Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 26729 - su and login freezes when I use nss-mysql module
Summary: su and login freezes when I use nss-mysql module
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: PAM Gentoo Team (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-08-16 10:04 UTC by Martin Filip
Modified: 2005-02-13 21:54 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Straces of getent for novas007 (novas007-strace-getent,27.54 KB, text/plain)
2003-11-13 22:30 UTC, Mike Lundy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Filip 2003-08-16 10:04:04 UTC
I've used nss-mysql. Everything worked OK (configs and DB are OK I guess). But
one day, I've run emerge -u world and since then strange things happens. When I
have in my /etc/nsswitch.conf only
passwd: files
shadow: files
group: files
everything goes OK. but when I use files mysql at each line, su and login
freezes. The strange thing is, that getent passwd and getent shadow works
perfectly. It gets all info, that it needs. And most wierd is, that when I
strace su it gets all info.
here is my strace output (strace su - lnovy (lnovy is my test user)):
[cut]
read(3, "\23\0\0\3", 4)                 = 4
read(3, "\4user\3uid\3\v\0\0\1\3\3\1\0\0", 19) = 19
read(3, "\20\0\0\4", 4)                 = 4
read(3, "\0\4NULL\3\4\0\0\1\6\3\0\0\0", 16) = 16
read(3, "\30\0\0\5", 4)                 = 4
read(3, "\4user\10realname\3 \0\0\1\375\3\1\0\0", 24) = 24
read(3, "\25\0\0\6", 4)                 = 4
read(3, "\4user\5shell\3\24\0\0\1\375\3\1\0\0", 21) = 21
read(3, "\27\0\0\7", 4)                 = 4
read(3, "\4user\7homedir\3 \0\0\1\375\3\1\0\0", 23) = 23
read(3, "\23\0\0\10", 4)                = 4
read(3, "\4user\3gid\3\v\0\0\1\3\3\1\0\0", 19) = 19
read(3, "\1\0\0\t", 4)                  = 4
read(3, "\376", 1)                      = 1
brk(0)                                  = 0x8064000
brk(0x8066000)                          = 0x8066000
read(3, "1\0\0\n", 4)                   = 4
read(3, "\5lnovy\0041006\373\nLukas Novy\t/bin/bas"..., 49) = 49
read(3, "\1\0\0\v", 4)                  = 4
read(3, "\376", 1)                      = 1
open("/etc/shadow", O_RDONLY)           = 4
fcntl64(4, F_GETFD)                     = 0
fcntl64(4, F_SETFD, FD_CLOEXEC)         = 0
fstat64(4, {st_mode=S_IFREG|0600, st_size=530, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x4426c000
read(4, "root:$1$ss8/nB1S$TCVNC4qihM48Tkh"..., 4096) = 530
read(4, "", 4096)                       = 0
close(4)                                = 0
munmap(0x4426c000, 4096)                = 0
stat64("/etc/nss-mysql/nss-mysql-root.conf", {st_mode=S_IFREG|0666,
st_size=4814, ...}) = 0
time([1061050489])                      = 1061050489
open("/etc/localtime", O_RDONLY)        = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=806, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x4426c000
read(4, "TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\0\0\0\6\0"..., 4096) = 806
close(4)                                = 0
munmap(0x4426c000, 4096)                = 0
getpid()                                = 10161
rt_sigprocmask(SIG_SETMASK, NULL, [RTMIN], 8) = 0
rt_sigsuspend([] <unfinished ...>

I've even tried to recompile whole machine (from beginning!!! not just recompile
some packages) and problem stays :(

Am I really so stupid?

Reproducible: Always
Steps to Reproduce:
su - lnovy
Actual Results:  
it just freezes and nothing more happens

Expected Results:  
I've expected to do the same as when I have lnovy user in my /etc/passwd

Portage 2.0.48-r5 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1)
=================================================================
System uname: 2.4.21 i586 Pentium MMX
GENTOO_MIRRORS="http://gentoo.oregonstate.edu
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config
/usr/kde/2/share/config /usr/kde/3/share/config /var/bind"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR_OVERLAY=""
USE="x86 crypt cups foomaticdb gif jpeg libg++ mad mmx ncurses png truetype zlib
gdbm berkdb slang readline tetex tcpd pam libwww ssl python -3dnow -apm -arts
-avi -encode gd -gnome -gpm -gtk -imlib ipv6 -java -kde -mbox maildir -mikmod
-motif -mpeg mysql -nls nocardbus -oggvorbis -opengl -oss -pdflib perl pnp -qt
-quicktime samba -sdl snmp -spell -svga -X -xml2 -xmms -xv"
COMPILER="gcc3"
CHOST="i586-pc-linux-gnu"
CFLAGS="-O2 -mcpu=i586 -pipe"
CXXFLAGS="-O2 -mcpu=i686 -pipe"
ACCEPT_KEYWORDS="x86"
MAKEOPTS="-j2"
AUTOCLEAN="yes"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
FEATURES="sandbox ccache"
Comment 1 Mike Lundy 2003-11-13 20:42:29 UTC
I can confirm this- the exact same thing happened to me. The strace ends at the same place. Maybe my emerge info will show some correlation.

Portage 2.0.49-r15 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.6.0-test8-bk-2003-10-23_03-44-26)
=================================================================
System uname: 2.6.0-test8-bk-2003-10-23_03-44-26 i686 AMD Athlon(tm) XP 1800+
Gentoo Base System version 1.4.3.10p1
distcc 2.11.1 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -O2"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-march=athlon-xp -O2"
DISTDIR="/usr/portage/distfiles"
FEATURES="sandbox ccache autoaddcvs"
GENTOO_MIRRORS="http://www.ibiblio.org/gentoo http://gentoo.mirrors.pair.com/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/home/mike/gentoo/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 oss avi crypt cups encode foomaticdb gif jpeg gnome libg++ mad mikmod mpeg ncurses pdflib png quicktime spell truetype xml2 xmms xv zlib gtkhtml alsa gdbm berkdb slang readline tetex bonobo ggi tcltk java guile mysql postgres X sdl gpm tcpd pam libwww ssl perl python imlib oggvorbis gtk qt kde opengl mozilla gphoto2 cdr 3dnow crypto cscope dedicated dga doc dvd freetype gd gd-external ginac gnomedb gtk2 hbci innodb lcms mbox mmx mng mozctl moznocompose moznoirc moznomail mozsvg nocardbus offensive ofx pda plotutils qhull samba sasl slp sse stroke tiff ungif usb vim-with-x xosd -apm -motif -nls -svga -arts -esd"
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-11-13 21:31:55 UTC
Martin Filip: 
change your root password, you've just exposed it here.

either of you (both preferably):
set nsswitch.conf to only source from files, then do: 
getent -s mysql passwd
getent -s mysql shadow
getent -s mysql group

if any of those fail to return the data they should, or crash, please attach the strace of them.

if the above doesn't produce an error, then try:
getent -s mysql passwd lnovy 
getent -s mysql shadow lnovy 

next of all, if you don't have nscd running, repeat the above with nscd running, if you do have it running, repeat without it running (if that works for your situation. I know nscd is required for nss_ldap).
Comment 3 Mike Lundy 2003-11-13 22:29:15 UTC
Ok, did it. There's no difference (except for pid/time values) between the nscd and non-nscd straces, so i'll omit them. The three files are catted together (delimited in an obvious way) so I don't have to create 3 attachements or tar them (and make them non-browser-viewable).
Comment 4 Mike Lundy 2003-11-13 22:30:13 UTC
Created attachment 20723 [details]
Straces of getent for novas007
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-11-13 23:52:25 UTC
whoa, go back and read the instructions after the openssl update, including run revdep-rebuild and clean up the openssl-0.9.6 stuff.
then see if it still happens (I don't think it will).
Comment 6 Mike Lundy 2003-11-14 00:49:10 UTC
Er, I haven't upgraded to 0.9.7 at all yet- still on .6k. Should I upgrade? (revdep only has gnucash and openoffice-bin, neither of which matter for this)
Comment 7 Martin Filip 2003-11-14 09:38:30 UTC
it was a testing machine with very simple testing password :)
Comment 8 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-11-14 15:27:17 UTC
err, I assumed that based on the fact that martin said he did 'emerge -u world' and you said things were the same for you. Can you look back and see what recent updates have been done to:
gcc, glibc, nss_mysql, mysql

(I'm trying to trace the bug to one of those).
Comment 9 Mike Lundy 2003-11-14 16:28:51 UTC
sorry, i should be more clear- the first version I of nss-mysql I ever emerged was the current one- I've never had it working. Here are the versions I'm using, though:

mysql-4.0.14-r2
nss-mysql-0.43-r1
nss-3.8
gcc-3.2.3-r2
glibc-2.3.2-r1
USE flags as above.

I'm also most of the way through a revdep remerge for openssl (not really prompted by this- just decided that now was the time), so maybe something will change there (but I doubt it). Also, 0.9.7 is currently in ~x86, which I don't use automatically. (I upgrade programs I use on a regular basis, but I don't usually upgrade to libraries from ~x86 unless one of those is pulled in by a program upgrade).
Comment 10 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-11-14 17:03:44 UTC
Just wondering, you guys DID follow the instructions after the nss-mysql install?

Namely "ebuild /var/db/pkg/sys-libs/nss-mysql-0.43-r1/nss-mysql-0.43-r1.ebuild config"
Comment 11 Mike Lundy 2003-11-14 19:22:28 UTC
indeed. Here's a chunk of the mysql query log (wrapped, this time).
031113 23:03:29
35 Connect     nss@localhost on nss_mysql
35 Query       select groups.group_name,groups.gid,groups.group_password,user.user_name 
from groups 
LEFT JOIN user_group on groups.group_id=user_group.group_id 
LEFT JOIN user on user_group.user_id=user.user_id and user.status = 'A' 
where 1 = 1 and groups.status = 'A'
35 Quit

So it's querying ok, or so it seems.
Comment 12 Maurice van der Pot (RETIRED) gentoo-dev 2005-01-08 06:20:20 UTC
No activity for over a year. Is this still an issue?
Comment 13 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2005-02-13 21:54:51 UTC
no response from user, closing.