]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
build: tolerate unlimited group size
authorEric Blake <eblake@redhat.com>
Mon, 16 May 2011 21:37:15 +0000 (15:37 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 17 May 2011 15:17:46 +0000 (09:17 -0600)
commitb3918fabda42e3aecf1b0bfe1079a05e6cad62f7
tree8757737ca1948b722aa74911073e480d6b1f62dd
parent00fa155578252558b8995722266c467bc11d932b
build: tolerate unlimited group size

POSIX allows sysconf(_SC_GETPW_R_SIZE_MAX) to return -1 if there
is no fixed limit, and requires ERANGE errors to track real size.
Model our behavior after the example in POSIX itself:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/getpwuid_r.html

Also, on error for get*_r functions, errno is undefined, and the
real error was the return value.

* src/util/util.c (virGetUserEnt, virGetUserID, virGetGroupID)
(virSetUIDGID):  Cope with sysconf failure or too small buffer.
Reported by Matthias Bolte.
src/util/util.c