diff --git a/lam-0.4/lib/lamdaemon.pl b/lam-0.4/lib/lamdaemon.pl index 95580243..8669f832 100755 --- a/lam-0.4/lib/lamdaemon.pl +++ b/lam-0.4/lib/lamdaemon.pl @@ -194,13 +194,27 @@ else { $remotepath = shift @ARGV; use Net::SSH::Perl; if ($ARGV[2] eq "*test") { print "Net::SSH::Perl successfully installed.\n"; } - @username = split (',', $ARGV[0]); - $username[0] =~ s/uid=//; - $password = $ARGV[1]; + if (($ARGV[0] eq "-") and ($ARGV[1] eq "-")) { # user+passwd are in STDIN + $username = ; + chop($username); + @username = split (',', $username); + $username[0] =~ s/uid=//; + $username[0] =~ s/cn=//; + $username = $username[0]; + $password = ; + chop($password); + } + else { + @username = split (',', $ARGV[0]); + $username[0] =~ s/uid=//; + $username[0] =~ s/cn=//; + $username = $username[0]; + $password = $ARGV[1]; + } my $ssh = Net::SSH::Perl->new($hostname, options=>[ "UserKnownHostsFile /dev/null"], protocol => "2,1" ); - $ssh->login($username[0], $password); + $ssh->login($username, $password); # Put all transfered lines in one string if ($ARGV[2] ne "*test") { $string = do {local $/;};