Bug 853 - NIS map services.byname not exported to clients correctly
Summary: NIS map services.byname not exported to clients correctly
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 2.1-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1995-11-30 17:10 UTC by daveho
Modified: 1995-12-09 19:28 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description daveho 1995-11-30 17:10:02 UTC
	The FreeBSD box is being used as an NIS server.  The problem is
	with the services.byname map: for services with both a tcp and
	udp version, only the udp version is visible through NIS.  This
	causes problems for clients looking for the tcp service.

Fix: 

The problem seems to be that the services.byname database
	is being created with only the service name as a key: the
	effect being that when the upd service is added, it overwrites
	the tcp service with the same name.  I don't know enough about
	NIS to fix this myself, but it sounds like upd or tcp need
	to be encoded in the database key.
How-To-Repeat: 
	On a client, do

	$ ypcat services.byname|grep telnet

	telnet/tcp is not shown.
Comment 1 Bill Paul freebsd_committer freebsd_triage 1995-12-09 19:25:19 UTC
State Changed
From-To: open->closed

Fixed in latest version of /usr/src/gnu/usr.sbin/ypserv/Makefile.yp. 
Here is a quick patch for the benefit of the bug filer: 

4c4 
< # $Id: Makefile.yp,v 1.12 1995/10/26 18:00:35 wpaul Exp $ 
--- 
> # $Id: Makefile.yp,v 1.13 1995/12/09 19:25:00 wpaul Exp $ 
296,298c296,297 
< 	   '$$1 !~ "#"  { print $$1"t"$$0;  
< 			  for (n=3; n<=NF && $$n !~ "#"; n++)  
< 			      print $$n"t"$$0  
--- 
> 	   '$$1 !~ "#"  { if (index($$2,"udp")) { printf("%s/udp",$$1) }  
> 			  else { printf("%s/tcp",$$1) }; print "t"$$0