Commit 31eef6c7 authored by Richard Russon's avatar Richard Russon Committed by Kevin J. McCarthy

Selectively cache headers.

Thanks to NeoMutt and Jeriko One for the patch, which was slightly
modified to apply to the Mutt code.
parent 6aed28b4
......@@ -84,6 +84,7 @@ header_cache_t* imap_hcache_open (IMAP_DATA* idata, const char* path)
ciss_url_t url;
char cachepath[LONG_STRING];
char mbox[LONG_STRING];
size_t len;
if (path)
imap_cachepath (idata, path, mbox, sizeof (mbox));
......@@ -96,6 +97,12 @@ header_cache_t* imap_hcache_open (IMAP_DATA* idata, const char* path)
FREE (&mx.mbox);
}
if (strstr(mbox, "/../") || (strcmp(mbox, "..") == 0) || (strncmp(mbox, "../", 3) == 0))
return NULL;
len = strlen(mbox);
if ((len > 3) && (strcmp(mbox + len - 3, "/..") == 0))
return NULL;
mutt_account_tourl (&idata->conn->account, &url);
url.path = mbox;
url_ciss_tostring (&url, cachepath, sizeof (cachepath), U_PATH);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment