1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-20 22:50:26 +03:00

traffic: fix userAccountControl for machine account

change userAccountControl from

UF_WORKSTATION_TRUST_ACCOUNT | UF_PASSWD_NOTREQD

to

UF_TRUSTED_FOR_DELEGATION | UF_SERVER_TRUST_ACCOUNT

This will fix NetrServerPasswordSet2 failure in packet_rpc_netlogon_30
while testing against windows.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
This commit is contained in:
Joe Guo 2018-05-02 22:22:52 +00:00 committed by Andrew Bartlett
parent 72f98f9763
commit 2fc6cbb8cb

View File

@ -42,8 +42,11 @@ from samba.drs_utils import drs_DsBind
import traceback
from samba.credentials import Credentials, DONT_USE_KERBEROS, MUST_USE_KERBEROS
from samba.auth import system_session
from samba.dsdb import UF_WORKSTATION_TRUST_ACCOUNT, UF_PASSWD_NOTREQD
from samba.dsdb import UF_NORMAL_ACCOUNT
from samba.dsdb import (
UF_NORMAL_ACCOUNT,
UF_SERVER_TRUST_ACCOUNT,
UF_TRUSTED_FOR_DELEGATION
)
from samba.dcerpc.misc import SEC_CHAN_BDC
from samba import gensec
from samba import sd_utils
@ -1657,7 +1660,7 @@ def create_machine_account(ldb, instance_id, netbios_name, machinepass):
"objectclass": "computer",
"sAMAccountName": "%s$" % netbios_name,
"userAccountControl":
str(UF_WORKSTATION_TRUST_ACCOUNT | UF_PASSWD_NOTREQD),
str(UF_TRUSTED_FOR_DELEGATION | UF_SERVER_TRUST_ACCOUNT),
"unicodePwd": utf16pw})
end = time.time()
duration = end - start