Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: permission denied on file write only when running browser on application server

by davido (Cardinal)
on Jul 08, 2020 at 06:31 UTC ( #11119023=note: print w/replies, xml ) Need Help??


in reply to permission denied on file write only when running browser on application server

Knowing nothing about IIS webservers, I would be inclined to add this to my CGI code:

warn join(":", scalar(getpwuid($<)), scalar(getgrgid($())), "\n"

And then look at the logs when making a request. Then verify your upload directory is writable by the user/group that showed up in the logs.


Dave

  • Comment on Re: permission denied on file write only when running browser on application server
  • Download Code

Replies are listed 'Best First'.
Re^2: permission denied on file write only when running browser on application server
by Anonymous Monk on Jul 08, 2020 at 16:29 UTC
    getpwuid and getgrgid are unimplemented by ActivePerl for Windows. Instead I used Win32::LoginName and I see my personal user ID. This agrees with several variables found in %ENV such as
    AUTH_USER
    LOGON_USER
    REMOTE_USER
    except those variables also include the domain name ("DOMAIN\userid").
    The USERNAME environment variable is showing as the server name ("MYSERVER$") and I think perhaps this is a remnant of the IIS process before it invoked the CGI module and impersonated the remote user making the request.

    Maybe there's something else in a Win32 module that I can use to diagnose the situation. For example, I'll use Win32::File to check whether the folder has the readonly attribute set.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2021-01-25 02:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?