Blame SOURCES/0006-krb5-refactor-removal-of-krb5info-files.patch

cdf651
From 713bc782502163251ef22eb81b09eed61a8407f7 Mon Sep 17 00:00:00 2001
cdf651
From: Sumit Bose <sbose@redhat.com>
cdf651
Date: Tue, 5 Jun 2018 17:44:59 +0200
cdf651
Subject: [PATCH] krb5: refactor removal of krb5info files
cdf651
cdf651
Currently a persistent offline callback removes the krb5info files for
cdf651
the configured main domain and those files were removed by a SIGTERM
cdf651
signal handlers as well.
cdf651
cdf651
This does not scale if krb5info files are created for sub-domains as
cdf651
well. To remove the files automatically the removal is moved into a
cdf651
talloc destructor of an offline callback which is added if the file is
cdf651
created and frees itself when the system goes offline. Due to the
cdf651
talloc memory hierarchy we get removal on shutdown for free.
cdf651
cdf651
Related to https://pagure.io/SSSD/sssd/issue/3652
cdf651
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
cdf651
cdf651
(cherry picked from commit d91661e295c8e878f1bbf34e6f65f61e8301bf0e)
cdf651
---
cdf651
 src/providers/ad/ad_common.c          |   7 +-
cdf651
 src/providers/ipa/ipa_common.c        |   5 +-
cdf651
 src/providers/krb5/krb5_common.c      | 176 +++++++++++++-------------
cdf651
 src/providers/krb5/krb5_common.h      |   7 +-
cdf651
 src/providers/krb5/krb5_init_shared.c |   6 -
cdf651
 src/providers/ldap/ldap_common.c      |  87 -------------
cdf651
 6 files changed, 102 insertions(+), 186 deletions(-)
cdf651
cdf651
diff --git a/src/providers/ad/ad_common.c b/src/providers/ad/ad_common.c
cdf651
index 0aea985e00faa996643fd7e7630d4264fb6cf233..8caaba6c0d06cfe83d9741536192d662fc936273 100644
cdf651
--- a/src/providers/ad/ad_common.c
cdf651
+++ b/src/providers/ad/ad_common.c
cdf651
@@ -804,6 +804,8 @@ ad_failover_init(TALLOC_CTX *mem_ctx, struct be_ctx *bectx,
cdf651
         goto done;
cdf651
     }
cdf651
 
cdf651
+    service->krb5_service->be_ctx = bectx;
cdf651
+
cdf651
     if (!primary_servers) {
cdf651
         DEBUG(SSSDBG_CONF_SETTINGS,
cdf651
               "No primary servers defined, using service discovery\n");
cdf651
@@ -984,8 +986,9 @@ ad_resolve_callback(void *private_data, struct fo_server *server)
cdf651
             goto done;
cdf651
         }
cdf651
 
cdf651
-        ret = write_krb5info_file(service->krb5_service->realm, safe_address,
cdf651
-                                SSS_KRB5KDC_FO_SRV);
cdf651
+        ret = write_krb5info_file(service->krb5_service,
cdf651
+                                  safe_address,
cdf651
+                                  SSS_KRB5KDC_FO_SRV);
cdf651
         if (ret != EOK) {
cdf651
             DEBUG(SSSDBG_MINOR_FAILURE,
cdf651
                 "write_krb5info_file failed, authentication might fail.\n");
cdf651
diff --git a/src/providers/ipa/ipa_common.c b/src/providers/ipa/ipa_common.c
cdf651
index 87ed967673358bf833dae13c29b1f6a17b0fc19c..dcbb54a744358718e444972b9827ee64887e5e33 100644
cdf651
--- a/src/providers/ipa/ipa_common.c
cdf651
+++ b/src/providers/ipa/ipa_common.c
cdf651
@@ -838,7 +838,8 @@ static void ipa_resolve_callback(void *private_data, struct fo_server *server)
cdf651
             return;
cdf651
         }
cdf651
 
cdf651
-        ret = write_krb5info_file(service->krb5_service->realm, safe_address,
cdf651
+        ret = write_krb5info_file(service->krb5_service,
cdf651
+                                  safe_address,
cdf651
                                   SSS_KRB5KDC_FO_SRV);
cdf651
         if (ret != EOK) {
cdf651
             DEBUG(SSSDBG_OP_FAILURE,
cdf651
@@ -1012,6 +1013,8 @@ int ipa_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx,
cdf651
         goto done;
cdf651
     }
cdf651
 
cdf651
+    service->krb5_service->be_ctx = ctx;
cdf651
+
cdf651
     if (!primary_servers) {
cdf651
         DEBUG(SSSDBG_CONF_SETTINGS,
cdf651
               "No primary servers defined, using service discovery\n");
cdf651
diff --git a/src/providers/krb5/krb5_common.c b/src/providers/krb5/krb5_common.c
cdf651
index 520e7591ce1b37b4a8dea357b6dd0ec7afd76f58..c6896a6cd663da896075e72aa0a0602c198b45e8 100644
cdf651
--- a/src/providers/krb5/krb5_common.c
cdf651
+++ b/src/providers/krb5/krb5_common.c
cdf651
@@ -389,7 +389,76 @@ done:
cdf651
     return ret;
cdf651
 }
cdf651
 
cdf651
-errno_t write_krb5info_file(const char *realm, const char *server,
cdf651
+static int remove_info_files_destructor(void *p)
cdf651
+{
cdf651
+    int ret;
cdf651
+    struct remove_info_files_ctx *ctx = talloc_get_type(p,
cdf651
+                                                  struct remove_info_files_ctx);
cdf651
+
cdf651
+    ret = remove_krb5_info_files(ctx, ctx->realm);
cdf651
+    if (ret != EOK) {
cdf651
+        DEBUG(SSSDBG_CRIT_FAILURE, "remove_krb5_info_files failed.\n");
cdf651
+    }
cdf651
+
cdf651
+    return 0;
cdf651
+}
cdf651
+
cdf651
+static errno_t
cdf651
+krb5_add_krb5info_offline_callback(struct krb5_service *krb5_service)
cdf651
+{
cdf651
+    int ret;
cdf651
+    struct remove_info_files_ctx *ctx;
cdf651
+
cdf651
+    if (krb5_service == NULL || krb5_service->name == NULL
cdf651
+                             || krb5_service->realm == NULL
cdf651
+                             || krb5_service->be_ctx == NULL) {
cdf651
+        DEBUG(SSSDBG_CRIT_FAILURE, "Missing KDC service name or realm!\n");
cdf651
+        return EINVAL;
cdf651
+    }
cdf651
+
cdf651
+    ctx = talloc_zero(krb5_service->be_ctx, struct remove_info_files_ctx);
cdf651
+    if (ctx == NULL) {
cdf651
+        DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zfree failed.\n");
cdf651
+        return ENOMEM;
cdf651
+    }
cdf651
+
cdf651
+    ctx->realm = talloc_strdup(ctx, krb5_service->realm);
cdf651
+    if (ctx->realm == NULL) {
cdf651
+        DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup failed!\n");
cdf651
+        ret = ENOMEM;
cdf651
+        goto done;
cdf651
+    }
cdf651
+
cdf651
+    ctx->be_ctx = krb5_service->be_ctx;
cdf651
+    ctx->kdc_service_name = talloc_strdup(ctx, krb5_service->name);
cdf651
+    if (ctx->kdc_service_name == NULL) {
cdf651
+        DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup failed!\n");
cdf651
+        ret = ENOMEM;
cdf651
+        goto done;
cdf651
+    }
cdf651
+
cdf651
+    ret = be_add_offline_cb(ctx, krb5_service->be_ctx,
cdf651
+                            remove_krb5_info_files_callback, ctx, NULL);
cdf651
+    if (ret != EOK) {
cdf651
+        DEBUG(SSSDBG_CRIT_FAILURE, "be_add_offline_cb failed.\n");
cdf651
+        goto done;
cdf651
+    }
cdf651
+
cdf651
+    talloc_set_destructor((TALLOC_CTX *) ctx, remove_info_files_destructor);
cdf651
+
cdf651
+    ret = EOK;
cdf651
+
cdf651
+done:
cdf651
+    if (ret != EOK) {
cdf651
+        talloc_zfree(ctx);
cdf651
+    }
cdf651
+
cdf651
+    return ret;
cdf651
+}
cdf651
+
cdf651
+
cdf651
+errno_t write_krb5info_file(struct krb5_service *krb5_service,
cdf651
+                            const char *server,
cdf651
                             const char *service)
cdf651
 {
cdf651
     int ret;
cdf651
@@ -401,17 +470,19 @@ errno_t write_krb5info_file(const char *realm, const char *server,
cdf651
     size_t server_len;
cdf651
     ssize_t written;
cdf651
 
cdf651
-    if (realm == NULL || *realm == '\0' || server == NULL || *server == '\0' ||
cdf651
-        service == NULL || *service == '\0') {
cdf651
+    if (krb5_service == NULL || krb5_service->realm == NULL
cdf651
+                             || *krb5_service->realm == '\0'
cdf651
+                             || server == NULL || *server == '\0'
cdf651
+                             || service == NULL || *service == '\0') {
cdf651
         DEBUG(SSSDBG_CRIT_FAILURE,
cdf651
               "Missing or empty realm, server or service.\n");
cdf651
         return EINVAL;
cdf651
     }
cdf651
 
cdf651
-    if (sss_krb5_realm_has_proxy(realm)) {
cdf651
+    if (sss_krb5_realm_has_proxy(krb5_service->realm)) {
cdf651
         DEBUG(SSSDBG_CONF_SETTINGS,
cdf651
               "KDC Proxy available for realm [%s], no kdcinfo file created.\n",
cdf651
-              realm);
cdf651
+              krb5_service->realm);
cdf651
         return EOK;
cdf651
     }
cdf651
 
cdf651
@@ -439,7 +510,7 @@ errno_t write_krb5info_file(const char *realm, const char *server,
cdf651
         goto done;
cdf651
     }
cdf651
 
cdf651
-    krb5info_name = talloc_asprintf(tmp_ctx, name_tmpl, realm);
cdf651
+    krb5info_name = talloc_asprintf(tmp_ctx, name_tmpl, krb5_service->realm);
cdf651
     if (krb5info_name == NULL) {
cdf651
         DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n");
cdf651
         ret = ENOMEM;
cdf651
@@ -495,6 +566,12 @@ errno_t write_krb5info_file(const char *realm, const char *server,
cdf651
         goto done;
cdf651
     }
cdf651
 
cdf651
+    ret = krb5_add_krb5info_offline_callback(krb5_service);
cdf651
+    if (ret != EOK) {
cdf651
+        DEBUG(SSSDBG_OP_FAILURE, "Failed to add offline callback, krb5info "
cdf651
+                                 "file might not be removed properly.\n");
cdf651
+    }
cdf651
+
cdf651
     ret = EOK;
cdf651
 done:
cdf651
     if (fd != -1) {
cdf651
@@ -561,7 +638,8 @@ static void krb5_resolve_callback(void *private_data, struct fo_server *server)
cdf651
             return;
cdf651
         }
cdf651
 
cdf651
-        ret = write_krb5info_file(krb5_service->realm, safe_address,
cdf651
+        ret = write_krb5info_file(krb5_service,
cdf651
+                                  safe_address,
cdf651
                                   krb5_service->name);
cdf651
         if (ret != EOK) {
cdf651
             DEBUG(SSSDBG_OP_FAILURE,
cdf651
@@ -761,6 +839,7 @@ int krb5_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx,
cdf651
     }
cdf651
 
cdf651
     service->write_kdcinfo = use_kdcinfo;
cdf651
+    service->be_ctx = ctx;
cdf651
 
cdf651
     if (!primary_servers) {
cdf651
         DEBUG(SSSDBG_CONF_SETTINGS,
cdf651
@@ -839,7 +918,6 @@ errno_t remove_krb5_info_files(TALLOC_CTX *mem_ctx, const char *realm)
cdf651
 void remove_krb5_info_files_callback(void *pvt)
cdf651
 {
cdf651
     int ret;
cdf651
-    TALLOC_CTX *tmp_ctx = NULL;
cdf651
     struct remove_info_files_ctx *ctx = talloc_get_type(pvt,
cdf651
                                                   struct remove_info_files_ctx);
cdf651
 
cdf651
@@ -864,19 +942,10 @@ void remove_krb5_info_files_callback(void *pvt)
cdf651
         }
cdf651
     }
cdf651
 
cdf651
-    tmp_ctx = talloc_new(NULL);
cdf651
-    if (tmp_ctx == NULL) {
cdf651
-        DEBUG(SSSDBG_CRIT_FAILURE,
cdf651
-              "talloc_new failed, cannot remove krb5 info files.\n");
cdf651
-        return;
cdf651
-    }
cdf651
-
cdf651
-    ret = remove_krb5_info_files(tmp_ctx, ctx->realm);
cdf651
-    if (ret != EOK) {
cdf651
-        DEBUG(SSSDBG_CRIT_FAILURE, "remove_krb5_info_files failed.\n");
cdf651
-    }
cdf651
-
cdf651
-    talloc_zfree(tmp_ctx);
cdf651
+    /* Freeing the remove_info_files_ctx will remove the related krb5info
cdf651
+     * file. Additionally the callback from the list of callbacks is removed,
cdf651
+     * it will be added again when a new krb5info file is created. */
cdf651
+    talloc_free(ctx);
cdf651
 }
cdf651
 
cdf651
 void krb5_finalize(struct tevent_context *ev,
cdf651
@@ -886,74 +955,9 @@ void krb5_finalize(struct tevent_context *ev,
cdf651
                    void *siginfo,
cdf651
                    void *private_data)
cdf651
 {
cdf651
-    char *realm = (char *)private_data;
cdf651
-    int ret;
cdf651
-
cdf651
-    ret = remove_krb5_info_files(se, realm);
cdf651
-    if (ret != EOK) {
cdf651
-        DEBUG(SSSDBG_CRIT_FAILURE, "remove_krb5_info_files failed.\n");
cdf651
-    }
cdf651
-
cdf651
     orderly_shutdown(0);
cdf651
 }
cdf651
 
cdf651
-errno_t krb5_install_offline_callback(struct be_ctx *be_ctx,
cdf651
-                                      struct krb5_ctx *krb5_ctx)
cdf651
-{
cdf651
-    int ret;
cdf651
-    struct remove_info_files_ctx *ctx;
cdf651
-    const char *krb5_realm;
cdf651
-
cdf651
-    if (krb5_ctx->service == NULL || krb5_ctx->service->name == NULL) {
cdf651
-        DEBUG(SSSDBG_CRIT_FAILURE, "Missing KDC service name!\n");
cdf651
-        return EINVAL;
cdf651
-    }
cdf651
-
cdf651
-    ctx = talloc_zero(krb5_ctx, struct remove_info_files_ctx);
cdf651
-    if (ctx == NULL) {
cdf651
-        DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zfree failed.\n");
cdf651
-        return ENOMEM;
cdf651
-    }
cdf651
-
cdf651
-    krb5_realm = dp_opt_get_cstring(krb5_ctx->opts, KRB5_REALM);
cdf651
-    if (krb5_realm == NULL) {
cdf651
-        DEBUG(SSSDBG_CRIT_FAILURE, "Missing krb5_realm option!\n");
cdf651
-        ret = EINVAL;
cdf651
-        goto done;
cdf651
-    }
cdf651
-
cdf651
-    ctx->realm = talloc_strdup(ctx, krb5_realm);
cdf651
-    if (ctx->realm == NULL) {
cdf651
-        DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup failed!\n");
cdf651
-        ret = ENOMEM;
cdf651
-        goto done;
cdf651
-    }
cdf651
-
cdf651
-    ctx->be_ctx = be_ctx;
cdf651
-    ctx->kdc_service_name = krb5_ctx->service->name;
cdf651
-    if (krb5_ctx->kpasswd_service == NULL) {
cdf651
-        ctx->kpasswd_service_name =NULL;
cdf651
-    } else {
cdf651
-        ctx->kpasswd_service_name = krb5_ctx->kpasswd_service->name;
cdf651
-    }
cdf651
-
cdf651
-    ret = be_add_offline_cb(ctx, be_ctx, remove_krb5_info_files_callback, ctx,
cdf651
-                            NULL);
cdf651
-    if (ret != EOK) {
cdf651
-        DEBUG(SSSDBG_CRIT_FAILURE, "be_add_offline_cb failed.\n");
cdf651
-        goto done;
cdf651
-    }
cdf651
-
cdf651
-    ret = EOK;
cdf651
-
cdf651
-done:
cdf651
-    if (ret != EOK) {
cdf651
-        talloc_zfree(ctx);
cdf651
-    }
cdf651
-
cdf651
-    return ret;
cdf651
-}
cdf651
-
cdf651
 errno_t krb5_install_sigterm_handler(struct tevent_context *ev,
cdf651
                                      struct krb5_ctx *krb5_ctx)
cdf651
 {
cdf651
diff --git a/src/providers/krb5/krb5_common.h b/src/providers/krb5/krb5_common.h
cdf651
index 48368a528e75947102c74cb75bf7a74ec0dd258f..a2e47b0605debdffa28305dab4f7674707f713ac 100644
cdf651
--- a/src/providers/krb5/krb5_common.h
cdf651
+++ b/src/providers/krb5/krb5_common.h
cdf651
@@ -67,6 +67,7 @@ enum krb5_opts {
cdf651
 typedef enum { INIT_PW, INIT_KT, RENEW, VALIDATE } action_type;
cdf651
 
cdf651
 struct krb5_service {
cdf651
+    struct be_ctx *be_ctx;
cdf651
     char *name;
cdf651
     char *realm;
cdf651
     bool write_kdcinfo;
cdf651
@@ -157,7 +158,8 @@ errno_t krb5_try_kdcip(struct confdb_ctx *cdb, const char *conf_path,
cdf651
 errno_t sss_krb5_get_options(TALLOC_CTX *memctx, struct confdb_ctx *cdb,
cdf651
                              const char *conf_path, struct dp_option **_opts);
cdf651
 
cdf651
-errno_t write_krb5info_file(const char *realm, const char *kdc,
cdf651
+errno_t write_krb5info_file(struct krb5_service *krb5_service,
cdf651
+                            const char *server,
cdf651
                             const char *service);
cdf651
 
cdf651
 int krb5_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx,
cdf651
@@ -177,9 +179,6 @@ void krb5_finalize(struct tevent_context *ev,
cdf651
                    void *siginfo,
cdf651
                    void *private_data);
cdf651
 
cdf651
-errno_t krb5_install_offline_callback(struct be_ctx *be_ctx,
cdf651
-                                      struct krb5_ctx *krb_ctx);
cdf651
-
cdf651
 errno_t krb5_install_sigterm_handler(struct tevent_context *ev,
cdf651
                                      struct krb5_ctx *krb5_ctx);
cdf651
 
cdf651
diff --git a/src/providers/krb5/krb5_init_shared.c b/src/providers/krb5/krb5_init_shared.c
cdf651
index 3901b7272119c32930c2b6b47279a2c685bf3cfb..368d6f7b0f2bc038e4cc4aa8f0970cd0e81d7b6b 100644
cdf651
--- a/src/providers/krb5/krb5_init_shared.c
cdf651
+++ b/src/providers/krb5/krb5_init_shared.c
cdf651
@@ -71,12 +71,6 @@ errno_t krb5_child_init(struct krb5_ctx *krb5_auth_ctx,
cdf651
         goto done;
cdf651
     }
cdf651
 
cdf651
-    ret = krb5_install_offline_callback(bectx, krb5_auth_ctx);
cdf651
-    if (ret != EOK) {
cdf651
-        DEBUG(SSSDBG_CRIT_FAILURE, "krb5_install_offline_callback failed.\n");
cdf651
-        goto done;
cdf651
-    }
cdf651
-
cdf651
     ret = krb5_install_sigterm_handler(bectx->ev, krb5_auth_ctx);
cdf651
     if (ret != EOK) {
cdf651
         DEBUG(SSSDBG_CRIT_FAILURE, "krb5_install_sigterm_handler failed.\n");
cdf651
diff --git a/src/providers/ldap/ldap_common.c b/src/providers/ldap/ldap_common.c
cdf651
index 91e229243b9a1b43e7a57704824f5db0341f4ee9..15377ee1f062c0167aabee30ef0757ebe7271682 100644
cdf651
--- a/src/providers/ldap/ldap_common.c
cdf651
+++ b/src/providers/ldap/ldap_common.c
cdf651
@@ -158,14 +158,6 @@ static void sdap_finalize(struct tevent_context *ev,
cdf651
                           void *siginfo,
cdf651
                           void *private_data)
cdf651
 {
cdf651
-    char *realm = (char *) private_data;
cdf651
-    int ret;
cdf651
-
cdf651
-    ret = remove_krb5_info_files(se, realm);
cdf651
-    if (ret != EOK) {
cdf651
-        DEBUG(SSSDBG_CRIT_FAILURE, "remove_krb5_info_files failed.\n");
cdf651
-    }
cdf651
-
cdf651
     orderly_shutdown(0);
cdf651
 }
cdf651
 
cdf651
@@ -196,78 +188,6 @@ errno_t sdap_install_sigterm_handler(TALLOC_CTX *mem_ctx,
cdf651
     return EOK;
cdf651
 }
cdf651
 
cdf651
-void sdap_remove_kdcinfo_files_callback(void *pvt)
cdf651
-{
cdf651
-    int ret;
cdf651
-    TALLOC_CTX *tmp_ctx = NULL;
cdf651
-    struct remove_info_files_ctx *ctx = talloc_get_type(pvt,
cdf651
-                                                  struct remove_info_files_ctx);
cdf651
-
cdf651
-    ret = be_fo_run_callbacks_at_next_request(ctx->be_ctx,
cdf651
-                                              ctx->kdc_service_name);
cdf651
-    if (ret != EOK) {
cdf651
-        DEBUG(SSSDBG_CRIT_FAILURE,
cdf651
-              "be_fo_run_callbacks_at_next_request failed, "
cdf651
-                  "krb5 info files will not be removed, because "
cdf651
-                  "it is unclear if they will be recreated properly.\n");
cdf651
-        return;
cdf651
-    }
cdf651
-
cdf651
-    tmp_ctx = talloc_new(NULL);
cdf651
-    if (tmp_ctx == NULL) {
cdf651
-        DEBUG(SSSDBG_CRIT_FAILURE,
cdf651
-              "talloc_new failed, cannot remove krb5 info files.\n");
cdf651
-        return;
cdf651
-    }
cdf651
-
cdf651
-    ret = remove_krb5_info_files(tmp_ctx, ctx->realm);
cdf651
-    if (ret != EOK) {
cdf651
-        DEBUG(SSSDBG_CRIT_FAILURE, "remove_krb5_info_files failed.\n");
cdf651
-    }
cdf651
-
cdf651
-    talloc_zfree(tmp_ctx);
cdf651
-}
cdf651
-
cdf651
-
cdf651
-errno_t sdap_install_offline_callback(TALLOC_CTX *mem_ctx,
cdf651
-                                      struct be_ctx *be_ctx,
cdf651
-                                      const char *realm,
cdf651
-                                      const char *service_name)
cdf651
-{
cdf651
-    int ret;
cdf651
-    struct remove_info_files_ctx *ctx;
cdf651
-
cdf651
-    ctx = talloc_zero(mem_ctx, struct remove_info_files_ctx);
cdf651
-    if (ctx == NULL) {
cdf651
-        DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zfree failed.\n");
cdf651
-        return ENOMEM;
cdf651
-    }
cdf651
-
cdf651
-    ctx->be_ctx = be_ctx;
cdf651
-    ctx->realm = talloc_strdup(ctx, realm);
cdf651
-    ctx->kdc_service_name = talloc_strdup(ctx, service_name);
cdf651
-    if (ctx->realm == NULL || ctx->kdc_service_name == NULL) {
cdf651
-        DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup failed!\n");
cdf651
-        ret = ENOMEM;
cdf651
-        goto done;
cdf651
-    }
cdf651
-
cdf651
-    ret = be_add_offline_cb(ctx, be_ctx,
cdf651
-                            sdap_remove_kdcinfo_files_callback,
cdf651
-                            ctx, NULL);
cdf651
-    if (ret != EOK) {
cdf651
-        DEBUG(SSSDBG_CRIT_FAILURE, "be_add_offline_cb failed.\n");
cdf651
-        goto done;
cdf651
-    }
cdf651
-
cdf651
-    ret = EOK;
cdf651
-done:
cdf651
-    if (ret != EOK) {
cdf651
-        talloc_zfree(ctx);
cdf651
-    }
cdf651
-    return ret;
cdf651
-}
cdf651
-
cdf651
 errno_t
cdf651
 sdap_set_sasl_options(struct sdap_options *id_opts,
cdf651
                       char *default_primary,
cdf651
@@ -458,13 +378,6 @@ int sdap_gssapi_init(TALLOC_CTX *mem_ctx,
cdf651
         goto done;
cdf651
     }
cdf651
 
cdf651
-    ret = sdap_install_offline_callback(mem_ctx, bectx,
cdf651
-                                        krb5_realm, SSS_KRB5KDC_FO_SRV);
cdf651
-    if (ret != EOK) {
cdf651
-        DEBUG(SSSDBG_FATAL_FAILURE, "Failed to install sigterm handler\n");
cdf651
-        goto done;
cdf651
-    }
cdf651
-
cdf651
     sdap_service->kinit_service_name = talloc_strdup(sdap_service,
cdf651
                                                      service->name);
cdf651
     if (sdap_service->kinit_service_name == NULL) {
cdf651
-- 
cdf651
2.17.1
cdf651