diff --git a/PVE/Storage/CIFSPlugin.pm b/PVE/Storage/CIFSPlugin.pm index 724fb1f..cb7c844 100644 --- a/PVE/Storage/CIFSPlugin.pm +++ b/PVE/Storage/CIFSPlugin.pm @@ -198,9 +198,9 @@ sub deactivate_storage { sub check_connection { my ($class, $storeid, $scfg) = @_; - my $server = $scfg->{server}; + my $servicename = '//'.$scfg->{server}.'/'.$scfg->{share}; - my $cmd = ['/usr/bin/smbclient', '-L', $server, '-d', '0', '-m']; + my $cmd = ['/usr/bin/smbclient', $servicename, '-d', '0', '-m']; push @$cmd, $scfg->{smbversion} ? "smb".int($scfg->{smbversion}) : 'smb3'; @@ -211,6 +211,8 @@ sub check_connection { push @$cmd, '-U', 'Guest','-N'; } + push @$cmd, '-c', 'echo 1 0'; + my $out_str; eval { run_command($cmd, timeout => 2, outfunc => sub {$out_str .= shift;},