From fcd2204ae8837acc7beec9bdd0b33ef6ac13ff49 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 4 Oct 2017 07:57:08 +0000 Subject: [PATCH] Fic bug boo#1061343 OBS-URL: https://build.opensuse.org/package/show/server:mail/mutt?expand=0&rev=177 --- mutt.changes | 6 +++ mutt.spec | 3 ++ neomutt-c030a8b.patch | 103 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 112 insertions(+) create mode 100644 neomutt-c030a8b.patch diff --git a/mutt.changes b/mutt.changes index 589abfa..7ab16e3 100644 --- a/mutt.changes +++ b/mutt.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Oct 4 07:55:59 UTC 2017 - werner@suse.de + +- Add patch neomutt-c030a8b.patch from upstream commit to fix + boo#1061343 + ------------------------------------------------------------------- Fri Sep 15 09:07:55 UTC 2017 - werner@suse.de diff --git a/mutt.spec b/mutt.spec index a3a8d0c..6d4d55d 100644 --- a/mutt.spec +++ b/mutt.spec @@ -99,6 +99,8 @@ Patch16: mutt-1.5.23-carriage-return.path Patch18: mutt-1.5.21-mailcap.diff # PATCH-FIX-SUSE: bsc#907453 - CVE-2014-9116: mutt: heap-based buffer overflow in mutt_substrdup() Patch19: bsc907453-CVE-2014-9116-jessie.patch +# PATCH-FIX-UPSTREAM: bsc#1061343 - (neo)mutt displaying times in Zulu time +Patch20: neomutt-c030a8b.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %global _sysconfdir %{_sysconfdir} @@ -145,6 +147,7 @@ ln -sf neomutt-neomutt-%neo mutt-%version %patch16 -p0 -b .crlf %patch18 -p0 -b .mailcap %patch19 -p0 -b .cvw2014.9116 +%patch20 -p1 -b .zulu rm -vf README*.orig rm -vf PATCHES*.orig diff --git a/neomutt-c030a8b.patch b/neomutt-c030a8b.patch new file mode 100644 index 0000000..11fa987 --- /dev/null +++ b/neomutt-c030a8b.patch @@ -0,0 +1,103 @@ +From c030a8b8ef43f2bc549e4f00651c25681d54f26e Mon Sep 17 00:00:00 2001 +From: Richard Russon +Date: Thu, 14 Sep 2017 17:36:19 +0100 +Subject: [PATCH] fix: %{fmt} date format + +A mistake was introduced when moving the date code to the library. +The dates being displayed were those of the base timezone, not the email. + +Remove the `%<...>` documentation from `$index_format` + +Fixes #757 +--- + init.h | 2 -- + lib/date.c | 12 ++++++++---- + lib/date.h | 2 +- + parse.c | 10 +++++----- + 4 files changed, 14 insertions(+), 12 deletions(-) + +diff --git a/init.h b/init.h +index 247b0f211..4f029f39c 100644 +--- a/init.h ++++ b/init.h +@@ -1584,8 +1584,6 @@ struct Option MuttVars[] = { + ** .dt %(fmt) .dd the local date and time when the message was received. + ** ``fmt'' is expanded by the library function \fCstrftime(3)\fP; + ** a leading bang disables locales +- ** .dt % .dd the current local time. ``fmt'' is expanded by the library +- ** function \fCstrftime(3)\fP; a leading bang disables locales. + ** .dt %>X .dd right justify the rest of the string and pad with character ``X'' + ** .dt %|X .dd pad to the end of the line with character ``X'' + ** .dt %*X .dd soft-fill with character ``X'' as pad +diff --git a/lib/date.c b/lib/date.c +index b1a450a24..5cce4b3f9 100644 +--- a/lib/date.c ++++ b/lib/date.c +@@ -432,7 +432,7 @@ bool is_day_name(const char *s) + * + * The 'timezone' field is optional; it defaults to +0000 if missing. + */ +-time_t mutt_parse_date(const char *s, const struct Tz **tz_out) ++time_t mutt_parse_date(const char *s, struct Tz *tz_out) + { + int count = 0; + char *t = NULL; +@@ -537,9 +537,6 @@ time_t mutt_parse_date(const char *s, const struct Tz **tz_out) + zhours = tz->zhours; + zminutes = tz->zminutes; + zoccident = tz->zoccident; +- +- if (tz_out) +- *tz_out = tz; + } + + /* ad hoc support for the European MET (now officially CET) TZ */ +@@ -568,5 +565,12 @@ time_t mutt_parse_date(const char *s, const struct Tz **tz_out) + return -1; + } + ++ if (tz_out) ++ { ++ tz_out->zhours = zhours; ++ tz_out->zminutes = zminutes; ++ tz_out->zoccident = zoccident; ++ } ++ + return (mutt_mktime(&tm, 0) + tz_offset); + } +diff --git a/lib/date.h b/lib/date.h +index ad0eb9c38..fab7a1b8f 100644 +--- a/lib/date.h ++++ b/lib/date.h +@@ -45,7 +45,7 @@ time_t mutt_local_tz(time_t t); + time_t mutt_mktime(struct tm *t, int local); + void mutt_normalize_time(struct tm *tm); + char *mutt_make_date(char *buf, size_t buflen); +-time_t mutt_parse_date(const char *s, const struct Tz **tz_out); ++time_t mutt_parse_date(const char *s, struct Tz *tz_out); + bool is_day_name(const char *s); + int mutt_check_month(const char *s); + +diff --git a/parse.c b/parse.c +index 38f46129d..3b8966e1a 100644 +--- a/parse.c ++++ b/parse.c +@@ -835,13 +835,13 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line, + mutt_str_replace(&e->date, p); + if (hdr) + { +- const struct Tz *tz = NULL; ++ struct Tz tz; + hdr->date_sent = mutt_parse_date(p, &tz); +- if (tz) ++ if (hdr->date_sent > 0) + { +- hdr->zhours = tz->zhours; +- hdr->zminutes = tz->zminutes; +- hdr->zoccident = tz->zoccident; ++ hdr->zhours = tz.zhours; ++ hdr->zminutes = tz.zminutes; ++ hdr->zoccident = tz.zoccident; + } + } + matched = 1;