diff options
-rw-r--r-- | share/txr/stdlib/path-test.tl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/share/txr/stdlib/path-test.tl b/share/txr/stdlib/path-test.tl index 851ac61b..cb2a1c48 100644 --- a/share/txr/stdlib/path-test.tl +++ b/share/txr/stdlib/path-test.tl @@ -77,12 +77,13 @@ (or (= g (getegid)) (find g (getgroups)))))) +;; umask, gmask and omask must test identical permissions (defun sys:path-access (path umask gmask omask) (sys:path-test (s stat path) (let ((m s.mode) (euid (geteuid))) (cond - ((zerop euid) (or (zerop (logior umask s-ixusr)) + ((zerop euid) (or (zerop (logand umask s-ixusr)) (plusp (logand m (logior umask gmask omask))))) ((= euid s.uid) (plusp (logand m umask))) ((let ((g s.gid)) |