Date: Wed, 03 Nov 2021 11:29:12 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 259625] fdescfs: file descriptors with O_EXEC give EACCESS when opened Message-ID: <bug-259625-227-76TcJi38Mb@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-259625-227@https.bugs.freebsd.org/bugzilla/> References: <bug-259625-227@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D259625 --- Comment #7 from Konstantin Belousov <kib@FreeBSD.org> --- (In reply to Konstantin Belousov from comment #5) I remembered that there is a trick in POSIX that de-facto allowed O_RDONLY = be zero. But apparently it is even more strict, making your second program non-conforming. Applications shall specify exactly one of the first five values (file access modes) below in the value of oflag: O_EXEC Open for execute only (non-directory files). The result is unspecifi= ed if this flag is applied to a directory. O_RDONLY Open for reading only. O_RDWR Open for reading and writing. The result is undefined if this flag is applied to a FIFO. O_SEARCH Open directory for search only. The result is unspecified if this = flag is applied to a non-directory file. O_WRONLY Open for writing only. I.e. O_RDONLY|O_EXEC is illegal from POSIX PoV, and FreeBSD interprets it as O_EXEC. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-259625-227-76TcJi38Mb>