summaryrefslogtreecommitdiffstats
path: root/sys/security/audit/audit_syscalls.c
diff options
context:
space:
mode:
authorkevlo <kevlo@FreeBSD.org>2008-09-04 10:44:33 +0000
committerkevlo <kevlo@FreeBSD.org>2008-09-04 10:44:33 +0000
commit9f7bbf786b8774496a85d188582a51fe6846d9f0 (patch)
tree282f9a414aa0c1d72807ad19d4e453764596cb2c /sys/security/audit/audit_syscalls.c
parenta90af94f38b29c41a0dc8264d6fbe076359f19dd (diff)
downloadFreeBSD-src-9f7bbf786b8774496a85d188582a51fe6846d9f0.zip
FreeBSD-src-9f7bbf786b8774496a85d188582a51fe6846d9f0.tar.gz
If the process id specified is invalid, the system call returns ESRCH
Diffstat (limited to 'sys/security/audit/audit_syscalls.c')
-rw-r--r--sys/security/audit/audit_syscalls.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/security/audit/audit_syscalls.c b/sys/security/audit/audit_syscalls.c
index 3043539..ee8e801 100644
--- a/sys/security/audit/audit_syscalls.c
+++ b/sys/security/audit/audit_syscalls.c
@@ -314,12 +314,12 @@ auditon(struct thread *td, struct auditon_args *uap)
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);
}
if (tp->p_ucred->cr_audit.ai_termid.at_type == AU_IPv6) {
PROC_UNLOCK(tp);
@@ -342,16 +342,16 @@ auditon(struct thread *td, struct auditon_args *uap)
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);
@@ -378,9 +378,9 @@ auditon(struct thread *td, struct auditon_args *uap)
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);
udata.au_aupinfo_addr.ap_auid =
tp->p_ucred->cr_audit.ai_auid;
udata.au_aupinfo_addr.ap_mask.am_success =
OpenPOWER on IntegriCloud