Subject: Re: bug#10257: 23.3.1 Cygwin: network drives - file is write protected (false positive)

From: Ken Brown <[email-masked]>
Date: Fri, 09 Dec 2011 15:33:46 -0500

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<name here>  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.