Skip to content

Commit aebdf2b

Browse files
committed
all: do not use the word "sandbox" to describe interp's handlers
They do not provide any form of security isolation, so avoid any potential confusion with users.
1 parent c6351e9 commit aebdf2b

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ expand `$VAR` and `~` in strings, and glob with `**` or match `case`-style patte
1818

1919
To run shell scripts without a system shell, including on Windows,
2020
see the [interp package](https://pkg.go.dev/mvdan.cc/sh/v3/interp);
21-
its handlers allow sandboxing what scripts can execute and access.
21+
its handlers allow configuring what scripts can execute and access.
2222

2323
### shfmt
2424

‎interp/api.go‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@
55
// parsed by the [syntax] package as either [syntax.LangBash]
66
// or [syntax.LangPOSIX], behaving like Bash as a result.
77
//
8-
// Scripts run without a system shell, so they work on any platform including
9-
// Windows. Handlers such as [ExecHandler], [OpenHandler], and [ReadDirHandler2]
10-
// replace how programs are executed and files are accessed, allowing scripts
11-
// to be sandboxed or run against virtual filesystems.
8+
// Scripts run without a system shell, so they work on any platform including Windows.
9+
// Handlers such as [ExecHandler], [OpenHandler], and [ReadDirHandler2]
10+
// replace how programs are executed and files are accessed,
11+
// allowing scripts to be controlled or run against virtual filesystems.
1212
// The [mvdan.cc/sh/x/coreutils] package provides portable
1313
// implementations of common utilities like cat, cp, and find.
1414
//
15+
// Note that hanlders do not provide a sandbox or any other sort of OS-level isolation.
16+
// For example, an [OpenHandler] refusing access to the /etc directory
17+
// can be foiled by [ExecHandler] allowing access to external programs like cat.
18+
//
1519
// The interpreter currently aims to behave like a non-interactive shell,
1620
// which is how most shells run scripts, and is more useful to machines.
1721
// In the future, it may gain an option to behave like an interactive shell.

0 commit comments

Comments
 (0)