t/op/glob.t See if <*> works
t/op/goto.t See if goto works
t/op/goto_xs.t See if "goto &sub" works on XSUBs
+t/op/grent.t See if getgr*() functions work
t/op/groups.t See if $( works
t/op/gv.t See if typeglobs work
t/op/hashwarn.t See if warnings for bad hash assignments work
t/op/pat.t See if esoteric patterns work
t/op/pos.t See if pos works
t/op/push.t See if push and pop work
+t/op/pwent.t See if getpw*() functions work
t/op/quotemeta.t See if quotemeta works
t/op/rand.t See if rand works
t/op/range.t See if .. works
--- /dev/null
+#!./perl
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = "../lib" if -d "../lib";
+ eval { require Config; import Config; };
+
+ my $GR = "/etc/group";
+
+ if ($Config{'i_grp'} ne 'define' or not -f $GR or not open(GR, $GR)) {
+ print "1..0\n";
+ exit 0;
+ }
+}
+
+print "1..1\n";
+
+# Go through at most this many groups.
+my $max = 25; #
+
+my $n = 0;
+my $not;
+my $tst = 1;
+
+$not = 0;
+while (<GR>) {
+ last if $n == $max;
+ chomp;
+ @s = split /:/;
+ if (@s == 4) {
+ my ($name_s,$passwd_s,$gid_s,$members_s) = @s;
+ @n = getgrgid($gid_s);
+ # 'nogroup' et al.
+ next unless @n;
+ my ($name,$passwd,$gid,$members) = @n;
+ # Protect against one-to-many and many-to-one mappings.
+ if ($name_s ne $name) {
+ @n = getgrnam($name_s);
+ ($name,$passwd,$gid,$members) = @n;
+ next if $name_s ne $name;
+ }
+ $members =~ s/ /,/g;
+ $not = 1, last
+ if $name ne $name_s or
+# Shadow passwords confuse this.
+# $passwd ne $passwd_s or
+ $gid ne $gid_s or
+ $members ne $members_s;
+ }
+ $n++;
+}
+
+print "not " if $not;
+print "ok ", $tst++, "\n";
+
+close(GR);
--- /dev/null
+#!./perl
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = "../lib" if -d "../lib";
+ eval { require Config; import Config; };
+
+ my $PW = "/etc/passwd";
+
+ if ($Config{'i_pwd'} ne 'define' or not -f $PW or not open(PW, $PW)) {
+ print "1..0\n";
+ exit 0;
+ }
+}
+
+print "1..1\n";
+
+# Go through at most this many users.
+my $max = 25; #
+
+my $n = 0;
+my $not;
+my $tst = 1;
+
+$not = 0;
+while (<PW>) {
+ last if $n == $max;
+ chomp;
+ @s = split /:/;
+ if (@s == 7) {
+ my ($name_s, $passwd_s, $uid_s, $gid_s, $gcos_s, $home_s, $shell_s) = @s;
+ @n = getpwuid($uid_s);
+ # 'nobody' et al.
+ next unless @n;
+ my ($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$home,$shell) = @n;
+ # Protect against one-to-many and many-to-one mappings.
+ if ($name_s ne $name) {
+ @n = getpwnam($name_s);
+ ($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$home,$shell) = @n;
+ next if $name_s ne $name;
+ }
+ $not = 1, last
+ if $name ne $name_s or
+# Shadow passwords confuse this.
+# Think about non-crypt(3) encryptions, too, before you do anything rash.
+# $passwd ne $passwd_s or
+ $uid ne $uid_s or
+ $gid ne $gid_s or
+ $gcos ne $gcos_s or
+ $home ne $home_s or
+ $shell ne $shell_s;
+ }
+ $n++;
+}
+
+print "not " if $not;
+print "ok ", $tst++, "\n";
+
+close(PW);