summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2020-11-06 14:02:49 -0800
committerKevin McCarthy <kevin@8t8.us>2020-11-06 14:10:34 -0800
commitf5aa9382edd1f044c5d86da0ee0cd2f3cbb1b2b3 (patch)
tree2b516e18a05c7bc6763e67f08ba91c62754b6519
parent6704caf444fa9746bc641da2ee3f5477d372e50f (diff)
Disable normalization after expand_path().
The algorithm used was incorrect, for '..' expansion with symlinks involved. Furthermore, mutt_pretty_mailbox() takes care of this for us. To be conservative, just before the release, I'm leaving the function but converting it to a noop. I'll pull the function out after the release. Thanks to Oswald Buddenhagen for pointing out the bug!
-rw-r--r--muttlib.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/muttlib.c b/muttlib.c
index ce009fdb..4ef77897 100644
--- a/muttlib.c
+++ b/muttlib.c
@@ -411,6 +411,16 @@ static void buffer_normalize_fullpath (BUFFER *dest, const char *src)
if (!src)
return;
+ /* Disabling this for the 2.0 release.
+ * See Gitlab #290 - '..' can not be simplified in this manner.
+ * Furthermore, it looks like mutt_pretty_mailbox() calls realpath()
+ * if there are any '..' strings in the path, and does its own '.'
+ * normalization much more succinctly than this. I'll remove this
+ * code after the release.
+ */
+ mutt_buffer_strcpy (dest, src);
+ return;
+
if (*src != '/')
{
mutt_buffer_strcpy (dest, src);