Skip Menu |

This queue is for tickets about the Net-SCP-Expect CPAN distribution.

Report information
The Basics
Id: 24273
Status: resolved
Priority: 0/
Queue: Net-SCP-Expect

People
Owner: RYBSKEJ [...] cpan.org
Requestors: paulo.santanna [...] morganstanley.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.12
Fixed in: 0.13



Subject: scp binary is hardcoded, cannot specify a different path to scp
The scp binary used by the module is picked up from the user PATH. In our case we have a default scp that won't work in some cases because it was modified to authenticate using kerberos only. The fix is to point to a stock scp in /usr/bin/scp but the script don't have a option for that. A quick fix was to add the following to my code: $ENV{'PATH'} = "/usr/bin:" . $ENV{'PATH'}; This solves the problem but is not very flexible. I added a scp_path option that would fix that, allowing the user to say: my $scpe = Net::SCP::Expect->new(user=> $user, password=> $pass, auto_yes=> 1, scp_path=> "/usr/bin/scp"); I've attached the modified Expect.pm and a diff file.
Subject: Expect.pm.diff
47d46 < _scp_path => $arg{scp_path} || undef, 132d130 < my $scp_path = $self->_get('scp_path'); # Path to scp (paulo.santanna@morganstanley.com) 174,176d171 < # Use scp specified by the user if possible (paulo.santanna@morganstanley.com) < $scp_path = "scp " unless (defined $scp_path); < 181c176 < my $scp_string = "$scp_path $flags $from $to"; --- > my $scp_string = "scp $flags $from $to"; 459,461d453 < B<scp_path> - The path for the scp binary to use. E.g.: /usr/bin/scp, defaults to use < the first scp on your $PATH variable <
Subject: Expect.pm

Message body is not shown because it is too large.

New option 'scp_path' is available, when calling class constructor. See POD for usage information. Changes included in 0.13 release.
Subject: RE: [rt.cpan.org #24273] Resolved: scp binary is hardcoded, cannot specify a different path to scp
Date: Thu, 12 Jun 2008 15:32:32 -0400
To: <bug-Net-SCP-Expect [...] rt.cpan.org>
From: "Sant'Anna, Paulo \(IT\)" <Paulo.SantAnna [...] morganstanley.com>
Eric, Thanks for this. I will test it out but I'm sure it works fine. Thank you. Paulo Sant'Anna Morgan Stanley | Technology 1 Pierrepont Plaza, 12th Floor | Brooklyn, NY 11201 Phone: +1 718 754-2680 Paulo.SantAnna@morganstanley.com Show quoted text
-----Original Message----- From: Eric Rybski via RT [mailto:bug-Net-SCP-Expect@rt.cpan.org] Sent: Thursday, June 12, 2008 11:23 AM To: Sant'Anna, Paulo (IT) Subject: [rt.cpan.org #24273] Resolved: scp binary is hardcoded, cannot specify a different path to scp <URL: http://rt.cpan.org/Ticket/Display.html?id=24273 > According to our records, your request has been resolved. If you have any further questions or concerns, please respond to this message. -------------------------------------------------------- NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.