delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/04/23/08:30:20

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Mon, 23 Apr 2012 14:28:07 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: cygwin 1.7.13-1: can't execute shell scripts on samba share
Message-ID: <20120423122807.GE7097@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <1E3D6F97-F938-420C-A5F7-C6446EC27F32 AT intersystems DOT com> <CA+sc5mkcWZZcskBqSCgKJqzTh1-CwbyF_Z83Bsox2zPMtk5v9A AT mail DOT gmail DOT com> <1883CD3D-75CE-4289-A5F9-317DE2ED7F28 AT intersystems DOT com> <CA+sc5m=E78GFTYnTaOgjLOs-99OupJs1TA3aE_-AjdgGYo5F1Q AT mail DOT gmail DOT com> <FEF31C20-5357-4D61-A272-CE75404C3A88 AT intersystems DOT com> <6BFA9AF2C7556E42AFF3F187ECAB07B802F9CFCB AT bespdc01 DOT mediaxim DOT local> <20120423115331 DOT GD7097 AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
In-Reply-To: <20120423115331.GD7097@calimero.vinschen.de>
User-Agent: Mutt/1.5.21 (2010-09-15)
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 Apr 23 13:53, Corinna Vinschen wrote:
> On Apr 23 13:02, Michel Bardiaux wrote:
> > [snip]
> > 
> > > lgiambro AT lorien ~
> > > $ cat len.sh
> > > #!/bin/sh
> > > echo it works
> > 
> > And man sh states " --norc Do  not  read  and  execute the personal
> > initialization file ~/.bashrc if the
> >               shell is interactive.  This option is on by default if the
> > shell  is  invoked
> >               as sh."
> > Which eliminates bashrc as a possible culprit.
> > 
> > I have also tried the same as you did (len.sh on a samba share) and saw
> > the same problem. Then I saw that the len.sh got a (cygwin *and* linux)
> > mode of -rwxrw-r-- *without* doing any chmod. Then I saw that *every*
> > file I create on the samba share, gets the same mode!
> > 
> > First things first, is there a workaround? Yes, chmod 777 len.sh *done
> > on linux* works. And it actually works too when done on cygwin.
> > 
> > However, recreating len.sh on cygwin, then a chmod 700 len.sh again on
> > cygwin, does not work, again "./len.sh: Permission denied". But the mode
> > seen on the linux side is -rwx------.
> > 
> > I have also tried deleting then recreating the file in cygwin, then
> > closing all cygwin processes and unmapping and remapping the samba
> > drive. No cigar.
> > 
> > Then I tried cacls in various situations. It turns out that with mode
> > 777, cacls reveals "Everyone:F", but with mode 700 we get:
> > 
> > len.sh <Account Domain not found>F
> >               <Account Domain not found>(special access:)
> >               Everyone:(special access:)
> > 
> > And getfacl says:
> > 
> > # file: len.sh
> > # owner: ????????
> > # group: ????????

Just to clarify:  The unknown owner and group accounts in the getfacl
output above are almost certainly the fake SIDs created by Samba to
generate an unambiguous Unix UID/GID to Windows SID mapping.  This
occurs if you don't use winbind on the Samba side to generate a real
UID/GID to SID mapping.

The fake SIDs created by Samba are of the form

  S-1-22-1-UID
  S-1-22-2-GID

You can add them to your /etc/passwd and /etc/group files by using the
`mkpasswd/mkgroup -U option, see
http://cygwin.com/cygwin-ug-net/using-utils.html#mkpasswd and
http://cygwin.com/cygwin-ug-net/using-utils.html#mkgroup

For instance:

  $ mkpasswd -o 20000 -U root,corinna -L my_samba_server
  Unix User\root:unused:20000:99999:,S-1-22-1-0::
  Unix User\corinna:unused:20500:99999:,S-1-22-1-500::
  $ mkgroup -o 20000 -U root,vinschen -L calimero
  Unix Group\root:S-1-22-2-0:20000:
  Unix Group\vinschen:S-1-22-2-11125:31125:

This gives a useful output in ls, getfacl or stat.

> You could mount the samba share with "noacl", see
> http://cygwin.com/cygwin-ug-net/using.html#mount-table


Corinna

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