diff options
author | Denys Vlasenko | 2009-05-14 00:23:34 +0200 |
---|---|---|
committer | Denys Vlasenko | 2009-05-14 00:23:34 +0200 |
commit | 1b0a93edb93a93c30d7fbb35571f109ddf8a67a2 (patch) | |
tree | 73326fed28844ea23c13d4bbfe7abdd7b64bd270 /loginutils/addgroup.c | |
parent | 810b7161dcace56709038bf0cad93c925669c3b8 (diff) | |
download | busybox-1b0a93edb93a93c30d7fbb35571f109ddf8a67a2.zip busybox-1b0a93edb93a93c30d7fbb35571f109ddf8a67a2.tar.gz |
adduser/addgroup: make system id range configurable.
By Tito (farmatito AT tiscali.it).
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'loginutils/addgroup.c')
-rw-r--r-- | loginutils/addgroup.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/loginutils/addgroup.c b/loginutils/addgroup.c index cb83929..dc60788 100644 --- a/loginutils/addgroup.c +++ b/loginutils/addgroup.c @@ -11,6 +11,10 @@ */ #include "libbb.h" +#if CONFIG_LAST_SYSTEM_ID < CONFIG_FIRST_SYSTEM_ID +#error Bad LAST_SYSTEM_ID or FIRST_SYSTEM_ID in .config +#endif + #define OPT_GID (1 << 0) #define OPT_SYSTEM_ACCOUNT (1 << 1) @@ -30,11 +34,11 @@ static void xgroup_study(struct group *g) /* gid values is set to [0, INT_MAX] */ if (!(option_mask32 & OPT_GID)) { if (option_mask32 & OPT_SYSTEM_ACCOUNT) { - g->gr_gid = 100; /* FIRST_SYSTEM_GID */ - max = 999; /* LAST_SYSTEM_GID */ + g->gr_gid = CONFIG_FIRST_SYSTEM_ID; + max = CONFIG_LAST_SYSTEM_ID; } else { - g->gr_gid = 1000; /* FIRST_GID */ - max = 64999; /* LAST_GID */ + g->gr_gid = CONFIG_LAST_SYSTEM_ID + 1; + max = 64999; } } /* Check if the desired gid is free |