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
Escape user name in Airbrake notify command #144
Conversation
I see recipes all over the place that don't properly escape user input in their shell commands. This could be problematic if someone's name is This solution at least works on Ruby 1.8: perhaps someone can figure out what needs to be done to have it work in Windows, too. |
Also, I followed all the directions in the |
@jasonmp85 sorry for not updating you sooner. Looks good to me! Some tests would be wonderful. We've had some issues with the test suite, but everything is working like charm now. You can run the unit tests with
Or the complete suite with
I'll understand if you don't want to do this anymore, but please let me know. |
If a user has manually overridden this variable to be a full name, it may contain a space which will break the command. Escaping the name solves this issue. Added a unit test for a name needing escaping.
Got the tests running (they only run on master and I had rebased off the latest release tag because I wanted to have a stable base, heh) so I wrote a simple test to look for the escaped values in the capistrano output. Having whitebox knowledge of the codebase, I know that the command echoed is the command run, but I guess to really be certain we should turn off The |
Anyways, tests all pass and I've been using this patch for several months now to put real names in deployment notifications (I use the full git user name if present, so it shows up as "Jason Petersen", which is descriptive, unlike my system username which is just "jason"). Tell me if anything else is required for merge. |
Any update? All the tests pass and I've added one to test the escaping functionality. |
Escape user name in Airbrake notify command
Nicely done. Thanks Jason! |
If a user has manually overridden this variable to be a full name, it
may contain a space which will break the command. Escaping the name
solves this issue.
This is an attempt to solve #103, which has been bothering me for almost a year. The main issue is that I don't want to use simple usernames because at a decentralized-enough company, those are basically user-chosen. I like using full, real names, but those break. This fixes it (at least in Unix).