Mail Archives: cygwin/2005/04/01/02:02:50
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 -