--- bcron-0.09.orig/debian/bcron-run.conffiles +++ bcron-0.09/debian/bcron-run.conffiles @@ -0,0 +1,7 @@ +/etc/crontab +/etc/bcron-sched/run +/etc/bcron-sched/log/run +/etc/bcron-spool/run +/etc/bcron-spool/log/run +/etc/bcron-update/run +/etc/bcron-update/log/run --- bcron-0.09.orig/debian/README.Debian.diet +++ bcron-0.09/debian/README.Debian.diet @@ -0,0 +1,14 @@ +Building bcron with the diet libc +--------------------------------- + +This package optionally can be built with the diet libc instead of the glibc +to provide small statically linked programs. + +To use the diet libc, make sure the latest versions of the dietlibc-dev and +bglibs-dev packages are installed, and set DEB_BUILD_OPTIONS=diet in the +environment when building the package, e.g.: + + # apt-get install dietlibc-dev bglibs-dev + $ DEB_BUILD_OPTIONS=diet fakeroot apt-get source -b bcron + + -- Gerrit Pape , Sat, 02 Apr 2005 12:40:26 +0000 --- bcron-0.09.orig/debian/bcron-run.README.Debian +++ bcron-0.09/debian/bcron-run.README.Debian @@ -0,0 +1,32 @@ +bcron-run for Debian +-------------------- + +This package sets up the bcron-sched, bcron-spool, and bcron-update +services to provide the Debian cron functionality mandated by Debian +policy 9.5. This includes support for the /etc/crontab file and the +/etc/cron.d/ directory, as well as the crontab(1) program as user +interface, and support for the /etc/cron.hourly/, /etc/cron.daily/, +/etc/cron.weekly/, and /etc/cron.monthly/ directories. + +The bcron services including their logs are handled through runit, and +so enabled automatically on package installation and system boot. Use +the sv(8) program to control a service or print its status information. +See the runit package's documentation for details, e.g. + + # sv status bcron-sched + run: bcron-sched: (pid 11169) 14528s; run: log: (pid 11168) 14528s + # sv restart bcron-sched + ok: run: bcron-sched: (pid 11188) 0s + # sv status bcron-sched + run: bcron-sched: (pid 2423) 4s; run: log: (pid 11168) 55s + # + +Logs are written to the /var/log/bcron/, /var/log/bcron/spool/, and +/var/log/bcron/update/ directories, through the svlogd(8) program. +Configure the logs through the ``config'' file, and access the recent +log entries through the ``current'' log file in these directories, see +the svlogd(8) man page for details, e.g. + + $ less /var/log/bcron/current + + -- Gerrit Pape , Sat, 02 Apr 2005 12:40:26 +0000 --- bcron-0.09.orig/debian/bcron-run.postinst +++ bcron-0.09/debian/bcron-run.postinst @@ -0,0 +1,38 @@ +#!/bin/sh +set -e + +test "$1" = 'configure' || exit 0 + +err() { echo >&2 "$*"; exit 1; } + +getent passwd cron >/dev/null || \ + adduser --system --group --home /var/spool/cron --no-create-home cron +getent passwd cronlog >/dev/null || \ + adduser --system --home /nonexistent --no-create-home cronlog + +if test ! -p /var/spool/cron/trigger; then + test ! -e /var/spool/cron/trigger || + err /var/spool/cron/trigger exists, but is not a fifo. + mkfifo -m0600 /var/spool/cron/trigger +fi + +for i in crontabs tmp trigger; do + chown cron:cron /var/spool/cron/$i + chmod go-rwx /var/spool/cron/$i +done +for i in `ls -1 /var/spool/cron/crontabs/ || :`; do + chown cron:cron /var/spool/cron/crontabs/$i +done +chown cronlog:adm /var/log/bcron /var/log/bcron/spool /var/log/bcron/update +chmod 2750 /var/log/bcron /var/log/bcron/spool /var/log/bcron/update + +test -z "$2" || dpkg --compare-versions "$2" gt '0.09-8' || { + for i in sched spool update; do + update-service --remove /etc/bcron-$i || : + done + sleep 6 +} + +for i in sched spool update; do + update-service --add /etc/bcron-$i +done --- bcron-0.09.orig/debian/bcron-run.postrm +++ bcron-0.09/debian/bcron-run.postrm @@ -0,0 +1,28 @@ +#!/bin/sh +set -e + +test "$1" != 'remove' || exec rm -f /var/spool/cron/crontabs/:?* +test "$1" = 'purge' || exit 0 + +sv force-stop /etc/bcron-sched /etc/bcron-spool /etc/bcron-update || : +for i in sched spool update; do + rm -rf /etc/bcron-$i/supervise /etc/bcron-$i/log/supervise + rm -rf /var/lib/supervise/bcron-$i /var/lib/supervise/bcron-$i.log +done + +rm -f /var/spool/cron/trigger +for i in '' spool update; do + for j in '@*' current config lock state; do + rm -f /var/log/bcron/$i/$j + done +done +rmdir /var/log/bcron/spool /var/log/bcron/update || : +rmdir /var/log/bcron || : + +getent passwd cron >/dev/null || getent passwd cronlog >/dev/null || exit 0 +if ! deluser --version >/dev/null 2>&1; then + echo 'deluser program not available, not removing system users "cron", "cronlog".' >&2 + exit 0 +fi +deluser cron +deluser cronlog --- bcron-0.09.orig/debian/bcron.docs +++ bcron-0.09/debian/bcron.docs @@ -0,0 +1,7 @@ +ANNOUNCEMENT +NEWS +README +TODO +VERSION +bcron.html +debian/README.Debian.diet --- bcron-0.09.orig/debian/implicit +++ bcron-0.09/debian/implicit @@ -0,0 +1,93 @@ +# $Id: implicit,v 1.11 2005/11/29 21:57:55 pape Exp $ + +.PHONY: deb-checkdir deb-checkuid + +deb-checkdir: + @test -e debian/control || sh -cx '! : wrong directory' +deb-checkuid: + @test "`id -u`" -eq 0 || sh -cx '! : need root privileges' + +%.deb: %.deb-docs %.deb-DEBIAN + @rm -f $*.deb $*.deb-checkdir $*.deb-docs $*.deb-docs-base \ + $*.deb-docs-docs $*.deb-docs-examples $*.deb-DEBIAN \ + $*.deb-DEBIAN-dir $*.deb-DEBIAN-scripts $*.deb-DEBIAN-md5sums + +%.udeb: %.deb-DEBIAN + @rm -f $*.deb $*.deb-checkdir $*.deb-DEBIAN $*.deb-DEBIAN-dir \ + $*.deb-DEBIAN-scripts $*.deb-DEBIAN-md5sums + +%.deb-checkdir: + @test -d debian/$* || sh -cx '! : directory debian/$* missing' + @test "`id -u`" -eq 0 || sh -cx '! : need root privileges' + +%.deb-docs-base: + : implicit + @rm -f debian/$*/usr/share/doc/$*/* || : + @install -d -m0755 debian/$*/usr/share/doc/$* + : debian/$*/usr/share/doc/$*/ + @sh -cx 'install -m0644 debian/copyright debian/$*/usr/share/doc/$*/' + @sh -cx 'install -m0644 debian/changelog \ + debian/$*/usr/share/doc/$*/changelog.Debian' + @test ! -r changelog || \ + sh -cx 'install -m0644 changelog debian/$*/usr/share/doc/$*/' + @test -r debian/$*/usr/share/doc/$*/changelog || \ + sh -cx 'mv debian/$*/usr/share/doc/$*/changelog.Debian \ + debian/$*/usr/share/doc/$*/changelog' + @test -s debian/$*/usr/share/doc/$*/changelog || \ + sh -cx 'rm -f debian/$*/usr/share/doc/$*/changelog' + @gzip -9 debian/$*/usr/share/doc/$*/changelog* +%.deb-docs-docs: + @for i in `cat debian/$*.docs 2>/dev/null || :`; do \ + if test -d $$i; then \ + sh -cx "install -d -m0755 debian/$*/usr/share/doc/$*/$${i##*/}" && \ + for j in $$i/*; do \ + sh -cx "install -m0644 $$j \ + debian/$*/usr/share/doc/$*/$${i##*/}/" || exit 1; \ + done || exit 1; \ + continue; \ + fi; \ + sh -cx "install -m0644 $$i debian/$*/usr/share/doc/$*/" || exit 1; \ + done + @test ! -r debian/$*.README.Debian || \ + sh -cx 'install -m0644 debian/$*.README.Debian \ + debian/$*/usr/share/doc/$*/README.Debian' + @if test -r debian/$*.NEWS.Debian; then \ + sh -cx 'install -m0644 debian/$*.NEWS.Debian \ + debian/$*/usr/share/doc/$*/NEWS.Debian && \ + gzip -9 debian/$*/usr/share/doc/$*/NEWS.Debian'; \ + fi +%.deb-docs-examples: + @rm -rf debian/$*/usr/share/doc/$*/examples + : debian/$*/usr/share/doc/$*/examples/ + @test ! -r debian/$*.examples || \ + install -d -m0755 debian/$*/usr/share/doc/$*/examples + @for i in `cat debian/$*.examples 2>/dev/null || :`; do \ + sh -cx "install -m0644 $$i debian/$*/usr/share/doc/$*/examples/" \ + || exit 1; \ + done +%.deb-docs: %.deb-checkdir %.deb-docs-base %.deb-docs-docs %.deb-docs-examples + : debian/$*/usr/share/doc/$*/ ok + +%.deb-DEBIAN-base: + @rm -rf debian/$*/DEBIAN + : debian/$*/DEBIAN/ + @install -d -m0755 debian/$*/DEBIAN + @for i in conffiles shlibs templates; do \ + test ! -r debian/$*.$$i || \ + sh -cx "install -m0644 debian/$*.$$i debian/$*/DEBIAN/$$i" \ + || exit 1; \ + done +%.deb-DEBIAN-scripts: + @for i in preinst prerm postinst postrm config; do \ + test ! -r debian/$*.$$i || \ + sh -cx "install -m0755 debian/$*.$$i debian/$*/DEBIAN/$$i" \ + || exit 1; \ + done +%.deb-DEBIAN-md5sums: + : debian/$*/DEBIAN/md5sums + @rm -f debian/$*/DEBIAN/md5sums + @cd debian/$* && find * -path 'DEBIAN' -prune -o \ + -type f -exec md5sum {} >>DEBIAN/md5sums \; +%.deb-DEBIAN: %.deb-checkdir %.deb-DEBIAN-base %.deb-DEBIAN-scripts \ + %.deb-DEBIAN-md5sums + : debian/$*/DEBIAN/ ok --- bcron-0.09.orig/debian/crontab +++ bcron-0.09/debian/crontab @@ -0,0 +1,7 @@ +SHELL=/bin/sh +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +14 * * * * root run-parts --report /etc/cron.hourly +24 4 * * * root test -x /usr/sbin/anacron || run-parts --report /etc/cron.daily +39 4 * * 7 root test -x /usr/sbin/anacron || run-parts --report /etc/cron.weekly +54 4 1 * * root test -x /usr/sbin/anacron || run-parts --report /etc/cron.monthly --- bcron-0.09.orig/debian/rules +++ bcron-0.09/debian/rules @@ -0,0 +1,128 @@ +#!/usr/bin/make -f + +STRIP =strip +ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + STRIP =: nostrip +endif + +CFLAGS =-g -O2 -Wall +LDFLAGS = +CC =gcc +BGLIBS =/usr/lib/bglibs +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS =-g -O0 -Wall +endif +ifneq (,$(findstring diet,$(DEB_BUILD_OPTIONS))) + CC =diet -v -Os gcc -nostdinc + BGLIBS =/usr/lib/diet/bglibs +endif + +DIR =$(shell pwd)/debian/bcron + +patch: deb-checkdir patch-stamp +patch-stamp: + for i in `ls -1 debian/diff/*.diff || :`; do \ + patch -p1 <$$i || exit 1; \ + done + touch patch-stamp + +build: deb-checkdir build-arch-stamp build-indep-stamp + +build-arch: deb-checkdir build-arch-stamp +build-arch-stamp: patch-stamp + -gcc -v + for i in conf-*; do \ + test -e $${i%'{orig}'}'{orig}' || cp -v $$i $$i'{orig}'; \ + done + echo '$(CC) $(CFLAGS)' >conf-cc + echo '$(CC) $(LDFLAGS)' >conf-ld + echo '/usr/sbin' >conf-bin + echo '$(BGLIBS)/include' >conf-bgincs + echo '$(BGLIBS)/lib' >conf-bglibs + $(MAKE) + sh tests.sh + touch build-arch-stamp + +build-indep: deb-checkdir build-indep-stamp +build-indep-stamp: + touch build-indep-stamp + +clean: deb-checkdir deb-checkuid patch-stamp + $(MAKE) clean + test ! -e patch-stamp || \ + for i in `ls -1r debian/diff/*.diff || :`; do patch -p1 -R <$$i; done + for i in `ls *'{orig}' || :`; do mv -vf $$i $${i%'{orig}'}; done + rm -f build-arch-stamp build-indep-stamp patch-stamp + rm -rf '$(DIR)' '$(DIR)'-run + rm -f debian/files debian/substvars changelog + +install: install-arch install-indep +install-arch: deb-checkdir deb-checkuid build-arch-stamp + rm -rf '$(DIR)' + install -d -m0755 '$(DIR)'/usr/bin '$(DIR)'/usr/sbin + PATH="/usr/lib/bglibs/bin:$$PATH" make install install_prefix='$(DIR)' + rm -f '$(DIR)'/usr/sbin/crontab + $(STRIP) -R .comment -R .note '$(DIR)'/usr/sbin/* + mv '$(DIR)'/usr/sbin/bcrontab '$(DIR)'/usr/bin/bcrontab + install -d -m0755 '$(DIR)'/etc/bcron + # man pages + for i in 1 5 8; do \ + install -d -m0755 '$(DIR)'/usr/share/man/man$$i && \ + install -m0644 *.$$i '$(DIR)'/usr/share/man/man$$i/ || exit 1; \ + done + mv '$(DIR)'/usr/share/man/man5/crontab.5 \ + '$(DIR)'/usr/share/man/man5/bcrontab.5 + gzip -9 '$(DIR)'/usr/share/man/man?/*.? + test -r changelog || ln -s ChangeLog changelog + +install-indep: deb-checkdir deb-checkuid build-indep-stamp + rm -rf '$(DIR)'-run + install -d -m0755 '$(DIR)'-run/usr/bin + ln -s bcrontab '$(DIR)'-run/usr/bin/crontab + install -d -m0755 '$(DIR)'-run/var/spool/cron/crontabs + install -d -m0755 '$(DIR)'-run/var/spool/cron/tmp + install -d -m0755 '$(DIR)'-run/etc/cron.d + install -d -m0755 '$(DIR)'-run/etc/bcron-sched/log + install -m0755 debian/etc/bcron-sched/run \ + '$(DIR)'-run/etc/bcron-sched/run + install -m0755 debian/etc/bcron-sched/log/run \ + '$(DIR)'-run/etc/bcron-sched/log/run + install -d -m0755 '$(DIR)'-run/etc/bcron-spool/log + install -m0755 debian/etc/bcron-spool/run \ + '$(DIR)'-run/etc/bcron-spool/run + install -m0755 debian/etc/bcron-spool/log/run \ + '$(DIR)'-run/etc/bcron-spool/log/run + install -d -m0755 '$(DIR)'-run/etc/bcron-update/log + install -m0755 debian/etc/bcron-update/run \ + '$(DIR)'-run/etc/bcron-update/run + install -m0755 debian/etc/bcron-update/log/run \ + '$(DIR)'-run/etc/bcron-update/log/run + install -d -m0755 '$(DIR)'-run/var/log/bcron/spool + install -d -m0755 '$(DIR)'-run/var/log/bcron/update + install -m0644 debian/crontab '$(DIR)'-run/etc/crontab + install -d -m0755 '$(DIR)'-run/etc/cron.daily + install -d -m0755 '$(DIR)'-run/etc/cron.hourly + install -d -m0755 '$(DIR)'-run/etc/cron.monthly + test -r changelog || ln -s ChangeLog changelog + # man pages + install -d -m0755 '$(DIR)'-run/usr/share/man/man5 + ln -s bcrontab.5.gz '$(DIR)'-run/usr/share/man/man5/crontab.5.gz + install -d -m0755 '$(DIR)'-run/usr/share/man/man1 + ln -s bcrontab.1.gz '$(DIR)'-run/usr/share/man/man1/crontab.1.gz + +binary-arch: deb-checkdir deb-checkuid install-arch bcron.deb + test '$(CC)' != 'gcc' || \ + dpkg-shlibdeps '$(DIR)'/usr/bin/* '$(DIR)'/usr/sbin/* + dpkg-gencontrol -isp -pbcron -P'$(DIR)' + dpkg -b '$(DIR)' .. + +binary-indep: deb-checkdir deb-checkuid install-indep bcron-run.deb + dpkg-gencontrol -isp -pbcron-run -P'$(DIR)'-run + dpkg -b '$(DIR)'-run .. + +binary: binary-indep binary-arch + +.PHONY: patch build build-arch build-indep clean install install-arch \ +install-indep binary-arch binary-indep binary + +include debian/implicit --- bcron-0.09.orig/debian/copyright +++ bcron-0.09/debian/copyright @@ -0,0 +1,15 @@ +This package was debianized by Gerrit Pape on +Sat, 02 Apr 2005 12:40:26 +0000. + +It was downloaded from http://untroubled.org/bcron/ + +Upstream Author: Bruce Guenter + +Copyright: + +This package is Copyright(C) 2005 Bruce Guenter or FutureQuest, Inc., and +may be copied according to the GNU GENERAL PUBLIC LICENSE (GPL) Version 2 +or a later version. A copy of this license is included with this package. +This package comes with no warranty of any kind. + +The full text of the GPL can be found at /usr/share/common-licenses/GPL-2. --- bcron-0.09.orig/debian/control +++ bcron-0.09/debian/control @@ -0,0 +1,38 @@ +Source: bcron +Section: admin +Priority: optional +Maintainer: Gerrit Pape +Build-Depends: libbg1-dev +Standards-Version: 3.9.2.0 +Vcs-Git: http://smarden.org/git/bcron.git/ + +Package: bcron +Architecture: any +Depends: ${shlibs:Depends} +Recommends: bcron-run, runit, ucspi-unix, default-mta | mail-transport-agent +Description: Bruce's cron system (programs) + This is bcron, a new cron system designed with secure operations in mind. + To do this, the system is divided into several separate programs, each + responsible for a separate task, with strictly controlled communications + between them. The user interface is a drop-in replacement for similar + systems (such as vixie-cron), but the internals differ greatly. + . + This package contains the bcron programs. + +Package: bcron-run +Architecture: all +Section: admin +Depends: bcron, runit (>= 1.8.0-2), ucspi-unix, default-mta | mail-transport-agent, adduser +Provides: cron +Replaces: cron +Conflicts: cron +Suggests: runit-run, anacron +Description: Bruce's cron system + This is bcron, a new cron system designed with secure operations in mind. + To do this, the system is divided into several separate programs, each + responsible for a separate task, with strictly controlled communications + between them. The user interface is a drop-in replacement for similar + systems (such as vixie-cron), but the internals differ greatly. + . + This package sets up the bcron services, and replaces the default Debian + cron package. --- bcron-0.09.orig/debian/bcron.README.Debian +++ bcron-0.09/debian/bcron.README.Debian @@ -0,0 +1,17 @@ +bcron for Debian +---------------- + +This package contains the bcron programs, installed into /usr/bin/ and +/usr/sbin/, and the bcron documentation. + +To have the current cron package replaced by bcron, install the bcron-run +package, which enables the bcron services to provide default Debian cron +features, e.g. + + # apt-get install bcron-run + +bcron's behavior can be configured through the /etc/bcron/ directory, +see the man pages and the documentation in /usr/share/doc/bcron/ for +details. + + -- Gerrit Pape , Sat, 02 Apr 2005 12:40:26 +0000 --- bcron-0.09.orig/debian/changelog +++ bcron-0.09/debian/changelog @@ -0,0 +1,138 @@ +bcron (0.09-13) unstable; urgency=medium + + * debian/diff/0008-bcron-exec-Mark-all-temporary-files-close-...diff: + new; from upstream git; bcron-exec: Mark all temporary files + close-on-exec and close selfpipe; this fixes a security bug in + bcron where cron jobs get access to the temporary output files from + all other jobs that are still running (closes: #686650). + + -- Gerrit Pape Wed, 16 Jan 2013 10:13:37 +0000 + +bcron (0.09-12) unstable; urgency=low + + * debian/rules, debian/bcron.README.Debian: no longer install the + bcron.info file (closes: #528865). + * debian/control: bcron: Recommends: default-mta | + mail-transport-agent; bcron-run: Depends: default-mta | + mail-transport-agent (thx Jonathan Nieder; closes: #495834). + * debian/control: Standards-Version: 3.9.2.0. + + -- Gerrit Pape Thu, 20 Oct 2011 12:41:01 +0000 + +bcron (0.09-11) unstable; urgency=low + + * debian/bcron-run.postrm: services' supervise dirs are now located in + /var/lib/supervise/, remove those on purge. + * debian/rules: no longer include named pipe /var/spool/cron/trigger + in the bcron-run packages (closes: #552687). + * debian/bcron-run.postinst: create named pipe /var/spool/cron/trigger + if it doesn't exist yet, error out if it exists but is not a fifo. + * debian/bcron-run.postrm: remove /var/spool/cron/trigger on purge. + * debian/control: Standards-Version: 3.8.3.0. + + -- Gerrit Pape Sun, 01 Nov 2009 22:50:15 +0000 + +bcron (0.09-10) unstable; urgency=low + + * debian/control: Build-Depends: libbg1-dev (closes: #482516). + + -- Gerrit Pape Sun, 25 May 2008 16:15:18 +0000 + +bcron (0.09-9) unstable; urgency=low + + * debian/bcron-run.postinst, debian/bcron-run.prerm: use runit's + update-service program to add/remove services from system-wide service + supervision, instead of dealing with symlinks in /var/service/ directly. + * debian/control: package bcron-run: Depends: runit (>= 1.8.0-2) (1st + version that provides the update-service program). + * debian/rules: no longer include dangling links for ./supervise/ + subdirectories, update-service now takes care of this. + * debian/bcron-run.postinst: remove bcron service on upgrade from + <= 0.09-8, and re-add afterwards through update-service. + * debian/bcron-run.postrm: purge: adapt paths in /var/run/; force-stop bcron + services; remove ./supervise/ subdirectories (or symlinks) in service + directories. + * debian/control: add Vcs-Git: http://smarden.org/git/bcron.git/. + * debian/control: Standards-Version: 3.7.3.0. + + -- Gerrit Pape Wed, 13 Feb 2008 22:55:42 +0000 + +bcron (0.09-8) unstable; urgency=medium + + * debian/diff/*: redo diffs with git. + * debian/rules: apply diffs from debian/diff with patch -p1, not -p0. + * debian/diff/0006-tests.sh-export-TZ-CST0-trailing-zero-to-make-new.diff: + new; export TZ=CST0 (trailing zero) in selftests to make new glibc in + sid happy (closes: #422125). + * debian/diff/0007-tests.sh-replace-bashism-let-with-posix-arithmetic.diff: + new; replace bashism 'let' in selftests with posix arithmetic expansions + $(( )). + + -- Gerrit Pape Tue, 08 May 2007 17:45:32 +0000 + +bcron (0.09-7) unstable; urgency=medium + + * debian/bcron-run.postrm: check for deluser being available, if not, + print warning and don't remove system users (ref: #398539). + + -- Gerrit Pape Fri, 17 Nov 2006 20:12:14 +0000 + +bcron (0.09-6) unstable; urgency=low + + * debian/bcron-run.postinst: don't make the log service system user + cronlog member of group adm, but nogroup; cronlog's home directory is + /nonexistent; make log directories mode 2750, owner cronlog:adm + (closes: #396687). + + -- Gerrit Pape Mon, 6 Nov 2006 20:18:51 +0000 + +bcron (0.09-5) unstable; urgency=low + + * debian/control: Build-Depends: bglibs-dev (>> 1.041-1) (closes: + #376244); bcron-run: Suggests: anacron (closes: #375078). + + -- Gerrit Pape Thu, 13 Jul 2006 18:51:24 +0000 + +bcron (0.09-4) unstable; urgency=low + + * debian/diff/initgroups.diff: new; bcron-exec: setup group membership + properly (thx Joshua N Pritikin, closes: #352159). + * debian/implicit: update to revision 1.11. + + -- Gerrit Pape Sat, 4 Mar 2006 00:25:03 +0000 + +bcron (0.09-3) unstable; urgency=low + + * debian/bcron-run.postrm: typo; minor. + * debian/bcron-run.postinst, debian/bcron-run.README.Debian, + debian/bcron-run.prerm: use sv program instead of runsvctrl, runsvstat, + svwaitdown. + * debian/control: bcron-run Depends: runit (>> 1.3.0-0). + + -- Gerrit Pape Wed, 12 Oct 2005 10:23:04 +0000 + +bcron (0.09-2) unstable; urgency=low + + * debian/diff/bcron-spool-socket.diff: new; change path to bcron-spool + socket to /var/run/.bcron-spool (thx Tommi Virtanen, closes: #321383). + + -- Gerrit Pape Fri, 5 Aug 2005 17:33:30 +0000 + +bcron (0.09-1) unstable; urgency=low + + * new upstream version. + * debian/diff/var-run-.bcron-spool.diff, debian/diff/man.diff: remove; + adopted upstream. + * debian/rules: install-arch: use $install_prefix with new bg-installer; + build-arch: run selftests. + * debian/control: Standards-Version: 3.6.2.0; Build-Depends: bglibs-dev + (>> 1.021-0). + * debian/diff/tests.diff: new; skip non-root-only spool-*-baduser tests. + + -- Gerrit Pape Wed, 20 Jul 2005 20:51:18 +0000 + +bcron (0.08-0.3) unstable; urgency=low + + * initial version (closes: #302309). + + -- Gerrit Pape Sun, 10 Apr 2005 10:02:48 +0000 --- bcron-0.09.orig/debian/bcron-run.prerm +++ bcron-0.09/debian/bcron-run.prerm @@ -0,0 +1,11 @@ +#!/bin/sh +set -e + +trap "cd `pwd`" EXIT + +test "$1" = 'remove' || test "$1" = 'deconfigure' || \ + test "$1" = 'failed-upgrade' || exit 0 + +for i in update spool sched; do + update-service --remove /etc/bcron-$i || : +done --- bcron-0.09.orig/debian/diff/0005-tests.sh-skip-non-root-only-spool-baduser-tests.diff +++ bcron-0.09/debian/diff/0005-tests.sh-skip-non-root-only-spool-baduser-tests.diff @@ -0,0 +1,62 @@ +From bd1d6021038e2c5668754d337b00d021eac4c00d Mon Sep 17 00:00:00 2001 +From: Gerrit Pape +Date: Tue, 8 May 2007 09:02:18 +0000 +Subject: [PATCH] tests.sh: skip non-root-only spool-*-baduser tests. + +--- + tests.sh | 32 ++++++++++++++++---------------- + 1 files changed, 16 insertions(+), 16 deletions(-) + +diff --git a/tests.sh b/tests.sh +index df8fdf4..1cea1f9 100644 +--- a/tests.sh ++++ b/tests.sh +@@ -65,15 +65,15 @@ run_compare_test() { + + ##### Test tests/spool-delete-baduser ##### + +-runtest() { +-touch $CRONTABS/root +-echo -n "Rroot" | spoolcmd +-test -e $CRONTABS/root && echo File still exists. +-} +-run_compare_test tests/spool-delete-baduser < +Date: Tue, 8 May 2007 09:01:03 +0000 +Subject: [PATCH] bcron-exec.c: fix typo that prevented initgroups() from being called. + +--- + bcron-exec.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/bcron-exec.c b/bcron-exec.c +index 38a627b..2414bd8 100644 +--- a/bcron-exec.c ++++ b/bcron-exec.c +@@ -111,7 +111,7 @@ static void exec_cmd(int fdin, int fdout, + dup2(fdout, 1); + dup2(fdout, 2); + close(fdout); +- if (0 && initgroups(pw->pw_name, pw->pw_gid) != 0) ++ if (initgroups(pw->pw_name, pw->pw_gid) != 0) + die1sys(111, "Could not initgroups"); + if (setgid(pw->pw_gid) != 0) + die1sys(111, "Could not setgid"); +-- +1.5.1.3 + --- bcron-0.09.orig/debian/diff/0007-tests.sh-replace-bashism-let-with-posix-arithmetic.diff +++ bcron-0.09/debian/diff/0007-tests.sh-replace-bashism-let-with-posix-arithmetic.diff @@ -0,0 +1,29 @@ +From 3ffd2aaa01c534d092af58b69a37d0e8757fffa9 Mon Sep 17 00:00:00 2001 +From: Gerrit Pape +Date: Tue, 8 May 2007 09:14:26 +0000 +Subject: [PATCH] tests.sh: replace bashism 'let' with posix arithmetic expansions $(( )). + +--- + tests.sh | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests.sh b/tests.sh +index 08cdeb4..af8dc76 100644 +--- a/tests.sh ++++ b/tests.sh +@@ -57,10 +57,10 @@ run_compare_test() { + then + echo "Test $name $@ failed:" + ( cd $tmp; diff -U 9999 expected actual | tail -n +3; echo; ) +- let tests_failed=tests_failed+1 ++ tests_failed=$(($tests_failed+1)) + fi + rm -f $tmp/expected $tmp/actual +- let tests_count=tests_count+1 ++ tests_count=$(($tests_count+1)) + } + + ##### Test tests/spool-delete-baduser ##### +-- +1.5.1.3 + --- bcron-0.09.orig/debian/diff/0001-add-bcron.html-bcron.info-to-TARGETS-to-have-them-cl.diff +++ bcron-0.09/debian/diff/0001-add-bcron.html-bcron.info-to-TARGETS-to-have-them-cl.diff @@ -0,0 +1,25 @@ +From e684173ac857694fe2e1306404618d182582699b Mon Sep 17 00:00:00 2001 +From: Gerrit Pape +Date: Tue, 8 May 2007 08:54:30 +0000 +Subject: [PATCH] add bcron.html, bcron.info to TARGETS to have them cleaned up on make clean. + +--- + TARGETS | 2 -- + 1 files changed, 0 insertions(+), 2 deletions(-) + +diff --git a/TARGETS b/TARGETS +index 32380b8..55e2bcb 100644 +--- a/TARGETS ++++ b/TARGETS +@@ -10,8 +10,6 @@ bcron-start.o + bcron-update + bcron-update.o + bcron.a +-bcron.html +-bcron.info + bcrontab + bcrontab.o + chdir.o +-- +1.5.1.3 + --- bcron-0.09.orig/debian/diff/0002-Spool-socket-is-var-run-.bcron-spool-instead-of-var.diff +++ bcron-0.09/debian/diff/0002-Spool-socket-is-var-run-.bcron-spool-instead-of-var.diff @@ -0,0 +1,25 @@ +From aa02c0d1fafed3afe6191ff5223cda267da8db93 Mon Sep 17 00:00:00 2001 +From: Gerrit Pape +Date: Tue, 8 May 2007 08:55:56 +0000 +Subject: [PATCH] Spool socket is /var/run/.bcron-spool instead of /var/run/bcron-spool on Debian. + +--- + bcron.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/bcron.h b/bcron.h +index 2d98b6b..d50db65 100644 +--- a/bcron.h ++++ b/bcron.h +@@ -8,7 +8,7 @@ + + #define BCRON_SPOOL "/var/spool/cron" + #define CRONTAB_DIR "crontabs" +-#define SOCKET_PATH "/var/run/bcron-spool" ++#define SOCKET_PATH "/var/run/.bcron-spool" + #define BCRON_USER "cron" + #define TRIGGER "trigger" + +-- +1.5.1.3 + --- bcron-0.09.orig/debian/diff/0003-Have-bcron-update-ignore-files-that-are-outside-Debia.diff +++ bcron-0.09/debian/diff/0003-Have-bcron-update-ignore-files-that-are-outside-Debia.diff @@ -0,0 +1,62 @@ +From 17414bc406c0883ae8eaaeaafecf84f27689f324 Mon Sep 17 00:00:00 2001 +From: Gerrit Pape +Date: Tue, 8 May 2007 08:59:14 +0000 +Subject: [PATCH] Have bcron-update ignore files that are outside Debian namespace. + +On Debian, if path is a directory, bcron-spool skips files in this +directory with names that do not solely consist of lower- and uppercase +letters ('a'-'z', 'A'-'Z'), digits ('0'-'9'), underscores ('_'), and +hyphens ('-'). +--- + bcron-update.8 | 8 ++++++++ + bcron-update.c | 13 +++++++++++++ + 2 files changed, 21 insertions(+), 0 deletions(-) + +diff --git a/bcron-update.8 b/bcron-update.8 +index 7a20224..90e4a55 100644 +--- a/bcron-update.8 ++++ b/bcron-update.8 +@@ -15,6 +15,14 @@ those changes into the crontab spool directory. + .B bcron-update + runs as root in order to be able to read system files that would + potentially be unreadable otherwise. ++.P ++On Debian, if ++.I path ++is a directory, ++.B bcron-update ++skips files in this directory with names that do not solely consist of ++lower- and uppercase letters ('a'-'z', 'A'-'Z'), digits ('0'-'9'), ++underscores ('_'), and hyphens ('-'). + .SH EXAMPLES + To mirror modern vixie-cron's behavior, use: + .EX +diff --git a/bcron-update.c b/bcron-update.c +index 7bf6c6f..23bc8ce 100644 +--- a/bcron-update.c ++++ b/bcron-update.c +@@ -136,8 +136,21 @@ static int check_dir(struct arg* a, struct ministat* st) + while ((e = readdir(a->dir)) != 0) { + struct statcache_entry* se; + const char* name = e->d_name; ++ char *c; + if (name[0] == '.') + continue; ++ /* check Debian cron files namespace */ ++ for (c = e->d_name; *c; ++c) { ++ if (*c == '-') continue; ++ if (*c < '0') break; ++ if (*c <= '9') continue; ++ if (*c < 'A') break; ++ if (*c <= 'Z') continue; ++ if (*c == '_') continue; ++ if (*c < 'a') break; ++ if (*c > 'z') break; ++ } ++ if (*c) continue; + if ((se = statcache_get(&a->entries, &name)) == 0) { + /* File is new. */ + ministat2(a->path, name, st); +-- +1.5.1.3 + --- bcron-0.09.orig/debian/diff/0006-tests.sh-export-TZ-CST0-trailing-zero-to-make-new.diff +++ bcron-0.09/debian/diff/0006-tests.sh-export-TZ-CST0-trailing-zero-to-make-new.diff @@ -0,0 +1,34 @@ +From b40c55bbfdf04f45c9646ebaee328654629eb42e Mon Sep 17 00:00:00 2001 +From: Gerrit Pape +Date: Tue, 8 May 2007 08:52:58 +0000 +Subject: [PATCH] tests.sh: export TZ=CST0 (trailing zero) to make new glibc in sid happy. + + $ date + Tue May 8 08:51:03 UTC 2007 + $ TZ=CST date + Tue May 8 08:51:15 UTC 2007 + $ TZ=CST0 date + Tue May 8 08:51:23 CST 2007 + $ + +See http://bugs.debian.org/422125 +--- + tests.sh | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/tests.sh b/tests.sh +index 1cea1f9..08cdeb4 100644 +--- a/tests.sh ++++ b/tests.sh +@@ -347,7 +347,7 @@ END_OF_TEST_RESULTS + runtest() { + local job="$1" + local start="$2" +-export TZ=CST ++export TZ=CST0 + sched "$job echo" $start + unset TZ + } +-- +1.5.1.3 + --- bcron-0.09.orig/debian/diff/0008-bcron-exec-Mark-all-temporary-files-close-on-exec-and.diff +++ bcron-0.09/debian/diff/0008-bcron-exec-Mark-all-temporary-files-close-on-exec-and.diff @@ -0,0 +1,79 @@ +From 6b30379c3bcab65a6a21b5c7677e333dbc357cc3 Mon Sep 17 00:00:00 2001 +From: Bruce Guenter +Date: Fri, 5 Oct 2012 18:15:11 -0600 +Subject: [PATCH] bcron-exec: Mark all temporary files close-on-exec and + close selfpipe + +This fixes a security bug in bcron where cron jobs get access to the +temporary output files from all other jobs that are still running. + +First reported in Debian: +http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=686650 + +Conflicts: + NEWS +--- + bcron-exec.c | 3 +++ + tests/exec-fds | 22 ++++++++++++++++++++++ + 2 files changed, 25 insertions(+) + create mode 100644 tests/exec-fds + +diff --git a/bcron-exec.c b/bcron-exec.c +index 2414bd8..ec6c641 100644 +--- a/bcron-exec.c ++++ b/bcron-exec.c +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -106,6 +107,7 @@ static void exec_cmd(int fdin, int fdout, + const str* env, + const struct passwd* pw) + { ++ selfpipe_close(); + dup2(fdin, 0); + close(fdin); + dup2(fdout, 1); +@@ -205,6 +207,7 @@ static void start_slot(int slot, + return; + } + unlink(tmp.s); ++ cloexec_on(fd); + gethostname(hostname, sizeof hostname); + wrap_str(str_copyns(&tmp, 6, "To: <", mailto, ">\n", + "From: Cron Daemon \n")); +diff --git a/tests/exec-fds b/tests/exec-fds +new file mode 100644 +index 0000000..f2c4a9f +--- /dev/null ++++ b/tests/exec-fds +@@ -0,0 +1,22 @@ ++doexec \ ++ 'sleep 1; echo all done' \ ++ 'echo here >&4; echo here >&5; echo here >&6; echo here >&7; echo here >&8' ++ ++15:2^@KJob complete,15:1^@KJob complete, ++bcron-exec: (USER) CMD (sleep 1; echo all done) ++bcron-exec: (USER) CMD (echo here >&4; echo here >&5; echo here >&6; echo here >&7; echo here >&8) ++bcron-exec: Waiting for remaining slots to complete ++To: ++From: Cron Daemon ++Subject: Cron echo here >&4; echo here >&5; echo here >&6; echo here >&7; echo here >&8 ++ ++/bin/sh: 1: 4: Bad file descriptor ++/bin/sh: 1: 5: Bad file descriptor ++/bin/sh: 1: 6: Bad file descriptor ++/bin/sh: 1: 7: Bad file descriptor ++/bin/sh: 1: 8: Bad file descriptor ++To: ++From: Cron Daemon ++Subject: Cron sleep 1; echo all done ++ ++all done +-- +1.7.10.4 + --- bcron-0.09.orig/debian/etc/bcron-spool/run +++ bcron-0.09/debian/etc/bcron-spool/run @@ -0,0 +1,5 @@ +#!/bin/sh +exec 2>&1 +exec chpst -e/etc/bcron -Ucron sh -c ' + exec unixserver -U ${BCRON_SOCKET:-/var/run/.bcron-spool} bcron-spool +' --- bcron-0.09.orig/debian/etc/bcron-spool/log/run +++ bcron-0.09/debian/etc/bcron-spool/log/run @@ -0,0 +1,2 @@ +#!/bin/sh +exec chpst -ucronlog svlogd -tt /var/log/bcron/spool --- bcron-0.09.orig/debian/etc/bcron-sched/run +++ bcron-0.09/debian/etc/bcron-sched/run @@ -0,0 +1,3 @@ +#!/bin/sh +exec 2>&1 +exec chpst -e/etc/bcron bcron-start --- bcron-0.09.orig/debian/etc/bcron-sched/log/run +++ bcron-0.09/debian/etc/bcron-sched/log/run @@ -0,0 +1,2 @@ +#!/bin/sh +exec chpst -ucronlog svlogd -tt /var/log/bcron --- bcron-0.09.orig/debian/etc/bcron-update/run +++ bcron-0.09/debian/etc/bcron-update/run @@ -0,0 +1,3 @@ +#!/bin/sh +exec 2>&1 +exec bcron-update /etc/crontab /etc/cron.d --- bcron-0.09.orig/debian/etc/bcron-update/log/run +++ bcron-0.09/debian/etc/bcron-update/log/run @@ -0,0 +1,2 @@ +#!/bin/sh +exec chpst -ucronlog svlogd -tt /var/log/bcron/update