Bug 2449 - uid for expansion in ControlPath
Summary: uid for expansion in ControlPath
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 7.0p1
Hardware: All All
: P5 enhancement
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_7_2
  Show dependency treegraph
 
Reported: 2015-08-21 20:38 AEST by Christian Hesse
Modified: 2023-01-13 13:39 AEDT (History)
2 users (show)

See Also:


Attachments
uid for expansion in ControlPath (1.96 KB, patch)
2015-08-21 20:38 AEST, Christian Hesse
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Hesse 2015-08-21 20:38:03 AEST
Created attachment 2687 [details]
uid for expansion in ControlPath

Modern Linux systems create a private directory in /run/user/ for each
user, named by numeric user id (uid). This adds a new character sequence
'%i' for expansion in ControlPath to match this (and possibly other)
directory.
Comment 1 Damien Miller 2015-09-04 14:00:42 AEST
Comment on attachment 2687 [details]
uid for expansion in ControlPath

Looks fine to me
Comment 2 Darren Tucker 2015-09-04 14:08:47 AEST
Comment on attachment 2687 [details]
uid for expansion in ControlPath

>-	char thishost[NI_MAXHOST], shorthost[NI_MAXHOST], portstr[NI_MAXSERV];
>+	char thishost[NI_MAXHOST], shorthost[NI_MAXHOST], portstr[NI_MAXSERV],
>+	    uidstr[11];
> 	char cname[NI_MAXHOST];

I'd maybe make uidstr part of the following line for neatness.

Also, someone will eventually make a 64 bit uid_t, so perhaps you want to spend the extra 10 bytes of stacks space now?
Comment 3 Damien Miller 2015-09-11 13:48:00 AEST
applied (with uidstr sized to fit a 64-bit UID)
Comment 4 Damien Miller 2016-08-02 10:41:50 AEST
Close all resolved bugs after 7.3p1 release