aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2019-01-12 11:51:58 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2019-01-12 11:51:58 +0100
commitb67d900395a847e29f2afa81198f783004c80fc5 (patch)
tree49dbcb6ad199eaa5f61816fd11fca59627581acf
parent3109d1f9659ffad76f3cf2c547cc425ed34ae96c (diff)
downloadbusybox-w32-b67d900395a847e29f2afa81198f783004c80fc5.tar.gz
busybox-w32-b67d900395a847e29f2afa81198f783004c80fc5.tar.bz2
busybox-w32-b67d900395a847e29f2afa81198f783004c80fc5.zip
adduser: fix a bug of getpwnam() overwriting shell name, closes 8586
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--loginutils/adduser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/loginutils/adduser.c b/loginutils/adduser.c
index b2b5be5b3..850c810c4 100644
--- a/loginutils/adduser.c
+++ b/loginutils/adduser.c
@@ -198,7 +198,7 @@ int adduser_main(int argc UNUSED_PARAM, char **argv)
198 198
199 pw.pw_gecos = (char *)"Linux User,,,"; 199 pw.pw_gecos = (char *)"Linux User,,,";
200 /* We assume that newly created users "inherit" root's shell setting */ 200 /* We assume that newly created users "inherit" root's shell setting */
201 pw.pw_shell = (char *)get_shell_name(); 201 pw.pw_shell = xstrdup(get_shell_name()); /* might come from getpwnam(), need to make a copy */
202 pw.pw_dir = NULL; 202 pw.pw_dir = NULL;
203 203
204 opts = getopt32long(argv, "^" 204 opts = getopt32long(argv, "^"