Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Dec 2015 11:20:51 +0000 (UTC)
From:      Hajimu UMEMOTO <ume@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r292435 - head/usr.sbin/ypserv
Message-ID:  <201512181120.tBIBKpgv052838@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ume
Date: Fri Dec 18 11:20:50 2015
New Revision: 292435
URL: https://svnweb.freebsd.org/changeset/base/292435

Log:
  - Keep hosts.by{name,addr} IPv4 only.
  - Add comment how we handle hosts and ipnodes. (from NetBSD)
  
  MFC after:	1 week.

Modified:
  head/usr.sbin/ypserv/Makefile.yp

Modified: head/usr.sbin/ypserv/Makefile.yp
==============================================================================
--- head/usr.sbin/ypserv/Makefile.yp	Fri Dec 18 09:50:24 2015	(r292434)
+++ head/usr.sbin/ypserv/Makefile.yp	Fri Dec 18 11:20:50 2015	(r292435)
@@ -387,9 +387,20 @@ netgroup.byuser: $(NETGROUP)
 .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.
+#
 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
@@ -399,7 +410,7 @@ hosts.byname: $(HOSTS)
 
 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512181120.tBIBKpgv052838>