aboutsummaryrefslogtreecommitdiffstats
path: root/composer
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-07-02 22:45:58 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-07-02 23:02:56 +0800
commitae1f880dd8b49003a8c0ec51e977bad5bc6d5329 (patch)
tree09af4462e4f54aa901b729ae750c6fa57f23248e /composer
parent90b80d173ff72c1d4a7a92dd2563b20866eb9ff1 (diff)
downloadgsoc2013-evolution-ae1f880dd8b49003a8c0ec51e977bad5bc6d5329.tar.gz
gsoc2013-evolution-ae1f880dd8b49003a8c0ec51e977bad5bc6d5329.tar.zst
gsoc2013-evolution-ae1f880dd8b49003a8c0ec51e977bad5bc6d5329.zip
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.
Diffstat (limited to 'composer')
-rw-r--r--composer/e-msg-composer.c16
1 files changed, 16 insertions, 0 deletions
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);