Messages in this thread | | | Date | Wed, 7 Jan 1998 20:10:29 +0100 | From | ralf@uni-kobl ... | Subject | Re: hardlinks.... sucks... ;-( |
| |
On Wed, Jan 07, 1998 at 01:21:58AM -0500, Albert D. Cahalan wrote:
> >> No. You just need other tool than chown, you need tool that changes > >> uid->uid. And you run it as chown -from olduser -to newuser -R /, > >> which looks for all files owned by olduser and makes newuser own > >> them. Just go ahead and write this tool. (And mail me a copy ;-). (I > >> would also appredicate option to delete such files). > > > > Try something a bit like one of the following: > > > > find / -user 1234 -print | xargs chown 4321 > > find / -user 1234 -print | xargs rm > > find / -user 1234 -exec chown 4321 {} ; > > find / -user 1234 -exec rm {} ; > > Alright now, how many people would do that? :-) > > 1. the file is found by "find" > 2. the user removes it and makes a link > 3. the "chown" command runs > > It seems a file starting with "-" could cause trouble too. > Maybe a name like "--follow-symlinks" would be interesting.
So then try:
find / -user 1234 -print0 | xargs -0 chown 4321 -- find / -user 1234 -print0 | xargs -0 rm --
Which will also protect you against filenames with spaces and other fun characters.
> Link and symlink restrictions would help protect us from > our luserness. Arrogance has no place in security.
Some believe that not even larting will prevent us from luserness ;-)
Ralf
| |