Fix #155
signed-off-by: Charlie Vuillemez <cvuillemez@users.noreply.github.com>
/* Commit the change in the database if needed */
close_files (changed);
- nscd_flush_cache ("group");
- sssd_flush_cache (SSSD_DB_GROUP);
+ if (!read_only) {
+ nscd_flush_cache ("group");
+ sssd_flush_cache (SSSD_DB_GROUP);
+ }
/*
* Tell the user what we did and exit.
close_files (changed);
- nscd_flush_cache ("passwd");
- sssd_flush_cache (SSSD_DB_PASSWD);
+ if (!read_only) {
+ nscd_flush_cache ("passwd");
+ sssd_flush_cache (SSSD_DB_PASSWD);
+ }
/*
* Tell the user what we did and exit.