summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-01-15 22:19:36 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-02-10 22:08:47 +0100
commit4f118e3e6a25762f40a43e6dbefb09f44adbef32 (patch)
tree35e3eed19b3b462cc94f6aee0050562a7d37e6a8 /src/util
parentbfba0655bc129ebcffc20b1204e0f87549e0a74e (diff)
downloadsssd-4f118e3e6a25762f40a43e6dbefb09f44adbef32.tar.gz
sssd-4f118e3e6a25762f40a43e6dbefb09f44adbef32.tar.bz2
sssd-4f118e3e6a25762f40a43e6dbefb09f44adbef32.zip
Introduce IS_SUBDOMAIN() macro
Fixes https://fedorahosted.org/sssd/ticket/1766
Diffstat (limited to 'src/util')
-rw-r--r--src/util/domain_info_utils.c2
-rw-r--r--src/util/util.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/util/domain_info_utils.c b/src/util/domain_info_utils.c
index 6db7e157..d8ca55da 100644
--- a/src/util/domain_info_utils.c
+++ b/src/util/domain_info_utils.c
@@ -33,7 +33,7 @@ struct sss_domain_info *get_next_domain(struct sss_domain_info *domain,
dom = dom->subdomains;
} else if (dom->next) {
dom = dom->next;
- } else if (descend && dom->parent) {
+ } else if (descend && IS_SUBDOMAIN(dom)) {
dom = dom->parent->next;
} else {
return NULL;
diff --git a/src/util/util.h b/src/util/util.h
index 7697dbb5..7026f0b9 100644
--- a/src/util/util.h
+++ b/src/util/util.h
@@ -585,6 +585,8 @@ errno_t sssd_domain_init(TALLOC_CTX *mem_ctx,
const char *db_path,
struct sss_domain_info **_domain);
+#define IS_SUBDOMAIN(dom) ((dom)->parent != NULL)
+
/* from util_lock.c */
errno_t sss_br_lock_file(int fd, size_t start, size_t len,
int num_tries, useconds_t wait);