summaryrefslogtreecommitdiff
path: root/loginutils/addgroup.c
diff options
context:
space:
mode:
authorGlenn L McGrath2004-09-14 16:08:02 +0000
committerGlenn L McGrath2004-09-14 16:08:02 +0000
commitd2bd7d8dd5e277e7852c76003aeea592399e164b (patch)
tree1d3904a691ced8309f39e4638c1efb826778c42d /loginutils/addgroup.c
parente11db0ed3502506adf43ce0985288af976dd3ba2 (diff)
downloadbusybox-d2bd7d8dd5e277e7852c76003aeea592399e164b.zip
busybox-d2bd7d8dd5e277e7852c76003aeea592399e164b.tar.gz
Patch from tito to add argument checking.
Diffstat (limited to 'loginutils/addgroup.c')
-rw-r--r--loginutils/addgroup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/loginutils/addgroup.c b/loginutils/addgroup.c
index cfbd716..804d696 100644
--- a/loginutils/addgroup.c
+++ b/loginutils/addgroup.c
@@ -148,7 +148,7 @@ int addgroup_main(int argc, char **argv)
/* get remaining args */
if(bb_getopt_ulflags(argc, argv, "g:", &group)) {
- gid = strtol(group, NULL, 10);
+ gid = bb_xgetlarg(group, 10, 0, LONG_MAX);
}
if (optind < argc) {
@@ -160,10 +160,10 @@ int addgroup_main(int argc, char **argv)
if (optind < argc) {
user = argv[optind];
- optind++;
} else {
user = "";
}
+
if_i_am_not_root();
/* werk */