Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve shell escaping and handling #175

Merged
merged 3 commits into from
May 1, 2019
Merged

Improve shell escaping and handling #175

merged 3 commits into from
May 1, 2019

Conversation

GUI
Copy link
Collaborator

@GUI GUI commented May 1, 2019

There are several places where we call shell scripts with arguments that may not have been properly escaped if the argument contained spaces or other special characters. So, for example, if you set your data directory to a path with spaces, these commands could fail.

This fixes it by shifting our blocking shell calls to use lua-shell-games, which is a library I extracted to better handle escaping and the various oddities around calling shell commands in different versions of Lua. That separate library has much better test coverage for shell-specific things and testing across different Lua versions.

This also fixes the issue for our non-blocking shell calls (still made via lua-resty-shell) by using the same quoting utility functions from lua-shell-games.

@GUI GUI added this to the v0.13.0 milestone May 1, 2019
@GUI GUI merged commit 718205d into master May 1, 2019
@GUI GUI deleted the shell-escaping branch May 1, 2019 05:44
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