Package: cron
Version: 3.0pl1-87
Severity: wishlist

Hi Steve, as promised on debian-devel, here's a patch against cron's
postinst that I suggest to adjust permissions of the
/var/spool/cron/crontabs directory plus included crontabs.  In my tests
switching between cron and bcron-run as cron system works flawlessly
with this patch, as well as simply updating the cron package.  Here's a
preliminary bcron package to test with if you like

 http://people.debian.org/~pape/Eez3yao/

I'm not sure whether the conversion of /var/spool/cron/crontabs should
be guarded by the dpkg-statoverride test, IMHO only the chgrp and chmod
of /usr/bin/crontab should be done conditionally, I didn't change that
in the patch below though.

Thanks, Gerrit.
--- debian/postinst     2005-04-10 11:03:29.000000000 +0000
+++ ../cron-3.0pl1/debian/postinst      2005-04-10 12:22:19.000000000 +0000
@@ -43,14 +43,13 @@
 if ! dpkg-statoverride --list /usr/bin/crontab > /dev/null ; then
     chgrp crontab /usr/bin/crontab
     chmod g+s /usr/bin/crontab
-    chgrp crontab $crondir/crontabs
+    chown root:crontab $crondir/crontabs
     chmod 1730 $crondir/crontabs
-    if dpkg --compare-versions "$2" lt "3.0pl1-81" ; then
-        cd $crondir/crontabs
-        set +e
-        ls -1 |  xargs -r -n 1 --replace=xxx  chown 'xxx:crontab' 'xxx'
-        set -e
-    fi
+    cd $crondir/crontabs
+    set +e
+    ls -1 |  xargs -r -n 1 --replace=xxx  chown 'xxx:crontab' 'xxx'
+    set -e
+    ls -1 |  xargs -r chmod 0600
 fi
 
 if [ -x /etc/init.d/cron ]; then

Reply via email to