Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Perl backtiks run as root
nipper
I have a CGI that runs:
$cmd="/usr/bin/touch /tmp/hi";
`$cmd`;
When the cgi runs normal it is fine, but the file is owned by nobody. However I want this run as root so I chmod u+s to the cgi, now it does not run at all (I remove /tmp/hi nothing comes back)
So it appears when the CGI is setuid, it will not do a system call.
There has got to be something stupid here going on.
Tips/Pointers/RTFMs appreciated
Andy
Find more posts tagged with
Comments
Adam Stoller
Assuming this is a Perl script - I suggest you get a Perl book and look up information on 'taint' and/or the '-T' option for Perl.
Perl tries to be protective of setuid scripts and tends not to allow a number of operations that it otherwise would if the script was not setuid.
--fish
(Interwoven Senior Technical Consultant)
Migrateduser
I run a bunch of scripts as root and I had to do all the perl taint stuff to make them work. Check out this URL and it should tell you all you need to know. If you need any clarification, email me.
http://gunther.web66.com/FAQS/taintmode.html
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
nipper
Well I got my CGI to execute as root, but one of the things I wanted to run was $iwhome/bin/iwadduser.ipl which is very tainted. I tried cleaning it up, but no luck. :-(
Andy
smigster
With regard to running a CLT from a CGI -- specifically: iwextattr. I've de-tainted everything related to the DCR path and content vars used and can generate the file but setting the EA seems to require more than running the CLT in a shell script with the setuid bit set.
I'm surprised that there isn't a clearly defined, IW-endorsed method to doing this kind of thing (or, have I completely missed in in my searches?). Even though there are several ways to implement this
I'm curious as to how you do it.
TIA
smigster
DUH! Untainting the $ENV{PATH} did the trick.
Dave???? Are you sick or on vacation or something? You usually reply to posts faster than a speeding bullet or Chinese food delivery.