From 86549131028a387141594854bfb762d6ab1d09c4 Mon Sep 17 00:00:00 2001 From: rufustfirefly Date: Mon, 14 Aug 2000 16:23:30 +0000 Subject: [PATCH] openssl works properly now, uams build without lib_ prepended --- acconfig.h | 12 ++++++ configure.in | 85 ++++++++++++++++++++++++++++++++++---- etc/uams/Makefile.am | 28 +++++++------ etc/uams/uams_dhx_pam.c | 6 +++ etc/uams/uams_dhx_passwd.c | 6 +++ 5 files changed, 118 insertions(+), 19 deletions(-) diff --git a/acconfig.h b/acconfig.h index 716a3b56..c537c475 100644 --- a/acconfig.h +++ b/acconfig.h @@ -1,11 +1,23 @@ +#undef __svr4__ +#undef _ISOC9X_SOURCE #undef _PATH_CRACKLIB #undef ADMIN_GRP +#undef BSD4_4 #undef CAPDIR #undef DEBUG +#undef DLSYM_PREPEND_UNDERSCORE +#undef HAVE_GCC_MEMCPY_BUG +#undef NEED_QUOTACTL_WRAPPER #undef NO_DDP +#undef NO_STRUCT_TM_GMTOFF +#undef OPENSSL_DHX +#undef SENDFILE_FLAVOR_BSD +#undef SENDFILE_FLAVOR_LINUX #undef SERVERTEXT #undef SHADOWPW +#undef SOLARIS #undef TCPWRAP +#undef UAM_DHX #undef USE_CAP #undef USE_CRACKLIB #undef USE_FLOCK_LOCKS diff --git a/configure.in b/configure.in index b4fb838c..0ee5cf6a 100644 --- a/configure.in +++ b/configure.in @@ -81,6 +81,14 @@ AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h) +dnl --- check for openssl headers ... if so, add proper flags +AC_CHECK_HEADER(openssl/cast.h, + AC_DEFINE(OPENSSL_DHX, 1) + AC_DEFINE(UAM_DHX, 1) + AC_MSG_RESULT([including openssl libraries]) + compile_dhx=yes +) + dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_UID_T @@ -225,22 +233,85 @@ dnl drop in includes for top level directory structures here... dnl -------------------------------------------------------------------------- LIBS="$LIBS -L\$(top_srcdir)/libatalk/" CFLAGS="$CFLAGS -I\$(top_srcdir)/include -I\$(top_srcdir)/sys" -AC_SUBST(LIBS) -AC_SUBST(CFLAGS) dnl -------------------------------------------------------------------------- dnl specific configuration comes in here: dnl -------------------------------------------------------------------------- dnl --------------------- determine operating system from "target" -case "$target" in -*linux*) this_os=linux ;; -*solaris*) this_os=solaris ;; +case "$ac_cv_target_os" in + *freebsd*) this_os=freebsd ;; + *linux*) this_os=linux ;; + *openbsd*) this_os=openbsd ;; + *netbsd*) this_os=netbsd ;; + *solaris*) this_os=solaris ;; +esac + +case "$ac_cv_target_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 --------------------- conditional libraries, etc from "target" +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) + AC_DEFINE(SENDFILE_FLAVOR_BSD) +fi + +dnl ----- Linux specific ----- +if test x"$this_os" = "xlinux"; then + AC_MSG_RESULT([ * Linux specific configuration]) + AC_DEFINE(SENDFILE_FLAVOR_LINUX) + + dnl ----- check if we need the quotactl wrapper + AC_CHECK_HEADER(sys/quota.h,, + AC_MSG_RESULT([enabling quotactl wrapper]) + AC_DEFINE(NEED_QUOTACTL_WRAPPER) + ) + + dnl ----- Linux/alpha specific ----- + if test x"$this_cpu" = "xalpha"; then + AC_MSG_RESULT([enabling gcc memcpy bug workaround]) + AC_DEFINE(HAVE_GCC_MEMCPY_BUG) + fi +fi + +dnl ----- NetBSD specific ----- +if test x"$this_os" = "xnetbsd"; then + AC_MSG_RESULT([ * NetBSD specific configuration]) + AC_DEFINE(BSD4_4) + AC_DEFINE(DLSYM_PREPEND_UNDERSCORE) + CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS" +fi + +dnl ----- OpenBSD specific ----- +if test x"$this_os" = "xopenbsd"; then + AC_MSG_RESULT([ * OpenBSD specific configuration]) + AC_DEFINE(BSD4_4) +fi + +dnl ----- Solaris specific ----- +if test x"$this_os" = "xsolaris"; then + AC_MSG_RESULT([ * Solaris specific configuration]) + AC_DEFINE(__svr4__) + AC_DEFINE(_ISOC9X_SOURCE) + AC_DEFINE(NO_STRUCT_TM_GMTOFF) + AC_DEFINE(SOLARIS) +fi + + +dnl --------------------- last minute substitutions + +AC_SUBST(LIBS) +AC_SUBST(CFLAGS) +AM_CONDITIONAL(USE_DHX, test x$compile_dhx = xyes) -dnl List of Makefiles to generate +dnl --------------------- generate files AC_OUTPUT([Makefile bin/Makefile diff --git a/etc/uams/Makefile.am b/etc/uams/Makefile.am index 9f9ca586..2ca33944 100644 --- a/etc/uams/Makefile.am +++ b/etc/uams/Makefile.am @@ -1,17 +1,21 @@ # Makefile.am for etc/uams/ -#SUBDIRS = uams_krb4 +if USE_DHX +DHX_UAMS = uams_dhx_pam.so uams_dhx_passwd.so +endif -uamsdir = $(UAMS_PATH) -uams_LTLIBRARIES = lib_uams_dhx_pam.la lib_uams_dhx.passwd.la lib_uams_guest.la lib_uams_pam.la lib_uams_passwd.la lib_uams_randnum.la -# removed lib_uams_pgp.la since it doesn't currently build (AFAIK) +uamsdir = $(CONFIG_DIR)/uams +uams_DATA = $(DHX_UAMS) uams_guest.so uams_pam.so uams_passwd.so uams_randnum.so -lib_uams_dhx_pam_la_SOURCES = uams_dhx_pam.c -lib_uams_dhx_passwd_la_SOURCES = uams_dhx_passwd.c -lib_uams_guest_la_SOURCES = uams_guest.c -lib_uams_pam_la_SOURCES = uams_pam.c -lib_uams_passwd_la_SOURCES = uams_passwd.c -#lib_uams_pgp_la_SOURCES = uams_pgp.c -lib_uams_randnum_la_SOURCES = uams_randnum.c +EXTRA_DIST = uams_dhx_pam.c uams_dhx_passwd.c \ + uams_guest.c uams_pam.c uams_passwd.c uams_randnum.c + +SUFFIXES = .c .so +.c.so: + $(COMPILE) -DHAVE_CONFIG_H -DUAM_RNDNUM -fPIC -DPIC \ + -I$(top_srcdir) -fomit-frame-pointer -c $< ; \ + $(LD) -shared -o $@ $*.o $(LIBS) + +clean distclean clean-recursive distclean-recursive: + $(RM) $(uams_DATA) *.o core -CFLAGS = @CFLAGS@ -DUAM_RNDNUM diff --git a/etc/uams/uams_dhx_pam.c b/etc/uams/uams_dhx_pam.c index 063e5742..a84808b2 100644 --- a/etc/uams/uams_dhx_pam.c +++ b/etc/uams/uams_dhx_pam.c @@ -16,9 +16,15 @@ #include +#ifdef OPENSSL_DHX +#include +#include +#include +#else #include #include #include +#endif #include #include diff --git a/etc/uams/uams_dhx_passwd.c b/etc/uams/uams_dhx_passwd.c index 90e4fe25..9dc17349 100644 --- a/etc/uams/uams_dhx_passwd.c +++ b/etc/uams/uams_dhx_passwd.c @@ -26,9 +26,15 @@ #include #endif SHADOWPW +#ifdef OPENSSL_DHX +#include +#include +#include +#else #include #include #include +#endif #include #include -- 2.39.2