From ab476ab1543ea67f9c9d12f35116c194e9c3cfec Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Tue, 17 Jul 2012 12:44:11 +0000 Subject: [PATCH] bugfix #459: Export only symbols defined in ldns_symbols --- Changelog | 1 + Makefile.in | 2 +- examples/ldns-signzone.c | 12 ++++++++---- examples/ldns-verify-zone.c | 2 +- ldns/util.h.in | 2 ++ ldns_symbols.def | 30 ++++++++++++++++++++++++++++++ str2host.c | 2 +- util.c | 8 +++++++- 8 files changed, 51 insertions(+), 8 deletions(-) diff --git a/Changelog b/Changelog index e37c8e8f..fcb4833e 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 1.6.14 + * bugfix #459: Export only symbols defined in ldns_symbols * bugfix #458: Track all newly created signatures when signing. * bugfix #454: Don't set -g and -O2 CFLAGS from configure. * bugfix #457: Memroy leak fix for ldns_key_new_frm_algorithm. diff --git a/Makefile.in b/Makefile.in index dfe3f352..58e7d4fd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -201,7 +201,7 @@ lib: libldns.la lib-export-all: libldns.la-export-all libldns.la: $(LDNS_ALL_LOBJS) - $(LINK_LIB) $(LIBSSL_LDFLAGS) $(LIBSSL_LIBS) --export-symbols $(srcdir)/ldns_symbols.def -o libldns.la $(LDNS_ALL_LOBJS) -rpath $(libdir) $(RUNTIME_PATH) + $(LINK_LIB) $(LIBSSL_LDFLAGS) $(LIBSSL_LIBS) -export-symbols $(srcdir)/ldns_symbols.def -o libldns.la $(LDNS_ALL_LOBJS) -rpath $(libdir) $(RUNTIME_PATH) libldns.la-export-all: $(LDNS_ALL_LOBJS) $(LINK_LIB) -o libldns.la $(LDNS_ALL_LOBJS) -rpath $(libdir) $(RUNTIME_PATH) diff --git a/examples/ldns-signzone.c b/examples/ldns-signzone.c index 5c9ef99b..34615039 100644 --- a/examples/ldns-signzone.c +++ b/examples/ldns-signzone.c @@ -411,14 +411,16 @@ main(int argc, char *argv[]) tm.tm_year -= 1900; tm.tm_mon--; check_tm(tm); - expiration = (uint32_t) mktime_from_utc(&tm); + expiration = + (uint32_t) ldns_mktime_from_utc(&tm); } else if (strlen(optarg) == 14 && sscanf(optarg, "%4d%2d%2d%2d%2d%2d", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec) ) { tm.tm_year -= 1900; tm.tm_mon--; check_tm(tm); - expiration = (uint32_t) mktime_from_utc(&tm); + expiration = + (uint32_t) ldns_mktime_from_utc(&tm); } else { expiration = (uint32_t) atol(optarg); } @@ -436,14 +438,16 @@ main(int argc, char *argv[]) tm.tm_year -= 1900; tm.tm_mon--; check_tm(tm); - inception = (uint32_t) mktime_from_utc(&tm); + inception = + (uint32_t) ldns_mktime_from_utc(&tm); } else if (strlen(optarg) == 14 && sscanf(optarg, "%4d%2d%2d%2d%2d%2d", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec) ) { tm.tm_year -= 1900; tm.tm_mon--; check_tm(tm); - inception = (uint32_t) mktime_from_utc(&tm); + inception = + (uint32_t) ldns_mktime_from_utc(&tm); } else { inception = (uint32_t) atol(optarg); } diff --git a/examples/ldns-verify-zone.c b/examples/ldns-verify-zone.c index 1dd9aaea..bfdf6452 100644 --- a/examples/ldns-verify-zone.c +++ b/examples/ldns-verify-zone.c @@ -838,7 +838,7 @@ main(int argc, char **argv) tm.tm_year -= 1900; tm.tm_mon--; - check_time = mktime_from_utc(&tm); + check_time = ldns_mktime_from_utc(&tm); } else { check_time += atoi(optarg); diff --git a/ldns/util.h.in b/ldns/util.h.in index f9fb1042..fe4ff372 100644 --- a/ldns/util.h.in +++ b/ldns/util.h.in @@ -268,6 +268,8 @@ const char * ldns_version(void); * \param[in] tm a struct tm* with the date * \return the seconds since epoch */ +time_t ldns_mktime_from_utc(const struct tm *tm); + time_t mktime_from_utc(const struct tm *tm); /** diff --git a/ldns_symbols.def b/ldns_symbols.def index 9a1fe72b..1b37841e 100644 --- a/ldns_symbols.def +++ b/ldns_symbols.def @@ -140,6 +140,7 @@ ldns_dnssec_trust_tree_print_sm ldns_dnssec_trust_tree_print_sm_fmt ldns_dnssec_verify_denial ldns_dnssec_verify_denial_nsec3 +ldns_dnssec_verify_denial_nsec3_match ldns_dnssec_zone_add_empty_nonterminals ldns_dnssec_zone_add_rr ldns_dnssec_zone_create_nsec3s @@ -165,6 +166,12 @@ ldns_dnssec_zone_sign_flg ldns_dnssec_zone_sign_nsec3 ldns_dnssec_zone_sign_nsec3_flg ldns_dnssec_zone_sign_nsec3_flg_mkmap +ldns_duration2string +ldns_duration2time +ldns_duration_cleanup +ldns_duration_compare +ldns_duration_create +ldns_duration_create_from_string ldns_ecdsa2pkey_raw ldns_edns_flags ldns_error_str @@ -262,6 +269,7 @@ ldns_key_set_use ldns_key_use ldns_lookup_by_id ldns_lookup_by_name +ldns_mktime_from_utc ldns_native2rdf_int16 ldns_native2rdf_int16_data ldns_native2rdf_int32 @@ -284,6 +292,10 @@ ldns_nsec_get_bitmap ldns_nsec_type_check ldns_octet ldns_opcodes +ldns_output_format_bubblebabble +ldns_output_format_default +ldns_output_format_nocomments +ldns_output_format_onlykeyids ldns_pkt2buffer_str ldns_pkt2buffer_str_fmt ldns_pkt2buffer_wire @@ -408,6 +420,7 @@ ldns_rdf2buffer_str_a ldns_rdf2buffer_str_aaaa ldns_rdf2buffer_str_alg ldns_rdf2buffer_str_apl +ldns_rdf2buffer_str_atma ldns_rdf2buffer_str_b32_ext ldns_rdf2buffer_str_b64 ldns_rdf2buffer_str_cert_alg @@ -572,6 +585,7 @@ ldns_rr_dnskey_set_protocol ldns_rr_free ldns_rr_get_class ldns_rr_get_type +ldns_rr_is_question ldns_rr_label_count ldns_rr_list2buffer_str ldns_rr_list2buffer_str_fmt @@ -617,6 +631,7 @@ ldns_rr_pop_rdf ldns_rr_print ldns_rr_print_fmt ldns_rr_push_rdf +ldns_rr_set_question ldns_rr_rdata2buffer_wire ldns_rr_rd_count ldns_rr_rdf @@ -664,6 +679,18 @@ ldns_sha1_final ldns_sha1_init ldns_sha1_transform ldns_sha1_update +ldns_sha256 +ldns_sha256_final +ldns_sha256_init +ldns_sha256_update +ldns_sha384 +ldns_sha384_final +ldns_sha384_init +ldns_sha384_update +ldns_sha512 +ldns_sha512_final +ldns_sha512_init +ldns_sha512_update ldns_signing_algorithms ldns_sign_public ldns_sign_public_buffer @@ -682,6 +709,7 @@ ldns_str2rdf_a ldns_str2rdf_aaaa ldns_str2rdf_alg ldns_str2rdf_apl +ldns_str2rdf_atma ldns_str2rdf_b32_ext ldns_str2rdf_b64 ldns_str2rdf_cert_alg @@ -691,6 +719,7 @@ ldns_str2rdf_hex ldns_str2rdf_int16 ldns_str2rdf_int32 ldns_str2rdf_int8 +ldns_str2rdf_ipseckey ldns_str2rdf_loc ldns_str2rdf_nsap ldns_str2rdf_nsec @@ -783,3 +812,4 @@ ldns_zone_sign_nsec3 ldns_zone_soa ldns_zone_sort ldns_zone_strip_glue_rrs +mktime_from_utc diff --git a/str2host.c b/str2host.c index 2783f080..3553c0d5 100644 --- a/str2host.c +++ b/str2host.c @@ -96,7 +96,7 @@ ldns_str2rdf_time(ldns_rdf **rd, const char *time) goto bad_format; } - l = htonl(mktime_from_utc(&tm)); + l = htonl(ldns_mktime_from_utc(&tm)); memcpy(r, &l, sizeof(uint32_t)); *rd = ldns_rdf_new_frm_data( LDNS_RDF_TYPE_TIME, sizeof(uint32_t), r); diff --git a/util.c b/util.c index a7ab9608..475d2326 100644 --- a/util.c +++ b/util.c @@ -227,7 +227,7 @@ leap_days(int y1, int y2) * Code adapted from Python 2.4.1 sources (Lib/calendar.py). */ time_t -mktime_from_utc(const struct tm *tm) +ldns_mktime_from_utc(const struct tm *tm) { int year = 1900 + tm->tm_year; time_t days = 365 * ((time_t) year - 1970) + leap_days(1970, year); @@ -251,6 +251,12 @@ mktime_from_utc(const struct tm *tm) return seconds; } +time_t +mktime_from_utc(const struct tm *tm) +{ + return ldns_mktime_from_utc(tm); +} + #if SIZEOF_TIME_T <= 4 static void -- 2.47.3