From mboxrd@z Thu Jan  1 00:00:00 1970
From: Michael Tremer <michael.tremer@ipfire.org>
To: development@lists.ipfire.org
Subject: Re: Trying to update gd
Date: Fri, 18 Jun 2021 09:35:46 +0100
Message-ID: <41E6BF14-232C-44D6-981D-75CE7012E959@ipfire.org>
In-Reply-To: <09d4731d-c98b-a070-8f67-28fec756a54f@ipfire.org>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============8015161029657856827=="
List-Id: <development.lists.ipfire.org>

--===============8015161029657856827==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Hello,

> On 17 Jun 2021, at 19:53, Adolf Belka <adolf.belka(a)ipfire.org> wrote:
>=20
> Hi All,
>=20
> I found that gd was at version 2.0.33 from 2006 and there have been several=
 updates all the way up to May this year, some of them to fix bugs or securit=
y concerns.

Definitely needs an update!

> So I did a build for version 2.3.1 also taking the opportunity to disable-s=
tatic  libraries.
>=20
> This built successfully and I also ran the find-dependencies as the librari=
es changed from libgd.so.2.0.0 to libgd.3.0.9  There were no dependencies on =
libgd.so.2 or libgd.2.0.0
>=20
> As gd is used for the charts I installed the generated iso into a vm on my =
testbed system to confirm they worked.
>=20
> None of the charts showed any data. Also the log pie charts did not work. T=
he error message from httpd/error_log was:-
>=20
>=20
> Can't load '/usr/lib/perl5/site_perl/5.32.1/x86_64-linux-thread-multi/auto/=
GD/GD.so' for module GD: libtiff.so.5: cannot open shared object file: No suc=
h file or directory at /usr/lib/perl5/5.32.1/x86_64-linux-thread-multi/DynaLo=
ader.pm line 193.
> ^@ at /srv/web/ipfire/cgi-bin/getrrdimage.cgi line 24.
> Compilation failed in require at /srv/web/ipfire/cgi-bin/getrrdimage.cgi li=
ne 24.
> BEGIN failed--compilation aborted at /srv/web/ipfire/cgi-bin/getrrdimage.cg=
i line 24.
> [Thu Jun 17 16:38:29.559844 2021] [cgid:error] [pid 3156:tid 12722785323168=
0] [client 192.168.200.50:49220] End of script output before headers: getrrdi=
mage.cgi, referer: https://ipfire.localdomain:444/
>=20
>=20
> This seems to be saying it can't find libtiff.so.5
>
> Looking through the source tarballs over time I found that version 2.1.0 wa=
s where it started to look for libtiff.
>=20
> I then installed the libtiff addon in my vm and the charts were all working=
. So the new gd requires the libtiff shared object libraries.
>=20
> The addon installs a lot more than just the libtiff so libs so it does not =
seem right to build that structurally into the firewall.
>=20
>=20
> The only option I have come up with is to copy the libtiff so's into /usr/l=
ib/ after the install stage of gd.
>=20
> libtiff is built before gd so the files are available in the build. This wo=
uld seem to then provide the required libs without the rest of the libtiff fi=
les.
>=20
> Is this a reasonable approach to use or is there a different method I shoul=
d be using.

Can you not pass something like =E2=80=94-disable-tiff to the configure scrip=
t of gd to avoid it linking against libtiff?

We do not generate any TIFF files here, so it would be safe to disable that f=
unctionality.

-Michael

>=20
>=20
> Regards,
>=20
> Adolf.
>=20
>=20
> --=20
> Sent from my laptop
>=20


--===============8015161029657856827==--