summaryrefslogtreecommitdiff
path: root/doio.c
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 /doio.c
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 'doio.c')
-rw-r--r--doio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/doio.c b/doio.c
index 168c10e4ed..87f2da087d 100644
--- a/doio.c
+++ b/doio.c
@@ -1918,7 +1918,11 @@ Perl_cando(pTHX_ Mode_t mode, bool effective, register const Stat_t *statbufp)
return (mode & statbufp->st_mode) ? TRUE : FALSE;
#else /* ! DOSISH */
+# ifdef __CYGWIN__
+ if (ingroup(544,effective)) { /* member of Administrators */
+# else
if ((effective ? PL_euid : PL_uid) == 0) { /* root is special */
+# endif
if (mode == S_IXUSR) {
if (statbufp->st_mode & 0111 || S_ISDIR(statbufp->st_mode))
return TRUE;