Imported Debian patch 1.4.8-1~exp1

This commit is contained in:
Christian Kastner 2011-07-26 14:00:34 +02:00 committed by Mario Fetka
parent 886d9ad08e
commit 3f49655c6b
25 changed files with 870 additions and 0 deletions

16
debian/README.Debian vendored Normal file
View File

@ -0,0 +1,16 @@
cronie for Debian
-----------------
This version of cronie has been patched and configured to be as compatible as
possible to Debian's standard job scheduler, ISC cron. You should be able to
switch between these implementations without experiencing any major negative
side effects to your system.
Feature-wise, however, there still are quite a number of subtle and
not-so-subtle differences (mostly because of how much Debian's version of ISC
cron is patched), so be sure to read the manpages.
cronie installs a file /etc/cron.deny (empty), thereby enabling all users to
use the crontab(1) command by default.
-- Christian Kastner <debian@kvr.at> Sun, 20 Mar 2011 01:27:55 +0100

11
debian/changelog vendored Normal file
View File

@ -0,0 +1,11 @@
cronie (1.4.8-1~exp1) experimental; urgency=low
* Initial release (Closes: #590876)
* debian/patches added:
- 0001-Unbundle-anacron
- 0002-Manpage-and-typo-fixes
- 0003-Rename-PAM-service-to-cronie
- 0004-Debian-specific-paths-and-features
- 0005-Extend-support-for-kFreeBSD-and-GNU-HURD
-- Christian Kastner <debian@kvr.at> Tue, 26 Jul 2011 14:00:34 +0200

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
7

41
debian/control vendored Normal file
View File

@ -0,0 +1,41 @@
Source: cronie
Section: admin
Priority: optional
Maintainer: Christian Kastner <debian@kvr.at>
Build-Depends:
debhelper (>= 7.2.3~),
dh-autoreconf,
libpam0g-dev,
libselinux1-dev [linux-any],
libaudit-dev [linux-any]
Standards-Version: 3.9.2
Homepage: https://fedorahosted.org/cronie/
Vcs-Git: git://scm.kvr.at/git/pkg-cronie.git
Vcs-Browser: http://scm.kvr.at/git/?p=pkg-cronie.git;a=summary
Package: cronie
Architecture: any
Depends:
${shlibs:Depends},
${misc:Depends},
adduser,
lsb-base (>= 3.0-6),
libpam-runtime (>= 1.0.1-11)
Recommends:
exim4 | mail-transport-agent
Suggests:
anacron (>= 2.0-1)
Provides: cron-daemon, cron
Conflicts: cron
Replaces: cron
Description: Process Scheduling Daemon
cronie is a daemon that runs specified programs at scheduled times and
optionally mails generated output to the user. It is a fork of the original
ISC cron and contains many improvements, such as:
* inotify support (Linux only)
* clustering support
* full PAM support
.
cronie is fully compatible with ISC cron (Debian's standard job scheduler),
and can be used as a drop-in replacement for it.

134
debian/copyright vendored Normal file
View File

@ -0,0 +1,134 @@
Format: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=173
Upstream-Name: cronie
Upstream-Contact: Marcela Mašláňová <mmaslano@redhat.com>
Source: https://fedorahosted.org/releases/c/r/cronie/
Files: *
Copyright: 1988,1990,1993,1994, Paul Vixie
1997,2000, Internet Software Consortium, Inc.
2004, Internet Systems Consortium, Inc. ("ISC")
1997-2011, Red Hat, Inc.
2000,2002, Todd C. Miller
2010, Colin Dean
License: ISC
Files: popen.c
Copyright: 1989,1993,1994,2005, The Regents of the University of California
License: BSD-2-clause
Files: bitstring.h
Copyright: 1989,1993,2003, The Regents of the University of California
License: BSD-3-clause
Files: anacron/*
Copyright: 1998, Itai Tzur <itzur@actcom.co.il>
1999, Sean 'Shaleh' Perry <shaleh@debian.org>
2004, Pascal Hakim <pasc@redellipse.net>
2009-2011, Red Hat, Inc.
License: GPL-2+
Files: debian/*
2010-2011, Christian Kastner <debian@kvr.at>
License: GPL-3+
Files: debian/patches/*
Copyright: 2011, Christian Kastner <debian@kvr.at>
License: ISC
License: ISC
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
.
THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
License: BSD-2-clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
License: BSD-3-clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
License: GPL-2+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
.
On Debian systems, the full text of the GNU General Public
License version 2 can be found in the file
"/usr/share/common-licenses/GPL-2".
License: GPL-3+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
.
On Debian systems, the full text of the GNU General Public
License version 3 can be found in the file
"/usr/share/common-licenses/GPL-3".

12
debian/cronie.default vendored Normal file
View File

@ -0,0 +1,12 @@
# Defaults for cronie initscript
# This is a POSIX shell fragment
# Some additional options for the daemon
# See cron(8) for all options and a detailed explanation of these
#
# -m <cmd> shell command to use for sending mail instead of sendmail(8)
# -p lift some restrictions on user crontabs (owner, mode, type)
# -c enable clustering support
# -s send job output to syslog instead of mail
#
DAEMON_ARGS=""

0
debian/cronie.deny vendored Normal file
View File

87
debian/cronie.init vendored Normal file
View File

@ -0,0 +1,87 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: cronie
# Required-Start: $remote_fs $syslog $time
# Required-Stop: $remote_fs $syslog $time
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: time-based job scheduler
# Description: cronie is a daemon that runs specified programs at
# scheduled times and optionally mails generated output
# to the user.
### END INIT INFO
# Author: Christian Kastner <debian@kvr.at>
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="time-based job scheduler"
NAME=cronie
DAEMON_NAME=crond
DAEMON=/usr/sbin/$DAEMON_NAME
DAEMON_ARGS=""
PIDFILE=/var/run/$DAEMON_NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
# Exit if the package is not installed
[ -x $DAEMON ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
. /lib/lsb/init-functions
do_start()
{
start_daemon -p $PIDFILE $DAEMON $DAEMON_ARGS
}
do_stop()
{
killproc -p $PIDFILE $DAEMON
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 || exit 0 ;;
2|3) [ "$VERBOSE" != no ] && log_end_msg 1 || exit 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|3) [ "$VERBOSE" != no ] && log_end_msg 0 || exit 0 ;;
*) [ "$VERBOSE" != no ] && log_end_msg 1 || exit 1 ;;
esac
;;
status)
status_of_proc -p $PIDFILE "$DAEMON" "$DAEMON_NAME" && exit 0 || exit $?
;;
restart|force-reload)
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
if [ $? -eq 0 ]
then
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
else
# Failed to stop
log_end_msg 1
fi
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac

21
debian/cronie.pam vendored Normal file
View File

@ -0,0 +1,21 @@
# The PAM configuration file for cronie (cron daemon)
# Access control using /etc/security/access.conf
account required pam_access.so
# Set the loginuid process attribute
session required pam_loginuid.so
# Read environment variables from pam_env's default files, /etc/environment
# and /etc/security/pam_env.conf.
session required pam_env.so
# In addition to the above, read system locale information
session required pam_env.so envfile=/etc/default/locale
# Sets up user limits
session required pam_limits.so
@include common-account
@include common-session-noninteractive
@include common-auth

12
debian/crontab.system vendored Normal file
View File

@ -0,0 +1,12 @@
# /etc/crontab: system-wide crontab
# See crontab(5)
# Set PATH to system default
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#

6
debian/dirs vendored Normal file
View File

@ -0,0 +1,6 @@
etc/cron.d
etc/cron.hourly
etc/cron.daily
etc/cron.weekly
etc/cron.monthly
var/spool/cron/crontabs

2
debian/docs vendored Normal file
View File

@ -0,0 +1,2 @@
NEWS
README

View File

@ -0,0 +1,54 @@
From: Christian Kastner <debian@kvr.at>
Date: Thu, 28 Jul 2011 11:01:03 +0200
Subject: Unbundle anacron
Upstream has integrated anacron into cronie. Debian has its own package, so
we unbundle it (mostly by removing references to it).
Forwarded: not-needed
Last-Update: 2011-07-28
---
man/cron.8 | 7 +++----
man/crontab.5 | 2 +-
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/man/cron.8 b/man/cron.8
index 8f36a51..36006ca 100644
--- a/man/cron.8
+++ b/man/cron.8
@@ -49,8 +49,7 @@ for crontab files which are named after accounts in
The found crontabs are loaded into the memory.
.I Cron
also searches for
-.I /etc/anacrontab
-and any files in the
+any files in the
.I /etc/cron.d
directory, which have a different format (see
.BR crontab (5)).
@@ -82,9 +81,9 @@ crontables were modified. The modtime option is also used when inotify can not b
.PP
.I Cron
checks these files and directories:
-.IR /etc/anacrontab
+.IR /etc/crontab
system crontab, usually used to run daily, weekly, monthly jobs. See
-.BR anacrontab (5)
+.BR crontab (5)
for more details.
.IR /etc/cron.d/
directory that contains system cronjobs stored for different users.
diff --git a/man/crontab.5 b/man/crontab.5
index 0132fc7..6853b73 100644
--- a/man/crontab.5
+++ b/man/crontab.5
@@ -274,7 +274,7 @@ MLS_LEVEL=SystemHigh
0-59 * * * * id -Z > /tmp/SystemHigh/crontest
.fi
.SH FILES
-.I /etc/anacrontab
+.I /etc/crontab
system crontab file for jobs like cron.daily, weekly, monthly.
.I /var/spool/cron/
a directory for storing crontabs defined by users.
--

View File

@ -0,0 +1,180 @@
From: Christian Kastner <debian@kvr.at>
Date: Thu, 28 Jul 2011 11:07:40 +0200
Subject: Manpage and typo fixes
Correct some errors or clarify sections in the manpages; fix some typos
---
man/cron.8 | 37 +++++++++++++++++--------------------
man/crontab.1 | 2 +-
man/crontab.5 | 14 +++++++-------
src/cron.c | 4 ++--
4 files changed, 27 insertions(+), 30 deletions(-)
diff --git a/man/cron.8 b/man/cron.8
index 36006ca..e20455e 100644
--- a/man/cron.8
+++ b/man/cron.8
@@ -27,7 +27,7 @@
crond \- daemon to execute scheduled commands
.SH SYNOPSIS
.B crond
-.RB [ -n " | " -p " | " -s " | " -c " | " -m \fP\fI<mail command>\fP ]
+.RB [ -n " | " -i " | " -p " | " -s " | " -c " | " -m \fP\fI<mail command>\fP ]
.B crond
.B -x
@@ -35,18 +35,15 @@ crond \- daemon to execute scheduled commands
.br
.SH DESCRIPTION
.I Cron
-is started from
-.I /etc/rc.d/init.d
-or
-.I /etc/init.d
-It returns immediately, thus, there is no need to need to start it with the '&' parameter.
+is automatically started at boot time.
.PP
.I Cron
searches
.I /var/spool/cron
-for crontab files which are named after accounts in
-.I /etc/passwd;
-The found crontabs are loaded into the memory.
+for crontab files which are named after user accounts;
+together with the system crontab
+.IR /etc/crontab ,
+the found crontabs are loaded into the memory.
.I Cron
also searches for
any files in the
@@ -65,10 +62,10 @@ Any job output can also be sent to syslog by using the
option.
.PP
There are two ways how changes in crontables are checked. The first
-method is checking the modtime of a file. The second method is using the inotify support.
-Using of inotify is logged in the
-.I /var/log/cron
-log after the daemon is started. The inotify support checks for changes in all crontables and accesses the
+method is checking the modtime of a file. The second method
+is using inotify support, which is only available on Linux.
+When the daemon uses inotify, it logs this fact to syslog on startup.
+The inotify support checks for changes in all crontables and accesses the
hard disk only when a change is detected.
.PP
When using the modtime option,
@@ -89,13 +86,9 @@ for more details.
directory that contains system cronjobs stored for different users.
.IR /var/spool/cron
directory that contains user crontables created by the
-.IR crontab
+.BR crontab (1)
command.
-Note that the
-.BR crontab (1)
-command updates the modtime of the spool directory whenever it changes a
-crontab.
.PP
.SS Daylight Saving Time and other time changes
Local time changes of less than three hours, such as those caused
@@ -135,16 +128,20 @@ This command must accept a fully formatted mail message (with headers) on standa
as a mail message to the recipients specified in the mail headers. Specifying
the string
.I "off"
-(i.e. crond -m off)
+(i.e. crond \-m off)
will disable the sending of mail.
.TP
.B "\-n"
Tells the daemon to run in the foreground. This can be useful when starting it out of init.
.TP
+.B "\-i"
+Disables inotify support (if present)
+.TP
.B "\-p"
Allows
.I Cron
-to accept any user set crontables.
+to accept any user set crontables (read: lift owner, type and mode
+restrictions)
.TP
.B "\-c"
This option enables clustering support, as described below.
diff --git a/man/crontab.1 b/man/crontab.1
index d35331a..c1c8bae 100644
--- a/man/crontab.1
+++ b/man/crontab.1
@@ -86,7 +86,7 @@ or modify system cron jobs in the
.IR /etc/cron.d/
directory.
.PP
-The temporary directory can be set in an environment variable. If it is not set
+The temporary directory can be set using the environment variable $TMPDIR. If it is not set
by the user, the
.I /tmp
directory is used.
diff --git a/man/crontab.5 b/man/crontab.5
index 6853b73..03c034f 100644
--- a/man/crontab.5
+++ b/man/crontab.5
@@ -35,7 +35,7 @@ their own crontabs, eliminating the need for explicitly running
as part of a cron command.
.PP
Blank lines, leading spaces, and tabs are ignored. Lines whose first
-non-white space character is a pound-sign (#) are comments, and are note processed.
+non-white space character is a pound-sign (#) are comments, and are not processed.
Note that comments are not allowed on the same line as cron commands, since
they are considered a part of the command. Similarly, comments are not
allowed on the same line as environment variable settings.
@@ -235,7 +235,7 @@ CRON_TZ=Japan
# run at 2:15pm on the first of every month -- output mailed to paul
15 14 1 * * $HOME/bin/monthly
# run at 10 pm on weekdays, annoy Joe
-0 22 * * 1-5 mail -s "It's 10pm" joe%Joe,%%Where are your kids?%
+0 22 * * 1-5 mail \-s "It's 10pm" joe%Joe,%%Where are your kids?%
23 0-23/2 * * * echo "run 23 minutes after midn, 2am, 4am ..., everyday"
5 4 * * sun echo "run at 5 after 4 every sunday"
.fi
@@ -255,7 +255,7 @@ MAILTO=root
* * * * * root touch /tmp/file
.fi
.SH SELinux with multi level security (MLS)
-In a crontab, it is important to specify a security level by \fIcrontab\ -s\fR or specifying
+In a crontab, it is important to specify a security level by \fIcrontab\ \-s\fR or specifying
the required level on the first line of the crontab. Each level is specified
in \fI/etc/selinux/targeted/seusers\fR. When using crontab in the MLS mode, it is especially important to:
.br
@@ -265,13 +265,13 @@ in \fI/etc/selinux/targeted/seusers\fR. When using crontab in the MLS mode, it i
.SH EXAMPLE FOR SELINUX MLS
.nf
# login as root
-newrole -r sysadm_r
+newrole \-r sysadm_r
mkdir /tmp/SystemHigh
-chcon -l SystemHigh /tmp/SystemHigh
-crontab -e
+chcon \-l SystemHigh /tmp/SystemHigh
+crontab \-e
# write in crontab file
MLS_LEVEL=SystemHigh
-0-59 * * * * id -Z > /tmp/SystemHigh/crontest
+0-59 * * * * id \-Z > /tmp/SystemHigh/crontest
.fi
.SH FILES
.I /etc/crontab
diff --git a/src/cron.c b/src/cron.c
index 7dc2958..760bafe 100644
--- a/src/cron.c
+++ b/src/cron.c
@@ -137,8 +137,8 @@ static void usage(void) {
const char **dflags;
fprintf(stderr, "usage: %s [-h] print this message \n \
- [-i] deamon runs without inotify support \n \
- [-m <mail command>] off or specify prefered client for sending mails \n \
+ [-i] daemon runs without inotify support \n \
+ [-m <mail command>] off or specify preferred client for sending mails \n \
[-n] run in foreground \n \
[-p] permit any crontab \n \
[-c] enable clustering support \n \
--

View File

@ -0,0 +1,44 @@
From: Christian Kastner <debian@kvr.at>
Date: Thu, 28 Jul 2011 11:11:45 +0200
Subject: Rename PAM service to cronie
Upstream uses "crond"; we switch to "cron" to avoid confusion with Debian's ISC
cron (it uses "cron" but that might change).
Forwaded: not-needed
Last-Update: 2011-07-28
---
Makefile.am | 5 -----
src/security.c | 2 +-
2 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 05c541a..8fa4d97 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,11 +3,6 @@ if ANACRON
SUBDIRS += anacron
endif
-if PAM
-pamdir = $(sysconfdir)/pam.d
-dist_pam_DATA = pam/crond
-endif
-
EXTRA_DIST = cronie.init crond.sysconfig contrib/anacrontab \
contrib/0anacron contrib/0hourly \
contrib/dailyjobs
diff --git a/src/security.c b/src/security.c
index f6940a5..28dda4d 100644
--- a/src/security.c
+++ b/src/security.c
@@ -172,7 +172,7 @@ int cron_start_pam(struct passwd *pw) {
int retcode = 0;
#if defined(WITH_PAM)
- retcode = pam_start("crond", pw->pw_name, &conv, &pamh);
+ retcode = pam_start("cronie", pw->pw_name, &conv, &pamh);
PAM_FAIL_CHECK;
retcode = pam_set_item(pamh, PAM_TTY, "cron");
PAM_FAIL_CHECK;
--

View File

@ -0,0 +1,80 @@
From: Christian Kastner <debian@kvr.at>
Date: Thu, 28 Jul 2011 11:15:01 +0200
Subject: Debian-specific paths and features
Use Debian-specific paths and features. For example, the spool dir differs from
upstream, and we always build to use syslog.
Forwarded: not-needed
Last-Update: 2011-07-28
---
man/cron.8 | 13 ++-----------
man/crontab.1 | 2 +-
man/crontab.5 | 2 +-
3 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/man/cron.8 b/man/cron.8
index e20455e..5f83546 100644
--- a/man/cron.8
+++ b/man/cron.8
@@ -39,7 +39,7 @@ is automatically started at boot time.
.PP
.I Cron
searches
-.I /var/spool/cron
+.I /var/spool/cron/crontabs
for crontab files which are named after user accounts;
together with the system crontab
.IR /etc/crontab ,
@@ -84,7 +84,7 @@ system crontab, usually used to run daily, weekly, monthly jobs. See
for more details.
.IR /etc/cron.d/
directory that contains system cronjobs stored for different users.
-.IR /var/spool/cron
+.IR /var/spool/cron/crontabs
directory that contains user crontables created by the
.BR crontab (1)
command.
@@ -157,15 +157,6 @@ installed or if mail is disabled.
.TP
.B "\-x"
This option allows you to set debug flags.
-.SH SIGNALS
-When the \s-2SIGHUP\s+2 is received, the
-.I Cron
-daemon will close and reopen its
-log file. This proves to be useful in scripts which rotate and age log files.
-Naturally, this is not relevant if
-.I Cron
-was built to use
-.IR syslog (3).
.SH CLUSTERING SUPPORT
In this version of
.IR Cron
diff --git a/man/crontab.1 b/man/crontab.1
index c1c8bae..9c32c8e 100644
--- a/man/crontab.1
+++ b/man/crontab.1
@@ -56,7 +56,7 @@ more crontabs for each range. For more information, see
In this version of
.IR Cron
it is possible to use a network-mounted shared
-.I /var/spool/cron
+.I /var/spool/cron/crontabs
across a cluster of hosts and specify that only one of the hosts should
run the crontab jobs in the particular directory at any one time. You may also use
.BR crontab (1)
diff --git a/man/crontab.5 b/man/crontab.5
index 03c034f..8a3692b 100644
--- a/man/crontab.5
+++ b/man/crontab.5
@@ -276,7 +276,7 @@ MLS_LEVEL=SystemHigh
.SH FILES
.I /etc/crontab
system crontab file for jobs like cron.daily, weekly, monthly.
-.I /var/spool/cron/
+.I /var/spool/cron/crontabs
a directory for storing crontabs defined by users.
.I /etc/cron.d/
a directory for storing system crontables.
--

View File

@ -0,0 +1,41 @@
From: Christian Kastner <debian@kvr.at>
Date: Sun, 7 Aug 2011 19:48:09 +0200
Subject: Extend support for kFreeBSD and GNU HURD
Extend some of the #ifdefs to include kFreeBSD and HURD where it's obviously OK
to do so
Forwarded: no
Last-Update: 2011-08-07
---
src/entry.c | 2 +-
src/pathnames.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/entry.c b/src/entry.c
index 5d377c6..d03ddb1 100644
--- a/src/entry.c
+++ b/src/entry.c
@@ -335,7 +335,7 @@ entry *load_entry(FILE * file, void (*error_func) (), struct passwd *pw,
}
else
log_it("CRON", getpid(), "ERROR", "can't set LOGNAME", 0);
-#if defined(BSD) || defined(__linux)
+#if defined(BSD) || defined(__linux) || defined(__GLIBC__) || defined(__gnu_hurd__)
if (glue_strings(envstr, sizeof envstr, "USER", pw->pw_name, '=')) {
if ((tenvp = env_set(e->envp, envstr)) == NULL) {
ecode = e_memory;
diff --git a/src/pathnames.h b/src/pathnames.h
index b5d5c70..25d90c3 100644
--- a/src/pathnames.h
+++ b/src/pathnames.h
@@ -26,7 +26,7 @@
#ifndef _PATHNAMES_H_
#define _PATHNAMES_H_
-#if (defined(BSD)) && (BSD >= 199103) || defined(__linux) || defined(AIX)
+#if (defined(BSD)) && (BSD >= 199103) || defined(__linux) || defined(AIX) || defined(__GLIBC__) || defined(__gnu_hurd__)
# include <paths.h>
#endif /*BSD*/
--

5
debian/patches/series vendored Normal file
View File

@ -0,0 +1,5 @@
0001-Unbundle-anacron.patch
0002-Manpage-and-typo-fixes.patch
0003-Rename-PAM-service-to-cronie.patch
0004-Debian-specific-paths-and-features.patch
0005-Extend-support-for-kFreeBSD-and-GNU-HURD.patch

2
debian/placeholder vendored Normal file
View File

@ -0,0 +1,2 @@
# DO NOT REMOVE
# this file prevents dpkg from removing this directory

37
debian/postinst vendored Normal file
View File

@ -0,0 +1,37 @@
#!/bin/sh
set -e
# Analogous to Debian's ISC cron postinst script (for compatibility reasons)
tabsdir="/var/spool/cron/crontabs"
# Make sure group "crontab" exists (needed for running SGID)
getent group crontab > /dev/null 2>&1 || addgroup --system crontab
# Make crontab(1) SGID
if ! dpkg-statoverride --list /usr/bin/crontab > /dev/null
then
dpkg-statoverride --update --add root crontab 2755 /usr/bin/crontab
fi
# Adjust permissions for spool dir
# Can't use dpkg-statoverride for this because it doesn't cooperate nicely
# with cron alternatives such as bcron
if [ -d $tabsdir ] ; then
chown root:crontab $tabsdir
# This must be in sync with misc.c:check_spool_dir()
chmod 1730 $tabsdir
cd $tabsdir
if [ -n "`ls -A $tabsdir`" ]
then
for tabname in *
do
chown $tabname:crontab $tabname && chmod 600 $tabname || continue
done
fi
fi
#DEBHELPER#
exit 0

6
debian/postrm vendored Normal file
View File

@ -0,0 +1,6 @@
#!/bin/sh
set -e
#DEBHELPER#
exit 0

6
debian/prerm vendored Normal file
View File

@ -0,0 +1,6 @@
#!/bin/sh
set -e
#DEBHELPER#
exit 0

68
debian/rules vendored Executable file
View File

@ -0,0 +1,68 @@
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# Add build flags
CFLAGS += -Wall
# Build the config options string
CONFIG_OPTIONS =
# PAM is enabled by default
ifeq (,$(findstring nopam,$(DEB_BUILD_OPTIONS)))
CONFIG_OPTIONS += --with-pam
endif
### Linux-only options ###
ifeq ($(shell dpkg-architecture -qDEB_HOST_ARCH_OS), linux)
# SELINUX is enabled by default
ifeq (,$(findstring noselinux,$(DEB_BUILD_OPTIONS)))
CONFIG_OPTIONS += --with-selinux
endif
# inotify is enabled by default
ifeq (,$(findstring noinotify,$(DEB_BUILD_OPTIONS)))
CONFIG_OPTIONS += --with-inotify
endif
# audit is disabled by default
ifneq (,$(findstring withaudit,$(DEB_BUILD_OPTIONS)))
CONFIG_OPTIONS += --with-audit
endif
endif
### End Linux-only ###
%:
dh $@ --with autoreconf
# Set SPOOL_DIR to Debian's traditional location for crontabs (see Policy)
# Set CRON_GROUP to "crontab" to enable SGID functionality (avoids SUID)
override_dh_auto_configure:
SPOOL_DIR=/var/spool/cron/crontabs dh_auto_configure CRON_GROUP=crontab -- $(CONFIG_OPTIONS)
override_dh_install:
dh_install
# Create /etc/cron.deny to allow crontab(1) for all users by default
install -m 644 debian/cronie.deny debian/cronie/etc/cron.deny
# System-wide crontab
install -m 644 debian/crontab.system debian/cronie/etc/crontab
# Placeholders for dpkg
install -m 644 debian/placeholder debian/cronie/etc/cron.d/.placeholder
install -m 644 debian/placeholder debian/cronie/etc/cron.hourly/.placeholder
install -m 644 debian/placeholder debian/cronie/etc/cron.daily/.placeholder
install -m 644 debian/placeholder debian/cronie/etc/cron.weekly/.placeholder
install -m 644 debian/placeholder debian/cronie/etc/cron.monthly/.placeholder
# Don't need stop (redundant with sendsigs)
override_dh_installinit:
dh_installinit -- start 89 2 3 4 5 .
override_dh_clean:
dh_clean
rm -f src/cron-paths.h

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (quilt)

3
debian/watch vendored Normal file
View File

@ -0,0 +1,3 @@
version=3
https://fedorahosted.org/releases/c/r/cronie/cronie-(.*)\.tar\.gz