aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-importer.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2001-09-13 08:02:18 +0800
committerChris Toshok <toshok@src.gnome.org>2001-09-13 08:02:18 +0800
commit49510132a1d2ea0ebe294669ab837092d033c744 (patch)
tree48890348107f331766bce481fb25c4b92877f9a2 /shell/e-shell-importer.c
parentd90320e221ccf4b446c4cb3977fdc35fb42b511b (diff)
downloadgsoc2013-evolution-49510132a1d2ea0ebe294669ab837092d033c744.tar
gsoc2013-evolution-49510132a1d2ea0ebe294669ab837092d033c744.tar.gz
gsoc2013-evolution-49510132a1d2ea0ebe294669ab837092d033c744.tar.bz2
gsoc2013-evolution-49510132a1d2ea0ebe294669ab837092d033c744.tar.lz
gsoc2013-evolution-49510132a1d2ea0ebe294669ab837092d033c744.tar.xz
gsoc2013-evolution-49510132a1d2ea0ebe294669ab837092d033c744.tar.zst
gsoc2013-evolution-49510132a1d2ea0ebe294669ab837092d033c744.zip
only allow importing to /local folders.
2001-09-12 Chris Toshok <toshok@ximian.com> * e-shell-importer.c (start_import): only allow importing to /local folders. svn path=/trunk/; revision=12790
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);