logging in immediately logs out again

Bug #302092 reported by Sam Morris
This bug report is a duplicate of:  Bug #303458: segfault in pam_smbpass.so. Edit Remove
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Logging in via GDM, or login results in the user immediately being logged out again without any error being displayed.

I booted up in safe mode, and from a root shell ran login(8). If I logged in there, I saw a segmentation fault error. This does not appear if I boot up normally.

I finally noticed many of the following kernel messages being logged:

kernel: login[8182]: segfault at 0 ip b7c45abb sp bfc5e9c0 error 4 in pam_smbpass.so[b7be9000+12a000]

debsums says the checksums of the files in libpam-smbpass are fine.

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

Could you please indicate:
- which Ubuntu release you're running
- the versions of the samba, samba-common and libpam-smbpass packages you use (if they are installed)
- do you have a /var/lib/samba directory and if yes, what files does it contain
Thanks

Changed in samba:
status: New → Incomplete
Revision history for this message
Luca Martini (luca-martini) wrote :

I have the same problem on Intrepid, with samba version: 2:3.2.3-1ubuntu3.3.
I quickly fixed it (thanks to a colleague) by commenting out the line

# auth optional pam_smbpass.so migrate

from the file /etc/pam.d/common-auth

Changed in samba:
status: Incomplete → Confirmed
Revision history for this message
Sam Morris (yrro) wrote :

Indeed, that is how I worked around the problem.

The system is running Intrepid. samba, samba-common and libpam-smbpass are all at version 2:3.2.3-1ubuntu3.

$ find /var/lib/samba/ -ls
2766950 4 drwxr-xr-x 5 root root 4096 Nov 1 22:57 /var/lib/samba/
2766990 4 -rw------- 1 root root 696 Jul 6 17:38 /var/lib/samba/ntforms.tdb
2766969 4 -rw------- 1 root root 4096 Jul 6 17:38 /var/lib/samba/group_mapping.tdb.upgraded
3662964 80 -rw------- 1 root root 77824 Nov 1 22:57 /var/lib/samba/group_mapping.ldb
2766988 4 -rw------- 1 root root 4096 Jul 6 17:38 /var/lib/samba/ntdrivers.tdb
2766951 4 drwxr-xr-x 10 root root 4096 Oct 30 17:52 /var/lib/samba/printers
2763491 4 drwxr-xr-x 2 root root 4096 Oct 10 15:12 /var/lib/samba/printers/COLOR
2763515 4 drwxr-xr-x 2 root root 4096 Oct 10 15:12 /var/lib/samba/printers/W32PPC
2763493 4 drwxr-xr-x 2 root root 4096 Oct 10 15:12 /var/lib/samba/printers/W32ALPHA
2766962 4 drwxr-xr-x 2 root root 4096 Jun 30 16:56 /var/lib/samba/printers/WIN40
2763516 4 drwxr-xr-x 2 root root 4096 Oct 10 15:12 /var/lib/samba/printers/x64
2763492 4 drwxr-xr-x 2 root root 4096 Oct 10 15:12 /var/lib/samba/printers/IA64
2766961 4 drwxr-xr-x 2 root root 4096 Jun 30 16:56 /var/lib/samba/printers/W32X86
2763494 4 drwxr-xr-x 2 root root 4096 Oct 10 15:12 /var/lib/samba/printers/W32MIPS
2763497 4 -rw-r--r-- 1 root root 4096 Aug 9 21:26 /var/lib/samba/winbindd_idmap.tdb
2766975 36 -rw------- 1 root root 36864 Nov 25 10:13 /var/lib/samba/registry.tdb
2766967 8 -rw------- 1 root root 8192 Nov 25 16:06 /var/lib/samba/secrets.tdb
2766976 4 drwxr-xr-x 2 root root 4096 Jul 6 17:38 /var/lib/samba/perfmon
2766970 4 -rw------- 1 root root 4096 Oct 30 17:31 /var/lib/samba/account_policy.tdb
2766947 20 -rw------- 1 root root 20480 Nov 25 15:25 /var/lib/samba/share_info.tdb
2766989 20 -rw------- 1 root root 20480 Nov 25 10:13 /var/lib/samba/ntprinters.tdb
2766968 12 -rw------- 1 root root 12288 Nov 25 16:06 /var/lib/samba/passdb.tdb
2766971 4 drwxrwx--T 2 root sambashare 4096 Nov 17 14:33 /var/lib/samba/usershares
2763489 4 -rw-r--r-- 1 theuser theuser 102 Nov 17 14:33 /var/lib/samba/usershares/somefile

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

Could you try purging samba samba-common and libpam-smbpass:
$ sudo apt-get purge samba libpam-smbpass samba-common
(If you changed Samba configuration files, make backups before you purge)
Then reinstall:
$ sudo apt-get install samba libpam-smbpass

If it succeeeds, then something must have been wrong with existing /var/lib/samba data...

Revision history for this message
Luca Martini (luca-martini) wrote : Re: [Bug 302092] Re: logging in immediately logs out again

Thierry Carrez wrote:
> Could you try purging samba samba-common and libpam-smbpass:
> $ sudo apt-get purge samba libpam-smbpass samba-common
> (If you changed Samba configuration files, make backups before you purge)
> Then reinstall:
> $ sudo apt-get install samba libpam-smbpass
>
> If it succeeeds, then something must have been wrong with existing
> /var/lib/samba data...
>

I did it and it works (I don't have to modify the pam config file to log
in). The strange thing is that I didn't even know that samba was
installed on my system.
 Luca

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

That confirms that failure came from existing data in /var/lib/samba...

Is the system on which you had the error a hardy system that was upgraded ? If yes, did it start failing just after the upgrade ? If not, did it start failing as soon as you installed libpam-smbpass ?

Revision history for this message
Luca Martini (luca-martini) wrote :

Thierry Carrez wrote:
> That confirms that failure came from existing data in /var/lib/samba...
>
> Is the system on which you had the error a hardy system that was
> upgraded ?

yes

If yes, did it start failing just after the upgrade ?

No

If not,
> did it start failing as soon as you installed libpam-smbpass ?
>

I don't know, sorry.
 Luca

Revision history for this message
Sam Morris (yrro) wrote :

On Tue, 2008-12-02 at 13:30 +0000, Thierry Carrez wrote:
> That confirms that failure came from existing data in /var/lib/samba...

I haven't had a change to test this yet but when I do, I will make a
backup of /var/lib/samba so that the fault can be traced exactly.

> Is the system on which you had the error a hardy system that was
> upgraded ? If yes, did it start failing just after the upgrade ? If not,
> did it start failing as soon as you installed libpam-smbpass ?

In my case, the system was upgraded from hardy. I don't believe the
failure started until a few days after and I don't think they would have
installed libpam-smbpass manually.

--
Sam Morris <email address hidden>

Revision history for this message
lagoinsomne (lagoinsomne) wrote :

I noticed this behaviour after this two events: some days ago I shared a directory with samba. Everything went fine, except that having two networks I just couldn't see the shared directory in another windows machine, but that is another problem.

Today I installed a new printer and connected to 127.0.0.1:631 (cups), and after that I could not sudo, so rebooted the computer. After reboot I couldn't login, so I restarted in recovery mode and then I realized that three files in /var/lib/samba had changed this day, so I renamed them and voilá, I could login again.

The three files that were changed today were:
/var/lib/share_info.tdb
/var/lib/secrets.tdb
/var/lib/passwd.tdb

After login in successfully I checked /var/lib/samba and sectrets.tdb and passdb.tdb were recreated and the md5sum is different from the old ones. Share_info.tdb was not recreated, and seeing the date it seems that registry.tdb and ntprinters.tdb were touched or recreated again.

This bug is nasty because you just can't login, and if that happens to someone without another computer to check the solution then is hard to fix it.

Revision history for this message
Sam Morris (yrro) wrote :

This has now happened on two of my laptops!

Revision history for this message
Sam Morris (yrro) wrote :

This has now happened on a second of my laptops!

Revision history for this message
kriss (kszmurlo) wrote :

I've got same problem.
Ubuntu 8.10 (386)
samba 3.2.3-1u
cpu amd64
I've been playing swat and cups whet problem occurred.
Now I've got libpam-smbpass switched off so I can log into my account.
Tomorrow I will try to find what is wrong.

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.