Eli Zaretskii <eliz@HIDDEN>
to control <at> debbugs.gnu.org
.
Full text available.Received: (at 41218) by debbugs.gnu.org; 13 May 2020 14:25:54 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 13 10:25:54 2020 Received: from localhost ([127.0.0.1]:59031 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jYsKX-0002AQ-PF for submit <at> debbugs.gnu.org; Wed, 13 May 2020 10:25:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51986) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1jYsKR-00029v-BU; Wed, 13 May 2020 10:25:50 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37687) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1jYsKL-0000Td-RZ; Wed, 13 May 2020 10:25:41 -0400 Received: from [176.228.60.248] (port=2258 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from <eliz@HIDDEN>) id 1jYsKL-000391-66; Wed, 13 May 2020 10:25:41 -0400 Date: Wed, 13 May 2020 17:25:23 +0300 Message-Id: <83mu6b7vzg.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: "Michael Hoffman" <emacs-hoffman@HIDDEN> In-Reply-To: <29272-1589315462-76131@HIDDEN> (emacs-hoffman@HIDDEN) Subject: Re: bug#41218: 26.3; Windows: file-writable-p returns t for a file owned by the Administrators group but not writable by the user, a member of the Administrators group References: <29272-1589315462-76131@HIDDEN> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41218 Cc: 41218 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) severity 41218 wishlist thanks > From: "Michael Hoffman" <emacs-hoffman@HIDDEN> > Date: Tue, 12 May 2020 16:30:48 -0400 > > 1. Start elevated Powershell (Win+X,A) and create file C:\foo.txt owned by the Administrators group > > PS C:\> $null > C:\foo.txt > PS C:\> takeown /A /F C:\foo.txt > > SUCCESS: The file (or folder): "C:\foo.txt" now owned by the administrators group. > > 2. Open `emacs -Q` > > 3. C-x C-f C:/foo.txt > > 4. Type `(file-writable-p "foo.txt")` C-x C-e > t > > 5. C-x C-s > Saving file c:/foo.txt... > Cannot write backup file; backing up in ~/.emacs.d/%backup%~ > Error: (file-error "Setting ACL" "Operation not permitted" "c:/Users/mhoffman/.emacs.d/%backup%~") > basic-save-buffer-2: Opening output file: Permission denied, c:/foo.txt > > Expected that `(file-writable-p "foo.txt")` would return nil. Emacs on MS-Windows doesn't check the ACLs when it determines whether a file is writable. The reason is that there doesn't seem to be a general reliable way of doing so, given that access rights on Windows are many times implicitly given because the user belongs to some group that is granted access. Basically, the only reliable way of making sure the file is writable is to try writing to it; any other kind of test I know of is plagued with false negatives, i.e. they frequently tell the file is not writable when in fact it is, which I consider a greater evil than the kind of problem you report. And the fact that one normally needs to jump through hoops (elevating your session, using tools that make the file explicitly owned by a privileged group, etc.) to create such a situation on Windows is one more reason not to bother about this too much. IOW, the situation is rare. Of course, if someone can explain how to perform this test in a way that takes ACLs into account and would be reliable, we could consider implementing it (assuming it isn't too expensive, since such a test will have to be performed each time a user saves a buffer to its file). Thanks.
bug-gnu-emacs@HIDDEN
:bug#41218
; Package emacs
.
Full text available.Received: (at submit) by debbugs.gnu.org; 12 May 2020 21:16:48 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 12 17:16:48 2020 Received: from localhost ([127.0.0.1]:56671 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jYcGd-00083j-Af for submit <at> debbugs.gnu.org; Tue, 12 May 2020 17:16:48 -0400 Received: from lists.gnu.org ([209.51.188.17]:43868) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <emacs-hoffman@HIDDEN>) id 1jYbYP-0006nF-5s for submit <at> debbugs.gnu.org; Tue, 12 May 2020 16:31:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54910) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <emacs-hoffman@HIDDEN>) id 1jYbYO-0005BS-U1 for bug-gnu-emacs@HIDDEN; Tue, 12 May 2020 16:31:04 -0400 Received: from sneak2.sneakemail.com ([64.46.159.148]:36322) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from <emacs-hoffman@HIDDEN>) id 1jYbYN-0008PO-Ba for bug-gnu-emacs@HIDDEN; Tue, 12 May 2020 16:31:04 -0400 Received: from sneaked (ip-172-17-0-3.ec2.internal [172.17.0.3]) by 66321a2d97ce.localdomain (Postfix) with ESMTP id 4FC336000B for <bug-gnu-emacs@HIDDEN>; Tue, 12 May 2020 20:31:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=snkmail.com; s=mail; t=1589315462; bh=n5GexpPuM7yKpATep6tJlQpUi9z5riTo8qa6NRGRnzQ=; h=From:Date:Subject:To:From; b=fscjGjGxb6ZpE5uCH+Civ0TEd3FOvG5csRf8dA2Wds9E1AuIzBnSTTQNRNrKsPZQK xdm7qq8/QJd77HoOQspp+mDk2LGK1MwsbQkrlDEItlfeROdqOqGBPfB8e5meHb8pET zhYNd1IbuqCIxsieu2wups+iyP3sNTX0JXgbz0uH76flJa69AlxMBhH4D3xIQpwbRD iRoucgsPIRg+AEqmjO4vgCn8z8a5xP7GYzCY2hAkaNEKX59TCSj6BuOoFQoZAXsjCG dXcJ7un7dYtfHwg3rMkpsNamNvJK+JKGg9GYuQ/fHHW76XCCqGs7PuKT+WfDDhxrjW LOxgjAzkh92+Q== Received: from 40.107.67.133 by mail.sneakemail.com with SMTP; 12 May 2020 20:31:02 -0000 Received: (sneakemail censored 29272-1589315462-76131 #4); 12 May 2020 20:31:02 -0000 Received: (sneakemail censored 29272-1589315462-76131 #3); 12 May 2020 20:31:02 -0000 Received: (sneakemail censored 29272-1589315462-76131 #2); 12 May 2020 20:31:02 -0000 Received: (sneakemail censored 29272-1589315462-76131 #1); 12 May 2020 20:31:02 -0000 Arc-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GSq9JO/ESb56CiaWro/sC4LGBMOvIKGu/13oLja8PidMqVLvBstH7nP+u2oKhJE/IkYF3+SroHZS5pOFHyfLB9d5N2sU7oIUzOnP6csF2c3oyJgc8Oa7y2fyy08dyMKRFduwl+d3YL1fUjILSISazUSoQfZCyg44eURqLVu0auXahsdBRlbVqV7pQm9hRij4GN5SLBD6sUYHa1k970H9uR7J6WqvoW96zUuRFe9CzI2JTbtJlyDwx9Be1m8tgfjy8nQdtbsfo9MRxVsW9CoPITtODBKW0gKcpXmEntfRUz2cOvARZEe9OlZE/Q8BwlPj+xzVUOq9ibySHkrssPU4dQ== Arc-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XLi8e+dOG5Gcac+kII5jko7kMd88oYV0A6FbBMuSrH0=; b=k/QinyCt8buqjQDew9JmHKWHH7cYxm9JkFYLo9wTQ8OIu+lhAet1lWfYeYR6WETbAkJeMyOAe16RoCj/FbeujOHrVIG/zmdm6td9dIXZaeYkYu4ANxmOQ7DRpjIvV3mBx/72ZBaDTzj7yRpj9WUbWMphKeDI+5XbzTPchuLrucm33k2sb1JcgG7+HmCHv9EQwU/D69HiPQyTPTFSzy9DPNHbY3lNsIAzHa4guBitHqFGtbIGl6qhagS5OGI7XIqPPCLBTHGLCV9xvNKZa0AWWC2724lMs/vlLhLKaaVOvjGB2Pi/rTbc6IorY6TvWzybbh22tGTvsWowO0dSMWSofg== Arc-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=utoronto.ca; dmarc=pass action=none header.from=utoronto.ca; dkim=pass header.d=utoronto.ca; arc=none Authentication-Results: sneakemail.com; dkim=none (message not signed) header.d=none; sneakemail.com; dmarc=none action=none header.from=utoronto.ca; From: "Michael Hoffman" <emacs-hoffman@HIDDEN> Date: Tue, 12 May 2020 16:30:48 -0400 Message-ID: <29272-1589315462-76131@HIDDEN> Subject: 26.3; Windows: file-writable-p returns t for a file owned by the Administrators group but not writable by the user, a member of the Administrators group To: bug-gnu-emacs@HIDDEN Content-Type: multipart/alternative; boundary="0000000000006ab2c705a57957b9" MIME-Version: 1.0 X-Mailer: Perl5 Mail::Internet v Received-SPF: pass client-ip=64.46.159.148; envelope-from=emacs-hoffman@HIDDEN; helo=sneak2.sneakemail.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/12 16:31:02 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 12 May 2020 17:16:46 -0400 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.6 (--) --0000000000006ab2c705a57957b9 Content-Type: text/plain; charset="UTF-8" 1. Start elevated Powershell (Win+X,A) and create file C:\foo.txt owned by the Administrators group PS C:\> $null > C:\foo.txt PS C:\> takeown /A /F C:\foo.txt SUCCESS: The file (or folder): "C:\foo.txt" now owned by the administrators group. 2. Open `emacs -Q` 3. C-x C-f C:/foo.txt 4. Type `(file-writable-p "foo.txt")` C-x C-e t 5. C-x C-s Saving file c:/foo.txt... Cannot write backup file; backing up in ~/.emacs.d/%backup%~ Error: (file-error "Setting ACL" "Operation not permitted" "c:/Users/mhoffman/.emacs.d/%backup%~") basic-save-buffer-2: Opening output file: Permission denied, c:/foo.txt Expected that `(file-writable-p "foo.txt")` would return nil. In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32) of 2019-08-29 built on CIRROCUMULUS Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd Windowing system distributor 'Microsoft Corp.', version 10.0.18363 Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Mark activated Configured using: 'configure --without-dbus --host=x86_64-w64-mingw32 --without-compress-install 'CFLAGS=-O2 -static -g3'' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS THREADS LCMS2 Important settings: value of $LANG: ENU locale-coding-system: cp1252 Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils elec-pair time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads w32notify w32 lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 97495 11932) (symbols 48 20211 1) (miscs 40 42 143) (strings 32 29766 1358) (string-bytes 1 773975) (vectors 16 13889) (vector-slots 8 494823 7634) (floats 8 51 193) (intervals 56 251 11) (buffers 992 11)) --0000000000006ab2c705a57957b9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8"><d= iv dir=3D"ltr">1. Start elevated Powershell (Win+X,A) and create file C= :\foo.txt owned by the Administrators group<br><br>PS C:\> $null > C:= \foo.txt<br>PS C:\> takeown /A /F C:\foo.txt<br><br>SUCCESS: The file (o= r folder): "C:\foo.txt" now owned by the administrators group.<br= ><br>2. Open `emacs -Q`<br><br>3. C-x C-f C:/foo.txt<br><br>4. Type `(file-= writable-p "foo.txt")` C-x C-e<br>t<br><br>5. C-x C-s<br>Saving f= ile c:/foo.txt...<br>Cannot write backup file; backing up in ~/.emacs.d/%ba= ckup%~<br>Error: (file-error "Setting ACL" "Operation not pe= rmitted" "c:/Users/mhoffman/.emacs.d/%backup%~")<br>basic-sa= ve-buffer-2: Opening output file: Permission denied, c:/foo.txt<br><br>Expe= cted that `(file-writable-p "foo.txt")` would return nil.<br><br>= <br>In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)<br> of 2019-08-29 = built on CIRROCUMULUS<br>Repository revision: 96dd0196c28bc36779584e47fffcc= a433c9309cd<br>Windowing system distributor 'Microsoft Corp.', version 10.0= .18363<br>Recent messages:<br>For information about GNU Emacs and the GNU s= ystem, type C-h C-a.<br>Mark activated<br><br>Configured using:<br> 'c= onfigure --without-dbus --host=3Dx86_64-w64-mingw32<br> --without-comp= ress-install 'CFLAGS=3D-O2 -static -g3''<br><br>Configured features:<br>XPM= JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB<br>TOOLKIT_SCR= OLL_BARS THREADS LCMS2<br><br>Important settings:<br> value of $LANG:= ENU<br> locale-coding-system: cp1252<br><br>Major mode: Lisp Interac= tion<br><br>Minor modes in effect:<br> tooltip-mode: t<br> glob= al-eldoc-mode: t<br> eldoc-mode: t<br> electric-indent-mode: t<= br> mouse-wheel-mode: t<br> tool-bar-mode: t<br> menu-bar= -mode: t<br> file-name-shadow-mode: t<br> global-font-lock-mode= : t<br> font-lock-mode: t<br> blink-cursor-mode: t<br> au= to-composition-mode: t<br> auto-encryption-mode: t<br> auto-com= pression-mode: t<br> line-number-mode: t<br> transient-mark-mod= e: t<br><br>Load-path shadows:<br>None found.<br><br>Features:<br>(shadow s= ort mail-extr emacsbug message rmc puny seq byte-opt gv<br>bytecomp byte-co= mpile cconv cl-loaddefs cl-lib dired dired-loaddefs<br>format-spec rfc822 m= ml easymenu mml-sec password-cache epa derived epg<br>epg-config gnus-util = rmail rmail-loaddefs mm-decode mm-bodies mm-encode<br>mail-parse rfc2231 ma= ilabbrev gmm-utils mailheader sendmail rfc2047<br>rfc2045 ietf-drums mm-uti= l mail-prsvr mail-utils elec-pair time-date<br>mule-util tooltip eldoc elec= tric uniquify ediff-hook vc-hooks<br>lisp-float-type mwheel dos-w32 ls-lisp= disp-table term/w32-win w32-win<br>w32-vars term/common-win tool-bar dnd f= ontset image regexp-opt fringe<br>tabulated-list replace newcomment text-mo= de elisp-mode lisp-mode<br>prog-mode register page menu-bar rfn-eshadow ise= arch timer select<br>scroll-bar mouse jit-lock font-lock syntax facemenu fo= nt-core<br>term/tty-colors frame cl-generic cham georgian utf-8-lang misc-l= ang<br>vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp5193= 2<br>hebrew greek romanian slovak czech european ethiopic indian cyrillic<b= r>chinese composite charscript charprop case-table epa-hook jka-cmpr-hook<b= r>help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs<br>bu= tton faces cus-face macroexp files text-properties overlay sha1 md5<br>base= 64 format env code-pages mule custom widget hashtable-print-readable<br>bac= kquote threads w32notify w32 lcms2 multi-tty make-network-process<br>emacs)= <br><br>Memory information:<br>((conses 16 97495 11932)<br> (symbols 4= 8 20211 1)<br> (miscs 40 42 143)<br> (strings 32 29766 1358)<br>&= nbsp;(string-bytes 1 773975)<br> (vectors 16 13889)<br> (vector-s= lots 8 494823 7634)<br> (floats 8 51 193)<br> (intervals 56 251 1= 1)<br> (buffers 992 11))<br></div> --0000000000006ab2c705a57957b9--
"Michael Hoffman" <emacs-hoffman@HIDDEN>
:bug-gnu-emacs@HIDDEN
.
Full text available.bug-gnu-emacs@HIDDEN
:bug#41218
; Package emacs
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.