Hi,
A much improved version of systemd-cron is awaiting that some DD uploads it:
http://anonscm.debian.org/cgit/collab-maint/systemd-cron.git
git://anonscm.debian.org/collab-maint/systemd-cron.git
You may then add this patch in attachment upon this git tree to enable
the crontab setuid helper that let non-root user to use crontab;
and then rebuild the package with "debuild -us -uc" in tree.
Or you may as well copy the crontab binary from the cron package
and chmod it 2755.
Cheers,
Alexandre Detiste
Le mardi 17 mars 2015, 20:16:48 Oxan van Leeuwen a écrit :
> Package: systemd-cron
> Version: 1.3.1+ds1-2
> Severity: normal
diff -u -N systemd-cron-debian/debian/changelog systemd-cron-debian-scratch/debian/changelog
--- systemd-cron-debian/debian/changelog 2015-01-03 11:12:41.054613394 +0100
+++ systemd-cron-debian-scratch/debian/changelog 2015-01-03 11:43:54.972892595 +0100
@@ -1,3 +1,11 @@
+systemd-cron (1.5.2-2) UNRELEASED; urgency=medium
+
+ [ Alexandre Detiste ]
+ * Enable C setgid crontab helper, package move from 'all' to 'any'
+ * Closes: #766053 : cannot edit user crontabs
+
+ -- Alexandre Detiste <alexandre.deti...@gmail.com> Sat, 03 Jan 2015 11:42:19 +0100
+
systemd-cron (1.5.2-1) unstable; urgency=medium
[ Alexandre Detiste ]
diff -u -N systemd-cron-debian/debian/control systemd-cron-debian-scratch/debian/control
--- systemd-cron-debian/debian/control 2015-01-03 11:10:06.722370406 +0100
+++ systemd-cron-debian-scratch/debian/control 2014-12-21 16:19:05.061708600 +0100
@@ -13,8 +13,8 @@
Homepage: https://github.com/systemd-cron/systemd-cron
Package: systemd-cron
-Architecture: all
-Depends: ${misc:Depends}, systemd-sysv (>= 212), ${python3:Depends}
+Architecture: any
+Depends: ${misc:Depends}, systemd-sysv (>= 212), ${python3:Depends}, ${shlibs:Depends}
Recommends: exim4 | mail-transport-agent
Provides: cron-daemon, anacron
Conflicts: cron-daemon, anacron
diff -u -N systemd-cron-debian/debian/postinst systemd-cron-debian-scratch/debian/postinst
--- systemd-cron-debian/debian/postinst 1970-01-01 01:00:00.000000000 +0100
+++ systemd-cron-debian-scratch/debian/postinst 2014-12-21 16:22:30.721489468 +0100
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -e
+
+crondir="/var/spool/cron"
+action="$1"
+
+if [ "$action" != configure ]; then
+ exit 0
+fi
+
+# if cron was previously installed
+if dpkg-statoverride --list /usr/bin/crontab > /dev/null ; then
+ dpkg-statoverride --remove /usr/bin/crontab
+fi
+
+# Add group for crontabs
+getent group crontab > /dev/null 2>&1 || addgroup --system crontab
+
+if ! dpkg-statoverride --list /lib/systemd-cron/crontab_setgid > /dev/null ; then
+ dpkg-statoverride --update --add root crontab 2755 /lib/systemd-cron/crontab_setgid
+fi
+
+if [ -d $crondir/crontabs ] ; then
+ chown root:crontab $crondir/crontabs
+ chmod 1730 $crondir/crontabs
+ # This used to be done conditionally. For versions prior to "3.0pl1-81"
+ # It has been disabled to suit cron alternative such as bcron.
+ cd $crondir/crontabs
+ set +e
+ ls -1 | xargs -r -n 1 --replace=xxx chown 'xxx:crontab' 'xxx'
+ ls -1 | xargs -r -n 1 chmod 600
+ set -e
+fi
+
+#DEBHELPER#
diff -u -N systemd-cron-debian/debian/postrm systemd-cron-debian-scratch/debian/postrm
--- systemd-cron-debian/debian/postrm 2015-01-03 11:10:06.732369903 +0100
+++ systemd-cron-debian-scratch/debian/postrm 2014-12-21 16:52:02.452223894 +0100
@@ -1,6 +1,10 @@
#!/bin/sh
set -e
+if dpkg-statoverride --list /lib/systemd-cron/crontab_setgid > /dev/null ; then
+ dpkg-statoverride --remove /lib/systemd-cron/crontab_setgid
+fi
+
if [ "$1" = "purge" ]; then
rm -f /var/lib/systemd/timers/stamp-cron-*.timer
fi
diff -u -N systemd-cron-debian/debian/rules systemd-cron-debian-scratch/debian/rules
--- systemd-cron-debian/debian/rules 2015-01-03 11:10:06.742369400 +0100
+++ systemd-cron-debian-scratch/debian/rules 2014-12-21 16:01:05.835792250 +0100
@@ -13,6 +13,7 @@
--libdir=/lib \
--enable-boot=no \
--enable-persistent=yes \
+--enable-setgid=yes \
--stale-stamps=/etc/cron.weekly/systemd-cron
sed -i 's|$$(DESTDIR)$$(bindir)|$$(DESTDIR)/usr/bin|' Makefile
Common subdirectories: systemd-cron-debian/debian/source and systemd-cron-debian-scratch/debian/source