X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fcheck_ldap.c;h=726ffa64ff63f229dad8a5639edddf1aa5ecbe51;hb=a2a279e262ef341b95fe2511d7164cbc60f6b026;hp=11644a1fb96d68e4c192461f5b30bcef7b27fde2;hpb=884aee06674755ef44e4042803ae84a0faac5b10;p=nagiosplug.git diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c index 11644a1..726ffa6 100644 --- a/plugins/check_ldap.c +++ b/plugins/check_ldap.c @@ -58,7 +58,7 @@ char *ld_host = NULL; 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 @@ -341,7 +341,8 @@ process_arguments (int argc, char **argv) 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; @@ -364,6 +365,9 @@ process_arguments (int argc, char **argv) if (ld_base == NULL && argv[c]) ld_base = strdup (argv[c++]); + if (ld_port == -1) + ld_port = DEFAULT_PORT; + return validate_arguments (); } @@ -449,7 +453,7 @@ print_help (void) void print_usage (void) { - printf (_("Usage:")); + printf ("%s\n", _("Usage:")); printf (" %s -H -b [-p ] [-a ] [-D ]",progname); printf ("\n [-P ] [-w ] [-c ] [-t timeout]%s\n", #ifdef HAVE_LDAP_SET_OPTION