delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/03/02/14:00:38

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=1.6 required=5.0 tests=AWL,BAYES_00,BOTNET
X-Spam-Check-By: sourceware.org
Message-id: <4B8D523A.1060802@acm.org>
Date: Tue, 02 Mar 2010 10:00:26 -0800
From: David Rothenberger <daveroth AT acm DOT org>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3
MIME-version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Cygwin's svn appends unwanted .exe to file name on checkout
References: <B7FD2A676FED46478FC330F30AD8D78D4BB7C574E6 AT RDW083V001RVA1 DOT domain1 DOT systemhost DOT net> <4B8BFD4A DOT 6060609 AT acm DOT org> <20100302100035 DOT GO8799 AT trikaliotis DOT net> <4B8CE986 DOT 2040805 AT Gymel DOT com> <20100302115813 DOT GJ5683 AT calimero DOT vinschen DOT de> <4B8D47F7 DOT 7050000 AT acm DOT org> <20100302175545 DOT GB1425 AT calimero DOT vinschen DOT de>
In-reply-to: <20100302175545.GB1425@calimero.vinschen.de>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 3/2/2010 9:55 AM, Corinna Vinschen wrote:
> On Mar  2 09:16, David Rothenberger wrote:
>> 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.
> 
> The rename(2) function does not check at all for the ACL.  The weird
> outcome must have something to do with the way the GetBinaryType
> function works.

Yeah, that's what I guessed.

> I don't understand what the default permissions of the parent dir
> have to do with that, though.

I did notice that if I copied notepad.exe (the exe I was using for the
test), the default permissions had no effect. If I did "cat notepad.exe
> tempfile.tmp", though, it did. Maybe some kind of inheritance?

Anyway, is there a way to rename a file without triggering the .exe
suffix addition? If there is, do you think it would be a good idea for
libapr1 to use that instead of just calling rename(2)?

-- 
David Rothenberger  ----  daveroth AT acm DOT org

Rule of the Great:
        When people you greatly admire appear to be thinking deep
        thoughts, they probably are thinking about lunch.

--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019