summaryrefslogtreecommitdiffstats
path: root/plugins/check_ldap.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_ldap.c')
-rw-r--r--plugins/check_ldap.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c
index 3d6f05c..d0134a0 100644
--- a/plugins/check_ldap.c
+++ b/plugins/check_ldap.c
@@ -87,15 +87,15 @@ main (int argc, char *argv[])
87 LDAPMessage *result; 87 LDAPMessage *result;
88 88
89 /* should be int result = STATE_UNKNOWN; */ 89 /* should be int result = STATE_UNKNOWN; */
90 90
91 int status = STATE_UNKNOWN; 91 int status = STATE_UNKNOWN;
92 long microsec; 92 long microsec;
93 double elapsed_time; 93 double elapsed_time;
94 94
95 /* for ldap tls */ 95 /* for ldap tls */
96 96
97 int tls; 97 int tls;
98 int version=3; 98 int version=3;
99 99
100 setlocale (LC_ALL, ""); 100 setlocale (LC_ALL, "");
101 bindtextdomain (PACKAGE, LOCALEDIR); 101 bindtextdomain (PACKAGE, LOCALEDIR);
@@ -129,7 +129,7 @@ main (int argc, char *argv[])
129 printf ("Could not connect to the server at port %i\n", ld_port); 129 printf ("Could not connect to the server at port %i\n", ld_port);
130 return STATE_CRITICAL; 130 return STATE_CRITICAL;
131 } 131 }
132#else 132#else
133 if (!(ld = ldap_open (ld_host, ld_port))) { 133 if (!(ld = ldap_open (ld_host, ld_port))) {
134 if (verbose) 134 if (verbose)
135 ldap_perror(ld, "ldap_open"); 135 ldap_perror(ld, "ldap_open");
@@ -137,7 +137,7 @@ main (int argc, char *argv[])
137 return STATE_CRITICAL; 137 return STATE_CRITICAL;
138 } 138 }
139#endif /* HAVE_LDAP_INIT */ 139#endif /* HAVE_LDAP_INIT */
140 140
141#ifdef HAVE_LDAP_SET_OPTION 141#ifdef HAVE_LDAP_SET_OPTION
142 /* set ldap options */ 142 /* set ldap options */
143 if (ldap_set_option (ld, LDAP_OPT_PROTOCOL_VERSION, &ld_protocol) != 143 if (ldap_set_option (ld, LDAP_OPT_PROTOCOL_VERSION, &ld_protocol) !=
@@ -152,7 +152,7 @@ main (int argc, char *argv[])
152#if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_X_TLS) 152#if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_X_TLS)
153 /* ldaps: set option tls */ 153 /* ldaps: set option tls */
154 tls = LDAP_OPT_X_TLS_HARD; 154 tls = LDAP_OPT_X_TLS_HARD;
155 155
156 if (ldap_set_option (ld, LDAP_OPT_X_TLS, &tls) != LDAP_SUCCESS) 156 if (ldap_set_option (ld, LDAP_OPT_X_TLS, &tls) != LDAP_SUCCESS)
157 { 157 {
158 if (verbose) 158 if (verbose)
@@ -179,7 +179,7 @@ main (int argc, char *argv[])
179 /* call start_tls */ 179 /* call start_tls */
180 if (ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS) 180 if (ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS)
181 { 181 {
182 if (verbose) 182 if (verbose)
183 ldap_perror(ld, "ldap_start_tls"); 183 ldap_perror(ld, "ldap_start_tls");
184 printf (_("Could not init startTLS at port %i!\n"), ld_port); 184 printf (_("Could not init startTLS at port %i!\n"), ld_port);
185 return STATE_CRITICAL; 185 return STATE_CRITICAL;
@@ -189,7 +189,7 @@ main (int argc, char *argv[])
189 return STATE_CRITICAL; 189 return STATE_CRITICAL;
190#endif /* HAVE_LDAP_START_TLS_S */ 190#endif /* HAVE_LDAP_START_TLS_S */
191 } 191 }
192 192
193 /* bind to the ldap server */ 193 /* bind to the ldap server */
194 if (ldap_bind_s (ld, ld_binddn, ld_passwd, LDAP_AUTH_SIMPLE) != 194 if (ldap_bind_s (ld, ld_binddn, ld_passwd, LDAP_AUTH_SIMPLE) !=
195 LDAP_SUCCESS) { 195 LDAP_SUCCESS) {