summaryrefslogtreecommitdiffstats
path: root/src/db/sysdb.h
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2016-01-22 18:14:45 +0100
committerJakub Hrozek <jhrozek@redhat.com>2016-03-01 17:01:39 +0100
commit5ff7a765434ed0b4d37564ade26d7761d06f81c3 (patch)
tree6bbc3480c16b59b18fffe68b32ae82a50350b1b0 /src/db/sysdb.h
parent659232f194f83ec7c450ce89c3fd41e4e74409f2 (diff)
downloadsssd-5ff7a765434ed0b4d37564ade26d7761d06f81c3.tar.gz
sssd-5ff7a765434ed0b4d37564ade26d7761d06f81c3.tar.xz
sssd-5ff7a765434ed0b4d37564ade26d7761d06f81c3.zip
sdap: improve filtering of multiple results in GC lookups
The Global Catalog of AD contains some information about all users and groups in an AD forest. Users from different domain in the forest can have the same name. The most obvious example is the Administrator user which is present in all domains. Although SSSD uses a domain specific search base for looking up users in the GC the search might still return multiple results if there is a user with the same name in one of the child (or grand-child ...) domains because of the hierarchic nature of the LDAP tree. Limiting the search depth would not help because users can be created in deeply nested OUs. Currently SSSD expects in this case that the user object is store in CN=Users or below. This works for all default users like Administrator but in general users can be created anywhere in the directory tree. If a user is created outside of CN=Users and there is a user with the same name in a child domain the initgroups command to look up the group-memberships of the user fails because it is not clear which of the two results should be used (initgroups for the child domain user works fine). This patch adds an additional scheme to select the right result based on the domain component attribute name 'dc'. This attribute indicates an additional component in the domain name and hence a child domain. So as long as the result contains a dc component following out search base it cannot be the object we are looking for. This scheme includes the old CN=Users based one but since it is more expensive I kept the old scheme which so far worked all the time and only use the new one if the old one fails. Resolves https://fedorahosted.org/sssd/ticket/2961 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/db/sysdb.h')
-rw-r--r--src/db/sysdb.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index bb8ca08b1..4b2feffd0 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -1228,4 +1228,10 @@ errno_t sysdb_handle_original_uuid(const char *orig_name,
const char *src_name,
struct sysdb_attrs *dest_attrs,
const char *dest_name);
+
+errno_t sysdb_try_to_find_expected_dn(struct sss_domain_info *dom,
+ const char *domain_component_name,
+ struct sysdb_attrs **usr_attrs,
+ size_t count,
+ struct sysdb_attrs **exp_usr);
#endif /* __SYS_DB_H__ */