gpgconf: Make sure the homedir exists for --apply-profile.

* tools/gpgconf.c (main) <aApplyDefaults, aApplyProfile>: Create the
standard home directory.
--

This fixes a regression due to the fix for
GnuPG-bug-id: 4867
Before that change gpgsm implictly created the homedir while options
were collected.  It is important to have this so that a login script
can create config files for new users.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2020-11-04 15:49:58 +01:00
parent dabc314b71
commit 7d95f2e7e7
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
1 changed files with 4 additions and 0 deletions

View File

@ -805,12 +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);
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);
gc_component_retrieve_options (-1);
if (gc_apply_profile (fname))
gpgconf_failure (0);