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.
This commit is contained in:
Todd C. Miller
2023-07-27 11:32:56 -06:00
parent 4f3786f70f
commit bdde6dfa11
2 changed files with 12 additions and 2 deletions

View File

@@ -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

View File

@@ -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