> * Tore Anderson
>
> > Hi. I've run into problems with usernames like "123" or "1_1".
> > What seems to be the common thing is that that none of them
> > contains alphabetic characters. Cyradm creates them just fine
> > (although they for some reason is created under the "q" directory
> > when using a hashed spool), and lmtpd delivers to them just fine.
>
> * Rob MacGregor
>
> > AFAIK a trawl of the archives of this list should give you more
> > info. I have a vague memory of a patch, but as you don't say what
> > version of Cyrus you're using I can't be any more help...
>
> Well, I did search the archives before posting, and did so again
> right now without much luck. The closest I get is a patch from 1998
> which deals with a similar problem (usernames -starting- with digits).
> Do you remember the subject of the thread you're referring to?
>
> The version I'm using is 2.2.6.
Attached patch should do it.
HTH
Simon
diff -Naur cyrus-imapd-2.2.4.orig/lib/auth_unix.c cyrus-imapd-2.2.4/lib/auth_unix.c
--- cyrus-imapd-2.2.4.orig/lib/auth_unix.c Wed Oct 22 20:50:12 2003
+++ cyrus-imapd-2.2.4/lib/auth_unix.c Sat May 22 23:00:56 2004
@@ -160,7 +160,6 @@
{
static char retbuf[81];
struct group *grp;
- char sawalpha;
char *p;
int username_tolower = 0;
@@ -190,7 +189,6 @@
* Lowercase usernames if requested.
*/
username_tolower = libcyrus_config_getswitch(CYRUSOPT_USERNAME_TOLOWER);
- sawalpha = 0;
for(p = retbuf; *p; p++) {
if (username_tolower && isupper((unsigned char)*p))
*p = tolower((unsigned char)*p);
@@ -199,17 +197,11 @@
case 0:
return NULL;
- case 2:
- sawalpha = 1;
- /* FALL THROUGH */
-
default:
;
}
}
- if (!sawalpha) return NULL; /* has to be one alpha char */
-
return retbuf;
}