aboutsummaryrefslogtreecommitdiffstats
path: root/tools/gpgconf.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2025-04-09gpgconf: Show also stuff from the Registry emulation.Werner Koch1-6/+84
* tools/gpgconf.c (my_read_reg_string): New. Use it for the registry listing stuff. (show_registry_entries_from_file): Use also on Unix.
2024-09-03gpgconf: Add missing linefeed to the -X output.Werner Koch1-1/+11
* tools/gpgconf.c (show_registry_entries_from_file): Add missing LF.
2024-08-21w32: Add two more registry entries for use with -XWerner Koch1-0/+2
* tools/gpgconf.c (show_other_registry_entries): Add entries.
2024-08-12gpgconf: Print the full commit id.Werner Koch1-1/+1
* autogen.sh: Update to version 2024-07-04 from libgpg-error. * configure.ac (BUILD_REVISION): Rename the ac_define by BUILD_COMMITID. * tools/gpgconf.c (show_version_gnupg): Use it here. -- (cherry picked from commit 736579331b14035db5b857812d18b493678f7769)
2024-04-04gpgconf: Change layout of the gpgconf -X output.Werner Koch1-47/+78
* tools/gpgconf.c (list_dirs): Change the config mode output. (my_copy_file): Adjust output for org-mode style. (show_configs_one_file): Ditto. (show_other_registry_entries): Ditto. (show_registry_entries_from_file): Ditto. (show_configs): Ditto.
2024-03-18gpgconf: Check readability of some files with -XWerner Koch1-8/+29
* tools/gpgconf.c (list_dirs): Rename arg from special to show_config_mode. Add "S.Uiserver" test and test existsing files for readability.
2024-01-26tools: Fix argparse table of gpgconf.NIIBE Yutaka1-36/+40
* tools/gpgconf.c (opts): Use ARGPARSE macros. -- GnuPG-bug-id: 6902 Signed-off-by: NIIBE Yutaka <[email protected]> (cherry picked from commit 2be53b214d1c9205f5326ca663115200609d8df4)
2024-01-09gpgconf: Adjust -X command for the new VERSION file formatWerner Koch1-10/+38
* tools/gpgconf.c (show_version_gnupg): Read and parse the entire VERSION file. -- GnuPG-bug-id: 6918
2023-03-13gpgconf,w32: Also print a GnuPG Install Directory Registry entryWerner Koch1-1/+2
* tools/gpgconf.c (show_other_registry_entries): Add another dir.
2023-02-28gpgconf: Print some standard envvars with -XWerner Koch1-0/+18
* 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.
2022-08-03gpgconf: Add config file for Windows Registry dumps.Werner Koch1-0/+71
* tools/gpgconf.c (show_registry_entries_from_file): New. (show_configs): Call it. * doc/examples/gpgconf.rnames: New. * doc/Makefile.am (examples): Add it.
2022-08-02gpgconf: Improve registry dumping.Werner Koch1-9/+11
* common/w32-reg.c (read_w32_registry_string): Map REG_DWORD to a string. (read_w32_reg_string): Add arg r_hklm_fallback and change all callers. (show_configs): Indicate whether the HKLM fallback was used. * tools/gpgconf.c (show_other_registry_entries): Fix the Outlook Addin Registry key. Indicate whether the HKLM fallback was used.
2022-06-29gpgconf: New short options -V and -XWerner Koch1-5/+40
* tools/gpgconf.c: Assign short options -X and -V (show_version_gnupg): Print the vsd version if available. -- These changes are helpful for phone support.
2022-04-20w32: Do no use Registry item DefaultLogFile for the main tools.Werner Koch1-1/+2
* g10/gpg.c (main): Set LOG_NO_REGISTRY. * sm/gpgsm.c (main): Ditto. * tools/gpg-connect-agent.c (main): Ditto. * tools/gpgconf.c (main): Ditto. (show_other_registry_entries): Print "DefaultLogFile". -- The intention of this mostly forgotten registry entry was to allow for easy debugging of the tools. However, with the global config files (and in 2.3 with common.conf) things are anyway better. We disable the use for the commonly used tools so that it does not look like calling gpg on the command line seems to block with no output if the log server (e.g. tcp://1.2.3.4:11111) is not reachable.
2022-02-07gpgconf: Print the used code pages on Windows with --show-configsWerner Koch1-0/+9
* tools/gpgconf.c (show_configs): Add some code
2022-01-12gpgconf: Add command aliases -L -K -R.Werner Koch1-5/+6
* tools/gpgconf.c (enum cmd_and_opt_values): Assign shortcuts. -- I have to type them to often ;-)
2021-12-30build: Fixes recent commits to still build with gpgrt 1.27.Werner Koch1-1/+1
* agent/gpg-agent.c (main): Use gnupg_argparse. * tools/gpgconf-comp.c: Use gnupg_opt_t. * tools/gpgconf.c (show_version_gnupg): Use strusage. --
2021-12-29gpgconf: Support reading global options (part 1).Werner Koch1-0/+6
* tools/gpgconf.c (main): Set the config directories. * tools/gpgconf-comp.c (gc_backend): Change the name of the config files. (struct gc_option): Add new field 'attr'. (retrieve_options_from_program): Rewrite to use gpgrt_argparser. -- We need to do larger changes to gpgconf so that it is possible to get also global config options and their attributes. The old code worked along its own list of option and used a generic option file parser. This has no support for global config files. We now use gnupgt_argparser so that we to do exactly the same as the component does and thus delivers the actual option values as seen by the component. This is just a first step and we need to change more things. Signed-off-by: Werner Koch <[email protected]> This is a backport from master (2.3).
2021-11-19gpgconf: Include output of --list-dirs in --show-configs.Werner Koch1-14/+28
* tools/gpgconf.c (list_dirs): Add arg special. (show_other_registry_entries): Print the Homedir. (show_configs): List directories.
2021-11-18gpgconf: --show-configs now prints a bunch of Registry entries.Werner Koch1-11/+103
* tools/gpgconf.c (show_other_registry_entries): New. (show_configs): Call it. Minor reformatting. --
2021-11-18gpgconf: Extend --show-config to show envvars.Werner Koch1-19/+112
* tools/gpgconf.c (my_copy_file): Add arg LISTP and record certain things. (show_configs_one_file): New arg LISTP to be passed thru. (show_configs): Show envars and regisiry values. Signed-off-by: Werner Koch <[email protected]>
2021-11-13gpgconf: New command --show-configs.Werner Koch1-6/+155
* tools/gpgconf.c (aShowConfigs): New. (opts): Add --show-configs. (CUTLINE_FMT): New. (show_version_gnupg): Add arg "prefix" and adjust caller. (my_copy_file): New. (show_configs_one_file): New.New. (show_configs): New. (main): Call show_configs. -- The ability to have a consolidated list of all config files is very useful for support cases. This is in particular important due to the global config files and their conditional constructs. Signed-off-by: Werner Koch <[email protected]>
2021-08-17w32: Move socketdir to LOCAL_APPDATAWerner Koch1-2/+2
* common/homedir.c (is_gnupg_default_homedir): Use standard_homedir instead of the constant which makes a difference on Windows. (_gnupg_socketdir_internal) [W32]: Move the directory to LOCAL_APPDATA. (gnupg_cachedir): Remove unsued function. * common/sysutils.c (gnupg_rmdir): New. * tools/gpgconf.c (main): s/rmdir/gnupg_rmdir/. -- That is actually a more correct directory than APPDATA. This fixes a problem with installations where the APPDATA is non a network drive and the resulting socket filename is truncated in our socket helper function (because we use sockaddr also for our local socket emulation on Windows). LOCAL_APPDATA is expected to be on the local box and thus in the majority of cases the resulting socket file name will be short enough. GnuPG-bug-id: 5537 Signed-off-by: Werner Koch <[email protected]> Backport-from-master: 0802cbb59b21e06e16b4fd8596934c5565e7f659
2021-08-17gpgconf,w32: Print more registry diagnostics with --list-dirs.Werner Koch1-2/+36
* tools/gpgconf.c (list_dirs): Figure out classes with the key. Signed-off-by: Werner Koch <[email protected]>
2020-12-04Backport of the new option parser from 2.3Werner Koch1-7/+9
* configure.ac (GPGRT_ENABLE_ARGPARSE_MACROS): Define. * common/argparse.c, common/argparse.h: Rewrite. * tests/gpgscm/main.c: Switch to the new option parser. * g10/gpg.c: Switch to the new option parser and enable a global conf file. * g10/gpgv.c: Ditto. * agent/gpg-agent.c: Ditto. * agent/preset-passphrase.c: Ditto. * agent/protect-tool.c: Ditto. * scd/scdaemon.c: Ditto. * dirmngr/dirmngr.c: Ditto. * dirmngr/dirmngr_ldap.c: Ditto * dirmngr/dirmngr-client.c: Ditto. * kbx/kbxutil.c: Ditto. * tools/gpg-card.c: Ditto. * tools/gpg-check-pattern.c: Ditto. * tools/gpg-connect-agent.c: Ditto. * tools/gpg-pair-tool.c: Ditto. * tools/gpg-wks-client.c: Ditto. * tools/gpg-wks-server.c: Ditto. * tools/gpgconf.c: Ditto. * tools/gpgsplit.c: Ditto. * tools/gpgtar.c: Ditto. * g13/g13.c: Ditto. * g13/g13-syshelp.c: Ditto. Do not force verbose mode. * sm/gpgsm.c: Ditto. Add option --no-options. -- This is backport from master commit cdbe10b762f38449b86da69076209324b0c99982 commit ba463128ce65a0f347643f7246a8e097c5be19f1 commit 3bc004decd289810bc1b6ad6fb8f47e45c770ce6 commit 2c823bd878fcdbcc4f6c34993e1d0539d9a6b237 commit 0e8f6e2aa98c212442001036fb5178cd6cd8af59 but without changing all functions names to gpgrt. Instead we use wrapper functions which, when building against old Libgpg-error versions, are implemented in argparse.c using code from the current libgpg-error. This allows to keep the dependency requirement at libgpg-error 1.27 to support older distributions. Tested builds against 1.27 and 1.40-beta. Note that g13-syshelp does not anymore default to --verbose because that can now be enabled in /etc/gnupg/g13-syshelp.conf. GnuPG-bug-id: 4788 Signed-off-by: Werner Koch <[email protected]>
2020-11-12gpgconf: Yet another fix for --apply-profile.Werner Koch1-4/+4
* tools/gpgconf.c (main): Use gnupg_homedir instead of default_homedir. Check for existance of the directory. -- Fixes-commit: 1fbf085bc8b4a92772d1da8bfea507f4f97434b1 Signed-off-by: Werner Koch <[email protected]>
2020-11-09Require Libgcrypt 1.8Werner Koch1-2/+0
* configure.ac (NEED_LIBGCRYPT_VERSION): Require 1.8. * tools/gpgconf.c (show_version_libgcrypt): Remove conditional case for Libgcrypt < 1.8. * common/compliance.c (gnupg_rng_is_compliant): Ditto. * agent/pksign.c: Ditto. * agent/gpg-agent.c (thread_init_once): Ditto. (agent_libgcrypt_progress_cb): Ditto. * agent/command.c (cmd_getinfo): Ditto. -- Libgcrypt 1.7 reached end-of-life more than a year ago. Thus there is no reason to keep backward support for it. Signed-off-by: Werner Koch <[email protected]>
2020-11-04gpgconf: Make sure the homedir exists for --apply-profile.Werner Koch1-0/+4
* 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 <[email protected]>
2020-10-02gpgconf: New option --show-versions.Werner Koch1-1/+170
* tools/gpgconf.c: Include exechelp.h. New option --show-versions. (get_revision_from_blurb): New. (show_version_gnupg): New. (show_version_libgcrypt): New. (show_version_gpgrt): New. (show_versions_via_dirmngr): New. (show_versions): New. * dirmngr/dirmngr.c (main): New internal option --gpgconf-versions. (get_revision_from_blurb): New. (gpgconf_versions): New. -- This option should be helpful to gather information for debugging. Signed-off-by: Werner Koch <[email protected]> Backported-from-master: 357ad9ae29677c1676b56d2b81282e2f78ec8040
2020-02-10build: Always use EXTERN_UNLESS_MAIN_MODULE pattern.Werner Koch1-0/+1
* common/util.h (EXTERN_UNLESS_MAIN_MODULE): Add the definion only here but now without the Norcroft-C. Change all other places where it gets defined. * common/iobuf.h (iobuf_debug_mode): Declare unconditionally as extern. * common/iobuf.c (iobuf_debug_mode): Define it here. * agent/gpg-agent.c (INCLUDED_BY_MAIN_MODULE): Define here and also in all main modules of all other programs. * g10/main.h: Put util.h before the local header files. -- This change is required for use with gcc/ld's LTO feature which does not allow common blocks. Further gcc 10 will make -fno-common the default and thus this chnage is always needed. What a pitty. Co-authored-by: Tomáš Mráz GnuPG-bug-id: 4831 Signed-off-by: Werner Koch <[email protected]>
2020-01-17gpgconf,w32: Print a warning for a suspicious homedir.Werner Koch1-0/+14
* tools/gpgconf.c (list_dirs): Check whether the homedir has been taken from the registry. -- Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 7f12fb55f9757cd68147eca8f162c85378538405)
2019-05-16gpgconf: Before --launch check that the config file is fine.Werner Koch1-0/+1
* tools/gpgconf-comp.c (gc_component_launch): Check the conf file. * tools/gpgconf.c (gpgconf_failure): Call log_flush. -- GnuPG-bug-id: 4497 Signed-off-by: Werner Koch <[email protected]>
2019-02-26conf: New option --show-socket.Werner Koch1-1/+20
* tools/gpgconf-comp.c (gc_component_t): Move this enum to ... * tools/gpgconf.h: here. * tools/gpgconf.c (oShowSocket): New. (opts): Add new option. (main): Implement new option. -- This is a convenience options for software which directly connects to gpg-agent and thus needs to new the socket. By using --show-socket along with --launch that software can also autostart the agent or the dirmngr. Without this two calls to gpgconf would be required. Actually the same behaviour can be achieved by running gpg-connect-agent to query the running gpg-agent's socket via GETINFO. The gpg-connect also makes sure that the agent is started. This is not anymore suggested because gpgconf shall in future be used for all such things. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit ac485b4f253ad6bbd2bc648650b56d60fc82f89d)
2017-12-18conf: New option --status-fd.Werner Koch1-15/+97
* tools/gpgconf.c (oStatusFD): New const. (opts): New option --status-fd. (statusfp): New var. (set_status_fd): New. (gpgconf_write_status): New. (gpgconf_failure): New. (main): Set status fd and replace exit by gpgconf_failure. * tools/gpgconf-comp.c: Repalce exit by gpgconf_failure. (gc_process_gpgconf_conf): Print a few warning status messages. Signed-off-by: Werner Koch <[email protected]>
2017-08-23build: Change SWDB tag "gnupg21" to "gnupg22".Werner Koch1-1/+1
* configure.ac (GNUPG_SWDB_TAG): New ac_define. Set it to "gnupg22". * tools/gpgconf.c (query_swdb): Use it. * build-aux/speedo.mk: Change tag "gnupg21" to "gnupg22". * Makefile.am (distcheck-hook): Ditto. Signed-off-by: Werner Koch <[email protected]>
2017-07-19Fix usage of ARGPARSE_OPTS.NIIBE Yutaka1-1/+2
* agent/gpg-agent.c, agent/preset-passphrase.c, dirmngr/dirmngr-client.c, dirmngr/dirmngr_ldap.c, kbx/kbxutil.c, tools/gpg-check-pattern.c, tools/gpgconf.c, tools/gpgsplit.c, tools/symcryptrun.c: Use ARGPARSE_end. Signed-off-by: NIIBE Yutaka <[email protected]>
2017-04-28Spelling fixes in docs and comments.NIIBE Yutaka1-1/+1
-- In addition, fix trailing spaces in tests/inittests. GnuPG-bug-id: 3121 Reported-by: ka7 (klemens) Signed-off-by: NIIBE Yutaka <[email protected]>
2017-03-23tests: Use gpgconf to stop the agent.Werner Koch1-1/+37
* tests/openpgp/defs.scm (stop-agent): Swap order of actions. Kill all daemons using gpgconf. * tools/gpgconf.c (main) <aRemoveSocketDir>: Try to remove known socketfails on rmdir failure. Do no fail for ENONET. -- Killing all daemons is not really required but it does not harm to be prepared for the future. Signed-off-by: Werner Koch <[email protected]>
2017-03-07Remove -I option to common.NIIBE Yutaka1-2/+2
* dirmngr/Makefile.am (AM_CPPFLAGS): Remove -I$(top_srcdir)/common. * g10/Makefile.am (AM_CPPFLAGS): Ditto. * g13/Makefile.am (AM_CPPFLAGS): Ditto. * kbx/Makefile.am (AM_CPPFLAGS): Ditto. * scd/Makefile.am (AM_CPPFLAGS): Ditto. * sm/Makefile.am (AM_CPPFLAGS): Ditto. * tools/Makefile.am (AM_CPPFLAGS): Ditto. * Throughout: Follow the change. Signed-off-by: NIIBE Yutaka <[email protected]>
2017-02-21Clean up word replication.Yuri Chornoivan1-1/+1
-- This fixes extra word repetitions (like "the the" or "is is") in the code and docs. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
2017-01-23Fix format string errors and some missing error case initialization.Werner Koch1-1/+1
* common/logging.c (do_logv): Remove extra parentheses in comparison. * dirmngr/dns-stuff.c (resolve_addr_libdns): Init RES so that dns_res_close is given a defined value in the error case. * dirmngr/http.c (cookie_read, cookie_write) [HTTP_USE_NTBTLS]: Fix format string char. * dirmngr/ks-engine-hkp.c (ks_hkp_help): Remove duplicate "const". * dirmngr/ks-engine-http.c (ks_http_help): Ditto. * dirmngr/ks-engine-kdns.c (ks_kdns_help): Ditto. * dirmngr/ks-engine-ldap.c (ks_ldap_help): Ditto. * scd/app-p15.c (send_keypairinfo, do_getattr): Fix format string char. * tools/gpgconf-comp.c (gpg_agent_runtime_change): Init PID for the error case. (scdaemon_runtime_change): Ditto. (dirmngr_runtime_change): Ditto. * tools/gpgconf.c (query_swdb): Init VALUE_SIZE_UL. Signed-off-by: Werner Koch <[email protected]>
2017-01-18gpgconf: Allow "all" for --launch, --kill, and --reload.Werner Koch1-1/+13
* tools/gpgconf-comp.c (gc_component_launch): Allow -1 for COMPONENT. (gc_component_kill): Ditto. (gc_component_reload): For robustness change the condition to < 0. * tools/gpgconf.c (main) <aLaunch, aKill, aReload>: Support argument "all". Signed-off-by: Werner Koch <[email protected]>
2017-01-10tools: Fix memory leaks and improve error handling.Justus Winter1-0/+1
* tools/gpgconf-comp.c (gc_option_free): New function. (gc_components_free): Likewise. (gc_components_init): Likewise. (retrieve_options_from_program): Use 'xfree', fix memory leak. (change_options_program): Improve error handling. (gc_component_change_options): Fix memory leaks. * tools/gpgconf.c (main): Initialize components. * tools/gpgconf.h (gc_components_init): New prototype. Signed-off-by: Justus Winter <[email protected]>
2016-12-16gpgconf: New command --apply-profile.Werner Koch1-1/+12
* tools/gpgconf.c (aApplyProfile): New. (opts): New command --apply-profile. (main): Implement that command. * tools/gpgconf-comp.c (option_check_validity): Add arg VERBATIM. (change_options_program): Ditto. (change_one_value): Ditto. (gc_component_change_options): Ditto. (gc_apply_profile): New. -- Here is an example for a profile --8<---------------cut here---------------start------------->8--- # foo.prf - Sample profile [gpg] compliance de-vs default-new-key-algo brainpoolP256r1+brainpoolP256r1 [gpgsm] enable-crl-checks [gpg-agent] default-cache-ttl 900 max-cache-ttl [] 3600 no-allow-mark-trusted no-allow-external-cache enforce-passphrase-constraints min-passphrase-len 9 min-passphrase-nonalpha 0 [dirmngr] keyserver hkp://keys.gnupg.net allow-ocsp --8<---------------cut here---------------end--------------->8--- Note that flags inside of brackets are allowed after the option name. The only defined flag for now is "[default]". In case the value starts with a bracket, it is possible to insert "[]" as a nop-flag. Signed-off-by: Werner Koch <[email protected]>
2016-12-14common: Support locating components in the build tree.Justus Winter1-0/+3
* common/homedir.c (gnupg_build_directory): New variable. (gnupg_module_name_called): Likewise. (gnupg_set_builddir): New function. (gnupg_set_builddir_from_env): Likewise. (gnupg_module_name): Support locating components in the build tree. * common/util.h (gnupg_set_builddir): New prototype. * tests/openpgp/defs.scm (tools): Drop 'gpg and 'gpg-agent. (tool): Rename to 'tool-hardcoded. (gpg-conf): New function, with accessors for the results. (gpg-components): New variable. (tool): New function. * tools/gpgconf.c (enum cmd_and_opt_values): New key. (opts): New option '--build-prefix'. (main): Handle new option. -- This change makes sure that the components from the build tree are used, and not some older installed version in PATH. It also lets us make GPGME use components from the build tree, making it possible to execute GPGME's test suite with them. Signed-off-by: Justus Winter <[email protected]>
2016-12-08tools: Fix memleak in gpgconf.Werner Koch1-0/+1
* tools/gpgconf.c (main): Free SOCKETDIR. Signed-off-by: Werner Koch <[email protected]>
2016-11-05Change all http://www.gnu.org in license notices to https://Werner Koch1-1/+1
--
2016-11-03gpgconf: Add a new field to the --query-swdb output.Werner Koch1-5/+16
* tools/gpgconf.c (query_swdb): Insert new field with the installed version. Check that the supplied version does not contain a colon. Signed-off-by: Werner Koch <[email protected]>
2016-11-02gpgconf: Add command --query-swdb.Werner Koch1-0/+246
* tools/gpgconf.c (aQuerySWDB): New. (opts): Add --query-swdb. (valid_swdb_name_p): New. (query_swdb): New. (main): Implement command --query-swdb. -- Right now this command is not very useful because dimngr has not yet been changed to create the swdb.lst. For manual tests the swdb.lst file from the Net can be used with these additional lines: .filedate 20161102T130337 .verified 20161102T150000
2016-09-30agent: Create the extra sockets in the standard socket dir.Werner Koch1-0/+2
* agent/gpg-agent.c (main): Take the socketdir in account for the default sockets. * tools/gpgconf.c (list_dirs): Add "agent-extra-socket" and "agent-browser-socket". Signed-off-by: Werner Koch <[email protected]>