delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/04/01/02:02:50

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Date: Fri, 1 Apr 2005 17:02:21 +1000 (EST)
From: Luke Kendall <luke DOT kendall AT cisra DOT canon DOT com DOT au>
Subject: Re: Path confusion
To: cygwin AT cygwin DOT com
In-Reply-To: <Pine.GSO.4.61.0504010012190.26371@slinky.cs.nyu.edu>
MIME-Version: 1.0
Message-Id: <20050401070221.3F8E78553D@pessard.research.canon.com.au>

On  1 Apr, Igor Pechtchanski wrote:
>  > Luke Kendall wrote: 
>  > 
>  > >     find `cygpath -m /` -xdev -user $USER -print \ 
>  > >        | tr "\n" "\000" \ 
>  > >        | xargs -0 chown Administrators.SYSTEM 
Brian Dessent:
>  > 
>  > You can use -print0, and since find is a cygwin application I don't see 
>  > what the point of using cygpath is: 

I think you're right.  I was trying to limit it via the directory root
at first, not realising c:/cygwin would be re-written as "/" anyway. 
So you're right, the -xdev is sufficient.

The reason for the tr instead of the -print0 was so that other shell
filters (like grep) could be interposed there if needed.  Which
certainly wasn't obvious, I confess.  Without them, -print0 yields a
clearer and faster solution.

>  > find / -xdev -user $USER -print0 | xargs -0 chown Administrators.SYSTEM 
> 
>  Both of us have neglected the same pitfall: 
>   
>  find / -xdev -user "$USER" -print0 | xargs -0 chown Administrators.SYSTEM 

Ah, the new spaces in user names feature.  Good point!

>  > Though I would be tempted just to do "chown -R / ..." 
>
>  You must mean 'chown -R --from="$USER" ...' :-) 

Hmm, sounds better still.  :-)

>  > or even better, just set the desired ACL on c:\cygwin before installing 
>  > and let it be inherited. 
>   
>  That doesn't change the owner, though.  One may want to allow only users 
>  with administrative privileges to modify system programs, in which case a 
>  chown does make sense. 

Precisely.

This makes me recall another oddity, but I should probably start a
separate thread.

Thanks,

luke


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

- Raw text -


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