Skip to content

Commit

Permalink
gpg: no need to remove the UNIX socket
Browse files Browse the repository at this point in the history
Our agent should be invoked and re-used when running 'gpg --import'.
  • Loading branch information
romanz committed Nov 16, 2017
1 parent cb3477f commit 1f9d457
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions libagent/gpg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@ def run_init(device_type, args):
gpg_binary = keyring.get_gnupg_binary()
check_call([gpg_binary, '--homedir', homedir, '--quiet',
'--import', pubkey.name])
check_call(['rm', '-f', os.path.join(homedir, 'S.gpg-agent')])
# (otherwise, our agent won't be started automatically)

# Make new GPG identity with "ultimate" trust (via its fingerprint)
out = check_output([gpg_binary, '--homedir', homedir, '--list-public-keys',
Expand Down Expand Up @@ -215,6 +213,7 @@ def run_agent(device_type):
filename=config['log-file'])
log.debug('sys.argv: %s', sys.argv)
log.debug('os.environ: %s', os.environ)
log.debug('pid: %d, parent pid: %d', os.getpid(), os.getppid())
try:
env = {'GNUPGHOME': args.homedir}
sock_path = keyring.get_agent_sock_path(env=env)
Expand Down

0 comments on commit 1f9d457

Please sign in to comment.