diff options
author | Mats O Jansson <maja@cvs.openbsd.org> | 1997-04-15 22:59:00 +0000 |
---|---|---|
committer | Mats O Jansson <maja@cvs.openbsd.org> | 1997-04-15 22:59:00 +0000 |
commit | 838ef86f7534e99641c92a41d4e0d97cc1200d88 (patch) | |
tree | 8010c5b9cb61add997efca62122258eefbd69a40 /usr.sbin/ypserv/ypinit | |
parent | cb1a1f0e47ee55ced8badf0af15d0261dbca636b (diff) |
Added revnetgroup in ypserv's Makefile and added support for netgroup. -moj
Diffstat (limited to 'usr.sbin/ypserv/ypinit')
-rw-r--r-- | usr.sbin/ypserv/ypinit/Makefile.main | 4 | ||||
-rw-r--r-- | usr.sbin/ypserv/ypinit/Makefile.yp | 30 |
2 files changed, 30 insertions, 4 deletions
diff --git a/usr.sbin/ypserv/ypinit/Makefile.main b/usr.sbin/ypserv/ypinit/Makefile.main index ce3f7e44047..ca1e926de7d 100644 --- a/usr.sbin/ypserv/ypinit/Makefile.main +++ b/usr.sbin/ypserv/ypinit/Makefile.main @@ -1,7 +1,7 @@ -# $OpenBSD: Makefile.main,v 1.5 1996/05/30 09:53:16 deraadt Exp $ +# $OpenBSD: Makefile.main,v 1.6 1997/04/15 22:58:58 maja Exp $ SUBDIR= -passwd group hosts networks rpc services protocols netid: _SUBDIRUSE +passwd group hosts ethers networks rpc services protocols netid netgroup: _SUBDIRUSE .include <bsd.subdir.mk> diff --git a/usr.sbin/ypserv/ypinit/Makefile.yp b/usr.sbin/ypserv/ypinit/Makefile.yp index c8c1a952b6f..07d5f851f45 100644 --- a/usr.sbin/ypserv/ypinit/Makefile.yp +++ b/usr.sbin/ypserv/ypinit/Makefile.yp @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.yp,v 1.6 1997/03/13 09:50:26 maja Exp $ +# $OpenBSD: Makefile.yp,v 1.7 1997/04/15 22:58:59 maja Exp $ YPDBDIR=/var/yp DIR=/etc @@ -13,6 +13,7 @@ SED=/usr/bin/sed STDHOSTS=/usr/sbin/stdhosts STDETHERS=/usr/sbin/stdethers MKNETID=/usr/sbin/mknetid +REVNETGROUP=/usr/sbin/revnetgroup TOUCH=/usr/bin/touch DOMAIN="`/usr/bin/basename ${.CURDIR}`" YPPUSH=/usr/sbin/yppush @@ -24,7 +25,7 @@ YPPUSH=/usr/sbin/yppush MAKEDBM-S=$(MAKEDBM) -s UNSECURE="True" -all: passwd group hosts ethers networks rpc services protocols netid +all: passwd group hosts ethers networks rpc services protocols netid netgroup passwd.time: $(DIR)/master.passwd -@if [ -f $(>) ]; then \ @@ -218,6 +219,28 @@ netid.time: $(DIR)/passwd $(DIR)/group $(DIR)/hosts $(DIR)/netid fi +netgroup.time: $(DIR)/netgroup + -@if [ -f $(>) ]; then \ + $(CAT) $(>) | $(MAKEDBM) - netgroup; \ + $(CAT) $(>) | $(REVNETGROUP) -u -f - | \ + $(MAKEDBM) - netgroup.byuser; \ + $(CAT) $(>) | $(REVNETGROUP) -h -f - | \ + $(MAKEDBM) - netgroup.byhost; \ + $(TOUCH) $(@); \ + $(ECHO) "updated netgroup"; \ + if [ ! $(NOPUSH) ]; then \ + $(YPPUSH) -d $(DOMAIN) netgroup; \ + $(YPPUSH) -d $(DOMAIN) netgroup.byuser; \ + $(YPPUSH) -d $(DOMAIN) netgroup.byhost; \ + $(ECHO) "pushed netgroup"; \ + else \ + : ; \ + fi \ + else \ + $(ECHO) "couldn't find $(>)"; \ + fi + + passwd: passwd.time group: group.time hosts: hosts.time @@ -227,6 +250,7 @@ rpc: rpc.time services: services.time protocols: protocols.time netid: netid.time +netgroup: netgroup.time $(DIR)/passwd: $(DIR)/group: $(DIR)/hosts: @@ -237,3 +261,5 @@ $(DIR)/services: $(DIR)/protocols: $(DIR)/netid: $(DIR)/master.passwd: +$(DIR)/netgroup: + |