summaryrefslogtreecommitdiffstats
path: root/gnu/usr.sbin
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1995-10-26 18:00:35 +0000
committerwpaul <wpaul@FreeBSD.org>1995-10-26 18:00:35 +0000
commit627b063e661d2c0187cf625f83db54c6aca0a0c1 (patch)
treead3933dc28e085fd37c444ade50666a7fa313812 /gnu/usr.sbin
parentae139d16d72a6288affa85471dfd53bacbe5f879 (diff)
downloadFreeBSD-src-627b063e661d2c0187cf625f83db54c6aca0a0c1.zip
FreeBSD-src-627b063e661d2c0187cf625f83db54c6aca0a0c1.tar.gz
Add preliminary support for netgroup.byuser and netgroup.byhosts maps.
(I have to make another pass through here soon; awk doesn't handle lines broken up with '\', which can sometimes appear in netgroup maps.)
Diffstat (limited to 'gnu/usr.sbin')
-rw-r--r--gnu/usr.sbin/ypserv/Makefile.yp25
1 files changed, 24 insertions, 1 deletions
diff --git a/gnu/usr.sbin/ypserv/Makefile.yp b/gnu/usr.sbin/ypserv/Makefile.yp
index 06fa8a2..beb46e8 100644
--- a/gnu/usr.sbin/ypserv/Makefile.yp
+++ b/gnu/usr.sbin/ypserv/Makefile.yp
@@ -43,6 +43,7 @@ DBLOAD = /usr/sbin/yp_mkdb -m `hostname`
MKNETID = /usr/libexec/mknetid
YPPUSH = /usr/bin/yppush
DOMAIN = `/bin/domainname`
+REVNETGROUP = /usr/libexec/revnetgroup
YPSRCDIR = /etc
YPDIR = /var/yp
@@ -161,7 +162,7 @@ bootparams: $(BOOTPARAMS)
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
-netgroup: $(NETGROUP)
+netgroup: $(NETGROUP) netgroup.byhost netgroup.byuser
@echo "Updating $@..."
$(RM) $@
$(CAT) $(NETGROUP) | \
@@ -173,6 +174,28 @@ netgroup: $(NETGROUP)
@$(MAKE) -f ../Makefile netid
+netgroup.byhost: $(NETGROUP)
+ @echo "Updating $@..."
+ $(RM) $@
+ $(CAT) $(NETGROUP) | $(REVNETGROUP) -h -f $(NETGROUP) | \
+ $(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
+ print $$0 }' $^ | $(DBLOAD) -i $(NETGROUP) \
+ -o $(YPMAPDIR)/$@ - $@
+ @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
+ @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
+
+
+netgroup.byuser: $(NETGROUP)
+ @echo "Updating $@..."
+ $(RM) $@
+ $(CAT) $(NETGROUP) | $(REVNETGROUP) -u -f $(NETGROUP) | \
+ $(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
+ print $$0 }' $^ | $(DBLOAD) -i $(NETGROUP) \
+ -o $(YPMAPDIR)/$@ - $@
+ @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
+ @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
+
+
hosts.byname: $(HOSTS)
@echo "Updating $@..."
$(RM) $@
OpenPOWER on IntegriCloud