5 @INC = "../lib" if -d "../lib";
6 eval { require Config; import Config; };
8 my $PW = "/etc/passwd";
10 if ($Config{'i_pwd'} ne 'define' or not -f $PW or not open(PW, $PW)) {
18 # Go through at most this many users.
31 my ($name_s, $passwd_s, $uid_s, $gid_s, $gcos_s, $home_s, $shell_s) = @s;
32 @n = getpwuid($uid_s);
35 my ($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$home,$shell) = @n;
36 # Protect against one-to-many and many-to-one mappings.
37 if ($name_s ne $name) {
38 @n = getpwnam($name_s);
39 ($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$home,$shell) = @n;
40 next if $name_s ne $name;
43 if $name ne $name_s or
44 # Shadow passwords confuse this.
45 # Think about non-crypt(3) encryptions, too, before you do anything rash.
46 # $passwd ne $passwd_s or
57 print "ok ", $tst++, "\n";