From b56d41ddda9708948274c269495c3d18ef71cc70 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 14 Jul 2008 22:38:13 +0000 Subject: * 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. --- libfshelp/ChangeLog | 8 +++++++- libfshelp/perms-access.c | 2 +- 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 +2008-07-14 Samuel Thibault + + * 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 * 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)) -- cgit v1.2.3