1 Compatibility patch for Illumos/Solaris and possibly other platforms.
2 Implements getgrouplist when not provided by OS.
3 Without it, only the user's primary group is used in authentication!
4 --- 1970-01-01 00:00:00.000000000 +0000
5 +++ dbus-1.6.8/dbus/getgrouplist.c 2013-02-28 13:10:51.081792722 +0000
7 +/* $OpenBSD: getgrouplist.c,v 1.12 2005/08/08 08:05:34 espie Exp $ */
9 + * Copyright (c) 1991, 1993
10 + * The Regents of the University of California. All rights reserved.
12 + * Redistribution and use in source and binary forms, with or without
13 + * modification, are permitted provided that the following conditions
15 + * 1. Redistributions of source code must retain the above copyright
16 + * notice, this list of conditions and the following disclaimer.
17 + * 2. Redistributions in binary form must reproduce the above copyright
18 + * notice, this list of conditions and the following disclaimer in the
19 + * documentation and/or other materials provided with the distribution.
20 + * 3. Neither the name of the University nor the names of its contributors
21 + * may be used to endorse or promote products derived from this software
22 + * without specific prior written permission.
24 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 +/* OPENBSD ORIGINAL: lib/libc/gen/getgrouplist.c */
42 +#include <sys/types.h>
48 +getgrouplist(const char *uname, gid_t agroup, gid_t *groups, int *grpcnt)
57 + maxgroups = *grpcnt;
60 + * install primary group
62 + if (ngroups >= maxgroups) {
66 + groups[ngroups++] = agroup;
69 + * Scan the group file to find additional groups.
72 + while ((grp = getgrent())) {
73 + if (grp->gr_gid == agroup)
75 + for (bail = 0, i = 0; bail == 0 && i < ngroups; i++)
76 + if (groups[i] == grp->gr_gid)
80 + for (i = 0; grp->gr_mem[i]; i++) {
81 + if (!strcmp(grp->gr_mem[i], uname)) {
82 + if (ngroups >= maxgroups) {
86 + groups[ngroups++] = grp->gr_gid;
96 --- dbus-1.6.8/dbus/dbus-sysdeps-unix.c.orig 2013-02-28 13:08:52.171215237 +0000
97 +++ dbus-1.6.8/dbus/dbus-sysdeps-unix.c 2013-02-28 13:13:52.224615146 +0000
99 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
102 +#ifndef HAVE_GETGROUPLIST
103 +#include "getgrouplist.c"
104 +#define HAVE_GETGROUPLIST