From 957162be267ce96db1efc268ea27cee9e284a3f5 Mon Sep 17 00:00:00 2001 From: jouvin Date: Fri, 1 Dec 2000 10:00:34 +0000 Subject: [PATCH] Changes made by Michel Jouvin - jouvin@lal.in2p3.fr - 23/11/2000 Modifications aim at introducing support of Compaq Tru64 (ASIP only, done with 4.0f), allow greater flexibility with PAM handling during netatalk build and properly propagate to Macintosh client file permissions driven by ACL on the server side using XPG4 access() function. - configure.in : add support for Tru64 OS, allow greater flexibility with PAM for better handling of systems (like mine) without pam (basically _pam uams are built only if pam libs are present and --with-pam triggers what are the actual targets for uams_clrtxt.so and uam_dhx.so), check availability of access() function in standard libaries. - acconfig.in : initialisation (#undef) of new macros introduced for Tru64 support. - etc/uams/Makefile.am : Complementary mods for flexible handling of pam. Use standard install target as cp -d is not available on every platform (in particular Tru64). Define links uams_clrtxt.so and uams_dhx.so at install time only, directly in target dir and add -f to ln command. Add 'expect_unresolved *' when building shared libs. - sys/netatalk/endian.h : Include config.h if it exists. - etc/atalkd/route.c : define rtentry as ortentry on Tru64 to allow successful compiling (anyway this part is not used on Tru64 as appletalk layer is not available). - distrib/initscripts/rc.atalk.redhat.tmpl : define 3 variables for netatalk bin, sbin and config subdirectories and use them in files path to allow easier manul customization of path. - Addition of a distrib/initscripts/rc.atalk.tru64.tmpl, modeled on rc.atalk.sysv - distrib/initscripts/Makefile.am : add a target for Tru64 - etc/afpd/directory.c : if XPG4 access() is available, call it as it was done when AFS is defined through function accessmode() (defined in unix.c). This allows correct presentation of permissions to Mac users if the file server has ACLs. - etc/afpd/unix.c : add accessmode() function. This is the existing afsmode function less the checks to validate the current path is in AFS. - etc/afpd/afs.c : afsmods() modified to call new accessmode() after the checking phase. - etc/afpd/auth.c : Add a message with LOG_DEBUG priority telling which uam file is being loaded. Allow easier detection of misconfiguration. - etc/afpd/uam.c : log a message in case uam_load fails because mod_symbol() failed to locate the required symbol. --- acconfig.h | 6 +- configure.in | 53 ++++++++++-- distrib/initscripts/Makefile.am | 14 ++++ distrib/initscripts/rc.atalk.redhat.tmpl | 48 ++++++----- distrib/initscripts/rc.atalk.tru64.tmpl | 102 +++++++++++++++++++++++ etc/afpd/afs.c | 22 +---- etc/afpd/auth.c | 14 +++- etc/afpd/directory.c | 5 +- etc/afpd/uam.c | 3 + etc/afpd/unix.c | 34 ++++++++ etc/atalkd/route.c | 4 + etc/uams/Makefile.am | 58 +++++++------ sys/netatalk/endian.h | 4 + 13 files changed, 286 insertions(+), 81 deletions(-) create mode 100755 distrib/initscripts/rc.atalk.tru64.tmpl diff --git a/acconfig.h b/acconfig.h index b0d8aa0f..8eb40ba5 100644 --- a/acconfig.h +++ b/acconfig.h @@ -8,6 +8,7 @@ #undef DLSYM_PREPEND_UNDERSCORE #undef DROPKLUDGE #undef HAVE_2ARG_DBTOB +#undef HAVE_64BIT_LONGS #undef HAVE_BROKEN_CPP #undef HAVE_GCC_MEMCPY_BUG #undef MACOSX_SERVER @@ -22,6 +23,7 @@ #undef SHADOWPW #undef SOLARIS #undef TCPWRAP +#undef TRU64 #undef UAM_DHX #undef UAM_PGP #undef UAM_RNDNUM @@ -30,4 +32,6 @@ #undef USE_FLOCK_LOCKS #undef USE_LASTDID #undef USE_PAM - +#undef USE_MOUNT_H +#undef USE_OLD_RQUOTA +#undef USE_UFS_QUOTA_H diff --git a/configure.in b/configure.in index 2a1cbca3..b18a02a7 100644 --- a/configure.in +++ b/configure.in @@ -72,6 +72,14 @@ AC_CHECK_LIB(sys, main) dnl Replace `main' with a function in -lubik: AC_CHECK_LIB(ubik, main) +# +# Check presence of some functions +# +# Check for XPG4 access() function +# Be sure to test before adding AFS libs in LIBS path as AFS lib +# has such a function that works only on AFS filesystems. +AC_CHECK_FUNCS(access) + dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC @@ -232,15 +240,21 @@ AC_ARG_WITH(message-dir, AC_SUBST(SERVERTEXT) ) +AC_CHECK_LIB(pam, pam_start, + AC_DEFINE(USE_PAM, 1) + LIBS="$LIBS -lpam" + compile_pam=yes) +AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes) + AC_ARG_WITH(pam, [ --with-pam enable password authentication modules support], - AC_CHECK_LIB(pam, pam_start, - AC_DEFINE(USE_PAM, 1) - LIBS="$LIBS -lpam" - compile_pam=yes + if test "x$compile_pam" = "xyes"; then + use_pam_so=yes AC_MSG_RESULT([enabling pam modules support]) + else + AC_MSG_RESULT([pam libraries not found. Disabling pam modules support]) + fi ) -) AC_ARG_WITH(shadow, [ --with-shadow enable shadow password support], @@ -282,7 +296,7 @@ AC_ARG_ENABLE(cobalt, AC_ARG_WITH(uams-path, [ --with-uams-path=path path to UAMs [default=/etc/atalk/uams]], uams_path="$withval", - uams_path="/etc/atalk/uams" + uams_path="$config_dir/uams" ) AC_DEFINE_UNQUOTED(UAMS_PATH, "$uams_path", [path to UAMs [default=/etc/atalk/uams]]) @@ -308,6 +322,7 @@ case "$host_os" in *osx*) this_os=macosx ;; *netbsd*) this_os=netbsd ;; *openbsd*) this_os=openbsd ;; + *osf*) this_os=tru64 ;; *solaris*) this_os=solaris ;; esac @@ -382,6 +397,21 @@ if test x"$this_os" = "xsolaris"; then need_dash_r=yes fi +dnl ----- Tru64 specific ----- +if test x"$this_os" = "xtru64"; then + AC_MSG_RESULT([ * Tru64 specific configuration]) + AC_DEFINE(NO_DDP) + AC_DEFINE(HAVE_64BIT_LONGS) + AC_DEFINE(USE_MOUNT_H) + AC_DEFINE(USE_OLD_RQUOTA) + AC_DEFINE(USE_UFS_QUOTA_H) + AC_DEFINE(TRU64) + CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS" + LDSHAREDFLAGS="-expect_unresolved \*" + need_dash_r=no + sysv_style=tru64 +fi + dnl -- look for openssl AC_ARG_WITH(ssl-dir, [ --with-ssl-dir=PATH specify path to openssl installation (must contain @@ -403,14 +433,15 @@ for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl/ /usr/local dnl Check for the crypto library: AC_CHECK_LIB(crypto, main) - LIBS="$LIBS -lcrypto" + dnl LIBS="$LIBS -lcrypto" dnl Check for "DES" library (for SSLeay, not openssl): AC_CHECK_LIB(des, main) AC_DEFINE(OPENSSL_DHX, 1) - AC_DEFINE(UAM_DHX, 1) - AC_DEFINE(UAM_PGP, 1) + AC_DEFINE(UAM_DHX, 1) +dnl AC_DEFINE(UAM_PGP, 1) AC_DEFINE(UAM_RNDNUM, 1) + use_pgp=no compile_dhx=yes AC_MSG_RESULT([Found ssl and enabling RANDNUM and DHX support "$ssldir"]) break @@ -421,10 +452,14 @@ dnl --------------------- last minute substitutions AC_SUBST(LIBS) AC_SUBST(CFLAGS) +AC_SUBST(LDSHAREDFLAGS) AM_CONDITIONAL(USE_DHX, test x$compile_dhx = xyes) +AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes) AM_CONDITIONAL(USE_PAM, test x$compile_pam = xyes) +AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes) AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt) AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat) +AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64) dnl --------------------- generate files diff --git a/distrib/initscripts/Makefile.am b/distrib/initscripts/Makefile.am index 694addd5..92080b32 100644 --- a/distrib/initscripts/Makefile.am +++ b/distrib/initscripts/Makefile.am @@ -39,3 +39,17 @@ atalk: rc.atalk.cobalt chmod a+x atalk endif + +# +# checking for "tru64" style sysv scripts: +# + +if USE_TRU64 + +sysv_SCRIPTS = atalk + +atalk: rc.atalk.tru64 + cp -f rc.atalk.tru64 atalk + chmod a+x atalk + +endif diff --git a/distrib/initscripts/rc.atalk.redhat.tmpl b/distrib/initscripts/rc.atalk.redhat.tmpl index 951612b9..75127c83 100644 --- a/distrib/initscripts/rc.atalk.redhat.tmpl +++ b/distrib/initscripts/rc.atalk.redhat.tmpl @@ -9,18 +9,22 @@ # its data structures must have time to stablize before running the # other processes. +ATALK_BIN=:BINDIR: +ATALK_CONF_DIR=:ETCDIR: +ATALK_SBIN=:SBINDIR: + # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network -test -x :SBINDIR:/atalkd || exit 0 +test -x ${ATALK_SBIN}/atalkd || exit 0 -test -f :ETCDIR:/netatalk.conf || exit 0 +test -f ${ATALK_CONF_DIR}/netatalk.conf || exit 0 # read in netatalk configuration -. :ETCDIR:/netatalk.conf +. ${ATALK_CONF_DIR}/netatalk.conf # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 @@ -34,33 +38,33 @@ RETVAL_AFPD=0 # startup code for everything atalk_startup() { if [ x"${ATALKD_RUN}" != x"no" ]; then - daemon :SBINDIR:/atalkd + daemon ${ATALK_SBIN}/atalkd RETVAL_ATALKD=$? - if [ -x :BINDIR:/nbprgstr ]; then - :BINDIR:/nbprgstr -p 4 "${ATALK_NAME}:Workstation${ATALK_ZONE}" - :BINDIR:/nbprgstr -p 4 "${ATALK_NAME}:netatalk${ATALK_ZONE}" + if [ -x ${ATALK_BIN}/nbprgstr ]; then + ${ATALK_BIN}/nbprgstr -p 4 "${ATALK_NAME}:Workstation${ATALK_ZONE}" + ${ATALK_BIN}/nbprgstr -p 4 "${ATALK_NAME}:netatalk${ATALK_ZONE}" fi - if [ x"${PAPD_RUN}" = x"yes" -a -x :SBINDIR:/papd ]; then - daemon :SBINDIR:/papd + if [ x"${PAPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/papd ]; then + daemon ${ATALK_SBIN}/papd RETVAL_PAPD=$? fi # check for timelord in bin directory - if [ -x :BINDIR:/timelord ]; then - daemon :BINDIR:/timelord + if [ -x ${ATALK_BIN}/timelord ]; then + daemon ${ATALK_BIN}/timelord fi # check for timelord in sbin directory - if [ -x :SBINDIR:/timelord ]; then - daemon :SBINDIR:/timelord + if [ -x ${ATALK_SBIN}/timelord ]; then + daemon ${ATALK_SBIN}/timelord fi fi - if [ x"${AFPD_RUN}" = x"yes" -a -x :SBINDIR:/afpd ] ; then - daemon :SBINDIR:/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \ + if [ x"${AFPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/afpd ] ; then + daemon ${ATALK_SBIN}/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \ -c ${AFPD_MAX_CLIENTS} -n "${ATALK_NAME}${ATALK_ZONE}" RETVAL_AFPD=$? fi @@ -85,33 +89,33 @@ case "$1" in 'stop') echo -n 'Shutting down AppleTalk services: ' if [ x"${ATALKD_RUN}" != x"no" ]; then - if [ x"${PAPD_RUN}" = x"yes" -a -x :SBINDIR:/papd ]; then + if [ x"${PAPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/papd ]; then killproc papd RETVAL_PAPD=$? fi # checking for timelord in bin directory - if [ -x :BINDIR:/timelord ]; then + if [ -x ${ATALK_BIN}/timelord ]; then killproc timelord fi # checking for timelord in sbin directory - if [ -x :SBINDIR:/timelord ]; then + if [ -x ${ATALK_SBIN}/timelord ]; then killproc timelord fi - :BINDIR:/nbpunrgstr "${ATALK_NAME}:Workstation${ATALK_ZONE}" - :BINDIR:/nbpunrgstr "${ATALK_NAME}:netatalk${ATALK_ZONE}" + ${ATALK_BIN}/nbpunrgstr "${ATALK_NAME}:Workstation${ATALK_ZONE}" + ${ATALK_BIN}/nbpunrgstr "${ATALK_NAME}:netatalk${ATALK_ZONE}" # kill atalkd last, since without it the plumbing goes away. - if [ -x :SBINDIR:/atalkd ]; then + if [ -x ${ATALK_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 :SBINDIR:/afpd ]; then + if [ x"${AFPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/afpd ]; then killproc afpd RETVAL_AFPD=$? fi diff --git a/distrib/initscripts/rc.atalk.tru64.tmpl b/distrib/initscripts/rc.atalk.tru64.tmpl new file mode 100755 index 00000000..703645de --- /dev/null +++ b/distrib/initscripts/rc.atalk.tru64.tmpl @@ -0,0 +1,102 @@ +#! /bin/sh +# +# Start/stop the AppleTalk daemons. +# +# AppleTalk daemons. Make sure not to start atalkd in the background: +# its data structures must have time to stablize before running the +# other processes. +# + +ATALK_BIN=:BINDIR: +ATALK_CONF_DIR=:ETCDIR: +ATALK_SBIN=:SBINDIR: + +ATALK_START_ATALKD=0 +ATALK_START_NBPRGSTR=0 +ATALK_START_PAPD=0 +ATALK_START_AFPD=1 +ATALK_START_TIMELORD=0 + +# +# kill the named process(es) +# +killproc() { + pid=`/usr/bin/ps -e | + /usr/bin/grep $1 | + /usr/bin/grep -v grep | + /usr/bin/sed -e 's/^ *//' -e 's/ .*//'` + [ "$pid" != "" ] && kill $pid +} + +case "$1" in + +# +# Start the appletalk server processes. +# + +'start') + + echo 'starting appletalk daemons: \c' + if [ ${ATALK_START_ATALKD} -eq 1 -a -x ${ATALK_SBIN}/atalkd ]; then + ${ATALK_SBIN}/atalkd; echo ' atalkd\c' + fi + + if [ ${ATALK_START_NBPRGSTR} -eq 1 -a -x ${ATALK_BIN}/nbprgstr ]; then + ${ATALK_BIN}/nbprgstr -p 4 `hostname|sed 's/\..*$//'`:Workstation + ${ATALK_BIN}/nbprgstr -p 4 `hostname|sed 's/\..*$//'`:netatalk + echo ' nbprgstr\c' + fi + + if [ ${ATALK_START_PAPD} -eq 1 -a -x ${ATALK_SBIN}/papd ]; then + ${ATALK_SBIN}/papd; echo ' papd\c' + fi + + if [ ${ATALK_START_AFPD} -eq 1 -a -x ${ATALK_SBIN}/afpd ]; then + ${ATALK_SBIN}/afpd; echo ' afpd\c' + fi + + if [ ${ATALK_START_TIMELORD} -eq 1 -a -x ${ATALK_SBIN}/timelord ]; then + ${ATALK_SBIN}/timelord; echo ' timelord\c' + fi + + echo '.' + + ;; + +# +# Stop the appletalk server processes. +# + +'stop') + + echo 'stopping appletalk daemons:\c' + + if [ -x ${ATALK_SBIN}/papd ]; then + killproc papd; echo ' papd\c' + fi + + if [ -x ${ATALK_SBIN}/afpd ]; then + killproc afpd; echo ' afpd\c' + fi + + if [ -x ${ATALK_SBIN}/timelord ]; then + killproc timelord; echo ' timelord\c' + fi + + # kill atalkd last, since without it the plumbing goes away. + if [ -x ${ATALK_SBIN}/atalkd ]; then + killproc atalkd; echo ' atalkd\c' + fi + + echo '.' + ;; + +# +# Usage statement. +# + +*) + echo "usage: $0 {start|stop}" + exit 1 + ;; +esac diff --git a/etc/afpd/afs.c b/etc/afpd/afs.c index 8008d94b..cb2082c6 100644 --- a/etc/afpd/afs.c +++ b/etc/afpd/afs.c @@ -143,27 +143,7 @@ afsmode( path, ma, dir ) return; } - if ( access( path, R_OK|W_OK|X_OK ) == 0 ) { - ma->ma_user = AR_UREAD|AR_UWRITE|AR_USEARCH|AR_UOWN; - ma->ma_owner = AR_UREAD|AR_UWRITE|AR_USEARCH; - } else if ( access( path, R_OK|X_OK ) == 0 ) { - ma->ma_user = AR_UREAD|AR_USEARCH; - ma->ma_owner = AR_UREAD|AR_USEARCH; - } else { - ma->ma_user = ma->ma_owner = 0; - if ( access( path, R_OK ) == 0 ) { - ma->ma_user |= AR_UREAD; - ma->ma_owner |= AR_UREAD; - } - if ( access( path, X_OK ) == 0 ) { - ma->ma_user |= AR_USEARCH; - ma->ma_owner |= AR_USEARCH; - } - if ( access( path, W_OK ) == 0 ) { - ma->ma_user |= AR_UWRITE|AR_UOWN; - ma->ma_owner |= AR_UWRITE; - } - } + accessmode( upath, &ma, dir ); return; } diff --git a/etc/afpd/auth.c b/etc/afpd/auth.c index fd56025c..a163d57b 100644 --- a/etc/afpd/auth.c +++ b/etc/afpd/auth.c @@ -455,9 +455,19 @@ int auth_load(const char *path, const char *list) while (p) { strncpy(name + len, p, sizeof(name) - len); + syslog(LOG_DEBUG, "uam : Loading (%s)", name); + /* if ((stat(name, &st) == 0) && (mod = uam_load(name, p))) { - uam_attach(&uam_modules, mod); - syslog(LOG_INFO, "uam: %s loaded", p); + */ + if (stat(name, &st) == 0) { + if (mod = uam_load(name, p)) { + uam_attach(&uam_modules, mod); + syslog(LOG_INFO, "uam: %s loaded", p); + } else { + syslog(LOG_INFO, "uam: %s load failure",p); + } + } else { + syslog(LOG_INFO, "uam: uam not found (status=%d)", stat(name, &st)); } p = strtok(NULL, ","); } diff --git a/etc/afpd/directory.c b/etc/afpd/directory.c index 81640c46..b8dfece0 100644 --- a/etc/afpd/directory.c +++ b/etc/afpd/directory.c @@ -943,7 +943,10 @@ int getdirparams(vol, bitmap, upath, dir, st, buf, buflen ) case DIRPBIT_ACCESS : utommode( st, &ma ); -#ifdef AFS +#ifdef HAVE_ACCESS + accessmode( upath, &ma, dir ); +#endif HAVE_ACCESS +#ifdef AFS /* If only AFS defined, access() works only for AFS filesystems */ afsmode( upath, &ma, dir ); #endif AFS *data++ = ma.ma_user; diff --git a/etc/afpd/uam.c b/etc/afpd/uam.c index 60946a73..cff56de5 100644 --- a/etc/afpd/uam.c +++ b/etc/afpd/uam.c @@ -54,6 +54,9 @@ struct uam_mod *uam_load(const char *path, const char *name) if ((p = strchr(buf, '.'))) *p = '\0'; if ((mod->uam_fcn = mod_symbol(module, buf)) == NULL) { + syslog(LOG_ERR, "uam_load(%s): mod_symbol error for symbol %s", + name, + buf); goto uam_load_err; } diff --git a/etc/afpd/unix.c b/etc/afpd/unix.c index 2874abd6..b64b9b51 100644 --- a/etc/afpd/unix.c +++ b/etc/afpd/unix.c @@ -129,6 +129,40 @@ void utommode( stat, ma ) } +/* + * Calculate the mode for a directory using Posix access() calls to + * estimate permission, a la mdw. + */ +accessmode( path, ma, dir ) + char *path; + struct maccess *ma; + struct dir *dir; +{ + if ( access( path, R_OK|W_OK|X_OK ) == 0 ) { + ma->ma_user = AR_UREAD|AR_UWRITE|AR_USEARCH|AR_UOWN; + ma->ma_owner = AR_UREAD|AR_UWRITE|AR_USEARCH; + } else if ( access( path, R_OK|X_OK ) == 0 ) { + ma->ma_user = AR_UREAD|AR_USEARCH; + ma->ma_owner = AR_UREAD|AR_USEARCH; + } else { + ma->ma_user = ma->ma_owner = 0; + if ( access( path, R_OK ) == 0 ) { + ma->ma_user |= AR_UREAD; + ma->ma_owner |= AR_UREAD; + } + if ( access( path, X_OK ) == 0 ) { + ma->ma_user |= AR_USEARCH; + ma->ma_owner |= AR_USEARCH; + } + if ( access( path, W_OK ) == 0 ) { + ma->ma_user |= AR_UWRITE|AR_UOWN; + ma->ma_owner |= AR_UWRITE; + } + } + + return; +} + int gmem( gid ) const gid_t gid; { diff --git a/etc/atalkd/route.c b/etc/atalkd/route.c index cc97b2ac..2b20c107 100644 --- a/etc/atalkd/route.c +++ b/etc/atalkd/route.c @@ -22,7 +22,11 @@ route( message, dst, gate, flags ) struct sockaddr *dst, *gate; int flags; { +#ifdef TRU64 + struct ortentry rtent; +#else struct rtentry rtent; +#endif bzero( &rtent, sizeof( struct rtentry )); rtent.rt_dst = *dst; diff --git a/etc/uams/Makefile.am b/etc/uams/Makefile.am index f3440643..eb51620c 100644 --- a/etc/uams/Makefile.am +++ b/etc/uams/Makefile.am @@ -1,13 +1,36 @@ # Makefile.am for etc/uams/ if USE_DHX -DHX_UAMS = uams_dhx_pam.so uams_dhx_passwd.so uams_dhx.so uams_pgp.so +DHX_UAMS_BASE = uams_dhx_passwd.so +DHX_LINKS = uams_dhx.so +if USE_PGP +DHX_UAMS = $(DHX_UAMS_BASE) uams_pgp.so +else +DHX_UAMS = $(DHX_UAMS_BASE) +endif +endif + +if BUILD_PAM +PAM_UAMS= uams_pam.so +if USE_DHX +DHX_PAM_UAMS = uams_dhx_pam.so endif +endif + +if USE_PAM_SO +UAM_CLRTXT_SO=uams_pam.so +UAM_DHX_SO=uams_dhx_pam.so +else +UAM_CLRTXT_SO=uams_passwd.so +UAM_DHX_SO=uams_dhx_passwd.so +endif + +uamsdir = @UAMS_PATH@ +uams_DATA = $(DHX_UAMS) $(DHX_PAM_UAMS) $(PAM_UAMS) uams_guest.so \ + uams_passwd.so \ + uams_randnum.so -uamsdir = $(CONFIG_DIR)/uams -uams_DATA = $(DHX_UAMS) uams_guest.so \ - uams_pam.so uams_passwd.so \ - uams_randnum.so uams_clrtxt.so +uams_LINKS = $(DHX_LINKS) uams_clrtxt.so EXTRA_DIST = uams_dhx_pam.c uams_dhx_passwd.c uams_pgp.c \ uams_guest.c uams_pam.c uams_passwd.c uams_randnum.c @@ -20,38 +43,23 @@ SUFFIXES = .c .so .c.so: $(COMPILE) -DHAVE_CONFIG_H -fPIC -DPIC \ -I$(top_srcdir) -fomit-frame-pointer -c $< ; \ - $(LD) -shared -o $@ $*.o $(LIBS) + $(LD) -shared $(LDSHAREDFLAGS) -o $@ $*.o $(LIBS) # -# create symbolic links (conditionally, depending on when PAM is used): +# create symbolic links: # -if USE_PAM - uams_clrtxt.so: - $(LN_S) uams_pam.so uams_clrtxt.so + $(LN_S) -f $(UAM_CLRTXT_SO) $(DESTDIR)$(UAMS_PATH)/uams_clrtxt.so uams_dhx.so: - $(LN_S) uams_dhx_pam.so uams_dhx.so - -else - -uams_clrtxt.so: - $(LN_S) uams_passwd.so uams_clrtxt.so - -uams_dhx.so: - $(LN_S) uams_dhx_passwd.so uams_dhx.so - -endif + $(LN_S) -f $(UAM_DHX_SO) $(DESTDIR)$(UAMS_PATH)/uams_dhx.so # # install/install-strip: # -install: - mkdir -p $(DESTDIR)$(UAMS_PATH); \ - rm -f $(DESTDIR)$(UAMS_PATH)/uams_{clrtxt,dhx}.so; \ - cp -dpf $(uams_DATA) $(DESTDIR)$(UAMS_PATH)/ +install-data-local: $(uams_LINKS) install-strip: strip $(uams_DATA); \ diff --git a/sys/netatalk/endian.h b/sys/netatalk/endian.h index e602ec56..532eb28c 100644 --- a/sys/netatalk/endian.h +++ b/sys/netatalk/endian.h @@ -11,6 +11,10 @@ #include #include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef _IBMR2 #include #endif /*_IBMR2*/ -- 2.39.2