I just fixed a coreutils bug that stemmed from its passing 0 as the
2nd argument to mode_compile, where it should have passed
MODE_MASK_ALL.  This bug causes "mkdir -m =+rwx dir" to create a
directory with mode rwxrwxrwx even though the directory's permission
should be governed by the umask.

This bug leads me to think that everybody who calls mode_compile
should be doing it with a 2nd argument equal to MODE_MASK_ALL, to
avoid similar security bugs.  And if this is the case, the 2nd
argument should be removed, and mode_compile should behave as if the
2nd argument was always set to MODE_MASK_ALL.  (We could also omit the
MODE_MASK_* macros from modechange.h.)

I see that tar uses mode_compile only with MODE_MASK_ALL, so that's
not a problem.

Does anybody else need mode_compile with some value other than
MODE_MASK_ALL?  If not, I'm inclined to change it in gnulib.


_______________________________________________
bug-gnulib mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gnulib

Reply via email to