shellspy_module_punk::island - filesystem islands for safe interps
Package to a allow a safe interpreter to access islands of the
filesystem only, i.e. restricted directory trees within the
filesystem. The package brings back file, open and glob to the child interp
interpreter, though in a restricted manner.
JN Warning:
This mechanism can have interactions with package loading from auto_path - needs review.
Core API functions for punk::island
Add a path to the list of paths that are explicitely allowed for access
to a child interpreter. Access to any path that has not been explicitely
allowed will be denied. Paths that are added to the list of allowed
islands are always fully normalized.
Arguments:
Identifier of the child interpreter to control
Remove all access path allowance and arrange for the interpreter to be
able to return to the regular safe state.
Arguments:
Identifier of the child interpreter
Internal functions that are not part of the API
Check that the file name passed as an argument is within the islands of
the filesystem that have been registered through the add command for a
given (safe) interpreter. The path is fully normalized before testing
against the islands, which themselves are fully normalized.
Arguments:
Identifier of the child interpreter
(relative) path to the file to test
Parses the options and arguments to the file command to discover which
paths it tries to access and only return the results of its execution
when these path are within the allowed islands of the filesystem.
Arguments:
Identifier of the child interpreter
Subcommand of the file command
Arguments to the file subcommand
Parses the options and arguments to the open command to discover which
paths it tries to access and only return the results of its execution
when these path are within the allowed islands of the filesystem.
Arguments:
Identifier of the child interpreter
Arguments to the open subcommand
This procedure allows to callback a command that would typically have
been hidden from a child interpreter. It does not "interp expose" but
rather calls the hidden command, so we can easily revert back.
Arguments:
Identifier of the child interpreter
Hidden command to call
Arguments to the command
Parses the options and arguments to the glob command to discover which
paths it tries to access and only return the results of its execution
when these path are within the allowed islands of the filesystem.
Arguments:
Identifier of the child interpreter
Arguments to the glob command
Initialise child interpreter so that it will be able to perform some
file operations, but only within some islands of the filesystem.
Arguments:
Identifier of the child interpreter
Copyright © 2024