From: Mark Wooding Date: Mon, 26 Dec 2011 00:03:18 +0000 (+0000) Subject: distorted-keys.userv: Add userv configuration snippet. X-Git-Tag: 0.99.1~3 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/distorted-keys/commitdiff_plain/c122b7136af71386ac8febebcff4112805c9cacc distorted-keys.userv: Add userv configuration snippet. Needs a configured user name, and sbindir. --- diff --git a/Makefile.am b/Makefile.am index 4364761..3566e3a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -27,6 +27,7 @@ bin_SCRIPTS = sbin_SCRIPTS = dist_pkglib_SCRIPTS = dist_pkglib_DATA = +noinst_DATA = pkglib_DATA = noinst_SCRIPTS = @@ -43,10 +44,11 @@ EXTRA_DIST += config/confsubst SUBSTVARS = \ PACKAGE="$(PACKAGE)" VERSION="$(VERSION)" \ PYTHON="$(PYTHON)" \ - bindir="$(bindir)" \ + bindir="$(bindir)" sbindir="$(sbindir)" \ pkgconfdir="$(sysconfdir)/$(PACKAGE)" \ pkgstatedir="$(localstatedir)/$(PACKAGE)" \ - pkglibdir="$(pkglibdir)" + pkglibdir="$(pkglibdir)" \ + user="$(user)" SUBST = $(AM_V_GEN)$(confsubst) @@ -125,4 +127,13 @@ dist_pkglib_SCRIPTS += cryptop.decrypt dist_pkglib_SCRIPTS += cryptop.sign dist_pkglib_SCRIPTS += cryptop.verify +## Userv services configuration. +noinst_DATA += distorted-keys.userv +EXTRA_DIST += distorted-keys.userv.in +CLEANFILES += distorted-keys.userv +distorted-keys.userv: distorted-keys.userv.in Makefile + $(SUBST) $(srcdir)/distorted-keys.userv.in $(SUBSTVARS) \ + >distorted-keys.userv.new && \ + mv distorted-keys.userv.new distorted-keys.userv + ###----- That's all, folks -------------------------------------------------- diff --git a/configure.ac b/configure.ac index 44cdbd2..59378e6 100644 --- a/configure.ac +++ b/configure.ac @@ -33,6 +33,15 @@ AC_CONFIG_AUX_DIR([config]) AM_INIT_AUTOMAKE([foreign]) mdw_SILENT_RULES +dnl-------------------------------------------------------------------------- +dnl Other random configuration. + +AC_ARG_WITH([user], + AS_HELP_STRING([--with-user], [which user should own the archive]), + [user=$withval], + [user=keys]) +AC_SUBST([user]) + dnl-------------------------------------------------------------------------- dnl Python programming environment. diff --git a/distorted-keys.userv.in b/distorted-keys.userv.in new file mode 100644 index 0000000..4882d5c --- /dev/null +++ b/distorted-keys.userv.in @@ -0,0 +1,45 @@ +### -*-conf-*- +### +### userv services configuration for distorted-keys + +###-------------------------------------------------------------------------- +### User crypto operations. + +if ( glob service cryptop + & glob service-user @user@ + & grep calling-user-shell /etc/shells + ) + no-suppress-args + require-fd 0 read + require-fd 1-2 write + ignore-fd 3- + no-set-environment + execute @sbindir@/cryptop +fi + +###-------------------------------------------------------------------------- +### User profile access. + +if ( glob service cryptop-profile + & grep service-user-shell /etc/shells + & glob calling-user @user@ + ) + no-suppress-args + null-fd 0 + require-fd 1-2 write + ignore-fd 3- + no-set-environment + execute sh -c "case $# in \ + 1) \ + exec @bindir@/extract-profile \"$1\" \ + @pkgconfdir@/profile.d/ \ + .userv/cryptop-profile \ + ;; \ + *) \ + echo >&2 \"usage: cryptop-profile PROFILE\"; \ + exit 1 \ + ;; \ + esac" _ +fi + +###----- That's all, folks --------------------------------------------------