mkdir & open not setting sticky bit

Nicholas Wilson nicholas at nicholaswilson.me.uk
Thu Mar 7 00:07:49 UTC 2013


Hello,

I'm guessing it's well known that BUGS in sticky(8) explains that BSD mkdir
doesn't set the sticky bit. I'd like to fix that, but the fact that it's
still there from historical BSD code suggests it's going to break something
to change it (or surely it would have been done already!). I can't find a
PR or any discussion over it though.

It would be good to fix it, because of all the seven unixes our company
supports, BSD's the only one with this quirk. Imagine if someone shipped a
product with a security bug because directories weren't being created with
the correct permissions? I might easily have done.

If I wrote a patch for it, would I be wasting my time? The only difficulty
I can imagine is changing semantics for existing applications, which seems
extremely unlikely to cause breakage for this call. umask is ignored so
doesn't complicate things; and POSIX & XSI explicitly allow both the
current behaviour, and that implemented on every other Unix.

Best,
Nicholas


More information about the freebsd-hackers mailing list