Skip to content

Commit

Permalink
fixed indimail-virtualdomains for gcc14
Browse files Browse the repository at this point in the history
  • Loading branch information
mbhangui committed Jan 20, 2025
1 parent a5eab0c commit 63a1b2a
Show file tree
Hide file tree
Showing 84 changed files with 205 additions and 222 deletions.
2 changes: 1 addition & 1 deletion indimail-x/GetSMTProute.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ get_smtp_qmtp_port(const char *file, const char *domain, int default_port)
}
}
len = str_len(domain);
substdio_fdbuf(&ssin, read, fd, inbuf, sizeof(inbuf));
substdio_fdbuf(&ssin, (ssize_t (*)(int, char *, size_t)) read, fd, inbuf, sizeof(inbuf));
for(;;) {
if (getln(&ssin, &line, &match, '\n') == -1) {
strerr_warn3("GetSMTProute: read: ", file, ": ", &strerr_sys);
Expand Down
4 changes: 2 additions & 2 deletions indimail-x/LoadBMF.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ LoadBMF(int *total, char *bmf)
in_mysql_free_result(res);
return ((char **) 0);
}
substdio_fdbuf(&ssout, write, fd, outbuf, sizeof(outbuf));
substdio_fdbuf(&ssout, (ssize_t (*)(int, char *, size_t)) write, fd, outbuf, sizeof(outbuf));
in_mysql_data_seek(res, 0);
for (;(row = in_mysql_fetch_row(res));) {
if (badmail_flag) {
Expand Down Expand Up @@ -436,7 +436,7 @@ LoadBMF_internal(int *total, char *bmf)
strerr_die3sys(111, "LoadBMF: open: ", badmailfrom.s, ": ");
return ((char **) 0);
}
substdio_fdbuf(&ssin, read, fd, inbuf, sizeof(inbuf));
substdio_fdbuf(&ssin, (ssize_t (*)(int, char *, size_t)) read, fd, inbuf, sizeof(inbuf));
for (count = 0;;count++) {
if (getln(&ssin, &line, &match, '\n') == -1) {
strerr_warn3("LoadBMF: read: ", badmailfrom.s, ": ", &strerr_sys);
Expand Down
14 changes: 7 additions & 7 deletions indimail-x/LoadDbInfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ writemcdinfo(DBINFO **rhostsptr, time_t mtime)
return (1);
if ((fd = open(mcdFile.s, O_CREAT|O_WRONLY, INDIMAIL_QMAIL_MODE)) == -1)
strerr_die3sys(111, "LoadDbInfo: open-write: ", mcdFile.s, ": ");
substdio_fdbuf(&ssout, write, fd, outbuf, sizeof(outbuf));
substdio_fdbuf(&ssout, (ssize_t (*)(int, char *, size_t)) write, fd, outbuf, sizeof(outbuf));
if (indimailuid == -1 || indimailgid == -1)
get_indimailuidgid(&indimailuid, &indimailgid);
uid = indimailuid;
Expand Down Expand Up @@ -559,7 +559,7 @@ loadMCDInfo(int *total)
else
return (localDbInfo(total, &relayhosts));
}
substdio_fdbuf(&ssin, read, fd, inbuf, sizeof(inbuf));
substdio_fdbuf(&ssin, (ssize_t (*)(int, char *, size_t)) read, fd, inbuf, sizeof(inbuf));
/*-
* get count of dbinfo records each
* dbinfo record has a 'server line
Expand Down Expand Up @@ -766,7 +766,7 @@ localDbInfo(int *total, DBINFO ***rhosts)
else
return ((DBINFO **) 0);
}
substdio_fdbuf(&ssin, read, fd, inbuf, sizeof(inbuf));
substdio_fdbuf(&ssin, (ssize_t (*)(int, char *, size_t)) read, fd, inbuf, sizeof(inbuf));
/*- +indimail.org-:indimail.org:508:508:/var/indimail/domains/indimail.org:-:: -*/
for (count = 0;;) {
if (getln(&ssin, &line, &match, '\n') == -1)
Expand Down Expand Up @@ -833,7 +833,7 @@ localDbInfo(int *total, DBINFO ***rhosts)
if ((mfd = open_read(host_path.s)) == -1)
strerr_die2sys(111, host_path.s, ": ");
else {
substdio_fdbuf(&ssin, read, mfd, inbuf, sizeof(inbuf));
substdio_fdbuf(&ssin, (ssize_t (*)(int, char *, size_t)) read, mfd, inbuf, sizeof(inbuf));
if (getln(&ssin, &line, &match, '\n') == -1)
strerr_die3sys(111, "read: ", host_path.s, ": ");
close(mfd);
Expand Down Expand Up @@ -900,7 +900,7 @@ localDbInfo(int *total, DBINFO ***rhosts)
* The new allocated becomes total + 1 plus 1 for the last NULL dbinfo structure
* The old total was total + 1 and the new total becomes total + 2
*/
alloc_re((char *) &relayhosts, sizeof(DBINFO *) * (*total + 1), sizeof(DBINFO *) * (*total + 2));
alloc_re((void *) &relayhosts, sizeof(DBINFO *) * (*total + 1), sizeof(DBINFO *) * (*total + 2));
rhostsptr = relayhosts + *total;
for (tmpPtr = rhostsptr;tmpPtr < relayhosts + *total + 2;tmpPtr++)
*tmpPtr = (DBINFO *) 0;
Expand Down Expand Up @@ -936,7 +936,7 @@ localDbInfo(int *total, DBINFO ***rhosts)
}
if (*total) { /*- non-empty mcdinfo file */
/*- +ve count indicates that we found domains in the assign file */
alloc_re((char *) &relayhosts, sizeof(DBINFO *) * *total, sizeof(DBINFO *) * (*total + count + 1));
alloc_re((void *) &relayhosts, sizeof(DBINFO *) * *total, sizeof(DBINFO *) * (*total + count + 1));
rhostsptr = relayhosts + *total;
for (tmpPtr = rhostsptr;tmpPtr < relayhosts + *total + count + 1;tmpPtr++)
*tmpPtr = (DBINFO *) 0;
Expand All @@ -950,7 +950,7 @@ localDbInfo(int *total, DBINFO ***rhosts)
}
if (!relayhosts)
die_nomem();
substdio_fdbuf(&ssin, read, fd, inbuf, sizeof(inbuf));
substdio_fdbuf(&ssin, (ssize_t (*)(int, char *, size_t)) read, fd, inbuf, sizeof(inbuf));
if (lseek(fd, 0, SEEK_SET) == -1)
strerr_die3sys(111, "LoadDbInfo: lseek: ", filename.s, ": ");
ssin.p = 0; /*- reset position to beginning of file */
Expand Down
27 changes: 12 additions & 15 deletions indimail-x/ProcessInFifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static void *element = 0;
char strnum[FMT_ULONG];
static int pwdCache; /*- for sighup to figure out if caching was selected on startup */
char *tcpserver;
void (*logfunc) ();
void (*logfunc) (const char *, const char *);

/*-
typedef struct
Expand Down Expand Up @@ -274,7 +274,7 @@ getTimeoutValues(int *readTimeout, int *writeTimeout, char *sysconfdir, char *co
if ((fd = open_read(tmpbuf.s)) == -1)
*readTimeout = 4;
else {
substdio_fdbuf(&ssin, read, fd, inbuf, sizeof(inbuf));
substdio_fdbuf(&ssin, (ssize_t (*)(int, char *, size_t)) read, fd, inbuf, sizeof(inbuf));
if (getln(&ssin, &line, &match, '\n') == -1)
*readTimeout = 4;
else {
Expand Down Expand Up @@ -307,7 +307,7 @@ getTimeoutValues(int *readTimeout, int *writeTimeout, char *sysconfdir, char *co
if ((fd = open_read(tmpbuf.s)) == -1)
*writeTimeout = 4;
else {
substdio_fdbuf(&ssin, read, fd, inbuf, sizeof(inbuf));
substdio_fdbuf(&ssin, (ssize_t (*)(int, char *, size_t)) read, fd, inbuf, sizeof(inbuf));
if (getln(&ssin, &line, &match, '\n') == -1)
*writeTimeout = 4;
else {
Expand Down Expand Up @@ -700,10 +700,7 @@ isig_term()
}
#else
static void
sig_hand(sig, code, scp, addr)
int sig, code;
struct sigcontext *scp;
char *addr;
sig_hand(int sig)
{
char *fifo_path;
long total_count;
Expand Down Expand Up @@ -850,7 +847,7 @@ sig_hand(sig, code, scp, addr)
close_db();
break;
} /*- switch (sig) */
signal(sig, (void(*)()) sig_hand);
signal(sig, (void(*)(int)) sig_hand);
errno = error_intr;
return;
}
Expand All @@ -868,7 +865,7 @@ ProcessInFifo(int instNum)
char *ptr, *fifoName, *fifo_path, *myFifo, *sysconfdir, *controldir,
*QueryBuf, *email, *remoteip, *local_ip, *cntrl_host;
const char *real_domain;
void (*pstat) () = NULL;
void (*pstat) (int) = NULL;
void *(*search_func) (const void *key, void *const *rootp, int (*compar)(const void *, const void *));
time_t prev_time = 0l;
substdio ssin;
Expand All @@ -887,11 +884,11 @@ ProcessInFifo(int instNum)
signal(SIGHUP, (void(*)()) isig_hup);
signal(SIGINT, (void(*)()) isig_int);
#else
signal(SIGTERM, (void(*)()) sig_hand);
signal(SIGUSR1, (void(*)()) sig_hand);
signal(SIGUSR2, (void(*)()) sig_hand);
signal(SIGHUP, (void(*)()) sig_hand);
signal(SIGINT, (void(*)()) sig_hand);
signal(SIGTERM, (void(*)(int)) sig_hand);
signal(SIGUSR1, (void(*)(int)) sig_hand);
signal(SIGUSR2, (void(*)(int)) sig_hand);
signal(SIGHUP, (void(*)(int)) sig_hand);
signal(SIGINT, (void(*)(int)) sig_hand);
#endif
}
logfunc = tcpserver ? errout : out;
Expand Down Expand Up @@ -1046,7 +1043,7 @@ ProcessInFifo(int instNum)
cntrl_host = 0;
line.len = 0;
} else {
substdio_fdbuf(&ssin, read, fd, inbuf, sizeof(inbuf));
substdio_fdbuf(&ssin, (ssize_t (*)(int, char *, size_t)) read, fd, inbuf, sizeof(inbuf));
if (getln(&ssin, &line, &match, '\n') == -1) {
strerr_warn3("InLookup: read: ", host_path.s, ": ", &strerr_sys);
close(fd);
Expand Down
6 changes: 3 additions & 3 deletions indimail-x/add_vacation.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ add_vacation(char *email, char *fname)
die_nomem();
if ((fd1 = open_trunc(tmpbuf.s)) == -1)
strerr_die3sys(111, "add_vacation: open_trunc: ", tmpbuf.s, ": ");
substdio_fdbuf(&ssout, write, fd1, outbuf, sizeof(outbuf));
substdio_fdbuf(&ssout, (ssize_t (*)(int, char *, size_t)) write, fd1, outbuf, sizeof(outbuf));
if (substdio_put(&ssout, "| ", 2) ||
substdio_puts(&ssout, PREFIX) ||
substdio_put(&ssout, "/bin/autoresponder -q ", 22) ||
Expand Down Expand Up @@ -191,8 +191,8 @@ add_vacation(char *email, char *fname)
unlink(tmpbuf.s);
return (1);
}
substdio_fdbuf(&ssin, read, fd1, inbuf, sizeof(inbuf));
substdio_fdbuf(&ssout, write, fd2, outbuf, sizeof(outbuf));
substdio_fdbuf(&ssin, (ssize_t (*)(int, char *, size_t)) read, fd1, inbuf, sizeof(inbuf));
substdio_fdbuf(&ssout, (ssize_t (*)(int, char *, size_t)) write, fd2, outbuf, sizeof(outbuf));
for (;;) {
if (getln(&ssin, &line, &match, '\n') == -1) {
strerr_warn3("add_vacation: read: ", fd1 ? fname : "stdin", ": ", &strerr_sys);
Expand Down
2 changes: 1 addition & 1 deletion indimail-x/adminCmmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ IOPlex(int sockfd, int timeoutdata)
int retval, retrycount, dataTimeout;
char *ptr;
char sockbuf[SOCKBUF + 1], strnum[FMT_ULONG];
void (*pstat) ();
void (*pstat) (int);

if ((pstat = signal(SIGPIPE, SIG_IGN)) == SIG_ERR)
return (-1);
Expand Down
2 changes: 1 addition & 1 deletion indimail-x/authindi.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ exec_local(char **argv, const char *userid, const char *TheDomain, struct passwd
if ((fd = open_read(ptr)) == -1)
strerr_warn4(FATAL, "open: ", ptr, ": ", &strerr_sys);
else {
substdio_fdbuf(&ssin, read, fd, inbuf, sizeof(inbuf));
substdio_fdbuf(&ssin, (ssize_t (*)(int, char *, size_t)) read, fd, inbuf, sizeof(inbuf));
for (;;) {
if (getln(&ssin, &line, &match, '\n') == -1) {
strerr_warn4(FATAL, "read: ", ptr, ": ", &strerr_sys);
Expand Down
2 changes: 1 addition & 1 deletion indimail-x/autoturn_dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ autoturn_dir(const char *domain)
die_nomem();
if ((fd = open_read(filename.s)) == -1)
return ((char *) 0);
substdio_fdbuf(&ssin, read, fd, inbuf, sizeof(inbuf));
substdio_fdbuf(&ssin, (ssize_t (*)(int, char *, size_t)) read, fd, inbuf, sizeof(inbuf));
for (;;) {
if (getln(&ssin, &line, &match, '\n') == -1)
strerr_die3sys(111, "autoturn_dir: read: ", filename.s, ": ");
Expand Down
2 changes: 1 addition & 1 deletion indimail-x/backfill.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ backfill(const char *username, const char *domain, const char *path, int operati
strerr_warn3("backfill: ", filename.s, ": ", &strerr_sys);
return ((char *) 0);
}
substdio_fdbuf(&ssin, read, fd, inbuf, sizeof(inbuf));
substdio_fdbuf(&ssin, (ssize_t (*)(int, char *, size_t)) read, fd, inbuf, sizeof(inbuf));
for (;;) {
if (getln(&ssin, &line, &match, '\n') == -1) {
strerr_warn3("backfill: read: ", filename.s, ": ", &strerr_sys);
Expand Down
14 changes: 7 additions & 7 deletions indimail-x/bulletin.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ insert_bulletin(char *domain, char *emailFile, char *list_file)
unlink(tmpbuf.s);
return (-1);
}
substdio_fdbuf(&ssout, write, wfd, outbuf, sizeof(outbuf));
substdio_fdbuf(&ssout, (ssize_t (*)(int, char *, size_t)) write, wfd, outbuf, sizeof(outbuf));
if ((rfd = open_read(list_file)) == -1) {
strerr_warn3("bulletin: open: ", list_file, ": ", &strerr_sys);
close(wfd);
unlink(tmpbuf.s);
return (-1);
}
substdio_fdbuf(&ssin, read, rfd, inbuf, sizeof(inbuf));
substdio_fdbuf(&ssin, (ssize_t (*)(int, char *, size_t)) read, rfd, inbuf, sizeof(inbuf));
for (;;) {
if (getln(&ssin, &line, &match, '\n') == -1) {
strerr_warn3("bulletin: read: ", list_file, ": ", &strerr_sys);
Expand Down Expand Up @@ -280,7 +280,7 @@ store_email(char *host, char *domain, char *email)
break;
}
if (!mdaptr || !(*mdaptr)) { /*- entry for new host */
if (!alloc_re((char *) &mdaHOSTS, mdacount * sizeof(struct mdahosts *), (mdacount + 1) * sizeof(struct mdahosts *)))
if (!alloc_re((void *) &mdaHOSTS, mdacount * sizeof(struct mdahosts *), (mdacount + 1) * sizeof(struct mdahosts *)))
die_nomem();
if (!(mdaHOSTS[mdacount] = (struct mdahosts *) alloc(sizeof(struct mdahosts))))
die_nomem();
Expand All @@ -302,7 +302,7 @@ store_email(char *host, char *domain, char *email)
mdacount++;
} else { /*- entry for existing host */
emailcount = (*mdaptr)->emailcount + 1;
if (!alloc_re((char *) &(*mdaptr)->emailptr, emailcount * sizeof(char *) , (emailcount + 1) * sizeof(char *)))
if (!alloc_re((void *) &(*mdaptr)->emailptr, emailcount * sizeof(char *) , (emailcount + 1) * sizeof(char *)))
die_nomem();
else
if (!((*mdaptr)->emailptr[emailcount - 1] = (char *) alloc(len = (str_len(email) + 1))))
Expand Down Expand Up @@ -332,7 +332,7 @@ bulletin(char *emailFile, char *subscriber_list)

if ((fd = open_read(subscriber_list)) == -1)
strerr_die3sys(111, "bulletin: open: ", subscriber_list, ": ");
substdio_fdbuf(&ssin, read, fd, inbuf, sizeof(inbuf));
substdio_fdbuf(&ssin, (ssize_t (*)(int, char *, size_t)) read, fd, inbuf, sizeof(inbuf));
for (err = 0;;) {
if (getln(&ssin, &line, &match, '\n') == -1) {
strerr_warn3("bulletin: read: ", subscriber_list, ": ", &strerr_sys);
Expand Down Expand Up @@ -405,7 +405,7 @@ bulletin(char *emailFile, char *subscriber_list)
strerr_die3sys(111, "bulletin: mkstemp: ", SplitFile.s, ": ");
if (chown(SplitFile.s, uid, gid) || chmod(SplitFile.s, INDIMAIL_QMAIL_MODE))
strerr_die3sys(111, "bulletin: chown/chmod: ", SplitFile.s, ": ");
substdio_fdbuf(&ssout, write, fdtmp, outbuf, sizeof(outbuf));
substdio_fdbuf(&ssout, (ssize_t (*)(int, char *, size_t)) write, fdtmp, outbuf, sizeof(outbuf));
for (; *emailptr; emailptr++) {
if (substdio_puts(&ssout, *emailptr) ||
substdio_put(&ssout, "\n", 1))
Expand Down Expand Up @@ -459,7 +459,7 @@ bulletin(char *emailFile, char *subscriber_list)
strerr_warn3("bulletin: open: ", emailFile, ": ", &strerr_sys);
return (-1);
}
substdio_fdbuf(&ssin, read, fd, inbuf, sizeof(inbuf));
substdio_fdbuf(&ssin, (ssize_t (*)(int, char *, size_t)) read, fd, inbuf, sizeof(inbuf));
for (;;) {
if (getln(&ssin, &line, &match, '\n') == -1) {
strerr_warn3("bulletin: read: ", emailFile, ": ", &strerr_sys);
Expand Down
2 changes: 1 addition & 1 deletion indimail-x/check_quota.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ mdir_t check_quota(char *Maildir)
#ifdef USE_MAILDIRQUOTA
if (total)
*total = 0;
substdio_fdbuf(&ssin, read, fd, inbuf, sizeof(inbuf));
substdio_fdbuf(&ssin, (ssize_t (*)(int, char *, size_t)) read, fd, inbuf, sizeof(inbuf));
for (mail_size = 0;;) {
if (getln(&ssin, &line, &match, '\n') == -1) {
strerr_warn3("check_quota: read: ", tmpbuf.s, ": ", &strerr_sys);
Expand Down
2 changes: 1 addition & 1 deletion indimail-x/count_rcpthosts.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ count_rcpthosts()
strerr_die3sys(111, "count_rcpthosts: open: ", filename.s, ": ");
return (0);
}
substdio_fdbuf(&ssin, read, fd, inbuf, sizeof(inbuf));
substdio_fdbuf(&ssin, (ssize_t (*)(int, char *, size_t)) read, fd, inbuf, sizeof(inbuf));
for (count = 0;;) {
if (getln(&ssin, &line, &match, '\n') == -1) {
strerr_warn3("count_rcpthosts: read: ", filename.s, ": ", &strerr_sys);
Expand Down
4 changes: 1 addition & 3 deletions indimail-x/crc.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,7 @@ usage(int exitval)
_exit(exitval);
}
int
main(argc, argv)
int argc;
char **argv;
main(int argc, char **argv)
{
int statflag = 0, displayhex = 1;
unsigned long linecount;
Expand Down
3 changes: 1 addition & 2 deletions indimail-x/dbinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ die_nomem()
}

static int
getch(ch)
char *ch;
getch(char *ch)
{
int r;

Expand Down
4 changes: 2 additions & 2 deletions indimail-x/deldomain.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ deldomain(const char *domain)
}
} else {
BasePath.len = 0;
substdio_fdbuf(&ssin, read, fd, inbuf, sizeof(inbuf));
substdio_fdbuf(&ssin, (ssize_t (*)(int, char *, size_t)) read, fd, inbuf, sizeof(inbuf));
if (getln(&ssin, &line, &match, '\n') == -1) {
strerr_warn3("deldomain: read: ", tmpbuf.s, ": ", &strerr_sys);
close(fd);
Expand Down Expand Up @@ -226,7 +226,7 @@ deldomain(const char *domain)
out("deldomain", "\n");
flush("deldomain");
}
substdio_fdbuf(&ssin, read, fd, inbuf, sizeof(inbuf));
substdio_fdbuf(&ssin, (ssize_t (*)(int, char *, size_t)) read, fd, inbuf, sizeof(inbuf));
for(;;) {
if (getln(&ssin, &line, &match, '\n') == -1) {
strerr_warn3("deldomain: read: ", tmpbuf.s, ": ", &strerr_sys);
Expand Down
Loading

0 comments on commit 63a1b2a

Please sign in to comment.