summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2014-01-27 15:37:28 +0100
committermanuel <manuel@mausz.at>2014-01-27 15:37:28 +0100
commit490c21cd94489729f34b4c4b690a4c103a78ec11 (patch)
tree813d8574e47b4097e2d595fc0c80b216c894536d
parentb2596d21e976743f42a82b7a7a173c7874386bb4 (diff)
downloadqmail-490c21cd94489729f34b4c4b690a4c103a78ec11.tar.gz
qmail-490c21cd94489729f34b4c4b690a4c103a78ec11.tar.bz2
qmail-490c21cd94489729f34b4c4b690a4c103a78ec11.zip
make commands argument mandatory
-rw-r--r--Makefile2
-rw-r--r--commands.h2
-rw-r--r--qmail-pop3d.c24
-rw-r--r--qmail-popup.c8
-rw-r--r--qmail-smtpd.c14
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
1980 1980
1981spawn.o: \ 1981spawn.o: \
1982compile chkspawn spawn.c sig.h wait.h substdio.h byte.h str.h \ 1982compile chkspawn spawn.c sig.h wait.h substdio.h byte.h str.h \
1983stralloc.h gen_alloc.h select.h exit.h coe.h open.h error.h \ 1983stralloc.h gen_alloc.h select.h exit.h alloc.h coe.h open.h error.h \
1984auto_qmail.h auto_uids.h auto_spawn.h 1984auto_qmail.h auto_uids.h auto_spawn.h
1985 ./chkspawn 1985 ./chkspawn
1986 ./compile spawn.c 1986 ./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 @@
3 3
4struct commands { 4struct 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(); }
67void die_scan() { err("unable to scan $HOME/Maildir"); die(); } 67void die_scan() { err("unable to scan $HOME/Maildir"); die(); }
68 68
69void err_syntax() { err("syntax error"); } 69void err_syntax() { err("syntax error"); }
70void err_unimpl() { err("unimplemented"); } 70void err_unimpl(arg) char *arg; { err("unimplemented"); }
71void err_deleted() { err("already deleted"); } 71void err_deleted() { err("already deleted"); }
72void err_nozero() { err("messages are counted from 1"); } 72void err_nozero() { err("messages are counted from 1"); }
73void err_toobig() { err("not that many messages"); } 73void err_toobig() { err("not that many messages"); }
74void err_nosuch() { err("unable to open that message"); } 74void err_nosuch() { err("unable to open that message"); }
75void err_nounlink() { err("unable to unlink all deleted messages"); } 75void err_nounlink() { err("unable to unlink all deleted messages"); }
76 76
77void okay() { substdio_puts(&ssout,"+OK \r\n"); flush(); } 77void okay(arg) char *arg; { substdio_puts(&ssout,"+OK \r\n"); flush(); }
78 78
79void printfn(fn) char *fn; 79void printfn(fn) char *fn;
80{ 80{
@@ -147,7 +147,7 @@ void getlist()
147 } 147 }
148} 148}
149 149
150void pop3_stat() 150void 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
165void pop3_rset() 165void 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
173void pop3_last() 173void 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
181void pop3_quit() 181void 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
259void list(i,flaguidl) 259void 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
65void err_syntax() { err("syntax error"); } 65void err_syntax() { err("syntax error"); }
66void err_wantuser() { err("USER first"); } 66void err_wantuser() { err("USER first"); }
67void err_authoriz() { err("authorization first"); } 67void err_authoriz(arg) char *arg; { err("authorization first"); }
68 68
69void okay() { puts("+OK \r\n"); flush(); } 69void okay(arg) char *arg; { puts("+OK \r\n"); flush(); }
70void pop3_quit() { okay(); die(); } 70void pop3_quit(arg) char *arg; { okay(); die(); }
71 71
72 72
73char unique[FMT_ULONG + FMT_ULONG + 3]; 73char unique[FMT_ULONG + FMT_ULONG + 3];
@@ -138,7 +138,7 @@ void pop3_greet()
138void pop3_user(arg) char *arg; 138void 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
159void err_badbounce() { out("550 sorry, bounce messages should have a single envelope recipient (#5.7.1)\r\n"); } 159void err_badbounce() { out("550 sorry, bounce messages should have a single envelope recipient (#5.7.1)\r\n"); }
160void err_unimpl() { out("502 unimplemented (#5.5.1)\r\n"); } 160void err_unimpl(arg) char *arg; { out("502 unimplemented (#5.5.1)\r\n"); }
161void err_syntax() { out("555 syntax error (#5.5.4)\r\n"); } 161void err_syntax() { out("555 syntax error (#5.5.4)\r\n"); }
162void err_relay() { out("553 we don't relay (#5.7.1)\r\n"); } 162void err_relay() { out("553 we don't relay (#5.7.1)\r\n"); }
163void err_wantmail() { out("503 MAIL first (#5.5.1)\r\n"); } 163void err_wantmail() { out("503 MAIL first (#5.5.1)\r\n"); }
164void err_wantrcpt() { out("503 RCPT first (#5.5.1)\r\n"); } 164void err_wantrcpt() { out("503 RCPT first (#5.5.1)\r\n"); }
165void err_noop() { out("250 ok\r\n"); } 165void err_noop(arg) char *arg; { out("250 ok\r\n"); }
166void err_vrfy() { out("252 send some mail, i'll try my best\r\n"); } 166void err_vrfy(arg) char *arg; { out("252 send some mail, i'll try my best\r\n"); }
167void err_qqt() { out("451 qqt failure (#4.3.0)\r\n"); } 167void err_qqt() { out("451 qqt failure (#4.3.0)\r\n"); }
168 168
169int err_child() { out("454 oops, problem with child and I can't auth (#4.3.0)\r\n"); return -1; } 169int 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}
195void smtp_help() 195void 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}
199void smtp_quit() 199void 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}
607void smtp_rset() 607void 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
812void smtp_data() { 812void 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;