Date: Wed, 15 Dec 1999 14:39:53 -0200 (EDT) From: Joao Carlos Mendes Luis <jonny@jonny.eng.br> To: FreeBSD-gnats-submit@freebsd.org Subject: bin/15497: NIS and comments in /etc/passwd, /etc/group Message-ID: <199912151639.OAA04736@roma.coe.ufrj.br>
index | next in thread | raw e-mail
>Number: 15497
>Category: bin
>Synopsis: NIS does not deal well with comments
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Dec 15 08:40:02 PST 1999
>Closed-Date:
>Last-Modified:
>Originator: Joao Carlos Mendes Luis
>Release: FreeBSD 3.4-RC i386
>Organization:
COPPE/UFRJ
>Environment:
FreeBSD NIS server, using /etc/group and /etc/master.passwd as source
>Description:
If you use comments (#) in those files, NIS tries to create tables
with them, instead of ignoring them.
>How-To-Repeat:
Put a # comment in /etc/group, cd /var/yp, make
>Fix:
This patch removes lines with comments before making NIS databases.
--- Makefile.antes Wed Dec 15 14:15:41 1999
+++ Makefile Wed Dec 15 14:37:56 1999
@@ -479,7 +479,7 @@
passwd.byname: $(PASSWD)
@echo "Updating $@..."
$(CAT) $(PASSWD) | \
- $(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \
+ $(AWK) -F: '{ if ($$1 != "+" && $$1 !~ "^#.*") print $$1"\t"$$0 }' $^ \
| $(DBLOAD) -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
$(RMV) $(TMP) $@
@$(DBLOAD) -c
@@ -490,7 +490,7 @@
passwd.byuid: $(PASSWD)
@echo "Updating $@..."
$(CAT) $(PASSWD) | \
- $(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \
+ $(AWK) -F: '{ if ($$1 != "+" && $$1 !~ "^#.*") print $$3"\t"$$0 }' $^ \
| $(DBLOAD) -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
$(RMV) $(TMP) $@
@$(DBLOAD) -c
@@ -502,7 +502,7 @@
group.byname: $(GROUP)
@echo "Updating $@..."
$(CAT) $(GROUP) | \
- $(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \
+ $(AWK) -F: '{ if ($$1 != "+" && $$1 !~ "^#.*") print $$1"\t"$$0 }' $^ \
| $(DBLOAD) -f -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP); \
$(RMV) $(TMP) $@
@$(DBLOAD) -c
@@ -513,7 +513,7 @@
group.bygid: $(GROUP)
@echo "Updating $@..."
$(CAT) $(GROUP) | \
- $(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \
+ $(AWK) -F: '{ if ($$1 != "+" && $$1 !~ "^#.*") print $$3"\t"$$0 }' $^ \
| $(DBLOAD) -f -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP); \
$(RMV) $(TMP) $@
@$(DBLOAD) -c
@@ -538,7 +538,7 @@
@echo "Master.passwd source file not found -- skipping"
.else
$(CAT) $(MASTER) | \
- $(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \
+ $(AWK) -F: '{ if ($$1 != "+" && $$1 !~ "^#.*") print $$1"\t"$$0 }' $^ \
| $(DBLOAD) ${S} -f -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP); \
$(RMV) $(TMP) $@
@$(DBLOAD) -c
@@ -553,7 +553,7 @@
@echo "Master.passwd source file not found -- skipping"
.else
$(CAT) $(MASTER) | \
- $(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \
+ $(AWK) -F: '{ if ($$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
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199912151639.OAA04736>
