/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include <dlfcn.h>
#include <Security/AuthSession.h>
#include <CoreFoundation/CoreFoundation.h>
#include <SystemConfiguration/SystemConfiguration.h>
#include "java_props_macosx.h"
static void *getJRSFramework() {
jrsFwk = dlopen("/System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/JavaRuntimeSupport", RTLD_LAZY | RTLD_LOCAL);
}
return jrsFwk;
}
}
}
switch (cat) {
case LC_MESSAGES:
{
char *(*JRSCopyCanonicalLanguageForPrimaryLanguage)(char *) = dlsym(jrsFwk, "JRSCopyCanonicalLanguageForPrimaryLanguage");
char *canonicalLanguage = JRSCopyCanonicalLanguageForPrimaryLanguage ? JRSCopyCanonicalLanguageForPrimaryLanguage(primaryLanguage) : NULL;
return canonicalLanguage;
}
break;
default:
{
return strdup(localeString);
}
}
break;
}
return NULL;
}
/* There are several toolkit options on Mac OS X, so we should try to
* pick the "best" one, given what we know about the environment Java
* is running under
*/
return unset;
}
static bool isInAquaSession() {
// Is the WindowServer available?
if (!(session_info & sessionHasGraphicAccess)) return false;
return true;
}
}
}
return;
}
return;
}
}
static Boolean getProxyInfoForProtocol(CFDictionaryRef inDict, CFStringRef inEnabledKey, CFStringRef inHostKey, CFStringRef inPortKey, CFStringRef *outProxyHost, int *ioProxyPort) {
/* See if the proxy is enabled. */
if (cf_enabled == NULL) {
return false;
}
int isEnabled = false;
return isEnabled;
}
if (!isEnabled) return false;
// If cf_host is null, that means the checkbox is set,
// but no host was entered. We'll treat that as NOT ENABLED.
// If cf_port is null or cf_port isn't a number, that means
// no port number was entered. Treat this as ENABLED with the
// protocol's default port.
if (*outProxyHost == NULL) {
return false;
}
if (CFStringGetLength(*outProxyHost) == 0) {
return false;
}
int newPort = 0;
newPort > 0) {
*ioProxyPort = newPort;
} else {
// bad port or no port - leave *ioProxyPort unchanged
}
return true;
}
return returnVal;
}
return NULL;
}
// Return TRUE if str is a syntactically valid IP address.
// Using inet_pton() instead of inet_aton() for IPv6 support.
// len is only a hint; cstr must still be nul-terminated
}
// Convert Mac OS X proxy exception entry to Java syntax.
// See Radar #3441134 for details.
// Returns NULL if this exception should be ignored by Java.
// May generate a string with multiple exceptions separated by '|'.
// This is done with char* instead of CFString because inet_pton()
// needs a C string.
if (!c_exception) return NULL;
// 1. sanitize exception prefix
c_len -= 1;
c_len -= 2;
}
// 2. pre-reject other exception wildcards
return NULL;
}
// 3. no IP wildcarding
return c_exception;
}
// 4. allow domain suffixes
// c_exception is now "str\0" - change to "str|*.str\0"
if (!c_exception) return NULL;
return c_exception;
}
/*
* Method for fetching proxy info and storing it in the propery list.
*/
int
/* Read the proxy exceptions list */
/* Convert this exception from Mac OS X syntax to Java syntax.
See Radar #3441134 for details. This may generate a string
with multiple Java exceptions separated by '|'. */
if (c_exception) {
/* Append the host to the list of exclusions. */
if (CFStringGetLength(cf_exceptionList) > 0) {
}
}
}
}
}
if (cf_exceptionList != NULL) {
if (CFStringGetLength(cf_exceptionList) > 0) {
}
}
}
}