From 07ddfaead37bb07fd373577c11395af944d2e349 Mon Sep 17 00:00:00 2001 From: yamt Date: Sun, 28 May 2006 07:08:41 +0000 Subject: [PATCH] systrace_seteuid, systrace_setegid: fix bugs in kauth change. don't forget to update p_cred. --- sys/kern/kern_systrace.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_systrace.c b/sys/kern/kern_systrace.c index 5c936e218c64..842f2fa3874c 100644 --- a/sys/kern/kern_systrace.c +++ b/sys/kern/kern_systrace.c @@ -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 @@ -31,7 +31,7 @@ */ #include -__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);