diff options
author | Brian Somers <brian@FreeBSD.org> | 2000-06-28 09:31:31 +0000 |
---|---|---|
committer | Brian Somers <brian@FreeBSD.org> | 2000-06-28 09:31:31 +0000 |
commit | 03806e0da09dc317417162a5f2a367f599280552 (patch) | |
tree | 152d0e48fd28a06e7bc6e2590a28c731b18a7ef5 /usr.sbin | |
parent | a61800c2f3f8c4a1df1b5cdb1c0bca08ff288337 (diff) | |
download | src-03806e0da09dc317417162a5f2a367f599280552.tar.gz src-03806e0da09dc317417162a5f2a367f599280552.zip |
Further protection against comments in /etc/{passwd,group}
Submitted by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
PR: 14269
Notes
Notes:
svn path=/head/; revision=62210
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ypserv/Makefile.yp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/ypserv/Makefile.yp b/usr.sbin/ypserv/Makefile.yp index 354987783dde..296395b54833 100644 --- a/usr.sbin/ypserv/Makefile.yp +++ b/usr.sbin/ypserv/Makefile.yp @@ -466,11 +466,11 @@ $(PASSWD): $(MASTER) @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 @@ master.passwd.byname: $(MASTER) @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 @@ master.passwd.byuid: $(MASTER) @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 |