diff options
| author | 2014-03-24 00:19:48 +0000 | |
|---|---|---|
| committer | 2014-03-24 00:19:48 +0000 | |
| commit | 86fea0ff7a710ad2158aa65bb194c96a275dbea6 (patch) | |
| tree | b485ee6882dd092de3c51b31cf566a82ee844f20 /sys/kern/kern_prot.c | |
| parent | oops, merge error (diff) | |
| download | wireguard-openbsd-86fea0ff7a710ad2158aa65bb194c96a275dbea6.tar.xz wireguard-openbsd-86fea0ff7a710ad2158aa65bb194c96a275dbea6.zip | |
Split the API: struct ucred remains the kernel internal structure while
struct xucred becomes the structure for syscalls (mount(2) and nfssvc(2)).
ok deraadt@ beck@
Diffstat (limited to 'sys/kern/kern_prot.c')
| -rw-r--r-- | sys/kern/kern_prot.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 6a42a3a61b5..4e7c7171315 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_prot.c,v 1.56 2013/04/06 03:44:34 tedu Exp $ */ +/* $OpenBSD: kern_prot.c,v 1.57 2014/03/24 00:19:48 guenther Exp $ */ /* $NetBSD: kern_prot.c,v 1.33 1996/02/09 18:59:42 christos Exp $ */ /* @@ -837,6 +837,20 @@ crdup(struct ucred *cr) } /* + * Convert the userspace xucred to a kernel ucred + */ +void +crfromxucred(struct ucred *cr, const struct xucred *xcr) +{ + cr->cr_ref = 1; + cr->cr_uid = xcr->cr_uid; + cr->cr_gid = xcr->cr_gid; + cr->cr_ngroups = xcr->cr_ngroups; + memcpy(cr->cr_groups, xcr->cr_groups, + sizeof(cr->cr_groups[0]) * xcr->cr_ngroups); +} + +/* * Get login name, if available. */ /* ARGSUSED */ |
