From 49510132a1d2ea0ebe294669ab837092d033c744 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Thu, 13 Sep 2001 00:02:18 +0000 Subject: only allow importing to /local folders. 2001-09-12 Chris Toshok * e-shell-importer.c (start_import): only allow importing to /local folders. svn path=/trunk/; revision=12790 --- shell/ChangeLog | 5 +++++ shell/e-shell-importer.c | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/shell/ChangeLog b/shell/ChangeLog index 8f0116e004..290ca8765a 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,8 @@ +2001-09-12 Chris Toshok + + * e-shell-importer.c (start_import): only allow importing to + /local folders. + 2001-09-12 Ettore Perazzoli [Fix #4962, "Highlighting is left after a drag".] 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); -- cgit