[dovecot-cvs] dovecot/src/auth db-passwd-file.c, 1.28, 1.29 mech-gssapi.c, 1.10, 1.11 passdb-bsdauth.c, 1.16, 1.17 passdb-cache.c, 1.21, 1.22 passdb-checkpassword.c, 1.32, 1.33 passdb-pam.c, 1.48, 1.49 passdb-passwd.c, 1.18, 1.19 passdb-shadow.c, 1.19, 1.20 passdb-sia.c, 1.3, 1.4 passdb-vpopmail.c, 1.26, 1.27 userdb-passwd.c, 1.21, 1.22 userdb-prefetch.c, 1.5, 1.6 userdb-vpopmail.c, 1.23, 1.24

tss at dovecot.org tss at dovecot.org
Sat Mar 10 15:24:19 EET 2007


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

Modified Files:
	db-passwd-file.c mech-gssapi.c passdb-bsdauth.c passdb-cache.c 
	passdb-checkpassword.c passdb-pam.c passdb-passwd.c 
	passdb-shadow.c passdb-sia.c passdb-vpopmail.c userdb-passwd.c 
	userdb-prefetch.c userdb-vpopmail.c 
Log Message:
Added more debug logging.



Index: db-passwd-file.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/db-passwd-file.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- db-passwd-file.c	1 Jul 2006 19:42:27 -0000	1.28
+++ db-passwd-file.c	10 Mar 2007 13:24:15 -0000	1.29
@@ -389,6 +389,7 @@
 {
 	struct passwd_file *pw;
 	struct passwd_user *pu;
+	const char *username;
 
 	if (!db->vars)
 		pw = db->default_file;
@@ -413,13 +414,18 @@
 
 	if (!passwd_file_sync(pw)) {
 		auth_request_log_info(request, "passwd-file",
-				      "no passwd file");
+				      "no passwd file: %s", pw->path);
 		return NULL;
 	}
 
 	t_push();
-	pu = hash_lookup(pw->users, !db->domain_var ? request->user :
-			 t_strcut(request->user, '@'));
+	username = !db->domain_var ? request->user :
+		t_strcut(request->user, '@');
+
+	auth_request_log_debug(request, "passwd-file",
+			       "lookup: user=%s file=%s", username, pw->path);
+
+	pu = hash_lookup(pw->users, username);
 	if (pu == NULL)
                 auth_request_log_info(request, "passwd-file", "unknown user");
 	t_pop();

Index: mech-gssapi.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/mech-gssapi.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- mech-gssapi.c	3 Dec 2006 14:12:24 -0000	1.10
+++ mech-gssapi.c	10 Mar 2007 13:24:15 -0000	1.11
@@ -391,11 +391,14 @@
 
 	major_status = gss_release_cred(&minor_status,
 					&gssapi_request->service_cred);
-	major_status = gss_release_name(&minor_status,
-					&gssapi_request->authn_name);
-	major_status = gss_release_name(&minor_status,
-					&gssapi_request->authz_name);
-
+	if (gssapi_request->authn_name != GSS_C_NO_NAME) {
+		major_status = gss_release_name(&minor_status,
+						&gssapi_request->authn_name);
+	}
+	if (gssapi_request->authz_name != GSS_C_NO_NAME) {
+		major_status = gss_release_name(&minor_status,
+						&gssapi_request->authz_name);
+	}
 	pool_unref(request->pool);
 }
 

Index: passdb-bsdauth.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/passdb-bsdauth.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- passdb-bsdauth.c	8 Nov 2006 20:22:08 -0000	1.16
+++ passdb-bsdauth.c	10 Mar 2007 13:24:15 -0000	1.17
@@ -19,6 +19,8 @@
 	struct passwd *pw;
 	int result;
 
+	auth_request_log_debug(request, "bsdauth", "lookup");
+
 	pw = getpwnam(request->user);
 	if (pw == NULL) {
 		auth_request_log_info(request, "bsdauth", "unknown user");

Index: passdb-cache.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/passdb-cache.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- passdb-cache.c	16 Feb 2007 17:23:01 -0000	1.21
+++ passdb-cache.c	10 Mar 2007 13:24:15 -0000	1.22
@@ -23,8 +23,12 @@
 
 	/* value = password \t ... */
 	value = auth_cache_lookup(passdb_cache, request, key, &node, &expired);
-	if (value == NULL || (expired && !use_expired))
+	if (value == NULL || (expired && !use_expired)) {
+		auth_request_log_debug(request, "cache",
+				       value == NULL ? "miss" : "expired");
 		return FALSE;
+	}
+	auth_request_log_debug(request, "cache", "hit");
 
 	if (*value == '\0') {
 		/* negative cache entry */
@@ -79,8 +83,12 @@
 		return FALSE;
 
 	value = auth_cache_lookup(passdb_cache, request, key, &node, &expired);
-	if (value == NULL || (expired && !use_expired))
+	if (value == NULL || (expired && !use_expired)) {
+		auth_request_log_debug(request, "cache",
+				       value == NULL ? "miss" : "expired");
 		return FALSE;
+	}
+	auth_request_log_debug(request, "cache", "hit");
 
 	if (*value == '\0') {
 		/* negative cache entry */

Index: passdb-checkpassword.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/passdb-checkpassword.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- passdb-checkpassword.c	16 Feb 2007 17:26:19 -0000	1.32
+++ passdb-checkpassword.c	10 Mar 2007 13:24:15 -0000	1.33
@@ -221,15 +221,9 @@
 		auth_request_log_error(request, "checkpassword",
 				       "dup2() failed: %m");
 	} else {
-		/* very simple argument splitting. */
-		cmd = t_strconcat(module->checkpassword_path, " ",
-				  module->checkpassword_reply_path, NULL);
-		args = t_strsplit(cmd, " ");
-
 		/* Besides passing the standard username and password in a
 		   pipe, also pass some other possibly interesting information
 		   via environment. Use UCSPI names for local/remote IPs. */
-		/*  */
 		env_put("PROTO=TCP"); /* UCSPI */
 		env_put(t_strconcat("SERVICE=", request->service, NULL));
 		if (request->local_ip.family != 0) {
@@ -264,9 +258,13 @@
 			env_put_extra_fields(fields);
 		}
 
+		/* very simple argument splitting. */
+		cmd = t_strconcat(module->checkpassword_path, " ",
+				  module->checkpassword_reply_path, NULL);
 		auth_request_log_debug(request, "checkpassword",
-				       "Executed: %s", cmd);
+				       "execute: %s", cmd);
 
+		args = t_strsplit(cmd, " ");
 		execv(args[0], (char **)args);
 		auth_request_log_error(request, "checkpassword",
 				       "execv(%s) failed: %m", args[0]);

Index: passdb-pam.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/passdb-pam.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- passdb-pam.c	22 Feb 2007 12:23:52 -0000	1.48
+++ passdb-pam.c	10 Mar 2007 13:24:15 -0000	1.49
@@ -430,6 +430,7 @@
 
 	service = module->service_name != NULL ?
 		module->service_name : request->service;
+	auth_request_log_debug(request, "pam", "lookup service=%s", service);
 
 	if (worker) {
 		/* blocking=yes code path in auth worker */

Index: passdb-passwd.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/passdb-passwd.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- passdb-passwd.c	8 Nov 2006 20:22:08 -0000	1.18
+++ passdb-passwd.c	10 Mar 2007 13:24:15 -0000	1.19
@@ -20,6 +20,8 @@
 	struct passwd *pw;
 	bool result;
 
+	auth_request_log_debug(request, "passwd", "lookup");
+
 	pw = getpwnam(request->user);
 	if (pw == NULL) {
 		auth_request_log_info(request, "passwd", "unknown user");

Index: passdb-shadow.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/passdb-shadow.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- passdb-shadow.c	8 Nov 2006 20:22:08 -0000	1.19
+++ passdb-shadow.c	10 Mar 2007 13:24:15 -0000	1.20
@@ -20,6 +20,8 @@
 	struct spwd *spw;
 	bool result;
 
+	auth_request_log_debug(request, "shadow", "lookup");
+
 	spw = getspnam(request->user);
 	if (spw == NULL) {
 		auth_request_log_info(request, "shadow", "unknown user");

Index: passdb-sia.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/passdb-sia.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- passdb-sia.c	8 Nov 2006 20:22:08 -0000	1.3
+++ passdb-sia.c	10 Mar 2007 13:24:15 -0000	1.4
@@ -35,6 +35,8 @@
 {
 	char *argutility = "dovecot";
 
+	auth_request_log_debug(request, "sia", "lookup");
+
 	/* check if the password is valid */
 	if (sia_validate_user(checkpw_collect, 1, &argutility, NULL,
 			      (char *)request->user, NULL, NULL, NULL,

Index: passdb-vpopmail.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/passdb-vpopmail.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- passdb-vpopmail.c	8 Nov 2006 20:22:08 -0000	1.26
+++ passdb-vpopmail.c	10 Mar 2007 13:24:15 -0000	1.27
@@ -24,6 +24,10 @@
 	struct vqpasswd *vpw;
 	char *password;
 
+	auth_request_log_debug(auth_request, "vpopmail",
+			       "lookup user=%s domain=%s",
+			       vpop_user, vpop_domain);
+
 	vpw = vpopmail_lookup_vqp(auth_request, vpop_user, vpop_domain);
 	if (vpw == NULL) {
 		*result_r = PASSDB_RESULT_USER_UNKNOWN;
@@ -86,9 +90,6 @@
 		return;
 	}
 
-	auth_request_log_debug(request, "vpopmail",
-			       "crypted password=%s", password);
-
 	tmp_pass = crypted_pass;
 	scheme = password_get_scheme(&tmp_pass);
 	if (scheme == NULL)

Index: userdb-passwd.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/userdb-passwd.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- userdb-passwd.c	12 Feb 2007 21:48:37 -0000	1.21
+++ userdb-passwd.c	10 Mar 2007 13:24:15 -0000	1.22
@@ -16,6 +16,8 @@
 	struct passwd *pw;
 	struct auth_stream_reply *reply;
 
+	auth_request_log_debug(auth_request, "passwd", "lookup");
+
 	pw = getpwnam(auth_request->user);
 	if (pw == NULL) {
 		auth_request_log_info(auth_request, "passwd", "unknown user");

Index: userdb-prefetch.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/userdb-prefetch.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- userdb-prefetch.c	16 Jan 2007 13:18:24 -0000	1.5
+++ userdb-prefetch.c	10 Mar 2007 13:24:15 -0000	1.6
@@ -88,6 +88,8 @@
 	else {
 		struct auth_stream_reply *reply;
 
+		auth_request_log_debug(auth_request, "prefetch", "success");
+
 		/* import the string into request. since the values were
 		   exported they are already in escaped form in the string. */
 		reply = auth_stream_reply_init(auth_request);

Index: userdb-vpopmail.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/userdb-vpopmail.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- userdb-vpopmail.c	21 Dec 2006 16:01:15 -0000	1.23
+++ userdb-vpopmail.c	10 Mar 2007 13:24:15 -0000	1.24
@@ -27,6 +27,10 @@
 		return NULL;
 	}
 
+	auth_request_log_debug(auth_request, "vpopmail",
+			       "lookup user=%s domain=%s",
+			       vpop_user, vpop_domain);
+
 	vpw = vauth_getpw(vpop_user, vpop_domain);
 	if (vpw == NULL) {
 		auth_request_log_info(request, "vpopmail", "unknown user");



More information about the dovecot-cvs mailing list