Imported Upstream version 3.3.3
[debian/amanda] / application-src / amsamba.pl
index 7a6ffd8bdb7554f1866e47eafd331ac8266e3cab..db5c47516595e06846f2a1dd39156feb11ec2a4f 100644 (file)
@@ -1,9 +1,10 @@
 #!@PERL@ 
 # Copyright (c) 2008-2012 Zmanda, Inc.  All Rights Reserved.
 #
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 as published
-# by the Free Software Foundation.
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful, but
 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
@@ -31,6 +32,7 @@ use IPC::Open3;
 use Sys::Hostname;
 use Symbol;
 use IO::Handle;
+use MIME::Base64 ();
 use Amanda::Constants;
 use Amanda::Config qw( :init :getconf  config_dir_relative );
 use Amanda::Debug qw( :logging );
@@ -298,6 +300,10 @@ sub findpass {
                $self->{domain} = $domain if defined $domain && $domain ne "";
                my ($username, $password) = split('%', $userpasswd, 2);
                $self->{username} = $username;
+               if ($password =~ /^6G\!dr(.*)/) {
+                   my $base64 = $1;
+                   $password = MIME::Base64::decode($base64);
+               }
                $self->{password} = $password;
                $self->{password} = undef if (defined $password && $password eq "");
             } else {
@@ -347,7 +353,8 @@ sub command_support {
 sub command_selfcheck {
     my $self = shift;
 
-    $self->print_to_server("disk " . quote_string($self->{disk}));
+    $self->print_to_server("disk " . quote_string($self->{disk}),
+                          $Amanda::Script_App::GOOD);
 
     $self->print_to_server("amsamba version " . $Amanda::Constants::VERSION,
                           $Amanda::Script_App::GOOD);