16#ifndef INVALID_FILE_ATTRIBUTES
17#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
26# define stat(x,y) _stat(x,y)
64 "xsltNewSecurityPrefs : malloc failed\n");
181 ctxt->
sec = (
void *) sec;
248 struct stat stat_buffer;
286 "File write for %s refused\n",
path);
305 "Directory creation for %s refused\n",
346 "xsltCheckWrite: out of memory for %s\n", URL);
355 if ((
uri->path)&&(
uri->path[0]==
'/')&&
356 (
uri->path[1]!=
'\0')&&(
uri->path[2]==
':'))
377 ret =
check(sec, ctxt, (
const char *)URL);
380 "File write for %s refused\n", URL);
411 "xsltCheckRead: URL parsing failed for %s\n",
426 "Local file read for %s refused\n", URL);
437 ret =
check(sec, ctxt, (
const char *)URL);
440 "Network file read for %s refused\n", URL);
void xsltInitGlobals(void)
void xsltSetDefaultSecurityPrefs(xsltSecurityPrefsPtr sec)
xsltSecurityCheck xsltGetSecurityPrefs(xsltSecurityPrefsPtr sec, xsltSecurityOption option)
int xsltSetSecurityPrefs(xsltSecurityPrefsPtr sec, xsltSecurityOption option, xsltSecurityCheck func)
static int xsltCheckWritePath(xsltSecurityPrefsPtr sec, xsltTransformContextPtr ctxt, const char *path)
void xsltFreeSecurityPrefs(xsltSecurityPrefsPtr sec)
int xsltSecurityForbid(xsltSecurityPrefsPtr sec ATTRIBUTE_UNUSED, xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED, const char *value ATTRIBUTE_UNUSED)
int xsltCheckWrite(xsltSecurityPrefsPtr sec, xsltTransformContextPtr ctxt, const xmlChar *URL)
static int xsltCheckFilename(const char *path)
xsltSecurityPrefsPtr xsltGetDefaultSecurityPrefs(void)
int xsltSecurityAllow(xsltSecurityPrefsPtr sec ATTRIBUTE_UNUSED, xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED, const char *value ATTRIBUTE_UNUSED)
int xsltSetCtxtSecurityPrefs(xsltSecurityPrefsPtr sec, xsltTransformContextPtr ctxt)
xsltSecurityPrefsPtr xsltNewSecurityPrefs(void)
static xsltSecurityPrefsPtr xsltDefaultSecurityPrefs
int xsltCheckRead(xsltSecurityPrefsPtr sec, xsltTransformContextPtr ctxt, const xmlChar *URL)
xsltSecurityPrefs * xsltSecurityPrefsPtr
int(* xsltSecurityCheck)(xsltSecurityPrefsPtr sec, xsltTransformContextPtr ctxt, const char *value)
@ XSLT_SECPREF_READ_NETWORK
@ XSLT_SECPREF_WRITE_NETWORK
@ XSLT_SECPREF_CREATE_DIRECTORY
@ XSLT_SECPREF_WRITE_FILE
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
#define check(expected, result)
#define FILE_ATTRIBUTE_DIRECTORY
XMLPUBVAR xmlMallocFunc xmlMalloc
XMLPUBVAR xmlFreeFunc xmlFree
xsltSecurityCheck readFile
xsltSecurityCheck createFile
xsltSecurityCheck createDir
xsltSecurityCheck readNet
xsltSecurityCheck writeNet
XMLPUBFUN xmlURIPtr XMLCALL xmlCreateURI(void)
XMLPUBFUN xmlURIPtr XMLCALL xmlParseURI(const char *str)
XMLPUBFUN void XMLCALL xmlFreeURI(xmlURIPtr uri)
#define INVALID_FILE_ATTRIBUTES
XMLPUBFUN char *XMLCALL xmlParserGetDirectory(const char *filename)
XMLPUBFUN xmlChar *XMLCALL xmlStrdup(const xmlChar *cur)
XMLPUBFUN int XMLCALL xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
void xsltTransformError(xsltTransformContextPtr ctxt, xsltStylesheetPtr style, xmlNodePtr node, const char *msg,...)