Date: Tue, 27 Jun 2000 07:52:35 +0200 (CEST) From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de> To: FreeBSD-gnats-submit@freebsd.org Subject: misc/19538: NIS passwd and group maps do not clean out comments (2nd part) Message-ID: <200006270552.e5R5qZ429053@curry.mchp.siemens.de>
next in thread | raw e-mail | index | archive | help
>Number: 19538 >Category: misc >Synopsis: NIS passwd and group maps do not clean out comments (2nd part) >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jun 26 23:00:01 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Andre Albsmeier >Release: FreeBSD 3.4-STABLE i386 >Organization: >Environment: All FreeBSD versions after June 21st. >Description: PR misc/14269 contained a fix for usr.sbin/ypserv/Makefile.yp to allow comments in passwd and group files. However, even with the patch in there we still get errors when putting comments in master.passwd. We can get rid of these by changing the master.passwd.byname: and the master.passwd.byuid: rules in the same way as Walt Howard did it in PR misc/14269 with the passwd and group rules: --- Makefile.yp.ORI Wed Jun 21 16:39:04 2000 +++ Makefile.yp Wed Jun 21 16:39:32 2000 @@ -541,7 +541,8 @@ @echo "Master.passwd source file not found -- skipping" .else $(CAT) $(MASTER) | \ - $(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \ + $(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ + print $$1"\t"$$0 }' $^ \ | $(DBLOAD) ${S} -f -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @@ -556,7 +557,8 @@ @echo "Master.passwd source file not found -- skipping" .else $(CAT) $(MASTER) | \ - $(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \ + $(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ + print $$3"\t"$$0 }' $^ \ | $(DBLOAD) ${S} -f -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c In case that $(PASSWD) is being generated from $(MASTER) by the $(PASSWD): $(MASTER) rule, we will find things like #:::::: # Blah blah:::::: #:::::: in the resulting $(PASSWD). Although these are being ignored properly when bulding the maps, we can strip them out with the following, additional patch: --- Makefile.yp Wed Jun 21 16:52:01 2000 +++ Makefile.yp.new Wed Jun 21 16:52:37 2000 @@ -466,11 +466,11 @@ @echo "Creating new $@ file from $(MASTER)..." @if [ ! $(UNSECURE) ]; then \ $(RCAT) $(MASTER) | \ - $(AWK) -F: '{if ($$1 != "+") \ + $(AWK) -F: '{if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ print $$1":*:"$$3":"$$4":"$$8":"$$9":"$$10}' $^ \ > $(PASSWD) ; \ else $(RCAT) $(MASTER) | \ - $(AWK) -F: '{if ($$1 != "+") \ + $(AWK) -F: '{if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ print $$1":"$$2":"$$3":"$$4":"$$8":"$$9":"$$10}' $^ \ > $(PASSWD) ; fi >How-To-Repeat: Insert comments into master.passwd and let passwd get built from it. Watch the error messages (1st patch) and examine the resulting passwd (2. patch). >Fix: This patch combines the two above for easy commiting. --- Makefile.yp.ORI Tue Jun 27 07:47:54 2000 +++ Makefile.yp Tue Jun 27 07:47:57 2000 @@ -466,11 +466,11 @@ @echo "Creating new $@ file from $(MASTER)..." @if [ ! $(UNSECURE) ]; then \ $(RCAT) $(MASTER) | \ - $(AWK) -F: '{if ($$1 != "+") \ + $(AWK) -F: '{if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ print $$1":*:"$$3":"$$4":"$$8":"$$9":"$$10}' $^ \ > $(PASSWD) ; \ else $(RCAT) $(MASTER) | \ - $(AWK) -F: '{if ($$1 != "+") \ + $(AWK) -F: '{if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ print $$1":"$$2":"$$3":"$$4":"$$8":"$$9":"$$10}' $^ \ > $(PASSWD) ; fi @@ -541,7 +541,8 @@ @echo "Master.passwd source file not found -- skipping" .else $(CAT) $(MASTER) | \ - $(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \ + $(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ + print $$1"\t"$$0 }' $^ \ | $(DBLOAD) ${S} -f -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @@ -556,7 +557,8 @@ @echo "Master.passwd source file not found -- skipping" .else $(CAT) $(MASTER) | \ - $(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \ + $(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ + print $$3"\t"$$0 }' $^ \ | $(DBLOAD) ${S} -f -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200006270552.e5R5qZ429053>