MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / bufferToString

Function bufferToString

src/Access/GSSAcceptor.cpp:46–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44#if USE_KRB5
45
46String bufferToString(const gss_buffer_desc & buf)
47{
48 // Copy the GSS buffer verbatim. Do not strip trailing NULs: some callers (notably
49 // output_token_buf from gss_accept_sec_context, which carries an encrypted AP-REP in
50 // SPNEGO) pass opaque binary data where trailing 0x00 bytes are meaningful. Display
51 // strings from gss_display_status / gss_display_name have buf.length excluding the
52 // NUL terminator on MIT krb5 and Heimdal, so no trimming is needed there either.
53 String str;
54
55 if (buf.length > 0 && buf.value != nullptr)
56 str.assign(static_cast<char *>(buf.value), buf.length);
57
58 return str;
59}
60
61namespace
62{

Callers 4

extractNameAndRealmFunction · 0.85
processTokenMethod · 0.85
TESTFunction · 0.85

Calls 1

assignMethod · 0.45

Tested by 1

TESTFunction · 0.68