mirror of
https://github.com/affaan-m/ECC.git
synced 2026-09-08 07:37:48 +02:00
fix: normalize heredoc line continuations
This commit is contained in:
@@ -1760,6 +1760,39 @@ function runTests() {
|
||||
passed++;
|
||||
else failed++;
|
||||
|
||||
if (
|
||||
test('denies split command names after heredoc line continuation', () => {
|
||||
expectDestructiveDeny(
|
||||
['cat <<EOF', '$(r\\', 'm -rf /tmp/expanded-target', ')', 'EOF'].join('\n'),
|
||||
'split command name in unquoted heredoc substitution'
|
||||
);
|
||||
})
|
||||
)
|
||||
passed++;
|
||||
else failed++;
|
||||
|
||||
if (
|
||||
test('denies split options after tab-stripped heredoc line continuation', () => {
|
||||
expectDestructiveDeny(
|
||||
['cat <<-EOF', '\t$(rm\\', '\t-rf /tmp/expanded-target)', 'EOF'].join('\n'),
|
||||
'split option in tab-stripped unquoted heredoc substitution'
|
||||
);
|
||||
})
|
||||
)
|
||||
passed++;
|
||||
else failed++;
|
||||
|
||||
if (
|
||||
test('preserves internal tabs after tab-stripped heredoc continuations', () => {
|
||||
expectAllow(
|
||||
['cat <<-EOF', '\t$(r\\', '\tm -rf /tmp/expanded-target)', 'EOF'].join('\n'),
|
||||
'internal tab after tab-stripped heredoc continuation'
|
||||
);
|
||||
})
|
||||
)
|
||||
passed++;
|
||||
else failed++;
|
||||
|
||||
if (
|
||||
test('fails closed on line-continued unquoted heredoc terminators', () => {
|
||||
expectDestructiveDeny(
|
||||
|
||||
Reference in New Issue
Block a user