When invoking "sudo su -" I sometimes get immediately logged out back to the unprivileged user.
I have narrowed it down to something with "-su" process that gets created.
I don't seem to be able to recreate this for just a normal "su -", but the bug is not consistently reproducible.
I can somewhat consistently reproduce this bug on 4 systems that were all upgraded to Lenny from Etch.
Seems to happen about 50% of the times I "sudo su -".
Here is a strace from a "-su" process that had the issue.
Process 10609 attached - interrupt to quit
read(0, 0xbf92fa2f, 1) = -1 EIO (Input/output error)
rt_sigprocmask(SIG_BLOCK, [INT], [], 8) = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig -icanon -echo ...}) = 0
ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigaction(SIGINT, {0x8091fd0, [], 0}, {0x80c91d0, [], 0}, 8) = 0
rt_sigaction(SIGTERM, {SIG_IGN}, {SIG_IGN}, 8) = 0
rt_sigaction(SIGQUIT, {SIG_IGN}, {SIG_IGN}, 8) = 0
rt_sigaction(SIGALRM, {0x8091d90, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], 0}, {0x80c91d0, [], 0}, 8) = 0
rt_sigaction(SIGTSTP, {SIG_IGN}, {SIG_IGN}, 8) = 0
rt_sigaction(SIGTTOU, {SIG_IGN}, {SIG_IGN}, 8) = 0
rt_sigaction(SIGTTIN, {SIG_IGN}, {SIG_IGN}, 8) = 0
rt_sigaction(SIGWINCH, {0x8091c10, [], 0}, {0x80c9190, [], SA_RESTART}, 8) = 0
rt_sigaction(SIGINT, {0x8091fd0, [], 0}, {0x8091fd0, [], 0}, 8) = 0
write(2, "logout\n"..., 7) = 7
open("/root/.bash_logout", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/etc/bash.bash_logout", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigaction(SIGINT, {0x8091fd0, [], 0}, {0x8091fd0, [], 0}, 8) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD TSTP TTIN TTOU], [], 8) = 0
ioctl(255, TIOCSPGRP, [10608]) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
setpgid(0, 10608) = 0
exit_group(0) = ?
Process 10609 detached