Skip to content

Commit

Permalink
nanos: add sandbox klib config example
Browse files Browse the repository at this point in the history
  • Loading branch information
rinor committed Jul 1, 2023
1 parent 93d3f55 commit c794667
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,23 @@ Can be used with [Nanos](https://github.com/nanovms/nanos) `sandbox` _klib_ - ht

Can be safely used on other non-OpenBSD operating systems, where the syscalls are `noop`.

## Nanos ops config

```json
{
"Klibs": [
"sandbox"
],
"ManifestPassthrough": {
"sandbox": {
"pledge": {},
"unveil": {}
}
}
}
```

## pledge
### pledge

```go
package main
Expand Down Expand Up @@ -53,7 +68,7 @@ func main() {
}
```

## unveil
### unveil

```go
package main
Expand Down
4 changes: 3 additions & 1 deletion sandbox_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ const (
nanos_sysname = "Nanos"
)

var noop bool = true
var (
noop = true
)

func init() {
var uts syscall.Utsname
Expand Down

0 comments on commit c794667

Please sign in to comment.