From 24e8b3ea43d2c9cdd130863133bf2266ebf27639 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sun, 12 Apr 2020 17:03:11 -0400 Subject: Mangle message IDs in paths / is allowed in addr-spec but ; is not. --- archive.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/archive.h b/archive.h index e9d4648..addd94d 100644 --- a/archive.h +++ b/archive.h @@ -19,6 +19,7 @@ #include #include #include +#include #include #include "imap.h" @@ -148,17 +149,27 @@ pathUID(char path[static PATH_MAX], uint32_t uid, const char *type) { return path; } +static inline const char *pathMangle(const char *messageID) { + if (!strchr(messageID, '/')) return messageID; + static char buf[PATH_MAX]; + strlcpy(buf, messageID, sizeof(buf)); + for (char *ptr = buf; (ptr = strchr(ptr, '/')); ++ptr) { + *ptr = ';'; + } + return buf; +} + static inline char *pathMessage( char path[static PATH_MAX], const char *messageID, const char *type ) { - snprintf(path, PATH_MAX, "message/%s.%s", messageID, type); + snprintf(path, PATH_MAX, "message/%s.%s", pathMangle(messageID), type); return path; } static inline char *pathThread( char path[static PATH_MAX], const char *messageID, const char *type ) { - snprintf(path, PATH_MAX, "thread/%s.%s", messageID, type); + snprintf(path, PATH_MAX, "thread/%s.%s", pathMangle(messageID), type); return path; } -- cgit 1.4.1 t type='hidden' name='id' value='8eefde1a827ac9efd44de8449e2d612d4c7981bb'/>
Commit message (Expand)Author
2019-07-16Add catgirl shottyJune McEnroe
2019-07-16Fix SGRs 90 and 100June McEnroe
2019-07-15Add up -tJune McEnroe
2019-07-15Implement scrolling regionJune McEnroe
2019-07-14Add CSI names to shotty -dJune McEnroe
2019-07-14Ignore CSI tJune McEnroe
2019-07-14Add more info to shotty man pageJune McEnroe
2019-07-14Fix OSC PT handlingJune McEnroe
2019-07-14Handle OSC in shottyJune McEnroe
2019-07-14Add shotty -dJune McEnroe
2019-07-13Add shotty -cJune McEnroe
2019-07-13Add DL to shottyJune McEnroe
2019-07-12Color html rather than bodyJune McEnroe
2019-07-12Make author consistent and update URLsJune McEnroe
2019-07-12Move to www/text.causal.agencyJune McEnroe
2019-07-12Add new causal.agency with shotty shotsJune McEnroe
2019-07-12Use -s to infer terminal sizeJune McEnroe
2019-07-12Add DCH to shottyJune McEnroe
2019-07-12Support insert mode in shottyJune McEnroe
2019-07-11Don't do carriage return on line feedJune McEnroe
2019-07-11Interpret 256color-style SGRsJune McEnroe
2019-07-11Use inline style rather than <b>, <i>, <u>June McEnroe
2019-07-11Factor out clearJune McEnroe
2019-07-11Add bright option to shottyJune McEnroe
2019-07-11Output <b>, <i>, <u> in shottyJune McEnroe
2019-07-10Ignore SM and RMJune McEnroe
2019-07-09Add shotty man page and build itJune McEnroe
2019-07-09Add up -cJune McEnroe
2019-07-09Add options for default colors to shottyJune McEnroe
2019-07-08Use char literals consistentlyJune McEnroe