Displaying 1 result from an estimated 1 matches for "authsocketlist".
2015 Sep 26
5
[RFC][PATCH v2] Support a list of sockets on SSH_AUTH_SOCK
...naddr.sun_path));
@@ -117,7 +108,32 @@ ssh_get_authentication_socket(int *fdp)
*fdp = sock;
else
close(sock);
- return 0;
+ return SSH_ERR_SUCCESS;
+}
+
+/* Returns the number of the authentication fd, or -1 if there is none. */
+int
+ssh_get_authentication_socket(int *fdp)
+{
+ const char *authsocketlist;
+ const char *authsocket;
+ int rc;
+
+ if (fdp != NULL)
+ *fdp = -1;
+
+ authsocketlist = getenv(SSH_AUTHSOCKET_ENV_NAME);
+ if (!authsocketlist)
+ return SSH_ERR_AGENT_NOT_PRESENT;
+
+ authsocket = strtok((char *)authsocketlist, ":");
+
+ do {
+ rc = get_authentication_socket(authso...