Skip to content

[BUGFIX] Make Gerrit SSH probe portable across host systems - #24

Open
maikschneider wants to merge 1 commit into
bmack:mainfrom
maikschneider:bugfix/portable-gerrit-ssh-probe
Open

[BUGFIX] Make Gerrit SSH probe portable across host systems#24
maikschneider wants to merge 1 commit into
bmack:mainfrom
maikschneider:bugfix/portable-gerrit-ssh-probe

Conversation

@maikschneider

Copy link
Copy Markdown
Contributor

The reachability check used bash's /dev/tcp with a hostname. Since #12 moved cs to the host, it runs on the user's own OS, where that is not dependable: on macOS the redirection is killed with SIGKILL, so the probe always reported "network unreachable" even when Gerrit was reachable.

A single verbose ssh call now covers reachability and auth, classified into the existing CS_SSH_REASON values. The ssh-add gate is gone, since keys used from ~/.ssh without an agent are valid.

Verified on macOS (bash 3.2, 5.3) and in the web container (bash 5.2).

resolves #23

The reachability check used bash's /dev/tcp with a hostname. Since the
cs command moved from the web container to the host, this runs on the
user's own OS, where the construct is not dependable: on macOS a
hostname-based /dev/tcp redirection is killed with SIGKILL, so the probe
always reported "network unreachable" even though Gerrit was reachable
and authentication worked. /dev/tcp is also absent from bash builds
compiled with --disable-net-redirections.

A single verbose ssh call now serves as both reachability and auth
probe, and its output is classified into the existing CS_SSH_REASON
values. This needs nothing beyond ssh itself, which the command already
requires for pushing to Gerrit.

The identity check no longer runs ssh-add first: keys used from
~/.ssh without an agent are valid, and reporting them as a missing
agent key was wrong. "No key offered" is now derived from the ssh
transcript instead, and the wording no longer refers to ddev-ssh-agent,
which is not involved for a host command.

@garvinhicking garvinhicking left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, fixes my issue as well

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.

ddev cs doctor false negative on macOS

2 participants