Bug 2220

Summary: Add uuid-style identifier for use with ControlPath
Product: Portable OpenSSH Reporter: mancha <mancha1>
Component: sshAssignee: Damien Miller <djm>
Status: CLOSED FIXED    
Severity: enhancement CC: djm
Priority: P5    
Version: -current   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 2226    
Attachments:
Description Flags
Enhancement patch
none
tweaked patch none

Description mancha 2014-04-04 16:29:46 AEDT
Created attachment 2418 [details]
Enhancement patch

When combining %h, %r, and %p (recommended for uniqueness) in ControlPath,
long remote usernames and/or hostnames can cause the expansion to bump up
against UNIX_PATH_MAX.

This patch adds a uuid-style path component (%m) that expands to the sha1 digest of the concatenation of the local host (%l) + remote host (%h) + remote port (%p) + remote user (%r).

The token's expanded length is a fixed 40 characters and provides a reasonable expectation of uniqueness.

Sample usage:

  ControlPath ~/.ssh/control-master/%m
Comment 1 Damien Miller 2014-07-03 14:47:02 AEST
Created attachment 2451 [details]
tweaked patch

We have a tohex() function that will format a binary blob as a hex string, so we can use that here.
Comment 2 Damien Miller 2014-07-03 16:39:37 AEST
patch applied - will be in OpenSSH 6.7
Comment 3 mancha 2014-08-22 04:47:54 AEST
Nice improvements to the patch - thanks (didn't know about tohex).

Cheers.
Comment 4 Damien Miller 2014-10-08 08:00:35 AEDT
Close all bugs left open from 6.6 and 6.7 releases.