Apparently inconsistent behavior in a CGI program 
Author Message
 Apparently inconsistent behavior in a CGI program

> [I have no clue whether the problem is with my use of, my use
> perl, or my use of my brain, so I didn't set follow-up - feel free to
> point it to whichever group you think is best-suited]

> Short problem description:

> This script uploads a file to a per-user directory on the server, and
> chmods it to 644 if it didn't already exists. It then displays one of
> two messages, depending on whether the file existed. Or rather, it
> should display... What happens instead is that it will only display
> "replaced" message. When it should display the 'created" message, it
> will do nothing[1], although the file is still saved in the right
> I can't see any difference that would explain it, and it doesn't seem
> be related to the OS, Apache/ version, or browser, as it was
> tested under several combos with essentially the same results.

 AFAICT there's nothing wrong with your script. I made one change to the
example you had in that I wasn't running with taint mode (-T) on - I
just set the destination dir to something writable by my webserver user.

Is there anything in apache's error-logs? You seem to be checking all
your system-calls' return values, so if your script is die-ing there
should be something there.

Oh, and there *is* a file being uploaded isn't there - the only thing
you don't seem to check is that $file is set.

- Richard Huxton

Mon, 10 Feb 2003 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Any users of JetSet out there?

2. Apparently inconsistent behavior in a CGI program

3. trailing conditional - apparently inconsistent syntax rules

4. inconsistent behavior in CGI->param()?

5. API Reference

6. Setting parent property on TDBMemo

7. TDBImage components - Arrays of

8. Speed problem with Borland TP 7

9. MSDOS: Inconsistent PERL behavior

10. Inconsistent behavior when using diagnostics

11. Bad label: _EVAL_, inconsistent behavior

12. Inconsistent behavior s/// ?


Powered by phpBB® Forum Software