From fc647b8eb5bca901658dedf3dbda2f35c63a86f2 Mon Sep 17 00:00:00 2001 From: Pavel Březina Date: Wed, 2 Jan 2013 11:09:32 +0100 Subject: set ret to EOK after for loop in sdap_sudo_purge_sudoers If we are unable to delete some rule from cache we print a debug message and ignore the error. Thus we should set ret to EOK after the for loop otherwise we return whether the last rule was deleted successfully or not. This also removes compilation warning that ret may be used uninitialized (when we don't go inside the loop at all). --- src/providers/ldap/sdap_async_sudo.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/providers') diff --git a/src/providers/ldap/sdap_async_sudo.c b/src/providers/ldap/sdap_async_sudo.c index 86edcc343..71bf875d1 100644 --- a/src/providers/ldap/sdap_async_sudo.c +++ b/src/providers/ldap/sdap_async_sudo.c @@ -566,6 +566,8 @@ static int sdap_sudo_purge_sudoers(struct sysdb_ctx *sysdb_ctx, continue; } } + + ret = EOK; } else { /* purge cache by provided filter */ ret = sysdb_sudo_purge_byfilter(sysdb_ctx, filter); -- cgit