dovecot-2.0-sslstream: passdb-file: When iterating through users...

dovecot at dovecot.org dovecot at dovecot.org
Sat Feb 13 02:55:13 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0-sslstream/rev/d3f59a7a8e03
changeset: 10098:d3f59a7a8e03
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Oct 19 15:01:16 2009 -0400
description:
passdb-file: When iterating through users, skip empty lines and comments.

diffstat:

1 file changed, 5 insertions(+), 1 deletion(-)
src/auth/userdb-passwd-file.c |    6 +++++-

diffs (16 lines):

diff -r 596a8ab6820e -r d3f59a7a8e03 src/auth/userdb-passwd-file.c
--- a/src/auth/userdb-passwd-file.c	Sat Oct 17 20:27:09 2009 +0000
+++ b/src/auth/userdb-passwd-file.c	Mon Oct 19 15:01:16 2009 -0400
@@ -124,7 +124,11 @@ static void passwd_file_iterate_next(str
 	if (ctx->input == NULL)
 		line = NULL;
 	else {
-		line = i_stream_read_next_line(ctx->input);
+		while ((line = i_stream_read_next_line(ctx->input)) != NULL) {
+			if (*line == '\0' || *line == ':' || *line == '#')
+				continue; /* no username or comment */
+			break;
+		}
 		if (line == NULL && ctx->input->stream_errno != 0) {
 			i_error("read(%s) failed: %m", ctx->path);
 			_ctx->failed = TRUE;


More information about the dovecot-cvs mailing list