aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2023-02-28 13:41:04 +0000
committerWerner Koch <[email protected]>2023-02-28 13:43:53 +0000
commita5d9be1e282a77d80018d588378e9f09d73b153d (patch)
treea5b975d053e622c23de97a15ffe443e3823158ee
parentgpgsm: Improve cert lookup callback from dirmngr. (diff)
downloadgnupg-a5d9be1e282a77d80018d588378e9f09d73b153d.tar.gz
gnupg-a5d9be1e282a77d80018d588378e9f09d73b153d.zip
gpgconf: Print some standard envvars with -X
* tools/gpgconf.c (show_configs): Add a list of envvars and print them. -- Note that for simplicity we to not distinguish between Windows and Linux here.
-rw-r--r--tools/gpgconf.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/gpgconf.c b/tools/gpgconf.c
index 1b3f2beba..8faca0a6c 100644
--- a/tools/gpgconf.c
+++ b/tools/gpgconf.c
@@ -1472,6 +1472,11 @@ show_configs (estream_t outfp)
static const char *names[] = { "common.conf", "gpg-agent.conf",
"scdaemon.conf", "dirmngr.conf",
"gpg.conf", "gpgsm.conf" };
+ static const char *envvars[] = { "PATH",
+ "http_proxy", "HTTP_PROXY",
+ "https_proxy", "HTTPS_PROXY",
+ "LD_LIBRARY_PATH", "LD_PRELOAD",
+ "LD_AUDIT", "LD_ORIGIN_PATH" };
gpg_error_t err;
int idx;
char *fname;
@@ -1501,6 +1506,19 @@ show_configs (estream_t outfp)
list_dirs (outfp, NULL, 1);
es_fprintf (outfp, "\n");
+ for (idx=0; idx < DIM(envvars); idx++)
+ if ((s = getenv (envvars[idx])))
+ es_fprintf (outfp, "%s=%s\n", envvars[idx], s);
+ es_fprintf (outfp, "\n");
+
+ fname = make_filename (gnupg_sysconfdir (), "gpgconf.conf", NULL);
+ if (!gnupg_access (fname, F_OK))
+ {
+ show_configs_one_file (fname, 1, outfp, &list);
+ es_fprintf (outfp, "\n");
+ }
+ xfree (fname);
+
for (idx = 0; idx < DIM (names); idx++)
{
fname = make_filename (gnupg_sysconfdir (), names[idx], NULL);