git-plugin icon indicating copy to clipboard operation
git-plugin copied to clipboard

fix: Quote the username and password in credentials binding

Open gabyx opened this issue 3 years ago • 1 comments
trafficstars

JENKINS-27082 - Quote the username and password in credentials binding

Fix wrong quoting in askpass.

Won't solve all cases of quoting but will avoid some common problems related to quoting. For example, if the username or password includes a single quote, then the added quoting will fail. For the more common cases where the username or password contains a special special character that is not a single quote, this pull request will be an improvement.

Checklist

  • [x] I have read the CONTRIBUTING doc
  • [x] I have referenced the Jira issue related to my changes in one or more commit messages
  • [ ] I have added tests that verify my changes
  • [ ] Unit tests pass locally with my changes
  • [ ] I have added documentation as necessary
  • [ ] No Javadoc warnings were introduced with my changes
  • [ ] No spotbugs warnings were introduced with my changes
  • [ ] Documentation in README has been updated as necessary
  • [ ] Online help has been added and reviewed for any new or modified fields
  • [ ] I have interactively tested my changes
  • [ ] Any dependent changes have been merged and published in upstream modules (like git-client-plugin)

Types of changes

Correct quoting in bash script.

  • [ ] Dependency or infrastructure update
  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

gabyx avatar Aug 11 '22 15:08 gabyx

@MarkEWaite: See the followup #1314 which is a better and refactored solution. This PR still can go in as a patch first...

gabyx avatar Aug 16 '22 07:08 gabyx

Fixed in #1443 . Thanks for reporting the issue!

MarkEWaite avatar Jul 12 '23 00:07 MarkEWaite