#!./perl
BEGIN {
chdir 't' if -d 't';
}
eval {my @n = getgrgid 0};
}
my $reason;
}
}
if (-x $ypcat &&
{
# Check to make sure we're really using NIS.
# If there's no group line, assume it default to compat.
print "# Doesn't look like you're using NIS in ".
last;
}
}
last;
}
}
}
if (-x $nidump &&
{
last;
}
}
}
}
}
if ($reason) {
}
# By now the GR filehandle should be open and full of juicy group entries.
# Go through at most this many groups.
# (note that the first entry has been read away by now)
my $max = 25;
my $n = 0;
my $tst = 1;
my %perfect;
my %seen;
print "# where $where\n";
while (<GR>) {
# LIMIT -1 so that groups with no users don't fall off
my @s = split /:/, $_, -1;
if (@s) {
} else {
next;
}
local $/;
last;
}
# In principle we could whine if @s != 4 but do we know enough
# of group file formats everywhere?
if (@s == 4) {
$members_s =~ s/\s*,\s*/,/g;
$members_s =~ s/\s+$//;
$members_s =~ s/^\s+//;
# 'nogroup' et al.
next unless @n;
# Protect against one-to-many and many-to-one mappings.
}
# NOTE: group names *CAN* contain whitespace.
$members =~ s/\s+/,/g;
# what about different orders of members?
# Do not compare passwords: think shadow passwords.
# Not that group passwords are used much but better not assume anything.
}
$n++;
}
$max++;
print <<EOEX;
#
# The failure of op/grent test is not necessarily serious.
# It may fail due to local group administration conventions.
# If you are for example using both NIS and local groups,
# test failure is possible. Any distributed group scheme
# can cause such failures.
#
# What the grent test is doing is that it compares the $max first
# entries of $where
# with the results of getgrgid() and getgrnam() call. If it finds no
# matches at all, it suspects something is wrong.
#
EOEX
} else {
}
# Test both the scalar and list contexts.
my @gr1;
}
my @gr2;
}