redland/raptor/makefile.mk |3
redland/raptor/raptor-1.4.18.entities.patch | 383
2 files changed, 385 insertions(+), 1 deletion(-)
New commits:
commit cef1ba2d58cb8a6928055b322c88a79b5b5c0ad4
Author: Petr Mladek pmla...@suse.cz
Date: Wed Feb 22 16:55:40 2012 +0100
Disable problematic reading of external entities in raptor
diff --git a/redland/raptor/makefile.mk b/redland/raptor/makefile.mk
index 214ee2d..292a340 100644
--- a/redland/raptor/makefile.mk
+++ b/redland/raptor/makefile.mk
@@ -58,7 +58,8 @@ OOO_PATCH_FILES= \
$(TARFILE_NAME).patch.dmake \
$(TARFILE_NAME).patch.win32 \
$(TARFILE_NAME).patch.rindex \
-raptor-aix.patch
+raptor-aix.patch \
+$(TARFILE_NAME).entities.patch
.IF $(CROSS_COMPILING)==YES
OOO_PATCH_FILES += \
diff --git a/redland/raptor/raptor-1.4.18.entities.patch
b/redland/raptor/raptor-1.4.18.entities.patch
new file mode 100644
index 000..4964dae
--- /dev/null
+++ b/redland/raptor/raptor-1.4.18.entities.patch
@@ -0,0 +1,383 @@
+--- misc/raptor-1.4.18/src/raptor.h.old2008-06-20 07:47:38.0
+0200
misc/build/raptor-1.4.18/src/raptor.h 2012-02-15 16:54:21.0
+0100
+@@ -376,6 +376,7 @@ typedef struct {
+ * @RAPTOR_FEATURE_JSON_EXTRA_DATA: JSON serializer extra top-level data
+ * @RAPTOR_FEATURE_RSS_TRIPLES: Atom/RSS serializer writes extra RDF triples
it finds (none, rdf-xml, atom-triples)
+ * @RAPTOR_FEATURE_ATOM_ENTRY_URI: Atom entry URI. If given, generate an
Atom Entry Document with the item having the given URI, otherwise generate an
Atom Feed Document with any items found.
++ * @RAPTOR_FEATURE_LOAD_EXTERNAL_ENTITIES: When reading XML, load external
entities.
+ * @RAPTOR_FEATURE_LAST: Internal
+ *
+ * Raptor parser, serializer or XML writer features.
+@@ -416,7 +417,8 @@ typedef enum {
+ RAPTOR_FEATURE_JSON_EXTRA_DATA,
+ RAPTOR_FEATURE_RSS_TRIPLES,
+ RAPTOR_FEATURE_ATOM_ENTRY_URI,
+- RAPTOR_FEATURE_LAST=RAPTOR_FEATURE_ATOM_ENTRY_URI
++ RAPTOR_FEATURE_LOAD_EXTERNAL_ENTITIES,
++ RAPTOR_FEATURE_LAST=RAPTOR_FEATURE_LOAD_EXTERNAL_ENTITIES
+ } raptor_feature;
+
+
+--- misc/raptor-1.4.18/src/raptor_feature.c.old2008-06-05
08:54:16.0 +0200
misc/build/raptor-1.4.18/src/raptor_feature.c 2012-02-15
16:55:09.0 +0100
+@@ -89,7 +89,8 @@ static const struct
+ { RAPTOR_FEATURE_JSON_CALLBACK , 6, jsonCallback, JSON serializer
callback },
+ { RAPTOR_FEATURE_JSON_EXTRA_DATA , 6, jsonExtraData, JSON serializer
extra data },
+ { RAPTOR_FEATURE_RSS_TRIPLES , 6, rssTriples, Atom/RSS serializer
writes extra RDF triples },
+- { RAPTOR_FEATURE_ATOM_ENTRY_URI, 6, atomEntryUri, Atom serializer
Entry URI }
++ { RAPTOR_FEATURE_ATOM_ENTRY_URI, 6, atomEntryUri, Atom serializer
Entry URI },
++ { RAPTOR_FEATURE_LOAD_EXTERNAL_ENTITIES, 1, loadExternalEntities, Load
external XML entities. }
+ };
+
+
+--- misc/raptor-1.4.18/src/raptor_internal.h.old 2008-06-03
07:04:09.0 +0200
misc/build/raptor-1.4.18/src/raptor_internal.h 2012-02-15
16:52:08.0 +0100
+@@ -983,6 +983,14 @@ struct raptor_sax2_s {
+
+ /* base URI for resolving relative URIs or xml:base URIs */
+ raptor_uri* base_uri;
++
++ /* call SAX2 handlers if non-0 */
++ int enabled;
++
++ /* FEATURE:
++ * non 0 if XML entities should be loaded
++ */
++ int feature_load_external_entities;
+ };
+
+ int raptor_sax2_init(void);
+--- misc/raptor-1.4.18/src/raptor_libxml.c.old 2008-06-14 05:35:27.0
+0200
misc/build/raptor-1.4.18/src/raptor_libxml.c 2012-02-15
16:52:08.0 +0100
+@@ -142,18 +142,115 @@ raptor_libxml_hasExternalSubset (void* u
+
+ static xmlParserInputPtr
+ raptor_libxml_resolveEntity(void* user_data,
+-const xmlChar *publicId, const xmlChar *systemId)
{
+- raptor_sax2* sax2=(raptor_sax2*)user_data;
+- return libxml2_resolveEntity(sax2-xc, publicId, systemId);
++const xmlChar *publicId, const xmlChar *systemId)
++{
++ raptor_sax2* sax2 = (raptor_sax2*)user_data;
++ xmlParserCtxtPtr ctxt = sax2-xc;
++ const unsigned char *uri_string = NULL;
++ xmlParserInputPtr entity_input;
++ int load_entity = 0;
++
++ if(ctxt-input)
++uri_string = (const unsigned char *)ctxt-input-filename;
++
++ if(!uri_string)
++uri_string = (const unsigned char *)ctxt-directory;
++
++ load_entity = sax2-feature_load_external_entities;
++
++ if(load_entity) {
++entity_input = xmlLoadExternalEntity((const char*)uri_string,
++ (const char*)publicId,
++ ctxt);
++ } else {
++RAPTOR_DEBUG4(Not loading entity URI %s by policy for publicId '%s'
systemId '%s'\n, uri_string, publicId, systemId);
++ }
++
++ return entity_input;
+ }
+
+
+ static xmlEntityPtr
+-raptor_libxml_getEntity(void* user_data, const xmlChar *name) {
+-