kernel - Fix kern.proc.pathname sysctl
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 5 Aug 2016 20:12:08 +0000 (13:12 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 5 Aug 2016 20:12:08 +0000 (13:12 -0700)
commit726f7ca07e193db73635e9c4e24e40c96087d6d9
tree8be24faf4b1602a55ce43fa6a5766fd5212e6c19
parent3a05fd2acf14ca94c4e30809432212d52e1241e4
kernel - Fix kern.proc.pathname sysctl

* kern.proc.pathname is a sysctl used by programs to find the path
  of the running program.  This sysctl was created before we stored
  sufficient information in the proc structure to construct the
  correct path when multiple aliases are present (due to e.g. null-mounts)
  to the same file.

* We do have this information, in p->p_textnch, so change the sysctl to
  use it.  The sysctl will now return the actual full path in the context
  of whomever ran the program, so it should properly take into account
  chroots and such.
sys/kern/kern_proc.c