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

Function GetPasswordFromShellCommand

be/src/kudu/util/openssl_util.cc:358–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

356}
357
358Status GetPasswordFromShellCommand(const string& cmd, string* password) {
359 vector<string> argv = strings::Split(cmd, " ", strings::SkipEmpty());
360 if (argv.empty()) {
361 return Status::RuntimeError("invalid empty private key password command");
362 }
363 string stderr, stdout;
364 Status s = Subprocess::Call(argv, "" /* stdin */, &stdout, &stderr);
365 if (!s.ok()) {
366 return Status::RuntimeError(strings::Substitute(
367 "failed to run private key password command: $0", s.ToString()), stderr);
368 }
369 StripTrailingWhitespace(&stdout);
370 *password = stdout;
371 return Status::OK();
372}
373
374string GetProtocolName(const SSL* ssl) {
375 SCOPED_OPENSSL_NO_PENDING_ERRORS;

Callers 1

BuildMethod · 0.85

Calls 9

SplitFunction · 0.85
SkipEmptyClass · 0.85
RuntimeErrorFunction · 0.85
SubstituteFunction · 0.85
StripTrailingWhitespaceFunction · 0.85
OKFunction · 0.85
emptyMethod · 0.45
okMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected