summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGünther Deschner <gdeschner@redhat.com>2013-05-14 16:59:56 +0200
committerGünther Deschner <gd@samba.org>2013-05-15 13:34:45 +0200
commit64c50b61c2adf36b3582c1e35911f4768b3cec4b (patch)
treed7125d0a5a907dcb5c2dba2db165ebfdc55e80dc
parentb2967e07e46c1a94d203e36d57eb260de085659e (diff)
downloadgss-proxy-64c50b61c2adf36b3582c1e35911f4768b3cec4b.tar.gz
gss-proxy-64c50b61c2adf36b3582c1e35911f4768b3cec4b.tar.xz
gss-proxy-64c50b61c2adf36b3582c1e35911f4768b3cec4b.zip
Add --with-gpp-default-behavior configure switch.
Only LOCAL_ONLY,LOCAL_FIRST and REMOTE_FIRST allowed. REMOTE_ONLY is recognized but configure aborts as long as it is not supported. Signed-off-by: Günther Deschner <gdeschner@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
-rw-r--r--proxy/conf_macros.m427
-rw-r--r--proxy/configure.ac1
-rw-r--r--proxy/src/mechglue/gss_plugin.c9
3 files changed, 32 insertions, 5 deletions
diff --git a/proxy/conf_macros.m4 b/proxy/conf_macros.m4
index d474c7a..a04f694 100644
--- a/proxy/conf_macros.m4
+++ b/proxy/conf_macros.m4
@@ -242,7 +242,7 @@ AC_DEFUN([WITH_GSSIDEBUG],
[Whether to build with interposer debugging support [no]]
)
],
- [],
+ [],
with_gssidebug=no
)
if test x"$with_gssidebug" = xyes; then
@@ -250,3 +250,28 @@ AC_DEFUN([WITH_GSSIDEBUG],
fi
])
+AC_DEFUN([WITH_GPP_DEFAULT_BEHAVIOR],
+ [ AC_ARG_WITH([gpp_default_behavior],
+ [AC_HELP_STRING([--with-gpp-default-behavior=LOCAL_FIRST|LOCAL_ONLY|REMOTE_FIRST|REMOTE_ONLY],
+ [Which default behavior the gssproxy interposer plugin should use [LOCAL_FIRST]]
+ )
+ ],
+ [],
+ )
+ default_behavior=GPP_LOCAL_FIRST
+ if test x"$with_gpp_default_behavior" = x"LOCAL_FIRST"; then
+ AC_MSG_RESULT([Using gssproxy interposer behavior LOCAL_FIRST])
+ elif test x"$with_gpp_default_behavior" = x"LOCAL_ONLY"; then
+ AC_MSG_RESULT([Using gssproxy interposer behavior LOCAL_ONLY])
+ default_behavior=GPP_LOCAL_ONLY
+ elif test x"$with_gpp_default_behavior" = x"REMOTE_FIRST"; then
+ AC_MSG_RESULT([Using gssproxy interposer behavior REMOTE_FIRST])
+ default_behavior=GPP_REMOTE_FIRST
+ elif test x"$with_gpp_default_behavior" = x"REMOTE_ONLY"; then
+ AC_MSG_ERROR([REMOTE_ONLY currently not supported])
+ elif test x"$with_gpp_default_behavior" != x; then
+ AC_MSG_ERROR([unknown gpp default behavior])
+ fi
+ AC_DEFINE_UNQUOTED(GPP_DEFAULT_BEHAVIOR, $default_behavior, [Default gssproxy interposer plugin behavior])
+ ])
+
diff --git a/proxy/configure.ac b/proxy/configure.ac
index 770ab19..f3269e3 100644
--- a/proxy/configure.ac
+++ b/proxy/configure.ac
@@ -67,6 +67,7 @@ WITH_XML_CATALOG
WITH_SELINUX
WITH_GSSIDEBUG
WITH_GPSTATE_PATH
+WITH_GPP_DEFAULT_BEHAVIOR
m4_include([external/pkg.m4])
m4_include([external/libpopt.m4])
diff --git a/proxy/src/mechglue/gss_plugin.c b/proxy/src/mechglue/gss_plugin.c
index aac213e..0e62990 100644
--- a/proxy/src/mechglue/gss_plugin.c
+++ b/proxy/src/mechglue/gss_plugin.c
@@ -75,12 +75,13 @@ enum gpp_behavior gpp_get_behavior(void)
} else if (strcmp(envval, "REMOTE_ONLY") == 0) {
behavior = GPP_REMOTE_ONLY;
} else {
- /* unknwon setting, default to local first */
- behavior = GPP_LOCAL_FIRST;
+ /* unknown setting, default to what has been configured
+ * (by default local first) */
+ behavior = GPP_DEFAULT_BEHAVIOR;
}
} else {
- /* default to local only for now */
- behavior = GPP_LOCAL_FIRST;
+ /* default to what has been configured (by default local only) */
+ behavior = GPP_DEFAULT_BEHAVIOR;
}
}