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

traffic: grant user write permission

Some packets need user to have write permission, e.g.: writeaccountspn
Grant user write permission then we can send packets successfully.

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-10 16:43:04 +12:00 committed by Andrew Bartlett
parent 7181af9f94
commit 4fb5e28b66

View File

@ -46,6 +46,7 @@ from samba.dsdb import UF_WORKSTATION_TRUST_ACCOUNT, UF_PASSWD_NOTREQD
from samba.dsdb import UF_NORMAL_ACCOUNT
from samba.dcerpc.misc import SEC_CHAN_WKSTA
from samba import gensec
from samba import sd_utils
SLEEP_OVERHEAD = 3e-4
@ -1689,6 +1690,11 @@ def create_user_account(ldb, instance_id, username, userpass):
"userAccountControl": str(UF_NORMAL_ACCOUNT),
"unicodePwd": utf16pw
})
# grant user write permission to do things like write account SPN
sdutils = sd_utils.SDUtils(ldb)
sdutils.dacl_add_ace(user_dn, "(A;;WP;;;PS)")
end = time.time()
duration = end - start
print("%f\t0\tcreate\tuser\t%f\tTrue\t" % (end, duration))