Deleted Added
full compact
sys_process.c (42067) sys_process.c (43301)
1/*
2 * Copyright (c) 1994, Sean Eric Fagan
3 * 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

--- 14 unchanged lines hidden (view full) ---

23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
1/*
2 * Copyright (c) 1994, Sean Eric Fagan
3 * 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

--- 14 unchanged lines hidden (view full) ---

23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
31 * $Id: sys_process.c,v 1.40 1998/07/29 18:41:30 dfr Exp $
31 * $Id: sys_process.c,v 1.41 1998/12/26 17:14:37 dfr Exp $
32 */
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/sysproto.h>
37#include <sys/proc.h>
38#include <sys/vnode.h>
39#include <sys/ptrace.h>

--- 194 unchanged lines hidden (view full) ---

234
235 /* Already traced */
236 if (p->p_flag & P_TRACED)
237 return EBUSY;
238
239 /* not owned by you, has done setuid (unless you're root) */
240 if ((p->p_cred->p_ruid != curp->p_cred->p_ruid) ||
241 (p->p_flag & P_SUGID)) {
32 */
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/sysproto.h>
37#include <sys/proc.h>
38#include <sys/vnode.h>
39#include <sys/ptrace.h>

--- 194 unchanged lines hidden (view full) ---

234
235 /* Already traced */
236 if (p->p_flag & P_TRACED)
237 return EBUSY;
238
239 /* not owned by you, has done setuid (unless you're root) */
240 if ((p->p_cred->p_ruid != curp->p_cred->p_ruid) ||
241 (p->p_flag & P_SUGID)) {
242 if (error = suser(curp->p_ucred, &curp->p_acflag))
242 if ((error = suser(curp->p_ucred, &curp->p_acflag)) != 0)
243 return error;
244 }
245
246 /* can't trace init when securelevel > 0 */
247 if (securelevel > 0 && p->p_pid == 1)
248 return EPERM;
249
250 /* OK */

--- 284 unchanged lines hidden ---
243 return error;
244 }
245
246 /* can't trace init when securelevel > 0 */
247 if (securelevel > 0 && p->p_pid == 1)
248 return EPERM;
249
250 /* OK */

--- 284 unchanged lines hidden ---