summaryrefslogtreecommitdiffstats
path: root/proxy/src/mechglue/gss_plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'proxy/src/mechglue/gss_plugin.c')
-rw-r--r--proxy/src/mechglue/gss_plugin.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/proxy/src/mechglue/gss_plugin.c b/proxy/src/mechglue/gss_plugin.c
index 8a90da3..f574929 100644
--- a/proxy/src/mechglue/gss_plugin.c
+++ b/proxy/src/mechglue/gss_plugin.c
@@ -56,6 +56,35 @@ const gss_OID_desc gpoid_iakerb = {
.elements = IAKERB_OID
};
+enum gpp_behavior gpp_get_behavior(void)
+{
+ static enum gpp_behavior behavior = GPP_UNINITIALIZED;
+ char *envval;
+
+ if (behavior == GPP_UNINITIALIZED) {
+ envval = getenv("GSSPROXY_BEHAVIOR");
+ if (envval) {
+ if (strcmp(envval, "LOCAL_ONLY") == 0) {
+ behavior = GPP_LOCAL_ONLY;
+ } else if (strcmp(envval, "LOCAL_FIRST") == 0) {
+ behavior = GPP_LOCAL_FIRST;
+ } else if (strcmp(envval, "REMOTE_FIRST") == 0) {
+ behavior = GPP_REMOTE_FIRST;
+ } else if (strcmp(envval, "REMOTE_ONLY") == 0) {
+ behavior = GPP_REMOTE_ONLY;
+ } else {
+ /* unknwon setting, default to local first */
+ behavior = GPP_LOCAL_FIRST;
+ }
+ } else {
+ /* default to local only for now */
+ behavior = GPP_LOCAL_FIRST;
+ }
+ }
+
+ return behavior;
+}
+
/* 2.16.840.1.113730.3.8.15.1 */
const gss_OID_desc gssproxy_mech_interposer = {
.length = 11,