Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 646882 - app-portage/gemato-11.0: with gentoo prefix, Unable to refresh keys: gpg: no keyserver known (use option --keyserver)
Summary: app-portage/gemato-11.0: with gentoo prefix, Unable to refresh keys: gpg: no ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michał Górny
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-07 08:48 UTC by Martin Mokrejš
Modified: 2018-02-18 01:46 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
key refresh test case (key-refresh-test.sh,389 bytes, application/x-shellscript)
2018-02-08 10:04 UTC, Zac Medico
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mokrejš 2018-02-07 08:48:44 UTC
Hi Zac,
  with some recent changes to 'emerge --sync' I started to get:

x11-themes/Manifest.gz
x11-themes/gnome-backgrounds/Manifest
x11-themes/hicolor-icon-theme/Manifest
deleting x11-themes/zuki-themes/zuki-themes-3.24.2.ebuild
deleting x11-themes/zuki-themes/zuki-themes-3.20.ebuild
x11-themes/hicolor-icon-theme/hicolor-icon-theme-0.17.ebuild
x11-themes/zuki-themes/Manifest
x11-wm/Manifest.gz
x11-wm/icewm/Manifest
x11-wm/icewm/icewm-1.4.2.ebuild
x11-wm/spectrwm/Manifest
x11-wm/spectrwm/spectrwm-3.1.0.ebuild
x11-wm/windowmaker/Manifest
x11-wm/windowmaker/windowmaker-0.95.8-r1.ebuild

Number of files: 165,959 (reg: 138,405, dir: 27,554)
Number of created files: 800 (reg: 770, dir: 30)
Number of deleted files: 854 (reg: 841, dir: 13)
Number of regular files transferred: 4,894
Total file size: 224.21M bytes
Total transferred file size: 29.33M bytes
Literal data: 29.33M bytes
Matched data: 0 bytes
File list size: 3.81M
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 123.56K
Total bytes received: 33.64M

sent 123.56K bytes  received 33.64M bytes  1.32M bytes/sec
total size is 224.21M  speedup is 6.64
Traceback (most recent call last):
  File "/apps/gentoo/usr/lib/python-exec/python2.7/gemato", line 11, in <module>
    load_entry_point('gemato==10.3', 'console_scripts', 'gemato')()
  File "/apps/gentoo/usr/lib64/python2.7/site-packages/gemato/cli.py", line 403, in setuptools_main
    sys.exit(main(sys.argv))
  File "/apps/gentoo/usr/lib64/python2.7/site-packages/gemato/cli.py", line 398, in main
    return vals.func(vals, argp)
  File "/apps/gentoo/usr/lib64/python2.7/site-packages/gemato/cli.py", line 56, in do_verify
    with io.open(args.openpgp_key, 'rb') as f:
IOError: [Errno 2] No such file or directory: '/var/lib/gentoo/gkeys/keyrings/gentoo/release/pubring.gpg'
q: Updating ebuild cache in /apps/gentoo/usr/portage ... 
q: Finished 37333 entries in 1.084191 seconds

Performing Global Updates
(Could take a couple of minutes if you have a lot of binary packages.)
  .='update pass'  *='binary update'  #='/var/db update'  @='/var/db move'
  s='/var/db SLOT move'  %='binary move'  S='binary SLOT move'
  p='update /etc/portage/package.*'
/apps/gentoo/usr/portage/profiles/updates/2Q-2015........................................................................................................................................................................
/apps/gentoo/usr/portage/profiles/updates/3Q-2015......................
/apps/gentoo/usr/portage/profiles/updates/4Q-2015................................
/apps/gentoo/usr/portage/profiles/updates/1Q-2016............................................
/apps/gentoo/usr/portage/profiles/updates/2Q-2016.............................................................
/apps/gentoo/usr/portage/profiles/updates/3Q-2016.........................
/apps/gentoo/usr/portage/profiles/updates/4Q-2016..................................
/apps/gentoo/usr/portage/profiles/updates/1Q-2017.....................................
/apps/gentoo/usr/portage/profiles/updates/2Q-2017....
/apps/gentoo/usr/portage/profiles/updates/3Q-2017.........................
/apps/gentoo/usr/portage/profiles/updates/4Q-2017.......
/apps/gentoo/usr/portage/profiles/updates/1Q-2018.......


I have no idea which actual package is at cause but it should be easy to fix this. Therefore, sorry for the lousy subject line.


$ emerge --info
Portage 2.3.21 (python 2.7.14-final-0, default/linux/amd64/17.0/no-multilib/prefix/kernel-3.2+, gcc-6.3.0, glibc-2.25-r10, 2.6.32-696.10.3.el6.x86_64 x86_64)
=================================================================
System uname: Linux-2.6.32-696.10.3.el6.x86_64-x86_64-Intel-R-_Xeon-R-_CPU_E5-2695_v3_@_2.30GHz-with-centos-6.9-Final
KiB Mem:   132049160 total,  68841376 free
KiB Swap:    2097148 total,   2096296 free
Timestamp of repository gentoo: Wed, 07 Feb 2018 08:30:01 +0000
Head commit of repository gentoo: 1bc317cd39ecf7b89bb4cf9de05000e52f59110e
sh bash 4.4_p12-r1
ld GNU ld (Gentoo 2.29.1 p3) 2.29.1
app-shells/bash:          4.4_p12-r1::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.26.1-r1::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.4.6::gentoo, 3.5.4-r1::gentoo, 3.6.4::gentoo
dev-util/cmake:           3.10.2::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/sandbox:         2.12::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.14.1-r1::gentoo, 1.15.1-r1::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo, 2.30::gentoo
sys-devel/gcc:            3.4.6-r2::gentoo, 4.1.2::gentoo, 4.2.4-r1::gentoo, 4.4.7::gentoo, 4.5.4::gentoo, 4.7.4::gentoo, 4.8.5::gentoo, 4.9.3::gentoo, 4.9.4::gentoo, 5.4.0-r4::gentoo, 6.3.0::gentoo, 7.1.0-r1::gentoo, 7.2.0-r1::gentoo, 7.3.0::gentoo
sys-devel/gcc-config:     1.9.1::gentoo
sys-devel/libtool:        2.4.6-r4::gentoo
sys-devel/make:           4.2.1-r1::gentoo
sys-kernel/linux-headers: 4.15::gentoo (virtual/os-headers)
sys-libs/glibc:           2.25-r10::gentoo
Repositories:

gentoo
    location: /apps/gentoo/usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-openpgp-key-path: /var/lib/gentoo/gkeys/keyrings/gentoo/release/pubring.gpg
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: 

haskell
    location: /apps/gentoo/var/lib/layman/haskell
    masters: gentoo
    priority: 50

science
    location: /apps/gentoo/var/lib/layman/science
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1 sun-bcla-java-vm Oracle-BCLA-JavaSE IBM-J1.6 skype-eula Nero-EULA-US AdobeFlash-10.3 skype-4.0.0.7-copyright AdobeFlash-11.x Intel-SDP OPERA-2014"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -O2 -pipe -march=native -ftree-vectorize"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.3/conf"
CONFIG_PROTECT_MASK="/apps/gentoo/etc/gentoo-release /etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -O2 -pipe -march=native -ftree-vectorize"
DISTDIR="/apps/gentoo/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles force-prefix merge-sync multilib-strict news nostrip parallel-fetch preserve-libs protect-owned sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans unprivileged"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.fi.muni.cz/pub/linux/gentoo/ http://gentoo.mirror.web4u.cz/ rsync://gentoo.mirror.dkm.cz/gentoo/ ftp://gentoo.mirror.web4u.cz/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_US en_GB en cs"
MAKEOPTS="-j4"
PKGDIR="/apps/gentoo/usr/portage/packages"
PORTAGE_CONFIGROOT="/apps/gentoo/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/apps/gentoo/var/tmp"
USE="X alsa amd64 apache apache2 avx avx2 berkdb boost bzip2 cairo cgi cli coin cracklib crypt cryptlib cxx dbus device-mapper dhcp dri emboss encode fax fbcon ffmpeg fontconfig fortran gbm gd gdbm gimp glpk gnutls gtk hal hwdb iconv imaging innodb ithreads java javafx javascript jce jpeg jpg js jscript keymap ladspa lapack lcms libnotify lm_sensors mad mmx modules mpi mpich2 mysql ncurses nfs nls nptl nptlonly nscd objc openmp openssl pcre pdf perl php png policykit polkit postscript ppds pppd prefix python qt3support readline resolvconf seccomp server session slideshow sndfile sqlite sse sse2 sse3 sse4_1 sse4_2 ssl ssse3 suexec svg syslog tcl tcpd threads tiff tk truetype unicode usb v4l v4l2 vim-syntax vnc wavpack wifi x11 xcb xml xorg xrandr xv xvid xvmc zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Martin Mokrejš 2018-02-07 09:17:13 UTC
$ emerge -uNDpv system

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U  ] app-shells/bash-4.4_p18::gentoo [4.4_p12-r1::gentoo] USE="net nls (readline) -afs -bashlogger -examples -mem-scramble -plugins" 10 KiB
[ebuild     U  ] app-portage/gemato-11.0::gentoo [10.3::gentoo] USE="blake2 bzip2 gpg -lzma -sha3 {-test}" PYTHON_TARGETS="python2_7 python3_5 -pypy -python3_4 -python3_6" 63 KiB
[ebuild     U  ] sys-apps/portage-2.3.24::gentoo [2.3.21::gentoo] USE="(ipc) native-extensions rsync-verify -build -doc -epydoc -gentoo-dev% (-selinux) -xattr" PYTHON_TARGETS="python2_7 python3_5 -pypy -python3_4 -python3_6" 937 KiB

Total: 3 packages (3 upgrades), Size of downloads: 1010 KiB


I will give this a try.
Comment 2 Zac Medico gentoo-dev 2018-02-07 09:18:06 UTC

*** This bug has been marked as a duplicate of bug 646250 ***
Comment 3 Martin Mokrejš 2018-02-07 09:45:45 UTC
After the upgrades I get:

Number of files: 165,937 (reg: 138,384, dir: 27,553)
Number of created files: 0
Number of deleted files: 22 (reg: 21, dir: 1)
Number of regular files transferred: 32
Total file size: 224.16M bytes
Total transferred file size: 775.20K bytes
Literal data: 775.20K bytes
Matched data: 0 bytes
File list size: 3.49M
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 30.35K
Total bytes received: 4.86M

sent 30.35K bytes  received 4.86M bytes  315.71K bytes/sec
total size is 224.16M  speedup is 45.81
INFO:root:Refreshing keys from keyserver...
ERROR:root:OpenPGP keyring refresh failed:
Unable to refresh keys: gpg: no keyserver known (use option --keyserver)
gpg: keyserver refresh failed: Syntax error in URI

q: Updating ebuild cache in /apps/gentoo/usr/portage ... 
q: Finished 37326 entries in 0.932872 seconds
Comment 4 Zac Medico gentoo-dev 2018-02-08 09:09:07 UTC
(In reply to Martin Mokrejš from comment #3)
> INFO:root:Refreshing keys from keyserver...
> ERROR:root:OpenPGP keyring refresh failed:
> Unable to refresh keys: gpg: no keyserver known (use option --keyserver)
> gpg: keyserver refresh failed: Syntax error in URI

Maybe an old or broken gnupg. This is what we now require in the portage-2.3.24-r1 ebuild:

  >=app-crypt/gnupg-2.2.4-r2[ssl(-)]

The error message resembles this old forums thread:

https://forums.gentoo.org/viewtopic-t-334499-view-next.html
Comment 5 Martin Mokrejš 2018-02-08 09:38:43 UTC
$ emerge -pv gnupg portage

[ebuild     U  ] app-crypt/gnupg-2.2.4-r2::gentoo [2.2.4-r1::gentoo] USE="bzip2 nls readline ssl usb -doc -ldap (-selinux) -smartcard -tofu -tools -wks-server" 0 KiB
[ebuild     U  ] sys-apps/portage-2.3.24-r1::gentoo [2.3.24::gentoo] USE="(ipc) native-extensions rsync-verify -build -doc -epydoc -gentoo-dev (-selinux) -xattr" PYTHON_TARGETS="python2_7 python3_5 -pypy -python3_4 -python3_6" 0 KiB

Total: 2 packages (2 upgrades), Size of downloads: 0 KiB
Comment 6 Zac Medico gentoo-dev 2018-02-08 10:04:19 UTC
Created attachment 518548 [details]
key refresh test case

This script refreshes keys in the same way that gemato does. Hopefully it reproduces your key refresh problem, and you can then report it as a bug for the app-crypt/gnupg package.
Comment 7 Martin Mokrejš 2018-02-08 10:45:26 UTC
$ bash -x testcase.sh 
+ [[ hB != hxB ]]
+ XTRACE_STATE=-x
+ [[ hxB != hxB ]]
+ VERBOSE_STATE=+v
+ set +xv
+ unset XTRACE_STATE VERBOSE_STATE
++ portageq envvar EPREFIX
+ EPREFIX=/apps/gentoo
++ mktemp -d
+ tempdir=/tmp/tmp.2uoIcxmkvL
+ trap cleanup EXIT
+ export GNUPGHOME=/tmp/tmp.2uoIcxmkvL
+ GNUPGHOME=/tmp/tmp.2uoIcxmkvL
+ echo trust-model always
+ echo disable-scdaemon
+ gpg --import /dev/fd/63
++ cat /apps/gentoo/var/lib/gentoo/gkeys/keyrings/gentoo/release/pubring.gpg
gpg: keybox '/tmp/tmp.2uoIcxmkvL/pubring.kbx' created
gpg: key 825533CBF6CD6C97: 2 signatures not checked due to missing keys
gpg: key 825533CBF6CD6C97: public key "Gentoo-keys Team <gkeys@gentoo.org>" imported
gpg: key 9E6438C817072058: 77 signatures not checked due to missing keys
gpg: key 9E6438C817072058: public key "Gentoo Linux Release Engineering (Gentoo Linux Release Signing Key) <releng@gentoo.org>" imported
gpg: key DB6B8C1F96D8BF6D: 7 signatures not checked due to missing keys
gpg: key DB6B8C1F96D8BF6D: public key "Gentoo Portage Snapshot Signing Key (Automated Signing Key)" imported
gpg: key BB572E0E2D182910: 3 signatures not checked due to missing keys
gpg: key BB572E0E2D182910: 1 bad signature
gpg: key BB572E0E2D182910: public key "Gentoo Linux Release Engineering (Automated Weekly Release Key) <releng@gentoo.org>" imported
gpg: Total number processed: 4
gpg:               imported: 4
+ gpg --refresh-keys
gpg: refreshing 4 keys from hkps://hkps.pool.sks-keyservers.net
gpg: key BB572E0E2D182910: 8 signatures not checked due to missing keys
gpg: key BB572E0E2D182910: 1 bad signature
gpg: key BB572E0E2D182910: "Gentoo Linux Release Engineering (Automated Weekly Release Key) <releng@gentoo.org>" 6 new signatures
gpg: key DB6B8C1F96D8BF6D: 12 signatures not checked due to missing keys
gpg: key DB6B8C1F96D8BF6D: "Gentoo Portage Snapshot Signing Key (Automated Signing Key)" 7 new signatures
gpg: key 9E6438C817072058: 80 signatures not checked due to missing keys
gpg: key 9E6438C817072058: "Gentoo Linux Release Engineering (Gentoo Linux Release Signing Key) <releng@gentoo.org>" 3 new signatures
gpg: key 825533CBF6CD6C97: 2 signatures not checked due to missing keys
gpg: key 825533CBF6CD6C97: "Gentoo-keys Team <gkeys@gentoo.org>" 3 new signatures
gpg: key 825533CBF6CD6C97: "Gentoo-keys Team <gkeys@gentoo.org>" 1 new subkey
gpg: Total number processed: 4
gpg:            new subkeys: 1
gpg:         new signatures: 19
+ cleanup
+ gpgconf --kill gpg-agent
+ rm -rf /tmp/tmp.2uoIcxmkvL
$

So what does it mean?
Comment 8 Zac Medico gentoo-dev 2018-02-08 10:55:19 UTC
Apparently gpg works fine.

Please test this gemato command:

gemato verify --require-signed-manifest --openpgp-key \
/apps/gentoo/var/lib/gentoo/gkeys/keyrings/gentoo/release/pubring.gpg \
/apps/gentoo/usr/portage
Comment 9 Martin Mokrejš 2018-02-08 11:09:36 UTC
$ gemato verify --require-signed-manifest --openpgp-key \
> /apps/gentoo/var/lib/gentoo/gkeys/keyrings/gentoo/release/pubring.gpg \
> /apps/gentoo/usr/portage
INFO:root:Refreshing keys from keyserver...
ERROR:root:OpenPGP keyring refresh failed:
Unable to refresh keys: gpg: no keyserver known (use option --keyserver)
gpg: keyserver refresh failed: Syntax error in URI

$ emerge -pv gemato

[ebuild   R    ] app-portage/gemato-11.0::gentoo  USE="blake2 bzip2 gpg -lzma -sha3 {-test}" PYTHON_TARGETS="python2_7 python3_5 -pypy -python3_4 -python3_6" 0 KiB
Comment 10 Zac Medico gentoo-dev 2018-02-08 11:31:09 UTC
You can successfully refresh keys as shown in comment #7, but gemato fails as shown in comment #9. Strange.
Comment 11 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-02-08 13:17:55 UTC
Could you check if gemato calls the correct gpg executable? Maybe PATH is somewhat fishy.
Comment 12 Martin Mokrejš 2018-02-08 13:41:41 UTC
Right:

$ strace -v -f gemato verify --require-signed-manifest --openpgp-key /apps/gentoo/var/lib/gentoo/gkeys/keyrings/gentoo/release/pubring.gpg /apps/gentoo/usr/portage 2>&1 | less

...

[pid 28784] execve("gpg2", ["gpg2", "--batch", "--import"], ["TZ=UTC", "GNUPGHOME=/tmp/tmp7CCR6u"]) = -1 ENOENT (No such file or directory)
[pid 28784] execve("/bin/gpg2", ["gpg2", "--batch", "--import"], ["TZ=UTC", "GNUPGHOME=/tmp/tmp7CCR6u"]) = -1 ENOENT (No such file or directory)
[pid 28784] execve("/usr/bin/gpg2", ["gpg2", "--batch", "--import"], ["TZ=UTC", "GNUPGHOME=/tmp/tmp7CCR6u"] <unfinished ...>


$ whereis gpg2
gpg2: /usr/bin/gpg2 /apps/gentoo/usr/bin/gpg2 /usr/share/man/man1/gpg2.1.gz
$
$ hash |  grep whereis
   2	/apps/gentoo/usr/bin/whereis
$

$ equery files gnupg |  grep bin
/apps/gentoo/usr/bin
/apps/gentoo/usr/bin/dirmngr
/apps/gentoo/usr/bin/dirmngr-client
/apps/gentoo/usr/bin/gpg
/apps/gentoo/usr/bin/gpg-agent
/apps/gentoo/usr/bin/gpg-connect-agent
/apps/gentoo/usr/bin/gpg2
/apps/gentoo/usr/bin/gpgconf
/apps/gentoo/usr/bin/gpgparsemail
/apps/gentoo/usr/bin/gpgscm
/apps/gentoo/usr/bin/gpgsm
/apps/gentoo/usr/bin/gpgtar
/apps/gentoo/usr/bin/gpgv
/apps/gentoo/usr/bin/gpgv2
/apps/gentoo/usr/bin/kbxutil
/apps/gentoo/usr/bin/symcryptrun
/apps/gentoo/usr/bin/watchgnupg
/apps/gentoo/usr/sbin
/apps/gentoo/usr/sbin/addgnupghome
/apps/gentoo/usr/sbin/applygnupgdefaults
$

Do EPREFIX whereis does not prepend EROOT or EPREFIX in front of my PATH?

$ equery belongs /apps/gentoo/usr/bin/whereis
 * Searching for /apps/gentoo/usr/bin/whereis ... 
sys-apps/util-linux-2.31.1 (/apps/gentoo/usr/bin/whereis)
$
Comment 13 Martin Mokrejš 2018-02-08 13:42:13 UTC
$ emerge --info
Portage 2.3.24 (python 2.7.14-final-0, default/linux/amd64/17.0/no-multilib/prefix/kernel-3.2+, gcc-6.3.0, glibc-2.25-r10, 2.6.32-696.10.3.el6.x86_64 x86_64)
=================================================================
System uname: Linux-2.6.32-696.10.3.el6.x86_64-x86_64-Intel-R-_Xeon-R-_CPU_E5-2695_v3_@_2.30GHz-with-centos-6.9-Final
KiB Mem:   132049160 total,  78395480 free
KiB Swap:    2097148 total,   2096220 free
Timestamp of repository gentoo: Thu, 08 Feb 2018 09:30:01 +0000
Head commit of repository gentoo: 7c08ff455a820f8d5ed7c6482c191bde79ea3809
sh bash 4.4_p18
ld GNU ld (Gentoo 2.29.1 p3) 2.29.1
app-shells/bash:          4.4_p18::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.26.1-r1::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.4.6::gentoo, 3.5.4-r1::gentoo, 3.6.4::gentoo
dev-util/cmake:           3.10.2::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/sandbox:         2.12::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.14.1-r1::gentoo, 1.15.1-r1::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo, 2.30::gentoo
sys-devel/gcc:            3.4.6-r2::gentoo, 4.1.2::gentoo, 4.2.4-r1::gentoo, 4.4.7::gentoo, 4.5.4::gentoo, 4.7.4::gentoo, 4.8.5::gentoo, 4.9.3::gentoo, 4.9.4::gentoo, 5.4.0-r4::gentoo, 6.3.0::gentoo, 7.1.0-r1::gentoo, 7.2.0-r1::gentoo, 7.3.0::gentoo
sys-devel/gcc-config:     1.9.1::gentoo
sys-devel/libtool:        2.4.6-r4::gentoo
sys-devel/make:           4.2.1-r1::gentoo
sys-kernel/linux-headers: 4.15::gentoo (virtual/os-headers)
sys-libs/glibc:           2.25-r10::gentoo
Repositories:

gentoo
    location: /apps/gentoo/usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: 

haskell
    location: /apps/gentoo/var/lib/layman/haskell
    masters: gentoo
    priority: 50

science
    location: /apps/gentoo/var/lib/layman/science
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1 sun-bcla-java-vm Oracle-BCLA-JavaSE IBM-J1.6 skype-eula Nero-EULA-US AdobeFlash-10.3 skype-4.0.0.7-copyright AdobeFlash-11.x Intel-SDP OPERA-2014"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -O2 -pipe -march=native -ftree-vectorize"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.3/conf"
CONFIG_PROTECT_MASK="/apps/gentoo/etc/gentoo-release /etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -O2 -pipe -march=native -ftree-vectorize"
DISTDIR="/apps/gentoo/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles force-prefix merge-sync multilib-strict news nostrip parallel-fetch preserve-libs protect-owned sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans unprivileged"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.fi.muni.cz/pub/linux/gentoo/ http://gentoo.mirror.web4u.cz/ rsync://gentoo.mirror.dkm.cz/gentoo/ ftp://gentoo.mirror.web4u.cz/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_US en_GB en cs"
MAKEOPTS="-j4"
PKGDIR="/apps/gentoo/usr/portage/packages"
PORTAGE_CONFIGROOT="/apps/gentoo/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/apps/gentoo/var/tmp"
USE="X alsa amd64 apache apache2 avx avx2 berkdb boost bzip2 cairo cgi cli coin cracklib crypt cryptlib cxx dbus device-mapper dhcp dri emboss encode fax fbcon ffmpeg fontconfig fortran gbm gd gdbm gimp glpk gnutls gtk hal hwdb iconv imaging innodb ithreads java javafx javascript jce jpeg jpg js jscript keymap ladspa lapack lcms libnotify lm_sensors mad mmx modules mpi mpich2 mysql ncurses nfs nls nptl nptlonly nscd objc openmp openssl pcre pdf perl php png policykit polkit postscript ppds pppd prefix python qt3support readline resolvconf seccomp server session slideshow sndfile sqlite sse sse2 sse3 sse4_1 sse4_2 ssl ssse3 suexec svg syslog tcl tcpd threads tiff tk truetype unicode usb v4l v4l2 vim-syntax vnc wavpack wifi x11 xcb xml xorg xrandr xv xvid xvmc zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 14 Fabian Groffen gentoo-dev 2018-02-08 13:58:05 UTC
whereis seems to suggest /usr/bin comes earlier in your PATH.  Are you sure it is setup right?  Under Portage it should be OK though, as it gets reset IIRC.
Comment 15 Martin Mokrejš 2018-02-08 14:06:04 UTC
I assume when one starts from parent shell the EPREFIX should be prepended by Gentoo-RAP scripts.

centos$ echo $PATH
/opt/sgi/sbin:/opt/sgi/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/pbs/default/bin:/home/mmokrejs/bin
centos$

centos $ /apps/gentoo/startprefix
gentoo-rap $ echo $PATH
/apps/gentoo/usr/x86_64-pc-linux-gnu/gcc-bin/6.3.0:/apps/gentoo/usr/lib/llvm/5/bin:/apps/gentoo/usr/lib/llvm/4/bin:/apps/gentoo/usr/local/sbin:/apps/gentoo/usr/local/bin:/apps/gentoo/usr/sbin:/apps/gentoo/usr/bin:/apps/gentoo/sbin:/apps/gentoo/bin:/apps/gentoo/opt/bin:/usr/sbin:/sbin:/usr/bin:/bin:/opt/pbs/default/bin:/home/mmokrejs/bin
$
Comment 16 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-02-08 14:09:10 UTC
I guess I need to pass PATH through when running gpg via subprocess.Popen(). Will fix it today.
Comment 17 Martin Mokrejš 2018-02-08 14:25:20 UTC
I think 'wheres' ignores my $PATH, as you can see.
Comment 18 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-02-08 17:08:11 UTC
Could you test the following patch?

https://github.com/mgorny/gemato/commit/546e7a9695728fa205fbfe7c373762b25697b12a.patch

(or gemato-9999)
Comment 19 Martin Mokrejš 2018-02-08 17:38:29 UTC
Patch works, thank you.

I first ran the strace comamnd and grep and saw gpg2 from /apps/gentoo/usr/bin/ is used. Then, on the second try I did just:

$ gemato verify --require-signed-manifest --openpgp-key /apps/gentoo/var/lib/gentoo/gkeys/keyrings/gentoo/release/pubring.gpg /apps/gentoo/usr/portage 
INFO:root:Refreshing keys from keyserver...
INFO:root:Keys refreshed.
INFO:root:Manifest timestamp: 2018-02-08 09:08:22 UTC
INFO:root:Valid OpenPGP signature found:
INFO:root:- primary key: DCD05B71EAB94199527F44ACDB6B8C1F96D8BF6D
INFO:root:- subkey: E1D6ABB63BFCFB4BA02FDF1CEC590EEAC9189250
INFO:root:- timestamp: 2018-02-08 09:08:22 UTC
INFO:root:Verifying /apps/gentoo/usr/portage...
ERROR:root:Manifest mismatch for app-portage/gemato/Manifest
  __size__: expected: 1816, have: 2145
$

Yeah, and now you know I applied the manually. ;)

But shouldn't whereis be fixed too? Promoting /usr instead of $EPREFIX/usr/bin is bad IMHO. I know Gentoo-RAP uses a modified loader to inject the EPREFIX but if apps rely on whereis output to find a binary, they are out of luck.
Comment 20 Fabian Groffen gentoo-dev 2018-02-08 17:45:39 UTC
please file a separate bug for that
Comment 21 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-02-08 17:47:56 UTC
I'm sorry but I never used or felt the need to use whereis. If you want to figure out which executable will actually be run, you want 'type -P' shell built-in. That said, I don't think whereis lists results in any specific order.
Comment 22 Martin Mokrejš 2018-02-08 17:54:33 UTC
Opened bug #647026
Comment 23 Larry the Git Cow gentoo-dev 2018-02-09 11:26:19 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a8e750c14019c92612d16d57701d20d6cc78808a

commit a8e750c14019c92612d16d57701d20d6cc78808a
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2018-02-09 11:24:25 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2018-02-09 11:26:12 +0000

    app-portage/gemato: Bump to 11.1
    
    Bump to the 11.1 bugfix release that fixes wiping environment for
    isolated GnuPG mode, which in turn fixes Prefix support.
    
    Closes: https://bugs.gentoo.org/646882

 app-portage/gemato/Manifest           |  1 +
 app-portage/gemato/gemato-11.1.ebuild | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+)
Comment 24 Benda Xu gentoo-dev 2018-02-18 01:46:27 UTC
Thank you guys for the resolution of this bug!