~ubuntu-branches/ubuntu/raring/autofs5/raring

« back to all changes in this revision

Viewing changes to debian/patches/01UPSTREAM_autofs-5.0.3-ldap-page-control-configure-fix.patch

  • Committer: Bazaar Package Importer
  • Author(s): Jan Christoph Nordholz
  • Date: 2009-03-09 01:16:48 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090309011648-gjynlid883f0s2c4
Tags: 5.0.4-1
* New upstream version (5.0.4 plus patchset as of 2009/03/09).
  * Closes: #518728.
  * Remove dpatch 14, applied upstream.
* New dpatch 14 to avoid using the relatively young SOCK_CLOEXEC
  feature.
* Only invoke 'make clean' on clean target so ./configure isn't
  purged.
* Fix a typo in the postinst regarding the ucf conffile handling.
* Add 'set -e' to package maintenance scripts.
* Drop unnecessary /var/run/autofs from package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh /usr/share/dpatch/dpatch-run
2
 
## 01UPSTREAM_autofs-5.0.3-ldap-page-control-configure-fix.patch
3
 
## DP: Supplied by upstream.
4
 
 
5
 
@DPATCH@
6
 
 
7
 
diff --git a/CHANGELOG b/CHANGELOG
8
 
index 624fe9e..98855f5 100644
9
 
--- a/CHANGELOG
10
 
+++ b/CHANGELOG
11
 
@@ -1,3 +1,7 @@
12
 
+??/??/2008 autofs-5.0.4
13
 
+-----------------------
14
 
+- correct configure test for ldapr page control functions.
15
 
16
 
 14/01/2008 autofs-5.0.3
17
 
 -----------------------
18
 
 - include krb5.h in lookup_ldap.h (some openssl doesn't implicitly include it).
19
 
diff --git a/aclocal.m4 b/aclocal.m4
20
 
index 118ef0d..f24e076 100644
21
 
--- a/aclocal.m4
22
 
+++ b/aclocal.m4
23
 
@@ -222,3 +222,69 @@ AC_TRY_LINK(
24
 
 LDFLAGS="$af_check_hesiod_save_ldflags"
25
 
 ])
26
 
 
27
 
+dnl --------------------------------------------------------------------------
28
 
+dnl AF_CHECK_FUNC_LDAP_CREATE_PAGE_CONTROL
29
 
+dnl
30
 
+dnl Check for function ldap_create_page_control
31
 
+dnl --------------------------------------------------------------------------
32
 
+AC_DEFUN([AF_CHECK_FUNC_LDAP_CREATE_PAGE_CONTROL],
33
 
+[AC_MSG_CHECKING(for ldap_create_page_control in -lldap)
34
 
+
35
 
+# save current ldflags
36
 
+af_check_ldap_create_page_control_save_ldflags="$LDFLAGS"
37
 
+LDFLAGS="$LDFLAGS -lldap_r"
38
 
+
39
 
+AC_TRY_LINK(
40
 
+  [ #include <ldap.h> ],
41
 
+  [ LDAP *ld;
42
 
+    ber_int_t ps;
43
 
+    struct berval *c;
44
 
+    int ic, ret;
45
 
+    LDAPControl **clp;
46
 
+    ret = ldap_create_page_control(ld,ps,c,ic,clp); ],
47
 
+  [ af_have_ldap_create_page_control=yes
48
 
+    AC_MSG_RESULT(yes) ],
49
 
+  [ AC_MSG_RESULT(no) ])
50
 
+
51
 
+if test "$af_have_ldap_create_page_control" = "yes"; then
52
 
+  AC_DEFINE(HAVE_LDAP_CREATE_PAGE_CONTROL, 1,
53
 
+        [Define to 1 if you have the `ldap_create_page_control' function.])
54
 
+fi
55
 
+
56
 
+# restore ldflags
57
 
+LDFLAGS="$af_check_ldap_create_page_control_save_ldflags"
58
 
+])
59
 
+
60
 
+dnl --------------------------------------------------------------------------
61
 
+dnl AF_CHECK_FUNC_LDAP_PARSE_PAGE_CONTROL
62
 
+dnl
63
 
+dnl Check for function ldap_parse_page_control
64
 
+dnl --------------------------------------------------------------------------
65
 
+AC_DEFUN([AF_CHECK_FUNC_LDAP_PARSE_PAGE_CONTROL],
66
 
+[AC_MSG_CHECKING(for ldap_parse_page_control in -lldap)
67
 
+
68
 
+# save current ldflags
69
 
+af_check_ldap_parse_page_control_save_ldflags="$LDFLAGS"
70
 
+LDFLAGS="$LDFLAGS -lldap_r"
71
 
+
72
 
+AC_TRY_LINK(
73
 
+  [ #include <ldap.h> ],
74
 
+  [ LDAP *ld;
75
 
+    ber_int_t ct;
76
 
+    struct berval *c;
77
 
+    int ret;
78
 
+    LDAPControl **clp;
79
 
+    ret = ldap_parse_page_control(ld,clp,ct,c); ],
80
 
+  [ af_have_ldap_parse_page_control=yes
81
 
+    AC_MSG_RESULT(yes) ],
82
 
+  [ AC_MSG_RESULT(no) ])
83
 
+
84
 
+if test "$af_have_ldap_create_page_control" = "yes"; then
85
 
+  AC_DEFINE(HAVE_LDAP_PARSE_PAGE_CONTROL, 1,
86
 
+        [Define to 1 if you have the `ldap_parse_page_control' function.])
87
 
+fi
88
 
+
89
 
+# restore ldflags
90
 
+LDFLAGS="$af_check_ldap_parse_page_control_save_ldflags"
91
 
+])
92
 
+
93
 
diff --git a/configure b/configure
94
 
index d212b05..e872392 100755
95
 
--- a/configure
96
 
+++ b/configure
97
 
@@ -3631,7 +3631,7 @@ if test "${with_hesiod+set}" = set; then
98
 
 fi
99
 
 
100
 
 
101
 
-if test -z "$HAVE_HESIOD"
102
 
+if test -z "$HAVE_HESIOD" -o "$HAVE_HESIOD" != "0"
103
 
 then
104
 
        HAVE_HESIOD=0
105
 
        { echo "$as_me:$LINENO: checking for libhesiod" >&5
106
 
@@ -4498,7 +4498,7 @@ if test "${with_openldap+set}" = set; then
107
 
 
108
 
 fi
109
 
 
110
 
-if test -z "$HAVE_LDAP"; then
111
 
+if test -z "$HAVE_LDAP" -o "$HAVE_LDAP" != "0"; then
112
 
        HAVE_LDAP=0
113
 
        LDAP_FLAGS="$LDAP_FLAGS -DLDAP_DEPRECATED=1"
114
 
        { echo "$as_me:$LINENO: checking for ldap_initialize in -lldap" >&5
115
 
@@ -4566,71 +4566,106 @@ if test $ac_cv_lib_ldap_ldap_initialize = yes; then
116
 
   HAVE_LDAP=1 LIBLDAP="$LIBLDAP -lldap_r -llber -lresolv"
117
 
 fi
118
 
 
119
 
-       if test "$HAVE_LDAP" == "1"; then
120
 
+       if test "$HAVE_LDAP" = "1"; then
121
 
 
122
 
 cat >>confdefs.h <<\_ACEOF
123
 
 #define WITH_LDAP 1
124
 
 _ACEOF
125
 
 
126
 
        fi
127
 
+       { echo "$as_me:$LINENO: checking for ldap_create_page_control in -lldap" >&5
128
 
+echo $ECHO_N "checking for ldap_create_page_control in -lldap... $ECHO_C" >&6; }
129
 
+
130
 
+# save current ldflags
131
 
+af_check_ldap_create_page_control_save_ldflags="$LDFLAGS"
132
 
+LDFLAGS="$LDFLAGS -lldap_r"
133
 
+
134
 
+cat >conftest.$ac_ext <<_ACEOF
135
 
+/* confdefs.h.  */
136
 
+_ACEOF
137
 
+cat confdefs.h >>conftest.$ac_ext
138
 
+cat >>conftest.$ac_ext <<_ACEOF
139
 
+/* end confdefs.h.  */
140
 
+ #include <ldap.h>
141
 
+int
142
 
+main ()
143
 
+{
144
 
+ LDAP *ld;
145
 
+    ber_int_t ps;
146
 
+    struct berval *c;
147
 
+    int ic, ret;
148
 
+    LDAPControl **clp;
149
 
+    ret = ldap_create_page_control(ld,ps,c,ic,clp);
150
 
+  ;
151
 
+  return 0;
152
 
+}
153
 
+_ACEOF
154
 
+rm -f conftest.$ac_objext conftest$ac_exeext
155
 
+if { (ac_try="$ac_link"
156
 
+case "(($ac_try" in
157
 
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
158
 
+  *) ac_try_echo=$ac_try;;
159
 
+esac
160
 
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
161
 
+  (eval "$ac_link") 2>conftest.er1
162
 
+  ac_status=$?
163
 
+  grep -v '^ *+' conftest.er1 >conftest.err
164
 
+  rm -f conftest.er1
165
 
+  cat conftest.err >&5
166
 
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
167
 
+  (exit $ac_status); } && {
168
 
+        test -z "$ac_c_werror_flag" ||
169
 
+        test ! -s conftest.err
170
 
+       } && test -s conftest$ac_exeext &&
171
 
+       $as_test_x conftest$ac_exeext; then
172
 
+   af_have_ldap_create_page_control=yes
173
 
+    { echo "$as_me:$LINENO: result: yes" >&5
174
 
+echo "${ECHO_T}yes" >&6; }
175
 
+else
176
 
+  echo "$as_me: failed program was:" >&5
177
 
+sed 's/^/| /' conftest.$ac_ext >&5
178
 
+
179
 
+        { echo "$as_me:$LINENO: result: no" >&5
180
 
+echo "${ECHO_T}no" >&6; }
181
 
 fi
182
 
 
183
 
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
184
 
+      conftest$ac_exeext conftest.$ac_ext
185
 
 
186
 
+if test "$af_have_ldap_create_page_control" = "yes"; then
187
 
 
188
 
+cat >>confdefs.h <<\_ACEOF
189
 
+#define HAVE_LDAP_CREATE_PAGE_CONTROL 1
190
 
+_ACEOF
191
 
 
192
 
-LDFLAGS="${AF_tmp_ldflags}"
193
 
+fi
194
 
 
195
 
+# restore ldflags
196
 
+LDFLAGS="$af_check_ldap_create_page_control_save_ldflags"
197
 
 
198
 
+       { echo "$as_me:$LINENO: checking for ldap_parse_page_control in -lldap" >&5
199
 
+echo $ECHO_N "checking for ldap_parse_page_control in -lldap... $ECHO_C" >&6; }
200
 
 
201
 
-for ac_func in ldap_create_page_control ldap_parse_page_control
202
 
-do
203
 
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
204
 
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
205
 
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
206
 
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
207
 
-  echo $ECHO_N "(cached) $ECHO_C" >&6
208
 
-else
209
 
-  cat >conftest.$ac_ext <<_ACEOF
210
 
+# save current ldflags
211
 
+af_check_ldap_parse_page_control_save_ldflags="$LDFLAGS"
212
 
+LDFLAGS="$LDFLAGS -lldap_r"
213
 
+
214
 
+cat >conftest.$ac_ext <<_ACEOF
215
 
 /* confdefs.h.  */
216
 
 _ACEOF
217
 
 cat confdefs.h >>conftest.$ac_ext
218
 
 cat >>conftest.$ac_ext <<_ACEOF
219
 
 /* end confdefs.h.  */
220
 
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
221
 
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
222
 
-#define $ac_func innocuous_$ac_func
223
 
-
224
 
-/* System header to define __stub macros and hopefully few prototypes,
225
 
-    which can conflict with char $ac_func (); below.
226
 
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
227
 
-    <limits.h> exists even on freestanding compilers.  */
228
 
-
229
 
-#ifdef __STDC__
230
 
-# include <limits.h>
231
 
-#else
232
 
-# include <assert.h>
233
 
-#endif
234
 
-
235
 
-#undef $ac_func
236
 
-
237
 
-/* Override any GCC internal prototype to avoid an error.
238
 
-   Use char because int might match the return type of a GCC
239
 
-   builtin and then its argument prototype would still apply.  */
240
 
-#ifdef __cplusplus
241
 
-extern "C"
242
 
-#endif
243
 
-char $ac_func ();
244
 
-/* The GNU C library defines this for functions which it implements
245
 
-    to always fail with ENOSYS.  Some functions are actually named
246
 
-    something starting with __ and the normal name is an alias.  */
247
 
-#if defined __stub_$ac_func || defined __stub___$ac_func
248
 
-choke me
249
 
-#endif
250
 
-
251
 
+ #include <ldap.h>
252
 
 int
253
 
 main ()
254
 
 {
255
 
-return $ac_func ();
256
 
+ LDAP *ld;
257
 
+    ber_int_t ct;
258
 
+    struct berval *c;
259
 
+    int ret;
260
 
+    LDAPControl **clp;
261
 
+    ret = ldap_parse_page_control(ld,clp,ct,c);
262
 
   ;
263
 
   return 0;
264
 
 }
265
 
@@ -4653,28 +4688,37 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
266
 
         test ! -s conftest.err
267
 
        } && test -s conftest$ac_exeext &&
268
 
        $as_test_x conftest$ac_exeext; then
269
 
-  eval "$as_ac_var=yes"
270
 
+   af_have_ldap_parse_page_control=yes
271
 
+    { echo "$as_me:$LINENO: result: yes" >&5
272
 
+echo "${ECHO_T}yes" >&6; }
273
 
 else
274
 
   echo "$as_me: failed program was:" >&5
275
 
 sed 's/^/| /' conftest.$ac_ext >&5
276
 
 
277
 
-       eval "$as_ac_var=no"
278
 
+        { echo "$as_me:$LINENO: result: no" >&5
279
 
+echo "${ECHO_T}no" >&6; }
280
 
 fi
281
 
 
282
 
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
283
 
       conftest$ac_exeext conftest.$ac_ext
284
 
-fi
285
 
-ac_res=`eval echo '${'$as_ac_var'}'`
286
 
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
287
 
-echo "${ECHO_T}$ac_res" >&6; }
288
 
-if test `eval echo '${'$as_ac_var'}'` = yes; then
289
 
-  cat >>confdefs.h <<_ACEOF
290
 
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
291
 
+
292
 
+if test "$af_have_ldap_create_page_control" = "yes"; then
293
 
+
294
 
+cat >>confdefs.h <<\_ACEOF
295
 
+#define HAVE_LDAP_PARSE_PAGE_CONTROL 1
296
 
 _ACEOF
297
 
 
298
 
 fi
299
 
-done
300
 
 
301
 
+# restore ldflags
302
 
+LDFLAGS="$af_check_ldap_parse_page_control_save_ldflags"
303
 
+
304
 
+fi
305
 
+
306
 
+
307
 
+
308
 
+
309
 
+LDFLAGS="${AF_tmp_ldflags}"
310
 
 
311
 
 #
312
 
 # SASL support
313
 
@@ -4703,7 +4747,7 @@ if test "${with_sasl+set}" = set; then
314
 
 
315
 
 fi
316
 
 
317
 
-if test -z "$HAVE_SASL" -a "$HAVE_LIBXML" == "1"
318
 
+if test -z "$HAVE_SASL" -o "$HAVE_SASL" != "0" -a "$HAVE_LIBXML" == "1"
319
 
 then
320
 
        HAVE_SASL=0
321
 
        { echo "$as_me:$LINENO: checking for sasl_client_start in -lsasl2" >&5
322
 
diff --git a/configure.in b/configure.in
323
 
index 952d040..a9c86dd 100644
324
 
--- a/configure.in
325
 
+++ b/configure.in
326
 
@@ -155,7 +155,7 @@ AC_ARG_WITH(hesiod,
327
 
        fi
328
 
 )      
329
 
 
330
 
-if test -z "$HAVE_HESIOD"
331
 
+if test -z "$HAVE_HESIOD" -o "$HAVE_HESIOD" != "0"
332
 
 then
333
 
        HAVE_HESIOD=0
334
 
        AF_CHECK_LIBHESIOD()
335
 
@@ -194,15 +194,17 @@ AC_ARG_WITH(openldap,
336
 
                LDAP_FLAGS="-I${withval}/include"
337
 
        fi
338
 
 )
339
 
-if test -z "$HAVE_LDAP"; then
340
 
+if test -z "$HAVE_LDAP" -o "$HAVE_LDAP" != "0"; then
341
 
        HAVE_LDAP=0
342
 
        LDAP_FLAGS="$LDAP_FLAGS -DLDAP_DEPRECATED=1"
343
 
        AC_CHECK_LIB(ldap, ldap_initialize, HAVE_LDAP=1 LIBLDAP="$LIBLDAP -lldap_r -llber -lresolv", ,
344
 
                     -llber -lresolv $LIBS)
345
 
-       if test "$HAVE_LDAP" == "1"; then
346
 
+       if test "$HAVE_LDAP" = "1"; then
347
 
                AC_DEFINE(WITH_LDAP,1,
348
 
                        [Define if using LDAP as a source of automount maps])
349
 
        fi
350
 
+       AF_CHECK_FUNC_LDAP_CREATE_PAGE_CONTROL()
351
 
+       AF_CHECK_FUNC_LDAP_PARSE_PAGE_CONTROL()
352
 
 fi
353
 
 
354
 
 AC_SUBST(LDAP_FLAGS)
355
 
@@ -210,8 +212,6 @@ AC_SUBST(HAVE_LDAP)
356
 
 AC_SUBST(LIBLDAP)
357
 
 LDFLAGS="${AF_tmp_ldflags}"
358
 
 
359
 
-AC_CHECK_FUNCS(ldap_create_page_control ldap_parse_page_control)
360
 
-
361
 
 #
362
 
 # SASL support
363
 
 #   configure magic taken from:
364
 
@@ -236,7 +236,7 @@ AC_ARG_WITH(sasl,
365
 
                SASL_FLAGS="-I${withval}/include"
366
 
        fi
367
 
 )
368
 
-if test -z "$HAVE_SASL" -a "$HAVE_LIBXML" == "1"
369
 
+if test -z "$HAVE_SASL" -o "$HAVE_SASL" != "0" -a "$HAVE_LIBXML" == "1"
370
 
 then
371
 
        HAVE_SASL=0
372
 
        AC_CHECK_LIB(sasl2, sasl_client_start, HAVE_SASL=1 LIBSASL="$LIBSASL -lsasl2", , -lsasl2 $LIBS)
373
 
diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c
374
 
index 0723fd8..e8530f6 100644
375
 
--- a/modules/lookup_ldap.c
376
 
+++ b/modules/lookup_ldap.c
377
 
@@ -55,7 +55,7 @@ struct ldap_search_params {
378
 
        char *query, **attrs;
379
 
        struct berval *cookie;
380
 
        int morePages;
381
 
-       unsigned int totalCount;
382
 
+       ber_int_t totalCount;
383
 
        LDAPMessage *result;
384
 
        time_t age;
385
 
 };
386
 
@@ -63,7 +63,7 @@ struct ldap_search_params {
387
 
 static LDAP *auth_init(unsigned logopt, const char *, struct lookup_context *);
388
 
 
389
 
 #ifndef HAVE_LDAP_CREATE_PAGE_CONTROL
390
 
-int ldap_create_page_control(LDAP *ldap, unsigned int pagesize,
391
 
+int ldap_create_page_control(LDAP *ldap, ber_int_t pagesize,
392
 
                             struct berval *cookie, char isCritical,
393
 
                             LDAPControl **output)
394
 
 {
395
 
@@ -93,7 +93,7 @@ int ldap_create_page_control(LDAP *ldap, unsigned int pagesize,
396
 
 
397
 
 #ifndef HAVE_LDAP_PARSE_PAGE_CONTROL
398
 
 int ldap_parse_page_control(LDAP *ldap, LDAPControl **controls,
399
 
-                           unsigned int *totalcount, struct berval **cookie)
400
 
+                           ber_int_t *totalcount, struct berval **cookie)
401
 
 {
402
 
        int i, rc;
403
 
        BerElement *theBer;
404
 
@@ -1644,7 +1644,7 @@ static int do_paged_query(struct ldap_search_params *sp, struct lookup_context *
405
 
        struct autofs_point *ap = sp->ap;
406
 
        LDAPControl *pageControl=NULL, *controls[2] = { NULL, NULL };
407
 
        LDAPControl **returnedControls = NULL;
408
 
-       static unsigned long pageSize = 1000;
409
 
+       static ber_int_t pageSize = 1000;
410
 
        static char pagingCriticality = 'T';
411
 
        int rv, scope = LDAP_SCOPE_SUBTREE;
412