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. Advertisements

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. Curt K
    Replies:
    0
    Views:
    693
    Curt K
    Nov 3, 2006
  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:
    632
    Johann C. Rocholl
    Feb 6, 2007
  3. Leyla
    Replies:
    2
    Views:
    1,032
    Leyla
    Aug 17, 2006
  4. Louis Erickson
    Replies:
    2
    Views:
    373
    James Willmore
    Sep 3, 2003
  5. Ben
    Replies:
    17
    Views:
    389
  6. Matthew Braid

    Taint differences between 5.8.0 and 5.8.1?

    Matthew Braid, Oct 22, 2003, in forum: Perl Misc
    Replies:
    1
    Views:
    126
    Rafael Garcia-Suarez
    Oct 22, 2003
  7. Dave Saville

    Find::File and taint mode

    Dave Saville, Nov 18, 2003, in forum: Perl Misc
    Replies:
    5
    Views:
    280
    Ben Morrow
    Nov 18, 2003
  8. TechCrazy
    Replies:
    4
    Views:
    241
    Fabian Pilkowski
    Jun 18, 2005
Loading...