From: Miek Gieben Date: Wed, 31 Aug 2005 08:57:38 +0000 (+0000) Subject: exit changes X-Git-Tag: release-1.0.0~223 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fa25eec7c72a9118bcfd73011ffd1894554df2cf;p=thirdparty%2Fldns.git exit changes --- diff --git a/Changelog b/Changelog index 2f567bdc..bcec607b 100644 --- a/Changelog +++ b/Changelog @@ -1,8 +1,10 @@ -date : 0.71: ldns-team +XX Sep 2005: 0.80: ldns-team * License change: ldns is now BSD licensed * Networking code cleanup, added server udp/tcp support * Zonefile parsing was added - * Lua binding were created + * Lua binding were created + * [tools] Drill was added to ldns - see drill/ + * [tools] signer was added 28 Jul 2005: 0.70: ldns-team * [func] ldns_pkt_get_section now returns copies from the rrlists diff --git a/chaos.c b/chaos.c index 9932d316..ddf4d113 100644 --- a/chaos.c +++ b/chaos.c @@ -38,13 +38,13 @@ main(int argc, char *argv[]) if (argc != 2) { usage(stdout, argv[0]); - exit(1); + exit(EXIT_FAILURE); } else { /* create a rdf from the command line arg */ name = ldns_dname_new_frm_str(argv[1]); if (!name) { usage(stdout, argv[0]); - exit(1); + exit(EXIT_FAILURE); } } @@ -55,7 +55,7 @@ main(int argc, char *argv[]) /* create a new resolver from /etc/resolv.conf */ res = ldns_resolver_new_frm_file(NULL); if (!res) { - exit(1); + exit(EXIT_FAILURE); } ldns_resolver_set_retry(res, 1); /* don't want to wait too long */ @@ -63,7 +63,7 @@ main(int argc, char *argv[]) addr = ldns_get_rr_list_addr_by_name(res, name, LDNS_RR_CLASS_IN, LDNS_RD); if (!addr) { fprintf(stderr, " *** could not get an address for %s\n", argv[1]); - exit(1); + exit(EXIT_FAILURE); } remove_nameservers(res); @@ -112,6 +112,5 @@ main(int argc, char *argv[]) (void)ldns_resolver_pop_nameserver(res); } - exit(0); - return 0; + exit(EXIT_SUCCESS); } diff --git a/configure.ac b/configure.ac index 8c26cb50..97e8075f 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) -AC_INIT(libdns, 0.70, libdns@nlnetlabs.nl, libdns) +AC_INIT(libdns, 0.80, libdns@nlnetlabs.nl, libdns) AC_CONFIG_SRCDIR([packet.c]) OURCPPFLAGS='-ansi -pedantic -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600' diff --git a/drill/ChangeLog b/drill/ChangeLog index fef63ffe..1ce8b0b7 100644 --- a/drill/ChangeLog +++ b/drill/ChangeLog @@ -1,3 +1,9 @@ +--------- Drill now is a subdirectory in ldns. To make life easier +--------- we are using ldns' version numbering for drill from now on. +--------- Sadly this means we GO BACKWARDS in the versions +--------- This ChangeLog will not be updated anymore - all changes are +--------- documented in ldns' ChangeLog + 1.0-pre3: to be released: drill-team * Secure tracing works * Added section about DNSSEC in the manual page diff --git a/drill/README b/drill/README index 28ce1000..198a73cf 100644 --- a/drill/README +++ b/drill/README @@ -1,11 +1,15 @@ QUICK INSTALL GUIDE -* First install ldns - http://www.nlnetlabs.nl/ldns +drill is a subdirectory in ldns. - and follow the instructions +To compile drill you need: +autoreconf && ./configure --with-ldns=../ && make -* Now configure drill and compile it: - autoreconf && ./configure --with-ldns && make +when ldns isn't installed on the system, or: - or --with-ldns=, also see ./configure --help +autoreconf && ./configure --with-ldns && make + +when ldns is installed. Also see ./configure --help + +In the first case you must run drill as: +LD_LIBRARY_PATH=../.libs ./drill diff --git a/drill/configure.ac b/drill/configure.ac index dc6e95f7..8cfbb6ab 100644 --- a/drill/configure.ac +++ b/drill/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) -AC_INIT(drill, 1.0-pre3, drill@nlnetlabs.nl, drill1.0-pre) +AC_INIT(drill, 0.80, drill@nlnetlabs.nl, drill) AC_CONFIG_SRCDIR([drill_util.h]) AC_AIX diff --git a/keygen.c b/keygen.c index 970f597d..fe1dfd62 100644 --- a/keygen.c +++ b/keygen.c @@ -47,14 +47,14 @@ main(int argc, char *argv[]) case 'D': if (algorithm != 0) { fprintf(stderr, "%s: %s", prog, "Only one -D or -A is allowed\n"); - exit(1); + exit(EXIT_FAILURE); } algorithm = LDNS_SIGN_DSA; break; case 'R': if (algorithm != 0) { fprintf(stderr, "%s: %s", prog, "Only one -D or -A is allowed\n"); - exit(1); + exit(EXIT_FAILURE); } algorithm = LDNS_SIGN_RSASHA1; break; @@ -70,7 +70,7 @@ main(int argc, char *argv[]) break; default: usage(stderr, prog); - exit(1); + exit(EXIT_FAILURE); } } argc -= optind; @@ -82,7 +82,7 @@ main(int argc, char *argv[]) if (argc != 1) { usage(stderr, prog); - exit(1); + exit(EXIT_FAILURE); } /* create an rdf from the domain name */ @@ -107,5 +107,5 @@ main(int argc, char *argv[]) /* print the priv key to stderr */ ldns_key_print(stderr, key); - return 0; + exit(EXIT_SUCCESS); } diff --git a/mx.c b/mx.c index 355fdbd0..a4a8c8dc 100644 --- a/mx.c +++ b/mx.c @@ -31,13 +31,13 @@ main(int argc, char *argv[]) if (argc != 2) { usage(stdout, argv[0]); - exit(1); + exit(EXIT_FAILURE); } else { /* create a rdf from the command line arg */ domain = ldns_dname_new_frm_str(argv[1]); if (!domain) { usage(stdout, argv[0]); - exit(1); + exit(EXIT_FAILURE); } } @@ -45,7 +45,7 @@ main(int argc, char *argv[]) res = ldns_resolver_new_frm_file(NULL); if (!res) { - exit(1); + exit(EXIT_FAILURE); } /* use the resolver to send it a query for the mx @@ -56,7 +56,7 @@ main(int argc, char *argv[]) ldns_rdf_deep_free(domain); if (!p) { - exit(1); + exit(EXIT_FAILURE); } else { /* retrieve the MX records from the answer section of that * packet @@ -68,7 +68,7 @@ main(int argc, char *argv[]) argv[1], argv[1]); ldns_pkt_free(p); ldns_resolver_deep_free(res); - exit(1); + exit(EXIT_FAILURE); } else { /* sort the list nicely */ /* ldns_rr_list_sort(mx); */ diff --git a/signzone.c b/signzone.c index 20d5e1a2..8f0907d9 100644 --- a/signzone.c +++ b/signzone.c @@ -15,7 +15,7 @@ #define DATE_FORMAT "%Y%m%d%H%M%S" #define SHORT_DATE_FORMAT "%Y%m%d" -int +void usage(FILE *fp, const char *prog) { fprintf(fp, "%s [OPTIONS] \n", prog); fprintf(fp, " signs the zone with the given private key\n"); @@ -25,7 +25,6 @@ usage(FILE *fp, const char *prog) { fprintf(fp, "\t\t\tdates can be in YYYYMMDD[HHmmSS] format or timestamps\n"); fprintf(fp, " -o \t\torigin for the zone\n"); fprintf(fp, "keys and keysigning keys (-k option) can be given multiple times\n"); - return 0; } int @@ -110,12 +109,13 @@ main(int argc, char *argv[]) if (ldns_str2rdf_dname(&origin, optarg) != LDNS_STATUS_OK) { fprintf(stderr, "Bad origin, not a correct domain name\n"); usage(stderr, prog); - exit(1); + exit(EXIT_FAILURE); } break; default: - return usage(stderr, prog); + usage(stderr, prog); + exit(EXIT_SUCCESS); } } @@ -124,7 +124,7 @@ main(int argc, char *argv[]) if (argc < 2) { usage(stdout, prog); - exit(1); + exit(EXIT_FAILURE); } else { zonefile_name = argv[0]; } @@ -135,22 +135,22 @@ main(int argc, char *argv[]) if (!zonefile) { fprintf(stderr, "Error: unable to read %s (%s)\n", zonefile_name, strerror(errno)); - exit(1); + exit(EXIT_FAILURE); } else { orig_zone = ldns_zone_new_frm_fp_l(zonefile, origin, ttl, class, &line_nr); if (!orig_zone) { fprintf(stderr, "Zone not read, parse error at %s line %u\n", zonefile_name, line_nr); - exit(1); + exit(EXIT_FAILURE); } else { orig_soa = ldns_zone_soa(orig_zone); if (!orig_soa) { fprintf(stderr, "Error reading zonefile: missing SOA record\n"); - exit(1); + exit(EXIT_FAILURE); } orig_rrs = ldns_zone_rrs(orig_zone); if (!orig_rrs) { fprintf(stderr, "Error reading zonefile: no resource records\n"); - exit(1); + exit(EXIT_FAILURE); } } fclose(zonefile); @@ -199,7 +199,7 @@ main(int argc, char *argv[]) if (ldns_key_list_key_count(keys) < 1) { fprintf(stderr, "Error: no keys to sign with. Aborting.\n\n"); usage(stderr, prog); - return 1; + exit(EXIT_FAILURE); } /* read the KSKs */ @@ -240,6 +240,7 @@ main(int argc, char *argv[]) ldns_zone_deep_free(signed_zone); } else { fprintf(stderr, "Error signing zone."); + exit(EXIT_FAILURE); } ldns_key_list_free(keys); @@ -247,5 +248,5 @@ main(int argc, char *argv[]) ldns_zone_deep_free(orig_zone); LDNS_FREE(key_signing_key_filenames); - return 0; + exit(EXIT_SUCCESS); }