chiark / gitweb /
checkpath.c, tmpdir.c: Use symbolic names for permission masks.
[checkpath] / tmpdir.c
index 944cc18ea08169ea437cde34ef6b02d19322e30a..c561c1c1e609b379ba5874fbb6796d50dc881a05 100644 (file)
--- a/tmpdir.c
+++ b/tmpdir.c
@@ -122,9 +122,9 @@ static int ok(const char *p, int *f)
     complain(p, "not a directory", 0);
   else if (st.st_uid != me)
     complain(p, "not owner", 0);
-  else if (st.st_mode & 0077)
+  else if (st.st_mode & (S_IRWXG | S_IRWXO))
     complain(p, "non-owner access permitted", 0);
-  else if (~st.st_mode & 0700)
+  else if (~st.st_mode & S_IRWXU)
     complain(p, "owner lacks permissions", 0);
   else
     return (1);