You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add support for extension lsetstat@openssh.com #651
I would definitely suggest going for targeting v2 for extensions. I already have quite a few, but I hadn’t seen this lsetstat@openssh.com one yet.
Probably need to think on how I expect an extended type request gets sent. sftp.Client should probably support it through a direct LSetStat call… or rather the various chown chtimes etc should have an L prefix varient.
Though utimensat isn’t going to be possible, even lsetstat@openssh.com only has second precision through the File Attributes specification.
I got utimensat from reading the openssh sftp-server implementation. But yeah, the fact that it uses utimensat to set it, does not mean that there is ns (nanosecond) precision in the protocol on the wire.
I'd like to pick this up for v2. The lsetstat@openssh.com packet is already in encoding/ssh/filexfer/openssh (#656), so what's left is the client and server side. Which client API would you prefer: L-prefixed variants (Lchmod, Lchown, Lchtimes), a single LSetStat(name, attrs), or both?
I've started with the L-prefixed variants, since that's what you suggested in #648, but it's easy to switch. On the server side I've added an extension interface like HardlinkServerHandler, advertised when the handler implements it, and implemented it in localfs as far as the platform allows (Linux can't change a symlink's mode, for example).
I don't have resource to page in the whole context of this again. But it sounds like multiple Lch* makes sense, as that would matches existing Ch* client functions, right?
Updated #684 to reflect the agreement here: the client API uses Lchmod, Lchown and Lchtimes, matching the existing Chmod/Chown/Chtimes methods. The implementation already provides these methods, so this update only changes the PR description: it links to the decision and removes the open question about offering a single LSetStat method.
Activity
christhomas commentedon Oct 17, 2026
I'd like to pick this up for v2. The
lsetstat@openssh.compacket is already inencoding/ssh/filexfer/openssh(#656), so what's left is the client and server side. Which client API would you prefer:L-prefixed variants (Lchmod,Lchown,Lchtimes), a singleLSetStat(name, attrs), or both?I've started with the
L-prefixed variants, since that's what you suggested in #648, but it's easy to switch. On the server side I've added an extension interface likeHardlinkServerHandler, advertised when the handler implements it, and implemented it inlocalfsas far as the platform allows (Linux can't change a symlink's mode, for example).quite commentedon Oct 18, 2026
I don't have resource to page in the whole context of this again. But it sounds like multiple
Lch*makes sense, as that would matches existingCh*client functions, right?christhomas commentedon Oct 18, 2026
That would seem more consistent yeah, Ch* and Lch*, thats consistent
christhomas commentedon Oct 18, 2026
Updated #684 to reflect the agreement here: the client API uses
Lchmod,LchownandLchtimes, matching the existingChmod/Chown/Chtimesmethods. The implementation already provides these methods, so this update only changes the PR description: it links to the decision and removes the open question about offering a singleLSetStatmethod.puellanivis commentedon Oct 18, 2026
Everything is solid argument here except we’ve switched to prefixes being separate words. So,
LChmod,LChown, andLChtimes.christhomas commentedon Oct 18, 2026
Done: #684 now uses
LChmod,LChownandLChtimes(da648b8), and the PR description is updated to match.