BaseHTTPServer and priviledge separation?

Discussion in 'Python' started by Helmut Jarausch, Jun 25, 2005.

  1. Hi,

    to use a port below 1000 on a Unix system one needs root priviledges.
    But it's dangerous to execute all of a script under those priviledges.
    Therefore I'd like to drop the root priviledges as soon as possible.
    (How) is this possible?

    Many thanks for a hint,

    Helmut Jarausch

    Lehrstuhl fuer Numerische Mathematik
    RWTH - Aachen University
    D 52056 Aachen, Germany
     
    Helmut Jarausch, Jun 25, 2005
    #1
    1. Advertising

  2. Helmut Jarausch

    Lee Harr Guest

    > to use a port below 1000 on a Unix system one needs root priviledges.
    > But it's dangerous to execute all of a script under those priviledges.
    > Therefore I'd like to drop the root priviledges as soon as possible.
    > (How) is this possible?
    >



    Are you sure you don't just want to use twisted?
    http://twistedmatrix.com/

    It is a bit more complex to start, but for just serving
    web pages it may actually be simpler. Plus you get a
    lot of extra functionality built in (like dropping
    privelege and chroot).

    Looking at the code for twistd, they use os.setuid
    and os.setgid
     
    Lee Harr, Jun 25, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wayne Liu

    Question on view and code separation

    Wayne Liu, Jul 25, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    357
    Wayne Liu
    Jul 25, 2003
  2. noone
    Replies:
    4
    Views:
    292
    noone
    Jan 23, 2007
  3. Peter Schuller
    Replies:
    23
    Views:
    679
    NickC
    Feb 4, 2008
  4. Alexander
    Replies:
    41
    Views:
    1,055
    Jorgen Grahn
    Jul 25, 2010
  5. Alexander
    Replies:
    38
    Views:
    970
    Öö Tiib
    Jul 23, 2010
Loading...

Share This Page