#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
#undef SHADOWPW
#undef SOLARIS
#undef TCPWRAP
+#undef TRU64
#undef UAM_DHX
#undef UAM_PGP
#undef UAM_RNDNUM
#undef USE_FLOCK_LOCKS
#undef USE_LASTDID
#undef USE_PAM
-
+#undef USE_MOUNT_H
+#undef USE_OLD_RQUOTA
+#undef USE_UFS_QUOTA_H
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
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],
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]])
*osx*) this_os=macosx ;;
*netbsd*) this_os=netbsd ;;
*openbsd*) this_os=openbsd ;;
+ *osf*) this_os=tru64 ;;
*solaris*) this_os=solaris ;;
esac
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
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
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
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
# 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
# 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
'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
--- /dev/null
+#! /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
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;
}
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, ",");
}
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;
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;
}
}
+/*
+ * 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;
{
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;
# 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
.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); \
#include <sys/types.h>
#include <netinet/in.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#ifdef _IBMR2
#include <sys/machine.h>
#endif /*_IBMR2*/