chiark / gitweb /
* really: uidonly option doesn't crash. debian_version_3_99_1_0_9
authorianmdlvl <ianmdlvl>
Wed, 9 Jul 2003 18:10:17 +0000 (18:10 +0000)
committerianmdlvl <ianmdlvl>
Wed, 9 Jul 2003 18:10:17 +0000 (18:10 +0000)
  * really: -DREALLY_CHECK_GID compiles.

cprogs/really.c
debian/changelog

index cce79462e96bda4a33b8367f82c199eb2bb74be6..f4cfa08692a99821f9309680d719da7d48456c47 100644 (file)
@@ -48,6 +48,15 @@ static const char *opt_user, *opt_useronly;
 static int opt_groupsclear= 0, opt_ngids= 0, opt_uidonly= -1;
 static int opt_gids[512];
 
 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 void af_group(const struct cmdinfo *cip, const char *value) {
   struct group *gr;
 
@@ -76,7 +85,7 @@ static void af_help(const struct cmdinfo *cip, const char *value) {
 static const struct cmdinfo cmdinfos[]= {
   { "user",         'u',  1,  0, &opt_user,          0,           },
   { "useronly",     'i',  1,  0, &opt_useronly,      0            },
 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       },
   { "groupsclear",  'z',  0,  &opt_groupsclear, 0,   0,        1  },
   { "group",        'g',  1,  0, 0,                  af_group     },
   { "gid",          'G',  1,  0, 0,                  af_gid       },
@@ -94,7 +103,7 @@ static void checkroot(void) {
 #ifdef REALLY_CHECK_GID
 static void checkroot(void) {
   gid_t groups[512];
 #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); }
 
   r= getgid(); if (r==REALLY_CHECK_GID) return;
   if (r<0) { perror("getgid check"); exit(-1); }
index f5dc6c3e4d1f790cb40a9063b14fefcb33df01ef..5f436199d910dbe8b807fe7d80f4fd8a0e1162b5 100644 (file)
@@ -1,3 +1,10 @@
+chiark-utils (3.99.1.0.9) unstable; urgency=low
+
+  * really: uidonly option doesn't crash.
+  * really: -DREALLY_CHECK_GID compiles.
+
+ -- Ian Jackson <ian@davenant.greenend.org.uk>  Wed,  9 Jul 2003 19:09:48 +0100
+
 chiark-utils (3.99.1.0.8) unstable; urgency=low
 
   * Update to a sensible standards-version
 chiark-utils (3.99.1.0.8) unstable; urgency=low
 
   * Update to a sensible standards-version