samba: samba-config: gain exclusive access with flock

This commit is contained in:
mglae 2023-05-11 00:21:24 +02:00
parent 8546c5a9aa
commit 401b898ff5

View File

@ -10,6 +10,12 @@ SMB_CONF="/run/samba/smb.conf"
SMB_DIR=$(dirname ${SMB_CONF})
mkdir -p ${SMB_DIR}
# exclusive access
SMB_LOCK="${SMB_DIR}/samba-config.lock"
exec 200>"${SMB_LOCK}"
flock 200
SMB_TMP=$(mktemp -p ${SMB_DIR})
SMB_USERCONF_IS_VALID=no