From 5d8180011d48b57e0c17d86402e0bc716e792096 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 16 Nov 1995 08:05:44 +0000 Subject: [PATCH] now warn if chown(2) failed --- visudo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) -- 2.40.0