From bc473990f5676e7da50f9edf4fca85fca0948cbd Mon Sep 17 00:00:00 2001 From: sobomax Date: Sat, 29 Jan 2005 23:47:36 +0000 Subject: [PATCH] Fix small non-conformance introduced in the previous commit: execve() is expected to return ENAMETOOLONG, not E2BIG if first argument doesn't fit into {PATH_MAX} bytes. MFC after: 2 weeks --- sys/kern/kern_exec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 3998726c175c..58a9138d00f9 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -629,6 +629,8 @@ do_execve(td, args, mac_p) * to locking the proc lock. */ textvp = p->p_textvp; + if (textvp) + VN_KNOTE_LOCKED(textvp, NOTE_STOPEXEC | p->p_pid); p->p_textvp = ndp->ni_vp; /* @@ -636,6 +638,7 @@ do_execve(td, args, mac_p) * as we're now a bona fide freshly-execed process. */ KNOTE_LOCKED(&p->p_klist, NOTE_EXEC); + VN_KNOTE_LOCKED(p->p_textvp, NOTE_STARTEXEC | p->p_pid); p->p_flag &= ~P_INEXEC; /* @@ -948,11 +951,8 @@ exec_copyin_args(struct image_args *args, char *fname, error = (segflg == UIO_SYSSPACE) ? copystr(fname, args->fname, PATH_MAX, &length) : copyinstr(fname, args->fname, PATH_MAX, &length); - if (error != 0) { - if (error == ENAMETOOLONG) - return (E2BIG); + if (error != 0) return (error); - } /* * extract arguments first