aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-importer.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/e-shell-importer.c')
-rw-r--r--shell/e-shell-importer.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/shell/e-shell-importer.c b/shell/e-shell-importer.c
index a22d44732b..7cd8ba10db 100644
--- a/shell/e-shell-importer.c
+++ b/shell/e-shell-importer.c
@@ -44,6 +44,7 @@
#include "e-shell.h"
#include "e-shell-view.h"
+#include "e-local-storage.h" /* for E_LOCAL_STORAGE_NAME */
#include "e-shell-folder-selection-dialog.h"
#include "importer/evolution-importer-client.h"
@@ -341,6 +342,7 @@ start_import (const char *folderpath,
ImporterComponentData *icd;
char *label;
char *real_iid;
+ char *localpath;
struct stat buf;
if (stat (filename, &buf) == -1) {
@@ -353,6 +355,15 @@ start_import (const char *folderpath,
return;
}
+ /* Only allow importing to /local */
+ localpath = "/" E_LOCAL_STORAGE_NAME "/";
+ if (strncmp (folderpath, localpath, strlen (localpath))) {
+ char *message;
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
+ _("You may only import to local folders"));
+ return;
+ }
+
if (iid == NULL || strcmp (iid, "Automatic") == 0) {
/* Work out the component to use */
real_iid = get_iid_for_filetype (filename);