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: Mon, 20 Jun 2011 01:55:55 -0400 Message-ID: References: <83hb7mwmxi.fsf@gnu.org> <87liwxv7hd.fsf@turtle.gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1308549383 9568 80.91.229.12 (20 Jun 2011 05:56:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 20 Jun 2011 05:56:23 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Sven Joachim Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 20 07:56:19 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 1QYXT8-0006Nq-FC for ged-emacs-devel@m.gmane.org; Mon, 20 Jun 2011 07:56:18 +0200 Original-Received: from localhost ([::1]:41277 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYXT6-000081-LI for ged-emacs-devel@m.gmane.org; Mon, 20 Jun 2011 01:56:16 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:37404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYXSp-00007t-Oy for emacs-devel@gnu.org; Mon, 20 Jun 2011 01:56:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QYXSp-0002Sk-08 for emacs-devel@gnu.org; Mon, 20 Jun 2011 01:55:59 -0400 Original-Received: from mail-iw0-f169.google.com ([209.85.214.169]:46519) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYXSn-0002SW-M1; Mon, 20 Jun 2011 01:55:57 -0400 Original-Received: by iwn8 with SMTP id 8so928916iwn.0 for ; Sun, 19 Jun 2011 22:55:55 -0700 (PDT) Original-Received: by 10.231.0.234 with SMTP id 42mr3229330ibc.110.1308549355103; Sun, 19 Jun 2011 22:55:55 -0700 (PDT) Original-Received: by 10.231.200.200 with HTTP; Sun, 19 Jun 2011 22:55:55 -0700 (PDT) In-Reply-To: <87liwxv7hd.fsf@turtle.gmx.de> X-Google-Sender-Auth: Os2akloxF6zNfrymQYf003T7U-E 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:140703 Archived-At: On Sun, Jun 19, 2011 at 5:25 PM, Sven Joachim wrote: > > More exactly, visudo renames /etc/sudoers.tmp to /etc/sudoers so that > the commit is indeed atomic. Thank you for clarifying with specificity (it wasn't IMO entirely clear from man visudo). > >> 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. I'm sure you're right. Still, it seems there may be corner cases where the backup might not be entirely sanitary. I'm still curious though about what happens to the inode (and corresponding metadata) around /etc/sudoers.tmp~ e.g.: root> ls -ldZ /etc/sudoers.tmp~ -rw-------. root root unconfined_u:object_r:etc_t:s0 /etc/sudoers.tmp~ >> 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. How can it be both? Either its a backup of /etc/sudoers or of /etc/sudoers.tmp~ Depending on the underlying linking it might _be_ useful albeit maybe in unintended ways... > Cheers, > Sven -- /s_P\