]> granicus.if.org Git - sudo/commitdiff
now warn if chown(2) failed
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 16 Nov 1995 08:05:44 +0000 (08:05 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 16 Nov 1995 08:05:44 +0000 (08:05 +0000)
visudo.c

index e2848b052b868c3c3ab62da1d21933c6d4f53fa5..239bfbe5b5d261037f0a693c7db11b5ce379e9cc 100644 (file)
--- a/visudo.c
+++ b/visudo.c
@@ -212,7 +212,11 @@ int main(argc, argv)
      * Change ownership of temp file to SUDOERS_OWNER
      * so when we move it to sudoers things are kosher.
      */
-    (void) chown(stmp, pwd -> pw_uid, -1);
+    if (chown(stmp, pwd -> pw_uid, -1)) {
+       (void) fprintf(stderr, "%s: Warning, unable to set owner to %s: ",
+           Argv[0], SUDOERS_OWNER);
+       perror("");
+    }
 
     /*
      * Edit the temp file and parse it (for sanity checking)