Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-dev:musl commit in: sys-process/cronie/, sys-process/cronie/files/
Date: Sat, 31 Jan 2015 21:13:01
Message-Id: 1422738897.97798a61840f7049f96132411acede5b0229f200.blueness@gentoo
1 commit: 97798a61840f7049f96132411acede5b0229f200
2 Author: Dagg <daggs <AT> gmx <DOT> com>
3 AuthorDate: Sat Jan 10 13:37:12 2015 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 31 21:14:57 2015 +0000
6 URL: http://sources.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=97798a61
7
8 sys-process/cronie: fix limits.h
9
10 ---
11 sys-process/cronie/cronie-1.4.12-r99.ebuild | 87 ++++++++++++++++++++++
12 .../files/0001-add_limits_h_and_MAXNAMLEN.patch | 15 ++++
13 sys-process/cronie/files/cronie-1.2-cron.deny | 5 ++
14 sys-process/cronie/files/cronie-1.3-crontab | 16 ++++
15 sys-process/cronie/files/cronie-1.3-initd | 14 ++++
16 sys-process/cronie/files/cronie-1.4.3-pamd | 9 +++
17 sys-process/cronie/metadata.xml | 20 +++++
18 7 files changed, 166 insertions(+)
19
20 diff --git a/sys-process/cronie/cronie-1.4.12-r99.ebuild b/sys-process/cronie/cronie-1.4.12-r99.ebuild
21 new file mode 100644
22 index 0000000..026029f
23 --- /dev/null
24 +++ b/sys-process/cronie/cronie-1.4.12-r99.ebuild
25 @@ -0,0 +1,87 @@
26 +# Copyright 1999-2014 Gentoo Foundation
27 +# Distributed under the terms of the GNU General Public License v2
28 +# $Header: /var/cvsroot/gentoo-x86/sys-process/cronie/cronie-1.4.12.ebuild,v 1.4 2014/12/30 17:42:09 maekke Exp $
29 +
30 +EAPI=5
31 +
32 +inherit cron eutils pam systemd user
33 +
34 +DESCRIPTION="Cronie is a standard UNIX daemon cron based on the original vixie-cron"
35 +SRC_URI="https://fedorahosted.org/releases/c/r/cronie/${P}.tar.gz"
36 +HOMEPAGE="https://fedorahosted.org/cronie/wiki"
37 +
38 +LICENSE="ISC BSD BSD-2 GPL-2"
39 +KEYWORDS="amd64 arm ~mips ppc x86"
40 +IUSE="anacron +inotify pam selinux"
41 +
42 +DEPEND="pam? ( virtual/pam )
43 + anacron? ( !sys-process/anacron )"
44 +RDEPEND="${DEPEND}"
45 +
46 +#cronie supports /etc/crontab
47 +CRON_SYSTEM_CRONTAB="yes"
48 +
49 +src_prepare() {
50 + epatch "${FILESDIR}"/0001-add_limits_h_and_MAXNAMLEN.patch
51 +}
52 +
53 +pkg_setup() {
54 + enewgroup crontab
55 +}
56 +
57 +src_configure() {
58 + SPOOL_DIR="/var/spool/cron/crontabs" \
59 + ANACRON_SPOOL_DIR="/var/spool/anacron" \
60 + econf \
61 + $(use_with inotify) \
62 + $(use_with pam) \
63 + $(use_with selinux) \
64 + $(use_enable anacron) \
65 + --enable-syscrontab \
66 + --with-daemon_username=cron \
67 + --with-daemon_groupname=cron
68 +}
69 +
70 +src_install() {
71 + emake install DESTDIR="${D}"
72 +
73 + docrondir -m 1730 -o root -g crontab
74 + fowners root:crontab /usr/bin/crontab
75 + fperms 2751 /usr/bin/crontab
76 +
77 + insinto /etc/conf.d
78 + newins "${S}"/crond.sysconfig ${PN}
79 +
80 + insinto /etc
81 + newins "${FILESDIR}/${PN}-1.3-crontab" crontab
82 + newins "${FILESDIR}/${PN}-1.2-cron.deny" cron.deny
83 +
84 + keepdir /etc/cron.d
85 + newinitd "${FILESDIR}/${PN}-1.3-initd" ${PN}
86 + newpamd "${FILESDIR}/${PN}-1.4.3-pamd" crond
87 +
88 + sed s:sysconfig/crond:conf.d/cronie: contrib/cronie.systemd \
89 + > "${T}"/cronie.service
90 + systemd_dounit "${T}"/cronie.service
91 +
92 + if use anacron ; then
93 + local anacrondir="/var/spool/anacron"
94 + keepdir ${anacrondir}
95 + fowners root:cron ${anacrondir}
96 + fperms 0750 ${anacrondir}
97 +
98 + insinto /etc
99 +
100 + doins contrib/anacrontab
101 +
102 + insinto /etc/cron.hourly
103 + doins contrib/0anacron
104 + fperms 0750 /etc/cron.hourly/0anacron
105 + fi
106 +
107 + dodoc AUTHORS README contrib/*
108 +}
109 +
110 +pkg_postinst() {
111 + cron_pkg_postinst
112 +}
113
114 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
115 new file mode 100644
116 index 0000000..fdf721b
117 --- /dev/null
118 +++ b/sys-process/cronie/files/0001-add_limits_h_and_MAXNAMLEN.patch
119 @@ -0,0 +1,15 @@
120 +--- src/database.c 2015-01-10 13:17:11.253148769 +0000
121 ++++ src/database.c 2015-01-10 13:18:45.491148769 +0000
122 +@@ -38,6 +38,12 @@
123 + #include <sys/stat.h>
124 + #include <sys/types.h>
125 + #include <unistd.h>
126 ++#if ! defined(__GLIBC__) && ! defined(__UCLIBC__)
127 ++#include <limits.h>
128 ++
129 ++/* match gnu to posix */
130 ++#define MAXNAMLEN NAME_MAX
131 ++#endif
132 +
133 + #ifdef WITH_INOTIFY
134 + # include <sys/inotify.h>
135
136 diff --git a/sys-process/cronie/files/cronie-1.2-cron.deny b/sys-process/cronie/files/cronie-1.2-cron.deny
137 new file mode 100644
138 index 0000000..f909922
139 --- /dev/null
140 +++ b/sys-process/cronie/files/cronie-1.2-cron.deny
141 @@ -0,0 +1,5 @@
142 +# $Id: cronie-1.2-cron.deny,v 1.1 2009/02/17 22:09:35 bangert Exp $
143 +# If for any reason you have users in the 'cron' group who should not
144 +# be allowed to run crontab, add them to this file (one username per
145 +# line)
146 +
147
148 diff --git a/sys-process/cronie/files/cronie-1.3-crontab b/sys-process/cronie/files/cronie-1.3-crontab
149 new file mode 100644
150 index 0000000..b14eeda
151 --- /dev/null
152 +++ b/sys-process/cronie/files/cronie-1.3-crontab
153 @@ -0,0 +1,16 @@
154 +# for cronie
155 +# $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 $
156 +
157 +# Global variables
158 +SHELL=/bin/bash
159 +PATH=/sbin:/bin:/usr/sbin:/usr/bin
160 +MAILTO=root
161 +HOME=/
162 +
163 +# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly
164 +# if anacron is not present
165 +59 * * * * root [ ! -x /etc/cron.hourly/0anacron ] && rm -f /var/spool/cron/lastrun/cron.hourly
166 +9 3 * * * root [ ! -x /etc/cron.hourly/0anacron ] && rm -f /var/spool/cron/lastrun/cron.daily
167 +19 4 * * 6 root [ ! -x /etc/cron.hourly/0anacron ] && rm -f /var/spool/cron/lastrun/cron.weekly
168 +29 5 1 * * root [ ! -x /etc/cron.hourly/0anacron ] && rm -f /var/spool/cron/lastrun/cron.monthly
169 +*/10 * * * * root [ ! -x /etc/cron.hourly/0anacron ] && { test -x /usr/sbin/run-crons && /usr/sbin/run-crons ; }
170
171 diff --git a/sys-process/cronie/files/cronie-1.3-initd b/sys-process/cronie/files/cronie-1.3-initd
172 new file mode 100644
173 index 0000000..138530f
174 --- /dev/null
175 +++ b/sys-process/cronie/files/cronie-1.3-initd
176 @@ -0,0 +1,14 @@
177 +#!/sbin/runscript
178 +# Copyright 1999-2014 Gentoo Foundation
179 +# Distributed under the terms of the GNU General Public License v2
180 +# $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 $
181 +
182 +command="/usr/sbin/crond"
183 +command_args="${CRONDARGS}"
184 +pidfile="/var/run/crond.pid"
185 +
186 +depend() {
187 + use clock logger
188 + need localmount
189 + provide cron
190 +}
191
192 diff --git a/sys-process/cronie/files/cronie-1.4.3-pamd b/sys-process/cronie/files/cronie-1.4.3-pamd
193 new file mode 100644
194 index 0000000..e82be8d
195 --- /dev/null
196 +++ b/sys-process/cronie/files/cronie-1.4.3-pamd
197 @@ -0,0 +1,9 @@
198 +#
199 +# The PAM configuration file for the cron daemon
200 +#
201 +#
202 +auth include system-auth
203 +account required pam_access.so
204 +account include system-auth
205 +session required pam_loginuid.so
206 +session include system-auth
207
208 diff --git a/sys-process/cronie/metadata.xml b/sys-process/cronie/metadata.xml
209 new file mode 100644
210 index 0000000..79ee246
211 --- /dev/null
212 +++ b/sys-process/cronie/metadata.xml
213 @@ -0,0 +1,20 @@
214 +<?xml version="1.0" encoding="UTF-8"?>
215 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
216 +<pkgmetadata>
217 +<herd>cron</herd>
218 +<maintainer>
219 + <email>polynomial-c@g.o</email>
220 + <name>Lars Wendler</name>
221 +</maintainer>
222 + <longdescription lang="en">
223 + Cronie contains the standard UNIX daemon crond that runs specified programs at
224 + scheduled times and related tools. It is based on the original cron and
225 + has security and configuration enhancements like the ability to use pam and
226 + SELinux.
227 + And why cronie? See http://www.urbandictionary.com/define.php?term=cronie
228 + </longdescription>
229 + <use>
230 + <flag name='anacron'>Install the periodic anacron command scheduler.</flag>
231 + <flag name='inotify'>Enable inotify filesystem monitoring support.</flag>
232 + </use>
233 +</pkgmetadata>