Bug 884264

Summary: agent always required with gpg2
Product: Red Hat Enterprise Linux 7 Reporter: Rob Crittenden <rcritten>
Component: gnupg2Assignee: Tomas Mraz <tmraz>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-05 21:59:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rob Crittenden 2012-12-05 18:53:00 UTC
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

Comment 1 Tomas Mraz 2012-12-05 21:59:50 UTC

*** This bug has been marked as a duplicate of bug 841588 ***