Date: Tue, 8 Jan 2019 17:21:59 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342864 - head/sys/compat/linux Message-ID: <201901081721.x08HLxMA009314@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Tue Jan 8 17:21:59 2019 New Revision: 342864 URL: https://svnweb.freebsd.org/changeset/base/342864 Log: Specify the correct option level when emulating SO_PEERCRED. Our equivalent to SO_PEERCRED, LOCAL_PEERCRED, is implemented at socket option level 0, not SOL_SOCKET. PR: 234722 Submitted by: Dániel Bakai <bakaidl@gmail.com> MFC after: 2 weeks Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Tue Jan 8 17:08:10 2019 (r342863) +++ head/sys/compat/linux/linux_socket.c Tue Jan 8 17:21:59 2019 (r342864) @@ -1633,6 +1633,11 @@ linux_getsockopt(struct thread *td, struct linux_getso case LOCAL_PEERCRED: if (args->optlen < sizeof(lxu)) return (EINVAL); + /* + * LOCAL_PEERCRED is not served at the SOL_SOCKET level, + * but by the Unix socket's level 0. + */ + bsd_args.level = 0; xulen = sizeof(xu); error = kern_getsockopt(td, args->s, bsd_args.level, name, &xu, UIO_SYSSPACE, &xulen);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201901081721.x08HLxMA009314>