summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/tty/replica.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-02-11 19:17:28 +0000
committergVisor bot <gvisor-bot@google.com>2021-02-11 19:17:28 +0000
commitf7d56875d020ecadba2dfc355ed3ecf02978530e (patch)
treef8147eec23da39394cfce82b958bf66477a02722 /pkg/sentry/fs/tty/replica.go
parentbb24bdc0d84656283f8be86c539f21d1570f8757 (diff)
parentae8d966f5af0bba9978a1aedac64038ef65a4cc9 (diff)
Merge release-20210201.0-86-gae8d966f5 (automated)
Diffstat (limited to 'pkg/sentry/fs/tty/replica.go')
-rw-r--r--pkg/sentry/fs/tty/replica.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/sentry/fs/tty/replica.go b/pkg/sentry/fs/tty/replica.go
index 385d230fb..0e3eea3bd 100644
--- a/pkg/sentry/fs/tty/replica.go
+++ b/pkg/sentry/fs/tty/replica.go
@@ -138,7 +138,7 @@ func (sf *replicaFileOperations) Write(ctx context.Context, _ *fs.File, src user
}
// Ioctl implements fs.FileOperations.Ioctl.
-func (sf *replicaFileOperations) Ioctl(ctx context.Context, _ *fs.File, io usermem.IO, args arch.SyscallArguments) (uintptr, error) {
+func (sf *replicaFileOperations) Ioctl(ctx context.Context, file *fs.File, io usermem.IO, args arch.SyscallArguments) (uintptr, error) {
t := kernel.TaskFromContext(ctx)
if t == nil {
// ioctl(2) may only be called from a task goroutine.
@@ -167,7 +167,7 @@ func (sf *replicaFileOperations) Ioctl(ctx context.Context, _ *fs.File, io userm
case linux.TIOCSCTTY:
// Make the given terminal the controlling terminal of the
// calling process.
- return 0, sf.si.t.setControllingTTY(ctx, args, false /* isMaster */)
+ return 0, sf.si.t.setControllingTTY(ctx, args, false /* isMaster */, file.Flags().Read)
case linux.TIOCNOTTY:
// Release this process's controlling terminal.
return 0, sf.si.t.releaseControllingTTY(ctx, args, false /* isMaster */)