public static boolean isPreferredUnixAgent(PropertyResolver resolver) { if (PropertyResolverUtils.getBooleanProperty(resolver, PREFER_UNIX_AGENT, OsUtils.isUNIX())) { try { if (AprLibrary.getInstance() != null) { return true; } } catch (Exception ignore) { // ignored } } return false; } }
public static boolean isPreferredUnixAgent(PropertyResolver resolver) { if (PropertyResolverUtils.getBooleanProperty(resolver, PREFER_UNIX_AGENT, OsUtils.isUNIX())) { try { if (AprLibrary.getInstance() != null) { return true; } } catch (Exception ignore) { // ignored } } return false; } }
if (!innerFinished.get()) { try { signalEOS(AprLibrary.getInstance(), debugEnabled); } catch (Exception e) {
if (!innerFinished.get()) { try { signalEOS(AprLibrary.getInstance(), debugEnabled); } catch (Exception e) {
public AgentClient(String authSocket, CloseableExecutorService executor) throws IOException { super((executor == null) ? ThreadUtils.newSingleThreadExecutor("AgentClient[" + authSocket + "]") : executor); this.authSocket = authSocket; try { pool = Pool.create(AprLibrary.getInstance().getRootPool()); handle = Local.create(authSocket, pool); int result = Local.connect(handle, 0); if (result != Status.APR_SUCCESS) { throwException(result); } receiveBuffer = new ByteArrayBuffer(); messages = new ArrayBlockingQueue<>(10); CloseableExecutorService service = getExecutorService(); pumper = service.submit(this); } catch (IOException e) { throw e; } catch (Exception e) { throw new SshException(e); } }
public AgentClient(String authSocket, CloseableExecutorService executor) throws IOException { super((executor == null) ? ThreadUtils.newSingleThreadExecutor("AgentClient[" + authSocket + "]") : executor); this.authSocket = authSocket; try { pool = Pool.create(AprLibrary.getInstance().getRootPool()); handle = Local.create(authSocket, pool); int result = Local.connect(handle, 0); if (result != Status.APR_SUCCESS) { throwException(result); } receiveBuffer = new ByteArrayBuffer(); messages = new ArrayBlockingQueue<>(10); CloseableExecutorService service = getExecutorService(); pumper = service.submit(this); } catch (IOException e) { throw e; } catch (Exception e) { throw new SshException(e); } }
String authSocket = AprLibrary.createLocalSocketAddress(); pool = Pool.create(AprLibrary.getInstance().getRootPool()); handle = Local.create(authSocket, pool); this.authSocket = authSocket;
String authSocket = AprLibrary.createLocalSocketAddress(); pool = Pool.create(AprLibrary.getInstance().getRootPool()); handle = Local.create(authSocket, pool); this.authSocket = authSocket;
public String start() throws Exception { authSocket = AprLibrary.createLocalSocketAddress(); pool = Pool.create(AprLibrary.getInstance().getRootPool()); handle = Local.create(authSocket, pool); int result = Local.bind(handle, 0); if (result != Status.APR_SUCCESS) { throwException(result); } AprLibrary.secureLocalSocket(authSocket, handle); result = Local.listen(handle, 0); if (result != Status.APR_SUCCESS) { throwException(result); } CloseableExecutorService executor = getExecutorService(); agentThread = executor.submit(() -> { try { while (true) { long clientSock = Local.accept(handle); Socket.timeoutSet(clientSock, 10000000); // TODO make this configurable new SshAgentSession(clientSock, agent).run(); } } catch (Exception e) { log.error("Failed to run session", e); } }); return authSocket; }
public String start() throws Exception { authSocket = AprLibrary.createLocalSocketAddress(); pool = Pool.create(AprLibrary.getInstance().getRootPool()); handle = Local.create(authSocket, pool); int result = Local.bind(handle, 0); if (result != Status.APR_SUCCESS) { throwException(result); } AprLibrary.secureLocalSocket(authSocket, handle); result = Local.listen(handle, 0); if (result != Status.APR_SUCCESS) { throwException(result); } CloseableExecutorService executor = getExecutorService(); agentThread = executor.submit(() -> { try { while (true) { long clientSock = Local.accept(handle); Socket.timeoutSet(clientSock, 10000000); // TODO make this configurable new SshAgentSession(clientSock, agent).run(); } } catch (Exception e) { log.error("Failed to run session", e); } }); return authSocket; }
out = new ChannelOutputStream(this, getRemoteWindow(), log, SshConstants.SSH_MSG_CHANNEL_DATA, true); authSocket = this.getString(SshAgent.SSH_AUTHSOCKET_ENV_NAME); pool = Pool.create(AprLibrary.getInstance().getRootPool()); handle = Local.create(authSocket, pool); int result = Local.connect(handle, 0);
out = new ChannelOutputStream(this, getRemoteWindow(), log, SshConstants.SSH_MSG_CHANNEL_DATA, true); authSocket = this.getString(SshAgent.SSH_AUTHSOCKET_ENV_NAME); pool = Pool.create(AprLibrary.getInstance().getRootPool()); handle = Local.create(authSocket, pool); int result = Local.connect(handle, 0);