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

chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new a5f733b42 [KYUUBI #3047] Fallback krb5 conf to OS if not configured
a5f733b42 is described below

commit a5f733b42ec291132cd25f6883da0d8d00de262e
Author: Cheng Pan <[email protected]>
AuthorDate: Tue Jul 12 18:52:57 2022 +0800

    [KYUUBI #3047] Fallback krb5 conf to OS if not configured
    
    ### _Why are the changes needed?_
    
    We should not assume that the default `krb5.conf` is located at 
`/etc/krb5.conf`, it OS-depended.
    
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including 
negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [x] [Run 
test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests)
 locally before make a pull request
    
    Closes #3047 from pan3793/kinit.
    
    Closes #3047
    
    16b5d930 [Cheng Pan] Revert "Check kinit in GA"
    8e465e18 [Cheng Pan] Check kinit in GA
    d53ea1fa [Cheng Pan] Fallback krb5 conf to OS if not configured
    
    Authored-by: Cheng Pan <[email protected]>
    Signed-off-by: Cheng Pan <[email protected]>
---
 .../main/scala/org/apache/kyuubi/server/KinitAuxiliaryService.scala    | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git 
a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KinitAuxiliaryService.scala
 
b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KinitAuxiliaryService.scala
index cb0f99e19..a8997401a 100644
--- 
a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KinitAuxiliaryService.scala
+++ 
b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KinitAuxiliaryService.scala
@@ -47,10 +47,9 @@ class KinitAuxiliaryService() extends 
AbstractService("KinitAuxiliaryService") {
       UserGroupInformation.loginUserFromKeytab(principal.get, keytab.get)
       val krb5Conf = Option(System.getProperty("java.security.krb5.conf"))
         .orElse(Option(System.getenv("KRB5_CONFIG")))
-        .getOrElse("/etc/krb5.conf")
       val commands = Seq("kinit", "-kt", keytab.get, principal.get)
       val kinitProc = new ProcessBuilder(commands: _*).inheritIO()
-      kinitProc.environment().put("KRB5_CONFIG", krb5Conf)
+      krb5Conf.foreach(kinitProc.environment().put("KRB5_CONFIG", _))
       kinitTask = new Runnable {
         override def run(): Unit = {
           val process = kinitProc.start()

Reply via email to