summaryrefslogtreecommitdiffstats
path: root/proxy/src
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2012-06-13 16:32:33 -0400
committerSimo Sorce <simo@redhat.com>2012-08-31 16:26:38 -0400
commit298a1934ea057e62c425d38785c292b71dabd4ce (patch)
tree1e9b2c70a22b5edb5561aacaebc7ce256697702b /proxy/src
parent5e8684a6ce97f0c6f63939a4955fbe1e698e0300 (diff)
downloadgss-proxy-298a1934ea057e62c425d38785c292b71dabd4ce.tar.gz
gss-proxy-298a1934ea057e62c425d38785c292b71dabd4ce.tar.xz
gss-proxy-298a1934ea057e62c425d38785c292b71dabd4ce.zip
Add function to report internal client errors
This is to allow gss_display_status to return a meaningful error if there is an internal client error as opposed to a returned proxy server error. If we do not do this a call to gpm_display_status() after a failure would return a NULL string and give no clue about the error.
Diffstat (limited to 'proxy/src')
-rw-r--r--proxy/src/mechglue/gpm_display_status.c18
-rw-r--r--proxy/src/mechglue/gssapi_gpm.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/proxy/src/mechglue/gpm_display_status.c b/proxy/src/mechglue/gpm_display_status.c
index 7f8f247..cc5e3cc 100644
--- a/proxy/src/mechglue/gpm_display_status.c
+++ b/proxy/src/mechglue/gpm_display_status.c
@@ -45,6 +45,24 @@ void gpm_save_status(gssx_status *status)
}
}
+/* This funciton is used to record internal mech errors that are
+ * generated by the proxy client code */
+void gpm_save_internal_status(uint32_t err, char *err_str)
+{
+ gssx_status status;
+
+ memset(&status, 0, sizeof(gssx_status));
+
+#define STD_MAJ_ERROR_STR "Internal gssproxy error"
+ status.major_status = GSS_S_FAILURE;
+ status.major_status_string.utf8string_val = STD_MAJ_ERROR_STR;
+ status.major_status_string.utf8string_len = sizeof(STD_MAJ_ERROR_STR);
+ status.minor_status = err;
+ status.minor_status_string.utf8string_val = err_str;
+ status.minor_status_string.utf8string_len = strlen(err_str) + 1;
+ gpm_save_status(&status);
+}
+
OM_uint32 gpm_display_status(OM_uint32 *minor_status,
OM_uint32 status_value,
int status_type,
diff --git a/proxy/src/mechglue/gssapi_gpm.h b/proxy/src/mechglue/gssapi_gpm.h
index 0974bfd..f4faf3f 100644
--- a/proxy/src/mechglue/gssapi_gpm.h
+++ b/proxy/src/mechglue/gssapi_gpm.h
@@ -46,6 +46,7 @@ OM_uint32 gpm_release_buffer(OM_uint32 *minor_status,
gss_buffer_t buffer);
void gpm_save_status(gssx_status *status);
+void gpm_save_internal_status(uint32_t err, char *err_str);
OM_uint32 gpm_display_status(OM_uint32 *minor_status,
OM_uint32 status_value,