Skip to content
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.

Commit

Permalink
Imported Upstream version 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Jackson authored and lucab committed Jul 2, 2009
1 parent 989de9a commit fb9afae
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 39 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -23,7 +23,7 @@

# Remember to change ADNS_VERSION_STRING in client/client.h too, and
# possibly library soname (MAJOR and MINOR in settings.make.in).
DISTVERSION= 1.2
DISTVERSION= 1.3

srcdir= .

Expand Down
2 changes: 1 addition & 1 deletion Makefile.in
Expand Up @@ -22,7 +22,7 @@

# Remember to change ADNS_VERSION_STRING in client/client.h too, and
# possibly library soname (MAJOR and MINOR in settings.make.in).
DISTVERSION= 1.2
DISTVERSION= 1.3

srcdir= @srcdir@
VPATH= @srcdir@
Expand Down
18 changes: 18 additions & 0 deletions changelog
@@ -1,3 +1,21 @@
adns (1.3); urgency=low

Portability fixes:
* Cast ptrdiff_t to int for %.*s length in adnsheloex and adnslogres,
as is required. (Report from Jim Meyering.)
* In configure.in, quote macro name argument to define() to
suppress spurious autoconf error. (Report from Mihai Ibanescu.)
* Use autoconf's values for {bin,lib,include}dir rather than inventing
our own from @exec_prefix@, making configure --libdir work.
(Patch from Mihai Ibanescu.)
* Remove spurious `_' from {bin,lib,include}dir Makefile variables.
(Report from Mihai Ibanescu.)
* Do away with `mismatch' variable in parse.c:adns__findrr_anychk so that
overzealous GCC cannot complain about members of eo_fls being
uninitialised. (Report from Jim Meyering.)

-- Ian Jackson <ian@davenant.greenend.org.uk> Tue, 6 Jun 2006 20:22:30 +0100

adns (1.2); urgency=medium

New features:
Expand Down
6 changes: 3 additions & 3 deletions client/Makefile.in
Expand Up @@ -58,12 +58,12 @@ ADNSDIR= $(srcdir)/../src/
all: $(TARGETS)

install: $(TARG_INSTALL)
mkdir -p $(bin_dir)
mkdir -p $(bindir)
set -xe; for f in $(TARG_INSTALL); \
do $(INSTALL_PROGRAM) $$f $(bin_dir)/$$f; done
do $(INSTALL_PROGRAM) $$f $(bindir)/$$f; done

uninstall:
for f in $(TARGETS); do rm -f $(bin_dir)/$$f; done
for f in $(TARGETS); do rm -f $(bindir)/$$f; done

adnshost: $(ADH_OBJS) $(DYNAMIC_DEP)
$(CC) $(LDFLAGS) $(ADH_OBJS) $(DYNAMIC_LINK) -o $@ $(LDLIBS)
Expand Down
6 changes: 3 additions & 3 deletions client/adnsheloex.c
Expand Up @@ -30,7 +30,7 @@
*/

static const char * const cvsid =
"$Id: adnsheloex.c,v 1.2 2006/04/08 14:36:57 ian Exp $";
"$Id: adnsheloex.c,v 1.3 2006/05/09 19:37:58 ian Exp $";

#include <sys/types.h>
#include <sys/socket.h>
Expand Down Expand Up @@ -168,7 +168,7 @@ static void proclog(FILE *inf, FILE *outf, int maxpending, int opts) {
if (head->query) {
if (opts & OPT_DEBUG)
msg("%d in queue; checking %.*s", len,
head->rest-head->name, guard_null(head->name));
(int)(head->rest-head->name), guard_null(head->name));
if (eof || len >= maxpending) {
if (opts & OPT_POLL)
err= adns_wait_poll(adns, &head->query, &answer, NULL);
Expand All @@ -185,7 +185,7 @@ static void proclog(FILE *inf, FILE *outf, int maxpending, int opts) {
if (answer->status == adns_s_ok) {
const char *addr;
int ok = 0;
fprintf(outf, "%.*s", head->rest-head->start, head->start);
fprintf(outf, "%.*s", (int)(head->rest-head->start), head->start);
while(answer->nrrs--) {
addr= inet_ntoa(answer->rrs.inaddr[answer->nrrs]);
ok |= !strncmp(addr, head->addr, strlen(addr));
Expand Down
6 changes: 3 additions & 3 deletions client/adnslogres.c
Expand Up @@ -33,7 +33,7 @@
*/

static const char * const cvsid =
"$Id: adnslogres.c,v 1.22 2006/04/08 14:36:57 ian Exp $";
"$Id: adnslogres.c,v 1.23 2006/05/09 19:37:58 ian Exp $";

#include <sys/types.h>
#include <sys/time.h>
Expand Down Expand Up @@ -154,7 +154,7 @@ static logline *readline(FILE *inf, adns_state adns, int opts) {
strcpy(line->start, buf);
str= ipaddr2domain(line->start, &line->addr, &line->rest);
if (opts & OPT_DEBUG)
msg("submitting %.*s -> %s", line->rest-line->addr, guard_null(line->addr), str);
msg("submitting %.*s -> %s", (int)(line->rest-line->addr), guard_null(line->addr), str);
if (adns_submit(adns, str, adns_r_ptr,
adns_qf_quoteok_cname|adns_qf_cname_loose,
NULL, &line->query))
Expand Down Expand Up @@ -186,7 +186,7 @@ static void proclog(FILE *inf, FILE *outf, int maxpending, int opts) {
while (head) {
if (opts & OPT_DEBUG)
msg("%d in queue; checking %.*s", len,
head->rest-head->addr, guard_null(head->addr));
(int)(head->rest-head->addr), guard_null(head->addr));
if (eof || len >= maxpending) {
if (opts & OPT_POLL)
err= adns_wait_poll(adns, &head->query, &answer, NULL);
Expand Down
2 changes: 0 additions & 2 deletions client/x.gdb

This file was deleted.

2 changes: 1 addition & 1 deletion configure.in
Expand Up @@ -24,7 +24,7 @@ AC_INIT(src/adns.h)
AC_CONFIG_HEADER(src/config.h)

dnl DPKG_CACHED_TRY_COMPILE(<description>,<cachevar>,<include>,<program>,<ifyes>,<ifno>)
define(DPKG_CACHED_TRY_COMPILE,[
define([DPKG_CACHED_TRY_COMPILE],[
AC_MSG_CHECKING($1)
AC_CACHE_VAL($2,[
AC_TRY_COMPILE([$3],[$4],[$2=yes],[$2=no])
Expand Down
10 changes: 5 additions & 5 deletions dynamic/Makefile.in
Expand Up @@ -30,13 +30,13 @@ include $(srcdir)/../src/adns.make
ALLOBJS= $(addsuffix _p.o, $(basename $(LIBOBJS)))

install:
mkdir -p $(lib_dir)
$(INSTALL_PROGRAM) $(SHLIBFILE) $(lib_dir)/$(SHLIBFILE)
ln -sf $(SHLIBFILE) $(lib_dir)/$(SHLIBSONAME)
ln -sf $(SHLIBSONAME) $(lib_dir)/$(SHLIBFORLINK)
mkdir -p $(libdir)
$(INSTALL_PROGRAM) $(SHLIBFILE) $(libdir)/$(SHLIBFILE)
ln -sf $(SHLIBFILE) $(libdir)/$(SHLIBSONAME)
ln -sf $(SHLIBSONAME) $(libdir)/$(SHLIBFORLINK)

uninstall:
rm -f $(lib_dir)/$(SHLIBFILE) $(lib_dir)/$(SHLIBSONAME)
rm -f $(libdir)/$(SHLIBFILE) $(libdir)/$(SHLIBSONAME)

$(SHLIBFORLINK):
ln -s $(SHLIBSONAME) $(SHLIBFORLINK)
Expand Down
8 changes: 4 additions & 4 deletions settings.make.in
Expand Up @@ -22,7 +22,7 @@
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

MAJOR= 1
MINOR= 2
MINOR= 3
SHLIBFILE= @SHLIBFILE@
SHLIBSONAME= @SHLIBSONAME@
SHLIBFORLINK= @SHLIBFORLINK@
Expand All @@ -47,9 +47,9 @@ MKSHLIB_3= @MKSHLIB_3@

prefix= @prefix@
exec_prefix= @exec_prefix@
bin_dir= $(exec_prefix)/bin
lib_dir= $(exec_prefix)/lib
include_dir= $(prefix)/include
bindir= @bindir@
libdir= @libdir@
includedir= @includedir@

AC_INSTALL= @INSTALL@
ifeq ($(AC_INSTALL),./install-sh -c)
Expand Down
10 changes: 5 additions & 5 deletions src/Makefile.in
Expand Up @@ -28,14 +28,14 @@ include $(srcdir)/../settings.make
include adns.make

install:
mkdir -p $(lib_dir) $(include_dir)
mkdir -p $(libdir) $(includedir)
set -xe; for f in $(TARGETS); \
do $(INSTALL_DATA) $$f $(lib_dir)/$$f; done
$(INSTALL_DATA) $(srcdir)/../src/adns.h $(include_dir)/adns.h
do $(INSTALL_DATA) $$f $(libdir)/$$f; done
$(INSTALL_DATA) $(srcdir)/../src/adns.h $(includedir)/adns.h

uninstall:
for f in $(TARGETS); do rm -f $(lib_dir)/$$f; done
rm -f $(include_dir)/adns.h
for f in $(TARGETS); do rm -f $(libdir)/$$f; done
rm -f $(includedir)/adns.h

ALLOBJS= $(LIBOBJS)

Expand Down
23 changes: 12 additions & 11 deletions src/parse.c
Expand Up @@ -168,10 +168,11 @@ adns_status adns__findrr_anychk(adns_query qu, int serv,
int *rdlen_r, int *rdstart_r,
const byte *eo_dgram, int eo_dglen,
int eo_cbyte, int *eo_matched_r) {
findlabel_state fls, eo_fls;
findlabel_state fls, eo_fls_buf;
findlabel_state *eo_fls; /* 0 iff we know it's not matching eo_... */
int cbyte;

int tmp, rdlen, mismatch;
int tmp, rdlen;
unsigned long ttl;
int lablen, labstart, ch;
int eo_lablen, eo_labstart, eo_ch;
Expand All @@ -181,31 +182,31 @@ adns_status adns__findrr_anychk(adns_query qu, int serv,

adns__findlabel_start(&fls,qu->ads, serv,qu, dgram,dglen,dglen,cbyte,&cbyte);
if (eo_dgram) {
adns__findlabel_start(&eo_fls,qu->ads, -1,0,
eo_fls= &eo_fls_buf;
adns__findlabel_start(eo_fls,qu->ads, -1,0,
eo_dgram,eo_dglen,eo_dglen,eo_cbyte,0);
mismatch= 0;
} else {
mismatch= 1;
eo_fls= 0;
}

for (;;) {
st= adns__findlabel_next(&fls,&lablen,&labstart);
if (st) return st;
if (lablen<0) goto x_truncated;

if (!mismatch) {
st= adns__findlabel_next(&eo_fls,&eo_lablen,&eo_labstart);
if (eo_fls) {
st= adns__findlabel_next(eo_fls,&eo_lablen,&eo_labstart);
assert(!st); assert(eo_lablen>=0);
if (lablen != eo_lablen) mismatch= 1;
while (!mismatch && eo_lablen-- > 0) {
if (lablen != eo_lablen) eo_fls= 0;
while (eo_fls && eo_lablen-- > 0) {
ch= dgram[labstart++]; if (ctype_alpha(ch)) ch &= ~32;
eo_ch= eo_dgram[eo_labstart++]; if (ctype_alpha(eo_ch)) eo_ch &= ~32;
if (ch != eo_ch) mismatch= 1;
if (ch != eo_ch) eo_fls= 0;
}
}
if (!lablen) break;
}
if (eo_matched_r) *eo_matched_r= !mismatch;
if (eo_matched_r) *eo_matched_r= !!eo_fls;

if (cbyte+10>dglen) goto x_truncated;
GET_W(cbyte,tmp); *type_r= tmp;
Expand Down

0 comments on commit fb9afae

Please sign in to comment.