Blame SOURCES/Handle-gss_import_cred-failure-when-importing-gssx-c.patch

1f3cc3
From 0379411547792a58b3d36c9928354072b5f6cabf Mon Sep 17 00:00:00 2001
1f3cc3
From: Robbie Harwood <rharwood@redhat.com>
1f3cc3
Date: Mon, 15 Apr 2019 19:56:50 -0400
1f3cc3
Subject: [PATCH] Handle gss_import_cred() failure when importing gssx creds
1f3cc3
1f3cc3
Otherwise, we might attempt to set options on a non-existent handle,
1f3cc3
leading to a segfault.
1f3cc3
1f3cc3
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
1f3cc3
Reviewed-by: Simo Sorce <simo@redhat.com>
1f3cc3
Merges: #244
1f3cc3
(cherry picked from commit 84cf88f6c6cfeb8e3fd2c26ed0fe9fe5bf3810d2)
1f3cc3
---
1f3cc3
 src/gp_export.c | 4 ++++
1f3cc3
 1 file changed, 4 insertions(+)
1f3cc3
1f3cc3
diff --git a/src/gp_export.c b/src/gp_export.c
1f3cc3
index 403e339..7ad8037 100644
1f3cc3
--- a/src/gp_export.c
1f3cc3
+++ b/src/gp_export.c
1f3cc3
@@ -476,6 +476,10 @@ uint32_t gp_import_gssx_cred(uint32_t *min, struct gp_call_ctx *gpcall,
1f3cc3
     }
1f3cc3
 
1f3cc3
     ret_maj = gss_import_cred(&ret_min, &token, out);
1f3cc3
+    if (ret_maj) {
1f3cc3
+        GPDEBUG("gss_import_cred failed when importing gssx cred\n");
1f3cc3
+        goto done;
1f3cc3
+    }
1f3cc3
 
1f3cc3
     /* check if there is any client option we need to set on credentials */
1f3cc3
     gp_set_cred_options(cred, *out);