summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2023-05-10 15:54:09 +1200
committerAndrew Bartlett <abartlet@samba.org>2023-05-16 23:29:32 +0000
commit9f3dcf0e693e49c87d35f56a69b801e6db5540ce (patch)
tree58480f8fa69f99b799a0601e2b072701fea1a3f9 /python
parentf94f174db452015c3032e725e13f485bd51413dc (diff)
downloadsamba-9f3dcf0e693e49c87d35f56a69b801e6db5540ce.tar.gz
samba-tool domain join: Allow "ad dc functional level" to change which
level we claim to be during an AD join Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Diffstat (limited to 'python')
-rw-r--r--python/samba/join.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/python/samba/join.py b/python/samba/join.py
index 7abd189bdba..e453aab1198 100644
--- a/python/samba/join.py
+++ b/python/samba/join.py
@@ -50,7 +50,7 @@ import tempfile
from collections import OrderedDict
from samba.common import get_string
from samba.netcmd import CommandError
-from samba import dsdb
+from samba import dsdb, functional_level
class DCJoinException(Exception):
@@ -554,7 +554,12 @@ class DCJoinContext(object):
nc_list = [ctx.base_dn, ctx.config_dn, ctx.schema_dn]
if ctx.behavior_version >= samba.dsdb.DS_DOMAIN_FUNCTION_2003:
- rec["msDS-Behavior-Version"] = str(samba.dsdb.DS_DOMAIN_FUNCTION_2008_R2)
+ # This allows an override via smb.conf or --option using
+ # "ad dc functional level" to make us seem like 2016 to
+ # join such a domain for (say) a migration, or to test the
+ # partially implemented 2016 support.
+ domainControllerFunctionality = functional_level.dc_level_from_lp(ctx.lp)
+ rec["msDS-Behavior-Version"] = str(domainControllerFunctionality)
if ctx.behavior_version >= samba.dsdb.DS_DOMAIN_FUNCTION_2003:
rec["msDS-HasDomainNCs"] = ctx.base_dn