Bug#564772: libjavascript-perl: Segfaults with wpad extraction code
Niko Tyni
ntyni at debian.org
Tue Jan 12 09:11:10 UTC 2010
On Mon, Jan 11, 2010 at 10:07:41PM +0100, Petter Reinholdtsen wrote:
> Package: libjavascript-perl
> For etch, I wrote a script to extract the proxy setting from a WPAD
> script to be able to update /etc/environment at boot. When trying to
> use it with Debian Edu based on Lenny, the script fail and perl
> segfaults. I hope this bug can be fixed in Lenny, because we are
> working on finalizing the Lenny based Debian Edu and it would be great
> if we could get this working using Lenny packages, as we are moving to
> using a WPAD file to specify the proxy setting.
>
> I had to disable the setting of the error handler, as this function
> seem to be missing in the Lenny package.
Using just 'die $@ if $@' for that shows the actual problem:
dnsResolve is not defined at main line 94 in 41
I suppose the old Etch javascript library exposed a dnsResolve() function
but the newer ones don't. I suspect this is not a bug.
It seems to work for me if I supply a dnsResolve() implementation before
the "$cx->eval(get_pac_functions())" line:
use Socket; # for inet_ntoa
$cx->bind_function(name => "dnsResolve", func => sub {
my $name = shift;
my $packed = gethostbyname($name);
return $packed ? inet_ntoa($packed) : undef;
});
This is obviously not IPv6 compatible etc. but it's a start.
I haven't really investigated the segfault: given that there's an error
indicator before it happens and that it's fixed in sid, I don't think
it's worth the effort trying to fix it in lenny. YMMV of course.
Hope this helps,
--
Niko Tyni ntyni at debian.org
More information about the pkg-perl-maintainers
mailing list