diff options
author | M. Sean Finney <seanius@users.sourceforge.net> | 2005-04-16 06:09:47 +0000 |
---|---|---|
committer | M. Sean Finney <seanius@users.sourceforge.net> | 2005-04-16 06:09:47 +0000 |
commit | cf35fb4b92c07781ffebc1d054c4604b769be1d0 (patch) | |
tree | 222364ea5b978b395b87a91ac262e66d8ff6a24b | |
parent | 7a930f77c513255c416bd67198d4b6fbf4d8d006 (diff) | |
download | monitoring-plugins-cf35fb4b92c07781ffebc1d054c4604b769be1d0.tar.gz |
patch to check_disk_smb to allow empty passwords
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1163 f882894a-f735-0410-b71e-b25c423dba1c
-rwxr-xr-x | plugins-scripts/check_disk_smb.pl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl index 3358f6a1..02b71500 100755 --- a/plugins-scripts/check_disk_smb.pl +++ b/plugins-scripts/check_disk_smb.pl | |||
@@ -76,7 +76,7 @@ my $share = $1 if ($opt_s =~ /^([-_.A-Za-z0-9]+\$?)$/); | |||
76 | my $user = $1 if ($opt_u =~ /^([-_.A-Za-z0-9\\]+)$/); | 76 | my $user = $1 if ($opt_u =~ /^([-_.A-Za-z0-9\\]+)$/); |
77 | ($user) || usage("Invalid user: $opt_u\n"); | 77 | ($user) || usage("Invalid user: $opt_u\n"); |
78 | 78 | ||
79 | ($opt_p) || ($opt_p = shift) || ($opt_p = "guest"); | 79 | ($opt_p) || ($opt_p = shift) || ($opt_p = ""); |
80 | my $pass = $1 if ($opt_p =~ /(.*)/); | 80 | my $pass = $1 if ($opt_p =~ /(.*)/); |
81 | 81 | ||
82 | ($opt_w) || ($opt_w = shift) || ($opt_w = 85); | 82 | ($opt_w) || ($opt_w = shift) || ($opt_w = 85); |
@@ -123,10 +123,10 @@ alarm($TIMEOUT); | |||
123 | # Execute an "ls" on the share using smbclient program | 123 | # Execute an "ls" on the share using smbclient program |
124 | # get the results into $res | 124 | # get the results into $res |
125 | if (defined($workgroup)) { | 125 | if (defined($workgroup)) { |
126 | $res = qx/$smbclient \/\/$host\/$share $pass -W $workgroup -U $user $smbclientoptions -c ls/; | 126 | $res = qx/$smbclient \/\/$host\/$share -W $workgroup -U $user%$pass $smbclientoptions -c ls/; |
127 | } else { | 127 | } else { |
128 | print "$smbclient " . "\/\/$host\/$share" ." $pass -U $user $smbclientoptions -c ls\n" if ($verbose); | 128 | print "$smbclient " . "\/\/$host\/$share" ." $pass -U $user $smbclientoptions -c ls\n" if ($verbose); |
129 | $res = qx/$smbclient \/\/$host\/$share $pass -U $user $smbclientoptions -c ls/; | 129 | $res = qx/$smbclient \/\/$host\/$share -U $user%$pass $smbclientoptions -c ls/; |
130 | } | 130 | } |
131 | #Turn off alarm | 131 | #Turn off alarm |
132 | alarm(0); | 132 | alarm(0); |