diff -urN samba-3.2.4.orig/source/configure samba-3.2.4/source/configure --- samba-3.2.4.orig/source/configure 2008-09-18 13:58:39.000000000 +0200 +++ samba-3.2.4/source/configure 2008-10-05 20:37:14.974295461 +0200 @@ -53863,18 +53863,175 @@ if test x"$samba_cv_WITH_AFS" != x"no" || test x"$samba_cv_WITH_FAKE_KASERVER" != x"no"; then + { echo "$as_me:$LINENO: checking for DES_pcbc_encrypt in -lcrypto" >&5 +echo $ECHO_N "checking for DES_pcbc_encrypt in -lcrypto... $ECHO_C" >&6; } +if test "${ac_cv_lib_crypto_DES_pcbc_encrypt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char DES_pcbc_encrypt (); +int +main () +{ +return DES_pcbc_encrypt (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_crypto_DES_pcbc_encrypt=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_crypto_DES_pcbc_encrypt=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_DES_pcbc_encrypt" >&5 +echo "${ECHO_T}$ac_cv_lib_crypto_DES_pcbc_encrypt" >&6; } +if test $ac_cv_lib_crypto_DES_pcbc_encrypt = yes; then + LIBS="$LIBS -lcrypto" +else + { { echo "$as_me:$LINENO: error: OpenSSL library: libcrypto ot found!" >&5 +echo "$as_me: error: OpenSSL library: libcrypto ot found!" >&2;} + { (exit 1); exit 1; }; } +fi + + # see if this box has the afs-headers in /usr/include/afs { echo "$as_me:$LINENO: checking for /usr/include/afs" >&5 echo $ECHO_N "checking for /usr/include/afs... $ECHO_C" >&6; } if test -d /usr/include/afs; then - CFLAGS="$CFLAGS -I/usr/include/afs" - CPPFLAGS="$CPPFLAGS -I/usr/include/afs" + mkdir -p ./include/afs + for f in auth.h param.h prs_fs.h stds.h venus.h afssyscalls.h; do + cp -a /usr/include/afs/$f ./include/afs/ + done + echo "#include " > ./include/afs/afs.h + cat /usr/include/afs/afs.h >> ./include/afs/afs.h + CFLAGS="$CFLAGS -Iinclude/afs" + CPPFLAGS="$CPPFLAGS -Iinclude/afs" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi + # see if this box has the afs libraries in /usr/lib/afs + { echo "$as_me:$LINENO: checking for /usr/lib/afs" >&5 +echo $ECHO_N "checking for /usr/lib/afs... $ECHO_C" >&6; } + if test -d /usr/lib/afs; then + mkdir -p ./bin + cp -a /usr/lib/afs/libsys.a ./bin/ + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi + { echo "$as_me:$LINENO: checking for proc_afs_syscall in -lsys" >&5 +echo $ECHO_N "checking for proc_afs_syscall in -lsys... $ECHO_C" >&6; } +if test "${ac_cv_lib_sys_proc_afs_syscall+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsys $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char proc_afs_syscall (); +int +main () +{ +return proc_afs_syscall (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_sys_proc_afs_syscall=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_sys_proc_afs_syscall=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_sys_proc_afs_syscall" >&5 +echo "${ECHO_T}$ac_cv_lib_sys_proc_afs_syscall" >&6; } +if test $ac_cv_lib_sys_proc_afs_syscall = yes; then + LIBS="$LIBS -lsys" +else + { { echo "$as_me:$LINENO: error: OpenAFS library: libsys not found!" >&5 +echo "$as_me: error: OpenAFS library: libsys not found!" >&2;} + { (exit 1); exit 1; }; } +fi + # check for afs.h have_afs_headers=no @@ -72263,8 +72420,6 @@ - - # Checks for the vfs_fileid module # Start { echo "$as_me:$LINENO: checking for getmntent" >&5 diff -urN samba-3.2.4.orig/source/configure.in samba-3.2.4/source/configure.in --- samba-3.2.4.orig/source/configure.in 2008-09-18 08:49:02.000000000 +0200 +++ samba-3.2.4/source/configure.in 2008-10-05 20:37:14.986292595 +0200 @@ -2941,15 +2941,33 @@ if test x"$samba_cv_WITH_AFS" != x"no" || test x"$samba_cv_WITH_FAKE_KASERVER" != x"no"; then + AC_CHECK_LIB( crypto, DES_pcbc_encrypt, LIBS="$LIBS -lcrypto" , [AC_ERROR(OpenSSL library: libcrypto ot found!)] ) + # see if this box has the afs-headers in /usr/include/afs AC_MSG_CHECKING(for /usr/include/afs) if test -d /usr/include/afs; then - CFLAGS="$CFLAGS -I/usr/include/afs" - CPPFLAGS="$CPPFLAGS -I/usr/include/afs" + mkdir -p ./include/afs + for f in auth.h param.h prs_fs.h stds.h venus.h afssyscalls.h; do + cp -a /usr/include/afs/$f ./include/afs/ + done + echo "#include " > ./include/afs/afs.h + cat /usr/include/afs/afs.h >> ./include/afs/afs.h + CFLAGS="$CFLAGS -Iinclude/afs" + CPPFLAGS="$CPPFLAGS -Iinclude/afs" AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi + # see if this box has the afs libraries in /usr/lib/afs + AC_MSG_CHECKING(for /usr/lib/afs) + if test -d /usr/lib/afs; then + mkdir -p ./bin + cp -a /usr/lib/afs/libsys.a ./bin/ + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi + AC_CHECK_LIB( sys, proc_afs_syscall, LIBS="$LIBS -lsys", [AC_ERROR(OpenAFS library: libsys not found!)] ) # check for afs.h have_afs_headers=no @@ -5916,8 +5934,6 @@ AC_SUBST(INIPARSERLIBS) AC_SUBST(FLAGS1) - - # Checks for the vfs_fileid module # Start AC_CHECK_FUNC(getmntent) diff -urN samba-3.2.4.orig/source/lib/afs.c samba-3.2.4/source/lib/afs.c --- samba-3.2.4.orig/source/lib/afs.c 2008-09-18 08:49:02.000000000 +0200 +++ samba-3.2.4/source/lib/afs.c 2008-10-05 20:37:14.986292595 +0200 @@ -23,6 +23,7 @@ #define NO_ASN1_TYPEDEFS 1 +#include #include #include #include diff -urN samba-3.2.4.orig/source/lib/afs_settoken.c samba-3.2.4/source/lib/afs_settoken.c --- samba-3.2.4.orig/source/lib/afs_settoken.c 2008-09-18 08:49:02.000000000 +0200 +++ samba-3.2.4/source/lib/afs_settoken.c 2008-10-05 20:37:14.986292595 +0200 @@ -23,6 +23,7 @@ #define NO_ASN1_TYPEDEFS 1 +#include #include #include #include @@ -30,6 +31,7 @@ #include #include #include +#include int afs_syscall( int subcall, char * path, @@ -37,9 +39,12 @@ char * cmarg, int follow) { - return( syscall( SYS_afs_syscall, subcall, path, cmd, cmarg, follow)); +/* return( syscall( SYS_afs_syscall, subcall, path, cmd, cmarg, follow)); */ + int errcode; + return( proc_afs_syscall(subcall, (long)path, cmd, (long)cmarg, follow, &errcode)); } + struct ClearToken { uint32 AuthHandle; char HandShakeKey[8]; diff -urN samba-3.2.4.orig/source/Makefile.in samba-3.2.4/source/Makefile.in --- samba-3.2.4.orig/source/Makefile.in 2008-09-18 08:49:02.000000000 +0200 +++ samba-3.2.4/source/Makefile.in 2008-10-05 20:37:14.990302067 +0200 @@ -2564,6 +2564,9 @@ bin/timelimit \ .headers.stamp */src/*.o proto_exists -rm -rf t_dir +#Remove afs headers and lib copied by configure in case of --with-fake-kaserver --with-vfs-afsacl options + -rm -rf include/afs + -rm -f bin/libsys.a # Making this target will just make sure that the prototype files # exist, not necessarily that they are up to date. Since they're diff -urN samba-3.2.4.orig/source/modules/vfs_afsacl.c samba-3.2.4/source/modules/vfs_afsacl.c --- samba-3.2.4.orig/source/modules/vfs_afsacl.c 2008-09-18 08:49:02.000000000 +0200 +++ samba-3.2.4/source/modules/vfs_afsacl.c 2008-10-05 20:37:14.994289854 +0200 @@ -22,6 +22,7 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_VFS +#include #include #include #include