From a5382398ec9f46e4efb649000d0f13c06a349476 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Sun, 3 Feb 2002 19:33:22 +0000 Subject: [PATCH] Fix for FreeBSD 4.0 and newer --- unix/pw_util.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/unix/pw_util.c b/unix/pw_util.c index e92c9e8e..e64249c0 100644 --- a/unix/pw_util.c +++ b/unix/pw_util.c @@ -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);