Author: mikemccand
Date: Tue May 12 21:03:25 2015
New Revision: 1679097

URL: http://svn.apache.org/r1679097
Log:
TIKA-1628: ExternalParser.check now returns false if SecurityException is thrown

Modified:
    tika/trunk/CHANGES.txt
    
tika/trunk/tika-core/src/main/java/org/apache/tika/parser/external/ExternalParser.java

Modified: tika/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/tika/trunk/CHANGES.txt?rev=1679097&r1=1679096&r2=1679097&view=diff
==============================================================================
--- tika/trunk/CHANGES.txt (original)
+++ tika/trunk/CHANGES.txt Tue May 12 21:03:25 2015
@@ -4,7 +4,6 @@ Release 1.9 - Current Development
     URLs and in addition it outputs the detected language as a
     metadata field (TIKA-1625).
 
-
   * OUTPUT_FILE_TOKEN not being replaced in ExternalParser 
     contributed by Pascal Essiembre (TIKA-1620).
 
@@ -42,6 +41,10 @@ Release 1.9 - Current Development
     Users will now need to add sqlite-jdbc to their classpath for
     the Sqlite3Parser to work.
 
+  * ExternalParser.check now catches (suppresses) SecurityException
+    and returns false, so it's OK to run Tika with a security policy
+    that does not allow execution of external processes (TIKA-1628).
+
 Release 1.8 - 4/13/2015
 
   * Fix null pointer when processing ODT footer styles (TIKA-1600).

Modified: 
tika/trunk/tika-core/src/main/java/org/apache/tika/parser/external/ExternalParser.java
URL: 
http://svn.apache.org/viewvc/tika/trunk/tika-core/src/main/java/org/apache/tika/parser/external/ExternalParser.java?rev=1679097&r1=1679096&r2=1679097&view=diff
==============================================================================
--- 
tika/trunk/tika-core/src/main/java/org/apache/tika/parser/external/ExternalParser.java
 (original)
+++ 
tika/trunk/tika-core/src/main/java/org/apache/tika/parser/external/ExternalParser.java
 Tue May 12 21:03:25 2015
@@ -351,6 +351,9 @@ public class ExternalParser extends Abst
        } catch (InterruptedException ie) {
           // Some problem, command is there or is broken
           return false;
+       } catch (SecurityException se) {
+          // External process execution is banned by the security manager
+          return false;
        } catch (Error err) {
            if (err.getMessage() != null && 
                (err.getMessage().contains("posix_spawn") || 


Reply via email to