summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/devpts/master.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/fsimpl/devpts/master.go
parentbb24bdc0d84656283f8be86c539f21d1570f8757 (diff)
parentae8d966f5af0bba9978a1aedac64038ef65a4cc9 (diff)
Merge release-20210201.0-86-gae8d966f5 (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/devpts/master.go')
-rw-r--r--pkg/sentry/fsimpl/devpts/master.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/sentry/fsimpl/devpts/master.go b/pkg/sentry/fsimpl/devpts/master.go
index b44117f40..93c031c89 100644
--- a/pkg/sentry/fsimpl/devpts/master.go
+++ b/pkg/sentry/fsimpl/devpts/master.go
@@ -164,10 +164,11 @@ func (mfd *masterFileDescription) Ioctl(ctx context.Context, io usermem.IO, args
case linux.TIOCSCTTY:
// Make the given terminal the controlling terminal of the
// calling process.
- return 0, mfd.t.setControllingTTY(ctx, args, true /* isMaster */)
+ steal := args[2].Int() == 1
+ return 0, mfd.t.setControllingTTY(ctx, steal, true /* isMaster */, mfd.vfsfd.IsReadable())
case linux.TIOCNOTTY:
// Release this process's controlling terminal.
- return 0, mfd.t.releaseControllingTTY(ctx, args, true /* isMaster */)
+ return 0, mfd.t.releaseControllingTTY(ctx, true /* isMaster */)
case linux.TIOCGPGRP:
// Get the foreground process group.
return mfd.t.foregroundProcessGroup(ctx, args, true /* isMaster */)