From: Charlie Vuillemez Date: Wed, 27 Feb 2019 16:28:39 +0000 (+0100) Subject: Do not flush nscd and sssd cache in read-only mode X-Git-Tag: 4.7~15^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F156%2Fhead;p=thirdparty%2Fshadow.git Do not flush nscd and sssd cache in read-only mode Fix #155 signed-off-by: Charlie Vuillemez --- diff --git a/src/grpck.c b/src/grpck.c index 6140b10df..e6216efad 100644 --- a/src/grpck.c +++ b/src/grpck.c @@ -870,8 +870,10 @@ int main (int argc, char **argv) /* 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. diff --git a/src/pwck.c b/src/pwck.c index 0ffb711ef..b9603a5cb 100644 --- a/src/pwck.c +++ b/src/pwck.c @@ -877,8 +877,10 @@ int main (int argc, char **argv) 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.