diff options
author | brian <brian@FreeBSD.org> | 2000-06-28 09:31:31 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2000-06-28 09:31:31 +0000 |
commit | c6cc4497b13dc84a57c16566894e590369a6013d (patch) | |
tree | 4388fd16245657cb080f79b576fc8e156e32e4a9 | |
parent | 15dc9f70e6c493251ed09a89c910fb24607923e2 (diff) | |
download | FreeBSD-src-c6cc4497b13dc84a57c16566894e590369a6013d.zip FreeBSD-src-c6cc4497b13dc84a57c16566894e590369a6013d.tar.gz |
Further protection against comments in /etc/{passwd,group}
Submitted by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
PR: 14269
-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 3549877..296395b 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 |