#define jobcontrol_in(x)
#define jobcontrol_out(x)
#define limit_exceeded(x,y) (0)
+#define can_signal(p, sig) \
+ (udata.u_ptab->p_uid == (p)->p_uid || super())
#endif
turns the whole thing into a constant 32bit comparison with a fixed
or global register memory address */
#define limit_exceeded(l, v) \
- (udata.u_rlimit[(l)] < (v))
+ (udata.u_rlimit[(l)] < (v))
+
+/* Job control requires SIGCONT is sendable to anyone in our process group.
+ Untidy but we are stuck with it
+
+ FIXME: check for any setuid funnies */
+#define can_signal(p, sig) \
+ ((sig == SIGCONT && udata.u_ptab->p_session == (p)->session) \
+ || udata.u_ptab->p_uid == (p)->p_uid || super())
extern arg_t _setgroups(void);
extern arg_t _getgroups(void);
/* No overlap here */
if (-p->p_pgrp == pid || p->p_pid == pid) {
f = 1; /* Found */
- if (udata.u_ptab->p_uid == p->p_uid || super()) {
+ if (can_signal(p, sig)) {
if (sig)
ssig(p, sig);
s = 1; /* Signalled */