summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ypserv
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2000-06-15 15:51:49 +0000
committerbrian <brian@FreeBSD.org>2000-06-15 15:51:49 +0000
commit1c9174009ea754350d49c9d78e449cef8009884d (patch)
treef119f5ea2a60ea32fab32689f6cb37bc9465fff3 /usr.sbin/ypserv
parent3bacc3e3a8ed35a82accd5d18507a17931e26835 (diff)
downloadFreeBSD-src-1c9174009ea754350d49c9d78e449cef8009884d.zip
FreeBSD-src-1c9174009ea754350d49c9d78e449cef8009884d.tar.gz
Handle comments and empty lines when generating YP passwd and group files
PR: 14269 Submitted by: howard@ee.utah.edu
Diffstat (limited to 'usr.sbin/ypserv')
-rw-r--r--usr.sbin/ypserv/Makefile.yp12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/ypserv/Makefile.yp b/usr.sbin/ypserv/Makefile.yp
index 61a5636..3549877 100644
--- a/usr.sbin/ypserv/Makefile.yp
+++ b/usr.sbin/ypserv/Makefile.yp
@@ -478,7 +478,8 @@ $(PASSWD): $(MASTER)
passwd.byname: $(PASSWD)
@echo "Updating $@..."
$(CAT) $(PASSWD) | \
- $(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \
+ $(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
+ print $$1"\t"$$0 }' $^ \
| $(DBLOAD) -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
$(RMV) $(TMP) $@
@$(DBLOAD) -c
@@ -489,7 +490,8 @@ passwd.byname: $(PASSWD)
passwd.byuid: $(PASSWD)
@echo "Updating $@..."
$(CAT) $(PASSWD) | \
- $(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \
+ $(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
+ print $$3"\t"$$0 }' $^ \
| $(DBLOAD) -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
$(RMV) $(TMP) $@
@$(DBLOAD) -c
@@ -501,7 +503,8 @@ passwd.byuid: $(PASSWD)
group.byname: $(GROUP)
@echo "Updating $@..."
$(CAT) $(GROUP) | \
- $(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \
+ $(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
+ print $$1"\t"$$0 }' $^ \
| $(DBLOAD) -f -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP); \
$(RMV) $(TMP) $@
@$(DBLOAD) -c
@@ -512,7 +515,8 @@ group.byname: $(GROUP)
group.bygid: $(GROUP)
@echo "Updating $@..."
$(CAT) $(GROUP) | \
- $(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \
+ $(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
+ print $$3"\t"$$0 }' $^ \
| $(DBLOAD) -f -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP); \
$(RMV) $(TMP) $@
@$(DBLOAD) -c
OpenPOWER on IntegriCloud