Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 34574 Details for
Bug 55537
cyrus-imapd-2.1.15-r1 update to add kolabs and amd64 patches
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
new group file patch
group_file.patch (text/plain), 2.27 KB, created by
Andreas Pokorny
on 2004-07-01 04:16:47 UTC
(
hide
)
Description:
new group file patch
Filename:
MIME Type:
Creator:
Andreas Pokorny
Created:
2004-07-01 04:16:47 UTC
Size:
2.27 KB
patch
obsolete
>--- lib/auth_unix.c 2003-05-13 15:33:26.000000000 +0000 >+++ lib/auth_unix.c-patched 2004-06-29 10:47:53.494897529 +0000 >@@ -50,6 +50,7 @@ > #include <grp.h> > #include <ctype.h> > #include <string.h> >+#include <stdio.h> > > #include "auth.h" > #include "xmalloc.h" >@@ -143,6 +144,24 @@ > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 > }; > >+static struct group* fgetgrnam(const char* name) >+{ >+ struct group *grp; >+ FILE *groupfile; >+ >+ groupfile = fopen("/etc/imapd/imapd.group","r"); >+ if (!groupfile) groupfile = fopen("/etc/group", "r"); >+ if (groupfile) { >+ while ((grp = fgetgrent(groupfile))) { >+ if (strcmp(grp->gr_name, name) == 0) { >+ fclose(groupfile); >+ return grp; >+ } >+ } >+ } >+ if (groupfile) fclose(groupfile); >+ return NULL; >+} > /* > * Convert 'identifier' into canonical form. > * Returns a pointer to a static buffer containing the canonical form >@@ -185,7 +204,7 @@ > */ > > if (!strncmp(retbuf, "group:", 6)) { >- grp = getgrnam(retbuf+6); >+ grp = fgetgrnam(retbuf+6); > if (!grp) return 0; > strcpy(retbuf+6, grp->gr_name); > return retbuf; >@@ -228,6 +247,7 @@ > struct passwd *pwd; > struct group *grp; > char **mem; >+ FILE *groupfile; > > identifier = auth_canonifyid(identifier, 0); > if (!identifier) return 0; >@@ -241,20 +261,23 @@ > newstate->ngroups = 0; > newstate->group = (char **) 0; > >- setgrent(); >- while ((grp = getgrent())) { >- for (mem = grp->gr_mem; *mem; mem++) { >- if (!strcmp(*mem, identifier)) break; >- } >- >- if (*mem || (pwd && pwd->pw_gid == grp->gr_gid)) { >- newstate->ngroups++; >- newstate->group = (char **)xrealloc((char *)newstate->group, >+ groupfile = fopen("/etc/imapd.group", "r"); >+ if (!groupfile) groupfile = fopen("/etc/group","r"); >+ if (groupfile) { >+ while ((grp = fgetgrent(groupfile))) { >+ for (mem = grp->gr_mem; *mem; mem++) { >+ if (!strcmp(*mem, identifier)) break; >+ } >+ >+ if (*mem || (pwd && pwd->pw_gid == grp->gr_gid)) { >+ newstate->ngroups++; >+ newstate->group = (char **)xrealloc((char *)newstate->group, > newstate->ngroups * sizeof(char *)); >- newstate->group[newstate->ngroups-1] = xstrdup(grp->gr_name); >- } >- } >- endgrent(); >+ newstate->group[newstate->ngroups-1] = xstrdup(grp->gr_name); >+ } >+ } >+ fclose(groupfile); >+ } > return newstate; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 55537
:
34402
|
34403
|
34404
|
34574
|
34575
|
34668
|
34669