changeset 6489:c0d5845f82d5

RT-36141: Gtk: SecurityException using WebView when running app with security manager Reviewed-by: anthony
author kcr
date Mon, 17 Mar 2014 05:28:19 -0700
parents 6820d900774a
children 73f0beec1171
files modules/graphics/src/main/java/com/sun/glass/ui/Application.java
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/glass/ui/Application.java	Mon Mar 17 13:22:16 2014 +0100
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/Application.java	Mon Mar 17 05:28:19 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -216,7 +216,12 @@
      */
     public String getDataDirectory() {
         checkEventThread();
-        return System.getProperty("user.home") + File.separator + "." + name + File.separator;
+        String userHome = AccessController.doPrivileged(new PrivilegedAction<String>() {
+            @Override public String run() {
+                return System.getProperty("user.home");
+            }
+        });
+        return userHome + File.separator + "." + name + File.separator;
     }
 
     private void notifyWillFinishLaunching() {