Use sys/stat.h defines instead of bare octal values.

This commit is contained in:
Todd C. Miller
2016-11-07 13:36:05 -07:00
parent 2b020c9f17
commit 8133cdfdf6
12 changed files with 43 additions and 23 deletions

View File

@@ -192,7 +192,8 @@ ts_secure_dir(char *path, bool make_it, bool quiet)
ret = true;
break;
case SUDO_PATH_MISSING:
if (make_it && ts_mkdirs(path, timestamp_uid, 0700, 0711, quiet)) {
if (make_it && ts_mkdirs(path, timestamp_uid, S_IRWXU,
S_IRWXU|S_IXGRP|S_IXOTH, quiet)) {
ret = true;
break;
}
@@ -235,7 +236,7 @@ ts_open(const char *path, int flags)
if (timestamp_uid != 0)
uid_changed = set_perms(PERM_TIMESTAMP);
fd = open(path, flags, 0600);
fd = open(path, flags, S_IRUSR|S_IWUSR);
if (uid_changed && !restore_perms()) {
/* Unable to restore permissions, should not happen. */
if (fd != -1) {