Imported Upstream version 2.6.0
[debian/amanda] / config / amanda / bsd-security.m4
diff --git a/config/amanda/bsd-security.m4 b/config/amanda/bsd-security.m4
new file mode 100644 (file)
index 0000000..a376707
--- /dev/null
@@ -0,0 +1,58 @@
+# SYNOPSIS
+#
+#   AMANDA_BSD_SECURITY
+#
+# OVERVIEW
+#
+#   Handle configuration for BSD security, implementing the 
+#   --without-bsd-security option.  Also supplies the --without-amandahosts
+#   option to use .rhosts instead of .amandahosts
+#
+#   Note that the defaults for *both* of these options are "yes", unlike
+#   the remainder of the security implementations.
+#
+#   Defines BSD_SECURITY, and sets AM_CONDITIONAL WANT_BSD_SECURITY,
+#   if the user has selected this mechanism.  Also defines USE_AMANDAHOSTS
+#   unless the user has specified --without-amandahosts.
+#
+AC_DEFUN([AMANDA_BSD_SECURITY],
+[
+    BSD_SECURITY="yes"
+    AC_ARG_WITH(bsd-security,
+        AS_HELP_STRING([--without-bsd-security],
+                [do not include BSD authentication]),
+        [
+            case "$withval" in
+                n | no) BSD_SECURITY=no ;;
+                y |  ye | yes) ;;
+                *) AC_MSG_ERROR([*** You must not supply an argument to --without-bsd-security.])
+                    ;;
+            esac
+        ],
+    )
+
+    USE_AMANDAHOSTS=yes
+    AC_ARG_WITH(amandahosts,
+        AS_HELP_STRING([ --without-amandahosts],
+            [use ".rhosts" instead of ".amandahosts"]),
+        [
+            case "$withval" in
+                n | no ) USE_AMANDAHOSTS="no" ;;
+                y |  ye | yes) : ;;
+                *) AC_MSG_ERROR([*** You must not supply an argument to --without-amandahosts option.])
+                  ;;
+            esac
+        ]
+    )
+
+    if test "x$BSD_SECURITY" = "xyes"; then
+        AC_DEFINE(BSD_SECURITY,1,
+            [Define to use BSD .rhosts/.amandahosts security. ])
+        if test "x$USE_AMANDAHOSTS" = "xyes"; then
+            AC_DEFINE(USE_AMANDAHOSTS,1,
+                [Define if you want to use the ".amandahosts" for BSD security. ])
+        fi
+    fi
+
+    AM_CONDITIONAL(WANT_BSD_SECURITY, test x"$BSD_SECURITY" = x"yes")
+])