summaryrefslogtreecommitdiff
path: root/loginutils/adduser.c
diff options
context:
space:
mode:
authorDenys Vlasenko2013-12-20 20:45:02 +0100
committerDenys Vlasenko2013-12-20 20:45:02 +0100
commite83e1c50f20f01fbb10cf65532a966f7f63a6b6d (patch)
tree4501ffe8485dd7c0211cb28bfa3462db88670714 /loginutils/adduser.c
parente85e260e4720cd8f652c19b4df3e6901c02b9169 (diff)
downloadbusybox-e83e1c50f20f01fbb10cf65532a966f7f63a6b6d.zip
busybox-e83e1c50f20f01fbb10cf65532a966f7f63a6b6d.tar.gz
adduser: check whether run with no USERNAME. Closes 6728
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'loginutils/adduser.c')
-rw-r--r--loginutils/adduser.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/loginutils/adduser.c b/loginutils/adduser.c
index dc02444..ef390ad 100644
--- a/loginutils/adduser.c
+++ b/loginutils/adduser.c
@@ -162,9 +162,9 @@ int adduser_main(int argc UNUSED_PARAM, char **argv)
pw.pw_shell = (char *)get_shell_name();
pw.pw_dir = NULL;
- /* at most two non-option args */
+ /* at least one and at most two non-option args */
/* disable interactive passwd for system accounts */
- opt_complementary = "?2:SD:u+";
+ opt_complementary = "-1:?2:SD:u+";
if (sizeof(pw.pw_uid) == sizeof(int)) {
opts = getopt32(argv, "h:g:s:G:DSHu:", &pw.pw_dir, &pw.pw_gecos, &pw.pw_shell, &usegroup, &pw.pw_uid);
} else {