X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/checkpath/blobdiff_plain/7b5e7899240bb934fa8ee9844ebdadca0a097add..995186ff19a5a2388b5de61928d62bb68e618612:/tmpdir.c?ds=inline diff --git a/tmpdir.c b/tmpdir.c index bcebf8d..7b6fc64 100644 --- 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); - else if ((st.st_mode & 0777) != 0700) + else if (st.st_mode & 0077) complain(p, "non-owner access permitted", 0); + else if (~st.st_mode & 0700) + complain(p, "owner lacks permissions", 0); else return (1); return (0);