Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Unavailable network drives in CGI scripts

by JediWizard (Deacon)
on Dec 13, 2006 at 16:33 UTC ( #589609=note: print w/replies, xml ) Need Help??


in reply to Unavailable network drives in CGI scripts

Without knowing what web server you are using, or how it is being run, I can't say for sure what the problem is. That being said, my first guess would be that you are having a permissions issue. CGI scripts are generally run as a different user for security reasons, and only given access to a sub set of available resources. The user under which the script is being run when used as a CGI simply may not have read permission on the mount in question.


They say that time changes things, but you actually have to change them yourself.

—Andy Warhol

Replies are listed 'Best First'.
Re^2: Unavailable network drives in CGI scripts
by Sprad (Hermit) on Dec 13, 2006 at 16:43 UTC
    This is running under IIS 5.1. I added two more lines:
    print `whoami`; print $ENV{USERNAME};
    'whoami' returned my username (not a web account), but the USERNAME environment variable was empty.

    ---
    A fair fight is a sign of poor planning.

      Try adding something like this:

      if(-d 'w:\'){ print "w:\\ is a directory\n"; if(-R 'w:\'){ print "w:\\ is readable\n"; }else{ print "w:\\ is not readbable\n"; } }else{ print "w:\\ is not a directory\n"; }

      They say that time changes things, but you actually have to change them yourself.

      —Andy Warhol

        I tried it with 'w:', 'w:\' and 'w:/'. In all three cases, it says it's not a directory.

        ---
        A fair fight is a sign of poor planning.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://589609]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (None)
    As of 2022-01-26 05:48 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      In 2022, my preferred method to securely store passwords is:












      Results (69 votes). Check out past polls.

      Notices?