Detect and handle comment lines in master.passwd files.
PR: bin/19664
This commit is contained in:
parent
98f5573fdd
commit
d73dd62871
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=63014
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user