~ubuntu-branches/ubuntu/hoary/nagios-plugins/hoary

« back to all changes in this revision

Viewing changes to debian/patches/01_ldap21bind.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Guido Trotter
  • Date: 2004-06-15 15:37:48 UTC
  • Revision ID: james.westby@ubuntu.com-20040615153748-qu1p82yghm0o98ct
Tags: 1.3.1.0-7
Add 03_hostwithnumbers.dpatch written by me to correct the behaviour
of is_hostname() in utils.c  about host components beginning with a 
number (closes: #253620). Thanks to Andreas Edler who spotted
the problem.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh -e
 
2
## 01_ldap21bind.dpatch by Guido Trotter <ultrotter@debian.org>
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: Bind to the LDAP server using protocol version 3, so to be able 
 
6
## DP: to check both slapd 2.0 and 2.1
 
7
 
 
8
if [ $# -ne 1 ]; then
 
9
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
 
10
    exit 1
 
11
fi
 
12
 
 
13
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
 
14
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
 
15
 
 
16
case "$1" in
 
17
       -patch) patch $patch_opts -p1 < $0;;
 
18
       -unpatch) patch $patch_opts -p1 -R < $0;;
 
19
        *)
 
20
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
 
21
                exit 1;;
 
22
esac
 
23
 
 
24
exit 0
 
25
 
 
26
@DPATCH@
 
27
diff -urNad /home/ultrotter/tmp/nagios/nagios-plugins-1.3.1/plugins/check_ldap.c nagios-plugins-1.3.1/plugins/check_ldap.c
 
28
--- /home/ultrotter/tmp/nagios/nagios-plugins-1.3.1/plugins/check_ldap.c        2003-01-29 07:16:15.000000000 +0100
 
29
+++ nagios-plugins-1.3.1/plugins/check_ldap.c   2003-08-31 13:46:22.000000000 +0200
 
30
@@ -50,6 +50,7 @@
 
31
 unsigned int ld_port = DEFAULT_PORT;
 
32
 int warn_time = UNDEFINED;
 
33
 int crit_time = UNDEFINED;
 
34
+int version;
 
35
 
 
36
 int
 
37
 main (int argc, char *argv[])
 
38
@@ -80,6 +81,9 @@
 
39
                return STATE_CRITICAL;
 
40
        }
 
41
 
 
42
+       version = LDAP_VERSION3;
 
43
+       ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &version);
 
44
+
 
45
        /* bind to the ldap server */
 
46
        if (ldap_bind_s (ld, ld_binddn, ld_passwd, LDAP_AUTH_SIMPLE) !=
 
47
                        LDAP_SUCCESS) {