[SSSD] [PATCH] SSS_CACHE: Reset the initgroups attribute when resetting users

Jakub Hrozek jhrozek at redhat.com
Wed Feb 12 14:25:57 UTC 2014


On Wed, Feb 12, 2014 at 11:35:49AM +0100, Lukas Slebodnik wrote:
> ACK
> 
> LS

Pushed to master. The sssd-1-11 sysdb API is different, so attached is a
version that applies cleanly to sssd-1-11. The only difference is an
extra sysdb attribute.
-------------- next part --------------
>From b4bd13293598b664aec613f54789052ddfe6dbb4 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek at redhat.com>
Date: Tue, 11 Feb 2014 22:51:48 +0100
Subject: [PATCH] SSS_CACHE: Reset the initgroups attribute when resetting
 users
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

(cherry picked from commit 30ee051025753b63ceb19d3b83c44019a19554a1)
Reviewed-by: Lukáš Slebodník <lslebodn at redhat.com>
---
 src/tools/sss_cache.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/tools/sss_cache.c b/src/tools/sss_cache.c
index 56dc47afdcb92b71dc1ef71d7f26fdf276a1c45f..59b36db3e25333f4ca5da241b607edda226b929f 100644
--- a/src/tools/sss_cache.c
+++ b/src/tools/sss_cache.c
@@ -424,6 +424,12 @@ static errno_t invalidate_entry(TALLOC_CTX *ctx, struct sysdb_ctx *sysdb,
         if (ret == EOK) {
             switch (entry_type) {
                 case TYPE_USER:
+                    /* For users, we also need to reset the initgroups
+                     * cache expiry */
+                    ret = sysdb_attrs_add_time_t(sys_attrs,
+                            SYSDB_INITGR_EXPIRE, 1);
+                    if (ret != EOK) return ret;
+
                     ret = sysdb_set_user_attr(sysdb, domain, name, sys_attrs,
                                               SYSDB_MOD_REP);
                     break;
-- 
1.8.5.3



More information about the sssd-devel mailing list