How about giving your users a child (formerly known as slave) interpreter by using the "interp create" command? And additionally using interp aliases in order to expose the infrastructure of the enclosing parent (formerly known
as master) interpreter you like to be used by your users?
HTH,
Christian
At Wed, 21 Sep 2022 15:04:17 -0700 (PDT) Christian Werner wrote:
How about giving your users a child (formerly known as slave) interpreter byI believe there is something call a "safe" interpreter. I believe this means that the interpreter is (intentionally) "missing" some procedures -- ones that
using the "interp create" command? And additionally using interp aliases in order to expose the infrastructure of the enclosing parent (formerly known as master) interpreter you like to be used by your users?
are potientally "dangerious".
man 3tcl interp
interp create ?-safe? ?--? ?path?
On Wednesday, September 21, 2022 at 10:53:24 PM UTC-3, Robert Heller wrote:
At Wed, 21 Sep 2022 15:04:17 -0700 (PDT) Christian Werner wrote:
How about giving your users a child (formerly known as slave) interpreter byI believe there is something call a "safe" interpreter. I believe this means
using the "interp create" command? And additionally using interp aliases in
order to expose the infrastructure of the enclosing parent (formerly known
as master) interpreter you like to be used by your users?
that the interpreter is (intentionally) "missing" some procedures -- ones that
are potientally "dangerious".
man 3tcl interp
interp create ?-safe? ?--? ?path?
The problem with a safe interpreter is that it has restrictions. Given that the user is supposed to be completely free to code whatever they want in their own custom procs, I probably don't want those restrictions. I just to avoid proc name conflicts.
On Wednesday, September 21, 2022 at 10:53:24 PM UTC-3, Robert Heller wrote:You can always rewrite [proc] itself to add this protection. rename proc _proc, then _proc proc {name args} {...} to write a variant that can check [info proc] to see if it exists already and fail if so, and uplevel _proc $name $args to run the "real"
At Wed, 21 Sep 2022 15:04:17 -0700 (PDT) Christian Werner wrote:
How about giving your users a child (formerly known as slave) interpreter byI believe there is something call a "safe" interpreter. I believe this means
using the "interp create" command? And additionally using interp aliases in
order to expose the infrastructure of the enclosing parent (formerly known
as master) interpreter you like to be used by your users?
that the interpreter is (intentionally) "missing" some procedures -- ones that
are potientally "dangerious".
man 3tcl interp
interp create ?-safe? ?--? ?path?The problem with a safe interpreter is that it has restrictions. Given that the user is supposed to be completely free to code whatever they want in their own custom procs, I probably don't want those restrictions. I just to avoid proc name conflicts.
On Wednesday, September 21, 2022 at 10:53:24 PM UTC-3, Robert Heller wrote:
At Wed, 21 Sep 2022 15:04:17 -0700 (PDT) Christian Werner wrote:
How about giving your users a child (formerly known as slave) interpreter byI believe there is something call a "safe" interpreter. I believe this means >> that the interpreter is (intentionally) "missing" some procedures -- ones that
using the "interp create" command? And additionally using interp aliases in
order to expose the infrastructure of the enclosing parent (formerly known >> > as master) interpreter you like to be used by your users?
are potientally "dangerious".
man 3tcl interp
interp create ?-safe? ?--? ?path?
The problem with a safe interpreter is that it has restrictions.
Given that the user is supposed to be completely free to code
whatever they want in their own custom procs, I probably don't want
those restrictions. I just to avoid proc name conflicts.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 498 |
Nodes: | 16 (2 / 14) |
Uptime: | 27:55:19 |
Calls: | 9,830 |
Calls today: | 9 |
Files: | 13,761 |
Messages: | 6,192,326 |
Posted today: | 1 |