diff options
| author | Dmitry Chagin <dchagin@FreeBSD.org> | 2009-05-16 18:42:18 +0000 |
|---|---|---|
| committer | Dmitry Chagin <dchagin@FreeBSD.org> | 2009-05-16 18:42:18 +0000 |
| commit | d4dd69c46cf0a3513b5ae06bd7f3e579574985d3 (patch) | |
| tree | ca69c2e6c186a75c9cd48b6b0ffe4e094819c375 /sys/compat/linux/linux_socket.c | |
| parent | ae28ded2c8322f9363327cf2338070d08b0893b8 (diff) | |
Notes
Diffstat (limited to 'sys/compat/linux/linux_socket.c')
| -rw-r--r-- | sys/compat/linux/linux_socket.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index bb2090c77725..da7d82905d66 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -1354,7 +1354,9 @@ linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args) } */ bsd_args; l_timeval linux_tv; struct timeval tv; - socklen_t tv_len; + socklen_t tv_len, xulen; + struct xucred xu; + struct l_ucred lxu; int error, name; bsd_args.s = args->s; @@ -1377,6 +1379,23 @@ linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args) sizeof(linux_tv))); /* NOTREACHED */ break; + case LOCAL_PEERCRED: + if (args->optlen != sizeof(lxu)) + return (EINVAL); + xulen = sizeof(xu); + error = kern_getsockopt(td, args->s, bsd_args.level, + name, &xu, UIO_SYSSPACE, &xulen); + if (error) + return (error); + /* + * XXX Use 0 for pid as the FreeBSD does not cache peer pid. + */ + lxu.pid = 0; + lxu.uid = xu.cr_uid; + lxu.gid = xu.cr_gid; + return (copyout(&lxu, PTRIN(args->optval), sizeof(lxu))); + /* NOTREACHED */ + break; default: break; } |
