s3-gse Allow printing the partial error string
authorAndrew Bartlett <abartlet@samba.org>
Wed, 20 Jul 2011 02:04:45 +0000 (12:04 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 20 Jul 2011 02:04:45 +0000 (12:04 +1000)
We may not be able to obtain the full error string, so print what we can get.

This is required when the error is the the GSSAPI layer, not the mechanism.

Andrew Bartlett

source3/librpc/crypto/gse.c

index c311c774d42c6b7deb8a13b35b3ce52db26e4eac..cfa6bf1e0d6b003ecf7584bd6a2a1a6e7a9d4429 100644 (file)
@@ -558,6 +558,12 @@ static char *gse_errstr(TALLOC_CTX *mem_ctx, OM_uint32 maj, OM_uint32 min)
        if (gss_maj) {
                goto done;
        }
+       errstr = talloc_strndup(mem_ctx,
+                               (char *)msg_maj.value,
+                                       msg_maj.length);
+       if (!errstr) {
+               goto done;
+       }
        gss_maj = gss_display_status(&gss_min, min, GSS_C_MECH_CODE,
                                     (gss_OID)discard_const(gss_mech_krb5),
                                     &msg_ctx, &msg_min);
@@ -565,12 +571,6 @@ static char *gse_errstr(TALLOC_CTX *mem_ctx, OM_uint32 maj, OM_uint32 min)
                goto done;
        }
 
-       errstr = talloc_strndup(mem_ctx,
-                               (char *)msg_maj.value,
-                                       msg_maj.length);
-       if (!errstr) {
-               goto done;
-       }
        errstr = talloc_strdup_append_buffer(errstr, ": ");
        if (!errstr) {
                goto done;