SystemTools: Fix Touch to avoid requiring file ownership
Compare changes
System updates will be applied on Mar 14th between 7am and 9am, EST (UTC-05:00). This site will have intermittent downtime during that time.
SystemTools::Touch should only require +w file permissions. The previous
implementation used stat
to get the current time, and then passed that
time to one of utimensat/utimes/utime. However, utimes/utimensat only
permit an arbitrary-time argument to be passed by the file owner.
Therefore, per the docs, we pass NULL for the times
argument to utimes
and utimensat, to indicate using the current time. This is permitted for
any UID with +w on the file.
Fallback usage of utime
is removed as unnecessary.
Issue: cmake/cmake#16526 (closed)
Topic-rename: SystemTools-simplify-touch