-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
some commands fail when the current directory's path includes spaces #135
Comments
@MichaelPeter-Shockoe Thanks for the detailed report. Are you interested in providing a fix? |
No problem. Unfortunately I don't have the bandwidth to commit time towards a fix right now though |
@joshrabinowitz Could you please verify that this is still an issue? |
@sobolevn it is still an issue. I see these issues so far:
|
And here's the first error you'll encounter if you try to create a git-secret repo using a directory with spaces
|
Can anyone provide tips fixing these issues? Not a bash master here (yet) |
@joshrabinowitz you have to look for expression expansion issues. It generally means that we are missing |
Yeah, I've tried all sorts of quoting changes so far, I could use some specific guidance |
Relevant: http://mywiki.wooledge.org/Quotes http://mywiki.wooledge.org/BashFAQ/050#I_only_want_to_pass_options_if_the_runtime_data_needs_them
I'm pretty sure this is extra important:
https://github.com/anordal/shellharden/blob/master/how_to_do_things_safely_in_bash.md |
Also affected by this. 😢 |
I think we should release 0.2.4 without this fix (since we don't have the fix yet). |
This is fixed by PR #224, which should be in the next release |
@joshrabinowitz thank you for your hard work! I know this was a challenging one. |
@sobolevn you're quite welcome! Thanks for all your time and work writing and supporting git-secret. |
Hi all! I just encountered this issue again, today, 08/07/22, after running Here's the terminal output:
I don't have a fix for this but just wanted to post that it's an issue that I am encountering again. |
confirmed regression on current |
Even though I closed this ticket some time ago, I don't think this actually was ever fixed for the case of spaces in parent directories (we did fix the case of spaces in filenames and directories in the git-secret repo). I'm not sure how to fix the underlying problem which is an issue with quoting in the gawk code |
This is because (at the very least) the gawk scripts used in git-secret can't handle spaces in parent directory names. To replicate:
Note how it truncates the directory name at the first space |
@hurricanehrndz it looks like you're the original author of the awk code that git-secret depends on and is causing issues here. |
Some commands, specifically at least
git secret init
andgit secret reveal
, encounter errors when the current directory's path contains any spaces. I personally avoid using spaces in directory names, but I am attempting to set up git-secret with our CI server and must work around the existing structure there.What are the steps to reproduce this issue?
In place of the suggested sections, I will provide two full examples which I hope will show the issue clearly.
Note: both of these examples take place on a machine on which I am able to use git-secret without issue when the path does not contain a space
Example 1 - Initializing to a directory which contains a space
Here is the base case where I try to set up git-secret from scratch in a directory which already contains a space in the path
Example 2 - Calling
git secret reveal
from a directory which contains a spaceHere, I first initialize git-secret and encrypt a file successfully in a directory with no spaces in the path so that I can get further along in the process. I then rename the directory to contain a space and try to call
git secret reveal
Any other comments?
I inserted some logging and played with the code a bit, and I believe the issue is stemming from lines of the form
$($gpg_local ......)
A little research pointed me towards the use of
eval
for better interpretation of commands formed by concatenating strings, but I am not sure of the security implications around that command.What versions of software are you using?
Operating system: macOS 10.13.3
git-secret
path: /usr/local/bin/git-secretgit-secret
version: 0.2.2git
version: 2.11.1Shell type and version: zsh 5.3 (x86_64-apple-darwin17.0)
gpg
version: 2.2.5The text was updated successfully, but these errors were encountered: