Purging samba breaks login (pam_smbpass.so segfaults)

Bug #260687 reported by Daniel Schwitzgebel
62
This bug affects 5 people
Affects Status Importance Assigned to Milestone
samba (Baltix)
New
Undecided
Unassigned
samba (Ubuntu)
Fix Released
High
Unassigned

Bug Description

pam_smbpass.so is causing segfault here. For example if I ran 'sudo ps', following appeared in dmesg:

[ 89.789908] sudo[4669]: segfault at 0 ip b7b98adb sp bfce50f0 error 4 in pam_smbpass.so[b7b3c000+12a000]

I removed package libpam-smbpass and now sudo operates ok. Anybody else with similar experiencies or was this just my personal problem :D ?

Related branches

Revision history for this message
Jussi Saarinen (jms) wrote :

Well, I noticed that samba (smbd) was also causing segfault systematically. I backed up smb.conf, purged all samba packages, installed them again as well as libpam-smbpass and restored smb.conf. Now everything operates fine.

Dmesg output is attached, but as the problem got "fixed" by installing stuff from scratch this is no longer reproducible. at least by me.

Revision history for this message
Chuck Short (zulcss) wrote :

Which version is this for?

Thanks
chuck

Changed in samba:
status: New → Incomplete
Revision history for this message
Jussi Saarinen (jms) wrote :

Samba 3.2.1

Revision history for this message
rw (rwichmann) wrote :

This is a nasty problem, because it makes login impossible (except in single-user mode) if libpam-smbpass is installed. We currently have three machines with Intrepid (latest updates); on two of them there's no problem, on the third pam_smbpass.so segfaults on every login attempt (and thus the login fails). Attached is the backtrace reported by the Samba 'panic action' script (/usr/share/samba/panic-action). libpam-smbpass version is 2:3.2.3-1ubuntu2

Thierry Carrez (ttx)
Changed in samba:
status: Incomplete → New
Revision history for this message
A. Bram Neijt (bneijt) wrote :

I got this problem after removing samba. I think it may be a problem that libpam-smbpass depends on samba without that being defined. You can remove samba, leave samba-common and libpam-smbpass and you will have this problem. Stupid thing is that every sudo fails also, so removing the libpam-smbpass will require me to enter single user mode and work from there (telinit 1). With sudo failing, there is no way to fix this without that.

The following dmesg entries are shown (and repeated for every type of sudo command):
[ 4940.176470] sudo[9337]: segfault at 0 ip 00007f5c6e480d6c sp 00007fff783b9fe0 error 4 in pam_smbpass.so[7f5c6e419000+149000]

I have this problem on Ubuntu Intrepid on x86_64 with the latest updates.

Revision history for this message
A. Bram Neijt (bneijt) wrote :

Just adding, telinit doesn't work because you need to be root. To solve this, I used the following:
- Reboot and choose the "recovery mode" from the boot selection menu
- Choose "drop into root shell" from the recovery menu
- Execute the command: dpkg --purge libpam-smbpass

After that you can reboot into normal mode and everything should be ok.

Revision history for this message
surfed (god-youhavechoice) wrote :

Confirmed, installing samba breaks sudo in pam.

Changed in samba:
status: New → Confirmed
Thierry Carrez (ttx)
Changed in samba:
importance: Undecided → High
Revision history for this message
Thierry Carrez (ttx) wrote :

Reproduction on a minimal intrepid system:
$ sudo apt-get install samba libpam-smbpass && sudo apt-get purge samba
then try to login.
Updating title to better reflect where the problem stands.

Revision history for this message
Thierry Carrez (ttx) wrote :

libpam-smbpass needs the /var/lib/samba directory to exist (even empty).
You can also reproduce simply by installing libpam-smbpass without installing samba...

easy fix: make libpam-smbpass depend on samba
better fix: create /var/lib/samba in samba-common.dirs and transfer purging of that directory from samba.postrm to samba-common.postrm

Revision history for this message
surfed (surfed) wrote : Re: [Bug 260687] Re: Purging samba breaks login (pam_smbpass.so segfaults)

I do have /var/lib/samba and still get
 libpam-smbpass segfaults.

Thierry Carrez wrote:
> libpam-smbpass needs the /var/lib/samba directory to exist (even empty).
> You can also reproduce simply by installing libpam-smbpass without installing samba...
>
> easy fix: make libpam-smbpass depend on samba
> better fix: create /var/lib/samba in samba-common.dirs and transfer purging of that directory from samba.postrm to samba-common.postrm
>
>

Revision history for this message
Thierry Carrez (ttx) wrote :

surfed:
Most people on this bug and duplicates explained that they encountered the problem after removing Samba. That's the case I've been trying to solve. Yours might be slightly different. Could you give us more information about your case, for example :
- can you reproduce it starting from a clean install ? If yes, how ?
- what packages are installed (output of dpkg -l | grep samba) ?
- backtrace of the crash ?
I tried to reproduce based on your information ("installing samba breaks sudo in pam"), but installing samba didn't break anything here...

Revision history for this message
surfed (god-youhavechoice) wrote :

Ok, I cant really help much anymore as I have purged everything with samba or smb in the name and reinstalled samba and everything works now. I guess there was a dodgy conf file somewhere and purging instead of just removing samba stuff seemed to have cured my libpam-smbpass issues. I am getting segfaults with gksu (error 4 in libgksu2.so.0.0.2) but thats another story / bug. Thank you for trying to help.

Revision history for this message
Mathias Gug (mathiaz) wrote :

Seems like a good option:

  better fix: create /var/lib/samba in samba-common.dirs and transfer purging of that directory from samba.postrm to samba-common.postrm

Could you prepare a debdiff?

Changed in samba:
assignee: nobody → tcarrez
status: Confirmed → Triaged
Revision history for this message
Thierry Carrez (ttx) wrote :

Debdiff for proposed fix

samba (2:3.2.3-1ubuntu3) intrepid; urgency=low

  * Fix pam-smbpass.so crashing because it misses /var/lib/samba (LP: #260687)
    - debian/samba-common.dirs: create /var/lib/samba in samba-common
    - debian/samba.postrm: don't completely remove /var/lib/samba on purge
      (just let samba-common postrm do it)

Patch will be forwarded to http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=499359 in a minute.

Thierry Carrez (ttx)
Changed in samba:
assignee: tcarrez → nobody
status: Triaged → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package samba - 2:3.2.3-1ubuntu3

---------------
samba (2:3.2.3-1ubuntu3) intrepid; urgency=low

  * Fix pam-smbpass.so crashing because it misses /var/lib/samba (LP: #260687)
    - debian/samba-common.dirs: create /var/lib/samba in samba-common
    - debian/samba.postrm: don't completely remove /var/lib/samba on purge
      (just let samba-common postrm do it)

 -- Thierry Carrez <email address hidden> Fri, 10 Oct 2008 11:24:48 +0200

Changed in samba:
status: Confirmed → Fix Released
Revision history for this message
Guillaume Hain (zedtux) wrote :

Hi all,

I'm under Ubuntu Intrepid Ibex 64bits, and have samba 2:3.2.3-1ubuntu3, samba-common 2:3.2.3-1ubuntu3 and libpam-smbpass 2:3.2.3-1ubuntu3 installed, and I got the problem of segmentation fault using su or sudo !

When I delete the libpam-smbpass package all work ( else network shares ).

I have try to remove with purge the libpam-smbpass package, and re-install ... but same error...

Revision history for this message
Guillaume Hain (zedtux) wrote :

Sorry, I forget to tell you that in the /var/log/kern.log, when I use the su or sudo, I have this line :

Nov 25 18:32:23 zUbuntu kernel: [ 732.969448] sudo[6685]: segfault at 0 ip 00007f14fff7fd6c sp 00007fff09eba620 error 4 in pam_smbpass.so[7f14fff18000+149000]

~ # uname -a
Linux zUbuntu 2.6.27-7-generic #1 SMP Tue Nov 4 19:33:06 UTC 2008 x86_64 GNU/Linux
~ #

Revision history for this message
Thierry Carrez (ttx) wrote :

zedtux:
could you check (after reinstall) if you have a /var/lib/samba directory ? If yes, please file another bug because this one was about a segfault due to the missing directory... (purging samba probably doesn't break login for you). Thanks !

Revision history for this message
Guillaume Hain (zedtux) wrote :

Okay, thanks.

I have this directory.

Revision history for this message
Rochvellon (rochvellon) wrote :

I have had the same problem.

Samba was installed a fews days ago. Today i've installed Crossover Games, which i deinstalled a few minutes later.
Later i would start synaptic but it doesn't worked. Every time i wanted to open a program using sudo or gksudo/gksu i got only one message: "Segmentation fault". Nothing else.

dpkg --purge libpam-smbpass worked for me.

Revision history for this message
joctee (nospam-joakims) wrote :

I had the same exact same problem, this worked for me:

QUOTE

- Reboot and choose the "recovery mode" from the boot selection menu
- Choose "drop into root shell" from the recovery menu
- Execute the command: dpkg --purge libpam-smbpass

ENDQUOTE

Doing this, I am able to logon again.

Before reinstalling libpam-smbpass, delete or rename /var/lib/samba/secrets.tdb:

sudo mv /var/lib/samba/secrets.tdb /var/lib/samba/secrets.tdb.old
sudo apt-get install libpam-smbpass

Revision history for this message
Thierry Carrez (ttx) wrote :

Please followup on bug 303458 as this precise one (segfault if /var/lib/samba is missing) is fixed.

Revision history for this message
Jelle Foks (jellefoks) wrote :

When upgrading from saucy to trusty, something similar happened to me, the upgrade failed, because the samba upgrade failed because it didn't like that there was a secrets.tdb in both /var/lib/samba and in /var/lib/samba/private, and the fix was similar to joctee's comment in posting #21, but then purging libpam-winbind instead of libpam-smbpass... Note that a failure that 'breaks' sudo is can be difficult (or frustrating) one to fix for many users, because not everybody will know about or how to get a root shell without it.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related questions

Remote bug watches

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