summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorchris <chris@FreeBSD.org>2000-05-11 22:08:57 +0000
committerchris <chris@FreeBSD.org>2000-05-11 22:08:57 +0000
commit38514c79e1a22f59968d7eaa717adfae49929f84 (patch)
treef35e08d42dffb97b3884035dab51de286dfe6d8e /sys/kern
parente1336e50c1fefc28c276a6b63061bab3dfdbc36a (diff)
downloadFreeBSD-src-38514c79e1a22f59968d7eaa717adfae49929f84.zip
FreeBSD-src-38514c79e1a22f59968d7eaa717adfae49929f84.tar.gz
Include the UID and GID values filled in by socreate() into socket->so_cred
for stat() calls. Reviewed by: phk
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/sys_socket.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c
index f0f2717..2f9383b 100644
--- a/sys/kern/sys_socket.c
+++ b/sys/kern/sys_socket.c
@@ -45,6 +45,7 @@
#include <sys/stat.h>
#include <sys/uio.h>
#include <sys/filedesc.h>
+#include <sys/ucred.h>
#include <net/if.h>
#include <net/route.h>
@@ -164,6 +165,8 @@ soo_stat(fp, ub, p)
bzero((caddr_t)ub, sizeof (*ub));
ub->st_mode = S_IFSOCK;
+ ub->st_uid = so->so_cred->cr_uid;
+ ub->st_gid = so->so_cred->cr_gid;
return ((*so->so_proto->pr_usrreqs->pru_sense)(so, ub));
}
OpenPOWER on IntegriCloud