[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bash history / ssh+sudo+reverse-i-search will execute the command fo
Re: bash history / ssh+sudo+reverse-i-search will execute the command found if the ssh process is killed
Mon, 24 Oct 2016 11:17:35 -0400
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.4.0
On 10/19/16 1:46 PM, Stein Arne Storslett wrote:
> Bash Version: 4.2
> Patch Level: 46
> Release Status: release
> Bash history / reverse-i-search will execute the command found
> if the ssh process is killed.
> This happens with the combination of:
> - ssh into server
> - sudo su -
> - reverse-i-search # <ctrl>+R
> I.e. a user in the middle of a bash reverse-i-search, and the
> ssh process is killed
> i.e. due to a network outage.
> This can be critical if the command in the search history is
> something harmful or potentially unwanted, like a server shutdown
> The chain of events during the kill, and how the sub processes
> are killed might be the cause here, but nevertheless no signal
> should cause the bash history command to run.
Part of this was fixed in bash-4.3, and the issue has been completely
resolved in bash-4.4.
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU address@hidden http://cnswww.cns.cwru.edu/~chet/