bpo-35070: test_getgrouplist may fail on macOS if too many groups by websurfer5 · Pull Request #13071 · python/cpython
The test_getgroups subtest fails when the current user running the test belongs to the maximum number supplemental groups. It fails because posix.getgrouplist() passes an array to the POSIX API function getgrouplist() that is too small. It uses NGROUPS_MAX to determine the size of the array that it passes to getgrouplist() to be filled with the user's GIDs. NGROUPS_MAX is defined by POSIX.1 as the maximum number of supplimental groups a user can belong to. The value has to be increased by one because getgrouplist() returns both the supplemental groups and the primary group, i.e. all of the groups the user belongs to. NGROUPS_MAX is defined as 16 on OS X systems, so the test fails when the user belongs to 16 supplemental groups because it passes an array with 16 elements to receive the GIDs, but getgrouplist() returns an error because it wants to return 17 GIDs (the primary plus 16 supplemntals). This problem most likely is not seen on Linux systems because they typically have a much higher limit for supplemental groups (e.g. 65,536 on Ubuntu 16.04.4).
websurfer5
changed the title
BPO-35070: test_posix fails on macOS 10.14 Mojave
bpo-35070: test_posix fails on macOS 10.14 Mojave
ned-deily
changed the title
bpo-35070: test_posix fails on macOS 10.14 Mojave
bpo-35070: test_getgrouplist may fail on macOS if too many groups
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
Jun 13, 2019…thonGH-13071) (cherry picked from commit 8725c83) Co-authored-by: Jeffrey Kintscher <49998481+websurfer5@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
Jun 13, 2019…thonGH-13071) (cherry picked from commit 8725c83) Co-authored-by: Jeffrey Kintscher <49998481+websurfer5@users.noreply.github.com>
miss-islington added a commit that referenced this pull request
Jun 13, 2019miss-islington added a commit that referenced this pull request
Jun 13, 2019This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters