static int opt_groupsclear= 0, opt_ngids= 0, opt_uidonly= -1;
static int opt_gids[512];
+static void af_uidonly(const struct cmdinfo *cip, const char *value) {
+ unsigned long ul;
+ char *ep;
+
+ ul= strtoul(value,&ep,10);
+ if (*ep) { fprintf(stderr,"bad uid `%s'\n",value); exit(-1); }
+ opt_uidonly= ul;
+}
+
static void af_group(const struct cmdinfo *cip, const char *value) {
struct group *gr;
static const struct cmdinfo cmdinfos[]= {
{ "user", 'u', 1, 0, &opt_user, 0, },
{ "useronly", 'i', 1, 0, &opt_useronly, 0 },
- { "uidonly", 'I', 1, &opt_uidonly, 0, 0 },
+ { "uidonly", 'I', 1, 0, 0, af_uidonly },
{ "groupsclear", 'z', 0, &opt_groupsclear, 0, 0, 1 },
{ "group", 'g', 1, 0, 0, af_group },
{ "gid", 'G', 1, 0, 0, af_gid },
#ifdef REALLY_CHECK_GID
static void checkroot(void) {
gid_t groups[512];
- int r;
+ int r, i;
r= getgid(); if (r==REALLY_CHECK_GID) return;
if (r<0) { perror("getgid check"); exit(-1); }