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
2008-08-18 Sergey Poznyakoff <gray@gnu.org.ua>
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.
* doc/rfc/Makefile.am (EXTRA_DIST): Add new rfcs.
* doc/rfc/rfc1413.txt, doc/rfc/rfc2087.txt, doc/rfc/rfc2180.txt,
doc/rfc/rfc2683.txt, doc/rfc/rfc3348.txt,
......
GNU mailutils NEWS -- history of user-visible changes. 2008-08-17
GNU mailutils NEWS -- history of user-visible changes. 2008-08-18
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007,
2008 Free Software Foundation, Inc.
See the end of file for copying conditions.
......@@ -140,8 +140,8 @@ New diagnostics functions are available, among them:
void mu_diag_voutput (int level, const char *fmt, va_list ap);
void mu_diag_output (int level, const char *fmt, ...);
A new header file, mailutils/diag.h, declarations of these and other
related functions.
A new header file, mailutils/diag.h, provides declarations for these
and other related functions.
See documentation (FIXME: Chapter?) for more information.
......
GNU mailutils TODO list. 2008-01-03
GNU mailutils TODO list. 2008-08-18
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006,
2007, 2008 Free Software Foundation, Inc.
......@@ -83,6 +83,19 @@ mail (from mailutils itself), mutt, pine, netscape, mozilla.
** implement AUTHENTICATE KERBEROS_V4 and SKEY and SRP?
* Implement extensions:
- ID : RFC 2971
- QUOTA : RFC 2087
- ACL : RFC 4314
- CHILDREN : RFC 3348
** Consider implementing the following extensions:
- CONDSTORE : RFC 4551
- ESEARCH : RFC 4731
- SEARCHRES : RFC 5182
* Mailcap API
The framework is implemented. Needs extensive testing.
......
......@@ -1264,7 +1264,7 @@ header-list = "(" header-fld-name *(SP header-fld-name) ")"
static void
parse_header_list (struct parsebuf *p, struct fetch_function_closure *ffc)
{
if (p->token[0] != '(')
if (!(p->token && p->token[0] == '('))
parsebuf_exit (p, "Syntax error: expected (");
mu_list_create (&ffc->headers);
mu_list_set_comparator (ffc->headers, _header_cmp);
......@@ -1532,8 +1532,8 @@ parse_macro (struct parsebuf *p)
{
parsebuf_next (p, 1);
parse_fetch_att_list (p);
if (p->token[0] != ')')
parsebuf_exit (p, "Missing closing parenthesis");
if (!(p->token && p->token[0] == ')'))
parsebuf_exit (p, "Unknown token or missing closing parenthesis");
}
else if ((exp = find_macro (p->token)))
{
......
......@@ -237,7 +237,7 @@ extern int imap4d_preauth_setup (int fd);
extern int imap4d_search (struct imap4d_command *, imap4d_tokbuf_t);
extern int imap4d_search0 (imap4d_tokbuf_t, int isuid, char **repyptr);
extern int imap4d_select (struct imap4d_command *, imap4d_tokbuf_t);
extern int imap4d_select0 (struct imap4d_command *, char *, int);
extern int imap4d_select0 (struct imap4d_command *, const char *, int);
extern int imap4d_select_status (void);
#ifdef WITH_TLS
extern int imap4d_starttls (struct imap4d_command *, imap4d_tokbuf_t);
......
......@@ -34,10 +34,12 @@ imap4d_select (struct imap4d_command *command, imap4d_tokbuf_t tok)
/* This code is share with EXAMINE. */
int
imap4d_select0 (struct imap4d_command *command, char *mailbox_name, int flags)
imap4d_select0 (struct imap4d_command *command, const char *mboxname,
int flags)
{
int status;
char *mailbox_name;
/* FIXME: Check state. */
/* 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)
imap4d_sync ();
}
if (strcmp (mailbox_name, "INBOX") == 0)
if (strcmp (mboxname, "INBOX") == 0)
flags |= MU_STREAM_CREAT;
mailbox_name = namespace_getfullpath (mailbox_name, "/");
mailbox_name = namespace_getfullpath (mboxname, "/");
if (!mailbox_name)
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)
"READ-ONLY" : "READ-WRITE", command->name);
}
}
status = util_finish (command, RESP_NO, "Couldn't open %s, %s",
mailbox_name, mu_strerror (status));
mu_mailbox_destroy (&mbox);
status = util_finish (command, RESP_NO, "Could not open %s: %s",
mboxname, mu_strerror (status));
free (mailbox_name);
state = STATE_AUTH;
return status;
}
......