This patch adds ability to customize ssh config directory with
--with-ssh-config-dir
(instead of hardcoded /etc/ssh value). This is useful in Linux distributions
with
custom ssh config directories (/etc/openssh in ALTLinux, for example).
From 94211d56273cd705dbe4b7c0e2bdcabb307782b2 Mon Sep 17 00:00:00 2001
From: Vitaly Kuznetsov <[email protected]>
Date: Thu, 25 Feb 2010 18:39:16 +0000
Subject: [PATCH] Make SSH_CONFIG_DIR customizable

This patch adds ability to customize ssh config directory with --with-ssh-config-dir
(instead of hardcoded /etc/ssh value). This is useful in Linux distributions with
custom ssh config directories (/etc/openssh in ALTLinux, for example).

Signed-off-by: Vitaly Kuznetsov <[email protected]>
---
 Makefile.am      |    1 +
 configure.ac     |   10 ++++++++++
 lib/constants.py |    6 +++---
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 513d67b..c43b894 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -431,6 +431,7 @@ lib/_autoconf.py: Makefile stamp-directories
 	  echo "VERSION_FULL = '$(VERSION_FULL)'"; \
 	  echo "LOCALSTATEDIR = '$(localstatedir)'"; \
 	  echo "SYSCONFDIR = '$(sysconfdir)'"; \
+	  echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
 	  echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
 	  echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
 	  echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
diff --git a/configure.ac b/configure.ac
index 9f8882b..b4fd4a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,6 +39,16 @@ AC_ARG_WITH([export-dir],
   [export_dir="/srv/ganeti/export"])
 AC_SUBST(EXPORT_DIR, $export_dir)
 
+# --with-ssh-config-dir=...
+AC_ARG_WITH([ssh-config-dir],
+  [AS_HELP_STRING([--with-ssh-config-dir=DIR],
+    [ directory with ssh host keys ]
+    [ (default is /etc/ssh)]
+  )],
+  [ssh_config_dir="$withval"],
+  [ssh_config_dir="/etc/ssh"])
+AC_SUBST(SSH_CONFIG_DIR, $ssh_config_dir)
+
 # --with-os-search-path=...
 # do a bit of black sed magic to for quoting of the strings in the list
 AC_ARG_WITH([os-search-path],
diff --git a/lib/constants.py b/lib/constants.py
index 827828d..47994da 100644
--- a/lib/constants.py
+++ b/lib/constants.py
@@ -343,10 +343,10 @@ OS_API_FILE = 'ganeti_api_version'
 OS_VARIANTS_FILE = 'variants.list'
 
 # ssh constants
-SSH_CONFIG_DIR = "/etc/ssh/"
-SSH_HOST_DSA_PRIV = SSH_CONFIG_DIR + "ssh_host_dsa_key"
+SSH_CONFIG_DIR = _autoconf.SSH_CONFIG_DIR
+SSH_HOST_DSA_PRIV = SSH_CONFIG_DIR + "/ssh_host_dsa_key"
 SSH_HOST_DSA_PUB = SSH_HOST_DSA_PRIV + ".pub"
-SSH_HOST_RSA_PRIV = SSH_CONFIG_DIR + "ssh_host_rsa_key"
+SSH_HOST_RSA_PRIV = SSH_CONFIG_DIR + "/ssh_host_rsa_key"
 SSH_HOST_RSA_PUB = SSH_HOST_RSA_PRIV + ".pub"
 SSH = "ssh"
 SCP = "scp"
-- 
1.6.5.8

Reply via email to