tdaitx / java-swing-ayatana

Automatically exported from code.google.com/p/java-swing-ayatana
0 stars 0 forks source link

Java Web start crashes when Jayatana is used #40

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Run javaws anyfile.jnlp, here's the crash I'm getting:

Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up _JAVA_OPTIONS: 
-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:382)
    at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:397)
Caused by: java.security.AccessControlException: access denied 
("java.lang.RuntimePermission" "getenv.JAYATANA_LIBAGPATH")
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:372)
    at java.security.AccessController.checkPermission(AccessController.java:559)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
    at java.lang.System.getenv(System.java:885)
    at com.jarego.jayatana.Agent.premain(Unknown Source)
    ... 6 more
FATAL ERROR in native method: processing of -javaagent failed
Annullato (core dump creato

Original issue reported on code.google.com by trevi55 on 13 May 2014 at 1:49

GoogleCodeExporter commented 8 years ago
In progress

Original comment by danjaredg on 9 Sep 2014 at 9:42

GoogleCodeExporter commented 8 years ago
Please test with ppa:danjaredg/jayatana-test

Original comment by danjaredg on 25 Sep 2014 at 6:07

GoogleCodeExporter commented 8 years ago
Cool, that fixes the crash!

However, if you try to launch the attached jnlp, the menus are not exported 
(probably it's not something you can), but the crash bug is indeed fixed!

Original comment by trevi55 on 25 Sep 2014 at 11:13

Attachments:

GoogleCodeExporter commented 8 years ago
Is posible integrate JAyatana for jnlp applications, but it's a security hole. 
But if you still want to try, you need edit the file: 
/etc/icedtea-web/javaws.policy and add this lines

grant codeBase "file:/usr/share/java/jayatana.jar" {
    permission java.security.AllPermission;
};

grant codeBase "file:/usr/share/java/jayatanaag.jar" {
    permission java.security.AllPermission;
};

grant {
    permission java.lang.RuntimePermission "shutdownHooks";
};

Original comment by danjaredg on 26 Sep 2014 at 12:24

Attachments:

GoogleCodeExporter commented 8 years ago
The problem is the permission:

java.lang.RuntimePermission "shutdownHooks";

JAyatana uses it to close GMainLoop when closing the application. But a 
malicious software can generate new executions when attempting to close the 
application.

Original comment by danjaredg on 26 Sep 2014 at 12:29

GoogleCodeExporter commented 8 years ago
Oh, cool... It would be nice if you might somewhat add a new policy file to 
integrate that with this :)

Original comment by trevi55 on 26 Sep 2014 at 12:30