That was my first thought as well. But if it was a permission problem, then neither method would work. unlink() just returns the number of files unlinked, so it returns 1 for the snippet that works and 0 for the snippet that doesn't work, in this case.
| [reply] |
| [reply] |
Thanks for your suggestions Joost. I had already tried the die "......$!" before I posted my original message. It didn't help because I'm testing this on a web server, through a browser, and the page I'm generating just terminates at the point of error without reporting the error. I also don't seem to have access to the error_log on this particular (institutional) server.
Tilly (see below) hit on the cause of the problem. Just to follow up on your suggestion, I ran the script from a command line and got another confirmation that it was the taint checking:
Insecure dependency in unlink while running with -T switch at ./de
+lete.cgi line 43.
Thanks again.
| [reply] [d/l] |