[dovecot-cvs] dovecot/src/auth mech.c,1.35,1.36

cras at dovecot.org cras at dovecot.org
Sun Sep 26 18:51:59 EEST 2004


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

Modified Files:
	mech.c 
Log Message:
Don't allow empty usernames. Solaris PAM seems to eat all memory with them.



Index: mech.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/mech.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- mech.c	20 Sep 2004 20:48:31 -0000	1.35
+++ mech.c	26 Sep 2004 15:51:57 -0000	1.36
@@ -257,6 +257,12 @@
 {
 	unsigned char *p;
 
+	if (*username == '\0') {
+		/* Some PAM plugins go nuts with empty usernames */
+		*error_r = "Empty username";
+		return FALSE;
+	}
+
 	for (p = (unsigned char *)username; *p != '\0'; p++) {
 		if (username_translation[*p & 0xff] != 0)
 			*p = username_translation[*p & 0xff];



More information about the dovecot-cvs mailing list