bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unfinished command executed when TTY is closed


From: Piotr Grzybowski
Subject: Re: unfinished command executed when TTY is closed
Date: Thu, 18 Dec 2014 11:37:03 +0100

On Wed, Dec 17, 2014 at 9:23 PM, Greg Wooledge <wooledg@eeg.ccf.org> wrote:
>
> It would be more reasonable for bash (or ssh, I'm not sure at what level
> this handling should occur) to discard the partially typed line.  Not
> to execute it.

 that much is certain, that line should not be executed. how much of
this can be exploited? If the bug report is true, you can try to slow
down the machine, flood the both sides of connection and try to
interrupt the rm -Rf /tmp/tempdir just after the first '/'. sounds
impossible, but I am ready to believe in anything these days.

>
> If I open an rxvt and type "touch this_file_should_not_exist" but do not
> press Enter, and then I close the terminal using my window manager's
> "Close" functionality, bash does not execute the partially-typed command.
> (Verified by the absence of the file in a new window.)

that is probably because in this case "normal" terminal disconnect happens.

> This may turn out to be a bug in ssh instead of bash.  I don't know.

I would find hard to believe that ssh inserts the '\n'. I just tested
it with closing the xterm running via -e ssh to some remote host --
the command does not get executed. I tried to force the ssh channel to
be closed with ~. but that requires a new line to get interpreted,
maybe this is the new line? ;-)
 Jiri: does the command that should not be executed actually appear in
the .bash_history? Also: are you able to reproduce it by logging in
from some other machine?

cheers,
pg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]