fixed a problem related to directory checking and creation raised by Craig
authorDaniel Veillard <veillard@src.gnome.org>
Wed, 8 Jan 2003 11:35:34 +0000 (11:35 +0000)
committerDaniel Veillard <veillard@src.gnome.org>
Wed, 8 Jan 2003 11:35:34 +0000 (11:35 +0000)
* libxslt/transform.c: fixed a problem related to directory
  checking and creation raised by Craig Goss
Daniel

ChangeLog
libxslt/transform.c

index a2eb6ab..25c0034 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Jan  8 12:33:47 CET 2003 Daniel Veillard <daniel@veillard.com>
+
+       * libxslt/transform.c: fixed a problem related to directory
+         checking and creation raised by Craig Goss
+
 Thu Jan  2 23:23:30 CET 2003 Daniel Veillard <daniel@veillard.com>
 
        * libexslt/strings.c: applied patch from Jörg Walter to provide
index 07fa5c8..7d4aa98 100644 (file)
@@ -3802,6 +3802,20 @@ xsltApplyStylesheetInternal(xsltStylesheetPtr style, xmlDocPtr doc,
        xmlFreeDoc(res);
        res = NULL;
     }
+    if ((res != NULL) && (ctxt != NULL) && (output != NULL)) {
+       int ret;
+
+       ret = xsltCheckWrite(userCtxt->sec, userCtxt, output);
+       if (ret == 0) {
+           xsltTransformError(ctxt, NULL, NULL,
+                    "xsltApplyStylesheet: forbidden to save to %s\n",
+                              output);
+       } else if (ret < 0) {
+           xsltTransformError(ctxt, NULL, NULL,
+                    "xsltApplyStylesheet: saving to %s may not be possible\n",
+                              output);
+       }
+    }
 
     if ((ctxt != NULL) && (userCtxt == NULL))
        xsltFreeTransformContext(ctxt);