From ae1f880dd8b49003a8c0ec51e977bad5bc6d5329 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 2 Jul 2012 10:45:58 -0400 Subject: Trust attachments from ~/.kde and ~/.kde4. This came about from a mailing list thread entitled: Sending photos from digKam: "Skipping suspicious attachment" Apparently KDE still uses dot-folders quite heavily, despite having helped draft the XDG Base Directory Specification. --- composer/e-msg-composer.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'composer') diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 82f2ef5b14..168a843571 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -3929,6 +3929,8 @@ file_is_blacklisted (const gchar *argument) } if (blacklisted) { + gchar *base_dir; + /* Don't blacklist files in trusted base directories. */ if (g_str_has_prefix (filename, g_get_user_data_dir ())) blacklisted = FALSE; @@ -3936,6 +3938,20 @@ file_is_blacklisted (const gchar *argument) blacklisted = FALSE; if (g_str_has_prefix (filename, g_get_user_config_dir ())) blacklisted = FALSE; + + /* Apparently KDE still uses ~/.kde heavily, and some + * distributions use ~/.kde4 to distinguish KDE4 data + * from KDE3 data. Trust these directories as well. */ + + base_dir = g_build_filename (g_get_home_dir (), ".kde", NULL); + if (g_str_has_prefix (filename, base_dir)) + blacklisted = FALSE; + g_free (base_dir); + + base_dir = g_build_filename (g_get_home_dir (), ".kde4", NULL); + if (g_str_has_prefix (filename, base_dir)) + blacklisted = FALSE; + g_free (base_dir); } g_strfreev (parts); -- cgit