Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
In ipa we use gpg for simple symmetric encryption within a tool, basically like this:
% touch encrypt_me
% mkdir /tmp/test
% echo password | /usr/bin/gpg2 --batch --homedir /tmp/test --passphrase-fd 0 --yes --no-tty -o encrypt_me.gpg -c encrypt_me
gpg: WARNING: unsafe permissions on homedir `/tmp/test'
gpg: keyring `/tmp/test/pubring.gpg' created
gpg: can't connect to the agent: IPC connect call failed
gpg: problem with the agent: No agent running
% echo $? 2
This succeeds in encrypting the file but returns error code 2.
The reverse of this does not complain about the agent and returns 0.
% echo password | /usr/bin/gpg2 --batch --homedir /tmp/test --passphrase-fd 0
--yes --no-tty -o encrypt_me.out -d encrypt_me.gpg
gpg: WARNING: unsafe permissions on homedir `/tmp/test'
gpg: CAST5 encrypted data
gpg: encrypted with 1 passphrase
gpg: WARNING: message was not integrity protected
% echo $?
0
Similar commands works fine using gpg.
Error code 2 is not documented on the man page. It just says that anything non-zero is bad. Does 2 mean can't connect to agent or something else? I can ignore that return code if needed.
Version-Release number of selected component (if applicable):
gnupg2-2.0.19-6.el7