From 1807c74cbec5204385b71b3a120ebcd40f80c18e Mon Sep 17 00:00:00 2001 From: Josh Andler Date: Wed, 16 Sep 2009 02:04:50 +0000 Subject: Fix by Adib for 353847 (bzr r8601) --- src/extension/system.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/extension/system.cpp') 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); -- cgit v1.2.3