Open Siskin-Bot opened 4 years ago
Although it is now possible to permanently protect series (values), words are not protected permanently!
>> o: object [a: 1 protect/lock 'a]
== make object! [
a: 1
]
>> o/a: 2
** Script error: protected variable - cannot modify: a
>> unprotect 'o/a
== o/a
>> o/a: 3
== 3 ;<--- should be an error!
Submitted by: BrianH
PROTECT/lock would lock the current protected, hidden or unprotected status of its argument. How much of or how deep into its argument it would apply depends on the other options provided - see #1014 for details.
It is important to note that this would also allow you to prevent something that is not protected from being protected, which could be a denial-of-service attack.
Imported from: CureCode [ Version: alpha 76 Type: Wish Platform: All Category: Security Reproduce: Always Fixed-in:none ] Imported from: https://github.com/rebol/rebol-issues/issues/1141
Comments:
In these commits I implemented
protect/permanently
. There is also difference, thatunprotect
does not throw error on locked values, but silently ignores unprotection.https://github.com/Oldes/r3/commit/053846baa6119ce087f033450c57f314c244a804 https://github.com/Oldes/r3/commit/829bd7842a53a52770e978be36882589789e1576