-
Notifications
You must be signed in to change notification settings - Fork 105
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
fix problematic parsing of keyspec #246
Conversation
The original had some flaws. The `.*` statement is an eager match and could eat spaces. An example: `options ssh-xyz key name with spaces` would be matched as: ``` [ "options ", "options", "ssh-xyz key name", "ssh", "with", "spaces" ] ``` The new regex would match it like this: ``` [ "options ", "options", "ssh-xyz", "ssh", "key", "name with spaces" ] ``` Another example: `ssh-xyz key ssh name with spaces` ``` [ "ssh-xyz key ", "ssh-xyz key", "ssh name", "ssh", "with", "spaces" ] ``` vs ``` [ "", "", "ssh-xyz", "ssh", "key", "ssh name with spaces" ] ``` Workaround until a fix is released: carefully manage the spaces and do not use `ssh` or `ecdsa-sha2` in unexpected places (certainly no spaces in the name). Thanks to @ekoster for finding this.
|
Hi @EECOLOR There seems to be a problem when running on Puppet 6. Acceptance tests are passing on Puppet 5, but on Puppet 6 there are 3 failures. Edit: looks like the master is also failing. Looking into it :-) |
|
The problem is related, the following would fail with both the old and proposed regular expression: https://github.com/puppetlabs/puppetlabs-accounts/blob/master/spec/acceptance/accounts_spec.rb#L49 |
|
If having a space inside the A naive adaptation ( Please note that the current version and the previous version (using |
|
@EECOLOR I'm happy to merge this as soon as the build is passing. Unfortunately, there has been a regression introduced with the release of puppet 6.8.0 so we might have to wait a couple of days for the fix to be released. |
|
@EECOLOR Thank you. Tests are running clean now. |

The original had some flaws. The
.*statement is an eager match and could eat spaces. An example:options ssh-xyz key name with spaceswould be matched as:The new regex would match it like this:
Another example:
ssh-xyz key ssh name with spacesvs
Workaround until a fix is released: carefully manage the spaces and do not use
sshorecdsa-sha2in unexpected places (certainly no spaces in the name).Thanks to @ekoster for finding this.