Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Allow to pass custom arguments to the ssh(1) command line
Baptiste Daroussin committed 12 years ago
commit 036b8c245f716c44ad8ba5b211ad22996c01f3ae
parent a578627
3 files changed +12 -0
modified libpkg/fetch.c
@@ -126,10 +126,15 @@ start_ssh(struct pkg_repo *repo, struct url *u, off_t *sz)
	size_t linelen;
	struct sbuf *cmd = NULL;
	const char *errstr;
+
	const char *ssh_args;
+

+
	pkg_config_string(PKG_CONFIG_SSH_ARGS, &ssh_args);

	if (repo->ssh == NULL) {
		cmd = sbuf_new_auto();
		sbuf_cat(cmd, "/usr/bin/ssh -e none -T ");
+
		if (ssh_args != NULL)
+
			sbuf_printf(cmd, "%s ", ssh_args);
		if (u->port > 0)
			sbuf_printf(cmd, "-P %d ", u->port);
		if (u->user[0] != '\0')
modified libpkg/pkg.h.in
@@ -345,6 +345,7 @@ typedef enum _pkg_config_key {
	PKG_CONFIG_FETCH_TIMEOUT,
	PKG_CONFIG_UNSET_TIMESTAMP,
	PKG_CONFIG_SSH_RESTRICT_DIR,
+
	PKG_CONFIG_SSH_ARGS,
	PKG_CONFIG_ENV,
	PKG_CONFIG_DISABLE_MTREE,
	PKG_CONFIG_DEBUG_LEVEL,
modified libpkg/pkg_config.c
@@ -275,6 +275,12 @@ static struct config_entry c[] = {
		"NO",
		"Experimental: disable MTREE processing on pkg installation",
	},
+
	[PKG_CONFIG_SSH_ARGS] = {
+
		PKG_CONFIG_STRING,
+
		"PKG_SSH_ARGS",
+
		NULL,
+
		"Extras arguments to pass to ssh(1)",
+
	},
	[PKG_CONFIG_DEBUG_LEVEL] = {
		PKG_CONFIG_INTEGER,
		"DEBUG_LEVEL",