* bug#3328: marked as done (set-default-file-modes on Windows Emacs broken)
2009-05-18 20:39 ` bug#3328: set-default-file-modes on Windows Emacs broken Matthew Carter
@ 2009-05-19 19:45 ` Emacs bug Tracking System
0 siblings, 0 replies; 2+ messages in thread
From: Emacs bug Tracking System @ 2009-05-19 19:45 UTC (permalink / raw)
To: Eli Zaretskii
[-- Attachment #1: Type: text/plain, Size: 884 bytes --]
Your message dated Tue, 19 May 2009 22:38:46 +0300
with message-id <83iqjwq3w9.fsf@gnu.org>
and subject line Re: bug#3328: set-default-file-modes on Windows Emacs broken
has caused the Emacs bug report #3328,
regarding set-default-file-modes on Windows Emacs broken
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)
--
3328: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3328
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems
[-- Attachment #2: Type: message/rfc822, Size: 4796 bytes --]
From: Matthew Carter <r_q_einstein-emacsbugreport@yahoo.com>
To: bug-gnu-emacs@gnu.org
Subject: set-default-file-modes on Windows Emacs broken
Date: Mon, 18 May 2009 16:39:31 -0400
Message-ID: <4A11C783.2040206@yahoo.com>
* The version number of Emacs.
GNU Emacs 22.2.1 (i386-mingw-nt5.1.2600) of 2008-03-26 on RELEASE
* The operands given to the configure command when Emacs was installed.
I installed this version of Windows emacs as a binary installation downloaded from the web, so I never ran a "configure" command.
* A complete list of any modifications you have made to the Emacs source.
None.
* Details of any other deviations from the standard procedure for installing GNU Emacs.
None.
* The precise commands we need to type to reproduce the bug.
Run this lisp expression:
(set-default-file-modes ?\644)
e.g., by putting it in your ~/.emacs or by using M-:
Then, create a new file, "foo.txt".
Then, in a cygwin bash shell, run "ls -l foo.txt".
The file SHOULD have these permissions:
-rw-r--r--
But instead, it has these permissions:
-rwxrwxrwx
I tried passing various values to set-default-file-modes to see whether it had any effect at all. It did, but not the expected effect. Here are the results I found:
The first column tells the value that I passed in to set-default-file-modes .
The second column tells what value the default-file-modes function returned as a result.
The third column shows the actual permissions that a created file had (as shown by cygwin "ls -l").
(All values are shown in octal.)
set-default-file-modes default-file-modes file permissions
---------------------- ------------------ ----------------
01 0177 0555
0700 0777 0755
0777 0777 0755
0 0177 0555
0400 0577 0555
040 0177 0555
[-- Attachment #3: Type: message/rfc822, Size: 3426 bytes --]
From: Eli Zaretskii <eliz@gnu.org>
To: Matthew Carter <r_q_einstein-emacsbugreport@yahoo.com>, 3328-done@emacsbugs.donarmstrong.com
Subject: Re: bug#3328: set-default-file-modes on Windows Emacs broken
Date: Tue, 19 May 2009 22:38:46 +0300
Message-ID: <83iqjwq3w9.fsf@gnu.org>
> Date: Mon, 18 May 2009 16:39:31 -0400
> From: Matthew Carter <r_q_einstein-emacsbugreport@yahoo.com>
> Cc:
>
> Run this lisp expression:
> (set-default-file-modes ?\644)
> e.g., by putting it in your ~/.emacs or by using M-:
>
> Then, create a new file, "foo.txt".
> Then, in a cygwin bash shell, run "ls -l foo.txt".
> The file SHOULD have these permissions:
> -rw-r--r--
> But instead, it has these permissions:
> -rwxrwxrwx
This is not a bug. Maybe a missing feature (which is not easy to
implement). Details follow.
First, the way native Windows programs (such as Emacs) implement
Unix-style permission mode bits, and the way Cygwin implements them,
are very different. Native Windows applications only look at the
first (most significant) 3 mode bits, and ignore the rest. Thus,
0644, 0664, and 0666 will all give the same effect: create a file that
is readable and writable by the owner. If you use 0444, you will get
a read-only file. And that is about all you can meaningfully get in
the native Windows build of Emacs: the MS emulation of `umask' does
not allow to create files that are not readable by the owner, and it
can not set the executable (x) bit.
This all is a consequence of a simple fact that the MS emulation of
`umask' and related features use a single bit in the file's
attributes: the readonly bit.
Cygwin, OTOH, uses Windows NT security features to emulate the Posix
permissions much closer. It almost completely ignores the readonly
bit, and instead manipulates the Windows ACLs to emulate Posix
permissions, including owner, group, and world permissions.
So you are (a) expecting from NTEmacs more than it currently supports,
and (b) use incompatible tools to assess the effect of operations on
the file permission bits.
Therefore, I'm closing this bug report.
Thanks anyway for your detailed report.
^ permalink raw reply [flat|nested] 2+ messages in thread