os.setgroups ought to accept long integer arguments, just as os.setgid does. I think this worked in an earlier version of Python - or maybe it was that string.atol used to return a non-long integer if the number was small enough, so I didn't encounter long integers at all. >>> import os >>> os.setgid(1L) >>> os.setgroups((1L,)) Traceback (most recent call last): File "", line 1, in ? TypeError: groups must be integers >>> import sys >>> print sys.version 2.3.3 (#1, Dec 30 2003, 22:52:56) [GCC 3.2.3]
Logged In: YES user_id=21627 Would that be the time to check that the value fits into a gid_t? I think the strategy would be this: - assign the value to grouplist[i] - read it back again - check if this is still the same value