You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/03/05 19:19:07 UTC

[GitHub] [netbeans] matthiasblaesing commented on a change in pull request #3713: [NETBEANS-6067] Update JSch to 0.1.72 and junixsocket to 2.4.0

matthiasblaesing commented on a change in pull request #3713:
URL: https://github.com/apache/netbeans/pull/3713#discussion_r820139009



##########
File path: ide/libs.git/src/org/netbeans/libs/git/jgit/JGitSshSessionFactory.java
##########
@@ -167,9 +177,25 @@ protected Session createSession (Host hc, String user, String host, int port, FS
     private boolean setupJSchIdentityRepository (JSch jsch, String identityFile, boolean preferAgent) throws JSchException {
         boolean agentUsed = false;
         if (preferAgent) {
-            Connector con = ConnectorFactory.getInstance().createConnector(ConnectorFactory.ConnectorKind.ANY);
-            if (con != null) {
-                IdentityRepository irepo = new IdentityRepositoryImpl(con);
+            AgentConnector agentConnector = null;
+            try {
+                 agentConnector = new SSHAgentConnector();
+                 if(! agentConnector.isAvailable()) {
+                     agentConnector = null;
+                 }
+            } catch (Throwable ex) {
+                LOG.log(Level.FINE, null, ex);
+            }
+            try {
+                agentConnector = new PageantConnector();

Review comment:
       There are two possible outcomes of the creation of the SSHAgentConnector:
   
   - instantiation of `SSHAgentConnector` could fail because `junixsocket` can't be instatiated
   - the class might be loadable, but there is no agent running
   
   On window this is quite possible. In my work setup I have pagent running and an ssh-agent -> pagent bridge in cygwin, but NetBeans uses PAgent directly.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists