mailing list of musl libc
 help / color / mirror / code / Atom feed
* O_EXEC and O_SEARCH
@ 2013-02-22  0:45 Rich Felker
  2013-02-23  3:05 ` KOSAKI Motohiro
  2013-02-23  4:54 ` KOSAKI Motohiro
  0 siblings, 2 replies; 12+ messages in thread
From: Rich Felker @ 2013-02-22  0:45 UTC (permalink / raw)
  To: libc-alpha; +Cc: musl

Hi,

I'd like to have a conversation with the glibc team about O_EXEC and
O_SEARCH in the interest of hopefully developing a unified plan for
supporting them on Linux. Presumably the reason glibc still does not
have them is that Linux O_PATH does not exactly match their semantics
in some cases, and O_PATH is sufficiently broken on many kernel
versions to make offering it problematic. In particular, current
coreutils break badly on most kernel versions around 2.6.39-3.6 or so
if O_SEARCH and O_EXEC are defined as O_PATH.

Right now, we're offering O_EXEC and O_SEARCH in musl libc, defining
them as O_PATH. As long as recent Linux is used, this gives nearly
correct semantics, except that combined with O_NOFOLLOW they do not
fail when the final component is a symbolic link. I believe it's
possible to work around this issue on sufficiently modern kernels
where fstat works on O_PATH file descriptors, but adding the
workaround whenever O_PATH|O_NOFOLLOW is in the flags would change the
semantics when O_PATH is used by the caller rather than O_EXEC or
O_SEARCH, since the value is equal. I'm not sure this is desirable.

What should the long-term plan for supporting O_SEARCH and O_EXEC on
Linux be? Should we assume Linux is aiming for O_PATH to eventually
provide compatible semantics, and thus just define O_SEARCH and O_EXEC
as O_PATH? Or is there a need to define a different value (perhaps 3,
the unused access mode) for O_SEARCH and O_EXEC and have open/fcntl
remap it and handle workarounds for Linux semantics that don't match
the POSIX semantics?

Rich


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-02-23  5:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-22  0:45 O_EXEC and O_SEARCH Rich Felker
2013-02-23  3:05 ` KOSAKI Motohiro
2013-02-23  3:17   ` Rich Felker
2013-02-23  3:58     ` KOSAKI Motohiro
2013-02-23  4:33       ` Rich Felker
2013-02-23  5:01         ` KOSAKI Motohiro
2013-02-23  5:05           ` Rich Felker
2013-02-23  5:21             ` KOSAKI Motohiro
2013-02-23  4:54 ` KOSAKI Motohiro
2013-02-23  5:03   ` Rich Felker
2013-02-23  5:20     ` KOSAKI Motohiro
2013-02-23  5:28       ` KOSAKI Motohiro

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).