This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / kernel / signal.c
index e4282d2..e3c7eb4 100644 (file)
@@ -273,6 +273,7 @@ static struct sigqueue *__sigqueue_alloc(void)
                INIT_LIST_HEAD(&q->list);
                q->flags = 0;
                q->lock = NULL;
+#warning MEF PLANETLAB: q->user = get_uid(current->user); is something new in Fedora Core.
                q->user = get_uid(current->user);
                atomic_inc(&q->user->sigpending);
        }
@@ -417,7 +418,6 @@ flush_signal_handlers(struct task_struct *t, int force_default)
        }
 }
 
-EXPORT_SYMBOL_GPL(flush_signal_handlers);
 
 /* Notify the system that a driver wants to block all signals for this
  * process, and wants to be notified if any signals at all were to be
@@ -603,28 +603,17 @@ static int check_kill_permission(int sig, struct siginfo *info,
                                 struct task_struct *t)
 {
        int error = -EINVAL;
-       int user;
-
        if (sig < 0 || sig > _NSIG)
                return error;
-
-       user = (!info ||
-               (info != SEND_SIG_PRIV &&
-                info != SEND_SIG_FORCED &&
-                SI_FROMUSER(info)));
-
        error = -EPERM;
-       if (user && (sig != SIGCONT ||
-                    current->signal->session != t->signal->session)
+       if ((!info || ((unsigned long)info != 1 &&
+                       (unsigned long)info != 2 && SI_FROMUSER(info)))
+           && ((sig != SIGCONT) ||
+               (current->signal->session != t->signal->session))
            && (current->euid ^ t->suid) && (current->euid ^ t->uid)
            && (current->uid ^ t->suid) && (current->uid ^ t->uid)
            && !capable(CAP_KILL))
                return error;
-
-       error = -ESRCH;
-       if (user && !vx_check(vx_task_xid(t), VX_ADMIN|VX_IDENT))
-               return error;
-
        return security_task_kill(t, info, sig);
 }
 
@@ -738,6 +727,7 @@ static int send_signal(int sig, struct siginfo *info, struct task_struct *t,
 
        if (q) {
                q->flags = 0;
+#warning MEF PLANETLAB: q->user = get_uid(t->user); is something new in Fedora Core.
                q->user = get_uid(t->user);
                atomic_inc(&q->user->sigpending);
                list_add_tail(&q->list, &signals->list);
@@ -1066,6 +1056,9 @@ int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p)
        unsigned long flags;
        int ret;
 
+       if (!vx_check(vx_task_xid(p), VX_ADMIN|VX_WATCH|VX_IDENT))
+               return -ESRCH;
+
        ret = check_kill_permission(sig, info, p);
        if (!ret && sig && p->sighand) {
                spin_lock_irqsave(&p->sighand->siglock, flags);