summaryrefslogtreecommitdiffstats
path: root/proxy/src/mechglue/gss_plugin.c
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2012-08-01 16:44:52 -0400
committerSimo Sorce <simo@redhat.com>2012-08-28 08:25:51 +0200
commitdad1d6295a8d2e04ab283593a18f0a3c5e4f52df (patch)
tree770c90b0aa9042f1a6589e33ae27159fc2f2d842 /proxy/src/mechglue/gss_plugin.c
parent11fb3f6ecd6156a1eedb0310739c743c4aac003c (diff)
downloadgss-proxy-dad1d6295a8d2e04ab283593a18f0a3c5e4f52df.tar.gz
gss-proxy-dad1d6295a8d2e04ab283593a18f0a3c5e4f52df.tar.xz
gss-proxy-dad1d6295a8d2e04ab283593a18f0a3c5e4f52df.zip
Add mechanism to select behavior based on envvar
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 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,