[Dovecot] Case insensitive user names

andrew fresh andrew at mad-techies.org
Sat Mar 20 00:30:26 EET 2004


aha,  a little more digging through the dovecot source leads me to this much simpler patch. 

--- src/auth/db-passwd-file.c.orig      2003-05-18 05:26:28.000000000 -0700
+++ src/auth/db-passwd-file.c   2004-03-19 15:32:52.000000000 -0700
@@ -153,6 +153,9 @@ static void passwd_file_open(struct pass
                if (args[1] != NULL) {
                        /* at least two fields */
                        const char *no_args = NULL;
+
+                       args[0] = str_lcase(args[0]);
+
                        passwd_file_add(pw, args[0], args[1],
                                        pw->userdb ? args+2 : &no_args);
                }
@@ -219,6 +222,8 @@ db_passwd_file_lookup(struct passwd_file
 {
        struct passwd_user *pu;

+       user = str_lcase(user);
+
        passwd_file_sync(pw);

        pu = hash_lookup(pw->users, user);

-- 
andrew

/---------------------------------------------------------------------\
|   ICQ#   |             Proud Member of Mad-Techies.org              |
|  253198  |               http://www.mad-techies.org                 |
|---------------------------------------------------------------------|
| A computer is like an air-conditioned house, so don't open Windows! |
\---------------------------------------------------------------------/



More information about the dovecot mailing list