From owner-svn-src-all@freebsd.org Tue Sep 1 18:57:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CC3D9C7342; Tue, 1 Sep 2015 18:57:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 009F7B60; Tue, 1 Sep 2015 18:57:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81IvwA8049252; Tue, 1 Sep 2015 18:57:58 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81Ivw8U049249; Tue, 1 Sep 2015 18:57:58 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201509011857.t81Ivw8U049249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 1 Sep 2015 18:57:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r287375 - stable/10/usr.sbin/ypserv X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Sep 2015 18:57:59 -0000 Author: asomers Date: Tue Sep 1 18:57:57 2015 New Revision: 287375 URL: https://svnweb.freebsd.org/changeset/base/287375 Log: MFC r286892 Serve /etc/eui64 via NIS. The C library already knows how to lookup eui64 entries from NIS. For example, fwcontrol(8) does it. But /var/yp/Makefile.dist doesn't build the eui64 maps, and ypinit(8) doesn't push them to slaves. This change fixes that. Modified: stable/10/usr.sbin/ypserv/Makefile.yp stable/10/usr.sbin/ypserv/ypinit.8 stable/10/usr.sbin/ypserv/ypinit.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ypserv/Makefile.yp ============================================================================== --- stable/10/usr.sbin/ypserv/Makefile.yp Tue Sep 1 17:52:43 2015 (r287374) +++ stable/10/usr.sbin/ypserv/Makefile.yp Tue Sep 1 18:57:57 2015 (r287375) @@ -103,6 +103,7 @@ YPMAPDIR = $(YPDIR)/$(DOMAIN) # 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 @@ -143,8 +144,8 @@ TARGETS= servers hosts networks protocol #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 +153,12 @@ TARGETS+= ethers ETHERS= /dev/null .endif +.if exists($(EUI64)) +TARGETS+= eui64 +.else +EUI64= /dev/null +.endif + .if exists($(BOOTPARAMS)) TARGETS+= bootparams .else @@ -195,6 +202,7 @@ IPNODES= /dev/null 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,6 +302,32 @@ ethers.byaddr: $(ETHERS) @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 $@..." Modified: stable/10/usr.sbin/ypserv/ypinit.8 ============================================================================== --- stable/10/usr.sbin/ypserv/ypinit.8 Tue Sep 1 17:52:43 2015 (r287374) +++ stable/10/usr.sbin/ypserv/ypinit.8 Tue Sep 1 18:57:57 2015 (r287375) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 10, 1997 +.Dd August 18, 2015 .Dt YPINIT 8 .Os .Sh NAME @@ -147,6 +147,8 @@ can propagate updates on the master to a 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 Modified: stable/10/usr.sbin/ypserv/ypinit.sh ============================================================================== --- stable/10/usr.sbin/ypserv/ypinit.sh Tue Sep 1 17:52:43 2015 (r287374) +++ stable/10/usr.sbin/ypserv/ypinit.sh Tue Sep 1 18:57:57 2015 (r287375) @@ -14,8 +14,9 @@ MAPLIST="master.passwd.byname master.pas 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