You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ve...@apache.org on 2016/08/11 04:16:39 UTC

[4/5] incubator-ranger git commit: RANGER-1124: Fixes for CID#s 131473, 150594, 150789

RANGER-1124: Fixes for CID#s 131473, 150594, 150789

Signed-off-by: Velmurugan Periasamy <ve...@apache.org>
(cherry picked from commit 09b52b939bcd957be7e5a6a85a138c0fee29f9df)


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

Branch: refs/heads/ranger-0.6
Commit: ce7edb25bd3bf5f1a5be2996ebdb3810ecde5e60
Parents: b795649
Author: Sailaja Polavarapu <sp...@hortonworks.com>
Authored: Thu Jul 28 09:52:10 2016 -0700
Committer: Velmurugan Periasamy <ve...@apache.org>
Committed: Thu Aug 11 09:33:41 2016 +0530

----------------------------------------------------------------------
 .../ranger/ldapconfigcheck/LdapConfigCheckMain.java     |  9 ++++++++-
 .../ranger/authentication/unix/jaas/PamLoginModule.java |  5 +++--
 .../authentication/UnixAuthenticationService.java       | 12 +++++++++---
 3 files changed, 20 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/ce7edb25/ugsync/ldapconfigchecktool/ldapconfigcheck/src/main/java/org/apache/ranger/ldapconfigcheck/LdapConfigCheckMain.java
----------------------------------------------------------------------
diff --git a/ugsync/ldapconfigchecktool/ldapconfigcheck/src/main/java/org/apache/ranger/ldapconfigcheck/LdapConfigCheckMain.java b/ugsync/ldapconfigchecktool/ldapconfigcheck/src/main/java/org/apache/ranger/ldapconfigcheck/LdapConfigCheckMain.java
index fe9326f..3bcb840 100644
--- a/ugsync/ldapconfigchecktool/ldapconfigcheck/src/main/java/org/apache/ranger/ldapconfigcheck/LdapConfigCheckMain.java
+++ b/ugsync/ldapconfigchecktool/ldapconfigcheck/src/main/java/org/apache/ranger/ldapconfigcheck/LdapConfigCheckMain.java
@@ -58,7 +58,7 @@ public class LdapConfigCheckMain {
         PrintStream logFile = null;
         PrintStream ambariProps = null;
         PrintStream installProps = null;
-        LdapContext ldapContext;
+        LdapContext ldapContext = null;
 
         try {
             logFile = new PrintStream(new File(outputDir + LOG_FILE));
@@ -136,6 +136,13 @@ public class LdapConfigCheckMain {
             if (installProps != null) {
                 installProps.close();
             }
+            try {
+            	if (ldapContext != null) {
+            		ldapContext.close();
+            	}
+            } catch (NamingException ne){
+            	System.out.println("Failed to close LdapContext!");
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/ce7edb25/unixauthclient/src/main/java/org/apache/ranger/authentication/unix/jaas/PamLoginModule.java
----------------------------------------------------------------------
diff --git a/unixauthclient/src/main/java/org/apache/ranger/authentication/unix/jaas/PamLoginModule.java b/unixauthclient/src/main/java/org/apache/ranger/authentication/unix/jaas/PamLoginModule.java
index d1107ef..1465b9d 100644
--- a/unixauthclient/src/main/java/org/apache/ranger/authentication/unix/jaas/PamLoginModule.java
+++ b/unixauthclient/src/main/java/org/apache/ranger/authentication/unix/jaas/PamLoginModule.java
@@ -137,8 +137,9 @@ public class PamLoginModule extends Object implements LoginModule
     private void initPassword(PasswordCallback passwordCallback)
     {
         char[] password = passwordCallback.getPassword();
-        _password = new String(password);
-
+        if (password != null) {
+        	_password = new String(password);
+        }
         passwordCallback.clearPassword();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/ce7edb25/unixauthservice/src/main/java/org/apache/ranger/authentication/UnixAuthenticationService.java
----------------------------------------------------------------------
diff --git a/unixauthservice/src/main/java/org/apache/ranger/authentication/UnixAuthenticationService.java b/unixauthservice/src/main/java/org/apache/ranger/authentication/UnixAuthenticationService.java
index acb0b37..863a56a 100644
--- a/unixauthservice/src/main/java/org/apache/ranger/authentication/UnixAuthenticationService.java
+++ b/unixauthservice/src/main/java/org/apache/ranger/authentication/UnixAuthenticationService.java
@@ -351,9 +351,15 @@ public class UnixAuthenticationService {
 				
 		Socket client = null ;
 		
-		while ( (client = socket.accept()) != null ) {
-			Thread clientValidatorThread = new Thread(new PasswordValidator(client)) ;
-			clientValidatorThread.start(); 
+		try {
+		
+			while ( (client = socket.accept()) != null ) {
+				Thread clientValidatorThread = new Thread(new PasswordValidator(client)) ;
+				clientValidatorThread.start(); 
+			}
+		} catch (IOException e) {
+			socket.close();
+			throw(e);
 		}
 
 	}