created for the original connecting user. Said differently: if you
know the password of adminauthuser, you can authenticate as any other
user.
+* NEW: configure option "--enable-suse-systemd" for openSUSE12.1 and later.
+ "--enable-redhat-systemd" and "--enable-suse-systemd" are same as
+ "--enable-systemd".
+ "--enable-suse" is renamed "--enable-suse-sysv".
* NEW: experimental systemd service files in distrib/systemd/
* UPD: afpd: Enhanced POSIX ACL mapping semantics, from Laura Mueller
* UPD: afpd: Reset options every time a :DEFAULT: line is found in a
AM_CONDITIONAL(DEFAULT_HOOK, test x$neta_cv_have_libgcrypt != xyes && test x$neta_cv_have_openssl != xyes)
AM_CONDITIONAL(USE_NETBSD, test x$sysv_style = xnetbsd)
AM_CONDITIONAL(USE_REDHAT_SYSV, test x$sysv_style = xredhat-sysv)
-AM_CONDITIONAL(USE_REDHAT_SYSTEMD, test x$sysv_style = xredhat-systemd)
-AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
+AM_CONDITIONAL(USE_SUSE_SYSV, test x$sysv_style = xsuse-sysv)
AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
AM_CONDITIONAL(USE_SOLARIS, test x$sysv_style = xsolaris)
AM_CONDITIONAL(USE_GENTOO, test x$sysv_style = xgentoo)
AM_CONDITIONAL(USE_DEBIAN, test x$sysv_style = xdebian)
+AM_CONDITIONAL(USE_SYSTEMD, test x$sysv_style = xsystemd || test x$sysv_style = xredhat-systemd || test x$sysv_style = xsuse-systemd)
AM_CONDITIONAL(USE_UNDEF, test x$sysv_style = x)
AM_CONDITIONAL(USE_BDB, test x$bdb_required = xyes)
AM_CONDITIONAL(HAVE_ATFUNCS, test x"$ac_neta_haveatfuncs" = x"yes")
Makefile.in
rc.atalk.bsd
rc.atalk.redhat-sysv
-rc.atalk.redhat-systemd
-rc.atalk.suse
+rc.atalk.systemd
+rc.atalk.suse-sysv
rc.atalk.tru64
rc.atalk.sysv
-service.atalk.redhat-systemd
+service.atalk.systemd
netatalk
atalk
netatalk.service
GENERATED_FILES = \
rc.afpd.netbsd \
rc.atalk.redhat-sysv \
- rc.atalk.redhat-systemd \
+ rc.atalk.systemd \
rc.atalk.tru64 \
rc.atalk.bsd \
rc.atalkd.netbsd \
- rc.atalk.suse \
+ rc.atalk.suse-sysv \
rc.cnid_metad.netbsd \
rc.papd.netbsd \
rc.timelord.netbsd \
rc.atalk.sysv \
rc.atalk.gentoo \
rc.atalk.debian \
- service.atalk.redhat-systemd
+ service.atalk.systemd
TEMPLATES = \
rc.afpd.netbsd.tmpl \
rc.atalk.redhat-sysv.tmpl \
- rc.atalk.redhat-systemd.tmpl \
+ rc.atalk.systemd.tmpl \
rc.atalk.tru64.tmpl \
rc.atalk.bsd.tmpl \
rc.atalkd.netbsd.tmpl \
- rc.atalk.suse.tmpl \
+ rc.atalk.suse-sysv.tmpl \
rc.cnid_metad.netbsd.tmpl \
rc.papd.netbsd.tmpl \
rc.timelord.netbsd.tmpl \
rc.atalk.sysv.tmpl \
rc.atalk.gentoo.tmpl \
rc.atalk.debian.tmpl \
- service.atalk.redhat-systemd.tmpl
+ service.atalk.systemd.tmpl
CLEANFILES = $(GENERATED_FILES) $(sysv_SCRIPTS) $(service_DATA) afpd atalkd cnid_metad papd timelord
EXTRA_DIST = $(TEMPLATES)
endif
#
-# checking for "redhat" style systemd scripts:
+# checking for general systemd scripts:
#
-if USE_REDHAT_SYSTEMD
+if USE_SYSTEMD
sysvdir = $(pkglibexecdir)
sysv_SCRIPTS = netatalk.sh
servicedir = /lib/systemd/system
service_DATA = netatalk.service
-$(sysv_SCRIPTS): rc.atalk.redhat-systemd
- cp -f rc.atalk.redhat-systemd $(sysv_SCRIPTS)
+$(sysv_SCRIPTS): rc.atalk.systemd
+ cp -f rc.atalk.systemd $(sysv_SCRIPTS)
chmod a+x $(sysv_SCRIPTS)
-$(service_DATA): service.atalk.redhat-systemd
- cp -f service.atalk.redhat-systemd $(service_DATA)
+$(service_DATA): service.atalk.systemd
+ cp -f service.atalk.systemd $(service_DATA)
install-data-hook:
-systemctl daemon-reload
# checking for "SuSE" style sysv scripts:
#
-if USE_SUSE
+if USE_SUSE_SYSV
sysvdir = /etc/init.d
sysv_SCRIPTS = netatalk
-$(sysv_SCRIPTS): rc.atalk.suse
- cp -f rc.atalk.suse $(sysv_SCRIPTS)
+$(sysv_SCRIPTS): rc.atalk.suse-sysv
+ cp -f rc.atalk.suse-sysv $(sysv_SCRIPTS)
chmod a+x $(sysv_SCRIPTS)
install-data-hook:
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
+# Default-Stop: 1
### END INIT INFO
#
# netatalk Netatalk :NETATALK_VERSION: initscript
+++ /dev/null
-#!/bin/sh
-
-# Netatalk :NETATALK_VERSION: startup script for systemd.
-
-# The method of using this script is not suitable.
-# This script will be deleted in the future.
-
-ATALK_BIN=:BINDIR:
-ATALK_CONF_DIR=:ETCDIR:
-ATALK_SBIN=:SBINDIR:
-
-# default
-ATALK_NAME=`echo ${HOSTNAME}|cut -d. -f1`
-ATALK_UNIX_CHARSET='LOCALE'
-ATALK_MAC_CHARSET='MAC_ROMAN'
-
-CNID_METAD_RUN=yes
-AFPD_RUN=yes
-AFPD_MAX_CLIENTS=20
-AFPD_UAMLIST="-U uams_dhx.so,uams_dhx2.so"
-AFPD_GUEST=nobody
-CNID_CONFIG="-l log_note"
-
-ATALKD_RUN=no
-PAPD_RUN=no
-TIMELORD_RUN=no
-A2BOOT_RUN=no
-ATALK_ZONE=
-ATALK_BGROUND=no
-
-# read in netatalk configuration
-if [ -f ${ATALK_CONF_DIR}/netatalk.conf ]; then
- . ${ATALK_CONF_DIR}/netatalk.conf
-fi
-
-netatalk_startup() {
- if [ x"${ATALKD_RUN}" != x"no" -a -x ${ATALK_SBIN}/atalkd ]; then
- ${ATALK_SBIN}/atalkd
-
- 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 ${ATALK_SBIN}/papd ]; then
- ${ATALK_SBIN}/papd
- fi
-
- # check for timelord in bin directory
- if [ x"${TIMELORD_RUN}" = x"yes" -a -x ${ATALK_BIN}/timelord ]; then
- ${ATALK_BIN}/timelord
- fi
-
- # check for timelord in sbin directory
- if [ x"${TIMELORD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/timelord ]; then
- ${ATALK_SBIN}/timelord
- fi
-
- # check for a2boot in bin directory
- if [ x"${A2BOOT_RUN}" = x"yes" -a -x ${ATALK_BIN}/a2boot ]; then
- ${ATALK_BIN}/a2boot
- fi
-
- # check for a2boot in sbin directory
- if [ x"${A2BOOT_RUN}" = x"yes" -a -x ${ATALK_SBIN}/a2boot ]; then
- ${ATALK_SBIN}/a2boot
- fi
- fi
-
- if [ x"${CNID_METAD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/cnid_metad ]; then
- ${ATALK_SBIN}/cnid_metad $CNID_CONFIG
- fi
-
- if [ x"${AFPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/afpd ]; then
- ${ATALK_SBIN}/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \
- -c ${AFPD_MAX_CLIENTS} -n ${ATALK_NAME}${ATALK_ZONE}
- fi
-}
-
-if [ x"${ATALK_BGROUND}" = x"yes" -a x"${ATALKD_RUN}" != x"no" ]; then
- netatalk_startup >& /dev/null &
-else
- netatalk_startup
-fi
--- /dev/null
+#! /bin/sh
+# Copyright (c) 1996-2001 SuSE GmbH Nuernberg, Germany. All rights reserved.
+#
+# Author:
+# Reinhold Sojer, <reinhold@suse.de>
+# Olaf Hering, <olh@suse.de>
+#
+### BEGIN INIT INFO
+# Provides: netatalk
+# Required-Start: $local_fs
+# Required-Stop: $local_fs
+# Should-Start: $network $named $remote_fs $syslog slpd
+# Should-Stop: $remote_fs $network $syslog
+# Default-Start: 3 5
+# Default-Stop:
+# Description: AFP over TCP and legacy AppleTalk daemons
+### END INIT INFO
+
+# Netatalk :NETATALK_VERSION:
+
+ATALK_NAME=`hostname|sed 's/\..*$//'`
+ATALK_UNIX_CHARSET='LOCALE'
+ATALK_MAC_CHARSET='MAC_ROMAN'
+
+CNID_METAD_RUN=yes
+AFPD_RUN=yes
+AFPD_MAX_CLIENTS=20
+AFPD_UAMLIST="-U uams_dhx.so,uams_dhx2.so"
+AFPD_GUEST=nobody
+CNID_CONFIG="-l log_note"
+
+ATALKD_RUN=no
+PAPD_RUN=no
+TIMELORD_RUN=no
+#A2BOOT_RUN=no
+ATALK_ZONE=
+ATALK_BGROUND=no
+
+. /etc/rc.status
+. :ETCDIR:/netatalk.conf
+
+# startup code for everything
+atalk_startup() {
+ if [ x"${ATALKD_RUN}" != x"no" ]; then
+ echo -n " Starting atalkd ... "
+ :SBINDIR:/atalkd ; my_ec=$?
+
+ if [ -x :BINDIR:/nbprgstr -a "$my_ec" = "0" ]; then
+ echo -n ".. "
+ :BINDIR:/nbprgstr -p 4 ${ATALK_NAME}:Workstation
+ echo -n ". "
+ :BINDIR:/nbprgstr -p 4 ${ATALK_NAME}:netatalk
+ fi
+ if [ "$my_ec" != "0" ] ; then false ; fi
+ rc_status -v
+
+ rc_reset
+
+ if [ x"${PAPD_RUN}" = x"yes" -a -x :SBINDIR:/papd ]; then
+ echo -n " Starting papd"
+ :SBINDIR:/papd
+ rc_status -v
+ fi
+
+ rc_reset
+
+ if [ x"${TIMELORD_RUN}" = x"yes" -a -x :SBINDIR:/timelord ]; then
+ echo -n " Starting timelord"
+ :SBINDIR:/timelord
+ rc_status -v
+ fi
+
+ rc_reset
+
+ fi
+
+ if [ x"${CNID_METAD_RUN}" = x"yes" -a -x :SBINDIR:/cnid_metad ] ; then
+ echo -n " Starting cnid_metad "
+ startproc :SBINDIR:/cnid_metad ${CNID_CONFIG}
+ rc_status -v
+ fi
+
+ if [ x"${AFPD_RUN}" = x"yes" -a -x :SBINDIR:/afpd ] ; then
+ echo -n " Starting afpd ("
+ echo -n ${AFPD_UAMLIST} -g ${AFPD_GUEST} \
+ -c ${AFPD_MAX_CLIENTS} -n ${ATALK_NAME}${ATALK_ZONE}
+ echo -n ")"
+ startproc :SBINDIR:/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \
+ ${AFPD_OPTIONS} \
+ -c ${AFPD_MAX_CLIENTS} -n "${ATALK_NAME}${ATALK_ZONE}"
+ rc_status -v
+ fi
+
+ touch /var/lock/subsys/atalk
+}
+
+case "$1" in
+ start)
+ if test ! -z "$UID" -a "$UID" != 0 ; then
+ echo "you have to be root to start netatalk daemons"
+ rc_failed
+ else
+ if [ x"${ATALK_BGROUND}" = x"yes" -a x"${ATALKD_RUN}" != x"no" ]; then
+ echo -n "Starting netatalk in the background ..."
+ atalk_startup >& /dev/null &
+ rc_status -v
+ else
+ echo "Starting netatalk (this may take a while) ..."
+ atalk_startup
+ fi
+ fi
+ ;;
+ stop)
+ echo -n "Shutting down netatalk"
+ if test -x :SBINDIR:/papd ; then
+ killproc -TERM :SBINDIR:/papd
+ fi
+ if test -x :SBINDIR:/timelord ; then
+ killproc -TERM :SBINDIR:/timelord
+ fi
+ if test -x :SBINDIR:/atalkd ; then
+ killproc -TERM :SBINDIR:/atalkd
+ fi
+ killproc -TERM :SBINDIR:/cnid_metad
+ killproc -TERM :SBINDIR:/afpd
+
+ rc_status -v
+ ;;
+ restart|reload|force-reload)
+ $0 stop
+ $0 start
+ rc_status
+ ;;
+ status)
+ echo "Checking for netatalk services"
+ if [ x"${ATALKD_RUN}" = x"yes" -a -x :SBINDIR:/atalkd ] ; then
+ checkproc :SBINDIR:/atalkd && echo -n "atalkd: OK " || echo -n "atalkd: No process "
+ fi
+ if [ x"${PAPD_RUN}" = x"yes" -a -x :SBINDIR:/papd ] ; then
+ checkproc :SBINDIR:/papd && echo -n "papd: OK " || echo -n "papd: No process "
+ fi
+ if [ x"${TIMELORD_RUN}" = x"yes" -a -x :SBINDIR:/timelord ] ; then
+ checkproc :SBINDIR:/timelord && echo -n " timelord: OK " || echo -n " timelord: No process "
+ fi
+ if [ x"${CNID_METAD_RUN}" = x"yes" ] ; then
+ checkproc :SBINDIR:/cnid_metad && echo -n " cnid_metad: OK " || echo -n " cnid_metad: No process "
+ fi
+ checkproc :SBINDIR:/afpd && echo "afpd: OK" || echo "afpd: No process"
+ # assume that afpd is the "main" process ...
+ checkproc :SBINDIR:/afpd
+ rc_status -v
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|status}"
+ exit 1
+ ;;
+esac
+
+rc_exit
+++ /dev/null
-#! /bin/sh
-# Copyright (c) 1996-2001 SuSE GmbH Nuernberg, Germany. All rights reserved.
-#
-# Author:
-# Reinhold Sojer, <reinhold@suse.de>
-# Olaf Hering, <olh@suse.de>
-#
-### BEGIN INIT INFO
-# Provides: netatalk
-# Required-Start: $local_fs
-# Required-Stop: $local_fs
-# Should-Start: $network $named $remote_fs $syslog slpd
-# Should-Stop: $remote_fs $network $syslog
-# Default-Start: 3 5
-# Default-Stop:
-# Description: AFP over TCP and legacy AppleTalk daemons
-### END INIT INFO
-
-# Netatalk :NETATALK_VERSION:
-
-ATALK_NAME=`hostname|sed 's/\..*$//'`
-ATALK_UNIX_CHARSET='LOCALE'
-ATALK_MAC_CHARSET='MAC_ROMAN'
-
-CNID_METAD_RUN=yes
-AFPD_RUN=yes
-AFPD_MAX_CLIENTS=20
-AFPD_UAMLIST="-U uams_dhx.so,uams_dhx2.so"
-AFPD_GUEST=nobody
-CNID_CONFIG="-l log_note"
-
-ATALKD_RUN=no
-PAPD_RUN=no
-TIMELORD_RUN=no
-#A2BOOT_RUN=no
-ATALK_ZONE=
-ATALK_BGROUND=no
-
-. /etc/rc.status
-. :ETCDIR:/netatalk.conf
-
-# startup code for everything
-atalk_startup() {
- if [ x"${ATALKD_RUN}" != x"no" ]; then
- echo -n " Starting atalkd ... "
- :SBINDIR:/atalkd ; my_ec=$?
-
- if [ -x :BINDIR:/nbprgstr -a "$my_ec" = "0" ]; then
- echo -n ".. "
- :BINDIR:/nbprgstr -p 4 ${ATALK_NAME}:Workstation
- echo -n ". "
- :BINDIR:/nbprgstr -p 4 ${ATALK_NAME}:netatalk
- fi
- if [ "$my_ec" != "0" ] ; then false ; fi
- rc_status -v
-
- rc_reset
-
- if [ x"${PAPD_RUN}" = x"yes" -a -x :SBINDIR:/papd ]; then
- echo -n " Starting papd"
- :SBINDIR:/papd
- rc_status -v
- fi
-
- rc_reset
-
- if [ x"${TIMELORD_RUN}" = x"yes" -a -x :SBINDIR:/timelord ]; then
- echo -n " Starting timelord"
- :SBINDIR:/timelord
- rc_status -v
- fi
-
- rc_reset
-
- fi
-
- if [ x"${CNID_METAD_RUN}" = x"yes" -a -x :SBINDIR:/cnid_metad ] ; then
- echo -n " Starting cnid_metad "
- startproc :SBINDIR:/cnid_metad ${CNID_CONFIG}
- rc_status -v
- fi
-
- if [ x"${AFPD_RUN}" = x"yes" -a -x :SBINDIR:/afpd ] ; then
- echo -n " Starting afpd ("
- echo -n ${AFPD_UAMLIST} -g ${AFPD_GUEST} \
- -c ${AFPD_MAX_CLIENTS} -n ${ATALK_NAME}${ATALK_ZONE}
- echo -n ")"
- startproc :SBINDIR:/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \
- ${AFPD_OPTIONS} \
- -c ${AFPD_MAX_CLIENTS} -n "${ATALK_NAME}${ATALK_ZONE}"
- rc_status -v
- fi
-
- touch /var/lock/subsys/atalk
-}
-
-case "$1" in
- start)
- if test ! -z "$UID" -a "$UID" != 0 ; then
- echo "you have to be root to start netatalk daemons"
- rc_failed
- else
- if [ x"${ATALK_BGROUND}" = x"yes" -a x"${ATALKD_RUN}" != x"no" ]; then
- echo -n "Starting netatalk in the background ..."
- atalk_startup >& /dev/null &
- rc_status -v
- else
- echo "Starting netatalk (this may take a while) ..."
- atalk_startup
- fi
- fi
- ;;
- stop)
- echo -n "Shutting down netatalk"
- if test -x :SBINDIR:/papd ; then
- killproc -TERM :SBINDIR:/papd
- fi
- if test -x :SBINDIR:/timelord ; then
- killproc -TERM :SBINDIR:/timelord
- fi
- if test -x :SBINDIR:/atalkd ; then
- killproc -TERM :SBINDIR:/atalkd
- fi
- killproc -TERM :SBINDIR:/cnid_metad
- killproc -TERM :SBINDIR:/afpd
-
- rc_status -v
- ;;
- restart|reload|force-reload)
- $0 stop
- $0 start
- rc_status
- ;;
- status)
- echo "Checking for netatalk services"
- if [ x"${ATALKD_RUN}" = x"yes" -a -x :SBINDIR:/atalkd ] ; then
- checkproc :SBINDIR:/atalkd && echo -n "atalkd: OK " || echo -n "atalkd: No process "
- fi
- if [ x"${PAPD_RUN}" = x"yes" -a -x :SBINDIR:/papd ] ; then
- checkproc :SBINDIR:/papd && echo -n "papd: OK " || echo -n "papd: No process "
- fi
- if [ x"${TIMELORD_RUN}" = x"yes" -a -x :SBINDIR:/timelord ] ; then
- checkproc :SBINDIR:/timelord && echo -n " timelord: OK " || echo -n " timelord: No process "
- fi
- if [ x"${CNID_METAD_RUN}" = x"yes" ] ; then
- checkproc :SBINDIR:/cnid_metad && echo -n " cnid_metad: OK " || echo -n " cnid_metad: No process "
- fi
- checkproc :SBINDIR:/afpd && echo "afpd: OK" || echo "afpd: No process"
- # assume that afpd is the "main" process ...
- checkproc :SBINDIR:/afpd
- rc_status -v
- ;;
- *)
- echo "Usage: $0 {start|stop|restart|status}"
- exit 1
- ;;
-esac
-
-rc_exit
--- /dev/null
+#!/bin/sh
+
+# Netatalk :NETATALK_VERSION: startup script for systemd.
+
+# The method of using this script is not suitable.
+# This script will be deleted in the future.
+
+ATALK_BIN=:BINDIR:
+ATALK_CONF_DIR=:ETCDIR:
+ATALK_SBIN=:SBINDIR:
+
+# default
+ATALK_NAME=`echo ${HOSTNAME}|cut -d. -f1`
+ATALK_UNIX_CHARSET='LOCALE'
+ATALK_MAC_CHARSET='MAC_ROMAN'
+
+CNID_METAD_RUN=yes
+AFPD_RUN=yes
+AFPD_MAX_CLIENTS=20
+AFPD_UAMLIST="-U uams_dhx.so,uams_dhx2.so"
+AFPD_GUEST=nobody
+CNID_CONFIG="-l log_note"
+
+ATALKD_RUN=no
+PAPD_RUN=no
+TIMELORD_RUN=no
+A2BOOT_RUN=no
+ATALK_ZONE=
+ATALK_BGROUND=no
+
+# read in netatalk configuration
+if [ -f ${ATALK_CONF_DIR}/netatalk.conf ]; then
+ . ${ATALK_CONF_DIR}/netatalk.conf
+fi
+
+netatalk_startup() {
+ if [ x"${ATALKD_RUN}" != x"no" -a -x ${ATALK_SBIN}/atalkd ]; then
+ ${ATALK_SBIN}/atalkd
+
+ 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 ${ATALK_SBIN}/papd ]; then
+ ${ATALK_SBIN}/papd
+ fi
+
+ # check for timelord in bin directory
+ if [ x"${TIMELORD_RUN}" = x"yes" -a -x ${ATALK_BIN}/timelord ]; then
+ ${ATALK_BIN}/timelord
+ fi
+
+ # check for timelord in sbin directory
+ if [ x"${TIMELORD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/timelord ]; then
+ ${ATALK_SBIN}/timelord
+ fi
+
+ # check for a2boot in bin directory
+ if [ x"${A2BOOT_RUN}" = x"yes" -a -x ${ATALK_BIN}/a2boot ]; then
+ ${ATALK_BIN}/a2boot
+ fi
+
+ # check for a2boot in sbin directory
+ if [ x"${A2BOOT_RUN}" = x"yes" -a -x ${ATALK_SBIN}/a2boot ]; then
+ ${ATALK_SBIN}/a2boot
+ fi
+ fi
+
+ if [ x"${CNID_METAD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/cnid_metad ]; then
+ ${ATALK_SBIN}/cnid_metad $CNID_CONFIG
+ fi
+
+ if [ x"${AFPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/afpd ]; then
+ ${ATALK_SBIN}/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \
+ -c ${AFPD_MAX_CLIENTS} -n ${ATALK_NAME}${ATALK_ZONE}
+ fi
+}
+
+if [ x"${ATALK_BGROUND}" = x"yes" -a x"${ATALKD_RUN}" != x"no" ]; then
+ netatalk_startup >& /dev/null &
+else
+ netatalk_startup
+fi
+++ /dev/null
-# This file is part of netatalk :NETATALK_VERSION:.
-
-# The method of using shell-script "netatalk.sh" is not suitable.
-# The future service files are due to start daemons directly.
-# See netatalk-xxx/distrib/systemd/ directory in tarball.
-
-[Unit]
-Description=File and Printer sharing for Macintosh clients
-After=syslog.target network.target
-
-[Service]
-Type=oneshot
-ExecStart=/bin/sh -c "exec :PKGLIBEXECDIR:/netatalk.sh"
-RemainAfterExit=yes
-
-[Install]
-WantedBy=multi-user.target
--- /dev/null
+# This file is part of netatalk :NETATALK_VERSION:.
+
+# The method of using shell-script "netatalk.sh" is not suitable.
+# The future service files are due to start daemons directly.
+# See netatalk-xxx/distrib/systemd/ directory in tarball.
+
+[Unit]
+Description=File and Printer sharing for Macintosh clients
+After=syslog.target network.target
+
+[Service]
+Type=oneshot
+ExecStart=/bin/sh -c "exec :PKGLIBEXECDIR:/netatalk.sh"
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
mpath = obj->newtmp;
mp = makemacpath( vol, mpath, AFPOBJ_TMPSIZ, curdir, path->m_name );
if (!mp) {
+ close(tfd);
return AFPERR_PARAM;
}
mplen = mpath + AFPOBJ_TMPSIZ - mp;
memcpy(p, appltag, sizeof( appltag ));
cc = mpath + AFPOBJ_TMPSIZ - p;
if ( write( tfd, p, cc ) != cc ) {
+ close(tfd);
unlink( tempfile );
return( AFPERR_PARAM );
}
fprintf(dump, "\n");
fflush(dump);
+ fclose(dump);
return;
}
}
if (!S_ISDIR(st.st_mode)) {
- if (setfilmode(dirp->d_name, mode, &st, vol->v_umask) < 0) {
+ int setmode = (osx && *dirp->d_name == '.')?hf_mode:mode;
+
+ if (setfilmode(dirp->d_name, setmode, &st, vol->v_umask) < 0) {
+ closedir( dir );
LOG(log_error, logtype_afpd, "setdirmode: chmod %s: %s",dirp->d_name, strerror(errno) );
return -1;
}
#include <atalk/logger.h>
#include <atalk/util.h>
+#include <atalk/errchk.h>
#include "db_param.h"
#include "dbif.h"
*/
static int dbif_stamp(DBD *dbd, void *buffer, int size)
{
+ EC_INIT;
struct stat st;
- int rc,cwd;
+ int cwd = -1;
if (size < 8)
- return -1;
+ EC_FAIL;
/* Remember cwd */
if ((cwd = open(".", O_RDONLY)) < 0) {
LOG(log_error, logtype_cnid, "error opening cwd: %s", strerror(errno));
- return -1;
+ EC_FAIL;
}
/* chdir to db_envhome */
if ((chdir(dbd->db_envhome)) != 0) {
LOG(log_error, logtype_cnid, "error chdiring to db_env '%s': %s", dbd->db_envhome, strerror(errno));
- return -1;
+ EC_FAIL;
}
- if ((rc = stat(dbd->db_table[DBIF_CNID].name, &st)) < 0) {
+ if (stat(dbd->db_table[DBIF_CNID].name, &st) < 0) {
LOG(log_error, logtype_cnid, "error stating database %s: %s", dbd->db_table[DBIF_CNID].name, db_strerror(errno));
- return -1;
+ EC_FAIL;
}
LOG(log_maxdebug, logtype_cnid,"stamp: %s", asctime(localtime(&st.st_ctime)));
memset(buffer, 0, size);
memcpy(buffer, &st.st_ctime, sizeof(st.st_ctime));
- if ((fchdir(cwd)) != 0) {
- LOG(log_error, logtype_cnid, "error chdiring back: %s", strerror(errno));
- return -1;
+EC_CLEANUP:
+ if (cwd != -1) {
+ if (fchdir(cwd) != 0) {
+ LOG(log_error, logtype_cnid, "error chdiring back: %s", strerror(errno));
+ EC_STATUS(-1);
+ }
+ close(cwd);
}
-
- return 0;
+ EC_EXIT;
}
/*!
}
pwd->pw_passwd = sp->sp_pwdp;
- if (sp && sp->sp_max != -1 && sp->sp_lstchg) {
+ if (sp->sp_max != -1 && sp->sp_lstchg) {
time_t now = time(NULL) / (60*60*24);
int32_t expire_days = sp->sp_lstchg - now + sp->sp_max;
if ( expire_days < 0 ) {
}
pwd->pw_passwd = sp->sp_pwdp;
- if (sp && sp->sp_max != -1 && sp->sp_lstchg) {
+ if (sp->sp_max != -1 && sp->sp_lstchg) {
time_t now = time(NULL) / (60*60*24);
int32_t expire_days = sp->sp_lstchg - now + sp->sp_max;
if ( expire_days < 0 ) {
}
#elif defined(SENDFILE_FLAVOR_BSD )
-#include <sys/sendfile.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/uio.h><
ssize_t sys_sendfile(int tofd, int fromfd, off_t *offset, size_t count)
{
-size_t total=0;
-int ret;
-
- total = count;
- while (total) {
- ssize_t nwritten;
- do {
- ret = sendfile(fromfd, tofd, offset, count, NULL, &nwritten, 0);
- while (ret == -1 && errno == EINTR);
- if (ret == -1)
- return -1;
- total -= nwritten;
- offset += nwritten;
- }
- return count;
+ return sendfile(fromfd, tofd, *offset, count, NULL, offset, 0);
}
#else
{
int ret;
- LOG(log_debug, logtype_dsi, "dsi_cmdreply(DSI ID: %u, len: %jd): START",
- dsi->clientID, (intmax_t)dsi->datalen);
+ LOG(log_debug, logtype_dsi, "dsi_cmdreply(DSI ID: %u, len: %zd): START",
+ dsi->clientID, dsi->datalen);
dsi->header.dsi_flags = DSIFL_REPLY;
dsi->header.dsi_len = htonl(dsi->datalen);
ret = dsi_stream_send(dsi, dsi->data, dsi->datalen);
- LOG(log_debug, logtype_dsi, "dsi_cmdreply(DSI ID: %u, len: %jd): END",
- dsi->clientID, (intmax_t)dsi->datalen);
+ LOG(log_debug, logtype_dsi, "dsi_cmdreply(DSI ID: %u, len: %zd): END",
+ dsi->clientID, dsi->datalen);
return ret;
}
goto exit;
}
if (errno == EAGAIN || errno == EWOULDBLOCK) {
-#ifdef SOLARIS
+#if defined(SOLARIS) || defined(FREEBSD)
if (pos > offset) {
/* we actually have sent sth., adjust counters and keep trying */
len = pos - offset;
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-sysv|redhat-systemd|suse|gentoo|netbsd|debian]]],
+ [ --with-sysv-style use OS specific sysv config [[redhat-sysv|redhat-systemd|suse-sysv|suse-systemd|gentoo|netbsd|debian|systemd]]],
sysv_style="$withval", sysv_style=none
)
case "$sysv_style" in
AC_MSG_RESULT([enabling redhat-style systemd support])
;;
"suse")
- AC_MSG_RESULT([enabling suse-style sysv support])
+ AC_MSG_RESULT([--enable-suse is obsoleted. Use --enable-suse-sysv or --enable-suse-systemd])
;;
+ "suse-sysv")
+ AC_MSG_RESULT([enabling suse-style sysv configuration])
+ ;;
+ "suse-systemd")
+ AC_MSG_RESULT([enabling suse-style systemd support (>=openSUSE12.1)])
+ ;;
"gentoo")
AC_MSG_RESULT([enabling gentoo-style sysv support])
;;
"debian")
AC_MSG_RESULT([enabling debian-style sysv support])
;;
+ "systemd")
+ AC_MSG_RESULT([use general systemd configuration])
+ ;;
*)
AC_MSG_RESULT([disabling sysv support])
;;
AC_MSG_RESULT([ DHX2 ($uams_using_options)])
fi
if test "x$neta_cv_have_openssl" = "xyes"; then
- AC_MSG_RESULT([ RANDNUM])
+ AC_MSG_RESULT([ RANDNUM (afppasswd)])
fi
if test x"$netatalk_cv_build_krb5_uam" = x"yes"; then
AC_MSG_RESULT([ Kerberos V])