From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Barzilay Newsgroups: gmane.emacs.bugs Subject: bug#21699: 24.5; Bug in backup-buffer-copy and/or set-file-extended-attributes etc [set-file-extended-attributes] Date: Mon, 19 Oct 2015 05:10:58 -0400 Message-ID: References: <831tcricrz.fsf@gnu.org> <83zizfgxnl.fsf@gnu.org> <83wpujgwr3.fsf@gnu.org> <83si57gu7s.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1445245895 20561 80.91.229.3 (19 Oct 2015 09:11:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 19 Oct 2015 09:11:35 +0000 (UTC) Cc: 21699@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 19 11:11:27 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zo6TT-0006Ie-RT for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Oct 2015 11:11:23 +0200 Original-Received: from localhost ([::1]:37733 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zo6TS-0005Ph-VC for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Oct 2015 05:11:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zo6TC-00053B-Av for bug-gnu-emacs@gnu.org; Mon, 19 Oct 2015 05:11:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zo6T9-0006h1-3z for bug-gnu-emacs@gnu.org; Mon, 19 Oct 2015 05:11:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36786) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zo6T9-0006gx-1d for bug-gnu-emacs@gnu.org; Mon, 19 Oct 2015 05:11:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Zo6T8-0008Eq-DV for bug-gnu-emacs@gnu.org; Mon, 19 Oct 2015 05:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Barzilay Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Oct 2015 09:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21699 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21699-submit@debbugs.gnu.org id=B21699.144524586131661 (code B ref 21699); Mon, 19 Oct 2015 09:11:02 +0000 Original-Received: (at 21699) by debbugs.gnu.org; 19 Oct 2015 09:11:01 +0000 Original-Received: from localhost ([127.0.0.1]:55727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zo6T6-0008Ea-O7 for submit@debbugs.gnu.org; Mon, 19 Oct 2015 05:11:01 -0400 Original-Received: from mail-io0-f170.google.com ([209.85.223.170]:36787) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zo6T5-0008ET-El for 21699@debbugs.gnu.org; Mon, 19 Oct 2015 05:11:00 -0400 Original-Received: by ioll68 with SMTP id l68so22438958iol.3 for <21699@debbugs.gnu.org>; Mon, 19 Oct 2015 02:10:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=R3wNW42VoYoM2k38j3yerID9Y32eDUP+g6ZhhOZAt20=; b=AiSesz9ZjRz+23BRx8rUk4U+Jvk2qPTSxfPma8jsgWHQYAKlLaGvz6HUQy5Hweum0h OWdQM7b1NrR1SpFu18IepD5FUfhjNja15T5SRwSN6tm4bWvU+76fFqpO9K3aPAjSajeG SsRWQEwuNUQjx9zYT/FohoDNqAX+zCjNRxtRs3WVp/cekkrhyk52rYd0xKC1dM3EuDWK qmvUFTuuu5cmPbAfWQujwkO5lcVUIAdLUcNu1e+HZnssW8VE24daemtvdCJ1L2J+hjTB eW0iFDwpEqE3qO3QSpZ/mAvmNHKTI851FfmZ4MT3f2q9FPkU6xOPlowMlBfTZPM7GuqN TiOA== X-Gm-Message-State: ALoCoQks8aoIKyKs52I6xDi062RnYFBENYBBftcT60sYTnZqMe8vSHzfV4A8FTKMaPmYOKOzKzKD X-Received: by 10.107.137.66 with SMTP id l63mr14833580iod.112.1445245859019; Mon, 19 Oct 2015 02:10:59 -0700 (PDT) Original-Received: by 10.79.28.211 with HTTP; Mon, 19 Oct 2015 02:10:58 -0700 (PDT) In-Reply-To: <83si57gu7s.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:107746 Archived-At: On Mon, Oct 19, 2015 at 4:04 AM, Eli Zaretskii wrote: >> Date: Mon, 19 Oct 2015 03:50:04 -0400 >> From: Eli Barzilay >> Cc: 21699@debbugs.gnu.org >> >> *BUT* I doubt that this is a good idea, since on a system that >> supports both acl and selinux-context you probably want a t result to >> indicate that all of the extended settings worked. > > I don't think this is true. Many (maybe most) systems support either > ACLs or SELinux, and for them the function will incorrectly return > nil. > > A better way might be to have a test of "null" attributes, and avoid > calling the low-level APIs when the attributes are "null". A separate > issue, I think. Did you have a look at my `file-extended-attributes' fix? It does just that: when the low-level functions return "null" (four nils in the selinux case), then they won't get included in the result. This frees `set-file-extended-attributes' to require that all settings succeed. And I think that there's one case where things would fail with your fix: a linux machine that has selinux disabled will have this as the extended attributes: ((acl . nil) (selinux-context . (nil nil nil nil))) and your version of `set-file-extended-attributes' would fail when both of these fail. With my fix, `file-extended-attributes' would just return nil in that case, and `set-file-extended-attributes' will succeed trivially. -- ((x=>x(x))(x=>x(x))) Eli Barzilay: http://barzilay.org/ Maze is Life!