You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed this when in the process of updating the Solus sudo package to 1.9.14p2.
If you run visudo /non-existant-file and then exit without saving the file (for instance, in Nano using ctrl+x) the end result will be that visudo will create an empty /non-existant-file.
This seems undesirable to me, perhaps the user simply misspelled a file name and exited to use a different file name. In that case they would not expect the misspelled file to be created.
The text was updated successfully, but these errors were encountered:
This prevents visudo from creating a new zero-length sudoers file
if the user exited the editor without making any changes. Files
created via a @include directive are preserved, even if empty, to
avoid a parse error. GitHub issue #294.
… 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.
Things can get a little complicated. For example, if you add a #include line to sudoers, visudo must create the file, even if it is empty. Otherwise the file will not parse properly. The change I committed will prevent a new top-level sudoers file from being created via visudo if the editor is exited without writing any changes.
I noticed this when in the process of updating the Solus sudo package to 1.9.14p2.
If you run
visudo /non-existant-file
and then exit without saving the file (for instance, in Nano using ctrl+x) the end result will be that visudo will create an empty/non-existant-file
.This seems undesirable to me, perhaps the user simply misspelled a file name and exited to use a different file name. In that case they would not expect the misspelled file to be created.
The text was updated successfully, but these errors were encountered: