1 --- cups-pdf-3.0.1/src/cups-pdf.c.1 2018-05-05 09:12:47.326242438 +0000
2 +++ cups-pdf-3.0.1/src/cups-pdf.c 2018-05-05 09:13:03.182785706 +0000
8 +// Solaris does not have getgrouplist
11 +getgrouplist(const char *uname, gid_t agroup, gid_t *groups, int *grpcnt)
13 + const struct group *grp;
14 + int i, maxgroups, ngroups, ret;
18 + maxgroups = *grpcnt;
20 + * When installing primary group, duplicate it;
21 + * the first element of groups is the effective gid
22 + * and will be overwritten when a setgid file is executed.
24 + groups ? groups[ngroups++] = agroup : ngroups++;
26 + groups ? groups[ngroups++] = agroup : ngroups++;
28 + * Scan the group file to find additional groups.
31 + while ((grp = getgrent()) != NULL) {
33 + for (i = 0; i < ngroups; i++) {
34 + if (grp->gr_gid == groups[i])
38 + for (i = 0; grp->gr_mem[i]; i++) {
39 + if (!strcmp(grp->gr_mem[i], uname)) {
40 + if (ngroups >= maxgroups) {
44 + groups ? groups[ngroups++] = grp->gr_gid : ngroups++;
57 static FILE *logfp=NULL;