On Thu, Aug 22, 2013 at 02:37:47PM +0200, Pavel Březina wrote:
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina(a)redhat.com>
Date: Thu, 22 Aug 2013 13:58:27 +0200
Subject: [PATCH 1/2] sudo: do not strdup usn on ENOENT
ACK
> From 57be0b8c58b15436331dd51511b24af3de203840 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina(a)redhat.com>
> Date: Thu, 22 Aug 2013 14:04:38 +0200
> Subject: [PATCH 2/2] sudo: do not fail to store the rule if we can't read usn
>
> Resolves:
> ---
> src/providers/ldap/sdap_sudo_cache.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/providers/ldap/sdap_sudo_cache.c
b/src/providers/ldap/sdap_sudo_cache.c
> index
bace80ef24d396f81b9e363fb00110160ccb4c2d..0550fce788130f0fad17a37752b3d6fd6a07efff 100644
> --- a/src/providers/ldap/sdap_sudo_cache.c
> +++ b/src/providers/ldap/sdap_sudo_cache.c
> @@ -88,9 +88,10 @@ sdap_save_native_sudorule(TALLOC_CTX *mem_ctx,
> }
>
> ret = sdap_sudo_get_usn(mem_ctx, attrs, map, rule_name, _usn);
> - if (ret != EOK && ret != ENOENT) {
> + if (ret != EOK) {
> DEBUG(SSSDBG_OP_FAILURE, ("Could not read USN from %s\n",
rule_name));
Can you change the level to MINOR failure now that we're able to
recover?
- return ret;
+ *_usn = NULL;
+ /* but we will store the rule anyway */
}
ret = sysdb_save_sudorule(sysdb_ctx, domain, rule_name, attrs);
--
1.7.11.7