commit: 97798a61840f7049f96132411acede5b0229f200 Author: Dagg <daggs <AT> gmx <DOT> com> AuthorDate: Sat Jan 10 13:37:12 2015 +0000 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> CommitDate: Sat Jan 31 21:14:57 2015 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=97798a61
sys-process/cronie: fix limits.h --- sys-process/cronie/cronie-1.4.12-r99.ebuild | 87 ++++++++++++++++++++++ .../files/0001-add_limits_h_and_MAXNAMLEN.patch | 15 ++++ sys-process/cronie/files/cronie-1.2-cron.deny | 5 ++ sys-process/cronie/files/cronie-1.3-crontab | 16 ++++ sys-process/cronie/files/cronie-1.3-initd | 14 ++++ sys-process/cronie/files/cronie-1.4.3-pamd | 9 +++ sys-process/cronie/metadata.xml | 20 +++++ 7 files changed, 166 insertions(+) diff --git a/sys-process/cronie/cronie-1.4.12-r99.ebuild b/sys-process/cronie/cronie-1.4.12-r99.ebuild new file mode 100644 index 0000000..026029f --- /dev/null +++ b/sys-process/cronie/cronie-1.4.12-r99.ebuild @@ -0,0 +1,87 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-process/cronie/cronie-1.4.12.ebuild,v 1.4 2014/12/30 17:42:09 maekke Exp $ + +EAPI=5 + +inherit cron eutils pam systemd user + +DESCRIPTION="Cronie is a standard UNIX daemon cron based on the original vixie-cron" +SRC_URI="https://fedorahosted.org/releases/c/r/cronie/${P}.tar.gz" +HOMEPAGE="https://fedorahosted.org/cronie/wiki" + +LICENSE="ISC BSD BSD-2 GPL-2" +KEYWORDS="amd64 arm ~mips ppc x86" +IUSE="anacron +inotify pam selinux" + +DEPEND="pam? ( virtual/pam ) + anacron? ( !sys-process/anacron )" +RDEPEND="${DEPEND}" + +#cronie supports /etc/crontab +CRON_SYSTEM_CRONTAB="yes" + +src_prepare() { + epatch "${FILESDIR}"/0001-add_limits_h_and_MAXNAMLEN.patch +} + +pkg_setup() { + enewgroup crontab +} + +src_configure() { + SPOOL_DIR="/var/spool/cron/crontabs" \ + ANACRON_SPOOL_DIR="/var/spool/anacron" \ + econf \ + $(use_with inotify) \ + $(use_with pam) \ + $(use_with selinux) \ + $(use_enable anacron) \ + --enable-syscrontab \ + --with-daemon_username=cron \ + --with-daemon_groupname=cron +} + +src_install() { + emake install DESTDIR="${D}" + + docrondir -m 1730 -o root -g crontab + fowners root:crontab /usr/bin/crontab + fperms 2751 /usr/bin/crontab + + insinto /etc/conf.d + newins "${S}"/crond.sysconfig ${PN} + + insinto /etc + newins "${FILESDIR}/${PN}-1.3-crontab" crontab + newins "${FILESDIR}/${PN}-1.2-cron.deny" cron.deny + + keepdir /etc/cron.d + newinitd "${FILESDIR}/${PN}-1.3-initd" ${PN} + newpamd "${FILESDIR}/${PN}-1.4.3-pamd" crond + + sed s:sysconfig/crond:conf.d/cronie: contrib/cronie.systemd \ + > "${T}"/cronie.service + systemd_dounit "${T}"/cronie.service + + if use anacron ; then + local anacrondir="/var/spool/anacron" + keepdir ${anacrondir} + fowners root:cron ${anacrondir} + fperms 0750 ${anacrondir} + + insinto /etc + + doins contrib/anacrontab + + insinto /etc/cron.hourly + doins contrib/0anacron + fperms 0750 /etc/cron.hourly/0anacron + fi + + dodoc AUTHORS README contrib/* +} + +pkg_postinst() { + cron_pkg_postinst +} diff --git a/sys-process/cronie/files/0001-add_limits_h_and_MAXNAMLEN.patch b/sys-process/cronie/files/0001-add_limits_h_and_MAXNAMLEN.patch new file mode 100644 index 0000000..fdf721b --- /dev/null +++ b/sys-process/cronie/files/0001-add_limits_h_and_MAXNAMLEN.patch @@ -0,0 +1,15 @@ +--- src/database.c 2015-01-10 13:17:11.253148769 +0000 ++++ src/database.c 2015-01-10 13:18:45.491148769 +0000 +@@ -38,6 +38,12 @@ + #include <sys/stat.h> + #include <sys/types.h> + #include <unistd.h> ++#if ! defined(__GLIBC__) && ! defined(__UCLIBC__) ++#include <limits.h> ++ ++/* match gnu to posix */ ++#define MAXNAMLEN NAME_MAX ++#endif + + #ifdef WITH_INOTIFY + # include <sys/inotify.h> diff --git a/sys-process/cronie/files/cronie-1.2-cron.deny b/sys-process/cronie/files/cronie-1.2-cron.deny new file mode 100644 index 0000000..f909922 --- /dev/null +++ b/sys-process/cronie/files/cronie-1.2-cron.deny @@ -0,0 +1,5 @@ +# $Id: cronie-1.2-cron.deny,v 1.1 2009/02/17 22:09:35 bangert Exp $ +# If for any reason you have users in the 'cron' group who should not +# be allowed to run crontab, add them to this file (one username per +# line) + diff --git a/sys-process/cronie/files/cronie-1.3-crontab b/sys-process/cronie/files/cronie-1.3-crontab new file mode 100644 index 0000000..b14eeda --- /dev/null +++ b/sys-process/cronie/files/cronie-1.3-crontab @@ -0,0 +1,16 @@ +# for cronie +# $Header: /var/cvsroot/gentoo-x86/sys-process/cronie/files/cronie-1.3-crontab,v 1.2 2014/04/18 13:24:55 polynomial-c Exp $ + +# Global variables +SHELL=/bin/bash +PATH=/sbin:/bin:/usr/sbin:/usr/bin +MAILTO=root +HOME=/ + +# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly +# if anacron is not present +59 * * * * root [ ! -x /etc/cron.hourly/0anacron ] && rm -f /var/spool/cron/lastrun/cron.hourly +9 3 * * * root [ ! -x /etc/cron.hourly/0anacron ] && rm -f /var/spool/cron/lastrun/cron.daily +19 4 * * 6 root [ ! -x /etc/cron.hourly/0anacron ] && rm -f /var/spool/cron/lastrun/cron.weekly +29 5 1 * * root [ ! -x /etc/cron.hourly/0anacron ] && rm -f /var/spool/cron/lastrun/cron.monthly +*/10 * * * * root [ ! -x /etc/cron.hourly/0anacron ] && { test -x /usr/sbin/run-crons && /usr/sbin/run-crons ; } diff --git a/sys-process/cronie/files/cronie-1.3-initd b/sys-process/cronie/files/cronie-1.3-initd new file mode 100644 index 0000000..138530f --- /dev/null +++ b/sys-process/cronie/files/cronie-1.3-initd @@ -0,0 +1,14 @@ +#!/sbin/runscript +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-process/cronie/files/cronie-1.3-initd,v 1.3 2014/03/04 00:17:58 polynomial-c Exp $ + +command="/usr/sbin/crond" +command_args="${CRONDARGS}" +pidfile="/var/run/crond.pid" + +depend() { + use clock logger + need localmount + provide cron +} diff --git a/sys-process/cronie/files/cronie-1.4.3-pamd b/sys-process/cronie/files/cronie-1.4.3-pamd new file mode 100644 index 0000000..e82be8d --- /dev/null +++ b/sys-process/cronie/files/cronie-1.4.3-pamd @@ -0,0 +1,9 @@ +# +# The PAM configuration file for the cron daemon +# +# +auth include system-auth +account required pam_access.so +account include system-auth +session required pam_loginuid.so +session include system-auth diff --git a/sys-process/cronie/metadata.xml b/sys-process/cronie/metadata.xml new file mode 100644 index 0000000..79ee246 --- /dev/null +++ b/sys-process/cronie/metadata.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>cron</herd> +<maintainer> + <email>[email protected]</email> + <name>Lars Wendler</name> +</maintainer> + <longdescription lang="en"> + Cronie contains the standard UNIX daemon crond that runs specified programs at + scheduled times and related tools. It is based on the original cron and + has security and configuration enhancements like the ability to use pam and + SELinux. + And why cronie? See http://www.urbandictionary.com/define.php?term=cronie + </longdescription> + <use> + <flag name='anacron'>Install the periodic anacron command scheduler.</flag> + <flag name='inotify'>Enable inotify filesystem monitoring support.</flag> + </use> +</pkgmetadata>
