Skip to content

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

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

Closed
wants to merge 1 commit into from

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 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 Bug label Aug 26, 2018
@cmb69
Copy link
Member Author

cmb69 commented Aug 29, 2018

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

@php-pulls
Copy link

Comment on behalf of cmb at php.net:

Applied via 2677d43.

@php-pulls php-pulls closed this Sep 1, 2018
@cmb69 cmb69 deleted the fix-75696 branch September 1, 2018 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants