[dovecot-cvs] dovecot/src/auth auth-request.c,1.54,1.55

cras at dovecot.org cras at dovecot.org
Sun Apr 9 14:54:01 EEST 2006


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

Modified Files:
	auth-request.c 
Log Message:
The login and master usernames were reversed when using
master_user_separator (now the order is UW-IMAP compatible).



Index: auth-request.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/auth-request.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- auth-request.c	9 Apr 2006 11:34:15 -0000	1.54
+++ auth-request.c	9 Apr 2006 11:53:59 -0000	1.55
@@ -582,10 +582,16 @@
 		p = strchr(username, request->auth->master_user_separator);
 		if (p != NULL) {
 			/* it does, set it. */
-			if (!auth_request_set_login_username(request, p+1,
+			const char *login_username;
+
+			login_username = t_strdup_until(username, p);
+			if (!auth_request_set_login_username(request,
+							     login_username,
 							     error_r))
 				return FALSE;
-			username = t_strdup_until(username, p);
+
+			/* username is the master user */
+			username = p + 1;
 		}
 	}
 
@@ -610,7 +616,8 @@
 
         request->requested_login_user =
                 auth_request_fix_username(request, username, error_r);
-	if (strcmp(request->requested_login_user, request->user) == 0) {
+	if (request->user != NULL &&
+	    strcmp(request->requested_login_user, request->user) == 0) {
 		/* The usernames are the same, we don't really wish to log
 		   in as someone else */
 		request->requested_login_user = NULL;



More information about the dovecot-cvs mailing list