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;