sbase/libutil
Michael Forney 529e50a7ad mkdir: Fix created directory permissions
Previously, with -p, the specified directory and all of its parents
would be 0777&~filemask (regardless of the -m flag). POSIX says parent
directories must created as (0300|~filemask)&0777, and of course if -m
is set, the specified directory should be created with those
permissions.

Additionally, POSIX says that for symbolic_mode strings, + and - should
be interpretted relative to a default mode of 0777 (not 0).

Without -p, previously the directory would be created first with
0777&~filemask (before a chmod), but POSIX says that the directory shall
at no point in time have permissions less restrictive than the -m mode
argument.

Rather than dealing with mkdir removing the filemask bits by calling
chmod afterward, just clear the umask and remove the bits manually.
2017-07-03 21:03:11 +02:00
..
concat.c Add *fshut() functions to properly flush file streams 2015-04-05 09:13:56 +01:00
cp.c libutil: fix leaks 2017-05-07 13:50:26 +02:00
crypt.c crypt: Add some missing error checks for cryptsum 2016-12-27 14:02:32 +01:00
ealloc.c add estrndup 2015-02-11 01:17:21 +00:00
enmasse.c Revert "enmasse: For the special case of 2 args, do not distinguish between dirs and files" 2015-11-13 14:31:34 +00:00
eprintf.c Check argv0 in xvprintf() 2015-12-21 14:13:36 +00:00
eregcomp.c code-style: whitespace fixes 2015-09-30 19:44:10 +01:00
estrtod.c Rename util/ to libutil/ 2014-11-17 16:48:34 +00:00
fnck.c Refactor enmasse() and recurse() to reflect depth 2015-03-02 22:50:38 +01:00
fshut.c Fix typo in libutil/fshut.c 2015-10-26 16:53:28 +00:00
getlines.c Properly increment line lenght on edge-case in getlines() 2016-03-10 08:48:09 +00:00
human.c Use off_t in humansize() as it is more descriptive and applicable 2015-04-29 16:42:49 +01:00
linecmp.c linecmp: Handle NUL bytes properly 2016-07-09 10:09:50 +01:00
md5.c Rename util/ to libutil/ 2014-11-17 16:48:34 +00:00
memmem.c Support NUL-containing lines in sort(1) 2016-03-10 08:48:09 +00:00
mkdirp.c mkdir: Fix created directory permissions 2017-07-03 21:03:11 +02:00
mode.c parsemode: No need to return after eprintf 2016-12-27 13:33:35 +01:00
parseoffset.c Use SSIZE_MAX for overflow check in parseoffset() 2015-11-26 10:35:46 +00:00
putword.c Actually print <space> to stream in putword() too 2015-04-21 18:00:47 +01:00
reallocarray.c Implement mallocarray() 2015-03-10 22:19:19 +01:00
recurse.c Add SILENT flag to recurse() 2015-04-20 11:12:40 +01:00
rm.c Remove st != NULL checks from recursor functions 2017-07-03 21:03:02 +02:00
sha1.c Rename util/ to libutil/ 2014-11-17 16:48:34 +00:00
sha224.c add sha224sum and sha384sum 2016-02-24 10:15:16 +00:00
sha256.c add sha224sum and sha384sum 2016-02-24 10:15:16 +00:00
sha384.c add sha224sum and sha384sum 2016-02-24 10:15:16 +00:00
sha512-224.c add sha512-224sum (SHA512/224) and sha512-256sum (SHA512/256) 2016-02-24 10:40:57 +00:00
sha512-256.c add sha512-224sum (SHA512/224) and sha512-256sum (SHA512/256) 2016-02-24 10:40:57 +00:00
sha512.c add sha224sum and sha384sum 2016-02-24 10:15:16 +00:00
strcasestr.c code-style: whitespace fixes 2015-09-30 19:44:10 +01:00
strlcat.c Add estrlcat() and estrlcpy() 2015-03-17 11:24:49 +01:00
strlcpy.c Add estrlcat() and estrlcpy() 2015-03-17 11:24:49 +01:00
strsep.c Import strsep() from musl libc 2015-01-25 17:48:11 +00:00
strtonum.c Use strtonum and libutf in test(1), refactor code and manpage 2015-02-09 22:21:23 +01:00
unescape.c libutil/unescape: NULL terminate unescaped string 2017-03-24 10:40:32 +01:00