From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bill Meier Newsgroups: gmane.emacs.bugs Subject: Re: [PATCH] src/makefile.w32-in Date: Sun, 20 Jan 2008 11:30:21 -0500 Message-ID: <4793771D.5000805@newsguy.com> References: <200801162026.m0GKQUaa000801@member.newsguy.com> <478F228D.2090608@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090407040504050904010808" X-Trace: ger.gmane.org 1200846660 16498 80.91.229.12 (20 Jan 2008 16:31:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 20 Jan 2008 16:31:00 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 20 17:31:18 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JGd4m-0008Hz-Sc for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Jan 2008 17:31:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JGd4N-0000XI-DA for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Jan 2008 11:30:51 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JGd4G-0000X6-Hi for bug-gnu-emacs@gnu.org; Sun, 20 Jan 2008 11:30:44 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JGd4F-0000Ws-Fy for bug-gnu-emacs@gnu.org; Sun, 20 Jan 2008 11:30:43 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JGd4F-0000Wp-Ac for bug-gnu-emacs@gnu.org; Sun, 20 Jan 2008 11:30:43 -0500 Original-Received: from smtp1.newsguy.com ([64.209.0.71]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JGd4A-00086l-UK; Sun, 20 Jan 2008 11:30:39 -0500 Original-Received: from [12.75.232.240] (240.piscataway-01rh15-16rt.nj.dial-access.att.net [12.75.232.240]) (authenticated bits=0) by smtp1.newsguy.com (8.13.8/8.13.8) with ESMTP id m0KGURIb074937 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 20 Jan 2008 08:30:30 -0800 (PST) (envelope-from wmeier@newsguy.com) User-Agent: Thunderbird 2.0.0.9 (X11/20071115) In-Reply-To: <478F228D.2090608@gnu.org> X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.8 (RFC1323-) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:17381 Archived-At: This is a multi-part message in MIME format. --------------090407040504050904010808 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Jason Rumney wrote: > I'm confused, what permissions are you talking about? Windows does not > use POSIX permissions, all readable .exe files are considered executable. I'm not really familiar with the details of Windows file permissions so the easiest way for me to respond is to say that in my Windows environment (see below) a 'mingw32-make clean' followed by a 'mingw32-make' fails with a 'permission denied' for temacs.exe. ###Annotated) $mingw32-make clean $mingw32-make "../nt/oo-spd/i386/addsection" "oo-spd/i386/temacs.bin" "oo-spd/i386/temacs.exe" EMHEAP 16 Dumping from oo-spd/i386/temacs.bin to oo-spd/i386/temacs.exe echo oo-spd/i386/emacs.o > oo-spd/i386/buildobj.lst "./oo-spd/i386/temacs.exe" -batch -l loadup dump /usr/bin/sh: ./oo-spd/i386/temacs.exe: Permission denied mingw32-make[1]: *** [oo-spd/i386/emacs.exe] Error 126 mingw32-make[1]: Leaving directory `C:/emacs-22.1.1/src' mingw32-make: *** [all-other-dirs-gmake] Error 2 ### The following shows the 'permissions' of temacs.exe at ### this point $cacls c:\emacs-22.1.1\src\oo-spd\i386\temacs.exe c:\emacs-22.1.1\src\oo-spd\i386\temacs.exe xxx\wmeier:(special access:) STANDARD_RIGHTS_ALL DELETE READ_CONTROL WRITE_DAC WRITE_OWNER SYNCHRONIZE STANDARD_RIGHTS_REQUIRED FILE_GENERIC_READ FILE_GENERIC_WRITE FILE_READ_DATA FILE_WRITE_DATA FILE_APPEND_DATA FILE_READ_EA FILE_WRITE_EA FILE_READ_ATTRIBUTES FILE_WRITE_ATTRIBUTES BUILTIN\Users:(special access:) READ_CONTROL SYNCHRONIZE FILE_GENERIC_READ FILE_GENERIC_WRITE FILE_READ_DATA FILE_WRITE_DATA FILE_APPEND_DATA FILE_READ_EA FILE_WRITE_EA FILE_READ_ATTRIBUTES FILE_WRITE_ATTRIBUTES Everyone:(special access:) READ_CONTROL SYNCHRONIZE FILE_GENERIC_READ FILE_GENERIC_WRITE FILE_READ_DATA FILE_WRITE_DATA FILE_APPEND_DATA FILE_READ_EA FILE_WRITE_EA FILE_READ_ATTRIBUTES FILE_WRITE_ATTRIBUTES ------------------------------------------------------------- My environment (which I think is nothing out of the ordinary) Windows XP (patched) using NTFS file structure MinGW (for gcc, mingw32-make & etc) Cygwin (for bash & etc) ------------------------------------------------------------- As described previously, some poking around shows that the problem is due to the fact that a dummy temacs.exe file without 'execute' permission exists when addsection is run in src/makefile. The dummy file is created in lib-src/makefile. The simple solution to the problem is to delete the dummy file just before runing addsection to create the real temacs.exe. I've attached a patch to do this against the EMACS_22_BASE src/makefile.w32-in ============================================================= ### Some gory details ### Demonstration of the problem ### ### Create dummy temacs.exe and then run addsection; ### Then: Cannot execute temacs.exe $ cd c:\emacs-22.1\src $bash bash-3.2$ echo temacs > oo-spd/i386/temacs.exe bash-3.2$ cacls oo-spd/i386/temacs.exe C:\emacs-22.1.1\src\oo-spd\i386\temacs.exe xxx\wmeier:(special access:) STANDARD_RIGHTS_ALL DELETE READ_CONTROL WRITE_DAC WRITE_OWNER SYNCHRONIZE STANDARD_RIGHTS_REQUIRED FILE_GENERIC_READ FILE_GENERIC_WRITE FILE_READ_DATA FILE_WRITE_DATA FILE_APPEND_DATA FILE_READ_EA FILE_WRITE_EA FILE_READ_ATTRIBUTES FILE_WRITE_ATTRIBUTES BUILTIN\Users:(special access:) READ_CONTROL SYNCHRONIZE FILE_GENERIC_READ FILE_GENERIC_WRITE FILE_READ_DATA FILE_WRITE_DATA FILE_APPEND_DATA FILE_READ_EA FILE_WRITE_EA FILE_READ_ATTRIBUTES FILE_WRITE_ATTRIBUTES Everyone:(special access:) READ_CONTROL SYNCHRONIZE FILE_GENERIC_READ FILE_GENERIC_WRITE FILE_READ_DATA FILE_WRITE_DATA FILE_APPEND_DATA FILE_READ_EA FILE_WRITE_EA FILE_READ_ATTRIBUTES FILE_WRITE_ATTRIBUTES bash-3.2$ "../nt/oo-spd/i386/addsection" "oo-spd/i386/temacs.bin" "oo-spd/i386/temacs.exe" EMHEAP 16 Dumping from oo-spd/i386/temacs.bin to oo-spd/i386/temacs.exe bash-3.2$ ./oo-spd/i386/temacs.exe -l -batch loadup dump bash: ./oo-spd/i386/temacs.exe: Permission denied bash-3.2$ cacls oo-spd/i386/temacs.exe C:\emacs-22.1.1\src\oo-spd\i386\temacs.exe xxx\wmeier:(special access:) STANDARD_RIGHTS_ALL DELETE READ_CONTROL WRITE_DAC WRITE_OWNER SYNCHRONIZE STANDARD_RIGHTS_REQUIRED FILE_GENERIC_READ FILE_GENERIC_WRITE FILE_READ_DATA FILE_WRITE_DATA FILE_APPEND_DATA FILE_READ_EA FILE_WRITE_EA FILE_READ_ATTRIBUTES FILE_WRITE_ATTRIBUTES BUILTIN\Users:(special access:) READ_CONTROL SYNCHRONIZE FILE_GENERIC_READ FILE_GENERIC_WRITE FILE_READ_DATA FILE_WRITE_DATA FILE_APPEND_DATA FILE_READ_EA FILE_WRITE_EA FILE_READ_ATTRIBUTES FILE_WRITE_ATTRIBUTES Everyone:(special access:) READ_CONTROL SYNCHRONIZE FILE_GENERIC_READ FILE_GENERIC_WRITE FILE_READ_DATA FILE_WRITE_DATA FILE_APPEND_DATA FILE_READ_EA FILE_WRITE_EA FILE_READ_ATTRIBUTES FILE_WRITE_ATTRIBUTES ### Creating temacs.exe in the absence of the dummy file ### works AOK bash-3.2$ rm oo-spd/i386/temacs.exe bash-3.2$ "../nt/oo-spd/i386/addsection" "oo-spd/i386/temacs.bin" "oo-spd/i386/temacs.exe" EMHEAP 16 Dumping from oo-spd/i386/temacs.bin to oo-spd/i386/temacs.exe bash-3.2$ ./oo-spd/i386/temacs.exe -l -batch loadup dump bash-3.2$ cacls oo-spd/i386/temacs.exe C:\emacs-22.1.1\src\oo-spd\i386\temacs.exe xxx\wmeier:F BUILTIN\Users:(special access:) READ_CONTROL SYNCHRONIZE FILE_GENERIC_READ FILE_GENERIC_WRITE FILE_GENERIC_EXECUTE FILE_READ_DATA FILE_WRITE_DATA FILE_APPEND_DATA FILE_READ_EA FILE_WRITE_EA FILE_EXECUTE FILE_DELETE_CHILD FILE_READ_ATTRIBUTES FILE_WRITE_ATTRIBUTES Everyone:(special access:) READ_CONTROL SYNCHRONIZE FILE_GENERIC_READ FILE_GENERIC_WRITE FILE_GENERIC_EXECUTE FILE_READ_DATA FILE_WRITE_DATA FILE_APPEND_DATA FILE_READ_EA FILE_WRITE_EA FILE_EXECUTE FILE_DELETE_CHILD FILE_READ_ATTRIBUTES FILE_WRITE_ATTRIBUTES --------------090407040504050904010808 Content-Type: text/plain; name="patch-src-makefile-w32-in.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-src-makefile-w32-in.txt" --- src\makefile.w32-in-orig 2008-01-20 10:24:26.150886400 -0500 +++ src\makefile.w32-in 2008-01-20 10:29:14.345289600 -0500 @@ -168,11 +168,16 @@ # Note the extra post-link step to insert a static preload heap section. # If preload runs out of memory, increase the last argument to addsection # (it is the preload heap size in MB). +# Note that a (possibly dummy) temacs.exe is deleted before the post-link step. +# This is required so that the permissions for the new temacs.exe are not inherited +# from an existing one (which might not have 'executable' permission). +# (See lib-src makefile). # temacs: stamp_BLD $(TEMACS) $(TEMACS): $(TLIB0) $(TLIB1) $(TLIBW32) $(TLASTLIB) $(TOBJ) $(TRES) \ ../nt/$(BLD)/addsection.exe $(LINK) $(LINK_OUT)$(TEMACS_TMP) $(FULL_LINK_FLAGS) $(TOBJ) $(TRES) $(LIBS) + - $(DEL) "$(TEMACS)" "../nt/$(BLD)/addsection" "$(TEMACS_TMP)" "$(TEMACS)" EMHEAP 16 echo $(OBJ0) > $(BLD)/buildobj.lst echo $(OBJ1) >> $(BLD)/buildobj.lst --------------090407040504050904010808--