summaryrefslogtreecommitdiffstats
path: root/dirmngr
diff options
context:
space:
mode:
Diffstat (limited to 'dirmngr')
-rw-r--r--dirmngr/dirmngr.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c
index 95f739a0c..034f7d5b4 100644
--- a/dirmngr/dirmngr.c
+++ b/dirmngr/dirmngr.c
@@ -406,7 +406,7 @@ static npth_key_t my_tlskey_current_fd;
/* Prototypes. */
static void cleanup (void);
#if USE_LDAP
-static ldap_server_t parse_ldapserver_file (const char* filename);
+static ldap_server_t parse_ldapserver_file (const char* filename, int ienoent);
#endif /*USE_LDAP*/
static fingerprint_list_t parse_ocsp_signer (const char *string);
static void netactivity_action (void);
@@ -1126,11 +1126,11 @@ main (int argc, char **argv)
ldapfile = make_filename (gnupg_homedir (),
"dirmngr_ldapservers.conf",
NULL);
- opt.ldapservers = parse_ldapserver_file (ldapfile);
+ opt.ldapservers = parse_ldapserver_file (ldapfile, 1);
xfree (ldapfile);
}
else
- opt.ldapservers = parse_ldapserver_file (ldapfile);
+ opt.ldapservers = parse_ldapserver_file (ldapfile, 0);
#endif /*USE_LDAP*/
#ifndef HAVE_W32_SYSTEM
@@ -1593,7 +1593,7 @@ dirmngr_deinit_default_ctrl (ctrl_t ctrl)
*/
#if USE_LDAP
static ldap_server_t
-parse_ldapserver_file (const char* filename)
+parse_ldapserver_file (const char* filename, int ignore_enoent)
{
char buffer[1024];
char *p;
@@ -1605,7 +1605,10 @@ parse_ldapserver_file (const char* filename)
fp = es_fopen (filename, "r");
if (!fp)
{
- log_info ("failed to open '%s': %s\n", filename, strerror (errno));
+ if (ignore_enoent && gpg_err_code_from_syserror () == GPG_ERR_ENOENT)
+ ;
+ else
+ log_info ("failed to open '%s': %s\n", filename, strerror (errno));
return NULL;
}