diff options
author | Peter Wemm <peter@FreeBSD.org> | 1995-08-20 22:32:57 +0000 |
---|---|---|
committer | Peter Wemm <peter@FreeBSD.org> | 1995-08-20 22:32:57 +0000 |
commit | 6bc227b4052c3ed894cc99b3abd2db4245118bf8 (patch) | |
tree | 2677989c4b0a8dc94ed90d8738113633ef16ed13 /usr.bin/host | |
parent | 2c5c94781c08a495abfbee9d6959d85f12919f27 (diff) | |
download | src-6bc227b4052c3ed894cc99b3abd2db4245118bf8.tar.gz src-6bc227b4052c3ed894cc99b3abd2db4245118bf8.zip |
Update the DNS tools from 4.9.3-b9 -> 4.9.3-b24
Notes
Notes:
svn path=/head/; revision=10144
Diffstat (limited to 'usr.bin/host')
-rw-r--r-- | usr.bin/host/host.c | 48 |
1 files changed, 29 insertions, 19 deletions
diff --git a/usr.bin/host/host.c b/usr.bin/host/host.c index 8a138783a6d1..22839c3b76d4 100644 --- a/usr.bin/host/host.c +++ b/usr.bin/host/host.c @@ -67,7 +67,7 @@ char copyright[] = */ #ifndef lint -static char rcsid[] = "$Id: host.c,v 1.2 1994/09/22 21:52:03 pst Exp $"; +static char rcsid[] = "$Id: host.c,v 1.3 1995/05/30 06:30:50 rgrimes Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -360,10 +360,10 @@ printanswer(hp) printf("\n\n"); } -hperror(errno) -int errno; +hperror(errnum) +int errnum; { -switch(errno) { +switch(errnum) { case HOST_NOT_FOUND: fprintf(stderr,"Host not found.\n"); break; @@ -459,7 +459,7 @@ gethostinfo(name) char *name; { register char *cp, **domain; - int n; + u_int n; int hp; int nDomain; int asis = 0; @@ -765,15 +765,20 @@ pr_rr(cp, msg, file, filter) case T_HINFO: case T_ISDN: - if (n = *cp++) { - if (doprint) - fprintf(file,"%c%.*s", punc, n, cp); - cp += n; - } - if (n = *cp++) { - if (doprint) - fprintf(file,"%c%.*s", punc, n, cp); - cp += n; + { + u_char *cp2 = cp + dlen; + if (n = *cp++) { + if (doprint) + fprintf(file,"%c%.*s", punc, n, cp); + cp += n; + } + if ((cp < cp2) && (n = *cp++)) { + if (doprint) + fprintf(file,"%c%.*s", punc, n, cp); + cp += n; + } else if (type == T_HINFO) + if (doprint) + fprintf(file,"\n; *** Warning *** OS-type missing"); } break; @@ -805,10 +810,13 @@ pr_rr(cp, msg, file, filter) case T_AFSDB: case T_RT: if (doprint) - if (verbose) - fprintf(file,"\t%ld ",_getshort(cp)); + if (type == T_MX) + fprintf(file," (pri=%d) by ", _getshort(cp)); else - fprintf(file," "); + if (verbose) + fprintf(file,"\t%d ", _getshort(cp)); + else + fprintf(file," "); cp += sizeof(u_short); cp = (u_char *)pr_cdname(cp, msg, name, sizeof(name)); if (doprint) @@ -842,7 +850,7 @@ pr_rr(cp, msg, file, filter) while (cp < end) { if (n = *cp++) { for (j = n; j > 0 && cp < end ; j --) - if (*cp == '\n') { + if ((*cp == '\n') || (*cp == '"')) { if (doprint){ (void) putc('\\', file); (void) putc(*cp++, file); @@ -947,7 +955,7 @@ pr_type(type) case T_MG: /* mail group member */ return("MG"); case T_MX: /* mail routing info */ - return(verbose? "MX" : "mail is handled by"); + return(verbose? "MX" : "mail is handled"); case T_TXT: /* TXT - descriptive info */ return(verbose? "TXT" : "descriptive text"); case T_AFSDB: /* AFS/DCE info */ @@ -1447,7 +1455,9 @@ DecodeError(result) case NXDOMAIN: return("Non-existent domain"); break; case NOTIMP: return("Not implemented"); break; case REFUSED: return("Query refused"); break; +#ifdef NOCHANGE case NOCHANGE: return("No change"); break; +#endif case NO_INFO: return("No information"); break; case ERROR: return("Unspecified error"); break; case TIME_OUT: return("Timed out"); break; |