> > Need a perl CGI script that will print to a web page the 
> contents of a
> > directory specified in the program.  Basically i need the 
> > perl program to
> > simply call the unix "ls" function, not sure how to 
> > encorporate this into my
> > script though, any ideas?
> 
> system() will work, however you will have to be careful to 
> not allow input like this in the web page:
> 
> /home/foo/$(rm -rf /*)
> /foo/bar`really bad thing`
> etc etc
> 
> Read up on "taint" mode, if you want to be super safe.
> Luke

Of course, a better solution would be to emulate "ls" by use of the readdir() and 
stat() functions in perl.

Luke

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to