Fix chmod(2), chown(2), and utimens(2) opening the path for writing.
The change 9d29e96c "Fix open(2) allowing opening directories invalidly and check O_TRUNC errors." broke the chmod(2), chown(2), and utimens(2) system calls on directories, because they can no longer be opened for writing. This changes fixes the regression by opening such paths for reading. There is currently no filesystem permission checks for those system calls. However, those system calls should check the permissions at the time of the operation rather than relying on the file having been opened for writing previously.
Showing with 6 additions and 3 deletions