From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: MON KEY Newsgroups: gmane.emacs.devel Subject: Re: visudo with Emacs Date: Sun, 19 Jun 2011 16:46:39 -0400 Message-ID: References: <83hb7mwmxi.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1308516490 29218 80.91.229.12 (19 Jun 2011 20:48:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 19 Jun 2011 20:48:10 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 19 22:48:06 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QYOuZ-0004dp-36 for ged-emacs-devel@m.gmane.org; Sun, 19 Jun 2011 22:48:03 +0200 Original-Received: from localhost ([::1]:47468 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYOuY-0007dq-Bv for ged-emacs-devel@m.gmane.org; Sun, 19 Jun 2011 16:48:02 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:43127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYOtI-0007QZ-LX for emacs-devel@gnu.org; Sun, 19 Jun 2011 16:46:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QYOtH-0005pX-Dm for emacs-devel@gnu.org; Sun, 19 Jun 2011 16:46:44 -0400 Original-Received: from mail-iw0-f169.google.com ([209.85.214.169]:43109) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYOtE-0005pK-L9; Sun, 19 Jun 2011 16:46:40 -0400 Original-Received: by iwn8 with SMTP id 8so638254iwn.0 for ; Sun, 19 Jun 2011 13:46:39 -0700 (PDT) Original-Received: by 10.231.18.220 with SMTP id x28mr4280670iba.185.1308516399378; Sun, 19 Jun 2011 13:46:39 -0700 (PDT) Original-Received: by 10.231.200.200 with HTTP; Sun, 19 Jun 2011 13:46:39 -0700 (PDT) In-Reply-To: <83hb7mwmxi.fsf@gnu.org> X-Google-Sender-Auth: XUE8tpMFoD-HHQqtF1CMDOmgqeQ X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.214.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:140682 Archived-At: On Sat, Jun 18, 2011 at 10:54 PM, Eli Zaretskii 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. My impression is that neither /etc/sudoers.tmp nor the backup file /etc/sudoers.tmp~ are meant to be retained. ,---- (man "visudo") | visudo locks the sudoers file against multiple simultaneous edits, | provides basic sanity checks, and checks for parse errors. | | (...) | | visudo parses the sudoers file after the edit and will not save the | changes if there is a syntax error. | | (...) | | FILES | /etc/sudoers List of who can run what | /etc/sudoers.tmp Lock file for visudo `---- > 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 ! The state represented by /etc/sudoers.tmp might be representative of a failed commit... Note, at best I'm an occasional user of sudo/visudo. It would be nice if a sudo/visudo-devel or well versed sys-admin familiar with the intricacies of visudo could comment on the efficacy of Emacs' retention of /etc/sudoers.tmp~ -- /s_P\