Bug#528608: xdm crashes with a nonexisting homedir, before running pam_mkhomedir
Package: xdm
Version: 1:1.1.8-5
Severity: normal
xdm reproducibly crashes when the user's home directory does not exist,
before actually doing any pam session handling - so that pam_mkhomedir can't
take care of the missing homedir.
it's easy to reproduce:
apt-get install xdm
(nothing special, everything out of the box)
adduser dummy
...
rm -rf /home/dummy
cat /etc/pam.d/common-session
session optional pam_mkhomedir.so
session required pam_unix.so
and that's it. you try to login as dummy, the password is accepted,
a brief message of "login successful" or the like flashes on the screen,
and then the greeter part of xdm sigsegvs, and the main xdm shuts
itself and the x server down.
fallout in the xdm.log:
Thu May 14 15:28:29 2009 xdm info (pid 5504): sourcing /etc/X11/xdm/Xsetup
Thu May 14 15:29:06 2009 xdm info (pid 5504): sourcing /etc/X11/xdm/Xstartup
Thu May 14 15:29:06 2009 xdm error (pid 5495): display :0 (pid 2816) exited with unexpected status 5504
strace -f -p 5504 (the greeter child of xdm) shows that
immediately after the xstartup process finishes, xdm does a stat on
the not-yet-existing homedir and sigsegv's straight away.
relevant bits from this trace are included here:
Process 5504 attached - interrupt to quit
...
open("/etc/X11/xdm/Xstartup", O_RDONLY) = 4
close(4) = 0
time(NULL) = 1242278946
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=413, ...}) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=413, ...}) = 0
write(2, "Thu May 14 15:29:06 2009 xdm info"..., 46) = 46
write(2, "sourcing /etc/X11/xdm/Xstartup\n"..., 31) = 31
clone(Process 5526 attached
child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7bcd958) = 5526
[pid 5526] setsid() = 5526
...lots of xstartup activity...
[pid 5526] open("/var/log/lastlog", O_RDWR|O_LARGEFILE) = 3
[pid 5526] _llseek(3, 292584, [292584], SEEK_SET) = 0
[pid 5526] write(3, "\"\254\vJ:0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 292) = 292
[pid 5526] close(3) = 0
[pid 5526] exit_group(0) = ?
Process 5504 resumed
Process 5526 detached
<... wait4 resumed> [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 5526
--- SIGCHLD (Child exited) @ 0 (0) ---
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
rt_sigaction(SIGTERM, {0x8053570, [], 0}, {SIG_DFL}, 8) = 0
open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 4
_llseek(4, 0, [0], SEEK_CUR) = 0
fstat64(4, {st_mode=S_IFREG|0644, st_size=1196, ...}) = 0
mmap2(NULL, 1196, PROT_READ, MAP_SHARED, 4, 0) = 0xb808a000
_llseek(4, 1196, [1196], SEEK_SET) = 0
munmap(0xb808a000, 1196) = 0
close(4) = 0
stat64("/home/dummy", 0xbfbacda8) = -1 ENOENT (No such file or directory)
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
Process 5504 detached
etch's xdm worked fine in the same environment, and so does lenny's kdm
so i'm *absolutely* certain that pam_mkhomedir is not the culprit here.
regards
az
-- System Information:
Debian Release: 5.0.1
APT prefers stable
APT policy: (990, 'stable'), (980, 'testing'), (970, 'unstable')
Architecture: i386 (i686)
Reply to: