Subj : Re: CGI questiuon To : Scott Adams From : Jasen Betts Date : Tue Dec 09 2003 07:01 pm Hi Scott. 28-Nov-03 04:57:18, Scott Adams wrote to Jasen Betts JB>> I want to serve a binary files to an HTTP client (like wget) from JB>> a CGI script, is that posssible? JB>> The plan is to have one/some of my machines requesting files over JB>> the network and have the CGI script on the server coordinating JB>> the cd-draw to change discs depending on the path the script JB>> gets. SA> There could be some serious security issues if its done wrong for SA> the network. I'm not a network person myself so couldn't help you SA> on the details but what id o know if a script is involved just SA> have to be very very careful :) I've got the CGI working now but I wimped out of using perl and ended up doing it in about 30 lines of bash, it doesn't do any URL traslaition or anything fancy, it just grabs a CD name from $PATH_INFO in the environment and the filename from the query string (command-line) spits out the CD if it's not the one it wants and uses "wall" to hassle anyone nearby (IOW me) to feed it the apropriate disk. and once satisfied responds with a "location" message that points the server (apache at the moment) at a symlink to the cdrom drive's mount point so far "the network" is three PCs within arm's reach of me but one of them's going into the spare room later this month. I'm not planning on opening port 80 to the world for a while yet. and if I do I'll put an IP address check near the start of the script and give foreigners a 404 hmm speaking of 404s... you get to give a text (or html etc) message for interactive users to read... I wonder if I could grab the output of /usr/games/fortune bofh (which emits BOFH excuses for computer problems) and insert that into the error page :) -=> Bye <=- --- * Origin: Dogs come when you call, cats have answering machines (3:640/1042) .