Summary: | socketpair support for LOCAL_PEERCRED | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Nicholas Wilson <nicholas> | ||||
Component: | kern | Assignee: | Alan Somers <asomers> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | CC: | asomers, emaste, eto.freebsd, net, oshogbo | ||||
Priority: | Normal | Keywords: | needs-qa | ||||
Version: | Unspecified | Flags: | asomers:
mfc-stable11+
asomers: mfc-stable10+ |
||||
Hardware: | Any | ||||||
OS: | Any | ||||||
URL: | https://reviews.freebsd.org/D16350 | ||||||
Attachments: |
|
Description
Nicholas Wilson
2013-02-25 13:00:00 UTC
Responsible Changed From-To: freebsd-bugs->freebsd-net Over to maintainer(s). I think I hit this recently as well. Man page contains wording: [ENOTCONN] The argument s does not refer to a socket on which connect(2) or listen(2) have been called. Which actually describes situation exactly, but it is bit non-obvious that it also means implicit exclusion of socktepair(). More over, as mentioned by nicholas, other system I tried (Linux) supports getting this information about socketpair() created sockets. I have not yet tried OS X. I wanted to use this to verify socket owner credentials (usually parent process), before consuming data from it, in scripted environment. Unfortunately, this feature can be used only when I go through fs namespace. I don't know how these "anonymous" sockets (created by socketpair()) are implemented internally but, I think creating socket files in my situation is kinda wasteful. batch change: For bugs that match the following - Status Is In progress AND - Untouched since 2018-01-01. AND - Affects Base System OR Documentation DO: Reset to open status. Note: I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed. Code review in progress https://reviews.freebsd.org/D16350 A commit references this bug: Author: asomers Date: Fri Aug 3 01:37:01 UTC 2018 New revision: 337222 URL: https://svnweb.freebsd.org/changeset/base/337222 Log: Fix LOCAL_PEERCRED with socketpair(2) Enable the LOCAL_PEERCRED socket option for unix domain stream sockets created with socketpair(2). Previously, it only worked with unix domain stream sockets created with socket(2)/listen(2)/connect(2)/accept(2). PR: 176419 Reported by: Nicholas Wilson <nicholas@nicholaswilson.me.uk> MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16350 Changes: head/sys/kern/uipc_syscalls.c head/sys/kern/uipc_usrreq.c head/sys/sys/unpcb.h head/tests/sys/kern/Makefile head/tests/sys/kern/unix_socketpair_test.c A commit references this bug: Author: asomers Date: Mon Oct 1 17:37:00 UTC 2018 New revision: 339067 URL: https://svnweb.freebsd.org/changeset/base/339067 Log: MFC r337222: Fix LOCAL_PEERCRED with socketpair(2) Enable the LOCAL_PEERCRED socket option for unix domain stream sockets created with socketpair(2). Previously, it only worked with unix domain stream sockets created with socket(2)/listen(2)/connect(2)/accept(2). PR: 176419 Reported by: Nicholas Wilson <nicholas@nicholaswilson.me.uk> Differential Revision: https://reviews.freebsd.org/D16350 Changes: _U stable/11/ stable/11/sys/kern/uipc_syscalls.c stable/11/sys/kern/uipc_usrreq.c stable/11/sys/sys/unpcb.h stable/11/tests/sys/kern/Makefile stable/11/tests/sys/kern/unix_socketpair_test.c A commit references this bug: Author: asomers Date: Mon Oct 1 18:00:53 UTC 2018 New revision: 339068 URL: https://svnweb.freebsd.org/changeset/base/339068 Log: MFC r337222: Fix LOCAL_PEERCRED with socketpair(2) Enable the LOCAL_PEERCRED socket option for unix domain stream sockets created with socketpair(2). Previously, it only worked with unix domain stream sockets created with socket(2)/listen(2)/connect(2)/accept(2). PR: 176419 Reported by: Nicholas Wilson <nicholas@nicholaswilson.me.uk> Differential Revision: https://reviews.freebsd.org/D16350 Changes: _U stable/10/ stable/10/sys/kern/uipc_syscalls.c stable/10/sys/kern/uipc_usrreq.c stable/10/sys/sys/unpcb.h stable/10/tests/sys/kern/Makefile stable/10/tests/sys/kern/unix_socketpair_test.c |