Net:SSH bug (+ fix)

Hi,

Just found a small bug in Net::SSH 1.0. Line 44 of services.rb contains the following if statement:

   if socket_name && socket_factory

If you use the Putty Agent the socket factory is enough for agent usage, but because of this if statement you also have to set the SSH_AUTH_SOCK environment variable to make use of the agent. This could be changed by slightly changing the if statement to:

   if (File::ALT_SEPARATOR || socket_name) && socket_factory

Thanks for the great library BTW!

Regards,

Peter

Peter C. Verhage wrote:

Hi,

Just found a small bug in Net::SSH 1.0. Line 44 of services.rb

contains

the following if statement:

   if socket_name && socket_factory

If you use the Putty Agent the socket factory is enough for agent

usage,

but because of this if statement you also have to set the

SSH_AUTH_SOCK

environment variable to make use of the agent. This could be changed

by

slightly changing the if statement to:

   if (File::ALT_SEPARATOR || socket_name) && socket_factory

Thanks for the great library BTW!

Regards,

Peter

Nice spot. Please post patches, bug fixes, etc on the Net::SSH
RubyForge project page. Jamis is more likely to see it, and less
likely to forget it. :slight_smile:

Regards,

Dan

Thanks for the fix, Peter. I've committed it to the repository
(http://www.jamisbuck.org/svn/net-ssh\) and it will be released
whenever I get some time to package the next release. :slight_smile:

- Jamis

···

On 05:30 Fri 18 Feb , Peter C. Verhage wrote:

Hi,

Just found a small bug in Net::SSH 1.0. Line 44 of services.rb contains
the following if statement:

  if socket_name && socket_factory

If you use the Putty Agent the socket factory is enough for agent usage,
but because of this if statement you also have to set the SSH_AUTH_SOCK
environment variable to make use of the agent. This could be changed by
slightly changing the if statement to:

  if (File::ALT_SEPARATOR || socket_name) && socket_factory

Thanks for the great library BTW!

Regards,

Peter

--
Jamis Buck
jamis_buck@byu.edu
http://jamis.jamisbuck.org
------------------------------
"I am Victor of Borge. You will be assimil-nine-ed."

A very, very good point. It also provides a history of what work has
been done, and if someone else encounters a problem, they can quickly
discover whether anyone else has the same problem.

- Jamis

···

On 05:39 Fri 18 Feb , Daniel Berger wrote:

Peter C. Verhage wrote:
> Hi,
>
> Just found a small bug in Net::SSH 1.0. Line 44 of services.rb
contains
> the following if statement:
>
> if socket_name && socket_factory
>
> If you use the Putty Agent the socket factory is enough for agent
usage,
> but because of this if statement you also have to set the
SSH_AUTH_SOCK
> environment variable to make use of the agent. This could be changed
by
> slightly changing the if statement to:
>
> if (File::ALT_SEPARATOR || socket_name) && socket_factory
>
> Thanks for the great library BTW!
>
> Regards,
>
> Peter

Nice spot. Please post patches, bug fixes, etc on the Net::SSH
RubyForge project page. Jamis is more likely to see it, and less
likely to forget it. :slight_smile:

--
Jamis Buck
jamis_buck@byu.edu
http://jamis.jamisbuck.org
------------------------------
"I am Victor of Borge. You will be assimil-nine-ed."