Skip to content
This repository has been archived by the owner on May 19, 2022. It is now read-only.

Word splitting issues resolved #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Word splitting issues resolved #41

wants to merge 1 commit into from

Conversation

vifon
Copy link

@vifon vifon commented Jan 6, 2015

Example of the issue on zsh with autocd turned on:

~/directory % cat <<!
subdir1
subdir2
subdir3
!
[the output of cat]
~/directory/subdir1 %

The cwd has changed due to the heredoc lines being incorrectly split.

Another, much more threatening example:

~/ % ls
[the directory is empty]
~/ % cat <<!
touch newfile
!
[the output of cat]
~/ % ls
newfile

It actually may lead to unintentional code execution.

Example of the issue on zsh with autocd turned on:

    ~/directory % cat <<!
    subdir1
    subdir2
    subdir3
    !
    [the output of cat]
    ~/directory/subdir1 %

The cwd has changed due to the heredoc lines being incorrectly split.

Another, much more threatening example:

    ~/ % ls
    [the directory is empty]
    ~/ % cat <<!
    touch newfile
    !
    [the output of cat]
    ~/ % ls
    newfile

It actually may lead to unintentional code execution.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants