View Single Post
  #4   (View Single Post)  
Old 2nd March 2019
brudan brudan is offline
Fdisk Soldier
 
Join Date: Dec 2018
Posts: 82
Default

If user wants to use TRUSTED_PKG_PATH (by defining it in either an interactive shell or in a shell configuration file such as ~/.bashrc), don't forget to export it so that pkg_add sees it. (For some reason, PKG_PATH does not need to be exported for pkg_add to see it, but TRUSTED_PKG_PATH does need to be exported.)

I think the main issue I was having with TRUSTED_PKG_PATH has to do with the fact that I use sudo(8). Defining and exporting plain PKG_PATH in ~/.bashrc automatically works with sudo because sudo keeps the value of PKG_PATH in its environment by default. Not so with TRUSTED_PKG_PATH, which needs to be manually appended to the env_keep section of /etc/sudoers so that it looks something like this:

Code:
Defaults env_keep +="FTPMODE PKG_CACHE PKG_PATH SM_PATH SSH_AUTH_SOCK TRUSTED_PKG_PATH"
Hope this helps someone. Once I figured out that, unlike PKG_PATH, TRUSTED_PKG_PATH needs to be exported and added to /etc/sudoers, all the "unexpected behavior" went away.

Last edited by brudan; 2nd March 2019 at 07:31 PM.
Reply With Quote