Skip to content

Couple of small fixes - #1004

Merged
vszakats merged 4 commits into
libssh2:masterfrom
migueldeicaza:master-upstream
Apr 26, 2023
Merged

vszakats merged 4 commits into
libssh2:masterfrom
migueldeicaza:master-upstream

Conversation

@migueldeicaza

Copy link
Copy Markdown
Contributor

The first merely makes sure that we include the proper header file, otherwise this fails to compile with recent versions of Xcode.

The second patch fixes an issue that would corrupt the data stream when attempting to initialize the agent in non-blocking mode, as it is necessary to propagate the EAGAIN signal upstream when the transport returns EAGAIN.

Comment thread src/channel.c Outdated
if(rc == LIBSSH2_ERROR_EAGAIN) {
_libssh2_error(session, rc,
"Would block sending auth-agent request");
return rc;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This needs spaces for indent.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good call, I think my editor was going full tabs.

@vszakats

Copy link
Copy Markdown
Member

Including openssl/err.h makes sense, but do you have an idea what does it have to do with Xcode? What is the error you're seeing?

point which means that if the code is suspended due to the transport
returning an EAGAIN, this will re-initialize the structure every time.

The issue is that this keeps assigning a new channel-id downstream,
which does not match the initial channel-id that is initially generated,
causing a lookup later to fail as there is no matching channel.
@vszakats

vszakats commented Apr 26, 2023 •

Copy link
Copy Markdown
Member

channel.c and packet.c patches: regressions from #752.

@migueldeicaza

Copy link
Copy Markdown
Contributor Author

Without it, a file mater on references an ERR_ symbol which has not been declared, and it becomes an error to call due to a warning-as-error for using an undeclared function.

@vszakats

Copy link
Copy Markdown
Member

Got it, so that is a regression from #789. It seems that OpenSSL builds with OPENSSL_NO_ENGINE could have fallen into this after that patch.

@vszakats
vszakats merged commit 5981bcb into libssh2:master Apr 26, 2023
@vszakats

Copy link
Copy Markdown
Member

Thanks Miguel!

@vszakats vszakats added the bug label Apr 26, 2023
agreppin pushed a commit to agreppin/libssh2 that referenced this pull request Jul 14, 2024
- openssl: fix potentially missing `ERR_*` constants by including
  `openssl/err.h`. This could happen with recent version of Xcode
  or when building against OpenSSL built with the `OPENSSL_NO_ENGINE`
  option.

  Regression from 097c8f0 (libssh2#789)

- channel: fix an issue that would corrupt the data stream when
  attempting to initialize the agent in non-blocking mode, as it is
  necessary to propagate the `EAGAIN` signal upstream when the transport
  returns `EAGAIN`.

  Regression from bc4e619 (libssh2#752)

- packet: the current code does not set the state machine upon reaching
  this point which means that if the code is suspended due to the
  transport returning an `EAGAIN`, this will re-initialize the structure
  every time.

  The issue is that this keeps assigning a new channel-id downstream,
  which does not match the initial channel-id that is initially
  generated, causing a lookup later to fail as there is no matching
  channel.

  Regression from bc4e619 (libssh2#752)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants