summaryrefslogtreecommitdiff
path: root/loginutils/addgroup.c
diff options
context:
space:
mode:
authorDenis Vlasenko2008-03-19 23:15:26 +0000
committerDenis Vlasenko2008-03-19 23:15:26 +0000
commita7d6c8bab919e1a537f8b7db7b8676484e60f550 (patch)
treefd5d442775f7551b76d22563816d30b4fc6a6029 /loginutils/addgroup.c
parentcf7cf622046b0e1a2817e1da4aa8bc6f513b0153 (diff)
downloadbusybox-a7d6c8bab919e1a537f8b7db7b8676484e60f550.zip
busybox-a7d6c8bab919e1a537f8b7db7b8676484e60f550.tar.gz
adduser/addgroup: check username for invalid chars
(by Tito <farmatito AT tiscali.it>). +129 bytes when enabled.
Diffstat (limited to 'loginutils/addgroup.c')
-rw-r--r--loginutils/addgroup.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/loginutils/addgroup.c b/loginutils/addgroup.c
index b25f817..367c6b9 100644
--- a/loginutils/addgroup.c
+++ b/loginutils/addgroup.c
@@ -173,8 +173,11 @@ int addgroup_main(int argc ATTRIBUTE_UNUSED, char **argv)
#endif
} else
#endif /* ENABLE_FEATURE_ADDUSER_TO_GROUP */
+ {
+ die_if_bad_username(argv[0]);
new_group(argv[0], gid);
+ }
/* Reached only on success */
return EXIT_SUCCESS;
}