DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 12th January 2019
brudan brudan is offline
Fdisk Soldier
 
Join Date: Dec 2018
Posts: 82
Default pkg_add ignores TRUSTED_PKG_PATH

I am on OpenBSD 6.4 and have a local mirror of official packages ("openbsd" directory), as well as a local repository of custom packages ("openbsd-bruno" directory).

Here everything works fine:
Code:
# export PKG_PATH=https://bruno:MyPassword@mydomain.net/openbsd-bruno/6.4/packages/amd64:https://bruno:MyPassword@mydomain.net/openbsd/6.4/packages/amd64
# pkg_add myscripts
But no luck with this:

Code:
# export TRUSTED_PKG_PATH=https://bruno:MyPassword@mydomain.net/openbsd-bruno/6.4/packages/amd64
# export PKG_PATH=https://bruno:MyPassword@mydomain.net/openbsd/6.4/packages/amd64
# pkg_add myscripts
quirks-3.16 signed on 2018-10-12T15:26:25Z
Can't find myscripts
I'd like to make TRUSTED_PKG_PATH work so that I don't have to sign my custom packages. I tried putting quotes and/or trailing forward slash around the url and no luck.

Am I doing something wrong, or did I find a bug (pkg_add ignores TRUSTED_PKG_PATH)?
Reply With Quote
  #2   (View Single Post)  
Old 12th January 2019
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

According to the pkg_add(1) man page, TRUSTED_PKG_PATH is searched prior to PKG_PATH. If you are certain that TRUST_PKG_PATH is only working for you when PKG_PATH is undefined, then you have uncovered a reportable bug.

www.openbsd.org/report.html
Reply With Quote
  #3   (View Single Post)  
Old 16th January 2019
brudan brudan is offline
Fdisk Soldier
 
Join Date: Dec 2018
Posts: 82
Default

Yes, I've done further testing and am convinced the behavior is unexpected. I will report it as a bug. Thanks for the link, jggimi.
Reply With Quote
  #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
Reply

Tags
openbsd, trusted_pkg_path

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
pkg_add php-fpm psypro OpenBSD Packages and Ports 7 28th March 2016 12:22 PM
pkg_add claxsis NetBSD Package System (pkgsrc) 14 24th March 2016 11:07 PM
pkg_add is NOT clever sw2wolf FreeBSD Ports and Packages 7 24th August 2012 09:17 AM
pkg_add times out (?) Daffy OpenBSD Packages and Ports 0 27th July 2012 09:41 PM
pkg_add error buba OpenBSD Packages and Ports 4 13th June 2008 03:29 PM


All times are GMT. The time now is 05:51 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick