diff options
author | Dmitry Chagin <dchagin@FreeBSD.org> | 2019-05-30 14:24:26 +0000 |
---|---|---|
committer | Dmitry Chagin <dchagin@FreeBSD.org> | 2019-05-30 14:24:26 +0000 |
commit | c5afec6e895a11c64f58eb99e493adb8ad5dc361 (patch) | |
tree | 76a184c2ed5a4763917ede32840013f6ea1c85ef /sys/kern/kern_prot.c | |
parent | 1410bfe1423048af030a0bde5e01c3e5555dbd1e (diff) |
Complete LOCAL_PEERCRED support. Cache pid of the remote process in the
struct xucred. Do not bump XUCRED_VERSION as struct layout is not changed.
PR: 215202
Reviewed by: tijl
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D20415
Notes
Notes:
svn path=/head/; revision=348419
Diffstat (limited to 'sys/kern/kern_prot.c')
-rw-r--r-- | sys/kern/kern_prot.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 2991086d7327..0f70880b2bfa 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1957,6 +1957,14 @@ cru2x(struct ucred *cr, struct xucred *xcr) ngroups * sizeof(*cr->cr_groups)); } +void inline +cru2xt(struct thread *td, struct xucred *xcr) +{ + + cru2x(td->td_ucred, xcr); + xcr->cr_pid = td->td_proc->p_pid; +} + /* * Set initial process credentials. * Callers are responsible for providing the reference for provided credentials. |