summaryrefslogtreecommitdiffstats
path: root/proxy/src
diff options
context:
space:
mode:
Diffstat (limited to 'proxy/src')
-rw-r--r--proxy/src/mechglue/gss_plugin.c29
-rw-r--r--proxy/src/mechglue/gss_plugin.h9
2 files changed, 38 insertions, 0 deletions
diff --git a/proxy/src/mechglue/gss_plugin.c b/proxy/src/mechglue/gss_plugin.c
index ba41e80..7200182 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,
diff --git a/proxy/src/mechglue/gss_plugin.h b/proxy/src/mechglue/gss_plugin.h
index 2b24e74..f472b47 100644
--- a/proxy/src/mechglue/gss_plugin.h
+++ b/proxy/src/mechglue/gss_plugin.h
@@ -30,6 +30,15 @@
extern const gss_OID_desc gssproxy_mech_interposer;
+enum gpp_behavior {
+ GPP_UNINITIALIZED = 0,
+ GPP_LOCAL_ONLY,
+ GPP_LOCAL_FIRST,
+ GPP_REMOTE_FIRST,
+ GPP_REMOTE_ONLY,
+};
+
gss_OID_set gss_mech_interposer(gss_OID mech_type);
+enum gpp_behavior gpp_get_behavior(void);
#endif /* _GSS_PLUGIN_H_ */