Author Topic: Software error  (Read 6989 times)

0 Members and 1 Guest are viewing this topic.

Offline Catcherman

  • album.pl User
  • *
  • Posts: 6
  • Karma: +0/-0
  • Do more than just get your tackle wet.
    • catcherman.com
Software error
« on: April 14, 2003, 14:46:17 »
I did search this forum, but didn't find this item answered specifically.

I'm getting an error page when I try to upload my images:

Software error:
CGI open of tmpfile: Permission denied

For help, please send mail to this site's webmaster, giving this error message and the time and date of the error. [Mon Apr 14 12:34:55 2003] C:\Client Websites\www.catcherman.com\web\cgi-bin\album.pl: CGI open of tmpfile: Permission denied


This is on a IIS5, Win2K Server box.

I have set the photoalbum directory to have read, write, and execute, as well as album.pl.  What else do I need to do?

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re:Software error
« Reply #1 on: April 14, 2003, 15:19:31 »
« Last Edit: April 14, 2003, 15:20:35 by Mike Bobbitt »

Offline Catcherman

  • album.pl User
  • *
  • Posts: 6
  • Karma: +0/-0
  • Do more than just get your tackle wet.
    • catcherman.com
Re:Software error
« Reply #2 on: April 14, 2003, 16:25:27 »
I saw that one, but it didn't help.

I'm working on the server and the only way to get the temp directory to work is to give write permission to my root directory - that's where it's wanting the temp directory to be.

How can I change the location of the temp directory that it wants?  It seems like that would be in your code somewhere, but I can't find it.

Thanks for your help.

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re:Software error
« Reply #3 on: April 15, 2003, 08:02:51 »
I think you've slightly missed the problem... When you upload to your web server (from anything, including album.pl) the web server wants to write that into it's defined temp directory. Where that is depends on each web server installation.

In this case, your web server's defined temp directory isn't writable to the web server, so it can't create the file that it's trying to. It's not a setting in album.pl, but a problem with your web server. You just never noticed it before because you probably never uploaded to it...

Hope that helps.

Cheers

Offline Jrodden

  • album.pl User
  • *
  • Posts: 2
  • Karma: +0/-0
  • I'm a llama!
Re:Software error
« Reply #4 on: April 16, 2003, 13:04:32 »
I am working with catcherman on this issue. The windows temp directory has the appropriate permissions on it. The issue is why must iusr_servername have write permission to the root of the configured website.

Hope this sheds more light

John

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re:Software error
« Reply #5 on: April 16, 2003, 14:21:10 »
Hi John,

The Windows temp directory may not be what the web server is using. As far as I'm concerned, the web server *doesn't* need to have write permission to the web site's root. Not sure where that comes into play...

Cheers

Offline Jrodden

  • album.pl User
  • *
  • Posts: 2
  • Karma: +0/-0
  • I'm a llama!
Re:Software error
« Reply #6 on: April 16, 2003, 14:27:34 »
When the write permissions are set off on the site root the process fails, but when the permissions are set on the process is successful and a file called CGItemp58399 is created in the root of the site.

The file has no extension.
What does that filename mean to you?

Thanks
John

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re:Software error
« Reply #7 on: April 16, 2003, 16:03:08 »
Aha!

So that's where your web server is writing the temp files. Just to be clear: this has nothing to do with album.pl, and everything to do with the web server.

Your best bet then is to move the web server's temp directory out of the root - having it writable is just as big a security problem as having temp files accessible via the web!

I wish I could tell you how to do that, but I'm not that familiar with IIS... It might be under server properties --> home directory --> configuration --> cache options --> disk cache directory.

Hope that helps...

Offline Catcherman

  • album.pl User
  • *
  • Posts: 6
  • Karma: +0/-0
  • Do more than just get your tackle wet.
    • catcherman.com
Re:Software error
« Reply #8 on: April 29, 2003, 13:27:44 »
All if the IIS professionals I have spoken to have told me that the temp directory would not be set by IIS, but instead by the CGI code.

I'm stuck in the middle here.  Hopefully the new download of 6.2 will make a difference.

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re:Software error
« Reply #9 on: April 30, 2003, 06:04:04 »
It won't.

This is definitely an IIS issue. Maybe it's time to switch professionals... :)

Seriously though, I've seen this before and fixed it many times on Apache. If you doubt it, try another upload script, and I guarantee you'll get the same result. When the web server attempts to write to the same temp dir again, the same error will occur...

Sorry to hear you're not seeing progress on this...

Here's some more info on the problem for you, from alt.perl:

Quote
Hi Folks,

New to writing CGI code with Perl.

I am trying to write a file upload program for an IIS5 webserver using
CGI.pm.

I keep getting this very helpful error msg. from IIS "CGI open of tmpfile:
Permission denied".

Would someone please be so kind as to point me in the right direction?

Thank you.

Quote
Actually, with a little further investigation [it was not however, so
obvious] it turned out that CGI.pm was attempting to write to the c:\temp
directory on the machine in question. So indeed, it was permissions issue,
but not one that I had anticipated. Basically, the IUSR_machinename account
requires write access to c:\temp, otherwise it fails with the error note in
the subject.

Hopefully that will help you isolate it...

Cheers