[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gnulib] any objection to removing mode_compile's 2nd argument?

From: Paul Eggert
Subject: [bug-gnulib] any objection to removing mode_compile's 2nd argument?
Date: Sat, 23 Apr 2005 01:21:03 -0700

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]