[Openmcl-devel] modify lisp reader such that :: is disallowed
taoufik.dachraoui at wanadoo.fr
Thu Jun 11 16:03:21 UTC 2009
The best I could find without hacking the ccl lisp reader is the
(defparameter *secure-readtable* (copy-readtable nil))
#'(lambda (s c)
(declare (ignore s c))
(setq *readtable* (copy-readtable nil))
(error "use of colons is not allowed")))
? (let ((*readtable* *secure-readtable*)) (read))
> Error: use of colons is not allowed
> While executing: #<Anonymous Function #x8ABC576>, in process
> Type :POP to abort, :R for a list of available restarts.
> Type :? for other options.
1 > (get-macro-character #\:)
1 > :pop
But with this, users will not be able to use keywords either.
Is there a way to know if the colon is the first character in the token?
Does the reader has accessible working variables that we can consult?
On Jun 11, 2009, at 4:54 PM, Robert P. Goldman wrote:
> This seems like a mistake, anyway, because this won't stop a user
> from typing
> (eval (list (intern "ERASE-TAOUFIKS-HARD-DRIVE" (find-
> package :private-package))))
> I continue to think that trying to sandbox common lisp is a very big
> project for a novice.
> The browser builders are often getting sandboxing wrong for
> Robert P. Goldman
> Principal Scientist, SIFT, LLC
> ..... Original Message .......
> On Thu, 11 Jun 2009 14:40:14 +0200 "Taoufik Dachraoui" <taoufik.dachraoui at wanadoo.fr
> > wrote:
>> I tried to modify the lisp reader such that the use of :: is
>> disallowed (throws an error) but failed.
>> I tried to use set-macro-character and set-dispatch-macro-character
>> without success.
>> ? ... set new lisp reader ....
>> ? test::x
>> Error: access to not exported symbols is forbidden
>> Kind regards
>> Openmcl-devel mailing list
>> Openmcl-devel at clozure.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Openmcl-devel