Jump to content

Recommended Posts

Posted

This should be simple enough to answer, I hope. :) I'm in the process of moving my site over to TCH. It has a fair amount of CGI calls buried in it: most of it very low-level and straightforward, but there are a couple of scripts which call on other parts of UNIX for help.

 

I've got the paths for Perl and sendmail - they're hard to miss, being listed on the main page of CPanel and all. What are the paths for rm, date and ls?

 

I'm guessing just /bin. But, er, I'd rather not guess. :) Thanks!

Posted

Welcome to the forums, ohh! :thumbup1:

 

You should not need a path to execute rm, date and ls. Just write your script to do the following:

 

>rm /path-to-files
date
ls /path-to-list

Posted

Is this true for a Perl script running from /scgi-bin as well? On the last two servers I was on, for Perl scripts that ran as setuid, Perl considered the $PATH environment variable as potentially tainted - and so Perl would reject it, meaning I had to call rm, date and ls with full paths.

 

This is normal behavior for setuid'd Perl, or at least it was when I learned it. Of course, that was a few incarnations of Perl ago. :)

Posted

Excellent. Thanks very much!

Posted
Well if that's the case then use /usr/local/bin/ to preface the commands.

 

Uhm, could we double-check this? date seems to be located at /bin/ - at least, it functions there but doesn't at /usr/local/. I'm not yet sure about rm and ls.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...