This is an automated email from the ASF dual-hosted git repository.

alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 8a26e843a1ff5a807a4b6f1c77f6146bc5156398
Author: Andrew Wong <[email protected]>
AuthorDate: Wed Feb 16 18:32:00 2022 -0800

    [security] harmonize updates to mini_kdc
    
    Impala recently rebased their Kudu libraries and ran into some build
    issues. This patch addresses one:
    
    An Impala backend test calls MiniKdc::Kinit() with parameter
    "dummy/host", but "/" caused a runtime error in MiniKdc::Kinit(). This
    patch replaces "/" with "_" when creating the template. The same is not
    done for principal names, which can consist "/".
    
    This is a follow-up to 8133fbfb734c18be8f4abb3ee83ac9dd0cc4ce16.
    
    Change-Id: I60bd9a0bf3113a689a252182b4e6292dff12a9e7
    Reviewed-on: http://gerrit.cloudera.org:8080/18245
    Tested-by: Kudu Jenkins
    Reviewed-by: Alexey Serbin <[email protected]>
---
 src/kudu/security/test/mini_kdc.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/kudu/security/test/mini_kdc.cc 
b/src/kudu/security/test/mini_kdc.cc
index 831699c..7e6a0e8 100644
--- a/src/kudu/security/test/mini_kdc.cc
+++ b/src/kudu/security/test/mini_kdc.cc
@@ -309,7 +309,9 @@ Status MiniKdc::Kinit(const string& username) {
   RETURN_NOT_OK(GetBinaryPath("kinit", &kinit));
   unique_ptr<WritableFile> tmp_cc_file;
   string tmp_cc_path;
-  const auto tmp_template = Substitute("kinit-temp-$0.XXXXXX", username);
+  string tmp_username = username;
+  StripString(&tmp_username, "/", '_');
+  const auto tmp_template = Substitute("kinit-temp-$0.XXXXXX", tmp_username);
   WritableFileOptions opts;
   opts.is_sensitive = false;
   RETURN_NOT_OK_PREPEND(Env::Default()->NewTempWritableFile(

Reply via email to