From 715b276a8d0fa18e2ba4b45a5472ac81c8909c0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Poho=C5=99elsk=C3=BD?= Date: Wed, 14 May 2025 08:10:59 +0200 Subject: [PATCH] Move parsing code before separator check Related: RHEL-83153 --- cronie.spec | 4 +++- move_parsing_code.patch | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 move_parsing_code.patch diff --git a/cronie.spec b/cronie.spec index 62ec996..13af359 100644 --- a/cronie.spec +++ b/cronie.spec @@ -21,7 +21,9 @@ Patch: 0001-Do-not-leak-file-descriptors-in-backup_crontab.patch Patch: re-introduce-the-test-for-existence-of-file.patch # https://github.com/cronie-crond/cronie/pull/200 -Patch: fix-range-parsing.patch +# https://github.com/cronie-crond/cronie/pull/201 +Patch: fix-range-parsing.patch +Patch: move_parsing_code.patch Requires: dailyjobs diff --git a/move_parsing_code.patch b/move_parsing_code.patch new file mode 100644 index 0000000..abb83a0 --- /dev/null +++ b/move_parsing_code.patch @@ -0,0 +1,36 @@ +From e6c2853856c3103a4add4c3673b3306cc21d341e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Poho=C5=99elsk=C3=BD?= +Date: Wed, 7 May 2025 13:25:19 +0200 +Subject: [PATCH] get_range() move parsing code before separator check + +In the previous commit the parsing fix was added after a separator check +by accident, making it not execute properly. This commit moves it into the +right place. +--- + src/entry.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/entry.c b/src/entry.c +index 30bedb3..da1a02c 100644 +--- a/src/entry.c ++++ b/src/entry.c +@@ -638,13 +638,13 @@ get_range(bitstr_t * bits, int low, int high, const char *names[], + state = R_STEP; + break; + } ++ if (low_ > high_ && high_ == 0) { ++ high_ = 7; ++ } + if (is_separator(ch)) { + state = R_FINISH; + break; + } +- if (low_ > high_ && high_ == 0) { +- high_ = 7; +- } + return (EOF); + + case R_RANDOM: +-- +2.49.0 +