If you type in a xterm, su <enter>, your pass, program <close the window> the program gets executed. This behavior doesn't work when you actually kill the xterm itself. Reproducible: Always Steps to Reproduce: 1. start xterm 2. su 3. programname <no enter> 4. close the window Actual Results: program gets executed Expected Results: a killed xterm
I don't see this in a quick check. Perhaps it depends on your shell (which may be supplying a newline, to be helpful).
I'm using Bash as shell. The best thing to show is probably: 1. start xterm 2. su 3. xterm 4. close the window Actual Results: 1. Clean root xterm Expected Results: 1. A closed window
I still don't see this (on Debian/testing). But it seems that the shell would be the first place to look (if one were to trace things to isolate this).
I'm not seeing this behaviour. Closing bug for lack of response from original reporter. Please reopen if this persists.
It is still there, same sequence. open a xterm su [passphrase] [enter] xterm [NOENTER] close the window, you now get an xterm started as root
ick! I _do_ see this
Since you see it and I don't, it's either that I'm misreading the description, or there's some difference in environment. My login shell is /bin/tcsh (perhaps changing that to bash would expose a bug).
this is, a bug in su, not xterm or shell, apparently, because it happens in screen (with any term) as well.
The bug is not on xterm, it does the same with konsole and screen (^A K to kill a session with a su shell). It's probably su-related (as it does nothing on a simple non-su shell). Seems like the problem is on handling of SIGTERM by su. [seems like bgo is slow as hell for me, this is going to be added two comments later than i have submitted it.]
I'm sorry, it's not SIGTERM which is thrown in that case, but SIGHUP.. I'm still trying to figure out where does it's handled.
Does not happen with gnome-terminal btw.
Ok, I researched it just a bit .. seems that if su gets a SIGTERM, it handles it just fine, kills bash/whatever, and this issue does not happen (so I assume without looking at the code, that gnome-terminal sends a SIGTERM). If you however send it a SIGKILL, it does not handle it, and for some reason bash executes the last command on its commandline. I have tried to add the signal handler for SIGTERM to SIGKILL as well in su.c, but it really does not like that, and I have not checked why the sigaction() call fails just yet ... I will have another peak later on if somebody else do not get to it before me.
http://lists.gnu.org/archive/html/bug-bash/2007-03/msg00085.html