]> granicus.if.org Git - php/commit
Fix #75696: posix_getgrnam fails to print details of group
authorChristoph M. Becker <cmbecker69@gmx.de>
Fri, 24 Aug 2018 15:59:44 +0000 (17:59 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Sat, 1 Sep 2018 12:25:59 +0000 (14:25 +0200)
commit2677d438502b68a967d46ffadfadc138070ce762
treeab9af111fb20419c5fbe95841200b3bd4d2f7d41
parent7fb7869e13999f419787f56340ca4b4dbbb4eef8
Fix #75696: posix_getgrnam fails to print details of group

According to the POSIX specification of `getgrnam_r()` the result of
`sysconf(_SC_GETGR_R_SIZE_MAX)` is an initial value suggested for the
size of the buffer, and `ERANGE` signals that insufficient storage was
supplied.  So if we get `ERANGE`, we try again with a buffer twice as
big, and so on, instead of failing.
NEWS
ext/posix/posix.c
ext/posix/tests/bug75696.phpt [new file with mode: 0644]