a37670720724ecc589009973d4a8720f7900159c
[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 BSD_SECURITY, and sets AM_CONDITIONAL WANT_BSD_SECURITY,
15 #   if the user has selected this mechanism.  Also defines USE_AMANDAHOSTS
16 #   unless the user has specified --without-amandahosts.
17 #
18 AC_DEFUN([AMANDA_BSD_SECURITY],
19 [
20     BSD_SECURITY="yes"
21     AC_ARG_WITH(bsd-security,
22         AS_HELP_STRING([--without-bsd-security],
23                 [do not include BSD authentication]),
24         [
25             case "$withval" in
26                 n | no) BSD_SECURITY=no ;;
27                 y |  ye | yes) ;;
28                 *) AC_MSG_ERROR([*** You must not supply an argument to --without-bsd-security.])
29                     ;;
30             esac
31         ],
32     )
33
34     USE_AMANDAHOSTS=yes
35     AC_ARG_WITH(amandahosts,
36         AS_HELP_STRING([ --without-amandahosts],
37             [use ".rhosts" instead of ".amandahosts"]),
38         [
39             case "$withval" in
40                 n | no ) USE_AMANDAHOSTS="no" ;;
41                 y |  ye | yes) : ;;
42                 *) AC_MSG_ERROR([*** You must not supply an argument to --without-amandahosts option.])
43                   ;;
44             esac
45         ]
46     )
47
48     if test "x$BSD_SECURITY" = "xyes"; then
49         AC_DEFINE(BSD_SECURITY,1,
50             [Define to use BSD .rhosts/.amandahosts security. ])
51         if test "x$USE_AMANDAHOSTS" = "xyes"; then
52             AC_DEFINE(USE_AMANDAHOSTS,1,
53                 [Define if you want to use the ".amandahosts" for BSD security. ])
54         fi
55     fi
56
57     AM_CONDITIONAL(WANT_BSD_SECURITY, test x"$BSD_SECURITY" = x"yes")
58 ])