summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2014-05-29 19:13:54 +0000
committerrandomdan <randomdan@localhost>2014-05-29 19:13:54 +0000
commit679af65d5f4ef4c6020a31f6114f5b0f4ddcd3dd (patch)
treef0911edf53485d7a6b8a79653534b2e78e512901
parentNo more setuid/setgid because it's not thread-safe, instead we handle permiss... (diff)
downloadnetfs-679af65d5f4ef4c6020a31f6114f5b0f4ddcd3dd.tar.bz2
netfs-679af65d5f4ef4c6020a31f6114f5b0f4ddcd3dd.tar.xz
netfs-679af65d5f4ef4c6020a31f6114f5b0f4ddcd3dd.zip
Test st_mode for the correct masks in ExecutableBy helper
-rw-r--r--netfs/daemon/ioHelpers.cpp8
1 files 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;
}