I am trying to program a web interface for automated generation of calculus tests. The idea is to take some input from user, say number of problems and name of instructor, and then by means of php generate the latex file, process it with pdflatex and let user download it.
The procedure seems to be quite straightforward. But what if somebody enters for instructor name something like "Mr. Mackey \input{/etc/hosts}" ?
looks like one can retrieve any file accessible to web server.
How to prevent this? May be there are natural php ways? I am very new to php, and would appreciate any advice.
\includeand you will see it fail. Please do aman pdftexand read the comments intexmf.cnf. And of course usechrootandulimit. – Martin Schröder Dec 13 '12 at 07:46:)– Paulo Cereda Dec 14 '12 at 16:48bash, a command line such asopenin_any=p pdflatex fileworks as well. – egreg Dec 14 '12 at 16:59