aboutsummaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
authorlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-07-16 18:58:18 +0000
committerlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-07-16 18:58:18 +0000
commit78b488891ec0ccc02f07c92ff68d25b904f82000 (patch)
tree0bb4b7846c18aba6f104fe32b0e256c48317fe31 /loginutils
parentfeebe4618da66c123a028ac91e715133afa21ec3 (diff)
downloadbusybox-w32-78b488891ec0ccc02f07c92ff68d25b904f82000.tar.gz
busybox-w32-78b488891ec0ccc02f07c92ff68d25b904f82000.tar.bz2
busybox-w32-78b488891ec0ccc02f07c92ff68d25b904f82000.zip
Bugfix from Tito to make sure /etc/group gets updated.
git-svn-id: svn://busybox.net/trunk/busybox@15705 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/adduser.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/loginutils/adduser.c b/loginutils/adduser.c
index a0d4872ec..a640ece3b 100644
--- a/loginutils/adduser.c
+++ b/loginutils/adduser.c
@@ -96,6 +96,7 @@ static void passwd_wrapper(const char *login)
96static int adduser(struct passwd *p, unsigned long flags) 96static int adduser(struct passwd *p, unsigned long flags)
97{ 97{
98 FILE *file; 98 FILE *file;
99 int addgroup = !p->pw_gid;
99 100
100 /* make sure everything is kosher and setup uid && gid */ 101 /* make sure everything is kosher and setup uid && gid */
101 file = bb_xfopen(bb_path_passwd_file, "a"); 102 file = bb_xfopen(bb_path_passwd_file, "a");
@@ -132,9 +133,8 @@ static int adduser(struct passwd *p, unsigned long flags)
132 /* add to group */ 133 /* add to group */
133 /* addgroup should be responsible for dealing w/ gshadow */ 134 /* addgroup should be responsible for dealing w/ gshadow */
134 /* if using a pre-existing group, don't create one */ 135 /* if using a pre-existing group, don't create one */
135 if (p->pw_gid == 0) { 136 if (addgroup) addgroup_wrapper(p);
136 addgroup_wrapper(p); 137
137 }
138 /* Clear the umask for this process so it doesn't 138 /* Clear the umask for this process so it doesn't
139 * * screw up the permissions on the mkdir and chown. */ 139 * * screw up the permissions on the mkdir and chown. */
140 umask(0); 140 umask(0);