remoting icon indicating copy to clipboard operation
remoting copied to clipboard

[JENKINS-72474] for ssh agents on z/OS neutralize char set conversions done by z/OS OpenSSH implementation

Open lne3 opened this issue 1 year ago • 0 comments
trafficstars

Fixing JENKINS-72474

On z/OS platform ssh stdin and stdout receive character set conversion between the EBCDIC code used at z/OS side and ISO-8859-1 character set (cf. OpenSSH and globalization table 1, scenario 5). This hampers communication between Jenkins ssh agents running on z/OS that communicate via stdin/stdout with Jenkins controller.

There are two known workarounds that require configuration:

  • run ssh agent with JVM option -Dfile.encoding=ISO-8859-1 (this may have unintended side effects on other Jenkins components/plugins)
  • run ssh agent with Prefix Start Agent Command iconv -f 1047 -t ISO8859-1 | ( and Suffix Start Agent Command ) | iconv -t 1047 -f ISO8859-1 (assuming that the z/OS side character set is IBM1047).

However, to address this issue and run ssh agents on z/OS out of the box without additional configuration a stream wrapper (hudson.remoting.ZosSshInOutStreamWrapper) is introduced that neutralizes the conversion done by z/OS OpenSSH implementation. By default the wrapper is enabled on z/OS platform only and uses system property ibm.system.encoding to determine the EBCDIC character set to be used. The EBCDIC character set can be specified explicitly by setting system property hudson.remoting.ZosSshInOutStreamWrapper to the character set name. To disable the wrapper set system property hudson.remoting.ZosSshInOutStreamWrapper to value disabled.

Testing done

A ssh agent on z/OS has been ramped up with various system properties:

  1. without any system properties set in JVM Options of the ssh agent configuration
  2. JVM Options -Dhudson.remoting.ZosSshInOutStreamWrapper=disabled -Dfile.encoding=ISO-8859-1
  3. JVM Options -Dhudson.remoting.ZosSshInOutStreamWrapper=IBM1047
### Submitter checklist
- [x] Make sure you are opening from a **topic/feature/bugfix branch** (right side) and not your main branch!
- [x] Ensure that the pull request title represents the desired changelog entry
- [x] Please describe what you did
- [x] Link to relevant issues in GitHub or Jira
- [ ] Link to relevant pull requests, esp. upstream and downstream changes
- [ ] Ensure you have provided tests - that demonstrates feature works or fixes the issue

lne3 avatar Jan 03 '24 19:01 lne3