Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package cronie for openSUSE:Factory checked in at 2022-04-02 18:20:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/cronie (Old) and /work/SRC/openSUSE:Factory/.cronie.new.1900 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cronie" Sat Apr 2 18:20:36 2022 rev:84 rq:965744 version:unknown Changes: -------- --- /work/SRC/openSUSE:Factory/cronie/cronie.changes 2021-09-20 23:32:26.303120593 +0200 +++ /work/SRC/openSUSE:Factory/.cronie.new.1900/cronie.changes 2022-04-02 18:20:48.686092662 +0200 @@ -1,0 +2,18 @@ +Tue Mar 29 13:08:02 UTC 2022 - Danilo Spinella <danilo.spine...@suse.com> + +- Update to 1.6.0: + * Add switch -f for foreground mode + * Fix regression in handling */x crontab entries + * Add random within range '~' operator + * Fix RandomScale calculation + * crond: Fix description of '-P' option + * Increase the maximum number of crontab entries + * crontab: use bold colors +- Remove upstreamed patches: + * cronie-1.5.7-increase_crontab_limit.patch + * cronie-piddir.patch +- Refresh patches: + * cronie-nheader_lines.diff + * cronie-cron_pid.diff + +------------------------------------------------------------------- Old: ---- cronie-1.5.7-increase_crontab_limit.patch cronie-1.5.7.tar.gz cronie-piddir.patch New: ---- cronie-1.6.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cronie.spec ++++++ --- /var/tmp/diff_new_pack.SIWgTt/_old 2022-04-02 18:20:49.366085029 +0200 +++ /var/tmp/diff_new_pack.SIWgTt/_new 2022-04-02 18:20:49.370084984 +0200 @@ -1,7 +1,7 @@ # # spec file for package cronie # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -22,7 +22,7 @@ %define _fillupdir %{_localstatedir}/adm/fillup-templates %endif Name: cronie -Version: 1.5.7 +Version: 1.6.0 Release: 0 Summary: Cron Daemon License: BSD-3-Clause AND GPL-2.0-only AND MIT @@ -43,12 +43,9 @@ Patch4: cronie-nheader_lines.diff # we use cron.pid instead of crond.pid Patch5: cronie-crond_pid.diff -Patch12: cronie-piddir.patch # PATCH-FIX-SUSE the first occurance of "/etc/anacrontab" was replaced by "/etc/crontab" # in manpage file because the /etc/crontab is still used in SUSE. Patch13: fix-manpage-replace-anacrontab-with-crontab.patch -# PATCH-FIX-UPSTREAM Increase the maximum number of crontab entries bsc#1187508 -Patch14: cronie-1.5.7-increase_crontab_limit.patch BuildRequires: audit-devel BuildRequires: autoconf BuildRequires: automake @@ -106,9 +103,7 @@ %patch4 %patch5 -p1 cp %{SOURCE7} ./cron_to_cronie.README -%patch12 -p1 %patch13 -p1 -%patch14 -p1 %build # fill macro CRON_VERSION it is used in top three lines of crontab file,should be reworked ++++++ cronie-1.5.7.tar.gz -> cronie-1.6.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cronie-cronie-1.5.7/ChangeLog new/cronie-cronie-1.6.0/ChangeLog --- old/cronie-cronie-1.5.7/ChangeLog 2021-03-29 13:58:30.000000000 +0200 +++ new/cronie-cronie-1.6.0/ChangeLog 2022-03-22 14:54:01.000000000 +0100 @@ -1,3 +1,47 @@ +2022-03-22 w30023233 <wangyuhan...@huawei.com> + + * Add switch -f for foreground mode + +2022-03-22 Tomas Mraz <tm...@fedoraproject.org> + + * Fix regression in handling */x crontab entries + +2022-01-05 Tomas Mraz <tm...@fedoraproject.org> + + * get_number: Add missing NUL termination for the scanned string + +2021-11-08 Ond??ej Poho??elsk?? <35430604+opoho...@users.noreply.github.com> + + * Add random within range '~' operator + +2021-11-03 Nicolas Limare <nico...@limare.net> + + * Fix RandomScale calculation + +2021-10-27 sgerwk <sge...@aol.com> + + * include the case where runstate is undefined + +2021-10-26 sgerwk <sge...@aol.com> + + * use the configure runstatedir directory for pid file + +2021-09-02 Nils Philippsen <n...@tiptoe.de> + + * crond: Fix description of '-P' option + +2021-07-13 Danilo Spinella <danilo.spine...@suse.com> + + * Increase the maximum number of crontab entries + +2021-04-29 Jan Stan??k <jsta...@redhat.com> + + * Address issues found by coverity scan + +2021-03-29 Christian Hesse <m...@eworm.de> + + * crontab: use bold colors + 2021-03-29 Tomas Mraz <tm...@fedoraproject.org> * Release new version 1.5.7 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cronie-cronie-1.5.7/NEWS new/cronie-cronie-1.6.0/NEWS --- old/cronie-cronie-1.5.7/NEWS 2021-03-29 13:58:30.000000000 +0200 +++ new/cronie-cronie-1.6.0/NEWS 2022-03-22 14:54:01.000000000 +0100 @@ -1,5 +1,12 @@ cronie NEWS -- history of user-visible changes. +Release 1.6.0 + +* crond: Add switch -f as an alias for -n +* crond: Add random within range '~' operator +* crond: Use the configure runstatedir directory for pid file +* crond: Increase the maximum number of crontab entries to 10000 + Release 1.5.7 * anacron: Fix problem of anacron not being started on some desktops diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cronie-cronie-1.5.7/anacron/main.c new/cronie-cronie-1.6.0/anacron/main.c --- old/cronie-cronie-1.5.7/anacron/main.c 2021-03-29 13:58:30.000000000 +0200 +++ new/cronie-cronie-1.6.0/anacron/main.c 2022-03-22 14:54:01.000000000 +0100 @@ -44,8 +44,8 @@ int year, month, day_of_month; /* date anacron started */ char *program_name; -char *anacrontab; -char *spooldir; +char *anacrontab = NULL; +char *spooldir = NULL; int serialize, force, update_only, now, no_daemon, quiet, testing_only; /* command-line options */ char **job_args; /* vector of "job" command-line arguments */ @@ -128,12 +128,14 @@ quiet = 1; break; case 't': + free(anacrontab); anacrontab = strdup(optarg); break; case 'T': testing_only = 1; break; case 'S': + free(spooldir); spooldir = strdup(optarg); break; case 'V': @@ -208,9 +210,11 @@ /* stdin is already closed */ if (fclose(stdout)) die_e("Can't close stdout"); + /* coverity[leaked_handle] ??? fd 1 closed automatically */ xopen(1, "/dev/null", O_WRONLY); if (fclose(stderr)) die_e("Can't close stderr"); + /* coverity[leaked_handle] ??? fd 2 closed automatically */ xopen(2, "/dev/null", O_WRONLY); pid = xfork(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cronie-cronie-1.5.7/anacron/runjob.c new/cronie-cronie-1.6.0/anacron/runjob.c --- old/cronie-cronie-1.5.7/anacron/runjob.c 2021-03-29 13:58:30.000000000 +0200 +++ new/cronie-cronie-1.6.0/anacron/runjob.c 2022-03-22 14:54:01.000000000 +0100 @@ -237,7 +237,9 @@ xcloselog(); /* Ensure stdout/stderr are sane before exec-ing sendmail */ + /* coverity[leaked_handle] ??? STDOUT closed automatically */ xclose(STDOUT_FILENO); xopen(STDOUT_FILENO, "/dev/null", O_WRONLY); + /* coverity[leaked_handle] ??? STDERR closed automatically */ xclose(STDERR_FILENO); xopen(STDERR_FILENO, "/dev/null", O_WRONLY); xclose(jr->output_fd); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cronie-cronie-1.5.7/configure.ac new/cronie-cronie-1.6.0/configure.ac --- old/cronie-cronie-1.5.7/configure.ac 2021-03-29 13:58:30.000000000 +0200 +++ new/cronie-cronie-1.6.0/configure.ac 2022-03-22 14:54:01.000000000 +0100 @@ -1,4 +1,4 @@ -AC_INIT([cronie],[1.5.7]) +AC_INIT([cronie],[1.6.0]) AC_CONFIG_HEADERS([config.h]) AC_PREREQ([2.64]) @@ -266,6 +266,8 @@ CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/obstack" ]) +AM_CONDITIONAL(HAS_RUNSTATE, [test x$runstatedir != x]) + AC_CONFIG_FILES([Makefile]) AC_OUTPUT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cronie-cronie-1.5.7/cronie.spec new/cronie-cronie-1.6.0/cronie.spec --- old/cronie-cronie-1.5.7/cronie.spec 2021-03-29 13:58:30.000000000 +0200 +++ new/cronie-cronie-1.6.0/cronie.spec 2022-03-22 14:54:01.000000000 +0100 @@ -5,7 +5,7 @@ Summary: Cron daemon for executing programs at set times Name: cronie -Version: 1.5.7 +Version: 1.6.0 Release: 0packit%{?dist} License: MIT and BSD and ISC and GPLv2+ URL: https://github.com/cronie-crond/cronie @@ -209,7 +209,7 @@ %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/cron.d/dailyjobs %changelog -* Wed Mar 17 2021 Packit <pac...@packit.dev> - 1.5.7-0packit +* Tue Mar 22 2022 Packit <pac...@packit.dev> - 1.6.0-0packit - Packit build * Thu Oct 31 2019 Tom???? Mr??z <tm...@redhat.com> - 1.5.5-1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cronie-cronie-1.5.7/man/cron.8 new/cronie-cronie-1.6.0/man/cron.8 --- old/cronie-cronie-1.5.7/man/cron.8 2021-03-29 13:58:30.000000000 +0200 +++ new/cronie-cronie-1.6.0/man/cron.8 2022-03-22 14:54:01.000000000 +0100 @@ -169,6 +169,9 @@ .I pam_loginuid.so module. .TP +.B "\-f" +the same as -n, consistent with other crond implementations. +.TP .B "\-p" Allows .I Cron diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cronie-cronie-1.5.7/man/crontab.5 new/cronie-cronie-1.6.0/man/crontab.5 --- old/cronie-cronie-1.5.7/man/crontab.5 2021-03-29 13:58:30.000000000 +0200 +++ new/cronie-cronie-1.6.0/man/crontab.5 2022-03-22 14:54:01.000000000 +0100 @@ -205,6 +205,15 @@ an 'hours' entry specifies execution at hours 8, 9, 10, and 11. The first number must be less than or equal to the second one. .PP +Randomization of the execution time within a range can be used. +A random number within a range specified as two numbers separated with +a tilde is picked. The specified range is inclusive. +For example, 6~15 for a 'minutes' entry picks a random minute +within 6 to 15 range. The random number is picked when crontab file is parsed. +The first number must be less than or equal to the second one. You might omit +one or both of the numbers specifying the range. For example, ~ for a 'minutes' +entry picks a random minute within 0 to 59 range. +.PP Lists are allowed. A list is a set of numbers (or ranges) separated by commas. Examples: "1,2,5,9", "0-4,8-12". .PP diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cronie-cronie-1.5.7/readme.md new/cronie-cronie-1.6.0/readme.md --- old/cronie-cronie-1.5.7/readme.md 2021-03-29 13:58:30.000000000 +0200 +++ new/cronie-cronie-1.6.0/readme.md 2022-03-22 14:54:01.000000000 +0100 @@ -7,10 +7,17 @@ And why cronie? [http://www.urbandictionary.com/define.php?term=cronie] # Download -Latest released version is 1.5.7. +Latest released version is 1.6.0. User visible changes: +Release 1.6.0 + +- crond: Add switch -f as an alias for -n +- crond: Add random within range '~' operator +- crond: Use the configure runstatedir directory for pid file +- crond: Increase the maximum number of crontab entries to 10000 + Release 1.5.7 - anacron: Fix problem of anacron not being started on some desktops diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cronie-cronie-1.5.7/src/Makemodule.am new/cronie-cronie-1.6.0/src/Makemodule.am --- old/cronie-cronie-1.5.7/src/Makemodule.am 2021-03-29 13:58:30.000000000 +0200 +++ new/cronie-cronie-1.6.0/src/Makemodule.am 2022-03-22 14:54:01.000000000 +0100 @@ -61,6 +61,13 @@ # Depends on this Makefile, because it uses make variables. # CCD 2010/09/10 added CRON_HOSTNAME for clustered-cron. CLEANFILES += cron-paths.h +if HAS_RUNSTATE +cronpidcomment=/* directory of cron pid file */ +cronpiddir=\#define CRON_PID_DIR "$(runstatedir)" +else +cronpidcomment= +cronpiddir= +endif cron-paths.h: Makefile @echo 'creating $@' @sed >$@ 's/ *\\$$//' <<\END #\ @@ -96,6 +103,9 @@ #define CRON_ALLOW "$(sysconfdir)/cron.allow" \ #define CRON_DENY "$(sysconfdir)/cron.deny" \ \ + $(cronpidcomment) \ + $(cronpiddir) \ + \ /* 4.3BSD-style crontab f.e. /etc/crontab */ \ #define SYSCRONTAB "$(SYSCRONTAB)" \ \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cronie-cronie-1.5.7/src/cron.c new/cronie-cronie-1.6.0/src/cron.c --- old/cronie-cronie-1.5.7/src/cron.c 2021-03-29 13:58:30.000000000 +0200 +++ new/cronie-cronie-1.6.0/src/cron.c 2022-03-22 14:54:01.000000000 +0100 @@ -182,8 +182,10 @@ fprintf(stderr, " -i deamon runs without inotify support\n"); fprintf(stderr, " -m <comm> off, or specify preferred client for sending mails\n"); fprintf(stderr, " -n run in foreground\n"); + fprintf(stderr, " -f run in foreground, the same as -n\n"); fprintf(stderr, " -p permit any crontab\n"); - fprintf(stderr, " -P use PATH=\"%s\"\n", _PATH_DEFPATH); + fprintf(stderr, " -P inherit PATH from environment instead of using default value"); + fprintf(stderr, " of \"%s\"\n", _PATH_DEFPATH); fprintf(stderr, " -c enable clustering support\n"); fprintf(stderr, " -s log into syslog instead of sending mails\n"); fprintf(stderr, " -V print version and exit\n"); @@ -307,7 +309,7 @@ if (gettimeofday(&tv, &tz) != 0) tv.tv_usec = 0; srandom((unsigned int)(pid + tv.tv_usec)); - RandomScale = (double)random() / (double)RAND_MAX; + RandomScale = (double)random() / (double)(1lu << 31); snprintf(buf, sizeof(buf), "RANDOM_DELAY will be scaled with factor %d%% if used.", (int)(RandomScale*100)); log_it("CRON", pid, "INFO", buf, 0); @@ -689,13 +691,14 @@ static void parse_args(int argc, char *argv[]) { int argch; - while (-1 != (argch = getopt(argc, argv, "hnpsiPx:m:cV"))) { + while (-1 != (argch = getopt(argc, argv, "hnfpsiPx:m:cV"))) { switch (argch) { case 'x': if (!set_debug_flags(optarg)) usage(); break; case 'n': + case 'f': NoFork = 1; break; case 'p': diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cronie-cronie-1.5.7/src/crontab.c new/cronie-cronie-1.6.0/src/crontab.c --- old/cronie-cronie-1.5.7/src/crontab.c 2021-03-29 13:58:30.000000000 +0200 +++ new/cronie-cronie-1.6.0/src/crontab.c 2022-03-22 14:54:01.000000000 +0100 @@ -66,8 +66,8 @@ #define NHEADER_LINES 0 -#define COMMENT_COLOR "\x1B[34m" -#define ERROR_COLOR "\x1B[31m" +#define COMMENT_COLOR "\x1B[34;1m" +#define ERROR_COLOR "\x1B[31;1m" #define RESET_COLOR "\x1B[0m" enum opt_t { @@ -872,6 +872,7 @@ if ((error = check_syntax(tmp)) < 0) { fprintf(stderr, "Invalid crontab file, can't install.\n"); + fclose(tmp); goto done; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cronie-cronie-1.5.7/src/database.c new/cronie-cronie-1.6.0/src/database.c --- old/cronie-cronie-1.5.7/src/database.c 2021-03-29 13:58:30.000000000 +0200 +++ new/cronie-cronie-1.6.0/src/database.c 2022-03-22 14:54:01.000000000 +0100 @@ -559,7 +559,8 @@ if (not_a_crontab(dp)) continue; - strncpy(fname, dp->d_name, NAME_MAX + 1); + strncpy(fname, dp->d_name, NAME_MAX); + fname[NAME_MAX] = '\0'; if (!glue_strings(tabname, sizeof tabname, SPOOL_DIR, fname, '/')) continue; /* XXX log? */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cronie-cronie-1.5.7/src/entry.c new/cronie-cronie-1.6.0/src/entry.c --- old/cronie-cronie-1.5.7/src/entry.c 2021-03-29 13:58:30.000000000 +0200 +++ new/cronie-cronie-1.6.0/src/entry.c 2022-03-22 14:54:01.000000000 +0100 @@ -62,9 +62,22 @@ "out of memory" }; +typedef enum { + R_START, + R_AST, + R_STEP, + R_TERMS, + R_NUM1, + R_RANGE, + R_RANGE_NUM2, + R_RANDOM, + R_RANDOM_NUM2, + R_FINISH, +} range_state_t; + static int get_list(bitstr_t *, int, int, const char *[], int, FILE *), -get_range(bitstr_t *, int, int, const char *[], int, FILE *), -get_number(int *, int, const char *[], int, FILE *, const char *), +get_range(bitstr_t *, int, int, const char *[], FILE *), +get_number(int *, int, const char *[], FILE *), set_element(bitstr_t *, int, int, int); void free_entry(entry * e) { @@ -467,11 +480,14 @@ /* process all ranges */ done = FALSE; + /* unget ch to allow get_range() to process it properly + */ + unget_char(ch, file); while (!done) { - if (EOF == (ch = get_range(bits, low, high, names, ch, file))) + if (EOF == (ch = get_range(bits, low, high, names, file))) return (EOF); if (ch == ',') - ch = get_char(file); + continue; else done = TRUE; } @@ -486,144 +502,196 @@ return (ch); } +inline static int is_separator(int ch) { + switch (ch) { + case '\t': + case '\n': + case ' ': + case ',': + return 1; + default: + return 0; + } +} + + static int get_range(bitstr_t * bits, int low, int high, const char *names[], - int ch, FILE * file) { + FILE * file) { /* range = number | number "-" number [ "/" number ] + * | [number] "~" [number] */ + + int ch, i, num1, num2, num3; - int i, num1, num2, num3; - - Debug(DPARS | DEXT, ("get_range()...entering, exit won't show\n")); + /* default value for step + */ + num3 = 1; + range_state_t state = R_START; + + while (state != R_FINISH && ((ch = get_char(file)) != EOF)) { + switch (state) { + case R_START: + if (ch == '*') { + num1 = low; + num2 = high; + state = R_AST; + break; + } + if (ch == '~') { + num1 = low; + state = R_RANDOM; + break; + } + unget_char(ch, file); + if (get_number(&num1, low, names, file) != EOF) { + state = R_NUM1; + break; + } + return (EOF); - if (ch == '*') { - /* '*' means "first-last" but can still be modified by /step - */ - num1 = low; - num2 = high; - ch = get_char(file); - if (ch == EOF) - return (EOF); - } - else { - ch = get_number(&num1, low, names, ch, file, ",- \t\n"); - if (ch == EOF) - return (EOF); + case R_AST: + if (ch == '/') { + state = R_STEP; + break; + } + if (is_separator(ch)) { + state = R_FINISH; + break; + } + return (EOF); - if (ch != '-') { - /* not a range, it's a single number. - */ - if (EOF == set_element(bits, low, high, num1)) { + case R_STEP: unget_char(ch, file); + if (get_number(&num3, 0, PPC_NULL, file) != EOF + && num3 != 0) { + state = R_TERMS; + break; + } return (EOF); - } - return (ch); - } - else { - /* eat the dash - */ - ch = get_char(file); - if (ch == EOF) + + case R_TERMS: + if (is_separator(ch)) { + state = R_FINISH; + break; + } return (EOF); - /* get the number following the dash - */ - ch = get_number(&num2, low, names, ch, file, "/, \t\n"); - if (ch == EOF || num1 > num2) + case R_NUM1: + if (ch == '-') { + state = R_RANGE; + break; + } + if (ch == '~') { + state = R_RANDOM; + break; + } + if (is_separator(ch)) { + num2 = num1; + state = R_FINISH; + break; + } return (EOF); - } - } - /* check for step size - */ - if (ch == '/') { - /* eat the slash - */ - ch = get_char(file); - if (ch == EOF) - return (EOF); + case R_RANGE: + if (get_number(&num2, low, names, file) != EOF) { + state = R_RANGE_NUM2; + break; + } + return (EOF); - /* get the step size -- note: we don't pass the - * names here, because the number is not an - * element id, it's a step size. 'low' is - * sent as a 0 since there is no offset either. - */ - ch = get_number(&num3, 0, PPC_NULL, ch, file, ", \t\n"); - if (ch == EOF || num3 == 0) - return (EOF); - } - else { - /* no step. default==1. - */ - num3 = 1; - } + case R_RANGE_NUM2: + if (ch == '/') { + state = R_STEP; + break; + } + if (is_separator(ch)) { + state = R_FINISH; + break; + } + return (EOF); - /* num1 (through i) will be validated by set_element() below, but num2 - * and num3 are merely used as loop condition and increment, and must - * be validated separately. - */ - if (num2 < low || num2 > high || num3 > high) + case R_RANDOM: + if (is_separator(ch)) { + num2 = high; + state = R_FINISH; + } + else if (unget_char(ch, file), + get_number(&num2, low, names, file) != EOF) { + state = R_TERMS; + } + /* fail if couldn't find match on previous term + */ + else + return (EOF); + + /* if invalid random range was selected */ + if (num1 > num2) + return (EOF); + + /* select random number in range <num1, num2> + */ + num1 = num2 = random() % (num2 - num1 + 1) + num1; + break; + + + default: + /* We should never get here + */ + return (EOF); + } + } + if (state != R_FINISH || ch == EOF) return (EOF); - /* range. set all elements from num1 to num2, stepping - * by num3. (the step is a downward-compatible extension - * proposed conceptually by bob@acornrc, syntactically - * designed then implemented by paul vixie). - */ for (i = num1; i <= num2; i += num3) if (EOF == set_element(bits, low, high, i)) { unget_char(ch, file); return (EOF); } - - return (ch); + return ch; } static int -get_number(int *numptr, int low, const char *names[], int ch, FILE * file, - const char *terms) { +get_number(int *numptr, int low, const char *names[], FILE * file) { char temp[MAX_TEMPSTR], *pc; - int len, i; + int len, i, ch; + char *endptr; pc = temp; len = 0; - /* first look for a number */ - while (isdigit((unsigned char) ch)) { + /* get all alnum characters available */ + while (isalnum((ch = get_char(file)))) { if (++len >= MAX_TEMPSTR) goto bad; *pc++ = (char)ch; - ch = get_char(file); } *pc = '\0'; - if (len != 0) { - /* got a number, check for valid terminator */ - if (!strchr(terms, ch)) - goto bad; - *numptr = atoi(temp); - return (ch); + if (len == 0) + goto bad; + + unget_char(ch, file); + + /* try to get number */ + *numptr = (int) strtol(temp, &endptr, 10); + if (*endptr == '\0' && temp != endptr) { + /* We have a number */ + return 0; } /* no numbers, look for a string if we have any */ if (names) { - while (isalpha((unsigned char) ch)) { - if (++len >= MAX_TEMPSTR) - goto bad; - *pc++ = (char)ch; - ch = get_char(file); - } - *pc = '\0'; - if (len != 0 && strchr(terms, ch)) { - for (i = 0; names[i] != NULL; i++) { - Debug(DPARS | DEXT, - ("get_num, compare(%s,%s)\n", names[i], temp)); - if (!strcasecmp(names[i], temp)) { - *numptr = i + low; - return (ch); - } + for (i = 0; names[i] != NULL; i++) { + Debug(DPARS | DEXT, ("get_num, compare(%s,%s)\n", names[i], temp)); + if (strcasecmp(names[i], temp) == 0) { + *numptr = i + low; + return 0; } } + } else { + goto bad; } bad: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cronie-cronie-1.5.7/src/macros.h new/cronie-cronie-1.6.0/src/macros.h --- old/cronie-cronie-1.5.7/src/macros.h 2021-03-29 13:58:30.000000000 +0200 +++ new/cronie-cronie-1.6.0/src/macros.h 2022-03-22 14:54:01.000000000 +0100 @@ -59,7 +59,7 @@ #define ROOT_UID 0 /* don't change this, it really must be root */ #define ROOT_USER "root" /* ditto */ #define MAX_USER_ENVS 1000 /* maximum environment variables in user's crontab */ -#define MAX_USER_ENTRIES 1000 /* maximum crontab entries in user's crontab */ +#define MAX_USER_ENTRIES 10000 /* maximum crontab entries in user's crontab */ #define MAX_GARBAGE 32768 /* max num of chars of comments and whitespaces between entries */ #define MAX_CLOSE_FD 10000 /* max fd num to close when spawning a child process */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cronie-cronie-1.5.7/src/pathnames.h new/cronie-cronie-1.6.0/src/pathnames.h --- old/cronie-cronie-1.5.7/src/pathnames.h 2021-03-29 13:58:30.000000000 +0200 +++ new/cronie-cronie-1.6.0/src/pathnames.h 2022-03-22 14:54:01.000000000 +0100 @@ -36,10 +36,14 @@ * PIDDIR must end in '/'. * (Don't ask why the default is "/etc/".) */ -#ifdef _PATH_VARRUN -# define PIDDIR _PATH_VARRUN +#ifdef CRON_PID_DIR +# define PIDDIR CRON_PID_DIR "/" #else -# define PIDDIR SYSCONFDIR "/" +# ifdef _PATH_VARRUN +# define PIDDIR _PATH_VARRUN +# else +# define PIDDIR SYSCONFDIR "/" +# endif #endif #define PIDFILE "crond.pid" #define _PATH_CRON_PID PIDDIR PIDFILE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cronie-cronie-1.5.7/src/pw_dup.c new/cronie-cronie-1.6.0/src/pw_dup.c --- old/cronie-cronie-1.5.7/src/pw_dup.c 2021-03-29 13:58:30.000000000 +0200 +++ new/cronie-cronie-1.6.0/src/pw_dup.c 2022-03-22 14:54:01.000000000 +0100 @@ -121,6 +121,7 @@ cp += ssize; } + /* cppcheck-suppress[memleak symbolName=cp] memory originally pointed to by cp returned via newpw */ return (newpw); } ++++++ cronie-crond_pid.diff ++++++ --- /var/tmp/diff_new_pack.SIWgTt/_old 2022-04-02 18:20:49.478083772 +0200 +++ /var/tmp/diff_new_pack.SIWgTt/_new 2022-04-02 18:20:49.482083727 +0200 @@ -3,8 +3,8 @@ --- cronie-1.4.4.orig/src/pathnames.h +++ cronie-1.4.4/src/pathnames.h @@ -41,7 +41,7 @@ - #else - # define PIDDIR SYSCONFDIR "/" + # define PIDDIR SYSCONFDIR "/" + # endif #endif -#define PIDFILE "crond.pid" +#define PIDFILE "cron.pid" ++++++ cronie-nheader_lines.diff ++++++ --- /var/tmp/diff_new_pack.SIWgTt/_old 2022-04-02 18:20:49.490083638 +0200 +++ /var/tmp/diff_new_pack.SIWgTt/_new 2022-04-02 18:20:49.494083593 +0200 @@ -9,8 +9,8 @@ -#define NHEADER_LINES 0 +#define NHEADER_LINES 3 - #define COMMENT_COLOR "\x1B[34m" - #define ERROR_COLOR "\x1B[31m" + #define COMMENT_COLOR "\x1B[34;1m" + #define ERROR_COLOR "\x1B[31;1m" @@ -418,7 +418,7 @@ static void parse_args(int argc, char *a static void list_cmd(void) { char n[MAX_FNAME];