if (stat(def_iolog_dir, &sb) != 0) {
if (mkdir(def_iolog_dir, S_IRWXU) != 0)
log_fatal(USE_ERRNO, "Can't mkdir %s", def_iolog_dir);
+ (void) chown(def_iolog_dir, (uid_t)-1, ROOT_GID);
} else if (!S_ISDIR(sb.st_mode)) {
log_fatal(0, "%s exists but is not a directory (0%o)",
def_iolog_dir, (unsigned int) sb.st_mode);
if (stat(pathbuf, &sb) != 0) {
if (mkdir(pathbuf, S_IRWXU) != 0)
log_fatal(USE_ERRNO, "Can't mkdir %s", pathbuf);
+ (void) chown(pathbuf, (uid_t)-1, ROOT_GID);
} else if (!S_ISDIR(sb.st_mode)) {
log_fatal(0, "%s: %s", pathbuf, strerror(ENOTDIR));
}
if (mkdir(pathbuf, S_IRUSR|S_IWUSR|S_IXUSR) != 0)
log_fatal(USE_ERRNO, "Can't mkdir %s", pathbuf);
+ (void) chown(pathbuf, (uid_t)-1, ROOT_GID);
/*
* We create 7 files: a log file, a timing file and 5 for input/output.
#define user_role (sudo_user.role)
#define user_type (sudo_user.type)
+#ifdef __TANDEM
+# define ROOT_UID 65535
+#else
+# define ROOT_UID 0
+#endif
+#define ROOT_GID 0
+
/*
* We used to use the system definition of PASS_MAX or _PASSWD_LEN,
* but that caused problems with various alternate authentication