summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2012-05-17 00:40:30 -0400
committerSimo Sorce <simo@redhat.com>2012-08-23 17:11:36 +0200
commit336e77de3eecfd1dfcdd5ee6ec23ae835c0bca25 (patch)
treef3f0f8fa0163fd9822ca5ce387eee5bfb7adda17
parent525924b3a1a00c47742094cdc01533713cbdfefc (diff)
downloadgss-proxy-336e77de3eecfd1dfcdd5ee6ec23ae835c0bca25.tar.gz
gss-proxy-336e77de3eecfd1dfcdd5ee6ec23ae835c0bca25.tar.xz
gss-proxy-336e77de3eecfd1dfcdd5ee6ec23ae835c0bca25.zip
Fix gpm_display_status
Fix some assumptions in gpm_display_status and make it clearly state no error is available, when we do not have one. This is so that the plugin code later on will know when to properly fall back to ask to the local provider.
-rw-r--r--proxy/src/mechglue/gpm_display_status.c32
1 files changed, 13 insertions, 19 deletions
diff --git a/proxy/src/mechglue/gpm_display_status.c b/proxy/src/mechglue/gpm_display_status.c
index 633b18a..7f8f247 100644
--- a/proxy/src/mechglue/gpm_display_status.c
+++ b/proxy/src/mechglue/gpm_display_status.c
@@ -58,6 +58,7 @@ OM_uint32 gpm_display_status(OM_uint32 *minor_status,
switch(status_type) {
case GSS_C_GSS_CODE:
if (tls_last_status &&
+ tls_last_status->major_status == status_value &&
tls_last_status->major_status_string.utf8string_len) {
ret = gp_copy_utf8string(&tls_last_status->major_status_string,
&tmp);
@@ -70,21 +71,20 @@ OM_uint32 gpm_display_status(OM_uint32 *minor_status,
*minor_status = 0;
return GSS_S_COMPLETE;
} else {
- return gss_display_status(minor_status,
- status_value,
- GSS_C_GSS_CODE,
- GSS_C_NO_OID,
- message_context,
- status_string);
+ /* if we do not have it, make it clear */
+ return GSS_S_UNAVAILABLE;
}
case GSS_C_MECH_CODE:
- if (*message_context) {
- /* we do not support multiple messages for now */
- *minor_status = EINVAL;
- return GSS_S_FAILURE;
- }
if (tls_last_status &&
+ tls_last_status->minor_status == status_value &&
tls_last_status->minor_status_string.utf8string_len) {
+
+ if (*message_context) {
+ /* we do not support multiple messages for now */
+ *minor_status = EINVAL;
+ return GSS_S_FAILURE;
+ }
+
ret = gp_copy_utf8string(&tls_last_status->minor_status_string,
&tmp);
if (ret) {
@@ -94,14 +94,8 @@ OM_uint32 gpm_display_status(OM_uint32 *minor_status,
status_string->value = tmp.utf8string_val;
status_string->length = tmp.utf8string_len;
} else {
- status_string->value = strdup(strerror(status_value));
- if (!status_string->value) {
- status_string->length = 0;
- *minor_status = ENOMEM;
- return GSS_S_FAILURE;
- } else {
- status_string->length = strlen(status_string->value) + 1;
- }
+ /* if we do not have it, make it clear */
+ return GSS_S_UNAVAILABLE;
}
*minor_status = 0;
return GSS_S_COMPLETE;