MCPcopy Create free account
hub / github.com/apache/impala / GetConfiguredPrincipal

Function GetConfiguredPrincipal

be/src/kudu/security/init.cc:449–463  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

447}
448
449Status GetConfiguredPrincipal(const string& in_principal, string* out_principal) {
450 *out_principal = in_principal;
451 static const auto& kHostToken = "_HOST";
452 if (in_principal.find(kHostToken) != string::npos) {
453 string hostname;
454 // Try to fill in either the FQDN or hostname.
455 if (!GetFQDN(&hostname).ok()) {
456 RETURN_NOT_OK(GetHostname(&hostname));
457 }
458 // Hosts in principal names are canonicalized to lower-case.
459 std::transform(hostname.begin(), hostname.end(), hostname.begin(), tolower);
460 GlobalReplaceSubstring(kHostToken, hostname, out_principal);
461 }
462 return Status::OK();
463}
464
465optional<string> GetLoggedInPrincipalFromKeytab() {
466 if (!g_kinit_ctx) {

Callers 1

InitKerberosForServerFunction · 0.85

Calls 9

GetFQDNFunction · 0.85
GlobalReplaceSubstringFunction · 0.85
OKFunction · 0.85
GetHostnameFunction · 0.50
transformFunction · 0.50
findMethod · 0.45
okMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected