kern_ktrace.c (41628) | kern_ktrace.c (46155) |
---|---|
1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)kern_ktrace.c 8.2 (Berkeley) 9/23/93 | 1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)kern_ktrace.c 8.2 (Berkeley) 9/23/93 |
34 * $Id: kern_ktrace.c,v 1.24 1998/11/10 09:16:29 peter Exp $ | 34 * $Id: kern_ktrace.c,v 1.25 1998/12/10 01:47:41 rvb Exp $ |
35 */ 36 37#include "opt_ktrace.h" 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/sysproto.h> 42#include <sys/kernel.h> --- 467 unchanged lines hidden (view full) --- 510 */ 511static int 512ktrcanset(callp, targetp) 513 struct proc *callp, *targetp; 514{ 515 register struct pcred *caller = callp->p_cred; 516 register struct pcred *target = targetp->p_cred; 517 | 35 */ 36 37#include "opt_ktrace.h" 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/sysproto.h> 42#include <sys/kernel.h> --- 467 unchanged lines hidden (view full) --- 510 */ 511static int 512ktrcanset(callp, targetp) 513 struct proc *callp, *targetp; 514{ 515 register struct pcred *caller = callp->p_cred; 516 register struct pcred *target = targetp->p_cred; 517 |
518 if (!PRISON_CHECK(callp, targetp)) 519 return (0); |
|
518 if ((caller->pc_ucred->cr_uid == target->p_ruid && 519 target->p_ruid == target->p_svuid && 520 caller->p_rgid == target->p_rgid && /* XXX */ 521 target->p_rgid == target->p_svgid && 522 (targetp->p_traceflag & KTRFAC_ROOT) == 0) || 523 caller->pc_ucred->cr_uid == 0) 524 return (1); 525 526 return (0); 527} 528 529#endif /* KTRACE */ | 520 if ((caller->pc_ucred->cr_uid == target->p_ruid && 521 target->p_ruid == target->p_svuid && 522 caller->p_rgid == target->p_rgid && /* XXX */ 523 target->p_rgid == target->p_svgid && 524 (targetp->p_traceflag & KTRFAC_ROOT) == 0) || 525 caller->pc_ucred->cr_uid == 0) 526 return (1); 527 528 return (0); 529} 530 531#endif /* KTRACE */ |