diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2010-10-15 09:21:56 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-10-18 13:12:04 -0400 |
commit | d5d2af3a47753527e96cef47162eecedfb6b2b5b (patch) | |
tree | 3529431650a793c4b7ffcef39960f34199abafb4 | |
parent | 9932622f615a783f276a83389a37e65ffcdfc5da (diff) | |
download | sssd-d5d2af3a47753527e96cef47162eecedfb6b2b5b.tar.gz sssd-d5d2af3a47753527e96cef47162eecedfb6b2b5b.tar.bz2 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
-rw-r--r-- | src/providers/ldap/sdap_async_accounts.c | 5 |
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 0f8ebf5a..1684af63 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; |