[Openmcl-devel] modify lisp reader such that :: is disallowed

Taoufik Dachraoui taoufik.dachraoui at wanadoo.fr
Thu Jun 11 08:09:35 PDT 2009


Hi

Users will not have access to intern, find-package, ...

I implemented a loader that exports public symbols and shadow unwanted  
symbols
so that users will not be able to use any private or shadowed symbols.

the only problem I am facing today (as far as I can see right now) is to
disallow users to access non exported symbols by using the double  
colons (::)

I tried to use set-macro-character and set-dispatch-macro-character  
but failed, and
the reason is that the lisp reader as soon as it finds a macro- 
character the previously
read word will be considered as a token and there is no way to rollback.

For this reason I am trying to find a hack to modify the ccl lisp  
reader as follows:

1. add parameter *use-double-colon*  (default to t)
2. when (null *use-double-colon*) then the lisp reader must reject any  
use of double colon

Example:

(let ((*use-double-colon* nil))
	(read-from-string "test::x"))
=> Error: use of double colons are not allowed


The portability is not an issue for me (at least now), and would like  
to hack the ccl
lisp reader for performance reason (eg. do not want to use a new lisp  
reader on top
of the already existing ccl lisp reader)

Kind regards

-Taoufik


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  
> javascript, whích is a much simpler language.
> ___
> Robert P. Goldman
> Principal  Scientist, SIFT, LLC
> www.sift.info
>
> ..... Original Message .......
> On Thu, 11 Jun 2009 14:40:14 +0200 "Taoufik Dachraoui" <taoufik.dachraoui at wanadoo.fr 
> > wrote:
>> Hi
>>
>> 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.
>>
>> example:
>>
>> ? ... set new lisp reader ....
>> ? test::x
>> Error: access to not exported symbols is forbidden
>>
>>
>> Kind regards
>>
>> -Taoufik
>>
>> _______________________________________________
>> Openmcl-devel mailing list
>> Openmcl-devel at clozure.com
>> http://clozure.com/mailman/listinfo/openmcl-devel
>
>





More information about the Openmcl-devel mailing list