1 diff -Naur cyrus-imapd-2.2.10.orig/lib/auth_unix.c cyrus-imapd-2.2.10/lib/auth_unix.c
2 --- cyrus-imapd-2.2.10.orig/lib/auth_unix.c Tue Sep 14 00:49:29 2004
3 +++ cyrus-imapd-2.2.10/lib/auth_unix.c Thu Dec 16 08:36:32 2004
17 + char fnamebuf[1024];
18 + const char *config_dir =
19 + libcyrus_config_getstring(CYRUSOPT_CONFIG_DIR);
21 identifier = auth_canonifyid(identifier, 0);
22 if (!identifier) return 0;
25 pwd = getpwnam(identifier);
27 + strcpy(fnamebuf, config_dir);
28 + strcat(fnamebuf, "/group.cache");
29 + groupcache = fopen(fnamebuf, "r");
31 - while ((grp = getgrent())) {
32 + while (grp = ( (groupcache) ? fgetgrent(groupcache) : getgrent() )) {
33 for (mem = grp->gr_mem; *mem; mem++) {
34 if (!strcmp(*mem, identifier)) break;
40 + if (groupcache) fclose(groupcache);