[Nagiosplug-devel] [ nagiosplug-Bugs-1985489 ] check_ldap doesn't allow empty bases

SourceForge.net noreply at sourceforge.net
Thu Jun 5 16:12:36 CEST 2008


Bugs item #1985489, was opened at 2008-06-05 16:12
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1985489&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Argument proccessing
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Jan Wagner (cyco_dd)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_ldap doesn't allow empty bases

Initial Comment:
The following Bugreport we got against our debian package:

Hiya,

$ /usr/lib/nagios/plugins/check_ldap -H localhost -b ''
check_ldap: Please specify the LDAP base

doesn't work.

For me, a check with an empty base seems like the most obvious
thing to do.

So I don't understand why it is explicitely disallowed in the
code (note that the error message is also confusing)

A simple fix:

--- plugins/check_ldap.c-before-base-fix	2008-05-07 11:32:13.000000000 +0100
+++ plugins/check_ldap.c	2008-05-07 11:34:50.000000000 +0100
@@ -374,7 +374,7 @@ validate_arguments ()
 	if (ld_host==NULL || strlen(ld_host)==0)
 		usage4 (_("Please specify the host name\n"));
 
-	if (ld_base==NULL || strlen(ld_base)==0)
+	if (ld_base == NULL)
 		usage4 (_("Please specify the LDAP base\n"));
 
 	return OK;


The similar check for strlen(ld_host) could be removed as well,
because if ld_host is "", it's because the user specified -H '',
so did specify the hostname, so that the error message is
misleading.

You can track the bugreport via http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=479984

Thanks and kind regards, Jan.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1985489&group_id=29880




More information about the Devel mailing list