#523251 login: sudo su - randomly logs out after immediate key press

Package:
bash
Source:
bash
Description:
GNU Bourne Again SHell
Submitter:
Greg Cockburn
Date:
2021-10-20 03:21:03 UTC
Severity:
wishlist
#523251#5
Date:
2009-04-09 02:53:08 UTC
From:
To:
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

#523251#10
Date:
2009-04-09 21:49:09 UTC
From:
To:
Hello,

This looks like http://bugs.debian.org/476519

Can you try if changing the default shell to dash solves the issue?

Can you check if

	perl -e '$<=$>=$(=$)=<UID of your user>; system bash'

has the same problem?

Best Regards,

#523251#15
Date:
2009-04-09 22:36:50 UTC
From:
To:
Hi Nekral,

Changing the shell to dash, I can not reproduce this problem,

The perl command [perl -e '$<=$>=$(=$)=1000; system bash'] can reproduce it,
but still not consistently.

It does look the same as
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=476519.

Greg.

#523251#20
Date:
2009-04-09 23:19:21 UTC
From:
To:
forcemerge 476519 523251
thanks

I still don't understand at all what's happening, but this still seems to
be a bash issue.

Best Regards,

#523251#29
Date:
2021-10-20 03:18:42 UTC
From:
To:
Hallo, ich bin Frau Elizabeth Liu, wenn Sie als vor der Covid-19-Epidemie geschützt markiert wurden, meine Gebete mit Ihnen. Ich möchte Ihnen ein Geschäft im Wert von $7,400,000.00 USD anbieten. Wenn Sie interessiert sind, kontaktieren Sie mich privat. E-Mail: elizabethliu@winghangbnk.com

Elizabeth Liu