Skip to content

Avoid shell execution in kill#41

Open
Dremig wants to merge 1 commit into
liriliri:masterfrom
Dremig:fix/kill-no-shell
Open

Avoid shell execution in kill#41
Dremig wants to merge 1 commit into
liriliri:masterfrom
Dremig:fix/kill-no-shell

Conversation

@Dremig

@Dremig Dremig commented May 16, 2026

Copy link
Copy Markdown

Summary

This updates kill to avoid constructing shell commands from pid values.

For valid input, the behavior stays the same, but the implementation now:

  • normalizes and validates pid as a positive integer
  • uses process.kill(pid, 'SIGKILL') on Unix-like platforms
  • uses spawnSync('taskkill', [...]) on Windows instead of shell execution

This makes the helper safer and avoids shell interpretation of invalid values.

Tests

  • node bin/licia.js format kill
  • node bin/licia.js lint kill
  • env HOME=/private/tmp/licia-home node bin/licia.js test kill -s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant