[ python-Bugs-869197 ] setgroups rejects long integer arguments

SourceForge.net noreply at sourceforge.net
Sun Nov 13 11:16:11 CET 2005


Bugs item #869197, was opened at 2004-01-02 10:38
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=869197&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Feature Request
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Paul Jarc (prjsf)
Assigned to: Reinhold Birkenfeld (birkenfeld)
Summary: setgroups rejects long integer arguments

Initial Comment:
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 "<stdin>", 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]


----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2005-11-13 11:16

Message:
Logged In: YES 
user_id=21627

The patch looks fine, please apply. Please remove the unused
variable check, though.

----------------------------------------------------------------------

Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-11-11 09:44

Message:
Logged In: YES 
user_id=1188172

Adding enhanced patch.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2005-10-02 10:52

Message:
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



----------------------------------------------------------------------

Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-09-29 22:36

Message:
Logged In: YES 
user_id=1188172

Attaching patch against CVS head. Please review.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=869197&group_id=5470


More information about the Python-bugs-list mailing list