From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#13298: 24.3.50; Cannot write backup file; backing up in ~\.emacs.d\%backup%~ Date: Sat, 29 Dec 2012 21:18:54 +0400 Message-ID: <50DF25FE.3010900@yandex.ru> References: <87zk0xnc0f.fsf@yandex.ru> <83zk0xl4cv.fsf@gnu.org> <50DED342.7040901@yandex.ru> <83ip7lkqp6.fsf@gnu.org> <50DEF35F.9090107@yandex.ru> <83d2xtklu1.fsf@gnu.org> <50DEF66E.4020106@yandex.ru> <83bodclxyl.fsf@gnu.org> <50DF14C3.6040702@yandex.ru> <83a9swlrp7.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1356801615 13061 80.91.229.3 (29 Dec 2012 17:20:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Dec 2012 17:20:15 +0000 (UTC) Cc: 13298@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 29 18:20:31 2012 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 1Tp05E-0001GK-6H for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Dec 2012 18:20:28 +0100 Original-Received: from localhost ([::1]:40488 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tp04z-0003ML-Di for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Dec 2012 12:20:13 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tp04t-0003HV-T0 for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2012 12:20:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tp04q-0004u2-AB for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2012 12:20:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54303) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tp04q-0004t3-4r for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2012 12:20:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Tp05m-0003fi-FH for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2012 12:21:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Dec 2012 17:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13298 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13298-submit@debbugs.gnu.org id=B13298.135680160113961 (code B ref 13298); Sat, 29 Dec 2012 17:21:02 +0000 Original-Received: (at 13298) by debbugs.gnu.org; 29 Dec 2012 17:20:01 +0000 Original-Received: from localhost ([127.0.0.1]:36318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tp04m-0003d0-PX for submit@debbugs.gnu.org; Sat, 29 Dec 2012 12:20:01 -0500 Original-Received: from mail-la0-f42.google.com ([209.85.215.42]:32875) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tp04j-0003cl-3n for 13298@debbugs.gnu.org; Sat, 29 Dec 2012 12:19:58 -0500 Original-Received: by mail-la0-f42.google.com with SMTP id fe20so2281394lab.15 for <13298@debbugs.gnu.org>; Sat, 29 Dec 2012 09:18:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=DNO1iLS2yunWB1A5YwhCIRnl+/PisvUWRfzXanIJwKM=; b=ZPErEbs6IjIfQdfAQPn342LLgO0s+Mkcg3HMAoEqjEqbMXuwpP4NeoFaRljEj2Es7C wiBD30O6kYAl10gKsSIuj45n+67lN7L75xMBjTIEw9tDLdMndGKasgG/nf0RDyDM5J8A bNhc1y8Y+BZKpKlPjZWkQLvcRfn5BMqGmjpNMdO2in48bg9u2q5t/6dBXyPf8nyiLywr cXcoiKSQRHVA2xvr4Yv98Wl7nrg2ncMyECcULegFAvsLg5aHnTPQOS9MlCpZCHfyWXWY 45/lRdL64ztmZBXCt+b6r5v4POD76515W+e+M3HsS4Qp7ZO02qWw9HxhMcDwcGgwbqOU PHlg== X-Received: by 10.152.108.37 with SMTP id hh5mr34722076lab.52.1356801536591; Sat, 29 Dec 2012 09:18:56 -0800 (PST) Original-Received: from [127.0.0.1] ([178.252.98.87]) by mx.google.com with ESMTPS id ja10sm13651886lab.6.2012.12.29.09.18.52 (version=SSLv3 cipher=OTHER); Sat, 29 Dec 2012 09:18:54 -0800 (PST) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: <83a9swlrp7.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.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:69164 Archived-At: On 29.12.2012 20:59, Eli Zaretskii wrote: >> Date: Sat, 29 Dec 2012 20:05:23 +0400 >> From: Dmitry Gutov >> CC: 13298@debbugs.gnu.org >> >> On 29.12.2012 18:44, Eli Zaretskii wrote: >>>> Date: Sat, 29 Dec 2012 17:55:58 +0400 >>>> From: Dmitry Gutov >>>> CC: 13298@debbugs.gnu.org >>>> >>>> On 29.12.2012 17:51, Eli Zaretskii wrote: >>>>>> Date: Sat, 29 Dec 2012 17:42:55 +0400 >>>>>> From: Dmitry Gutov >>>>>> CC: 13298@debbugs.gnu.org >>>>>> >>>>>>> Can you step with a debugger (e.g., Edebug) through >>>>>>> backup-buffer-copy, and see why it errors out? My crystal ball says >>>>>>> it happens because of set-file-extended-attributes, in which case >>>>>>> please tell what is the value of extended-attributes argument passed >>>>>>> to backup-buffer-copy. >>>>>> >>>>>> Indeed, it happens after a call to set-file-acl. >>>>>> >>>>>> ((acl . >>>>>> "O:BAG:S-1-5-21-909999172-181315677-756075521-513D:(A;;FA;;;SY)(A;;FA;;;BA)(A;;FA;;;S-1-5-21-909999172-181315677-756075521-1000)") >>>>>> (selinux-context nil nil nil nil)) >>>>> >>>>> And if, before the call to set-file-acl inside >>>>> set-file-extended-attributes, you evaluate the expression >>>>> >>>>> (file-acl filename) >>>>> >>>>> what does it return? >>>> >>>> "O:S-1-5-21-909999172-181315677-756075521-1000G:S-1-5-21-909999172-181315677-756075521-513D:(A;;FA;;;SY)(A;;FA;;;BA)(A;;FA;;;S-1-5-21-909999172-181315677-756075521-1000)" >>> >>> I guess this happens because all of the following: >>> >>> . your user is a local Administrator >>> >>> . you took ownership of your ~/.emacs.d directory, instead of >>> leaving it owned by the Administrators group >> >> The above is true. But /Users/gutov is owned by SYSTEM, FWIW. >> >>> . you didn't (or cannot) enable the "take ownership" privilege in >>> your local security policy >> >> This policy's security setting says "Administrators", and my user >> belongs to that group (I'm looking in Local Policies/User Rights >> Assignment, is that right?). > > You could try explicitly allowing the privilege for your user, but I'm > not sure it would help. That's the "cannot" part above: for users who > are members of the Administrators group, enabling that privilege does > nothing, AFAIK. Windows doesn't let such users this privilege without > elevation. You can only avoid the problem by running Emacs "as > Administrator" or from a shell that was run "as Administrator". Yeah, that's not going to happen. Why doesn't Emacs try to show the elevation dialog, anyway? >>> I installed as trunk revision 111369 a set of changes that should fix >>> this for you. Please test. (I could only approximate the problem on >>> my machine, so I cannot be sure the changes indeed fix it.) >> >> It's better, but now I see these messages: >> >> Saving file c:/Users/gutov/.newsrc... >> Error: (file-error "Setting ACL" "operation not permitted" > > This is what the changes intended to accomplish. In this discussion: > > http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00568.html > > I suggested to ignore these errors entirely, but others felt this was > too radical, since there could be real security issues involved here. I've seen that discussion, but didn't feel I was qualified to comment. > Stefan suggested using with-demoted-errors here: > > http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00645.html > > which is what Emacs does after my changes. > >> Like I described, I don't think my situation is exceptional, so seeing >> the error messages is misleading. > > Why misleading? We asked Emacs to preserve the ACLs of the original > file, and it couldn't. Shouldn't the user be informed about that? It leads me to believe that there's either something wrong with my system, or Emacs configuration, whereas I don't know why I should care that the backup function doesn't correctly set the file ownership. I guess I might care about it in some other case. > If you think this is bad behavior, lobby on emacs-devel to allow some > kind of user options for ignoring these errors (which means you don't > care about security of access to your files). I don't think that a user option is the way to go if it's going to be off by default. Maybe don't expect the user to customize its value, and bind it to t in certain functions, like backup-buffer-copy, instead?