HIVE-10572 - Improve Hive service test to check empty string (Chao, reviewed by 
Thejas)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/65d63666
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/65d63666
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/65d63666

Branch: refs/heads/llap
Commit: 65d63666d361ac8ad845dec5be1523f8ba88ff10
Parents: 50704ee
Author: Chao Sun <[email protected]>
Authored: Fri May 1 17:12:08 2015 -0700
Committer: Chao Sun <[email protected]>
Committed: Fri May 1 17:12:08 2015 -0700

----------------------------------------------------------------------
 .../apache/hive/service/auth/LdapAuthenticationProviderImpl.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/65d63666/service/src/java/org/apache/hive/service/auth/LdapAuthenticationProviderImpl.java
----------------------------------------------------------------------
diff --git 
a/service/src/java/org/apache/hive/service/auth/LdapAuthenticationProviderImpl.java
 
b/service/src/java/org/apache/hive/service/auth/LdapAuthenticationProviderImpl.java
index 854d078..4e2ef90 100644
--- 
a/service/src/java/org/apache/hive/service/auth/LdapAuthenticationProviderImpl.java
+++ 
b/service/src/java/org/apache/hive/service/auth/LdapAuthenticationProviderImpl.java
@@ -53,7 +53,7 @@ public class LdapAuthenticationProviderImpl implements 
PasswdAuthenticationProvi
       user  = user + "@" + ldapDomain;
     }
 
-    if (password == null || password.isEmpty()) {
+    if (password == null || password.isEmpty() || password.getBytes()[0] == 0) 
{
       throw new AuthenticationException("Error validating LDAP user:" +
           " a null or blank password has been provided");
     }

Reply via email to