Python with setuid
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 3 of 3
  1. #1
    grial Guest

    Python with setuid

    Hi, guys!

    I need to write a programme for user managment which would run system commands like: useradd. I thought to write this in python script (through 'commands' module ), but it seems to ignore the setuid parameter, so the script can't get the authority to do it's job. Is that ( running setuid python scripts ) something which is disabled in fedora? If that is so, can anyone recomend me a good way to run unix commands in C++, I tried the fork, exec, pipe etc. method, is there anything simplier (some library ) supplied with fedora?

    Thanks in advance!

  2. #2
    Join Date
    Aug 2004
    Location
    Czech Republic, Central Europe
    Age
    45
    Posts
    89
    Hallo,

    try set the setuid bit on /usr/bin/python - a Python interpreter. There must be any solve because the some (may be all ?) system-config-* scripts are written in Python.

    circulus
    "... Nothing Runs Like A Python ...", Fedora 16 -> Fedora 18 soon as possible :)

  3. #3
    Join Date
    Feb 2004
    Location
    Seattle, WA, USA
    Age
    61
    Posts
    3,423
    The "system-config-*" programs in /usr/bin are sym-linked to /usr/bin/consolehelper

    My suggestion: man consolehelper and DO NOT SUID python! That is a monstrous security hole and will bite you in the posterior more often than not. Playing with the suid bit is extremely dangerous, in any case.
    Linux User #28251 (April '93)
    Professional Java Geek :cool:

Similar Threads

  1. Programs ( SetUID as root )
    By overule in forum Linux Chat
    Replies: 1
    Last Post: 28th August 2006, 01:15 PM
  2. Earliest setuid
    By lemaymd in forum Security and Privacy
    Replies: 0
    Last Post: 6th June 2006, 02:21 PM
  3. FC4 setuid perl in rpm?
    By pidhead in forum Using Fedora
    Replies: 2
    Last Post: 13th July 2005, 11:01 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •