]> granicus.if.org Git - sudo/commitdiff
We want to inherit the gid from the parent directory when not setting
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 30 Oct 2016 12:36:55 +0000 (06:36 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 30 Oct 2016 12:36:55 +0000 (06:36 -0600)
permissions on intermerdiate directories.

plugins/sudoers/iolog.c

index 5ca346ab06fc744eee7d11674a0dc2f242a596b8..0eb7fe0279c25bb67b39bbfe3d1fb903a81ca4e8 100644 (file)
@@ -106,7 +106,7 @@ io_mkdirs(char *path, uid_t uid, gid_t *gidp, mode_t mode, bool set_intermediate
     if (!set_intermediate) {
        parent_mode = S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH;
        parent_uid = ROOT_UID;
-       parent_gid = 0;
+       parent_gid = (gid_t)-1;
     } else {
        parent_mode = mode;
        parent_uid = uid;
@@ -150,7 +150,7 @@ io_mkdtemp(char *path, uid_t uid, gid_t *gidp, mode_t mode, bool set_intermediat
     if (!set_intermediate) {
        parent_mode = S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH;
        parent_uid = ROOT_UID;
-       parent_gid = 0;
+       parent_gid = (gid_t)-1;
     } else {
        parent_mode = mode;
        parent_uid = uid;