Commit Graph

11 Commits

Author SHA1 Message Date
Todd C. Miller
1afce22f7f Use PATH_MAX, not NAME_MAX+1 for the directory entry length.
On some systems, such as Solaris, the max length of a directory
entry is filesystem-dependent.  We could use fpathconf() and
dynamically allocate the name but it is simpler to just use
PATH_MAX here.
2022-01-12 15:30:39 -07:00
Todd C. Miller
1f098a2029 Use POSIX NAME_MAX, not the obsolete MAXNAMLEN define.
Fixes compilation with musl libc.
2022-01-12 10:25:44 -07:00
Todd C. Miller
c53192eb7e sudo_mkdir_parents: make sure the path we created is a directory
For extra paranoia, verify that the directory we created is still
a directory before we fchown() it.
2021-12-11 16:27:33 -07:00
Todd C. Miller
c13b21c199 Avoid TOCTOU in sudo_mkdir_parents() using openat(2) and mkdirat(2).
This also allows us to make path const as it should be.
2021-12-11 08:35:18 -07:00
Todd C. Miller
a7367ce47d Move cppcheck suppression annotation to where it needs to be. 2021-09-22 15:51:45 -06:00
Todd C. Miller
8ef5c4cf9d Set DEFAULT_TEXT_DOMAIN in lib/util's Makefile not individual .c files.
We no longer need to include sudo_gettext.h before sudo_compat.h
2020-05-18 11:19:58 -06:00
Todd C. Miller
446ae3f507 Include string.h unconditionally and only use strings.h for strn?casecmp()
In the pre-POSIX days BSD had strings.h, not string.h.
Now strings.h is only used for non-ANSI string functions.
2020-05-18 07:59:24 -06:00
Todd C. Miller
dd88460800 We no longer need to include headers we don't use for sudo*.h files.
Previously we needed to include headers required by the various
sudo*h files.  Now those files are more self-sufficient and we
should only include headers needed by code in the various .c files.
2020-05-18 06:47:04 -06:00
Todd C. Miller
486ee2b71f debug_decl and debug_decl_vars now require a semicolon at the end. 2019-12-22 08:48:16 -07:00
Todd C. Miller
6c6f0567ba Avoid TOCTOU in sudo_mkdir_parents; Coverity CID 204357 2019-10-24 20:04:32 -06:00
Todd C. Miller
e0c9a9dfa3 Move mkdir_parents to libsudo_util. 2019-10-24 20:04:31 -06:00