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

Allow for longer command line strings. #5

Merged
merged 1 commit into from
Jul 21, 2016
Merged

Conversation

GUI
Copy link
Contributor

@GUI GUI commented Jul 21, 2016

Previously, if the command line string exceeded 504 characters, the command would fail due to the command not being read in properly. This would result in odd errors being returned, like /bin/sh: 7cho: command not found.

This increases the limit to 2040 characters, adds a test, and adds a reference to this limit to the README.

For this pull request, I took the very simplistic approach and just increased the existing hard-coded limit. However, this limit is still fairly arbitrary. While this should help if you happen to have longer commands (as I was encountering), there's still the possibility of overflowing this limit if you have super-duper long commands. If you'd prefer to allow for even longer strings, then reading in the data with something like getline (which handles reallocs), might be better (although some limit may still need to be enforced). But I thought I'd get your feedback and thoughts before trying any larger changes.

Thanks!

Previously, if the command line string exceeded 504 characters, the
command would fail due to the command not being read in properly.

This increases the limit to 2040 characters, adds a test, and adds a
reference to this limit to the README.
GUI added a commit to auto-ssl/lua-resty-auto-ssl that referenced this pull request Jul 21, 2016
This cropped up in our CI environment, since due to the recent changes
to the letsencrypt_hooks arguments, we needed to pass additional command
line arguments in. This worked fine in my local environment, but this
ended up breaking on our CI environment. This uncovered the fact that
sockproc limits the length of the command line string. Since some of the
file paths happened to be longer in the CI environment, we ended up
exceeding this limit.

This resolves it by using a fork of sockproc to allow for longer command
line strings: juce/sockproc#5
@juce
Copy link
Owner

juce commented Jul 21, 2016

Nick,

thanks for the patch!
Good quick fix, which probably takes care of most real-life situations. However, you're right: ideally it should allow for arbitrary long commands (even though exec might have some internal limits too). I'll work on that.

@juce juce merged commit fc8ad3f into juce:master Jul 21, 2016
@GUI
Copy link
Contributor Author

GUI commented Jul 22, 2016

Thank you, much appreciated!

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.

2 participants