---- net-snmp-5.0.8/configure.in.orig 2003-03-06 07:41:13.000000000 +0100
-+++ net-snmp-5.0.8/configure.in 2003-05-17 12:55:45.000000000 +0200
-@@ -7,8 +7,8 @@
- dnl
- dnl save the configure arguments
- dnl
--AC_DEFINE_UNQUOTED(CONFIGURE_OPTIONS,"\"$ac_configure_args\"")
--CONFIGURE_OPTIONS="\"$ac_configure_args\""
-+AC_DEFINE_UNQUOTED(CONFIGURE_OPTIONS,"$ac_configure_args")
-+CONFIGURE_OPTIONS="$ac_configure_args"
- AC_SUBST(CONFIGURE_OPTIONS)
-
- dnl
-@@ -554,9 +554,7 @@
- dnl get version number.
- AC_MSG_CHECKING(for net-snmp version number)
- VERSION=`grep NetSnmpVersionInfo.*= $srcdir/snmplib/snmp_version.c | sed 's/";.*//;s/.*"//;s/pre/0./;'`
--changequote(, )
--RELEASEVERSION=`echo $VERSION | sed 's/^\([0-9]\)\.\([0-9]\)/\1:\2:0/'`
--changequote([, ])
-+RELEASEVERSION=`echo $VERSION | sed ['s/^\([0-9]\)\.\([0-9]\)/\1:\2:0/']`
- AC_SUBST(VERSION)
- AC_SUBST(RELEASEVERSION)
- AC_MSG_RESULT($VERSION)
-@@ -574,10 +572,8 @@
-
- dnl system check
- AC_CANONICAL_SYSTEM
--changequote(, )
--PARTIALTARGETOS=`echo $target_os | sed 's/[-._].*//'`
-+PARTIALTARGETOS=`echo $target_os | sed ['s/[-._].*//']`
- CFLAGS="$CFLAGS -D$PARTIALTARGETOS"
--changequote([, ])
- AC_MSG_CACHE_ADD(Building for: $PARTIALTARGETOS)
-
- dnl
-@@ -585,7 +581,6 @@
- dnl
-
- AC_MSG_CHECKING(for system include file)
--changequote(, )
- filebase=$target_os
- dnl ignore binary format indication
- filebase=`echo $filebase | sed 's/elf//'`
-@@ -595,9 +590,9 @@
- while test "x$filebase" != "x$last" -a ! -f $srcdir/include/net-snmp/system/$filebase.h
+--- net-snmp-5.4.1/configure.ac 2007-09-08 16:13:11.531748373 +0200
++++ net-snmp-5.4.1-ac/configure.ac 2007-11-14 20:58:16.361317122 +0200
+@@ -1726,16 +1726,18 @@
+ rebuilt_new_with_security=
+ already_checked_krb5=no
+
++KRB5_LIBS=
++AC_SUBST(KRB5_LIBS)
+ for sec in $new_with_security
do
- last=$filebase
-- filebase=`echo $filebase | sed 's/[-._][^-._]*$//'`
-+ filebase=`echo $filebase | sed ['s/[-._][^-._]*$//']`
- if test "x$filebase" = "x$last"; then
-- filebase=`echo $filebase | sed 's/[0-9]*$//'`
-+ filebase=`echo $filebase | sed ['s/[0-9]*$//']`
- fi
- done
-
-@@ -606,19 +601,17 @@
- fi
- ac_cv_SYSTEM_INCLUDE_FILE="net-snmp/system/$filebase.h"
-
--changequote([, ])
- AC_MSG_RESULT($ac_cv_SYSTEM_INCLUDE_FILE)
- AC_DEFINE_UNQUOTED(SYSTEM_INCLUDE_FILE, "$ac_cv_SYSTEM_INCLUDE_FILE")
-
- dnl second part, the CPU type.
-
- AC_MSG_CHECKING(for machine-type include file)
--changequote(, )
- filebase=$target_cpu
- while test "x$filebase" != "x$last" -a ! -f $srcdir/include/net-snmp/machine/$filebase.h
- do
- last=$filebase
-- filebase=`echo $filebase | sed 's/[-._][^-._]*$//'`
-+ filebase=`echo $filebase | sed ['s/[-._][^-._]*$//']`
- done
-
- if test "x$filebase" = "x$last"; then
-@@ -626,7 +619,6 @@
- fi
- ac_cv_MACHINE_INCLUDE_FILE="net-snmp/machine/$filebase.h"
-
--changequote([, ])
- AC_MSG_RESULT($ac_cv_MACHINE_INCLUDE_FILE)
- AC_DEFINE_UNQUOTED(MACHINE_INCLUDE_FILE, "$ac_cv_MACHINE_INCLUDE_FILE")
-
-@@ -737,7 +729,7 @@
- for i in v6d toshiba kame inria zeta linux-glibc linux-inet6; do
- case $i in
- v6d)
-- AC_EGREP_CPP(yes, [dnl
-+ AC_EGREP_CPP(yes, [
- #include </usr/local/v6/include/sys/types.h>
- #ifdef __V6D__
- yes
-@@ -747,7 +739,7 @@
- CFLAGS="-I/usr/local/v6/include $CFLAGS"])
- ;;
- toshiba)
-- AC_EGREP_CPP(yes, [dnl
-+ AC_EGREP_CPP(yes, [
- #include <sys/param.h>
- #ifdef _TOSHIBA_INET6
- yes
-@@ -757,7 +749,7 @@
- CFLAGS="-DINET6 $CFLAGS"])
- ;;
- kame)
-- AC_EGREP_CPP(yes, [dnl
-+ AC_EGREP_CPP(yes, [
- #include <netinet/in.h>
- #ifdef __KAME__
- yes
-@@ -768,7 +760,7 @@
- CFLAGS="-DINET6 $CFLAGS"])
- ;;
- inria)
-- AC_EGREP_CPP(yes, [dnl
-+ AC_EGREP_CPP(yes, [
- #include <netinet/in.h>
- #ifdef IPV6_INRIA_VERSION
- yes
-@@ -780,7 +772,7 @@
- CFLAGS="-DINET6 $CFLAGS"])
- ;;
- zeta)
-- AC_EGREP_CPP(yes, [dnl
-+ AC_EGREP_CPP(yes, [
- #include <sys/param.h>
- #ifdef _ZETA_MINAMI_INET6
- A
-@@ -791,7 +783,7 @@
- CFLAGS="-DINET6 $CFLAGS"])
- ;;
- linux-glibc)
-- AC_EGREP_CPP(yes, [dnl
-+ AC_EGREP_CPP(yes, [
- #include <features.h>
- #if defined(__GLIBC__) && ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC_ > 2))
- yes
-@@ -840,7 +832,6 @@
-
- if test "x$with_res_locks" = "xyes"; then
- AC_DEFINE(NS_REENTRANT)
--EOF
-
- case $target_os in
-
-@@ -1049,7 +1040,6 @@
- dnl Do hairy agent module processing.
- dnl
- AC_MSG_CHECKING(for and configuring mib modules to use)
--changequote(, )
-
- mibdir="agent/mibgroup"
- module_list=""
-@@ -1096,13 +1086,11 @@
+ if test "x$sec" = "xksm" -a "xyes" = "x$already_checked_krb5"; then
+ continue
fi
- done
-
--changequote([, ])
- AC_MSG_RESULT($new_module_list.)
- AC_MSG_CACHE_ADD(Agent MIB code: $new_module_list)
-
- AC_MSG_CHECKING(for and configuring mib modules pieces to use)
- FD=AC_FD_MSG
--changequote(, )
-
- while test "x$new_module_list" != "x"; do
- for i in $new_module_list
-@@ -1127,13 +1115,9 @@
- for j in $new_list
- do
- if test ! -f $srcdir/$mibdir/$j.h; then
-- changequote([, ])
- AC_MSG_ERROR(mib module "$i" requires module "$j" but $j.h or $j.c could not be found in $srcdir/$mibdir)
-- changequote(, )
- elif echo " $new_with_out_mib_modules " | grep " $j " > /dev/null; then
-- changequote([, ])
- AC_MSG_WARN(mib module "$i" requires module "$j" but you told me to compile without it)
-- changequote(, )
- elif echo " $module_list $new_list_two $new_module_list " | grep " $j " > /dev/null; then
- :
- else
-@@ -1158,9 +1142,7 @@
- done
- fi
- else
-- changequote([, ])
- AC_MSG_ERROR(module files $i.h or $i.c could not be found in $srcdir/$mibdir)
-- changequote(, )
- fi
- module_list="$module_list $i"
- echo '#include "'"mibgroup/$i.h"'"' >> $mibdir/mib_module_includes.h
-@@ -1177,18 +1159,16 @@
- fi
+- already_checked_krb5=yes
+
+ if test x$sec != xksm; then
+ rebuilt_new_with_security="$rebuilt_new_with_security $sec"
+ else
++ already_checked_krb5=yes
+ if test no = $trykrb5; then
+ AC_MSG_NOTICE([configured not to use krb5. disabling ksm])
+ continue
+@@ -1745,7 +1747,7 @@
+
+ if test no != $krb5_config; then
+ CPPFLAGS="$CPPFLAGS `$krb5_config --cflags`"
+- LIBS="$LIBS `$krb5_config --libs`"
++ KRB5_LIBS="`$krb5_config --libs`"
+ elif test $krb5path != no; then
+ AC_ADD_SEARCH_PATH($krb5path)
+ else
+@@ -1782,29 +1784,35 @@
+ if test $ac_cv_heimdal = yes; then
+ AC_DEFINE(NETSNMP_USE_KERBEROS_HEIMDAL)
+ if test no = $krb5_config; then
+- LIBS="$LIBS -lkrb5 -lasn1 -lcom_err -lroken"
++ KRB5_LIBS="-lkrb5 -lasn1 -lcom_err -lroken"
fi
- if test "x`echo $i | sed 's/\///g;'`" != "x$i"; then
-- mnd=`echo $i | sed 's/\/[^/]*$//;'`
-+ mnd=`echo $i | sed ['s/\/[^/]*$//;']`
- if test ! -d ./$mibdir/$mnd; then
- module_directories="$module_directories ./$mibdir/$mnd"
- fi
- fi
- if grep config_load_mib $srcdir/$mibdir/$i.h > /dev/null 2>&1; then
-- changequote([, ])
- AC_MSG_WARN(mib module "$i" uses the "config_load_mib" directive, which is no longer supported. It probably won't work.)
-- changequote(, )
- fi
-- grep config_parse_dot_conf $srcdir/$mibdir/$i.h | sed 's@.*config_parse_dot_conf(\([^)]*\), *\([^),]*\), *\([^),]*\), *\([^),]*\)).*@register_config_handler("snmpd",\1, \2, \3, \4);@' >> $mibdir/mib_module_dot_conf.h
-- sym="`echo ${i} | sed 's/[^a-zA-Z0-9_]/_/g' | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
-+ grep config_parse_dot_conf $srcdir/$mibdir/$i.h | sed ['s@.*config_parse_dot_conf(\([^)]*\), *\([^),]*\), *\([^),]*\), *\([^),]*\)).*@register_config_handler("snmpd",\1, \2, \3, \4);@'] >> $mibdir/mib_module_dot_conf.h
-+ sym="`echo ${i} | sed ['s/[^a-zA-Z0-9_]/_/g'] | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
- echo "/* Define if compiling with the ${i} module files. */" >> include/net-snmp/agent/mib_module_config.h
- echo "#define USING_${sym}_MODULE 1" >> include/net-snmp/agent/mib_module_config.h
- echo " " >> include/net-snmp/agent/mib_module_config.h
-@@ -1198,12 +1178,11 @@
- new_module_list="$new_list_two"
- new_list_two=""
- done
--module_list_o=`echo "$module_list_code " | sed 's/\([^ ]\) /\1.o /g'`
--module_list_lo=`echo "$module_list_code " | sed 's/\([^ ]\) /\1.lo /g'`
--module_list_c=`echo "$module_list_code " | sed 's/\([^ ]\) /\1.c /g'`
--mibgroup_list_o=`echo " $module_list_o " | sed 's@ \([^ ]*\)\.o@ mibgroup/\1.o @g'`
--mibgroup_list_lo=`echo " $module_list_lo " | sed 's@ \([^ ]*\)\.lo@ mibgroup/\1.lo @g'`
--changequote([, ])
-+module_list_o=`echo "$module_list_code " | sed ['s/\([^ ]\) /\1.o /g']`
-+module_list_lo=`echo "$module_list_code " | sed ['s/\([^ ]\) /\1.lo /g']`
-+module_list_c=`echo "$module_list_code " | sed ['s/\([^ ]\) /\1.c /g']`
-+mibgroup_list_o=`echo " $module_list_o " | sed ['s@ \([^ ]*\)\.o@ mibgroup/\1.o @g']`
-+mibgroup_list_lo=`echo " $module_list_lo " | sed ['s@ \([^ ]*\)\.lo@ mibgroup/\1.lo @g']`
- MODULE_LIST=$module_list_code
- AC_SUBST(MODULE_LIST)
- AC_SUBST(module_list_c)
-@@ -1361,8 +1340,8 @@
+ elif test no = $krb5_config; then
+- LIBS="$LIBS -lkrb5 -lcom_err"
++ KRB5_LIBS="-lkrb5 -lcom_err"
fi
- _libs=${LIBS}
-- AC_CHECK_HEADER(tcpd.h, ,
-- AC_MSG_ERROR(Asked to use libwrap but I couldn't find tcpd.h.))
-+ AC_CHECK_HEADER(tcpd.h, ,[
-+ AC_MSG_ERROR(Asked to use libwrap but I couldn't find tcpd.h.)])
-
- LIBS="$LIBS -lwrap"
- AC_MSG_CHECKING(for TCP wrappers library -lwrap)
-@@ -1378,21 +1357,21 @@
- [
- AC_MSG_RESULT(no)
- dnl Linux RedHat 6.1 won't link libwrap without libnsl
-- AC_CHECK_FUNC(yp_get_default_domain, ,
-- AC_CHECK_LIB(nsl, yp_get_default_domain))
-+ AC_CHECK_FUNC(yp_get_default_domain, ,[
-+ AC_CHECK_LIB(nsl, yp_get_default_domain)])
- AC_MSG_CHECKING(for TCP wrappers library -lwrap linked with -lnsl)
- AC_TRY_LINK([#include <tcpd.h>
- int allow_severity = 0;
- int deny_severity = 0;
-- ],[hosts_access((void *)0)],
-+ ],[hosts_access((void *)0)],[
-
- AC_MSG_RESULT(yes)
- AC_DEFINE(USE_LIBWRAP)
- test "$with_libwrap" != no -a "$with_libwrap" != yes && WRAPLIBS="-L$with_libwrap/lib"
-- WRAPLIBS="$WRAPLIBS -lwrap -lnsl",
-+ WRAPLIBS="$WRAPLIBS -lwrap -lnsl"],[
-
- AC_MSG_RESULT(no)
-- AC_MSG_ERROR(Asked to use libwrap but I couldn't find it.))
-+ AC_MSG_ERROR(Asked to use libwrap but I couldn't find it.)])
- ])
- CPPFLAGS=${_cppflags}
- LDFLAGS=${_ldflags}
-@@ -1649,17 +1628,15 @@
- dnl so we do it by hand.
- AC_MSG_CHECKING(for socklen_t)
- AC_CACHE_VAL(ac_cv_type_$1,
--[AC_EGREP_CPP(dnl
--changequote(<<,>>)dnl
--<<socklen_t[^a-zA-Z_0-9]>>dnl
--changequote([,]), [#include <sys/types.h>
-+[AC_EGREP_CPP([socklen_t[^a-zA-Z_0-9]]
-+, [#include <sys/types.h>
- #if STDC_HEADERS
- #include <stdlib.h>
- #include <stddef.h>
- #endif
- #ifdef HAVE_SYS_SOCKET_H
- #include <sys/socket.h>
--#endif], ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no)])dnl
-+#endif], [ac_cv_type_socklen_t=yes], [ac_cv_type_socklen_t=no])])
-
- AC_MSG_RESULT($ac_cv_type_socklen_t)
- if test $ac_cv_type_socklen_t = yes; then
-@@ -1669,10 +1646,8 @@
- dnl AIX keeps in_addr_t in /usr/include/netinet/in.h
- AC_MSG_CHECKING(for in_addr_t)
- AC_CACHE_VAL(ac_cv_type_$1,
--[AC_EGREP_CPP(dnl
--changequote(<<,>>)dnl
--<<in_addr_t[^a-zA-Z_0-9]>>dnl
--changequote([,]), [#include <sys/types.h>
-+[AC_EGREP_CPP([in_addr_t[^a-zA-Z_0-9]]
-+, [#include <sys/types.h>
- #if STDC_HEADERS
- #include <stdlib.h>
- #include <stddef.h>
---- net-snmp-5.0.8/acconfig.h.orig 2003-02-25 19:04:04.000000000 +0100
-+++ net-snmp-5.0.8/acconfig.h 2003-05-17 12:54:27.000000000 +0200
-@@ -46,9 +46,11 @@
- #undef _REENTRANT
-
- /* debugging stuff */
--#undef SNMP_NO_DEBUGGING /* if defined, we optimize the code
-+#undef SNMP_NO_DEBUGGING
-+ /* if defined, we optimize the code
- to exclude all debugging calls. */
--#define SNMP_ALWAYS_DEBUG 0 /* Always print debugging information and
-+#define SNMP_ALWAYS_DEBUG 0
-+ /* Always print debugging information and
- ignore the -D flag passed to the cmds */
-
- /* reverse encoding BER packets is both faster and more efficient in space. */
-@@ -616,4 +616,9 @@
-
- #undef INET6
++ old_LIBS="$LIBS"
++ LIBS="$LIBS $KRB5_LIBS"
+ AC_MSG_CHECKING([to see which crypto API we need to use])
+ AC_CHECK_FUNC(krb5_c_encrypt,[
+- AC_CACHE_VAL(ac_cv_NETSNMP_USE_KERBEROS_MIT,
+- AC_CHECK_LIB(k5crypto, krb5_init_context,
+- ac_cv_NETSNMP_USE_KERBEROS_MIT=yes, ac_cv_MIT_NEW_CRYPTo=no
+- )
+- )
++ AC_CHECK_LIB(k5crypto, krb5_init_context,
++ ac_cv_MIT_NEW_CRYPTo=yes, ac_cv_MIT_NEW_CRYPTo=no
++ )
+
+- if test yes = $ac_cv_NETSNMP_USE_KERBEROS_MIT; then
+- AC_MSG_RESULT(new MIT crypto API)
++ if test yes = $ac_cv_MIT_NEW_CRYPTo; then
+ AC_DEFINE(NETSNMP_USE_KERBEROS_MIT)
++ AC_MSG_RESULT(new MIT crypto API)
+ if test no = $krb5_config; then
+- LIBS="$LIBS -lk5crypto"
++ KRB5_LIBS="$LIBS -lk5crypto"
++ else
++ CFLAGS="$CFLAGS `$krb5_config --cflags`"
++ KRB5_LIBS="$LIBS `$krb5_config --libs`"
+ fi
+ else
+- AC_MSG_RESULT(old MIT crypto API)])
++ AC_MSG_RESULT(old MIT crypto API)
+ fi
++ ])
++ LNETSNMPLIBS="$LNETSNMPLIBS $KRB5_LIBS"
++ LIBS="$old_LIBS"
+ fi
+ done
-+#ifndef NETSNMP_INLINE
-+# define NETSNMP_NO_INLINE
-+# define NETSNMP_INLINE
-+#endif
-+
- #endif /* NET_SNMP_CONFIG_H */