From 679af65d5f4ef4c6020a31f6114f5b0f4ddcd3dd Mon Sep 17 00:00:00 2001 From: randomdan Date: Thu, 29 May 2014 19:13:54 +0000 Subject: Test st_mode for the correct masks in ExecutableBy helper --- netfs/daemon/ioHelpers.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/netfs/daemon/ioHelpers.cpp b/netfs/daemon/ioHelpers.cpp index 0bf873c..d06424b 100644 --- a/netfs/daemon/ioHelpers.cpp +++ b/netfs/daemon/ioHelpers.cpp @@ -20,10 +20,10 @@ bool WritableBy(const struct stat & s, uid_t u, gid_t g) bool ExecutableBy(const struct stat & s, uid_t u, gid_t g) { - if (u == 0 && (s.st_mode & (S_IWOTH | S_IWGRP | S_IWUSR))) return true; - if (s.st_mode & S_IWOTH) return true; - if (s.st_mode & S_IWGRP && s.st_gid == g) return true; - if (s.st_mode & S_IWUSR && s.st_uid == u) return true; + if (u == 0 && (s.st_mode & (S_IXOTH | S_IXGRP | S_IXUSR))) return true; + if (s.st_mode & S_IXOTH) return true; + if (s.st_mode & S_IXGRP && s.st_gid == g) return true; + if (s.st_mode & S_IXUSR && s.st_uid == u) return true; return false; } -- cgit v1.2.3