# We will use the libucw build system
include $(BUILDSYS)/Maketop
-EXTRA_RUNDIRS=run share/man/man1 share/man/man8
+EXTRA_RUNDIRS=run/subauthd lib/subauthd share/man/man1 share/man/man8
# Add the detected flags to all the global flags
CFLAGS+=$(LIBUCW_CFLAGS) $(LIBUCW_JSON_CFLAGS)
+subauth (1.0) stable; urgency=medium
+
+ * Released the first stable version.
+
+ -- Martin Mares <mj@ucw.cz> Sun, 19 Nov 2017 14:54:17 +0100
+
subauth (0.9) unstable; urgency=low
* Initial Release.
--- /dev/null
+#!/bin/sh -e
+
+if [ "$1" = configure ] ; then
+ if ! getent passwd subauthd >/dev/null ; then
+ adduser --system --group --disabled-login --gecos 'Sub-authentication daemon' subauthd
+ fi
+ chown subauthd.subauthd /var/lib/subauthd
+ chmod 700 /var/lib/subauthd
+fi
+
+#DEBHELPER#
+
+exit 0
--- /dev/null
+#!/bin/sh -e
+
+#DEBHELPER#
+
+if [ "$1" = purge ] ; then
+ rm -f /var/lib/subauthd/subauthd.db
+ rm -f /var/lib/subauthd/temp-key
+ deluser --quiet --system subauthd >/dev/null || true
+fi
+
+exit 0
[Service]
ExecStart=/usr/sbin/subauthd
+User=subauthd
+Group=subauthd
+RuntimeDirectory=subauthd
+RuntimeDirectoryMode=755
[Install]
WantedBy=multi-user.target
SubauthD {
# Path to local socket over which clients communicate with the daemon
- SocketPath @INSTALL_RUN_DIR@/subauthd.socket
+ SocketPath @INSTALL_RUN_DIR@/subauthd/subauthd.socket
# Path to database of users and accounts
- Database @INSTALL_STATE_DIR@/subauthd.db
+ Database @INSTALL_STATE_DIR@/subauthd/subauthd.db
# An optional path to a key for signing temporary tokens.
# If it is defined, temporary tokens survive daemon restart. Otherwise,
# the daemon creates a new key on every startup.
- TempKeyFile @INSTALL_STATE_DIR@/subauthd-temp-key
+ TempKeyFile @INSTALL_STATE_DIR@/subauthd/temp-key
# Maximum number of simultaneous client connections
MaxConnections 1000
install -m 755 $(o)/server/subauthd $(DESTDIR)$(INSTALL_SBIN_DIR)
install -m 644 run/etc/subauthd $(DESTDIR)$(INSTALL_CONFIG_DIR)
install -m 644 run/share/man/man8/subauthd.8 $(DESTDIR)$(INSTALL_MAN_DIR)/man8
+ install -d -m 750 $(DESTDIR)$(INSTALL_STATE_DIR)/subauthd