Commit ced56434 ced564348134cc2f5569643551162a587778d762 by Sergey Poznyakoff

Bugfixes.

* TODO: Update.
* imap4d/fetch.c: Prevent coredumps on inexpected end of statement
(e.g. `FETCH 1:* (uid')
* imap4d/imap4d.h (imap4d_select0): Update protottype.
* imap4d/select.c (imap4d_select0): Do not advertise actual
mailbox name with a NO response.
Return to authenticated state on failure.
1 parent 7bbd113a
1 2008-08-18 Sergey Poznyakoff <gray@gnu.org.ua> 1 2008-08-18 Sergey Poznyakoff <gray@gnu.org.ua>
2 2
3 Bugfixes.
4 * TODO: Update.
5 * imap4d/fetch.c: Prevent coredumps on inexpected end of statement
6 (e.g. `FETCH 1:* (uid')
7 * imap4d/imap4d.h (imap4d_select0): Update protottype.
8 * imap4d/select.c (imap4d_select0): Do not advertise actual
9 mailbox name with a NO response.
10 Return to authenticated state on failure.
11
3 * doc/rfc/Makefile.am (EXTRA_DIST): Add new rfcs. 12 * doc/rfc/Makefile.am (EXTRA_DIST): Add new rfcs.
4 * doc/rfc/rfc1413.txt, doc/rfc/rfc2087.txt, doc/rfc/rfc2180.txt, 13 * doc/rfc/rfc1413.txt, doc/rfc/rfc2087.txt, doc/rfc/rfc2180.txt,
5 doc/rfc/rfc2683.txt, doc/rfc/rfc3348.txt, 14 doc/rfc/rfc2683.txt, doc/rfc/rfc3348.txt,
......
1 GNU mailutils NEWS -- history of user-visible changes. 2008-08-17 1 GNU mailutils NEWS -- history of user-visible changes. 2008-08-18
2 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007,
3 2008 Free Software Foundation, Inc. 3 2008 Free Software Foundation, Inc.
4 See the end of file for copying conditions. 4 See the end of file for copying conditions.
...@@ -140,8 +140,8 @@ New diagnostics functions are available, among them: ...@@ -140,8 +140,8 @@ New diagnostics functions are available, among them:
140 void mu_diag_voutput (int level, const char *fmt, va_list ap); 140 void mu_diag_voutput (int level, const char *fmt, va_list ap);
141 void mu_diag_output (int level, const char *fmt, ...); 141 void mu_diag_output (int level, const char *fmt, ...);
142 142
143 A new header file, mailutils/diag.h, declarations of these and other 143 A new header file, mailutils/diag.h, provides declarations for these
144 related functions. 144 and other related functions.
145 145
146 See documentation (FIXME: Chapter?) for more information. 146 See documentation (FIXME: Chapter?) for more information.
147 147
......
1 GNU mailutils TODO list. 2008-01-03 1 GNU mailutils TODO list. 2008-08-18
2 Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2 Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006,
3 2007, 2008 Free Software Foundation, Inc. 3 2007, 2008 Free Software Foundation, Inc.
4 4
...@@ -83,6 +83,19 @@ mail (from mailutils itself), mutt, pine, netscape, mozilla. ...@@ -83,6 +83,19 @@ mail (from mailutils itself), mutt, pine, netscape, mozilla.
83 83
84 ** implement AUTHENTICATE KERBEROS_V4 and SKEY and SRP? 84 ** implement AUTHENTICATE KERBEROS_V4 and SKEY and SRP?
85 85
86 * Implement extensions:
87
88 - ID : RFC 2971
89 - QUOTA : RFC 2087
90 - ACL : RFC 4314
91 - CHILDREN : RFC 3348
92
93 ** Consider implementing the following extensions:
94
95 - CONDSTORE : RFC 4551
96 - ESEARCH : RFC 4731
97 - SEARCHRES : RFC 5182
98
86 * Mailcap API 99 * Mailcap API
87 100
88 The framework is implemented. Needs extensive testing. 101 The framework is implemented. Needs extensive testing.
......
...@@ -1264,7 +1264,7 @@ header-list = "(" header-fld-name *(SP header-fld-name) ")" ...@@ -1264,7 +1264,7 @@ header-list = "(" header-fld-name *(SP header-fld-name) ")"
1264 static void 1264 static void
1265 parse_header_list (struct parsebuf *p, struct fetch_function_closure *ffc) 1265 parse_header_list (struct parsebuf *p, struct fetch_function_closure *ffc)
1266 { 1266 {
1267 if (p->token[0] != '(') 1267 if (!(p->token && p->token[0] == '('))
1268 parsebuf_exit (p, "Syntax error: expected ("); 1268 parsebuf_exit (p, "Syntax error: expected (");
1269 mu_list_create (&ffc->headers); 1269 mu_list_create (&ffc->headers);
1270 mu_list_set_comparator (ffc->headers, _header_cmp); 1270 mu_list_set_comparator (ffc->headers, _header_cmp);
...@@ -1532,8 +1532,8 @@ parse_macro (struct parsebuf *p) ...@@ -1532,8 +1532,8 @@ parse_macro (struct parsebuf *p)
1532 { 1532 {
1533 parsebuf_next (p, 1); 1533 parsebuf_next (p, 1);
1534 parse_fetch_att_list (p); 1534 parse_fetch_att_list (p);
1535 if (p->token[0] != ')') 1535 if (!(p->token && p->token[0] == ')'))
1536 parsebuf_exit (p, "Missing closing parenthesis"); 1536 parsebuf_exit (p, "Unknown token or missing closing parenthesis");
1537 } 1537 }
1538 else if ((exp = find_macro (p->token))) 1538 else if ((exp = find_macro (p->token)))
1539 { 1539 {
......
...@@ -237,7 +237,7 @@ extern int imap4d_preauth_setup (int fd); ...@@ -237,7 +237,7 @@ extern int imap4d_preauth_setup (int fd);
237 extern int imap4d_search (struct imap4d_command *, imap4d_tokbuf_t); 237 extern int imap4d_search (struct imap4d_command *, imap4d_tokbuf_t);
238 extern int imap4d_search0 (imap4d_tokbuf_t, int isuid, char **repyptr); 238 extern int imap4d_search0 (imap4d_tokbuf_t, int isuid, char **repyptr);
239 extern int imap4d_select (struct imap4d_command *, imap4d_tokbuf_t); 239 extern int imap4d_select (struct imap4d_command *, imap4d_tokbuf_t);
240 extern int imap4d_select0 (struct imap4d_command *, char *, int); 240 extern int imap4d_select0 (struct imap4d_command *, const char *, int);
241 extern int imap4d_select_status (void); 241 extern int imap4d_select_status (void);
242 #ifdef WITH_TLS 242 #ifdef WITH_TLS
243 extern int imap4d_starttls (struct imap4d_command *, imap4d_tokbuf_t); 243 extern int imap4d_starttls (struct imap4d_command *, imap4d_tokbuf_t);
......
...@@ -34,10 +34,12 @@ imap4d_select (struct imap4d_command *command, imap4d_tokbuf_t tok) ...@@ -34,10 +34,12 @@ imap4d_select (struct imap4d_command *command, imap4d_tokbuf_t tok)
34 34
35 /* This code is share with EXAMINE. */ 35 /* This code is share with EXAMINE. */
36 int 36 int
37 imap4d_select0 (struct imap4d_command *command, char *mailbox_name, int flags) 37 imap4d_select0 (struct imap4d_command *command, const char *mboxname,
38 int flags)
38 { 39 {
39 int status; 40 int status;
40 41 char *mailbox_name;
42
41 /* FIXME: Check state. */ 43 /* FIXME: Check state. */
42 44
43 /* Even if a mailbox is selected, a SELECT EXAMINE or LOGOUT 45 /* Even if a mailbox is selected, a SELECT EXAMINE or LOGOUT
...@@ -53,9 +55,9 @@ imap4d_select0 (struct imap4d_command *command, char *mailbox_name, int flags) ...@@ -53,9 +55,9 @@ imap4d_select0 (struct imap4d_command *command, char *mailbox_name, int flags)
53 imap4d_sync (); 55 imap4d_sync ();
54 } 56 }
55 57
56 if (strcmp (mailbox_name, "INBOX") == 0) 58 if (strcmp (mboxname, "INBOX") == 0)
57 flags |= MU_STREAM_CREAT; 59 flags |= MU_STREAM_CREAT;
58 mailbox_name = namespace_getfullpath (mailbox_name, "/"); 60 mailbox_name = namespace_getfullpath (mboxname, "/");
59 61
60 if (!mailbox_name) 62 if (!mailbox_name)
61 return util_finish (command, RESP_NO, "Couldn't open mailbox"); 63 return util_finish (command, RESP_NO, "Couldn't open mailbox");
...@@ -77,9 +79,12 @@ imap4d_select0 (struct imap4d_command *command, char *mailbox_name, int flags) ...@@ -77,9 +79,12 @@ imap4d_select0 (struct imap4d_command *command, char *mailbox_name, int flags)
77 "READ-ONLY" : "READ-WRITE", command->name); 79 "READ-ONLY" : "READ-WRITE", command->name);
78 } 80 }
79 } 81 }
80 status = util_finish (command, RESP_NO, "Couldn't open %s, %s", 82
81 mailbox_name, mu_strerror (status)); 83 mu_mailbox_destroy (&mbox);
84 status = util_finish (command, RESP_NO, "Could not open %s: %s",
85 mboxname, mu_strerror (status));
82 free (mailbox_name); 86 free (mailbox_name);
87 state = STATE_AUTH;
83 return status; 88 return status;
84 } 89 }
85 90
......