Skip Menu |

This queue is for tickets about the Net-SSH-Perl CPAN distribution.

Report information
The Basics
Id: 13373
Status: resolved
Priority: 0/
Queue: Net-SSH-Perl

People
Owner: Nobody in particular
Requestors: david [...] justatheory.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.67
Fixed in: (no value)



Subject: Net::SSH::Perl should use the Effective UID to Detect Root
Net::SSH::Perl detects root using the UID of the current process. However, this can cause problems in environments where the effective UID is changed, such as under mod_perl. I suggest using the effective UID ($>) instead of the UID ($<). Here's the patch: --- lib/Net/SSH/Perl.pm.old 2005-06-22 12:09:59.000000000 -0700 +++ lib/Net/SSH/Perl.pm 2005-06-22 12:10:45.000000000 -0700 @@ -95,11 +95,7 @@ sub client_version_string { $_[0]->{client_version_string} } sub server_version_string { $_[0]->{server_version_string} } -sub _current_user { - my $user; - eval { $user = scalar getpwuid($<) }; - $user; -} +sub _current_user { eval { scalar getpwuid $> } } sub _init { my $ssh = shift;