[OpenAFS-devel] Re: x86_64 aklog segmentation fault

Miles Davis miles@cs.stanford.edu
Tue, 18 Jan 2005 14:12:01 -0800


--98e8jtXdkpgskNou
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Sat, Jan 15, 2005 at 10:18:31AM +0100, Stephan Wiesand wrote:
> Dear Enrico,
> 
> this is a known "feature" of the krb5 packages - see the thread on 
> scientific-linux-users titled "krb5/afs on SL 3.0.2 (x86_64) ?".
> 
> Workarounds I've found so far:
> 
>    - the 32bit aklog binary works
> 
>    - rebuilding krb5 with patch37 enabled makes afslog work,
>      but neither aklog nor pam_krb5afs.so
> 
>    - SuSE 9.0/amd64 ships with a pam_krb5afs.so that works and can
>      be used on SL3/amd64 if you pull in the needed shared libs
>      (heimdal, ...) as well, but there are issues with at least the
>      configuration (heimdal slightly incomatible with MIT) and
>      ticket lieftimes
> 
> If anyone comes up with something better, I'd be glad to hear about it.

Seems to work fine for me if you link to the 64 bit libraries (patch 1) 
and pass NULLs instead of 0s to krb5_build_principal(). Patched version 
works for me on i386, x86_64.

I'm probably doing something stupid, since I don't write C very often. If 
somebody finds that's the case, please do let me know. :)

-- 
// Miles Davis - miles@cs.stanford.edu - http://www.cs.stanford.edu/~miles
// Computer Science Department - Computer Facilities
// Stanford University

--98e8jtXdkpgskNou
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="openafs-krb5-x86_64.patch"

--- openafs-krb5-2.0/src/configure.in.orig	2005-01-18 11:39:57.429499458 -0800
+++ openafs-krb5-2.0/src/configure.in	2005-01-18 11:49:31.952912889 -0800
@@ -89,22 +89,6 @@
 	AC_MSG_ERROR([Unable to find gethostbyname function])
 fi
 LIBS="$save_LIBS $NETLIBS"
-AC_CHECK_FUNC(res_search, have_res_search=yes, have_res_search=no)
-
-if test "$have_res_search" = no; then
-	for lib in dns nsl resolv
-	do
-		if test "$have_res_search" != yes; then
-			AC_CHECK_LIB(${lib}, res_search,
-				     [have_res_search=yes
-				      NETLIBS="$NETLIBS -l${lib}"])
-		fi
-	done
-fi
-if test "$have_res_search" = no; then
-	AC_MSG_ERROR([Unable to find res_search function])
-fi
-LIBS="$save_LIBS"
 dnl
 dnl Optional support for AFS
 dnl
@@ -112,7 +96,7 @@
 [  --with-afs=AFSDIR       use preinstalled AFS library tree], ,with_afs=/usr/afsws)dnl
 if test $with_afs != no; then
 	AC_DEFINE(AFS)
-	AFSLIBS="-L$with_afs/lib -L$with_afs/lib/afs -lsys -lprot -lubik -lauth -lrxkad -lrx -llwp -ldes -lsys $with_afs/lib/afs/util.a"
+	AFSLIBS="-L$with_afs/lib64 -L$with_afs/lib64/afs -lsys -lprot -lubik -lauth -lrxkad -lrx -llwp -ldes -lsys $with_afs/lib64/afs/util.a"
 	CPPFLAGS="$CPPFLAGS -I$with_afs/include"
 else
 	AC_MSG_ERROR([Cannot build without AFS tree])
@@ -122,10 +106,10 @@
 dnl See if we have getDirPath in util.a
 dnl
 AKLOG_EXTRA_OBJ=
-AC_CACHE_CHECK([for getDirPath in ${with_afs}/lib/afs/util.a],
+AC_CACHE_CHECK([for getDirPath in ${with_afs}/lib64/afs/util.a],
 afs_cv_func_getDirPath,
 [ac_save_LIBS="$LIBS"
-LIBS="$LIBS $with_afs/lib/afs/util.a"
+LIBS="$LIBS $with_afs/lib64/afs/util.a"
 AC_TRY_LINK_FUNC(getDirPath, afs_cv_func_getDirPath=yes, afs_cv_func_getDirPath=no)
 LIBS="$ac_save_LIBS"])
 if test "x$afs_cv_func_getDirPath" = "xyes"; then
@@ -170,14 +154,14 @@
 AC_ARG_WITH(krb5-src,
 [  --with-krb5-src=DIR     Location of Kerberos source tree],
 [	EXTRA_INC="$EXTRA_INC -I$with_krb5_src/include -I$with_krb5_src/include/krb5"
-	if test -r $with_krb5_src/lib/libdb.a ; then
-		KADM_LIBS=`echo $KADM_LIBS | sed -e "s#-ldb#$with_krb5_src/lib/libdb.a#"`
+	if test -r $with_krb5_src/lib64/libdb.a ; then
+		KADM_LIBS=`echo $KADM_LIBS | sed -e "s#-ldb#$with_krb5_src/lib64/libdb.a#"`
 	fi])
 dnl
 AC_ARG_WITH(krb5-obj,
 [  --with-krb5-obj=DIR     Location of Kerberos build tree],
 [	EXTRA_INC="$EXTRA_INC -I$with_krb5_obj/include -I$with_krb5_obj/include/krb5"
-	KADM_LIBS=`echo $KADM_LIBS | sed -e "s#-ldb#$with_krb5_obj/lib/libdb.a#"`])
+	KADM_LIBS=`echo $KADM_LIBS | sed -e "s#-ldb#$with_krb5_obj/lib64/libdb.a#"`])
 dnl
 dnl Sigh, why is this so complicated?  Right now, just assume that 
 dnl the 524 library is always called krb524 and will be picked up by the

--98e8jtXdkpgskNou
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="openafs-krb5-x86_64_nullptr.patch"

--- openafs-krb5-2.0/src/aklog_param.c	1999-05-25 11:24:38.000000000 -0700
+++ openafs-krb5-2.0csdcf/src/aklog_param.c	2005-01-18 13:41:38.642647155 -0800
@@ -96,8 +96,8 @@
     if ((r = krb5_build_principal(context, &increds.server,
                      strlen(realm), realm,
                      name,
-           (inst && strlen(inst)) ? inst : 0,
-                     0))) {
+           (inst && strlen(inst)) ? inst : NULL,
+                     NULL))) {
         return((int)r);
     }
 

--98e8jtXdkpgskNou--