Tags:
create new tag
view all tags

Question

I had a really wierd problem with my webserver setting the cwd for the scripts to the root directory of the webserver instead of the directory of the script. This ruins everything.

Below I show what I have added to the scripts to hopefully make this work.

  • TWiki version: Sept 2001
  • Web server: IIS5.0 (but I suspect with an II3.0 compatibility mode)
  • Server OS: Windows 2000 Advanced Server
  • Web browser: IE 5.0
  • Client OS: Any

-- MartinCleaver - 04 Oct 2001

Answer

Insert this in every file in /bin immediately after the #! perl line:

BEGIN{($_=$0)=~s!(.*)[\\/][^\\/]+$!!;chdir $1}

For what it does, see http://www.rcbowen.com/imho/perl_cwd_iis.html I modified it to make it work in taint mode.

-- MartinCleaver - 04 Oct 2001

Please rename this to Bizarre ... (Also, surely I should be able to rename my own topic, especially if no-one has made changes!!)


Category: TWikiPatches
Topic attachments
I Attachment History Action Size Date Who Comment
HTMLhtm cwdunderPerlonIIS.htm r1 manage 7.4 K 2003-10-04 - 21:41 UnknownUser  
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2003-10-04 - MartinCleaver
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.