Page MenuHomeFreeBSD

D58792.id183904.diff
No OneTemporary

D58792.id183904.diff

diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -3114,8 +3114,15 @@
* socket, it is the peer, so return success (or its error) with no
* fallback; if not, it may be an O_PATH handle for a bound socket's
* vnode, so fall through to an EMPTYPATH lookup.
+ *
+ * The descriptor-names-the-peer interpretation only applies to
+ * connectat(2) with a real fd. connect(2) passes AT_FDCWD, and a
+ * sockaddr whose sun_path begins with a NUL byte (e.g. a Linux
+ * abstract namespace name passed through the linuxulator) must keep
+ * failing the pathname lookup with ENOENT as it historically did,
+ * so callers like libxcb fall back to the pathname socket.
*/
- if (*buf == '\0') {
+ if (*buf == '\0' && fd != AT_FDCWD) {
error = unp_socket_fd_peer(td, fd, so2p);
if (error != ENOTSOCK)
return (error);

File Metadata

Mime Type
text/plain
Expires
Thu, Aug 20, 9:05 AM (9 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36605419
Default Alt Text
D58792.id183904.diff (903 B)

Event Timeline