FS#58368 - [pinentry] when pinentry-gnome3 is present, pinentry doesn't work without a terminal

Attached to Project: Arch Linux
Opened by Ladislav Laska (Krakonos) - Friday, 27 April 2018, 14:17 GMT
Last edited by Gaetan Bisson (vesath) - Tuesday, 08 May 2018, 20:44 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Gaetan Bisson (vesath)
Jan Alexander Steffens (heftig)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 5
Private No

Details

Description:
/usr/bin/pinentry wrapper fails on systems with only basic gnome3 libs (or gnome3 not running, I'm not sure what is the case)


Additional info:
* package version(s): 1.1.0-2
* config and/or log files etc.


Steps to reproduce:
Having only gcr installed ( /usr/lib/libgcr-base-3.so.1 is owned by gcr 3.28.0-1 ), running pinentry results in:

```
krakonos@gazelle ~ $ pinentry
No Gcr System Prompter available, falling back to curses
OK Pleased to meet you
```

This is also reported when pinentry-gnome3 is executed directly. Commenting out the gnome3 line in /usr/bin/pinentry runs the qt5 client, which works fine.

This problem caused my Thunderbird with enigmail to fail with "Encryption command failed" and "gpg: signing failed: Inappropriate ioctl for device" in logs.
This task depends upon

Closed by  Gaetan Bisson (vesath)
Tuesday, 08 May 2018, 20:44 GMT
Reason for closing:  Fixed
Additional comments about closing:  pinentry-1.1.0-3 in [testing]
Comment by Jan Alexander Steffens (heftig) - Friday, 27 April 2018, 19:02 GMT
Does systemctl --user show-environment contain the DISPLAY variable?
Comment by S.B. (sbw87) - Saturday, 28 April 2018, 01:03 GMT
Hi, I'm experiencing the same problem with an i3 setup, and no, there is no DISPLAY variable set.
Comment by Jan Alexander Steffens (heftig) - Saturday, 28 April 2018, 09:16 GMT
Try running "dbus-update-activation-environment DISPLAY XAUTHORITY" after you have an X display but before i3 or whatever starts.
Comment by Jan Alexander Steffens (heftig) - Saturday, 28 April 2018, 10:32 GMT
Actually, there is a script in /etc/X11/xinit/xinitrc.d that already does this. Please make sure you source the scripts in this directory when you write your own xinitrc script.
Comment by Ladislav Laska (Krakonos) - Monday, 30 April 2018, 11:39 GMT
Hi! Running the dbus-update-activation-environment works. However, I'm not really sure it's right to force the gnome3 ui in case it's not set up. (And yes, I do have my own .xsession which does not source the /etc/X11/xinit/xinitrc.d/ files)
Comment by Kamus Hadenes (kamushadenes) - Wednesday, 02 May 2018, 13:09 GMT
Can confirm dbus-update-activation-environment works for me, running i3.

Took me a long time to pinpoint where the problem was. The error was occurring also from a TTY with no X running, so quit hard to assume it was Gnome3 related.
Comment by Jorge Luis Martinez Gomez (jol) - Monday, 07 May 2018, 23:13 GMT
I'm also having trouble with this. I can't input my password to decrypt pass generated passwords through a ssh login because it opens the prompt in a window in X11 on the remote computer. The problem seems to lie with a script that was introduced April 19th in the package: https://git.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/pinentry&id=6e03488e1a857d9e000c28224cea5b516e664068. It decides to call pinentry-gnome3 over pinentry-curses solely on the existance of /usr/lib/libgcr-base-3.so.1.
Comment by Jorge Luis Martinez Gomez (jol) - Monday, 07 May 2018, 23:15 GMT
I can confirm that reverting that commit fixes the issue.
Comment by Jorge Luis Martinez Gomez (jol) - Monday, 07 May 2018, 23:55 GMT
Looking more into this, before that commit changed /usr/bin/pinentry to a script, it was a symlink to /usr/bin/pinentry-gtk-2, which seems to exhibit the behaviour of pinentry-curses if the DISPLAY environment variable is not set to a valid display. Curiously enough, using strace reveals that pinentry-gtk-2 doesn't call pinentry-curses for this. I guess it just shares code. Now, that's some code smell, but the resulting behaviour is great. On the other hand, pinentry-gnome3 is awful in that it completely disregards DISPLAY. Call it through ssh and it will open a prompt in :0. Open a new display with a new xorg server process, call it in :0, and it will open a prompt in :1. Doesn't matter what DISPLAY is set to or even if it is set.

Loading...