Fix for FreeBSD 4.0 and newer

This commit is contained in:
Michiel Broek 2002-02-03 19:33:22 +00:00
parent 1a1586d651
commit a5382398ec

View File

@ -263,6 +263,16 @@ void pw_copy(int ffd, int tfd, struct passwd *pw)
goto err;
continue;
}
for (p = buf; *p != '\n'; p++)
if (*p != ' ' && *p != '\t')
break;
if (*p == '#' || *p == '\n') {
(void)fprintf(to, "%s", buf);
if (ferror(to))
goto err;
continue;
}
*p = '\0';
if (!(p = strchr(buf, ':'))) {
syslog(LOG_WARNING, "%s: corrupted entry", _PATH_MASTERPASSWD);
pw_error(NULL, 0, 1);