Browse Source

FOP-3174: Allow sections which need security permissions to be run when AllPermission denied in caller code

pull/75/merge
Simon Steiner 2 months ago
parent
commit
64846a5c4c
1 changed files with 19 additions and 2 deletions
  1. 19
    2
      fop-core/src/main/java/org/apache/fop/apps/FopFactory.java

+ 19
- 2
fop-core/src/main/java/org/apache/fop/apps/FopFactory.java View File

* @throws SAXException * @throws SAXException
* @throws IOException * @throws IOException
*/ */
public static FopFactory newInstance(URI baseURI, InputStream confStream) throws SAXException,
public static FopFactory newInstance(final URI baseURI, final InputStream confStream) throws SAXException,
IOException { IOException {
return new FopConfParser(confStream, baseURI).getFopFactoryBuilder().build();
Object action = AccessController.doPrivileged(
new PrivilegedAction<Object>() {
public Object run() {
try {
return new FopConfParser(confStream, baseURI).getFopFactoryBuilder().build();
} catch (SAXException | IOException e) {
return e;
}
}
}
);
if (action instanceof SAXException) {
throw (SAXException) action;
}
if (action instanceof IOException) {
throw (IOException) action;
}
return (FopFactory) action;
} }


/** /**

Loading…
Cancel
Save