diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-04 10:16:52 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-04 10:16:52 +0000 |
commit | 74324c86663f57a19c1de303ee8c8e5449db9ef2 (patch) | |
tree | 11f5da9de4212875ce5811be2e1050e076378c9a /loginutils | |
parent | 4e5f82c76f08614d0b69f9ec4a8baac303af15f6 (diff) | |
download | busybox-w32-74324c86663f57a19c1de303ee8c8e5449db9ef2.tar.gz busybox-w32-74324c86663f57a19c1de303ee8c8e5449db9ef2.tar.bz2 busybox-w32-74324c86663f57a19c1de303ee8c8e5449db9ef2.zip |
Audit bb_common_bufsiz usage, add script which looks for misuse.
tr: stop using globals needlessly.
code: -103 bytes
Diffstat (limited to 'loginutils')
-rw-r--r-- | loginutils/adduser.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/loginutils/adduser.c b/loginutils/adduser.c index 82a4381ad..916a25b89 100644 --- a/loginutils/adduser.c +++ b/loginutils/adduser.c | |||
@@ -182,15 +182,14 @@ int adduser_main(int argc, char **argv) | |||
182 | /* check for min, max and missing args and exit on error */ | 182 | /* check for min, max and missing args and exit on error */ |
183 | opt_complementary = "-1:?1:?"; | 183 | opt_complementary = "-1:?1:?"; |
184 | getopt32(argc, argv, "h:g:s:G:DSH", &pw.pw_dir, &pw.pw_gecos, &pw.pw_shell, &usegroup); | 184 | getopt32(argc, argv, "h:g:s:G:DSH", &pw.pw_dir, &pw.pw_gecos, &pw.pw_shell, &usegroup); |
185 | argv += optind; | ||
185 | 186 | ||
186 | /* create string for $HOME if not specified already */ | 187 | /* create a passwd struct */ |
188 | pw.pw_name = argv[0]; | ||
187 | if (!pw.pw_dir) { | 189 | if (!pw.pw_dir) { |
188 | snprintf(bb_common_bufsiz1, BUFSIZ, "/home/%s", argv[optind]); | 190 | /* create string for $HOME if not specified already */ |
189 | pw.pw_dir = bb_common_bufsiz1; | 191 | pw.pw_dir = xasprintf("/home/%s", argv[0]); |
190 | } | 192 | } |
191 | |||
192 | /* create a passwd struct */ | ||
193 | pw.pw_name = argv[optind]; | ||
194 | pw.pw_passwd = (char *)"x"; | 193 | pw.pw_passwd = (char *)"x"; |
195 | pw.pw_uid = 0; | 194 | pw.pw_uid = 0; |
196 | pw.pw_gid = usegroup ? xgroup2gid(usegroup) : 0; /* exits on failure */ | 195 | pw.pw_gid = usegroup ? xgroup2gid(usegroup) : 0; /* exits on failure */ |