summaryrefslogtreecommitdiffhomepage
path: root/runsc/boot/fds.go
diff options
context:
space:
mode:
authorKevin Krakauer <krakauer@google.com>2018-09-18 13:21:13 -0700
committerShentubot <shentubot@google.com>2018-09-18 13:22:26 -0700
commit7e00f3705480313a63c9db7d087db711abc720bc (patch)
tree29e658ff1ef4a3e13296d0dde861e56a79cf9861 /runsc/boot/fds.go
parented08597d121a624592e5517a28ae40ddbcc59cb0 (diff)
Automated rollback of changelist 213307171
PiperOrigin-RevId: 213504354 Change-Id: Iadd42f0ca4b7e7a9eae780bee9900c7233fb4f3f
Diffstat (limited to 'runsc/boot/fds.go')
-rw-r--r--runsc/boot/fds.go13
1 files changed, 5 insertions, 8 deletions
diff --git a/runsc/boot/fds.go b/runsc/boot/fds.go
index 91c698fea..9de5a78b1 100644
--- a/runsc/boot/fds.go
+++ b/runsc/boot/fds.go
@@ -16,6 +16,7 @@ package boot
import (
"fmt"
+ "syscall"
"gvisor.googlesource.com/gvisor/pkg/sentry/context"
"gvisor.googlesource.com/gvisor/pkg/sentry/fs"
@@ -27,19 +28,15 @@ import (
// createFDMap creates an fd map that contains stdin, stdout, and stderr. If
// console is true, then ioctl calls will be passed through to the host fd.
-func createFDMap(ctx context.Context, k *kernel.Kernel, l *limits.LimitSet, console bool, stdioFDs []int) (*kernel.FDMap, error) {
- if len(stdioFDs) != 3 {
- return nil, fmt.Errorf("stdioFDs should contain exactly 3 FDs (stdin, stdout, and stderr), but %d FDs received", len(stdioFDs))
- }
-
+func createFDMap(ctx context.Context, k *kernel.Kernel, l *limits.LimitSet, console bool) (*kernel.FDMap, error) {
fdm := k.NewFDMap()
defer fdm.DecRef()
// Maps sandbox fd to host fd.
fdMap := map[int]int{
- 0: stdioFDs[0],
- 1: stdioFDs[1],
- 2: stdioFDs[2],
+ 0: syscall.Stdin,
+ 1: syscall.Stdout,
+ 2: syscall.Stderr,
}
mounter := fs.FileOwnerFromContext(ctx)