This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Path confusion

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. 


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



Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]