From howard@ee.utah.edu Mon Oct 11 14:52:18 1999
Return-Path: <howard@ee.utah.edu>
Received: from ee.utah.edu (ee.elen.utah.edu [128.110.18.3])
	by hub.freebsd.org (Postfix) with ESMTP id 6F7FA15092
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 11 Oct 1999 14:52:17 -0700 (PDT)
	(envelope-from howard@ee.utah.edu)
Received: by ee.utah.edu (Postfix, from userid 106)
	id 2A4A25411; Mon, 11 Oct 1999 15:52:17 -0600 (MDT)
Message-Id: <19991011215217.2A4A25411@ee.utah.edu>
Date: Mon, 11 Oct 1999 15:52:17 -0600 (MDT)
From: howard@ee.utah.edu
Reply-To: howard@ee.utah.edu
To: FreeBSD-gnats-submit@freebsd.org
Subject: update /var/yp/Makefile
X-Send-Pr-Version: 3.2

>Number:         14269
>Category:       misc
>Synopsis:       NIS passwd and group maps do not clean out comments
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 11 15:00:01 PDT 1999
>Closed-Date:    Wed Jun 21 04:20:05 PDT 2000
>Last-Modified:  Wed Jun 21 04:21:46 PDT 2000
>Originator:     Walt Howard
>Release:        FreeBSD 3.3-RELEASE i386
>Organization:
University of Utah Electrical Engineering Dept
>Environment:

	same as release, plus running as a nis_server

>Description:

	Somewhere in the recent past, FreeBSD started allowing comment
        lines in /etc/passwd and /etc/group.  /var/yp/Makefile was not
        updated to remove the comment lines before making a NIS map
        from those files.

>How-To-Repeat:

	cd /var/yp; mkdir domain; cd domain
        make -f ../Makefile group
        : notice the complaints about duplicate key '#'


>Fix:
	
	Here is a context diff on /var/yp/Makefile

*** /var/yp/Makefile.orig	Thu Sep 16 16:48:34 1999
--- /var/yp/Makefile.patch	Mon Oct 11 14:54:08 1999
***************
*** 478,484 ****
  passwd.byname: $(PASSWD)
  	@echo "Updating $@..."
  	$(CAT) $(PASSWD) | \
! 	$(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \
  		| $(DBLOAD) -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
  		$(RMV) $(TMP) $@
  	@$(DBLOAD) -c
--- 478,485 ----
  passwd.byname: $(PASSWD)
  	@echo "Updating $@..."
  	$(CAT) $(PASSWD) | \
! 	$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
! 		print $$1"\t"$$0 }' $^ \
  		| $(DBLOAD) -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
  		$(RMV) $(TMP) $@
  	@$(DBLOAD) -c
***************
*** 489,495 ****
  passwd.byuid: $(PASSWD)
  	@echo "Updating $@..."
  	$(CAT) $(PASSWD) | \
! 	$(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \
  		| $(DBLOAD) -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
  		$(RMV) $(TMP) $@
  	@$(DBLOAD) -c
--- 490,497 ----
  passwd.byuid: $(PASSWD)
  	@echo "Updating $@..."
  	$(CAT) $(PASSWD) | \
! 	$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
! 		print $$3"\t"$$0 }' $^ \
  		| $(DBLOAD) -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
  		$(RMV) $(TMP) $@
  	@$(DBLOAD) -c
***************
*** 501,507 ****
  group.byname: $(GROUP)
  	@echo "Updating $@..."
  	$(CAT) $(GROUP) | \
! 	$(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \
  		| $(DBLOAD) -f -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP); \
  		$(RMV) $(TMP) $@
  	@$(DBLOAD) -c
--- 503,510 ----
  group.byname: $(GROUP)
  	@echo "Updating $@..."
  	$(CAT) $(GROUP) | \
! 	$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
! 		print $$1"\t"$$0 }' $^ \
  		| $(DBLOAD) -f -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP); \
  		$(RMV) $(TMP) $@
  	@$(DBLOAD) -c
***************
*** 512,518 ****
  group.bygid: $(GROUP)
  	@echo "Updating $@..."
  	$(CAT) $(GROUP) | \
! 	$(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \
  		| $(DBLOAD) -f -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP); \
  		$(RMV) $(TMP) $@
  	@$(DBLOAD) -c
--- 515,522 ----
  group.bygid: $(GROUP)
  	@echo "Updating $@..."
  	$(CAT) $(GROUP) | \
! 	$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
! 		print $$3"\t"$$0 }' $^ \
  		| $(DBLOAD) -f -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP); \
  		$(RMV) $(TMP) $@
  	@$(DBLOAD) -c

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: brian 
State-Changed-When: Wed Jun 21 04:20:05 PDT 2000 
State-Changed-Why:  
Fixed in -current, -stable and releng_3 

http://www.freebsd.org/cgi/query-pr.cgi?pr=14269 
>Unformatted:
 Walt Howard
