projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3109d1f
)
adduser: fix a bug of getpwnam() overwriting shell name, closes 8586
author
Denys Vlasenko
<vda.linux@googlemail.com>
Sat, 12 Jan 2019 10:51:58 +0000
(11:51 +0100)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Sat, 12 Jan 2019 10:51:58 +0000
(11:51 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
loginutils/adduser.c
patch
|
blob
|
history
diff --git
a/loginutils/adduser.c
b/loginutils/adduser.c
index b2b5be5b3c30b95e2a229e43121ab8f3875fe096..850c810c493ad871f536ebe4d2a4279fb0d85c6a 100644
(file)
--- a/
loginutils/adduser.c
+++ b/
loginutils/adduser.c
@@
-198,7
+198,7
@@
int adduser_main(int argc UNUSED_PARAM, char **argv)
pw.pw_gecos = (char *)"Linux User,,,";
/* We assume that newly created users "inherit" root's shell setting */
- pw.pw_shell =
(char *)get_shell_name();
+ pw.pw_shell =
xstrdup(get_shell_name()); /* might come from getpwnam(), need to make a copy */
pw.pw_dir = NULL;
opts = getopt32long(argv, "^"