diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2013-05-29 00:56:18 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-06-07 00:14:13 +0200 |
commit | 02d1cb8935d5c9b57cd05dfdbfe6ed38e0d61c28 (patch) | |
tree | 99eba160bfb608f08dc3f38e3524a3badff3ed67 /src/tools | |
parent | c51f7a064b0d7ef86110bdeb6dc09fa6c08be7d3 (diff) | |
download | sssd-02d1cb8935d5c9b57cd05dfdbfe6ed38e0d61c28.tar.gz sssd-02d1cb8935d5c9b57cd05dfdbfe6ed38e0d61c28.tar.bz2 sssd-02d1cb8935d5c9b57cd05dfdbfe6ed38e0d61c28.zip |
New utility function sss_get_domain_name
Instead of copying a block of code that checks whether domain is a subdomain
and uses only name of FQDN as appropriate, wrap the logic into a function.
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/sss_cache.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/tools/sss_cache.c b/src/tools/sss_cache.c index f888608a..c9096fa9 100644 --- a/src/tools/sss_cache.c +++ b/src/tools/sss_cache.c @@ -219,14 +219,10 @@ static errno_t update_filter(struct cache_tool_ctx *tctx, } if (parsed_domain) { - if (IS_SUBDOMAIN(dinfo)) { - /* Use fqdn for subdomains */ - use_name = sss_tc_fqname(tmp_ctx, tctx->nctx, dinfo, name); - if (use_name == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory\n")); - ret = ENOMEM; - goto done; - } + use_name = sss_get_domain_name(tmp_ctx, use_name, dinfo); + if (!use_name) { + ret = ENOMEM; + goto done; } if (!strcasecmp(dinfo->name, parsed_domain)) { |