From a3f50a6d869317dd127b47f4eb3f95f804da25ef Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Tue, 11 Feb 2014 22:53:10 +0100 Subject: [PATCH] Test accessibility of trust anchor before adding --- src/context.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/context.c b/src/context.c index 70be880e..0f39ec57 100644 --- a/src/context.c +++ b/src/context.c @@ -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 */