Merge pull request #3647 from urbit/m/eyre-binding-restriction

eyre: prevent binding in reserved namespaces
This commit is contained in:
fang 2020-10-06 18:03:35 +02:00 committed by GitHub
commit fac890e577
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1772,6 +1772,12 @@
|= [=binding =action] |= [=binding =action]
^- [(list move) server-state] ^- [(list move) server-state]
=^ success bindings.state =^ success bindings.state
:: prevent binding in reserved namespaces
::
?: ?| ?=([%'~' *] path.binding) :: eyre
?=([%'~_~' *] path.binding) :: runtime
==
[| bindings.state]
(insert-binding [binding duct action] bindings.state) (insert-binding [binding duct action] bindings.state)
:_ state :_ state
[duct %give %bound success binding]~ [duct %give %bound success binding]~