[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help! File permissions keep changing...



Le 12466ième jour après Epoch,
Michael Stone écrivait:

> 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?)

I've not read the full thread, but why not use the command:

  su "owner-of-the-file" -c chmod some+args the-file

in the script? So no critical race condition, no hardlink problems,
etc. ???

Maybe I'm wrong, correct me in this case.

-- 
"I'd love to go out with you, but it's my parakeet's bowling night."



Reply to: