Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent Pty::pts() from attaching via O_NOCTTY #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Oct 15, 2024

  1. Prevent Pty::pts() from attaching via O_NOCTTY

    If a process doesn't have a controlling terminal (for example if it is
    in a new session) then `open(ptsname())` will automatically make the
    slave the controlling terminal of the process.
    
    Later on, `command.spawn(&pts)`s call to `ioctl_tiocsctty()` within
    `session_leader()` within `command.pre_exec()` will fail as with EPERM
    since the parent process (and session) is alread using it as its
    controlling terminal.
    
    Use `O_NOCTTY` to prevent this.
    Chris Pick committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    349c9ec View commit details
    Browse the repository at this point in the history