summaryrefslogtreecommitdiff
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
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.
-rw-r--r--libfshelp/ChangeLog8
-rw-r--r--libfshelp/perms-access.c2
2 files changed, 8 insertions, 2 deletions
diff --git a/libfshelp/ChangeLog b/libfshelp/ChangeLog
index 28963041..a768a51d 100644
--- a/libfshelp/ChangeLog
+++ b/libfshelp/ChangeLog
@@ -1,4 +1,10 @@
-2008-06-27 Flávio Cruz <flaviocruz@gmail.com>
+2008-07-14 Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+ * 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.
+
+2008-06-27 Flávio Cruz <flaviocruz@gmail.com>
* perms-iscontroller.c (fshelp_iscontroller): Replace duplicate check
for st->ts_uid in user->uids by check for 0 in user->uids.
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))