From f334363aab16ee9b78ac2395ec593eab1f15f0f0 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sat, 28 Oct 2023 09:56:44 -0500 Subject: [PATCH] r/samba-dc: sysvolsync: Remove winbind cache file The `net cache flush` command does not seem to always work to clear the identity mapping cache used by winbind. Explicitly moving the file does, though. --- roles/samba-dc/files/sysvolsync.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/samba-dc/files/sysvolsync.sh b/roles/samba-dc/files/sysvolsync.sh index 4fd91e3..31235f5 100644 --- a/roles/samba-dc/files/sysvolsync.sh +++ b/roles/samba-dc/files/sysvolsync.sh @@ -3,6 +3,7 @@ SYSVOL=/var/lib/samba/sysvol IDMAP_LDB=/var/lib/samba/private/idmap.ldb +WINBIND_CACHE=/var/lib/samba/winbind_cache.tdb case "${DEBUG}" in yes|YES|y|Y|on|ON|1|true|TRUE|t|T) @@ -71,6 +72,7 @@ if [ -z "${st_cur}" ] || [ "${st_new}" != "${st_cur}" ]; then mv "${IDMAP_LDB}.new" "${IDMAP_LDB}" info 'Flushing idmap cache' net cache flush + rm -f "${WINBIND_CACHE}" info 'Restarting Samba service' systemctl start samba || exit info 'Resetting SYSVOL ACLs'