--- ./plugins/check_ldap.c~ 2003-01-29 06:16:15.000000000 +0000 +++ ./plugins/check_ldap.c 2003-10-22 11:10:44.000000000 +0100 @@ -45,8 +45,6 @@ char *ld_attr = ld_defattr; char *ld_host = ""; char *ld_base = ""; -char *ld_passwd = NULL; -char *ld_binddn = NULL; unsigned int ld_port = DEFAULT_PORT; int warn_time = UNDEFINED; int crit_time = UNDEFINED; @@ -74,20 +72,12 @@ time (&time0); /* initialize ldap */ - if (!(ld = ldap_open (ld_host, ld_port))) { + if (!(ld = ldap_init (ld_host, ld_port))) { /*ldap_perror(ld, "ldap_open"); */ printf ("Could not connect to the server at port %i\n", ld_port); return STATE_CRITICAL; } - /* bind to the ldap server */ - if (ldap_bind_s (ld, ld_binddn, ld_passwd, LDAP_AUTH_SIMPLE) != - LDAP_SUCCESS) { - /*ldap_perror(ld, "ldap_bind"); */ - printf ("Could not bind to the ldap-server\n"); - return STATE_CRITICAL; - } - /* do a search of all objectclasses in the base dn */ if (ldap_search_s (ld, ld_base, LDAP_SCOPE_BASE, ld_attr, NULL, 0, &result) != LDAP_SUCCESS) { @@ -140,8 +130,6 @@ {"host", required_argument, 0, 'H'}, {"base", required_argument, 0, 'b'}, {"attr", required_argument, 0, 'a'}, - {"bind", required_argument, 0, 'D'}, - {"pass", required_argument, 0, 'P'}, {"port", required_argument, 0, 'p'}, {"warn", required_argument, 0, 'w'}, {"crit", required_argument, 0, 'c'}, @@ -159,9 +147,9 @@ while (1) { #ifdef HAVE_GETOPT_H - c = getopt_long (argc, argv, "hVt:c:w:H:b:p:a:D:P:", longopts, &option_index); + c = getopt_long (argc, argv, "hVt:c:w:H:b:p:a:", longopts, &option_index); #else - c = getopt (argc, argv, "+?hVt:c:w:H:b:p:a:D:P:"); + c = getopt (argc, argv, "+?hVt:c:w:H:b:p:a:"); #endif if (c == -1 || c == EOF) @@ -191,12 +179,6 @@ case 'a': ld_attr = optarg; break; - case 'D': - ld_binddn = optarg; - break; - case 'P': - ld_passwd = optarg; - break; case 'w': warn_time = atoi (optarg); break;