Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/ypserv/ypinit generate ipnodes.{byname, byaddr} for ...



details:   https://anonhg.NetBSD.org/src/rev/40a7d525a324
branches:  trunk
changeset: 495497:40a7d525a324
user:      itojun <itojun%NetBSD.org@localhost>
date:      Sun Jul 30 02:33:13 2000 +0000

description:
generate ipnodes.{byname,byaddr} for IPv4/v6 lookups.
hosts.{byname,byaddr} is still an IPv4 only mapping.
obeys solaris8 practice.  see comments in ypinit/Makefile.yp for details.

TODO: interop test with solaris8 (any takers?)

diffstat:

 usr.sbin/ypserv/ypinit/Makefile.main |   4 +-
 usr.sbin/ypserv/ypinit/Makefile.yp   |  40 ++++++++++++++++++++++++++++++++++-
 2 files changed, 40 insertions(+), 4 deletions(-)

diffs (89 lines):

diff -r aeb33cb46eb6 -r 40a7d525a324 usr.sbin/ypserv/ypinit/Makefile.main
--- a/usr.sbin/ypserv/ypinit/Makefile.main      Sun Jul 30 02:25:08 2000 +0000
+++ b/usr.sbin/ypserv/ypinit/Makefile.main      Sun Jul 30 02:33:13 2000 +0000
@@ -1,8 +1,8 @@
-#      $NetBSD: Makefile.main,v 1.4 1999/04/25 06:28:10 lukem Exp $
+#      $NetBSD: Makefile.main,v 1.5 2000/07/30 02:33:13 itojun Exp $
 
 SUBDIR=        
 
-TARGETS+=      passwd aliases amd.home ethers group hosts netgroup \
+TARGETS+=      passwd aliases amd.home ethers group hosts ipnodes netgroup \
                networks protocols rpc services netid
 
 .include <bsd.subdir.mk>
diff -r aeb33cb46eb6 -r 40a7d525a324 usr.sbin/ypserv/ypinit/Makefile.yp
--- a/usr.sbin/ypserv/ypinit/Makefile.yp        Sun Jul 30 02:25:08 2000 +0000
+++ b/usr.sbin/ypserv/ypinit/Makefile.yp        Sun Jul 30 02:33:13 2000 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.yp,v 1.9 1999/11/19 16:55:25 abs Exp $
+#      $NetBSD: Makefile.yp,v 1.10 2000/07/30 02:33:13 itojun Exp $
 #
 # This is the YP Makefile, used to create and push YP maps.
 #
@@ -46,7 +46,7 @@
 # We have a rule for ypservers, but we don't build it by default, since
 # it seldom changes (only when slaves are added/deleted).
 
-all: passwd aliases amd.home ethers group hosts netgroup networks rpc services protocols netid
+all: passwd aliases amd.home ethers group hosts ipnodes netgroup networks rpc services protocols netid
 
 
 passwd.time: ${DIR}/master.passwd
@@ -191,6 +191,19 @@
        fi
 
 
+# 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, for compatibility with NetBSD
+# local name resolution.
+#
 hosts.time: ${DIR}/hosts
        -@if [ -f ${.ALLSRC} ]; then \
                ${STDHOSTS} ${.ALLSRC} | ${SED} -e s/#.*$$// | \
@@ -213,6 +226,28 @@
        fi
 
 
+ipnodes.time: ${DIR}/hosts
+       -@if [ -f ${.ALLSRC} ]; then \
+               ${STDHOSTS} -n ${.ALLSRC} | ${SED} -e s/#.*$$// | \
+               ${AWK} '{for (i = 2; i <= NF; i++) print $$i, $$0 }' | \
+               ${SORT} | ${MAKEDBM} - ipnodes.byname; \
+               ${STDHOSTS} -n ${.ALLSRC} | \
+               ${AWK} 'BEGIN { OFS="\t"; } { print $$1, $$0 }' | \
+               ${SORT} | ${MAKEDBM} - ipnodes.byaddr; \
+               ${TOUCH} ${.TARGET}; \
+               ${ECHO} "updated ipnodes"; \
+               if [ ! ${NOPUSH} ]; then \
+                       ${YPPUSH} -d ${DOMAIN} ipnodes.byname; \
+                       ${YPPUSH} -d ${DOMAIN} ipnodes.byaddr; \
+                       ${ECHO} "pushed ipnodes"; \
+               else \
+                       : ; \
+               fi \
+       else \
+               ${ECHO} "couldn't find ${.ALLSRC}"; \
+       fi
+
+
 netgroup.time: ${DIR}/netgroup
        -@if [ -f ${.ALLSRC} ]; then \
                ${CAT} ${.ALLSRC} | ${SORT} | ${MAKEDBM} - netgroup; \
@@ -346,6 +381,7 @@
 passwd: passwd.time
 group: group.time
 hosts: hosts.time
+ipnodes: ipnodes.time
 aliases: aliases.time
 amd.home: amd.home.time
 ethers: ethers.time



Home | Main Index | Thread Index | Old Index