If a process exists but has a different uid than the killer it should return
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Fri, 9 Sep 1983 01:48:45 +0000 (17:48 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Fri, 9 Sep 1983 01:48:45 +0000 (17:48 -0800)
EPERM rather than ESRCH. (Bill Shanon)

SCCS-vsn: sys/kern/kern_sig.c 6.2

usr/src/sys/kern/kern_sig.c

index 99800df..07a8467 100644 (file)
@@ -1,4 +1,4 @@
-/*     kern_sig.c      6.1     83/08/20        */
+/*     kern_sig.c      6.2     83/09/08        */
 
 #include "../machine/reg.h"
 #include "../machine/pte.h"
 
 #include "../machine/reg.h"
 #include "../machine/pte.h"
@@ -205,8 +205,10 @@ kill1(ispgrp, signo, who)
                return (EINVAL);
        if (who > 0 && !ispgrp) {
                p = pfind(who);
                return (EINVAL);
        if (who > 0 && !ispgrp) {
                p = pfind(who);
-               if (p == 0 || u.u_uid && u.u_uid != p->p_uid)
+               if (p == 0)
                        return (ESRCH);
                        return (ESRCH);
+               if (u.u_uid && u.u_uid != p->p_uid)
+                       return (EPERM);
                if (signo)
                        psignal(p, signo);
                return (0);
                if (signo)
                        psignal(p, signo);
                return (0);