From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Jari Aalto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Dec 2011 18:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 10257@debbugs.gnu.org X-Debbugs-Original-To: submit@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.132345509028445 (code B ref -1); Fri, 09 Dec 2011 18:25:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 Dec 2011 18:24:50 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RZ57p-0007Oj-L6 for submit@debbugs.gnu.org; Fri, 09 Dec 2011 13:24:50 -0500 Received: from emh07.mail.saunalahti.fi ([62.142.5.117]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RZ57m-0007OZ-FX for submit@debbugs.gnu.org; Fri, 09 Dec 2011 13:24:48 -0500 Received: from saunalahti-vams (vs3-10.mail.saunalahti.fi [62.142.5.94]) by emh07-2.mail.saunalahti.fi (Postfix) with SMTP id E0C8E18D1C5 for ; Fri, 9 Dec 2011 20:23:48 +0200 (EET) Received: from emh05.mail.saunalahti.fi ([62.142.5.111]) by vs3-10.mail.saunalahti.fi ([62.142.5.94]) with SMTP (gateway) id A06E91DC71E; Fri, 09 Dec 2011 20:23:48 +0200 Received: from picasso.cante.net (a91-155-176-245.elisa-laajakaista.fi [91.155.176.245]) by emh05.mail.saunalahti.fi (Postfix) with ESMTP id CC71327D86 for ; Fri, 9 Dec 2011 20:23:47 +0200 (EET) Received: from jaalto by picasso.cante.net with local (Exim 4.77) (envelope-from ) id 1RZ56p-0000ds-AP for submit@debbugs.gnu.org; Fri, 09 Dec 2011 20:23:47 +0200 From: Jari Aalto Mail-Copies-To: poster Date: Fri, 09 Dec 2011 20:23:47 +0200 Message-ID: <87aa71mwng.fsf@picasso.cante.net> MIME-Version: 1.0 Content-Type: text/plain X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: jari.aalto@cante.net X-SA-Exim-Scanned: No (on picasso.cante.net); SAEximRunCond expanded to false X-Antivirus: VAMS X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Package: emacs Version: 23.3+1-4 Severity: normal TEST CASE - OS: Windows 7 64 bit - Start Cygwin X server: XWin :0 -unixkill -multiwindow - Start Cygwin Emacs: DISPLAY=:0 emacs-X11 & - C-x C-f any network drive file Emacs marks the file as read-only (%%) and asks every time a question after pressing C-x C-s: File is write-protected; try to save anyway? (y or n) PROBLEM The constant prompting "Y/N" makes writing to a network drive location exessively hard. It's nuissance to have to be able to confirm every save action. There doens't seem to be way to turn of this prompting. SUGGESTION The logic of checking if file is write protedted or not does not seem to be reliable under Cygwin regarding network drives. The Permissions probably don't come through correctly for Emacs to examine them. A) Offer option to turn of confirmation B) or bypass write protection checks under Cygwin TEST DATA Here is an example under Cygwin Emacs: (file-attributes "/cygdrive/z/tmp/test-epackage.el") => (nil 1 4294967295.0 4294967295.0 (20194 11100) (20194 19792) (20194 19792) 437 "-rwxr--r--" t (-1735557 1952988 . 8890) (30147 . 13405)) Under Cygwin Bash shell it looks like this: $ ls -la /cygdrive/z/tmp/test-epackage.el -rwxr--r-- 1 ???????? ???????? 437 Dec 9 20:02 /cygdrive/z/tmp/test-epackage.el Note: the uid and gid information is not available from this non-domain network drive. From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Ken Brown Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Dec 2011 20:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jari Aalto Cc: 10257@debbugs.gnu.org Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.13234628927541 (code B ref 10257); Fri, 09 Dec 2011 20:35:01 +0000 Received: (at 10257) by debbugs.gnu.org; 9 Dec 2011 20:34:52 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RZ79f-0001xa-B6 for submit@debbugs.gnu.org; Fri, 09 Dec 2011 15:34:52 -0500 Received: from granite1.mail.cornell.edu ([128.253.83.141] helo=authusersmtp.mail.cornell.edu) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RZ79a-0001xQ-V2 for 10257@debbugs.gnu.org; Fri, 09 Dec 2011 15:34:49 -0500 Received: from [192.168.1.3] (cpe-67-249-194-47.twcny.res.rr.com [67.249.194.47]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id pB9KXmsg002967 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 9 Dec 2011 15:33:49 -0500 (EST) Message-ID: <4EE270AA.2080702@cornell.edu> Date: Fri, 09 Dec 2011 15:33:46 -0500 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 References: <87aa71mwng.fsf@picasso.cante.net> In-Reply-To: <87aa71mwng.fsf@picasso.cante.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -5.8 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) On 12/9/2011 1:23 PM, Jari Aalto wrote: > Package: emacs > Version: 23.3+1-4 > Severity: normal > > TEST CASE > > - OS: Windows 7 64 bit > - Start Cygwin X server: > XWin :0 -unixkill -multiwindow > - Start Cygwin Emacs: > DISPLAY=:0 emacs-X11& > - C-x C-f any network drive file Is there really a problem on *any* network drive, or is the issue that you have some particular file system on that drive for which Cygwin can't get reliable permission information? I would think that you should try to get help on the Cygwin list before talking about making emacs bypass permission checks on Cygwin. I don't use network drives myself, but I know that plenty of people do, and the Cygwin maintainers are very accommodating in trying to teach Cygwin to recognize problematic file systems. And if that fails, can't you solve the problem by mounting your drive with the noacl option? > Emacs marks the file as read-only (%%) and asks every time a question > after pressing C-x C-s: > > File is write-protected; try to save anyway? (y or n) > > PROBLEM > > The constant prompting "Y/N" makes writing to a network drive location > exessively hard. It's nuissance to have to be able to confirm every > save action. > > There doens't seem to be way to turn of this prompting. > > SUGGESTION > > The logic of checking if file is write protedted or not does not seem > to be reliable under Cygwin regarding network drives. The Permissions > probably don't come through correctly for Emacs to examine them. > > A) Offer option to turn of confirmation > B) or bypass write protection checks under Cygwin > > TEST DATA > > Here is an example under Cygwin Emacs: > > (file-attributes "/cygdrive/z/tmp/test-epackage.el") > => (nil 1 4294967295.0 4294967295.0 (20194 11100) (20194 19792) (20194 > 19792) 437 "-rwxr--r--" t (-1735557 1952988 . 8890) (30147 . 13405)) > > Under Cygwin Bash shell it looks like this: > > $ ls -la /cygdrive/z/tmp/test-epackage.el > -rwxr--r-- 1 ???????? ???????? 437 Dec 9 20:02 /cygdrive/z/tmp/test-epackage.el > > Note: the uid and gid information is not available from this non-domain > network drive. From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: jaalto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Dec 2011 10:00:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ken Brown Cc: 10257@debbugs.gnu.org Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132351120023283 (code B ref 10257); Sat, 10 Dec 2011 10:00:01 +0000 Received: (at 10257) by debbugs.gnu.org; 10 Dec 2011 10:00:00 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RZJip-00063T-TT for submit@debbugs.gnu.org; Sat, 10 Dec 2011 05:00:00 -0500 Received: from emh04.mail.saunalahti.fi ([62.142.5.110]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RZJil-00063A-VC for 10257@debbugs.gnu.org; Sat, 10 Dec 2011 04:59:58 -0500 Received: from saunalahti-vams (vs3-11.mail.saunalahti.fi [62.142.5.95]) by emh04-2.mail.saunalahti.fi (Postfix) with SMTP id B0D9F13BBB1; Sat, 10 Dec 2011 11:58:54 +0200 (EET) Received: from emh07.mail.saunalahti.fi ([62.142.5.117]) by vs3-11.mail.saunalahti.fi ([62.142.5.95]) with SMTP (gateway) id A04B53AA522; Sat, 10 Dec 2011 11:58:54 +0200 Received: from picasso.cante.net (a91-155-176-245.elisa-laajakaista.fi [91.155.176.245]) by emh07.mail.saunalahti.fi (Postfix) with ESMTP id D33401C6382; Sat, 10 Dec 2011 11:58:51 +0200 (EET) Received: from cante.cante.net ([192.168.1.3] ident=Debian-exim) by picasso.cante.net with esmtp (Exim 4.77) (envelope-from ) id 1RZJhj-0004hf-J9; Sat, 10 Dec 2011 11:58:51 +0200 Received: from jaalto by cante.cante.net with local (Exim 4.76) (envelope-from ) id 1RZJhq-0007Dj-Om; Sat, 10 Dec 2011 11:58:58 +0200 Date: Sat, 10 Dec 2011 11:58:58 +0200 From: jaalto Message-ID: <20111210095858.GA19881@cante.cante.net> References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4EE270AA.2080702@cornell.edu> X-Gpg-Key-Id: 0xD189E680 X-Gpg-Key-Info: http://key-server.de:11371/pks/lookup?search=0xD189E680&op=vindex X-Gpg-Key-Get: ttp://key-server.de:11371/pks/lookup?search=0xD189E680&op=get User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 192.168.1.3 X-SA-Exim-Mail-From: jaalto@cante.cante.net X-SA-Exim-Scanned: No (on picasso.cante.net); SAEximRunCond expanded to false X-Antivirus: VAMS X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 2011-12-09 15:33, Ken Brown wrote: | | >Here is an example under Cygwin Emacs: | > | > (file-attributes "/cygdrive/z/tmp/test-epackage.el") | > => (nil 1 4294967295.0 4294967295.0 (20194 11100) (20194 19792) (20194 | > 19792) 437 "-rwxr--r--" t (-1735557 1952988 . 8890) (30147 . 13405)) | > | >Under Cygwin Bash shell it looks like this: | > | > $ ls -la /cygdrive/z/tmp/test-epackage.el | > -rwxr--r-- 1 ???????? ???????? 437 Dec 9 20:02 /cygdrive/z/tmp/test-epackage.el | > | | Is there really a problem on *any* network drive, or is the issue | that you have some particular file system on that drive for which | Cygwin can't get reliable permission information? See above. The permissions from Cygwin shell look correct. It's the UID, GID that don't translate back to windows, because this not a domain. | I would think that you should try to get help on the Cygwin list | before talking about making emacs bypass permission checks on | Cygwin. I don't use network drives myself, but I know that plenty | of people do, and the Cygwin maintainers are very accommodating in | trying to teach Cygwin to recognize problematic file systems. | | And if that fails, can't you solve the problem by mounting your | drive with the noacl option? There are no problems under Cygwin. On Bash shell, all cp(1), mv(1) and editors (nanoe, joe) write operations continue to work as usual. For some reason Emacs thinks that all files are write protected. The Disk drive has been mapped with Standard Windows "Map network drive" feature. Jari From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Ken Brown Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Dec 2011 12:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: jaalto Cc: 10257@debbugs.gnu.org Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.13237788241158 (code B ref 10257); Tue, 13 Dec 2011 12:21:02 +0000 Received: (at 10257) by debbugs.gnu.org; 13 Dec 2011 12:20:24 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaRLL-0000Id-QR for submit@debbugs.gnu.org; Tue, 13 Dec 2011 07:20:24 -0500 Received: from granite1.mail.cornell.edu ([128.253.83.141] helo=authusersmtp.mail.cornell.edu) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaRLI-0000IS-2s for 10257@debbugs.gnu.org; Tue, 13 Dec 2011 07:20:21 -0500 Received: from [192.168.1.3] (cpe-67-249-194-47.twcny.res.rr.com [67.249.194.47]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id pBDCJ0VJ016523 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 13 Dec 2011 07:19:01 -0500 (EST) Message-ID: <4EE742B0.1080703@cornell.edu> Date: Tue, 13 Dec 2011 07:18:56 -0500 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> In-Reply-To: <20111210095858.GA19881@cante.cante.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -5.8 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) On 12/10/2011 4:58 AM, jaalto wrote: > On 2011-12-09 15:33, Ken Brown wrote: > | > |>Here is an example under Cygwin Emacs: > |> > |> (file-attributes "/cygdrive/z/tmp/test-epackage.el") > |> => (nil 1 4294967295.0 4294967295.0 (20194 11100) (20194 19792) (20194 > |> 19792) 437 "-rwxr--r--" t (-1735557 1952988 . 8890) (30147 . 13405)) > |> > |>Under Cygwin Bash shell it looks like this: > |> > |> $ ls -la /cygdrive/z/tmp/test-epackage.el > |> -rwxr--r-- 1 ???????? ???????? 437 Dec 9 20:02 /cygdrive/z/tmp/test-epackage.el > |> > | > | Is there really a problem on *any* network drive, or is the issue > | that you have some particular file system on that drive for which > | Cygwin can't get reliable permission information? > > See above. The permissions from Cygwin shell look correct. It's the > UID, GID that don't translate back to windows, because this not a domain. > > | I would think that you should try to get help on the Cygwin list > | before talking about making emacs bypass permission checks on > | Cygwin. I don't use network drives myself, but I know that plenty > | of people do, and the Cygwin maintainers are very accommodating in > | trying to teach Cygwin to recognize problematic file systems. > | > | And if that fails, can't you solve the problem by mounting your > | drive with the noacl option? > > There are no problems under Cygwin. On Bash shell, all cp(1), mv(1) > and editors (nanoe, joe) write operations continue to work as usual. > > For some reason Emacs thinks that all files are write protected. emacs uses file-writable-p, which calls check_writable() (defined in fileio.c), which calls euidaccess(). That explains why emacs thinks the file is not writable when Cygwin can't determine the UID. It would certainly be possible to make check_writable() use a different method of determining writability on Cygwin, as it already does on MSDOS. But I still think it would be best to try to fix this in Cygwin first. > The Disk drive has been mapped with Standard Windows "Map network > drive" feature. So why don't you ask on the Cygwin list whether access() and euidaccess() can be taught to give the "right" answer for files on such drives. Or maybe the question is simply whether Cygwin can be taught to determine the correct UID. Ken From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: jari Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Dec 2011 14:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ken Brown Cc: 10257@debbugs.gnu.org Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132378492812949 (code B ref 10257); Tue, 13 Dec 2011 14:03:01 +0000 Received: (at 10257) by debbugs.gnu.org; 13 Dec 2011 14:02:08 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaSvo-0003Mo-MC for submit@debbugs.gnu.org; Tue, 13 Dec 2011 09:02:08 -0500 Received: from emh02.mail.saunalahti.fi ([62.142.5.108]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaSvl-0003Mf-B8 for 10257@debbugs.gnu.org; Tue, 13 Dec 2011 09:02:07 -0500 Received: from saunalahti-vams (vs3-11.mail.saunalahti.fi [62.142.5.95]) by emh02-2.mail.saunalahti.fi (Postfix) with SMTP id C633BEF751; Tue, 13 Dec 2011 16:00:45 +0200 (EET) Received: from emh04.mail.saunalahti.fi ([62.142.5.110]) by vs3-11.mail.saunalahti.fi ([62.142.5.95]) with SMTP (gateway) id A05F9CC119A; Tue, 13 Dec 2011 16:00:45 +0200 Received: from picasso.cante.net (a91-155-176-245.elisa-laajakaista.fi [91.155.176.245]) by emh04.mail.saunalahti.fi (Postfix) with ESMTP id BCC8D41BE4; Tue, 13 Dec 2011 16:00:42 +0200 (EET) Received: from jaalto by picasso.cante.net with local (Exim 4.77) (envelope-from ) id 1RaSuQ-0002Sp-C4; Tue, 13 Dec 2011 16:00:42 +0200 Date: Tue, 13 Dec 2011 16:00:42 +0200 From: jari Message-ID: <20111213140042.GA22678@picasso.cante.net> References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4EE742B0.1080703@cornell.edu> X-Gpg-Key-Id: 0xD189E680 X-Gpg-Key-Info: http://key-server.de:11371/pks/lookup?search=0xD189E680&op=vindex X-Gpg-Key-Get: ttp://key-server.de:11371/pks/lookup?search=0xD189E680&op=get User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: jaalto@picasso.cante.net X-SA-Exim-Scanned: No (on picasso.cante.net); SAEximRunCond expanded to false X-Antivirus: VAMS X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 2011-12-13 07:18, Ken Brown wrote: | On 12/10/2011 4:58 AM, jaalto wrote: | >On 2011-12-09 15:33, Ken Brown wrote: | >| | >|>Here is an example under Cygwin Emacs: | >|> | >|> (file-attributes "/cygdrive/z/tmp/test-epackage.el") | >|> => (nil 1 4294967295.0 4294967295.0 (20194 11100) (20194 19792) (20194 | >|> 19792) 437 "-rwxr--r--" t (-1735557 1952988 . 8890) (30147 . 13405)) | >|> | >|>Under Cygwin Bash shell it looks like this: | >|> | >|> $ ls -la /cygdrive/z/tmp/test-epackage.el | >|> -rwxr--r-- 1 ???????? ???????? 437 Dec 9 20:02 /cygdrive/z/tmp/test-epackage.el | >|> | >| | >| Is there really a problem on *any* network drive, or is the issue | >| that you have some particular file system on that drive for which | >| Cygwin can't get reliable permission information? | > | >See above. The permissions from Cygwin shell look correct. It's the | >UID, GID that don't translate back to windows, because this not a domain. > | emacs uses file-writable-p, which calls check_writable() (defined in | fileio.c), which calls euidaccess(). That explains why emacs thinks | the file is not writable when Cygwin can't determine the UID. It | would certainly be possible to make check_writable() use a different | method of determining writability on Cygwin, as it already does on | MSDOS. But I still think it would be best to try to fix this in | Cygwin first. | | >The Disk drive has been mapped with Standard Windows "Map network | >drive" feature. | | So why don't you ask on the Cygwin list whether access() and | euidaccess() can be taught to give the "right" answer for files on | such drives. Or maybe the question is simply whether Cygwin can be | taught to determine the correct UID. Sure, but because The network drive is not part of Windows Domain, I'm afraid Cygwin has any means to determine what the correct UID or GID would be are as they have no correspondence on the Windows side. In any case, this is a big problem in daily use; especially because the file system check cannot be ignored, bypassed or configured to "just to go ahead and write without questions". Jari From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Dec 2011 14:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: jari Cc: 10257@debbugs.gnu.org, kbrown@cornell.edu Reply-To: Eli Zaretskii Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132378748219522 (code B ref 10257); Tue, 13 Dec 2011 14:45:01 +0000 Received: (at 10257) by debbugs.gnu.org; 13 Dec 2011 14:44:42 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaTb0-00054o-IV for submit@debbugs.gnu.org; Tue, 13 Dec 2011 09:44:42 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaTay-00054i-PP for 10257@debbugs.gnu.org; Tue, 13 Dec 2011 09:44:41 -0500 Received: from eliz by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RaTZh-0006H7-3R; Tue, 13 Dec 2011 09:43:21 -0500 Date: Tue, 13 Dec 2011 09:43:21 -0500 Message-Id: From: Eli Zaretskii In-reply-to: <20111213140042.GA22678@picasso.cante.net> (message from jari on Tue, 13 Dec 2011 16:00:42 +0200) References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> X-Spam-Score: -6.6 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) > Date: Tue, 13 Dec 2011 16:00:42 +0200 > From: jari > Cc: 10257@debbugs.gnu.org > > | So why don't you ask on the Cygwin list whether access() and > | euidaccess() can be taught to give the "right" answer for files on > | such drives. Or maybe the question is simply whether Cygwin can be > | taught to determine the correct UID. > > Sure, but because The network drive is not part of Windows Domain, I'm > afraid Cygwin has any means to determine what the correct UID or GID > would be are as they have no correspondence on the Windows side. ??? As long as the network drive is mounted using Windows APIs (which must be the case), the NT security features should be fully supported for it. That includes the user and group IDs of every file. So why does Cygwin's `stat' return 4294967295 (which AFAIU is a fancy way of saying -1) for UID and GID of these files? > In any case, this is a big problem in daily use; especially because > the file system check cannot be ignored, bypassed or configured to > "just to go ahead and write without questions". We don't want to put some ad-hoc "solution" into Emacs just because it is urgent for you. We want to understand the problem, and in particular figure out whether it is an Emacs problem or a problem with the Cygwin implementation of some library function. Only then it will be possible to establish what is the best solution. Ken repeatedly suggested that you ask on the Cygwin list about this. I think this is a good idea, as people here (with the exception of Ken) know very little about Cygwin internals. In any case, if you don't wish to follow Ken's advice, but want to solve this urgent problem, you have the sources, don't you? From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Ken Brown Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Dec 2011 15:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 10257@debbugs.gnu.org, jari Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132378924922396 (code B ref 10257); Tue, 13 Dec 2011 15:15:01 +0000 Received: (at 10257) by debbugs.gnu.org; 13 Dec 2011 15:14:09 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaU3U-0005pB-Te for submit@debbugs.gnu.org; Tue, 13 Dec 2011 10:14:09 -0500 Received: from granite1.mail.cornell.edu ([128.253.83.141] helo=authusersmtp.mail.cornell.edu) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaU3S-0005p4-SB for 10257@debbugs.gnu.org; Tue, 13 Dec 2011 10:14:08 -0500 Received: from [128.84.254.146] (rrdhcp254-146.redrover.cornell.edu [128.84.254.146]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id pBDFClON013842 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 13 Dec 2011 10:12:47 -0500 (EST) Message-ID: <4EE76B6E.7070904@cornell.edu> Date: Tue, 13 Dec 2011 10:12:46 -0500 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -5.8 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) I have a question about the emacs side of this. I wonder what the rationale is for testing writability before trying to save the file, and then asking the user for confirmation in case the (unreliable) test for writability fails (*). It might be reasonable to just assume that the user really wants to save the file; the worst thing that can happen is that the write fails. Am I missing something? Ken (*) According to the documentation at http://www.kernel.org/doc/man-pages/online/pages/man3/euidaccess.3.html euidaccess() and access () are not reliable for checking permissions. The advice there is to simply try the desired operation and check for errors. From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: jari Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Dec 2011 16:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 10257@debbugs.gnu.org, kbrown@cornell.edu Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132379367828990 (code B ref 10257); Tue, 13 Dec 2011 16:28:01 +0000 Received: (at 10257) by debbugs.gnu.org; 13 Dec 2011 16:27:58 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaVCw-0007XX-0m for submit@debbugs.gnu.org; Tue, 13 Dec 2011 11:27:58 -0500 Received: from emh07.mail.saunalahti.fi ([62.142.5.117]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaVCs-0007XL-VB for 10257@debbugs.gnu.org; Tue, 13 Dec 2011 11:27:56 -0500 Received: from saunalahti-vams (vs3-10.mail.saunalahti.fi [62.142.5.94]) by emh07-2.mail.saunalahti.fi (Postfix) with SMTP id 8A86C18D1CA; Tue, 13 Dec 2011 18:26:34 +0200 (EET) Received: from emh07.mail.saunalahti.fi ([62.142.5.117]) by vs3-10.mail.saunalahti.fi ([62.142.5.94]) with SMTP (gateway) id A0289686FF5; Tue, 13 Dec 2011 18:26:34 +0200 Received: from picasso.cante.net (a91-155-176-245.elisa-laajakaista.fi [91.155.176.245]) by emh07.mail.saunalahti.fi (Postfix) with ESMTP id 09B3C1C6386; Tue, 13 Dec 2011 18:26:29 +0200 (EET) Received: from jaalto by picasso.cante.net with local (Exim 4.77) (envelope-from ) id 1RaVBU-0002k8-ML; Tue, 13 Dec 2011 18:26:28 +0200 Date: Tue, 13 Dec 2011 18:26:28 +0200 From: jari Message-ID: <20111213162628.GB22678@picasso.cante.net> References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Gpg-Key-Id: 0xD189E680 X-Gpg-Key-Info: http://key-server.de:11371/pks/lookup?search=0xD189E680&op=vindex X-Gpg-Key-Get: ttp://key-server.de:11371/pks/lookup?search=0xD189E680&op=get User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: jaalto@picasso.cante.net X-SA-Exim-Scanned: No (on picasso.cante.net); SAEximRunCond expanded to false X-Antivirus: VAMS X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 2011-12-13 09:43, Eli Zaretskii wrote: | > | So why don't you ask on the Cygwin list whether access() and | > | euidaccess() can be taught to give the "right" answer for files on | > | such drives. Or maybe the question is simply whether Cygwin can be | > | taught to determine the correct UID. | > | > Sure, but because The network drive is not part of Windows Domain, I'm | > afraid Cygwin has any means to determine what the correct UID or GID | > would be are as they have no correspondence on the Windows side. | | ??? As long as the network drive is mounted using Windows APIs (which | must be the case), the NT security features should be fully supported | for it. That includes the user and group IDs of every file. So why | does Cygwin's `stat' return 4294967295 (which AFAIU is a fancy way of | saying -1) for UID and GID of these files? Response from Cygwin list: > $ ls -la /cygdrive/z/tmp/test-epackage.el > -rwxr--r-- 1 ???????? ???????? 437 Dec 9 20:02 /cygdrive/z/tmp/test-epackage.el It's not a bug. If you use winbind and the user accounts are correctly mapped to Windows accounts, then you would see the Cygwin UIDs/GIDs correspoding to the SID of the AD user account. If you don't do that, there's only an invisible mapping from the Windows SID to the Unix uid/gid. The actual UNIX account has not the same mapping back to the Windows SID. Instead, the SID returned from Samba to Windows is a fake SID S-1-22-1-UnixUID or S-1-22-2-UnixGID. (..) The rest goes into details for setting 1:1 UID, GID mapping. Still, - The mapped drive can be written to without any extra 1:1 GUID,UID configuration. - Under Cygwin, should Emacs rely on unreliable[*] UID, GID? - Is there need for this extra prompt? The protective nature turned into nightmare. Much better would be to give control back to the user: (setq write-file-interactive-confirmation-flag nil) This doesn't affect Emacs's ability to signal an error on write failure. Jari [*] Which depend on specific environment and settings user has. The 1:1 setting gets interesting for N servers that may have different UID, GID settings for the same user names; as they may not all be part of the same domain. From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Ken Brown Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Dec 2011 16:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: jari Cc: Eli Zaretskii , 10257@debbugs.gnu.org Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132379525131369 (code B ref 10257); Tue, 13 Dec 2011 16:55:01 +0000 Received: (at 10257) by debbugs.gnu.org; 13 Dec 2011 16:54:11 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaVcI-00089t-JS for submit@debbugs.gnu.org; Tue, 13 Dec 2011 11:54:11 -0500 Received: from granite1.mail.cornell.edu ([128.253.83.141] helo=authusersmtp.mail.cornell.edu) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaVcF-00089k-Lq for 10257@debbugs.gnu.org; Tue, 13 Dec 2011 11:54:09 -0500 Received: from [128.84.234.240] (dhcp240.math.cornell.edu [128.84.234.240]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id pBDGqh7J001247 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 13 Dec 2011 11:52:47 -0500 (EST) Message-ID: <4EE782DB.3030600@cornell.edu> Date: Tue, 13 Dec 2011 11:52:43 -0500 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <20111213162628.GB22678@picasso.cante.net> In-Reply-To: <20111213162628.GB22678@picasso.cante.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -5.8 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) On 12/13/2011 11:26 AM, jari wrote: > Response from Cygwin list: > > > $ ls -la /cygdrive/z/tmp/test-epackage.el > > -rwxr--r-- 1 ???????? ???????? 437 Dec 9 20:02 /cygdrive/z/tmp/test-epackage.el > > It's not a bug. > > If you use winbind and the user accounts are correctly mapped to > Windows accounts, then you would see the Cygwin UIDs/GIDs > correspoding to the SID of the AD user account. > > If you don't do that, there's only an invisible mapping from the > Windows SID to the Unix uid/gid. The actual UNIX account has not > the same mapping back to the Windows SID. Instead, the SID > returned from Samba to Windows is a fake SID S-1-22-1-UnixUID or > S-1-22-2-UnixGID. (..) > > The rest goes into details for setting 1:1 UID, GID mapping. You omitted the part of the response that says, "The easiest way to workaround this issue is to mount the share with the noacl mount option". I also suggested this in my first response to your report. Does this fail to work for some reason? Ken From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: jari Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Dec 2011 17:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ken Brown Cc: Eli Zaretskii , 10257@debbugs.gnu.org Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.13237985874019 (code B ref 10257); Tue, 13 Dec 2011 17:50:01 +0000 Received: (at 10257) by debbugs.gnu.org; 13 Dec 2011 17:49:47 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaWU6-00012m-NF for submit@debbugs.gnu.org; Tue, 13 Dec 2011 12:49:47 -0500 Received: from emh01.mail.saunalahti.fi ([62.142.5.107]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaWU2-00012c-Kn for 10257@debbugs.gnu.org; Tue, 13 Dec 2011 12:49:44 -0500 Received: from saunalahti-vams (vs3-10.mail.saunalahti.fi [62.142.5.94]) by emh01-2.mail.saunalahti.fi (Postfix) with SMTP id E18848C603; Tue, 13 Dec 2011 19:48:21 +0200 (EET) Received: from emh04.mail.saunalahti.fi ([62.142.5.110]) by vs3-10.mail.saunalahti.fi ([62.142.5.94]) with SMTP (gateway) id A076F7DE2BC; Tue, 13 Dec 2011 19:48:21 +0200 Received: from picasso.cante.net (a91-155-176-245.elisa-laajakaista.fi [91.155.176.245]) by emh04.mail.saunalahti.fi (Postfix) with ESMTP id 0F4E141BE2; Tue, 13 Dec 2011 19:48:17 +0200 (EET) Received: from jaalto by picasso.cante.net with local (Exim 4.77) (envelope-from ) id 1RaWSf-0007CS-JE; Tue, 13 Dec 2011 19:48:17 +0200 Date: Tue, 13 Dec 2011 19:48:17 +0200 From: jari Message-ID: <20111213174817.GC22678@picasso.cante.net> References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <20111213162628.GB22678@picasso.cante.net> <4EE782DB.3030600@cornell.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4EE782DB.3030600@cornell.edu> X-Gpg-Key-Id: 0xD189E680 X-Gpg-Key-Info: http://key-server.de:11371/pks/lookup?search=0xD189E680&op=vindex X-Gpg-Key-Get: ttp://key-server.de:11371/pks/lookup?search=0xD189E680&op=get User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: jaalto@picasso.cante.net X-SA-Exim-Scanned: No (on picasso.cante.net); SAEximRunCond expanded to false X-Antivirus: VAMS X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 2011-12-13 11:52, Ken Brown wrote: | On 12/13/2011 11:26 AM, jari wrote: | >Response from Cygwin list: | > | > > $ ls -la /cygdrive/z/tmp/test-epackage.el | > > -rwxr--r-- 1 ???????? ???????? 437 Dec 9 20:02 /cygdrive/z/tmp/test-epackage.el | > | > It's not a bug. | > | > If you use winbind and the user accounts are correctly mapped to | > Windows accounts, then you would see the Cygwin UIDs/GIDs | > correspoding to the SID of the AD user account. | > | > If you don't do that, there's only an invisible mapping from the | > Windows SID to the Unix uid/gid. The actual UNIX account has not | > the same mapping back to the Windows SID. Instead, the SID | > returned from Samba to Windows is a fake SID S-1-22-1-UnixUID or | > S-1-22-2-UnixGID. (..) | > | >The rest goes into details for setting 1:1 UID, GID mapping. | | You omitted the part of the response that says, "The easiest way to | workaround this issue is to mount the share with the noacl mount | option". | Does this fail to work for some reason? That would create a new "Cygwin mount". Different path altogether than what is already in use; mapped by the Windows. In Windows: Z:\ In Cygwin : /cygdrive/z All paths would change if I would Cygwin mount(1) "//server/login /mnt/login ..." /mnt/login /cygdrive/z That would create problems all over the place that now assume certain locations. Not to mention losing ability to copy/paste paths from Windows File Exporer to Cygwin[*] Jari [*] Cygwin accepts drive letter syntax in single quotes: 'z:\' See also cygoath(1). From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Dec 2011 17:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: jari Cc: 10257@debbugs.gnu.org, kbrown@cornell.edu Reply-To: Eli Zaretskii Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.13237986624174 (code B ref 10257); Tue, 13 Dec 2011 17:52:01 +0000 Received: (at 10257) by debbugs.gnu.org; 13 Dec 2011 17:51:02 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaWVK-00015H-I2 for submit@debbugs.gnu.org; Tue, 13 Dec 2011 12:51:02 -0500 Received: from mtaout22.012.net.il ([80.179.55.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaWVI-00014s-TL for 10257@debbugs.gnu.org; Tue, 13 Dec 2011 12:51:02 -0500 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LW500000LFLI900@a-mtaout22.012.net.il> for 10257@debbugs.gnu.org; Tue, 13 Dec 2011 19:48:51 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.229.18.12]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LW500CQNLHDWLH2@a-mtaout22.012.net.il>; Tue, 13 Dec 2011 19:48:51 +0200 (IST) Date: Tue, 13 Dec 2011 19:48:47 +0200 From: Eli Zaretskii In-reply-to: <20111213162628.GB22678@picasso.cante.net> X-012-Sender: halo1@inter.net.il Message-id: <83d3bs8irk.fsf@gnu.org> References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <20111213162628.GB22678@picasso.cante.net> X-Spam-Score: -2.0 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > Date: Tue, 13 Dec 2011 18:26:28 +0200 > From: jari > Cc: kbrown@cornell.edu, 10257@debbugs.gnu.org > > - The mapped drive can be written to without any extra 1:1 GUID,UID > configuration. > - Under Cygwin, should Emacs rely on unreliable[*] UID, GID? > - Is there need for this extra prompt? The protective > nature turned into nightmare. > > Much better would be to give control back to the user: > > (setq write-file-interactive-confirmation-flag nil) > > This doesn't affect Emacs's ability to signal an error on write > failure. Emacs assumes Posix-compliant APIs wrt UID/GID/EUID. Platforms that don't comply with the Posix semantics of these APIs should either (a) become more compliant, or (b) modify the Emacs sources with platform-specific code or #ifdef's to work around the lack of compliance. (Emacs maintainers generally prefer the former possibility, for obvious reasons.) All the other platforms do one or the other; why should Cygwin be different? why should we change long-standing Emacs code because one platform turns out to be non- compliant, and the user refuses to work around the problem by configuring his system in a slightly different way? From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: jari Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Dec 2011 18:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 10257@debbugs.gnu.org, kbrown@cornell.edu Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.13237996385703 (code B ref 10257); Tue, 13 Dec 2011 18:08:01 +0000 Received: (at 10257) by debbugs.gnu.org; 13 Dec 2011 18:07:18 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaWl3-0001Tv-Cb for submit@debbugs.gnu.org; Tue, 13 Dec 2011 13:07:17 -0500 Received: from emh04.mail.saunalahti.fi ([62.142.5.110]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaWky-0001Tj-Pj for 10257@debbugs.gnu.org; Tue, 13 Dec 2011 13:07:15 -0500 Received: from saunalahti-vams (vs3-11.mail.saunalahti.fi [62.142.5.95]) by emh04-2.mail.saunalahti.fi (Postfix) with SMTP id 2D0F913B3B2; Tue, 13 Dec 2011 20:05:52 +0200 (EET) Received: from emh02.mail.saunalahti.fi ([62.142.5.108]) by vs3-11.mail.saunalahti.fi ([62.142.5.95]) with SMTP (gateway) id A015D226071; Tue, 13 Dec 2011 20:05:52 +0200 Received: from picasso.cante.net (a91-155-176-245.elisa-laajakaista.fi [91.155.176.245]) by emh02.mail.saunalahti.fi (Postfix) with ESMTP id 5519B2BD48; Tue, 13 Dec 2011 20:05:48 +0200 (EET) Received: from jaalto by picasso.cante.net with local (Exim 4.77) (envelope-from ) id 1RaWjb-0007Dg-VW; Tue, 13 Dec 2011 20:05:47 +0200 Date: Tue, 13 Dec 2011 20:05:47 +0200 From: jari Message-ID: <20111213180547.GD22678@picasso.cante.net> References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <20111213162628.GB22678@picasso.cante.net> <83d3bs8irk.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83d3bs8irk.fsf@gnu.org> X-Gpg-Key-Id: 0xD189E680 X-Gpg-Key-Info: http://key-server.de:11371/pks/lookup?search=0xD189E680&op=vindex X-Gpg-Key-Get: ttp://key-server.de:11371/pks/lookup?search=0xD189E680&op=get User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: jaalto@picasso.cante.net X-SA-Exim-Scanned: No (on picasso.cante.net); SAEximRunCond expanded to false X-Antivirus: VAMS X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 2011-12-13 19:48, Eli Zaretskii wrote: | > Date: Tue, 13 Dec 2011 18:26:28 +0200 | > From: jari | > Cc: kbrown@cornell.edu, 10257@debbugs.gnu.org | > | > - The mapped drive can be written to without any extra 1:1 GUID,UID | > configuration. | > - Under Cygwin, should Emacs rely on unreliable[*] UID, GID? | > - Is there need for this extra prompt? The protective | > nature turned into nightmare. | > | > Much better would be to give control back to the user: | > | > (setq write-file-interactive-confirmation-flag nil) | > | > This doesn't affect Emacs's ability to signal an error on write | > failure. | | Emacs assumes Posix-compliant APIs wrt UID/GID/EUID. Platforms that | don't comply with the Posix semantics of these APIs should either | (a) become more compliant, or (b) modify the Emacs sources with | platform-specific code or #ifdef's to work around the lack of | compliance. (Emacs maintainers generally prefer the former | possibility, for obvious reasons.) All the other platforms do one | or the other; why should Cygwin be different? why should we change | long-standing Emacs code because one platform turns out to be non- | compliant, and the user refuses to work around the problem by | configuring his system in a slightly different way? The proposed chnage, by letting the use to control the prompting/checking behavior, would solve the issue. As far as I can tell, it wouldn't break anything. User already has a write access to the device. Emacs just doesn't know / guesses wrong / environment is complex / possibly uses wrong methodology (see Ken's notes about using uid, gid for write access check). So why not let user to help it to know via variable? Jari From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Dec 2011 18:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: jari Cc: 10257@debbugs.gnu.org, kbrown@cornell.edu Reply-To: Eli Zaretskii Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.13238014758482 (code B ref 10257); Tue, 13 Dec 2011 18:38:01 +0000 Received: (at 10257) by debbugs.gnu.org; 13 Dec 2011 18:37:55 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaXEh-0002Cl-8o for submit@debbugs.gnu.org; Tue, 13 Dec 2011 13:37:55 -0500 Received: from mtaout20.012.net.il ([80.179.55.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaXEe-0002Ca-Hl for 10257@debbugs.gnu.org; Tue, 13 Dec 2011 13:37:53 -0500 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LW500L00NMC1F00@a-mtaout20.012.net.il> for 10257@debbugs.gnu.org; Tue, 13 Dec 2011 20:36:14 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.229.18.12]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LW500GJRNOCKRH1@a-mtaout20.012.net.il>; Tue, 13 Dec 2011 20:36:14 +0200 (IST) Date: Tue, 13 Dec 2011 20:36:13 +0200 From: Eli Zaretskii In-reply-to: <20111213180547.GD22678@picasso.cante.net> X-012-Sender: halo1@inter.net.il Message-id: <83borc8gki.fsf@gnu.org> References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <20111213162628.GB22678@picasso.cante.net> <83d3bs8irk.fsf@gnu.org> <20111213180547.GD22678@picasso.cante.net> X-Spam-Score: -2.0 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > Date: Tue, 13 Dec 2011 20:05:47 +0200 > From: jari > Cc: kbrown@cornell.edu, 10257@debbugs.gnu.org > > User already has a write access to the device. > > Emacs just doesn't know / guesses wrong / environment is complex / If Cygwin's implementation of the Posix APIs were compliant, it would know/guess correctly. > possibly uses wrong methodology (see Ken's notes about using uid, gid > for write access check). Let's see where the discussion of Ken's questions leads us. Only then we will be able to conclude whether the current methodology is wrong or not. From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Dec 2011 19:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ken Brown Cc: Eli Zaretskii , 10257@debbugs.gnu.org, jari Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132380456013239 (code B ref 10257); Tue, 13 Dec 2011 19:30:02 +0000 Received: (at 10257) by debbugs.gnu.org; 13 Dec 2011 19:29:20 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaY2R-0003RU-TJ for submit@debbugs.gnu.org; Tue, 13 Dec 2011 14:29:20 -0500 Received: from relais.videotron.ca ([24.201.245.36]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaY2Q-0003RJ-7K for 10257@debbugs.gnu.org; Tue, 13 Dec 2011 14:29:18 -0500 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from ceviche.home ([173.176.12.77]) by VL-VM-MR004.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0LW500HNPPVTR340@VL-VM-MR004.ip.videotron.ca> for 10257@debbugs.gnu.org; Tue, 13 Dec 2011 14:23:55 -0500 (EST) Received: by ceviche.home (Postfix, from userid 20848) id 6DF33662EE; Tue, 13 Dec 2011 14:27:33 -0500 (EST) From: Stefan Monnier Message-id: References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <4EE76B6E.7070904@cornell.edu> Date: Tue, 13 Dec 2011 14:27:33 -0500 In-reply-to: <4EE76B6E.7070904@cornell.edu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-Spam-Score: -2.2 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.2 (--) > I have a question about the emacs side of this. I wonder what the rationale > is for testing writability before trying to save the file, and then asking > the user for confirmation in case the (unreliable) test for writability > fails (*). Can you point us to the piece of code about which you're talking? Ideally, show us a sample pseudo patch (even better if it compiles, even better if it works) showing the kind of change you have in mind. Stefan From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Ken Brown Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Dec 2011 20:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Eli Zaretskii , 10257@debbugs.gnu.org, jari Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132380748717774 (code B ref 10257); Tue, 13 Dec 2011 20:19:02 +0000 Received: (at 10257) by debbugs.gnu.org; 13 Dec 2011 20:18:07 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaYne-0004cd-Eo for submit@debbugs.gnu.org; Tue, 13 Dec 2011 15:18:06 -0500 Received: from granite1.mail.cornell.edu ([128.253.83.141] helo=authusersmtp.mail.cornell.edu) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaYna-0004cT-RL for 10257@debbugs.gnu.org; Tue, 13 Dec 2011 15:18:04 -0500 Received: from [128.84.234.240] (dhcp240.math.cornell.edu [128.84.234.240]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id pBDKGfq8006826 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 13 Dec 2011 15:16:41 -0500 (EST) Message-ID: <4EE7B2A9.6060308@cornell.edu> Date: Tue, 13 Dec 2011 15:16:41 -0500 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <4EE76B6E.7070904@cornell.edu> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -5.8 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) On 12/13/2011 2:27 PM, Stefan Monnier wrote: >> I have a question about the emacs side of this. I wonder what the rationale >> is for testing writability before trying to save the file, and then asking >> the user for confirmation in case the (unreliable) test for writability >> fails (*). > > Can you point us to the piece of code about which you're talking? > Ideally, show us a sample pseudo patch (even better if it compiles, even > better if it works) showing the kind of change you have in mind. The code I'm talking about is near the beginning of the definition of `basic-save-buffer-2' in files.el: (if (not (file-writable-p buffer-file-name)) (let ((dir (file-name-directory buffer-file-name))) (if (not (file-directory-p dir)) (if (file-exists-p dir) (error "%s is not a directory" dir) (error "%s: no such directory" dir)) (if (not (file-exists-p buffer-file-name)) (error "Directory %s write-protected" dir) (if (yes-or-no-p (format "File %s is write-protected; try to save anyway? " (file-name-nondirectory buffer-file-name))) (setq tempsetmodes t) (error "Attempt to save to a file which you aren't allowed to write")))))) I'm not (yet) proposing a change. I'm simply asking what the rationale is for calling `yes-or-no-p' and making the user confirm that s/he wants to try to save the file. I don't see that any harm would come from just trying to do what the user asked for, without making him/her ask a second time. If the file really is write-protected, there will be an error. If you agree, then I guess I would propose the following patch (not yet tested): === modified file 'lisp/files.el' --- lisp/files.el 2011-12-04 08:02:42 +0000 +++ lisp/files.el 2011-12-13 20:08:55 +0000 @@ -4456,13 +4456,7 @@ (error "%s: no such directory" dir)) (if (not (file-exists-p buffer-file-name)) (error "Directory %s write-protected" dir) - (if (yes-or-no-p - (format - "File %s is write-protected; try to save anyway? " - (file-name-nondirectory - buffer-file-name))) - (setq tempsetmodes t) - (error "Attempt to save to a file which you aren't allowed to write")))))) + (setq tempsetmodes t))))) (or buffer-backed-up (setq setmodes (backup-buffer))) (let* ((dir (file-name-directory buffer-file-name)) Ken From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Dec 2011 02:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ken Brown Cc: Eli Zaretskii , 10257@debbugs.gnu.org, jari Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132383137020239 (code B ref 10257); Wed, 14 Dec 2011 02:57:01 +0000 Received: (at 10257) by debbugs.gnu.org; 14 Dec 2011 02:56:10 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Raf0s-0005GN-0G for submit@debbugs.gnu.org; Tue, 13 Dec 2011 21:56:10 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Raf0p-0005GG-Vf for 10257@debbugs.gnu.org; Tue, 13 Dec 2011 21:56:08 -0500 Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id pBE2sdwn003646; Tue, 13 Dec 2011 21:54:39 -0500 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id A3F5BB42CF; Tue, 13 Dec 2011 21:54:39 -0500 (EST) From: Stefan Monnier Message-ID: References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <4EE76B6E.7070904@cornell.edu> <4EE7B2A9.6060308@cornell.edu> Date: Tue, 13 Dec 2011 21:54:39 -0500 In-Reply-To: <4EE7B2A9.6060308@cornell.edu> (Ken Brown's message of "Tue, 13 Dec 2011 15:16:41 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4070=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4070> : streams <710396> : uri <1027433> X-Spam-Score: -4.6 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.6 (----) > The code I'm talking about is near the beginning of the definition of > basic-save-buffer-2' in files.el: Thanks. > I'm not (yet) proposing a change. I'm simply asking what the rationale is > for calling `yes-or-no-p' and making the user confirm that s/he wants to try > to save the file. I'm not sure what was the intention, but I know that this code is triggered in cases such as: - running as root: write will always succeed. - saving to a read-only file that you own: while `write' will fail, you can make it succeed by changing the access rights (which is what tempsetmodes is for). - saving to a read-only file in a writable dir: write will fail, but you can make it succeed by calling unlink first [Not sure if this works in Emacs right now]. In all these cases, Emacs is able to write the file, but the read-only bit expresses an intention not to modify the file so it makes sense to ask for confirmation. This said, the code you quote should never prevent you from saving a file, it should only ask for confirmation (i.e. it might be annoying but it shouldn't prevent you from getting your work done). But other than for the "running as root" case, the above two cases could replace the `file-writable-p' test with a `write-region' test: file-writable-p is documented (via POSIX's documentation of `access') to be an approximation, whereas `write-region' should reliably tell us whether we can write to the file. > I don't see that any harm would come from just trying to > do what the user asked for, without making him/her ask a second time. I'm not sure what second time you're thinking of. > If you agree, then I guess I would propose the following patch (not yet > tested): Your patch would probably remove the ability to save to a read-only file. Stefan From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Ken Brown Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Dec 2011 03:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Eli Zaretskii , 10257@debbugs.gnu.org, jari Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132383332223069 (code B ref 10257); Wed, 14 Dec 2011 03:29:02 +0000 Received: (at 10257) by debbugs.gnu.org; 14 Dec 2011 03:28:42 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RafWM-000602-4n for submit@debbugs.gnu.org; Tue, 13 Dec 2011 22:28:42 -0500 Received: from granite1.mail.cornell.edu ([128.253.83.141] helo=authusersmtp.mail.cornell.edu) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RafWJ-0005zu-DU for 10257@debbugs.gnu.org; Tue, 13 Dec 2011 22:28:40 -0500 Received: from [192.168.1.3] (cpe-67-249-194-47.twcny.res.rr.com [67.249.194.47]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id pBE3RFXQ012348 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 13 Dec 2011 22:27:16 -0500 (EST) Message-ID: <4EE8178F.5040004@cornell.edu> Date: Tue, 13 Dec 2011 22:27:11 -0500 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <4EE76B6E.7070904@cornell.edu> <4EE7B2A9.6060308@cornell.edu> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -5.8 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) On 12/13/2011 9:54 PM, Stefan Monnier wrote: >> The code I'm talking about is near the beginning of the definition of >> basic-save-buffer-2' in files.el: > > Thanks. > >> I'm not (yet) proposing a change. I'm simply asking what the rationale is >> for calling `yes-or-no-p' and making the user confirm that s/he wants to try >> to save the file. > > I'm not sure what was the intention, but I know that this code is > triggered in cases such as: > - running as root: write will always succeed. > - saving to a read-only file that you own: while `write' will fail, > you can make it succeed by changing the access rights (which is what > tempsetmodes is for). > - saving to a read-only file in a writable dir: write will fail, but > you can make it succeed by calling unlink first [Not sure if this > works in Emacs right now]. > In all these cases, Emacs is able to write the file, but the read-only > bit expresses an intention not to modify the file so it makes sense to > ask for confirmation. There's a fourth case, and that's what led to the present bug report (by Jari): - saving to a file that is in fact writable, for which file-writable-p gives the wrong answer. > This said, the code you quote should never prevent you from saving > a file, it should only ask for confirmation (i.e. it might be annoying > but it shouldn't prevent you from getting your work done). Jari was annoyed to the point where he felt he couldn't get his work done. He's in a situation where file-writable-p will consistently report that a file is not writable, but writing will in fact succeed. I was trying to help him find a way to avoid having to repeatedly confirm that he wants to save. > But other than for the "running as root" case, the above two cases could > replace the `file-writable-p' test with a `write-region' test: > file-writable-p is documented (via POSIX's documentation of `access') to > be an approximation, whereas `write-region' should reliably tell us > whether we can write to the file. So that sounds like a solution to Jari's problem. I'll leave it to him to propose a patch along those lines. Ken From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Jari Aalto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Dec 2011 08:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ken Brown Cc: Eli Zaretskii , 10257@debbugs.gnu.org, Stefan Monnier , jari Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132384980314894 (code B ref 10257); Wed, 14 Dec 2011 08:04:01 +0000 Received: (at 10257) by debbugs.gnu.org; 14 Dec 2011 08:03:23 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RajoA-0003sB-G1 for submit@debbugs.gnu.org; Wed, 14 Dec 2011 03:03:22 -0500 Received: from emh07.mail.saunalahti.fi ([62.142.5.117]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rajo5-0003s1-Vh for 10257@debbugs.gnu.org; Wed, 14 Dec 2011 03:03:20 -0500 Received: from saunalahti-vams (vs3-10.mail.saunalahti.fi [62.142.5.94]) by emh07-2.mail.saunalahti.fi (Postfix) with SMTP id 2A08718D46B; Wed, 14 Dec 2011 10:01:54 +0200 (EET) Received: from emh03.mail.saunalahti.fi ([62.142.5.109]) by vs3-10.mail.saunalahti.fi ([62.142.5.94]) with SMTP (gateway) id A07BF425393; Wed, 14 Dec 2011 10:01:54 +0200 Received: from picasso.cante.net (a91-155-176-245.elisa-laajakaista.fi [91.155.176.245]) by emh03.mail.saunalahti.fi (Postfix) with ESMTP id 72FD4158A68; Wed, 14 Dec 2011 10:01:47 +0200 (EET) Received: from jaalto by picasso.cante.net with local (Exim 4.77) (envelope-from ) id 1Rajmd-00019V-H0; Wed, 14 Dec 2011 10:01:47 +0200 From: Jari Aalto References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <4EE76B6E.7070904@cornell.edu> <4EE7B2A9.6060308@cornell.edu> <4EE8178F.5040004@cornell.edu> Mail-Copies-To: poster Date: Wed, 14 Dec 2011 10:01:47 +0200 In-Reply-To: <4EE8178F.5040004@cornell.edu> (Ken Brown's message of "Tue, 13 Dec 2011 22:27:11 -0500") Message-ID: <87liqf1t04.fsf@picasso.cante.net> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: jari.aalto@cante.net X-SA-Exim-Scanned: No (on picasso.cante.net); SAEximRunCond expanded to false X-Antivirus: VAMS X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) --=-=-= Content-Type: text/plain 2011-12-14 05:27 Ken Brown : | On 12/13/2011 9:54 PM, Stefan Monnier wrote: | >> The code I'm talking about is near the beginning of the definition of | >> basic-save-buffer-2' in files.el: | > | > I'm not sure what was the intention, but I know that this code is | > triggered in cases such as: | [snip] | | (... and) saving to a file that is in fact writable, for which | file-writable-p gives the wrong answer. | | > This said, the code you quote should never prevent you from saving | > a file, it should only ask for confirmation (i.e. it might be annoying | > but it shouldn't prevent you from getting your work done). For occasional confirmation, this is acceptable. But in this case every single save is prompted while I know I have a write access. The protective prompting turned into nightmare. I'm proposing following, Jari 2011-12-14 Jari Aalto * files.el (basic-save-buffer-2): Add `save-buffer-read-only-confirm-flag' to control asking to a write-protected file. (save-buffer-read-only-confirm-flag): New user variable (bug#10257). --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Add-user-variable-to-control-asking-to-a-write-prote.patch >From 5e1873b417fd5bc79a05339cb9d1e1aacb57164a Mon Sep 17 00:00:00 2001 From: Jari Aalto Date: Wed, 14 Dec 2011 10:00:38 +0200 Subject: [PATCH] Add user variable to control asking to a write-protected file. Organization: Private Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit files.el (basic-save-buffer-2): Add `save-buffer-read-only-confirm-flag' (save-buffer-read-only-confirm-flag): New user variable (bug#10257). Signed-off-by: Jari Aalto --- lisp/files.el | 23 ++++++++++++++++------- 1 files changed, 16 insertions(+), 7 deletions(-) diff --git a/lisp/files.el b/lisp/files.el index 40b6e7d..52c11b7 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4445,9 +4445,17 @@ Before and after saving the buffer, this function runs (setq buffer-file-coding-system-explicit (cons last-coding-system-used nil))))) +;; See 2011-12-09 Emacs Bug#10257 for details +(defvar save-buffer-read-only-confirm-flag t + "*If non-nil, do not ask writable confiramtion in `basic-save-buffer-2'. +Useful e.g. under Cygwin where the returned read-only status of +a file may not be accurate over Windows mapped network drives.") + ;; This returns a value (MODES SELINUXCONTEXT BACKUPNAME), like backup-buffer. (defun basic-save-buffer-2 () (let (tempsetmodes setmodes) + ;; Note: the file-writable-p checks + ;; UID, GID which are not necessarily correct e.g. under Cygwin. (if (not (file-writable-p buffer-file-name)) (let ((dir (file-name-directory buffer-file-name))) (if (not (file-directory-p dir)) @@ -4456,13 +4464,14 @@ Before and after saving the buffer, this function runs (error "%s: no such directory" dir)) (if (not (file-exists-p buffer-file-name)) (error "Directory %s write-protected" dir) - (if (yes-or-no-p - (format - "File %s is write-protected; try to save anyway? " - (file-name-nondirectory - buffer-file-name))) - (setq tempsetmodes t) - (error "Attempt to save to a file which you aren't allowed to write")))))) + (if save-buffer-read-only-confirm-flag + (if (yes-or-no-p + (format + "File %s is write-protected; try to save anyway? " + (file-name-nondirectory + buffer-file-name))) + (setq tempsetmodes t) + (error "Attempt to save to a file which you aren't allowed to write"))))))) (or buffer-backed-up (setq setmodes (backup-buffer))) (let* ((dir (file-name-directory buffer-file-name)) -- 1.7.7.3 --=-=-=-- From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Dec 2011 08:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jari Aalto Cc: 10257@debbugs.gnu.org, monnier@iro.umontreal.ca, kbrown@cornell.edu, jari.aalto@cante.net Reply-To: Eli Zaretskii Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132385179417752 (code B ref 10257); Wed, 14 Dec 2011 08:37:01 +0000 Received: (at 10257) by debbugs.gnu.org; 14 Dec 2011 08:36:34 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RakKH-0004cH-M9 for submit@debbugs.gnu.org; Wed, 14 Dec 2011 03:36:33 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RakKF-0004cA-9W for 10257@debbugs.gnu.org; Wed, 14 Dec 2011 03:36:32 -0500 Received: from eliz by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RakIt-0003NH-Lz; Wed, 14 Dec 2011 03:35:07 -0500 Date: Wed, 14 Dec 2011 03:35:07 -0500 Message-Id: From: Eli Zaretskii In-reply-to: <87liqf1t04.fsf@picasso.cante.net> (message from Jari Aalto on Wed, 14 Dec 2011 10:01:47 +0200) References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <4EE76B6E.7070904@cornell.edu> <4EE7B2A9.6060308@cornell.edu> <4EE8178F.5040004@cornell.edu> <87liqf1t04.fsf@picasso.cante.net> X-Spam-Score: -6.6 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) > From: Jari Aalto > Cc: Stefan Monnier , Eli Zaretskii , 10257@debbugs.gnu.org, jari > Date: Wed, 14 Dec 2011 10:01:47 +0200 > > I'm proposing following, > Jari > > 2011-12-14 Jari Aalto > > * files.el (basic-save-buffer-2): Add > `save-buffer-read-only-confirm-flag' to control asking to a > write-protected file. > (save-buffer-read-only-confirm-flag): New user variable > (bug#10257). Yuck! Are we going to add a knob for every possible misconfiguration of network filesystems and/or for every incompatibility in Posix emulation layers on Windows? Up till now, the way to deal with this was either to change the generic code (where it was deemed to be deficient in the first place), or ask the maintainers of the platform to fix that either in the platform libraries or in platform-specific code in Emacs. I think that is the right way; adding a user option every time is not, IMNSHO. If native Windows and even MS-DOS ports can DTRT with this, then how come Cygwin cannot? From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Ken Brown Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Dec 2011 12:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 10257@debbugs.gnu.org, monnier@iro.umontreal.ca, Jari Aalto Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.13238655835383 (code B ref 10257); Wed, 14 Dec 2011 12:27:02 +0000 Received: (at 10257) by debbugs.gnu.org; 14 Dec 2011 12:26:23 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ranug-0001Ol-2T for submit@debbugs.gnu.org; Wed, 14 Dec 2011 07:26:23 -0500 Received: from granite1.mail.cornell.edu ([128.253.83.141] helo=authusersmtp.mail.cornell.edu) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ranud-0001Ob-68 for 10257@debbugs.gnu.org; Wed, 14 Dec 2011 07:26:20 -0500 Received: from [192.168.1.3] (cpe-67-249-194-47.twcny.res.rr.com [67.249.194.47]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id pBECOrHF023282 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 14 Dec 2011 07:24:54 -0500 (EST) Message-ID: <4EE89590.2040503@cornell.edu> Date: Wed, 14 Dec 2011 07:24:48 -0500 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <4EE76B6E.7070904@cornell.edu> <4EE7B2A9.6060308@cornell.edu> <4EE8178F.5040004@cornell.edu> <87liqf1t04.fsf@picasso.cante.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -5.8 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) On 12/14/2011 3:35 AM, Eli Zaretskii wrote: >> From: Jari Aalto >> Cc: Stefan Monnier, Eli Zaretskii, 10257@debbugs.gnu.org, jari >> Date: Wed, 14 Dec 2011 10:01:47 +0200 >> >> I'm proposing following, >> Jari >> >> 2011-12-14 Jari Aalto >> >> * files.el (basic-save-buffer-2): Add >> `save-buffer-read-only-confirm-flag' to control asking to a >> write-protected file. >> (save-buffer-read-only-confirm-flag): New user variable >> (bug#10257). > > Yuck! Are we going to add a knob for every possible misconfiguration > of network filesystems and/or for every incompatibility in Posix > emulation layers on Windows? > > Up till now, the way to deal with this was either to change the > generic code (where it was deemed to be deficient in the first place), > or ask the maintainers of the platform to fix that either in the > platform libraries or in platform-specific code in Emacs. I think > that is the right way; adding a user option every time is not, IMNSHO. > > If native Windows and even MS-DOS ports can DTRT with this, then how > come Cygwin cannot? The MS-DOS port uses system-specific code in `check_writable' (see fileio.c). I don't know whether the native Windows port DTRT for Jari's network filesystem. Jari, can you test this? Ken From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Ken Brown Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Dec 2011 12:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 10257@debbugs.gnu.org, Jari Aalto Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132386740210936 (code B ref 10257); Wed, 14 Dec 2011 12:57:01 +0000 Received: (at 10257) by debbugs.gnu.org; 14 Dec 2011 12:56:42 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaoO1-0002qL-Vv for submit@debbugs.gnu.org; Wed, 14 Dec 2011 07:56:42 -0500 Received: from granite1.mail.cornell.edu ([128.253.83.141] helo=authusersmtp.mail.cornell.edu) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaoNy-0002qC-JC for 10257@debbugs.gnu.org; Wed, 14 Dec 2011 07:56:40 -0500 Received: from [192.168.1.3] (cpe-67-249-194-47.twcny.res.rr.com [67.249.194.47]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id pBECtCOF027077 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 14 Dec 2011 07:55:13 -0500 (EST) Message-ID: <4EE89CAB.8080301@cornell.edu> Date: Wed, 14 Dec 2011 07:55:07 -0500 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <4EE76B6E.7070904@cornell.edu> <4EE7B2A9.6060308@cornell.edu> <4EE8178F.5040004@cornell.edu> <87liqf1t04.fsf@picasso.cante.net> <4EE89590.2040503@cornell.edu> In-Reply-To: <4EE89590.2040503@cornell.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -5.8 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) On 12/14/2011 7:24 AM, Ken Brown wrote: > On 12/14/2011 3:35 AM, Eli Zaretskii wrote: >>> From: Jari Aalto >>> Cc: Stefan Monnier, Eli >>> Zaretskii, 10257@debbugs.gnu.org, >>> jari >>> Date: Wed, 14 Dec 2011 10:01:47 +0200 >>> >>> I'm proposing following, >>> Jari >>> >>> 2011-12-14 Jari Aalto >>> >>> * files.el (basic-save-buffer-2): Add >>> `save-buffer-read-only-confirm-flag' to control asking to a >>> write-protected file. >>> (save-buffer-read-only-confirm-flag): New user variable >>> (bug#10257). >> >> Yuck! Are we going to add a knob for every possible misconfiguration >> of network filesystems and/or for every incompatibility in Posix >> emulation layers on Windows? >> >> Up till now, the way to deal with this was either to change the >> generic code (where it was deemed to be deficient in the first place), >> or ask the maintainers of the platform to fix that either in the >> platform libraries or in platform-specific code in Emacs. I think >> that is the right way; adding a user option every time is not, IMNSHO. >> >> If native Windows and even MS-DOS ports can DTRT with this, then how >> come Cygwin cannot? > > The MS-DOS port uses system-specific code in `check_writable' (see > fileio.c). I don't know whether the native Windows port DTRT for Jari's > network filesystem. Jari, can you test this? Ignore my question. I don't think it's relevant, nor do I think there's any need for Cygwin-specific code in emacs to deal with this. As I understand it, this is a filesystem problem: Samba returns a fake SID to Windows, so Cygwin can't determine the correct uid/gid. Jari, you were already told on the Cygwin list how to work around this problem. Why not just do it? Ken From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Dec 2011 13:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ken Brown Cc: 10257@debbugs.gnu.org, jari.aalto@cante.net Reply-To: Eli Zaretskii Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132386829415221 (code B ref 10257); Wed, 14 Dec 2011 13:12:01 +0000 Received: (at 10257) by debbugs.gnu.org; 14 Dec 2011 13:11:34 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaocP-0003xS-S4 for submit@debbugs.gnu.org; Wed, 14 Dec 2011 08:11:33 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaocO-0003xL-5Y for 10257@debbugs.gnu.org; Wed, 14 Dec 2011 08:11:32 -0500 Received: from eliz by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1Raob0-0001RU-If; Wed, 14 Dec 2011 08:10:06 -0500 Date: Wed, 14 Dec 2011 08:10:06 -0500 Message-Id: From: Eli Zaretskii In-reply-to: <4EE89CAB.8080301@cornell.edu> (message from Ken Brown on Wed, 14 Dec 2011 07:55:07 -0500) References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <4EE76B6E.7070904@cornell.edu> <4EE7B2A9.6060308@cornell.edu> <4EE8178F.5040004@cornell.edu> <87liqf1t04.fsf@picasso.cante.net> <4EE89590.2040503@cornell.edu> <4EE89CAB.8080301@cornell.edu> X-Spam-Score: -6.6 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) > Date: Wed, 14 Dec 2011 07:55:07 -0500 > From: Ken Brown > CC: 10257@debbugs.gnu.org, Jari Aalto > > As I understand it, this is a filesystem problem: Samba returns a > fake SID to Windows, so Cygwin can't determine the correct uid/gid. > Jari, you were already told on the Cygwin list how to work around > this problem. Why not just do it? Either that, or make euidaccess/check_writable return success in such cases. After all, it is well known that on Windows the equivalent of euidaccess (AccessCheck and its ilk) is even more of an approximation than on Posix, due to implicit access rights granted through membership in multiple user groups. From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: jari Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Dec 2011 14:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ken Brown Cc: Eli Zaretskii , 10257@debbugs.gnu.org Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132387221521113 (code B ref 10257); Wed, 14 Dec 2011 14:17:01 +0000 Received: (at 10257) by debbugs.gnu.org; 14 Dec 2011 14:16:55 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rapdf-0005UU-Bx for submit@debbugs.gnu.org; Wed, 14 Dec 2011 09:16:55 -0500 Received: from emh07.mail.saunalahti.fi ([62.142.5.117]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rapdb-0005UK-CP for 10257@debbugs.gnu.org; Wed, 14 Dec 2011 09:16:53 -0500 Received: from saunalahti-vams (vs3-11.mail.saunalahti.fi [62.142.5.95]) by emh07-2.mail.saunalahti.fi (Postfix) with SMTP id CBACF18CDFC; Wed, 14 Dec 2011 16:15:25 +0200 (EET) Received: from emh04.mail.saunalahti.fi ([62.142.5.110]) by vs3-11.mail.saunalahti.fi ([62.142.5.95]) with SMTP (gateway) id A046A7C8D34; Wed, 14 Dec 2011 16:15:25 +0200 Received: from picasso.cante.net (a91-155-176-245.elisa-laajakaista.fi [91.155.176.245]) by emh04.mail.saunalahti.fi (Postfix) with ESMTP id 15A1241BE9; Wed, 14 Dec 2011 16:15:21 +0200 (EET) Received: from jaalto by picasso.cante.net with local (Exim 4.77) (envelope-from ) id 1Rapc9-00049b-Hj; Wed, 14 Dec 2011 16:15:21 +0200 Date: Wed, 14 Dec 2011 16:15:21 +0200 From: jari Message-ID: <20111214141521.GE22678@picasso.cante.net> References: <4EE76B6E.7070904@cornell.edu> <4EE7B2A9.6060308@cornell.edu> <4EE8178F.5040004@cornell.edu> <87liqf1t04.fsf@picasso.cante.net> <4EE89590.2040503@cornell.edu> <4EE89CAB.8080301@cornell.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4EE89CAB.8080301@cornell.edu> X-Gpg-Key-Id: 0xD189E680 X-Gpg-Key-Info: http://key-server.de:11371/pks/lookup?search=0xD189E680&op=vindex X-Gpg-Key-Get: ttp://key-server.de:11371/pks/lookup?search=0xD189E680&op=get User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: jaalto@picasso.cante.net X-SA-Exim-Scanned: No (on picasso.cante.net); SAEximRunCond expanded to false X-Antivirus: VAMS X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 2011-12-14 07:55, Ken Brown wrote: | ... | >> [Eli] or ask the maintainers of the platform to fix that either in the | >> platform libraries or in platform-specific code in Emacs. I think | >> that is the right way; adding a user option every time is not, IMNSHO. | >> | >> If native Windows and even MS-DOS ports can DTRT with this, then how | >> come Cygwin cannot? To recap: - Cygwin can, but it needs special setup. This setup is not trivial: if you intend to use same Windows Mapped Network Drive. If you use mount(1), you lose Windows File Manager Integration because paths are no longer the same. - Emacs can't rely on UID, GID on Cygwin to be correct. | >The MS-DOS port uses system-specific code in `check_writable' (see | >fileio.c). I don't know whether the native Windows port DTRT for Jari's | >network filesystem. Jari, can you test this? Yes, Windows NT EMacs port works fine. No problems - File on remote drive are not marked read-only - File on remote drive are written without asking. | As I understand it, this is a filesystem problem: Samba returns a | fake SID to Windows, so Cygwin can't determine the correct uid/gid. Yes. | Jari, you were already told on the Cygwin list how to work around | this problem. Why not just do it? It's too complex, and doesn't work with multiple Samaba severs that would use all different GID, UIDs for the same user name, and I cannot get right UIDs and GIDs installed ... too many issues. I can work just fine under Cygwin without these GID, UIDs set. But I can't use Emacs effectively. I would expect there to be at least an option to control these pre-emptive confirmation questions. Without any control, the situation is a nightmare. Compare: confirm-kill-emacs dired-no-confirm message-kill-buffer-on-exit vc-suppress-confirm ... Jari From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Ken Brown Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Dec 2011 14:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 10257@debbugs.gnu.org, jari.aalto@cante.net Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132387244521460 (code B ref 10257); Wed, 14 Dec 2011 14:21:02 +0000 Received: (at 10257) by debbugs.gnu.org; 14 Dec 2011 14:20:45 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaphM-0005a3-2E for submit@debbugs.gnu.org; Wed, 14 Dec 2011 09:20:44 -0500 Received: from granite1.mail.cornell.edu ([128.253.83.141] helo=authusersmtp.mail.cornell.edu) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaphJ-0005Zv-89 for 10257@debbugs.gnu.org; Wed, 14 Dec 2011 09:20:42 -0500 Received: from [128.84.234.240] (dhcp240.math.cornell.edu [128.84.234.240]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id pBEEJFo9010332 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 14 Dec 2011 09:19:15 -0500 (EST) Message-ID: <4EE8B064.8080803@cornell.edu> Date: Wed, 14 Dec 2011 09:19:16 -0500 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <4EE76B6E.7070904@cornell.edu> <4EE7B2A9.6060308@cornell.edu> <4EE8178F.5040004@cornell.edu> <87liqf1t04.fsf@picasso.cante.net> <4EE89590.2040503@cornell.edu> <4EE89CAB.8080301@cornell.edu> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -5.8 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) On 12/14/2011 8:10 AM, Eli Zaretskii wrote: >> Date: Wed, 14 Dec 2011 07:55:07 -0500 >> From: Ken Brown >> CC: 10257@debbugs.gnu.org, Jari Aalto >> >> As I understand it, this is a filesystem problem: Samba returns a >> fake SID to Windows, so Cygwin can't determine the correct uid/gid. >> Jari, you were already told on the Cygwin list how to work around >> this problem. Why not just do it? > > Either that, or make euidaccess/check_writable return success in such > cases. I don't know how to determine what "such cases" are. In the case at hand, Jari has a network filesystem that is configured in such a way that the uid/gid of a file can't be determined by standard system calls. As explained on the Cygwin list, he can set up his /etc/passwd and /etc/group to work around this. [He has to map the fake SID returned by Samba to a real one.] If he doesn't want to do that, I think it would clearly be wrong for euidaccess to return success. Maybe check_writable could be a little more lenient, but I'm not sure what the implications of that would be. Ken From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Ken Brown Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Dec 2011 14:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: jari Cc: Eli Zaretskii , 10257@debbugs.gnu.org Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132387307622400 (code B ref 10257); Wed, 14 Dec 2011 14:32:01 +0000 Received: (at 10257) by debbugs.gnu.org; 14 Dec 2011 14:31:16 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaprX-0005pF-T1 for submit@debbugs.gnu.org; Wed, 14 Dec 2011 09:31:16 -0500 Received: from granite1.mail.cornell.edu ([128.253.83.141] helo=authusersmtp.mail.cornell.edu) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaprT-0005p5-Ta for 10257@debbugs.gnu.org; Wed, 14 Dec 2011 09:31:14 -0500 Received: from [128.84.234.240] (dhcp240.math.cornell.edu [128.84.234.240]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id pBEETk3n012334 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 14 Dec 2011 09:29:46 -0500 (EST) Message-ID: <4EE8B2DB.70707@cornell.edu> Date: Wed, 14 Dec 2011 09:29:47 -0500 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 References: <4EE76B6E.7070904@cornell.edu> <4EE7B2A9.6060308@cornell.edu> <4EE8178F.5040004@cornell.edu> <87liqf1t04.fsf@picasso.cante.net> <4EE89590.2040503@cornell.edu> <4EE89CAB.8080301@cornell.edu> <20111214141521.GE22678@picasso.cante.net> In-Reply-To: <20111214141521.GE22678@picasso.cante.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -5.8 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) On 12/14/2011 9:15 AM, jari wrote: > Yes, Windows NT EMacs port works fine. No problems > > - File on remote drive are not marked read-only > - File on remote drive are written without asking. So can you look into how the native Windows port implements check_writable? Maybe we can do something similar on Cygwin. Ken From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: jari Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Dec 2011 14:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ken Brown Cc: Eli Zaretskii , 10257@debbugs.gnu.org Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132387388823616 (code B ref 10257); Wed, 14 Dec 2011 14:45:02 +0000 Received: (at 10257) by debbugs.gnu.org; 14 Dec 2011 14:44:48 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Raq4e-00068r-OI for submit@debbugs.gnu.org; Wed, 14 Dec 2011 09:44:48 -0500 Received: from emh06.mail.saunalahti.fi ([62.142.5.116]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Raq4b-00068i-DV for 10257@debbugs.gnu.org; Wed, 14 Dec 2011 09:44:47 -0500 Received: from saunalahti-vams (vs3-11.mail.saunalahti.fi [62.142.5.95]) by emh06-2.mail.saunalahti.fi (Postfix) with SMTP id D25D4C8096; Wed, 14 Dec 2011 16:43:19 +0200 (EET) Received: from emh01.mail.saunalahti.fi ([62.142.5.107]) by vs3-11.mail.saunalahti.fi ([62.142.5.95]) with SMTP (gateway) id A07A9ACEE16; Wed, 14 Dec 2011 16:43:19 +0200 Received: from picasso.cante.net (a91-155-176-245.elisa-laajakaista.fi [91.155.176.245]) by emh01.mail.saunalahti.fi (Postfix) with ESMTP id C5C7A4042; Wed, 14 Dec 2011 16:43:15 +0200 (EET) Received: from jaalto by picasso.cante.net with local (Exim 4.77) (envelope-from ) id 1Raq39-0004Gw-KN; Wed, 14 Dec 2011 16:43:15 +0200 Date: Wed, 14 Dec 2011 16:43:15 +0200 From: jari Message-ID: <20111214144315.GF22678@picasso.cante.net> References: <4EE7B2A9.6060308@cornell.edu> <4EE8178F.5040004@cornell.edu> <87liqf1t04.fsf@picasso.cante.net> <4EE89590.2040503@cornell.edu> <4EE89CAB.8080301@cornell.edu> <20111214141521.GE22678@picasso.cante.net> <4EE8B2DB.70707@cornell.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4EE8B2DB.70707@cornell.edu> X-Gpg-Key-Id: 0xD189E680 X-Gpg-Key-Info: http://key-server.de:11371/pks/lookup?search=0xD189E680&op=vindex X-Gpg-Key-Get: ttp://key-server.de:11371/pks/lookup?search=0xD189E680&op=get User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: jaalto@picasso.cante.net X-SA-Exim-Scanned: No (on picasso.cante.net); SAEximRunCond expanded to false X-Antivirus: VAMS X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 2011-12-14 09:29, Ken Brown wrote: | On 12/14/2011 9:15 AM, jari wrote: | >Yes, Windows NT EMacs port works fine. No problems | > | >- File on remote drive are not marked read-only | >- File on remote drive are written without asking. | | So can you look into how the native Windows port implements | check_writable? Maybe we can do something similar on Cygwin. I only have the *.exe Jari From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: jari Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Dec 2011 14:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ken Brown Cc: Eli Zaretskii , 10257@debbugs.gnu.org Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132387411826818 (code B ref 10257); Wed, 14 Dec 2011 14:49:02 +0000 Received: (at 10257) by debbugs.gnu.org; 14 Dec 2011 14:48:38 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Raq8L-0006yU-83 for submit@debbugs.gnu.org; Wed, 14 Dec 2011 09:48:38 -0500 Received: from emh02.mail.saunalahti.fi ([62.142.5.108]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Raq8I-0006yJ-TC for 10257@debbugs.gnu.org; Wed, 14 Dec 2011 09:48:35 -0500 Received: from saunalahti-vams (vs3-12.mail.saunalahti.fi [62.142.5.96]) by emh02-2.mail.saunalahti.fi (Postfix) with SMTP id E8F28EF815; Wed, 14 Dec 2011 16:47:09 +0200 (EET) Received: from emh07.mail.saunalahti.fi ([62.142.5.117]) by vs3-12.mail.saunalahti.fi ([62.142.5.96]) with SMTP (gateway) id A0353FC48C7; Wed, 14 Dec 2011 16:47:09 +0200 Received: from picasso.cante.net (a91-155-176-245.elisa-laajakaista.fi [91.155.176.245]) by emh07.mail.saunalahti.fi (Postfix) with ESMTP id 64A981C6382; Wed, 14 Dec 2011 16:47:06 +0200 (EET) Received: from jaalto by picasso.cante.net with local (Exim 4.77) (envelope-from ) id 1Raq6s-0004HF-5P; Wed, 14 Dec 2011 16:47:06 +0200 Date: Wed, 14 Dec 2011 16:47:06 +0200 From: jari Message-ID: <20111214144706.GG22678@picasso.cante.net> References: <4EE7B2A9.6060308@cornell.edu> <4EE8178F.5040004@cornell.edu> <87liqf1t04.fsf@picasso.cante.net> <4EE89590.2040503@cornell.edu> <4EE89CAB.8080301@cornell.edu> <4EE8B064.8080803@cornell.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4EE8B064.8080803@cornell.edu> X-Gpg-Key-Id: 0xD189E680 X-Gpg-Key-Info: http://key-server.de:11371/pks/lookup?search=0xD189E680&op=vindex X-Gpg-Key-Get: ttp://key-server.de:11371/pks/lookup?search=0xD189E680&op=get User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: jaalto@picasso.cante.net X-SA-Exim-Scanned: No (on picasso.cante.net); SAEximRunCond expanded to false X-Antivirus: VAMS X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 2011-12-14 09:19, Ken Brown wrote: | >>As I understand it, this is a filesystem problem: Samba returns a | >>fake SID to Windows, so Cygwin can't determine the correct uid/gid. | > | >Either that, or make euidaccess/check_writable return success in such | >cases. | | (...) /etc/passwd and /etc/group to work around this. [He has to map the | fake SID returned by Samba to a real one.] If he doesn't want to do | that (..) I'm unable to get those values configured properly. I've rechecked Corrinna's Cygwin-ML examples and compared them to my tries over and over, and it still shows ???? for the UID part. GID succeed. Jari From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Dec 2011 17:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ken Brown Cc: 10257@debbugs.gnu.org, jari.aalto@cante.net Reply-To: Eli Zaretskii Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132388339813829 (code B ref 10257); Wed, 14 Dec 2011 17:24:01 +0000 Received: (at 10257) by debbugs.gnu.org; 14 Dec 2011 17:23:18 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RasY2-0003b0-Es for submit@debbugs.gnu.org; Wed, 14 Dec 2011 12:23:18 -0500 Received: from mtaout22.012.net.il ([80.179.55.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RasXz-0003as-Mm for 10257@debbugs.gnu.org; Wed, 14 Dec 2011 12:23:17 -0500 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LW700H00EVBCD00@a-mtaout22.012.net.il> for 10257@debbugs.gnu.org; Wed, 14 Dec 2011 19:21:49 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.229.18.12]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LW700EVIEW9S2U0@a-mtaout22.012.net.il>; Wed, 14 Dec 2011 19:21:46 +0200 (IST) Date: Wed, 14 Dec 2011 19:21:47 +0200 From: Eli Zaretskii In-reply-to: <4EE8B2DB.70707@cornell.edu> X-012-Sender: halo1@inter.net.il Message-id: <83hb132hn8.fsf@gnu.org> References: <4EE76B6E.7070904@cornell.edu> <4EE7B2A9.6060308@cornell.edu> <4EE8178F.5040004@cornell.edu> <87liqf1t04.fsf@picasso.cante.net> <4EE89590.2040503@cornell.edu> <4EE89CAB.8080301@cornell.edu> <20111214141521.GE22678@picasso.cante.net> <4EE8B2DB.70707@cornell.edu> X-Spam-Score: -2.0 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > Date: Wed, 14 Dec 2011 09:29:47 -0500 > From: Ken Brown > CC: Eli Zaretskii , 10257@debbugs.gnu.org > > So can you look into how the native Windows port implements > check_writable? It calls `access', whose implementation is in w32.c:sys_access. It mostly calls GetFileAttributes and that's it. If you want to check NT security ACLs on Cygwin, then what the native build does will not be good enough for you. But you can perhaps fall back on that if the UID and GID are bogus (see my other mail). From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Richard Stallman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Dec 2011 17:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ken Brown Cc: eliz@gnu.org, 10257@debbugs.gnu.org, jari.aalto@cante.net Reply-To: rms@gnu.org Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132388348213958 (code B ref 10257); Wed, 14 Dec 2011 17:25:01 +0000 Received: (at 10257) by debbugs.gnu.org; 14 Dec 2011 17:24:42 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RasZN-0003d4-O9 for submit@debbugs.gnu.org; Wed, 14 Dec 2011 12:24:42 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RasZH-0003ct-UN for 10257@debbugs.gnu.org; Wed, 14 Dec 2011 12:24:39 -0500 Received: from rms by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RasXs-0001i3-BE; Wed, 14 Dec 2011 12:23:08 -0500 Date: Wed, 14 Dec 2011 12:23:08 -0500 Message-Id: Content-Type: text/plain; charset=ISO-8859-15 From: Richard Stallman In-reply-to: <4EE76B6E.7070904@cornell.edu> (message from Ken Brown on Tue, 13 Dec 2011 10:12:46 -0500) References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <4EE76B6E.7070904@cornell.edu> X-Spam-Score: -6.6 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) I have a question about the emacs side of this. I wonder what the rationale is for testing writability before trying to save the file, and then asking the user for confirmation in case the (unreliable) test for writability fails (*). I think the reason for the fallible first test is to avoid things that are done (to backup files, for instance) before trying to write the file. It is good to avoid them if the write would fail anyway. -- Dr Richard Stallman President, Free Software Foundation 51 Franklin St Boston MA 02110 USA www.fsf.org www.gnu.org Skype: No way! That's nonfree (freedom-denying) software. Use free telephony http://directory.fsf.org/category/tel/ From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Dec 2011 17:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ken Brown Cc: 10257@debbugs.gnu.org, jari.aalto@cante.net Reply-To: Eli Zaretskii Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132388393314665 (code B ref 10257); Wed, 14 Dec 2011 17:33:01 +0000 Received: (at 10257) by debbugs.gnu.org; 14 Dec 2011 17:32:13 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rasgf-0003oT-2H for submit@debbugs.gnu.org; Wed, 14 Dec 2011 12:32:13 -0500 Received: from mtaout21.012.net.il ([80.179.55.169]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rasgc-0003oJ-CI for 10257@debbugs.gnu.org; Wed, 14 Dec 2011 12:32:11 -0500 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0LW700A00FADLU00@a-mtaout21.012.net.il> for 10257@debbugs.gnu.org; Wed, 14 Dec 2011 19:30:44 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.229.18.12]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LW700AT6FB7KX10@a-mtaout21.012.net.il>; Wed, 14 Dec 2011 19:30:43 +0200 (IST) Date: Wed, 14 Dec 2011 19:30:45 +0200 From: Eli Zaretskii In-reply-to: <4EE8B064.8080803@cornell.edu> X-012-Sender: halo1@inter.net.il Message-id: <83fwgn2h8a.fsf@gnu.org> References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <4EE76B6E.7070904@cornell.edu> <4EE7B2A9.6060308@cornell.edu> <4EE8178F.5040004@cornell.edu> <87liqf1t04.fsf@picasso.cante.net> <4EE89590.2040503@cornell.edu> <4EE89CAB.8080301@cornell.edu> <4EE8B064.8080803@cornell.edu> X-Spam-Score: -2.0 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > Date: Wed, 14 Dec 2011 09:19:16 -0500 > From: Ken Brown > CC: 10257@debbugs.gnu.org, jari.aalto@cante.net > > > Either that, or make euidaccess/check_writable return success in such > > cases. > > I don't know how to determine what "such cases" are. "Such cases" are those where UID and GID are returned as -1 (I think), see the original report where Jari shows the result of file-attributes. I believe Corinna also wrote something about the special SID values returned in this case. You could use these special values to detect this situation and work around it. > In the case at hand, Jari has a network filesystem that is > configured in such a way that the uid/gid of a file can't be > determined by standard system calls. As explained on the Cygwin > list, he can set up his /etc/passwd and /etc/group to work around > this. [He has to map the fake SID returned by Samba to a real one.] > If he doesn't want to do that, I think it would clearly be wrong for > euidaccess to return success. My POV is that "such cases" are better solved inside euidaccess: it doesn't make much sense to force the users to jump through the hoops when it is known that the library is unable to determine something reliably, in this case the uid/gid values. In such cases, the library should do whatever will punish users the least. But that's me; if the Cygwin maintainers disagree and will not modify euidaccess, then you could try doing the equivalent of this in Emacs. > Maybe check_writable could be a little more lenient, but I'm not sure > what the implications of that would be. The file is already writable in this case, so how bad can this become? The trick is not to be more lenient in all the cases, only in these problematic ones. Then you can never do worse than we do now. From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Ken Brown Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Dec 2011 17:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 10257@debbugs.gnu.org, jari.aalto@cante.net Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132388552117122 (code B ref 10257); Wed, 14 Dec 2011 17:59:01 +0000 Received: (at 10257) by debbugs.gnu.org; 14 Dec 2011 17:58:41 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rat6H-0004S6-26 for submit@debbugs.gnu.org; Wed, 14 Dec 2011 12:58:41 -0500 Received: from granite1.mail.cornell.edu ([128.253.83.141] helo=authusersmtp.mail.cornell.edu) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rat6D-0004Rw-82 for 10257@debbugs.gnu.org; Wed, 14 Dec 2011 12:58:39 -0500 Received: from [128.84.234.240] (dhcp240.math.cornell.edu [128.84.234.240]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id pBEHvAdf018930 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 14 Dec 2011 12:57:10 -0500 (EST) Message-ID: <4EE8E376.7080309@cornell.edu> Date: Wed, 14 Dec 2011 12:57:10 -0500 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <4EE76B6E.7070904@cornell.edu> <4EE7B2A9.6060308@cornell.edu> <4EE8178F.5040004@cornell.edu> <87liqf1t04.fsf@picasso.cante.net> <4EE89590.2040503@cornell.edu> <4EE89CAB.8080301@cornell.edu> <4EE8B064.8080803@cornell.edu> <83fwgn2h8a.fsf@gnu.org> In-Reply-To: <83fwgn2h8a.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -5.8 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) On 12/14/2011 12:30 PM, Eli Zaretskii wrote: > "Such cases" are those where UID and GID are returned as -1 (I think), > see the original report where Jari shows the result of > file-attributes. OK, I could certainly change check_writable to return success if euidaccess returns failure and UID and GID are both -1. I'll make a patch when I get a chance and let Jari test it. Ken From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Ken Brown Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Dec 2011 02:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 10257@debbugs.gnu.org, jari.aalto@cante.net Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132391708530581 (code B ref 10257); Thu, 15 Dec 2011 02:45:01 +0000 Received: (at 10257) by debbugs.gnu.org; 15 Dec 2011 02:44:45 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rb1JN-0007xB-Et for submit@debbugs.gnu.org; Wed, 14 Dec 2011 21:44:45 -0500 Received: from granite1.mail.cornell.edu ([128.253.83.141] helo=authusersmtp.mail.cornell.edu) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rb1JK-0007x3-Kp for 10257@debbugs.gnu.org; Wed, 14 Dec 2011 21:44:43 -0500 Received: from [192.168.1.3] (cpe-67-249-194-47.twcny.res.rr.com [67.249.194.47]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id pBF2hC56011042 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 14 Dec 2011 21:43:13 -0500 (EST) Message-ID: <4EE95EBB.5040504@cornell.edu> Date: Wed, 14 Dec 2011 21:43:07 -0500 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <4EE76B6E.7070904@cornell.edu> <4EE7B2A9.6060308@cornell.edu> <4EE8178F.5040004@cornell.edu> <87liqf1t04.fsf@picasso.cante.net> <4EE89590.2040503@cornell.edu> <4EE89CAB.8080301@cornell.edu> <4EE8B064.8080803@cornell.edu> <83fwgn2h8a.fsf@gnu.org> <4EE8E376.7080309@cornell.edu> In-Reply-To: <4EE8E376.7080309@cornell.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -5.8 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) On 12/14/2011 12:57 PM, Ken Brown wrote: > On 12/14/2011 12:30 PM, Eli Zaretskii wrote: >> "Such cases" are those where UID and GID are returned as -1 (I think), >> see the original report where Jari shows the result of >> file-attributes. > > OK, I could certainly change check_writable to return success if > euidaccess returns failure and UID and GID are both -1. I'll make a > patch when I get a chance and let Jari test it. How does the following patch look? === modified file 'src/fileio.c' --- src/fileio.c 2011-12-05 08:55:25 +0000 +++ src/fileio.c 2011-12-15 02:17:01 +0000 @@ -2416,15 +2416,27 @@ return (st.st_mode & S_IWRITE || S_ISDIR (st.st_mode)); #else /* not MSDOS */ #ifdef HAVE_EUIDACCESS - return (euidaccess (filename, 2) >= 0); -#else + int res = (euidaccess (filename, 2) >= 0); +#ifdef CYGWIN + /* euidaccess may have returned failure because Cygwin couldn't + determine the file's UID and GID; if so, we return success. */ + if (!res) + { + struct stat st; + if (stat (filename, &st) < 0) + return 0; + res = (st.st_uid == -1 && st.st_gid == -1); + } +#endif /* CYGWIN */ + return res; +#else /* not HAVE_EUIDACCESS */ /* Access isn't quite right because it uses the real uid and we really want to test with the effective uid. But Unix doesn't give us a right way to do it. Opening with O_WRONLY could work for an ordinary file, but would lose for directories. */ return (access (filename, 2) >= 0); -#endif +#endif /* not HAVE_EUIDACCESS */ #endif /* not MSDOS */ } Jari, can you test it and see if it solves your problem? Ken From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Ken Brown Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Dec 2011 02:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 10257@debbugs.gnu.org, jari.aalto@cante.net Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.132391769231434 (code B ref 10257); Thu, 15 Dec 2011 02:55:02 +0000 Received: (at 10257) by debbugs.gnu.org; 15 Dec 2011 02:54:52 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rb1TA-0008Ax-Ks for submit@debbugs.gnu.org; Wed, 14 Dec 2011 21:54:52 -0500 Received: from granite1.mail.cornell.edu ([128.253.83.141] helo=authusersmtp.mail.cornell.edu) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rb1T8-0008Aq-I6 for 10257@debbugs.gnu.org; Wed, 14 Dec 2011 21:54:51 -0500 Received: from [192.168.1.3] (cpe-67-249-194-47.twcny.res.rr.com [67.249.194.47]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id pBF2rKGY012397 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 14 Dec 2011 21:53:22 -0500 (EST) Message-ID: <4EE9611B.7080605@cornell.edu> Date: Wed, 14 Dec 2011 21:53:15 -0500 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <4EE76B6E.7070904@cornell.edu> <4EE7B2A9.6060308@cornell.edu> <4EE8178F.5040004@cornell.edu> <87liqf1t04.fsf@picasso.cante.net> <4EE89590.2040503@cornell.edu> <4EE89CAB.8080301@cornell.edu> <4EE8B064.8080803@cornell.edu> <83fwgn2h8a.fsf@gnu.org> <4EE8E376.7080309@cornell.edu> <4EE95EBB.5040504@cornell.edu> In-Reply-To: <4EE95EBB.5040504@cornell.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -5.8 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) On 12/14/2011 9:43 PM, Ken Brown wrote: > On 12/14/2011 12:57 PM, Ken Brown wrote: >> On 12/14/2011 12:30 PM, Eli Zaretskii wrote: >>> "Such cases" are those where UID and GID are returned as -1 (I think), >>> see the original report where Jari shows the result of >>> file-attributes. >> >> OK, I could certainly change check_writable to return success if >> euidaccess returns failure and UID and GID are both -1. I'll make a >> patch when I get a chance and let Jari test it. > > How does the following patch look? > > === modified file 'src/fileio.c' > --- src/fileio.c 2011-12-05 08:55:25 +0000 > +++ src/fileio.c 2011-12-15 02:17:01 +0000 > @@ -2416,15 +2416,27 @@ > return (st.st_mode & S_IWRITE || S_ISDIR (st.st_mode)); > #else /* not MSDOS */ > #ifdef HAVE_EUIDACCESS > - return (euidaccess (filename, 2) >= 0); > -#else > + int res = (euidaccess (filename, 2) >= 0); > +#ifdef CYGWIN > + /* euidaccess may have returned failure because Cygwin couldn't > + determine the file's UID and GID; if so, we return success. */ > + if (!res) > + { > + struct stat st; > + if (stat (filename, &st) < 0) > + return 0; > + res = (st.st_uid == -1 && st.st_gid == -1); > + } > +#endif /* CYGWIN */ > + return res; > +#else /* not HAVE_EUIDACCESS */ > /* Access isn't quite right because it uses the real uid > and we really want to test with the effective uid. > But Unix doesn't give us a right way to do it. > Opening with O_WRONLY could work for an ordinary file, > but would lose for directories. */ > return (access (filename, 2) >= 0); > -#endif > +#endif /* not HAVE_EUIDACCESS */ > #endif /* not MSDOS */ > } Sorry, this isn't quite right. I think it's too lenient. As long as I've called stat, I should at least check that stat shows the file to be writable, as in the MSDOS port. I'll send a revised patch. Ken From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Ken Brown Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Dec 2011 03:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 10257@debbugs.gnu.org, jari.aalto@cante.net Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.13239192591253 (code B ref 10257); Thu, 15 Dec 2011 03:21:02 +0000 Received: (at 10257) by debbugs.gnu.org; 15 Dec 2011 03:20:59 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rb1sQ-0000K9-OP for submit@debbugs.gnu.org; Wed, 14 Dec 2011 22:20:59 -0500 Received: from granite1.mail.cornell.edu ([128.253.83.141] helo=authusersmtp.mail.cornell.edu) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rb1sN-0000K1-TQ for 10257@debbugs.gnu.org; Wed, 14 Dec 2011 22:20:57 -0500 Received: from [192.168.1.3] (cpe-67-249-194-47.twcny.res.rr.com [67.249.194.47]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id pBF3JQlH016425 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 14 Dec 2011 22:19:27 -0500 (EST) Message-ID: <4EE96739.30803@cornell.edu> Date: Wed, 14 Dec 2011 22:19:21 -0500 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <4EE76B6E.7070904@cornell.edu> <4EE7B2A9.6060308@cornell.edu> <4EE8178F.5040004@cornell.edu> <87liqf1t04.fsf@picasso.cante.net> <4EE89590.2040503@cornell.edu> <4EE89CAB.8080301@cornell.edu> <4EE8B064.8080803@cornell.edu> <83fwgn2h8a.fsf@gnu.org> <4EE8E376.7080309@cornell.edu> <4EE95EBB.5040504@cornell.edu> <4EE9611B.7080605@cornell.edu> In-Reply-To: <4EE9611B.7080605@cornell.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -5.8 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) On 12/14/2011 9:53 PM, Ken Brown wrote: > Sorry, this isn't quite right. I think it's too lenient. As long as I've > called stat, I should at least check that stat shows the file to be > writable, as in the MSDOS port. > > I'll send a revised patch. Never mind. It's probably not worth the trouble to check further if we don't even know the file's owner or group. Ken From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Dec 2011 04:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ken Brown Cc: 10257@debbugs.gnu.org, jari.aalto@cante.net Reply-To: Eli Zaretskii Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.13239219795347 (code B ref 10257); Thu, 15 Dec 2011 04:07:02 +0000 Received: (at 10257) by debbugs.gnu.org; 15 Dec 2011 04:06:19 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rb2aJ-0001OC-Kc for submit@debbugs.gnu.org; Wed, 14 Dec 2011 23:06:19 -0500 Received: from mtaout22.012.net.il ([80.179.55.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rb2aG-0001O3-BU for 10257@debbugs.gnu.org; Wed, 14 Dec 2011 23:06:17 -0500 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LW800N008KJ1400@a-mtaout22.012.net.il> for 10257@debbugs.gnu.org; Thu, 15 Dec 2011 06:04:13 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.229.18.12]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LW800HXR8N1DDB2@a-mtaout22.012.net.il>; Thu, 15 Dec 2011 06:04:13 +0200 (IST) Date: Thu, 15 Dec 2011 06:04:15 +0200 From: Eli Zaretskii In-reply-to: <4EE95EBB.5040504@cornell.edu> X-012-Sender: halo1@inter.net.il Message-id: <83d3bq32gw.fsf@gnu.org> References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <4EE76B6E.7070904@cornell.edu> <4EE7B2A9.6060308@cornell.edu> <4EE8178F.5040004@cornell.edu> <87liqf1t04.fsf@picasso.cante.net> <4EE89590.2040503@cornell.edu> <4EE89CAB.8080301@cornell.edu> <4EE8B064.8080803@cornell.edu> <83fwgn2h8a.fsf@gnu.org> <4EE8E376.7080309@cornell.edu> <4EE95EBB.5040504@cornell.edu> X-Spam-Score: -2.0 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > Date: Wed, 14 Dec 2011 21:43:07 -0500 > From: Ken Brown > CC: 10257@debbugs.gnu.org, jari.aalto@cante.net > > On 12/14/2011 12:57 PM, Ken Brown wrote: > > On 12/14/2011 12:30 PM, Eli Zaretskii wrote: > >> "Such cases" are those where UID and GID are returned as -1 (I think), > >> see the original report where Jari shows the result of > >> file-attributes. > > > > OK, I could certainly change check_writable to return success if > > euidaccess returns failure and UID and GID are both -1. I'll make a > > patch when I get a chance and let Jari test it. > > How does the following patch look? Looks fine to me, if it does the job. From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Ken Brown Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Dec 2011 14:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 10257@debbugs.gnu.org, jari.aalto@cante.net Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.13239602538165 (code B ref 10257); Thu, 15 Dec 2011 14:45:01 +0000 Received: (at 10257) by debbugs.gnu.org; 15 Dec 2011 14:44:13 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RbCXd-00027d-0c for submit@debbugs.gnu.org; Thu, 15 Dec 2011 09:44:13 -0500 Received: from granite1.mail.cornell.edu ([128.253.83.141] helo=authusersmtp.mail.cornell.edu) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RbCXZ-00027U-JV for 10257@debbugs.gnu.org; Thu, 15 Dec 2011 09:44:11 -0500 Received: from [192.168.1.3] (cpe-67-249-194-47.twcny.res.rr.com [67.249.194.47]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id pBFEgbdK022152 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 15 Dec 2011 09:42:38 -0500 (EST) Message-ID: <4EEA0759.5040403@cornell.edu> Date: Thu, 15 Dec 2011 09:42:33 -0500 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <4EE76B6E.7070904@cornell.edu> <4EE7B2A9.6060308@cornell.edu> <4EE8178F.5040004@cornell.edu> <87liqf1t04.fsf@picasso.cante.net> <4EE89590.2040503@cornell.edu> <4EE89CAB.8080301@cornell.edu> <4EE8B064.8080803@cornell.edu> <83fwgn2h8a.fsf@gnu.org> <4EE8E376.7080309@cornell.edu> <4EE95EBB.5040504@cornell.edu> <83d3bq32gw.fsf@gnu.org> In-Reply-To: <83d3bq32gw.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -5.8 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) On 12/14/2011 11:04 PM, Eli Zaretskii wrote: >> How does the following patch look? > > Looks fine to me, if it does the job. Thanks. It works for me, but I'd like Jari to confirm. I was able to test it because there are some files on my system that are owned by the TrustedInstaller virtual user. Cygwin currently doesn't create /etc/passwd and /etc/group entries for TrustedInstaller, so its files show up with UID and GID equal to -1. By the way, the check_executable function calls euidaccess in the same way as check_writable, but I don't think I want to change that one to be more permissive unless there's a good reason to do so. It seems to be used mainly to check for standard programs, which I hope aren't going to be found on a network share configured in such a way that the UID/GID can't be determined. Thanks, as always, for being so helpful. Ken From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Jason Rumney Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Dec 2011 14:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 10257@debbugs.gnu.org, jari Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.13239603658351 (code B ref 10257); Thu, 15 Dec 2011 14:47:02 +0000 Received: (at 10257) by debbugs.gnu.org; 15 Dec 2011 14:46:05 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RbCZR-0002Ad-Hz for submit@debbugs.gnu.org; Thu, 15 Dec 2011 09:46:05 -0500 Received: from mail-gy0-f172.google.com ([209.85.160.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RbCZO-0002AW-T1 for 10257@debbugs.gnu.org; Thu, 15 Dec 2011 09:46:03 -0500 Received: by ghrr16 with SMTP id r16so1532112ghr.3 for <10257@debbugs.gnu.org>; Thu, 15 Dec 2011 06:44:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=EHGMv2vCNbHq3L3XD76cFSRxYybHFvVic9V1eYxkKS4=; b=naVu59Vev13mmbgvXeYlhhfeWwum2xpLfS4PG8G53qk7UzJH450MRHH3d1xxkR0V44 UZCX7DeNaM3oaLr44Y5f8rKlZY7a6CjLerGmh/u+xhG9bPGSj96vjuZKdUJC2c5Ngbif m8kXAstdR2nrWKk8sXjb4mt26Ggn8yTCDvzjI= Received: by 10.50.188.129 with SMTP id ga1mr3182712igc.69.1323960272627; Thu, 15 Dec 2011 06:44:32 -0800 (PST) Received: from home.jasonrumney.net ([180.75.128.157]) by mx.google.com with ESMTPS id mb4sm10973099igc.1.2011.12.15.06.44.29 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Dec 2011 06:44:31 -0800 (PST) Received: by home.jasonrumney.net (Postfix, from userid 1000) id 790F4E0A; Thu, 15 Dec 2011 22:44:24 +0800 (MYT) From: Jason Rumney References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> Date: Thu, 15 Dec 2011 22:44:24 +0800 In-Reply-To: (Eli Zaretskii's message of "Tue, 13 Dec 2011 09:43:21 -0500") Message-ID: <87y5udevxz.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.6 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.6 (---) Eli Zaretskii writes: >> Sure, but because The network drive is not part of Windows Domain, I'm >> afraid Cygwin has any means to determine what the correct UID or GID >> would be are as they have no correspondence on the Windows side. > > ??? As long as the network drive is mounted using Windows APIs (which > must be the case), the NT security features should be fully supported > for it. If the two computers are not members of the same domain, they know nothing about each others users and groups. From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Ken Brown Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Dec 2011 19:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 10257@debbugs.gnu.org, Stefan Monnier , jari.aalto@cante.net Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.13240643615401 (code B ref 10257); Fri, 16 Dec 2011 19:40:02 +0000 Received: (at 10257) by debbugs.gnu.org; 16 Dec 2011 19:39:21 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rbdcj-0001P1-S1 for submit@debbugs.gnu.org; Fri, 16 Dec 2011 14:39:19 -0500 Received: from granite1.mail.cornell.edu ([128.253.83.141] helo=authusersmtp.mail.cornell.edu) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rbdcf-0001Oq-So for 10257@debbugs.gnu.org; Fri, 16 Dec 2011 14:39:16 -0500 Received: from [192.168.1.3] (cpe-67-249-194-47.twcny.res.rr.com [67.249.194.47]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id pBGJbYI9015293 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Dec 2011 14:37:35 -0500 (EST) Message-ID: <4EEB9DFA.8040000@cornell.edu> Date: Fri, 16 Dec 2011 14:37:30 -0500 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <4EE76B6E.7070904@cornell.edu> <4EE7B2A9.6060308@cornell.edu> <4EE8178F.5040004@cornell.edu> <87liqf1t04.fsf@picasso.cante.net> <4EE89590.2040503@cornell.edu> <4EE89CAB.8080301@cornell.edu> <4EE8B064.8080803@cornell.edu> <83fwgn2h8a.fsf@gnu.org> <4EE8E376.7080309@cornell.edu> <4EE95EBB.5040504@cornell.edu> <83d3bq32gw.fsf@gnu.org> <4EEA0759.5040403@cornell.edu> In-Reply-To: <4EEA0759.5040403@cornell.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -5.8 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) On 12/15/2011 9:42 AM, Ken Brown wrote: > On 12/14/2011 11:04 PM, Eli Zaretskii wrote: >>> How does the following patch look? >> >> Looks fine to me, if it does the job. > > Thanks. > > It works for me, but I'd like Jari to confirm. Jari has confirmed in private email that it works, but he has proposed making it slightly more permissive and having check_writable return success if either UID or GID is -1. The rationale is the same as before: If euidaccess returns failure but either UID or GID is -1, then the result of euidaccess is unreliable. The revised patch is below. Eli, do you see any problem with this extra permissiveness? Stefan, is it OK to apply the patch to the trunk, or would you rather I wait for 24.2? Ken === modified file 'src/fileio.c' --- src/fileio.c 2011-12-05 08:55:25 +0000 +++ src/fileio.c 2011-12-16 19:32:23 +0000 @@ -2416,15 +2416,27 @@ return (st.st_mode & S_IWRITE || S_ISDIR (st.st_mode)); #else /* not MSDOS */ #ifdef HAVE_EUIDACCESS - return (euidaccess (filename, 2) >= 0); -#else + int res = (euidaccess (filename, 2) >= 0); +#ifdef CYGWIN + /* euidaccess may have returned failure because Cygwin couldn't + determine the file's UID or GID; if so, we return success. */ + if (!res) + { + struct stat st; + if (stat (filename, &st) < 0) + return 0; + res = (st.st_uid == -1 || st.st_gid == -1); + } +#endif /* CYGWIN */ + return res; +#else /* not HAVE_EUIDACCESS */ /* Access isn't quite right because it uses the real uid and we really want to test with the effective uid. But Unix doesn't give us a right way to do it. Opening with O_WRONLY could work for an ordinary file, but would lose for directories. */ return (access (filename, 2) >= 0); -#endif +#endif /* not HAVE_EUIDACCESS */ #endif /* not MSDOS */ } From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Dec 2011 19:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ken Brown Cc: 10257@debbugs.gnu.org, monnier@IRO.UMontreal.CA, jari.aalto@cante.net Reply-To: Eli Zaretskii Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.13240649646298 (code B ref 10257); Fri, 16 Dec 2011 19:50:02 +0000 Received: (at 10257) by debbugs.gnu.org; 16 Dec 2011 19:49:24 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RbdmV-0001dT-T9 for submit@debbugs.gnu.org; Fri, 16 Dec 2011 14:49:24 -0500 Received: from mtaout21.012.net.il ([80.179.55.169]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RbdmS-0001dK-LC for 10257@debbugs.gnu.org; Fri, 16 Dec 2011 14:49:21 -0500 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0LWB00000ARNJT00@a-mtaout21.012.net.il> for 10257@debbugs.gnu.org; Fri, 16 Dec 2011 21:46:37 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.127.39.203]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LWB000YAAXNIW20@a-mtaout21.012.net.il>; Fri, 16 Dec 2011 21:46:37 +0200 (IST) Date: Fri, 16 Dec 2011 21:46:39 +0200 From: Eli Zaretskii In-reply-to: <4EEB9DFA.8040000@cornell.edu> X-012-Sender: halo1@inter.net.il Message-id: <83hb101eqo.fsf@gnu.org> References: <87aa71mwng.fsf@picasso.cante.net> <4EE270AA.2080702@cornell.edu> <20111210095858.GA19881@cante.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <4EE76B6E.7070904@cornell.edu> <4EE7B2A9.6060308@cornell.edu> <4EE8178F.5040004@cornell.edu> <87liqf1t04.fsf@picasso.cante.net> <4EE89590.2040503@cornell.edu> <4EE89CAB.8080301@cornell.edu> <4EE8B064.8080803@cornell.edu> <83fwgn2h8a.fsf@gnu.org> <4EE8E376.7080309@cornell.edu> <4EE95EBB.5040504@cornell.edu> <83d3bq32gw.fsf@gnu.org> <4EEA0759.5040403@cornell.edu> <4EEB9DFA.8040000@cornell.edu> X-Spam-Score: -2.0 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > Date: Fri, 16 Dec 2011 14:37:30 -0500 > From: Ken Brown > CC: 10257@debbugs.gnu.org, jari.aalto@cante.net, > Stefan Monnier > > Jari has confirmed in private email that it works, but he has proposed > making it slightly more permissive and having check_writable return > success if either UID or GID is -1. The rationale is the same as > before: If euidaccess returns failure but either UID or GID is -1, then > the result of euidaccess is unreliable. The revised patch is below. > > Eli, do you see any problem with this extra permissiveness? No, I was thinking along the same lines. From unknown Thu Aug 21 12:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Dec 2011 23:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ken Brown Cc: Eli Zaretskii , 10257@debbugs.gnu.org, jari.aalto@cante.net Received: via spool by 10257-submit@debbugs.gnu.org id=B10257.1324077443407 (code B ref 10257); Fri, 16 Dec 2011 23:18:02 +0000 Received: (at 10257) by debbugs.gnu.org; 16 Dec 2011 23:17:23 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rbh1n-00006W-EG for submit@debbugs.gnu.org; Fri, 16 Dec 2011 18:17:23 -0500 Received: from smtp-01.vtx.ch ([194.38.175.90]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rbh1k-00006M-GN for 10257@debbugs.gnu.org; Fri, 16 Dec 2011 18:17:21 -0500 Received: from ceviche.home (dyn.83-228-219-171.dsl.vtx.ch [83.228.219.171]) by smtp-01.vtx.ch (VTX Services SA) with ESMTP id AD66B28603; Sat, 17 Dec 2011 00:15:41 +0100 (CET) Received: by ceviche.home (Postfix, from userid 20848) id BB3A5662EE; Fri, 16 Dec 2011 18:15:39 -0500 (EST) From: Stefan Monnier Message-ID: References: <87aa71mwng.fsf@picasso.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <4EE76B6E.7070904@cornell.edu> <4EE7B2A9.6060308@cornell.edu> <4EE8178F.5040004@cornell.edu> <87liqf1t04.fsf@picasso.cante.net> <4EE89590.2040503@cornell.edu> <4EE89CAB.8080301@cornell.edu> <4EE8B064.8080803@cornell.edu> <83fwgn2h8a.fsf@gnu.org> <4EE8E376.7080309@cornell.edu> <4EE95EBB.5040504@cornell.edu> <83d3bq32gw.fsf@gnu.org> <4EEA0759.5040403@cornell.edu> <4EEB9DFA.8040000@cornell.edu> Date: Fri, 16 Dec 2011 18:15:39 -0500 In-Reply-To: <4EEB9DFA.8040000@cornell.edu> (Ken Brown's message of "Fri, 16 Dec 2011 14:37:30 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.8 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.7 (---) > Stefan, is it OK to apply the patch to the trunk, or would you rather I wait > for 24.2? Sounds fine, Stefan From unknown Thu Aug 21 12:12:18 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Jari Aalto Subject: bug#10257: closed (Re: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive)) Message-ID: References: <4EECCC77.3040402@cornell.edu> <87aa71mwng.fsf@picasso.cante.net> X-Gnu-PR-Message: they-closed 10257 X-Gnu-PR-Package: emacs Reply-To: 10257@debbugs.gnu.org Date: Sat, 17 Dec 2011 17:10:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1324141802-4945-1" This is a multi-part message in MIME format... ------------=_1324141802-4945-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #10257: 23.3.1 Cygwin: network drives - file is write protected (false posi= tive) which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 10257@debbugs.gnu.org. --=20 10257: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D10257 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1324141802-4945-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 10257-done) by debbugs.gnu.org; 17 Dec 2011 17:09:56 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rbxlj-0001HR-0H for submit@debbugs.gnu.org; Sat, 17 Dec 2011 12:09:55 -0500 Received: from granite1.mail.cornell.edu ([128.253.83.141] helo=authusersmtp.mail.cornell.edu) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rbxlg-0001HI-Be for 10257-done@debbugs.gnu.org; Sat, 17 Dec 2011 12:09:53 -0500 Received: from [192.168.1.3] (cpe-67-249-194-47.twcny.res.rr.com [67.249.194.47]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id pBHH87YO011250 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 17 Dec 2011 12:08:08 -0500 (EST) Message-ID: <4EECCC77.3040402@cornell.edu> Date: Sat, 17 Dec 2011 12:08:07 -0500 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Stefan Monnier Subject: Re: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive) References: <87aa71mwng.fsf@picasso.cante.net> <4EE742B0.1080703@cornell.edu> <20111213140042.GA22678@picasso.cante.net> <4EE76B6E.7070904@cornell.edu> <4EE7B2A9.6060308@cornell.edu> <4EE8178F.5040004@cornell.edu> <87liqf1t04.fsf@picasso.cante.net> <4EE89590.2040503@cornell.edu> <4EE89CAB.8080301@cornell.edu> <4EE8B064.8080803@cornell.edu> <83fwgn2h8a.fsf@gnu.org> <4EE8E376.7080309@cornell.edu> <4EE95EBB.5040504@cornell.edu> <83d3bq32gw.fsf@gnu.org> <4EEA0759.5040403@cornell.edu> <4EEB9DFA.8040000@cornell.edu> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -5.8 (-----) X-Debbugs-Envelope-To: 10257-done Cc: Eli Zaretskii , 10257-done@debbugs.gnu.org, jari.aalto@cante.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) Version: 24.0.93 I've applied the patch and am closing the bug. ------------=_1324141802-4945-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 9 Dec 2011 18:24:50 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RZ57p-0007Oj-L6 for submit@debbugs.gnu.org; Fri, 09 Dec 2011 13:24:50 -0500 Received: from emh07.mail.saunalahti.fi ([62.142.5.117]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RZ57m-0007OZ-FX for submit@debbugs.gnu.org; Fri, 09 Dec 2011 13:24:48 -0500 Received: from saunalahti-vams (vs3-10.mail.saunalahti.fi [62.142.5.94]) by emh07-2.mail.saunalahti.fi (Postfix) with SMTP id E0C8E18D1C5 for ; Fri, 9 Dec 2011 20:23:48 +0200 (EET) Received: from emh05.mail.saunalahti.fi ([62.142.5.111]) by vs3-10.mail.saunalahti.fi ([62.142.5.94]) with SMTP (gateway) id A06E91DC71E; Fri, 09 Dec 2011 20:23:48 +0200 Received: from picasso.cante.net (a91-155-176-245.elisa-laajakaista.fi [91.155.176.245]) by emh05.mail.saunalahti.fi (Postfix) with ESMTP id CC71327D86 for ; Fri, 9 Dec 2011 20:23:47 +0200 (EET) Received: from jaalto by picasso.cante.net with local (Exim 4.77) (envelope-from ) id 1RZ56p-0000ds-AP for submit@debbugs.gnu.org; Fri, 09 Dec 2011 20:23:47 +0200 From: Jari Aalto To: submit@debbugs.gnu.org Subject: 23.3.1 Cygwin: network drives - file is write protected (false positive) Mail-Copies-To: poster Date: Fri, 09 Dec 2011 20:23:47 +0200 Message-ID: <87aa71mwng.fsf@picasso.cante.net> MIME-Version: 1.0 Content-Type: text/plain X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: jari.aalto@cante.net X-SA-Exim-Scanned: No (on picasso.cante.net); SAEximRunCond expanded to false X-Antivirus: VAMS X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Package: emacs Version: 23.3+1-4 Severity: normal TEST CASE - OS: Windows 7 64 bit - Start Cygwin X server: XWin :0 -unixkill -multiwindow - Start Cygwin Emacs: DISPLAY=:0 emacs-X11 & - C-x C-f any network drive file Emacs marks the file as read-only (%%) and asks every time a question after pressing C-x C-s: File is write-protected; try to save anyway? (y or n) PROBLEM The constant prompting "Y/N" makes writing to a network drive location exessively hard. It's nuissance to have to be able to confirm every save action. There doens't seem to be way to turn of this prompting. SUGGESTION The logic of checking if file is write protedted or not does not seem to be reliable under Cygwin regarding network drives. The Permissions probably don't come through correctly for Emacs to examine them. A) Offer option to turn of confirmation B) or bypass write protection checks under Cygwin TEST DATA Here is an example under Cygwin Emacs: (file-attributes "/cygdrive/z/tmp/test-epackage.el") => (nil 1 4294967295.0 4294967295.0 (20194 11100) (20194 19792) (20194 19792) 437 "-rwxr--r--" t (-1735557 1952988 . 8890) (30147 . 13405)) Under Cygwin Bash shell it looks like this: $ ls -la /cygdrive/z/tmp/test-epackage.el -rwxr--r-- 1 ???????? ???????? 437 Dec 9 20:02 /cygdrive/z/tmp/test-epackage.el Note: the uid and gid information is not available from this non-domain network drive. ------------=_1324141802-4945-1--