Bug 218431

Summary: Terminal following path can be dangerous
Product: [Applications] dolphin Reporter: g111
Component: generalAssignee: Peter Penz <peter.penz19>
Status: RESOLVED DUPLICATE    
Severity: normal CC: andresbajotierra
Priority: NOR    
Version: 16.12.2   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:

Description g111 2009-12-12 21:00:38 UTC
Version:           1.3 (using KDE 4.3.4)
OS:                Linux
Installed from:    Debian testing/unstable Packages

If you open the terminal inside of dolphin it follows to the current path when the user changes it by executing a "cd PATH" command.

This can be dangerous because if something is already typed on the command line, the "cd PATH" is added to the line and the whole line is executed.

Test: Type "echo " on the command line of the internal terminal and then change the path in dolphin. Result:

gert@oink:/tmp$ echo cd /tmp/kde-gert
cd /tmp/kde-gert
gert@oink:/tmp$

Now think of something different then a simple "echo ". Maybe a "rm -r ".

I can think of four solutions:
a) Check if the command line is empty. If it is not then do not change the path but leave the command line untouched.

b) If this is possible: If the command line is not empty, copy the command line and erase it (or cancel it like pressing CTRL+C manually). Change the path. Paste the previous command line to the terminal again.

c) If a) and b) are not possible to implement, always send a CTRL+C first to cancel a possibly none empty line and then execute the cd command on this empty line.

Additionally:
d) Never switch the path automatically. Instead offer a button in the head line of the terminal like "Change to current path". This can be combined with b) or c). Also combining it with a) could be possible (Inactivate the button if something is typed on the command line).

Bye,
Gert
Comment 1 Dario Andres 2009-12-13 00:14:09 UTC
This is being tracked at bug 161637. Thanks

*** This bug has been marked as a duplicate of bug 161637 ***