summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2012-05-17 00:40:30 -0400
committerGünther Deschner <gdeschner@redhat.com>2012-06-26 14:44:43 +0200
commitf79748fcc83b7107ee8338f0bd823f6ed1c5e9be (patch)
treeaea1306b797208dbb87ed4f5b98a8dcb22b8f89d
parent00b837b99edc23846d63de29df9e480b266208c8 (diff)
downloadgss-proxy-f79748fcc83b7107ee8338f0bd823f6ed1c5e9be.tar.gz
gss-proxy-f79748fcc83b7107ee8338f0bd823f6ed1c5e9be.tar.xz
gss-proxy-f79748fcc83b7107ee8338f0bd823f6ed1c5e9be.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;