]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Do not flush nscd and sssd cache in read-only mode 156/head
authorCharlie Vuillemez <cvuillemez@users.noreply.github.com>
Wed, 27 Feb 2019 16:28:39 +0000 (17:28 +0100)
committerCharlie Vuillemez <cvuillemez@users.noreply.github.com>
Wed, 27 Feb 2019 16:40:04 +0000 (17:40 +0100)
Fix #155

signed-off-by: Charlie Vuillemez <cvuillemez@users.noreply.github.com>

src/grpck.c
src/pwck.c

index 6140b10dff865bce4af6bb597ebd0b05b72a33b2..e6216efadc886ea0f75375adb77470d389fa682a 100644 (file)
@@ -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.
index 0ffb711efb13d7021b42d9671fd5fd0dc8ad85fa..b9603a5cbeeb1e834d295e9e5a8c92ae5b868fa0 100644 (file)
@@ -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.