diff options
author | randomdan <randomdan@localhost> | 2014-05-29 19:13:54 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2014-05-29 19:13:54 +0000 |
commit | 679af65d5f4ef4c6020a31f6114f5b0f4ddcd3dd (patch) | |
tree | f0911edf53485d7a6b8a79653534b2e78e512901 | |
parent | No more setuid/setgid because it's not thread-safe, instead we handle permiss... (diff) | |
download | netfs-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.cpp | 8 |
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; } |