#include "url.h"
#include "string-list.h"
#include "sha1-array.h"
+#include "transport.h"
static char *server_capabilities;
static const char *parse_feature_value(const char *, const char *, int *);
case PROTO_GIT:
return "git";
default:
- return "unkown protocol";
+ return "unknown protocol";
}
}
static char addr[NI_MAXHOST];
if (getnameinfo(ai->ai_addr, ai->ai_addrlen, addr, sizeof(addr), NULL, 0,
NI_NUMERICHOST) != 0)
- strcpy(addr, "(unknown)");
+ xsnprintf(addr, sizeof(addr), "(unknown)");
return addr;
}
else
target_host = xstrdup(hostandport);
+ transport_check_allowed("git");
+
/* These underlying connection commands die() if they
* cannot connect.
*/
int putty = 0, tortoiseplink = 0;
char *ssh_host = hostandport;
const char *port = NULL;
+ transport_check_allowed("ssh");
get_host_and_port(&ssh_host, &port);
if (!port)
argv_array_push(&conn->args, port);
}
argv_array_push(&conn->args, ssh_host);
+ } else {
+ transport_check_allowed("file");
}
argv_array_push(&conn->args, cmd.buf);