# HG changeset patch # User mfang # Date 1400775301 25200 # Node ID edece54a1aee1be1bfbbd89b37ec8cc89f993da6 # Parent 5f539eb2a8a6514ad7215e98b1b3f40853f074b6# Parent a96915fc059d38f30b499eeae35ee1d9364165c9 Merge diff -r 5f539eb2a8a6 -r edece54a1aee jdk/make/mapfiles/libjava/mapfile-vers --- a/jdk/make/mapfiles/libjava/mapfile-vers Thu May 22 08:13:14 2014 -0700 +++ b/jdk/make/mapfiles/libjava/mapfile-vers Thu May 22 09:15:01 2014 -0700 @@ -270,7 +270,10 @@ Java_sun_misc_Version_getJvmVersionInfo; Java_sun_misc_Version_getJvmSpecialVersion; Java_sun_misc_VM_latestUserDefinedLoader; - Java_sun_misc_VM_isSetUID; + Java_sun_misc_VM_getuid; + Java_sun_misc_VM_geteuid; + Java_sun_misc_VM_getgid; + Java_sun_misc_VM_getegid; Java_sun_misc_VM_initialize; Java_sun_misc_VMSupport_initAgentProperties; Java_sun_misc_VMSupport_getVMTemporaryDirectory; diff -r 5f539eb2a8a6 -r edece54a1aee jdk/src/share/classes/java/util/TimeZone.java --- a/jdk/src/share/classes/java/util/TimeZone.java Thu May 22 08:13:14 2014 -0700 +++ b/jdk/src/share/classes/java/util/TimeZone.java Thu May 22 09:15:01 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -591,8 +591,7 @@ /** * Gets the platform defined TimeZone ID. **/ - private static native String getSystemTimeZoneID(String javaHome, - String country); + private static native String getSystemTimeZoneID(String javaHome); /** * Gets the custom time zone ID based on the GMT offset of the @@ -650,12 +649,10 @@ // if the time zone ID is not set (yet), perform the // platform to Java time zone ID mapping. if (zoneID == null || zoneID.isEmpty()) { - String country = AccessController.doPrivileged( - new GetPropertyAction("user.country")); String javaHome = AccessController.doPrivileged( new GetPropertyAction("java.home")); try { - zoneID = getSystemTimeZoneID(javaHome, country); + zoneID = getSystemTimeZoneID(javaHome); if (zoneID == null) { zoneID = GMT_ID; } diff -r 5f539eb2a8a6 -r edece54a1aee jdk/src/share/classes/sun/misc/VM.java --- a/jdk/src/share/classes/sun/misc/VM.java Thu May 22 08:13:14 2014 -0700 +++ b/jdk/src/share/classes/sun/misc/VM.java Thu May 22 09:15:01 2014 -0700 @@ -370,7 +370,37 @@ /** * Returns {@code true} if we are in a set UID program. */ - public static native boolean isSetUID(); + public static boolean isSetUID() { + long uid = getuid(); + long euid = geteuid(); + long gid = getgid(); + long egid = getegid(); + return uid != euid || gid != egid; + } + + /** + * Returns the real user ID of the calling process, + * or -1 if the value is not available. + */ + public static native long getuid(); + + /** + * Returns the effective user ID of the calling process, + * or -1 if the value is not available. + */ + public static native long geteuid(); + + /** + * Returns the real group ID of the calling process, + * or -1 if the value is not available. + */ + public static native long getgid(); + + /** + * Returns the effective group ID of the calling process, + * or -1 if the value is not available. + */ + public static native long getegid(); static { initialize(); diff -r 5f539eb2a8a6 -r edece54a1aee jdk/src/share/classes/sun/security/krb5/internal/rcache/DflCache.java --- a/jdk/src/share/classes/sun/security/krb5/internal/rcache/DflCache.java Thu May 22 08:13:14 2014 -0700 +++ b/jdk/src/share/classes/sun/security/krb5/internal/rcache/DflCache.java Thu May 22 09:15:01 2014 -0700 @@ -39,7 +39,6 @@ import java.security.AccessController; import java.util.*; -import com.sun.security.auth.module.UnixSystem; import sun.security.action.GetPropertyAction; import sun.security.krb5.internal.KerberosTime; import sun.security.krb5.internal.Krb5; @@ -61,8 +60,7 @@ * * service_euid * - * Java does not have a method to get euid, so uid is used instead. This - * should normally to be since a Java program is seldom used as a setuid app. + * in which euid is available as sun.misc.VM.geteuid(). * * The file has a header: * @@ -108,14 +106,8 @@ private static long uid; static { - try { - // Available on Solaris, Linux and Mac. Otherwise, no _euid suffix - UnixSystem us = new com.sun.security.auth.module.UnixSystem(); - uid = us.getUid(); - } catch (Throwable e) { - // Cannot be only Exception, might be UnsatisfiedLinkError - uid = -1; - } + // Available on Solaris, Linux and Mac. Otherwise, -1 and no _euid suffix + uid = sun.misc.VM.geteuid(); } public DflCache (String source) { diff -r 5f539eb2a8a6 -r edece54a1aee jdk/src/share/classes/sun/tools/serialver/SerialVer.java --- a/jdk/src/share/classes/sun/tools/serialver/SerialVer.java Thu May 22 08:13:14 2014 -0700 +++ b/jdk/src/share/classes/sun/tools/serialver/SerialVer.java Thu May 22 09:15:01 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -26,8 +26,6 @@ package sun.tools.serialver; import java.io.*; -import java.awt.*; -import java.applet.*; import java.io.ObjectStreamClass; import java.util.Properties; import java.text.MessageFormat; @@ -39,106 +37,7 @@ import java.util.StringTokenizer; import sun.net.www.ParseUtil; -public class SerialVer extends Applet { - GridBagLayout gb; - TextField classname_t; - Button show_b; - TextField serialversion_t; - Label footer_l; - - private static final long serialVersionUID = 7666909783837760853L; - - public synchronized void init() { - gb = new GridBagLayout(); - setLayout(gb); - - GridBagConstraints c = new GridBagConstraints(); - c.fill = GridBagConstraints.BOTH; - - Label l1 = new Label(Res.getText("FullClassName")); - l1.setAlignment(Label.RIGHT); - gb.setConstraints(l1, c); - add(l1); - - classname_t = new TextField(20); - c.gridwidth = GridBagConstraints.RELATIVE; - c.weightx = 1.0; - gb.setConstraints(classname_t, c); - add(classname_t); - - show_b = new Button(Res.getText("Show")); - c.gridwidth = GridBagConstraints.REMAINDER; - c.weightx = 0.0; /* Don't grow the button */ - gb.setConstraints(show_b, c); - add(show_b); - - Label l2 = new Label(Res.getText("SerialVersion")); - l2.setAlignment(Label.RIGHT); - c.gridwidth = 1; - gb.setConstraints(l2, c); - add(l2); - - serialversion_t = new TextField(50); - serialversion_t.setEditable(false); - c.gridwidth = GridBagConstraints.REMAINDER; - gb.setConstraints(serialversion_t, c); - add(serialversion_t); - - footer_l = new Label(); - c.gridwidth = GridBagConstraints.REMAINDER; - gb.setConstraints(footer_l, c); - add(footer_l); - - /* Give the focus to the type-in area */ - classname_t.requestFocus(); - } - - public void start() { - /* Give the focus to the type-in area */ - classname_t.requestFocus(); - } - - @SuppressWarnings("deprecation") - public boolean action(Event ev, Object obj) { - if (ev.target == classname_t) { - show((String)ev.arg); - return true; - } else if (ev.target == show_b) { - show(classname_t.getText()); - return true; - } - return false; - } - - - @SuppressWarnings("deprecation") - public boolean handleEvent(Event ev) { - boolean rc = super.handleEvent(ev); - return rc; - } - - /** - * Lookup the specified classname and display it. - */ - void show(String classname) { - try { - footer_l.setText(""); // Clear the message - serialversion_t.setText(""); // clear the last value - - if (classname.equals("")) { - return; - } - - String s = serialSyntax(classname); - if (s != null) { - serialversion_t.setText(s); - } else { - footer_l.setText(Res.getText("NotSerializable", classname)); - } - } catch (ClassNotFoundException cnf) { - footer_l.setText(Res.getText("ClassNotFound", classname)); - } - } +public class SerialVer { /* * A class loader that will load from the CLASSPATH environment @@ -218,13 +117,7 @@ } } - @SuppressWarnings("deprecation") - private static void showWindow(Window w) { - w.show(); - } - public static void main(String[] args) { - boolean show = false; String envcp = null; int i = 0; @@ -234,9 +127,7 @@ } for (i = 0; i < args.length; i++) { - if (args[i].equals("-show")) { - show = true; - } else if (args[i].equals("-classpath")) { + if (args[i].equals("-classpath")) { if ((i+1 == args.length) || args[i+1].startsWith("-")) { System.err.println(Res.getText("error.missing.classpath")); usage(); @@ -278,51 +169,35 @@ System.exit(3); } - if (!show) { - /* - * Check if there are any class names specified, if it is not a - * invocation with the -show option. - */ - if (i == args.length) { - usage(); - System.exit(1); - } + /* + * Check if there are any class names specified + */ + if (i == args.length) { + usage(); + System.exit(1); + } - /* - * The rest of the parameters are classnames. - */ - boolean exitFlag = false; - for (i = i; i < args.length; i++ ) { - try { - String syntax = serialSyntax(args[i]); - if (syntax != null) - System.out.println(args[i] + ":" + syntax); - else { - System.err.println(Res.getText("NotSerializable", - args[i])); - exitFlag = true; - } - } catch (ClassNotFoundException cnf) { - System.err.println(Res.getText("ClassNotFound", args[i])); + /* + * The rest of the parameters are classnames. + */ + boolean exitFlag = false; + for (i = i; i < args.length; i++ ) { + try { + String syntax = serialSyntax(args[i]); + if (syntax != null) + System.out.println(args[i] + ":" + syntax); + else { + System.err.println(Res.getText("NotSerializable", + args[i])); exitFlag = true; } - } - if (exitFlag) { - System.exit(1); - } - } else { - if (i < args.length) { - System.err.println(Res.getText("ignoring.classes")); - System.exit(1); + } catch (ClassNotFoundException cnf) { + System.err.println(Res.getText("ClassNotFound", args[i])); + exitFlag = true; } - Frame f = new SerialVerFrame(); - // f.setLayout(new FlowLayout()); - SerialVer sv = new SerialVer(); - sv.init(); - - f.add("Center", sv); - f.pack(); - showWindow(f); + } + if (exitFlag) { + System.exit(1); } } @@ -337,65 +212,6 @@ } /** - * Top level frame so serialVer can be run as an main program - * and have an exit menu item. - */ -class SerialVerFrame extends Frame { - MenuBar menu_mb; - Menu file_m; - MenuItem exit_i; - - private static final long serialVersionUID = -7248105987187532533L; - - /* - * Construct a new Frame with title and menu. - */ - SerialVerFrame() { - super(Res.getText("SerialVersionInspector")); - - /* Create the file menu */ - file_m = new Menu(Res.getText("File")); - file_m.add(exit_i = new MenuItem(Res.getText("Exit"))); - - /* Now add the file menu to the menu bar */ - menu_mb = new MenuBar(); - menu_mb.add(file_m); - - /* Add the menubar to the frame */ - // Bug in JDK1.1 setMenuBar(menu_mb); - } - - /* - * Handle a window destroy event by exiting. - */ - @SuppressWarnings("deprecation") - public boolean handleEvent(Event e) { - if (e.id == Event.WINDOW_DESTROY) { - exit(0); - } - return super.handleEvent(e); - } - /* - * Handle an Exit event by exiting. - */ - @SuppressWarnings("deprecation") - public boolean action(Event ev, Object obj) { - if (ev.target == exit_i) { - exit(0); - } - return false; - } - - /* - * Cleanup and exit. - */ - void exit(int ret) { - System.exit(ret); - } - -} - -/** * Utility for integrating with serialver and for localization. * Handle Resources. Access to error and warning counts. * Message formatting. diff -r 5f539eb2a8a6 -r edece54a1aee jdk/src/share/classes/sun/tools/serialver/resources/serialver.properties --- a/jdk/src/share/classes/sun/tools/serialver/resources/serialver.properties Thu May 22 08:13:14 2014 -0700 +++ b/jdk/src/share/classes/sun/tools/serialver/resources/serialver.properties Thu May 22 09:15:01 2014 -0700 @@ -1,9 +1,3 @@ -SerialVersionInspector=Serial Version Inspector -File=File -Exit=Exit -Show=Show -FullClassName=Full Class Name: -SerialVersion=Serial Version: NotSerializable=\ Class {0} is not Serializable. ClassNotFound=\ @@ -14,7 +8,5 @@ Missing argument for -classpath option invalid.flag=\ Invalid flag {0}. -ignoring.classes=\ - Cannot specify class arguments with the -show option usage=\ - use: serialver [-classpath classpath] [-show] [classname...] + use: serialver [-classpath classpath] [classname...] diff -r 5f539eb2a8a6 -r edece54a1aee jdk/src/share/lib/security/sunpkcs11-solaris.cfg --- a/jdk/src/share/lib/security/sunpkcs11-solaris.cfg Thu May 22 08:13:14 2014 -0700 +++ b/jdk/src/share/lib/security/sunpkcs11-solaris.cfg Thu May 22 09:15:01 2014 -0700 @@ -18,16 +18,6 @@ disabledMechanisms = { CKM_DSA_KEY_PAIR_GEN -# the following mechanisms are disabled due to CKR_SAVED_STATE_INVALID bug -# (Solaris bug 7058108) - CKM_MD2 - CKM_MD5 - CKM_SHA_1 -# the following mechanisms are disabled due to no cloning support -# (Solaris bug 7050617) - CKM_SHA256 - CKM_SHA384 - CKM_SHA512 # the following mechanisms are disabled due to performance issues # (Solaris bug 6337157) CKM_DSA_SHA1 diff -r 5f539eb2a8a6 -r edece54a1aee jdk/src/share/native/java/util/TimeZone.c --- a/jdk/src/share/native/java/util/TimeZone.c Thu May 22 08:13:14 2014 -0700 +++ b/jdk/src/share/native/java/util/TimeZone.c Thu May 22 09:15:01 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -38,42 +38,28 @@ */ JNIEXPORT jstring JNICALL Java_java_util_TimeZone_getSystemTimeZoneID(JNIEnv *env, jclass ign, - jstring java_home, jstring country) + jstring java_home) { - const char *cname; const char *java_home_dir; char *javaTZ; + jstring jstrJavaTZ = NULL; - if (java_home == NULL) - return NULL; + CHECK_NULL_RETURN(java_home, NULL); java_home_dir = JNU_GetStringPlatformChars(env, java_home, 0); - if (java_home_dir == NULL) - return NULL; - - if (country != NULL) { - cname = JNU_GetStringPlatformChars(env, country, 0); - /* ignore error cases for cname */ - } else { - cname = NULL; - } + CHECK_NULL_RETURN(java_home_dir, NULL); /* * Invoke platform dependent mapping function */ - javaTZ = findJavaTZ_md(java_home_dir, cname); - - free((void *)java_home_dir); - if (cname != NULL) { - free((void *)cname); + javaTZ = findJavaTZ_md(java_home_dir); + if (javaTZ != NULL) { + jstrJavaTZ = JNU_NewStringPlatform(env, javaTZ); + free((void *)javaTZ); } - if (javaTZ != NULL) { - jstring jstrJavaTZ = JNU_NewStringPlatform(env, javaTZ); - free((void *)javaTZ); - return jstrJavaTZ; - } - return NULL; + JNU_ReleaseStringPlatformChars(env, java_home, java_home_dir); + return jstrJavaTZ; } /* diff -r 5f539eb2a8a6 -r edece54a1aee jdk/src/solaris/native/java/util/TimeZone_md.c --- a/jdk/src/solaris/native/java/util/TimeZone_md.c Thu May 22 08:13:14 2014 -0700 +++ b/jdk/src/solaris/native/java/util/TimeZone_md.c Thu May 22 09:15:01 2014 -0700 @@ -652,11 +652,11 @@ * using /lib/tzmappings. If the TZ value is not found, it * trys some libc implementation dependent mappings. If it still * can't map to a Java time zone ID, it falls back to the GMT+/-hh:mm - * form. `country', which can be null, is not used for UNIX platforms. + * form. */ /*ARGSUSED1*/ char * -findJavaTZ_md(const char *java_home_dir, const char *country) +findJavaTZ_md(const char *java_home_dir) { char *tz; char *javatz = NULL; diff -r 5f539eb2a8a6 -r edece54a1aee jdk/src/solaris/native/java/util/TimeZone_md.h --- a/jdk/src/solaris/native/java/util/TimeZone_md.h Thu May 22 08:13:14 2014 -0700 +++ b/jdk/src/solaris/native/java/util/TimeZone_md.h Thu May 22 09:15:01 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -26,7 +26,7 @@ #ifndef _TIMEZONE_MD_H #define _TIMEZONE_MD_H -char *findJavaTZ_md(const char *java_home_dir, const char *region); +char *findJavaTZ_md(const char *java_home_dir); char *getGMTOffsetID(); #endif diff -r 5f539eb2a8a6 -r edece54a1aee jdk/src/solaris/native/sun/misc/VM_md.c --- a/jdk/src/solaris/native/sun/misc/VM_md.c Thu May 22 08:13:14 2014 -0700 +++ b/jdk/src/solaris/native/sun/misc/VM_md.c Thu May 22 09:15:01 2014 -0700 @@ -27,12 +27,26 @@ #include "jni_util.h" -JNIEXPORT jboolean JNICALL -Java_sun_misc_VM_isSetUID(JNIEnv *env, jclass thisclass) { +JNIEXPORT jlong JNICALL +Java_sun_misc_VM_getuid(JNIEnv *env, jclass thisclass) { + + return getuid(); +} + +JNIEXPORT jlong JNICALL +Java_sun_misc_VM_geteuid(JNIEnv *env, jclass thisclass) { + + return geteuid(); +} - /* Return true if we are in a set UID or set GID process. */ - if (getuid() != geteuid() || getgid() != getegid()) { - return JNI_TRUE; - } - return JNI_FALSE; +JNIEXPORT jlong JNICALL +Java_sun_misc_VM_getgid(JNIEnv *env, jclass thisclass) { + + return getgid(); } + +JNIEXPORT jlong JNICALL +Java_sun_misc_VM_getegid(JNIEnv *env, jclass thisclass) { + + return getegid(); +} diff -r 5f539eb2a8a6 -r edece54a1aee jdk/src/windows/native/java/util/TimeZone_md.c --- a/jdk/src/windows/native/java/util/TimeZone_md.c Thu May 22 08:13:14 2014 -0700 +++ b/jdk/src/windows/native/java/util/TimeZone_md.c Thu May 22 09:15:01 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -394,31 +394,34 @@ * * value_type is one of the following values: * VALUE_KEY for exact key matching - * VALUE_MAPID for MapID and country-based mapping (this is + * VALUE_MAPID for MapID (this is * required for the old Windows, such as NT 4.0 SP3). */ static char *matchJavaTZ(const char *java_home_dir, int value_type, char *tzName, - char *mapID, const char *country) + char *mapID) { int line; int IDmatched = 0; FILE *fp; char *javaTZName = NULL; char *items[TZ_NITEMS]; - char mapFileName[_MAX_PATH + 1]; + char *mapFileName; char lineBuffer[MAX_ZONE_CHAR * 4]; - char bestMatch[MAX_ZONE_CHAR]; - int noMapID = *mapID == '\0'; /* no mapID on Vista */ + int noMapID = *mapID == '\0'; /* no mapID on Vista and later */ - bestMatch[0] = '\0'; - + mapFileName = malloc(strlen(java_home_dir) + strlen(MAPPINGS_FILE) + 1); + if (mapFileName == NULL) { + return NULL; + } strcpy(mapFileName, java_home_dir); strcat(mapFileName, MAPPINGS_FILE); if ((fp = fopen(mapFileName, "r")) == NULL) { jio_fprintf(stderr, "can't open %s.\n", mapFileName); + free((void *) mapFileName); return NULL; } + free((void *) mapFileName); line = 0; while (fgets(lineBuffer, sizeof(lineBuffer), fp) != NULL) { @@ -469,18 +472,6 @@ javaTZName = _strdup(items[TZ_JAVA_NAME]); break; } - /* - * Try to find the most likely time zone. - */ - if (*items[TZ_REGION] == '\0') { - strncpy(bestMatch, items[TZ_JAVA_NAME], MAX_ZONE_CHAR); - } else if (country != NULL && strcmp(items[TZ_REGION], country) == 0) { - if (value_type == VALUE_MAPID) { - javaTZName = _strdup(items[TZ_JAVA_NAME]); - break; - } - strncpy(bestMatch, items[TZ_JAVA_NAME], MAX_ZONE_CHAR); - } } else { if (IDmatched == 1) { /* @@ -492,9 +483,6 @@ } fclose(fp); - if (javaTZName == NULL && bestMatch[0] != '\0') { - javaTZName = _strdup(bestMatch); - } return javaTZName; illegal_format: @@ -506,7 +494,7 @@ /* * Detects the platform time zone which maps to a Java time zone ID. */ -char *findJavaTZ_md(const char *java_home_dir, const char *country) +char *findJavaTZ_md(const char *java_home_dir) { char winZoneName[MAX_ZONE_CHAR]; char winMapID[MAX_MAPID_LENGTH]; @@ -521,7 +509,7 @@ std_timezone = _strdup(winZoneName); } else { std_timezone = matchJavaTZ(java_home_dir, result, - winZoneName, winMapID, country); + winZoneName, winMapID); } } diff -r 5f539eb2a8a6 -r edece54a1aee jdk/src/windows/native/java/util/TimeZone_md.h --- a/jdk/src/windows/native/java/util/TimeZone_md.h Thu May 22 08:13:14 2014 -0700 +++ b/jdk/src/windows/native/java/util/TimeZone_md.h Thu May 22 09:15:01 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -26,7 +26,7 @@ #ifndef _TIMEZONE_MD_H #define _TIMEZONE_MD_H -char *findJavaTZ_md(const char *java_home_dir, const char *region); +char *findJavaTZ_md(const char *java_home_dir); char *getGMTOffsetID(); #endif diff -r 5f539eb2a8a6 -r edece54a1aee jdk/src/windows/native/sun/misc/VM_md.c --- a/jdk/src/windows/native/sun/misc/VM_md.c Thu May 22 08:13:14 2014 -0700 +++ b/jdk/src/windows/native/sun/misc/VM_md.c Thu May 22 09:15:01 2014 -0700 @@ -26,9 +26,30 @@ #include "jni_util.h" -JNIEXPORT jboolean JNICALL -Java_sun_misc_VM_isSetUID(JNIEnv *env, jclass thisclass) { +JNIEXPORT jlong JNICALL +Java_sun_misc_VM_getuid(JNIEnv *env, jclass thisclass) { + + /* -1 means function not available. */ + return -1; +} + +JNIEXPORT jlong JNICALL +Java_sun_misc_VM_geteuid(JNIEnv *env, jclass thisclass) { + + /* -1 means function not available. */ + return -1; +} - /* There is no set UID on Windows. */ - return JNI_FALSE; +JNIEXPORT jlong JNICALL +Java_sun_misc_VM_getgid(JNIEnv *env, jclass thisclass) { + + /* -1 means function not available. */ + return -1; } + +JNIEXPORT jlong JNICALL +Java_sun_misc_VM_getegid(JNIEnv *env, jclass thisclass) { + + /* -1 means function not available. */ + return -1; +} diff -r 5f539eb2a8a6 -r edece54a1aee jdk/test/com/sun/jdi/BadHandshakeTest.java --- a/jdk/test/com/sun/jdi/BadHandshakeTest.java Thu May 22 08:13:14 2014 -0700 +++ b/jdk/test/com/sun/jdi/BadHandshakeTest.java Thu May 22 09:15:01 2014 -0700 @@ -26,7 +26,7 @@ * @summary Check that a bad handshake doesn't cause a debuggee to abort * @library /lib/testlibrary * - * @build VMConnection BadHandshakeTest Exit0 + * @build jdk.testlibrary.* VMConnection BadHandshakeTest Exit0 * @run main BadHandshakeTest * */ diff -r 5f539eb2a8a6 -r edece54a1aee jdk/test/com/sun/jdi/ExclusiveBind.java --- a/jdk/test/com/sun/jdi/ExclusiveBind.java Thu May 22 08:13:14 2014 -0700 +++ b/jdk/test/com/sun/jdi/ExclusiveBind.java Thu May 22 09:15:01 2014 -0700 @@ -27,8 +27,7 @@ * at the same time. * @library /lib/testlibrary * - * @build jdk.testlibrary.ProcessTools jdk.testlibrary.JDKToolLauncher jdk.testlibrary.Utils - * @build VMConnection ExclusiveBind HelloWorld + * @build jdk.testlibrary.* VMConnection ExclusiveBind HelloWorld * @run main ExclusiveBind */ import java.net.ServerSocket; diff -r 5f539eb2a8a6 -r edece54a1aee jdk/test/com/sun/tools/attach/TempDirTest.java --- a/jdk/test/com/sun/tools/attach/TempDirTest.java Thu May 22 08:13:14 2014 -0700 +++ b/jdk/test/com/sun/tools/attach/TempDirTest.java Thu May 22 09:15:01 2014 -0700 @@ -38,7 +38,7 @@ * @bug 8033104 * @summary Test to make sure attach and jvmstat works correctly when java.io.tmpdir is set * @library /lib/testlibrary - * @run build Application Shutdown RunnerUtil + * @run build jdk.testlibrary.* Application Shutdown RunnerUtil * @run main TempDirTest */ diff -r 5f539eb2a8a6 -r edece54a1aee jdk/test/java/lang/instrument/DaemonThread/TestDaemonThread.java --- a/jdk/test/java/lang/instrument/DaemonThread/TestDaemonThread.java Thu May 22 08:13:14 2014 -0700 +++ b/jdk/test/java/lang/instrument/DaemonThread/TestDaemonThread.java Thu May 22 09:15:01 2014 -0700 @@ -26,7 +26,7 @@ * @summary Assert in java.lang.instrument agents during shutdown when classloading occurs after shutdown * @library /lib/testlibrary * - * @build DummyAgent DummyClass TestDaemonThreadLauncher TestDaemonThread + * @build jdk.testlibrary.* DummyAgent DummyClass TestDaemonThreadLauncher TestDaemonThread * @run shell ../MakeJAR3.sh DummyAgent * @run main TestDaemonThreadLauncher /timeout=240 * diff -r 5f539eb2a8a6 -r edece54a1aee jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java --- a/jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java Thu May 22 08:13:14 2014 -0700 +++ b/jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java Thu May 22 09:15:01 2014 -0700 @@ -33,7 +33,7 @@ * @author Mandy Chung * * @library /lib/testlibrary/ - * @build ResetPeakMemoryUsage MemoryUtil RunUtil + * @build jdk.testlibrary.* ResetPeakMemoryUsage MemoryUtil RunUtil * @run main ResetPeakMemoryUsage */ diff -r 5f539eb2a8a6 -r edece54a1aee jdk/test/sun/management/jdp/JdpDefaultsTest.java --- a/jdk/test/sun/management/jdp/JdpDefaultsTest.java Thu May 22 08:13:14 2014 -0700 +++ b/jdk/test/sun/management/jdp/JdpDefaultsTest.java Thu May 22 09:15:01 2014 -0700 @@ -28,7 +28,7 @@ * @test JdpDefaultsTest * @summary Assert that we can read JDP packets from a multicast socket connection, on default IP and port. * @library /lib/testlibrary - * @build ClientConnection JdpTestUtil JdpTestCase JdpOnTestCase DynamicLauncher + * @build jdk.testlibrary.* ClientConnection JdpTestUtil JdpTestCase JdpOnTestCase DynamicLauncher * @run main JdpDefaultsTest */ diff -r 5f539eb2a8a6 -r edece54a1aee jdk/test/sun/management/jdp/JdpOffTest.java --- a/jdk/test/sun/management/jdp/JdpOffTest.java Thu May 22 08:13:14 2014 -0700 +++ b/jdk/test/sun/management/jdp/JdpOffTest.java Thu May 22 09:15:01 2014 -0700 @@ -29,7 +29,7 @@ * @test JdpOffTest.java * @summary Assert that no JDP packets are sent to the default address and port. * @library /lib/testlibrary - * @build ClientConnection JdpTestUtil JdpTestCase JdpOffTestCase DynamicLauncher + * @build jdk.testlibrary.* ClientConnection JdpTestUtil JdpTestCase JdpOffTestCase DynamicLauncher * @run main JdpOffTest */ diff -r 5f539eb2a8a6 -r edece54a1aee jdk/test/sun/management/jdp/JdpSpecificAddressTest.java --- a/jdk/test/sun/management/jdp/JdpSpecificAddressTest.java Thu May 22 08:13:14 2014 -0700 +++ b/jdk/test/sun/management/jdp/JdpSpecificAddressTest.java Thu May 22 09:15:01 2014 -0700 @@ -28,7 +28,7 @@ * @test JdpSpecificAddressTest * @summary Assert that we can read JDP packets from a multicast socket connection, on specific IP and port. * @library /lib/testlibrary - * @build ClientConnection JdpTestUtil JdpTestCase JdpOnTestCase DynamicLauncher + * @build jdk.testlibrary.* ClientConnection JdpTestUtil JdpTestCase JdpOnTestCase DynamicLauncher * @run main JdpSpecificAddressTest */ diff -r 5f539eb2a8a6 -r edece54a1aee jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java --- a/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java Thu May 22 08:13:14 2014 -0700 +++ b/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java Thu May 22 09:15:01 2014 -0700 @@ -42,9 +42,7 @@ * without connection or username/password details. * TestManager will attempt a connection to the address obtained from * both agent properties and jvmstat buffer. - * @build jdk.testlibrary.ProcessTools - * @build jdk.testlibrary.Utils - * @build TestManager TestApplication + * @build jdk.testlibrary.* TestManager TestApplication * @run main/othervm/timeout=300 -XX:+UsePerfData LocalManagementTest */ diff -r 5f539eb2a8a6 -r edece54a1aee jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.java --- a/jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.java Thu May 22 08:13:14 2014 -0700 +++ b/jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.java Thu May 22 09:15:01 2014 -0700 @@ -28,11 +28,7 @@ * @library /lib/testlibrary * @bug 6557093 * @summary Check SSL config file permission for out-of-the-box management - * @build jdk.testlibrary.Utils - * @build jdk.testlibrary.ProcessTools - * @build jdk.testlibrary.OutputAnalyzer - * @build AbstractFilePermissionTest - * @build Dummy + * @build jdk.testlibrary.* AbstractFilePermissionTest Dummy * @run main/timeout=300 PasswordFilePermissionTest * * @author Taras Ledkov diff -r 5f539eb2a8a6 -r edece54a1aee jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh --- a/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh Thu May 22 08:13:14 2014 -0700 +++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh Thu May 22 09:15:01 2014 -0700 @@ -27,11 +27,7 @@ # @summary Test RMI Bootstrap # # @library /lib/testlibrary -# @library /lib/testlibrary -# @build jdk.testlibrary.Utils -# @build TestLogger -# @build Utils -# @build RmiBootstrapTest +# @build jdk.testlibrary.* TestLogger Utils RmiBootstrapTest # @run shell/timeout=300 RmiBootstrapTest.sh # Define the Java class test name diff -r 5f539eb2a8a6 -r edece54a1aee jdk/test/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java --- a/jdk/test/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java Thu May 22 08:13:14 2014 -0700 +++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java Thu May 22 09:15:01 2014 -0700 @@ -42,10 +42,7 @@ * @library /lib/testlibrary * @bug 6228231 * @summary Test that RMI registry uses SSL. - * @build jdk.testlibrary.Utils - * @build jdk.testlibrary.ProcessTools - * @build jdk.testlibrary.OutputAnalyzer - * @build RmiRegistrySslTestApp + * @build jdk.testlibrary.* RmiRegistrySslTestApp * @run main/timeout=300 RmiRegistrySslTest * @author Luis-Miguel Alventosa, Taras Ledkov */ diff -r 5f539eb2a8a6 -r edece54a1aee jdk/test/sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh --- a/jdk/test/sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh Thu May 22 08:13:14 2014 -0700 +++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh Thu May 22 09:15:01 2014 -0700 @@ -27,10 +27,7 @@ # @summary Test RMI Bootstrap with SSL # # @library /lib/testlibrary -# @build jdk.testlibrary.Utils -# @build TestLogger -# @build Utils -# @build RmiBootstrapTest +# @build jdk.testlibrary.* TestLogger Utils RmiBootstrapTest # @run shell/timeout=300 RmiSslBootstrapTest.sh # Define the Java class test name diff -r 5f539eb2a8a6 -r edece54a1aee jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.java --- a/jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.java Thu May 22 08:13:14 2014 -0700 +++ b/jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.java Thu May 22 09:15:01 2014 -0700 @@ -27,12 +27,7 @@ * @test * @library /lib/testlibrary * @bug 6557093 - * @bug 6557093 - * @build jdk.testlibrary.Utils - * @build jdk.testlibrary.ProcessTools - * @build jdk.testlibrary.OutputAnalyzer - * @build Dummy - * @build AbstractFilePermissionTest + * @build jdk.testlibrary.* Dummy AbstractFilePermissionTest * @summary Check SSL config file permission for out-of-the-box management * @run main/timeout=300 SSLConfigFilePermissionTest * diff -r 5f539eb2a8a6 -r edece54a1aee jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java --- a/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java Thu May 22 08:13:14 2014 -0700 +++ b/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java Thu May 22 09:15:01 2014 -0700 @@ -54,10 +54,7 @@ * @test * @bug 7110104 * @library /lib/testlibrary - * @build jdk.testlibrary.ProcessTools - * @build jdk.testlibrary.JDKToolLauncher - * @build jdk.testlibrary.Utils - * @build JMXStartStopTest JMXStartStopDoSomething + * @build jdk.testlibrary.* JMXStartStopTest JMXStartStopDoSomething * @run main/othervm JMXStartStopTest * @summary Makes sure that enabling/disabling the management agent through * JCMD achieves the desired results diff -r 5f539eb2a8a6 -r edece54a1aee jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java --- a/jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java Thu May 22 08:13:14 2014 -0700 +++ b/jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java Thu May 22 09:15:01 2014 -0700 @@ -40,7 +40,6 @@ import java.security.MessageDigest; import java.util.*; -import com.sun.security.auth.module.UnixSystem; import sun.security.jgss.GSSUtil; import sun.security.krb5.internal.APReq; import sun.security.krb5.internal.rcache.AuthTime; @@ -79,13 +78,7 @@ mode = -1; } - try { - UnixSystem us = new com.sun.security.auth.module.UnixSystem(); - uid = us.getUid(); - } catch (Throwable e) { - // Cannot be only Exception, might be UnsatisfiedLinkError - uid = -1; - } + uid = sun.misc.VM.geteuid(); KDC kdc = KDC.create(OneKDC.REALM, HOST, 0, true); for (int i=0; i