7 # Handle configuration for SSH security, implementing the --with-ssh-security
8 # option and checking for the relevant programs and options.
10 AC_DEFUN([AMANDA_SSH_SECURITY],
13 AC_ARG_WITH(ssh-security,
14 AS_HELP_STRING([--with-ssh-security],
15 [include SSH authentication]),
19 y | ye | yes) SSH_SECURITY=yes ;;
20 *) AC_MSG_ERROR([*** You must not supply an argument to --with-ssh-security.])
26 if test "x$SSH_SECURITY" = "xyes"; then
28 AC_PATH_PROGS(SSH, ssh, , $LOCSYSPATH)
30 # see what options we should use
31 AC_ARG_WITH(ssh-options,
32 AS_HELP_STRING([ --with-ssh-options=@<:@OPTIONS@:>@],
33 [Use these ssh options for ssh security; the default should work]),
34 [ SSH_OPTIONS="$withval" ],
38 case "$SSH_OPTIONS" in
39 y | ye | yes | n | no)
40 AC_MSG_ERROR([*** You must supply an argument to --with-ssh-options.]);;
44 AC_MSG_CHECKING([SSH options])
45 # if we didn't get SSH options from the user, figure them out for ourselves
46 if test -z "$SSH_OPTIONS"; then
47 case `$SSH -V 2>&1` in
48 OpenSSH*) SSH_OPTIONS='-x -o BatchMode=yes -o PreferredAuthentications=publickey';;
49 *) SSH_OPTIONS='-x -o BatchMode=yes' ;;
53 # now convert that to a comma-separated list of C strings
54 eval "set dummy ${SSH_OPTIONS}"; shift
57 quoted="\"`echo "$i" | sed -e 's/\"/\\\"/'`\""
58 SSH_OPTIONS="${SSH_OPTIONS}${SSH_OPTIONS:+, }$quoted";
60 AC_MSG_RESULT($SSH_OPTIONS)
62 # finally, make the various outputs for all of this
63 AC_DEFINE(SSH_SECURITY,1,
64 [Define if SSH transport should be enabled. ])
65 AC_DEFINE_UNQUOTED(SSH, "$SSH",
66 [Path to the SSH binary])
67 AC_DEFINE_UNQUOTED(SSH_OPTIONS, $SSH_OPTIONS,
70 AM_CONDITIONAL(WANT_SSH_SECURITY, test x"$SSH_SECURITY" = x"yes")