]> granicus.if.org Git - sudo/commitdiff
Open sudoers for writing with mode SUDOERS_MODE
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 15 Dec 2000 03:57:53 +0000 (03:57 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 15 Dec 2000 03:57:53 +0000 (03:57 +0000)
From Dimitry Andric <dim@xs4all.nl>

visudo.c

index 3d88995aa589ff9b15daba4902f7d314c70312ba..56e6f88dc21d9963d1d602e54ff96adcab5f3d14 100644 (file)
--- a/visudo.c
+++ b/visudo.c
@@ -171,7 +171,7 @@ main(argc, argv)
      * Open sudoers, lock it and stat it.  
      * sudoers_fd must remain open throughout in order to hold the lock.
      */
-    sudoers_fd = open(sudoers, O_RDWR | O_CREAT);
+    sudoers_fd = open(sudoers, O_RDWR | O_CREAT, SUDOERS_MODE);
     if (sudoers_fd == -1) {
        (void) fprintf(stderr, "%s: %s: %s\n", Argv[0], sudoers,
            strerror(errno));