Bug 2220 - Add uuid-style identifier for use with ControlPath
Summary: Add uuid-style identifier for use with ControlPath
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: -current
Hardware: All All
: P5 enhancement
Assignee: Damien Miller
URL:
Keywords:
Depends on:
Blocks: V_6_7
  Show dependency treegraph
 
Reported: 2014-04-04 16:29 AEDT by mancha
Modified: 2014-10-08 08:00 AEDT (History)
1 user (show)

See Also:


Attachments
Enhancement patch (3.24 KB, patch)
2014-04-04 16:29 AEDT, mancha
no flags Details | Diff
tweaked patch (3.75 KB, patch)
2014-07-03 14:47 AEST, Damien Miller
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.