From: Sven Joachim <svenjoac@gmx.de>
To: MON KEY <monkey@sandpframing.com>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: visudo with Emacs
Date: Sun, 19 Jun 2011 23:25:50 +0200 [thread overview]
Message-ID: <87liwxv7hd.fsf@turtle.gmx.de> (raw)
In-Reply-To: <BANLkTi=swd9Gs115g5009FT19xZVY3cYsA@mail.gmail.com> (MON KEY's message of "Sun, 19 Jun 2011 16:46:39 -0400")
On 2011-06-19 22:46 +0200, MON KEY wrote:
> On Sat, Jun 18, 2011 at 10:54 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>>> AFAICT the stray /etc/sudoers.tmp~ is not in keeping with the
>>> spirit of visudo. Emacs should operate equivalently with vi.
>>
>> ??? Why? what's wrong with leaving backup files in these use cases?
>
> AIUI visudo is an abstraction of an "atomic commit".
>
> - When invoked visudo visits /etc/sudoers.tmp
> - Edits are made.
> - When the file is saved (read committed) it is verified for
> correctness.
> - If the the commit is successful, visudo writes to /etc/sudoers and
> /etc/sudoers.tmp is removed.
More exactly, visudo renames /etc/sudoers.tmp to /etc/sudoers so that
the commit is indeed atomic.
> My impression is that neither /etc/sudoers.tmp nor the backup file
> /etc/sudoers.tmp~ are meant to be retained.
Since it serves as a lockfile, /etc/sudoers.tmp must not be retained
(visudo either renames or unlinks it, depending on whether you have made
changes or not), but /etc/sudoers.tmp~ does no harm.
>> If nothing else, you get for free the ability to easily restore the
>> original files, if you happen to screw up.
>
> Restoring from /etc/sudoers.tmp~ would amount to restoring from the
> lock file not /etc/sudoers !
And? /etc/sudoers.tmp~ is still a backup file of /etc/sudoers and so
might be useful.
Cheers,
Sven
next prev parent reply other threads:[~2011-06-19 21:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-18 21:48 visudo with Emacs MON KEY
2011-06-19 2:54 ` Eli Zaretskii
2011-06-19 20:46 ` MON KEY
2011-06-19 21:25 ` Sven Joachim [this message]
2011-06-20 5:55 ` MON KEY
2011-06-20 17:52 ` Sven Joachim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87liwxv7hd.fsf@turtle.gmx.de \
--to=svenjoac@gmx.de \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=monkey@sandpframing.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.