summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-10-08 08:21:33 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-10-08 19:26:55 -0400
commite49534debf728e8a07c6eca457c47d67e617e3d2 (patch)
tree1623d97dc4ebe9a2e4056df1c1a153110e620185 /src
parent7a7bd8fc72cb5eaaaadb14fd189cfd9fd4c0fea0 (diff)
downloadsssd-e49534debf728e8a07c6eca457c47d67e617e3d2.tar.gz
sssd-e49534debf728e8a07c6eca457c47d67e617e3d2.tar.xz
sssd-e49534debf728e8a07c6eca457c47d67e617e3d2.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')
-rw-r--r--src/providers/ldap/sdap_async_accounts.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap_async_accounts.c b/src/providers/ldap/sdap_async_accounts.c
index 0b739c467..55e392ee5 100644
--- a/src/providers/ldap/sdap_async_accounts.c
+++ b/src/providers/ldap/sdap_async_accounts.c
@@ -381,6 +381,15 @@ struct tevent_req *sdap_save_users_send(TALLOC_CTX *memctx,
state->handle = NULL;
state->higher_timestamp = NULL;
+ if (num_users == 0) {
+ /* Nothing to do if there are no
+ * users
+ */
+ tevent_req_done(req);
+ tevent_req_post(req, ev);
+ return req;
+ }
+
subreq = sysdb_transaction_send(state, state->ev, state->sysdb);
if (!subreq) {
tevent_req_error(req, ENOMEM);