slackware-current/patches/source/netatalk/rc.atalk.new
Patrick J Volkerding 7793836a6d Fri Jan 13 20:29:55 UTC 2023
patches/packages/netatalk-3.1.14-x86_64-1_slack15.0.txz:  Upgraded.
  Netatalk through 3.1.13 has an afp_getappl heap-based buffer overflow
  resulting in code execution via a crafted .appl file.
  For more information, see:
    https://www.cve.org/CVERecord?id=CVE-2022-45188
  (* Security fix *)
2023-01-14 13:30:29 +01:00

58 lines
1,009 B
Bash

#!/bin/sh
# Start/stop/restart the netatalk daemon.
netatalk_start() {
if [ -x /usr/sbin/netatalk ]; then
LINES="$(grep "^[^;]" /etc/netatalk/afp.conf | wc -l)"
if [ "$LINES" -lt "2" ]; then
echo "netatalk is not configured.... exiting."
exit
fi
echo "Starting netatalk: /usr/sbin/netatalk"
/usr/sbin/netatalk
fi
}
# Stop netatalk
netatalk_stop() {
echo "Stopping netatalk."
/usr/bin/pkill --ns $$ -f "^/usr/sbin/netatalk" 2> /dev/null
}
# Restart netatalk
netatalk_restart() {
netatalk_stop
sleep 1
netatalk_start
}
# Check if netatalk is running
netatalk_status() {
PID="$(/usr/bin/pgrep --ns $$ -f "^/usr/sbin/netatalk" 2> /dev/null)"
if [ $PID ]; then
echo "netatalk is running. PID: $PID"
else
echo "netatalk is stopped."
exit 1
fi
}
case "$1" in
'start')
netatalk_start
;;
'stop')
netatalk_stop
;;
'restart')
netatalk_restart
;;
'status')
netatalk_status
;;
*)
echo "usage $0 start|stop|restart|status"
esac