From Jonny@mailhost.coppe.ufrj.br  Tue Sep  2 08:46:01 1997
Received: from gaia.coppe.ufrj.br ([146.164.5.200])
          by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id IAA12801
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 2 Sep 1997 08:46:00 -0700 (PDT)
Received: (from root@localhost)
	by gaia.coppe.ufrj.br (8.8.7/8.8.7) id MAA00237;
	Tue, 2 Sep 1997 12:45:25 -0300 (EST)
Message-Id: <199709021545.MAA00237@gaia.coppe.ufrj.br>
Date: Tue, 2 Sep 1997 12:45:25 -0300 (EST)
From: Joao Carlos Mendes Luis <Jonny@mailhost.coppe.ufrj.br>
Reply-To: Jonny@mailhost.coppe.ufrj.br
To: FreeBSD-gnats-submit@freebsd.org
Subject: YP Makefile changes
X-Send-Pr-Version: 3.2

>Number:         4452
>Category:       bin
>Synopsis:       /etc/ethers and NIS: Bad comment parser
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    steve
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep  2 08:50:01 PDT 1997
>Closed-Date:    Sun Jan 25 09:52:16 PST 1998
>Last-Modified:  Sun Jan 25 09:52:39 PST 1998
>Originator:     Joao Carlos Mendes Luis
>Release:        FreeBSD 2.2-STABLE i386
>Organization:
COPPE/UFRJ
>Environment:

	FreeBSD 2.2, YP Server

>Description:

	If one uses comments like this:
############################################
  in /etc/ethers, YP Makefile thinks it's an error, instead of a comment.


>How-To-Repeat:

	Edit /etc/ethers, and add the following 3 lines:
#####################################################################
#  Test                                                             #
#####################################################################

>Fix:
	
Suggested patch to /var/yp/Makefile:

--- Makefile.old	Tue Sep  2 12:38:57 1997
+++ Makefile	Tue Sep  2 12:37:28 1997
@@ -190,7 +190,7 @@
 	@echo "Updating $@..."
 	@echo $@.$$$$ > $(NFILE)
 	$(CAT) $(ETHERS) | \
-	$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
+	$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
 		print $$2"\t"$$0 }' $^ | $(DBLOAD) -i $(ETHERS) \
 						-o $(YPMAPDIR)/$@ - $(TMP)
 	@$(MV) $(TMP) $@
@@ -203,7 +203,7 @@
 	@echo "Updating $@..."
 	@echo $@.$$$$ > $(NFILE)
 	$(CAT) $(ETHERS) | \
-	$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
+	$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
 		print $$1"\t"$$0 }' $^ | $(DBLOAD) -i $(ETHERS) \
 						-o $(YPMAPDIR)/$@ - $(TMP)
 	@$(MV) $(TMP) $@
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->wpaul 
Responsible-Changed-By: wosch 
Responsible-Changed-When: Sun Sep 14 11:23:06 PDT 1997 
Responsible-Changed-Why:  
YP is Bill Paul area. 
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Sun Jan 25 09:52:16 PST 1998 
State-Changed-Why:  
Slightly ammended patch applied.  Thanks! 
>Unformatted:
