diff options
Diffstat (limited to 'src/extension/system.cpp')
| -rw-r--r-- | src/extension/system.cpp | 8 |
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); |
