]> arthur.barton.de Git - netatalk.git/commitdiff
configure cleanup, remove krb4 uam
authorFrank Lahm <franklahm@googlemail.com>
Fri, 25 Feb 2011 11:36:39 +0000 (12:36 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Fri, 25 Feb 2011 11:36:39 +0000 (12:36 +0100)
22 files changed:
configure.in
distrib/initscripts/Makefile.am
distrib/initscripts/rc.atalk.cobalt [deleted file]
etc/uams/Makefile.am
etc/uams/uams_krb4/.gitignore [deleted file]
etc/uams/uams_krb4/Makefile.am [deleted file]
etc/uams/uams_krb4/kuam.c [deleted file]
etc/uams/uams_krb4/lifetime.c [deleted file]
etc/uams/uams_krb4/send_to_kdc.c [deleted file]
etc/uams/uams_krb4/uams_krb4.c [deleted file]
macros/Makefile.am
macros/afs-check.m4
macros/config-checks.m4
macros/db3-check.m4
macros/iconv.m4
macros/libgcrypt.m4
macros/netatalk.m4 [new file with mode: 0644]
macros/pam-check.m4
macros/quota-check.m4
macros/ssl-check.m4
macros/summary.m4
macros/webmin.m4

index 24ad399e41f27aa28d7b83927978d64018de2d11..7265d3e8ca03d6bb0a5f4901e4c317eec501bf41 100644 (file)
@@ -29,6 +29,16 @@ AC_C_INLINE
 dnl Request SUSv3 standard interfaces plus anything else the platform may have
 CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600 -D__EXTENSIONS__ -D_GNU_SOURCE"
 
+dnl Check if we can use attribute unused (gcc only) from ethereal
+AC_MSG_CHECKING(to see if we can add '__attribute__((unused))' to CFLAGS)
+if test x$GCC != x ; then
+  CFLAGS="-D_U_=\"__attribute__((unused))\" $CFLAGS"
+  AC_MSG_RESULT(yes)
+else
+  CFLAGS="-D_U_=\"\" $CFLAGS"
+  AC_MSG_RESULT(no)
+fi
+
 dnl Configure libevent
 AC_CONFIG_SUBDIRS([libevent])
 
@@ -39,7 +49,7 @@ AC_CHECK_HEADERS(mntent.h unistd.h termios.h ufs/quota.h)
 AC_CHECK_HEADERS(netdb.h sgtty.h statfs.h dlfcn.h langinfo.h locale.h)
 AC_CHECK_HEADERS(sys/param.h sys/fcntl.h sys/termios.h)
 AC_CHECK_HEADERS(sys/mnttab.h sys/statvfs.h sys/stat.h sys/vfs.h)
-dnl Checks for header files, conformed to be required as of 2011
+dnl Checks for header files, confirmed to be required as of 2011
 AC_CHECK_HEADERS(sys/epoll.h)
 AC_CHECK_HEADERS([sys/mount.h], , , 
 [#ifdef HAVE_SYS_PARAM_H
@@ -47,6 +57,7 @@ AC_CHECK_HEADERS([sys/mount.h], , ,
 #endif
 ])
 
+AC_SYS_LARGEFILE([], AC_MSG_ERROR([AFP 3.x support requires Large File Support.]))
 
 dnl --------------------------------------------------------------------------
 dnl check if dlsym needs to add an underscore, uses libtool macros 
@@ -76,6 +87,36 @@ if test x"$ac_cv_search_pthread_sigmask" != x"none required" ; then
    PTHREAD_LIBS=$ac_cv_search_pthread_sigmask
 fi
 AC_SUBST(PTHREAD_LIBS)
+
+dnl --------------------- Check if realpath() takes NULL
+AC_CACHE_CHECK([if the realpath function allows a NULL argument],
+    neta_cv_REALPATH_TAKES_NULL, [
+        AC_TRY_RUN([
+            #include <stdio.h>
+            #include <limits.h>
+            #include <signal.h>
+
+            void exit_on_core(int ignored) {
+                 exit(1);
+            }
+
+            main() {
+                char *newpath;
+                signal(SIGSEGV, exit_on_core);
+                newpath = realpath("/tmp", NULL);
+                exit((newpath != NULL) ? 0 : 1);
+            }],
+            neta_cv_REALPATH_TAKES_NULL=yes,
+            neta_cv_REALPATH_TAKES_NULL=no,
+            neta_cv_REALPATH_TAKES_NULL=cross
+        )
+    ]
+)
+
+if test x"$neta_cv_REALPATH_TAKES_NULL" = x"yes"; then
+    AC_DEFINE(REALPATH_TAKES_NULL,1,[Whether the realpath function allows NULL])
+fi
+
 AC_CACHE_SAVE
 
 dnl --------------------------------------------------------------------------
@@ -117,100 +158,32 @@ dnl --------------------------------------------------------------------------
 dnl specific configuration comes in here:
 dnl --------------------------------------------------------------------------
 
+dnl Check for optional admin group support
+AC_NETATALK_ADMIN_GROUP
 
-netatalk_cv_admin_group=yes
-AC_MSG_CHECKING([for administrative group support])
-AC_ARG_ENABLE(admin-group,
-       [  --disable-admin-group   disable admin group],[
-        if test x"$enableval" = x"no"; then
-               AC_DEFINE(ADMIN_GRP, 0, [Define if the admin group should be enabled])
-               netatalk_cv_admin_group=no
-               AC_MSG_RESULT([no])
-       else
-               AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
-               AC_MSG_RESULT([yes])
-        fi],[
-               AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
-               AC_MSG_RESULT([yes])
-       ]
-)
+dnl Check for optional AFS support
+AC_NETATALK_AFS_CHECK
 
-NETATALK_AFS_CHECK
-
-NETATALK_CONFIG_DIRS
-
-netatalk_cv_with_cracklib=no
-AC_ARG_WITH(cracklib,
-       [  --with-cracklib=DICT    enable/set location of cracklib dictionary],[
-       if test "x$withval" != "xno" ; then
-               cracklib="$withval"
-               AC_CHECK_LIB(crack, main, [
-                       AC_DEFINE(USE_CRACKLIB, 1, [Define if cracklib should be used])
-                       LIBS="$LIBS -lcrack"
-                       if test "$cracklib" = "yes"; then
-                               cracklib="/usr/$atalk_libname/cracklib_dict"
-                       fi
-                       AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
-                               [path to cracklib dictionary])
-                       AC_MSG_RESULT([setting cracklib dictionary to $cracklib])
-                       netatalk_cv_with_cracklib=yes
-                       ],[
-                       AC_MSG_ERROR([cracklib not found!])
-                       ]
-               )
-       fi
-       ]
-)
-AC_MSG_CHECKING([for cracklib support])
-AC_MSG_RESULT([$netatalk_cv_with_cracklib])
-
-AC_MSG_CHECKING([whether to enable verbose debug code])
-AC_ARG_ENABLE(debug,
-       [  --enable-debug          enable verbose debug code],[
-       if test "$enableval" != "no"; then
-               if test "$enableval" = "yes"; then
-                       AC_DEFINE(DEBUG, 1, [Define if verbose debugging information should be included])
-               else
-                       AC_DEFINE_UNQUOTED(DEBUG, $enableval, [Define if verbose debugging information should be included])
-               fi 
-               AC_MSG_RESULT([yes])
-       else
-               AC_MSG_RESULT([no])
-        AC_DEFINE(NDEBUG, 1, [Disable assertions])
-       fi
-       ],[
-               AC_MSG_RESULT([no])
-        AC_DEFINE(NDEBUG, 1, [Disable assertions])
-       ]
-)
+dnl --with-pkgconfdir check to change configuration directory location
+AC_NETATALK_CONFIG_DIRS
 
-AC_MSG_CHECKING([whether to enable debugging with debuggers])
-AC_ARG_ENABLE(debugging,
-       [  --enable-debugging      disable SIGALRM timers and DSI tickles (eg for debugging with gdb/dbx/...)],[
-       if test "$enableval" != "no"; then
-               if test "$enableval" = "yes"; then
-                       AC_DEFINE(DEBUGGING, 1, [Define if you want to disable SIGALRM timers and DSI tickles])
-               else
-                       AC_DEFINE_UNQUOTED(DEBUGGING, $enableval, [Define if you want to disable SIGALRM timers and DSI tickles])
-               fi 
-               AC_MSG_RESULT([yes])
-       else
-               AC_MSG_RESULT([no])
-       fi
-       ],[
-               AC_MSG_RESULT([no])
-       ]
-)
+dnl Check for optional cracklib support
+AC_NETATALK_CRACKLIB
 
-AC_SYS_LARGEFILE([], AC_MSG_ERROR([AFP 3.x support requires Large File Support.]))
-AC_CHECK_ICONV
+dnl Check whether to enable debug code
+AC_NETATALK_DEBUG
+
+dnl Check whethe to disable tickle SIGALARM stuff, which eases debugging
+AC_NETATALK_DEBUGGING
+
+dnl    Check for libiconv support
+AC_NETATALK_CHECK_ICONV
 
 dnl Check for CNID database backends
-bdb_required=no
 AC_NETATALK_CNID([bdb_required=yes],[bdb_required=no])
 
 dnl Check for quota support
-AC_CHECK_QUOTA
+AC_NETATALK_CHECK_QUOTA
 
 dnl Check for optional server location protocol support (used by MacOS X)
 AC_NETATALK_SRVLOC
@@ -222,131 +195,52 @@ dnl Check for optional TCP-wrappers support
 AC_NETATALK_TCP_WRAPPERS
 
 dnl Check for PAM libs
-netatalk_cv_use_pam=no
-AC_PATH_PAM([
-       use_pam_so=yes
-       compile_pam=yes
-       netatalk_cv_use_pam=yes
-       AC_DEFINE(USE_PAM, 1, [Define to enable PAM support])
-])
+AC_NETATALK_PATH_PAM
 
 dnl Check for optional shadow password support
-netatalk_cv_use_shadowpw=no
-AC_ARG_WITH(shadow,
-       [  --with-shadow           enable shadow password support [[auto]]],
-       [netatalk_cv_use_shadowpw="$withval"],
-       [netatalk_cv_use_shadowpw=auto]
-)
-
-if test "x$netatalk_cv_use_shadowpw" != "xno"; then
-    AC_CHECK_HEADER([shadow.h])
-    if test x"$ac_cv_header_shadow_h" = x"yes"; then
-       netatalk_cv_use_shadowpw=yes
-       AC_DEFINE(SHADOWPW, 1, [Define if shadow passwords should be used])
-    else 
-      if test "x$shadowpw" = "xyes"; then
-        AC_MSG_ERROR([shadow support not available])
-      else
-               netatalk_cv_use_shadowpw=no
-      fi
-    fi 
-fi
-
-AC_MSG_CHECKING([whether shadow support should be enabled])
-if test "x$netatalk_cv_use_shadowpw" = "xyes"; then
-       AC_MSG_RESULT([yes])
-else
-       AC_MSG_RESULT([no])
-fi
+AC_NETATALK_SHADOW
        
 dnl Check for optional valid-shell-check support
-netatalk_cv_use_shellcheck=yes
-AC_MSG_CHECKING([whether checking for a valid shell should be enabled])
-AC_ARG_ENABLE(shell-check,
-       [  --disable-shell-check   disable checking for a valid shell],[
-       if test "$enableval" = "no"; then 
-               AC_DEFINE(DISABLE_SHELLCHECK, 1, [Define if shell check should be disabled])
-               AC_MSG_RESULT([no])
-               netatalk_cv_use_shellcheck=no
-       else
-               AC_MSG_RESULT([yes])
-       fi
-       ],[
-               AC_MSG_RESULT([yes])
-       ]
-)
+AC_NETATALK_SHELL_CHECK
 
-dnl OS specific configuration
-AC_ARG_ENABLE(redhat,
-       [  --enable-redhat         use redhat-style sysv configuration ],[
-       if test "$enableval" = "yes"; then
-               sysv_style=redhat
-       fi
-       AC_MSG_RESULT([enabling redhat-style sysv support])
-       ]
-)
+dnl Check for optional Webmin
+AC_NETATALK_WEBMIN
 
-AC_ARG_ENABLE(suse,
-       [  --enable-suse           use suse-style sysv configuration ],[
-       if test "$enableval" = "yes"; then
-               sysv_style=suse
-       fi
-       AC_MSG_RESULT([enabling suse-style sysv support])
-       ]
-)
+dnl Check for optional sysv initscript install
+AC_NETATALK_SYSV_STYLE
 
-AC_ARG_ENABLE(gentoo,
-       [  --enable-gentoo         use gentoo-style sysv configuration ],[
-       if test "$enableval" = "yes"; then
-               sysv_style=gentoo
-       fi
-       AC_MSG_RESULT([enabling gentoo-style sysv support])
-       ]
-)
+dnl Path where UAM modules shall be installed
+AC_ARG_WITH(uams-path, [  --with-uams-path=PATH   path to UAMs [[PKGCONF/uams]]], [uams_path="$withval"], [uams_path="${PKGCONFDIR}/uams"])
 
-AC_ARG_ENABLE(cobalt,
-       [  --enable-cobalt         use cobalt-style sysv configuration ],
-       if test "$enableval" = "yes"; then
-               sysv_style=cobalt
-       fi
-       AC_MSG_RESULT([enabling cobalt-style sysv support])
-)
+dnl Check for libgcrypt, if found enables DHX2 UAM
+AC_NETATALK_PATH_LIBGCRYPT([1:1.2.3])
 
-AC_ARG_ENABLE(netbsd,
-       [  --enable-netbsd         use NetBSD-style rc.d configuration ],
-       if test "x$enableval" = "xyes"; then
-               sysv_style=netbsd
-       fi
-       AC_MSG_RESULT([enabling NetBSD-style rc.d support])
-)
+dnl Check for openssl, if found enables DHX UAM and Randnum UAM
+AC_NETATALK_PATH_SSL
 
-AC_ARG_ENABLE(debian,
-       [  --enable-debian         use debian-style sysv configuration ],[
-       if test "$enableval" = "yes"; then
-               sysv_style=debian
-       fi
-       AC_MSG_RESULT([enabling debian-style sysv support])
-       ]
-)
+dnl Check for Berkeley DB library
+AC_NETATALK_PATH_BDB
 
-dnl Path where UAM modules shall be installed
-AC_ARG_WITH(uams-path,
-       [  --with-uams-path=PATH   path to UAMs [[PKGCONF/uams]]],[
-               uams_path="$withval"
-       ],[
-               uams_path="${PKGCONFDIR}/uams"
-       ]
-)
+dnl Check for crypt
+AC_NETATALK_CRYPT
 
-dnl check if we can use attribute unused (gcc only) from ethereal
-AC_MSG_CHECKING(to see if we can add '__attribute__((unused))' to CFLAGS)
-if test x$GCC != x ; then
-  CFLAGS="-D_U_=\"__attribute__((unused))\" $CFLAGS"
-  AC_MSG_RESULT(yes)
-else
-  CFLAGS="-D_U_=\"\" $CFLAGS"
-  AC_MSG_RESULT(no)
-fi
+dnl Check for building PGP UAM module
+AC_NETATALK_PGP_UAM
+
+dnl Check for building Kerberos V UAM module
+AC_NETATALK_KRB5_UAM
+
+dnl Check for overwrite the config files or not
+AC_NETATALK_OVERWRITE_CONFIG
+
+dnl Check for LDAP support, for client-side ACL visibility
+AC_NETATALK_LDAP
+
+dnl Check for ACL support
+AC_NETATALK_ACL
+
+dnl Check for Extended Attributes support
+AC_NETATALK_EXTENDED_ATTRIBUTES
 
 dnl --------------------------------------------------------------------------
 dnl FHS stuff has to be done last because it overrides other defaults
@@ -379,6 +273,14 @@ dnl --------------------------------------------------------------------------
 UAMS_PATH="${uams_path}"
 AC_SUBST(UAMS_PATH)
 
+
+dnl --------------------------------------------------------------------------
+dnl OS specific configuration comes in here:
+dnl --------------------------------------------------------------------------
+
+AC_NETATALK_OS_SPECIFIC
+
+
 dnl --------------------------------------------------------------------------
 dnl drop in includes for top level directory structures here...
 dnl --------------------------------------------------------------------------
@@ -391,628 +293,12 @@ CFLAGS="-I\$(top_srcdir)/include -I\$(top_srcdir)/sys -I\$(top_srcdir)/libevent/
 
 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, ELOOP, errno returned by open with O_NOFOLLOW)
 
+
 dnl --------------------------------------------------------------------------
-dnl specific configuration comes in here:
+dnl Last minute substitutions
 dnl --------------------------------------------------------------------------
-
-dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
-
-dnl --------------------- determine operating system from "target"
-case "$host_os" in
-       *aix*)                          this_os=aix ;;
-       *freebsd*)                      this_os=freebsd ;;
-       *hpux11*)                       this_os=hpux11 ;;
-       *irix*)                         this_os=irix ;;
-       *linux*)                        this_os=linux ;;
-       *osx*)                          this_os=macosx ;;
-       *darwin*)                       this_os=macosx ;;
-       *netbsd*)                       this_os=netbsd ;;
-       *openbsd*)                      this_os=openbsd ;;
-       *osf*)                          this_os=tru64 ;;
-       *solaris*)                      this_os=solaris ;;
-esac
-
-case "$host_cpu" in
-       i386|i486|i586|i686|k7)         this_cpu=x86 ;;
-       alpha)                                          this_cpu=alpha ;;
-       mips)                                           this_cpu=mips ;;
-       powerpc|ppc)                            this_cpu=ppc ;;
-esac
-
-dnl --------------------- operating system specific flags (port from sys/*)
-
-dnl ----- FreeBSD specific -----
-if test x"$this_os" = "xfreebsd"; then 
-       AC_MSG_RESULT([ * FreeBSD specific configuration])
-       AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
-       AC_DEFINE(FREEBSD, 1, [Define if OS is FreeBSD])
-       AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics])
-    AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW)
-fi
-
-dnl ----- Linux specific -----
-if test x"$this_os" = "xlinux"; then 
-       AC_MSG_RESULT([ * Linux specific configuration])
-       
-       dnl ----- check if we need the quotactl wrapper
-    AC_CHECK_HEADERS(linux/dqblk_xfs.h,,
-               [AC_CHECK_HEADERS(linux/xqm.h linux/xfs_fs.h)
-               AC_CHECK_HEADERS(xfs/libxfs.h xfs/xqm.h xfs/xfs_fs.h)]
-       )
-
-
-       dnl ----- as far as I can tell, dbtob always does the wrong thing
-       dnl ----- on every single version of linux I've ever played with.
-       dnl ----- see etc/afpd/quota.c
-       AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
-
-       netatalk_cv_linux_sendfile=yes
-       AC_MSG_CHECKING([use sendfile syscall])
-        AC_ARG_ENABLE(sendfile,
-           [  --disable-sendfile       disable linux sendfile syscall],[
-               if test x"$enableval" = x"no"; then
-                       netatalk_cv_linux_sendfile=no
-                       AC_MSG_RESULT([no])
-               else
-                       AC_MSG_RESULT([yes])
-
-               fi
-           ],[
-               AC_MSG_RESULT([yes])
-       ]
-
-       )
-
-       if test x"$netatalk_cv_linux_sendfile" = "xyes"; then 
-           AC_CACHE_CHECK([for linux sendfile support],netatalk_cv_HAVE_SENDFILE,[
-           AC_TRY_LINK([#include <sys/sendfile.h>],
-[\
-int tofd, fromfd;
-off_t offset;
-size_t total;
-ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
-],
-netatalk_cv_HAVE_SENDFILE=yes,netatalk_cv_HAVE_SENDFILE=no)])
-
-# Try and cope with broken Linux sendfile....
-           AC_CACHE_CHECK([for broken linux sendfile support],netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE,[
-           AC_TRY_LINK([\
-#if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)
-#undef _FILE_OFFSET_BITS
-#endif
-#include <sys/sendfile.h>],
-[\
-int tofd, fromfd;
-off_t offset;
-size_t total;
-ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
-],
-netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE=yes,netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE=no,netatalk_cv_HAVE_BROKEN_SENDFILE=cross)])
-
-           if test x"$netatalk_cv_HAVE_SENDFILE" = x"yes"; then
-               AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() is available])
-               AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available])
-               AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used])
-           elif test x"$netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE" = x"yes"; then
-               AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available])
-               AC_DEFINE(LINUX_BROKEN_SENDFILE_API,1,[Whether (linux) sendfile() is broken])
-               AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile should be used])
-           else
-               netatalk_cv_linux_sendfile=no
-               AC_MSG_RESULT(no);
-           fi
-       fi
-
-       need_dash_r=no
-fi
-
-dnl ----- Mac OSX specific -----
-if test x"$this_os" = "xmacosx"; then 
-       AC_MSG_RESULT([ * Mac OSX specific configuration])
-       AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
-       AC_DEFINE(HAVE_2ARG_DBTOB, 1, [Define if dbtob takes two arguments])
-       dnl AC_DEFINE(NO_DLFCN_H)
-       AC_DEFINE(NO_QUOTA_SUPPORT, 1, [Define if Quota support should be disabled])
-       AC_DEFINE(MACOSX_SERVER, 1, [Define if compiling for MacOS X Server])
-fi
-
-dnl ----- NetBSD specific -----
-if test x"$this_os" = "xnetbsd"; then 
-       AC_MSG_RESULT([ * NetBSD specific configuration])
-       AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
-       AC_DEFINE(NETBSD, 1, [Define if OS is NetBSD])
-    AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EFTYPE, errno returned by open with O_NOFOLLOW)
-
-       CFLAGS="-I\$(top_srcdir)/sys/netbsd $CFLAGS"
-       need_dash_r=yes 
-
-       dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
-       AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
-fi
-
-dnl ----- OpenBSD specific -----
-if test x"$this_os" = "xopenbsd"; then 
-       AC_MSG_RESULT([ * OpenBSD specific configuration])
-       dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
-       AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
-fi
-
-dnl ----- Solaris specific -----
-if test x"$this_os" = "xsolaris"; then 
-       AC_MSG_RESULT([ * Solaris specific configuration])
-       AC_DEFINE(__svr4__, 1, [Solaris compatibility macro])
-       AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
-       AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
-       AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro])
-       CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
-       need_dash_r=yes
-       sysv_style=solaris
-
-       solaris_module=no
-       AC_MSG_CHECKING([if we can build Solaris kernel module])
-       if test -x /usr/ccs/bin/ld && test x"$netatalk_cv_ddp_enabled" = x"yes" ; then
-               solaris_module=yes
-       fi
-       AC_MSG_RESULT([$solaris_module])
-
-       COMPILE_64BIT_KMODULE=no
-       KCFLAGS=""
-       KLDFLAGS=""
-       COMPILE_KERNEL_GCC=no
-
-       if test "$solaris_module" = "yes"; then
-          dnl Solaris kernel module stuff
-           AC_MSG_CHECKING([if we have to build a 64bit kernel module])
-
-          # check for isainfo, if not found it has to be a 32 bit kernel (<=2.6)       
-          if test -x /usr/bin/isainfo; then
-               # check for 64 bit platform
-               if isainfo -kv | grep '^64-bit'; then
-                       COMPILE_64BIT_KMODULE=yes
-               fi
-          fi
-
-          AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
-
-          if test "${GCC}" = yes; then
-               COMPILE_KERNEL_GCC=yes
-               if test "$COMPILE_64BIT_KMODULE" = yes; then
-               
-                        AC_MSG_CHECKING([if we can build a 64bit kernel module])
-                       
-                        case `$CC --version 2>/dev/null` in
-                       [[12]].* | 3.0.*)
-                               COMPILE_64BIT_KMODULE=no
-                               COMPILE_KERNEL_GCC=no   
-                               solaris_module=no;;
-                       *)
-                               # use for 64 bit
-                               KCFLAGS="-m64"
-                               #KLDFLAGS="-melf64_sparc"
-                               KLDFLAGS="-64";;
-                       esac    
-                       
-                       AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
-                       
-               else
-                       KCFLAGS=""
-                       KLDFLAGS=""
-               fi
-               KCFLAGS="$KCFLAGS -D_KERNEL -Wall -Wstrict-prototypes"
-           else
-               if test "$COMPILE_64BIT_KMODULE" = yes; then
-                # use Sun CC (for a 64-bit kernel, uncomment " -xarch=v9 -xregs=no%appl ")
-                       KCFLAGS="-xarch=v9 -xregs=no%appl"
-                       KLDFLAGS="-64"
-               else
-                       KCFLAGS=""
-                       KLDFLAGS=""
-               fi
-               KCFLAGS="-D_KERNEL $KCFLAGS -mno-app-regs -munaligned-doubles -fpcc-struct-return"
-          fi
-
-           AC_CACHE_CHECK([for timeout_id_t],netatalk_cv_HAVE_TIMEOUT_ID_T,[
-           AC_TRY_LINK([\
-#include <sys/stream.h>
-#include <sys/ddi.h>],
-[\
-timeout_id_t dummy;
-],
-netatalk_cv_HAVE_TIMEOUT_ID_T=yes,netatalk_cv_HAVE_TIMEOUT_ID_T=no,netatalk_cv_HAVE_TIMEOUT_ID_T=cross)])
-
-          AC_DEFINE(HAVE_TIMEOUT_ID_T, test x"$netatalk_cv_HAVE_TIMEOUT_ID" = x"yes", [define for timeout_id_t])
-       fi
-
-       AC_SUBST(COMPILE_KERNEL_GCC)
-       AC_SUBST(COMPILE_64BIT_KMODULE)
-       AC_SUBST(KCFLAGS)
-       AC_SUBST(KLDFLAGS)
-fi
-
-dnl -- check for libgcrypt, if found enables DHX UAM
-AM_PATH_LIBGCRYPT([1:1.2.3],[neta_cv_compile_dhx2=yes
-                       neta_cv_have_libgcrypt=yes
-                       AC_MSG_NOTICE([Enabling DHX2 UAM])
-                       AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define if the DHX2 modules should be built with libgcrypt])
-                       AC_DEFINE(UAM_DHX2, 1, [Define if the DHX2 UAM modules should be compiled])
-                       ])
-
-dnl -- look for openssl, if found enables DHX UAM and Randnum UAM
-AC_PATH_SSL
-
-dnl Check for Berkeley DB library
-if test "x$bdb_required" = "xyes"; then
-       AC_PATH_BDB(, [
-               AC_MSG_RESULT([])
-               AC_MSG_RESULT([Make sure you have the required Berkeley DB libraries AND headers installed.])
-               AC_MSG_RESULT([You can download the latest version from http://www.sleepycat.com.])
-               AC_MSG_RESULT([If you have installed BDB in a non standard location use the])
-               AC_MSG_RESULT([--with-bdb=/path/to/bdb configure option and make sure])
-               AC_MSG_RESULT([your linker is configured to check for libraries there.])
-               AC_MSG_ERROR([Berkeley DB library required but not found!])
-       ])
-fi
-
-dnl -- check for crypt
-AC_CRYPT
-
-dnl --------------------- check for building PGP UAM module
-
-AC_MSG_CHECKING([whether the PGP UAM should be build])
-AC_ARG_ENABLE(pgp-uam,
-       [  --enable-pgp-uam        enable build of PGP UAM module],[
-       if test "$enableval" = "yes"; then 
-               if test "x$neta_cv_have_openssl" = "xyes"; then 
-                       AC_DEFINE(UAM_PGP, 1, [Define if the PGP UAM module should be compiled])
-                       compile_pgp=yes
-                       AC_MSG_RESULT([yes])
-               else
-                       AC_MSG_RESULT([no])
-               fi
-       fi
-       ],[
-               AC_MSG_RESULT([no])
-       ]
-)
-
-dnl --------------------- check for building Kerberos v4 UAM module
-
-AC_MSG_CHECKING([whether the Kerberos IV UAM should be build])
-AC_ARG_ENABLE(krb4-uam,
-       [  --enable-krb4-uam       enable build of Kerberos v4 UAM module],[
-       if test "$enableval" = "yes"; then
-               AC_DEFINE(UAM_KRB4, 1, [Define if the Kerberos 4 UAM module should be compiled])
-               compile_kerberos=yes
-               AC_MSG_RESULT([yes])
-       else
-               AC_MSG_RESULT([no])
-       fi
-       ],[
-               AC_MSG_RESULT([no])
-       ]
-)
-
-dnl --------------------- check for building Kerberos V UAM module
-
-netatalk_cv_build_krb5_uam=no
-AC_ARG_ENABLE(krbV-uam,
-       [  --enable-krbV-uam       enable build of Kerberos V UAM module],
-       [
-               if test x"$enableval" = x"yes"; then
-                       NETATALK_GSSAPI_CHECK([
-                               netatalk_cv_build_krb5_uam=yes
-                       ],[
-                               AC_MSG_ERROR([need GSSAPI to build Kerberos V UAM])
-                       ])
-               fi
-       ]
-       
-)
-
-AC_MSG_CHECKING([whether Kerberos V UAM should be build])
-if test x"$netatalk_cv_build_krb5_uam" = x"yes"; then
-       AC_MSG_RESULT([yes])
-else
-       AC_MSG_RESULT([no])
-fi
-AM_CONDITIONAL(USE_GSSAPI, test x"$netatalk_cv_build_krb5_uam" = x"yes")
-
-dnl --------------------- overwrite the config files . . . or not.
-
-AC_MSG_CHECKING([whether configuration files should be overwritten])
-AC_ARG_ENABLE(overwrite,
-       [  --enable-overwrite      overwrite configuration files during installation],
-       [OVERWRITE_CONFIG="${enable_overwrite}"],
-       [OVERWRITE_CONFIG="no"]
-)
-AC_MSG_RESULT([$OVERWRITE_CONFIG])
-
-dnl --------------------- check for LDAP support, for client-side ACL visibility
-AC_MSG_CHECKING(for LDAP (necessary for client-side ACL visibility))
-AC_ARG_WITH(ldap,
-    [AS_HELP_STRING([--with-ldap],
-        [LDAP support (default=auto)])],
-    [ case "$withval" in
-      yes|no)
-          with_ldap="$withval"
-                 ;;
-      *)
-          with_ldap=auto
-          ;;
-      esac ])
-AC_MSG_RESULT($with_ldap)
-
-if test x"$with_ldap" != x"no" ; then
-       AC_CHECK_HEADER([ldap.h], with_ldap=yes,
-        [ if test x"$with_ldap" = x"yes" ; then
-            AC_MSG_ERROR([Missing LDAP headers])
-        fi
-               with_ldap=no
-        ])
-       AC_CHECK_LIB(ldap, ldap_init, with_ldap=yes,
-        [ if test x"$with_ldap" = x"yes" ; then
-            AC_MSG_ERROR([Missing LDAP library])
-        fi
-               with_ldap=no
-        ])
-fi
-
-if test x"$with_ldap" = x"yes"; then
-       AC_DEFINE(HAVE_LDAP,1,[Whether LDAP is available])
-fi
-
-dnl --------------------- check for ACL support
-AC_MSG_CHECKING(whether to support ACLs)
-AC_ARG_WITH(acls,
-    [AS_HELP_STRING([--with-acls],
-        [Include ACL support (default=auto)])],
-    [ case "$withval" in
-      yes|no)
-          with_acl_support="$withval"
-                 ;;
-      *)
-          with_acl_support=auto
-          ;;
-      esac ],
-    [with_acl_support=auto])
-AC_MSG_RESULT($with_acl_support)
-
-if test x"$with_acl_support" = x"no"; then
-       AC_MSG_RESULT(Disabling ACL support)
-       AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support should be built in])
-else
-    with_acl_support=yes
-fi
-
-if test x"$with_acl_support" = x"yes" ; then
-       AC_MSG_NOTICE(checking whether ACL support is available:)
-       case "$host_os" in
-       *sysv5*)
-               AC_MSG_NOTICE(Using UnixWare ACLs)
-               AC_DEFINE(HAVE_UNIXWARE_ACLS,1,[Whether UnixWare ACLs are available])
-               ;;
-       *solaris*)
-               AC_MSG_NOTICE(Using solaris ACLs)
-               AC_DEFINE(HAVE_SOLARIS_ACLS,1,[Whether solaris ACLs are available])
-               ACL_LIBS="$ACL_LIBS -lsec"
-               ;;
-       *hpux*)
-               AC_MSG_NOTICE(Using HPUX ACLs)
-               AC_DEFINE(HAVE_HPUX_ACLS,1,[Whether HPUX ACLs are available])
-               ;;
-       *irix*)
-               AC_MSG_NOTICE(Using IRIX ACLs)
-               AC_DEFINE(HAVE_IRIX_ACLS,1,[Whether IRIX ACLs are available])
-               ;;
-       *aix*)
-               AC_MSG_NOTICE(Using AIX ACLs)
-               AC_DEFINE(HAVE_AIX_ACLS,1,[Whether AIX ACLs are available])
-               ;;
-       *osf*)
-               AC_MSG_NOTICE(Using Tru64 ACLs)
-               AC_DEFINE(HAVE_TRU64_ACLS,1,[Whether Tru64 ACLs are available])
-               ACL_LIBS="$ACL_LIBS -lpacl"
-               ;;
-       *darwin*)
-               AC_MSG_NOTICE(ACLs on Darwin currently not supported)
-               AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
-               ;;
-       *)
-               AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"])
-               case "$host_os" in
-               *linux*)
-                       AC_CHECK_LIB(attr,getxattr,[ACL_LIBS="$ACL_LIBS -lattr"])
-                       ;;
-               esac
-               AC_CACHE_CHECK([for POSIX ACL support],netatalk_cv_HAVE_POSIX_ACLS,[
-                       acl_LIBS=$LIBS
-                       LIBS="$LIBS $ACL_LIBS"
-                       AC_TRY_LINK([
-                               #include <sys/types.h>
-                               #include <sys/acl.h>
-                       ],[
-                               acl_t acl;
-                               int entry_id;
-                               acl_entry_t *entry_p;
-                               return acl_get_entry(acl, entry_id, entry_p);
-                       ],
-                       [netatalk_cv_HAVE_POSIX_ACLS=yes],
-                       [netatalk_cv_HAVE_POSIX_ACLS=no
-                with_acl_support=no])
-                       LIBS=$acl_LIBS
-               ])
-               if test x"$netatalk_cv_HAVE_POSIX_ACLS" = x"yes"; then
-                       AC_MSG_NOTICE(Using POSIX ACLs)
-                       AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available])
-                       AC_CACHE_CHECK([for acl_get_perm_np],netatalk_cv_HAVE_ACL_GET_PERM_NP,[
-                               acl_LIBS=$LIBS
-                               LIBS="$LIBS $ACL_LIBS"
-                               AC_TRY_LINK([
-                                       #include <sys/types.h>
-                                       #include <sys/acl.h>
-                               ],[
-                                       acl_permset_t permset_d;
-                                       acl_perm_t perm;
-                                       return acl_get_perm_np(permset_d, perm);
-                               ],
-                               [samba_cv_HAVE_ACL_GET_PERM_NP=yes],
-                               [samba_cv_HAVE_ACL_GET_PERM_NP=no])
-                               LIBS=$acl_LIBS
-                       ])
-                       if test x"netatalk_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
-                               AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
-                       fi
-               else
-                       AC_MSG_NOTICE(ACL support is not avaliable)
-                       AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
-               fi
-               ;;
-    esac
-fi
-
-if test x"$with_acl_support" = x"yes" ; then
-    AC_DEFINE(HAVE_ACLS,1,[Whether ACLs support is available])
-    AC_SUBST(ACL_LIBS)
-fi
-
-dnl --------------------- check for Extended Attributes support
-neta_cv_eas="ad"
-neta_cv_eas_sys_found=no
-neta_cv_eas_sys_not_found=no
-
-AC_CHECK_HEADERS(sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h sys/ea.h)
-
-case "$this_os" in
-
-  *osf*)
-       AC_SEARCH_LIBS(getproplist, [proplist])
-       AC_CHECK_FUNCS([getproplist fgetproplist setproplist fsetproplist],
-                   [neta_cv_eas_sys_found=yes],
-                   [neta_cv_eas_sys_not_found=yes])
-       AC_CHECK_FUNCS([delproplist fdelproplist add_proplist_entry get_proplist_entry],,
-                   [neta_cv_eas_sys_not_found=yes])
-       AC_CHECK_FUNCS([sizeof_proplist_entry],,
-                   [neta_cv_eas_sys_not_found=yes])
-  ;;
-
-  *solaris*)
-       AC_CHECK_FUNCS([attropen],
-                   [neta_cv_eas_sys_found=yes],
-                   [neta_cv_eas_sys_not_found=yes])
-  ;;
-
-  'freebsd')
-    AC_CHECK_FUNCS([extattr_delete_fd extattr_delete_file extattr_delete_link],
-                   [neta_cv_eas_sys_found=yes],
-                   [neta_cv_eas_sys_not_found=yes])
-    AC_CHECK_FUNCS([extattr_get_fd extattr_get_file extattr_get_link],,
-                   [neta_cv_eas_sys_not_found=yes])
-    AC_CHECK_FUNCS([extattr_list_fd extattr_list_file extattr_list_link],,
-                   [neta_cv_eas_sys_not_found=yes])
-    AC_CHECK_FUNCS([extattr_set_fd extattr_set_file extattr_set_link],,
-                   [neta_cv_eas_sys_not_found=yes])
-  ;;
-
-  *freebsd4* | *dragonfly* )
-    AC_DEFINE(BROKEN_EXTATTR, 1, [Does extattr API work])
-  ;;
-
-  *)
-       AC_SEARCH_LIBS(getxattr, [attr])
-
-    if test "x$neta_cv_eas_sys_found" != "xyes" ; then
-       AC_CHECK_FUNCS([getxattr lgetxattr fgetxattr listxattr llistxattr],
-                      [neta_cv_eas_sys_found=yes],
-                      [neta_cv_eas_sys_not_found=yes])
-          AC_CHECK_FUNCS([flistxattr removexattr lremovexattr fremovexattr],,
-                      [neta_cv_eas_sys_not_found=yes])
-          AC_CHECK_FUNCS([setxattr lsetxattr fsetxattr],,
-                      [neta_cv_eas_sys_not_found=yes])
-    fi
-
-    if test "x$neta_cv_eas_sys_found" != "xyes" ; then
-          AC_CHECK_FUNCS([getea fgetea lgetea listea flistea llistea],
-                      [neta_cv_eas_sys_found=yes],
-                      [neta_cv_eas_sys_not_found=yes])
-          AC_CHECK_FUNCS([removeea fremoveea lremoveea setea fsetea lsetea],,
-                      [neta_cv_eas_sys_not_found=yes])
-    fi
-
-    if test "x$neta_cv_eas_sys_found" != "xyes" ; then
-          AC_CHECK_FUNCS([attr_get attr_list attr_set attr_remove],,
-                      [neta_cv_eas_sys_not_found=yes])
-       AC_CHECK_FUNCS([attr_getf attr_listf attr_setf attr_removef],,
-                      [neta_cv_eas_sys_not_found=yes])
-    fi
-  ;;
-esac
-
-# Do xattr functions take additional options like on Darwin?
-if test x"$ac_cv_func_getxattr" = x"yes" ; then
-       AC_CACHE_CHECK([whether xattr interface takes additional options], smb_attr_cv_xattr_add_opt, [
-               old_LIBS=$LIBS
-               LIBS="$LIBS $ACL_LIBS"
-               AC_TRY_COMPILE([
-                       #include <sys/types.h>
-                       #if HAVE_ATTR_XATTR_H
-                       #include <attr/xattr.h>
-                       #elif HAVE_SYS_XATTR_H
-                       #include <sys/xattr.h>
-                       #endif
-               ],[
-                       getxattr(0, 0, 0, 0, 0, 0);
-               ],
-               [smb_attr_cv_xattr_add_opt=yes],
-               [smb_attr_cv_xattr_add_opt=no;LIBS=$old_LIBS])
-       ])
-       if test x"$smb_attr_cv_xattr_add_opt" = x"yes"; then
-               AC_DEFINE(XATTR_ADD_OPT, 1, [xattr functions have additional options])
-       fi
-fi
-
-if test "x$neta_cv_eas_sys_found" = "xyes" ; then
-   if test "x$neta_cv_eas_sys_not_found" != "xyes" ; then
-      neta_cv_eas="$neta_cv_eas | sys"
-   fi
-fi
-AC_DEFINE_UNQUOTED(EA_MODULES,["$neta_cv_eas"],[Available Extended Attributes modules])
-
-dnl --------------------- Check if realpath() takes NULL
-AC_CACHE_CHECK([if the realpath function allows a NULL argument],
-    neta_cv_REALPATH_TAKES_NULL, [
-        AC_TRY_RUN([
-            #include <stdio.h>
-            #include <limits.h>
-            #include <signal.h>
-
-            void exit_on_core(int ignored) {
-                 exit(1);
-            }
-
-            main() {
-                char *newpath;
-                signal(SIGSEGV, exit_on_core);
-                newpath = realpath("/tmp", NULL);
-                exit((newpath != NULL) ? 0 : 1);
-            }],
-            neta_cv_REALPATH_TAKES_NULL=yes,
-            neta_cv_REALPATH_TAKES_NULL=no,
-            neta_cv_REALPATH_TAKES_NULL=cross
-        )
-    ]
-)
-
-if test x"$neta_cv_REALPATH_TAKES_NULL" = x"yes"; then
-    AC_DEFINE(REALPATH_TAKES_NULL,1,[Whether the realpath function allows NULL])
-fi
-
-dnl --------------------- Netatalk Webmin
-NETATALK_WEBMIN
-
-dnl --------------------- last minute substitutions
 AC_SUBST(LIBS)
 AC_SUBST(CFLAGS)
-AC_SUBST(OVERWRITE_CONFIG)
 
 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
 AM_CONDITIONAL(HAVE_LIBGCRYPT, test x$neta_cv_have_libgcrypt = xyes)
@@ -1022,13 +308,11 @@ AM_CONDITIONAL(HAVE_LDAP, test x"$with_ldap" = x"yes")
 AM_CONDITIONAL(USE_DHX, test x$neta_cv_compile_dhx = xyes)
 AM_CONDITIONAL(USE_DHX2, test x$neta_cv_compile_dhx2 = xyes)
 AM_CONDITIONAL(USE_RANDNUM, test x$neta_cv_have_openssl = xyes)
-AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
 AM_CONDITIONAL(USE_PAM, test x$netatalk_cv_install_pam = xyes)
 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
 AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes)
 AM_CONDITIONAL(DEFAULT_HOOK, test x$neta_cv_have_libgcrypt != xyes && test x$neta_cv_have_openssl != xyes)
-AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
 AM_CONDITIONAL(USE_NETBSD, test x$sysv_style = xnetbsd)
 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
@@ -1071,7 +355,6 @@ AC_OUTPUT([Makefile
        etc/cnid_dbd/Makefile
        etc/netalockd/Makefile
        etc/uams/Makefile
-       etc/uams/uams_krb4/Makefile
        include/Makefile
        include/atalk/Makefile
        libatalk/Makefile
index 5ad0d37e4891e430f26160929a79af8324ee4975..3abbb0dae871dca2d160443bcb1774a818199e32 100644 (file)
@@ -95,27 +95,6 @@ uninstall-startup:
 
 endif
 
-#
-# checking for "cobalt" style sysv scripts:
-#
-
-if USE_COBALT
-
-sysvdir        = /etc/rc.d/init.d
-sysv_SCRIPTS = netatalk
-
-$(sysv_SCRIPTS): rc.atalk.cobalt
-       cp -f rc.atalk.cobalt $(sysv_SCRIPTS)
-       chmod a+x $(sysv_SCRIPTS)
-
-install-data-hook:
-
-uninstall-hook:
-
-uninstall-startup: uninstall-am
-
-endif
-
 #
 # checking for "tru64" style sysv scripts:
 #
diff --git a/distrib/initscripts/rc.atalk.cobalt b/distrib/initscripts/rc.atalk.cobalt
deleted file mode 100644 (file)
index dc10109..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-#!/bin/sh
-#
-# chkconfig: 345 91 35
-# description: Starts and stops the atalk, afpd & papd daemons for
-#              providing AppleTalk networking services.
-#
-
-# Source function library.
-. /etc/rc.d/init.d/functions
-
-# set lcd stuff up if necessary
-if [ x"$LCD_STOP" = x"" ]; then
-        LCD_STOP="/sbin/stoplcd"
-fi
-if [ x"$LCD_SWRITE" = x"" ]; then
-        LCD_SWRITE="/sbin/swritelcd"
-fi
-
-# set up i18n stuff if necessary
-if [ -x /usr/local/sbin/getmsg ]; then
-       GETMSG=/usr/local/sbin/getmsg
-       START_MSG1=atalkStart1
-       START_MSG2=atalkStart2
-       STOP_MSG1=atalkStop1
-       STOP_MSG2=atalkStop2
-else
-       GETMSG=getmsg
-       START_MSG1=atalk_start_1
-       START_MSG2=atalk_start_2
-       STOP_MSG1=atalk_stop_1
-       STOP_MSG2=atalk_stop_2
-fi
-
-# Source networking configuration.
-. /etc/sysconfig/network
-
-test -x /usr/sbin/atalkd || exit 0
-
-test -f /etc/atalk/netatalk.conf || exit 0
-
-# read in netatalk configuration
-. /etc/atalk/netatalk.conf
-
-# Check that networking is up.
-[ ${NETWORKING} = "no" ] && exit 0
-
-# initialize return values
-RETVAL=1
-RETVAL_ATALKD=0
-RETVAL_PAPD=0
-RETVAL_CNID_METAD=0
-RETVAL_AFPD=0
-
-# startup code for everything
-atalk_startup() {
-    if [ x"${ATALKD_RUN}" != x"no" ]; then 
-       daemon /usr/sbin/atalkd
-       RETVAL_ATALKD=$?
-
-       if [ -x /usr/bin/nbprgstr ]; then       
-           /usr/bin/nbprgstr -p 4 "${ATALK_NAME}:Workstation${ATALK_ZONE}"
-           /usr/bin/nbprgstr -p 4 "${ATALK_NAME}:netatalk${ATALK_ZONE}"
-       fi      
-           
-       if [ x"${PAPD_RUN}" = x"yes"  -a -x /usr/sbin/papd ]; then
-           daemon /usr/sbin/papd
-           RETVAL_PAPD=$?
-       fi
-
-       if [ -x /usr/sbin/timelord ]; then
-           daemon /usr/sbin/timelord
-       fi
-    fi
-
-    if [ x"${CNID_METAD_RUN}" = x"yes" -a -x /usr/sbin/cnid_metad ] ; then
-           daemon /usr/sbin/cnid_metad $CNID_CONFIG
-           RETVAL_CNID_METAD=$?
-    fi
-
-    if [ x"${AFPD_RUN}" = x"yes" -a -x /usr/sbin/afpd ] ; then
-           daemon /usr/sbin/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \
-               -c ${AFPD_MAX_CLIENTS} -n "${ATALK_NAME}${ATALK_ZONE}"
-           RETVAL_AFPD=$?
-    fi
-
-    if [ $RETVAL_ATALKD -eq 0 -a $RETVAL_PAPD -eq 0 -a $RETVAL_CNID_METAD -eq 0 -a $RETVAL_AFPD -eq 0 ]; then
-        RETVAL=0
-       touch /var/lock/subsys/atalk || RETVAL=1
-    fi
-}
-
-case "$1" in
-'start')
-       LINE1=`$GETMSG $START_MSG1`
-        LINE2=`$GETMSG $START_MSG2`
-        $LCD_STOP
-        $LCD_SWRITE "$LINE1" "$LINE2" &>/dev/null &
-       echo -n 'Starting AppleTalk services: '
-       if [ x"${ATALK_BGROUND}" = x"yes" ]; then 
-           echo -n "(backgrounded)"
-           atalk_startup >& /dev/null &
-       else
-           atalk_startup
-       fi
-       echo 
-       touch /var/lock/subsys/atalk
-       ;;
-'stop')
-       LINE1=`$GETMSG $STOP_MSG1`
-        LINE2=`$GETMSG $STOP_MSG2`
-        $LCD_STOP
-        $LCD_SWRITE "$LINE1" "$LINE2" &>/dev/null &
-       echo -n 'Shutting down AppleTalk services: '
-       if [ x"${ATALKD_RUN}" != x"no" ]; then
-           if [ x"${PAPD_RUN}" = x"yes" -a -x /usr/sbin/papd ]; then
-               killproc papd
-               RETVAL_PAPD=$?
-           fi
-
-           /usr/bin/nbpunrgstr "${ATALK_NAME}:Workstation${ATALK_ZONE}"
-           /usr/bin/nbpunrgstr "${ATALK_NAME}:netatalk${ATALK_ZONE}"
-
-           # kill atalkd last, since without it the plumbing goes away.
-           if [ -x /usr/sbin/atalkd ]; then
-               killproc atalkd
-               RETVAL_ATALKD=$?
-           fi
-       fi          
-
-       # kill this separately as we also do AFP/tcp
-       if [ x"${AFPD_RUN}" = x"yes" -a -x /usr/sbin/afpd ]; then
-           killproc afpd
-           RETVAL_AFPD=$?
-       fi
-
-       if [ x"${CNID_METAD_RUN}" = x"yes" -a -x /usr/sbin/cnid_metad ]; then
-           killproc cnid_metad
-           RETVAL_CNID_METAD=$?
-       fi
-
-       if [ $RETVAL_ATALKD -eq 0 -a $RETVAL_PAPD -eq 0 -a $RETVAL_CNID_METAD -eq 0 -a $RETVAL_AFPD -eq 0 ] ; then
-           RETVAL=0
-           rm -f /var/lock/subsys/atalk || RETVAL=1
-       fi
-       echo ""
-       ;;
-  restart|reload)
-       $0 stop
-       $0 start
-       ;;
-  status)
-       status atalkd
-       ;;
-  *)
-       echo "Usage: atalk {start|stop|restart|status}"
-       exit 1
-esac
-
-exit $RETVAL
index 687228e6232cbc9484b66ed17a7dae4f7f4f80b9..ec40a15ea39153e9205c39104eea55d3f331f4d6 100644 (file)
@@ -1,7 +1,5 @@
 # Makefile.am for etc/uams/
 
-SUBDIRS = uams_krb4
-
 #
 # conditionally build some modules
 #
diff --git a/etc/uams/uams_krb4/.gitignore b/etc/uams/uams_krb4/.gitignore
deleted file mode 100644 (file)
index c22a7f2..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-.libs
-.deps
-*.o
-*.so
-*.la
-core
-Makefile.in
-Makefile
-.gitignore
-*.o
diff --git a/etc/uams/uams_krb4/Makefile.am b/etc/uams/uams_krb4/Makefile.am
deleted file mode 100644 (file)
index 219e74b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# Makefile.am for etc/uams/uams_krb4/
-
-if USE_KERBEROS
-KERBEROS_MODULE = uams_krb4.la
-else
-KERBEROS_MODULE =
-endif
-
-uams_krb4_la_SOURCES = kuam.c lifetime.c send_to_kdc.c uams_krb4.c
-uams_krb4_la_LDFLAGS = -module -avoid-version
-
-uamsdir = @UAMS_PATH@
-uams_LTLIBRARIES = $(KERBEROS_MODULE)
diff --git a/etc/uams/uams_krb4/kuam.c b/etc/uams/uams_krb4/kuam.c
deleted file mode 100644 (file)
index 3c79064..0000000
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * $Id: kuam.c,v 1.4 2001-06-25 20:13:45 rufustfirefly Exp $
- *
- * Copyright (c) 1990,1994 Regents of The University of Michigan.
- * All Rights Reserved.  See COPYRIGHT.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#ifdef UAM_AFSKRB
-
-#include <mit-copyright.h>
-#include <krb.h>
-#include <des.h>
-#include <prot.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-
-/* use the bsd time.h struct defs for PC too! */
-#include <sys/time.h>
-#include <sys/types.h>
-
-int     swap_bytes;
-
-/*
- * krb_get_in_tkt() gets a ticket for a given principal to use a given
- * service and stores the returned ticket and session key for future
- * use.
- *
- * The "user", "instance", and "realm" arguments give the identity of
- * the client who will use the ticket.  The "service" and "sinstance"
- * arguments give the identity of the server that the client wishes
- * to use.  (The realm of the server is the same as the Kerberos server
- * to whom the request is sent.)  The "life" argument indicates the
- * desired lifetime of the ticket; the "key_proc" argument is a pointer
- * to the routine used for getting the client's private key to decrypt
- * the reply from Kerberos.  The "decrypt_proc" argument is a pointer
- * to the routine used to decrypt the reply from Kerberos; and "arg"
- * is an argument to be passed on to the "key_proc" routine.
- *
- * If all goes well, krb_get_in_tkt() returns INTK_OK, otherwise it
- * returns an error code:  If an AUTH_MSG_ERR_REPLY packet is returned
- * by Kerberos, then the error code it contains is returned.  Other
- * error codes returned by this routine include INTK_PROT to indicate
- * wrong protocol version, INTK_BADPW to indicate bad password (if
- * decrypted ticket didn't make sense), INTK_ERR if the ticket was for
- * the wrong server or the ticket store couldn't be initialized.
- *
- * The format of the message sent to Kerberos is as follows:
- *
- * Size                        Variable                Field
- * ----                        --------                -----
- *
- * 1 byte              KRB_PROT_VERSION        protocol version number
- * 1 byte              AUTH_MSG_KDC_REQUEST |  message type
- *                     HOST_BYTE_ORDER         local byte order in lsb
- * string              user                    client's name
- * string              instance                client's instance
- * string              realm                   client's realm
- * 4 bytes             tlocal.tv_sec           timestamp in seconds
- * 1 byte              life                    desired lifetime
- * string              service                 service's name
- * string              sinstance               service's instance
- */
-
-kuam_get_in_tkt(user, instance, realm, service, sinstance, life, rpkt )
-    char       *user;
-    char       *instance;
-    char       *realm;
-    char       *service;
-    char       *sinstance;
-    int                life;
-    KTEXT      rpkt;
-{
-    KTEXT_ST pkt_st;
-    KTEXT pkt = &pkt_st;       /* Packet to KDC */
-    KTEXT_ST cip_st;
-    KTEXT cip = &cip_st;       /* Returned Ciphertext */
-    KTEXT_ST tkt_st;
-    KTEXT tkt = &tkt_st;       /* Current ticket */
-    unsigned char *v = pkt->dat; /* Prot vers no */
-    unsigned char *t = (pkt->dat+1); /* Prot msg type */
-    int msg_byte_order;
-    int kerror;
-    struct timeval t_local;
-    u_int32_t rep_err_code;
-
-
-    /* BUILD REQUEST PACKET */
-
-    /* Set up the fixed part of the packet */
-    *v = (unsigned char) KRB_PROT_VERSION;
-    *t = (unsigned char) AUTH_MSG_KDC_REQUEST;
-    *t |= HOST_BYTE_ORDER;
-
-    /* Now for the variable info */
-    (void) strcpy((char *)(pkt->dat+2),user); /* aname */
-    pkt->length = 3 + strlen(user);
-    (void) strcpy((char *)(pkt->dat+pkt->length),
-                 instance);    /* instance */
-    pkt->length += 1 + strlen(instance);
-    (void) strcpy((char *)(pkt->dat+pkt->length),realm); /* realm */
-    pkt->length += 1 + strlen(realm);
-
-    (void) gettimeofday(&t_local,(struct timezone *) 0);
-    /* timestamp */
-    memcpy((pkt->dat+pkt->length), &(t_local.tv_sec), 4);
-    pkt->length += 4;
-
-    *(pkt->dat+(pkt->length)++) = (char) life;
-    (void) strcpy((char *)(pkt->dat+pkt->length),service);
-    pkt->length += 1 + strlen(service);
-    (void) strcpy((char *)(pkt->dat+pkt->length),sinstance);
-    pkt->length += 1 + strlen(sinstance);
-
-    rpkt->length = 0;
-
-    /* SEND THE REQUEST AND RECEIVE THE RETURN PACKET */
-
-    if (kerror = send_to_kdc(pkt, rpkt, realm)) return(kerror);
-
-    /* check packet version of the returned packet */
-    if (pkt_version(rpkt) != KRB_PROT_VERSION)
-        return(INTK_PROT);
-
-    /* Check byte order */
-    msg_byte_order = pkt_msg_type(rpkt) & 1;
-    swap_bytes = 0;
-    if (msg_byte_order != HOST_BYTE_ORDER) {
-        swap_bytes++;
-    }
-
-    switch (pkt_msg_type(rpkt) & ~1) {
-    case AUTH_MSG_KDC_REPLY:
-        break;
-    case AUTH_MSG_ERR_REPLY:
-        memcpy(&rep_err_code,pkt_err_code(rpkt),4);
-        if (swap_bytes) swap_u_long(rep_err_code);
-        return((int)rep_err_code);
-    default:
-        return(INTK_PROT);
-    }
-
-    return( INTK_OK );
-}
-
-kuam_set_in_tkt( user, instance, realm, service, sinstance, ptr)
-    char       *user, *instance, *realm, *service, *sinstance, *ptr;
-{
-    KTEXT_ST           tkt_st;
-    KTEXT              tkt = &tkt_st;
-    struct timeval     t_local;
-    int                        lifetime, kvno, kerror;
-    int32_t            kdc_time;
-    C_Block            ses;
-    char               s_name[ SNAME_SZ ], s_instance[ INST_SZ ];
-    char               rlm[ REALM_SZ ];
-
-    /* extract session key */
-    memcpy(ses, ptr, 8);
-    ptr += 8;
-
-    /* extract server's name */
-    (void) strcpy(s_name,ptr);
-    ptr += strlen(s_name) + 1;
-
-    /* extract server's instance */
-    (void) strcpy(s_instance,ptr);
-    ptr += strlen(s_instance) + 1;
-
-    /* extract server's realm */
-    (void) strcpy(rlm,ptr);
-    ptr += strlen(rlm) + 1;
-
-    /* extract ticket lifetime, server key version, ticket length */
-    /* be sure to avoid sign extension on lifetime! */
-    lifetime = (unsigned char) ptr[0];
-    kvno = (unsigned char) ptr[1];
-    tkt->length = (unsigned char) ptr[2];
-    ptr += 3;
-
-    /* extract ticket itself */
-    memcpy( tkt->dat, ptr, tkt->length);
-    ptr += tkt->length;
-
-    if (strcmp(s_name, service) || strcmp(s_instance, sinstance) ||
-        strcmp(rlm, realm))    /* not what we asked for */
-       return(INTK_ERR);       /* we need a better code here XXX */
-
-    /* check KDC time stamp */
-    memcpy(&kdc_time, ptr, 4); /* Time (coarse) */
-    if (swap_bytes) swap_u_long(kdc_time);
-
-    ptr += 4;
-
-    (void) gettimeofday(&t_local,(struct timezone *) 0);
-    if (abs((int)(t_local.tv_sec - kdc_time)) > CLOCK_SKEW) {
-        return(RD_AP_TIME);            /* XXX should probably be better
-                                          code */
-    }
-
-    /* initialize ticket cache */
-    if (in_tkt(user,instance) != KSUCCESS)
-       return(INTK_ERR);
-
-    /* stash ticket, session key, etc. for future use */
-    if (kerror = save_credentials(s_name, s_instance, rlm, ses,
-                                 lifetime, kvno, tkt, t_local.tv_sec))
-       return(kerror);
-
-    return(INTK_OK);
-}
-
-#endif /* UAM_AFSKRB */
diff --git a/etc/uams/uams_krb4/lifetime.c b/etc/uams/uams_krb4/lifetime.c
deleted file mode 100644 (file)
index 428eac9..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * $Id: lifetime.c,v 1.3 2001-06-25 20:13:45 rufustfirefly Exp $
- *
- * Ticket lifetime.  This defines the table used to lookup lifetime
- * for the fixed part of rande of the one byte lifetime field.  Values
- * less than 0x80 are intrpreted as the number of 5 minute intervals.
- * Values from 0x80 to 0xBF should be looked up in this table.  The
- * value of 0x80 is the same using both methods: 10 and two-thirds
- * hours .  The lifetime of 0xBF is 30 days.  The intervening values
- * of have a fixed ratio of roughly 1.06914.  The value 0xFF is
- * defined to mean a ticket has no expiration time.  This should be
- * used advisedly since individual servers may impose defacto
- * upperbounds on ticket lifetimes.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <sys/types.h>
-#include <netatalk/endian.h>
-
-#define TKTLIFENUMFIXED 64
-#define TKTLIFEMINFIXED 0x80
-#define TKTLIFEMAXFIXED 0xBF
-#define TKTLIFENOEXPIRE 0xFF
-#define MAXTKTLIFETIME (30*24*3600)    /* 30 days */
-#ifndef NEVERDATE
-#define NEVERDATE ((u_int32_t)-1L)
-#endif /* NEVERDATE */
-
-static int tkt_lifetimes[TKTLIFENUMFIXED] = {
-    38400,                             /* 10.67 hours, 0.44 days */ 
-    41055,                             /* 11.40 hours, 0.48 days */ 
-    43894,                             /* 12.19 hours, 0.51 days */ 
-    46929,                             /* 13.04 hours, 0.54 days */ 
-    50174,                             /* 13.94 hours, 0.58 days */ 
-    53643,                             /* 14.90 hours, 0.62 days */ 
-    57352,                             /* 15.93 hours, 0.66 days */ 
-    61318,                             /* 17.03 hours, 0.71 days */ 
-    65558,                             /* 18.21 hours, 0.76 days */ 
-    70091,                             /* 19.47 hours, 0.81 days */ 
-    74937,                             /* 20.82 hours, 0.87 days */ 
-    80119,                             /* 22.26 hours, 0.93 days */ 
-    85658,                             /* 23.79 hours, 0.99 days */ 
-    91581,                             /* 25.44 hours, 1.06 days */ 
-    97914,                             /* 27.20 hours, 1.13 days */ 
-    104684,                            /* 29.08 hours, 1.21 days */ 
-    111922,                            /* 31.09 hours, 1.30 days */ 
-    119661,                            /* 33.24 hours, 1.38 days */ 
-    127935,                            /* 35.54 hours, 1.48 days */ 
-    136781,                            /* 37.99 hours, 1.58 days */ 
-    146239,                            /* 40.62 hours, 1.69 days */ 
-    156350,                            /* 43.43 hours, 1.81 days */ 
-    167161,                            /* 46.43 hours, 1.93 days */ 
-    178720,                            /* 49.64 hours, 2.07 days */ 
-    191077,                            /* 53.08 hours, 2.21 days */ 
-    204289,                            /* 56.75 hours, 2.36 days */ 
-    218415,                            /* 60.67 hours, 2.53 days */ 
-    233517,                            /* 64.87 hours, 2.70 days */ 
-    249664,                            /* 69.35 hours, 2.89 days */ 
-    266926,                            /* 74.15 hours, 3.09 days */ 
-    285383,                            /* 79.27 hours, 3.30 days */ 
-    305116,                            /* 84.75 hours, 3.53 days */ 
-    326213,                            /* 90.61 hours, 3.78 days */ 
-    348769,                            /* 96.88 hours, 4.04 days */ 
-    372885,                            /* 103.58 hours, 4.32 days */ 
-    398668,                            /* 110.74 hours, 4.61 days */ 
-    426234,                            /* 118.40 hours, 4.93 days */ 
-    455705,                            /* 126.58 hours, 5.27 days */ 
-    487215,                            /* 135.34 hours, 5.64 days */ 
-    520904,                            /* 144.70 hours, 6.03 days */ 
-    556921,                            /* 154.70 hours, 6.45 days */ 
-    595430,                            /* 165.40 hours, 6.89 days */ 
-    636601,                            /* 176.83 hours, 7.37 days */ 
-    680618,                            /* 189.06 hours, 7.88 days */ 
-    727680,                            /* 202.13 hours, 8.42 days */ 
-    777995,                            /* 216.11 hours, 9.00 days */ 
-    831789,                            /* 231.05 hours, 9.63 days */ 
-    889303,                            /* 247.03 hours, 10.29 days */ 
-    950794,                            /* 264.11 hours, 11.00 days */ 
-    1016537,                           /* 282.37 hours, 11.77 days */ 
-    1086825,                           /* 301.90 hours, 12.58 days */ 
-    1161973,                           /* 322.77 hours, 13.45 days */ 
-    1242318,                           /* 345.09 hours, 14.38 days */ 
-    1328218,                           /* 368.95 hours, 15.37 days */ 
-    1420057,                           /* 394.46 hours, 16.44 days */ 
-    1518247,                           /* 421.74 hours, 17.57 days */ 
-    1623226,                           /* 450.90 hours, 18.79 days */ 
-    1735464,                           /* 482.07 hours, 20.09 days */ 
-    1855462,                           /* 515.41 hours, 21.48 days */ 
-    1983758,                           /* 551.04 hours, 22.96 days */ 
-    2120925,                           /* 589.15 hours, 24.55 days */ 
-    2267576,                           /* 629.88 hours, 26.25 days */ 
-    2424367,                           /* 673.44 hours, 28.06 days */ 
-    2592000};                          /* 720.00 hours, 30.00 days */ 
-
-/*
- * krb_life_to_time - takes a start time and a Kerberos standard
- * lifetime char and returns the corresponding end time.  There are
- * four simple cases to be handled.  The first is a life of 0xff,
- * meaning no expiration, and results in an end time of 0xffffffff.
- * The second is when life is less than the values covered by the
- * table.  In this case, the end time is the start time plus the
- * number of 5 minute intervals specified by life.  The third case
- * returns start plus the MAXTKTLIFETIME if life is greater than
- * TKTLIFEMAXFIXED.  The last case, uses the life value (minus
- * TKTLIFEMINFIXED) as an index into the table to extract the lifetime
- * in seconds, which is added to start to produce the end time.
- */
-u_int32_t krb_life_to_time(start, life)
-u_int32_t start;
-int life;
-{
-    life = (unsigned char) life;
-    if (life == TKTLIFENOEXPIRE) return NEVERDATE;
-    if (life < TKTLIFEMINFIXED) return start + life*5*60;
-    if (life > TKTLIFEMAXFIXED) return start + MAXTKTLIFETIME;
-    return start + tkt_lifetimes[life - TKTLIFEMINFIXED];
-}
-
-/*
- * krb_time_to_life - takes start and end times for the ticket and
- * returns a Kerberos standard lifetime char, possibily using the
- * tkt_lifetimes table for lifetimes above 127*5 minutes.  First, the
- * special case of (end == NEVERDATE) is handled to mean no
- * expiration.  Then negative lifetimes and those greater than the
- * maximum ticket lifetime are rejected.  Then lifetimes less than the
- * first table entry are handled by rounding the requested lifetime
- * *up* to the next 5 minute interval.  The final step is to search
- * the table for the smallest entry *greater than or equal* to the
- * requested entry.
- */
-int krb_time_to_life(start, end)
-u_int32_t start;
-u_int32_t end;
-{
-    int32_t lifetime;
-    int i;
-
-    if (end == NEVERDATE) return TKTLIFENOEXPIRE;
-    lifetime = end - start;
-    if (lifetime > MAXTKTLIFETIME || lifetime <= 0) return 0;
-    if (lifetime < tkt_lifetimes[0]) return (lifetime + 5*60 - 1)/(5*60);
-    for (i=0; i<TKTLIFENUMFIXED; i++) {
-       if (lifetime <= tkt_lifetimes[i]) {
-           return i+TKTLIFEMINFIXED;
-       }
-    }
-    return 0;
-}
diff --git a/etc/uams/uams_krb4/send_to_kdc.c b/etc/uams/uams_krb4/send_to_kdc.c
deleted file mode 100644 (file)
index d20856f..0000000
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- * $Id: send_to_kdc.c,v 1.4 2001-06-25 20:13:45 rufustfirefly Exp $
- * $Author: rufustfirefly $
- *
- * Copyright (c) 1990,1994 Regents of The University of Michigan.
- * All Rights Reserved.  See COPYRIGHT.
- *
- * $Source: /home/ralph/netatalk/rsync/netatalk/etc/uams/uams_krb4/send_to_kdc.c,v $
- *
- * Copyright 1987, 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- */
-
-#ifndef lint
-static char rcsid_send_to_kdc_c[] =
-"$Id: send_to_kdc.c,v 1.4 2001-06-25 20:13:45 rufustfirefly Exp $";
-#endif /* lint */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#ifdef UAM_AFSKRB
-
-#include <mit-copyright.h>
-
-#include <krb.h>
-#include <prot.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#ifdef lint
-#include <sys/uio.h>            /* struct iovec to make lint happy */
-#endif /* lint */
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <string.h>
-
-#define S_AD_SZ sizeof(struct sockaddr_in)
-
-extern int krb_debug;
-
-extern char *malloc(), *calloc(), *realloc();
-
-int krb_udp_port = 0;
-
-/* CLIENT_KRB_TIMEOUT indicates the time to wait before
- * retrying a server.  It's defined in "krb.h".
- */
-static struct timeval timeout = { CLIENT_KRB_TIMEOUT, 0};
-static char *prog = "send_to_kdc";
-static send_recv();
-
-/*
- * This file contains two routines, send_to_kdc() and send_recv().
- * send_recv() is a static routine used by send_to_kdc().
- */
-
-/*
- * send_to_kdc() sends a message to the Kerberos authentication
- * server(s) in the given realm and returns the reply message.
- * The "pkt" argument points to the message to be sent to Kerberos;
- * the "rpkt" argument will be filled in with Kerberos' reply.
- * The "realm" argument indicates the realm of the Kerberos server(s)
- * to transact with.  If the realm is null, the local realm is used.
- *
- * If more than one Kerberos server is known for a given realm,
- * different servers will be queried until one of them replies.
- * Several attempts (retries) are made for each server before
- * giving up entirely.
- *
- * If an answer was received from a Kerberos host, KSUCCESS is
- * returned.  The following errors can be returned:
- *
- * SKDC_CANT    - can't get local realm
- *              - can't find "kerberos" in /etc/services database
- *              - can't open socket
- *              - can't bind socket
- *              - all ports in use
- *              - couldn't find any Kerberos host
- *
- * SKDC_RETRY   - couldn't get an answer from any Kerberos server,
- *               after several retries
- */
-
-send_to_kdc(pkt,rpkt,realm)
-    KTEXT pkt;
-    KTEXT rpkt;
-    char *realm;
-{
-    int i, f;
-    int no_host; /* was a kerberos host found? */
-    int retry;
-    int n_hosts;
-    int retval;
-    struct sockaddr_in to;
-    struct hostent *host, *hostlist;
-    char *cp;
-    char krbhst[MAX_HSTNM];
-    char lrealm[REALM_SZ];
-
-    /*
-     * If "realm" is non-null, use that, otherwise get the
-     * local realm.
-     */
-    if (realm)
-       (void) strcpy(lrealm, realm);
-    else
-       if (krb_get_lrealm(lrealm,1)) {
-           if (krb_debug)
-               fprintf(stderr, "%s: can't get local realm\n", prog);
-           return(SKDC_CANT);
-       }
-    if (krb_debug)
-        printf("lrealm is %s\n", lrealm);
-    if (krb_udp_port == 0) {
-        register struct servent *sp;
-        if ((sp = getservbyname("kerberos","udp")) == 0) {
-            if (krb_debug)
-                fprintf(stderr, "%s: Can't get kerberos/udp service\n",
-                        prog);
-            return(SKDC_CANT);
-        }
-        krb_udp_port = sp->s_port;
-        if (krb_debug)
-            printf("krb_udp_port is %d\n", krb_udp_port);
-    }
-    memset(&to, 0, S_AD_SZ);
-    hostlist = (struct hostent *) malloc(sizeof(struct hostent));
-    if (!hostlist)
-        return (/*errno */SKDC_CANT);
-    if ((f = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
-        if (krb_debug)
-            fprintf(stderr,"%s: Can't open socket\n", prog);
-        return(SKDC_CANT);
-    }
-    /* from now on, exit through rtn label for cleanup */
-
-    no_host = 1;
-    /* get an initial allocation */
-    n_hosts = 0;
-    for (i = 1; krb_get_krbhst(krbhst, lrealm, i) == KSUCCESS; ++i) {
-        if (krb_debug) {
-            printf("Getting host entry for %s...",krbhst);
-            (void) fflush(stdout);
-        }
-        host = gethostbyname(krbhst);
-        if (krb_debug) {
-            printf("%s.\n",
-                   host ? "Got it" : "Didn't get it");
-            (void) fflush(stdout);
-        }
-        if (!host)
-            continue;
-        no_host = 0;    /* found at least one */
-        n_hosts++;
-        /* preserve host network address to check later
-         * (would be better to preserve *all* addresses,
-         * take care of that later)
-         */
-        hostlist = (struct hostent *)
-            realloc((char *)hostlist,
-                    (unsigned)
-                    sizeof(struct hostent)*(n_hosts+1));
-        if (!hostlist)
-            return /*errno */SKDC_CANT;
-        memcpy(&hostlist[n_hosts-1], host, sizeof(struct hostent));
-        host = &hostlist[n_hosts-1];
-        cp = malloc((unsigned)host->h_length);
-        if (!cp) {
-            retval = /*errno */SKDC_CANT;
-            goto rtn;
-        }
-        memcpy(cp, host->h_addr, host->h_length);
-/* At least Sun OS version 3.2 (or worse) and Ultrix version 2.2
-   (or worse) only return one name ... */
-#if !(defined(ULTRIX022) || (defined(SunOS) && SunOS < 40))
-        host->h_addr_list = (char **)malloc(sizeof(char *));
-        if (!host->h_addr_list) {
-            retval = /*errno */SKDC_CANT;
-            goto rtn;
-        }
-#endif /* ULTRIX022 || SunOS */
-        host->h_addr = cp;
-        memset(&hostlist[n_hosts], 0, sizeof(struct hostent));
-        to.sin_family = host->h_addrtype;
-        memcpy(&to.sin_addr, host->h_addr, host->h_length);
-        to.sin_port = krb_udp_port;
-        if (send_recv(pkt, rpkt, f, &to, hostlist)) {
-            retval = KSUCCESS;
-            goto rtn;
-        }
-        if (krb_debug) {
-            printf("Timeout, error, or wrong descriptor\n");
-            (void) fflush(stdout);
-        }
-    }
-    if (no_host) {
-       if (krb_debug)
-           fprintf(stderr, "%s: can't find any Kerberos host.\n",
-                   prog);
-        retval = SKDC_CANT;
-        goto rtn;
-    }
-    /* retry each host in sequence */
-    for (retry = 0; retry < CLIENT_KRB_RETRY; ++retry) {
-        for (host = hostlist; host->h_name != (char *)NULL; host++) {
-            to.sin_family = host->h_addrtype;
-            memcpy(&to.sin_addr, host->h_addr, host->h_length);
-            if (send_recv(pkt, rpkt, f, &to, hostlist)) {
-                retval = KSUCCESS;
-                goto rtn;
-            }
-        }
-    }
-    retval = SKDC_RETRY;
-rtn:
-    (void) close(f);
-    if (hostlist) {
-        register struct hostent *hp;
-        for (hp = hostlist; hp->h_name; hp++)
-#if !(defined(ULTRIX022) || (defined(SunOS) && SunOS < 40))
-            if (hp->h_addr_list) {
-#endif /* ULTRIX022 || SunOS */
-                if (hp->h_addr)
-                    free(hp->h_addr);
-#if !(defined(ULTRIX022) || (defined(SunOS) && SunOS < 40))
-                free((char *)hp->h_addr_list);
-            }
-#endif /* ULTRIX022 || SunOS */
-        free((char *)hostlist);
-    }
-    return(retval);
-}
-
-/*
- * try to send out and receive message.
- * return 1 on success, 0 on failure
- */
-
-static send_recv(pkt,rpkt,f,_to,addrs)
-    KTEXT pkt;
-    KTEXT rpkt;
-    int f;
-    struct sockaddr_in *_to;
-    struct hostent *addrs;
-{
-    fd_set readfds;
-    register struct hostent *hp;
-    struct sockaddr_in from;
-    int sin_size, rc;
-    int numsent;
-
-    if (krb_debug) {
-        if (_to->sin_family == AF_INET)
-            printf("Sending message to %s...",
-                   inet_ntoa(_to->sin_addr));
-        else
-            printf("Sending message...");
-        (void) fflush(stdout);
-    }
-    if ((numsent = sendto(f,(char *)(pkt->dat), pkt->length, 0, 
-                         (struct sockaddr *)_to,
-                          S_AD_SZ)) != pkt->length) {
-        if (krb_debug)
-            printf("sent only %d/%d\n",numsent, pkt->length);
-        return 0;
-    }
-    if (krb_debug) {
-        printf("Sent\nWaiting for reply...");
-        (void) fflush(stdout);
-    }
-    FD_ZERO(&readfds);
-    FD_SET(f, &readfds);
-    errno = 0;
-    /* select - either recv is ready, or timeout */
-    /* see if timeout or error or wrong descriptor */
-    if (select(f + 1, &readfds, (fd_set *)0, (fd_set *)0, &timeout) < 1
-        || !FD_ISSET(f, &readfds)) {
-        if (krb_debug) {
-            fprintf(stderr, "select failed: readfds=%x",
-                    readfds);
-            perror("");
-        }
-        return 0;
-    }
-    sin_size = sizeof(from);
-    if (( rc = recvfrom(f, (char *)(rpkt->dat), sizeof(rpkt->dat), 0,
-                (struct sockaddr *)&from, &sin_size)) < 0) {
-        if (krb_debug)
-            perror("recvfrom");
-        return 0;
-    }
-    rpkt->length = rc;
-    if (krb_debug) {
-        printf("received packet from %s\n", inet_ntoa(from.sin_addr));
-        fflush(stdout);
-    }
-    for (hp = addrs; hp->h_name != (char *)NULL; hp++) {
-        if (!memcmp(hp->h_addr, (char *)&from.sin_addr.s_addr,
-                  hp->h_length)) {
-            if (krb_debug) {
-                printf("Received it\n");
-                (void) fflush(stdout);
-            }
-            return 1;
-        }
-        if (krb_debug)
-            fprintf(stderr,
-                    "packet not from %x\n",
-                    hp->h_addr);
-    }
-    if (krb_debug)
-        fprintf(stderr, "%s: received packet from wrong host! (%x)\n",
-                "send_to_kdc(send_rcv)", from.sin_addr.s_addr);
-    return 0;
-}
-
-#endif /* UAM_AFSKRB */
diff --git a/etc/uams/uams_krb4/uams_krb4.c b/etc/uams/uams_krb4/uams_krb4.c
deleted file mode 100644 (file)
index 35b1493..0000000
+++ /dev/null
@@ -1,780 +0,0 @@
-/*
- * $Id: uams_krb4.c,v 1.10 2009-10-15 11:39:48 didg Exp $
- *
- * Copyright (c) 1990,1993 Regents of The University of Michigan.
- * All Rights Reserved.  See COPYRIGHT.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#if defined( KRB ) || defined( UAM_AFSKRB )
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <limits.h>
-#include <string.h>
-#include <ctype.h>
-#include <pwd.h>
-#include <atalk/logger.h>
-#include <netinet/in.h>
-#include <des.h>
-#include <krb.h>
-#if 0
-#include <prot.h>
-#endif /* 0 */
-
-#include <netatalk/endian.h>
-#include <atalk/afp.h>
-#include <atalk/compat.h>
-#include <atalk/util.h>
-#include <atalk/uam.h>
-
-static C_Block                 seskey;
-static Key_schedule            seskeysched;
-
-static char            realm[ REALM_SZ ];
-
-#ifdef UAM_AFSKRB
-static int             validseskey = 0;
-static int             logged = 0;
-static char            *tktfile;
-static char            instance[ INST_SZ ], name[ ANAME_SZ ];
-#endif /* UAM_AFSKRB */
-
-#ifdef AFS
-#include <afs/stds.h>
-#include <rx/rxkad.h>
-#include <afs/afs.h>
-#include <afs/venus.h>
-#include <afs/afsint.h>
-
-char *ka_LocalCell();
-
-struct ClearToken {
-    int32_t AuthHandle;
-    char HandShakeKey[8];
-    int32_t ViceId;
-    int32_t BeginTimestamp;
-    int32_t EndTimestamp;
-};
-#endif /* AFS */
-
-
-#ifdef KRB
-
-static void lcase( p )
-    char       *p;
-{
-    for (; *p; p++ ) {
-       if ( isupper( *p )) {
-           *p = tolower( *p );
-       }
-    }
-    return;
-}
-
-static void ucase( p )
-    char       *p;
-{
-    for (; *p; p++ ) {
-       if ( islower( *p )) {
-           *p = toupper( *p );
-       }
-    }
-    return;
-}
-
-#define KRB4CMD_HELO   1
-#define KRB4RPL_REALM  2
-#define KRB4WRT_SESS   3
-#define KRB4RPL_DONE   4
-#define KRB4RPL_PRINC  5
-#define KRB4WRT_TOKEN  6
-#define KRB4WRT_SKIP   7
-#define KRB4RPL_DONEMUT        8
-#define KRB4CMD_SESS   9
-#define KRB4CMD_TOKEN  10
-#define KRB4CMD_SKIP   11
-
-static int krb4_login(void *obj, struct passwd **uam_pwd,
-                     char *ibuf, size_t ibuflen,
-                     char *rbuf, size_t *rbuflen )
-{
-    char               *p;
-    char               *username;
-    struct passwd      *pwd;
-    u_int16_t          len;
-    KTEXT_ST           tkt;
-    static AUTH_DAT    ad;
-    int                        rc, proto;
-    size_t             ulen;
-    char               inst[ 40 ], princ[ 40 ];
-
-    if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, &username, &ulen) < 0)
-      return AFPERR_MISC;
-
-    if (uam_afpserver_option(obj, UAM_OPTION_PROTOCOL, &proto, NULL) < 0)
-      return AFPERR_MISC;
-
-    switch( *ibuf ) {
-       case KRB4CMD_SESS:
-           LOG(log_info, logtype_default, "krb4_login: KRB4CMD_SESS" );
-           ++ibuf;
-           p = ibuf;
-           memcpy( &len, p, sizeof( u_int16_t ));
-           tkt.length = ntohs( len );
-           p += sizeof( u_int16_t );
-
-           if ( tkt.length <= 0 || tkt.length > MAX_KTXT_LEN ) {
-               *rbuflen = 0;
-               LOG(log_info, logtype_default, "krb4_login: tkt.length = %d", tkt.length );
-               return( AFPERR_BADUAM );
-           }
-
-           memcpy( tkt.dat, p, tkt.length );
-           p += tkt.length;
-
-           strcpy( inst, "*" );
-
-           switch( proto ) {
-               case AFPPROTO_ASP:
-                   strcpy( princ, "afpserver" );
-                   break;
-               case AFPPROTO_DSI:
-                   strcpy( princ, "rcmd" );
-                   break;
-           }
-
-           if( (rc = krb_rd_req( &tkt, princ, inst, 0, &ad, "" )) 
-               != RD_AP_OK ) {
-               LOG(log_error, logtype_default, 
-                       "krb4_login: krb_rd_req(): %s", krb_err_txt[ rc ] );
-               *rbuflen = 0;
-               return( AFPERR_BADUAM );
-           }
-
-           LOG(log_info, logtype_default, "krb4_login: %s.%s@%s", ad.pname, ad.pinst, 
-               ad.prealm );
-           strcpy( realm, ad.prealm );
-           memcpy( seskey, ad.session, sizeof( C_Block ) );
-           key_sched( (C_Block *)seskey, seskeysched );
-
-           strncpy( username, ad.pname, ulen );
-
-           p = rbuf;
-
-#ifdef AFS
-           *p = KRB4RPL_DONE;  /* XXX */
-           *rbuflen = 1;
-
-           if (( pwd = uam_getname( obj, ad.pname, strlen(ad.pname) )) == NULL ) {
-               return AFPERR_PARAM;
-           }
-/*
-           if (uam_checkuser( pwd ) < 0) {
-               return AFPERR_NOTAUTH;
-           }
-*/
-           *uam_pwd = pwd;
-           return( AFP_OK ); /* Should this be AFPERR_AUTHCONT? */
-#else /* AFS */
-           /* get principals */
-           *p++ = KRB4RPL_PRINC;
-           len = strlen( realm );
-           *p++ = len + 1;
-           *p++ = '@';
-           strcpy( p, realm );
-           p += len + 1;
-           break;
-#endif /* AFS */
-       case KRB4CMD_HELO:
-           p = rbuf;
-           if (krb_get_lrealm( realm, 1 ) != KSUCCESS ) {
-               LOG(log_error, logtype_default, "krb4_login: can't get local realm!" );
-               return( AFPERR_NOTAUTH );
-           }
-           *p++ = KRB4RPL_REALM;
-           *p++ = 1;
-           len = strlen( realm );
-           *p++ = len;
-           strcpy( p, realm );
-           p += len + 1;
-           break;
-
-       default:
-           *rbuflen = 0;
-           LOG(log_info, logtype_default, "krb4_login: bad command %d", *ibuf );
-           return( AFPERR_NOTAUTH );
-    }
-
-#ifdef AFS
-    if ( setpag() < 0 ) {
-       *rbuflen = 0;
-       LOG(log_error, logtype_default, "krb_login: setpag: %s", strerror(errno) );
-       return( AFPERR_BADUAM );
-    }
-#endif /*AFS*/
-
-    *rbuflen = p - rbuf;
-    return( AFPERR_AUTHCONT );
-}
-
-static int krb4_action( void *v1, void *v2, const int i )
-{
-       return i;
-}
-
-/*
-   I have a hunch that problems might arise on platforms 
-   with non-16bit short's and non-32bit int's
-*/
-static int krb4_logincont(void *obj, struct passwd **uam_pwd,
-                         char *ibuf, size_t ibuflen,
-                         char *rbuf, size_t *rbuflen)
-{
-    static struct passwd       *pwd;
-    KTEXT_ST           tkt;
-    static AUTH_DAT    ad;
-    int                        rc;
-    u_int16_t          len;
-    char               *p, *username, *servername;
-    CREDENTIALS                cr;
-#ifdef AFS
-    struct ViceIoctl   vi;
-    struct ClearToken  ct;
-#endif /* AFS */
-    char               buf[ 1024 ];
-    int                        aint, ulen, snlen;
-
-    if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, &username, &ulen) < 0)
-      return AFPERR_MISC;
-
-    if (uam_afpserver_option(obj, UAM_OPTION_HOSTNAME, &servername, &snlen) < 0)
-      return AFPERR_MISC;
-
-    ibuf++;
-    switch ( rc = *ibuf++ ) {
-       case KRB4CMD_TOKEN :
-#ifdef AFS
-           p = buf;
-           memcpy( &len, ibuf, sizeof( u_int16_t ) );
-           ibuf += sizeof( len );
-           len = ntohs( len );
-           aint = len;
-           memcpy( p, &aint, sizeof( int ) );
-           p += sizeof( int );
-           memcpy( p, ibuf, len );
-           pcbc_encrypt( (C_Block *)p, (C_Block *)p, len, seskeysched,
-               seskey, DECRYPT );
-           p += len;
-           ibuf += len;
-
-           memcpy( &len, ibuf, sizeof( u_int16_t ) );
-           ibuf += sizeof( u_int16_t ) );
-           len = ntohs( len );
-
-           if ( len != sizeof( struct ClearToken ) ) {
-               LOG(log_error, logtype_default, "krb4_logincont: token too short" );
-               *rbuflen = 0;
-               return( AFPERR_BADUAM );
-           }
-           memcpy( &ct, ibuf, len );
-
-           pcbc_encrypt( (C_Block *)&ct, (C_Block *)&ct, len, 
-               seskeysched, seskey, DECRYPT );
-
-           aint = sizeof( struct ClearToken );
-           memcpy( p, &aint, sizeof( int ) );
-           p += sizeof( int );
-           memcpy( p, &ct, sizeof( struct ClearToken ) );
-           p += sizeof( struct ClearToken );
-
-           aint = 0;
-           memcpy( p, &aint, sizeof( int ) );
-           p += sizeof( int );
-
-           lcase( realm );
-           strcpy( p, realm );
-           p += strlen( realm ) + 1;
-
-           vi.in = buf;
-           vi.in_size = p - buf;
-           vi.out = buf;
-           vi.out_size = sizeof( buf );
-
-           if ( pioctl( 0, VIOCSETTOK, &vi, 0 ) < 0 ) {
-               LOG(log_error, logtype_default, "krb4_logincont: pioctl: %s", strerror(errno) );
-               *rbuflen = 0;
-               return( AFPERR_BADUAM );
-           }
-           /* FALL THROUGH */
-
-       case KRB4CMD_SKIP:
-           p = rbuf;
-           *p = KRB4RPL_DONE;  /* XXX */
-           *rbuflen = 1;
-
-           if (( pwd = uam_getname( obj, username, strlen(username) ) ) == NULL ) {
-               return( AFPERR_NOTAUTH );
-           }
-/*
-           if (uam_checkuser(pwd) < 0) {
-               return AFPERR_NOTAUTH;
-           }
-*/
-           *uam_pwd = pwd;
-           return( AFP_OK );
-#endif /* AFS */
-       default:
-           /* read in the rest */
-           if (uam_afp_read(obj, rbuf, rbuflen, krb4_action) < 0)
-               return AFPERR_PARAM;
-
-           p = rbuf;
-           switch ( rc = *p++ ) {
-               case KRB4WRT_SESS :
-                   memcpy( &len, p, sizeof( len ));
-                   tkt.length = ntohs( len );
-                   p += sizeof( short );
-
-                   if ( tkt.length <= 0 || tkt.length > MAX_KTXT_LEN ) {
-                       return( AFPERR_BADUAM );
-                   }
-                   memcpy( tkt.dat, p, tkt.length );
-                   p += tkt.length;
-
-                   if (( rc = krb_rd_req( &tkt, "afpserver", servername, 
-                       0, &ad, "" )) != RD_AP_OK ) {
-                       LOG(log_error, logtype_default, "krb4_logincont: krb_rd_req(): %s", krb_err_txt[ rc ] );
-                       return( AFPERR_BADUAM );
-                   }
-
-                   LOG(log_info, logtype_default, "krb4_login: %s.%s@%s", ad.pname, 
-                       ad.pinst, ad.prealm );
-                   memcpy(realm, ad.prealm, sizeof(realm));
-                   memcpy(seskey, ad.session, sizeof( C_Block ));
-                   key_sched((C_Block *) seskey, seskeysched );
-
-                   strncpy(username, ad.pname, ulen);
-
-                   p = rbuf;
-#ifndef AFS
-                   *p = KRB4RPL_DONE;  /* XXX */
-                   *rbuflen = 1;
-
-                   if (( pwd = uam_getname( obj, ad.pname, strlen(ad.pname) )) 
-                       == NULL ) {
-                       return( AFPERR_PARAM );
-                   }
-                   *uam_pwd = pwd;
-                   return AFP_OK;
-#else /* ! AFS */
-                   /* get principals */
-                   *p++ = KRB4RPL_PRINC;
-                   len = strlen( realm );
-                   *p++ = len + 1;
-                   *p++ = '@';
-                   strcpy( p, realm );
-                   p += len + 1;
-                   *rbuflen = p - rbuf;
-                   return( AFPERR_AUTHCONT );
-
-               case KRB4WRT_TOKEN :
-                   memcpy( &len, p, sizeof( len ));
-                   len = ntohs( len );
-                   p += sizeof( len );
-                   memcpy( &cr, p, len );
-
-                   pcbc_encrypt((C_Block *)&cr, (C_Block *)&cr, len, 
-                       seskeysched, seskey, DES_DECRYPT );
-
-                   p = buf;
-                   cr.ticket_st.length = ntohl( cr.ticket_st.length );
-                   memcpy( p, &cr.ticket_st.length, sizeof( int ));
-                   p += sizeof( int );
-                   memcpy( p, cr.ticket_st.dat, cr.ticket_st.length );
-                   p += cr.ticket_st.length;
-
-                   ct.AuthHandle = ntohl( cr.kvno );
-                   memcpy( ct.HandShakeKey, cr.session, sizeof( cr.session ));
-                   ct.ViceId = 0;
-                   ct.BeginTimestamp = ntohl( cr.issue_date );
-                   ct.EndTimestamp = krb_life_to_time( ntohl( cr.issue_date ),
-                   ntohl( cr.lifetime ));
-
-                   aint = sizeof( struct ClearToken );
-                   memcpy( p, &aint, sizeof( int ));
-                   p += sizeof( int );
-                   memcpy( p, &ct, sizeof( struct ClearToken ));
-                   p += sizeof( struct ClearToken );
-
-                   aint = 0;
-                   memcpy( p, &aint, sizeof( int ));
-                   p += sizeof( int );
-
-                   lcase( realm );
-                   strcpy( p, realm );
-                   p += strlen( realm ) + 1;
-
-                   vi.in = buf;
-                   vi.in_size = p - buf;
-                   vi.out = buf;
-                   vi.out_size = sizeof( buf );
-                   if ( pioctl( 0, VIOCSETTOK, &vi, 0 ) < 0 ) {
-                       LOG(log_error, logtype_default, "krb4_logincont: pioctl: %s", strerror(errno) );
-                       return( AFPERR_BADUAM );
-                   }
-                   /* FALL THROUGH */
-
-               case KRB4WRT_SKIP :
-                   p = rbuf;
-                   *p = KRB4RPL_DONE;  /* XXX */
-                   *rbuflen = 1;
-
-                   if (( pwd = uam_getname( obj, ad.pname, strlen(ad.pname) )) 
-                       == NULL ) {
-                       return( AFPERR_PARAM );
-                   }
-                   *uam_pwd = pwd;
-                   return AFP_OK;
-#endif /*AFS*/
-
-               default:
-                   LOG(log_info, logtype_default, "krb4_logincont: bad command %d", rc );
-                   *rbuflen = 0;
-                   return( AFPERR_NOTAUTH );
-                   break;
-           }
-           break;
-    }
-}
-
-#endif /* KRB */
-
-
-#ifdef AFS
-#include <rx/rxkad.h>
-#include <afs/afsint.h>
-
-char *ka_LocalCell();
-
-static void
-addrealm(realm,cells)
-    char *realm;
-       char ***cells;
-{
-    char **ptr;
-       int temp;
-
-       ptr= *cells;
-
-    for(;*ptr != 0 ;ptr++)
-        if(!strcmp(realm,*ptr))
-            return;
-
-       temp=ptr- *cells;
-       *cells=(char**)realloc(*cells,((2+temp)*sizeof(char*)));
-       ptr= *cells+temp;
-
-    *ptr=(char*)malloc(strlen(realm)+1);
-    strcpy(*ptr++,realm);
-       *ptr=0;
-    return;
-}
-
-static int kcheckuser(pwd,passwd)
-       struct passwd *pwd;
-       char *passwd;
-{
-       int32_t code;
-       char *instance="";
-       char realm[MAXKTCREALMLEN];
-       char lorealm[MAXKTCREALMLEN];
-       char *cell;
-       Date lifetime=MAXKTCTICKETLIFETIME;
-       int rval;
-       char **cells=(char **)malloc(sizeof(char*));
-       char *temp;
-       int rc,cellNum;
-       struct ktc_principal serviceName;
-
-       *cells=0;
-
-       code = ka_Init(0);
-
-       {
-               char *temp,*temp1;
-               temp=(char*)malloc(strlen(pwd->pw_dir)+1);
-               strcpy(temp,pwd->pw_dir);
-               temp1=temp;
-               temp=strtok(temp,"/");
-               temp=strtok('\0',"/");
-               ka_CellToRealm(temp,realm,0);
-               addrealm(realm,&cells);
-               free(temp1);
-       }
-
-       setpag();
-       authenticate(cells,pwd->pw_name,passwd);
-       cellNum=0;
-       rc=ktc_ListTokens(cellNum,&cellNum,&serviceName);
-       if(rc)
-               rval=1;
-       else{
-               rval=0;
-       }
-
-       return(rval);
-}
-
-static void authenticate(cells,name,passwd)
-       char **cells;
-       char *name;
-       char *passwd;
-{
-       char **ptr=cells;
-       char *errorstring;
-
-       while(*ptr){
-           ka_UserAuthenticate(name,/*instance*/"",/*cell*/*ptr++,
-                   passwd,/*setpag*/0,&errorstring);
-       }
-}
-#endif /* AFS */
-
-#if defined( UAM_AFSKRB ) && defined( AFS )
-static int afskrb_login(void *obj, struct passwd *uam_pwd,
-                       char *ibuf, size_t ibuflen, 
-                       char *rbuf, size_t *rbuflen )
-{
-    KTEXT_ST   authent, rpkt;
-    CREDENTIALS        cr;
-    char       *p, *q, *username, servername;
-    int                len, rc, whoserealm, ulen, snlen;
-    short      slen;
-
-    *rbuflen = 0;
-    if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, &username, &ulen) < 0)
-      return AFPERR_MISC;
-
-    if (uam_afpserver_option(obj, UAM_OPTION_HOSTNAME, &servername, &snlen ) < 0)
-      return AFPERR_MISC;
-    
-    len = (unsigned char) *ibuf++;
-    ibuf[ len ] = '\0';
-    if (( p = strchr( ibuf, '@' )) != NULL ) {
-       *p++ = '\0';
-       strcpy( realm, p );
-       ucase( realm );
-       whoserealm = 0;
-    } else {
-       if ( krb_get_lrealm( realm, 1 ) != KSUCCESS ) {
-           return AFPERR_BADUAM;
-       }
-       whoserealm = 1;
-    }
-    if (( p = strchr( ibuf, '.' )) != NULL ) {
-       *p++ = '\0';
-       strcpy( instance, p );
-    } else {
-       *instance = '\0';
-    }
-    strcpy( name, ibuf );
-    /*
-     * We don't have the session key, yet. Get one.
-     */
-    p = rbuf;
-    if ( validseskey == 0 ) {
-       if ( setpag() < 0 ) {
-           LOG(log_error, logtype_default, "krb_login: setpag: %s", strerror(errno) );
-           return AFPERR_BADUAM;
-       }
-       krb_set_tkt_string(( tktfile = mktemp( _PATH_AFPTKT )));
-       if (( rc =  krb_get_svc_in_tkt( "afpserver", servername, realm,
-               TICKET_GRANTING_TICKET, realm, 255, KEYFILE )) != INTK_OK ) {
-           LOG(log_error, logtype_default, "krb_login: can't get ticket-granting-ticket" );
-           return (( whoserealm ) ? AFPERR_BADUAM : AFPERR_PARAM );
-       }
-       if ( krb_mk_req( &authent, name, instance, realm, 0 ) != KSUCCESS ) {
-           return ( AFPERR_PARAM );
-       }
-       if ( krb_get_cred( name, instance, realm, &cr ) != KSUCCESS ) {
-           return ( AFPERR_BADUAM );
-       }
-
-       if ( unlink( tktfile ) < 0 ) {
-           LOG(log_error, logtype_default, "krb_login: unlink %s: %s", tktfile, strerror(errno) );
-           return ( AFPERR_BADUAM );
-       }
-
-       memcpy( seskey, cr.session, sizeof( C_Block ));
-       key_sched((C_Block *) seskey, seskeysched );
-       validseskey = 1;
-       strncpy(username, name, ulen);
-
-       memcpy( p, authent.dat, authent.length );
-       p += authent.length;
-    }
-
-    if ( kuam_get_in_tkt( name, instance, realm, TICKET_GRANTING_TICKET,
-           realm, 255, &rpkt ) != INTK_OK ) {
-       return ( AFPERR_PARAM );
-    }
-
-
-    q = (char *)rpkt.dat;
-    *p++ = *q++;
-    *p++ = *q++;
-    while ( *q++ )
-       ;
-    while ( *q++ )
-       ;
-    while ( *q++ )
-       ;
-    q += 10;
-
-    len = strlen( realm );
-    strcpy( p, realm );
-    p += len + 1;
-    memcpy( &slen, q, sizeof( short ));
-    memcpy( p, &slen, sizeof( short ));
-    p += sizeof( short );
-    q += sizeof( short );
-    memcpy( p, q, slen );
-    p += slen;
-
-    *rbuflen = p - rbuf;
-    return( AFPERR_AUTHCONT );
-}
-
-static int afskrb_logincont(void *obj, struct passwd *uam_pwd,
-                           char *ibuf, size_t ibuflen, 
-                           char *rbuf, size_t *rbuflen )
-{
-    CREDENTIALS                cr;
-    struct ViceIoctl   vi;
-    struct ClearToken  ct;
-    struct passwd      *pwd;
-    char               buf[ 1024 ], *p;
-    int                        aint;
-    short              clen;
-
-    *rbuflen = 0;
-    if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, &username, NULL) < 0)
-      return AFPERR_MISC;
-    
-    ibuf += 2;
-    memcpy( &clen, ibuf, sizeof( short ));
-    clen = ntohs( clen );
-    ibuf += sizeof( short );
-
-    pcbc_encrypt((C_Block *)ibuf, (C_Block *)ibuf,
-           clen, seskeysched, seskey, DES_DECRYPT );
-    if ( kuam_set_in_tkt( name, instance, realm, TICKET_GRANTING_TICKET,
-           realm, ibuf ) != INTK_OK ) {
-       return ( AFPERR_PARAM );
-    }
-
-    if ( get_ad_tkt( "afs", "", realm, 255 ) != KSUCCESS ) {
-       return ( AFPERR_PARAM );
-    }
-    if ( krb_get_cred( "afs", "", realm, &cr ) != KSUCCESS ) {
-       return ( AFPERR_PARAM );
-    }
-
-    p = buf;
-    memcpy( p, &cr.ticket_st.length, sizeof( int ));
-    p += sizeof( int );
-    memcpy( p, cr.ticket_st.dat, cr.ticket_st.length );
-    p += cr.ticket_st.length;
-
-    ct.AuthHandle = cr.kvno;
-    memcpy( ct.HandShakeKey, cr.session, sizeof( cr.session ));
-    ct.ViceId = 0;
-    ct.BeginTimestamp = cr.issue_date;
-    /* ct.EndTimestamp = cr.issue_date + ( cr.lifetime * 5 * 60 ); */
-    ct.EndTimestamp = krb_life_to_time( cr.issue_date, cr.lifetime );
-
-    aint = sizeof( struct ClearToken );
-    memcpy( p, &aint, sizeof( int ));
-    p += sizeof( int );
-    memcpy( p, &ct, sizeof( struct ClearToken ));
-    p += sizeof( struct ClearToken );
-
-    aint = 0;
-    memcpy( p, &aint, sizeof( int ));
-    p += sizeof( int );
-
-    lcase( realm );
-    strcpy( p, realm );
-    p += strlen( realm ) + 1;
-
-    vi.in = buf;
-    vi.in_size = p - buf;
-    vi.out = buf;
-    vi.out_size = sizeof( buf );
-    if ( pioctl( 0, VIOCSETTOK, &vi, 0 ) < 0 ) {
-       LOG(log_error, logtype_default, "krb_logincont: pioctl: %s", strerror(errno) );
-       return ( AFPERR_BADUAM );
-    }
-
-    if ( unlink( tktfile ) < 0 ) {
-       LOG(log_error, logtype_default, "krb_logincont: %s: %s", tktfile, strerror(errno) );
-       return ( AFPERR_BADUAM );
-    }
-
-    if (( pwd = uam_getname( obj, username, strlen(username) )) == NULL ) {
-       return ( AFPERR_PARAM );
-    }
-
-    if ( logged == 0 ) {
-       logged = 1;
-       LOG(log_info, logtype_default, "authenticated %s.%s@%s", name, instance, realm );
-       *uam_pwd = pwd;
-       return AFP_OK;
-    }
-    LOG(log_info, logtype_default, "re-authenticated %s.%s@%s", name, instance, realm );
-    return( AFP_OK );
-}
-#endif /* UAM_AFSKRB AFS */
-
-static int uam_setup(const char *path)
-{
-#ifdef KRB
-   uam_register(UAM_SERVER_LOGIN, path, "Kerberos IV", krb4_login, 
-               krb4_logincont, NULL);
-   /* uam_afpserver_action(); */
-#endif /* KRB */
-#ifdef UAM_AFSKRB
-   uam_register(UAM_SERVER_LOGIN, path, "AFS Kerberos", afskrb_login, 
-               afskrb_logincont, NULL);
-   /* uam_afpserver_action(); */
-#endif /* UAM_AFSKRB */
-   return 0;
-}
-
-static void uam_cleanup(void)
-{
-#ifdef KRB
-   /* uam_afpserver_action(); */
-   uam_unregister(UAM_SERVER_LOGIN, "Kerberos IV");
-#endif
-#ifdef UAM_AFSKRB
-   /* uam_afpserver_action(); */
-   uam_unregister(UAM_SERVER_LOGIN, "AFS Kerberos");
-#endif
-}
-
-UAM_MODULE_EXPORT struct uam_export uams_krb4 = {
-  UAM_MODULE_SERVER,
-  UAM_MODULE_VERSION,
-  uam_setup, uam_cleanup
-};
-
-#endif /* KRB or UAM_AFSKRB */
-
index 7910a3b29a191217cdd2566739cc79c15189ac5c..d01259b661d33493415ac4d91bc5feeea848f1fe 100644 (file)
@@ -9,6 +9,7 @@ EXTRA_DIST = \
        iconv.m4                \
        largefile-check.m4      \
        libgcrypt.m4            \
+       netatalk.m4                     \
        pam-check.m4            \
        perl-check.m4           \
        ps-check.m4             \
index 2b74b8cf8246d56a25b95c157aa5d915bed57052..799cfa2649e6fefab6fd3ffe3fdfc0c9a1a19571 100644 (file)
@@ -1,7 +1,7 @@
 dnl $Id: afs-check.m4,v 1.4 2005-08-11 20:15:35 didg Exp $
 dnl Autoconf macro to check whether AFS support should be enabled
 
-AC_DEFUN([NETATALK_AFS_CHECK], [
+AC_DEFUN([AC_NETATALK_AFS_CHECK], [
        AFS_LIBS=
        AFS_CFLAGS=
 
index eb4cf882efe7fe8ceaec72e974149fbaa3e835c3..1627fd1ddc8750e1b6e194f9ac17bd9d505a3d06 100644 (file)
@@ -1,7 +1,7 @@
 dnl $Id: config-checks.m4,v 1.6 2005-04-28 20:50:05 bfernhomberg Exp $
 dnl Autoconf macro to set the configuration directories.
 
-AC_DEFUN([NETATALK_CONFIG_DIRS], [
+AC_DEFUN([AC_NETATALK_CONFIG_DIRS], [
        PKGCONFDIR="${sysconfdir}/netatalk"
 
        AC_ARG_WITH(pkgconfdir,
index 081d27be75f28222122d1fb283ef21b24cdd4f44..6fae6187205b69d4542ace1016e7de16b6901e96 100644 (file)
@@ -1,4 +1,3 @@
-dnl $Id: db3-check.m4,v 1.23 2010-04-12 14:28:48 franklahm Exp $
 dnl Autoconf macros to check for the Berkeley DB library
 
 dnl -- check header for minimum version and return version in
@@ -83,7 +82,8 @@ AC_DEFUN([NETATALK_BDB_TRY_LINK],[
 ])
 
 dnl -- This is called from configure
-AC_DEFUN([AC_PATH_BDB],[
+AC_DEFUN([AC_NETATALK_PATH_BDB],[
+if test "x$bdb_required" = "xyes"; then
     trybdbdir=""
     dobdbsearch=yes
     bdb_search_dirs="/usr/local /usr"
@@ -206,6 +206,7 @@ AC_DEFUN([AC_PATH_BDB],[
         ifelse([$1], , :, [$1])
     else
         ifelse([$2], , :, [$2])     
+               AC_MSG_ERROR([Berkeley DB library required but not found!])
     fi
 
     CFLAGS_REMOVE_USR_INCLUDE(BDB_CFLAGS)
@@ -214,6 +215,7 @@ AC_DEFUN([AC_PATH_BDB],[
     AC_SUBST(BDB_LIBS)
     AC_SUBST(BDB_BIN)
     AC_SUBST(BDB_PATH)
+fi
 ])
 
 
index c7c91034b6f190193be7bb409a564b5a0d9f8b2a..3ddd7a9dd5fd0f5069adcee03de762c35c57e95f 100644 (file)
@@ -1,4 +1,4 @@
-AC_DEFUN([AC_CHECK_ICONV],
+AC_DEFUN([AC_NETATALK_CHECK_ICONV],
 [
 
 dnl    #################################################
index 957275e2fe5c4703e7c50aed5c18c4f8d246f56c..21b323ec0f23a3d53254daf35117976d16355037 100644 (file)
@@ -8,7 +8,7 @@ dnl version of libgcrypt is at least 1.2.5 *and* the API number is 1.  Using
 dnl this features allows to prevent build against newer versions of libgcrypt
 dnl with a changed API.
 dnl
-AC_DEFUN([AM_PATH_LIBGCRYPT],
+AC_DEFUN([AC_NETATALK_PATH_LIBGCRYPT],
 [ AC_ARG_WITH(libgcrypt-dir,
             AC_HELP_STRING([--with-libgcrypt-dir=PATH],
                            [path where LIBGCRYPT is installed (optional). 
@@ -107,6 +107,11 @@ fi
   if test $ok = yes; then
     LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
     LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
+    neta_cv_compile_dhx2=yes
+    neta_cv_have_libgcrypt=yes
+       AC_MSG_NOTICE([Enabling DHX2 UAM])
+       AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define if the DHX2 modules should be built with libgcrypt])
+       AC_DEFINE(UAM_DHX2, 1, [Define if the DHX2 UAM modules should be compiled])
     ifelse([$2], , :, [$2])
   else
     LIBGCRYPT_CFLAGS=""
diff --git a/macros/netatalk.m4 b/macros/netatalk.m4
new file mode 100644 (file)
index 0000000..207c686
--- /dev/null
@@ -0,0 +1,726 @@
+dnl Kitchen sink for configuration macros
+
+dnl Check for optional admin group support
+AC_DEFUN([AC_NETATALK_ADMIN_GROUP], [
+    netatalk_cv_admin_group=yes
+    AC_MSG_CHECKING([for administrative group support])
+    AC_ARG_ENABLE(admin-group,
+           [  --disable-admin-group   disable admin group],[
+            if test x"$enableval" = x"no"; then
+                        AC_DEFINE(ADMIN_GRP, 0, [Define if the admin group should be enabled])
+                        netatalk_cv_admin_group=no
+                        AC_MSG_RESULT([no])
+               else
+                        AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
+                        AC_MSG_RESULT([yes])
+            fi],[
+               AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
+               AC_MSG_RESULT([yes])
+       ])
+])
+
+dnl Check for optional cracklib support
+AC_DEFUN([AC_NETATALK_CRACKLIB], [
+netatalk_cv_with_cracklib=no
+AC_ARG_WITH(cracklib,
+       [  --with-cracklib=DICT    enable/set location of cracklib dictionary],[
+       if test "x$withval" != "xno" ; then
+               cracklib="$withval"
+               AC_CHECK_LIB(crack, main, [
+                       AC_DEFINE(USE_CRACKLIB, 1, [Define if cracklib should be used])
+                       LIBS="$LIBS -lcrack"
+                       if test "$cracklib" = "yes"; then
+                               cracklib="/usr/$atalk_libname/cracklib_dict"
+                       fi
+                       AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
+                               [path to cracklib dictionary])
+                       AC_MSG_RESULT([setting cracklib dictionary to $cracklib])
+                       netatalk_cv_with_cracklib=yes
+                       ],[
+                       AC_MSG_ERROR([cracklib not found!])
+                       ]
+               )
+       fi
+       ]
+)
+AC_MSG_CHECKING([for cracklib support])
+AC_MSG_RESULT([$netatalk_cv_with_cracklib])
+])
+
+dnl Check whether to enable debug code
+AC_DEFUN([AC_NETATALK_DEBUG], [
+AC_MSG_CHECKING([whether to enable verbose debug code])
+AC_ARG_ENABLE(debug,
+       [  --enable-debug          enable verbose debug code],[
+       if test "$enableval" != "no"; then
+               if test "$enableval" = "yes"; then
+                       AC_DEFINE(DEBUG, 1, [Define if verbose debugging information should be included])
+               else
+                       AC_DEFINE_UNQUOTED(DEBUG, $enableval, [Define if verbose debugging information should be included])
+               fi 
+               AC_MSG_RESULT([yes])
+       else
+               AC_MSG_RESULT([no])
+        AC_DEFINE(NDEBUG, 1, [Disable assertions])
+       fi
+       ],[
+               AC_MSG_RESULT([no])
+        AC_DEFINE(NDEBUG, 1, [Disable assertions])
+       ]
+)
+])
+
+dnl Check whethe to disable tickle SIGALARM stuff, which eases debugging
+AC_DEFUN([AC_NETATALK_DEBUGGING], [
+AC_MSG_CHECKING([whether to enable debugging with debuggers])
+AC_ARG_ENABLE(debugging,
+       [  --enable-debugging      disable SIGALRM timers and DSI tickles (eg for debugging with gdb/dbx/...)],[
+       if test "$enableval" != "no"; then
+               if test "$enableval" = "yes"; then
+                       AC_DEFINE(DEBUGGING, 1, [Define if you want to disable SIGALRM timers and DSI tickles])
+               else
+                       AC_DEFINE_UNQUOTED(DEBUGGING, $enableval, [Define if you want to disable SIGALRM timers and DSI tickles])
+               fi 
+               AC_MSG_RESULT([yes])
+       else
+               AC_MSG_RESULT([no])
+       fi
+       ],[
+               AC_MSG_RESULT([no])
+       ]
+)
+
+])
+
+dnl Check for optional shadow password support
+AC_DEFUN([AC_NETATALK_SHADOW], [
+netatalk_cv_use_shadowpw=no
+AC_ARG_WITH(shadow,
+       [  --with-shadow           enable shadow password support [[auto]]],
+       [netatalk_cv_use_shadowpw="$withval"],
+       [netatalk_cv_use_shadowpw=auto]
+)
+
+if test "x$netatalk_cv_use_shadowpw" != "xno"; then
+    AC_CHECK_HEADER([shadow.h])
+    if test x"$ac_cv_header_shadow_h" = x"yes"; then
+       netatalk_cv_use_shadowpw=yes
+       AC_DEFINE(SHADOWPW, 1, [Define if shadow passwords should be used])
+    else 
+      if test "x$shadowpw" = "xyes"; then
+        AC_MSG_ERROR([shadow support not available])
+      else
+               netatalk_cv_use_shadowpw=no
+      fi
+    fi 
+fi
+
+AC_MSG_CHECKING([whether shadow support should be enabled])
+if test "x$netatalk_cv_use_shadowpw" = "xyes"; then
+       AC_MSG_RESULT([yes])
+else
+       AC_MSG_RESULT([no])
+fi
+])
+
+dnl Check for optional valid-shell-check support
+AC_DEFUN([AC_NETATALK_SHELL_CHECK], [
+netatalk_cv_use_shellcheck=yes
+AC_MSG_CHECKING([whether checking for a valid shell should be enabled])
+AC_ARG_ENABLE(shell-check,
+       [  --disable-shell-check   disable checking for a valid shell],[
+       if test "$enableval" = "no"; then 
+               AC_DEFINE(DISABLE_SHELLCHECK, 1, [Define if shell check should be disabled])
+               AC_MSG_RESULT([no])
+               netatalk_cv_use_shellcheck=no
+       else
+               AC_MSG_RESULT([yes])
+       fi
+       ],[
+               AC_MSG_RESULT([yes])
+       ]
+)
+])
+
+dnl Check for optional sysv initscript install
+AC_DEFUN([AC_NETATALK_SYSV_STYLE], [
+    AC_ARG_WITH(sysv-style,
+                [  --with-sysv-style       use OS specific sysv config [[redhat|suse|gentoo|netbsd|debian]]],
+                sysv_style="$withval", sysv_style=none
+    )
+    case "$sysv_style" in 
+    "redhat")
+           AC_MSG_RESULT([enabling redhat-style sysv support])
+        ;;
+    "suse")
+           AC_MSG_RESULT([enabling suse-style sysv support])
+        ;;
+    "gentoo")
+           AC_MSG_RESULT([enabling gentoo-style sysv support])
+        ;;
+    "netbsd")
+           AC_MSG_RESULT([enabling netbsd-style sysv support])
+        ;;
+    "debian")
+           AC_MSG_RESULT([enabling debian-style sysv support])
+        ;;
+    *)
+           AC_MSG_RESULT([disabling sysv support])
+        ;;
+    esac
+])
+
+dnl OS specific configuration
+AC_DEFUN([AC_NETATALK_OS_SPECIFIC], [
+case "$host_os" in
+       *aix*)                          this_os=aix ;;
+       *freebsd*)                      this_os=freebsd ;;
+       *hpux11*)                       this_os=hpux11 ;;
+       *irix*)                         this_os=irix ;;
+       *linux*)                        this_os=linux ;;
+       *osx*)                          this_os=macosx ;;
+       *darwin*)                       this_os=macosx ;;
+       *netbsd*)                       this_os=netbsd ;;
+       *openbsd*)                      this_os=openbsd ;;
+       *osf*)                          this_os=tru64 ;;
+       *solaris*)                      this_os=solaris ;;
+esac
+
+case "$host_cpu" in
+       i386|i486|i586|i686|k7)         this_cpu=x86 ;;
+       alpha)                                          this_cpu=alpha ;;
+       mips)                                           this_cpu=mips ;;
+       powerpc|ppc)                            this_cpu=ppc ;;
+esac
+
+dnl --------------------- operating system specific flags (port from sys/*)
+
+dnl ----- FreeBSD specific -----
+if test x"$this_os" = "xfreebsd"; then 
+       AC_MSG_RESULT([ * FreeBSD specific configuration])
+       AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
+       AC_DEFINE(FREEBSD, 1, [Define if OS is FreeBSD])
+       AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics])
+    AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW)
+fi
+
+dnl ----- Linux specific -----
+if test x"$this_os" = "xlinux"; then 
+       AC_MSG_RESULT([ * Linux specific configuration])
+       
+       dnl ----- check if we need the quotactl wrapper
+    AC_CHECK_HEADERS(linux/dqblk_xfs.h,,
+               [AC_CHECK_HEADERS(linux/xqm.h linux/xfs_fs.h)
+               AC_CHECK_HEADERS(xfs/libxfs.h xfs/xqm.h xfs/xfs_fs.h)]
+       )
+
+
+       dnl ----- as far as I can tell, dbtob always does the wrong thing
+       dnl ----- on every single version of linux I've ever played with.
+       dnl ----- see etc/afpd/quota.c
+       AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
+
+       netatalk_cv_linux_sendfile=yes
+       AC_MSG_CHECKING([use sendfile syscall])
+        AC_ARG_ENABLE(sendfile,
+           [  --disable-sendfile       disable linux sendfile syscall],[
+               if test x"$enableval" = x"no"; then
+                       netatalk_cv_linux_sendfile=no
+                       AC_MSG_RESULT([no])
+               else
+                       AC_MSG_RESULT([yes])
+
+               fi
+           ],[
+               AC_MSG_RESULT([yes])
+       ]
+
+       )
+
+       if test x"$netatalk_cv_linux_sendfile" = "xyes"; then 
+           AC_CACHE_CHECK([for linux sendfile support],netatalk_cv_HAVE_SENDFILE,[
+           AC_TRY_LINK([#include <sys/sendfile.h>],
+[\
+int tofd, fromfd;
+off_t offset;
+size_t total;
+ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
+],
+netatalk_cv_HAVE_SENDFILE=yes,netatalk_cv_HAVE_SENDFILE=no)])
+
+# Try and cope with broken Linux sendfile....
+           AC_CACHE_CHECK([for broken linux sendfile support],netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE,[
+           AC_TRY_LINK([\
+#if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)
+#undef _FILE_OFFSET_BITS
+#endif
+#include <sys/sendfile.h>],
+[\
+int tofd, fromfd;
+off_t offset;
+size_t total;
+ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
+],
+netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE=yes,netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE=no,netatalk_cv_HAVE_BROKEN_SENDFILE=cross)])
+
+           if test x"$netatalk_cv_HAVE_SENDFILE" = x"yes"; then
+               AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() is available])
+               AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available])
+               AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used])
+           elif test x"$netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE" = x"yes"; then
+               AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available])
+               AC_DEFINE(LINUX_BROKEN_SENDFILE_API,1,[Whether (linux) sendfile() is broken])
+               AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile should be used])
+           else
+               netatalk_cv_linux_sendfile=no
+               AC_MSG_RESULT(no);
+           fi
+       fi
+
+       need_dash_r=no
+fi
+
+dnl ----- Mac OSX specific -----
+if test x"$this_os" = "xmacosx"; then 
+       AC_MSG_RESULT([ * Mac OSX specific configuration])
+       AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
+       AC_DEFINE(HAVE_2ARG_DBTOB, 1, [Define if dbtob takes two arguments])
+       dnl AC_DEFINE(NO_DLFCN_H)
+       AC_DEFINE(NO_QUOTA_SUPPORT, 1, [Define if Quota support should be disabled])
+       AC_DEFINE(MACOSX_SERVER, 1, [Define if compiling for MacOS X Server])
+fi
+
+dnl ----- NetBSD specific -----
+if test x"$this_os" = "xnetbsd"; then 
+       AC_MSG_RESULT([ * NetBSD specific configuration])
+       AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
+       AC_DEFINE(NETBSD, 1, [Define if OS is NetBSD])
+    AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EFTYPE, errno returned by open with O_NOFOLLOW)
+
+       CFLAGS="-I\$(top_srcdir)/sys/netbsd $CFLAGS"
+       need_dash_r=yes 
+
+       dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
+       AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
+fi
+
+dnl ----- OpenBSD specific -----
+if test x"$this_os" = "xopenbsd"; then 
+       AC_MSG_RESULT([ * OpenBSD specific configuration])
+       dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
+       AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
+fi
+
+dnl ----- Solaris specific -----
+if test x"$this_os" = "xsolaris"; then 
+       AC_MSG_RESULT([ * Solaris specific configuration])
+       AC_DEFINE(__svr4__, 1, [Solaris compatibility macro])
+       AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
+       AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
+       AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro])
+       CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
+       need_dash_r=yes
+       sysv_style=solaris
+
+       solaris_module=no
+       AC_MSG_CHECKING([if we can build Solaris kernel module])
+       if test -x /usr/ccs/bin/ld && test x"$netatalk_cv_ddp_enabled" = x"yes" ; then
+               solaris_module=yes
+       fi
+       AC_MSG_RESULT([$solaris_module])
+
+       COMPILE_64BIT_KMODULE=no
+       KCFLAGS=""
+       KLDFLAGS=""
+       COMPILE_KERNEL_GCC=no
+
+       if test "$solaris_module" = "yes"; then
+          dnl Solaris kernel module stuff
+           AC_MSG_CHECKING([if we have to build a 64bit kernel module])
+
+          # check for isainfo, if not found it has to be a 32 bit kernel (<=2.6)       
+          if test -x /usr/bin/isainfo; then
+               # check for 64 bit platform
+               if isainfo -kv | grep '^64-bit'; then
+                       COMPILE_64BIT_KMODULE=yes
+               fi
+          fi
+
+          AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
+
+          if test "${GCC}" = yes; then
+               COMPILE_KERNEL_GCC=yes
+               if test "$COMPILE_64BIT_KMODULE" = yes; then
+               
+                        AC_MSG_CHECKING([if we can build a 64bit kernel module])
+                       
+                        case `$CC --version 2>/dev/null` in
+                       [[12]].* | 3.0.*)
+                               COMPILE_64BIT_KMODULE=no
+                               COMPILE_KERNEL_GCC=no   
+                               solaris_module=no;;
+                       *)
+                               # use for 64 bit
+                               KCFLAGS="-m64"
+                               #KLDFLAGS="-melf64_sparc"
+                               KLDFLAGS="-64";;
+                       esac    
+                       
+                       AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
+                       
+               else
+                       KCFLAGS=""
+                       KLDFLAGS=""
+               fi
+               KCFLAGS="$KCFLAGS -D_KERNEL -Wall -Wstrict-prototypes"
+           else
+               if test "$COMPILE_64BIT_KMODULE" = yes; then
+                # use Sun CC (for a 64-bit kernel, uncomment " -xarch=v9 -xregs=no%appl ")
+                       KCFLAGS="-xarch=v9 -xregs=no%appl"
+                       KLDFLAGS="-64"
+               else
+                       KCFLAGS=""
+                       KLDFLAGS=""
+               fi
+               KCFLAGS="-D_KERNEL $KCFLAGS -mno-app-regs -munaligned-doubles -fpcc-struct-return"
+          fi
+
+           AC_CACHE_CHECK([for timeout_id_t],netatalk_cv_HAVE_TIMEOUT_ID_T,[
+           AC_TRY_LINK([\
+#include <sys/stream.h>
+#include <sys/ddi.h>],
+[\
+timeout_id_t dummy;
+],
+netatalk_cv_HAVE_TIMEOUT_ID_T=yes,netatalk_cv_HAVE_TIMEOUT_ID_T=no,netatalk_cv_HAVE_TIMEOUT_ID_T=cross)])
+
+          AC_DEFINE(HAVE_TIMEOUT_ID_T, test x"$netatalk_cv_HAVE_TIMEOUT_ID" = x"yes", [define for timeout_id_t])
+       fi
+
+       AC_SUBST(COMPILE_KERNEL_GCC)
+       AC_SUBST(COMPILE_64BIT_KMODULE)
+       AC_SUBST(KCFLAGS)
+       AC_SUBST(KLDFLAGS)
+fi
+
+])
+
+dnl Check for building PGP UAM module
+AC_DEFUN([AC_NETATALK_PGP_UAM], [
+AC_MSG_CHECKING([whether the PGP UAM should be build])
+AC_ARG_ENABLE(pgp-uam,
+       [  --enable-pgp-uam        enable build of PGP UAM module],[
+       if test "$enableval" = "yes"; then 
+               if test "x$neta_cv_have_openssl" = "xyes"; then 
+                       AC_DEFINE(UAM_PGP, 1, [Define if the PGP UAM module should be compiled])
+                       compile_pgp=yes
+                       AC_MSG_RESULT([yes])
+               else
+                       AC_MSG_RESULT([no])
+               fi
+       fi
+       ],[
+               AC_MSG_RESULT([no])
+       ]
+)
+])
+
+dnl Check for building Kerberos V UAM module
+AC_DEFUN([AC_NETATALK_KRB5_UAM], [
+netatalk_cv_build_krb5_uam=no
+AC_ARG_ENABLE(krbV-uam,
+       [  --enable-krbV-uam       enable build of Kerberos V UAM module],
+       [
+               if test x"$enableval" = x"yes"; then
+                       NETATALK_GSSAPI_CHECK([
+                               netatalk_cv_build_krb5_uam=yes
+                       ],[
+                               AC_MSG_ERROR([need GSSAPI to build Kerberos V UAM])
+                       ])
+               fi
+       ]
+       
+)
+
+AC_MSG_CHECKING([whether Kerberos V UAM should be build])
+if test x"$netatalk_cv_build_krb5_uam" = x"yes"; then
+       AC_MSG_RESULT([yes])
+else
+       AC_MSG_RESULT([no])
+fi
+AM_CONDITIONAL(USE_GSSAPI, test x"$netatalk_cv_build_krb5_uam" = x"yes")
+])
+
+dnl Check for overwrite the config files or not
+AC_DEFUN([AC_NETATALK_OVERWRITE_CONFIG], [
+AC_MSG_CHECKING([whether configuration files should be overwritten])
+AC_ARG_ENABLE(overwrite,
+       [  --enable-overwrite      overwrite configuration files during installation],
+       [OVERWRITE_CONFIG="${enable_overwrite}"],
+       [OVERWRITE_CONFIG="no"]
+)
+AC_MSG_RESULT([$OVERWRITE_CONFIG])
+AC_SUBST(OVERWRITE_CONFIG)
+])
+
+dnl Check for LDAP support, for client-side ACL visibility
+AC_DEFUN([AC_NETATALK_LDAP], [
+AC_MSG_CHECKING(for LDAP (necessary for client-side ACL visibility))
+AC_ARG_WITH(ldap,
+    [AS_HELP_STRING([--with-ldap],
+        [LDAP support (default=auto)])],
+    [ case "$withval" in
+      yes|no)
+          with_ldap="$withval"
+                 ;;
+      *)
+          with_ldap=auto
+          ;;
+      esac ])
+AC_MSG_RESULT($with_ldap)
+
+if test x"$with_ldap" != x"no" ; then
+       AC_CHECK_HEADER([ldap.h], with_ldap=yes,
+        [ if test x"$with_ldap" = x"yes" ; then
+            AC_MSG_ERROR([Missing LDAP headers])
+        fi
+               with_ldap=no
+        ])
+       AC_CHECK_LIB(ldap, ldap_init, with_ldap=yes,
+        [ if test x"$with_ldap" = x"yes" ; then
+            AC_MSG_ERROR([Missing LDAP library])
+        fi
+               with_ldap=no
+        ])
+fi
+
+if test x"$with_ldap" = x"yes"; then
+       AC_DEFINE(HAVE_LDAP,1,[Whether LDAP is available])
+fi
+])
+
+dnl Check for ACL support
+AC_DEFUN([AC_NETATALK_ACL], [
+AC_MSG_CHECKING(whether to support ACLs)
+AC_ARG_WITH(acls,
+    [AS_HELP_STRING([--with-acls],
+        [Include ACL support (default=auto)])],
+    [ case "$withval" in
+      yes|no)
+          with_acl_support="$withval"
+                 ;;
+      *)
+          with_acl_support=auto
+          ;;
+      esac ],
+    [with_acl_support=auto])
+AC_MSG_RESULT($with_acl_support)
+
+if test x"$with_acl_support" = x"no"; then
+       AC_MSG_RESULT(Disabling ACL support)
+       AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support should be built in])
+else
+    with_acl_support=yes
+fi
+
+if test x"$with_acl_support" = x"yes" ; then
+       AC_MSG_NOTICE(checking whether ACL support is available:)
+       case "$host_os" in
+       *sysv5*)
+               AC_MSG_NOTICE(Using UnixWare ACLs)
+               AC_DEFINE(HAVE_UNIXWARE_ACLS,1,[Whether UnixWare ACLs are available])
+               ;;
+       *solaris*)
+               AC_MSG_NOTICE(Using solaris ACLs)
+               AC_DEFINE(HAVE_SOLARIS_ACLS,1,[Whether solaris ACLs are available])
+               ACL_LIBS="$ACL_LIBS -lsec"
+               ;;
+       *hpux*)
+               AC_MSG_NOTICE(Using HPUX ACLs)
+               AC_DEFINE(HAVE_HPUX_ACLS,1,[Whether HPUX ACLs are available])
+               ;;
+       *irix*)
+               AC_MSG_NOTICE(Using IRIX ACLs)
+               AC_DEFINE(HAVE_IRIX_ACLS,1,[Whether IRIX ACLs are available])
+               ;;
+       *aix*)
+               AC_MSG_NOTICE(Using AIX ACLs)
+               AC_DEFINE(HAVE_AIX_ACLS,1,[Whether AIX ACLs are available])
+               ;;
+       *osf*)
+               AC_MSG_NOTICE(Using Tru64 ACLs)
+               AC_DEFINE(HAVE_TRU64_ACLS,1,[Whether Tru64 ACLs are available])
+               ACL_LIBS="$ACL_LIBS -lpacl"
+               ;;
+       *darwin*)
+               AC_MSG_NOTICE(ACLs on Darwin currently not supported)
+               AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
+               ;;
+       *)
+               AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"])
+               case "$host_os" in
+               *linux*)
+                       AC_CHECK_LIB(attr,getxattr,[ACL_LIBS="$ACL_LIBS -lattr"])
+                       ;;
+               esac
+               AC_CACHE_CHECK([for POSIX ACL support],netatalk_cv_HAVE_POSIX_ACLS,[
+                       acl_LIBS=$LIBS
+                       LIBS="$LIBS $ACL_LIBS"
+                       AC_TRY_LINK([
+                               #include <sys/types.h>
+                               #include <sys/acl.h>
+                       ],[
+                               acl_t acl;
+                               int entry_id;
+                               acl_entry_t *entry_p;
+                               return acl_get_entry(acl, entry_id, entry_p);
+                       ],
+                       [netatalk_cv_HAVE_POSIX_ACLS=yes],
+                       [netatalk_cv_HAVE_POSIX_ACLS=no
+                with_acl_support=no])
+                       LIBS=$acl_LIBS
+               ])
+               if test x"$netatalk_cv_HAVE_POSIX_ACLS" = x"yes"; then
+                       AC_MSG_NOTICE(Using POSIX ACLs)
+                       AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available])
+                       AC_CACHE_CHECK([for acl_get_perm_np],netatalk_cv_HAVE_ACL_GET_PERM_NP,[
+                               acl_LIBS=$LIBS
+                               LIBS="$LIBS $ACL_LIBS"
+                               AC_TRY_LINK([
+                                       #include <sys/types.h>
+                                       #include <sys/acl.h>
+                               ],[
+                                       acl_permset_t permset_d;
+                                       acl_perm_t perm;
+                                       return acl_get_perm_np(permset_d, perm);
+                               ],
+                               [samba_cv_HAVE_ACL_GET_PERM_NP=yes],
+                               [samba_cv_HAVE_ACL_GET_PERM_NP=no])
+                               LIBS=$acl_LIBS
+                       ])
+                       if test x"netatalk_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
+                               AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
+                       fi
+               else
+                       AC_MSG_NOTICE(ACL support is not avaliable)
+                       AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
+               fi
+               ;;
+    esac
+fi
+
+if test x"$with_acl_support" = x"yes" ; then
+    AC_DEFINE(HAVE_ACLS,1,[Whether ACLs support is available])
+    AC_SUBST(ACL_LIBS)
+fi
+])
+
+dnl Check for Extended Attributes support
+AC_DEFUN([AC_NETATALK_EXTENDED_ATTRIBUTES], [
+neta_cv_eas="ad"
+neta_cv_eas_sys_found=no
+neta_cv_eas_sys_not_found=no
+
+AC_CHECK_HEADERS(sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h sys/ea.h)
+
+case "$this_os" in
+
+  *osf*)
+       AC_SEARCH_LIBS(getproplist, [proplist])
+       AC_CHECK_FUNCS([getproplist fgetproplist setproplist fsetproplist],
+                   [neta_cv_eas_sys_found=yes],
+                   [neta_cv_eas_sys_not_found=yes])
+       AC_CHECK_FUNCS([delproplist fdelproplist add_proplist_entry get_proplist_entry],,
+                   [neta_cv_eas_sys_not_found=yes])
+       AC_CHECK_FUNCS([sizeof_proplist_entry],,
+                   [neta_cv_eas_sys_not_found=yes])
+  ;;
+
+  *solaris*)
+       AC_CHECK_FUNCS([attropen],
+                   [neta_cv_eas_sys_found=yes],
+                   [neta_cv_eas_sys_not_found=yes])
+  ;;
+
+  'freebsd')
+    AC_CHECK_FUNCS([extattr_delete_fd extattr_delete_file extattr_delete_link],
+                   [neta_cv_eas_sys_found=yes],
+                   [neta_cv_eas_sys_not_found=yes])
+    AC_CHECK_FUNCS([extattr_get_fd extattr_get_file extattr_get_link],,
+                   [neta_cv_eas_sys_not_found=yes])
+    AC_CHECK_FUNCS([extattr_list_fd extattr_list_file extattr_list_link],,
+                   [neta_cv_eas_sys_not_found=yes])
+    AC_CHECK_FUNCS([extattr_set_fd extattr_set_file extattr_set_link],,
+                   [neta_cv_eas_sys_not_found=yes])
+  ;;
+
+  *freebsd4* | *dragonfly* )
+    AC_DEFINE(BROKEN_EXTATTR, 1, [Does extattr API work])
+  ;;
+
+  *)
+       AC_SEARCH_LIBS(getxattr, [attr])
+
+    if test "x$neta_cv_eas_sys_found" != "xyes" ; then
+       AC_CHECK_FUNCS([getxattr lgetxattr fgetxattr listxattr llistxattr],
+                      [neta_cv_eas_sys_found=yes],
+                      [neta_cv_eas_sys_not_found=yes])
+          AC_CHECK_FUNCS([flistxattr removexattr lremovexattr fremovexattr],,
+                      [neta_cv_eas_sys_not_found=yes])
+          AC_CHECK_FUNCS([setxattr lsetxattr fsetxattr],,
+                      [neta_cv_eas_sys_not_found=yes])
+    fi
+
+    if test "x$neta_cv_eas_sys_found" != "xyes" ; then
+          AC_CHECK_FUNCS([getea fgetea lgetea listea flistea llistea],
+                      [neta_cv_eas_sys_found=yes],
+                      [neta_cv_eas_sys_not_found=yes])
+          AC_CHECK_FUNCS([removeea fremoveea lremoveea setea fsetea lsetea],,
+                      [neta_cv_eas_sys_not_found=yes])
+    fi
+
+    if test "x$neta_cv_eas_sys_found" != "xyes" ; then
+          AC_CHECK_FUNCS([attr_get attr_list attr_set attr_remove],,
+                      [neta_cv_eas_sys_not_found=yes])
+       AC_CHECK_FUNCS([attr_getf attr_listf attr_setf attr_removef],,
+                      [neta_cv_eas_sys_not_found=yes])
+    fi
+  ;;
+esac
+
+# Do xattr functions take additional options like on Darwin?
+if test x"$ac_cv_func_getxattr" = x"yes" ; then
+       AC_CACHE_CHECK([whether xattr interface takes additional options], smb_attr_cv_xattr_add_opt, [
+               old_LIBS=$LIBS
+               LIBS="$LIBS $ACL_LIBS"
+               AC_TRY_COMPILE([
+                       #include <sys/types.h>
+                       #if HAVE_ATTR_XATTR_H
+                       #include <attr/xattr.h>
+                       #elif HAVE_SYS_XATTR_H
+                       #include <sys/xattr.h>
+                       #endif
+               ],[
+                       getxattr(0, 0, 0, 0, 0, 0);
+               ],
+               [smb_attr_cv_xattr_add_opt=yes],
+               [smb_attr_cv_xattr_add_opt=no;LIBS=$old_LIBS])
+       ])
+       if test x"$smb_attr_cv_xattr_add_opt" = x"yes"; then
+               AC_DEFINE(XATTR_ADD_OPT, 1, [xattr functions have additional options])
+       fi
+fi
+
+if test "x$neta_cv_eas_sys_found" = "xyes" ; then
+   if test "x$neta_cv_eas_sys_not_found" != "xyes" ; then
+      neta_cv_eas="$neta_cv_eas | sys"
+   fi
+fi
+AC_DEFINE_UNQUOTED(EA_MODULES,["$neta_cv_eas"],[Available Extended Attributes modules])
+])
+
+AC_DEFUN([AC_NETATALK_], [
+])
+
+AC_DEFUN([AC_NETATALK_], [
+])
index e5663db347fb0f5e3b08884791014305e5c3dbc4..6bc40cbad841562161bf2c1a6a1f3cd776cdb5e4 100644 (file)
@@ -1,7 +1,8 @@
 dnl $Id: pam-check.m4,v 1.6 2010-01-11 13:06:02 franklahm Exp $
 dnl PAM finding macro
 
-AC_DEFUN([AC_PATH_PAM], [
+AC_DEFUN([AC_NETATALK_PATH_PAM], [
+    netatalk_cv_use_pam=no
        AC_ARG_WITH(pam, [  --with-pam[[=PATH]]       specify path to PAM installation [[auto]]],
                [
                        require_pam="yes"
@@ -125,6 +126,10 @@ AC_DEFUN([AC_PATH_PAM], [
        else
                AC_MSG_RESULT([yes])
                ifelse([$1], , :, [$1])
+        use_pam_so=yes
+           compile_pam=yes
+           netatalk_cv_use_pam=yes
+           AC_DEFINE(USE_PAM, 1, [Define to enable PAM support])
        fi
 
     LIB_REMOVE_USR_LIB(PAM_LIBS)
index 11ddd6ff526ac4281e1de99b3501128589a7fc51..5786b0b2543f724f78c47bfaae3bf746c1fa7d43 100644 (file)
@@ -2,7 +2,7 @@ dnl $Id: quota-check.m4,v 1.6 2005-07-20 23:58:21 didg Exp $
 dnl Autoconf macro to check for quota support
 dnl FIXME: This is in now way complete.
 
-AC_DEFUN([AC_CHECK_QUOTA], [
+AC_DEFUN([AC_NETATALK_CHECK_QUOTA], [
        AC_ARG_ENABLE(quota,
        [  --enable-quota           Turn on quota support (default=auto)])
 
index 9de28019fb5b7473da1091e19ff72bf54135694c..8d9c1b6c66650e5ca8f8f337057b8a229c69cccc 100644 (file)
@@ -1,7 +1,7 @@
 dnl $Id: ssl-check.m4,v 1.14 2008-11-22 12:07:26 didg Exp $
 dnl Autoconf macro to check for SSL or OpenSSL
 
-AC_DEFUN([AC_CRYPT], [
+AC_DEFUN([AC_NETATALK_CRYPT], [
 
        saveLIBS=$LIBS
        LIBS=""
@@ -17,7 +17,7 @@ AC_DEFUN([AC_CRYPT], [
 ])
 
 
-AC_DEFUN([AC_PATH_SSL], [
+AC_DEFUN([AC_NETATALK_PATH_SSL], [
        AC_ARG_WITH(ssl-dir, [  --with-ssl-dir=PATH     specify path to OpenSSL installation (must contain
                           lib and include dirs)],
                [
index 7673d4822589523e6eafb14e3d2050e02bf15b0c..ab28a1604e25bd10a8219e930e52ee74df87e0b2 100644 (file)
@@ -11,11 +11,8 @@ AC_DEFUN([AC_NETATALK_CONFIG_SUMMARY], [
                AC_MSG_RESULT([         none])
        fi
        AC_MSG_RESULT([    AFP:])
-       AC_MSG_RESULT([         AFP 3.x calls activated: $afp3])
-       if test "x$afp3" = "xyes"; then
-               AC_MSG_RESULT([         Large file support (>2GB) for AFP3: $wx_largefile])
-       fi
        AC_MSG_RESULT([         Extended Attributes: $neta_cv_eas])
+       AC_MSG_RESULT([         ACL support: $with_acl_support])
        AC_MSG_RESULT([    CNID:])
        AC_MSG_RESULT([         backends: $compiled_backends])
        AC_MSG_RESULT([    UAMS:])
@@ -38,17 +35,12 @@ AC_DEFUN([AC_NETATALK_CONFIG_SUMMARY], [
        if test x"$netatalk_cv_build_krb5_uam" = x"yes"; then
                AC_MSG_RESULT([         Kerberos V])
        fi
-       if test x"$compile_kerberos" = x"yes"; then
-               AC_MSG_RESULT([         Kerberos IV])
-       fi
        if test x"$compile_pgp" = x"yes"; then
                AC_MSG_RESULT([         PGP])
        fi
        AC_MSG_RESULT([         passwd  ($uams_using_options)])
        AC_MSG_RESULT([         guest])
        AC_MSG_RESULT([    Options:])
-       AC_MSG_RESULT([         DDP (AppleTalk) support: $netatalk_cv_ddp_enabled])
-       AC_MSG_RESULT([         CUPS support:            $netatalk_cv_use_cups])
        AC_MSG_RESULT([         SLP support:             $netatalk_cv_srvloc])
        AC_MSG_RESULT([         Zeroconf support:        $netatalk_cv_zeroconf])
        AC_MSG_RESULT([         tcp wrapper support:     $netatalk_cv_tcpwrap])
@@ -59,10 +51,6 @@ dnl  fi
        AC_MSG_RESULT([         admin group support:     $netatalk_cv_admin_group])
        AC_MSG_RESULT([         valid shell check:       $netatalk_cv_use_shellcheck])
        AC_MSG_RESULT([         cracklib support:        $netatalk_cv_with_cracklib])
-       AC_MSG_RESULT([         dropbox kludge:          $netatalk_cv_dropkludge])
-       AC_MSG_RESULT([         force volume uid/gid:    $netatalk_cv_force_uidgid])
-       AC_MSG_RESULT([         Apple 2 boot support:    $compile_a2boot])
-       AC_MSG_RESULT([         ACL support:             $with_acl_support])
        if test x"$use_pam_so" = x"yes" -a x"$netatalk_cv_install_pam" = x"no"; then
                AC_MSG_RESULT([])
                AC_MSG_WARN([ PAM support was configured for your system, but the netatalk PAM configuration file])
index ec722c1e4b1f0d574678d7d8dc1258877742c1d0..029990dc98ebacdef3a1c3f1107f0ee409c208d4 100644 (file)
@@ -1,7 +1,7 @@
 dnl $Id: webmin.m4,v 1.1 2009-10-22 08:36:30 franklahm Exp $
 dnl Autoconf macro to install webmin + netatalk webmin module
 
-AC_DEFUN([NETATALK_WEBMIN],[
+AC_DEFUN([AC_NETATALK_WEBMIN],[
     AC_ARG_WITH(webmin,
         [  --with-webmin=PATH      path where webmin is installed [[$PKGCONFDIR/webmin]]],
         if test "x$withval" = "xyes"; then