[evolution/gnome-3-4] Trust attachments from ~/.kde and ~/.kde4.



commit 6d3861030b2c4bafc98029140fcc4bd6c78a1a16
Author: Matthew Barnes <mbarnes redhat com>
Date:   Mon Jul 2 10:45:58 2012 -0400

    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.
    
    (cherry picked from commit ae1f880dd8b49003a8c0ec51e977bad5bc6d5329)

 composer/e-msg-composer.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 8dbbdc6..97197d4 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -3955,6 +3955,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;
@@ -3962,6 +3964,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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]