#!./perl
BEGIN {
chdir 't' if -d 't';
print "1..0 # Skip: $1\n";
exit 0;
}
my $reason;
}
}
if (-x $ypcat &&
last;
}
}
}
if (-x $nidump &&
last;
}
}
}
}
}
if (-x $niscat &&
last;
}
}
}
exit 0;
}
}
# By now the PW filehandle should be open and full of juicy password entries.
print "1..2\n";
# Go through at most this many users.
# (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";
setpwent();
while (<PW>) {
# LIMIT -1 so that users with empty shells don't fall off
my @s = split /:/, $_, -1;
} else {
}
next if /^\+/; # ignore NIS includes
if (@s) {
} else {
next;
}
local $/;
last;
}
# In principle we could whine if @s != 7 but do we know enough
# of passwd file formats everywhere?
# 'nobody' et al.
next unless @n;
# Protect against one-to-many and many-to-one mappings.
}
# Do not compare passwords: think shadow passwords.
}
$n++;
}
$max++;
print <<EOEX;
#
# The failure of op/pwent test is not necessarily serious.
# It may fail due to local password administration conventions.
# If you are for example using both NIS and local passwords,
# test failure is possible. Any distributed password scheme
# can cause such failures.
#
# What the pwent test is doing is that it compares the $max first
# entries of $where
# with the results of getpwuid() and getpwnam() call. If it finds no
# matches at all, it suspects something is wrong.
#
EOEX
print "not ";
$not = 1;
} else {
$not = 0;
}
print "\n";
# Test both the scalar and list contexts.
my @pw1;
}
my @pw2;
}