18 $id =~ s/^uid=// or return $id =~ m/\n/ ? "ERROR: $`" : "ERROR: $id";
19 $id =~ s/^(\d+)// or return $orgid;
21 $id =~ s/^\([^\)]+\)//; $id =~ s/^\s+// or return $orgid;
22 $id =~ s/^gid=(\d+)// or return $orgid;
24 $id =~ s/^\([^\)]+\)//; $id =~ s/^\s+// or return $orgid;
25 $id =~ s/^groups=// or return $orgid;
26 for $part (split(/,/,$id)) {
27 $part =~ s/^(\d+)// or return $orgid;
29 $part =~ s/^\([^\)]+\)//; $part eq '' or return $orgid;
35 $org =~ m/^uid=\d+\(([^\)]+)\) gid=\d+\(([^\)]+)\) / or die "$org ?";
36 $orguser= $1; $orggroup= $2;
38 $org =~ m/^\d+ \d+ / or die $org;
39 ($orguid,$orggid,@orgxgids)= split(/ /,$org);
43 $testuid $testgid @testxgids
46 ERROR: -z|--groupsclear must be accompanied by some groups
48 -u $testuser -g $othergroup
49 $testuid $othergid @testxgids $othergid
51 -u $testuser -z -g $othergroup
52 ERROR: -u|--user may not be used with -z|--groupsclear
54 -u $testuser -G $numgid -g $othergroup
55 $testuid $numgid @testxgids $numgid $othergid
57 -u $testuser -z -G $numgid -g $othergroup
58 ERROR: -u|--user may not be used with -z|--groupsclear
60 -u $testuser -g $testgroup -G $testgid
61 $testuid $testgid @testxgids
63 -u $testuser -z -g $testgroup -G $testgid
64 ERROR: -u|--user may not be used with -z|--groupsclear
66 -u $testuser -g $othergroup -g $testgroup -G $testgid
67 $testuid $othergid @testxgids $othergid
69 -u $testuser -z -g $othergroup -g $testgroup -G $testgid
70 ERROR: -u|--user may not be used with -z|--groupsclear
72 -u $testuser -G $numgid -g $othergroup -g $testgroup -G $testgid
73 $testuid $numgid @testxgids $numgid $othergid
75 -u $testuser -z -G $numgid -g $othergroup -g $testgroup -G $testgid
76 ERROR: -u|--user may not be used with -z|--groupsclear
82 $testuid $orggid @orgxgids
85 ERROR: -z|--groupsclear must be accompanied by some groups
87 -i $testuser -g $othergroup
88 $testuid $othergid @orgxgids $othergid
90 -i $testuser -z -g $othergroup
91 $testuid $othergid $othergid
93 -i $testuser -G $numgid -g $othergroup
94 $testuid $numgid @orgxgids $numgid $othergid
96 -i $testuser -z -G $numgid -g $othergroup
97 $testuid $numgid $numgid $othergid
99 -i $testuser -g $orggroup -G $orggid
100 $testuid $orggid @orgxgids
102 -i $testuser -z -g $orggroup -G $orggid
103 $testuid $orggid $orggid
105 -i $testuser -g $othergroup -g $orggroup -G $orggid
106 $testuid $othergid @orgxgids $othergid
108 -i $testuser -z -g $othergroup -g $orggroup -G $orggid
109 $testuid $othergid $othergid $orggid
111 -i $testuser -G $numgid -g $othergroup -g $orggroup -G $orggid
112 $testuid $numgid @orgxgids $numgid $othergid
114 -i $testuser -z -G $numgid -g $othergroup -g $orggroup -G $orggid
115 $testuid $numgid $numgid $othergid $orggid
121 ERROR: -z|--groupsclear must be accompanied by some groups
124 $orguid $othergid @orgxgids $othergid
127 $orguid $othergid $othergid
129 -G $numgid -g $othergroup
130 $orguid $numgid @orgxgids $numgid $othergid
132 -z -G $numgid -g $othergroup
133 $orguid $numgid $numgid $othergid
135 -g $orggroup -G $orggid
136 $orguid $orggid @orgxgids
138 -z -g $orggroup -G $orggid
139 $orguid $orggid $orggid
141 -g $othergroup -g $orggroup -G $orggid
142 $orguid $othergid @orgxgids $othergid
144 -z -g $othergroup -g $orggroup -G $orggid
145 $orguid $othergid $othergid $orggid
147 -G $numgid -g $othergroup -g $orggroup -G $orggid
148 $orguid $numgid @orgxgids $numgid $othergid
150 -z -G $numgid -g $othergroup -g $orggroup -G $orggid
151 $orguid $numgid $numgid $othergid $orggid
154 ERROR: sorry: Permission denied
155 ./really-test -u $testuser -g staff
158 @tests= split(/\n/,$tests);
159 for ($i=0; $i<$#tests; $i+=3) {
160 $out= `$tests[$i+2] ./really-test $tests[$i] id 2>&1`;
161 $newout= parseid($out);
162 print("OK $tests[$i] ($tests[$i+2])\n"), next if $newout eq $tests[$i+1];
163 die "$newout != $tests[$i+1] ($tests[$i]) $i";