Mercurial > p > roundup > code
comparison roundup/scripts/roundup_server.py @ 3733:2addec69757a
fix: setuid called when run by non-root
| author | Alexander Smishlajev <a1s@users.sourceforge.net> |
|---|---|
| date | Sun, 29 Oct 2006 05:01:15 +0000 |
| parents | f2fda3e6fc8b |
| children | a2d22d0de0bc |
comparison
equal
deleted
inserted
replaced
| 3732:0cc9b954f1f1 | 3733:2addec69757a |
|---|---|
| 15 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 15 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 16 # | 16 # |
| 17 | 17 |
| 18 """Command-line script that runs a server over roundup.cgi.client. | 18 """Command-line script that runs a server over roundup.cgi.client. |
| 19 | 19 |
| 20 $Id: roundup_server.py,v 1.83 2006-04-27 04:59:37 richard Exp $ | 20 $Id: roundup_server.py,v 1.84 2006-10-29 05:01:15 a1s Exp $ |
| 21 """ | 21 """ |
| 22 __docformat__ = 'restructuredtext' | 22 __docformat__ = 'restructuredtext' |
| 23 | 23 |
| 24 import errno, cgi, getopt, os, socket, sys, traceback, urllib, time | 24 import errno, cgi, getopt, os, socket, sys, traceback, urllib, time |
| 25 import ConfigParser, BaseHTTPServer, SocketServer, StringIO | 25 import ConfigParser, BaseHTTPServer, SocketServer, StringIO |
| 322 return | 322 return |
| 323 raise ValueError, _("Can't run as root!") | 323 raise ValueError, _("Can't run as root!") |
| 324 | 324 |
| 325 if os.getuid(): | 325 if os.getuid(): |
| 326 print _('WARNING: ignoring "-u" argument, not root') | 326 print _('WARNING: ignoring "-u" argument, not root') |
| 327 return | |
| 327 | 328 |
| 328 try: | 329 try: |
| 329 import pwd | 330 import pwd |
| 330 except ImportError: | 331 except ImportError: |
| 331 raise ValueError, _("Can't change users - no pwd module") | 332 raise ValueError, _("Can't change users - no pwd module") |
