]> arthur.barton.de Git - netatalk.git/commitdiff
Changes made by Michel Jouvin - jouvin@lal.in2p3.fr - 23/11/2000
authorjouvin <jouvin>
Fri, 1 Dec 2000 10:00:34 +0000 (10:00 +0000)
committerjouvin <jouvin>
Fri, 1 Dec 2000 10:00:34 +0000 (10:00 +0000)
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.

13 files changed:
acconfig.h
configure.in
distrib/initscripts/Makefile.am
distrib/initscripts/rc.atalk.redhat.tmpl
distrib/initscripts/rc.atalk.tru64.tmpl [new file with mode: 0755]
etc/afpd/afs.c
etc/afpd/auth.c
etc/afpd/directory.c
etc/afpd/uam.c
etc/afpd/unix.c
etc/atalkd/route.c
etc/uams/Makefile.am
sys/netatalk/endian.h

index b0d8aa0f93506c28dd402e65f98f745a6ee5b378..8eb40ba53999599f6604f2e5b0f234a44ca9ab67 100644 (file)
@@ -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
index 2a1cbca3180ae053963d2f6637245c48732dcfe3..b18a02a7acfa70029864f3a93b51bfeb116272f6 100644 (file)
@@ -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
 
index 694addd555e2e2ce459044ef9ebabace317fdc03..92080b3202a552b01dbea09edb8bf0e573b196ab 100644 (file)
@@ -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
index 951612b928a0e82a5ec89f1e5fc8a06437d9947a..75127c8312dbcddb004706c9c242d54479f75edc 100644 (file)
@@ -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 (executable)
index 0000000..703645d
--- /dev/null
@@ -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
index 8008d94bcbce4d15869b8f8cf0a323054afd2f92..cb2082c60db296ad599c899f690655e9414267bd 100644 (file)
@@ -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;
 }
index fd56025ccc51cd1461f1739f970d80d615e977c9..a163d57bea5023b9b71ea5d4219aebcc2b351b00 100644 (file)
@@ -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, ",");
   }
index 81640c46ff50595f45e2d8850382b6f885751ec5..b8dfece090f586cef3f11519f0ab676308800edd 100644 (file)
@@ -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;
index 60946a7369aea3e0b8b3e7ff534b63f1bb818fd9..cff56de530ac014e91c7b5c49dba554057c7d32b 100644 (file)
@@ -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;
   }
 
index 2874abd6ed81f23ecb8fbfd91125c8393dd15037..b64b9b51d416155a6cddee704e685120648ddcb2 100644 (file)
@@ -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;
 {
index cc97b2acedd9c69525ab35b3af389ff696253087..2b20c107f92172cc4fe1b9948603fe7f8609df05 100644 (file)
@@ -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;
index f344064372d585ec387adec214dd3d8cad438b4f..eb51620c22ce76f5b05dbe6c4b2f7b43fbb53e1a 100644 (file)
@@ -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); \
index e602ec567941896a5c628f92c7ce1fa12e3376e6..532eb28cfc84ac651365756de5f6ace30eb7def7 100644 (file)
 #include <sys/types.h>
 #include <netinet/in.h>
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #ifdef _IBMR2
 #include <sys/machine.h>
 #endif /*_IBMR2*/