summaryrefslogtreecommitdiff
path: root/t/op/stat.t
diff options
context:
space:
mode:
authorReini Urban <rurban@x-ray.at>2010-01-11 20:24:32 +0000
committerH.Merijn Brand <h.m.brand@xs4all.nl>2010-01-14 12:55:20 +0100
commitb595cd4b73a6e1bd45865d6446c34d4019c740d1 (patch)
treedd401c3dd17b6f35a5f8d8889b3248dee4106fe1 /t/op/stat.t
parent91152fc19d1c59a1213e39f74ac8a80f4a015f5e (diff)
downloadperl-b595cd4b73a6e1bd45865d6446c34d4019c740d1.tar.gz
CYG23-544-stat
Stable cygwin patch for root filetests (gid 0 root <= gid 544 Administrators). On cygwin check for the Administrators group (544) which has root rights regarding -r filetests. Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl>
Diffstat (limited to 't/op/stat.t')
-rw-r--r--t/op/stat.t11
1 files changed, 8 insertions, 3 deletions
diff --git a/t/op/stat.t b/t/op/stat.t
index 5167655db1..bc05112f2f 100644
--- a/t/op/stat.t
+++ b/t/op/stat.t
@@ -27,10 +27,15 @@ $Is_DGUX = $^O eq 'dgux';
$Is_MPRAS = $^O =~ /svr4/ && -f '/etc/.relid';
$Is_Rhapsody= $^O eq 'rhapsody';
-$Is_Dosish = $Is_Dos || $Is_OS2 || $Is_MSWin32 || $Is_NetWare || $Is_Cygwin;
+$Is_Dosish = $Is_Dos || $Is_OS2 || $Is_MSWin32 || $Is_NetWare;
$Is_UFS = $Is_Darwin && (() = `df -t ufs . 2>/dev/null`) == 2;
+if ($Is_Cygwin) {
+ require Win32;
+ Win32->import;
+}
+
my($DEV, $INO, $MODE, $NLINK, $UID, $GID, $RDEV, $SIZE,
$ATIME, $MTIME, $CTIME, $BLKSIZE, $BLOCKS) = (0..12);
@@ -163,10 +168,10 @@ SKIP: {
my $olduid = $>;
eval { $> = 1; };
skip "Can't test -r or -w meaningfully if you're superuser", 2
- if $> == 0;
+ if ($Is_Cygwin ? Win32::IsAdminUser : $> == 0);
SKIP: {
- skip "Can't test -r meaningfully?", 1 if $Is_Dos || $Is_Cygwin;
+ skip "Can't test -r meaningfully?", 1 if $Is_Dos;
ok(!-r $tmpfile, " -r");
}