smbd: Claim version in g_lock
commit26932271a85a08a755c81df0138d770b6a3bc3a3
authorVolker Lendecke <vl@samba.org>
Mon, 22 May 2017 14:00:08 +0000 (22 16:00 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 15 Jun 2017 11:19:15 +0000 (15 13:19 +0200)
treec3101fefbaf0f0c1eb18ebdced70bd71600a1094
parent2c200dd00d8a3969e5dbbdb0598b5073fd3cf65e
smbd: Claim version in g_lock

Protect smbd against version incompatibilities in a cluster.

At first startup smbd locks "samba_version_string" and writes its version
string. It then downgrades the lock to a read lock. Subsequent smbds check
against the version string and also keep the read lock around. If the version
does not match, we try to write our own version. But as there's a read lock,
the lock upgrade to write lock will fail due the read lock being around. So as
long as there's one smbd with this read lock, no other version of smbd will be
able to start.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
docs-xml/smbdotconf/misc/allowunsafeclusterupgrade.xml [new file with mode: 0644]
source3/smbd/server.c