Resolve conflicts, generally in favor of the vendor version.

This commit is contained in:
Doug Barton 2002-07-01 01:20:28 +00:00
parent cc893dce92
commit 16f43f04f8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=99188
7 changed files with 91 additions and 79 deletions

View File

@ -131,7 +131,7 @@ char copyright[] =
#if !defined(lint) && !defined(SABER) #if !defined(lint) && !defined(SABER)
static const char sccsid[] = "@(#)named-xfer.c 4.18 (Berkeley) 3/7/91"; static const char sccsid[] = "@(#)named-xfer.c 4.18 (Berkeley) 3/7/91";
static const char rcsid[] = "$Id: named-xfer.c,v 8.120 2002/01/29 06:54:52 marka Exp $"; static const char rcsid[] = "$Id: named-xfer.c,v 8.121 2002/06/26 03:27:22 marka Exp $";
#endif /* not lint */ #endif /* not lint */
#include "port_before.h" #include "port_before.h"
@ -751,6 +751,7 @@ main(int argc, char *argv[]) {
default: default:
result = XFER_FAIL; result = XFER_FAIL;
/* fall through */ /* fall through */
case XFER_REFUSED:
case XFER_TIMEOUT: case XFER_TIMEOUT:
case XFER_FAIL: case XFER_FAIL:
(void) unlink(tmpname); (void) unlink(tmpname);
@ -1068,6 +1069,7 @@ getzone(struct zoneinfo *zp, u_int32_t serial_no, int port) {
u_int32_t query_serial = serial_no; u_int32_t query_serial = serial_no;
int first_soa_printed; int first_soa_printed;
struct in_addr z_axfr_src; struct in_addr z_axfr_src;
int refused = 0;
#ifdef DEBUG #ifdef DEBUG
if (debug) { if (debug) {
@ -1631,6 +1633,7 @@ getzone(struct zoneinfo *zp, u_int32_t serial_no, int port) {
my_addr_text, my_addr_text,
inet_ntoa(sin.sin_addr), inet_ntoa(sin.sin_addr),
zp->z_origin); zp->z_origin);
refused = 1;
} else { } else {
syslog(LOG_INFO, syslog(LOG_INFO,
"[%s] record too short from [%s], zone %s\n", "[%s] record too short from [%s], zone %s\n",
@ -1913,6 +1916,7 @@ getzone(struct zoneinfo *zp, u_int32_t serial_no, int port) {
my_addr_text, my_addr_text,
inet_ntoa(sin.sin_addr), inet_ntoa(sin.sin_addr),
zp->z_origin); zp->z_origin);
refused = 1;
} else { } else {
syslog(LOG_INFO, syslog(LOG_INFO,
"[%s] record too short from [%s], zone %s\n", "[%s] record too short from [%s], zone %s\n",
@ -1952,6 +1956,8 @@ getzone(struct zoneinfo *zp, u_int32_t serial_no, int port) {
} }
if (!error) if (!error)
return (XFER_TIMEOUT); return (XFER_TIMEOUT);
if (refused)
return (XFER_REFUSED);
return (XFER_FAIL); return (XFER_FAIL);
} }

View File

@ -172,11 +172,11 @@ NAME [:A-Za-z0-9.*=_/-]
* 1 == use original server to find * 1 == use original server to find
* the new one. * the new one.
*/ */
SetDefaultServer(yytext, 0); SetDefaultServer((char*)yytext, 0);
return(1); return(1);
} }
^{WS}*lserver{WS}+{LET}{NAME}*{WS}*$ { ^{WS}*lserver{WS}+{LET}{NAME}*{WS}*$ {
SetDefaultServer(yytext, 1); SetDefaultServer((char*)yytext, 1);
return(1); return(1);
} }
^{WS}*exit{WS}*$ { ^{WS}*exit{WS}*$ {
@ -192,11 +192,11 @@ NAME [:A-Za-z0-9.*=_/-]
* 0 == output to stdout * 0 == output to stdout
* 1 == output to file * 1 == output to file
*/ */
Finger(yytext, 1); Finger((char*)yytext, 1);
return(1); return(1);
} }
^{WS}*finger({WS}+{LET}{NAME}*)?{WS}*$ { ^{WS}*finger({WS}+{LET}{NAME}*)?{WS}*$ {
Finger(yytext, 0); Finger((char*)yytext, 0);
return(1); return(1);
} }
^{WS}*ls{WS}+(("-a"|"-d"|"-h"|"-m"|"-s"){WS}+)?{LET}{NAME}*{WS}+>>?{WS}+{NAME}+{WS}*$ { ^{WS}*ls{WS}+(("-a"|"-d"|"-h"|"-m"|"-s"){WS}+)?{LET}{NAME}*{WS}+>>?{WS}+{NAME}+{WS}*$ {
@ -205,11 +205,11 @@ NAME [:A-Za-z0-9.*=_/-]
* 0 == output to stdout * 0 == output to stdout
* 1 == output to file * 1 == output to file
*/ */
ListHosts(yytext, 1); ListHosts((char*)yytext, 1);
return(1); return(1);
} }
^{WS}*ls{WS}+(("-a"|"-d"|"-h"|"-m"|"-s"){WS}+)?{LET}{NAME}*{WS}*$ { ^{WS}*ls{WS}+(("-a"|"-d"|"-h"|"-m"|"-s"){WS}+)?{LET}{NAME}*{WS}*$ {
ListHosts(yytext, 0); ListHosts((char*)yytext, 0);
return(1); return(1);
} }
^{WS}*ls{WS}+-t{WS}+({LET}{NAME}*{WS}+)?{LET}{NAME}*{WS}+>>?{WS}+{NAME}+{WS}*$ { ^{WS}*ls{WS}+-t{WS}+({LET}{NAME}*{WS}+)?{LET}{NAME}*{WS}+>>?{WS}+{NAME}+{WS}*$ {
@ -218,15 +218,15 @@ NAME [:A-Za-z0-9.*=_/-]
* 0 == output to stdout * 0 == output to stdout
* 1 == output to file * 1 == output to file
*/ */
ListHostsByType(yytext, 1); ListHostsByType((char*)yytext, 1);
return(1); return(1);
} }
^{WS}*ls{WS}+-t{WS}+({LET}{NAME}*{WS}+)?{LET}{NAME}*{WS}*$ { ^{WS}*ls{WS}+-t{WS}+({LET}{NAME}*{WS}+)?{LET}{NAME}*{WS}*$ {
ListHostsByType(yytext, 0); ListHostsByType((char*)yytext, 0);
return(1); return(1);
} }
^{WS}*set{WS}+{NAME}+{WS}*$ { ^{WS}*set{WS}+{NAME}+{WS}*$ {
SetOption(yytext); SetOption((char*)yytext);
return(1); return(1);
} }
^{WS}*help{WS}*$ { ^{WS}*help{WS}*$ {
@ -244,11 +244,11 @@ NAME [:A-Za-z0-9.*=_/-]
* 0 == output to stdout * 0 == output to stdout
* 1 == output to file * 1 == output to file
*/ */
LookupHost(yytext, 1); LookupHost((char*)yytext, 1);
return(1); return(1);
} }
^{WS}*{FLET}{NAME}*{WS}*$ { ^{WS}*{FLET}{NAME}*{WS}*$ {
LookupHost(yytext, 0); LookupHost((char*)yytext, 0);
return(1); return(1);
} }
^{WS}*{FLET}{NAME}*{WS}+{LET}{NAME}*{WS}+>>?{WS}*{NAME}+{WS}*$ { ^{WS}*{FLET}{NAME}*{WS}+{LET}{NAME}*{WS}+>>?{WS}*{NAME}+{WS}*$ {
@ -256,11 +256,11 @@ NAME [:A-Za-z0-9.*=_/-]
* 0 == output to stdout * 0 == output to stdout
* 1 == output to file * 1 == output to file
*/ */
LookupHostWithServer(yytext, 1); LookupHostWithServer((char*)yytext, 1);
return(1); return(1);
} }
^{WS}*{FLET}{NAME}*{WS}+{LET}{NAME}*{WS}*$ { ^{WS}*{FLET}{NAME}*{WS}+{LET}{NAME}*{WS}*$ {
LookupHostWithServer(yytext, 0); LookupHostWithServer((char*)yytext, 0);
return(1); return(1);
} }
^{WS}*\n { ^{WS}*\n {
@ -268,7 +268,7 @@ NAME [:A-Za-z0-9.*=_/-]
} }
^.*\n { ^.*\n {
printf("Unrecognized command: %s", printf("Unrecognized command: %s",
yytext); (char*)yytext);
return(1); return(1);
} }
\n { ; } \n { ; }

View File

@ -54,7 +54,7 @@
#ifndef lint #ifndef lint
static const char sccsid[] = "@(#)getinfo.c 5.26 (Berkeley) 3/21/91"; static const char sccsid[] = "@(#)getinfo.c 5.26 (Berkeley) 3/21/91";
static const char rcsid[] = "$Id: getinfo.c,v 8.23 2002/04/29 01:11:52 marka Exp $"; static const char rcsid[] = "$Id: getinfo.c,v 8.27 2002/05/22 04:06:57 marka Exp $";
#endif /* not lint */ #endif /* not lint */
/* /*
@ -142,16 +142,9 @@ typedef union {
*/ */
static int static int
GetAnswer(nsAddrPtr, queryType, msg, msglen, iquery, hostPtr, isServer, GetAnswer(union res_sockaddr_union *nsAddrPtr, int queryType,
merge) char *msg, int msglen, Boolean iquery, HostInfo *hostPtr,
union res_sockaddr_union *nsAddrPtr; Boolean isServer, Boolean merge)
char *msg;
int queryType;
int msglen;
Boolean iquery;
register HostInfo *hostPtr;
Boolean isServer;
Boolean merge;
{ {
register HEADER *headerPtr; register HEADER *headerPtr;
register const u_char *cp; register const u_char *cp;
@ -253,7 +246,8 @@ GetAnswer(nsAddrPtr, queryType, msg, msglen, iquery, hostPtr, isServer,
printf("Non-authoritative answer:\n"); printf("Non-authoritative answer:\n");
} }
if (queryType != T_A && !(iquery && queryType == T_PTR)) { if (queryType != T_A && queryType != T_AAAA && /* A6? */
!(iquery && queryType == T_PTR)) {
while (--ancount >= 0 && cp < eom) { while (--ancount >= 0 && cp < eom) {
if ((cp = Print_rr(cp, (u_char *)&answer, if ((cp = Print_rr(cp, (u_char *)&answer,
eom, stdout)) == NULL) { eom, stdout)) == NULL) {
@ -360,7 +354,8 @@ GetAnswer(nsAddrPtr, queryType, msg, msglen, iquery, hostPtr, isServer,
} }
} }
if ((queryType == T_A || queryType == T_PTR) && haveAnswer) { if ((queryType == T_A || queryType == T_AAAA || queryType == T_PTR) &&
haveAnswer) {
/* /*
* Go through the alias and address lists and return them * Go through the alias and address lists and return them
@ -540,7 +535,7 @@ GetAnswer(nsAddrPtr, queryType, msg, msglen, iquery, hostPtr, isServer,
*/ */
cp = res_skip((u_char*)&answer, 3, eom); cp = res_skip((u_char*)&answer, 3, eom);
if (queryType != T_A) { if (queryType != T_A && queryType != T_AAAA) {
/* /*
* If we don't need to save the record, just print it. * If we don't need to save the record, just print it.
*/ */

View File

@ -78,7 +78,7 @@ char copyright[] =
#ifndef lint #ifndef lint
static const char sccsid[] = "@(#)main.c 5.42 (Berkeley) 3/3/91"; static const char sccsid[] = "@(#)main.c 5.42 (Berkeley) 3/3/91";
static const char rcsid[] = "$Id: main.c,v 8.22 2002/04/12 03:03:49 marka Exp $"; static const char rcsid[] = "$Id: main.c,v 8.24 2002/05/26 03:12:20 marka Exp $";
#endif /* not lint */ #endif /* not lint */
/* /*
@ -341,10 +341,21 @@ main(int argc, char **argv) {
} else { } else {
result = GetHostInfoByAddr(&u[i], &u[i], defaultPtr); result = GetHostInfoByAddr(&u[i], &u[i], defaultPtr);
if (result != SUCCESS) { if (result != SUCCESS) {
char t[80];
switch (u[i].sin.sin_family) {
case AF_INET:
inet_ntop(AF_INET, &u[i].sin.sin_addr, t, sizeof(t));
break;
case AF_INET6:
inet_ntop(AF_INET6, &u[i].sin6.sin6_addr, t, sizeof(t));
break;
default:
strcpy(t, "<UNKNOWN>");
break;
}
fprintf(stderr, fprintf(stderr,
"*** Can't find server name for address %s: %s\n", "*** Can't find server name for address %s: %s\n",
inet_ntoa(res.nsaddr_list[i].sin_addr), t, DecodeError(result));
DecodeError(result));
} else { } else {
defaultAddr = u[i]; defaultAddr = u[i];
break; break;
@ -693,7 +704,7 @@ DoLookup(host, servPtr, serverName)
* RFC1123 says we "SHOULD check the string syntactically for a * RFC1123 says we "SHOULD check the string syntactically for a
* dotted-decimal number before looking it up [...]" (p. 13). * dotted-decimal number before looking it up [...]" (p. 13).
*/ */
if (queryType == T_A && IsAddr(host, &addr)) { if ((queryType == T_A || queryType == T_AAAA) && IsAddr(host, &addr)) {
result = GetHostInfoByAddr(&servAddr, &addr, &curHostInfo); result = GetHostInfoByAddr(&servAddr, &addr, &curHostInfo);
} else { } else {
if (queryType == T_PTR) { if (queryType == T_PTR) {
@ -711,7 +722,7 @@ DoLookup(host, servPtr, serverName)
* There's no need to print anything for other query types * There's no need to print anything for other query types
* because the info has already been printed. * because the info has already been printed.
*/ */
if (queryType == T_A) { if (queryType == T_A || queryType == T_AAAA) {
curHostValid = TRUE; curHostValid = TRUE;
PrintHostInfo(filePtr, "Name:", &curHostInfo); PrintHostInfo(filePtr, "Name:", &curHostInfo);
} }

View File

@ -1,5 +1,5 @@
.\" $FreeBSD$ .\" $FreeBSD$
.\" $Id: dig.1,v 8.8 2001/09/24 15:21:29 marka Exp $ .\" $Id: dig.1,v 8.9 2002/06/18 01:53:43 marka Exp $
.\" .\"
.\" ++Copyright++ 1993 .\" ++Copyright++ 1993
.\" - .\" -
@ -96,7 +96,7 @@ will take the form:
where: where:
.Bl -tag -width Fl .Bl -tag -width Fl
.It Ar server .It Ar server
may be either a domain name or a dot-notation may be either a domain name or a raw (IPv4 / IPv6)
Internet address. If this optional field is omitted, Internet address. If this optional field is omitted,
.Ic dig .Ic dig
will attempt to use the default name server for your machine. will attempt to use the default name server for your machine.
@ -145,7 +145,7 @@ See the
.Fl x .Fl x
option (documented in the option (documented in the
.Sx OTHER OPTIONS .Sx OTHER OPTIONS
subsection of this section) for convenient way to specify inverse address subsection of this section) for convenient way to specify reverse address
query. query.
.It Ar query-type .It Ar query-type
is the type of information (DNS query type) that is the type of information (DNS query type) that
@ -240,9 +240,15 @@ available (although not guaranteed to be useful):
.It Fl x Ar dot-notation-address .It Fl x Ar dot-notation-address
Convenient form to specify inverse address mapping. Convenient form to specify inverse address mapping.
Instead of Instead of
.Dq Ic dig 32.0.9.128.in-addr.arpa , .Dq Ic dig 32.0.9.28.in-addr.arpa ,
one can simply one can simply
.Dq Ic dig -x 128.9.0.32 . .Dq Ic dig -x 28.9.0.32 .
.It Fl x Ar IPv6-address
Convenient form to specify inverse address mapping.
Instead of
.Dq Ic dig 1.0.0.0.0.0.0.0.0.0.0.0. 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa ,
one can simply
.Dq Ic dig -x ::1 .
.It Fl f Ar file .It Fl f Ar file
File for File for
.Ic dig .Ic dig

View File

@ -1,3 +1,4 @@
.\" $FreeBSD$
.\" ++Copyright++ 1993 .\" ++Copyright++ 1993
.\" - .\" -
.\" Copyright (c) 1993 .\" Copyright (c) 1993
@ -50,9 +51,7 @@
.\" SOFTWARE. .\" SOFTWARE.
.\" - .\" -
.\" --Copyright-- .\" --Copyright--
.\" $Id: host.1,v 8.6 2001/08/10 00:14:47 cyarnell Exp $ .\" $Id: host.1,v 8.7 2002/06/18 02:39:26 marka Exp $
.\" $FreeBSD$
.\"
.Dd December 15, 1994 .Dd December 15, 1994
.Dt HOST @CMD_EXT_U@ .Dt HOST @CMD_EXT_U@
.Os BSD 4 .Os BSD 4
@ -61,9 +60,13 @@
.Nd look up host names using domain server .Nd look up host names using domain server
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm host .Nm host
.Op Fl adlrwv .Op Fl l
.Op Fl c Ar class .Op Fl v
.Op Fl w
.Op Fl r
.Op Fl d
.Op Fl t Ar querytype .Op Fl t Ar querytype
.Op Fl a
.Ar host .Ar host
.Op Ar server .Op Ar server
.Sh DESCRIPTION .Sh DESCRIPTION
@ -82,7 +85,7 @@ by the domain server.
The arguments can be either host names or host numbers. The program The arguments can be either host names or host numbers. The program
first attempts to interpret them as host numbers. If this fails, first attempts to interpret them as host numbers. If this fails,
it will treat them as host names. A host number consists of it will treat them as host names. A host number consists of
four decimal numbers separated by dots, e.g. 128.6.4.194 IPv4 dotted decimal quad (127.0.0.1) or IPv6 raw address (::1).
A host name consists of names separated by dots, e.g. topaz.rutgers.edu. A host name consists of names separated by dots, e.g. topaz.rutgers.edu.
Unless the name ends in a dot, the local domain Unless the name ends in a dot, the local domain
is automatically tacked on the end. Thus, a Rutgers user can say is automatically tacked on the end. Thus, a Rutgers user can say
@ -156,39 +159,23 @@ There are a number of options that can be used before the
host name. Most of these options are meaningful only to the host name. Most of these options are meaningful only to the
staff who have to maintain the domain database. staff who have to maintain the domain database.
.Bl -tag -width Fl .Bl -tag -width Fl
.It Fl a .It Fl w
.Dq all ; This causes
this is equivalent to .Ic host
.Dq Fl v Fl t Cm any . to wait forever for a response. Normally
.It Fl c Ar class it will time out after approximate one minute.
The .It Fl v
.Ar class Use "verbose" format for printout. This
to look for non-Internet data. is the official domain master file format, which is documented
.It Fl d in the man page for
Turn on debugging. Network transactions are shown in detail. .Xr @INDOT@named @SYS_OPS_EXT@ .
.It Fl l Without this option, output still follows
List a complete domain; e.g.: this format in general terms, but some attempt is made to make it
.Pp more intelligible to normal users. Without
.D1 Ic host -l rutgers.edu .Dq Fl v ,
.Pp any "a", "mx", and "cname" records
will give a listing of all hosts in the rutgers.edu domain. The are written out as "has address", "mail is handled by", and
.Dq Fl t "is a nickname for" (respectively), and TTL and class fields are not shown.
option is used to filter what information is presented, as you
would expect. The default is address information, which also
include PTR and NS records. The command
.Pp
.D1 Ic host -l -v -t any rutgers.edu
.Pp
will give a complete download of the zone data for rutgers.edu,
in the official master file format. (However the SOA record is
listed twice, for arcane reasons.)
.Pp
.Sy NOTE:
.Dq Fl l
is implemented by
doing a complete zone transfer and then filtering out the information
that you have asked for. This command should be used only if it
is absolutely necessary.
.It Fl r .It Fl r
Turn off recursion in the request. Turn off recursion in the request.
This means that the name server will return only data it has in This means that the name server will return only data it has in
@ -206,6 +193,7 @@ to be looked up. The arguments are defined in the man page for
.Xr @INDOT@named @SYS_OPS_EXT@ . .Xr @INDOT@named @SYS_OPS_EXT@ .
Currently-supported types include: Currently-supported types include:
.Dq Cm a , .Dq Cm a ,
.Dq Cm aaaa ,
.Dq Cm ns , .Dq Cm ns ,
.Dq Cm md , .Dq Cm md ,
.Dq Cm mf , .Dq Cm mf ,

View File

@ -16,6 +16,7 @@
#define SETPWENT_VOID #define SETPWENT_VOID
#endif #endif
#include <sys/param.h>
#include <sys/types.h> #include <sys/types.h>
#define GROUP_R_RETURN struct group * #define GROUP_R_RETURN struct group *
@ -27,8 +28,13 @@
#define GROUP_R_ENT_ARGS void #define GROUP_R_ENT_ARGS void
#define GROUP_R_OK gptr #define GROUP_R_OK gptr
#define GROUP_R_BAD NULL #define GROUP_R_BAD NULL
#if defined(__FreeBSD_version) && __FreeBSD_version >= 500030
#define GETGROUPLIST_ARGS const char *name, gid_t basegid, gid_t *groups, \ #define GETGROUPLIST_ARGS const char *name, gid_t basegid, gid_t *groups, \
int *ngroups int *ngroups
#else
#define GETGROUPLIST_ARGS const char *name, int basegid, int *groups, \
int *ngroups
#endif
#define HOST_R_RETURN struct hostent * #define HOST_R_RETURN struct hostent *
#define HOST_R_SET_RETURN void #define HOST_R_SET_RETURN void