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/perms-access.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libfshelp/perms-access.c') 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