diff options
author | Andriy Gapon <avg@FreeBSD.org> | 2011-03-26 11:25:36 +0000 |
---|---|---|
committer | Andriy Gapon <avg@FreeBSD.org> | 2011-03-26 11:25:36 +0000 |
commit | 01a9e1a11bafcfbcafd24519e1e36249727bee27 (patch) | |
tree | b1af08af47453523de412e4c7d4d249604e6a67c /sys/compat/linux | |
parent | 605da56bc3ac6a171b8f26aa9d6ebdc1e54e35e5 (diff) | |
download | src-01a9e1a11bafcfbcafd24519e1e36249727bee27.tar.gz src-01a9e1a11bafcfbcafd24519e1e36249727bee27.zip |
linux compat: add SO_PASSCRED option with basic handling
This seems to have been a part of a bigger patch by dchagin that either
haven't been committed or committed partially.
Submitted by: dchagin, nox
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=220032
Diffstat (limited to 'sys/compat/linux')
-rw-r--r-- | sys/compat/linux/linux_socket.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 6940e45be0bd..0fe0dc6ff707 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -300,6 +300,8 @@ linux_to_bsd_so_sockopt(int opt) return (SO_OOBINLINE); case LINUX_SO_LINGER: return (SO_LINGER); + case LINUX_SO_PASSCRED: + return (LOCAL_CREDS); case LINUX_SO_PEERCRED: return (LOCAL_PEERCRED); case LINUX_SO_RCVLOWAT: @@ -1467,6 +1469,12 @@ linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args) switch (bsd_args.level) { case SOL_SOCKET: name = linux_to_bsd_so_sockopt(args->optname); + switch (args->optname) { + case LINUX_SO_PASSCRED: + /* FreeBSD bug? socket level opts at non socket level */ + bsd_args.level = 0; + break; + } switch (name) { case SO_RCVTIMEO: /* FALLTHROUGH */ @@ -1544,6 +1552,12 @@ linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args) switch (bsd_args.level) { case SOL_SOCKET: name = linux_to_bsd_so_sockopt(args->optname); + switch (args->optname) { + case LINUX_SO_PASSCRED: + /* FreeBSD bug? socket level opts at non socket level */ + bsd_args.level = 0; + break; + } switch (name) { case SO_RCVTIMEO: /* FALLTHROUGH */ |