Previously, we'd report `non-owner access permitted', which was exactly
wrong.
This is a functionality check rather than a security check, so I'm not
completely convinced that this is something tmpdir(1) should be
checking. But it always has done so there's not much reason to stop
now.
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);