summaryrefslogtreecommitdiffstats
path: root/src/providers
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-10-15 09:21:56 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-10-18 13:12:04 -0400
commitd5d2af3a47753527e96cef47162eecedfb6b2b5b (patch)
tree3529431650a793c4b7ffcef39960f34199abafb4 /src/providers
parent9932622f615a783f276a83389a37e65ffcdfc5da (diff)
downloadsssd-d5d2af3a47753527e96cef47162eecedfb6b2b5b.tar.gz
sssd-d5d2af3a47753527e96cef47162eecedfb6b2b5b.tar.xz
sssd-d5d2af3a47753527e96cef47162eecedfb6b2b5b.zip
Make sdap_save_users_send handle zero users gracefully
If we send a zero num_users value, we should just immediately return success, rather than starting a useless transaction
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/ldap/sdap_async_accounts.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap_async_accounts.c b/src/providers/ldap/sdap_async_accounts.c
index 0f8ebf5ab..1684af638 100644
--- a/src/providers/ldap/sdap_async_accounts.c
+++ b/src/providers/ldap/sdap_async_accounts.c
@@ -295,6 +295,11 @@ static int sdap_save_users(TALLOC_CTX *memctx,
int ret;
int i;
+ if (num_users == 0) {
+ /* Nothing to do if there are no users */
+ return EOK;
+ }
+
tmpctx = talloc_new(memctx);
if (!tmpctx) {
return ENOMEM;