Description
Under Windows the standalone server fail to start with the following message if port < 1024 was used.
File "C:\Documents and Settings\darkstar\Application Data\Python\Python26\site-packages\MoinMoin\web\serving.py", line 140, in run_server if port < 1024 and os.getuid() != 0: AttributeError: 'module' object has no attribute 'getuid'
Steps to reproduce
Run
moin --config-dir=your_wiki server standalone --port=80
Details
MoinMoin Version |
1.9.1 |
OS and Version |
Windows 2000 SP4 |
Python Version |
2.6.4 |
Server Setup |
Standalone |
Server Details |
|
Language you are using the wiki in (set in the browser/UserPreferences) |
russian |
Workaround
Replace
if port < 1024 and os.getuid() != 0:
with
if port < 1024 and os.name == 'posix' and os.getuid() != 0:
in !MoinMoin/web/serving.py (the fix is the same as suggested in MoinMoinBugs/GetuidErrorOnStartup)
Discussion
- I would suggest not to test for the privileges like this under posix-like systems. Many new security models use delegation or least privilege models (like solaris RBAC and privileges or security add-ons for linux). Isn't it possible to catch the exception when binding to the port? This would allow security models other than "root is always needed" to work.
- Good idea, can you provide a patch?
Plan
- Priority:
- Assigned to:
Status: fixed by http://hg.moinmo.in/moin/1.9/rev/9b85f7601772