arina-ielchiieva commented on a change in pull request #1931: DRILL-6332: Allow 
to provide two-component Kerberos principals
URL: https://github.com/apache/drill/pull/1931#discussion_r357633489
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/BootStrapContext.java
 ##########
 @@ -135,10 +135,11 @@ private void login(final DrillConfig config) throws 
DrillbitStartupException {
         final String parts[] = KerberosUtil.splitPrincipalIntoParts(principal);
         if (parts.length != 3) {
           throw new DrillbitStartupException(
-              String.format("Invalid %s, Drill service principal must be of 
format: primary/instance@REALM",
-                ExecConstants.SERVICE_PRINCIPAL));
+            String.format("Invalid %s, Drill service principal must be of 
format 'primary/instance@REALM' or 'primary@REALM'",
+              ExecConstants.SERVICE_PRINCIPAL));
         }
-        parts[1] = KerberosUtil.canonicalizeInstanceName(parts[1], hostName);
+
+        parts[1] = (parts[1] == "")? "": 
KerberosUtil.canonicalizeInstanceName(parts[1], hostName);
 
 Review comment:
   ```suggestion
           parts[1] = (parts[1] == "") ? "" : 
KerberosUtil.canonicalizeInstanceName(parts[1], hostName);
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to