trust_anchor_backoff_time also when appdata dir is not writable

This commit is contained in:
Willem Toorop 2018-12-14 13:42:43 +01:00
parent 990372329c
commit 232f655663
1 changed files with 8 additions and 3 deletions

View File

@ -5349,6 +5349,8 @@ int _getdns_context_write_priv_file(getdns_context *context,
(void) close(fd);
context->can_write_appdata = PROP_UNABLE;
context->trust_anchors_backoff_expiry =
_getdns_get_now_ms() + context->trust_anchors_backoff_time;
return 0;
}
@ -5361,9 +5363,12 @@ int _getdns_context_can_write_appdata(getdns_context *context)
if (context->can_write_appdata == PROP_ABLE)
return 1;
else if (context->can_write_appdata == PROP_UNABLE)
return 0;
else if (context->can_write_appdata == PROP_UNABLE) {
if (_getdns_ms_until_expiry(
context->trust_anchors_backoff_expiry) > 0)
return 0;
context->can_write_appdata = PROP_UNKNOWN;
}
(void) snprintf( test_fn, sizeof(test_fn)
, "write-test-%d.tmp", arc4random());