summaryrefslogtreecommitdiff
path: root/libfshelp/perms-access.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2008-07-14 22:38:13 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2008-07-14 22:38:13 +0000
commitb56d41ddda9708948274c269495c3d18ef71cc70 (patch)
tree44a65a302248b1437ccbb2a5b960bd176609e214 /libfshelp/perms-access.c
parent649e94342c315e898f3d01eccc899907f959587b (diff)
* perms-access.c (fshelp_access): If user->uids contain 0 and the op
is S_IEXEC, return 1 only if st_mode contains at least one executable bit.
Diffstat (limited to 'libfshelp/perms-access.c')
-rw-r--r--libfshelp/perms-access.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libfshelp/perms-access.c b/libfshelp/perms-access.c
index 91ad9da8..fdca0b7b 100644
--- a/libfshelp/perms-access.c
+++ b/libfshelp/perms-access.c
@@ -30,7 +30,7 @@ fshelp_access (struct stat *st, int op, struct iouser *user)
{
int gotit;
if (idvec_contains (user->uids, 0))
- gotit = 1;
+ gotit = (op != S_IEXEC) || (st->st_mode & (S_IXUSR | S_IXGRP | S_IXOTH));
else if (user->uids->num == 0 && (st->st_mode & S_IUSEUNK))
gotit = st->st_mode & (op << S_IUNKSHIFT);
else if (!fshelp_isowner (st, user))