X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
From: "Dave Korn" <dave.korn@artimi.com>
To: <cygwin@cygwin.com>
References: <E173C70E3D81F74188D2778B96C5CD0D011B4A73@postal1-dog.naughtydog.com> <20080204150853.GD5866@calimero.vinschen.de> <E173C70E3D81F74188D2778B96C5CD0D011B4AE2@postal1-dog.naughtydog.com> <20080204205620.GA2720@ednor.casa.cgf.cx> <E173C70E3D81F74188D2778B96C5CD0D011B4B5C@postal1-dog.naughtydog.com> <E173C70E3D81F74188D2778B96C5CD0D011B4BD0@postal1-dog.naughtydog.com> <02fb01c86795$9aeb5080$2e08a8c0@CAM.ARTIMI.COM> <20080205133450.GB307@calimero.vinschen.de> <032c01c867fd$c573da30$2e08a8c0@CAM.ARTIMI.COM> <20080205142712.GA840@calimero.vinschen.de>
Subject: RE: CIFS symlinks on network share break Cygwin
Date: Tue, 5 Feb 2008 20:24:26 -0000
Message-ID: <03a301c86835$1a571850$2e08a8c0@CAM.ARTIMI.COM>
MIME-Version: 1.0
Content-Type: text/plain; 	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <20080205142712.GA840@calimero.vinschen.de>
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On 05 February 2008 14:27, Corinna Vinschen wrote:

> On Feb  5 13:48, Dave Korn wrote:
>> On 05 February 2008 13:35, Corinna Vinschen wrote:
>> 
>>> What exactly happens with the perms?  Are you using CYGWIN=smbntsec?
> 
> you didn't answer my first question.  What exactly happens with the perms?
> To what values are they set when creating a file?

  Oops, pardon.  I thought I had posted this yesterday but now I see it's just
lying around my drafts folder.  My win32 "T:" drive is a netapp share (CIFS
with NFS perms) and /win/t is a mountpoint to it (system, binmode, noexec)
that I use as shorthand for /cygdrive notation.

/win/t/netapp $ ls -la
total 0
drwxr-xr-x 1 dk Domain Users 0 Feb  4 15:23 .
drwxr-xr-x 1 dk Domain Users 0 Jan  1  1970 ..
/win/t/netapp $ echo $CYGWIN
ntsec smbntsec notty error_start=C:\cygwin\usr\local\bin\insight.exe
/win/t/netapp $ touch foo.bar
/win/t/netapp $ ls -la
total 0
drwxr-xr-x 1 dk Domain Users 0 Feb  4 15:23 .
drwxr-xr-x 1 dk Domain Users 0 Jan  1  1970 ..
-rw-r--r-- 1 dk Domain Users 0 Feb  4 15:23 foo.bar
/win/t/netapp $ chmod a+rwx foo.bar
/win/t/netapp $ ls -la
total 0
drwxr-xr-x 1 dk Domain Users 0 Feb  4 15:23 .
drwxr-xr-x 1 dk Domain Users 0 Jan  1  1970 ..
-rw-r--r-- 1 dk Domain Users 0 Feb  4 15:23 foo.bar
/win/t/netapp $


  So, can't chmod easily.  Umask appears at first glance to be respected when
creating files:

/win/t $ umask 0
/win/t $ touch baz.bar
/win/t $
/win/t $ ls -la baz.bar
-rw-r--r-- 1 dk Domain Users 0 Feb  5 15:18 baz.bar
/win/t $ umask 777
/win/t $ touch baz.bot
/win/t $ ls -la baz.bot
---------- 1 dk Domain Users 0 Feb  5 15:18 baz.bot
/win/t $ 

  I have no idea what happened next.  Looked as if the umask was contagious:

/win/t $ chmod a+rwx baz.bot
/win/t $ ls -la baz.*
---------- 1 dk Domain Users   0 Feb  5 15:18 baz.bar
---------- 1 dk Domain Users   0 Feb  5 15:18 baz.bot
---------- 1 dk Domain Users 111 Aug 17  2006 baz.txt

  Ah, phew:

/win/t $ umask 000
/win/t $ ls -la baz.*
-rw-r--r-- 1 dk Domain Users   0 Feb  5 15:18 baz.bar
-rw-r--r-- 1 dk Domain Users   0 Feb  5 15:18 baz.bot
-rw-r--r-- 1 dk Domain Users 111 Aug 17  2006 baz.txt

...that got it back.  How bizarre: a live umask with retroactive effect.

/win/t $ umask 000
/win/t $ ls -la baz.*
-rw-r--r-- 1 dk Domain Users   0 Feb  5 15:18 baz.bar
-rw-r--r-- 1 dk Domain Users   0 Feb  5 15:18 baz.bot
-rw-r--r-- 1 dk Domain Users 111 Aug 17  2006 baz.txt
/win/t $ umask 077
/win/t $ ls -la baz.*
-rw------- 1 dk Domain Users   0 Feb  5 15:18 baz.bar
-rw------- 1 dk Domain Users   0 Feb  5 15:18 baz.bot
-rw------- 1 dk Domain Users 111 Aug 17  2006 baz.txt
/win/t $ umask 770
/win/t $ ls -la baz.*
-------r-- 1 dk Domain Users   0 Feb  5 15:18 baz.bar
-------r-- 1 dk Domain Users   0 Feb  5 15:18 baz.bot
-------r-- 1 dk Domain Users 111 Aug 17  2006 baz.txt
/win/t $ umask 731
/win/t $ ls -la baz.*
----r--r-- 1 dk Domain Users   0 Feb  5 15:18 baz.bar
----r--r-- 1 dk Domain Users   0 Feb  5 15:18 baz.bot
----r--r-- 1 dk Domain Users 111 Aug 17  2006 baz.txt
/win/t $ umask 137
/win/t $ ls -la baz.*
-rw-r----- 1 dk Domain Users   0 Feb  5 15:18 baz.bar
-rw-r----- 1 dk Domain Users   0 Feb  5 15:18 baz.bot
-rw-r----- 1 dk Domain Users 111 Aug 17  2006 baz.txt
/win/t $

  </boggle> That's just completely Tom Cruise, that is.

>>   (... which makes me wonder, could we possibly leverage that to do some
>> useful work for us in these situations...?)
> 
> Shure, if the DLL has a usefull documented API 

  Heh, I believe it's IShellExtension or some such similar[*]...

> and a programmer is
> caring (or paid) enough to actually do it.

  I'd do it just so that I don't have to go to explorer all the time.


    cheers,
      DaveK

[*] - not even nearly, actually, but anyway it's /one/ of those explorer shell
extension IXxxxXxxxxx interfaces.
-- 
Can't think of a witty .sigline today....


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

