Skip to content

Commit

Permalink
fixed svcron for gcc14 (#2)
Browse files Browse the repository at this point in the history
* fixed svcron for gcc14

* updated RCS log, ChangeLog
  • Loading branch information
mbhangui authored Jan 22, 2025
1 parent de24b30 commit da0a006
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions do_command.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
*
Expand Down
2 changes: 2 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion svcron.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
7 changes: 5 additions & 2 deletions svcrontab.c
Original file line number Diff line number Diff line change
Expand Up @@ -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: "
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
*
Expand Down

0 comments on commit da0a006

Please sign in to comment.