If a process exists but has a different uid than the killer it should return
[unix-history] / 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);