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 Date: Sun, 18 Oct 2015 00:34:42 -0400 Message-ID: <22051.8546.40000.221633@gargle.gargle.HOWL> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1445142989 28938 80.91.229.3 (18 Oct 2015 04:36:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 18 Oct 2015 04:36:29 +0000 (UTC) To: 21699@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 18 06:36:18 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 1Znfhg-0006n9-5y for geb-bug-gnu-emacs@m.gmane.org; Sun, 18 Oct 2015 06:36:16 +0200 Original-Received: from localhost ([::1]:60637 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Znfhf-0003ov-40 for geb-bug-gnu-emacs@m.gmane.org; Sun, 18 Oct 2015 00:36:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53313) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnfhX-0003oP-Vp for bug-gnu-emacs@gnu.org; Sun, 18 Oct 2015 00:36:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZnfhS-0007iU-VR for bug-gnu-emacs@gnu.org; Sun, 18 Oct 2015 00:36:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35776) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnfhS-0007iQ-Sa for bug-gnu-emacs@gnu.org; Sun, 18 Oct 2015 00:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZnfhS-00077a-Lu for bug-gnu-emacs@gnu.org; Sun, 18 Oct 2015 00:36: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: Sun, 18 Oct 2015 04:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21699 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.144514291027313 (code B ref -1); Sun, 18 Oct 2015 04:36:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Oct 2015 04:35:10 +0000 Original-Received: from localhost ([127.0.0.1]:54717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Znfgb-00076S-D2 for submit@debbugs.gnu.org; Sun, 18 Oct 2015 00:35:09 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43090) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZnfgZ-00076J-Cy for submit@debbugs.gnu.org; Sun, 18 Oct 2015 00:35:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZnfgX-0007Zy-Np for submit@debbugs.gnu.org; Sun, 18 Oct 2015 00:35:06 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:55411) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnfgX-0007Zq-LL for submit@debbugs.gnu.org; Sun, 18 Oct 2015 00:35:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnfgW-0003hv-Da for bug-gnu-emacs@gnu.org; Sun, 18 Oct 2015 00:35:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZnfgR-0007Um-CY for bug-gnu-emacs@gnu.org; Sun, 18 Oct 2015 00:35:04 -0400 Original-Received: from mail-wi0-f176.google.com ([209.85.212.176]:36415) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnfgR-0007UZ-6m for bug-gnu-emacs@gnu.org; Sun, 18 Oct 2015 00:34:59 -0400 Original-Received: by wicfx6 with SMTP id fx6so9092532wic.1 for ; Sat, 17 Oct 2015 21:34:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:mime-version:content-type :content-transfer-encoding:message-id:date:to:subject; bh=h9H5carjL+ZCGmsowQ8KwQgz0FwKuCSG06hZsHrdbAg=; b=bbF8MMdBq/lILEwuZ+mhfuQZ4ojh2/IuGAQGKVhkXp+8VAbYAxJyBzpU8Lg/wIWVQ2 G/n44ySoI5TcZLkLplVozWW0qJDtxhVN9UgI1R3waaMx7urfe6oBemP1S/7eajI4/Kr4 bLxJZ4DK7BsDealf/lyuab3B00n3QTR0dLeWN+Lu+uqA/gnxIV+euO8MKCbtaRaaLTKy YugskxaGm5JSE16Py35crwvYi1bEm6lwzYIlEpYITf6rcJwvfapDceZi2nxoLwHidzjF yyVnL0JQbLIAKainGsclv3ayPnDEYsJ2ohtk+RIrXLle5x32lD+nhBdkEceq0+HLBaS2 bn8A== X-Gm-Message-State: ALoCoQlWE2Hw7SDlVEl8O1Ocym/RhGRVSi2ai/ohr8xe5ANvWIR4SEECNkBIcJhf60NXkoHsD2WS X-Received: by 10.194.113.101 with SMTP id ix5mr26041576wjb.107.1445142898459; Sat, 17 Oct 2015 21:34:58 -0700 (PDT) Original-Received: from BARZILAY ([178.208.171.1]) by smtp.gmail.com with ESMTPSA id ki7sm31877149wjc.28.2015.10.17.21.34.56 for (version=TLSv1/SSLv3 cipher=OTHER); Sat, 17 Oct 2015 21:34:57 -0700 (PDT) X-Mailer: VM 8.2.0a under 24.5.1 (i686-pc-mingw32) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). 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:107704 Archived-At: (There are potentially multiple bugs here, I'll mark them as [n].) After switching to 24.5 I started to see warnings like: Cannot write backup file; backing up in ~/.emacs.d/%backup%~ when saving a file on a remote directory (running on Windows, remote is on Linux, but this is unlikely to be relevant). I tracked this to `backup-buffer-copy', which has a seemingly bad use of `with-demoted-errors'. This looks like a minor update is needed [1], since the macro source handles a no-format-string case as legacy. The next suspect was `set-file-extended-attributes'. This code comes from commit ccad023bc3c70fc8368c00f7ed2f5ec947a4260d (2012-12-29), and following the description there, I think that there's a bug in this function: it has a single `dolist' which would always return nil, which means that putting it in the `and' of `backup-buffer-copy' makes the code always think that there was a failure. Instead, there should be some flag to be used in the loop to keep track of the `and' of all of the results [2]. (Or maybe there's some andmap/every/... function that does it more idiomatically.) Next comes `set-file-selinux-context', which might have a problem. It's documentation says: This function does nothing and returns nil if SELinux is disabled, or if Emacs was not compiled with SELinux support. which I assume is my case since I'm running on Windows. It is called with (nil nil nil nil) which I'm guessing is some no-information- since-we-don't-have-selinux thing -- but in that case, `set-file-selinux-context' should not return nil when it's getting that value. So something is definitely broken here [3], either it shouldn't return nil, or it shouldn't be called (avoid adding that 4xnil value to the extended-attributes, or avoid calling `set-file-selinux-context' with that value), and possibly there should be an explicit no-info value. Finally, after the above problem makes it think that there was a failure, it uses `set-file-modes' with the backup file, and that throws an error for the backup file: (file-error "Doing chmod" "permission denied" "...path-to-backup...") My setup is to have a single (local) directory for backups, so this might be some result of applying the windows acl thing first, copying the acl of the remote file to the one of the local backup. Windows shows that the file permissions for Everyone are: "Read & Execute" and "Read", so that might be the problem. I'm not sure how this whole thing will look like, but it might be a problem to apply the acls this way, so this problem might require some additional flag that allows people to avoid copying the acls to the backups. -- ((x=>x(x))(x=>x(x))) Eli Barzilay: http://barzilay.org/ Maze is Life!