[JIRA] (JENKINS-59737) sshUserPrivateKey's "KeyFileVariable" is missing drive letter on windows

1 view
Skip to first unread message

cowlinator@gmail.com (JIRA)

unread,
Oct 10, 2019, 6:17:02 PM10/10/19
to jenkinsc...@googlegroups.com
p cowlinator created an issue
 
Jenkins / Bug JENKINS-59737
sshUserPrivateKey's "KeyFileVariable" is missing drive letter on windows
Issue Type: Bug Bug
Assignee: Unassigned
Components: credentials-binding-plugin
Created: 2019-10-10 22:16
Environment: Master:
    Jenkins v 2.176.1
    from docker image jenkins/jenkins:lts
    Credential binding plugin v 1.19
Node:
    Windows Server 2019 (amd64)
Labels: plugin credentials Credentials
Priority: Major Major
Reporter: p cowlinator

I am seeing a bug when using 

withCredentials([sshUserPrivateKey(credentialsId: 'myCred', keyFileVariable: 'privateSshKey')]){}

 

Documentation for keyFileVariable states that it is "an environment variable to be set to the temporary path of the SSH key file".

 

The problem is that the value of the variable is a nearly, but not quite, absolute path.  On Windows specifically, it is missing the drive letter and colon.  This causes it to fail with commands such as "ssh -i ${privateSshKey} myUrl".

 

Example:  If the actual path is

`C:\home\jenkins\agent\workspace\myjob@abc\def\ghi-privateSshKey`,

then the environment variable is incorrectly set to

`/home/jenkins/agent/workspace/myjob@abc/def/ghi-privateSshKey`

 

This was very difficult to debug because the plugin masks/censors all output containing the path.  There should be a way to opt out of the masking of logs.

 

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages