From c47b83d19bc600b7735f40495af2acd5e9e249fc Mon Sep 17 00:00:00 2001 From: martin Date: Wed, 16 Sep 2015 10:49:11 -0700 Subject: [PATCH] 8136570: Stop changing user environment variables related to /usr/dt 4953367: MAWT: Java should be more careful manipulating NLSPATH, XFILESEARCHPATH env variables Summary: Stop changing user environment variables: NLSPATH XFILESEARCHPATH Reviewed-by: prr --- src/solaris/native/java/lang/java_props_md.c | 50 -------------------- 1 file changed, 50 deletions(-) diff --git a/src/solaris/native/java/lang/java_props_md.c b/src/solaris/native/java/lang/java_props_md.c index df55fd32b..46f76426b 100644 --- a/src/solaris/native/java/lang/java_props_md.c +++ b/src/solaris/native/java/lang/java_props_md.c @@ -91,46 +91,6 @@ mapLookup(char* map[], const char* key, char** value) { return 0; } -/* This function sets an environment variable using envstring. - * The format of envstring is "name=value". - * If the name has already existed, it will append value to the name. - */ -static void -setPathEnvironment(char *envstring) -{ - char name[20], *value, *current; - - value = strchr(envstring, '='); /* locate name and value separator */ - - if (! value) - return; /* not a valid environment setting */ - - /* copy first part as environment name */ - strncpy(name, envstring, value - envstring); - name[value-envstring] = '\0'; - - value++; /* set value point to value of the envstring */ - - current = getenv(name); - if (current) { - if (! strstr(current, value)) { - /* value is not found in current environment, append it */ - char *temp = malloc(strlen(envstring) + strlen(current) + 2); - strcpy(temp, name); - strcat(temp, "="); - strcat(temp, current); - strcat(temp, ":"); - strcat(temp, value); - putenv(temp); - } - /* else the value has already been set, do nothing */ - } - else { - /* environment variable is not found */ - putenv(envstring); - } -} - #ifndef P_tmpdir #define P_tmpdir "/var/tmp" #endif @@ -615,16 +575,6 @@ GetJavaProperties(JNIEnv *env) sprops.path_separator = ":"; sprops.line_separator = "\n"; -#if !defined(_ALLBSD_SOURCE) - /* Append CDE message and resource search path to NLSPATH and - * XFILESEARCHPATH, in order to pick localized message for - * FileSelectionDialog window (Bug 4173641). - */ - setPathEnvironment("NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat"); - setPathEnvironment("XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt"); -#endif - - #ifdef MACOSX setProxyProperties(&sprops); #endif -- GitLab