[SRU] Not looking for library in multiarch-friendly path

Bug #1005425 reported by Gerben
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
mod-proxy-html (Debian)
Fix Released
Unknown
mod-proxy-html (Ubuntu)
Fix Released
Undecided
Unassigned
Precise
Won't Fix
Undecided
Aditya V

Bug Description

SRU Request for Precise

##### SRU Justification #####

[Impact]
Site-forwarding is not possible,
Precise cannot be used as a forwarding host to link to sites hosted within a private network.

[Development Fix]
I added the sed command mentioned below into the debian/postinst script so that the path is corrected at installation. Editing the file (debian/conf/proxy_html.load) itself won't be of any use because the path differs by architecture.

[Stable Fix]
Edit the file /etc/apache2/mods-enabled/proxy_html.load to include the right path using the following sed command:

sed -i "s/\/usr\/lib\/libxml2.so.2/\/usr\/lib\/`uname -i`-linux-gnu\/libxml2.so.2/g" /etc/apache2/mods-available/proxy_html.load

[Test Case]
1) Install the packages 'apache2', 'libxml2', and 'libapache2-mod-proxy-html'
2) Run the command 'sudo service apache2 start'

With the version in Precise, it will error out with:
apache2: Syntax error on line 210 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/proxy_html.load: Cannot load /usr/lib/libxml2.so.2 into server: /usr/lib/libxml2.so.2: cannot open shared object file: No such file or directory
Action 'start' failed.

[Regression Potential]
Little, as Apache doesn't run currently anyway

libxml2 2.7.8.dfsg-5.1ubuntu4.1 running on Ubuntu 12.04 LTS

------------ORIGINAL REPORT------------

See also package libapache2-mod-proxy-html , file/link /etc/apache2/mods-enabled/proxy_html.load

# lsb_release -rd
Description: Ubuntu 12.04 LTS
Release: 12.04

(64 bit)

# apt-cache policy libxml2
libxml2:
  Installed: 2.7.8.dfsg-5.1ubuntu4.1
  Candidate: 2.7.8.dfsg-5.1ubuntu4.1
  Version table:
 *** 2.7.8.dfsg-5.1ubuntu4.1 0
        500 http://de.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
        100 /var/lib/dpkg/status
     2.7.8.dfsg-5.1ubuntu4 0
        500 http://de.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

# apt-cache policy libapache2-mod-proxy-html:
libapache2-mod-proxy-html:
  Installed: 3.0.1-1
  Candidate: 3.0.1-1
  Version table:
 *** 3.0.1-1 0
        500 http://de.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
        100 /var/lib/dpkg/status

Expected:
I expected apache to start including module proxy_html.load.

What happened:
apache2 failed to start and showed an error message
# service apache2 start
 * Starting web server apache2 apache2: Syntax error on line 210 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/proxy_html.load: Cannot load /usr/lib/libxml2.so.2 into server: /usr/lib/libxml2.so.2: cannot open shared object file: No such file or directory
Action 'start' failed.
The Apache error log may have more information.
                                                                                           [fail]

proxy_html.load tries to load libxml2 (LoadFile /usr/lib/libxml2.so.2), but libxml2 only provides under /usr/lib/x86_64-linux-gnu
(under 10.04 64 bit things are available under /usr/lib)

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: libxml2 2.7.8.dfsg-5.1ubuntu4.1
ProcVersionSignature: Ubuntu 3.2.0-24.39-generic 3.2.16
Uname: Linux 3.2.0-24-generic x86_64
ApportVersion: 2.0.1-0ubuntu7
Architecture: amd64
Date: Mon May 28 09:25:26 2012
InstallationMedia: Ubuntu-Server 12.04 LTS "Precise Pangolin" - Release amd64 (20120424.1)
ProcEnviron:
 LANGUAGE=en_US:en
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: libxml2
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Gerben (gerbgeus) wrote :
Revision history for this message
Aditya V (kroq-gar78) wrote : Re: Library not found where expected (by libapache2-mod-proxy-html)

Seems like libxml2.so.2 is in the folder "/usr/lib/x86_64-linux-gnu/" on my 64-bit Precise. Are you using a 32-bit or 64-bit machine to produce this bug?

summary: - Library not found where extected (by libapache2-mod-proxy-html)
+ Library not found where expected (by libapache2-mod-proxy-html)
Aron Xu (happyaron)
affects: libxml2 (Ubuntu) → mod-proxy-html (Ubuntu)
Revision history for this message
Gerben (gerbgeus) wrote :

I've noticed this on a 64 bit installation, but 32 bit also lacks these files under /usr/lib

(from 32 bit:
$ dpkg -L libxml2
/.
/usr
/usr/lib
/usr/lib/i386-linux-gnu
/usr/lib/i386-linux-gnu/libxml2.so.2.7.8
/usr/share
/usr/share/doc
/usr/share/doc/libxml2
/usr/share/doc/libxml2/AUTHORS
/usr/share/doc/libxml2/README
/usr/share/doc/libxml2/README.Debian
/usr/share/doc/libxml2/copyright
/usr/share/doc/libxml2/TODO.gz
/usr/share/doc/libxml2/NEWS.gz
/usr/share/doc/libxml2/changelog.Debian.gz
/usr/lib/i386-linux-gnu/libxml2.so.2
geus@b32s1204:~$ cd /usr/lib/
geus@b32s1204:/usr/lib$ ls | grep libxml
geus@b32s1204:/usr/lib$
)

Revision history for this message
Aditya V (kroq-gar78) wrote : Re: [Bug 1005425] Re: Library not found where expected (by libapache2-mod-proxy-html)

I'll take care on this one. Can't set the assignee to me right now as I'm on my phone and it concerts the emails to HTML so I can't use LaunchPad's email interface.

Sincerely,
kroq-gar78

Revision history for this message
Launchpad Janitor (janitor) wrote : Re: Library not found where expected (by libapache2-mod-proxy-html)

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in mod-proxy-html (Ubuntu):
status: New → Confirmed
Aditya V (kroq-gar78)
Changed in mod-proxy-html (Ubuntu):
status: Confirmed → In Progress
assignee: nobody → kroq-gar78 (kroq-gar78)
Revision history for this message
Aditya V (kroq-gar78) wrote :

Looks like it's a problem with the file "debian/conf/proxy_html.load". It has the contents:

LoadFile /usr/lib/libxml2.so.2
LoadModule proxy_html_module /usr/lib/apache2/modules/mod_proxy_html.so

The important part being of the first line: "/usr/lib/libxml2.so.2". Looks like that needs to be customized in some manner, either through debian/rules or some post-install script (post-install sounds better to me). Also, thanks Aron for pointing me in the right direction! :)

Aditya V (kroq-gar78)
summary: - Library not found where expected (by libapache2-mod-proxy-html)
+ Library not found where expected
Aditya V (kroq-gar78)
summary: - Library not found where expected
+ Not looking in multiarch-friendly path
Revision history for this message
Aditya V (kroq-gar78) wrote : Re: Not looking in multiarch-friendly path

Here's the patch. What I did was I replaced the path in the debian/conf/proxy_html.load file in the 'postinst' script. I did this using sed and I made sure it was using the correct architecture path (which is why I didn't put it into the proxy_html.load file directly)

Revision history for this message
Aditya V (kroq-gar78) wrote :

Here's the patch without a silly typo.

summary: - Not looking in multiarch-friendly path
+ [SRU] Not looking for library in multiarch-friendly path
Revision history for this message
Aditya V (kroq-gar78) wrote :

Hmmm... just remembered that dpkg-architecture is part of dpkg-dev, and I don't want to add another dependency in. I'll use 'uname -m' and then append '-linux-gnu' to that. Please tell me if anybody has an alternative solution.

description: updated
Revision history for this message
Aditya V (kroq-gar78) wrote :

Gerben,

Can you post the output of "uname -m" on your 32-bit machine? I'm just trying to make sure that that's an alternative to using "dpkg-architecture"

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Fix path to use multiarch-friendly in 'postinst' script (no typo)" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Aditya V (kroq-gar78)
description: updated
description: updated
Revision history for this message
Gerben (gerbgeus) wrote :

Hi,

geus@b32s1204:~$ uname -m
i686

(image ubuntu-12.04-server-i386.iso used to install inside kvm hypervisor)
Gerben

Revision history for this message
Aditya V (kroq-gar78) wrote :

Hmm... not what I had hoped for. I'm trying to get a command to output 'i386' from your machine and 'x86_64' from mine (64-bit). Can you try running the command "arch" on your 32-bit system? Thanks. There's got to be a better way to do this...

Revision history for this message
Gerben (gerbgeus) wrote :

Hi,

The command to use is
  uname -i

This produced your excepted strings on the different platforms.

I've quickly looked at other apache modules, and mod_serurity also has the same problem.

Revision history for this message
Aditya V (kroq-gar78) wrote :

Thanks! I'll update my patch and branch. :)

I think I (or you, if you want) should file a separate bug report for mod_security, unless it's already been reported.

Aditya V (kroq-gar78)
tags: removed: patch
Revision history for this message
Aditya V (kroq-gar78) wrote :

Maybe this should be done through debian/rules instead of debian/postinst?

description: updated
Revision history for this message
Aditya V (kroq-gar78) wrote :

Good patch (that works)

Revision history for this message
Aditya V (kroq-gar78) wrote :

Gerben,

Can you fill out the Impact field? Basically, what is the impact of the problem? Thanks! Once you do that, I'll request a merge.

Revision history for this message
Aditya V (kroq-gar78) wrote :

Also, can you test this fix by running

sed -i "s/\/usr\/lib\/libxml2.so.2/\/usr\/lib\/`uname -i`-linux-gnu\/libxml2.so.2/g" /etc/apache2/mods-available/proxy_html.load

in a terminal and seeing if it solves the problem? Thanks.

Revision history for this message
Gerben (gerbgeus) wrote :

IMPACT:
LOW-MEDIUM
Site-forwarding is not possible,
  - 12.04 cannot be used as a forwarding host to link to sites hosted within a private network.
  (just keep using previous ubuntu version for the moment)

Revision history for this message
Aditya V (kroq-gar78) wrote :

Ok, added the impact. As soon as you test the fix, I'll set my branch to merge and they'll hopefully have it uploaded in a little while. Can you please test the command I wrote eariler? Thanks.

description: updated
Revision history for this message
Gerben (gerbgeus) wrote :

Hi,

ran the sed command and apache starts with the module enabled (both 64 and 32 bit installations).
This issue seems to be resolved.

Revision history for this message
Andrew Starr-Bochicchio (andrewsomething) wrote :

Can anyone confirm if this is still an issue in Quantal? Version 3.0.1-1.1 which was synced from Debian should have fixed this.

mod-proxy-html (3.0.1-1.1) unstable; urgency=medium

   * Non-maintainer upload.
   * Modify the path of libxml2.so.2 in conf file, update the minmal
     version of apache2 (Closes: #670633).
   * debian/compat: 4 -> 9.
   * debian/rules:
     - Replace dh_clean -k with dh_prep.
     - Add build-arch and build-indep target.
   * debian/dirs: removed, useless.
   * debian/source/format: 3.0 (quilt)
   * std-ver: 3.8.0 -> 3.9.3
 -- Aron Xu <email address hidden> Wed, 30 May 2012 08:59:37 +0000

Changed in mod-proxy-html (Ubuntu Precise):
assignee: nobody → kroq-gar78 (kroq-gar78)
status: New → Confirmed
Changed in mod-proxy-html (Ubuntu):
status: In Progress → Incomplete
Changed in mod-proxy-html (Debian):
status: Unknown → Fix Released
Revision history for this message
Gerben (gerbgeus) wrote :

Hi,

Performed the test in quantal-server-amd64.iso and this is no issue in Quantal. The LoadFile directive looks nice without any absolute path, probably using some LD_LIBPATH or LIBRARY_PATH in the background.

root@b64s1210:/etc/apache2/mods-enabled# dpkg -l | grep proxy-ht
ii libapache2-mod-proxy-html 3.0.1-1.1 Apache2 filter module for HTML links rewriting

Changed in mod-proxy-html (Ubuntu):
status: Incomplete → Fix Released
assignee: kroq-gar78 (kroq-gar78) → nobody
Revision history for this message
James Page (james-page) wrote :

Please see bug 988819 - this includes an apache2 change to make apache use dlopen as a fallback so that the .so file can be specificied without a full path.

Its currently in -proposed awaiting verification.

Revision history for this message
Aditya V (kroq-gar78) wrote :

Is this a duplicate of bug 1005425? The bugs seem almost exactly the same, and that one already has some fixes released. I, personally, can't tell the difference at all.

Revision history for this message
Aditya V (kroq-gar78) wrote : Re: [Bug 1005425] Re: [SRU] Not looking for library in multiarch-friendly path

Oops, I meant duplicate of bug 988819.

Revision history for this message
Steve Langasek (vorlon) wrote :

The Precise Pangolin has reached end of life, so this bug will not be fixed for that release

Changed in mod-proxy-html (Ubuntu Precise):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.