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