- skip("No $chflags available", 2) if !-x $chflags;
-
- SKIP: {
- eval {
- if (!-e $tstfile) {
- open(T, ">$tstfile") or die "Can't create $tstfile: $!";
- close T;
- }
- system($chflags, "uchg", $tstfile);
- die "Can't exec $chflags uchg" if $? != 0;
- };
- skip("Errors in test using chflags: $@", 2) if $@;
-
- {
- use filetest 'access';
+ skip("No $chflags available", 4) if !-x $chflags;
+
+ my $skip_eff_user_tests = (!$Config{d_setreuid} && !$Config{d_setresuid})
+ ||
+ (!$Config{d_setregid} && !$Config{d_setresgid});
+
+ eval {
+ if (!-e $tstfile) {
+ open(T, ">$tstfile") or die "Can't create $tstfile: $!";
+ close T;
+ }
+ system($chflags, "uchg", $tstfile);
+ die "Can't exec $chflags uchg" if $? != 0;
+ };
+ skip("Errors in test using chflags: $@", 4) if $@;
+
+ {
+ use filetest 'access';
+ SKIP: {
+ skip("No tests on effective user id", 1)
+ if $skip_eff_user_tests;