aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Arapov <anton@redhat.com>2010-10-20 12:49:25 +0200
committerEric B Munson <emunson@mgebm.net>2010-10-20 10:49:33 -0500
commit78713ddcafb8498074be5f4f31ac424c296a7bbd (patch)
tree97defd0fefcbe876e8a60b61d87f4fc9a58eb054
parenta2c9635bafe8ee55bcaf06a705e1af28b340a081 (diff)
downloadlibhugetlbfs-78713ddcafb8498074be5f4f31ac424c296a7bbd.tar.gz
setup_helper: fix the crash where the user and group were the same.
Huge page setup script was unable to create hugepages user with the same group. Reported-by: CAI Qian <caiqian@redhat.com> Signed-off-by: Anton Arapov <anton@redhat.com> Signed-off-by: Eric B Munson <emunson@mgebm.net>
-rwxr-xr-xhuge_page_setup_helper.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/huge_page_setup_helper.py b/huge_page_setup_helper.py
index c4b3b16..32fbe19 100755
--- a/huge_page_setup_helper.py
+++ b/huge_page_setup_helper.py
@@ -220,7 +220,10 @@ for hugeUser in hugePageUserList:
if userExists == False:
print "Creating user %s with membership in huge page group" % hugeUser
if debug == False:
- os.popen("/usr/sbin/useradd %s -G %s" % (hugeUser, userGroupReq))
+ if hugeUser == userGroupReq:
+ os.popen("/usr/sbin/useradd %s -g %s" % (hugeUser, userGroupReq))
+ else:
+ os.popen("/usr/sbin/useradd %s -G %s" % (hugeUser, userGroupReq))
else:
print "/usr/sbin/useradd %s -G %s" % (hugeUser, userGroupReq)
print