[Bug 1222912] Re: Error parsing proxy.pac
Michael Greene
mgreene at securityinnovation.com
Thu Sep 24 20:46:34 UTC 2015
A real oddity to me is that if I put the plugin into debug mode before
running firefox it all works:
$ export ICEDTEAPLUGIN_DEBUG=true
$ firefox --new-instance 2>&1 | tee /tmp/ffdebug.log
(will attach log momentarily)
after downloading the source package and poking around, I found this
code:
gchar* proxy;
uint32_t len;
gchar* decoded_url = (gchar*) calloc(strlen(parts[4]) + 1, sizeof(gchar));
IcedTeaPluginUtilities::decodeURL(parts[4], &decoded_url);
PLUGIN_DEBUG("parts[0]=%s, parts[1]=%s, reference, parts[3]=%s, parts[4]=%s -- decoded_url=%s\n", parts[0], parts[1], parts[3], parts[4], decoded_url);
gchar* proxy_info;
#if MOZILLA_VERSION_COLLAPSED < 1090100
proxy = (char*) malloc(sizeof(char)*2048);
#endif
proxy_info = g_strconcat ("plugin PluginProxyInfo reference ", parts[3], " ", NULL);
if (get_proxy_info(decoded_url, &proxy, &len) == NPERR_NO_ERROR)
{
proxy_info = g_strconcat (proxy_info, proxy, NULL);
}
PLUGIN_DEBUG("Proxy info: %s\n", proxy_info);
plugin_send_message_to_appletviewer(proxy_info);
g_free(decoded_url);
decoded_url = NULL;
g_free(proxy_info);
proxy_info = NULL;
#if MOZILLA_VERSION_COLLAPSED < 1090100
g_free(proxy);
proxy = NULL;
#endif
note that proxy is only allocated if MOZILLA_VERSION_COLLAPSED < 1090100
(is not even initialized otherwise), but is used if get_proxy_info
succeeds, so on the first invocation we get (potentially) garbage output
like so:
plugin PluginProxyInfo reference 0 �Þ
for whatever reason, having debugging enabled causes this not to happen
(perhaps a side-effect of the fprintf call inside the PLUGIN_DEBUG
macro? I'm not really sure)
Anyway, I am building a possible patch for this right now and will
submit once I have verified that it works as I expect it to.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to icedtea-web in Ubuntu.
https://bugs.launchpad.net/bugs/1222912
Title:
Error parsing proxy.pac
Status in icedtea-web package in Ubuntu:
New
Bug description:
Ubuntu 12.04.3 LTS 32-bit up-to-date
When using the following proxy.pac, IcedTea doesn't open embedded java
applets in Firefox or Chromium:
function FindProxyForURL(url, host) {
return "PROXY 192.168.1.3:8080; DIRECT";
}
I had to change to:
function FindProxyForURL(url, host) {
return "PROXY 192.168.1.3:8080";
}
There is some problem passing & parsing proxy.pac configurations.
I tried using proxy.pac using system proxy configuration, browser
proxy configuration and IcedTea Web Control Panel.
My conclusion is that proxy.pac only work if they return one proxy
possibility (as my above example).
Similar to:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1091926
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/icedtea-web/+bug/1222912/+subscriptions
More information about the foundations-bugs
mailing list