diff options
author | Sven Gothel <[email protected]> | 2013-06-21 04:39:21 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-06-21 04:39:21 +0200 |
commit | 889ba9488ca07b59fdcc378642a2dc20676d69a3 (patch) | |
tree | 42d3f57fc6c68b587677f21e9f8670400cf2f6ad /src/jogl/classes/jogamp/opengl/x11/glx | |
parent | 9043224ae336111982498005e88672488cb0bd7a (diff) |
Security: Apply security changes from GlueGen
GlueGen related commits
- 23341a2df2d2ea36784a16fa1db8bc7385351a12
- 2d8e25398e929f553c4524e9c57f083d90ba4e08
- 8cabcd2de8b46c42dffcaaf46ccc2dc4d092ebba
- f69831574d4927d03d40c330d0b047d8c89622a4
- eb842815498f5926828b49c48fffce22fc9586a2
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/x11/glx')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java | 31 | ||||
-rw-r--r-- | src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java | 4 |
2 files changed, 21 insertions, 14 deletions
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java index 394293bc0..b3b02e23f 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java @@ -39,6 +39,8 @@ package jogamp.opengl.x11.glx; import java.nio.Buffer; import java.nio.ShortBuffer; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.Collection; import java.util.HashMap; import java.util.List; @@ -91,19 +93,24 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { super(); synchronized(X11GLXDrawableFactory.class) { - if(null==x11GLXDynamicLookupHelper) { - DesktopGLDynamicLookupHelper tmp = null; - try { - tmp = new DesktopGLDynamicLookupHelper(new X11GLXDynamicLibraryBundleInfo()); - } catch (GLException gle) { - if(DEBUG) { - gle.printStackTrace(); + if( null == x11GLXDynamicLookupHelper ) { + x11GLXDynamicLookupHelper = AccessController.doPrivileged(new PrivilegedAction<DesktopGLDynamicLookupHelper>() { + public DesktopGLDynamicLookupHelper run() { + DesktopGLDynamicLookupHelper tmp; + try { + tmp = new DesktopGLDynamicLookupHelper(new X11GLXDynamicLibraryBundleInfo()); + if(null!=tmp && tmp.isLibComplete()) { + GLX.getGLXProcAddressTable().reset(tmp); + } + } catch (Exception ex) { + tmp = null; + if(DEBUG) { + ex.printStackTrace(); + } + } + return tmp; } - } - if(null!=tmp && tmp.isLibComplete()) { - x11GLXDynamicLookupHelper = tmp; - GLX.getGLXProcAddressTable().reset(x11GLXDynamicLookupHelper); - } + } ); } } diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java index 6083f209c..f25f7ae2c 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java @@ -31,13 +31,13 @@ package jogamp.opengl.x11.glx; import jogamp.opengl.*; import java.util.*; -public class X11GLXDynamicLibraryBundleInfo extends DesktopGLDynamicLibraryBundleInfo { +public final class X11GLXDynamicLibraryBundleInfo extends DesktopGLDynamicLibraryBundleInfo { protected X11GLXDynamicLibraryBundleInfo() { super(); } @Override - public List<List<String>> getToolLibNames() { + public final List<List<String>> getToolLibNames() { final List<List<String>> libsList = new ArrayList<List<String>>(); final List<String> libsGL = new ArrayList<String>(); |