Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #75696: posix_getgrnam fails to print details of group #3464

Closed
wants to merge 1 commit into from

Conversation

@cmb69
Copy link
Contributor

commented Aug 24, 2018

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.

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.
@smalyshev smalyshev added the Bugfix label Aug 26, 2018
@cmb69

This comment has been minimized.

Copy link
Contributor Author

commented Aug 29, 2018

Unless there'll be objections, I'm going to merge this on the next weekend.

@php-pulls

This comment has been minimized.

Copy link

commented Sep 1, 2018

Comment on behalf of cmb at php.net:

Applied via 2677d43.

@php-pulls php-pulls closed this Sep 1, 2018
@cmb69 cmb69 deleted the cmb69:fix-75696 branch Sep 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.