From 38d369de13acb95208a0ed8d1cf82ac19173688f Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 1 Sep 2016 19:22:48 +0200 Subject: [PATCH] gpg: Avoid homedir creation by --list-config * g10/gpg.c (main): Do not register a key for the list config commands. Signed-off-by: Werner Koch --- g10/gpg.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/g10/gpg.c b/g10/gpg.c index a9770d74a..0b0fb7e75 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -2377,11 +2377,16 @@ main (int argc, char **argv) { switch( pargs.r_opt ) { - case aCheckKeys: case aListConfig: case aListGcryptConfig: case aGPGConfList: case aGPGConfTest: + set_cmd (&cmd, pargs.r_opt); + /* Do not register a keyring for these commands. */ + default_keyring = -1; + break; + + case aCheckKeys: case aListPackets: case aImport: case aFastImport: @@ -3789,6 +3794,8 @@ main (int argc, char **argv) case aGenRandom: case aDeArmor: case aEnArmor: + case aListConfig: + case aListGcryptConfig: break; case aFixTrustDB: case aExportOwnerTrust: