airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject [36/50] [abbrv] airavata git commit: Simple null check
Date Thu, 19 Mar 2015 19:11:54 GMT
Simple null check


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

Branch: refs/heads/new-workflow-design
Commit: a2181e44af8fc3e19fa0069898f8053e253adb2b
Parents: 6da7a74
Author: Chathuri Wimalasena <kamalasini@gmail.com>
Authored: Thu Mar 12 15:46:34 2015 -0400
Committer: Chathuri Wimalasena <kamalasini@gmail.com>
Committed: Thu Mar 12 15:46:34 2015 -0400

----------------------------------------------------------------------
 .../java/org/apache/airavata/gsi/ssh/GSSContextX509.java | 11 +++++++++--
 .../airavata/gsi/ssh/impl/GSISSHAbstractCluster.java     |  2 +-
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/a2181e44/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/GSSContextX509.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/GSSContextX509.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/GSSContextX509.java
index 2eb70c6..351e1af 100644
--- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/GSSContextX509.java
+++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/GSSContextX509.java
@@ -168,12 +168,19 @@ public class GSSContextX509 implements com.jcraft.jsch.GSSContext {
 
     public boolean isEstablished() {
         // this must check to see if the call returned GSS_S_COMPLETE
-        return context.isEstablished();
+        if (context != null){
+            return context.isEstablished();
+        }
+        return false;
     }
 
     public byte[] init(byte[] token, int s, int l) throws JSchException {
         try {
-            return context.initSecContext(token, s, l);
+            if (context != null){
+                return context.initSecContext(token, s, l);
+            }else {
+                throw new JSchException("Context is null..");
+            }
         } catch (GSSException ex) {
             throw new JSchException(ex.toString());
         }

http://git-wip-us.apache.org/repos/asf/airavata/blob/a2181e44/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
index 0420cff..cf9f931 100644
--- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
+++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
@@ -109,7 +109,7 @@ public class GSISSHAbstractCluster implements Cluster {
         this.authenticationInfo = authenticationInfo;
 
         if (authenticationInfo instanceof GSIAuthenticationInfo) {
-        	JSch.setConfig("gssapi-with-mic.x509", "org.apache.airavata.gsi.ssh.GSSContextX509");
+            JSch.setConfig("gssapi-with-mic.x509", "org.apache.airavata.gsi.ssh.GSSContextX509");
             JSch.setConfig("userauth.gssapi-with-mic", "com.jcraft.jsch.UserAuthGSSAPIWithMICGSSCredentials");
             System.setProperty(X509_CERT_DIR, (String) ((GSIAuthenticationInfo) authenticationInfo).getProperties().
                     get("X509_CERT_DIR"));


Mime
View raw message