----boundary-LibPST-iamunique-1254651559_-_-
Content-type: text/plain
Under Fyodor's suggestion it would seem that the following would still
be possible:
MODULE A; (* Defining module for exported readonly array r *)
TYPE
Array* = ARRAY OF INTEGER;
VAR
(* readonly array whose elements now can not be modified *)
r-: POINTER TO Array;
BEGIN
NEW(r, 32); (* create the array in this module *)
END A.
MODULE B; (* Client of A *)
IMPORT A;
VAR
rw: POINTER TO Array;
BEGIN
rw := A.r; (* Asssignment currently permitted under CP *)
rw[3] := 7 (* Currently permitted *)
END B.
It would seem that the variable 'rw' would need to inherit in some way
the read only condition from the variable 'r' in order to guarentee that
the elements of 'r' (and now 'rw') could not be modified in module B.
There may be other difficulties as well.
I agree with Fyodor that it should be possible to specify an array (and
arbitrary data structures) as readonly for all of its elements.
-Doug
ftkachov{([at]})nowhere.xy
> Hi!
>
> Here is another aspect of the problem of (read-only) export of array
> elements mentioned earlier:
>
> If one declares a global variable in one module:
>
> VAR a-: POINTER TO ARRAY OF INTEGER;
>
> then the array's elements are r/w accessible from the outside.
>
> I think a stricter discipline is warranted:
> exported pointer should only give automatic access to the pointer
> -- not to the elements of the structure.
>
> These problems with export of array elements constitute a security hole
> that needs to be shut.
> Especially if one has in view scientific and engineering
> applications where BB has a significant potential.
>
> Cheers
> Fyodor Tkachov
> --------------------------------------------
>
> To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
> blackbox-request{([at]})nowhere.xy>
> To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.
>
> Send any problem reports or questions related to this email list to the list owner at
> owner-blackbox{([at]})nowhere.xy>
> Current posting policy:
>
> a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.
>
> b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.
>
>
--------------------------------------------
To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
blackbox-request{([at]})nowhere.xy
To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.
Send any problem reports or questions related to this email list to the list owner at
owner-blackbox{([at]})nowhere.xy
Current posting policy:
a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.
b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.
----boundary-LibPST-iamunique-1254651559_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIFVuZGVyIEZ5b2RvcidzIHN1Z2dlc3Rpb24gaXQg
d291bGQgc2VlbSB0aGF0IHRoZSBmb2xsb3dpbmcgd291bGQgc3RpbGwgXHBhcg0KYmUgcG9zc2li
bGU6XHBhcg0KXHBhcg0KTU9EVUxFIEE7ICgqIERlZmluaW5nIG1vZHVsZSBmb3IgZXhwb3J0ZWQg
cmVhZG9ubHkgYXJyYXkgciAqKVxwYXINCiAgIFRZUEVccGFyDQogICAgIEFycmF5KiA9IEFSUkFZ
IE9GIElOVEVHRVI7XHBhcg0KICAgVkFSXHBhcg0KICAgICgqIHJlYWRvbmx5IGFycmF5IHdob3Nl
IGVsZW1lbnRzIG5vdyBjYW4gbm90IGJlIG1vZGlmaWVkICopXHBhcg0KICAgICByLTogU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