Module Name: src
Committed By: martin
Date: Tue Sep 22 18:39:01 UTC 2020
Modified Files:
src/sys/kern [netbsd-9]: uipc_socket.c uipc_socket2.c uipc_usrreq.c
Log Message:
Pull up following revision(s) (requested by christos in ticket #1091):
sys/kern/uipc_socket.c: revision 1.291
sys/kern/uipc_usrreq.c: revision 1.199
sys/kern/uipc_socket2.c: revision 1.138
add socket info for user and group for unix sockets in fstat.
To generate a diff of this commit:
cvs rdiff -u -r1.281.2.2 -r1.281.2.3 src/sys/kern/uipc_socket.c
cvs rdiff -u -r1.134 -r1.134.2.1 src/sys/kern/uipc_socket2.c
cvs rdiff -u -r1.194 -r1.194.2.1 src/sys/kern/uipc_usrreq.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/uipc_socket.c
diff -u src/sys/kern/uipc_socket.c:1.281.2.2 src/sys/kern/uipc_socket.c:1.281.2.3
--- src/sys/kern/uipc_socket.c:1.281.2.2 Tue Feb 25 19:10:51 2020
+++ src/sys/kern/uipc_socket.c Tue Sep 22 18:39:01 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: uipc_socket.c,v 1.281.2.2 2020/02/25 19:10:51 martin Exp $ */
+/* $NetBSD: uipc_socket.c,v 1.281.2.3 2020/09/22 18:39:01 martin Exp $ */
/*
* Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.281.2.2 2020/02/25 19:10:51 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.281.2.3 2020/09/22 18:39:01 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -526,6 +526,7 @@ socreate(int dom, struct socket **aso, i
#endif
uid = kauth_cred_geteuid(l->l_cred);
so->so_uidinfo = uid_find(uid);
+ so->so_egid = kauth_cred_getegid(l->l_cred);
so->so_cpid = l->l_proc->p_pid;
/*
Index: src/sys/kern/uipc_socket2.c
diff -u src/sys/kern/uipc_socket2.c:1.134 src/sys/kern/uipc_socket2.c:1.134.2.1
--- src/sys/kern/uipc_socket2.c:1.134 Thu Jul 11 17:30:44 2019
+++ src/sys/kern/uipc_socket2.c Tue Sep 22 18:39:01 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: uipc_socket2.c,v 1.134 2019/07/11 17:30:44 maxv Exp $ */
+/* $NetBSD: uipc_socket2.c,v 1.134.2.1 2020/09/22 18:39:01 martin Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket2.c,v 1.134 2019/07/11 17:30:44 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket2.c,v 1.134.2.1 2020/09/22 18:39:01 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_ddb.h"
@@ -317,6 +317,7 @@ sonewconn(struct socket *head, bool sore
so->so_send = head->so_send;
so->so_receive = head->so_receive;
so->so_uidinfo = head->so_uidinfo;
+ so->so_egid = head->so_egid;
so->so_cpid = head->so_cpid;
/*
Index: src/sys/kern/uipc_usrreq.c
diff -u src/sys/kern/uipc_usrreq.c:1.194 src/sys/kern/uipc_usrreq.c:1.194.2.1
--- src/sys/kern/uipc_usrreq.c:1.194 Mon Jul 29 09:42:17 2019
+++ src/sys/kern/uipc_usrreq.c Tue Sep 22 18:39:01 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: uipc_usrreq.c,v 1.194 2019/07/29 09:42:17 maxv Exp $ */
+/* $NetBSD: uipc_usrreq.c,v 1.194.2.1 2020/09/22 18:39:01 martin Exp $ */
/*-
* Copyright (c) 1998, 2000, 2004, 2008, 2009 The NetBSD Foundation, Inc.
@@ -96,7 +96,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.194 2019/07/29 09:42:17 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.194.2.1 2020/09/22 18:39:01 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -898,6 +898,8 @@ unp_stat(struct socket *so, struct stat
unp->unp_ino = unp_ino++;
ub->st_atimespec = ub->st_mtimespec = ub->st_ctimespec = unp->unp_ctime;
ub->st_ino = unp->unp_ino;
+ ub->st_uid = so->so_uidinfo->ui_uid;
+ ub->st_gid = so->so_egid;
return (0);
}