Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem running cgi script

 
Michael Eddie
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've installed and configured tomcat to run cgi scripts according to the steps provided by jakarta/tomcat's website, and can successfully run simple scripts.

My problem is when I run a script that makes a call to execute a file on my local machine within the script:
@exist=`ldapsearch.exe -1 -p $port -h $ho...`

I also am unable to write to a file within my script.

I've searched for days trying to find a solution to no avail. The files I'm working with all have the correct read/write priveleges on the windows OS, and I've even tried with no luck to edit the catalina.policy file in tomcat in order to grant priveleges to the cgi servlet and the files i'm working with.

anyone have any clue how I can resolve this?

[ July 12, 2005: Message edited by: Michael Eddie ]
[ July 12, 2005: Message edited by: Michael Eddie ]
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is your script making invalid assumptions about what the current directory is? It will likely be the directory from where you launched Tomcat.
 
Michael Eddie
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the actual code in the example above when i make the call to execute the ldapsearch.exe file contains the full path to that file:
@exist=`c:\\pathtofile\\ldapsearch.exe`;

when i try to write to a file I also supply the full path in the call.

I should also add that the script I am using works correctly from the command line.

[ July 12, 2005: Message edited by: Michael Eddie ]
[ July 12, 2005: Message edited by: Michael Eddie ]
 
Michael Eddie
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I finally found the fix by adding this line to the script:

$ENV{"SYSTEMROOT"} = "C:\\windows";
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic