]> git.proxmox.com Git - mirror_corosync.git/commit
getpwnam_r()/getgrnam_r() returns ERANGE for some systems
authorTim Beale <tim.beale@alliedtelesis.co.nz>
Wed, 6 Jul 2011 13:31:45 +0000 (06:31 -0700)
committerSteven Dake <sdake@redhat.com>
Wed, 6 Jul 2011 13:31:50 +0000 (06:31 -0700)
commitba107f0a33fd5e6ef4073b9cc5539740e6ae3c12
tree7c98efbc4b2ddd25d8d3c34310506eab593547c0
parent5dc33c2824e9fd2b8c18e2e30cf60210c5e8617e
getpwnam_r()/getgrnam_r() returns ERANGE for some systems

On our system the expected buffer length is 256. This means calls to
getpwnam_r()/getgrnam_r() return ERANGE error and corosync fails to startup.
These 2 functions return ERANGE when insufficient buffer space is supplied.
Judging by the man page for getpwnam_r, the correct way to determine the
buffersize on any given system is to use sysconf().

Signed-off-by: Tim Beale <tim.beale@alliedtelesis.co.nz>
Reviewed-by: Steven Dake <sdake@redhat.com>
exec/mainconfig.c