summaryrefslogtreecommitdiffstats
path: root/src/extension/system.cpp
diff options
context:
space:
mode:
authorJosh Andler <scislac@gmail.com>2009-09-16 02:04:50 +0000
committerscislac <scislac@users.sourceforge.net>2009-09-16 02:04:50 +0000
commit1807c74cbec5204385b71b3a120ebcd40f80c18e (patch)
tree4acd4e7edddf85e9a027230a382134ed12cbf3b7 /src/extension/system.cpp
parentSwedish translation update by Elias. (diff)
downloadinkscape-1807c74cbec5204385b71b3a120ebcd40f80c18e.tar.gz
inkscape-1807c74cbec5204385b71b3a120ebcd40f80c18e.zip
Fix by Adib for 353847
(bzr r8601)
Diffstat (limited to 'src/extension/system.cpp')
-rw-r--r--src/extension/system.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/extension/system.cpp b/src/extension/system.cpp
index 365ea925b..43e7af494 100644
--- a/src/extension/system.cpp
+++ b/src/extension/system.cpp
@@ -32,6 +32,7 @@
#include "implementation/script.h"
#include "implementation/xslt.h"
#include "xml/rebase-hrefs.h"
+#include "io/sys.h"
/* #include "implementation/plugin.h" */
namespace Inkscape {
@@ -248,6 +249,13 @@ save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension,
throw Output::no_overwrite();
}
+ // test if the file exists and is writable
+ // the test only checks the file attributes and might pass where ACL does not allow to write
+ if (Inkscape::IO::file_test(filename, G_FILE_TEST_EXISTS) && !Inkscape::IO::file_is_writable(filename)) {
+ g_free(fileName);
+ throw Output::file_read_only();
+ }
+
Inkscape::XML::Node *repr = sp_document_repr_root(doc);