Description of problem:
pinentry-ncurses fails if current tty is owned by different user
as the one running pinentry. This happens for example when users does "su -"
after logging in as normal user. The /dev/pts/XX file is not chown-ed to root
and therefore pinentry-ncurses fails
Version-Release number of selected component (if applicable):
Steps to Reproduce:
# ssh to a box as a normal user
# unset DISPLAY
# su -
# dd if=/dev/urandom of=testpartition bs=1M count=10
# losetup /dev/loop0 testpartition
# cryptsetup luksFormat /dev/loop0
# volume_key --save /dev/loop0 -o packet
volume_key: Error creating `packet': GPGME: Bad passphrase
No error and pinentry asks for password
Patch sent upstream by sochotni
More simple reproducer is this:
1. login as normal user
2. unset DISPLAY # to use curses
3. su -
4. gpg2 --symmetric .bashrc
Created attachment 478883 [details]
Patch fixing the bug
This is patch that was sent upstream. Will be back after I hear back from them
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
Additional information from upstream: capabilities are not supported for a long time, they were surprised it worked and that it was enabled by default in their configuration. They will be turning it off for next release. Testing on Fedoras suggests no problems when package was configured with --without-libcap.
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
Prior to this update, there was a problem when entering a password using the pinentry-curses utility; an error message was displayed instead of the password entry dialog if pinentry-curses was run under a user different from the user who owned the current tty. This bug has been fixed in this update so that no error message is now displayed and pinentry-curses asks for a password as expected.
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.