
Perl script inherited permissions
I am currently trying to code a perl script that will get the directory listing of a folder I'm hosting with Apache. The problem right now is with the way I have my server set up. In the httpd.conf, for the directory I want the perl script to be able to list all files and folders, I'm using the following rules:
Options +ExecCGI
AddHandler cgi-script cgi pl
<Files ~ "\.(mp3)$">
Order allow,deny
Deny from all
</Files>
Satisfy any
Allow from all
I have authentication set up so that when a user logs in, they are able to see all files and directories. If they are an anonymous user, I want to hide files from them within the directory. But therein lies the problem - my perl script doesn't get handed the permissions of the authenticated user, so when i use the get() command to get the directory listing, it returns back a page that is hiding the mp3 files (in this example.) So what I'm wanting to know is whether there is some rule/option/environmental that will allow the perl script to properly use the get() command with the right permissions. I don't know if there is an easier way to do what I'm trying to do, but I suppose I could have the perl script access the file system, instead of using get() and going through apache.. but this way was much easier as it is only one line of code.
Thanks, and sorry if that was confusing - I'm fairly new to all of this