On Thu, 19 Feb 2004 09:12, Michael Stone <[EMAIL PROTECTED]> wrote: > On Wed, Feb 18, 2004 at 11:50:27PM +1100, Russell Coker wrote: > >The other way of doing it properly is to write a program that open's each > >file, calls fstat() to check the UID/GID, then uses fchown() or fchmod(). > > > >It would be nice if someone was to patch the -R option of > > chown/chgrp/chmod in coreutils to do this sort of thing. > > To do what? The logic rapidly gets too complex for the command line, > imo. (chown --only-if-uid-isn't-root? chown --onlyuids=1000-1009?)
chown --source-uid=1000 -R 1001 /home/usera That should be OK. The alternatives are to write a separate program, or to have a commonly desired operation that is extremely difficult to perform securely on a live system. -- http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page

