taint: system vs. backticks and permissions

Discussion in 'Perl' started by Kristina Clair, Aug 27, 2004.

  1. Hi,

    I have a perl script running suid root (thus running in taint mode), and
    I'm trying to execute a shell command. Usually I do this using
    backticks so I can get the output, and usually it is not a problem.

    However, in this instance I am trying to execute a python script, and
    the python script does not seem to be running as root, but as the apache
    user.

    Interestingly, using system() changes this and the python script runs
    appropriately as root. But, I'm having the following problems:

    - if I use system("/python/command args") then the python script
    executes appropriately but the output from the python script is being
    sent to httpd and i'm getting an internal server error due to malformed
    headers

    - if I use system("/python/command args >/dev/null") perl does not like
    this at all and it seems to not only not execute the python script, but
    it runs the perl script again from the beginning (!?!?!?!)

    So I'm very confused by this behavior. Does anyone have any ideas about
    what is going on? What is the difference between using backticks and
    system() in terms of how the perl script is calling the python script?
    And is there a way for system() to be happy but not send output to httpd?

    Thanks for any help.
    Kristina
     
    Kristina Clair, Aug 27, 2004
    #1
    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. Scott Allen
    Replies:
    0
    Views:
    440
    Scott Allen
    Jul 13, 2004
  2. Johann C. Rocholl

    Taint (like in Perl) as a Python module: taint.py

    Johann C. Rocholl, Feb 5, 2007, in forum: Python
    Replies:
    5
    Views:
    477
    Johann C. Rocholl
    Feb 6, 2007
  3. Leyla
    Replies:
    2
    Views:
    691
    Leyla
    Aug 17, 2006
  4. Ben
    Replies:
    17
    Views:
    237
  5. TechCrazy
    Replies:
    4
    Views:
    144
    Fabian Pilkowski
    Jun 18, 2005
Loading...

Share This Page