Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pgpewrap hard-coded paths break things #1271

Closed
mjsir911 opened this issue Jun 22, 2018 · 7 comments
Closed

pgpewrap hard-coded paths break things #1271

mjsir911 opened this issue Jun 22, 2018 · 7 comments
Assignees
Labels

Comments

@mjsir911
Copy link
Contributor

mjsir911 commented Jun 22, 2018

Expected Behaviour

Following the useGPG tutorial, get a working gpg setup going

Actual Behaviour

Doesn't work because when copying and decompressing my system's gpgrc (located at /usr/share/doc/neomutt-20180512/samples/gpg.rc.bz2 on gentoo), points at file /usr/lib/neomutt/pgpewrap when it is actually located at /usr/libexec/neomutt/pgpewrap

I suspect there is a similar issue with the other files in /usr/libexec/neomutt, but I haven't confirmed

$ ls /usr/libexec/neomutt/
pgpewrap  pgpring  smime_keys

Steps to Reproduce

  1. Follow the instructions on useGPG on a system configured to point at any directory other than the default /usr/lib/neomutt/pgpewrap

  2. Write an email either encrypting or encrypting and signing

How often does this happen?

  • Always

NeoMutt Version

NeoMutt 20180512
Copyright (C) 1996-2016 Michael R. Elkins and others.
NeoMutt comes with ABSOLUTELY NO WARRANTY; for details type 'neomutt -vv'.
NeoMutt is free software, and you are welcome to redistribute it
under certain conditions; type 'neomutt -vv' for details.

System: Linux 4.9.95-gentoo (x86_64)
ncurses: ncurses 6.1.20180127 (compiled with 6.1.20180127)
hcache backends: gdbm, bdb

Compiler:
x86_64-pc-linux-gnu-gcc (Gentoo 6.4.0-r1 p1.3) 6.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Configure options: --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --docdir=/usr/share/doc/neomutt-20180512 --libdir=/usr/lib64 --enable-doc --enable-nls --enable-notmuch --enable-gpgme --enable-pgp --enable-smime --enable-bdb --enable-gdbm --disable-kyotocabinet --disable-qdbm --disable-tokyocabinet --disable-idn --disable-gss --disable-lmdb --enable-sasl --with-ui=ncurses --sysconfdir=/etc/neomutt --enable-ssl --disable-gnutls

Compilation CFLAGS: -mtune=k8 -O2 -pipe -march=native -std=c99 -fno-delete-null-pointer-checks -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__ -I/usr/include  -DNCURSES_WIDECHAR -I/include -I/usr/include/

Default options:
  +attach_headers_color +compose_to_sender +compress +cond_date +debug 
  +encrypt_to_self +forgotten_attachments +forwref +ifdef +imap +index_color 
  +initials +limit_current_thread +multiple_fcc +nested_if +new_mail +nntp +pop 
  +progress +quasi_delete +regcomp +reply_with_xorig +sensible_browser +sidebar 
  +skip_quoted +smtp +status_color +timeout +tls_sni +trash 

Compile options:
  +bkgdset +color +curs_set +fcntl -flock -fmemopen +futimens +getaddrinfo 
  -gnutls +gpgme -gss +hcache -homespool -idn -locales_hack -lua +meta 
  -mixmaster +nls +notmuch +openssl +pgp +sasl +smime +start_color 
  +sun_attachment +typeahead 
MAILPATH="/var/mail"
PKGDATADIR="/usr/share/neomutt"
SENDMAIL="/usr/sbin/sendmail"
SYSCONFDIR="/etc/neomutt"

To learn more about NeoMutt, visit: https://neomutt.org
If you find a bug in NeoMutt, please raise an issue at:
    https://github.com/neomutt/neomutt/issues
or send an email to: <neomutt-devel@neomutt.org>

Extra Info

Temporary fix

This is an easy fix locally on my machine, just replace the broken paths with the fixed ones.

  • Operating System and its version
$ cat /proc/version
Linux version 4.9.95-gentoo (root@Ridl3y) (gcc version 6.4.0 (Gentoo 6.4.0-r1 p1.3) ) #2 SMP Sun May 27 22:02:48 EDT 2018
@flatcap flatcap self-assigned this Jun 22, 2018
flatcap added a commit that referenced this issue Jun 22, 2018
@flatcap
Copy link
Member

flatcap commented Jun 22, 2018

Thanks. I've corrected a handful of paths in:

  • contrib/gpg.rc
  • contrib/sample.neomuttrc
  • contrib/smime.rc

The commit's in my 'devel/trivial' branch: e05e13a
I'll leave this issue open, for now, in case we find any more.

@mjsir911
Copy link
Contributor Author

Is libexec the new standard everywhere? This issue still persists if I set the prefix on configure to anything other than the default.

Is it possible to run the file through configure to procedurally give it the correct directory?

$ mkdir tmp
$ ./configure --prefix=$PWD/tmp
...
$ make
...
$ make install
...
$ ls tmp/libexec/neomutt/
pgpewrap  smime_keys
$ grep pgpewrap tmp/share/doc/neomutt/samples/gpg.rc 
# set pgp_encrypt_only_command="/usr/libexec/neomutt/pgpewrap gpg-2comp -v --batch --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f"
set pgp_encrypt_only_command="/usr/libexec/neomutt/pgpewrap gpg --batch --quiet --no-verbose --output - --textmode --armor --encrypt -- --recipient %r -- %f"
# set pgp_encrypt_sign_command="/usr/libexec/neomutt/pgpewrap gpg-2comp %?p?--passphrase-fd 0? -v --batch --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f"
set pgp_encrypt_sign_command="/usr/libexec/neomutt/pgpewrap gpg %?p?--pinentry-mode loopback --passphrase-fd 0? --batch --quiet --no-verbose --textmode --output - %?a?--local-user %a? --armor --sign --encrypt -- --recipient %r -- %f"

Incorrect directories here ^

@Hasimir
Copy link

Hasimir commented Jun 23, 2018

You know, there is a guaranteed fix which is also the reason I've never seen this in spite of Neomutt being installed in /opt/local. All it takes is ignoring the immediate upstream and listening to their upstream with regards to the correct means of integrating GnuPG with Mutt and/or Neomutt.

It really does “just work” and it's not that hard to install.

Oh come on, @flatcap, you already knew I'd notice sooner or later. 😉

flatcap added a commit that referenced this issue Jul 6, 2018
@flatcap flatcap closed this as completed in b945055 Jul 7, 2018
@protist
Copy link

protist commented Jul 20, 2018

I just updated, and I think this commit has broken some things for me. I tried to send an encrypted mail and got the following error.

sh: /usr/libexec/neomutt/pgpewrap: No such file or directory

I reverted /usr/share/doc/neomutt/samples/gpg.rc, changing the paths in pgp_encrypt_only_command and pgp_encrypt_sign_command, from /usr/libexec/neomutt/pgpewrap back to /usr/lib/neomutt/pgpewrap. This fixed it for me.

I'm using neomutt-git on Arch, but AFAICT the package doesn't change much.

@mjsir911
Copy link
Contributor Author

line 31 is the problem, it's changing the libexec dir to something that hasn't been hardcoded in.

@protist
Copy link

protist commented Jul 20, 2018

Thanks @mjsir911, removing that line fixes it for me.

@Hasimir
Copy link

Hasimir commented Jul 21, 2018

This explains why we don't see the same sort of thing in the MacPorts version since it handles configuration slightly differently in the port file. It's mainly aimed at just rewriting the $PREFIX and/or $EPREFIX while honouring the existing directory structure of packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants