1 |
hwoarang 11/05/26 15:31:45 |
2 |
|
3 |
Added: freeradius-2.1.10-ipv6.patch |
4 |
freeradius-2.1.10-versionless-la-files.patch |
5 |
freeradius-2.1.10-ssl.patch |
6 |
freeradius-2.1.10-pkglibdir.patch |
7 |
freeradius-2.1.10-qafixes.patch |
8 |
Log: |
9 |
Version bump. Thanks to Christian Franke <nobody-gentoo@×××××××.ws>. Bug 308449 |
10 |
|
11 |
(Portage version: 2.1.9.49/cvs/Linux x86_64) |
12 |
|
13 |
Revision Changes Path |
14 |
1.1 net-dialup/freeradius/files/freeradius-2.1.10-ipv6.patch |
15 |
|
16 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dialup/freeradius/files/freeradius-2.1.10-ipv6.patch?rev=1.1&view=markup |
17 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dialup/freeradius/files/freeradius-2.1.10-ipv6.patch?rev=1.1&content-type=text/plain |
18 |
|
19 |
Index: freeradius-2.1.10-ipv6.patch |
20 |
=================================================================== |
21 |
diff -aur freeradius-server-2.1.10.orig/src/lib/udpfromto.c freeradius-server-2.1.10/src/lib/udpfromto.c |
22 |
--- freeradius-server-2.1.10.orig/src/lib/udpfromto.c 2010-09-28 13:03:56.000000000 +0200 |
23 |
+++ freeradius-server-2.1.10/src/lib/udpfromto.c 2011-02-09 22:41:46.000000000 +0100 |
24 |
@@ -87,7 +87,7 @@ |
25 |
* This should actually be standard IPv6 |
26 |
*/ |
27 |
proto = IPPROTO_IPV6; |
28 |
- flag = IPV6_PKTINFO; |
29 |
+ flag = IPV6_2292PKTINFO; |
30 |
#endif |
31 |
#endif |
32 |
} else { |
33 |
|
34 |
|
35 |
|
36 |
1.1 net-dialup/freeradius/files/freeradius-2.1.10-versionless-la-files.patch |
37 |
|
38 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dialup/freeradius/files/freeradius-2.1.10-versionless-la-files.patch?rev=1.1&view=markup |
39 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dialup/freeradius/files/freeradius-2.1.10-versionless-la-files.patch?rev=1.1&content-type=text/plain |
40 |
|
41 |
Index: freeradius-2.1.10-versionless-la-files.patch |
42 |
=================================================================== |
43 |
diff -Naur freeradius-server-2.1.10.orig/src/lib/Makefile freeradius-server-2.1.10/src/lib/Makefile |
44 |
--- freeradius-server-2.1.10.orig/src/lib/Makefile 2010-09-28 13:03:56.000000000 +0200 |
45 |
+++ freeradius-server-2.1.10/src/lib/Makefile 2011-02-09 17:39:25.000000000 +0100 |
46 |
@@ -54,7 +54,5 @@ |
47 |
$(INSTALL) -d -m 755 $(R)$(libdir) |
48 |
$(LIBTOOL) --mode=install $(INSTALL) -c $(TARGET).la \ |
49 |
$(R)$(libdir)/$(TARGET).la |
50 |
- rm -f $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION).la; |
51 |
- ln -s $(TARGET).la $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION).la |
52 |
|
53 |
reconfig: |
54 |
diff -Naur freeradius-server-2.1.10.orig/src/modules/rlm_eap/libeap/Makefile freeradius-server-2.1.10/src/modules/rlm_eap/libeap/Makefile |
55 |
--- freeradius-server-2.1.10.orig/src/modules/rlm_eap/libeap/Makefile 2010-09-28 13:03:56.000000000 +0200 |
56 |
+++ freeradius-server-2.1.10/src/modules/rlm_eap/libeap/Makefile 2011-02-09 17:40:00.000000000 +0100 |
57 |
@@ -44,5 +44,3 @@ |
58 |
install: all |
59 |
$(LIBTOOL) --mode=install $(INSTALL) -c $(TARGET).la \ |
60 |
$(R)$(libdir)/$(TARGET).la |
61 |
- rm -f $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION).la; |
62 |
- ln -s $(TARGET).la $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION).la |
63 |
diff -Naur freeradius-server-2.1.10.orig/src/modules/rlm_sql/drivers/rules.mak freeradius-server-2.1.10/src/modules/rlm_sql/drivers/rules.mak |
64 |
--- freeradius-server-2.1.10.orig/src/modules/rlm_sql/drivers/rules.mak 2010-09-28 13:03:56.000000000 +0200 |
65 |
+++ freeradius-server-2.1.10/src/modules/rlm_sql/drivers/rules.mak 2011-02-09 17:40:17.000000000 +0100 |
66 |
@@ -147,6 +147,4 @@ |
67 |
if [ "x$(TARGET)" != "x" ]; then \ |
68 |
$(LIBTOOL) --mode=install $(INSTALL) -c \ |
69 |
$(TARGET).la $(R)$(libdir)/$(TARGET).la || exit $$?; \ |
70 |
- rm -f $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION).la; \ |
71 |
- ln -s $(TARGET).la $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION).la || exit $$?; \ |
72 |
fi |
73 |
diff -Naur freeradius-server-2.1.10.orig/src/modules/rules.mak freeradius-server-2.1.10/src/modules/rules.mak |
74 |
--- freeradius-server-2.1.10.orig/src/modules/rules.mak 2010-09-28 13:03:56.000000000 +0200 |
75 |
+++ freeradius-server-2.1.10/src/modules/rules.mak 2011-02-09 17:39:43.000000000 +0100 |
76 |
@@ -171,6 +171,4 @@ |
77 |
if [ "x$(TARGET)" != "x" ]; then \ |
78 |
$(LIBTOOL) --mode=install $(INSTALL) -c \ |
79 |
$(TARGET).la $(R)$(libdir)/$(TARGET).la || exit $$?; \ |
80 |
- rm -f $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION).la; \ |
81 |
- ln -s $(TARGET).la $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION).la || exit $$?; \ |
82 |
fi |
83 |
|
84 |
|
85 |
|
86 |
1.1 net-dialup/freeradius/files/freeradius-2.1.10-ssl.patch |
87 |
|
88 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dialup/freeradius/files/freeradius-2.1.10-ssl.patch?rev=1.1&view=markup |
89 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dialup/freeradius/files/freeradius-2.1.10-ssl.patch?rev=1.1&content-type=text/plain |
90 |
|
91 |
Index: freeradius-2.1.10-ssl.patch |
92 |
=================================================================== |
93 |
diff -Naur freeradius-server-2.1.10.orig/src/modules/rlm_eap/libeap/Makefile freeradius-server-2.1.10/src/modules/rlm_eap/libeap/Makefile |
94 |
--- freeradius-server-2.1.10.orig/src/modules/rlm_eap/libeap/Makefile 2010-09-28 13:03:56.000000000 +0200 |
95 |
+++ freeradius-server-2.1.10/src/modules/rlm_eap/libeap/Makefile 2011-02-09 17:41:44.000000000 +0100 |
96 |
@@ -9,6 +9,7 @@ |
97 |
SRCS = eapcommon.c eapcrypto.c eapsimlib.c fips186prf.c |
98 |
ifneq ($(OPENSSL_LIBS),) |
99 |
SRCS += cb.c eap_tls.c mppe_keys.c tls.c |
100 |
+LIBS += $(OPENSSL_LIBS) |
101 |
endif |
102 |
LT_OBJS = $(SRCS:.c=.lo) |
103 |
INCLUDES = eap_types.h eap_tls.h |
104 |
|
105 |
|
106 |
|
107 |
1.1 net-dialup/freeradius/files/freeradius-2.1.10-pkglibdir.patch |
108 |
|
109 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dialup/freeradius/files/freeradius-2.1.10-pkglibdir.patch?rev=1.1&view=markup |
110 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dialup/freeradius/files/freeradius-2.1.10-pkglibdir.patch?rev=1.1&content-type=text/plain |
111 |
|
112 |
Index: freeradius-2.1.10-pkglibdir.patch |
113 |
=================================================================== |
114 |
diff -Naur freeradius-server-2.1.10.orig/Make.inc.in freeradius-server-2.1.10/Make.inc.in |
115 |
--- freeradius-server-2.1.10.orig/Make.inc.in 2010-09-28 13:03:56.000000000 +0200 |
116 |
+++ freeradius-server-2.1.10/Make.inc.in 2011-02-09 17:51:46.000000000 +0100 |
117 |
@@ -10,6 +10,7 @@ |
118 |
sysconfdir = @sysconfdir@ |
119 |
localstatedir = @localstatedir@ |
120 |
libdir = @libdir@ |
121 |
+pkglibdir = @libdir@/freeradius |
122 |
bindir = @bindir@ |
123 |
sbindir = @sbindir@ |
124 |
docdir = @docdir@ |
125 |
diff -Naur freeradius-server-2.1.10.orig/raddb/radiusd.conf.in freeradius-server-2.1.10/raddb/radiusd.conf.in |
126 |
--- freeradius-server-2.1.10.orig/raddb/radiusd.conf.in 2010-09-28 13:03:56.000000000 +0200 |
127 |
+++ freeradius-server-2.1.10/raddb/radiusd.conf.in 2011-02-09 17:51:57.000000000 +0100 |
128 |
@@ -103,7 +103,7 @@ |
129 |
# make |
130 |
# make install |
131 |
# |
132 |
-libdir = @libdir@ |
133 |
+libdir = @libdir@/freeradius |
134 |
|
135 |
# pidfile: Where to place the PID of the RADIUS server. |
136 |
# |
137 |
diff -Naur freeradius-server-2.1.10.orig/src/modules/Makefile freeradius-server-2.1.10/src/modules/Makefile |
138 |
--- freeradius-server-2.1.10.orig/src/modules/Makefile 2010-09-28 13:03:56.000000000 +0200 |
139 |
+++ freeradius-server-2.1.10/src/modules/Makefile 2011-02-09 17:52:11.000000000 +0100 |
140 |
@@ -12,7 +12,7 @@ |
141 |
@$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common |
142 |
|
143 |
install: |
144 |
- $(INSTALL) -d -m 755 $(R)$(libdir) |
145 |
+ $(INSTALL) -d -m 755 $(R)$(pkglibdir) |
146 |
@$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common |
147 |
|
148 |
clean: |
149 |
diff -Naur freeradius-server-2.1.10.orig/src/modules/rules.mak freeradius-server-2.1.10/src/modules/rules.mak |
150 |
--- freeradius-server-2.1.10.orig/src/modules/rules.mak 2011-02-09 17:50:58.000000000 +0100 |
151 |
+++ freeradius-server-2.1.10/src/modules/rules.mak 2011-02-09 17:52:53.000000000 +0100 |
152 |
@@ -123,7 +123,7 @@ |
153 |
$(TARGET).la: $(LT_OBJS) |
154 |
$(LIBTOOL) --mode=link $(CC) -release $(RADIUSD_VERSION) \ |
155 |
-module $(LINK_MODE) $(LDFLAGS) $(RLM_LDFLAGS) -o $@ \ |
156 |
- -rpath $(libdir) $^ $(LIBRADIUS) $(RLM_LIBS) $(LIBS) |
157 |
+ -rpath $(pkglibdir) $^ $(LIBRADIUS) $(RLM_LIBS) $(LIBS) |
158 |
|
159 |
####################################################################### |
160 |
# |
161 |
@@ -164,11 +164,11 @@ |
162 |
# Do any module-specific installation. |
163 |
# |
164 |
# If there isn't a TARGET defined, then don't do anything. |
165 |
-# Otherwise, install the libraries into $(libdir) |
166 |
+# Otherwise, install the libraries into $(pkglibdir) |
167 |
# |
168 |
install: |
169 |
@[ "x$(RLM_INSTALL)" = "x" ] || $(MAKE) $(MFLAGS) $(RLM_INSTALL) |
170 |
if [ "x$(TARGET)" != "x" ]; then \ |
171 |
$(LIBTOOL) --mode=install $(INSTALL) -c \ |
172 |
- $(TARGET).la $(R)$(libdir)/$(TARGET).la || exit $$?; \ |
173 |
+ $(TARGET).la $(R)$(pkglibdir)/$(TARGET).la || exit $$?; \ |
174 |
fi |
175 |
|
176 |
|
177 |
|
178 |
1.1 net-dialup/freeradius/files/freeradius-2.1.10-qafixes.patch |
179 |
|
180 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dialup/freeradius/files/freeradius-2.1.10-qafixes.patch?rev=1.1&view=markup |
181 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dialup/freeradius/files/freeradius-2.1.10-qafixes.patch?rev=1.1&content-type=text/plain |
182 |
|
183 |
Index: freeradius-2.1.10-qafixes.patch |
184 |
=================================================================== |
185 |
diff -Naur freeradius-server-2.1.10.orig/configure.in freeradius-server-2.1.10/configure.in |
186 |
--- freeradius-server-2.1.10.orig/configure.in 2010-09-28 13:03:56.000000000 +0200 |
187 |
+++ freeradius-server-2.1.10/configure.in 2011-02-09 17:42:53.000000000 +0100 |
188 |
@@ -556,7 +556,19 @@ |
189 |
], |
190 |
[ AC_MSG_WARN([pcap library not found, silently disabling the RADIUS sniffer.]) ]) |
191 |
|
192 |
-AC_LIB_READLINE |
193 |
+AC_CHECK_LIB(readline, readline, |
194 |
+ [ LIBREADLINE="-lreadline" |
195 |
+ AC_DEFINE(HAVE_LIBREADLINE, 1, |
196 |
+ [Define to 1 if you have a readline compatible library.]) |
197 |
+ AC_DEFINE(HAVE_READLINE_READLINE_H, 1, |
198 |
+ [Define to 1 if you have the <readline/readline.h> header file.]) |
199 |
+ AC_DEFINE(HAVE_READLINE_HISTORY, 1, |
200 |
+ [Define if your readline library has \`add_history']) |
201 |
+ AC_DEFINE(HAVE_READLINE_HISTORY_H, 1, |
202 |
+ [Define to 1 if you have the <readline/history.h> header file.]) |
203 |
+ ], |
204 |
+ [ LIBREADLINE="" ]) |
205 |
+AC_SUBST(LIBREADLINE) |
206 |
|
207 |
dnl ############################################################# |
208 |
dnl # |
209 |
diff -Naur freeradius-server-2.1.10.orig/configure.in.orig freeradius-server-2.1.10/configure.in.orig |
210 |
--- freeradius-server-2.1.10.orig/configure.in.orig 1970-01-01 01:00:00.000000000 +0100 |
211 |
+++ freeradius-server-2.1.10/configure.in.orig 2010-09-28 13:03:56.000000000 +0200 |
212 |
@@ -0,0 +1,1204 @@ |
213 |
+dnl ############################################################# |
214 |
+dnl # |
215 |
+dnl # For information about autoconf, see: |
216 |
+dnl # |
217 |
+dnl # http://www.gnu.org/software/autoconf/ |
218 |
+dnl # |
219 |
+dnl # The recommended order is: |
220 |
+dnl # |
221 |
+dnl # AC_INIT(file) |
222 |
+dnl # 0. checks for compiler, libtool, and command line options |
223 |
+dnl # 1. checks for programs |
224 |
+dnl # 2. checks for libraries |
225 |
+dnl # 3. checks for header files |
226 |
+dnl # 4. checks for typedefs |
227 |
+dnl # 5. checks for structures and functions |
228 |
+dnl # 6. checks for compiler characteristics |
229 |
+dnl # 7. checks for library functions |
230 |
+dnl # 8. checks for system services |
231 |
+dnl # AC_OUTPUT([file...]) |
232 |
+dnl # |
233 |
+dnl ############################################################# |
234 |
+ |
235 |
+AC_PREREQ([2.59]) |
236 |
+export CFLAGS LIBS LDFLAGS CPPFLAGS |
237 |
+AC_INIT(src/main/radiusd.c) |
238 |
+AC_CONFIG_HEADER(src/include/autoconf.h) |
239 |
+AC_REVISION($Revision: 1.1 $)dnl |
240 |
+ |
241 |
+dnl # The version of the software |
242 |
+RADIUSD_VERSION=`cat VERSION` |
243 |
+RADIUSD_MAJOR_VERSION=`cat VERSION | sed 's/\..*//'` |
244 |
+RADIUSD_MINOR_VERSION=`cat VERSION | sed 's/^2\.//'` |
245 |
+PACKAGE=freeradius |
246 |
+ |
247 |
+dnl ############################################################# |
248 |
+dnl # |
249 |
+dnl # 0. Checks for compiler, libtool, and command line options. |
250 |
+dnl # |
251 |
+dnl ############################################################# |
252 |
+ |
253 |
+dnl Check for GNU cc |
254 |
+AC_PROG_CC |
255 |
+AC_PROG_CXX |
256 |
+ |
257 |
+dnl # |
258 |
+dnl # check for AIX, to allow us to use some BSD functions |
259 |
+dnl # must be before macros that call the compiler. |
260 |
+dnl # |
261 |
+AC_AIX |
262 |
+ |
263 |
+AC_PROG_GCC_TRADITIONAL |
264 |
+AC_PROG_CC_SUNPRO |
265 |
+AC_PROG_RANLIB |
266 |
+ |
267 |
+dnl Compile in large (2G+) file support. |
268 |
+AC_SYS_LARGEFILE |
269 |
+ |
270 |
+dnl # check for system bytesex |
271 |
+dnl # AC_DEFINES WORDS_BIGENDIAN |
272 |
+AC_C_BIGENDIAN |
273 |
+ |
274 |
+dnl Find GNU Make. |
275 |
+AC_CHECK_PROG(GMAKE, gmake, yes, no) |
276 |
+if test $GMAKE = no; then |
277 |
+ AC_PATH_PROG(MAKE, make, /usr/local/bin/make) |
278 |
+else |
279 |
+ AC_PATH_PROG(MAKE, gmake, /usr/local/gnu/bin/make) |
280 |
+fi |
281 |
+makever=`$ac_cv_path_MAKE --version 2>&1 | grep "GNU Make"` |
282 |
+if test -z "$makever"; then |
283 |
+ AC_MSG_ERROR(GNU Make is not installed. Please download and install it |
284 |
+ from ftp://prep.ai.mit.edu/pub/gnu/make/ before continuing.) |
285 |
+fi |
286 |
+ |
287 |
+AC_ARG_WITH(system-libltdl, |
288 |
+[ --with-system-libltdl Use the libltdl installed in your system (default=use our own)], |
289 |
+[ |
290 |
+LIBLTDL="-lltdl" |
291 |
+INCLTDL= |
292 |
+LTDL_SUBDIRS= |
293 |
+], |
294 |
+[ |
295 |
+dnl If libltdl isn't installable, set it to be installable. |
296 |
+[test x"$enable_ltdl_install" = x && enable_ltdl_install=yes] |
297 |
+AC_LIBLTDL_INSTALLABLE |
298 |
+ |
299 |
+dnl tell Makefile to build ltdl if needed |
300 |
+if test x"$enable_ltdl_install" = x"yes"; then |
301 |
+ LTDL_SUBDIRS=libltdl |
302 |
+fi |
303 |
+]) |
304 |
+AC_SUBST(LTDL_SUBDIRS) |
305 |
+ |
306 |
+dnl use system-wide libtool, if it exists |
307 |
+AC_ARG_WITH(system-libtool, |
308 |
+[ --with-system-libtool Use the libtool installed in your system (default=use our own)], |
309 |
+[ AC_PATH_PROG(LIBTOOL, libtool,,$PATH:/usr/local/bin) ], |
310 |
+[ |
311 |
+ LIBTOOL="`pwd`/libtool" |
312 |
+ AC_SUBST(LIBTOOL) |
313 |
+ dnl ensure that we're looking for dlopen |
314 |
+ AC_LIBTOOL_DLOPEN |
315 |
+ |
316 |
+ dnl Figure out how to build shared libraries |
317 |
+ AC_PROG_LIBTOOL |
318 |
+]) |
319 |
+ |
320 |
+ |
321 |
+dnl Put this in later, when all distributed modules use autoconf. |
322 |
+dnl AC_ARG_WITH(disablemodulefoo, |
323 |
+dnl [ --without-rlm_foo Disables module compilation. Module list:] |
324 |
+dnl esyscmd([find src/modules -type d -name rlm_\* -print |\ |
325 |
+dnl sed -e 's%src/modules/.*/% (sub)- %; s%.*/%- %' |\ |
326 |
+dnl awk '{print " "$0}'])) |
327 |
+ |
328 |
+AC_ARG_ENABLE(strict-dependencies, |
329 |
+[ --enable-strict-dependencies Fail configure on lack of module dependancy.]) |
330 |
+ |
331 |
+dnl extra argument: --with-docdir |
332 |
+docdir='${datadir}/doc/freeradius' |
333 |
+AC_MSG_CHECKING(docdir) |
334 |
+AC_ARG_WITH(docdir, |
335 |
+[ --with-docdir=DIR Directory for documentation [DATADIR/doc/freeradius] ], |
336 |
+[ case "$withval" in |
337 |
+ no) |
338 |
+ docdir=no |
339 |
+ ;; |
340 |
+ yes) |
341 |
+ ;; |
342 |
+ [[\\/$]]* | ?:[[\\/]]* ) |
343 |
+ docdir="$withval" |
344 |
+ ;; |
345 |
+ *) |
346 |
+ AC_MSG_ERROR([expected an absolute directory name for --with-docdir: $withval]) |
347 |
+ ;; |
348 |
+ esac ] |
349 |
+) |
350 |
+AC_SUBST(docdir) |
351 |
+AC_MSG_RESULT($docdir) |
352 |
+if test "x$docdir" = xno; then |
353 |
+ AC_MSG_WARN(Documentation files will NOT be installed.) |
354 |
+fi |
355 |
+ |
356 |
+dnl extra argument: --with-logdir |
357 |
+logdir='${localstatedir}/log/radius' |
358 |
+AC_MSG_CHECKING(logdir) |
359 |
+AC_ARG_WITH(logdir, |
360 |
+[ --with-logdir=DIR Directory for logfiles [LOCALSTATEDIR/log/radius] ], |
361 |
+[ case "$withval" in |
362 |
+ no) |
363 |
+ AC_MSG_ERROR(Need logdir) |
364 |
+ ;; |
365 |
+ yes) |
366 |
+ ;; |
367 |
+ [[\\/$]]* | ?:[[\\/]]* ) |
368 |
+ logdir="$withval" |
369 |
+ ;; |
370 |
+ *) |
371 |
+ AC_MSG_ERROR([expected an absolute directory name for --with-logdir: $withval]) |
372 |
+ ;; |
373 |
+ esac ] |
374 |
+) |
375 |
+AC_SUBST(logdir) |
376 |
+AC_MSG_RESULT($logdir) |
377 |
+ |
378 |
+dnl extra argument: --with-radacctdir |
379 |
+radacctdir='${logdir}/radacct' |
380 |
+AC_MSG_CHECKING(radacctdir) |
381 |
+AC_ARG_WITH(radacctdir, |
382 |
+[ --with-radacctdir=DIR Directory for detail files [LOGDIR/radacct] ], |
383 |
+[ case "$withval" in |
384 |
+ no) |
385 |
+ AC_MSG_ERROR(Need radacctdir) |
386 |
+ ;; |
387 |
+ yes) |
388 |
+ ;; |
389 |
+ [[\\/$]]* | ?:[[\\/]]* ) |
390 |
+ radacctdir="$withval" |
391 |
+ ;; |
392 |
+ *) |
393 |
+ AC_MSG_ERROR([expected an absolute directory name for --with-radacctdir: $withval]) |
394 |
+ ;; |
395 |
+ esac ] |
396 |
+) |
397 |
+AC_SUBST(radacctdir) |
398 |
+AC_MSG_RESULT($radacctdir) |
399 |
+ |
400 |
+dnl extra argument: --with-raddbdir |
401 |
+raddbdir='${sysconfdir}/raddb' |
402 |
+AC_MSG_CHECKING(raddbdir) |
403 |
+AC_ARG_WITH(raddbdir, |
404 |
+[ --with-raddbdir=DIR Directory for config files [SYSCONFDIR/raddb] ], |
405 |
+[ case "$withval" in |
406 |
+ no) |
407 |
+ AC_MSG_ERROR(Need raddbdir) |
408 |
+ ;; |
409 |
+ yes) |
410 |
+ ;; |
411 |
+ [[\\/$]]* | ?:[[\\/]]* ) |
412 |
+ raddbdir="$withval" |
413 |
+ ;; |
414 |
+ *) |
415 |
+ AC_MSG_ERROR([expected an absolute directory name for --with-raddbdir: $withval]) |
416 |
+ ;; |
417 |
+ esac ] |
418 |
+) |
419 |
+AC_SUBST(raddbdir) |
420 |
+AC_MSG_RESULT($raddbdir) |
421 |
+ |
422 |
+dnl extra argument: --with-ascend-binary |
423 |
+ASCEND_BINARY=yes |
424 |
+AC_ARG_WITH(ascend-binary, |
425 |
+[ --with-ascend-binary Include support for Ascend binary filter attributes (default=yes)], |
426 |
+[ case "$withval" in |
427 |
+ yes) |
428 |
+ ;; |
429 |
+ *) |
430 |
+ ASCEND_BINARY="" |
431 |
+ esac ] |
432 |
+) |
433 |
+if test "X$ASCEND_BINARY" = "Xyes"; then |
434 |
+ AC_DEFINE(ASCEND_BINARY, [], [Include support for Ascend binary filter attributes]) |
435 |
+fi |
436 |
+ |
437 |
+dnl extra argument: --with-threads |
438 |
+WITH_THREADS=yes |
439 |
+AC_ARG_WITH(threads, |
440 |
+[ --with-threads Use threads, if available. (default=yes) ], |
441 |
+[ case "$withval" in |
442 |
+ yes) |
443 |
+ ;; |
444 |
+ *) |
445 |
+ WITH_THREADS="" |
446 |
+ esac ] |
447 |
+) |
448 |
+ |
449 |
+dnl extra argument: --with-vmps |
450 |
+WITH_VMPS=yes |
451 |
+AC_ARG_WITH(vmps, |
452 |
+[ --with-vmps Compile in VMPS support. (default=yes)], |
453 |
+[ case "$withval" in |
454 |
+ yes) |
455 |
+ ;; |
456 |
+ *) |
457 |
+ WITH_VMPS=no |
458 |
+ esac ] |
459 |
+) |
460 |
+if test "x$WITH_VMPS" = "xyes"; then |
461 |
+ AC_DEFINE(WITH_VMPS, [1], [define if you want VMPS support]) |
462 |
+fi |
463 |
+ |
464 |
+dnl extra argument: --with-dhcp |
465 |
+AC_ARG_WITH(dhcp, |
466 |
+[ --with-dhcp Compile in DHCP support. (default=no)], |
467 |
+[ case "$withval" in |
468 |
+ yes) |
469 |
+ AC_DEFINE(WITH_DHCP, [1], [Include experimental support for DHCP]) |
470 |
+ ;; |
471 |
+ *) |
472 |
+ ;; |
473 |
+ esac ] |
474 |
+) |
475 |
+ |
476 |
+ |
477 |
+dnl # |
478 |
+dnl # Allow the user to specify a list of modules to be linked |
479 |
+dnl # statically to the server. |
480 |
+dnl # |
481 |
+STATIC_MODULES= |
482 |
+AC_ARG_WITH(static_modules, |
483 |
+[ --with-static-modules=QUOTED-MODULE-LIST],[ |
484 |
+ for i in $withval; do |
485 |
+ STATIC_MODULES="$STATIC_MODULES -dlpreopen ../modules/rlm_$i/rlm_$i.la" |
486 |
+ done |
487 |
+]) |
488 |
+ |
489 |
+MODULES= |
490 |
+AC_ARG_WITH(modules, |
491 |
+[ --with-modules=QUOTED-MODULE-LIST],[ |
492 |
+ for i in $withval; do |
493 |
+ MODULES="$MODULES $i" |
494 |
+ done |
495 |
+]) |
496 |
+ |
497 |
+dnl # |
498 |
+dnl # Enable developer C compiler warnings |
499 |
+dnl # |
500 |
+AC_ARG_ENABLE(developer, |
501 |
+[ --enable-developer Enables features of interest to developers.], |
502 |
+[ case "$enableval" in |
503 |
+ no) |
504 |
+ developer=no |
505 |
+ ;; |
506 |
+ *) |
507 |
+ developer=yes |
508 |
+ esac ] |
509 |
+) |
510 |
+ |
511 |
+if test "x$developer" != "xno" -a -d $srcdir/CVS; then |
512 |
+ dnl turn on the developer flag when taken from a CVS checkout (not a release) |
513 |
+ developer="yes" |
514 |
+fi |
515 |
+ |
516 |
+if test "x$developer" != "xno" -a -d $srcdir/.git; then |
517 |
+ dnl turn on the developer flag when taken from a git checkout (not a release) |
518 |
+ developer="yes" |
519 |
+fi |
520 |
+ |
521 |
+dnl extra argument: --with-experimental-modules |
522 |
+EXPERIMENTAL= |
523 |
+AC_ARG_WITH(experimental-modules, |
524 |
+[ --with-experimental-modules Use experimental and unstable modules. (default=no) ], |
525 |
+[ case "$withval" in |
526 |
+ yes) |
527 |
+ EXPERIMENTAL=yes |
528 |
+ ;; |
529 |
+ *) |
530 |
+ esac ] |
531 |
+) |
532 |
+ |
533 |
+dnl extra argument: --with-openssl |
534 |
+WITH_OPENSSL=yes |
535 |
+AC_ARG_WITH(openssl, |
536 |
+[ --with-openssl Use OpenSSL. (default=yes)], |
537 |
+[ case "$withval" in |
538 |
+ no) |
539 |
+ WITH_OPENSSL=no |
540 |
+ ;; |
541 |
+ *) |
542 |
+ WITH_OPENSSL=yes |
543 |
+ ;; |
544 |
+ esac ] |
545 |
+) |
546 |
+ |
547 |
+dnl # |
548 |
+dnl # extra argument: --with-openssl-includes=dir |
549 |
+dnl # |
550 |
+OPENSSL_INCLUDE_DIR= |
551 |
+AC_ARG_WITH(openssl-includes, |
552 |
+[ --with-openssl-includes=DIR Directory to look for OpenSSL include files], |
553 |
+[ case "$withval" in |
554 |
+ *) OPENSSL_INCLUDE_DIR="$withval" |
555 |
+ ;; |
556 |
+ esac ] |
557 |
+) |
558 |
+ |
559 |
+dnl # |
560 |
+dnl # extra argument: --with-openssl-libraries=dir |
561 |
+dnl # |
562 |
+OPENSSL_LIB_DIR= |
563 |
+AC_ARG_WITH(openssl-libraries, |
564 |
+[ --with-openssl-libraries=DIR Directory to look for OpenSSL library files], |
565 |
+[ case "$withval" in |
566 |
+ *) OPENSSL_LIB_DIR="$withval" |
567 |
+ ;; |
568 |
+ esac ] |
569 |
+) |
570 |
+ |
571 |
+dnl # |
572 |
+dnl # These next two arguments don't actually do anything. They're |
573 |
+dnl # place holders so that the top-level configure script can tell |
574 |
+dnl # the user how to configure lower-level modules |
575 |
+dnl # |
576 |
+ |
577 |
+dnl # |
578 |
+dnl # extra argument: --with-rlm-FOO-lib-dir |
579 |
+dnl # |
580 |
+AC_ARG_WITH(rlm-FOO-lib-dir, |
581 |
+[ --with-rlm-FOO-lib-dir=DIR Directory to look for library files used by module FOO], |
582 |
+[ case "$withval" in |
583 |
+ *) |
584 |
+ ;; |
585 |
+ esac ] |
586 |
+) |
587 |
+ |
588 |
+dnl # |
589 |
+dnl # extra argument: --with-rlm-FOO-include-dir |
590 |
+dnl # |
591 |
+AC_ARG_WITH(rlm-FOO-include-dir, |
592 |
+[ --with-rlm-FOO-include-dir=DIR Directory to look for include files used by module FOO], |
593 |
+[ case "$withval" in |
594 |
+ *) |
595 |
+ ;; |
596 |
+ esac ] |
597 |
+) |
598 |
+ |
599 |
+dnl See what include-style is used by the make program. |
600 |
+dnl AC_MSG_CHECKING(include style for make) |
601 |
+dnl echo "include /dev/null" > testmake.$$ |
602 |
+dnl echo "all:" >> testmake.$$ |
603 |
+dnl make -f testmake.$$ >/dev/null 2>&1 |
604 |
+dnl if test $? = 0 |
605 |
+dnl then |
606 |
+dnl INCLUDE=include |
607 |
+dnl IQUOTE= |
608 |
+dnl else |
609 |
+dnl INCLUDE=.include |
610 |
+dnl IQUOTE='"' |
611 |
+dnl fi |
612 |
+dnl rm -f testmake.$$ |
613 |
+dnl AC_MSG_RESULT(" $INCLUDE") |
614 |
+dnl AC_SUBST(INCLUDE) |
615 |
+dnl AC_SUBST(IQUOTE) |
616 |
+ |
617 |
+dnl extra argument: --with-udpfromto |
618 |
+WITH_UDPFROMTO=no |
619 |
+AC_ARG_WITH(udpfromto, |
620 |
+[ --with-udpfromto Compile in UDPFROMTO support. (default=no)], |
621 |
+[ case "$withval" in |
622 |
+ yes) |
623 |
+ WITH_UDPFROMTO=yes |
624 |
+ ;; |
625 |
+ *) |
626 |
+ WITH_UDPFROMTO=no |
627 |
+ esac ] |
628 |
+) |
629 |
+ |
630 |
+if test "x$WITH_UDPFROMTO" = "xyes"; then |
631 |
+ AC_DEFINE(WITH_UDPFROMTO, [], [define if you want udpfromto]) |
632 |
+fi |
633 |
+ |
634 |
+dnl ############################################################# |
635 |
+dnl # |
636 |
+dnl # 1. Checks for programs |
637 |
+dnl # |
638 |
+dnl ############################################################# |
639 |
+ |
640 |
+CHECKRAD=checkrad.pl |
641 |
+AC_PATH_PROG(PERL, perl, /usr/local/bin/perl) |
642 |
+if test "x$ac_cv_path_PERL" = "x"; then |
643 |
+ AC_MSG_WARN(perl not found - Simultaneous-Use and checkrad.pl may not work) |
644 |
+fi |
645 |
+AC_PATH_PROG(SNMPGET, snmpget) |
646 |
+if test "x$ac_cv_path_SNMPGET" = "x"; then |
647 |
+ AC_MSG_WARN(snmpget not found - Simultaneous-Use and checkrad.pl may not work) |
648 |
+fi |
649 |
+ |
650 |
+AC_PATH_PROG(SNMPWALK, snmpwalk) |
651 |
+if test "x$ac_cv_path_SNMPWALK" = "x"; then |
652 |
+ AC_MSG_WARN(snmpwalk not found - Simultaneous-Use and checkrad.pl may not work) |
653 |
+fi |
654 |
+ |
655 |
+AC_PATH_PROG(RUSERS, rusers, /usr/bin/rusers) |
656 |
+ |
657 |
+dnl FIXME This is truly gross. |
658 |
+missing_dir=`cd $ac_aux_dir && pwd` |
659 |
+AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) |
660 |
+AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) |
661 |
+AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) |
662 |
+ |
663 |
+AC_PATH_PROG(LOCATE,locate) |
664 |
+AC_PATH_PROG(DIRNAME,dirname) |
665 |
+AC_PATH_PROG(GREP,grep) |
666 |
+ |
667 |
+dnl ############################################################# |
668 |
+dnl # |
669 |
+dnl # 2. Checks for libraries |
670 |
+dnl # |
671 |
+dnl ############################################################# |
672 |
+ |
673 |
+dnl If using pthreads, check for -lpthread (posix) or -lc_r (*BSD) |
674 |
+old_CFLAGS=$CFLAGS |
675 |
+if test "x$WITH_THREADS" = "xyes"; then |
676 |
+ if test $ac_cv_prog_suncc = "yes"; then |
677 |
+ CFLAGS="$CFLAGS -mt" |
678 |
+ fi |
679 |
+ |
680 |
+ AC_CHECK_HEADERS(pthread.h, [], [ WITH_THREADS="no" ]) |
681 |
+ |
682 |
+dnl # |
683 |
+dnl # pthread stuff is usually in -lpthread |
684 |
+dnl # or in -lc_r, on *BSD |
685 |
+dnl # |
686 |
+dnl # On Some systems, we need extra pre-processor flags, to get them to |
687 |
+dnl # to do the threading properly. |
688 |
+dnl # |
689 |
+ AC_CHECK_LIB(pthread, pthread_create, |
690 |
+ [ CFLAGS="$CFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" |
691 |
+ LIBS="$LIBS -lpthread" ], |
692 |
+ AC_CHECK_LIB(c_r, pthread_create, |
693 |
+ [ CFLAGS="$CFLAGS -pthread -D_THREAD_SAFE" ], |
694 |
+ [ WITH_THREADS="no" ] |
695 |
+ ) |
696 |
+ ) |
697 |
+fi |
698 |
+ |
699 |
+dnl # |
700 |
+dnl # If we have NO pthread libraries, remove any knowledge of threads. |
701 |
+dnl # |
702 |
+if test "x$WITH_THREADS" != "xyes"; then |
703 |
+ CFLAGS=$old_CFLAGS |
704 |
+ ac_cv_header_pthread_h="no" |
705 |
+ WITH_THREADS=no |
706 |
+else |
707 |
+ dnl # |
708 |
+ dnl # We need sem_init() and friends, as they're the friendliest |
709 |
+ dnl # semaphore functions for threading. |
710 |
+ dnl # |
711 |
+ dnl # HP/UX requires linking with librt, too, to get the sem_* symbols. |
712 |
+ dnl # Some systems have them in -lsem |
713 |
+ dnl # Solaris has them in -lposix4 |
714 |
+ dnl # NetBSD has them in -lsemaphore |
715 |
+ |
716 |
+ AC_SEARCH_LIBS(sem_init, pthread sem posix4 rt semaphore, |
717 |
+ [], |
718 |
+ [AC_MSG_ERROR(-lsem not found. You may want to download it from ftp://ftp.to.gd-es.com/pub/BSDI/libsem.tar.bz2 or ftp://ftp.freeradius.org/pub/radius/contrib/libsem.tar.gz)] |
719 |
+ ) |
720 |
+fi |
721 |
+ |
722 |
+dnl Check if we need -lsocket |
723 |
+AC_CHECK_LIB(socket, getsockname) |
724 |
+ |
725 |
+dnl Check for -lresolv |
726 |
+dnl This library may be needed later. |
727 |
+AC_CHECK_LIB(resolv, inet_aton) |
728 |
+ |
729 |
+dnl Check if we need -lnsl. Usually if we want to |
730 |
+dnl link against -lsocket we need to include -lnsl as well. |
731 |
+AC_CHECK_LIB(nsl, inet_ntoa) |
732 |
+ |
733 |
+dnl Check for OpenSSL libraries. |
734 |
+OPENSSL_LIBS= |
735 |
+if test "x$WITH_OPENSSL" = xyes; then |
736 |
+ old_LIBS=$LIBS |
737 |
+ old_LDFLAGS="$LDFLAGS" |
738 |
+ if test "x$OPENSSL_LIB_DIR" != "x"; then |
739 |
+ LDFLAGS="$LDFLAGS -L$OPENSSL_LIB_DIR" |
740 |
+ fi |
741 |
+ AC_CHECK_LIB(crypto, DH_new, |
742 |
+ [ |
743 |
+ LIBS="-lcrypto $LIBS" |
744 |
+ AC_DEFINE(HAVE_LIBCRYPTO, 1, |
745 |
+ [Define to 1 if you have the `crypto' library (-lcrypto).]) |
746 |
+ AC_CHECK_LIB(ssl, SSL_new, |
747 |
+ [ |
748 |
+ AC_DEFINE(HAVE_LIBSSL, 1, |
749 |
+ [Define to 1 if you have the `ssl' library (-lssl).]) |
750 |
+ if test "x$OPENSSL_LIB_DIR" != "x"; then |
751 |
+ OPENSSL_LIBS="-L$OPENSSL_LIB_DIR" |
752 |
+ fi |
753 |
+ OPENSSL_LIBS="$OPENSSL_LIBS -lcrypto -lssl -lcrypto" |
754 |
+ ], []) |
755 |
+ ], []) |
756 |
+ LIBS=$old_LIBS |
757 |
+ LDFLAGS="$old_LDFLAGS" |
758 |
+fi |
759 |
+ |
760 |
+AC_CHECK_LIB(ws2_32, htonl) |
761 |
+ |
762 |
+dnl Check the pcap library for the RADIUS sniffer. |
763 |
+PCAP_LIBS= |
764 |
+AC_CHECK_LIB(pcap, pcap_open_live, |
765 |
+ [ PCAP_LIBS="-lpcap" |
766 |
+ AC_DEFINE(HAVE_LIBPCAP, 1, |
767 |
+ [Define to 1 if you have the `pcap' library (-lpcap).]) |
768 |
+ ], |
769 |
+ [ AC_MSG_WARN([pcap library not found, silently disabling the RADIUS sniffer.]) ]) |
770 |
+ |
771 |
+AC_LIB_READLINE |
772 |
+ |
773 |
+dnl ############################################################# |
774 |
+dnl # |
775 |
+dnl # 3. Checks for header files |
776 |
+dnl # |
777 |
+dnl ############################################################# |
778 |
+ |
779 |
+dnl # |
780 |
+dnl # Interix requires us to set -D_ALL_SOURCE, otherwise |
781 |
+dnl # getopt will be #included, but won't link. <sigh> |
782 |
+dnl # |
783 |
+dnl # |
784 |
+case "$host" in |
785 |
+*-interix*) |
786 |
+ CFLAGS="$CFLAGS -D_ALL_SOURCE" |
787 |
+ ;; |
788 |
+*-darwin*) |
789 |
+ CFLAGS="$CFLAGS -DDARWIN" |
790 |
+ LIBS="-framework DirectoryService $LIBS" |
791 |
+ ;; |
792 |
+esac |
793 |
+ |
794 |
+AC_HEADER_DIRENT |
795 |
+AC_HEADER_STDC |
796 |
+AC_HEADER_TIME |
797 |
+AC_HEADER_SYS_WAIT |
798 |
+ |
799 |
+AC_CHECK_HEADERS( \ |
800 |
+ unistd.h \ |
801 |
+ crypt.h \ |
802 |
+ errno.h \ |
803 |
+ resource.h \ |
804 |
+ sys/resource.h \ |
805 |
+ getopt.h \ |
806 |
+ malloc.h \ |
807 |
+ utmp.h \ |
808 |
+ utmpx.h \ |
809 |
+ signal.h \ |
810 |
+ sys/select.h \ |
811 |
+ syslog.h \ |
812 |
+ inttypes.h \ |
813 |
+ stdint.h \ |
814 |
+ stdio.h \ |
815 |
+ netdb.h \ |
816 |
+ semaphore.h \ |
817 |
+ arpa/inet.h \ |
818 |
+ netinet/in.h \ |
819 |
+ sys/types.h \ |
820 |
+ sys/socket.h \ |
821 |
+ winsock.h \ |
822 |
+ sys/time.h \ |
823 |
+ sys/wait.h \ |
824 |
+ sys/security.h \ |
825 |
+ fcntl.h \ |
826 |
+ sys/fcntl.h \ |
827 |
+ sys/prctl.h \ |
828 |
+ sys/un.h \ |
829 |
+ glob.h \ |
830 |
+ prot.h \ |
831 |
+ pwd.h \ |
832 |
+ grp.h \ |
833 |
+ sia.h \ |
834 |
+ siad.h |
835 |
+) |
836 |
+ |
837 |
+dnl FreeBSD requires sys/socket.h before net/if.h |
838 |
+AC_CHECK_HEADERS(net/if.h, [], [], |
839 |
+[#ifdef HAVE_SYS_SOCKET_H |
840 |
+# include <sys/socket.h> |
841 |
+# endif |
842 |
+]) |
843 |
+ |
844 |
+REGEX=no |
845 |
+AC_CHECK_HEADER(regex.h, AC_DEFINE(HAVE_REGEX_H, [], [define this if we have the <regex.h> header file])) |
846 |
+if test "x$ac_cv_header_regex_h" = "xyes"; then |
847 |
+ REGEX_EXTENDED=no |
848 |
+ REGEX=yes |
849 |
+ AC_EGREP_CPP(yes, |
850 |
+ [#include <regex.h> |
851 |
+ #ifdef REG_EXTENDED |
852 |
+ yes |
853 |
+ #endif |
854 |
+ ], [AC_DEFINE(HAVE_REG_EXTENDED, [], [define this if we have REG_EXTENDED (from <regex.h>)]) REGEX_EXTENDED=yes]) |
855 |
+fi |
856 |
+AC_SUBST(REGEX) |
857 |
+AC_SUBST(REGEX_EXTENDED) |
858 |
+ |
859 |
+dnl # |
860 |
+dnl # other checks which require headers |
861 |
+dnl # |
862 |
+if test "x$ac_cv_header_sys_security_h" = "xyes" && test "x$ac_cv_header_prot_h" = "xyes" |
863 |
+then |
864 |
+ AC_DEFINE(OSFC2, [], [define if you have OSFC2 authentication]) |
865 |
+fi |
866 |
+ |
867 |
+if test "x$ac_cv_header_sia_h" = "xyes" && test "x$ac_cv_header_siad_h" = "xyes" |
868 |
+then |
869 |
+ AC_DEFINE(OSFSIA, [], [define if you have OSFSIA authentication]) |
870 |
+fi |
871 |
+ |
872 |
+dnl Check for OpenSSL includes. |
873 |
+OPENSSL_INCLUDE="-DNO_OPENSSL" |
874 |
+if test "x$WITH_OPENSSL" = xyes; then |
875 |
+ if test "x$OPENSSL_LIBS" = "x"; then |
876 |
+ AC_MSG_NOTICE([skipping test for openssl/ssl.h]) |
877 |
+ else |
878 |
+ old_CPPFLAGS=$CPPFLAGS |
879 |
+ if test "x$OPENSSL_INCLUDE_DIR" != "x"; then |
880 |
+ CPPFLAGS="$CPPFLAGS -I$OPENSSL_INCLUDE_DIR" |
881 |
+ fi |
882 |
+ dnl # stupid RedHat shit |
883 |
+ CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_KRB5" |
884 |
+ AC_CHECK_HEADERS( \ |
885 |
+ openssl/ssl.h \ |
886 |
+ openssl/crypto.h \ |
887 |
+ openssl/err.h \ |
888 |
+ openssl/evp.h \ |
889 |
+ openssl/engine.h, |
890 |
+ [], |
891 |
+ OPENSSL_LIBS= |
892 |
+ ) |
893 |
+ if test "x$OPENSSL_LIBS" != "x"; then |
894 |
+ AC_MSG_CHECKING([for OpenSSL version >= 0.9.7]) |
895 |
+ AC_EGREP_CPP(yes, |
896 |
+ [#include <openssl/crypto.h> |
897 |
+ #if (OPENSSL_VERSION_NUMBER >= 0x00907000L) |
898 |
+ yes |
899 |
+ #endif |
900 |
+ ], goodssl="yes") |
901 |
+ if test "x$goodssl" != "xyes"; then |
902 |
+ AC_MSG_RESULT(no) |
903 |
+ OPENSSL_LIBS= |
904 |
+ else |
905 |
+ AC_MSG_RESULT(yes) |
906 |
+ if test "x$OPENSSL_INCLUDE_DIR" != "x"; then |
907 |
+ OPENSSL_INCLUDE="-I$OPENSSL_INCLUDE_DIR -DOPENSSL_NO_KRB5" |
908 |
+ else |
909 |
+ OPENSSL_INCLUDE="-DOPENSSL_NO_KRB5" |
910 |
+ fi |
911 |
+ fi |
912 |
+ fi |
913 |
+ CPPFLAGS=$old_CPPFLAGS |
914 |
+ fi |
915 |
+fi |
916 |
+AC_SUBST(OPENSSL_INCLUDE) |
917 |
+AC_SUBST(OPENSSL_LIBS) |
918 |
+export OPENSSL_LIBS |
919 |
+ |
920 |
+dnl Check the pcap includes for the RADIUS sniffer. |
921 |
+if test "x$PCAP_LIBS" = x; then |
922 |
+ AC_MSG_NOTICE([skipping test for pcap.h.]) |
923 |
+else |
924 |
+ AC_CHECK_HEADER(pcap.h, |
925 |
+ AC_DEFINE(HAVE_PCAP_H, 1, |
926 |
+ [Define to 1 if you have the <pcap.h> header file.]), |
927 |
+ [ PCAP_LIBS= |
928 |
+ AC_MSG_WARN([pcap.h not found, silently disabling the RADIUS sniffer.]) |
929 |
+ ]) |
930 |
+fi |
931 |
+AC_SUBST(PCAP_LIBS) |
932 |
+ |
933 |
+dnl ############################################################# |
934 |
+dnl # |
935 |
+dnl # 4. Checks for typedefs |
936 |
+dnl # |
937 |
+dnl ############################################################# |
938 |
+ |
939 |
+dnl # |
940 |
+dnl # Ensure that these are defined |
941 |
+dnl # |
942 |
+AC_TYPE_OFF_T |
943 |
+AC_TYPE_PID_T |
944 |
+AC_TYPE_SIZE_T |
945 |
+AC_TYPE_UID_T |
946 |
+ |
947 |
+dnl check for socklen_t |
948 |
+FR_CHECK_TYPE_INCLUDE([ |
949 |
+#ifdef HAVE_SYS_TYPES_H |
950 |
+#include <sys/types.h> |
951 |
+#endif |
952 |
+#ifdef HAVE_SYS_SOCKET_H |
953 |
+#include <sys/socket.h> |
954 |
+#endif |
955 |
+],socklen_t, int, [socklen_t is generally 'int' on systems which don't use it]) |
956 |
+ |
957 |
+dnl check for uint8_t |
958 |
+FR_CHECK_TYPE_INCLUDE([ |
959 |
+#ifdef HAVE_INTTYPES_H |
960 |
+#include <inttypes.h> |
961 |
+#endif |
962 |
+#ifdef HAVE_STDINT_H |
963 |
+#include <stdint.h> |
964 |
+#endif |
965 |
+],uint8_t, unsigned char, [uint8_t should be the canonical 'octet' for network traffic]) |
966 |
+ |
967 |
+dnl check for uint16_t |
968 |
+FR_CHECK_TYPE_INCLUDE([ |
969 |
+#ifdef HAVE_INTTYPES_H |
970 |
+#include <inttypes.h> |
971 |
+#endif |
972 |
+#ifdef HAVE_STDINT_H |
973 |
+#include <stdint.h> |
974 |
+#endif |
975 |
+],uint16_t, unsigned short, [uint16_t should be the canonical '2 octets' for network traffic]) |
976 |
+ |
977 |
+dnl check for uint32_t |
978 |
+FR_CHECK_TYPE_INCLUDE([ |
979 |
+#ifdef HAVE_INTTYPES_H |
980 |
+#include <inttypes.h> |
981 |
+#endif |
982 |
+#ifdef HAVE_STDINT_H |
983 |
+#include <stdint.h> |
984 |
+#endif |
985 |
+],uint32_t, unsigned int, [uint32_t should be the canonical 'network integer]) |
986 |
+ |
987 |
+AC_CHECK_TYPE(struct in6_addr, AC_DEFINE(HAVE_STRUCT_IN6_ADDR, 1, [IPv6 address structure]), [], [ |
988 |
+#ifdef HAVE_NETINET_IN_H |
989 |
+#include <netinet/in.h> |
990 |
+#endif |
991 |
+]) |
992 |
+ |
993 |
+AC_CHECK_TYPE(struct sockaddr_storage, AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, [Generic socket addresses]), [], [ |
994 |
+#ifdef HAVE_NETINET_IN_H |
995 |
+#include <netinet/in.h> |
996 |
+#endif |
997 |
+#ifdef HAVE_SYS_SOCKET_H |
998 |
+#include <sys/socket.h> |
999 |
+#endif |
1000 |
+]) |
1001 |
+ |
1002 |
+AC_CHECK_TYPE(struct sockaddr_in6, AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6, 1, [IPv6 socket addresses]), [], [ |
1003 |
+#ifdef HAVE_NETINET_IN_H |
1004 |
+#include <netinet/in.h> |
1005 |
+#endif |
1006 |
+]) |
1007 |
+ |
1008 |
+AC_CHECK_TYPE(struct addrinfo, AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1, [Generic DNS lookups]), [], [ |
1009 |
+#ifdef HAVE_SYS_TYPES_H |
1010 |
+#include <sys/types.h> |
1011 |
+#endif |
1012 |
+#ifdef HAVE_SYS_SOCKET_H |
1013 |
+#include <sys/socket.h> |
1014 |
+#endif |
1015 |
+#ifdef HAVE_NETDB_H |
1016 |
+#include <netdb.h> |
1017 |
+#endif |
1018 |
+]) |
1019 |
+ |
1020 |
+dnl ############################################################# |
1021 |
+dnl # |
1022 |
+dnl # 5. Checks for structures and functions |
1023 |
+dnl # |
1024 |
+dnl ############################################################# |
1025 |
+AC_CHECK_FUNCS( \ |
1026 |
+ getopt_long \ |
1027 |
+ lockf \ |
1028 |
+ strsignal \ |
1029 |
+ sigaction \ |
1030 |
+ sigprocmask \ |
1031 |
+ pthread_sigmask \ |
1032 |
+ snprintf \ |
1033 |
+ vsnprintf \ |
1034 |
+ setsid \ |
1035 |
+ strncasecmp \ |
1036 |
+ strcasecmp \ |
1037 |
+ localtime_r \ |
1038 |
+ ctime_r \ |
1039 |
+ gmtime_r \ |
1040 |
+ strsep \ |
1041 |
+ inet_aton \ |
1042 |
+ inet_pton \ |
1043 |
+ inet_ntop \ |
1044 |
+ setlinebuf \ |
1045 |
+ setvbuf \ |
1046 |
+ getusershell \ |
1047 |
+ initgroups \ |
1048 |
+ getaddrinfo \ |
1049 |
+ getnameinfo \ |
1050 |
+ closefrom \ |
1051 |
+ gettimeofday \ |
1052 |
+ getpeereid \ |
1053 |
+ setuid \ |
1054 |
+ setresuid \ |
1055 |
+ getresuid \ |
1056 |
+ strlcat \ |
1057 |
+ strlcpy |
1058 |
+) |
1059 |
+RADIUSD_NEED_DECLARATIONS( \ |
1060 |
+ crypt \ |
1061 |
+ strncasecmp \ |
1062 |
+ strcasecmp \ |
1063 |
+ inet_aton \ |
1064 |
+ setlinebuf \ |
1065 |
+ getusershell \ |
1066 |
+ endusershell |
1067 |
+) |
1068 |
+ |
1069 |
+AC_TYPE_SIGNAL |
1070 |
+ |
1071 |
+dnl # check if we have utmpx.h |
1072 |
+dnl # if so, check if struct utmpx has entry ut_xtime |
1073 |
+dnl # if not, set it to define ut_xtime == ut_tv.tv_sec |
1074 |
+if test "x$ac_cv_header_utmpx_h" = "xyes" |
1075 |
+then |
1076 |
+ FR_CHECK_STRUCT_HAS_MEMBER([#include <utmpx.h>], [struct utmpx], ut_xtime) |
1077 |
+ if test "x$ac_cv_type_struct_utmpx_has_ut_xtime" = "x" |
1078 |
+ then |
1079 |
+ AC_DEFINE(ut_xtime,ut_tv.tv_sec, [define to something if you don't have ut_xtime in struct utmpx]) |
1080 |
+ fi |
1081 |
+fi |
1082 |
+ |
1083 |
+dnl # struct ip_pktinfo |
1084 |
+FR_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in_pktinfo], ipi_addr) |
1085 |
+if test "x$ac_cv_type_struct_in_pktinfo_has_ipi_addr" = "xyes" |
1086 |
+then |
1087 |
+ AC_DEFINE(HAVE_IP_PKTINFO, [], [define if you have IP_PKTINFO (Linux)]) |
1088 |
+fi |
1089 |
+ |
1090 |
+dnl # struct in6_pktinfo |
1091 |
+FR_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in6_pktinfo], ipi6_addr) |
1092 |
+if test "x$ac_cv_type_struct_in6_pktinfo_has_ipi6_addr" = "xyes" |
1093 |
+then |
1094 |
+ AC_DEFINE(HAVE_IN6_PKTINFO, [], [define if you have IN6_PKTINFO (Linux)]) |
1095 |
+fi |
1096 |
+ |
1097 |
+dnl ############################################################# |
1098 |
+dnl # |
1099 |
+dnl # 6. Checks for compiler characteristics |
1100 |
+dnl # |
1101 |
+dnl ############################################################# |
1102 |
+ |
1103 |
+dnl # |
1104 |
+dnl # Ensure that these are defined |
1105 |
+dnl # |
1106 |
+AC_C_CONST |
1107 |
+ |
1108 |
+dnl # |
1109 |
+dnl # See if this is OS/2 |
1110 |
+dnl # |
1111 |
+AC_MSG_CHECKING(type of OS) |
1112 |
+OS=`uname -s` |
1113 |
+AC_MSG_RESULT($OS) |
1114 |
+if test "$OS" = "OS/2"; then |
1115 |
+ LIBPREFIX= |
1116 |
+else |
1117 |
+ LIBPREFIX=lib |
1118 |
+fi |
1119 |
+AC_SUBST(LIBPREFIX) |
1120 |
+ |
1121 |
+dnl # |
1122 |
+dnl # Set Default CFLAGS |
1123 |
+dnl # |
1124 |
+if test "x$GCC" = "xyes"; then |
1125 |
+ CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE" |
1126 |
+fi |
1127 |
+ |
1128 |
+AC_MSG_CHECKING(for developer gcc flags) |
1129 |
+if test "x$developer" = "xyes" -a "x$GCC" = "xyes"; then |
1130 |
+ devflags="-g -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef" |
1131 |
+ CFLAGS="$CFLAGS $devflags" |
1132 |
+ INSTALLSTRIP="" |
1133 |
+ AC_MSG_RESULT(yes. Using $devflags) |
1134 |
+else |
1135 |
+ devflags="" |
1136 |
+ CFLAGS="$CFLAGS -DNDEBUG" |
1137 |
+ INSTALLSTRIP="" |
1138 |
+ AC_MSG_RESULT(no.) |
1139 |
+fi |
1140 |
+ |
1141 |
+FR_TLS |
1142 |
+ |
1143 |
+dnl ############################################################# |
1144 |
+dnl # |
1145 |
+dnl # 7. Checks for library functions |
1146 |
+dnl # |
1147 |
+dnl ############################################################# |
1148 |
+ |
1149 |
+old_LIBS="$LIBS" |
1150 |
+LIBS="$LIBS $LIBLTDL" |
1151 |
+AC_CHECK_FUNC(lt_dladvise_init, AC_DEFINE(HAVE_HAVE_LT_DLADVISE_INIT, [], [Do we have the lt_dladvise_init function])) |
1152 |
+LIBS="$old_LIBS" |
1153 |
+ |
1154 |
+dnl Check for libcrypt |
1155 |
+dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD) |
1156 |
+AC_CHECK_LIB(crypt, crypt, |
1157 |
+ CRYPTLIB="-lcrypt" |
1158 |
+) |
1159 |
+if test "$CRYPTLIB" != ""; then |
1160 |
+ AC_DEFINE(HAVE_CRYPT, [], [Do we have the crypt function]) |
1161 |
+else |
1162 |
+ AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT, [], [Do we have the crypt function])) |
1163 |
+fi |
1164 |
+ |
1165 |
+dnl Check for libcipher |
1166 |
+AC_CHECK_LIB(cipher, setkey, |
1167 |
+ CRYPTLIB="${CRYPTLIB} -lcipher" |
1168 |
+) |
1169 |
+AC_SUBST(CRYPTLIB) |
1170 |
+ |
1171 |
+dnl Check the style of gethostbyaddr, in order of preference |
1172 |
+dnl GNU (_r eight args) |
1173 |
+AC_DEFINE(GNUSTYLE, [1], [GNU-Style get*byaddr_r]) |
1174 |
+dnl SYSV (_r six args) |
1175 |
+AC_DEFINE(SYSVSTYLE, [2], [SYSV-Style get*byaddr_r]) |
1176 |
+dnl BSD (three args, may not be thread safe) |
1177 |
+AC_DEFINE(BSDSTYLE, [3], [BSD-Style get*byaddr_r]) |
1178 |
+dnl Tru64 has BSD version, but it is thread safe |
1179 |
+dnl http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1739____.HTM |
1180 |
+dnl We need #stdio.h to define NULL on FreeBSD (at least) |
1181 |
+gethostbyaddrrstyle="" |
1182 |
+AC_MSG_CHECKING([gethostbyaddr_r() syntax]) |
1183 |
+case "$host" in |
1184 |
+*-freebsd*) |
1185 |
+dnl With FreeBSD, check if there's a prototype for gethostbyaddr_r. |
1186 |
+dnl Some versions (FreeBSD 5.1?) have a symbol but no prototype - so we |
1187 |
+dnl override this test to BSDSTYLE. FreeBSD 6.2 and up have proper GNU |
1188 |
+dnl style support. |
1189 |
+ AC_CHECK_DECLS([gethostbyaddr_r], [], [ |
1190 |
+ AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE, |
1191 |
+ [style of gethostbyaddr_r functions ]) |
1192 |
+ gethostbyaddrrstyle=BSD |
1193 |
+ AC_MSG_WARN([FreeBSD overridden to BSD-style]) |
1194 |
+ ], [ |
1195 |
+#ifdef HAVE_NETDB_H |
1196 |
+#include <netdb.h> |
1197 |
+#endif |
1198 |
+]) |
1199 |
+ ;; |
1200 |
+esac |
1201 |
+if test "x$gethostbyaddrrstyle" = "x"; then |
1202 |
+ AC_TRY_LINK([ |
1203 |
+#include <stdio.h> |
1204 |
+#include <netdb.h> |
1205 |
+], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL, NULL) ], [ |
1206 |
+ AC_DEFINE(GETHOSTBYADDRRSTYLE, GNUSTYLE, [style of gethostbyaddr_r functions ]) |
1207 |
+ gethostbyaddrrstyle=GNU |
1208 |
+]) |
1209 |
+fi |
1210 |
+if test "x$gethostbyaddrrstyle" = "x"; then |
1211 |
+ AC_TRY_LINK([ |
1212 |
+#include <stdio.h> |
1213 |
+#include <netdb.h> |
1214 |
+], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL) ] , [ |
1215 |
+ AC_DEFINE(GETHOSTBYADDRRSTYLE, SYSVSTYLE, [style of gethostbyaddr_r functions ]) |
1216 |
+ gethostbyaddrrstyle=SYSV |
1217 |
+ ]) |
1218 |
+fi |
1219 |
+if test "x$gethostbyaddrrstyle" = "x"; then |
1220 |
+ AC_TRY_LINK([ |
1221 |
+#include <stdio.h> |
1222 |
+#include <netdb.h> |
1223 |
+], [ gethostbyaddr(NULL, 0, 0) ], [ |
1224 |
+ AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE, [style of gethostbyaddr_r functions ]) |
1225 |
+ gethostbyaddrrstyle=BSD |
1226 |
+ ]) |
1227 |
+fi |
1228 |
+ |
1229 |
+if test "x$gethostbyaddrrstyle" = "x"; then |
1230 |
+ AC_MSG_RESULT([none! It must not exist, here.]) |
1231 |
+else |
1232 |
+ AC_MSG_RESULT([${gethostbyaddrrstyle}-style]) |
1233 |
+fi |
1234 |
+ |
1235 |
+if test "x$gethostbyaddrrstyle" = "xBSD"; then |
1236 |
+ AC_MSG_WARN([ ****** BSD-style gethostbyaddr might NOT be thread-safe! ****** ]) |
1237 |
+fi |
1238 |
+ |
1239 |
+dnl Check the style of gethostbyname, in order of preference |
1240 |
+dnl GNU (_r seven args) |
1241 |
+dnl SYSV (_r five args) |
1242 |
+dnl BSD (two args, may not be thread safe) |
1243 |
+dnl Tru64 has BSD version, but it _is_ thread safe |
1244 |
+dnl http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1946____.HTM |
1245 |
+dnl We need #stdio.h to define NULL on FreeBSD (at least) |
1246 |
+gethostbynamerstyle="" |
1247 |
+AC_MSG_CHECKING([gethostbyname_r() syntax]) |
1248 |
+AC_TRY_LINK([ |
1249 |
+#include <stdio.h> |
1250 |
+#include <netdb.h> |
1251 |
+], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL) ], [ |
1252 |
+ AC_DEFINE(GETHOSTBYNAMERSTYLE, GNUSTYLE, [style of gethostbyname_r functions ]) |
1253 |
+ gethostbynamerstyle=GNU |
1254 |
+]) |
1255 |
+if test "x$gethostbynamerstyle" = "x"; then |
1256 |
+ AC_TRY_LINK([ |
1257 |
+#include <stdio.h> |
1258 |
+#include <netdb.h> |
1259 |
+], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL) ] , [ |
1260 |
+ AC_DEFINE(GETHOSTBYNAMERSTYLE, SYSVSTYLE, [style of gethostbyname_r functions ]) |
1261 |
+ gethostbynamerstyle=SYSV |
1262 |
+ ]) |
1263 |
+fi |
1264 |
+if test "x$gethostbynamerstyle" = "x"; then |
1265 |
+ AC_TRY_LINK([ |
1266 |
+#include <stdio.h> |
1267 |
+#include <netdb.h> |
1268 |
+], [ gethostbyname(NULL) ], [ |
1269 |
+ AC_DEFINE(GETHOSTBYNAMERSTYLE, BSDSTYLE, [style of gethostbyname_r functions ]) |
1270 |
+ gethostbynamerstyle=BSD |
1271 |
+ ]) |
1272 |
+fi |
1273 |
+ |
1274 |
+if test "x$gethostbynamerstyle" = "x"; then |
1275 |
+ AC_MSG_RESULT([none! It must not exist, here.]) |
1276 |
+else |
1277 |
+ AC_MSG_RESULT([${gethostbynamerstyle}-style]) |
1278 |
+fi |
1279 |
+ |
1280 |
+if test "x$gethostbynamerstyle" = "xBSD"; then |
1281 |
+ AC_MSG_WARN([ ****** BSD-style gethostbyname might NOT be thread-safe! ****** ]) |
1282 |
+fi |
1283 |
+ |
1284 |
+dnl check for non-posix solaris ctime_r (extra buflen int arg) |
1285 |
+AC_DEFINE(POSIXSTYLE, [1], [Posix-Style ctime_r]) |
1286 |
+AC_DEFINE(SOLARISSTYLE, [2], [Solaris-Style ctime_r]) |
1287 |
+ctimerstyle="" |
1288 |
+AC_MSG_CHECKING([ctime_r() syntax]) |
1289 |
+AC_TRY_LINK([ |
1290 |
+#include <time.h> |
1291 |
+], [ ctime_r(NULL, NULL, 0) ], [ |
1292 |
+ AC_DEFINE(CTIMERSTYLE, SOLARISSTYLE, [style of ctime_r function]) |
1293 |
+ ctimerstyle="SOLARIS" |
1294 |
+]) |
1295 |
+if test "x$ctimerstyle" = "x"; then |
1296 |
+ AC_TRY_LINK([ |
1297 |
+#include <time.h> |
1298 |
+], [ ctime_r(NULL, NULL) ], [ |
1299 |
+ AC_DEFINE(CTIMERSTYLE, POSIXSTYLE, [style of ctime_r function]) |
1300 |
+ ctimerstyle="POSIX" |
1301 |
+ ]) |
1302 |
+fi |
1303 |
+ |
1304 |
+if test "x$ctimerstyle" = "x"; then |
1305 |
+ AC_MSG_RESULT([none! It must not exist, here.]) |
1306 |
+else |
1307 |
+ AC_MSG_RESULT([${ctimerstyle}-style]) |
1308 |
+fi |
1309 |
+ |
1310 |
+AC_SUBST(HOSTINFO, $host) |
1311 |
+ |
1312 |
+dnl ############################################################# |
1313 |
+dnl # |
1314 |
+dnl # 8. Checks for system services |
1315 |
+dnl # |
1316 |
+dnl ############################################################# |
1317 |
+ |
1318 |
+dnl # |
1319 |
+dnl # Figure out where libtool is located, |
1320 |
+dnl # |
1321 |
+top_builddir=`pwd` |
1322 |
+export top_builddir |
1323 |
+AC_MSG_RESULT([top_builddir=$top_builddir]) |
1324 |
+dnl # AC_SUBST(top_builddir) |
1325 |
+AC_SUBST(LIBLTDL) |
1326 |
+AC_SUBST(INCLTDL) |
1327 |
+ |
1328 |
+dnl import libtool stuff |
1329 |
+ |
1330 |
+dnl ############################################################# |
1331 |
+dnl # |
1332 |
+dnl # Configure in any module directories. |
1333 |
+dnl # |
1334 |
+dnl ############################################################# |
1335 |
+ |
1336 |
+mysubdirs="$LIBLTDLPATH" |
1337 |
+if test "x$EXPERIMENTAL" = "xyes"; then |
1338 |
+ bar=`ls -1 "${srcdir}"/src/modules/rlm_*/configure | sed 's%/configure%%'` |
1339 |
+ dnl # get rid of LF's. |
1340 |
+ mysubdirs=`echo $mysubdirs $bar` |
1341 |
+else |
1342 |
+ dnl # |
1343 |
+ dnl # Find 'configure' in ONLY the stable modules |
1344 |
+ dnl # |
1345 |
+ for bar in `cat "${srcdir}"/src/modules/stable`; do |
1346 |
+ if test -f "${srcdir}"/src/modules/$bar/configure; then |
1347 |
+ mysubdirs="$mysubdirs src/modules/$bar" |
1348 |
+ fi |
1349 |
+ done |
1350 |
+fi |
1351 |
+ |
1352 |
+dnl ############################################################ |
1353 |
+dnl # make modules by list |
1354 |
+dnl ############################################################# |
1355 |
+if test "x$EXPERIMENTAL" = "xyes"; then |
1356 |
+ for foo in `ls -1 "${srcdir}"/src/modules | grep rlm_`; do |
1357 |
+ MODULES="$MODULES $foo" |
1358 |
+ done |
1359 |
+else |
1360 |
+ dnl # |
1361 |
+ dnl # make ONLY the stable modules |
1362 |
+ dnl # |
1363 |
+ for foo in `cat "${srcdir}"/src/modules/stable`; do |
1364 |
+ MODULES="$MODULES $foo" |
1365 |
+ done |
1366 |
+fi |
1367 |
+ |
1368 |
+dnl # |
1369 |
+dnl # Don't change the variable name here. Autoconf goes bonkers |
1370 |
+dnl # if you do. |
1371 |
+dnl # |
1372 |
+AC_CONFIG_SUBDIRS($LTDL_SUBDIRS $mysubdirs) |
1373 |
+AC_SUBST(MODULES) |
1374 |
+ |
1375 |
+dnl ############################################################# |
1376 |
+dnl # |
1377 |
+dnl # And finally, output the results. |
1378 |
+dnl # |
1379 |
+dnl ############################################################# |
1380 |
+ |
1381 |
+AC_CONFIG_COMMANDS([stamp-h], [echo timestamp > src/include/stamp-h]) |
1382 |
+AC_CONFIG_COMMANDS([build-radpaths-h], [(cd ./src/include && /bin/sh ./build-radpaths-h)]) |
1383 |
+AC_CONFIG_COMMANDS([main-chmod], [(cd ./src/main && chmod +x checkrad.pl radlast radtest)]) |
1384 |
+AC_CONFIG_COMMANDS([scripts-chmod], [(cd ./scripts && chmod +x rc.radiusd radwatch radiusd.cron.daily radiusd.cron.monthly cryptpasswd)]) |
1385 |
+ |
1386 |
+dnl # |
1387 |
+dnl # Substitute whatever libraries we found to be necessary |
1388 |
+dnl # |
1389 |
+AC_SUBST(LIBS) |
1390 |
+AC_SUBST(INSTALLSTRIP) |
1391 |
+ |
1392 |
+USE_SHARED_LIBS=$enable_shared |
1393 |
+AC_SUBST(USE_SHARED_LIBS) |
1394 |
+USE_STATIC_LIBS=$enable_static |
1395 |
+AC_SUBST(USE_STATIC_LIBS) |
1396 |
+AC_SUBST(STATIC_MODULES) |
1397 |
+AC_SUBST(RADIUSD_MAJOR_VERSION) |
1398 |
+AC_SUBST(RADIUSD_MINOR_VERSION) |
1399 |
+AC_SUBST(RADIUSD_VERSION) |
1400 |
+ |
1401 |
+AC_OUTPUT(\ |
1402 |
+ ./Make.inc \ |
1403 |
+ ./src/include/build-radpaths-h \ |
1404 |
+ ./src/main/Makefile \ |
1405 |
+ ./src/main/checkrad.pl \ |
1406 |
+ ./src/main/radlast \ |
1407 |
+ ./src/main/radtest \ |
1408 |
+ ./scripts/rc.radiusd \ |
1409 |
+ ./scripts/radwatch \ |
1410 |
+ ./scripts/radiusd.cron.daily \ |
1411 |
+ ./scripts/radiusd.cron.monthly \ |
1412 |
+ ./scripts/cryptpasswd \ |
1413 |
+ ./raddb/dictionary \ |
1414 |
+ ./raddb/radrelay.conf \ |
1415 |
+ ./raddb/radiusd.conf |
1416 |
+) |
1417 |
diff -Naur freeradius-server-2.1.10.orig/src/include/radiusd.h freeradius-server-2.1.10/src/include/radiusd.h |
1418 |
--- freeradius-server-2.1.10.orig/src/include/radiusd.h 2010-09-28 13:03:56.000000000 +0200 |
1419 |
+++ freeradius-server-2.1.10/src/include/radiusd.h 2011-02-09 17:42:53.000000000 +0100 |
1420 |
@@ -645,6 +645,7 @@ |
1421 |
void event_new_fd(rad_listen_t *listener); |
1422 |
|
1423 |
/* evaluate.c */ |
1424 |
+int radius_get_vp(REQUEST *request, const char *name, VALUE_PAIR **vp_p); |
1425 |
int radius_evaluate_condition(REQUEST *request, int modreturn, int depth, |
1426 |
const char **ptr, int evaluate_it, int *presult); |
1427 |
int radius_update_attrlist(REQUEST *request, CONF_SECTION *cs, |
1428 |
diff -Naur freeradius-server-2.1.10.orig/src/include/radiusd.h.orig freeradius-server-2.1.10/src/include/radiusd.h.orig |
1429 |
--- freeradius-server-2.1.10.orig/src/include/radiusd.h.orig 1970-01-01 01:00:00.000000000 +0100 |
1430 |
+++ freeradius-server-2.1.10/src/include/radiusd.h.orig 2010-09-28 13:03:56.000000000 +0200 |
1431 |
@@ -0,0 +1,653 @@ |
1432 |
+#ifndef RADIUSD_H |
1433 |
+#define RADIUSD_H |
1434 |
+/* |
1435 |
+ * radiusd.h Structures, prototypes and global variables |
1436 |
+ * for the FreeRADIUS server. |
1437 |
+ * |
1438 |
+ * Version: $Id: freeradius-2.1.10-qafixes.patch,v 1.1 2011/05/26 15:31:45 hwoarang Exp $ |
1439 |
+ * |
1440 |
+ * This program is free software; you can redistribute it and/or modify |
1441 |
+ * it under the terms of the GNU General Public License as published by |
1442 |
+ * the Free Software Foundation; either version 2 of the License, or |
1443 |
+ * (at your option) any later version. |
1444 |
+ * |
1445 |
+ * This program is distributed in the hope that it will be useful, |
1446 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1447 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1448 |
+ * GNU General Public License for more details. |
1449 |
+ * |
1450 |
+ * You should have received a copy of the GNU General Public License |
1451 |
+ * along with this program; if not, write to the Free Software |
1452 |
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA |
1453 |
+ * |
1454 |
+ * Copyright 1999,2000,2002,2003,2004,2005,2006,2007,2008 The FreeRADIUS server project |
1455 |
+ * |
1456 |
+ */ |
1457 |
+ |
1458 |
+#include <freeradius-devel/ident.h> |
1459 |
+RCSIDH(radiusd_h, "$Id: freeradius-2.1.10-qafixes.patch,v 1.1 2011/05/26 15:31:45 hwoarang Exp $") |
1460 |
+ |
1461 |
+#include <freeradius-devel/libradius.h> |
1462 |
+#include <freeradius-devel/radpaths.h> |
1463 |
+#include <freeradius-devel/conf.h> |
1464 |
+#include <freeradius-devel/conffile.h> |
1465 |
+#include <freeradius-devel/event.h> |
1466 |
+ |
1467 |
+typedef struct auth_req REQUEST; |
1468 |
+ |
1469 |
+#ifdef HAVE_PTHREAD_H |
1470 |
+#include <pthread.h> |
1471 |
+#endif |
1472 |
+ |
1473 |
+#ifndef NDEBUG |
1474 |
+#define REQUEST_MAGIC (0xdeadbeef) |
1475 |
+#endif |
1476 |
+ |
1477 |
+/* |
1478 |
+ * New defines for minimizing the size of the server, to strip |
1479 |
+ * out functionality. In order to ensure that people don't have |
1480 |
+ * to re-run "configure", after "cvs update", we play some |
1481 |
+ * special games with the defines. i.e. any top-level "configure" |
1482 |
+ * option should set both WITH_FOO and WITHOUT_FOO. After a few |
1483 |
+ * weeks, the WITHOUT_FOO can be deleted from the configure script. |
1484 |
+ */ |
1485 |
+#ifndef WITHOUT_PROXY |
1486 |
+#define WITH_PROXY (1) |
1487 |
+#endif |
1488 |
+ |
1489 |
+#ifndef WITHOUT_DETAIL |
1490 |
+#define WITH_DETAIL (1) |
1491 |
+#endif |
1492 |
+ |
1493 |
+#ifndef WITHOUT_SESSION_MGMT |
1494 |
+#define WITH_SESSION_MGMT (1) |
1495 |
+#endif |
1496 |
+ |
1497 |
+#ifndef WITHOUT_UNLANG |
1498 |
+#define WITH_UNLANG (1) |
1499 |
+#endif |
1500 |
+ |
1501 |
+#ifndef WITHOUT_ACCOUNTING |
1502 |
+#define WITH_ACCOUNTING (1) |
1503 |
+#else |
1504 |
+#ifdef WITH_SESSION_MGMT |
1505 |
+#error WITH_SESSION_MGMT is defined, but WITH_ACCOUNTING is not. Session management requires accounting. |
1506 |
+#endif |
1507 |
+#ifdef WITH_DETAIL |
1508 |
+#error WITH_DETAIL is defined, but WITH_ACCOUNTING is not. Detail file reading requires accounting. |
1509 |
+#endif |
1510 |
+#endif |
1511 |
+ |
1512 |
+#ifndef WITHOUT_DYNAMIC_CLIENTS |
1513 |
+#define WITH_DYNAMIC_CLIENTS (1) |
1514 |
+#endif |
1515 |
+ |
1516 |
+#ifndef WITHOUT_STATS |
1517 |
+#define WITH_STATS |
1518 |
+#endif |
1519 |
+ |
1520 |
+#ifndef WITHOUT_COMMAND_SOCKET |
1521 |
+#ifdef HAVE_SYS_UN_H |
1522 |
+#define WITH_COMMAND_SOCKET (1) |
1523 |
+#else |
1524 |
+#define WITHOUT_COMMAND_SOCKET (1) |
1525 |
+#endif |
1526 |
+#endif |
1527 |
+ |
1528 |
+#ifndef WITHOUT_COA |
1529 |
+#define WITH_COA (1) |
1530 |
+#ifndef WITH_PROXY |
1531 |
+#error WITH_COA requires WITH_PROXY |
1532 |
+#endif |
1533 |
+#endif |
1534 |
+ |
1535 |
+#include <freeradius-devel/stats.h> |
1536 |
+#include <freeradius-devel/realms.h> |
1537 |
+ |
1538 |
+ |
1539 |
+/* |
1540 |
+ * See util.c |
1541 |
+ */ |
1542 |
+typedef struct request_data_t request_data_t; |
1543 |
+ |
1544 |
+typedef struct radclient { |
1545 |
+ fr_ipaddr_t ipaddr; |
1546 |
+ int prefix; |
1547 |
+ char *longname; |
1548 |
+ char *secret; |
1549 |
+ char *shortname; |
1550 |
+ int message_authenticator; |
1551 |
+ char *nastype; |
1552 |
+ char *login; |
1553 |
+ char *password; |
1554 |
+ char *server; |
1555 |
+ int number; /* internal use only */ |
1556 |
+ const CONF_SECTION *cs; |
1557 |
+#ifdef WITH_STATS |
1558 |
+ fr_stats_t *auth; |
1559 |
+#ifdef WITH_ACCOUNTING |
1560 |
+ fr_stats_t *acct; |
1561 |
+#endif |
1562 |
+#endif |
1563 |
+ |
1564 |
+#ifdef WITH_DYNAMIC_CLIENTS |
1565 |
+ int lifetime; |
1566 |
+ int dynamic; /* was dynamically defined */ |
1567 |
+ time_t created; |
1568 |
+ time_t last_new_client; |
1569 |
+ char *client_server; |
1570 |
+ int rate_limit; |
1571 |
+#endif |
1572 |
+ |
1573 |
+#ifdef WITH_COA |
1574 |
+ char *coa_name; |
1575 |
+ home_server *coa_server; |
1576 |
+ home_pool_t *coa_pool; |
1577 |
+#endif |
1578 |
+} RADCLIENT; |
1579 |
+ |
1580 |
+/* |
1581 |
+ * Types of listeners. |
1582 |
+ * |
1583 |
+ * Ordered by priority! |
1584 |
+ */ |
1585 |
+typedef enum RAD_LISTEN_TYPE { |
1586 |
+ RAD_LISTEN_NONE = 0, |
1587 |
+#ifdef WITH_PROXY |
1588 |
+ RAD_LISTEN_PROXY, |
1589 |
+#endif |
1590 |
+ RAD_LISTEN_AUTH, |
1591 |
+#ifdef WITH_ACCOUNTING |
1592 |
+ RAD_LISTEN_ACCT, |
1593 |
+#endif |
1594 |
+#ifdef WITH_DETAIL |
1595 |
+ RAD_LISTEN_DETAIL, |
1596 |
+#endif |
1597 |
+#ifdef WITH_VMPS |
1598 |
+ RAD_LISTEN_VQP, |
1599 |
+#endif |
1600 |
+#ifdef WITH_DHCP |
1601 |
+ RAD_LISTEN_DHCP, |
1602 |
+#endif |
1603 |
+#ifdef WITH_COMMAND_SOCKET |
1604 |
+ RAD_LISTEN_COMMAND, |
1605 |
+#endif |
1606 |
+#ifdef WITH_COA |
1607 |
+ RAD_LISTEN_COA, |
1608 |
+#endif |
1609 |
+ RAD_LISTEN_MAX |
1610 |
+} RAD_LISTEN_TYPE; |
1611 |
+ |
1612 |
+ |
1613 |
+/* |
1614 |
+ * For listening on multiple IP's and ports. |
1615 |
+ */ |
1616 |
+typedef struct rad_listen_t rad_listen_t; |
1617 |
+typedef void (*radlog_func_t)(int, int, REQUEST *, const char *, ...); |
1618 |
+ |
1619 |
+#define REQUEST_DATA_REGEX (0xadbeef00) |
1620 |
+#define REQUEST_MAX_REGEX (8) |
1621 |
+ |
1622 |
+struct auth_req { |
1623 |
+#ifndef NDEBUG |
1624 |
+ uint32_t magic; /* for debugging only */ |
1625 |
+#endif |
1626 |
+ RADIUS_PACKET *packet; |
1627 |
+#ifdef WITH_PROXY |
1628 |
+ RADIUS_PACKET *proxy; |
1629 |
+#endif |
1630 |
+ RADIUS_PACKET *reply; |
1631 |
+#ifdef WITH_PROXY |
1632 |
+ RADIUS_PACKET *proxy_reply; |
1633 |
+#endif |
1634 |
+ VALUE_PAIR *config_items; |
1635 |
+ VALUE_PAIR *username; |
1636 |
+ VALUE_PAIR *password; |
1637 |
+ |
1638 |
+ struct main_config_t *root; |
1639 |
+ |
1640 |
+ request_data_t *data; |
1641 |
+ RADCLIENT *client; |
1642 |
+#ifdef HAVE_PTHREAD_H |
1643 |
+ pthread_t child_pid; |
1644 |
+#endif |
1645 |
+ time_t timestamp; |
1646 |
+ unsigned int number; /* internal server number */ |
1647 |
+ |
1648 |
+ rad_listen_t *listener; |
1649 |
+#ifdef WITH_PROXY |
1650 |
+ rad_listen_t *proxy_listener; |
1651 |
+#endif |
1652 |
+ |
1653 |
+ |
1654 |
+ int simul_max; /* see modcall.c && xlat.c */ |
1655 |
+#ifdef WITH_SESSION_MGMT |
1656 |
+ int simul_count; |
1657 |
+ int simul_mpp; /* WEIRD: 1 is false, 2 is true */ |
1658 |
+#endif |
1659 |
+ |
1660 |
+ int options; /* miscellanous options */ |
1661 |
+ const char *module; /* for debugging unresponsive children */ |
1662 |
+ const char *component; /* ditto */ |
1663 |
+ |
1664 |
+ struct timeval received; |
1665 |
+ struct timeval when; /* to wake up */ |
1666 |
+ int delay; |
1667 |
+ |
1668 |
+ int master_state; |
1669 |
+ int child_state; |
1670 |
+ RAD_LISTEN_TYPE priority; |
1671 |
+ |
1672 |
+ fr_event_t *ev; |
1673 |
+ struct timeval next_when; |
1674 |
+ fr_event_callback_t next_callback; |
1675 |
+ |
1676 |
+ int in_request_hash; |
1677 |
+#ifdef WITH_PROXY |
1678 |
+ int in_proxy_hash; |
1679 |
+ |
1680 |
+ home_server *home_server; |
1681 |
+ home_pool_t *home_pool; /* for dynamic failover */ |
1682 |
+ |
1683 |
+ struct timeval proxy_when; |
1684 |
+ |
1685 |
+ int num_proxied_requests; |
1686 |
+ int num_proxied_responses; |
1687 |
+#endif |
1688 |
+ |
1689 |
+ const char *server; |
1690 |
+ REQUEST *parent; |
1691 |
+ radlog_func_t radlog; /* logging function, if set */ |
1692 |
+#ifdef WITH_COA |
1693 |
+ REQUEST *coa; |
1694 |
+ int num_coa_requests; |
1695 |
+#endif |
1696 |
+}; /* REQUEST typedef */ |
1697 |
+ |
1698 |
+#define RAD_REQUEST_OPTION_NONE (0) |
1699 |
+#define RAD_REQUEST_OPTION_DEBUG (1) |
1700 |
+#define RAD_REQUEST_OPTION_DEBUG2 (2) |
1701 |
+#define RAD_REQUEST_OPTION_DEBUG3 (3) |
1702 |
+#define RAD_REQUEST_OPTION_DEBUG4 (4) |
1703 |
+ |
1704 |
+#define REQUEST_ACTIVE (1) |
1705 |
+#define REQUEST_STOP_PROCESSING (2) |
1706 |
+#define REQUEST_COUNTED (3) |
1707 |
+ |
1708 |
+#define REQUEST_QUEUED (1) |
1709 |
+#define REQUEST_RUNNING (2) |
1710 |
+#define REQUEST_PROXIED (3) |
1711 |
+#define REQUEST_REJECT_DELAY (4) |
1712 |
+#define REQUEST_CLEANUP_DELAY (5) |
1713 |
+#define REQUEST_DONE (6) |
1714 |
+ |
1715 |
+/* |
1716 |
+ * Function handler for requests. |
1717 |
+ */ |
1718 |
+typedef int (*RAD_REQUEST_FUNP)(REQUEST *); |
1719 |
+ |
1720 |
+typedef struct radclient_list RADCLIENT_LIST; |
1721 |
+ |
1722 |
+typedef struct pair_list { |
1723 |
+ const char *name; |
1724 |
+ VALUE_PAIR *check; |
1725 |
+ VALUE_PAIR *reply; |
1726 |
+ int lineno; |
1727 |
+ int order; |
1728 |
+ struct pair_list *next; |
1729 |
+ struct pair_list *lastdefault; |
1730 |
+} PAIR_LIST; |
1731 |
+ |
1732 |
+ |
1733 |
+typedef int (*rad_listen_recv_t)(rad_listen_t *, RAD_REQUEST_FUNP *, REQUEST **); |
1734 |
+typedef int (*rad_listen_send_t)(rad_listen_t *, REQUEST *); |
1735 |
+typedef int (*rad_listen_print_t)(const rad_listen_t *, char *, size_t); |
1736 |
+typedef int (*rad_listen_encode_t)(rad_listen_t *, REQUEST *); |
1737 |
+typedef int (*rad_listen_decode_t)(rad_listen_t *, REQUEST *); |
1738 |
+ |
1739 |
+struct rad_listen_t { |
1740 |
+ struct rad_listen_t *next; /* should be rbtree stuff */ |
1741 |
+ |
1742 |
+ /* |
1743 |
+ * For normal sockets. |
1744 |
+ */ |
1745 |
+ RAD_LISTEN_TYPE type; |
1746 |
+ int fd; |
1747 |
+ const char *server; |
1748 |
+ int status; |
1749 |
+ |
1750 |
+ rad_listen_recv_t recv; |
1751 |
+ rad_listen_send_t send; |
1752 |
+ rad_listen_encode_t encode; |
1753 |
+ rad_listen_decode_t decode; |
1754 |
+ rad_listen_print_t print; |
1755 |
+ |
1756 |
+ void *data; |
1757 |
+ |
1758 |
+#ifdef WITH_STATS |
1759 |
+ fr_stats_t stats; |
1760 |
+#endif |
1761 |
+}; |
1762 |
+ |
1763 |
+#define RAD_LISTEN_STATUS_INIT (0) |
1764 |
+#define RAD_LISTEN_STATUS_KNOWN (1) |
1765 |
+#define RAD_LISTEN_STATUS_CLOSED (2) |
1766 |
+#define RAD_LISTEN_STATUS_FINISH (3) |
1767 |
+ |
1768 |
+typedef enum radlog_dest_t { |
1769 |
+ RADLOG_STDOUT = 0, |
1770 |
+ RADLOG_FILES, |
1771 |
+ RADLOG_SYSLOG, |
1772 |
+ RADLOG_STDERR, |
1773 |
+ RADLOG_NULL, |
1774 |
+ RADLOG_NUM_DEST |
1775 |
+} radlog_dest_t; |
1776 |
+ |
1777 |
+typedef struct main_config_t { |
1778 |
+ struct main_config *next; |
1779 |
+ int refcount; |
1780 |
+ fr_ipaddr_t myip; /* from the command-line only */ |
1781 |
+ int port; /* from the command-line only */ |
1782 |
+ int log_auth; |
1783 |
+ int log_auth_badpass; |
1784 |
+ int log_auth_goodpass; |
1785 |
+ int allow_core_dumps; |
1786 |
+ int debug_level; |
1787 |
+ int proxy_requests; |
1788 |
+ int reject_delay; |
1789 |
+ int status_server; |
1790 |
+ int max_request_time; |
1791 |
+ int cleanup_delay; |
1792 |
+ int max_requests; |
1793 |
+#ifdef DELETE_BLOCKED_REQUESTS |
1794 |
+ int kill_unresponsive_children; |
1795 |
+#endif |
1796 |
+ char *log_file; |
1797 |
+ char *checkrad; |
1798 |
+ const char *pid_file; |
1799 |
+ rad_listen_t *listen; |
1800 |
+ int syslog_facility; |
1801 |
+ int radlog_fd; |
1802 |
+ radlog_dest_t radlog_dest; |
1803 |
+ CONF_SECTION *config; |
1804 |
+ const char *name; |
1805 |
+ const char *auth_badpass_msg; |
1806 |
+ const char *auth_goodpass_msg; |
1807 |
+} MAIN_CONFIG_T; |
1808 |
+ |
1809 |
+#define DEBUG if(debug_flag)log_debug |
1810 |
+#define DEBUG2 if (debug_flag > 1)log_debug |
1811 |
+#define DEBUG3 if (debug_flag > 2)log_debug |
1812 |
+#define DEBUG4 if (debug_flag > 3)log_debug |
1813 |
+ |
1814 |
+#if __GNUC__ >= 3 |
1815 |
+#define RDEBUG(fmt, ...) if(request && request->radlog) request->radlog(L_DBG, 1, request, fmt, ## __VA_ARGS__) |
1816 |
+#define RDEBUG2(fmt, ...) if(request && request->radlog) request->radlog(L_DBG, 2, request, fmt, ## __VA_ARGS__) |
1817 |
+#define RDEBUG3(fmt, ...) if(request && request->radlog) request->radlog(L_DBG, 3, request, fmt, ## __VA_ARGS__) |
1818 |
+#define RDEBUG4(fmt, ...) if(request && request->radlog) request->radlog(L_DBG, 4, request, fmt, ## __VA_ARGS__) |
1819 |
+#else |
1820 |
+#define RDEBUG DEBUG |
1821 |
+#define RDEBUG2 DEBUG2 |
1822 |
+#define RDEBUG3 DEBUG3 |
1823 |
+#define RDEBUG4 DEBUG4 |
1824 |
+#endif |
1825 |
+ |
1826 |
+#define SECONDS_PER_DAY 86400 |
1827 |
+#define MAX_REQUEST_TIME 30 |
1828 |
+#define CLEANUP_DELAY 5 |
1829 |
+#define MAX_REQUESTS 256 |
1830 |
+#define RETRY_DELAY 5 |
1831 |
+#define RETRY_COUNT 3 |
1832 |
+#define DEAD_TIME 120 |
1833 |
+ |
1834 |
+#define L_DBG 1 |
1835 |
+#define L_AUTH 2 |
1836 |
+#define L_INFO 3 |
1837 |
+#define L_ERR 4 |
1838 |
+#define L_PROXY 5 |
1839 |
+#define L_ACCT 6 |
1840 |
+#define L_CONS 128 |
1841 |
+ |
1842 |
+#ifndef FALSE |
1843 |
+#define FALSE 0 |
1844 |
+#endif |
1845 |
+#ifndef TRUE |
1846 |
+/* |
1847 |
+ * This definition of true as NOT false is definitive. :) Making |
1848 |
+ * it '1' can cause problems on stupid platforms. See articles |
1849 |
+ * on C portability for more information. |
1850 |
+ */ |
1851 |
+#define TRUE (!FALSE) |
1852 |
+#endif |
1853 |
+ |
1854 |
+/* for paircompare_register */ |
1855 |
+typedef int (*RAD_COMPARE_FUNC)(void *instance, REQUEST *,VALUE_PAIR *, VALUE_PAIR *, VALUE_PAIR *, VALUE_PAIR **); |
1856 |
+ |
1857 |
+typedef enum request_fail_t { |
1858 |
+ REQUEST_FAIL_UNKNOWN = 0, |
1859 |
+ REQUEST_FAIL_NO_THREADS, /* no threads to handle it */ |
1860 |
+ REQUEST_FAIL_DECODE, /* rad_decode didn't like it */ |
1861 |
+ REQUEST_FAIL_PROXY, /* call to proxy modules failed */ |
1862 |
+ REQUEST_FAIL_PROXY_SEND, /* proxy_send didn't like it */ |
1863 |
+ REQUEST_FAIL_NO_RESPONSE, /* we weren't told to respond, so we reject */ |
1864 |
+ REQUEST_FAIL_HOME_SERVER, /* the home server didn't respond */ |
1865 |
+ REQUEST_FAIL_HOME_SERVER2, /* another case of the above */ |
1866 |
+ REQUEST_FAIL_HOME_SERVER3, /* another case of the above */ |
1867 |
+ REQUEST_FAIL_NORMAL_REJECT, /* authentication failure */ |
1868 |
+ REQUEST_FAIL_SERVER_TIMEOUT /* the server took too long to process the request */ |
1869 |
+} request_fail_t; |
1870 |
+ |
1871 |
+/* |
1872 |
+ * Global variables. |
1873 |
+ * |
1874 |
+ * We really shouldn't have this many. |
1875 |
+ */ |
1876 |
+extern const char *progname; |
1877 |
+extern int debug_flag; |
1878 |
+extern const char *radacct_dir; |
1879 |
+extern const char *radlog_dir; |
1880 |
+extern const char *radlib_dir; |
1881 |
+extern const char *radius_dir; |
1882 |
+extern const char *radius_libdir; |
1883 |
+extern uint32_t expiration_seconds; |
1884 |
+extern int log_stripped_names; |
1885 |
+extern int log_auth_detail; |
1886 |
+extern const char *radiusd_version; |
1887 |
+void radius_signal_self(int flag); |
1888 |
+ |
1889 |
+#define RADIUS_SIGNAL_SELF_NONE (0) |
1890 |
+#define RADIUS_SIGNAL_SELF_HUP (1 << 0) |
1891 |
+#define RADIUS_SIGNAL_SELF_TERM (1 << 1) |
1892 |
+#define RADIUS_SIGNAL_SELF_EXIT (1 << 2) |
1893 |
+#define RADIUS_SIGNAL_SELF_DETAIL (1 << 3) |
1894 |
+#define RADIUS_SIGNAL_SELF_NEW_FD (1 << 4) |
1895 |
+#define RADIUS_SIGNAL_SELF_MAX (1 << 5) |
1896 |
+ |
1897 |
+ |
1898 |
+/* |
1899 |
+ * Function prototypes. |
1900 |
+ */ |
1901 |
+ |
1902 |
+/* acct.c */ |
1903 |
+int rad_accounting(REQUEST *); |
1904 |
+ |
1905 |
+/* session.c */ |
1906 |
+int rad_check_ts(uint32_t nasaddr, unsigned int port, const char *user, |
1907 |
+ const char *sessionid); |
1908 |
+int session_zap(REQUEST *request, uint32_t nasaddr, |
1909 |
+ unsigned int port, const char *user, |
1910 |
+ const char *sessionid, uint32_t cliaddr, |
1911 |
+ char proto,int session_time); |
1912 |
+ |
1913 |
+/* radiusd.c */ |
1914 |
+#undef debug_pair |
1915 |
+void debug_pair(VALUE_PAIR *); |
1916 |
+void debug_pair_list(VALUE_PAIR *); |
1917 |
+int log_err (char *); |
1918 |
+ |
1919 |
+/* util.c */ |
1920 |
+void (*reset_signal(int signo, void (*func)(int)))(int); |
1921 |
+void request_free(REQUEST **request); |
1922 |
+int rad_mkdir(char *directory, int mode); |
1923 |
+int rad_checkfilename(const char *filename); |
1924 |
+void *rad_malloc(size_t size); /* calls exit(1) on error! */ |
1925 |
+REQUEST *request_alloc(void); |
1926 |
+REQUEST *request_alloc_fake(REQUEST *oldreq); |
1927 |
+REQUEST *request_alloc_coa(REQUEST *request); |
1928 |
+int request_data_add(REQUEST *request, |
1929 |
+ void *unique_ptr, int unique_int, |
1930 |
+ void *opaque, void (*free_opaque)(void *)); |
1931 |
+void *request_data_get(REQUEST *request, |
1932 |
+ void *unique_ptr, int unique_int); |
1933 |
+void *request_data_reference(REQUEST *request, |
1934 |
+ void *unique_ptr, int unique_int); |
1935 |
+int rad_copy_string(char *dst, const char *src); |
1936 |
+int rad_copy_variable(char *dst, const char *from); |
1937 |
+ |
1938 |
+/* client.c */ |
1939 |
+RADCLIENT_LIST *clients_init(void); |
1940 |
+void clients_free(RADCLIENT_LIST *clients); |
1941 |
+RADCLIENT_LIST *clients_parse_section(CONF_SECTION *section); |
1942 |
+void client_free(RADCLIENT *client); |
1943 |
+int client_add(RADCLIENT_LIST *clients, RADCLIENT *client); |
1944 |
+#ifdef WITH_DYNAMIC_CLIENTS |
1945 |
+void client_delete(RADCLIENT_LIST *clients, RADCLIENT *client); |
1946 |
+RADCLIENT *client_create(RADCLIENT_LIST *clients, REQUEST *request); |
1947 |
+#endif |
1948 |
+RADCLIENT *client_find(const RADCLIENT_LIST *clients, |
1949 |
+ const fr_ipaddr_t *ipaddr); |
1950 |
+RADCLIENT *client_findbynumber(const RADCLIENT_LIST *clients, |
1951 |
+ int number); |
1952 |
+RADCLIENT *client_find_old(const fr_ipaddr_t *ipaddr); |
1953 |
+int client_validate(RADCLIENT_LIST *clients, RADCLIENT *master, |
1954 |
+ RADCLIENT *c); |
1955 |
+RADCLIENT *client_read(const char *filename, int in_server, int flag); |
1956 |
+ |
1957 |
+ |
1958 |
+/* files.c */ |
1959 |
+int pairlist_read(const char *file, PAIR_LIST **list, int complain); |
1960 |
+void pairlist_free(PAIR_LIST **); |
1961 |
+ |
1962 |
+/* version.c */ |
1963 |
+void version(void); |
1964 |
+ |
1965 |
+/* log.c */ |
1966 |
+int vradlog(int, const char *, va_list ap); |
1967 |
+int radlog(int, const char *, ...) |
1968 |
+#ifdef __GNUC__ |
1969 |
+ __attribute__ ((format (printf, 2, 3))) |
1970 |
+#endif |
1971 |
+; |
1972 |
+int log_debug(const char *, ...) |
1973 |
+#ifdef __GNUC__ |
1974 |
+ __attribute__ ((format (printf, 1, 2))) |
1975 |
+#endif |
1976 |
+; |
1977 |
+void vp_listdebug(VALUE_PAIR *vp); |
1978 |
+void radlog_request(int lvl, int priority, REQUEST *request, const char *msg, ...) |
1979 |
+#ifdef __GNUC__ |
1980 |
+ __attribute__ ((format (printf, 4, 5))) |
1981 |
+#endif |
1982 |
+; |
1983 |
+ |
1984 |
+/* auth.c */ |
1985 |
+char *auth_name(char *buf, size_t buflen, REQUEST *request, int do_cli); |
1986 |
+int rad_authenticate (REQUEST *); |
1987 |
+int rad_postauth(REQUEST *); |
1988 |
+ |
1989 |
+/* exec.c */ |
1990 |
+int radius_exec_program(const char *, REQUEST *, int, |
1991 |
+ char *user_msg, int msg_len, |
1992 |
+ VALUE_PAIR *input_pairs, |
1993 |
+ VALUE_PAIR **output_pairs, |
1994 |
+ int shell_escape); |
1995 |
+ |
1996 |
+/* timestr.c */ |
1997 |
+int timestr_match(char *, time_t); |
1998 |
+ |
1999 |
+/* valuepair.c */ |
2000 |
+int paircompare_register(int attr, int otherattr, |
2001 |
+ RAD_COMPARE_FUNC func, |
2002 |
+ void *instance); |
2003 |
+void paircompare_unregister(int attr, RAD_COMPARE_FUNC func); |
2004 |
+int paircompare(REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check, |
2005 |
+ VALUE_PAIR **reply); |
2006 |
+void pairxlatmove(REQUEST *, VALUE_PAIR **to, VALUE_PAIR **from); |
2007 |
+int radius_compare_vps(REQUEST *request, VALUE_PAIR *check, VALUE_PAIR *vp); |
2008 |
+int radius_callback_compare(REQUEST *req, VALUE_PAIR *request, |
2009 |
+ VALUE_PAIR *check, VALUE_PAIR *check_pairs, |
2010 |
+ VALUE_PAIR **reply_pairs); |
2011 |
+int radius_find_compare(int attribute); |
2012 |
+VALUE_PAIR *radius_paircreate(REQUEST *request, VALUE_PAIR **vps, |
2013 |
+ int attribute, int type); |
2014 |
+VALUE_PAIR *radius_pairmake(REQUEST *request, VALUE_PAIR **vps, |
2015 |
+ const char *attribute, const char *value, |
2016 |
+ int operator); |
2017 |
+ |
2018 |
+/* xlat.c */ |
2019 |
+typedef size_t (*RADIUS_ESCAPE_STRING)(char *out, size_t outlen, const char *in); |
2020 |
+ |
2021 |
+int radius_xlat(char * out, int outlen, const char *fmt, |
2022 |
+ REQUEST * request, RADIUS_ESCAPE_STRING func); |
2023 |
+typedef size_t (*RAD_XLAT_FUNC)(void *instance, REQUEST *, char *, char *, size_t, RADIUS_ESCAPE_STRING func); |
2024 |
+int xlat_register(const char *module, RAD_XLAT_FUNC func, |
2025 |
+ void *instance); |
2026 |
+void xlat_unregister(const char *module, RAD_XLAT_FUNC func); |
2027 |
+void xlat_free(void); |
2028 |
+ |
2029 |
+/* threads.c */ |
2030 |
+extern int thread_pool_init(CONF_SECTION *cs, int *spawn_flag); |
2031 |
+extern int thread_pool_addrequest(REQUEST *, RAD_REQUEST_FUNP); |
2032 |
+extern pid_t rad_fork(void); |
2033 |
+extern pid_t rad_waitpid(pid_t pid, int *status); |
2034 |
+extern int total_active_threads(void); |
2035 |
+extern void thread_pool_lock(void); |
2036 |
+extern void thread_pool_unlock(void); |
2037 |
+extern void thread_pool_queue_stats(int *array); |
2038 |
+ |
2039 |
+#ifndef HAVE_PTHREAD_H |
2040 |
+#define rad_fork(n) fork() |
2041 |
+#define rad_waitpid(a,b) waitpid(a,b, 0) |
2042 |
+#endif |
2043 |
+ |
2044 |
+/* mainconfig.c */ |
2045 |
+/* Define a global config structure */ |
2046 |
+extern struct main_config_t mainconfig; |
2047 |
+ |
2048 |
+int read_mainconfig(int reload); |
2049 |
+int free_mainconfig(void); |
2050 |
+void hup_mainconfig(void); |
2051 |
+void fr_suid_down(void); |
2052 |
+void fr_suid_up(void); |
2053 |
+void fr_suid_down_permanent(void); |
2054 |
+ |
2055 |
+/* listen.c */ |
2056 |
+void listen_free(rad_listen_t **head); |
2057 |
+int listen_init(CONF_SECTION *cs, rad_listen_t **head); |
2058 |
+rad_listen_t *proxy_new_listener(fr_ipaddr_t *ipaddr, int exists); |
2059 |
+RADCLIENT *client_listener_find(const rad_listen_t *listener, |
2060 |
+ const fr_ipaddr_t *ipaddr, int src_port); |
2061 |
+#ifdef WITH_STATS |
2062 |
+RADCLIENT_LIST *listener_find_client_list(const fr_ipaddr_t *ipaddr, |
2063 |
+ int port); |
2064 |
+rad_listen_t *listener_find_byipaddr(const fr_ipaddr_t *ipaddr, int port); |
2065 |
+#endif |
2066 |
+ |
2067 |
+/* event.c */ |
2068 |
+int radius_event_init(CONF_SECTION *cs, int spawn_flag); |
2069 |
+void radius_event_free(void); |
2070 |
+int radius_event_process(void); |
2071 |
+void radius_handle_request(REQUEST *request, RAD_REQUEST_FUNP fun); |
2072 |
+int received_request(rad_listen_t *listener, |
2073 |
+ RADIUS_PACKET *packet, REQUEST **prequest, |
2074 |
+ RADCLIENT *client); |
2075 |
+REQUEST *received_proxy_response(RADIUS_PACKET *packet); |
2076 |
+void event_new_fd(rad_listen_t *listener); |
2077 |
+ |
2078 |
+/* evaluate.c */ |
2079 |
+int radius_evaluate_condition(REQUEST *request, int modreturn, int depth, |
2080 |
+ const char **ptr, int evaluate_it, int *presult); |
2081 |
+int radius_update_attrlist(REQUEST *request, CONF_SECTION *cs, |
2082 |
+ VALUE_PAIR *input_vps, const char *name); |
2083 |
+void radius_pairmove(REQUEST *request, VALUE_PAIR **to, VALUE_PAIR *from); |
2084 |
+#endif /*RADIUSD_H*/ |
2085 |
diff -Naur freeradius-server-2.1.10.orig/src/lib/Makefile freeradius-server-2.1.10/src/lib/Makefile |
2086 |
--- freeradius-server-2.1.10.orig/src/lib/Makefile 2010-09-28 13:03:56.000000000 +0200 |
2087 |
+++ freeradius-server-2.1.10/src/lib/Makefile 2011-02-09 17:42:53.000000000 +0100 |
2088 |
@@ -42,7 +42,7 @@ |
2089 |
|
2090 |
$(TARGET).la: $(LT_OBJS) |
2091 |
$(LIBTOOL) --mode=link $(CC) -release $(RADIUSD_VERSION) \ |
2092 |
- $(LDFLAGS) $(LINK_MODE) -o $@ -rpath $(libdir) $^ |
2093 |
+ $(LDFLAGS) $(LINK_MODE) -o $@ -rpath $(libdir) $^ $(LIBS) |
2094 |
|
2095 |
$(LT_OBJS): $(INCLUDES) |
2096 |
|
2097 |
diff -Naur freeradius-server-2.1.10.orig/src/lib/Makefile.orig freeradius-server-2.1.10/src/lib/Makefile.orig |
2098 |
--- freeradius-server-2.1.10.orig/src/lib/Makefile.orig 1970-01-01 01:00:00.000000000 +0100 |
2099 |
+++ freeradius-server-2.1.10/src/lib/Makefile.orig 2010-09-28 13:03:56.000000000 +0200 |
2100 |
@@ -0,0 +1,60 @@ |
2101 |
+# |
2102 |
+# Makefile |
2103 |
+# |
2104 |
+# Version: $Id: freeradius-2.1.10-qafixes.patch,v 1.1 2011/05/26 15:31:45 hwoarang Exp $ |
2105 |
+# |
2106 |
+ |
2107 |
+include ../../Make.inc |
2108 |
+ |
2109 |
+SRCS = dict.c filters.c hash.c hmac.c hmacsha1.c isaac.c log.c \ |
2110 |
+ misc.c missing.c md4.c md5.c print.c radius.c rbtree.c \ |
2111 |
+ sha1.c snprintf.c strlcat.c strlcpy.c token.c udpfromto.c \ |
2112 |
+ valuepair.c fifo.c packet.c event.c getaddrinfo.c vqp.c \ |
2113 |
+ heap.c dhcp.c |
2114 |
+ |
2115 |
+LT_OBJS = $(SRCS:.c=.lo) |
2116 |
+ |
2117 |
+INCLUDES = ../include/radius.h ../include/libradius.h \ |
2118 |
+ ../include/missing.h ../include/autoconf.h \ |
2119 |
+ ../include/ident.h |
2120 |
+ |
2121 |
+CFLAGS += -D_LIBRADIUS -I$(top_builddir)/src |
2122 |
+ |
2123 |
+# if you have problems with things that need SHA1-HMAC, this will |
2124 |
+# dump the key and the input to the hash so you can compare to what |
2125 |
+# the other end is doing. |
2126 |
+#CFLAGS += -DHMAC_SHA1_DATA_PROBLEMS |
2127 |
+ |
2128 |
+ifeq ($(USE_SHARED_LIBS),yes) |
2129 |
+LINK_MODE = -export-dynamic |
2130 |
+else |
2131 |
+LINK_MODE = -static |
2132 |
+endif |
2133 |
+ |
2134 |
+TARGET = $(LIBPREFIX)freeradius-radius |
2135 |
+ |
2136 |
+# Define new rule for libtool objects |
2137 |
+%.lo : %.c |
2138 |
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $< |
2139 |
+ |
2140 |
+.PHONY: all clean install reconfig |
2141 |
+all: $(TARGET).la |
2142 |
+ |
2143 |
+$(TARGET).la: $(LT_OBJS) |
2144 |
+ $(LIBTOOL) --mode=link $(CC) -release $(RADIUSD_VERSION) \ |
2145 |
+ $(LDFLAGS) $(LINK_MODE) -o $@ -rpath $(libdir) $^ |
2146 |
+ |
2147 |
+$(LT_OBJS): $(INCLUDES) |
2148 |
+ |
2149 |
+clean: |
2150 |
+ rm -f *.o *.lo $(TARGET).la |
2151 |
+ rm -rf .libs |
2152 |
+ |
2153 |
+install: all |
2154 |
+ $(INSTALL) -d -m 755 $(R)$(libdir) |
2155 |
+ $(LIBTOOL) --mode=install $(INSTALL) -c $(TARGET).la \ |
2156 |
+ $(R)$(libdir)/$(TARGET).la |
2157 |
+ rm -f $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION).la; |
2158 |
+ ln -s $(TARGET).la $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION).la |
2159 |
+ |
2160 |
+reconfig: |
2161 |
diff -Naur freeradius-server-2.1.10.orig/src/main/listen.c freeradius-server-2.1.10/src/main/listen.c |
2162 |
--- freeradius-server-2.1.10.orig/src/main/listen.c 2010-09-28 13:03:56.000000000 +0200 |
2163 |
+++ freeradius-server-2.1.10/src/main/listen.c 2011-02-09 17:42:53.000000000 +0100 |
2164 |
@@ -49,6 +49,9 @@ |
2165 |
#include <fcntl.h> |
2166 |
#endif |
2167 |
|
2168 |
+#ifdef WITH_UDPFROMTO |
2169 |
+#include <freeradius-devel/udpfromto.h> |
2170 |
+#endif |
2171 |
|
2172 |
/* |
2173 |
* We'll use this below. |
2174 |
diff -Naur freeradius-server-2.1.10.orig/src/modules/rlm_passwd/rlm_passwd.c freeradius-server-2.1.10/src/modules/rlm_passwd/rlm_passwd.c |
2175 |
--- freeradius-server-2.1.10.orig/src/modules/rlm_passwd/rlm_passwd.c 2010-09-28 13:03:56.000000000 +0200 |
2176 |
+++ freeradius-server-2.1.10/src/modules/rlm_passwd/rlm_passwd.c 2011-02-09 17:42:53.000000000 +0100 |
2177 |
@@ -247,8 +247,7 @@ |
2178 |
|
2179 |
static struct mypasswd * get_next(char *name, struct hashtable *ht) |
2180 |
{ |
2181 |
-#define passwd ((struct mypasswd *) ht->buffer) |
2182 |
- struct mypasswd * hashentry; |
2183 |
+ struct mypasswd * hashentry, * passwd; |
2184 |
char buffer[1024]; |
2185 |
int len; |
2186 |
char *list, *nextlist; |
2187 |
@@ -267,6 +266,7 @@ |
2188 |
} |
2189 |
/* printf("try to find in file\n"); */ |
2190 |
if (!ht->fp) return NULL; |
2191 |
+ passwd = (struct mypasswd *) ht->buffer; |
2192 |
while (fgets(buffer, 1024,ht->fp)) { |
2193 |
if(*buffer && *buffer!='\n' && (len = string_to_entry(buffer, ht->nfields, ht->delimiter, passwd, sizeof(ht->buffer)-1)) && |
2194 |
(!ht->ignorenis || (*buffer !='-' && *buffer != '+') ) ){ |
2195 |
@@ -288,7 +288,6 @@ |
2196 |
fclose(ht->fp); |
2197 |
ht->fp = NULL; |
2198 |
return NULL; |
2199 |
-#undef passwd |
2200 |
} |
2201 |
|
2202 |
static struct mypasswd * get_pw_nam(char * name, struct hashtable* ht) |