libpam_foreground undefined symbol error on Ubuntu

If you happen to run Ubuntu Server (at least, up to version 7.04) and use the Courier POP3 or IMAP server, and you're watching your log files closely, you've seen error messages such as the below one in /var/log/syslog:

May 21 01:14:10 server4 authdaemond: PAM [dlerror: /lib/security/pam_foreground.so: undefined symbol: pam_set_data]

Many people have observed this problem.  This happens because libpam-foreground.so has not been compiled with the right options.  This library needs to be linked against libpam.so and glibc.so, but it isn't).  So, why is that this error only manifests itself in Courier login attempts, and not all the other applications and services which use PAM?  This depends on the order that each application loads its shared objects.  If the application first loads both glibc and libpam, and then tries to load libpam-foreground, then great!  Otherwise (as is the case with Courier) an error such as the above happens.

This is just a nuisance, because in non-interactive sessions, libpam-foreground doesn't do anything useful after all, but here's how to fix it.  You should just run the below commands in a login session.  You don't need to be root (I use sudo where necessary).

  1. cd ~
  2. sudo apt-get install build-essential fakeroot devscripts
  3. mkdir libpam-foreground
  4. cd libpam-foreground
  5. wget <a href="http://launchpadlibrarian.net/8187075/libpam-foreground_0.3-0ubuntu1.debdiff
  6. apt-get" title="http://launchpadlibrarian.net/8187075/libpam-foreground_0.3-0ubuntu1.debdiff
  7. apt-get">http://launchpadlibrarian.net/8187075/libpam-foreground_0.3-0ubuntu1.deb...</a> source libpam-foreground
  8. sudo apt-get build-dep libpam-foreground
  9. cd libpam-foreground-0.3
  10. patch -p4 &lt; ../libpam-foreground_0.3-0ubuntu1.debdiff
  11. debuild -uc -us
  12. cd ..
  13. sudo dpkg -i libpam-foreground_0.3-0ubuntu1_i386.deb

The above commands download the source package for libpam-foreground, apply a patch to correct the compilation options, re-compile the package and install the resulting deb file.  No more annoying log messages from libpam-foreground!

Trackback URL for this post:

http://ehsanakhgari.org/trackback/10

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.