Test accessibility of trust anchor before adding

This commit is contained in:
Willem Toorop 2014-02-11 22:53:10 +01:00
parent 8fd8c9cf98
commit a3f50a6d86
1 changed files with 2 additions and 1 deletions

View File

@ -453,7 +453,8 @@ getdns_context_create_with_extended_memory_functions(
GETDNS_TRANSPORT_UDP_FIRST_AND_FALL_BACK_TO_TCP);
/* Set default trust anchor */
(void) ub_ctx_add_ta_file(result->unbound_ctx, TRUST_ANCHOR_FILE);
if (access(TRUST_ANCHOR_FILE, R_OK) == 0)
(void) ub_ctx_add_ta_file(result->unbound_ctx, TRUST_ANCHOR_FILE);
return GETDNS_RETURN_GOOD;
} /* getdns_context_create_with_extended_memory_functions */