From a6a74dd1d5268f86616bce503e6414a6ccbea7b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrn=20Brodersen?= Date: Fri, 19 Feb 2021 01:38:32 +0100 Subject: [PATCH] WIP Organization: Univention GmbH, Bremen, Germany --- saml/crudesaml/patches/0001-foooo.patch | 82 +++++++++++++++++++++++++ saml/crudesaml/patches/series | 1 + 2 files changed, 83 insertions(+) create mode 100644 saml/crudesaml/patches/0001-foooo.patch diff --git a/saml/crudesaml/patches/0001-foooo.patch b/saml/crudesaml/patches/0001-foooo.patch new file mode 100644 index 0000000000..25e782e9e3 --- /dev/null +++ b/saml/crudesaml/patches/0001-foooo.patch @@ -0,0 +1,82 @@ +From 00942d17ab9c32e7366f70f91d7e4eea31e3f2ed Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=BCrn=20Brodersen?= +Date: Thu, 18 Feb 2021 18:34:15 +0100 +Subject: [PATCH] foooo +Organization: Univention GmbH, Bremen, Germany + +--- + cy2_saml.c | 7 ++++--- + pam_saml.c | 7 +++++-- + 2 files changed, 9 insertions(+), 5 deletions(-) + +diff --git a/cy2_saml.c b/cy2_saml.c +index 398715c..5e8824c 100644 +--- a/cy2_saml.c ++++ b/cy2_saml.c +@@ -58,6 +58,7 @@ __RCSID("$Id: cy2_saml.c,v 1.12 2017/05/24 22:47:15 manu Exp $"); + + #include "plugin_common.h" + ++static int lasso_is_initialized = 0; + + typedef struct { + char *out; +@@ -348,8 +349,6 @@ saml_server_mech_free(glob_context, utils) + gctx->lasso_server = NULL; + } + +- lasso_shutdown(); +- + /* + * Do not free (saml_glob_context_t *)glob_context, it is static! + */ +@@ -401,9 +400,11 @@ sasl_server_plug_init(utils, maxvers, outvers, pluglist, plugcount) + *pluglist = &saml_server_plugin; + *plugcount = 1; + +- if (lasso_init() != 0) { ++ if (!lasso_is_initialized && lasso_init() != 0) { + utils->seterror(utils->conn, 0, "lasso_init() failed"); + return SASL_FAIL; ++ } else { ++ lasso_is_initialized = 1; + } + + gctx = (saml_glob_context_t *)saml_server_plugin.glob_context; +diff --git a/pam_saml.c b/pam_saml.c +index a9f99cc..eea7036 100644 +--- a/pam_saml.c ++++ b/pam_saml.c +@@ -62,6 +62,8 @@ __RCSID("$Id: pam_saml.c,v 1.14 2017/08/13 14:29:00 manu Exp $"); + + #define GCTX_DATA "CRUDESAML-GCTX" + ++static int lasso_is_initialized = 0; ++ + void + saml_log(const void *utils, int pri, const char *fmt, ...) + { +@@ -153,7 +155,6 @@ gctx_cleanup(pamh, data, error) + gctx->lasso_server = NULL; + } + +- lasso_shutdown(); + free(gctx); + gctx = NULL; + } +@@ -182,9 +183,11 @@ pam_global_context_init(pamh, ac, av) + /* + * Initialize lasso + */ +- if (lasso_init() != 0) { ++ if (!lasso_is_initialized && lasso_init() != 0) { + syslog(LOG_ERR, "lasso_init() failed"); + return NULL; ++ } else { ++ lasso_is_initialized = 1; + } + + if ((gctx = malloc(sizeof(*gctx))) == NULL) { +-- +2.27.0 + diff --git a/saml/crudesaml/patches/series b/saml/crudesaml/patches/series index 7f4e5246ce..ff4adeefa7 100644 --- a/saml/crudesaml/patches/series +++ b/saml/crudesaml/patches/series @@ -1,3 +1,4 @@ +0001-foooo.patch 07_fix-pam-dir.patch 09_pkgconfig.patch 15_fix-string-format-vulnerability.patch -- 2.27.0