Imported Upstream version 2.6.1
[debian/amanda] / config / amanda / bsd-security.m4
1 # SYNOPSIS
2 #
3 #   AMANDA_BSD_SECURITY
4 #
5 # OVERVIEW
6 #
7 #   Handle configuration for BSD security, implementing the 
8 #   --without-bsd-security option.  Also supplies the --without-amandahosts
9 #   option to use .rhosts instead of .amandahosts
10 #
11 #   Note that the defaults for *both* of these options are "yes", unlike
12 #   the remainder of the security implementations.
13 #
14 #   Defines and substitues BSD_SECURITY, and sets AM_CONDITIONAL
15 #   WANT_BSD_SECURITY, if the user has selected this mechanism.
16 #   Also defines and substitutes USE_AMANDAHOSTS unless the user has
17 #   specified --without-amandahosts.
18 #
19 AC_DEFUN([AMANDA_BSD_SECURITY],
20 [
21     BSD_SECURITY="yes"
22     AC_ARG_WITH(bsd-security,
23         AS_HELP_STRING([--without-bsd-security],
24                 [do not include BSD authentication]),
25         [
26             case "$withval" in
27                 n | no) BSD_SECURITY=no ;;
28                 y |  ye | yes) BSD_SECURITY=yes ;;
29                 *) AC_MSG_ERROR([*** You must not supply an argument to --without-bsd-security.])
30                     ;;
31             esac
32         ],
33     )
34
35     USE_AMANDAHOSTS=yes
36     AC_ARG_WITH(amandahosts,
37         AS_HELP_STRING([ --without-amandahosts],
38             [use ".rhosts" instead of ".amandahosts"]),
39         [
40             case "$withval" in
41                 n | no ) USE_AMANDAHOSTS=no ;;
42                 y |  ye | yes) USE_AMANDAHOSTS=yes ;;
43                 *) AC_MSG_ERROR([*** You must not supply an argument to --without-amandahosts option.])
44                   ;;
45             esac
46         ]
47     )
48
49     if test "x$BSD_SECURITY" = "xyes"; then
50         AC_DEFINE(BSD_SECURITY,1,
51             [Define to use BSD .rhosts/.amandahosts security. ])
52         if test "x$USE_AMANDAHOSTS" = "xyes"; then
53             AC_DEFINE(USE_AMANDAHOSTS,1,
54                 [Define if you want to use the ".amandahosts" for BSD security. ])
55         fi
56     fi
57
58     AM_CONDITIONAL(WANT_BSD_SECURITY, test x"$BSD_SECURITY" = x"yes")
59     AC_SUBST(BSD_SECURITY)
60     AC_SUBST(USE_AMANDAHOSTS)
61 ])