coreutils
[Top][All Lists]
Advanced

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

Re: chmod --cheap option


From: Eric Blake
Subject: Re: chmod --cheap option
Date: Tue, 24 May 2016 08:38:22 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 05/24/2016 06:42 AM, Hrubák, András wrote:
> Dear Coreutils Dev Team,
> 
> I made a patch for chmod.
> It introduces an option `--cheap' to avoid real chmod (fchmodat) call
> if the new mode seems equivalent to the old one.
> It not only saves IO time, but also leaves ctime unchanged. While
> ctime often plays role in updating/backuping/cleaning mechanisms, I
> needed such a feature.
> Please see it here: https://github.com/coreutils/coreutils/pull/6

Please post patches to this list, rather than making us chase pull requests.

That said, it is unlikely that your patch will be applied, as it is
fundamentally a TOCTTOU race - there is no race-free way to determine a
file's current mode to know that the changed mode will not be different,
because a concurrent operation can occur between your check and the
(potentially-skipped) chmod; so we prefer to always do the chmod.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]