[Nagiosplug-checkins] nagiosplug/plugins-scripts check_disk_smb.pl,1.10,1.11
M. Sean Finney
seanius at users.sourceforge.net
Fri Apr 15 23:11:30 CEST 2005
Update of /cvsroot/nagiosplug/nagiosplug/plugins-scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14717/plugins-scripts
Modified Files:
check_disk_smb.pl
Log Message:
patch to check_disk_smb to allow empty passwords
Index: check_disk_smb.pl
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins-scripts/check_disk_smb.pl,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- check_disk_smb.pl 15 Sep 2003 14:26:54 -0000 1.10
+++ check_disk_smb.pl 16 Apr 2005 06:09:47 -0000 1.11
@@ -76,7 +76,7 @@
my $user = $1 if ($opt_u =~ /^([-_.A-Za-z0-9\\]+)$/);
($user) || usage("Invalid user: $opt_u\n");
-($opt_p) || ($opt_p = shift) || ($opt_p = "guest");
+($opt_p) || ($opt_p = shift) || ($opt_p = "");
my $pass = $1 if ($opt_p =~ /(.*)/);
($opt_w) || ($opt_w = shift) || ($opt_w = 85);
@@ -123,10 +123,10 @@
# Execute an "ls" on the share using smbclient program
# get the results into $res
if (defined($workgroup)) {
- $res = qx/$smbclient \/\/$host\/$share $pass -W $workgroup -U $user $smbclientoptions -c ls/;
+ $res = qx/$smbclient \/\/$host\/$share -W $workgroup -U $user%$pass $smbclientoptions -c ls/;
} else {
print "$smbclient " . "\/\/$host\/$share" ." $pass -U $user $smbclientoptions -c ls\n" if ($verbose);
- $res = qx/$smbclient \/\/$host\/$share $pass -U $user $smbclientoptions -c ls/;
+ $res = qx/$smbclient \/\/$host\/$share -U $user%$pass $smbclientoptions -c ls/;
}
#Turn off alarm
alarm(0);
More information about the Commits
mailing list