From: James E. M. <jm...@tr...> - 2001-07-30 21:30:28
|
Seems like this is off topic to this list, but... From Ralf, received Sun, Jul 29, 2001 at 08:13:55PM -0700: > New Problem, I got the script working, however It can only access directory > and files that are anyways accessible by the apache daemon, so it kinda > defeats the purpouse. > > Is theer away to make some sort of handler in the conf file that is you want > to access a specific dir you need to be logged in with a certain seclev? Hmm > I guess that entire dl.pl was for the dogs anyway > In my opinion, this is dangerous, for, as you pointed out in a previous post, there is not a whole lot stopping malicious access to your computer. That's why the apache daemon is run with not much read/write privs. But if you really want to do this, I think you can set up a cgi program to copy files from the inaccessible area to the accessible area, then spit them out with apache. It seems that apache can't display files, but scripts can copy them to a place where it can. funny. maybe you can use another script to authenticate, and then a third (or a cron job) to clean out the htdocs subdirectories periodically. (I did a hack like this for a plugin to use slash to manage my digital photos. I use a form to tell the script the local dir (/pics/date) and it copies those pics to /usr/local/slash/site/blahblah/htdocs/pics/date/*.jpg and then writes thumbnails, and links to both in the slash database, so my wife can edit a website photo-album for our daughter. here is the guts of that operation sub main { ... if($op eq 'upload directory') { uploadDir(); } ... } ... sub uploadDir { my $form = getCurrentForm(); my $directory = $form->{directory}; parse_dir($directory); } ... sub parse_dir{ my $imageDir = shift(@_); my @imageList = <$imageDir/*.jpg>; my $constants = getCurrentStatic(); if( scalar(@imageList) ){ parse_list(@imageList); }else{ print ("<strong><center>Hmm, the directory $imageDir doesn't contain any jpegs in it. Perhaps you misspelled something?</center></strong>"); loadPics; } } ... (I think this is by far the stupidest (ab)use of the slash site code/plugin system, but it works for me)) james |