[dovecot-cvs] dovecot/src/auth db-passwd-file.c, 1.18, 1.19 db-passwd-file.h, 1.9, 1.10 passdb-passwd-file.c, 1.24, 1.25 userdb-passwd-file.c, 1.19, 1.20

cras at dovecot.org cras at dovecot.org
Sun Jan 15 15:38:34 EET 2006


Update of /var/lib/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv26915/auth

Modified Files:
	db-passwd-file.c db-passwd-file.h passdb-passwd-file.c 
	userdb-passwd-file.c 
Log Message:
If debug is enabled, tell how many users are found from passwd-file whenever
it's read.



Index: db-passwd-file.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/db-passwd-file.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- db-passwd-file.c	14 Jan 2006 18:47:20 -0000	1.18
+++ db-passwd-file.c	15 Jan 2006 13:38:32 -0000	1.19
@@ -183,6 +183,11 @@
 		t_pop();
 	}
 	i_stream_unref(&input);
+
+	if (pw->db->debug) {
+		i_info("passwd-file %s: Read %u users",
+		       pw->path, hash_size(pw->users));
+	}
 	return TRUE;
 }
 
@@ -246,7 +251,8 @@
 	return NULL;
 }
 
-struct db_passwd_file *db_passwd_file_parse(const char *path, bool userdb)
+struct db_passwd_file *
+db_passwd_file_parse(const char *path, bool userdb, bool debug)
 {
 	struct db_passwd_file *db;
 	const char *p;
@@ -268,6 +274,7 @@
 	db = i_new(struct db_passwd_file, 1);
 	db->refcount = 1;
 	db->userdb = userdb;
+	db->debug = debug;
 	db->files = hash_create(default_pool, default_pool, 100,
 				str_hash, (hash_cmp_callback_t *)strcmp);
 

Index: db-passwd-file.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/db-passwd-file.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- db-passwd-file.h	14 Jan 2006 18:47:20 -0000	1.9
+++ db-passwd-file.h	15 Jan 2006 13:38:32 -0000	1.10
@@ -37,12 +37,14 @@
 	unsigned int domain_var:1;
 	unsigned int vars:1;
 	unsigned int userdb:1;
+	unsigned int debug:1;
 };
 
 struct passwd_user *
 db_passwd_file_lookup(struct db_passwd_file *db, struct auth_request *request);
 
-struct db_passwd_file *db_passwd_file_parse(const char *path, bool userdb);
+struct db_passwd_file *
+db_passwd_file_parse(const char *path, bool userdb, bool debug);
 void db_passwd_file_unref(struct db_passwd_file **db);
 
 #endif

Index: passdb-passwd-file.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/passdb-passwd-file.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- passdb-passwd-file.c	14 Jan 2006 18:47:20 -0000	1.24
+++ passdb-passwd-file.c	15 Jan 2006 13:38:32 -0000	1.25
@@ -14,6 +14,7 @@
 struct passwd_file_passdb_module {
 	struct passdb_module module;
 
+	struct auth *auth;
 	struct db_passwd_file *pwf;
 };
 
@@ -91,6 +92,7 @@
 
 	module = p_new(auth_passdb->auth->pool,
 		       struct passwd_file_passdb_module, 1);
+	module->auth = auth_passdb->auth;
 	module->module.cache_key = PASSWD_FILE_CACHE_KEY;
 	module->module.default_pass_scheme = PASSWD_FILE_DEFAULT_SCHEME;
 	return &module->module;
@@ -101,7 +103,8 @@
 	struct passwd_file_passdb_module *module =
 		(struct passwd_file_passdb_module *)_module;
 
-	module->pwf = db_passwd_file_parse(args, FALSE);
+	module->pwf =
+		db_passwd_file_parse(args, FALSE, module->auth->verbose_debug);
 }
 
 static void passwd_file_deinit(struct passdb_module *_module)

Index: userdb-passwd-file.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/userdb-passwd-file.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- userdb-passwd-file.c	14 Jan 2006 18:47:20 -0000	1.19
+++ userdb-passwd-file.c	15 Jan 2006 13:38:32 -0000	1.20
@@ -11,6 +11,7 @@
 struct passwd_file_userdb_module {
         struct userdb_module module;
 
+	struct auth *auth;
 	struct db_passwd_file *pwf;
 };
 
@@ -50,6 +51,7 @@
 
 	module = p_new(auth_userdb->auth->pool,
 		       struct passwd_file_userdb_module, 1);
+	module->auth = auth_userdb->auth;
 	return &module->module;
 }
 
@@ -58,7 +60,8 @@
 	struct passwd_file_userdb_module *module =
 		(struct passwd_file_userdb_module *)_module;
 
-	module->pwf = db_passwd_file_parse(args, TRUE);
+	module->pwf =
+		db_passwd_file_parse(args, TRUE, module->auth->verbose_debug);
 }
 
 static void passwd_file_deinit(struct userdb_module *_module)



More information about the dovecot-cvs mailing list