aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2021-06-09 08:23:42 +0000
committerWerner Koch <[email protected]>2021-06-16 10:59:49 +0000
commit14528ec66bd7dce28c7540fa9a34f35de54261c1 (patch)
treef0d01141854986310f1c51bfb9b1b2b577b04b22
parentdirmngr: Rewrite the LDAP wrapper tool (diff)
downloadgnupg-14528ec66bd7dce28c7540fa9a34f35de54261c1.tar.gz
gnupg-14528ec66bd7dce28c7540fa9a34f35de54261c1.zip
dirmngr: Allow to pass no filter args to dirmngr_ldap.
* dirmngr/dirmngr_ldap.c (main): Handle no args case. -- This is required for example for CRLs. The old code did not require this because the hos was taken from the URL given has arg. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit f6e45671aa26f3e7abb968a876de7bbdb4fca3f1)
-rw-r--r--dirmngr/dirmngr_ldap.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/dirmngr/dirmngr_ldap.c b/dirmngr/dirmngr_ldap.c
index ba256a877..9c9fcc508 100644
--- a/dirmngr/dirmngr_ldap.c
+++ b/dirmngr/dirmngr_ldap.c
@@ -296,8 +296,6 @@ main (int argc, char **argv)
if (log_get_errorcount (0))
exit (2);
- if (argc < 1)
- gpgrt_usage (1);
if (opt.alarm_timeout)
{
@@ -320,9 +318,17 @@ main (int argc, char **argv)
any_err = 1;
else
{
- for (; argc; argc--, argv++)
- if (process_filter (ld, *argv))
- any_err = 1;
+ if (!argc)
+ {
+ if (process_filter (ld, "(objectClass=*)"))
+ any_err = 1;
+ }
+ else
+ {
+ for (; argc; argc--, argv++)
+ if (process_filter (ld, *argv))
+ any_err = 1;
+ }
ldap_unbind (ld);
}