New submission from Mathijs Brands <math...@brands.name>:

# 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).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36017>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to