diff options
author | Thomas Fitzsimmons <fitzsim@redhat.com> | 2006-09-08 22:15:16 +0000 |
---|---|---|
committer | Thomas Fitzsimmons <fitzsim@redhat.com> | 2006-09-08 22:15:16 +0000 |
commit | 08ee9b555e690eaa43c48acea6ea3d22e4612241 (patch) | |
tree | c7ab371a53f2b5fa18d737c790f23c20ea1132ca /libjava | |
parent | 05410b250dcc512df9cfe6bcf5dd83994cb0cab7 (diff) |
2006-09-08 Thomas Fitzsimmons <fitzsim@redhat.com>
* tools/gnu/classpath/tools/appletviewer/Main.java: Warn about
missing security manager when run in standalone mode.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/redhat/gcc-4_1-branch@116787 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/classpath/ChangeLog | 5 | ||||
-rw-r--r-- | libjava/classpath/tools/gnu/classpath/tools/appletviewer/Main.java | 30 |
2 files changed, 35 insertions, 0 deletions
diff --git a/libjava/classpath/ChangeLog b/libjava/classpath/ChangeLog index 8aca3f97844..3ed9ec24a9b 100644 --- a/libjava/classpath/ChangeLog +++ b/libjava/classpath/ChangeLog @@ -1,3 +1,8 @@ +2006-09-08 Thomas Fitzsimmons <fitzsim@redhat.com> + + * tools/gnu/classpath/tools/appletviewer/Main.java: Warn about + missing security manager when run in standalone mode. + 2006-07-06 Paul Eggert <eggert@cs.ucla.edu> Port to hosts whose 'sort' and 'tail' implementations diff --git a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/Main.java b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/Main.java index 1d9fed2b04d..98b8407cced 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/Main.java +++ b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/Main.java @@ -44,10 +44,12 @@ import gnu.classpath.tools.getopt.OptionGroup; import gnu.classpath.tools.getopt.Parser; import java.applet.Applet; import java.awt.Dimension; +import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.InputStreamReader; import java.io.OutputStream; import java.net.URL; import java.util.ArrayList; @@ -249,6 +251,7 @@ class Main if (pluginMode) { + // Plugin will warn user about missing security manager. InputStream in; OutputStream out; @@ -259,6 +262,33 @@ class Main } else { + // Warn user about missing security manager. + System.err.println("WARNING: CURRENTLY GAPPLETVIEWER RUNS WITH NO SECURITY MANAGER.\n\n" + + "THIS MEANS THAT APPLETS YOU LOAD CAN DO ANYTHING A JAVA APPLICATION\n" + + "THAT YOU DOWNLOAD AND RUN CAN DO. BE *VERY* CAREFUL WHICH APPLETS YOU RUN.\n" + + "DO NOT USE GAPPLETVIEWER ON YOUR SYSTEM IF YOUR SYSTEM STORES IMPORTANT DATA.\n" + + "THIS DATA CAN BE DESTROYED OR STOLEN IF YOU LOAD A MALICIOUS APPLET.\n"); + + System.err.println("[press 'c' or 'C' to continue or anything else to quit]"); + + BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); + String response = null; + + try + { + response = stdin.readLine(); + } + catch (IOException e) + { + System.err.println("failed to read response to warning message: " + e); + System.exit(1); + } + + if (!(response.equals("c") || response.equals("C"))) + { + System.exit(0); + } + if (code == null) { // The --code option wasn't given and there are no URL |