in reply to Re: Perl, Permission and Browsers
in thread Perl, Permission and Browsers

Firstly, thanks for your help!
I just get the this error message:

CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: Can't open perl script "D:\...\cgi-bin\folder.cgi": Permission denied

Permission itself should not be the problem, I don't wxactly know how the hosing guys are handling it but they use the ftp user for authentication, all permissions I can see are -rwxrwxrwx, so that should work.

Another interesting thing is that if if go to perscript2.cgi and create a link to perlscript1.cgi from there, the problem arises in perlscript1 which worked perfectly the other way.

And one more thing: a Form on perlscript1 which calls perscript3 works perfectly with all browsers.
I'm pretty confused....

Replies are listed 'Best First'.
Re^3: Perl, Permission and Browsers
by ropey (Hermit) on Apr 21, 2005 at 09:29 UTC
    Setting to -rwxrwxrwx is not a secure idea, do -rwxr-xr-x which will allow it to be executed not seen.. it does sound that simply put your permissions are not set correctly
      Thats not quite right. If I remember correctly, to make something executable, but not viewable, you would want the permissions as

      -rwxr-x--x

      That would set the Read/Write/Execute bits on the file for the Owner, the Read/Execute bits for Group (but not Write) and Execute (no Read or Write) for World (i.e. everyone else). But, those are Unix-style permissions, not Windows. You might see the following

      -rwxrwxrwx
      permissions if you are looking at the file on a Windows machine with FTP (depending on how permissions are set for files on the Windows machine).
Re^3: Perl, Permission and Browsers
by polettix (Vicar) on Apr 21, 2005 at 10:08 UTC
    Please post the relevant sections of the two redirections. It seems strange to me that you are able to manage UNIX "-rwxrwxrwx" permissions together with files in a Win32 filesystem like "D:\...\cgi-bin\folder.cgi", so I'd rather taking a look at it.

    Flavio (perl -e "print(scalar(reverse('ti.xittelop@oivalf')))")

    Don't fool yourself.
      well, quite frankly this -rwxrwxrwx does not seem to have any impact, I only got that from my ftp-program, I'm aware that the server is on Win NT, but I only have ftp access to it.
      the first redirection is in intern.htm, the file contains only
      <META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://www.lent.ch/intern/cgi-bin/main.cgi">


      the second one is in main.cgi and looks like this:
      <td> <a href='/../intern/cgi-bin/folder.cgi?intern/$file'> $file </a></td>
      so its just a simple html-link, but these don't work with IE. However, if I create a link to a regular html-file (inside the protected folder), this works fine.
      well, quite frankly this -rwxrwxrwx does not seem to have any impact, I only got that from my ftp-program, I'm aware that the server is on Win NT, but I only have ftp access to it.
      the first redirection is in intern.htm, the file contains only
      <META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://www.lent.ch/intern/cgi-bin/main.cgi"></META +>


      the second one is in main.cgi and looks like this:<br> <td> <a href='/../intern/cgi-bin/folder.cgi?intern/$file'> $file </a>< +/td>

      so its just a simple html-link, but these don't work with IE. However, if I create a link to a regular html-file (inside the protected folder), this works fine.
        The second URL is suspect. Have you tried to remove the first part, like:
        <a href='/intern/cgi-bin/folder.cgi?intern/$file'>
        This should give you an absolute URL http://www.lent.ch/intern/cgi-bin/folder.cgi?intern/$file which I suspect is what you need. Take also into consideration mangling $file to escape bad characters that may tamper the final URL.

        Flavio (perl -e "print(scalar(reverse('ti.xittelop@oivalf')))")

        Don't fool yourself.