Avoid TOCTOU in sudo_mkdir_parents() using openat(2) and mkdirat(2).
This also allows us to make path const as it should be.
This commit is contained in:
@@ -185,7 +185,7 @@ ts_find_record(int fd, struct timestamp_entry *key, struct timestamp_entry *entr
|
||||
* Returns false on failure and displays a warning to stderr.
|
||||
*/
|
||||
static bool
|
||||
ts_mkdirs(char *path, uid_t owner, gid_t group, mode_t mode,
|
||||
ts_mkdirs(const char *path, uid_t owner, gid_t group, mode_t mode,
|
||||
mode_t parent_mode, bool quiet)
|
||||
{
|
||||
bool ret;
|
||||
|
Reference in New Issue
Block a user