summaryrefslogtreecommitdiff
path: root/libfshelp
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2009-08-23 19:21:47 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2009-08-23 19:21:47 +0200
commit8bbe158d77914520d2aa2e454eebeb0addfc63c1 (patch)
tree034456114fc0b07bbaa506fd417efb512803b708 /libfshelp
parent08aa7edb495445c0bfa54cb5d207e85c1df9008a (diff)
Fix root access to non-regular files
* libfshelp/perms-access.c (fshelp_access): Only check the x permission for root on regular files.
Diffstat (limited to 'libfshelp')
-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 fdca0b7b..67e52812 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 = (op != S_IEXEC) || (st->st_mode & (S_IXUSR | S_IXGRP | S_IXOTH));
+ gotit = (op != S_IEXEC) || !S_ISREG(st->st_mode) || (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))