chiark
/
gitweb
/
~mdw
/
checkpath
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tmpdir.c: Be more helpful if owner lacks permissions on the directory.
[checkpath]
/
tmpdir.c
diff --git
a/tmpdir.c
b/tmpdir.c
index bcebf8d067a2ca14037639512144cc8335dd8a9c..7b6fc64e111660b3fa1688324f92bbe801eef68c 100644
(file)
--- a/
tmpdir.c
+++ b/
tmpdir.c
@@
-122,8
+122,10
@@
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);
complain(p, "not a directory", 0);
else if (st.st_uid != me)
complain(p, "not owner", 0);
- else if (
(st.st_mode & 0777) != 0700
)
+ else if (
st.st_mode & 0077
)
complain(p, "non-owner access permitted", 0);
complain(p, "non-owner access permitted", 0);
+ else if (~st.st_mode & 0700)
+ complain(p, "owner lacks permissions", 0);
else
return (1);
return (0);
else
return (1);
return (0);