Page MenuHome GnuPG

gpgconf should? not list disabled components
Closed, ResolvedPublic

Description

I'm not that confident for this. I describe this for Windows' build.

For Windows, --disable-tmp2d is expected configure option (at least for now).
Even with that, gpgconf --list-components will list tpm2daemon, and gpgconf --check-programs will report an error for uninstalled tpm2daemon.

It probably confuses users.

Revisions and Commits

Related Objects

Event Timeline

If it confuses users, we can apply something like this:

diff --git a/tools/gpgconf-comp.c b/tools/gpgconf-comp.c
index 2a5087e1f..12916a64e 100644
--- a/tools/gpgconf-comp.c
+++ b/tools/gpgconf-comp.c
@@ -93,7 +93,9 @@ gc_error (int status, int errnum, const char *fmt, ...)
 /* Forward declaration.  */
 static void gpg_agent_runtime_change (int killflag);
 static void scdaemon_runtime_change (int killflag);
+#ifdef BUILD_WITH_TPM2D
 static void tpm2daemon_runtime_change (int killflag);
+#endif
 static void dirmngr_runtime_change (int killflag);
 static void keyboxd_runtime_change (int killflag);
 
@@ -379,6 +381,7 @@ static known_option_t known_options_scdaemon[] =
    { NULL }
  };
 
+#ifdef BUILD_WITH_TPM2D
 /* The known options of the GC_COMPONENT_TPM2DAEMON component.  */
 static known_option_t known_options_tpm2daemon[] =
   {
@@ -393,6 +396,7 @@ static known_option_t known_options_tpm2daemon[] =
 
    { NULL }
  };
+#endif
 
 
 /* The known options of the GC_COMPONENT_GPG component.  */
@@ -666,9 +670,11 @@ static struct
      GNUPG_MODULE_NAME_SCDAEMON, SCDAEMON_NAME ".conf",
      known_options_scdaemon, NULL, scdaemon_runtime_change},
 
+#ifdef BUILD_WITH_TPM2D
    { TPM2DAEMON_NAME, TPM2DAEMON_DISP_NAME, "gnupg", N_("TPM"),
      GNUPG_MODULE_NAME_TPM2DAEMON, TPM2DAEMON_NAME ".conf",
      known_options_tpm2daemon, NULL, tpm2daemon_runtime_change},
+#endif
 
    { DIRMNGR_NAME, DIRMNGR_DISP_NAME, "gnupg",   N_("Network"),
      GNUPG_MODULE_NAME_DIRMNGR, DIRMNGR_NAME ".conf",
@@ -802,6 +808,7 @@ scdaemon_runtime_change (int killflag)
 }
 
 
+#ifdef BUILD_WITH_TPM2D
 static void
 tpm2daemon_runtime_change (int killflag)
 {
@@ -844,6 +851,7 @@ tpm2daemon_runtime_change (int killflag)
               pgmname, argv[cmdidx], gpg_strerror (err));
   gnupg_release_process (pid);
 }
+#endif
 
 
 static void
werner triaged this task as Normal priority.Apr 22 2021, 8:33 AM
werner added a subscriber: werner.

Given that we don't yet support TPM for Windows you should go ahead and apply this patch. tpm should also be removed from the list of components.

gniibe claimed this task.