open(2): allow O_PATH | O_CREAT

(cherry picked from commit cc0d806f63)
This commit is contained in:
Konstantin Belousov 2025-01-06 13:01:11 +02:00
parent 42d4bcc6c5
commit aa8067cbe7

View file

@ -1147,7 +1147,7 @@ openatfp(struct thread *td, int dirfd, const char *path,
* except O_EXEC is ignored.
*/
if ((flags & O_PATH) != 0) {
flags &= ~(O_CREAT | O_ACCMODE);
flags &= ~O_ACCMODE;
} else if ((flags & O_EXEC) != 0) {
if (flags & O_ACCMODE)
return (EINVAL);