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