Author: rwatson
Date: Mon Mar 16 17:03:33 2009
New Revision: 189887
URL: http://svn.freebsd.org/changeset/base/189887

Log:
  Merge r182750, r182754 from head to stable/7:
  
    If the process id specified is invalid, the system call returns ESRCH
  
    Unbreak the build.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/kern/kern_proc.c
  stable/7/sys/security/audit/audit_syscalls.c

Modified: stable/7/sys/kern/kern_proc.c
==============================================================================
--- stable/7/sys/kern/kern_proc.c       Mon Mar 16 16:57:04 2009        
(r189886)
+++ stable/7/sys/kern/kern_proc.c       Mon Mar 16 17:03:33 2009        
(r189887)
@@ -994,10 +994,10 @@ sysctl_out_proc(struct proc *p, struct s
                np = pfind(pid);
        }
        if (np == NULL)
-               return EAGAIN;
+               return (ESRCH);
        if (np != p) {
                PROC_UNLOCK(np);
-               return EAGAIN;
+               return (ESRCH);
        }
        PROC_UNLOCK(np);
        return (0);

Modified: stable/7/sys/security/audit/audit_syscalls.c
==============================================================================
--- stable/7/sys/security/audit/audit_syscalls.c        Mon Mar 16 16:57:04 
2009        (r189886)
+++ stable/7/sys/security/audit/audit_syscalls.c        Mon Mar 16 17:03:33 
2009        (r189887)
@@ -314,12 +314,12 @@ auditon(struct thread *td, struct audito
 
        case A_GETPINFO:
                if (udata.au_aupinfo.ap_pid < 1)
-                       return (EINVAL);
+                       return (ESRCH);
                if ((tp = pfind(udata.au_aupinfo.ap_pid)) == NULL)
-                       return (EINVAL);
-               if (p_cansee(td, tp) != 0) {
+                       return (ESRCH);
+               if ((error = p_cansee(td, tp)) != 0) {
                        PROC_UNLOCK(tp);
-                       return (EINVAL);
+                       return (error);
                }
                cred = tp->p_ucred;
                if (cred->cr_audit.ai_termid.at_type == AU_IPv6) {
@@ -341,16 +341,16 @@ auditon(struct thread *td, struct audito
 
        case A_SETPMASK:
                if (udata.au_aupinfo.ap_pid < 1)
-                       return (EINVAL);
+                       return (ESRCH);
                newcred = crget();
                if ((tp = pfind(udata.au_aupinfo.ap_pid)) == NULL) {
                        crfree(newcred);
-                       return (EINVAL);
+                       return (ESRCH);
                }
-               if (p_cansee(td, tp) != 0) {
+               if ((error = p_cansee(td, tp)) != 0) {
                        PROC_UNLOCK(tp);
                        crfree(newcred);
-                       return (EINVAL);
+                       return (error);
                }
                oldcred = tp->p_ucred;
                crcopy(newcred, oldcred);
@@ -377,9 +377,9 @@ auditon(struct thread *td, struct audito
 
        case A_GETPINFO_ADDR:
                if (udata.au_aupinfo_addr.ap_pid < 1)
-                       return (EINVAL);
+                       return (ESRCH);
                if ((tp = pfind(udata.au_aupinfo_addr.ap_pid)) == NULL)
-                       return (EINVAL);
+                       return (ESRCH);
                cred = tp->p_ucred;
                udata.au_aupinfo_addr.ap_auid = cred->cr_audit.ai_auid;
                udata.au_aupinfo_addr.ap_mask.am_success =
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to