From bdde6dfa112f17d47bf5f4f8991023ece884780c Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 27 Jul 2023 11:32:56 -0600 Subject: [PATCH] visudo: document that a new file is only created if the editor writes it. If visudo is used to create a new file, the file will only be created if the user writes to the file via the editor. Simply running visudo and exiting the editor will no longer cause the file to be created. There is an exception for file created due to the addition of a @include directive, which need to be present for the sudoers file to parse properly. GitHub issue #294. --- docs/visudo.man.in | 7 ++++++- docs/visudo.mdoc.in | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/visudo.man.in b/docs/visudo.man.in index 9c70d3bd3..0bad13635 100644 --- a/docs/visudo.man.in +++ b/docs/visudo.man.in @@ -21,7 +21,7 @@ .\" Agency (DARPA) and Air Force Research Laboratory, Air Force .\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" -.TH "VISUDO" "@mansectsu@" "March 20, 2023" "Sudo @PACKAGE_VERSION@" "System Manager's Manual" +.TH "VISUDO" "@mansectsu@" "July 27, 2023" "Sudo @PACKAGE_VERSION@" "System Manager's Manual" .nh .if n .ad l .SH "NAME" @@ -47,6 +47,11 @@ If the \fIsudoers\fR file is currently being edited you will receive a message to try again later. .PP +If the +\fIsudoers\fR +file does not exist, it will be created unless the editor exits +without writing to the file. +.PP \fBvisudo\fR parses the \fIsudoers\fR diff --git a/docs/visudo.mdoc.in b/docs/visudo.mdoc.in index 73daab1de..f91430d34 100644 --- a/docs/visudo.mdoc.in +++ b/docs/visudo.mdoc.in @@ -20,7 +20,7 @@ .\" Agency (DARPA) and Air Force Research Laboratory, Air Force .\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" -.Dd March 20, 2023 +.Dd July 27, 2023 .Dt VISUDO @mansectsu@ .Os Sudo @PACKAGE_VERSION@ .Sh NAME @@ -45,6 +45,11 @@ If the .Em sudoers file is currently being edited you will receive a message to try again later. .Pp +If the +.Em sudoers +file does not exist, it will be created unless the editor exits +without writing to the file. +.Pp .Nm parses the .Em sudoers