Skip to content

Commit

Permalink
Merge pull request #3 from sagredo-dev/compilation-warnings
Browse files Browse the repository at this point in the history
fixed several compilation warnings
  • Loading branch information
sagredo-dev authored Feb 11, 2024
2 parents 2550509 + 5406e56 commit 2e0095b
Show file tree
Hide file tree
Showing 77 changed files with 234 additions and 594 deletions.
445 changes: 0 additions & 445 deletions FILES

This file was deleted.

85 changes: 2 additions & 83 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ compile chkuser.c chkuser.h chkuser_settings.h

clean: \
TARGETS
rm -f `cat TARGETS`
rm -f `grep -v '^#' TARGETS`

coe.o: \
compile coe.c coe.h
Expand Down Expand Up @@ -1573,7 +1573,7 @@ exit.h
./compile qmail-qread.c

qmail-qstat: \
warn-auto.sh qmail-qstat.sh conf-qmail conf-break conf-split
warn-auto.sh qmail-qstat.sh conf-qmail
cat warn-auto.sh qmail-qstat.sh \
| sed s}QMAIL}"`head -1 conf-qmail`"}g \
| sed s}BREAK}"`head -1 conf-break`"}g \
Expand Down Expand Up @@ -1950,87 +1950,6 @@ compile sgetopt.c substdio.h subfd.h substdio.h sgetopt.h subgetopt.h \
subgetopt.h
./compile sgetopt.c

shar: \
FILES BLURB BLURB2 BLURB3 BLURB4 README FAQ INSTALL INSTALL.alias \
INSTALL.ctl INSTALL.ids INSTALL.maildir INSTALL.mbox INSTALL.vsm \
REMOVE.sendmail REMOVE.binmail TEST.deliver TEST.receive UPGRADE \
THOUGHTS TODO THANKS CHANGES SECURITY INTERNALS SENDMAIL \
PIC.local2alias PIC.local2ext PIC.local2local PIC.local2rem \
PIC.local2virt PIC.nullclient PIC.relaybad PIC.relaygood \
PIC.rem2local FILES VERSION SYSDEPS TARGETS Makefile BIN.README \
BIN.Makefile BIN.setup idedit.c conf-break auto_break.h conf-spawn \
auto_spawn.h chkspawn.c conf-split auto_split.h conf-patrn \
auto_patrn.h conf-users conf-groups auto_uids.h auto_usera.h extra.h \
addresses.5 except.1 bouncesaying.1 condredirect.1 dot-qmail.9 \
envelopes.5 forgeries.7 forward.1 maildir2mbox.1 maildirmake.1 \
maildirwatch.1 mailsubj.1 mbox.5 preline.1 qbiff.1 qmail-clean.8 \
qmail-command.8 qmail-control.9 qmail-getpw.9 qmail-header.5 \
qmail-inject.8 qmail-limits.9 qmail-local.8 qmail-log.5 \
qmail-lspawn.8 qmail-newmrh.9 qmail-newu.9 qmail-pop3d.8 \
qmail-popup.8 qmail-pw2u.9 qmail-qmqpc.8 qmail-qmqpd.8 qmail-qmtpd.8 \
qmail-qread.8 qmail-qstat.8 qmail-queue.8 qmail-remote.8 \
qmail-rspawn.8 qmail-send.9 qmail-showctl.8 qmail-smtpd.8 \
qmail-start.9 qmail-tcpok.8 qmail-tcpto.8 qmail-users.9 qmail.7 \
qreceipt.1 splogger.8 tcp-env.1 config.sh config-fast.sh \
qmail-clean.c qmail-getpw.c qmail-inject.c qmail-local.c \
qmail-lspawn.c qmail-newmrh.c qmail-newu.c qmail-pop3d.c \
qmail-popup.c qmail-pw2u.c qmail-qmqpc.c qmail-qmqpd.c qmail-qmtpd.c \
qmail-qread.c qmail-qstat.sh qmail-queue.c qmail-remote.c \
qmail-rspawn.c qmail-send.c qmail-showctl.c qmail-smtpd.c \
qmail-start.c qmail-tcpok.c qmail-tcpto.c spawn.c dnscname.c dnsfq.c \
dnsip.c dnsmxip.c dnsptr.c dnstxt.c hostname.c ipmeprint.c ipmetest.c tcp-env.c \
sendmail.c qreceipt.c qsmhook.c qbiff.c forward.c preline.c predate.c \
except.c bouncesaying.c condredirect.c maildirmake.c maildir2mbox.c \
maildirwatch.c splogger.c qail.sh elq.sh pinq.sh qmail-upq.sh \
datemail.sh mailsubj.sh qlx.h rcpthosts.h rcpthosts.c commands.h \
commands.c dnsdoe.h dnsdoe.c fmtqfn.h fmtqfn.c gfrom.h gfrom.c \
myctime.h myctime.c newfield.h newfield.c qsutil.h qsutil.c \
readsubdir.h readsubdir.c received.h received.c tcpto.h tcpto.c \
tcpto_clean.c trigger.h trigger.c triggerpull.h triggerpull.c \
trynpbg1.c trysyslog.c conf-cc conf-ld home.sh home+df.sh proc.sh \
proc+df.sh binm1.sh binm2.sh binm3.sh binm1+df.sh binm2+df.sh \
binm3+df.sh find-systype.sh make-compile.sh make-load.sh \
make-makelib.sh trycpp.c warn-auto.sh auto-str.c auto-int.c \
auto-int8.c auto-gid.c auto-uid.c hier.c install.c instcheck.c \
install-big.c alloc.3 alloc.h alloc.c alloc_re.c case.3 case.h \
case_diffb.c case_diffs.c case_lowerb.c case_lowers.c case_starts.c \
cdb.3 cdb.h cdb_hash.c cdb_seek.c cdb_unpack.c cdbmake.h \
cdbmake_add.c cdbmake_hash.c cdbmake_pack.c cdbmss.h cdbmss.c coe.3 \
coe.h coe.c fd.h fd_copy.3 fd_copy.c fd_move.3 fd_move.c fifo_make.3 \
fifo.h fifo.c trymkffo.c fork.h1 fork.h2 tryvfork.c now.3 now.h now.c \
open.h open_append.c open_excl.c open_read.c open_trunc.c \
open_write.c seek.h seek_cur.c seek_end.c seek_set.c seek_trunc.c \
conf-qmail auto_qmail.h qmail.h qmail.c gen_alloc.h gen_allocdefs.h \
stralloc.3 stralloc.h stralloc_eady.c stralloc_pend.c stralloc_copy.c \
stralloc_opyb.c stralloc_opys.c stralloc_cat.c stralloc_catb.c \
stralloc_cats.c stralloc_arts.c strerr.h strerr_sys.c strerr_die.c \
substdio.h substdio.c substdi.c substdo.c substdio_copy.c subfd.h \
subfderr.c subfdouts.c subfdout.c subfdins.c subfdin.c readwrite.h \
exit.h timeoutconn.h timeoutconn.c timeoutread.h timeoutread.c \
timeoutwrite.h timeoutwrite.c remoteinfo.h remoteinfo.c uint32.h1 \
uint32.h2 tryulong32.c wait.3 wait.h wait_pid.c wait_nohang.c \
trywaitp.c sig.h sig_alarm.c sig_block.c sig_catch.c sig_pause.c \
sig_pipe.c sig_child.c sig_term.c sig_hup.c sig_misc.c sig_bug.c \
trysgact.c trysgprm.c env.3 env.h env.c envread.c byte.h byte_chr.c \
byte_copy.c byte_cr.c byte_cspn.c byte_diff.c byte_rchr.c byte_rcspn.c \
byte_zero.c str.h spf.c spf.h spfquery.c \
str_chr.c str_cpy.c str_cpyb.c str_diff.c str_diffn.c str_len.c str_rchr.c \
str_start.c lock.h lock_ex.c lock_exnb.c lock_un.c tryflock.c getln.3 \
getln.h getln.c getln2.3 getln2.c sgetopt.3 sgetopt.h sgetopt.c \
subgetopt.3 subgetopt.h subgetopt.c error.3 error_str.3 error_temp.3 \
error.h error.c error_str.c error_temp.c fmt.h fmt_str.c fmt_strn.c \
fmt_uint.c fmt_uint0.c fmt_ulong.c scan.h scan_ulong.c scan_8long.c \
slurpclose.h slurpclose.c quote.h quote.c hfield.h hfield.c \
headerbody.h headerbody.c token822.h token822.c control.h control.c \
datetime.3 datetime.h datetime.c datetime_un.c prioq.h prioq.c \
date822fmt.h date822fmt.c dns.h dns.c trylsock.c tryrsolv.c ip.h ip.c \
ipalloc.h strsalloc.h ipalloc.c select.h1 select.h2 trysysel.c ndelay.h ndelay.c \
ndelay_off.c direntry.3 direntry.h1 direntry.h2 trydrent.c prot.h \
prot.c chkshsgr.c warn-shsgr tryshsgr.c ipme.h ipme.c trysalen.c \
maildir.5 maildir.h maildir.c tcp-environ.5 constmap.h constmap.c
shar -m `cat FILES` > shar
chmod 400 shar

sig.a: \
makelib sig_alarm.o sig_block.o sig_catch.o sig_pause.o sig_pipe.o \
sig_child.o sig_hup.o sig_term.o sig_bug.o sig_misc.o
Expand Down
2 changes: 1 addition & 1 deletion alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ static aligned realspace[SPACE / ALIGNMENT];
static unsigned int avail = SPACE; /* multiple of ALIGNMENT; 0<=avail<=SPACE */

/*@null@*//*@out@*/char *alloc(n)
unsigned int n;
long unsigned int n;
{
char *x;
if (n >= (INT_MAX >> 3)) {
Expand Down
12 changes: 6 additions & 6 deletions auto-int.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
char buf1[256];
substdio ss1 = SUBSTDIO_FDBUF(write,1,buf1,sizeof(buf1));

void puts(s)
void puts2(s)
char *s;
{
if (substdio_puts(&ss1,s) == -1) _exit(111);
Expand All @@ -30,11 +30,11 @@ char **argv;
scan_ulong(value,&num);
strnum[fmt_ulong(strnum,num)] = 0;

puts("int ");
puts(name);
puts(" = ");
puts(strnum);
puts(";\n");
puts2("int ");
puts2(name);
puts2(" = ");
puts2(strnum);
puts2(";\n");
if (substdio_flush(&ss1) == -1) _exit(111);
_exit(0);
}
14 changes: 8 additions & 6 deletions auto-int8.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
#include "scan.h"
#include "fmt.h"

extern unsigned int scan_8long(char *s, unsigned long *u);

char buf1[256];
substdio ss1 = SUBSTDIO_FDBUF(write,1,buf1,sizeof(buf1));

void puts(s)
void puts2(s)
char *s;
{
if (substdio_puts(&ss1,s) == -1) _exit(111);
Expand All @@ -30,11 +32,11 @@ char **argv;
scan_8long(value,&num);
strnum[fmt_ulong(strnum,num)] = 0;

puts("int ");
puts(name);
puts(" = ");
puts(strnum);
puts(";\n");
puts2("int ");
puts2(name);
puts2(" = ");
puts2(strnum);
puts2(";\n");
if (substdio_flush(&ss1) == -1) _exit(111);
_exit(0);
}
14 changes: 7 additions & 7 deletions auto-str.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
char buf1[256];
substdio ss1 = SUBSTDIO_FDBUF(write,1,buf1,sizeof(buf1));

void puts(s)
void puts2(s)
char *s;
{
if (substdio_puts(&ss1,s) == -1) _exit(111);
Expand All @@ -25,20 +25,20 @@ char **argv;
value = argv[2];
if (!value) _exit(100);

puts("char ");
puts(name);
puts("[] = \"\\\n");
puts2("char ");
puts2(name);
puts2("[] = \"\\\n");

while (ch = *value++) {
puts("\\");
puts2("\\");
octal[3] = 0;
octal[2] = '0' + (ch & 7); ch >>= 3;
octal[1] = '0' + (ch & 7); ch >>= 3;
octal[0] = '0' + (ch & 7);
puts(octal);
puts2(octal);
}

puts("\\\n\";\n");
puts2("\\\n\";\n");
if (substdio_flush(&ss1) == -1) _exit(111);
_exit(0);
}
1 change: 1 addition & 0 deletions bouncesaying.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <unistd.h>
#include "fork.h"
#include "strerr.h"
#include "error.h"
Expand Down
1 change: 1 addition & 0 deletions cdb_seek.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <unistd.h>
#include <sys/types.h>
#include <errno.h>
#include "cdb.h"
Expand Down
6 changes: 5 additions & 1 deletion chkshsgr.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#include <unistd.h>
#include <grp.h>
#include "exit.h"

void main()
{
short x[4];
gid_t x[4];
// was short x[4];

x[0] = x[1] = 0;
if (getgroups(1,x) == 0) if (setgroups(1,x) == -1) _exit(1);
Expand Down
6 changes: 5 additions & 1 deletion chkuser.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*
*
* 'chkuser.c' v.2.0.9
Expand All @@ -21,10 +20,12 @@
/* required by vpopmail */
#include <stdio.h>

#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#include "case.h"
#include "dns.h"
#include "env.h"
#include "ipme.h"
Expand All @@ -48,6 +49,9 @@

extern void flush();
extern void out (char *s);
extern int addrallowed();
extern unsigned int byte_rchr();
extern int vmaildir_readquota(const char *dir, const char *quota);

extern char *remotehost;
extern char *remoteip;
Expand Down
1 change: 1 addition & 0 deletions condredirect.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "fmt.h"
#include "stralloc.h"
#include "srs.h"
#include "str.h"

#define FATAL "condredirect: fatal: "

Expand Down
2 changes: 1 addition & 1 deletion conf-cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cc -O2 -g -DEXTERNAL_TODO -DTLS=20231230 -I`/bin/sh ./vpopmail-dir.sh`/include
cc -O2 -g -DEXTERNAL_TODO -DTLS=20231230 -I`/bin/sh ./vpopmail-dir.sh`/include -DDEPRECATED_FUNCTIONS_REMOVED

This will be used to compile .c files.
29 changes: 29 additions & 0 deletions deprecated.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#ifndef DEPRECATED_H
#define DEPRECATED_H

/*
* Patch grabbed from notqmail https://github.com/notqmail/notqmail/commit/c3d3c72e3ca7bb5102f710aad7bf9ab105bde27e
* It gets the compiler to get rid of "incompatible redeclaration of library function 'log2'"
* compilation warning.
*
* We sometimes decide certain functions should no longer be called.
* If valuable external patches still call them, we wait to delete them
* until those patches stop being valuable.
*
* In the meantime, we
*
* 1. Mark these functions deprecated, so compilers will warn people
* 2. Optionally define them out of existence, mainly for developer builds
*/

#ifndef DEPRECATED_FUNCTIONS_REMOVED
#define DEPRECATED_FUNCTIONS_AVAILABLE
#endif

#if defined(__clang__) || defined(__GNUC__)
#define _deprecated_ __attribute__((deprecated))
#else
#define _deprecated_
#endif

#endif
1 change: 1 addition & 0 deletions dnsmxip.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <unistd.h>
#include "substdio.h"
#include "subfd.h"
#include "stralloc.h"
Expand Down
1 change: 1 addition & 0 deletions except.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <unistd.h>
#include "fork.h"
#include "strerr.h"
#include "wait.h"
Expand Down
1 change: 1 addition & 0 deletions fd_copy.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <unistd.h>
#include <fcntl.h>
#include "fd.h"

Expand Down
1 change: 1 addition & 0 deletions fd_move.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <unistd.h>
#include "fd.h"

int fd_move(to,from)
Expand Down
1 change: 1 addition & 0 deletions forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "fmt.h"
#include "stralloc.h"
#include "srs.h"
#include "str.h"

#define FATAL "forward: fatal: "

Expand Down
2 changes: 1 addition & 1 deletion hier.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "auto_uids.h"
#include "fmt.h"
#include "fifo.h"

#include "install.h"
#include <stdio.h>
#include "channels.h"

Expand Down
2 changes: 2 additions & 0 deletions idedit.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

int fd;

int wait_pid(int *wstat, int pid);

void byte(pos,value)
char *pos;
unsigned int value;
Expand Down
6 changes: 3 additions & 3 deletions install-big.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include <stdio.h>
#include "auto_qmail.h"
#include "auto_split.h"
#include "auto_uids.h"
#include "channels.h"
#include "fmt.h"
#include "fifo.h"

#include <stdio.h>
#include "channels.h"
#include "install.h"

char buf[100 + FMT_ULONG];

Expand Down
2 changes: 2 additions & 0 deletions install.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <sys/stat.h>
#include "fifo.h"
#include "substdio.h"
#include "strerr.h"
#include "error.h"
Expand Down
5 changes: 5 additions & 0 deletions install.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
void d(char *home, char*subdir, int uid, int gid, int mode);
void h(char *home, int uid, int gid, int mode);
void c(char *home, char *subdir, char *file, int uid, int gid, int mode);
void z(char *home, char *file, int len, int uid, int gid, int mode);
void p(char *home, char *fifo, int uid, int gid, int mode);
7 changes: 7 additions & 0 deletions ipme.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,20 @@
#include "ipme.h"
#include "substdio.h"
#include "readwrite.h"
#include "alloc.h"
#include "open.h"
#include "getln.h"
#include "str.h"

static int ipmeok = 0;
ipalloc ipme = {0};
ipalloc ipme_mask = {0};
ipalloc notipme = {0};
ipalloc notipme_mask = {0};

int ipme_match(struct ipalloc *ipa, struct ipalloc *ipa_mask, struct ip_address *ip);
int ipme_readipfile(ipalloc *ipa, ipalloc *ipa_mask, char *fn);

int ipme_is(ip)
struct ip_address *ip;
{
Expand Down
Loading

0 comments on commit 2e0095b

Please sign in to comment.