blob: e1520cc3d6b310c209f6ff428792b152e5d2e295 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#!./perl
if (! -x '/usr/ucb/groups') {
print "1..0\n";
exit 0;
}
print "1..2\n";
$pwgid = $( + 0;
($pwgnam) = getgrgid($pwgid);
@basegroup{$pwgid,$pwgnam} = (1,1);
$seen{$pwgid}++;
for (split(' ', $()) {
next if $seen{$_}++;
($group) = getgrgid($_);
if (defined $group) {
push(@gr, $group);
}
else {
push(@gr, $_);
}
}
$gr1 = join(' ', sort @gr);
$gr2 = join(' ', grep(!$basegroup{$_}, sort split(' ',`/usr/ucb/groups`)));
if ($gr1 eq $gr2) {
print "ok 1\n";
}
else {
print "#gr1 is <$gr1>\n";
print "#gr2 is <$gr2>\n";
print "not ok 1\n";
}
# multiple 0's indicate GROUPSTYPE is currently long but should be short
if ($pwgid == 0 || $seen{0} < 2) {
print "ok 2\n";
}
else {
print "not ok 2 (groupstype should be type short, not long)\n";
}
|