diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-11-11 10:04:27 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-11-11 10:16:10 +0100 |
commit | 594cfb7586089dfefab60574495baf6ed4048c1d (patch) | |
tree | 97773e8d8a2fa39b75e546aed1432868ce049518 /pflocal/sock.h | |
parent | 042feca78f2360e63929f3aa425f6468ed11c84a (diff) | |
download | hurd-594cfb7586089dfefab60574495baf6ed4048c1d.tar.gz hurd-594cfb7586089dfefab60574495baf6ed4048c1d.tar.bz2 hurd-594cfb7586089dfefab60574495baf6ed4048c1d.zip |
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.
Diffstat (limited to 'pflocal/sock.h')
-rw-r--r-- | pflocal/sock.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pflocal/sock.h b/pflocal/sock.h index c1e73f9b..64b030e5 100644 --- a/pflocal/sock.h +++ b/pflocal/sock.h @@ -85,6 +85,10 @@ struct sock /* A connection queue we're attempting to connect through; a socket may only be attempting one connection at a time. */ struct connq *connect_queue; + + /* Effective identity of the creator of the socket */ + uid_t uid; + gid_t gid; }; /* Socket flags */ |