systrace_seteuid, systrace_setegid:

fix bugs in kauth change.  don't forget to update p_cred.
This commit is contained in:
yamt 2006-05-28 07:08:41 +00:00
parent 04c3beb7b1
commit 07ddfaead3

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_systrace.c,v 1.53 2006/05/14 21:15:11 elad Exp $ */
/* $NetBSD: kern_systrace.c,v 1.54 2006/05/28 07:08:41 yamt Exp $ */
/*
* Copyright 2002, 2003 Niels Provos <provos@citi.umich.edu>
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_systrace.c,v 1.53 2006/05/14 21:15:11 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_systrace.c,v 1.54 2006/05/28 07:08:41 yamt Exp $");
#include "opt_systrace.h"
@ -931,7 +931,7 @@ systrace_seteuid(struct proc *p, uid_t euid)
/*
* Copy credentials so other references do not see our changes.
*/
pc = kauth_cred_copy(pc);
pc = p->p_cred = kauth_cred_copy(pc);
kauth_cred_seteuid(pc, euid);
p_sugid(p);
@ -952,7 +952,7 @@ systrace_setegid(struct proc *p, gid_t egid)
/*
* Copy credentials so other references do not see our changes.
*/
pc = kauth_cred_copy(pc);
pc = p->p_cred = kauth_cred_copy(pc);
kauth_cred_setegid(pc, egid);
p_sugid(p);