new upstream release 1.5.2

This commit is contained in:
Tomas Mraz 2018-05-03 19:06:15 +02:00
parent 27b8ae70a1
commit 8c79b167a4
6 changed files with 10 additions and 160 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/cronie-1.5.0.tar.gz
/cronie-1.5.1.tar.gz
/cronie-1.5.2.tar.gz

View File

@ -1,73 +0,0 @@
commit 1222a0d414c52214e1ecc023889595945496acbb
Author: Tomas Mraz <tmraz@fedoraproject.org>
Date: Mon Jul 13 11:19:55 2015 +0200
In crontab command use a temporary filename that is ignored by crond.
diff --git a/src/crontab.c b/src/crontab.c
index d165a06..e7a4878 100644
--- a/src/crontab.c
+++ b/src/crontab.c
@@ -104,7 +104,7 @@ edit_cmd(void),
poke_daemon(void),
check_error(const char *), parse_args(int c, char *v[]), die(int) ATTRIBUTE_NORETURN;
static int replace_cmd(void), hostset_cmd(void), hostget_cmd(void);
-static char *host_specific_filename(const char *filename, int prefix);
+static char *host_specific_filename(const char *prefix, const char *suffix);
static const char *tmp_path(void);
static void usage(const char *msg) ATTRIBUTE_NORETURN;
@@ -445,26 +445,27 @@ static const char *tmp_path(void) {
return tmpdir ? tmpdir : "/tmp";
}
-static char *host_specific_filename(const char *filename, int prefix)
+static char *host_specific_filename(const char *prefix, const char *suffix)
{
/*
* For cluster-wide use, where there is otherwise risk of the same
- * name being generated on more than one host at once, prefix with
- * "hostname." or suffix with ".hostname" as requested, and return
- * static buffer or NULL on failure.
+ * name being generated on more than one host at once, insert hostname
+ * separated with dots, and return static buffer or NULL on failure.
*/
static char safename[MAX_FNAME];
- char hostname[MAXHOSTNAMELEN];
+ char hostname[MAX_FNAME];
if (gethostname(hostname, sizeof hostname) != 0)
return NULL;
if (prefix) {
- if (!glue_strings(safename, sizeof safename, hostname, filename, '.'))
+ if (!glue_strings(safename, sizeof safename, prefix, hostname, '.'))
return NULL;
- } else {
- if (!glue_strings(safename, sizeof safename, filename, hostname, '.'))
+ strcpy(hostname, safename);
+ }
+ if (suffix) {
+ if (!glue_strings(safename, sizeof safename, hostname, suffix, '.'))
return NULL;
}
@@ -745,7 +746,7 @@ static int replace_cmd(void) {
char *safename;
- safename = host_specific_filename("tmp.XXXXXXXXXX", 1);
+ safename = host_specific_filename("#tmp", "XXXXXXXXXX");
if (!safename || !glue_strings(TempFilename, sizeof TempFilename, SPOOL_DIR,
safename, '/')) {
TempFilename[0] = '\0';
@@ -911,7 +912,7 @@ static int hostset_cmd(void) {
if (!HostSpecified)
gethostname(Host, sizeof Host);
- safename = host_specific_filename("tmp.XXXXXXXXXX", 1);
+ safename = host_specific_filename("#tmp", "XXXXXXXXXX");
if (!safename || !glue_strings(TempFilename, sizeof TempFilename, SPOOL_DIR,
safename, '/')) {
TempFilename[0] = '\0';

View File

@ -1,33 +0,0 @@
diff -up cronie-1.5.1/contrib/0anacron.power cronie-1.5.1/contrib/0anacron
--- cronie-1.5.1/contrib/0anacron.power 2013-01-17 14:04:09.000000000 +0100
+++ cronie-1.5.1/contrib/0anacron 2016-09-05 10:53:50.000000000 +0200
@@ -4,14 +4,24 @@ if test -r /var/spool/anacron/cron.daily
day=`cat /var/spool/anacron/cron.daily`
fi
if [ `date +%Y%m%d` = "$day" ]; then
- exit 0;
+ exit 0
fi
# Do not run jobs when on battery power
-if test -x /usr/bin/on_ac_power; then
- /usr/bin/on_ac_power >/dev/null 2>&1
- if test $? -eq 1; then
- exit 0
+online=1
+for psupply in AC ADP0 ; do
+ sysfile="/sys/class/power_supply/$psupply/online"
+
+ if [ -f $sysfile ] ; then
+ if [ `cat $sysfile 2>/dev/null`x = 1x ]; then
+ online=1
+ break
+ else
+ online=0
+ fi
fi
+done
+if [ $online = 0 ]; then
+ exit 0
fi
/usr/sbin/anacron -s

View File

@ -1,45 +0,0 @@
diff -up cronie-1.5.1/anacron/main.c.y2038 cronie-1.5.1/anacron/main.c
--- cronie-1.5.1/anacron/main.c.y2038 2016-05-13 14:39:45.000000000 +0200
+++ cronie-1.5.1/anacron/main.c 2017-05-04 16:44:06.511862226 +0200
@@ -371,17 +371,17 @@ record_start_time(void)
year, month, day_of_month);
}
-static int
+static unsigned int
time_till(job_rec *jr)
/* Return the number of seconds that we have to wait until it's time
* to start job jr.
*/
{
- unsigned int tj, tn;
+ time_t tj, tn;
if (now) return 0;
tn = time(NULL);
- tj = start_sec + jr->delay * 60;
+ tj = start_sec + (time_t)jr->delay * 60;
if (tj < tn) return 0;
if (tj - tn > 3600*24)
{
@@ -389,7 +389,7 @@ time_till(job_rec *jr)
jr->ident);
return 0;
}
- return tj - tn;
+ return (unsigned int)(tj - tn);
}
static void
diff -up cronie-1.5.1/src/cron.c.y2038 cronie-1.5.1/src/cron.c
--- cronie-1.5.1/src/cron.c.y2038 2015-02-05 16:29:17.000000000 +0100
+++ cronie-1.5.1/src/cron.c 2017-05-04 16:41:46.652390903 +0200
@@ -563,7 +563,7 @@ static void find_jobs(int vtime, cron_db
*/
for (u = db->head; u != NULL; u = u->next) {
for (e = u->crontab; e != NULL; e = e->next) {
- time_t virtualSecond = (vtime - e->delay) * SECONDS_PER_MINUTE;
+ time_t virtualSecond = (time_t)(vtime - e->delay) * (time_t)SECONDS_PER_MINUTE;
time_t virtualGMTSecond = virtualSecond - vGMToff;
job_tz = env_get("CRON_TZ", e->envp);
maketime(job_tz, orig_tz);

View File

@ -5,16 +5,13 @@
Summary: Cron daemon for executing programs at set times
Name: cronie
Version: 1.5.1
Release: 9%{?dist}
Version: 1.5.2
Release: 1%{?dist}
License: MIT and BSD and ISC and GPLv2+
Group: System Environment/Base
URL: https://github.com/cronie-crond/cronie
Source0: https://github.com/cronie-crond/cronie/releases/download/cronie-%{version}/cronie-%{version}.tar.gz
Patch1: cronie-1.5.1-power.patch
Patch2: cronie-1.5.1-y2038.patch
Requires: dailyjobs
%if %{with selinux}
@ -79,8 +76,6 @@ extra features.
%prep
%setup -q
%patch1 -p1 -b .power
%patch2 -p1 -b .y2038
%build
%configure \
@ -100,7 +95,7 @@ extra features.
--enable-pie \
--enable-relro
make %{?_smp_mflags}
make %{?_smp_mflags} V=2
%install
make install DESTDIR=$RPM_BUILD_ROOT DESTMAN=$RPM_BUILD_ROOT%{_mandir}
@ -178,10 +173,12 @@ exit 0
%license COPYING
%attr(755,root,root) %{_sbindir}/crond
%attr(4755,root,root) %{_bindir}/crontab
%attr(755,root,root) %{_bindir}/cronnext
%{_mandir}/man8/crond.*
%{_mandir}/man8/cron.*
%{_mandir}/man5/crontab.*
%{_mandir}/man1/crontab.*
%{_mandir}/man1/cronnext.*
%dir %{_localstatedir}/spool/cron
%dir %{_sysconfdir}/cron.d
%if %{with pam}
@ -207,6 +204,9 @@ exit 0
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/cron.d/dailyjobs
%changelog
* Thu May 3 2018 Tomáš Mráz <tmraz@redhat.com> - 1.5.2-1
- new upstream release 1.5.2
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

View File

@ -1 +1 @@
910e6effcc032998b0a49fbd46322e18 cronie-1.5.1.tar.gz
SHA512 (cronie-1.5.2.tar.gz) = e306b4b8388bff0181ca4b3f15b81c0881d727b0f502c28204e8325359c49baeb1b1a4a5751ffc11eb5ebdeefe42704b77f6727f029c60c99c70b9885f6b4d18