Further protection against comments in /etc/{passwd,group}

Submitted by:	Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
PR:		14269
This commit is contained in:
Brian Somers 2000-06-28 09:31:31 +00:00
parent a61800c2f3
commit 03806e0da0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=62210

View File

@ -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