[SSSD] [PATCH] Fix sysdb_search_selinux_usermap_by_username return value

Jakub Hrozek jhrozek at redhat.com
Fri Jul 20 11:23:48 UTC 2012


On Fri, Jul 20, 2012 at 12:30:16PM +0200, Jan Zelený wrote:
> Dne pátek 20 července 2012 11:48:49, Jakub Hrozek napsal(a):
> > There was a logic bug in sysdb_search_selinux_usermap_by_username that
> > resulted in returning the value the variable "ret" had after the last call
> > to sysdb_attrs_get_uint32_t, which in cases the last rule processed did
> > not have the requested attributes led to using the default user context.
> > 
> > I think this would fix the strange bug Rob was seeing yesterday, but I
> > still need to verify that.
> 
> Is there a patch please?

Yes :)
-------------- next part --------------
>From f6cb5117ece78a1334042888fe958a7236eac974 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek at redhat.com>
Date: Thu, 19 Jul 2012 12:00:29 -0400
Subject: [PATCH] Fix sysdb_search_selinux_usermap_by_username return value

There was a logic bug in sysdb_search_selinux_usermap_by_username that
resulted in returning the value the variable "ret" had after the last
call to sysdb_attrs_get_uint32_t, which in cases the last rule processed
did not have the requested attributes led to using the default user
context.
---
 src/db/sysdb_selinux.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/src/db/sysdb_selinux.c b/src/db/sysdb_selinux.c
index 1b020b7722e462b1cdb78e9ff7db40d8e20ba43f..eaf07b50a4435b11f937473e37c708edc6e2e0eb 100644
--- a/src/db/sysdb_selinux.c
+++ b/src/db/sysdb_selinux.c
@@ -469,6 +469,7 @@ errno_t sysdb_search_selinux_usermap_by_username(TALLOC_CTX *mem_ctx,
 
     *_usermaps = talloc_steal(mem_ctx, usermaps);
 
+    ret = EOK;
 done:
     talloc_zfree(tmp_ctx);
     return ret;
-- 
1.7.10.4



More information about the sssd-devel mailing list