mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
sysusers: flush nscd's caches whenever /etc/{passwd,group} are modified
This commit is contained in:
committed by
Lennart Poettering
parent
77c93e0a4e
commit
d481b83052
@@ -15,6 +15,7 @@
|
||||
#include "hashmap.h"
|
||||
#include "main-func.h"
|
||||
#include "mount-util.h"
|
||||
#include "nscd-flush.h"
|
||||
#include "pager.h"
|
||||
#include "path-util.h"
|
||||
#include "pretty-print.h"
|
||||
@@ -798,6 +799,9 @@ static int write_files(void) {
|
||||
return r;
|
||||
|
||||
group_tmp = mfree(group_tmp);
|
||||
|
||||
if (!arg_root && !arg_image)
|
||||
(void) nscd_flush_cache(STRV_MAKE("group"));
|
||||
}
|
||||
if (gshadow) {
|
||||
r = rename_and_apply_smack_floor_label(gshadow_tmp, gshadow_path);
|
||||
@@ -813,6 +817,9 @@ static int write_files(void) {
|
||||
return r;
|
||||
|
||||
passwd_tmp = mfree(passwd_tmp);
|
||||
|
||||
if (!arg_root && !arg_image)
|
||||
(void) nscd_flush_cache(STRV_MAKE("passwd"));
|
||||
}
|
||||
if (shadow) {
|
||||
r = rename_and_apply_smack_floor_label(shadow_tmp, shadow_path);
|
||||
|
||||
Reference in New Issue
Block a user