diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2010-10-08 08:21:33 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-10-08 19:26:55 -0400 |
commit | e49534debf728e8a07c6eca457c47d67e617e3d2 (patch) | |
tree | 1623d97dc4ebe9a2e4056df1c1a153110e620185 /src/providers/ldap/sdap_async_accounts.c | |
parent | 7a7bd8fc72cb5eaaaadb14fd189cfd9fd4c0fea0 (diff) | |
download | sssd2-e49534debf728e8a07c6eca457c47d67e617e3d2.tar.gz sssd2-e49534debf728e8a07c6eca457c47d67e617e3d2.tar.xz sssd2-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/providers/ldap/sdap_async_accounts.c')
-rw-r--r-- | src/providers/ldap/sdap_async_accounts.c | 9 |
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 0b739c46..55e392ee 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); |