Cygwin's svn appends unwanted .exe to file name on checkout

David Rothenberger daveroth@acm.org
Tue Mar 2 17:16:00 GMT 2010


On 3/2/2010 3:58 AM, Corinna Vinschen wrote:
> The .exe suffix is added if all of the below is true:
>
> - The file is renamed via the rename(2) function.
> - The name does not only change by case on a caseinsensitive mount.
> - The file is a binary checked with the Win32 function GetBinaryType,
>    and the returned type is SCS_32BIT_BINARY or SCS_64BIT_BINARY.
> - The source filename has none of the following suffixes:
>      .com
>      .dll
>      .exe
>      .scr
>      .sys
> - The destination filename has none of the aforementioned suffixes.

All these conditions are true in the svn test case. svn is renaming 
tst/tempfile.tmp to tst/notepad.xxx using libapr1, which is using rename(2).

It does seem that the ACLs on the directory and file play a role, too. 
I've attached a reproduction script along with a simple rename(2) driver 
program. The script explicitly removes the default group ACLs from a 
directory before doing a rename(2) in that directory. In that case, no 
.exe suffix is added. If you modify the top of the script to set 
"SETACLS=set", it will add default group ACLs of rwx and the .exe suffix 
is added.

I'm not sure if this points to a bug in Cygwin or not. It does explain 
why Alan and I were seeing different behavior.

Regardless, it doesn't seem like rename(2) will be changed to avoid 
adding the .exe suffix, so either we live with this behavior in svn or I 
need to patch libapr1 to do a rename without triggering this behavior. I 
tried using renameat(2) but that (unsurprisingly) also triggers the 
behavior.

Is there some sanctioned way to do a rename without triggering the .exe 
suffix addition?

-- 
David Rothenberger  ----  daveroth@acm.org

Alden's Laws:
         (1)  Giving away baby clothes and furniture is the major cause
              of pregnancy.
         (2)  Always be backlit.
         (3)  Sit down whenever possible.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tstren.c
URL: <http://cygwin.com/pipermail/cygwin/attachments/20100302/a7728219/attachment.c>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: reproduce.sh
URL: <http://cygwin.com/pipermail/cygwin/attachments/20100302/a7728219/attachment.ksh>
-------------- next part --------------
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


More information about the Cygwin mailing list