From 33391aed101a5ce1c7ae61f53aa0efa4a321a44a Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 25 Jul 1996 19:32:37 +0000 Subject: [PATCH] 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". --- usr.sbin/ypserv/Makefile.yp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/usr.sbin/ypserv/Makefile.yp b/usr.sbin/ypserv/Makefile.yp index 38e968f283b..0a184b08362 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 -- 2.45.2