summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2013-01-15 12:36:24 +0100
committerJakub Hrozek <jhrozek@redhat.com>2013-01-15 20:21:11 +0100
commit6dd62227d77d000f3a6de42ee153274884a3c7f4 (patch)
tree54c01accc24962ce426fefaccd76226600bf08f9 /src
parent89357445fdb3c34b9693c3d6fea55e7cac04e638 (diff)
downloadsssd-6dd62227d77d000f3a6de42ee153274884a3c7f4.tar.gz
sssd-6dd62227d77d000f3a6de42ee153274884a3c7f4.tar.xz
sssd-6dd62227d77d000f3a6de42ee153274884a3c7f4.zip
TOOLS: Refresh memcache after changes to local users and groups
Diffstat (limited to 'src')
-rw-r--r--src/tools/sss_groupmod.c21
-rw-r--r--src/tools/sss_usermod.c21
2 files changed, 42 insertions, 0 deletions
diff --git a/src/tools/sss_groupmod.c b/src/tools/sss_groupmod.c
index c210bad75..e96793ac4 100644
--- a/src/tools/sss_groupmod.c
+++ b/src/tools/sss_groupmod.c
@@ -214,6 +214,27 @@ int main(int argc, const char **argv)
}
in_transaction = false;
+ ret = sss_mc_refresh_group(pc_groupname);
+ if (ret != EOK) {
+ ERROR("NSS request failed (%1$d). Entry might remain in memory "
+ "cache.\n", ret);
+ /* Nothing we can do about it */
+ }
+
+ ret = sss_mc_refresh_grouplist(tctx->octx->addgroups);
+ if (ret != EOK) {
+ ERROR("NSS request failed (%1$d). Entry might remain in memory "
+ "cache.\n", ret);
+ /* Nothing we can do about it */
+ }
+
+ ret = sss_mc_refresh_grouplist(tctx->octx->rmgroups);
+ if (ret != EOK) {
+ ERROR("NSS request failed (%1$d). Entry might remain in memory "
+ "cache.\n", ret);
+ /* Nothing we can do about it */
+ }
+
done:
if (in_transaction) {
sret = sysdb_transaction_cancel(tctx->sysdb);
diff --git a/src/tools/sss_usermod.c b/src/tools/sss_usermod.c
index a45005caa..25073a747 100644
--- a/src/tools/sss_usermod.c
+++ b/src/tools/sss_usermod.c
@@ -236,6 +236,27 @@ int main(int argc, const char **argv)
}
in_transaction = false;
+ ret = sss_mc_refresh_user(pc_username);
+ if (ret != EOK) {
+ ERROR("NSS request failed (%1$d). Entry might remain in memory "
+ "cache.\n", ret);
+ /* Nothing we can do about it */
+ }
+
+ ret = sss_mc_refresh_grouplist(tctx->octx->addgroups);
+ if (ret != EOK) {
+ ERROR("NSS request failed (%1$d). Entry might remain in memory "
+ "cache.\n", ret);
+ /* Nothing we can do about it */
+ }
+
+ ret = sss_mc_refresh_grouplist(tctx->octx->rmgroups);
+ if (ret != EOK) {
+ ERROR("NSS request failed (%1$d). Entry might remain in memory "
+ "cache.\n", ret);
+ /* Nothing we can do about it */
+ }
+
/* Set SELinux login context - must be done after transaction is done
* b/c libselinux calls getpwnam */
ret = set_seuser(tctx->octx->name, pc_selinux_user);