summaryrefslogtreecommitdiff
path: root/rsvg-private.h
diff options
context:
space:
mode:
authorChristian Persch <chpe@gnome.org>2012-01-26 21:17:31 +0100
committerChristian Persch <chpe@gnome.org>2012-01-26 21:17:31 +0100
commita2e869cb700c13804056820fd4afa215e551b9c5 (patch)
tree86506a485f85272d251bac8bb1f9ae7008dac2d0 /rsvg-private.h
parentcd6700bb4852466bd1d700774c0fce4dde25c6e6 (diff)
downloadlibrsvg-a2e869cb700c13804056820fd4afa215e551b9c5.tar.gz
Add permission check before loading other files
Wrap _rsvg_io_acquire_* in _rsvg_handle_acquire_* that first checks whether the load should be allowed. For the moment, always allow the load; more restricted policies will be introduced in a follow-up commit.
Diffstat (limited to 'rsvg-private.h')
-rw-r--r--rsvg-private.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/rsvg-private.h b/rsvg-private.h
index 142e7326..b79e8715 100644
--- a/rsvg-private.h
+++ b/rsvg-private.h
@@ -122,9 +122,17 @@ struct RsvgSaxHandler {
void (*characters) (RsvgSaxHandler * self, const char *ch, int len);
};
+typedef enum {
+ RSVG_LOAD_POLICY_ALL_PERMISSIVE
+} RsvgLoadPolicy;
+
+#define RSVG_LOAD_POLICY_DEFAULT (RSVG_LOAD_POLICY_ALL_PERMISSIVE)
+
struct RsvgHandlePrivate {
RsvgHandleFlags flags;
+ RsvgLoadPolicy load_policy;
+
gboolean is_disposed;
gboolean is_closed;
@@ -395,6 +403,17 @@ G_GNUC_INTERNAL
void rsvg_return_if_fail_warning (const char *pretty_function,
const char *expression, GError ** error);
+G_GNUC_INTERNAL
+guint8* _rsvg_handle_acquire_data (RsvgHandle *handle,
+ const char *uri,
+ gsize *len,
+ GError **error);
+G_GNUC_INTERNAL
+GInputStream *_rsvg_handle_acquire_stream (RsvgHandle *handle,
+ const char *uri,
+ GError **error);
+
+
#define rsvg_return_if_fail(expr, error) G_STMT_START{ \
if G_LIKELY(expr) { } else \
{ \