aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--shell/ChangeLog5
-rw-r--r--shell/e-shell-importer.c11
2 files changed, 16 insertions, 0 deletions
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 <toshok@ximian.com>
+
+ * e-shell-importer.c (start_import): only allow importing to
+ /local folders.
+
2001-09-12 Ettore Perazzoli <ettore@ximian.com>
[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);