[JIRA] (JENKINS-60316) Git client plugin doesn't quote file locations in askpass wrappers

0 views
Skip to first unread message

waldemar.zurowski@r3.com (JIRA)

unread,
Nov 28, 2019, 6:08:02 AM11/28/19
to jenkinsc...@googlegroups.com
Waldemar Zurowski updated an issue
 
Jenkins / Bug JENKINS-60316
Git client plugin doesn't quote file locations in askpass wrappers
Change By: Waldemar Zurowski
Summary: Git client plugin doesn't quote file locations in askpass wrappers
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

mark.earl.waite@gmail.com (JIRA)

unread,
Nov 28, 2019, 10:43:02 AM11/28/19
to jenkinsc...@googlegroups.com
Mark Waite commented on Bug JENKINS-60316
 
Re: Git client plugin doesn't quote file locations in askpass wrappers

Which version of git client plugin are you using? The git client plugni 4.0.0 release includes an attempt to handle this case and other cases related to atypical project and temporary directory names.

mark.earl.waite@gmail.com (JIRA)

unread,
Nov 28, 2019, 10:43:03 AM11/28/19
to jenkinsc...@googlegroups.com
Mark Waite assigned an issue to Unassigned
 
Change By: Mark Waite
Assignee: Mark Waite

waldemar.zurowski@r3.com (JIRA)

unread,
Nov 28, 2019, 11:43:02 AM11/28/19
to jenkinsc...@googlegroups.com
Waldemar Zurowski commented on Bug JENKINS-60316
 
Re: Git client plugin doesn't quote file locations in askpass wrappers

I checked the master branch in Github and the problem was still there. Anyhow - the version we use is 3.0.0

mark.earl.waite@gmail.com (JIRA)

unread,
Nov 28, 2019, 11:50:01 AM11/28/19
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
Nov 28, 2019, 11:50:02 AM11/28/19
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Bug JENKINS-60316
Which version of git client plugin are you using?  The git client plugni 4 plugin 3 .0.0 release includes an attempt to handle this case and other cases related to atypical project and temporary directory names.

waldemar.zurowski@r3.com (JIRA)

unread,
Nov 29, 2019, 8:01:02 AM11/29/19
to jenkinsc...@googlegroups.com

Mark - is there any way I could dump an actual content of that jenkins-gitclient-pass file?

waldemar.zurowski@r3.com (JIRA)

unread,
Nov 29, 2019, 10:12:05 AM11/29/19
to jenkinsc...@googlegroups.com

Also one more clarification - this happens when Jenkinsfile uses external libraries

@Library('existing-build-control')

and this library is defined as a Github repository, fetched over HTTPS

waldemar.zurowski@r3.com (JIRA)

unread,
Nov 29, 2019, 10:53:02 AM11/29/19
to jenkinsc...@googlegroups.com

Also further to my note, the culprit seems to be:

filename = filename.replaceAll("'", "\\'");

in the unixArgEncodeFileName method (and others) which doesn't appear to actually do anything.

mark.earl.waite@gmail.com (JIRA)

unread,
Dec 1, 2019, 10:01:02 AM12/1/19
to jenkinsc...@googlegroups.com

You can dump the contents of the files that contain the credentials information by either deleting the line which removes the file and recompiling the git client plugin or by running Jenkins in a debugger and pausing execution with a breakpoint before the file is deleted.

The line that you cite is intended to replace any embedded single quote characters with an escaped single quote.

waldemar.zurowski@r3.com (JIRA)

unread,
Dec 1, 2019, 10:20:02 AM12/1/19
to jenkinsc...@googlegroups.com

This line of code doesn't change anything because the quoting backslash is consumed by regexp handling so in the end it replaces a single quote with identical single quote.

waldemar.zurowski@r3.com (JIRA)

unread,
Dec 2, 2019, 10:41:03 AM12/2/19
to jenkinsc...@googlegroups.com

Also - this is wrong, as well. You cannot escape a single quote that way at all. Perhaps org.apache.commons.text.StringEscapeUtils.Builder should be used instead

waldemar.zurowski@r3.com (JIRA)

unread,
Dec 2, 2019, 10:56:02 AM12/2/19
to jenkinsc...@googlegroups.com
Waldemar Zurowski edited a comment on Bug JENKINS-60316
Also - this is wrong, as well. You cannot escape a single quote that way at all. Perhaps {{org.apache.commons.text.StringEscapeUtils. Builder escape XSI }} should be used instead

rene.scheibe@gmail.com (JIRA)

unread,
Dec 29, 2019, 7:11:03 AM12/29/19
to jenkinsc...@googlegroups.com

rene.scheibe@gmail.com (JIRA)

unread,
Dec 29, 2019, 9:09:02 AM12/29/19
to jenkinsc...@googlegroups.com

rene.scheibe@gmail.com (JIRA)

unread,
Dec 29, 2019, 9:10:06 AM12/29/19
to jenkinsc...@googlegroups.com

rene.scheibe@gmail.com (JIRA)

unread,
Dec 29, 2019, 9:10:09 AM12/29/19
to jenkinsc...@googlegroups.com
René Scheibe started work on Bug JENKINS-60316
 
Change By: René Scheibe
Status: Open In Progress

rene.scheibe@gmail.com (JIRA)

unread,
Dec 29, 2019, 11:51:03 AM12/29/19
to jenkinsc...@googlegroups.com

rene.scheibe@gmail.com (JIRA)

unread,
Jan 18, 2020, 1:31:03 PM1/18/20
to jenkinsc...@googlegroups.com
René Scheibe resolved as Fixed
Change By: René Scheibe
Status: In Progress Resolved
Assignee: René Scheibe
Resolution: Fixed
Released As: git-client-3.1.0

mark.earl.waite@gmail.com (JIRA)

unread,
Jan 18, 2020, 1:32:03 PM1/18/20
to jenkinsc...@googlegroups.com
Mark Waite closed an issue as Fixed
 

Fixed in git client plugin 3.1.0 release Jan 18, 2020.

Change By: Mark Waite
Status: Resolved Closed
Reply all
Reply to author
Forward
0 new messages