updated on Sun Jan 22 16:00:49 UTC 2012
[aur-mirror.git] / libnss-pgsql / add_primary_group.patch
blob1d57ecf2011b3518c0390e6d06e6900ae156a9fc
1 --- libnss-pgsql-1.5.0-beta/src/backend.c.org 2010-10-24 13:36:18.218410000 +0200
2 +++ libnss-pgsql-1.5.0-beta/src/backend.c 2010-10-24 13:37:56.853302000 +0200
3 @@ -757,14 +757,18 @@ size_t backend_initgroups_dyn(const char
5 rows = PQntuples(res);
7 - if(rows+(*start) > *size) {
8 + if(rows+(*start)+1 > *size) {
9 // Have to make the result buffer bigger
10 - long int newsize = rows + (*start);
11 + long int newsize = rows + (*start) + 1;
12 newsize = (limit > 0) ? MIN(limit, newsize) : newsize;
13 *groupsp = groups = realloc(groups, newsize * sizeof(*groups));
14 *size = newsize;
17 + // gid_t group should be added to the output list (man 3 initgroups)
18 + groups[*start] = group;
19 + *start += 1;
21 rows = (limit > 0) ? MIN(rows, limit - *start) : rows;
23 while(rows--) {