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.

classification
Title: os.getpwent returns unsigned 32bit value, os.setuid refuses it
Type: behavior Stage: resolved
Components: Versions: Python 3.0, Python 3.1
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: gregory.p.smith Nosy List: boya, ezio.melotti, gregory.p.smith, joe.amenta, ned.deily, vstinner
Priority: normal Keywords: 64bit, patch

Created on 2009-04-05 22:37 by gregory.p.smith, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
patch_5705.diff boya, 2009-09-01 22:34
Messages (10)
msg85582 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2009-04-05 22:37
Running test_httpservers on a 64-bit build of Python 2.7 trunk on OS X
10.5:  (I added a print "nobody=", nobody)

test_authorization (__main__.CGIHTTPServerTestCase) ... nobody= 4294967294
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 55322)
Traceback (most recent call last):
  File "/Users/greg/sandbox/python/trunk/Lib/CGIHTTPServer.py", line
251, in run_cgi
    os.setuid(nobody)
OverflowError: signed integer is greater than maximum
msg85588 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2009-04-05 23:44
Fixed in r71299 trunk.  Needs backporting to release26-maint and
release30-maint.  (I'm waiting for buildbot results before I do that)
msg85615 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2009-04-06 06:50
merged into release26-maint.  release30-maint still needed.
msg85617 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2009-04-06 07:26
Closes duplicate Issue3586?
msg87064 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2009-05-03 20:22
release30-maint r72245 (its already been merged into py3k).
msg92144 - (view) Author: Boya Sun (boya) Date: 2009-09-01 22:34
Another potential bug discovered in posixmodule.c in the function
posix_lchown:

posix_lchown(PyObject *self, PyObject *args)
{
        ...
 	int uid, gid;
        ...
 	if (!PyArg_ParseTuple(args, "etii:lchown",
 	                      Py_FileSystemDefaultEncoding, &path,
 	                      &uid, &gid))
        ...
}

uid and gid could also cause over flow. Patch attached.

Hope some one can comment on the patch, thanks a lot!
msg92399 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2009-09-07 23:21
@boya: It's maybe better to open a new issue for posix_lchown.
msg92466 - (view) Author: Boya Sun (boya) Date: 2009-09-09 21:05
Created issue 6879 following Victor's suggestion.
msg92468 - (view) Author: Boya Sun (boya) Date: 2009-09-09 21:07
Sorry, typo.

Created issue 6873 following Victor's suggestion.
msg108758 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2010-06-26 23:20
I think this can be closed, now that there is another issue for posix_lchown.
History
Date User Action Args
2022-04-11 14:56:47adminsetgithub: 49955
2010-06-26 23:20:59ezio.melottisetstatus: open -> closed

nosy: + ezio.melotti
messages: + msg108758

stage: resolved
2009-09-09 21:07:30boyasetmessages: + msg92468
2009-09-09 21:05:54boyasetmessages: + msg92466
2009-09-07 23:21:34vstinnersetnosy: + vstinner
messages: + msg92399
2009-09-02 20:55:27joe.amentasetnosy: + joe.amenta
2009-09-02 20:42:21brett.cannonsetstatus: closed -> open
2009-09-01 22:34:52boyasetfiles: + patch_5705.diff

nosy: + boya
messages: + msg92144

keywords: + patch
2009-05-03 20:22:00gregory.p.smithsetstatus: open -> closed
resolution: fixed
messages: + msg87064
2009-04-06 16:14:30gregory.p.smithlinkissue3586 dependencies
2009-04-06 07:26:51ned.deilysetnosy: + ned.deily
messages: + msg85617
2009-04-06 06:50:46gregory.p.smithsetmessages: + msg85615
versions: - Python 2.6
2009-04-05 23:44:53gregory.p.smithsetmessages: + msg85588
versions: - Python 2.7
2009-04-05 22:37:55gregory.p.smithcreate