Deleted Added
full compact
kern_sig.c (46155) kern_sig.c (46381)
1/*
2 * Copyright (c) 1982, 1986, 1989, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

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

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)kern_sig.c 8.7 (Berkeley) 4/18/94
1/*
2 * Copyright (c) 1982, 1986, 1989, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

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

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)kern_sig.c 8.7 (Berkeley) 4/18/94
39 * $Id: kern_sig.c,v 1.54 1999/01/26 02:38:10 julian Exp $
39 * $Id: kern_sig.c,v 1.55 1999/04/28 11:36:59 phk Exp $
40 */
41
42#include "opt_compat.h"
43#include "opt_ktrace.h"
44
45#define SIGPROP /* include signal properties table */
46#include <sys/param.h>
47#include <sys/kernel.h>

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

68#include <machine/smp.h>
69#endif
70
71static int killpg1 __P((struct proc *cp, int signum, int pgid, int all));
72static void setsigvec __P((struct proc *p, int signum, struct sigaction *sa));
73static void stop __P((struct proc *));
74
75static int kern_logsigexit = 1;
40 */
41
42#include "opt_compat.h"
43#include "opt_ktrace.h"
44
45#define SIGPROP /* include signal properties table */
46#include <sys/param.h>
47#include <sys/kernel.h>

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

68#include <machine/smp.h>
69#endif
70
71static int killpg1 __P((struct proc *cp, int signum, int pgid, int all));
72static void setsigvec __P((struct proc *p, int signum, struct sigaction *sa));
73static void stop __P((struct proc *));
74
75static int kern_logsigexit = 1;
76SYSCTL_INT(_kern, KERN_LOGSIGEXIT, logsigexit, CTLFLAG_RW, &kern_logsigexit, 0, "");
76SYSCTL_INT(_kern, KERN_LOGSIGEXIT, logsigexit, CTLFLAG_RW,
77 &kern_logsigexit, 0,
78 "Log processes quitting on abnormal signals to syslog(3)");
77
78/*
79 * Can process p, with pcred pc, send the signal signum to process q?
80 */
81#define CANSIGNAL(p, pc, q, signum) \
82 (PRISON_CHECK(p, q) && ((pc)->pc_ucred->cr_uid == 0 || \
83 (pc)->p_ruid == (q)->p_cred->p_ruid || \
84 (pc)->pc_ucred->cr_uid == (q)->p_cred->p_ruid || \

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

92#define CANSIGIO(ruid, uc, q) \
93 ((uc)->cr_uid == 0 || \
94 (ruid) == (q)->p_cred->p_ruid || \
95 (uc)->cr_uid == (q)->p_cred->p_ruid || \
96 (ruid) == (q)->p_ucred->cr_uid || \
97 (uc)->cr_uid == (q)->p_ucred->cr_uid)
98
99int sugid_coredump;
79
80/*
81 * Can process p, with pcred pc, send the signal signum to process q?
82 */
83#define CANSIGNAL(p, pc, q, signum) \
84 (PRISON_CHECK(p, q) && ((pc)->pc_ucred->cr_uid == 0 || \
85 (pc)->p_ruid == (q)->p_cred->p_ruid || \
86 (pc)->pc_ucred->cr_uid == (q)->p_cred->p_ruid || \

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

94#define CANSIGIO(ruid, uc, q) \
95 ((uc)->cr_uid == 0 || \
96 (ruid) == (q)->p_cred->p_ruid || \
97 (uc)->cr_uid == (q)->p_cred->p_ruid || \
98 (ruid) == (q)->p_ucred->cr_uid || \
99 (uc)->cr_uid == (q)->p_ucred->cr_uid)
100
101int sugid_coredump;
100SYSCTL_INT(_kern, OID_AUTO, sugid_coredump, CTLFLAG_RW, &sugid_coredump, 0, "");
102SYSCTL_INT(_kern, OID_AUTO, sugid_coredump, CTLFLAG_RW,
103 &sugid_coredump, 0, "Enable coredumping set user/group ID processes");
101
102#ifndef _SYS_SYSPROTO_H_
103struct sigaction_args {
104 int signum;
105 struct sigaction *nsa;
106 struct sigaction *osa;
107};
108#endif

--- 1272 unchanged lines hidden ---
104
105#ifndef _SYS_SYSPROTO_H_
106struct sigaction_args {
107 int signum;
108 struct sigaction *nsa;
109 struct sigaction *osa;
110};
111#endif

--- 1272 unchanged lines hidden ---