1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
|
$FreeBSD$
Applied patches from IcedTea6-1.9.4 and updated for IcedTea-Web 1.0:
patches/hotspot/original/update-bootclasspath.patch
patches/icedtea-demo-swingapplet.patch
patches/extensions/netx.patch
patches/extensions/netx-umask.patch
patches/extensions/liveconnect.patch
Note: patches/hotspot/original/update-bootclasspath.patch was applied without
rhino support.
--- hotspot/src/share/vm/runtime/os.cpp.orig 2011-01-20 18:51:22.000000000 -0500
+++ hotspot/src/share/vm/runtime/os.cpp 2011-01-25 15:56:17.000000000 -0500
@@ -1032,6 +1032,8 @@
"%/lib/jsse.jar:"
"%/lib/jce.jar:"
"%/lib/charsets.jar:"
+ "%/lib/netx.jar:"
+ "%/lib/plugin.jar:"
// ## TEMPORARY hack to keep the legacy launcher working when
// ## only the boot module is installed (cf. j.l.ClassLoader)
--- jdk/make/docs/NON_CORE_PKGS.gmk.orig 2010-06-21 17:15:08.000000000 -0400
+++ jdk/make/docs/NON_CORE_PKGS.gmk 2010-09-09 16:26:01.000000000 -0400
@@ -84,6 +84,10 @@
SMARTCARDIO_PKGS = javax.smartcardio
+JNLP_PKGS = javax.jnlp
+
+JAVASCRIPT_PKGS = netscape.javascript
+
# non-core packages in rt.jar
NON_CORE_PKGS = $(DOMAPI_PKGS) \
$(MGMT_PKGS) \
@@ -91,4 +95,6 @@
$(JGSS_PKGS) \
$(OLD_JSSE_PKGS) \
$(HTTPSERVER_PKGS) \
- $(SMARTCARDIO_PKGS)
+ $(SMARTCARDIO_PKGS) \
+ $(JNLP_PKGS) \
+ $(JAVASCRIPT_PKGS)
--- jdk/make/launchers/Makefile.orig 2011-01-20 18:54:05.000000000 -0500
+++ jdk/make/launchers/Makefile 2011-02-09 12:58:47.000000000 -0500
@@ -61,12 +61,14 @@
$(call make-launcher, apt, com.sun.tools.apt.Main, , )
$(call make-launcher, extcheck, com.sun.tools.extcheck.Main, , )
$(call make-launcher, idlj, com.sun.tools.corba.se.idl.toJavaPortable.Compile, , )
+$(call make-launcher, itweb-settings, net.sourceforge.jnlp.controlpanel.ControlPanel, , )
$(call make-launcher, jar, sun.tools.jar.Main, , )
$(call make-launcher, jarsigner, sun.security.tools.JarSigner, , )
$(call make-launcher, javac, com.sun.tools.javac.Main, , )
$(call make-launcher, javadoc, com.sun.tools.javadoc.Main, , )
$(call make-launcher, javah, com.sun.tools.javah.Main, , )
$(call make-launcher, javap, sun.tools.javap.Main, , )
+$(call make-launcher, javaws, net.sourceforge.jnlp.runtime.Boot, , )
$(call make-launcher, jconsole, sun.tools.jconsole.JConsole, \
-J-Djconsole.showOutputViewer, )
$(call make-launcher, jdb, com.sun.tools.example.debug.tty.TTY, , )
--- jdk/make/launchers/Makefile.launcher.orig 2010-06-21 17:15:08.000000000 -0400
+++ jdk/make/launchers/Makefile.launcher 2010-09-09 16:25:12.000000000 -0400
@@ -148,6 +148,16 @@
endif
endif
+# pluginappletviewer only
+ifeq ($(PROGRAM), pluginappletviewer)
+ OTHER_CPPFLAGS += -DUSE_UMASK=\"077\"
+endif
+
+# javaws only
+ifeq ($(PROGRAM), javaws)
+ OTHER_CPPFLAGS += -DUSE_UMASK=\"077\"
+endif
+
# GUI tools
ifeq ($(GUI_TOOL),true)
ifneq ($(PLATFORM), windows)
--- jdk/make/mkdemo/jfc/SwingApplet/Makefile.orig 2010-06-21 17:15:08.000000000 -0400
+++ jdk/make/mkdemo/jfc/SwingApplet/Makefile 2010-09-09 16:24:23.000000000 -0400
@@ -33,7 +33,7 @@
include $(BUILDDIR)/common/Defs.gmk
DEMO_ROOT = $(SHARE_SRC)/demo/jfc/$(DEMONAME)
-DEMO_TOPFILES = ./README.txt
+DEMO_TOPFILES = ./README.txt ./SwingApplet.html
DEMO_MAINCLASS = $(DEMONAME)
DEMO_DESTDIR = $(DEMODIR)/jfc/$(DEMONAME)
--- jdk/make/sun/Makefile.orig 2010-06-21 17:15:08.000000000 -0400
+++ jdk/make/sun/Makefile 2010-09-09 16:26:01.000000000 -0400
@@ -66,6 +66,7 @@
$(HEADLESS_SUBDIR) $(DGA_SUBDIR) \
font jpeg cmm applet rmi beans $(JDBC_SUBDIR) \
jawt text nio launcher management $(ORG_SUBDIR) \
+ plugin \
native2ascii serialver tools jconsole
all build clean clobber::
--- jdk/make/sun/plugin/Makefile.orig 2010-09-09 16:26:01.000000000 -0400
+++ jdk/make/sun/plugin/Makefile 2010-09-09 16:26:01.000000000 -0400
@@ -0,0 +1,53 @@
+#
+# Copyright 1995-2005 Sun Microsystems, Inc. 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
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation. Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+#
+# Makefile for pluginappletviewer wrapper.
+#
+
+BUILDDIR = ../..
+PACKAGE = sun.applet
+PRODUCT = sun
+PROGRAM = pluginappletviewer
+include $(BUILDDIR)/common/Defs.gmk
+
+#
+# Files to compile.
+#
+AUTO_FILES_JAVA_DIRS = sun/applet
+
+ifneq ($(PLATFORM), windows)
+ #
+ # Anything with a GUI needs X11 to be linked in.
+ #
+ OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11
+endif # PLATFORM
+
+#
+# Rules
+#
+JAVA_ARGS = { "sun.applet.PluginMain" }
+include $(BUILDDIR)/common/Program.gmk
+
--- jdk/src/share/bin/java.c.orig 2010-06-21 17:15:10.000000000 -0400
+++ jdk/src/share/bin/java.c 2010-09-09 16:25:12.000000000 -0400
@@ -56,6 +56,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/stat.h>
#include <jni.h>
#include <jvm.h>
@@ -69,6 +70,8 @@
#define FULL_VERSION JDK_MAJOR_VERSION "." JDK_MINOR_VERSION
#endif
+#define MAXMASK 4095 /* Same as octal 07777 */
+
/*
* The following environment variable is used to influence the behavior
* of the jre exec'd through the SelectVersion routine. The command line
@@ -184,6 +187,10 @@
int JNICALL JavaMain(void * args); /* entry point */
+/* umask things */
+static int FindUMask(int *, char ***, int *);
+static int VerifyMask(char *, int*);
+
struct JavaMainArgs {
int argc;
char ** argv;
@@ -307,6 +314,26 @@
SetClassPath(s);
#endif
+#ifdef USE_UMASK
+ /* Set umask */
+ int mask;
+ // Check to see if we can find a umask on the command line.
+ if (FindUMask(&argc, &argv, &mask) < 0)
+ {
+ // We didn't find a umask, so fall back to the default one.
+ char * defaultMask = (char *) JLI_MemAlloc(5 * sizeof(char));
+ strcpy(defaultMask, USE_UMASK);
+ int converted;
+ VerifyMask(defaultMask, &converted);
+ JLI_MemFree(defaultMask);
+ umask(converted); /* from sys/stat.h */
+ }
+ else
+ {
+ umask(mask);
+ }
+#endif
+
/*
* Parse command line options; if the return value of
* ParseArguments is false, the program should exit.
@@ -2017,3 +2044,87 @@
}
DoSplashSetFileJarName(file_name, jar_name);
}
+
+/**
+ * Searches argv to find any parameters that start with "-umask=".
+ * Sets maskToSet with the mask if a -umask is found, and if the mask
+ * supplied is valid. Returns 1 if a valid mask was found and set,
+ * -1 otherwise.
+ */
+int FindUMask(int *pargc, char *** pargv, int *maskToSet)
+{
+ int found_mask = -1;
+
+ // our handles to the original list
+ int argc = *pargc;
+ char **argv = *pargv;
+
+ // the new set
+ int nargc = argc;
+ char ** nargv = (char **) JLI_MemAlloc((nargc + 1) * sizeof(char *));
+
+ // set the original set to the new set
+ *pargv = nargv;
+ *pargc = nargc;
+
+ char *maskString = (char *) JLI_MemAlloc(6 * sizeof(char *));
+ int i;
+ for (i = 0; i < argc; i++)
+ {
+ char *arg = argv[i];
+ if (strncmp(arg, "-umask=",7) == 0)
+ {
+ strncpy(maskString, arg+7, 5);
+
+ if (VerifyMask(maskString, maskToSet) < 0)
+ {
+ printf("Invalid umask %s, application stopped.\n", maskString);
+ exit(1);
+ }
+
+ found_mask = 1;
+ nargc--;
+ (*pargc)--;
+ }
+ else
+ {
+ *nargv++ = arg;
+ }
+ }
+
+ JLI_MemFree(maskString);
+
+ return found_mask;
+}
+
+/**
+ * Takes an octal mask in string form, and converts it to
+ * decimal form in convertedMask. The decimal form can then be
+ * easily passed to umask(). Returns 1 if the mask is valid, -1 otherwise.
+ */
+int VerifyMask(char * maskString, int * convertedMask)
+{
+ // Borrowed from coreutils modechange.c
+ if ('0' <= *maskString && *maskString < '8')
+ {
+ unsigned int decimal_mode = 0;
+
+ do {
+ decimal_mode = 8 * decimal_mode + *maskString++ - '0';
+ } while ('0' <= *maskString && *maskString < '8');
+
+ if (decimal_mode > MAXMASK)
+ return -1;
+ else if (*maskString)
+ return -1;
+ else
+ *convertedMask = decimal_mode;
+
+ return 1;
+ }
+ else
+ {
+ return -1;
+ }
+
+}
--- jdk/src/share/classes/sun/applet/AppletViewerPanel.java.orig 2010-06-21 17:15:27.000000000 -0400
+++ jdk/src/share/classes/sun/applet/AppletViewerPanel.java 2010-09-09 16:25:06.000000000 -0400
@@ -42,25 +42,25 @@
*
* @author Arthur van Hoff
*/
-class AppletViewerPanel extends AppletPanel {
+public class AppletViewerPanel extends AppletPanel {
/* Are we debugging? */
- static boolean debug = false;
+ protected static boolean debug = false;
/**
* The document url.
*/
- URL documentURL;
+ protected URL documentURL;
/**
* The base url.
*/
- URL baseURL;
+ protected URL baseURL;
/**
* The attributes of the applet.
*/
- Hashtable atts;
+ protected Hashtable atts;
/*
* JDK 1.1 serialVersionUID
@@ -70,7 +70,7 @@
/**
* Construct an applet viewer and start the applet.
*/
- AppletViewerPanel(URL documentURL, Hashtable atts) {
+ protected AppletViewerPanel(URL documentURL, Hashtable atts) {
this.documentURL = documentURL;
this.atts = atts;
@@ -202,12 +202,12 @@
return (AppletContext)getParent();
}
- static void debug(String s) {
+ protected static void debug(String s) {
if(debug)
System.err.println("AppletViewerPanel:::" + s);
}
- static void debug(String s, Throwable t) {
+ protected static void debug(String s, Throwable t) {
if(debug) {
t.printStackTrace();
debug(s);
--- jdk/src/share/classes/sun/applet/AppletPanel.java.orig 2010-06-21 17:15:27.000000000 -0400
+++ jdk/src/share/classes/sun/applet/AppletPanel.java 2010-09-09 16:25:06.000000000 -0400
@@ -68,7 +68,7 @@
/**
* The applet (if loaded).
*/
- Applet applet;
+ protected Applet applet;
/**
* Applet will allow initialization. Should be
@@ -117,7 +117,7 @@
/**
* The thread for the applet.
*/
- Thread handler;
+ protected Thread handler;
/**
@@ -162,7 +162,8 @@
* Creates a thread to run the applet. This method is called
* each time an applet is loaded and reloaded.
*/
- synchronized void createAppletThread() {
+ //Overridden by NetxPanel.
+ protected synchronized void createAppletThread() {
// Create a thread group for the applet, and start a new
// thread to load the applet.
String nm = "applet-" + getCode();
@@ -306,7 +307,7 @@
/**
* Get an event from the queue.
*/
- synchronized AppletEvent getNextEvent() throws InterruptedException {
+ protected synchronized AppletEvent getNextEvent() throws InterruptedException {
while (queue == null || queue.isEmpty()) {
wait();
}
@@ -695,7 +696,8 @@
* applet event processing so that it can be gracefully interrupted from
* things like HotJava.
*/
- private void runLoader() {
+ //Overridden by NetxPanel.
+ protected void runLoader() {
if (status != APPLET_DISPOSE) {
showAppletStatus("notdisposed");
return;
|