fchmodat, chownat, utimensat: O_WRITE: Is a directory
It seems that after "Fix open(2) allowing opening directories invalidly and check O_TRUNC errors.", the following system calls fail on directories fchmodat, chownat, and utimensat.
This problem can be reproduced by running touch(1) on a directory, or by extracting a tarball (for instance using the upcoming 'tix install' package management). I can't reproduce the problem on directories using chmod(1) for some reason, though tar(1) does mention such a problem. Sortix doesn't have a chown(1) so I can't test that system call. The issue needs to be investigated a bit more.
I can conclude these system calls should be affected because they open paths using O_WRITE
because they want to do operations like chmod
, chown
, and utimens
on the opened inode. I'm unclear how those should be implemented instead (especially when file system permissions are implemented). Perhaps O_WRITE
does make sense on directories?