Filesys::SmbClient doesn't have any knowledge of the protocol flag. I've gone ahead and fixed this in my environment (since I just had scheduled transfers fail because of it). I've supplied the patch here. I make no guarantees, I've done minimal testing, and I'm not responsible for anything that this patch may break in your environment.
-- Jeremy Baumgartner
--- SmbClientParser.pm.orig 2018-05-11 10:55:54.033252684 -0500
+++ SmbClientParser.pm 2018-05-11 11:07:15.612066151 -0500
@@ -5,6 +5,9 @@
# Copyright 2000-2002 A.Barbet alian@alianwebserver.com. All rights
+reserved.
# $Log: SmbClientParser.pm,v $
+# Revision 2.7.1 2018-05-11 11:06:00 jjb0528
+# - Added protocol selection to the options for smbclient
+#
# Revision 2.7 2004/04/14 21:53:18 alian
# - fix rt#5896: Will Not work on shares that contain spaces in names
#
@@ -83,6 +86,7 @@
$self->Password($ref{password}) if ($ref{password});
$self->Workgroup($ref{workgroup}) if ($ref{workgroup});
$self->IpAdress($ref{ipadress}) if ($ref{ipadress});
+ $self->Protocol($ref{protocol}) if ($ref{protocol});
$self->{DIR}='/';
$self->{"DEBUG"} = 0;
return $self;
@@ -99,6 +103,7 @@
sub Password {if ($_[1]) {$_[0]->{PASSWORD}=$_[1];} return $_[0]->{PA
+SSWORD};}
sub Workgroup {if ($_[1]) {$_[0]->{WG}=$_[1];} return $_[0]->{WG};}
sub IpAdress {if ($_[1]) {$_[0]->{IP}=$_[1];} return $_[0]->{IP};}
+sub Protocol {if ($_[1]) {$_[0]->{PROTO}=$_[1];} return $_[0]->{PROTO
+};}
sub LastResponse {
if ($_[1]) {$_[0]->{LAST_REP}=$_[1];} return $_[0]->{LAST_REP};}
sub err {
@@ -498,17 +503,19 @@
# rearrange_param
#--------------------------------------------------------------------
+----------
sub rearrange_param {
- my ($self,$command,$dir, $host, $share, $user, $pass, $wg, $ip) = @
+_;
+ my ($self,$command,$dir, $host, $share, $user, $pass, $wg, $ip, $pr
+oto) = @_;
if (!$user) {$user=$self->User;}
if (!$host) {$host=$self->Host;}
if (!$share){$share=$self->Share;}
if (!$pass) {$pass=$self->Password;}
if (!$wg) {$wg=$self->Workgroup; }
if (!$ip) {$ip =$self->IpAdress; }
+ if (!$proto) {$proto =$self->Protocol; }
if (!$dir) {$dir=$self->{DIR}; }
my $debug = ($self->{DEBUG} ? " -d".$self->{DEBUG} : ' -d0 ');
$wg = ($wg ? ("-W ".$wg." ") : ' '); # Workgroup
$ip = ($ip ? ("-I ".$ip." ") : ' '); # Ip adress of server
+ $proto = ($proto ? ("-m ".$proto." ") : ' '); # Protocol
$dir = ($dir ? (' -D "'.$dir.'"') : ' '); # Path
# User / Password
if (($user)&&($pass)) { $user = '-U "'.$user.'%'.$pass.'" '; }
@@ -519,7 +526,7 @@
if ($host) {$host='//'.$host; $path.=$host; }
if ($share) {$share='/'.$share;$path.=$share; }
$path.='" ';
- my $prefix = $self->{SMBLIENT}.$path.$user.$wg.$ip.$debug;
+ my $prefix = $self->{SMBLIENT}.$path.$user.$wg.$ip.$debug.$proto;
return ($self, $command, $prefix, $dir);
}
|