edwardcapriolo commented on PR #8177: URL: https://github.com/apache/hadoop/pull/8177#issuecomment-3741526716
Ok I have it sorted: https://man7.org/linux/man-pages/man3/getpwnam.3p.html Note that sysconf(_SC_GETPW_R_SIZE_MAX) may return -1 if there is no hard limit on the size of the buffer needed to store all the groups returned. This example shows how an application can allocate a buffer of sufficient size to work with getpwnam_r(). Both examples are wrong. You need to detect error and grow the buffer. Yikes while ((e = getpwnam_r("someuser", &result, buffer, len, &resultp)) == ERANGE) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
