[ 
https://issues.apache.org/jira/browse/PDFBOX-3520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15551538#comment-15551538
 ] 

simon steiner commented on PDFBOX-3520:
---------------------------------------

If you have this, then it helps since we may want to allow some font 
directories but not others
{code}
--- 
a/fontbox/src/main/java/org/apache/fontbox/util/autodetect/NativeFontDirFinder.java
+++ 
b/fontbox/src/main/java/org/apache/fontbox/util/autodetect/NativeFontDirFinder.java
@@ -41,9 +41,11 @@ public abstract class NativeFontDirFinder implements 
FontDirFinder
             for (String searchableDirectorie : searchableDirectories)
             {
                 File fontDir = new File(searchableDirectorie);
-                if (fontDir.exists() && fontDir.canRead())
-                {
-                    fontDirList.add(fontDir);
+                try {
+                    if (fontDir.exists() && fontDir.canRead()) {
+                        fontDirList.add(fontDir);
+                    }
+                } catch (SecurityException e) {
                 }
             }
         }


{code}

> Security manager fails
> ----------------------
>
>                 Key: PDFBOX-3520
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3520
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Writing
>    Affects Versions: 2.0.3
>            Reporter: simon steiner
>         Attachments: security.policy
>
>
> Related to PDFBOX-3145
> PDF from PDFBOX-5
> java -Djava.security.manager  -Djava.security.policy=security.policy -jar 
> ~/pdf-box-svn/app/target/pdfbox-app-2.1.0-SNAPSHOT.jar PDFToImage chinese.pdf



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to