aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2020-11-12 13:09:32 +0100
committerWerner Koch <wk@gnupg.org>2020-11-12 13:09:32 +0100
commite546cc78b75978a696298f2fcc072faeb7f69be4 (patch)
tree2b5c643c58c3034e49e13f89b7807915f4cec546
parent23f1fc766af0b8585e100cd75c4b571fe3dad831 (diff)
downloadgnupg-e546cc78b75978a696298f2fcc072faeb7f69be4.tar.gz
gpgconf: Yet another fix for --apply-profile.
* tools/gpgconf.c (main): Use gnupg_homedir instead of default_homedir. Check for existance of the directory. -- Fixes-commit: 7d95f2e7e7a09e3d433d449b117e3470f9dd38c7 Signed-off-by: Werner Koch <wk@gnupg.org>
-rw-r--r--tools/gpgconf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/gpgconf.c b/tools/gpgconf.c
index a5b84402b..181109f9a 100644
--- a/tools/gpgconf.c
+++ b/tools/gpgconf.c
@@ -805,16 +805,16 @@ main (int argc, char **argv)
es_putc ('\n', es_stderr);
gpgconf_failure (GPG_ERR_USER_2);
}
- if (!opt.dry_run)
- gnupg_maybe_make_homedir (default_homedir (), opt.quiet);
+ if (!opt.dry_run && gnupg_access (gnupg_homedir (), F_OK))
+ gnupg_maybe_make_homedir (gnupg_homedir (), opt.quiet);
gc_component_retrieve_options (-1);
if (gc_process_gpgconf_conf (NULL, 1, 1, NULL))
gpgconf_failure (0);
break;
case aApplyProfile:
- if (!opt.dry_run)
- gnupg_maybe_make_homedir (default_homedir (), opt.quiet);
+ if (!opt.dry_run && gnupg_access (gnupg_homedir (), F_OK))
+ gnupg_maybe_make_homedir (gnupg_homedir (), opt.quiet);
gc_component_retrieve_options (-1);
if (gc_apply_profile (fname))
gpgconf_failure (0);