I can get the security path "easily" enough, but for bundles, that gives me the top director, whereas I am trying to get the name of the executable. (I would have used kern.proc.pathname.$pid
on FreeBSD, but that's not there for macOS, and kern.procname
only gives the current process' name. I also found eskimo's post about getting process arguments, and I could use that to get all the arguments and only care about argv[0]
, but since the kernel does have p->p_name
it'd be nice if there were a nicer way to get just that...)
This is in the context of a network extension. Endpoint Security is much nicer in that regard. 😄