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: test_tcl aborts on OS X 10.6 with "The application with bundle ID org.python.python is running setugid(), which is not allowed."
Type: crash Stage: needs patch
Components: Versions: Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: gregory.p.smith Nosy List: barry, benjamin.peterson, fdrake, gregory.p.smith, ned.deily, ronaldoussoren
Priority: release blocker Keywords: patch

Created on 2010-03-03 02:33 by ned.deily, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (8)
msg100326 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2010-03-03 02:33
potential 2.6.5 release blocker

The changes introduced for Issue7999 in r78546, r78547, r78548, r78549 cause test_tcl to fail when it is run after test_os, as is normal under regrtest.  The problem is that the posixmodule was modified to accept values of -1 for setreuid and setregid and, although the tests added for them claim that they do nothing, on OS X 10.6 (in a framework build at least) they do have a side effect.  A simplified test case demonstrates:

$ ./python
Python 2.6.5rc1 (release26-maint, Mar  2 2010, 15:22:31) 
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from Tkinter import Tcl
>>> Tcl().loadtk()  # Tk window opens
>>> ^D
$ ./python
Python 2.6.5rc1 (release26-maint, Mar  2 2010, 15:22:31) 
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from Tkinter import Tcl
>>> import os
>>> os.getuid(), os.geteuid()
(501, 501)
>>> os.setreuid(-1, -1)
>>> os.getuid(), os.geteuid()
(501, 501)
>>> Tcl().loadtk()
2010-03-02 18:20:28.375 Python[21147:60f] The application with bundle ID org.python.python is running setugid(), which is not allowed.
$ ./python
Python 2.6.5rc1 (release26-maint, Mar  2 2010, 15:22:31) 
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from Tkinter import Tcl
>>> import os
>>> os.getgid(), os.getegid()
(20, 20)
>>> os.setregid(-1, -1)
>>> os.getgid(), os.getegid()
(20, 20)
>>> Tcl().loadtk()
2010-03-02 18:25:15.952 Python[21163:60f] The application with bundle ID org.python.python is running setugid(), which is not allowed.

Searching the web for "running setugid(), which is not allowed" shows various programs affected by this change in OS X 10.6, apparently to close a security hole.

Unfortunately, the module and test changes cause the standard python regression test to abort at test_tcl. For 2.6.5 at least, suggest disabling the two new -1, -1 tests on OS X.  (I assume that the other branches exhibit the same behavior but I haven't explicitly tested them yet.)
msg100327 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2010-03-03 02:37
(Thanks to Tom Loredo for bringing up the issue on the pythonmac-sig list.)
msg100330 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2010-03-03 02:47
Just disabling those two tests is the best thing for the 2.6.5 release if we don't get around to the actual fix:

Since calling setreuid(-1, -1) is apparently not such a no-op on all systems these tests would be better if we ran them in a subprocess so that they don't alter the main test runner process state.
msg100393 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2010-03-04 15:54
Confirmed as a release blocker for 2.6.5.  GPS's suggestion seems reasonable, though a bit more work.  Please submit a patch that we can review.  We're going to need a 2.6.5rc2 anyway.
msg100520 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2010-03-06 07:37
See trunk r78718 for my proposed fix.
msg100546 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2010-03-06 20:35
Ported Gregory's fix to py3k and 3.1.
msg100547 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2010-03-06 21:14
Moving the test to a child process does avoid the problem.
(BTW, so far I've only seen the failure when Tkinter is linked with the Apple-supplied Tk 8.5 in 10.6, not with Tk 8.4.)
msg100564 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2010-03-07 06:00
merged into release26-maint r78754.
History
Date User Action Args
2022-04-11 14:56:58adminsetgithub: 52293
2010-03-07 06:00:22gregory.p.smithsetstatus: open -> closed
resolution: fixed
messages: + msg100564
2010-03-06 21:14:54ned.deilysetmessages: + msg100547
2010-03-06 20:35:19benjamin.petersonsetnosy: + benjamin.peterson

messages: + msg100546
versions: - Python 3.1, Python 3.2
2010-03-06 07:37:11gregory.p.smithsetmessages: + msg100520
2010-03-04 15:54:04barrysetkeywords: + patch

messages: + msg100393
stage: needs patch
2010-03-03 20:21:42fdrakesetnosy: + fdrake
2010-03-03 02:47:39gregory.p.smithsetpriority: release blocker
assignee: gregory.p.smith
messages: + msg100330
2010-03-03 02:37:30ned.deilysetmessages: + msg100327
2010-03-03 02:33:52ned.deilycreate