[nagiosplug] Fix Debian bug #425129: SMB guest mode won't work

"Holger Weiss" <[email protected]>
Newsgroups gmane.network.nagios.plugins.cvs
Message-ID <[email protected]>
 Module: nagiosplug
 Branch: master
 Commit: e4613410033dc24d9efe34013c8a35b16487af8f
 Author: Holger Weiss <[email protected]>
   Date: Sun Apr 11 09:39:24 2010 +0200
    URL: http://nagiosplug.git.sf.net/git/gitweb.cgi?p=nagiosplug/nagiosplug;a=commit;h=e461341

Fix Debian bug #425129: SMB guest mode won't work

| The check_disk_smb plugin purports to support guest users, but it
| doesn't work out, because it doesn't specify the -N command line
| option to smbclient when no password is specified, making smbclient
| stop and ask.

[ http://bugs.debian.org/425129 ]

(Fixed by Josip Rodin, forwarded by Jan Wagner.)

---

 NEWS                              |    1 +
 THANKS.in                         |    1 +
 plugins-scripts/check_disk_smb.pl |    1 +
 3 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/NEWS b/NEWS
index 0d05019..5827db6 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,7 @@ This file documents the major additions and syntax changes between releases.
 	Fix compilation with GCC 2.96 (Konstantin Khomoutov - #2977105)
 	Fix regression introduced in #1867716 where partially valid performance strings would not be printed anymore
 	Fix regression in check_http ssl checks on some servers - make SNI an option
+	Fix guest mode support in check_disk_smb
 	WARNINGS
 	Updated developer documentation to say that performance labels should not have an equals sign or
 	single quote in the label
diff --git a/THANKS.in b/THANKS.in
index 1603622..ee75f33 100644
--- a/THANKS.in
+++ b/THANKS.in
@@ -260,3 +260,4 @@ Marcel Kuiper
 Bryan Irvine
 Jimmy Bergman
 Konstantin Khomoutov
+Josip Rodin
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl
index 985fa96..022fa50 100755
--- a/plugins-scripts/check_disk_smb.pl
+++ b/plugins-scripts/check_disk_smb.pl
@@ -78,6 +78,7 @@ my $user = $1 if ($opt_u =~ /^([-_.A-Za-z0-9\\]+)$/);
 
 ($opt_p) || ($opt_p = shift) || ($opt_p = "");
 my $pass = $1 if ($opt_p =~ /(.*)/);
+$pass = "-N" if ($opt_p eq "");
 
 ($opt_w) || ($opt_w = shift) || ($opt_w = 85);
 my $warn = $1 if ($opt_w =~ /^([0-9]{1,2}\%?|100\%?|[0-9]+[kMG])$/);


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.