From 594cfb7586089dfefab60574495baf6ed4048c1d Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Wed, 11 Nov 2020 10:04:27 +0100 Subject: pflocal: Record socket creator so io_stat can return it * pflocal/sock.h (struct sock): Add uid and gid fields. * pflocal/sock.c (sock_create): Set uid and gid to 0. * pflocal/mig-mutate.h (SOCKET_IMPORTS): Import ../libtrivfs/mig-decls.h. (PF_INTRAN, PF_INTRAN_PAYLOAD, PF_DESTRUCTOR): New macros. * pflocal/pf.c: Include hurd/trivfs.h. (S_socket_create): Update parameters. Set sock's uid and gid fields according to pf->user. * pflocal/io.c (S_io_stat): Set st_uid and st_gid according to pf. --- pflocal/io.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pflocal/io.c') diff --git a/pflocal/io.c b/pflocal/io.c index 23e71ea4..2a6b104c 100644 --- a/pflocal/io.c +++ b/pflocal/io.c @@ -327,6 +327,8 @@ S_io_stat (struct sock_user *user, struct stat *st) st->st_ino = sock->id; /* As we try to be clever with large transfers, ask for them. */ st->st_blksize = vm_page_size * 16; + st->st_uid = sock->uid; + st->st_gid = sock->gid; pthread_mutex_lock (&sock->lock); /* Make sure the pipes don't go away... */ -- cgit v1.2.3