From 9346e4f91dc468730efac8ad6f1d9d8024e8e93b Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 28 Apr 2010 07:05:07 +0200 Subject: Fix privileged access (applet) --- make/scripts/deploy-jar-sign.sh | 36 ++++++++++++++++++++++ .../jogamp/opengl/impl/GLDrawableFactoryImpl.java | 8 ++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100755 make/scripts/deploy-jar-sign.sh diff --git a/make/scripts/deploy-jar-sign.sh b/make/scripts/deploy-jar-sign.sh new file mode 100755 index 000000000..d6291c45c --- /dev/null +++ b/make/scripts/deploy-jar-sign.sh @@ -0,0 +1,36 @@ +#! /bin/sh + +jarfile=$1 +shift + +keystore=$1 +shift + +storepass=$1 +shift + +signarg=$1 +shift + +if [ -z "$jarfile" -o -z "$keystore" -o -z "$storepass" ] ; then + echo "usage $0 jarfile pkcs12-keystore storepass [signarg]" + exit 1 +fi + +if [ ! -e $jarfile ] ; then + echo $jarfile does not exist + exit 1 +fi + +if [ ! -e $keystore ] ; then + echo $keystore does not exist + exit 1 +fi + +THISDIR=`pwd` + +echo jarsigner -storetype pkcs12 -keystore $keystore $jarfile \"$signarg\" +jarsigner -storetype pkcs12 -keystore $THISDIR/$keystore -storepass $storepass $jarfile "$signarg" + +cd $THISDIR + diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableFactoryImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableFactoryImpl.java index 8f0299c1c..50e2edddb 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableFactoryImpl.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableFactoryImpl.java @@ -45,6 +45,7 @@ import javax.media.opengl.*; import com.jogamp.common.util.*; import com.jogamp.gluegen.runtime.*; import java.lang.reflect.*; +import java.security.*; /** Extends GLDrawableFactory with a few methods for handling typically software-accelerated offscreen rendering (Device @@ -185,7 +186,12 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { } }); } - Runtime.getRuntime().addShutdownHook(factoryShutdownHook); + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + Runtime.getRuntime().addShutdownHook(factoryShutdownHook); + return null; + } + }); factoryShutdownHookRegistered = true; } -- cgit v1.2.3