From 490c21cd94489729f34b4c4b690a4c103a78ec11 Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 27 Jan 2014 15:37:28 +0100 Subject: make commands argument mandatory --- Makefile | 2 +- commands.h | 2 +- qmail-pop3d.c | 24 ++++++++++++------------ qmail-popup.c | 8 ++++---- qmail-smtpd.c | 14 +++++++------- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index 946f0ab..0b98ee3 100644 --- a/Makefile +++ b/Makefile @@ -1980,7 +1980,7 @@ trylsock.c compile load spawn.o: \ compile chkspawn spawn.c sig.h wait.h substdio.h byte.h str.h \ -stralloc.h gen_alloc.h select.h exit.h coe.h open.h error.h \ +stralloc.h gen_alloc.h select.h exit.h alloc.h coe.h open.h error.h \ auto_qmail.h auto_uids.h auto_spawn.h ./chkspawn ./compile spawn.c diff --git a/commands.h b/commands.h index da05a8d..0e36409 100644 --- a/commands.h +++ b/commands.h @@ -3,7 +3,7 @@ struct commands { char *text; - void (*fun)(); + void (*fun)(char *arg); void (*flush)(); } ; diff --git a/qmail-pop3d.c b/qmail-pop3d.c index d2a6f87..e299339 100644 --- a/qmail-pop3d.c +++ b/qmail-pop3d.c @@ -67,14 +67,14 @@ void die_nomaildir() { err("this user has no $HOME/Maildir"); die(); } void die_scan() { err("unable to scan $HOME/Maildir"); die(); } void err_syntax() { err("syntax error"); } -void err_unimpl() { err("unimplemented"); } +void err_unimpl(arg) char *arg; { err("unimplemented"); } void err_deleted() { err("already deleted"); } void err_nozero() { err("messages are counted from 1"); } void err_toobig() { err("not that many messages"); } void err_nosuch() { err("unable to open that message"); } void err_nounlink() { err("unable to unlink all deleted messages"); } -void okay() { substdio_puts(&ssout,"+OK \r\n"); flush(); } +void okay(arg) char *arg; { substdio_puts(&ssout,"+OK \r\n"); flush(); } void printfn(fn) char *fn; { @@ -147,7 +147,7 @@ void getlist() } } -void pop3_stat() +void pop3_stat(arg) char *arg; { int i; unsigned long total; @@ -162,15 +162,15 @@ void pop3_stat() flush(); } -void pop3_rset() +void pop3_rset(arg) char *arg; { int i; for (i = 0;i < numm;++i) m[i].flagdeleted = 0; last = 0; - okay(); + okay(0); } -void pop3_last() +void pop3_last(arg) char *arg; { substdio_puts(&ssout,"+OK "); put(strnum,fmt_uint(strnum,last)); @@ -178,7 +178,7 @@ void pop3_last() flush(); } -void pop3_quit() +void pop3_quit(arg) char *arg; { int i; char quotabuf[QUOTABUFSIZE]; @@ -231,7 +231,7 @@ void pop3_quit() if (quotafd >= 0) close(quotafd); } } - okay(); + okay(0); die(); } @@ -253,7 +253,7 @@ void pop3_dele(arg) char *arg; if (i == -1) return; m[i].flagdeleted = 1; if (i + 1 > last) last = i + 1; - okay(); + okay(0); } void list(i,flaguidl) @@ -277,7 +277,7 @@ void dolisting(arg,flaguidl) char *arg; int flaguidl; list(i,flaguidl); } else { - okay(); + okay(0); for (i = 0;i < numm;++i) if (!m[i].flagdeleted) list(i,flaguidl); @@ -306,7 +306,7 @@ void pop3_top(arg) char *arg; fd = open_read(m[i].fn); if (fd == -1) { err_nosuch(); return; } - okay(); + okay(0); substdio_fdbuf(&ssmsg,read,fd,ssmsgbuf,sizeof(ssmsgbuf)); blast(&ssmsg,limit); close(fd); @@ -338,7 +338,7 @@ char **argv; getlist(); - okay(); + okay(0); commands(&ssin,pop3commands); die(); } diff --git a/qmail-popup.c b/qmail-popup.c index 5e6387a..8e5bc76 100644 --- a/qmail-popup.c +++ b/qmail-popup.c @@ -64,10 +64,10 @@ void die_badauth() { err("authorization failed"); } void err_syntax() { err("syntax error"); } void err_wantuser() { err("USER first"); } -void err_authoriz() { err("authorization first"); } +void err_authoriz(arg) char *arg; { err("authorization first"); } -void okay() { puts("+OK \r\n"); flush(); } -void pop3_quit() { okay(); die(); } +void okay(arg) char *arg; { puts("+OK \r\n"); flush(); } +void pop3_quit(arg) char *arg; { okay(); die(); } char unique[FMT_ULONG + FMT_ULONG + 3]; @@ -138,7 +138,7 @@ void pop3_greet() void pop3_user(arg) char *arg; { if (!*arg) { err_syntax(); return; } - okay(); + okay(0); seenuser = 1; if (!stralloc_copys(&username,arg)) die_nomem(); if (!stralloc_0(&username)) die_nomem(); diff --git a/qmail-smtpd.c b/qmail-smtpd.c index 4e40adf..8f0842b 100644 --- a/qmail-smtpd.c +++ b/qmail-smtpd.c @@ -157,13 +157,13 @@ void err_nogateway() } #endif void err_badbounce() { out("550 sorry, bounce messages should have a single envelope recipient (#5.7.1)\r\n"); } -void err_unimpl() { out("502 unimplemented (#5.5.1)\r\n"); } +void err_unimpl(arg) char *arg; { out("502 unimplemented (#5.5.1)\r\n"); } void err_syntax() { out("555 syntax error (#5.5.4)\r\n"); } void err_relay() { out("553 we don't relay (#5.7.1)\r\n"); } void err_wantmail() { out("503 MAIL first (#5.5.1)\r\n"); } void err_wantrcpt() { out("503 RCPT first (#5.5.1)\r\n"); } -void err_noop() { out("250 ok\r\n"); } -void err_vrfy() { out("252 send some mail, i'll try my best\r\n"); } +void err_noop(arg) char *arg; { out("250 ok\r\n"); } +void err_vrfy(arg) char *arg; { out("252 send some mail, i'll try my best\r\n"); } void err_qqt() { out("451 qqt failure (#4.3.0)\r\n"); } int err_child() { out("454 oops, problem with child and I can't auth (#4.3.0)\r\n"); return -1; } @@ -192,11 +192,11 @@ void smtp_greet(code) char *code; substdio_puts(&ssout,code); substdio_put(&ssout,greeting.s,greeting.len); } -void smtp_help() +void smtp_help(arg) char *arg; { out("214 qmail home page: http://pobox.com/~djb/qmail.html\r\n"); } -void smtp_quit() +void smtp_quit(arg) char *arg; { smtp_greet("221 "); out("\r\n"); flush(); _exit(0); } @@ -604,7 +604,7 @@ void smtp_ehlo(arg) char *arg; seenmail = 0; dohelo(arg); if (bhelook) flagbarfbhelo = bmcheck(BMCHECK_BHELO); } -void smtp_rset() +void smtp_rset(arg) char *arg; { spp_rset(); seenmail = 0; @@ -809,7 +809,7 @@ void acceptmessage(qp) unsigned long qp; out("\r\n"); } -void smtp_data() { +void smtp_data(arg) char *arg; { int hops; unsigned long qp; char *qqx; -- cgit v1.2.3