summaryrefslogtreecommitdiffstats
path: root/abs/extra/autofs/0001-autofs-5.0.5-include-krb5-library.patch
blob: 572ca97fd19960b6f3a29d3630975caa6a291e25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
From e467755fac27630730be25c4b41e5d0cfcd89c67 Mon Sep 17 00:00:00 2001
From: Ian Kent <raven@themaw.net>
Date: Tue, 10 Aug 2010 15:48:21 +0800
Subject: [PATCH 1/2] autofs-5.0.5 - include krb5 library

Since the Cyrus SASL module calls Kerberos directly we should be
linking against the Kerberos librarys.
---
 Makefile.conf.in |    2 +
 aclocal.m4       |   19 +++++++++++++++
 configure        |   67 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
 configure.in     |    5 +++-
 modules/Makefile |    4 +-
 5 files changed, 93 insertions(+), 4 deletions(-)

diff --git a/Makefile.conf.in b/Makefile.conf.in
index f0287c3..a9bcf8c 100644
--- a/Makefile.conf.in
+++ b/Makefile.conf.in
@@ -31,6 +31,8 @@ XML_FLAGS = @XML_FLAGS@
 SASL = @HAVE_SASL@
 LIBSASL= @LIBSASL@
 SASL_FLAGS = @SASL_FLAGS@
+KRB5_LIBS=@KRB5_LIBS@
+KRB5_FLAGS=@KRB5_FLAGS@
 
 # NIS+ support: yes (1) no (0)
 NISPLUS = @HAVE_NISPLUS@
diff --git a/aclocal.m4 b/aclocal.m4
index e7f1a30..750a159 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -215,6 +215,25 @@ else
 fi])
 
 dnl --------------------------------------------------------------------------
+dnl AF_CHECK_KRB5
+dnl
+dnl Check for Kerberos 5
+dnl --------------------------------------------------------------------------
+AC_DEFUN([AF_CHECK_KRB5],
+[AC_PATH_PROGS(KRB5_CONFIG, krb5-config, no)
+AC_MSG_CHECKING(for Kerberos library)
+if test "$KRB5_CONFIG" = "no"
+then
+  AC_MSG_RESULT(no)
+  HAVE_KRB5=0
+else
+  AC_MSG_RESULT(yes)
+  HAVE_KRB5=1
+  KRB5_LIBS=`$KRB5_CONFIG --libs`
+  KRB5_FLAGS=`$KRB5_CONFIG --cflags`
+fi])
+
+dnl --------------------------------------------------------------------------
 dnl AF_CHECK_LIBHESIOD
 dnl
 dnl Check for lib hesiod
diff --git a/configure b/configure
index 159f25f..500411c 100755
--- a/configure
+++ b/configure
@@ -640,6 +640,8 @@ ac_subst_vars='LTLIBOBJS
 LIBOBJS
 DAEMON_LDFLAGS
 DAEMON_CFLAGS
+KRB5_FLAGS
+KRB5_LIBS
 LIBSASL
 HAVE_SASL
 SASL_FLAGS
@@ -657,6 +659,7 @@ LIBHESIOD
 HAVE_HESIOD
 LIBRESOLV
 LIBNSL
+KRB5_CONFIG
 XML_CONFIG
 PATH_RPCGEN
 RPCGEN
@@ -3723,7 +3726,7 @@ $as_echo "no" >&6; }
   fi
 fi
 
-# LDAP SASL auth need libxml
+# LDAP SASL auth needs libxml and Kerberos
 for ac_prog in xml2-config
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -3801,6 +3804,66 @@ _ACEOF
     fi
   fi
 fi
+for ac_prog in krb5-config
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_KRB5_CONFIG+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $KRB5_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_KRB5_CONFIG="$KRB5_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_KRB5_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+KRB5_CONFIG=$ac_cv_path_KRB5_CONFIG
+if test -n "$KRB5_CONFIG"; then
+  { $as_echo "$as_me:$LINENO: result: $KRB5_CONFIG" >&5
+$as_echo "$KRB5_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$KRB5_CONFIG" && break
+done
+test -n "$KRB5_CONFIG" || KRB5_CONFIG="no"
+
+{ $as_echo "$as_me:$LINENO: checking for Kerberos library" >&5
+$as_echo_n "checking for Kerberos library... " >&6; }
+if test "$KRB5_CONFIG" = "no"
+then
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+  HAVE_KRB5=0
+else
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+  HAVE_KRB5=1
+  KRB5_LIBS=`$KRB5_CONFIG --libs`
+  KRB5_FLAGS=`$KRB5_CONFIG --cflags`
+fi
 
 #
 # glibc/libc 6 new libraries
@@ -5178,6 +5241,8 @@ fi
 
 
 
+
+
 LDFLAGS="${AF_tmp_ldflags}"
 
 #
diff --git a/configure.in b/configure.in
index f649a58..70b45e8 100644
--- a/configure.in
+++ b/configure.in
@@ -144,8 +144,9 @@ AF_CHECK_PROG(RPCGEN, rpcgen, , $searchpath)
 #
 AF_SLOPPY_MOUNT()
 
-# LDAP SASL auth need libxml
+# LDAP SASL auth needs libxml and Kerberos
 AF_CHECK_LIBXML()
+AF_CHECK_KRB5()
 
 #
 # glibc/libc 6 new libraries
@@ -274,6 +275,8 @@ AC_SUBST(XML_LIBS)
 AC_SUBST(SASL_FLAGS)
 AC_SUBST(HAVE_SASL)
 AC_SUBST(LIBSASL)
+AC_SUBST(KRB5_LIBS)
+AC_SUBST(KRB5_FLAGS)
 LDFLAGS="${AF_tmp_ldflags}"
 
 #
diff --git a/modules/Makefile b/modules/Makefile
index 13b3bd8..2389196 100644
--- a/modules/Makefile
+++ b/modules/Makefile
@@ -42,8 +42,8 @@ ifeq ($(LDAP), 1)
   MODS += lookup_ldap.so
   ifeq ($(SASL), 1)
     SASL_OBJ = cyrus-sasl.o
-    LDAP_FLAGS += $(SASL_FLAGS) $(XML_FLAGS) -DLDAP_THREAD_SAFE
-    LIBLDAP += $(LIBSASL) $(XML_LIBS)
+    LDAP_FLAGS += $(SASL_FLAGS) $(XML_FLAGS) $(KRB5_FLAGS) -DLDAP_THREAD_SAFE
+    LIBLDAP += $(LIBSASL) $(XML_LIBS) $(KRB5_LIBS)
   endif
 endif
 
-- 
1.7.5.1