This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mjbrands
Recipients mjbrands
Date 2019-02-17.21:26:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550438801.86.0.404382548135.issue36017@roundup.psfhosted.org>
In-reply-to
Content
# Choose a non-existent gid.
        fakegid = 4127
        while fakegid in bygids:
            fakegid = (fakegid * 3) % 0x10000

        self.assertRaises(KeyError, grp.getgrgid, fakegid)

When a Linux system is configured to use LDAP for user and group information, there is no guarantee that grp.getgrall will actually return a complete list of all configured groups.

In my case, grp.getgrall only returns 58 groups, while there are actually tens of thousands of groups (every user has their own group, which generally only has one member). The groups return by grp.getgrall are the 'system' groups (things like daemon, wheel, etc). In our case 4127 is an existing group and grp.getgrid can query information for it (and does not thrown the expected KeyError, since it is a valid group).

Perhaps this unit test should not rely on getgrall, but relying on getgrid on the test for getgrid itself is also problematic.

I have seen this LDAP setup, where getgrall does not return the full set of groups, at two different parties with lots of users (and Novell eDirectory).
History
Date User Action Args
2019-02-17 21:26:41mjbrandssetrecipients: + mjbrands
2019-02-17 21:26:41mjbrandssetmessageid: <1550438801.86.0.404382548135.issue36017@roundup.psfhosted.org>
2019-02-17 21:26:41mjbrandslinkissue36017 messages
2019-02-17 21:26:41mjbrandscreate