From d73dd62871c0675c4d50e1440d7530eadce34bd5 Mon Sep 17 00:00:00 2001 From: David Nugent Date: Wed, 12 Jul 2000 11:00:28 +0000 Subject: [PATCH] Detect and handle comment lines in master.passwd files. PR: bin/19664 --- usr.sbin/rpc.yppasswdd/pw_copy.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/usr.sbin/rpc.yppasswdd/pw_copy.c b/usr.sbin/rpc.yppasswdd/pw_copy.c index be0dbb831e5..73265d76e4f 100644 --- a/usr.sbin/rpc.yppasswdd/pw_copy.c +++ b/usr.sbin/rpc.yppasswdd/pw_copy.c @@ -90,6 +90,16 @@ pw_copy(ffd, tfd, pw) goto err; continue; } + /* + * Just copy comments and blank lines + */ + p = buf + strspn(buf, " \t\n"); + if (*p == '\0' || *p == '#') { + (void)fprintf(to, "%s", buf); + if (ferror(to)) + goto err; + continue; + } if (!(p = strchr(buf, ':'))) { yp_error("%s: corrupted entry", passfile); pw_error(NULL, 0, 1);