Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:20
erlang
1248-Encode-longname-field-along-with-file-name...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1248-Encode-longname-field-along-with-file-name-in-sftp-v.patch of Package erlang
From 1950f475f4c6b82c99919b87f28678c4f01d74b6 Mon Sep 17 00:00:00 2001 From: Jonatas Cardador <jonatas.cardador@gmail.com> Date: Tue, 9 Feb 2021 10:11:22 +0100 Subject: [PATCH 1/2] Encode longname field along with file name in sftp version 3 The longname field in the SSH_FXP_NAME response is an expanded format for the file name. --- lib/ssh/src/ssh_xfer.erl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/ssh/src/ssh_xfer.erl b/lib/ssh/src/ssh_xfer.erl index e4d97b7393..d4fa0ccd9f 100644 --- a/lib/ssh/src/ssh_xfer.erl +++ b/lib/ssh/src/ssh_xfer.erl @@ -809,6 +809,15 @@ decode_names(Vsn, I, <<?UINT32(Len), FileName:Len/binary, encode_names(Vsn, NamesAndAttrs) -> lists:mapfoldl(fun(N, L) -> encode_name(Vsn, N, L) end, 0, NamesAndAttrs). +encode_name(Vsn, {{NameUC,LongNameUC},Attr}, Len) when Vsn =< 3 -> + Name = binary_to_list(unicode:characters_to_binary(NameUC)), + NLen = length(Name), + LongName = binary_to_list(unicode:characters_to_binary(LongNameUC)), + LNLen = length(LongName), + EncAttr = encode_ATTR(Vsn, Attr), + ALen = size(EncAttr), + NewLen = Len + NLen + LNLen + 4 + 4 + ALen, + {[<<?UINT32(NLen)>>, Name, <<?UINT32(LNLen)>>, LongName, EncAttr], NewLen}; encode_name(Vsn, {NameUC,Attr}, Len) when Vsn =< 3 -> Name = binary_to_list(unicode:characters_to_binary(NameUC)), NLen = length(Name), -- 2.26.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor