diff --git a/src/Makefile.in b/src/Makefile.in index ded0c635..fedc0921 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -501,6 +501,8 @@ sha512.lo sha512.o: $(srcdir)/compat/sha512.c \ config.h strlcpy.lo strlcpy.o: $(srcdir)/compat/strlcpy.c \ config.h +strptime.lo strptime.o: $(srcdir)/compat/strptime.c \ + config.h locks.lo locks.o: $(srcdir)/util/locks.c \ config.h \ $(srcdir)/util/locks.h $(srcdir)/util/orig-headers/locks.h $(srcdir)/util/auxiliary/util/log.h $(srcdir)/debug.h @@ -557,4 +559,4 @@ select_eventloop.lo select_eventloop.o: $(srcdir)/extension/select_eventloop.c \ $(srcdir)/extension/select_eventloop.h \ getdns/getdns.h \ getdns/getdns_extra.h \ - $(srcdir)/debug.h $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h + $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h $(srcdir)/debug.h diff --git a/src/anchor.c b/src/anchor.c index 68300984..8dc31d0a 100644 --- a/src/anchor.c +++ b/src/anchor.c @@ -721,7 +721,7 @@ static uint8_t *tas_validate(struct mem_funcs *mf, void _getdns_context_equip_with_anchor( getdns_context *context, uint64_t *now_ms) { - uint8_t xml_spc[4096], *xml_data; + uint8_t xml_spc[4096], *xml_data = NULL; uint8_t p7s_spc[4096], *p7s_data = NULL; size_t xml_len, p7s_len; const char *verify_email = NULL; diff --git a/src/const-info.c b/src/const-info.c index 776e6795..9caf93cd 100644 --- a/src/const-info.c +++ b/src/const-info.c @@ -82,6 +82,9 @@ static struct const_info consts_info[] = { { 622, "GETDNS_CONTEXT_CODE_ROUND_ROBIN_UPSTREAMS", GETDNS_CONTEXT_CODE_ROUND_ROBIN_UPSTREAMS_TEXT }, { 623, "GETDNS_CONTEXT_CODE_TLS_BACKOFF_TIME", GETDNS_CONTEXT_CODE_TLS_BACKOFF_TIME_TEXT }, { 624, "GETDNS_CONTEXT_CODE_TLS_CONNECTION_RETRIES", GETDNS_CONTEXT_CODE_TLS_CONNECTION_RETRIES_TEXT }, + { 625, "GETDNS_CONTEXT_CODE_TRUST_ANCHOR_URL", GETDNS_CONTEXT_CODE_TRUST_ANCHOR_URL_TEXT }, + { 626, "GETDNS_CONTEXT_CODE_TRUST_ANCHOR_VERIFY_CA", GETDNS_CONTEXT_CODE_TRUST_ANCHOR_VERIFY_CA_TEXT }, + { 627, "GETDNS_CONTEXT_CODE_TRUST_ANCHOR_VERIFY_EMAIL", GETDNS_CONTEXT_CODE_TRUST_ANCHOR_VERIFY_EMAIL_TEXT }, { 700, "GETDNS_CALLBACK_COMPLETE", GETDNS_CALLBACK_COMPLETE_TEXT }, { 701, "GETDNS_CALLBACK_CANCEL", GETDNS_CALLBACK_CANCEL_TEXT }, { 702, "GETDNS_CALLBACK_TIMEOUT", GETDNS_CALLBACK_TIMEOUT_TEXT }, @@ -174,6 +177,9 @@ static struct const_name_info consts_name_info[] = { { "GETDNS_CONTEXT_CODE_TLS_BACKOFF_TIME", 623 }, { "GETDNS_CONTEXT_CODE_TLS_CONNECTION_RETRIES", 624 }, { "GETDNS_CONTEXT_CODE_TLS_QUERY_PADDING_BLOCKSIZE", 620 }, + { "GETDNS_CONTEXT_CODE_TRUST_ANCHOR_URL", 625 }, + { "GETDNS_CONTEXT_CODE_TRUST_ANCHOR_VERIFY_CA", 626 }, + { "GETDNS_CONTEXT_CODE_TRUST_ANCHOR_VERIFY_EMAIL", 627 }, { "GETDNS_CONTEXT_CODE_UPSTREAM_RECURSIVE_SERVERS", 603 }, { "GETDNS_DNSSEC_BOGUS", 401 }, { "GETDNS_DNSSEC_INDETERMINATE", 402 }, diff --git a/src/context.c b/src/context.c index e44ce842..6f57143e 100644 --- a/src/context.c +++ b/src/context.c @@ -4629,7 +4629,8 @@ uint8_t *_getdns_context_get_priv_file(getdns_context *context, GETDNS_FREE(context->mf, buf); buf = NULL; } - buf[*file_sz] = 0; + else + buf[*file_sz] = 0; } (void) fclose(f); return buf; diff --git a/src/debug.h b/src/debug.h index 0ddc9400..9d181140 100644 --- a/src/debug.h +++ b/src/debug.h @@ -47,41 +47,41 @@ #ifdef GETDNS_ON_WINDOWS #define DEBUG_ON(...) do { \ - struct timeval tv; \ - struct tm tm; \ - char buf[10]; \ - time_t tsec; \ + struct timeval tv_dEbUgSyM; \ + struct tm tm_dEbUgSyM; \ + char buf_dEbUgSyM[10]; \ + time_t tsec_dEbUgSyM; \ \ - gettimeofday(&tv, NULL); \ - tsec = (time_t) tv.tv_sec; \ - gmtime_s(&tm, (const time_t *) &tsec); \ - strftime(buf, 10, "%H:%M:%S", &tm); \ - fprintf(stderr, "[%s.%.6d] ", buf, (int)tv.tv_usec); \ + gettimeofday(&tv_dEbUgSyM, NULL); \ + tsec = (time_t) tv_dEbUgSyM.tv_sec; \ + gmtime_s(&tm_dEbUgSyM, (const time_t *) &tsec_dEbUgSyM); \ + strftime(buf_dEbUgSyM, 10, "%H:%M:%S", &tm_dEbUgSyM); \ + fprintf(stderr, "[%s.%.6d] ", buf_dEbUgSyM, (int)tv_dEbUgSyM.tv_usec); \ fprintf(stderr, __VA_ARGS__); \ } while (0) #else #define DEBUG_ON(...) do { \ - struct timeval tv; \ - struct tm tm; \ - char buf[10]; \ + struct timeval tv_dEbUgSyM; \ + struct tm tm_dEbUgSyM; \ + char buf_dEbUgSyM[10]; \ \ - gettimeofday(&tv, NULL); \ - gmtime_r(&tv.tv_sec, &tm); \ - strftime(buf, 10, "%H:%M:%S", &tm); \ - fprintf(stderr, "[%s.%.6d] ", buf, (int)tv.tv_usec); \ + gettimeofday(&tv_dEbUgSyM, NULL); \ + gmtime_r(&tv_dEbUgSyM.tv_sec, &tm_dEbUgSyM); \ + strftime(buf_dEbUgSyM, 10, "%H:%M:%S", &tm_dEbUgSyM); \ + fprintf(stderr, "[%s.%.6d] ", buf_dEbUgSyM, (int)tv_dEbUgSyM.tv_usec); \ fprintf(stderr, __VA_ARGS__); \ } while (0) #endif #define DEBUG_NL(...) do { \ - struct timeval tv; \ - struct tm tm; \ - char buf[10]; \ + struct timeval tv_dEbUgSyM; \ + struct tm tm_dEbUgSyM; \ + char buf_dEbUgSyM[10]; \ \ - gettimeofday(&tv, NULL); \ - gmtime_r(&tv.tv_sec, &tm); \ - strftime(buf, 10, "%H:%M:%S", &tm); \ - fprintf(stderr, "[%s.%.6d] ", buf, (int)tv.tv_usec); \ + gettimeofday(&tv_dEbUgSyM, NULL); \ + gmtime_r(&tv_dEbUgSyM.tv_sec, &tm_dEbUgSyM); \ + strftime(buf_dEbUgSyM, 10, "%H:%M:%S", &tm_dEbUgSyM); \ + fprintf(stderr, "[%s.%.6d] ", buf_dEbUgSyM, (int)tv_dEbUgSyM.tv_usec); \ fprintf(stderr, __VA_ARGS__); \ fprintf(stderr, "\n"); \ } while (0) diff --git a/src/libgetdns.symbols b/src/libgetdns.symbols index 00b26848..6ef6a820 100644 --- a/src/libgetdns.symbols +++ b/src/libgetdns.symbols @@ -33,6 +33,9 @@ getdns_context_get_tls_authentication getdns_context_get_tls_backoff_time getdns_context_get_tls_connection_retries getdns_context_get_tls_query_padding_blocksize +getdns_context_get_trust_anchor_url +getdns_context_get_trust_anchor_verify_CA +getdns_context_get_trust_anchor_verify_email getdns_context_get_update_callback getdns_context_get_upstream_recursive_servers getdns_context_process_async @@ -67,6 +70,9 @@ getdns_context_set_tls_authentication getdns_context_set_tls_backoff_time getdns_context_set_tls_connection_retries getdns_context_set_tls_query_padding_blocksize +getdns_context_set_trust_anchor_url +getdns_context_set_trust_anchor_verify_CA +getdns_context_set_trust_anchor_verify_email getdns_context_set_update_callback getdns_context_set_upstream_recursive_servers getdns_context_set_use_threads diff --git a/src/test/tpkg/330-event-loops-unit-tests.tpkg/330-event-loops-unit-tests.test b/src/test/tpkg/330-event-loops-unit-tests.tpkg/330-event-loops-unit-tests.test index 31a7dd1f..d34f8e8a 100644 --- a/src/test/tpkg/330-event-loops-unit-tests.tpkg/330-event-loops-unit-tests.test +++ b/src/test/tpkg/330-event-loops-unit-tests.tpkg/330-event-loops-unit-tests.test @@ -11,4 +11,6 @@ then then exit 1 fi +else + exit 1 fi diff --git a/src/test/tpkg/run-all-lcov.sh b/src/test/tpkg/run-all-lcov.sh index 8a083980..38f4b51a 100755 --- a/src/test/tpkg/run-all-lcov.sh +++ b/src/test/tpkg/run-all-lcov.sh @@ -25,4 +25,4 @@ do done lcov $LCOV_MERGE -o run-all.info genhtml run-all.info --output-directory coverage-html -"${TPKG}" r +"${TPKG}" -n -1 r diff --git a/src/test/tpkg/run-all.sh b/src/test/tpkg/run-all.sh index 2c1a23f8..94a5623a 100755 --- a/src/test/tpkg/run-all.sh +++ b/src/test/tpkg/run-all.sh @@ -17,4 +17,4 @@ do # trap keyboard interrupt (control-c) trap control_c 2 done -"${TPKG}" r +"${TPKG}" -n -1 r diff --git a/src/test/tpkg/run-parallel.sh b/src/test/tpkg/run-parallel.sh index a3ef22e0..1bde085a 100755 --- a/src/test/tpkg/run-parallel.sh +++ b/src/test/tpkg/run-parallel.sh @@ -31,7 +31,7 @@ do fi done echo "${ALL}" >> Makefile -printf '\t"%s" r\n\n' "${TPKG}" >> Makefile +printf '\t"%s" -n -1 r\n\n' "${TPKG}" >> Makefile printf 'clean:\n\t"%s" clean\n\trm -fr build build-stub-only build-event-loops build-static-analysis install scan-build-reports .tpkg.var.master *.info\n\n' "${TPKG}" >> Makefile for P in ${OTHERS} do diff --git a/src/test/tpkg/tpkg b/src/test/tpkg/tpkg index 0eddaedb..3701b723 100755 --- a/src/test/tpkg/tpkg +++ b/src/test/tpkg/tpkg @@ -193,6 +193,8 @@ function usage() { out " -p PRI\tlog using PRI as priority" out " -k\t\tdon't remove test directory when creating/executing a tpkg package" out " -n NUM\tif less than NUM of the tests are passed exit with 1" + out " \t\tOtherwise exit with 0. When NUM is -1, no tests may fail" + out " \t\tOnly valid when running tpkg report" out " \t\tOtherwise exit with 0. Only valid when running tpkg report" out " -b DIR\tuse DIR is a base directory in stead of ." out " -a ARGS\tpass the string ARGS through to the test scripts" @@ -330,11 +332,12 @@ function report() { if [[ $passed -lt $TPKG_PASS ]]; then exit 1 fi - elif [[ $failed -gt 0 ]]; then - exit 1 - else - exit 0 + elif [[ $TPKG_PASS -lt 0 ]]; then + if [[ $failed -gt 0 ]]; then + exit 1 + fi fi + exit 0 } # clone test1 to test2