Skip to content

Handle master pty allocation failure - #66

Open
salva wants to merge 1 commit into
masterfrom
fix/master-pty-allocation-error
Open

Handle master pty allocation failure#66
salva wants to merge 1 commit into
masterfrom
fix/master-pty-allocation-error

Conversation

@salva

@salva salva commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Summary

Fail master startup immediately when IO::Pty->new cannot allocate a pseudo-tty.

Changes

  • Check the return value from IO::Pty->new in _master_start.
  • Report a clear master failure instead of continuing without the pty and later producing a generic connection/login failure.

Fixes #42.

Testing

  • perl -Ilib -c lib/Net/OpenSSH.pm
  • perl -Ilib t/1_run.t

Copilot AI review requested due to automatic review settings June 4, 2026 11:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves failure handling during SSH master startup by immediately aborting when a requested pseudo-tty (pty) cannot be allocated, preserving the real root-cause error instead of allowing startup to proceed and fail later with a generic message.

Changes:

  • Add an explicit success check after IO::Pty->new in _master_start.
  • Fail master startup early via _master_fail with a clear “unable to allocate pseudo-tty” error message (including $!).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Master startup does not handle IO::Pty allocation failure

2 participants