changeset 3608:b86d4c76efdf HEAD

Read also users without password.
author Timo Sirainen <tss@iki.fi>
date Sat, 24 Sep 2005 15:51:25 +0300
parents a2dd3d895e00
children ea2266d0a07f
files src/auth/db-passwd-file.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/auth/db-passwd-file.c	Sat Sep 24 15:25:25 2005 +0300
+++ b/src/auth/db-passwd-file.c	Sat Sep 24 15:51:25 2005 +0300
@@ -137,6 +137,7 @@
 
 static int passwd_file_open(struct passwd_file *pw)
 {
+	const char *no_args = NULL;
 	struct istream *input;
 	const char *const *args;
 	const char *line;
@@ -170,10 +171,12 @@
 		t_push();
 		args = t_strsplit(line, ":");
 		if (args[1] != NULL) {
-			/* at least two fields */
-			const char *no_args = NULL;
+			/* at least username+password */
 			passwd_file_add(pw, args[0], args[1],
 					pw->db->userdb ? args+2 : &no_args);
+		} else {
+			/* only username */
+			passwd_file_add(pw, args[0], NULL, &no_args);
 		}
 		t_pop();
 	}