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
This commit is contained in:
Bryan Drewery 2016-05-26 23:27:08 +00:00
parent 6a0899c5ed
commit 23ae5cd74e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=300809

View file

@ -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 = "<unknown>";
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 : "<unknown>");
filemon_output(filemon, filemon->msgbufr, len);
filemon_drop(filemon);
free(freepath, M_TEMP);
}
}