scan cifs: fix passing "no pass" parameter

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2020-07-01 12:17:02 +02:00
parent 0b49e5cc6a
commit 8594155a66

View File

@ -1196,9 +1196,9 @@ sub scan_cifs {
# we only support Windows 2012 and newer, so just use smb3
my $cmd = ['/usr/bin/smbclient', '-m', 'smb3', '-d', '0', '-L', $server];
push @$cmd, '-N' if !defined($user);
push @$cmd, '-W', $domain if defined($domain);
push @$cmd, '-N' if !defined($password);
local $ENV{USER} = $user if defined($user);
local $ENV{PASSWD} = $password if defined($password);