ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gau...@apache.org
Subject incubator-ranger git commit: RANGER-940 : Add null check for ranger.ks.hsm.enabled property
Date Thu, 21 Apr 2016 06:28:26 GMT
Repository: incubator-ranger
Updated Branches:
  refs/heads/master 8614032c9 -> 017826011


RANGER-940 : Add null check for ranger.ks.hsm.enabled property

Signed-off-by: Gautam Borad <gautam@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/01782601
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/01782601
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/01782601

Branch: refs/heads/master
Commit: 017826011cc882d5a49cb27274e545eff269b676
Parents: 8614032
Author: Ankita Sinha <ankita.sinha@freestoneinfotech.com>
Authored: Wed Apr 20 12:52:34 2016 +0530
Committer: Gautam Borad <gautam@apache.org>
Committed: Thu Apr 21 11:58:10 2016 +0530

----------------------------------------------------------------------
 .../java/org/apache/hadoop/crypto/key/RangerKeyStoreProvider.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/01782601/kms/src/main/java/org/apache/hadoop/crypto/key/RangerKeyStoreProvider.java
----------------------------------------------------------------------
diff --git a/kms/src/main/java/org/apache/hadoop/crypto/key/RangerKeyStoreProvider.java b/kms/src/main/java/org/apache/hadoop/crypto/key/RangerKeyStoreProvider.java
index 12c9ed4..081e279 100755
--- a/kms/src/main/java/org/apache/hadoop/crypto/key/RangerKeyStoreProvider.java
+++ b/kms/src/main/java/org/apache/hadoop/crypto/key/RangerKeyStoreProvider.java
@@ -38,6 +38,7 @@ import java.util.Map;
 
 import javax.crypto.spec.SecretKeySpec;
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.conf.Configuration;
 import org.codehaus.jackson.map.ObjectMapper;
@@ -90,7 +91,7 @@ public class RangerKeyStoreProvider extends KeyProvider{
 		if(password == null || password.trim().equals("") || password.trim().equals("_") || password.trim().equals("crypted")){
 			throw new IOException("Master Key Jceks does not exists");
 		}
-		if(conf.get(HSM_ENABLED).equalsIgnoreCase("false")){
+		if(StringUtils.isEmpty(conf.get(HSM_ENABLED)) || conf.get(HSM_ENABLED).equalsIgnoreCase("false")){
 			rangerMasterKey = new RangerMasterKey(daoManager);
 		}else{
 			rangerMasterKey = new RangerHSM(conf);


Mime
View raw message