From: Todd C. Miller Date: Thu, 16 Nov 1995 08:05:44 +0000 (+0000) Subject: now warn if chown(2) failed X-Git-Tag: SUDO_1_4_0~137 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5d8180011d48b57e0c17d86402e0bc716e792096;p=sudo now warn if chown(2) failed --- diff --git a/visudo.c b/visudo.c index e2848b052..239bfbe5b 100644 --- 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)