summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2013-05-29 00:56:18 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-06-07 00:14:13 +0200
commit02d1cb8935d5c9b57cd05dfdbfe6ed38e0d61c28 (patch)
tree99eba160bfb608f08dc3f38e3524a3badff3ed67 /src/tools
parentc51f7a064b0d7ef86110bdeb6dc09fa6c08be7d3 (diff)
downloadsssd-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.c12
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)) {