diff options
| author | manuel <manuel@mausz.at> | 2014-01-27 15:37:28 +0100 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2014-01-27 15:37:28 +0100 |
| commit | 490c21cd94489729f34b4c4b690a4c103a78ec11 (patch) | |
| tree | 813d8574e47b4097e2d595fc0c80b216c894536d | |
| parent | b2596d21e976743f42a82b7a7a173c7874386bb4 (diff) | |
| download | qmail-490c21cd94489729f34b4c4b690a4c103a78ec11.tar.gz qmail-490c21cd94489729f34b4c4b690a4c103a78ec11.tar.bz2 qmail-490c21cd94489729f34b4c4b690a4c103a78ec11.zip | |
make commands argument mandatory
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | commands.h | 2 | ||||
| -rw-r--r-- | qmail-pop3d.c | 24 | ||||
| -rw-r--r-- | qmail-popup.c | 8 | ||||
| -rw-r--r-- | qmail-smtpd.c | 14 |
5 files changed, 25 insertions, 25 deletions
| @@ -1980,7 +1980,7 @@ trylsock.c compile load | |||
| 1980 | 1980 | ||
| 1981 | spawn.o: \ | 1981 | spawn.o: \ |
| 1982 | compile chkspawn spawn.c sig.h wait.h substdio.h byte.h str.h \ | 1982 | compile chkspawn spawn.c sig.h wait.h substdio.h byte.h str.h \ |
| 1983 | stralloc.h gen_alloc.h select.h exit.h coe.h open.h error.h \ | 1983 | stralloc.h gen_alloc.h select.h exit.h alloc.h coe.h open.h error.h \ |
| 1984 | auto_qmail.h auto_uids.h auto_spawn.h | 1984 | auto_qmail.h auto_uids.h auto_spawn.h |
| 1985 | ./chkspawn | 1985 | ./chkspawn |
| 1986 | ./compile spawn.c | 1986 | ./compile spawn.c |
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | struct commands { | 4 | struct commands { |
| 5 | char *text; | 5 | char *text; |
| 6 | void (*fun)(); | 6 | void (*fun)(char *arg); |
| 7 | void (*flush)(); | 7 | void (*flush)(); |
| 8 | } ; | 8 | } ; |
| 9 | 9 | ||
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(); } | |||
| 67 | void die_scan() { err("unable to scan $HOME/Maildir"); die(); } | 67 | void die_scan() { err("unable to scan $HOME/Maildir"); die(); } |
| 68 | 68 | ||
| 69 | void err_syntax() { err("syntax error"); } | 69 | void err_syntax() { err("syntax error"); } |
| 70 | void err_unimpl() { err("unimplemented"); } | 70 | void err_unimpl(arg) char *arg; { err("unimplemented"); } |
| 71 | void err_deleted() { err("already deleted"); } | 71 | void err_deleted() { err("already deleted"); } |
| 72 | void err_nozero() { err("messages are counted from 1"); } | 72 | void err_nozero() { err("messages are counted from 1"); } |
| 73 | void err_toobig() { err("not that many messages"); } | 73 | void err_toobig() { err("not that many messages"); } |
| 74 | void err_nosuch() { err("unable to open that message"); } | 74 | void err_nosuch() { err("unable to open that message"); } |
| 75 | void err_nounlink() { err("unable to unlink all deleted messages"); } | 75 | void err_nounlink() { err("unable to unlink all deleted messages"); } |
| 76 | 76 | ||
| 77 | void okay() { substdio_puts(&ssout,"+OK \r\n"); flush(); } | 77 | void okay(arg) char *arg; { substdio_puts(&ssout,"+OK \r\n"); flush(); } |
| 78 | 78 | ||
| 79 | void printfn(fn) char *fn; | 79 | void printfn(fn) char *fn; |
| 80 | { | 80 | { |
| @@ -147,7 +147,7 @@ void getlist() | |||
| 147 | } | 147 | } |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | void pop3_stat() | 150 | void pop3_stat(arg) char *arg; |
| 151 | { | 151 | { |
| 152 | int i; | 152 | int i; |
| 153 | unsigned long total; | 153 | unsigned long total; |
| @@ -162,15 +162,15 @@ void pop3_stat() | |||
| 162 | flush(); | 162 | flush(); |
| 163 | } | 163 | } |
| 164 | 164 | ||
| 165 | void pop3_rset() | 165 | void pop3_rset(arg) char *arg; |
| 166 | { | 166 | { |
| 167 | int i; | 167 | int i; |
| 168 | for (i = 0;i < numm;++i) m[i].flagdeleted = 0; | 168 | for (i = 0;i < numm;++i) m[i].flagdeleted = 0; |
| 169 | last = 0; | 169 | last = 0; |
| 170 | okay(); | 170 | okay(0); |
| 171 | } | 171 | } |
| 172 | 172 | ||
| 173 | void pop3_last() | 173 | void pop3_last(arg) char *arg; |
| 174 | { | 174 | { |
| 175 | substdio_puts(&ssout,"+OK "); | 175 | substdio_puts(&ssout,"+OK "); |
| 176 | put(strnum,fmt_uint(strnum,last)); | 176 | put(strnum,fmt_uint(strnum,last)); |
| @@ -178,7 +178,7 @@ void pop3_last() | |||
| 178 | flush(); | 178 | flush(); |
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | void pop3_quit() | 181 | void pop3_quit(arg) char *arg; |
| 182 | { | 182 | { |
| 183 | int i; | 183 | int i; |
| 184 | char quotabuf[QUOTABUFSIZE]; | 184 | char quotabuf[QUOTABUFSIZE]; |
| @@ -231,7 +231,7 @@ void pop3_quit() | |||
| 231 | if (quotafd >= 0) close(quotafd); | 231 | if (quotafd >= 0) close(quotafd); |
| 232 | } | 232 | } |
| 233 | } | 233 | } |
| 234 | okay(); | 234 | okay(0); |
| 235 | die(); | 235 | die(); |
| 236 | } | 236 | } |
| 237 | 237 | ||
| @@ -253,7 +253,7 @@ void pop3_dele(arg) char *arg; | |||
| 253 | if (i == -1) return; | 253 | if (i == -1) return; |
| 254 | m[i].flagdeleted = 1; | 254 | m[i].flagdeleted = 1; |
| 255 | if (i + 1 > last) last = i + 1; | 255 | if (i + 1 > last) last = i + 1; |
| 256 | okay(); | 256 | okay(0); |
| 257 | } | 257 | } |
| 258 | 258 | ||
| 259 | void list(i,flaguidl) | 259 | void list(i,flaguidl) |
| @@ -277,7 +277,7 @@ void dolisting(arg,flaguidl) char *arg; int flaguidl; | |||
| 277 | list(i,flaguidl); | 277 | list(i,flaguidl); |
| 278 | } | 278 | } |
| 279 | else { | 279 | else { |
| 280 | okay(); | 280 | okay(0); |
| 281 | for (i = 0;i < numm;++i) | 281 | for (i = 0;i < numm;++i) |
| 282 | if (!m[i].flagdeleted) | 282 | if (!m[i].flagdeleted) |
| 283 | list(i,flaguidl); | 283 | list(i,flaguidl); |
| @@ -306,7 +306,7 @@ void pop3_top(arg) char *arg; | |||
| 306 | 306 | ||
| 307 | fd = open_read(m[i].fn); | 307 | fd = open_read(m[i].fn); |
| 308 | if (fd == -1) { err_nosuch(); return; } | 308 | if (fd == -1) { err_nosuch(); return; } |
| 309 | okay(); | 309 | okay(0); |
| 310 | substdio_fdbuf(&ssmsg,read,fd,ssmsgbuf,sizeof(ssmsgbuf)); | 310 | substdio_fdbuf(&ssmsg,read,fd,ssmsgbuf,sizeof(ssmsgbuf)); |
| 311 | blast(&ssmsg,limit); | 311 | blast(&ssmsg,limit); |
| 312 | close(fd); | 312 | close(fd); |
| @@ -338,7 +338,7 @@ char **argv; | |||
| 338 | 338 | ||
| 339 | getlist(); | 339 | getlist(); |
| 340 | 340 | ||
| 341 | okay(); | 341 | okay(0); |
| 342 | commands(&ssin,pop3commands); | 342 | commands(&ssin,pop3commands); |
| 343 | die(); | 343 | die(); |
| 344 | } | 344 | } |
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"); } | |||
| 64 | 64 | ||
| 65 | void err_syntax() { err("syntax error"); } | 65 | void err_syntax() { err("syntax error"); } |
| 66 | void err_wantuser() { err("USER first"); } | 66 | void err_wantuser() { err("USER first"); } |
| 67 | void err_authoriz() { err("authorization first"); } | 67 | void err_authoriz(arg) char *arg; { err("authorization first"); } |
| 68 | 68 | ||
| 69 | void okay() { puts("+OK \r\n"); flush(); } | 69 | void okay(arg) char *arg; { puts("+OK \r\n"); flush(); } |
| 70 | void pop3_quit() { okay(); die(); } | 70 | void pop3_quit(arg) char *arg; { okay(); die(); } |
| 71 | 71 | ||
| 72 | 72 | ||
| 73 | char unique[FMT_ULONG + FMT_ULONG + 3]; | 73 | char unique[FMT_ULONG + FMT_ULONG + 3]; |
| @@ -138,7 +138,7 @@ void pop3_greet() | |||
| 138 | void pop3_user(arg) char *arg; | 138 | void pop3_user(arg) char *arg; |
| 139 | { | 139 | { |
| 140 | if (!*arg) { err_syntax(); return; } | 140 | if (!*arg) { err_syntax(); return; } |
| 141 | okay(); | 141 | okay(0); |
| 142 | seenuser = 1; | 142 | seenuser = 1; |
| 143 | if (!stralloc_copys(&username,arg)) die_nomem(); | 143 | if (!stralloc_copys(&username,arg)) die_nomem(); |
| 144 | if (!stralloc_0(&username)) die_nomem(); | 144 | 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() | |||
| 157 | } | 157 | } |
| 158 | #endif | 158 | #endif |
| 159 | void err_badbounce() { out("550 sorry, bounce messages should have a single envelope recipient (#5.7.1)\r\n"); } | 159 | void err_badbounce() { out("550 sorry, bounce messages should have a single envelope recipient (#5.7.1)\r\n"); } |
| 160 | void err_unimpl() { out("502 unimplemented (#5.5.1)\r\n"); } | 160 | void err_unimpl(arg) char *arg; { out("502 unimplemented (#5.5.1)\r\n"); } |
| 161 | void err_syntax() { out("555 syntax error (#5.5.4)\r\n"); } | 161 | void err_syntax() { out("555 syntax error (#5.5.4)\r\n"); } |
| 162 | void err_relay() { out("553 we don't relay (#5.7.1)\r\n"); } | 162 | void err_relay() { out("553 we don't relay (#5.7.1)\r\n"); } |
| 163 | void err_wantmail() { out("503 MAIL first (#5.5.1)\r\n"); } | 163 | void err_wantmail() { out("503 MAIL first (#5.5.1)\r\n"); } |
| 164 | void err_wantrcpt() { out("503 RCPT first (#5.5.1)\r\n"); } | 164 | void err_wantrcpt() { out("503 RCPT first (#5.5.1)\r\n"); } |
| 165 | void err_noop() { out("250 ok\r\n"); } | 165 | void err_noop(arg) char *arg; { out("250 ok\r\n"); } |
| 166 | void err_vrfy() { out("252 send some mail, i'll try my best\r\n"); } | 166 | void err_vrfy(arg) char *arg; { out("252 send some mail, i'll try my best\r\n"); } |
| 167 | void err_qqt() { out("451 qqt failure (#4.3.0)\r\n"); } | 167 | void err_qqt() { out("451 qqt failure (#4.3.0)\r\n"); } |
| 168 | 168 | ||
| 169 | int err_child() { out("454 oops, problem with child and I can't auth (#4.3.0)\r\n"); return -1; } | 169 | 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; | |||
| 192 | substdio_puts(&ssout,code); | 192 | substdio_puts(&ssout,code); |
| 193 | substdio_put(&ssout,greeting.s,greeting.len); | 193 | substdio_put(&ssout,greeting.s,greeting.len); |
| 194 | } | 194 | } |
| 195 | void smtp_help() | 195 | void smtp_help(arg) char *arg; |
| 196 | { | 196 | { |
| 197 | out("214 qmail home page: http://pobox.com/~djb/qmail.html\r\n"); | 197 | out("214 qmail home page: http://pobox.com/~djb/qmail.html\r\n"); |
| 198 | } | 198 | } |
| 199 | void smtp_quit() | 199 | void smtp_quit(arg) char *arg; |
| 200 | { | 200 | { |
| 201 | smtp_greet("221 "); out("\r\n"); flush(); _exit(0); | 201 | smtp_greet("221 "); out("\r\n"); flush(); _exit(0); |
| 202 | } | 202 | } |
| @@ -604,7 +604,7 @@ void smtp_ehlo(arg) char *arg; | |||
| 604 | seenmail = 0; dohelo(arg); | 604 | seenmail = 0; dohelo(arg); |
| 605 | if (bhelook) flagbarfbhelo = bmcheck(BMCHECK_BHELO); | 605 | if (bhelook) flagbarfbhelo = bmcheck(BMCHECK_BHELO); |
| 606 | } | 606 | } |
| 607 | void smtp_rset() | 607 | void smtp_rset(arg) char *arg; |
| 608 | { | 608 | { |
| 609 | spp_rset(); | 609 | spp_rset(); |
| 610 | seenmail = 0; | 610 | seenmail = 0; |
| @@ -809,7 +809,7 @@ void acceptmessage(qp) unsigned long qp; | |||
| 809 | out("\r\n"); | 809 | out("\r\n"); |
| 810 | } | 810 | } |
| 811 | 811 | ||
| 812 | void smtp_data() { | 812 | void smtp_data(arg) char *arg; { |
| 813 | int hops; | 813 | int hops; |
| 814 | unsigned long qp; | 814 | unsigned long qp; |
| 815 | char *qqx; | 815 | char *qqx; |
