From f07523526597f6232dfcafbe23e0857ec61f69ab Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Mon, 29 Apr 2013 14:37:27 +0200 Subject: Only try to relink ghost users if we're not enumerating https://fedorahosted.org/sssd/ticket/1893 When SSSD is not enumerating (which is the default), we are trying to link any "ghost" entries with a newly created user entry. However, when enumeration is on, this means a spurious search on adding any user. --- src/db/sysdb_ops.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/db/sysdb_ops.c') diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c index 5d0748740..5e6698010 100644 --- a/src/db/sysdb_ops.c +++ b/src/db/sysdb_ops.c @@ -1071,6 +1071,14 @@ int sysdb_add_user(struct sysdb_ctx *sysdb, goto done; } + /* If we're not enumerating, previous getgr{nam,gid} calls might + * have stored ghost users into the cache, so we need to link them + * with the newly-created user entry */ + if (domain->enumerate == true) { + ret = EOK; + goto done; + } + /* We need to find all groups that contain this object as a ghost user * and replace the ghost user by actual member record in direct parents. * Note that this object can be referred to either by its name or any -- cgit