[dovecot-cvs] dovecot/src/auth auth-request.c,1.58.2.13,1.58.2.14
    tss at dovecot.org 
    tss at dovecot.org
       
    Sat Nov 18 22:03:00 UTC 2006
    
    
  
Update of /var/lib/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv6867
Modified Files:
      Tag: branch_1_0
	auth-request.c 
Log Message:
When invalid character is found from username, say what character it is in
the log message. Also with auth_debug=yes log the whole username
(sanitized).
Index: auth-request.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/auth-request.c,v
retrieving revision 1.58.2.13
retrieving revision 1.58.2.14
diff -u -d -r1.58.2.13 -r1.58.2.14
--- auth-request.c	5 Nov 2006 15:51:39 -0000	1.58.2.13
+++ auth-request.c	18 Nov 2006 22:02:57 -0000	1.58.2.14
@@ -588,7 +588,9 @@
 		if (request->auth->username_translation[*p & 0xff] != 0)
 			*p = request->auth->username_translation[*p & 0xff];
 		if (request->auth->username_chars[*p & 0xff] == 0) {
-			*error_r = "Username contains disallowed characters";
+			*error_r = t_strdup_printf(
+				"Username contains disallowed character: "
+				"0x%02x", *p);
 			return NULL;
 		}
 	}
@@ -653,8 +655,11 @@
 	}
 
         request->user = auth_request_fix_username(request, username, error_r);
-	if (request->user == NULL)
+	if (request->user == NULL) {
+		auth_request_log_debug(request, "auth",
+			"Invalid username: %s", str_sanitize(username, 128));
 		return FALSE;
+	}
 
 	if (login_username != NULL) {
 		if (!auth_request_set_login_username(request,
    
    
More information about the dovecot-cvs
mailing list