From unknown Sun Jun 22 04:03:23 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3328: set-default-file-modes on Windows Emacs broken Reply-To: Matthew Carter , 3328@debbugs.gnu.org Resent-From: Matthew Carter Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 18 May 2009 20:45:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: report 3328 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.124267918318383 (code B ref -1); Mon, 18 May 2009 20:45:03 +0000 Received: (at submit) by emacsbugs.donarmstrong.com; 18 May 2009 20:39:43 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: * X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=1.3 required=4.0 tests=IMPRONONCABLE_1, MURPHY_WRONG_WORD1,MURPHY_WRONG_WORD2 autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n4IKddCs018370 for ; Mon, 18 May 2009 13:39:41 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M69cZ-0002hF-CA for bug-gnu-emacs@gnu.org; Mon, 18 May 2009 16:39:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M69cY-0002gU-OG for bug-gnu-emacs@gnu.org; Mon, 18 May 2009 16:39:38 -0400 Received: from [199.232.76.173] (port=57128 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M69cY-0002gG-Dm for bug-gnu-emacs@gnu.org; Mon, 18 May 2009 16:39:38 -0400 Received: from smtp105.prem.mail.ac4.yahoo.com ([76.13.13.44]:20248) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1M69cY-00062Y-2Q for bug-gnu-emacs@gnu.org; Mon, 18 May 2009 16:39:38 -0400 Received: (qmail 4732 invoked from network); 18 May 2009 20:39:37 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Content-Transfer-Encoding; b=1ddK1yfKfLimY3qQq5RkLQqXldzg7yAGpHqZQlKLBcic/3yALGDb3g7uyBkyrYywQAOybUqY/bJEcE4E29gmqaHHE8pyFoQBuUqQIoKYqX/LsbDTWyoWIbK8VLCkqucvciyBiJnBNGlsmy7C50e/JOPOou8tgs9/GVPdCAp5UcA= ; Received: from portale-x.east.saic.com (r_q_einstein-emacsbugreport@198.151.13.15 with plain) by smtp105.prem.mail.ac4.yahoo.com with SMTP; 18 May 2009 13:39:37 -0700 PDT X-Yahoo-SMTP: dMJxo3KswBAfXpqmkp1vZEFWzZuPaCp4D0o- X-YMail-OSG: Lvw3s44VM1n0ESCa4CfclqgZ_ziGD_GaZ56Url4b.M3dXqm_zA2gScIqWUoSwyrcDaFhBR.qN0oV6KAE_2AvBfwfrBMy8vYF6qgGGQyRiOzhuDGGF5SHhyrsNdvvIckEwUMK009hNBzblykE0gZcJL1Q0L2rIaCOopDF3uj30B3sEIjct85G_Nlaw3Vn5kF70t.x9R_wuxeTGffVcybQrFYjSSegAFtDuPQGuI.qSaQnc9UOOptcXqVdzy7LFOtY6Wze9VnGn4ibL4Q1x9qIlg-- X-Yahoo-Newman-Property: ymail-3 Message-ID: <4A11C783.2040206@yahoo.com> Date: Mon, 18 May 2009 16:39:31 -0400 From: Matthew Carter User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) * 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 From unknown Sun Jun 22 04:03:23 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.420 (Entity 5.420) X-Loop: owner@emacsbugs.donarmstrong.com From: help-debbugs@gnu.org (Emacs bug Tracking System) To: Matthew Carter Subject: bug#3328 closed by Eli Zaretskii (Re: bug#3328: set-default-file-modes on Windows Emacs broken) Message-ID: References: <83iqjwq3w9.fsf@gnu.org> <4A11C783.2040206@yahoo.com> X-Emacs-PR-Message: they-closed 3328 X-Emacs-PR-Package: emacs Reply-To: 3328@debbugs.gnu.org Date: Tue, 19 May 2009 19:45:06 +0000 Content-Type: multipart/mixed; boundary="----------=_1242762306-668-1" This is a multi-part message in MIME format... ------------=_1242762306-668-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is an automatic notification regarding your bug report which was filed against the emacs package: #3328: set-default-file-modes on Windows Emacs broken It has been closed by Eli Zaretskii . Their explanation is attached below along with your original report. If this explanation is unsatisfactory and you have not received a better one in a separate message then please contact Eli Zaretskii by replying to this email. --=20 3328: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D3328 Emacs Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1242762306-668-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 3328-done) by emacsbugs.donarmstrong.com; 19 May 2009 19:39:02 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.9 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER, IMPRONONCABLE_1,MURPHY_WRONG_WORD1,MURPHY_WRONG_WORD2 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mtaout6.012.net.il (mtaout6.012.net.il [84.95.2.16]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n4JJcwTK031360 for <3328-done@emacsbugs.donarmstrong.com>; Tue, 19 May 2009 12:38:59 -0700 Received: from conversion-daemon.i-mtaout6.012.net.il by i-mtaout6.012.net.il (HyperSendmail v2007.08) id <0KJW00600P58U000@i-mtaout6.012.net.il> for 3328-done@emacsbugs.donarmstrong.com; Tue, 19 May 2009 22:38:51 +0300 (IDT) Received: from HOME-C4E4A596F7 ([84.228.115.215]) by i-mtaout6.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KJW005CNP8L5W10@i-mtaout6.012.net.il>; Tue, 19 May 2009 22:38:49 +0300 (IDT) Date: Tue, 19 May 2009 22:38:46 +0300 From: Eli Zaretskii Subject: Re: bug#3328: set-default-file-modes on Windows Emacs broken In-reply-to: <4A11C783.2040206@yahoo.com> X-012-Sender: halo1@inter.net.il To: Matthew Carter , 3328-done@debbugs.gnu.org Reply-to: Eli Zaretskii Message-id: <83iqjwq3w9.fsf@gnu.org> References: <4A11C783.2040206@yahoo.com> > Date: Mon, 18 May 2009 16:39:31 -0400 > From: Matthew Carter > 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. ------------=_1242762306-668-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 18 May 2009 20:39:43 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: * X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=1.3 required=4.0 tests=IMPRONONCABLE_1, MURPHY_WRONG_WORD1,MURPHY_WRONG_WORD2 autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n4IKddCs018370 for ; Mon, 18 May 2009 13:39:41 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M69cZ-0002hF-CA for bug-gnu-emacs@gnu.org; Mon, 18 May 2009 16:39:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M69cY-0002gU-OG for bug-gnu-emacs@gnu.org; Mon, 18 May 2009 16:39:38 -0400 Received: from [199.232.76.173] (port=57128 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M69cY-0002gG-Dm for bug-gnu-emacs@gnu.org; Mon, 18 May 2009 16:39:38 -0400 Received: from smtp105.prem.mail.ac4.yahoo.com ([76.13.13.44]:20248) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1M69cY-00062Y-2Q for bug-gnu-emacs@gnu.org; Mon, 18 May 2009 16:39:38 -0400 Received: (qmail 4732 invoked from network); 18 May 2009 20:39:37 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Content-Transfer-Encoding; b=1ddK1yfKfLimY3qQq5RkLQqXldzg7yAGpHqZQlKLBcic/3yALGDb3g7uyBkyrYywQAOybUqY/bJEcE4E29gmqaHHE8pyFoQBuUqQIoKYqX/LsbDTWyoWIbK8VLCkqucvciyBiJnBNGlsmy7C50e/JOPOou8tgs9/GVPdCAp5UcA= ; Received: from portale-x.east.saic.com (r_q_einstein-emacsbugreport@198.151.13.15 with plain) by smtp105.prem.mail.ac4.yahoo.com with SMTP; 18 May 2009 13:39:37 -0700 PDT X-Yahoo-SMTP: dMJxo3KswBAfXpqmkp1vZEFWzZuPaCp4D0o- X-YMail-OSG: Lvw3s44VM1n0ESCa4CfclqgZ_ziGD_GaZ56Url4b.M3dXqm_zA2gScIqWUoSwyrcDaFhBR.qN0oV6KAE_2AvBfwfrBMy8vYF6qgGGQyRiOzhuDGGF5SHhyrsNdvvIckEwUMK009hNBzblykE0gZcJL1Q0L2rIaCOopDF3uj30B3sEIjct85G_Nlaw3Vn5kF70t.x9R_wuxeTGffVcybQrFYjSSegAFtDuPQGuI.qSaQnc9UOOptcXqVdzy7LFOtY6Wze9VnGn4ibL4Q1x9qIlg-- X-Yahoo-Newman-Property: ymail-3 Message-ID: <4A11C783.2040206@yahoo.com> Date: Mon, 18 May 2009 16:39:31 -0400 From: Matthew Carter User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: set-default-file-modes on Windows Emacs broken Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) * 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 ------------=_1242762306-668-1--