[Midnightbsd-cvs] src [10306] U trunk/usr.sbin/ypserv: update

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Jun 3 14:54:52 EDT 2018


Revision: 10306
          http://svnweb.midnightbsd.org/src/?rev=10306
Author:   laffer1
Date:     2018-06-03 14:54:51 -0400 (Sun, 03 Jun 2018)
Log Message:
-----------
update

Modified Paths:
--------------
    trunk/usr.sbin/ypserv/Makefile
    trunk/usr.sbin/ypserv/Makefile.yp
    trunk/usr.sbin/ypserv/yp_access.c
    trunk/usr.sbin/ypserv/yp_dnslookup.c
    trunk/usr.sbin/ypserv/yp_main.c
    trunk/usr.sbin/ypserv/yp_server.c
    trunk/usr.sbin/ypserv/ypinit.8
    trunk/usr.sbin/ypserv/ypinit.sh
    trunk/usr.sbin/ypserv/ypserv.8

Property Changed:
----------------
    trunk/usr.sbin/ypserv/Makefile.yp
    trunk/usr.sbin/ypserv/ypinit.8
    trunk/usr.sbin/ypserv/ypinit.sh
    trunk/usr.sbin/ypserv/ypserv.8

Modified: trunk/usr.sbin/ypserv/Makefile
===================================================================
--- trunk/usr.sbin/ypserv/Makefile	2018-06-03 18:53:27 UTC (rev 10305)
+++ trunk/usr.sbin/ypserv/Makefile	2018-06-03 18:54:51 UTC (rev 10306)
@@ -1,5 +1,8 @@
 # $MidnightBSD$
+# $FreeBSD: stable/10/usr.sbin/ypserv/Makefile 313220 2017-02-04 16:34:44Z ngie $
 
+.include <bsd.own.mk>
+
 RPCDIR=	${.CURDIR}/../../include/rpcsvc
 .PATH: ${RPCDIR}
 
@@ -8,12 +11,15 @@
 SRCS=	yp_svc.c yp_server.c yp_dblookup.c yp_dnslookup.c \
 	ypxfr_clnt.c yp.h yp_main.c yp_error.c yp_access.c yp_svc_udp.c
 
-CFLAGS+= -DDB_CACHE -DTCP_WRAPPER -I.
+CFLAGS+= -DDB_CACHE -I.
 
 WARNS?=	0
 
-DPADD=	${LIBWRAP}
-LDADD=	-lwrap
+.if ${MK_TCP_WRAPPERS} != "no"
+CFLAGS+=	-DTCP_WRAPPER
+DPADD+=		${LIBWRAP}
+LDADD+=		-lwrap
+.endif
 
 CLEANFILES= yp_svc.c ypxfr_clnt.c yp.h
 

Modified: trunk/usr.sbin/ypserv/Makefile.yp
===================================================================
--- trunk/usr.sbin/ypserv/Makefile.yp	2018-06-03 18:53:27 UTC (rev 10305)
+++ trunk/usr.sbin/ypserv/Makefile.yp	2018-06-03 18:54:51 UTC (rev 10306)
@@ -2,6 +2,7 @@
 # Makefile for the NIS databases
 #
 # $MidnightBSD$
+# $FreeBSD: stable/10/usr.sbin/ypserv/Makefile.yp 292720 2015-12-25 10:53:30Z ume $
 #
 # This Makefile should only be run on the NIS master server of a domain.
 # All updated maps will be pushed to all NIS slave servers listed in the
@@ -103,6 +104,7 @@
 # passwd file will be generated from the master.passwd file automagically.
 #
 ETHERS    = $(YPSRCDIR)/ethers	   # ethernet addresses (for rarpd)
+EUI64     = $(YPSRCDIR)/eui64	   # eui64 addresses (for firewire)
 BOOTPARAMS= $(YPSRCDIR)/bootparams # for booting Sun boxes (bootparamd)
 HOSTS     = $(YPSRCDIR)/hosts
 IPNODES   = $(YPDIR)/ipnodes
@@ -140,11 +142,12 @@
 # If you want to omit some of them, feel free to comment
 # them out from this list.
 TARGETS= servers hosts networks protocols rpc services shells group
+TARGETS+= ipnodes
 #TARGETS+= aliases
 
 # Sanity checks: filter out targets we can't build
-# Note that we don't build the ethers or boorparams maps by default
-# since /etc/ethers and /etc/bootparams are not likely to be present
+# Note that we don't build the ethers, eui64, or boorparams maps by default
+# since /etc/ethers, /etc/eui64 and /etc/bootparams are not likely to be present
 # on all systems.
 .if exists($(ETHERS))
 TARGETS+= ethers
@@ -152,6 +155,12 @@
 ETHERS= /dev/null
 .endif
 
+.if exists($(EUI64))
+TARGETS+= eui64
+.else
+EUI64= /dev/null
+.endif
+
 .if exists($(BOOTPARAMS))
 TARGETS+= bootparams
 .else
@@ -186,15 +195,14 @@
 AMDHOST= /dev/null
 .endif
 
-.if exists($(IPNODES))
-TARGETS+= ipnodes
-.else
-IPNODES= /dev/null
+.if !exists($(IPNODES))
+IPNODES= $(HOSTS)
 .endif
 
 all: $(TARGETS)
 
 ethers:	   ethers.byname ethers.byaddr
+eui64:	   eui64.byname eui64.byid
 bootparam: bootparams
 hosts:	   hosts.byname hosts.byaddr
 ipnodes:   ipnodes.byname ipnodes.byaddr
@@ -294,7 +302,33 @@
 	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
 .endif
 
+eui64.byname: $(EUI64)
+	@echo "Updating $@..."
+.if ${EUI64} == "/dev/null"
+	@echo "EUI64 source file not found -- skipping"
+.else
+	@$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
+		print $$2"\t"$$0 }' $(EUI64) | $(DBLOAD) -i $(EUI64) \
+		-o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
+	@$(DBLOAD) -c
+	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
+	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
+.endif
 
+eui64.byid: $(EUI64)
+	@echo "Updating $@..."
+.if ${EUI64} == "/dev/null"
+	@echo "EUI64 source file not found -- skipping"
+.else
+	@$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
+		print $$1"\t"$$0 }' $(EUI64) | $(DBLOAD) -i $(EUI64) \
+		-o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
+	@$(DBLOAD) -c
+	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
+	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
+.endif
+
+
 bootparams: $(BOOTPARAMS)
 	@echo "Updating $@..."
 .if ${BOOTPARAMS} == "/dev/null"
@@ -353,9 +387,22 @@
 .endif
 
 
+# Solaris 8 does the following:
+# - /etc/hosts and hosts.{byname,byaddr} are IPv4 only.
+# - /etc/inet/ipnodes and ipnodes.{byname,byaddr} are used for protocol
+#   independent name-to-address mapping.
+#
+# For local name resolution, we made /etc/hosts protocol independent.
+# For NIS name resolution, we obey Solaris 8 practice.
+# - We keep hosts.{byname,byaddr} IPv4 only, to be friendly with Solaris 8
+#   clients.
+# - ipnodes.{byname,byaddr} is used for protocol independent mapping.
+# We generate all the mappings from /etc/hosts unless /var/yp/ipnodes
+# exists, for compatibility with FreeBSD local name resolution.
+#
 hosts.byname: $(HOSTS)
 	@echo "Updating $@..."
-	@$(AWK) '/^[0-9]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \
+	@$(AWK) '/^[0-9.]+[\t ]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \
 		print $$n"\t"$$0 }' $(HOSTS) | $(DBLOAD) ${B} -i $(HOSTS)  \
 		-o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
 	@$(DBLOAD) -c
@@ -365,7 +412,7 @@
 
 hosts.byaddr: $(HOSTS)
 	@echo "Updating $@..."
-	@$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$0 }' $(HOSTS) \
+	@$(AWK) '/^[0-9.]+[\t ]/ { print $$1"\t"$$0 }' $(HOSTS) \
 		| $(DBLOAD) ${B} -i $(HOSTS) -o $(YPMAPDIR)/$@ - $(TMP); \
 		$(RMV) $(TMP) $@
 	@$(DBLOAD) -c
@@ -375,9 +422,6 @@
 
 ipnodes.byname: $(IPNODES)
 	@echo "Updating $@..."
-.if ${IPNODES} == "/dev/null"
-	@echo "Ipnodes source file not found -- skipping"
-.else
 	@$(AWK) '/^[0-9a-fA-F:]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \
 		print $$n"\t"$$0 }' $(IPNODES) | $(DBLOAD) ${B} -i $(IPNODES)  \
 		-o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
@@ -384,14 +428,10 @@
 	@$(DBLOAD) -c
 	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
 	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
-.endif
 
 
 ipnodes.byaddr: $(IPNODES)
 	@echo "Updating $@..."
-.if ${IPNODES} == "/dev/null"
-	@echo "Ipnodes source file not found -- skipping"
-.else
 	@$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$0 }' $(IPNODES) \
 		| $(DBLOAD) ${B} -i $(IPNODES) -o $(YPMAPDIR)/$@ - $(TMP); \
 		$(RMV) $(TMP) $@
@@ -398,7 +438,6 @@
 	@$(DBLOAD) -c
 	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
 	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
-.endif
 
 
 networks.byname: $(NETWORKS)


Property changes on: trunk/usr.sbin/ypserv/Makefile.yp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.sbin/ypserv/yp_access.c
===================================================================
--- trunk/usr.sbin/ypserv/yp_access.c	2018-06-03 18:53:27 UTC (rev 10305)
+++ trunk/usr.sbin/ypserv/yp_access.c	2018-06-03 18:54:51 UTC (rev 10306)
@@ -97,6 +97,10 @@
 
 #define LINEBUFSZ 1024
 
+#ifdef TCP_WRAPPER
+int hosts_ctl(char *, char *, char *, char *);
+#endif
+
 /*
  * Read /var/yp/securenets file and initialize the securenets
  * list. If the file doesn't exist, we set up a dummy entry that
@@ -287,7 +291,7 @@
 	if (status_securenets == 0) {
 #endif
 	/*
-	 * One of the following two events occured:
+	 * One of the following two events occurred:
 	 *
 	 * (1) The /var/yp/securenets exists and the remote host does not
 	 *     match any of the networks specified in it.

Modified: trunk/usr.sbin/ypserv/yp_dnslookup.c
===================================================================
--- trunk/usr.sbin/ypserv/yp_dnslookup.c	2018-06-03 18:53:27 UTC (rev 10305)
+++ trunk/usr.sbin/ypserv/yp_dnslookup.c	2018-06-03 18:54:51 UTC (rev 10306)
@@ -456,7 +456,7 @@
 	pending++;
 
 	if (debug)
-		yp_error("queueing async DNS name lookup (%d)", q->id);
+		yp_error("queueing async DNS name lookup (%lu)", q->id);
 
 	yp_prune_dnsq();
 	return(YP_TRUE);
@@ -489,9 +489,6 @@
 	    yp_find_dnsqent(svcudp_get_xid(rqstp->rq_xprt),BY_RPC_XID) != NULL)
 		return(YP_TRUE);
 
-	if ((q = yp_malloc_dnsent()) == NULL)
-		return(YP_YPERR);
-
 	switch (af) {
 	case AF_INET:
 		if (inet_aton(addr, (struct in_addr *)uaddr) != 1)
@@ -516,6 +513,9 @@
 		return(YP_YPERR);
 	}
 
+	if ((q = yp_malloc_dnsent()) == NULL)
+		return(YP_YPERR);
+
 	if (debug)
 		yp_error("DNS address is: %s", buf);
 
@@ -544,7 +544,7 @@
 	pending++;
 
 	if (debug)
-		yp_error("queueing async DNS address lookup (%d)", q->id);
+		yp_error("queueing async DNS address lookup (%lu)", q->id);
 
 	yp_prune_dnsq();
 	return(YP_TRUE);

Modified: trunk/usr.sbin/ypserv/yp_main.c
===================================================================
--- trunk/usr.sbin/ypserv/yp_main.c	2018-06-03 18:53:27 UTC (rev 10305)
+++ trunk/usr.sbin/ypserv/yp_main.c	2018-06-03 18:54:51 UTC (rev 10306)
@@ -292,7 +292,7 @@
 
 				s = __rpc_nconf2fd(nconf);
 				if (s < 0) {
-					if (errno == EPROTONOSUPPORT)
+					if (errno == EAFNOSUPPORT)
 						_msgout("unsupported"
 						    " transport: %s",
 						    nconf->nc_netid);
@@ -329,9 +329,8 @@
 					return -1;
 				}
 				memset(slep, 0, sizeof(*slep));
-				memcpy(&slep->sle_ss,
-				    (struct sockaddr *)(res->ai_addr),
-				    sizeof(res->ai_addr));
+				memcpy(&slep->sle_ss, res->ai_addr,
+				    res->ai_addrlen);
 				slep->sle_sock = s;
 				SLIST_INSERT_HEAD(&sle_head, slep, sle_next);
 

Modified: trunk/usr.sbin/ypserv/yp_server.c
===================================================================
--- trunk/usr.sbin/ypserv/yp_server.c	2018-06-03 18:53:27 UTC (rev 10305)
+++ trunk/usr.sbin/ypserv/yp_server.c	2018-06-03 18:54:51 UTC (rev 10306)
@@ -711,6 +711,7 @@
 				yp_error("strdup() failed: %s",strerror(errno));
 				closedir(dird);
 				yp_maplist_free(yp_maplist);
+				free(cur);
 				return(NULL);
 			}
 			cur->next = yp_maplist;

Modified: trunk/usr.sbin/ypserv/ypinit.8
===================================================================
--- trunk/usr.sbin/ypserv/ypinit.8	2018-06-03 18:53:27 UTC (rev 10305)
+++ trunk/usr.sbin/ypserv/ypinit.8	2018-06-03 18:54:51 UTC (rev 10306)
@@ -29,8 +29,9 @@
 .\" THE POSSIBILITY OF SUCH DAMAGE.
 .\"
 .\" $MidnightBSD$
+.\" $FreeBSD: stable/10/usr.sbin/ypserv/ypinit.8 287375 2015-09-01 18:57:57Z asomers $
 .\"
-.Dd November 10, 1997
+.Dd August 18, 2015
 .Dt YPINIT 8
 .Os
 .Sh NAME
@@ -147,6 +148,8 @@
 Bootparams source file
 .It Pa /etc/ethers
 Ethers data source file
+.It Pa /etc/eui64
+EUI64 data source file
 .It Pa /etc/group
 Group source file
 .It Pa /etc/hosts


Property changes on: trunk/usr.sbin/ypserv/ypinit.8
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.sbin/ypserv/ypinit.sh
===================================================================
--- trunk/usr.sbin/ypserv/ypinit.sh	2018-06-03 18:53:27 UTC (rev 10305)
+++ trunk/usr.sbin/ypserv/ypinit.sh	2018-06-03 18:54:51 UTC (rev 10306)
@@ -1,5 +1,6 @@
 #!/bin/sh
 # $MidnightBSD$
+# $FreeBSD: stable/10/usr.sbin/ypserv/ypinit.sh 293290 2016-01-07 00:40:51Z bdrewery $
 #
 # ypinit.sh - setup a master or slave server.
 # (Taken from OpenBSD and modified for FreeBSD.)
@@ -14,8 +15,9 @@
 	 group.byname group.bygid hosts.byname hosts.byaddr services.byname \
 	 rpc.byname rpc.bynumber networks.byname networks.byaddr netgroup \
 	 netgroup.byuser netgroup.byhost netid.byname publickey.byname \
-	 bootparams ethers.byname ethers.byaddr amd.host mail.aliases \
-	 ypservers protocols.byname protocols.bynumber netmasks.byaddr"
+	 bootparams ethers.byname ethers.byaddr eui64.byname eui64.byid \
+	 amd.host mail.aliases ypservers protocols.byname protocols.bynumber \
+	 netmasks.byaddr"
 
 ERROR_EXISTS="NO"
 umask 077
@@ -234,7 +236,7 @@
 
 	for MAP in ${YPMAPLIST}
 	do
-		echo "Transfering ${MAP}..."
+		echo "Transferring ${MAP}..."
 		if ! ${YPXFR} -p ${YP_DIR} -h ${MASTER} -c -d ${DOMAIN} ${MAP}; then
 			echo "Can't transfer map ${MAP}." 1>&2
 			ERROR_EXISTS="YES"


Property changes on: trunk/usr.sbin/ypserv/ypinit.sh
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.sbin/ypserv/ypserv.8
===================================================================
--- trunk/usr.sbin/ypserv/ypserv.8	2018-06-03 18:53:27 UTC (rev 10305)
+++ trunk/usr.sbin/ypserv/ypserv.8	2018-06-03 18:54:51 UTC (rev 10306)
@@ -29,6 +29,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $MidnightBSD$
+.\" $FreeBSD: stable/10/usr.sbin/ypserv/ypserv.8 233455 2012-03-25 09:18:34Z joel $
 .\"
 .Dd December 13, 2009
 .Dt YPSERV 8
@@ -220,7 +221,6 @@
 authentication through
 .Tn NIS .
 .El
-.Pp
 .Ss Security
 In general, any remote user can issue an RPC to
 .Nm
@@ -292,7 +292,6 @@
 to
 .Dq IP spoofing
 attacks.
-.Pp
 .Ss NIS v1 compatibility
 This version of
 .Nm


Property changes on: trunk/usr.sbin/ypserv/ypserv.8
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list