Do not flush nscd and sssd cache in read-only mode

Fix #155

signed-off-by: Charlie Vuillemez <cvuillemez@users.noreply.github.com>
This commit is contained in:
Charlie Vuillemez 2019-02-27 17:28:39 +01:00
parent d66a1fe069
commit dd2033c40c
2 changed files with 8 additions and 4 deletions

View File

@ -870,8 +870,10 @@ int main (int argc, char **argv)
/* Commit the change in the database if needed */ /* Commit the change in the database if needed */
close_files (changed); close_files (changed);
nscd_flush_cache ("group"); if (!read_only) {
sssd_flush_cache (SSSD_DB_GROUP); nscd_flush_cache ("group");
sssd_flush_cache (SSSD_DB_GROUP);
}
/* /*
* Tell the user what we did and exit. * Tell the user what we did and exit.

View File

@ -877,8 +877,10 @@ int main (int argc, char **argv)
close_files (changed); close_files (changed);
nscd_flush_cache ("passwd"); if (!read_only) {
sssd_flush_cache (SSSD_DB_PASSWD); nscd_flush_cache ("passwd");
sssd_flush_cache (SSSD_DB_PASSWD);
}
/* /*
* Tell the user what we did and exit. * Tell the user what we did and exit.