From 0ccb43611f5c44c32538b8d7621f6d48846847d4 Mon Sep 17 00:00:00 2001 From: Manvendra Bhangui Date: Tue, 21 Jan 2025 16:03:56 +0530 Subject: [PATCH 1/2] fixed svcron for gcc14 --- configure.ac | 2 +- do_command.c | 4 ++-- svcron.spec.in | 2 +- svcrontab.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 8cd0f33..1a32e00 100644 --- a/configure.ac +++ b/configure.ac @@ -13,7 +13,7 @@ AC_PROG_CC AC_PROG_INSTALL # Checks for header files. -AC_CHECK_HEADERS([fcntl.h paths.h sys/file.h sys/param.h sys/time.h syslog.h unistd.h utime.h]) +AC_CHECK_HEADERS([fcntl.h paths.h stdarg.h sys/file.h sys/param.h sys/time.h syslog.h unistd.h utime.h]) # Checks for typedefs, structures, and compiler characteristics. AC_CHECK_HEADER_STDBOOL diff --git a/do_command.c b/do_command.c index d91bb26..5fea4aa 100644 --- a/do_command.c +++ b/do_command.c @@ -397,7 +397,7 @@ child_process(entry *e, const user *u) * are part of its reference count now. */ close(stdout_pipe[READ_PIPE]); - substdio_fdbuf(&ssout, write, stdin_pipe[WRITE_PIPE], ssoutbuf, sizeof(ssoutbuf)); + substdio_fdbuf(&ssout, (ssize_t (*)(int, char *, size_t)) write, stdin_pipe[WRITE_PIPE], ssoutbuf, sizeof(ssoutbuf)); /* * translation: @@ -456,7 +456,7 @@ child_process(entry *e, const user *u) char ch; int c; - substdio_fdbuf(&ssin, read, stdout_pipe[READ_PIPE], ssinbuf, sizeof(ssinbuf)); + substdio_fdbuf(&ssin, (ssize_t (*)(int, char *, size_t)) read, stdout_pipe[READ_PIPE], ssinbuf, sizeof(ssinbuf)); c = substdio_get(&ssin, &ch, 1); if (c == 1) { diff --git a/svcron.spec.in b/svcron.spec.in index 6a28dcf..26db0db 100644 --- a/svcron.spec.in +++ b/svcron.spec.in @@ -52,7 +52,7 @@ package contains Paul Vixie's implementation of cron %{__mkdir_p} m4 aclocal -I m4 autoreconf -fis -%configure --prefix=%{_prefix} \ +%configure --prefix=%{_prefix} --sbindir=%{_prefix}/sbin \ --enable-crondir=%{_sysconfdir}/indimail/cron \ --enable-spooldir=crontabs \ --enable-syscrondir=%{_sysconfdir}/indimail/cron.d \ diff --git a/svcrontab.c b/svcrontab.c index 8e04224..6a46b4b 100644 --- a/svcrontab.c +++ b/svcrontab.c @@ -389,7 +389,7 @@ edit_cmd(void) again: rewind(NewCrontab); if (ferror(NewCrontab)) { - subprintf(subfderr, "%s: error while writing new crontab to %s: %s\n", ProgramName, Filename, strerror(errno)); + subprintf(subfderr, "%s: error while writing new crontab to %s: %s\n", ProgramName, Filename.s, strerror(errno)); substdio_flush(subfderr); fatal: unlink(Filename.s); From 796b9c53b42f546f415ba913ce675be0b290d8d7 Mon Sep 17 00:00:00 2001 From: Manvendra Bhangui Date: Wed, 22 Jan 2025 17:58:47 +0530 Subject: [PATCH 2/2] updated RCS log, ChangeLog --- do_command.c | 5 ++++- doc/ChangeLog | 2 ++ svcrontab.c | 5 ++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/do_command.c b/do_command.c index 5fea4aa..e6b168f 100644 --- a/do_command.c +++ b/do_command.c @@ -28,7 +28,7 @@ #define WARN "svcron: warn: " #if !defined(lint) && !defined(LINT) -static char rcsid[] = "$Id: do_command.c,v 1.2 2024-06-23 23:49:38+05:30 Cprogrammer Exp mbhangui $"; +static char rcsid[] = "$Id: do_command.c,v 1.3 2025-01-22 17:57:24+05:30 Cprogrammer Exp mbhangui $"; #endif static void child_process(entry *, const user *); @@ -625,6 +625,9 @@ getversion_do_command_c() /*- * $Log: do_command.c,v $ + * Revision 1.3 2025-01-22 17:57:24+05:30 Cprogrammer + * fixes for gcc14 errors + * * Revision 1.2 2024-06-23 23:49:38+05:30 Cprogrammer * refactored child handling * diff --git a/doc/ChangeLog b/doc/ChangeLog index f5dd612..daaa93d 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -12,3 +12,5 @@ Release @version@-@release@ Start 04/06/2024 End XX/XX/XXXX 6. entry.c: Fix CVE-2024-43688, buffer underflow for very large step values - 13/09/2024 7. misc.c: fixed extra null character getting into log +- 22/01/2025 +8. fix gcc14 errors diff --git a/svcrontab.c b/svcrontab.c index 6a46b4b..111560d 100644 --- a/svcrontab.c +++ b/svcrontab.c @@ -32,7 +32,7 @@ #include "cron.h" #if !defined(lint) && !defined(LINT) -static char rcsid[] = "$Id: svcrontab.c,v 1.1 2024-06-09 01:04:28+05:30 Cprogrammer Exp mbhangui $"; +static char rcsid[] = "$Id: svcrontab.c,v 1.2 2025-01-22 17:57:44+05:30 Cprogrammer Exp mbhangui $"; #endif #define FATAL "svcrontab: fatal: " @@ -685,6 +685,9 @@ getversion_crontab_c() /*- * $Log: svcrontab.c,v $ + * Revision 1.2 2025-01-22 17:57:44+05:30 Cprogrammer + * fix argument to subprintf + * * Revision 1.1 2024-06-09 01:04:28+05:30 Cprogrammer * Initial revision *