delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/08/06/14:05:02

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Thu, 6 Aug 2009 20:04:41 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Can't execute scripts from a samba share with 1.7
Message-ID: <20090806180441.GB19829@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <h5cqnj$c9f$1 AT ger DOT gmane DOT org> <20090806142010 DOT GE3204 AT calimero DOT vinschen DOT de> <h5f54a$nkt$1 AT ger DOT gmane DOT org>
MIME-Version: 1.0
In-Reply-To: <h5f54a$nkt$1@ger.gmane.org>
User-Agent: Mutt/1.5.19 (2009-02-20)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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 Aug  6 10:50, Nahor wrote:
> Corinna Vinschen wrote:
>> On Aug  5 13:40, Nahor wrote:
>>   
>>> Hi,
>>>
>>> I have a samba share mounted in cygwin with the following fstab entry:
>>> //server/nahor /home/nahor smbfs binary,user,exec,acl,posix=0,cygexec 0 0
>>>
>>> Permissions are set correctly:
>>> $ ls -al
>>> -rwxr--r-- 1 nahor Domain Users      19 Aug  5 11:46 t.sh
>>>
>>> My test script doesn't do much:
>>> $ cat ./t.sh
>>> #!/bin/sh
>>> echo foo
>>> $
>>>
>>> But when I execute:
>>> $ ./t.sh
>>> -bash: ./t.sh: Permission denied
>>> $
>>>     
>> Cygwin 1.5.x and earlier versions of Cygwin 1.7.0 didn't check execute
>> permissions when trying to start a shell script.  Later versions of
>> 1.7.0 do check on filesystems mounted with the "acl" option.  Apparently
>> the check fails.  Is there a chance that there are two different
>> accounts called nahor?
>>   
>
> Indeed. One is an account on the local machine and there is another one  
> on the domain. I login using the local account but the samba share  
> belong to the domain user.
> Running cygwin with the domain user allows running the script. Changing  
> the permission to 755 also fixes the error.
> Thanks!

I'm glad it has such a simple solution.

> One weird thing though, the directory permission are 700 and yet I can  
> list the content of the directory, cd in it and add/delete files. So  
> permissions are not consistently checked. But then, I assume it's  
> because all that is done by Windows/Samba while the permission check on  
> the script is done by Cygwin? Same thing with executing binary (I was  
> able to execute a binary file copied on the share even though I couldn't  
> execute scripts)?

Most of Cygwin relys on the permission checks of the underlying OS.
In case of scripts, that's not possible.  Therefore it has to check
script permissions explicitely.  Note that it doesn't do a simple
POSIX permission bit check, rather it calls an OS function asking
"does *this* account have the right to execute *that* file?"  That
should result in the most consistent behaviour, as far as Windows
consistency goes.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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