summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-07-25 19:32:37 +0000
committerpeter <peter@FreeBSD.org>1996-07-25 19:32:37 +0000
commit33391aed101a5ce1c7ae61f53aa0efa4a321a44a (patch)
tree66af7130aa0408f09f74a125603b56edf89a39e2
parent5b06d94d0a1a1906667b50382b804345f90dc31a (diff)
downloadFreeBSD-src-33391aed101a5ce1c7ae61f53aa0efa4a321a44a.zip
FreeBSD-src-33391aed101a5ce1c7ae61f53aa0efa4a321a44a.tar.gz
Fix the services.byname target so that it creates search keys for the
aliases of the "official" names as well, because now that getportbyname() does a yp match, it no longer found the entries under the alias. This broke rsh(1), because it looks up "shell/tcp" while the official name in /etc/services is "cmd/tcp".
-rw-r--r--usr.sbin/ypserv/Makefile.yp10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/ypserv/Makefile.yp b/usr.sbin/ypserv/Makefile.yp
index 38e968f..0a184b0 100644
--- a/usr.sbin/ypserv/Makefile.yp
+++ b/usr.sbin/ypserv/Makefile.yp
@@ -1,7 +1,7 @@
#
# Makefile for the NIS databases
#
-# $Id: Makefile.yp,v 1.9 1996/07/24 10:48:07 peter Exp $
+# $Id: Makefile.yp,v 1.10 1996/07/24 14:04:57 peter Exp $
#
# This Makefile should only be run on the NIS master server of a domain.
# All updated maps will be pushed to all NIS slave servers listed in the
@@ -369,9 +369,11 @@ services.byname: $(SERVICES)
@echo $@.$$$$ > $(NFILE)
$(CAT) $(SERVICES) | \
$(AWK) \
- '$$1 !~ "#" { if (index($$2,"udp")) { printf("%s/udp",$$1) } \
- else { printf("%s/tcp",$$1) }; print "\t"$$0 ; \
- print $$2"\t"$$0 ; \
+ '$$1 !~ "#" { for (n=1; n<=NF && $$n !~ "#"; n++) { \
+ if (index($$2,"udp")) { printf("%s/udp",$$n) } \
+ else { printf("%s/tcp",$$n) }; print "\t"$$0 ; \
+ if (n == 1) n = 2; \
+ } ; print $$2"\t"$$0 ; \
}' $^ | $(DBLOAD) -i $(SERVICES) -o $(YPMAPDIR)/$@ - $(TMP)
@$(MV) $(TMP) $@
@$(DBLOAD) -c
OpenPOWER on IntegriCloud