diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c
index 66834e88c6fc55b588a98219a6ef75f3589bbbbc..726ffa64ff63f229dad8a5639edddf1aa5ecbe51 100644 (file)
--- a/plugins/check_ldap.c
+++ b/plugins/check_ldap.c
char *ld_base = NULL;
char *ld_passwd = NULL;
char *ld_binddn = NULL;
-int ld_port = DEFAULT_PORT;
+int ld_port = -1;
#ifdef HAVE_LDAP_SET_OPTION
int ld_protocol = DEFAULT_PROTOCOL;
#endif
case 'S':
if (! starttls) {
ssl_on_connect = TRUE;
- ld_port = LDAPS_PORT;
+ if (ld_port == -1)
+ ld_port = LDAPS_PORT;
} else
usage_va(_("%s cannot be combined with %s"), "-S/--ssl", "-T/--starttls");
break;
if (ld_base == NULL && argv[c])
ld_base = strdup (argv[c++]);
+ if (ld_port == -1)
+ ld_port = DEFAULT_PORT;
+
return validate_arguments ();
}
printf (" %s\n", _("'SSL on connect' will be used no matter how the plugin was called."));
printf (" %s\n", _("This detection is deprecated, please use 'check_ldap' with the '--starttls' or '--ssl' flags"));
printf (" %s\n", _("to define the behaviour explicitly instead."));
-#ifdef NP_EXTRA_OPTS
- printf ("\n");
- printf (UT_EXTRA_OPTS_NOTES);
-#endif
printf (UT_SUPPORT);
}
void
print_usage (void)
{
- printf (_("Usage:"));
+ printf ("%s\n", _("Usage:"));
printf (" %s -H <host> -b <base_dn> [-p <port>] [-a <attr>] [-D <binddn>]",progname);
printf ("\n [-P <password>] [-w <warn_time>] [-c <crit_time>] [-t timeout]%s\n",
#ifdef HAVE_LDAP_SET_OPTION