The reason i ask is i am wondering i could limit lisp by limiting the packages, variables and functions allowed. I also want to keep the same functions to open files. Can files be opened without being JUDGED in the following:
This would be useful for transferring xml lisp-style, with data represented in functions,(you could allow defun to prevent data-repeat) the disallowing to make it secure. It would also need limits on loops, nestedness of recursion, for that though..
It might also be useful to be able to 'fake' files sometimes by letting the judger make up it's own stream.
Also, how do you turn off the lock for an expression?
Edit: sockets are a security threat too, CL doesn't contain any of that, does it? In the case the file uses a lib with that, one would want a similar transparent limitation.
(defun judge (filename)
(assert (not(char= (aref (namestring filename) 0) #\/)) nil
"JUDGED you may not open files from the root.")
(apply #'open opener))
(macrolet ((open (file &rest stuff)
(declare (ignore stuff))
`(judge ,file ,@stuff))
..judged part..)Was thinking of combining this with a scan of the expressions used to (dis)allow certain functions/variables.This would be useful for transferring xml lisp-style, with data represented in functions,(you could allow defun to prevent data-repeat) the disallowing to make it secure. It would also need limits on loops, nestedness of recursion, for that though..
It might also be useful to be able to 'fake' files sometimes by letting the judger make up it's own stream.
Also, how do you turn off the lock for an expression?
Edit: sockets are a security threat too, CL doesn't contain any of that, does it? In the case the file uses a lib with that, one would want a similar transparent limitation.