diff options
Diffstat (limited to 'web/attachments/66460-nagios-plugins-1.3.1-check-ldap.patch')
-rw-r--r-- | web/attachments/66460-nagios-plugins-1.3.1-check-ldap.patch | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/web/attachments/66460-nagios-plugins-1.3.1-check-ldap.patch b/web/attachments/66460-nagios-plugins-1.3.1-check-ldap.patch new file mode 100644 index 0000000..31bf7d1 --- /dev/null +++ b/web/attachments/66460-nagios-plugins-1.3.1-check-ldap.patch | |||
@@ -0,0 +1,67 @@ | |||
1 | --- ./plugins/check_ldap.c~ 2003-01-29 06:16:15.000000000 +0000 | ||
2 | +++ ./plugins/check_ldap.c 2003-10-22 11:10:44.000000000 +0100 | ||
3 | @@ -45,8 +45,6 @@ | ||
4 | char *ld_attr = ld_defattr; | ||
5 | char *ld_host = ""; | ||
6 | char *ld_base = ""; | ||
7 | -char *ld_passwd = NULL; | ||
8 | -char *ld_binddn = NULL; | ||
9 | unsigned int ld_port = DEFAULT_PORT; | ||
10 | int warn_time = UNDEFINED; | ||
11 | int crit_time = UNDEFINED; | ||
12 | @@ -74,20 +72,12 @@ | ||
13 | time (&time0); | ||
14 | |||
15 | /* initialize ldap */ | ||
16 | - if (!(ld = ldap_open (ld_host, ld_port))) { | ||
17 | + if (!(ld = ldap_init (ld_host, ld_port))) { | ||
18 | /*ldap_perror(ld, "ldap_open"); */ | ||
19 | printf ("Could not connect to the server at port %i\n", ld_port); | ||
20 | return STATE_CRITICAL; | ||
21 | } | ||
22 | |||
23 | - /* bind to the ldap server */ | ||
24 | - if (ldap_bind_s (ld, ld_binddn, ld_passwd, LDAP_AUTH_SIMPLE) != | ||
25 | - LDAP_SUCCESS) { | ||
26 | - /*ldap_perror(ld, "ldap_bind"); */ | ||
27 | - printf ("Could not bind to the ldap-server\n"); | ||
28 | - return STATE_CRITICAL; | ||
29 | - } | ||
30 | - | ||
31 | /* do a search of all objectclasses in the base dn */ | ||
32 | if (ldap_search_s (ld, ld_base, LDAP_SCOPE_BASE, ld_attr, NULL, 0, &result) | ||
33 | != LDAP_SUCCESS) { | ||
34 | @@ -140,8 +130,6 @@ | ||
35 | {"host", required_argument, 0, 'H'}, | ||
36 | {"base", required_argument, 0, 'b'}, | ||
37 | {"attr", required_argument, 0, 'a'}, | ||
38 | - {"bind", required_argument, 0, 'D'}, | ||
39 | - {"pass", required_argument, 0, 'P'}, | ||
40 | {"port", required_argument, 0, 'p'}, | ||
41 | {"warn", required_argument, 0, 'w'}, | ||
42 | {"crit", required_argument, 0, 'c'}, | ||
43 | @@ -159,9 +147,9 @@ | ||
44 | |||
45 | while (1) { | ||
46 | #ifdef HAVE_GETOPT_H | ||
47 | - c = getopt_long (argc, argv, "hVt:c:w:H:b:p:a:D:P:", longopts, &option_index); | ||
48 | + c = getopt_long (argc, argv, "hVt:c:w:H:b:p:a:", longopts, &option_index); | ||
49 | #else | ||
50 | - c = getopt (argc, argv, "+?hVt:c:w:H:b:p:a:D:P:"); | ||
51 | + c = getopt (argc, argv, "+?hVt:c:w:H:b:p:a:"); | ||
52 | #endif | ||
53 | |||
54 | if (c == -1 || c == EOF) | ||
55 | @@ -191,12 +179,6 @@ | ||
56 | case 'a': | ||
57 | ld_attr = optarg; | ||
58 | break; | ||
59 | - case 'D': | ||
60 | - ld_binddn = optarg; | ||
61 | - break; | ||
62 | - case 'P': | ||
63 | - ld_passwd = optarg; | ||
64 | - break; | ||
65 | case 'w': | ||
66 | warn_time = atoi (optarg); | ||
67 | break; | ||