From 506c645640d02e23e49ae41be74c922d57fda564 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Thu, 26 May 2016 23:27:08 +0000 Subject: [PATCH] filemon exec: Use imgp->execpath rather than vn_fullpath(9). This will be more accurate as the actual name is provided if ran from an absolute path in do_execve(). MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division --- sys/dev/filemon/filemon_wrapper.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sys/dev/filemon/filemon_wrapper.c b/sys/dev/filemon/filemon_wrapper.c index 87c9392a9454..e03c2376e478 100644 --- a/sys/dev/filemon/filemon_wrapper.c +++ b/sys/dev/filemon/filemon_wrapper.c @@ -102,24 +102,17 @@ filemon_event_process_exec(void *arg __unused, struct proc *p, struct image_params *imgp) { struct filemon *filemon; - char *fullpath, *freepath; size_t len; if ((filemon = filemon_proc_get(p)) != NULL) { - fullpath = ""; - freepath = NULL; - - vn_fullpath(curthread, imgp->vp, &fullpath, &freepath); - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "E %d %s\n", - p->p_pid, fullpath); + p->p_pid, + imgp->execpath != NULL ? imgp->execpath : ""); filemon_output(filemon, filemon->msgbufr, len); filemon_drop(filemon); - - free(freepath, M_TEMP); } }