Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP4
sssd.30908
0014-util-Remove-the-unused-function-is_email_f...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0014-util-Remove-the-unused-function-is_email_from_domain.patch of Package sssd.30908
From b1b2f55a8fdb1aaa81417136c52439334f054a70 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek <jhrozek@redhat.com> Date: Thu, 21 Jun 2018 12:40:44 +0200 Subject: [PATCH 14/18] util: Remove the unused function is_email_from_domain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit pretty much reverts commit 04d4c4d45f3942a813b7f772737f801f877f4e64, it's just coded manually, because "git revert 04d4c4d45f3942a813b7f772737f801f877f4e64" resulted in conflicts. It's easier to just remove the single function. Related: https://pagure.io/SSSD/sssd/issue/3607 Reviewed-by: Fabiano FidĂȘncio <fidencio@redhat.com> (cherry picked from commit 5b8d6794091e59419e677c055deb7be5dc44fd34) --- src/tests/cmocka/test_utils.c | 21 --------------------- src/util/domain_info_utils.c | 27 --------------------------- src/util/util.h | 1 - 3 files changed, 49 deletions(-) diff --git a/src/tests/cmocka/test_utils.c b/src/tests/cmocka/test_utils.c index cf314abe2..1a8699a2a 100644 --- a/src/tests/cmocka/test_utils.c +++ b/src/tests/cmocka/test_utils.c @@ -1849,25 +1849,6 @@ static void test_sss_get_domain_mappings_content(void **state) * capaths might not be as expected. */ } -static void test_is_email_from_domain(void **state) -{ - struct dom_list_test_ctx *test_ctx = talloc_get_type(*state, - struct dom_list_test_ctx); - struct sss_domain_info *d; - - d = find_domain_by_name(test_ctx->dom_list, "name_0.dom", false); - assert_non_null(d); - - assert_false(is_email_from_domain(NULL, NULL)); - assert_false(is_email_from_domain("hello", NULL)); - assert_false(is_email_from_domain(NULL, d)); - assert_false(is_email_from_domain("hello", d)); - assert_false(is_email_from_domain("hello@hello", d)); - - assert_true(is_email_from_domain("hello@name_0.dom", d)); - assert_true(is_email_from_domain("hello@NaMe_0.DoM", d)); -} - int main(int argc, const char *argv[]) { poptContext pc; @@ -1896,8 +1877,6 @@ int main(int argc, const char *argv[]) setup_dom_list, teardown_dom_list), cmocka_unit_test_setup_teardown(test_find_domain_by_name_disabled, setup_dom_list, teardown_dom_list), - cmocka_unit_test_setup_teardown(test_is_email_from_domain, - setup_dom_list, teardown_dom_list), cmocka_unit_test_setup_teardown(test_sss_names_init, confdb_test_setup, diff --git a/src/util/domain_info_utils.c b/src/util/domain_info_utils.c index 66077092a..9d608ef20 100644 --- a/src/util/domain_info_utils.c +++ b/src/util/domain_info_utils.c @@ -889,33 +889,6 @@ bool sss_domain_is_forest_root(struct sss_domain_info *dom) return (dom->forest_root == dom); } -bool is_email_from_domain(const char *email, struct sss_domain_info *dom) -{ - const char *p; - - if (email == NULL || dom == NULL) { - return false; - } - - p = strchr(email, '@'); - if (p == NULL) { - DEBUG(SSSDBG_TRACE_ALL, - "Input [%s] does not look like an email address.\n", email); - return false; - } - - if (strcasecmp(p+1, dom->name) == 0) { - DEBUG(SSSDBG_TRACE_ALL, "Email [%s] is from domain [%s].\n", email, - dom->name); - return true; - } - - DEBUG(SSSDBG_TRACE_ALL, "Email [%s] is not from domain [%s].\n", email, - dom->name); - - return false; -} - char *subdomain_create_conf_path(TALLOC_CTX *mem_ctx, struct sss_domain_info *subdomain) { diff --git a/src/util/util.h b/src/util/util.h index 78ab02dce..3bd4bd696 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -540,7 +540,6 @@ struct sss_domain_info *find_domain_by_sid(struct sss_domain_info *domain, enum sss_domain_state sss_domain_get_state(struct sss_domain_info *dom); void sss_domain_set_state(struct sss_domain_info *dom, enum sss_domain_state state); -bool is_email_from_domain(const char *email, struct sss_domain_info *dom); bool sss_domain_is_forest_root(struct sss_domain_info *dom); const char *sss_domain_type_str(struct sss_domain_info *dom); -- 2.23.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor