diff options
| author | Joe Guo <joeg@catalyst.net.nz> | 2018-05-10 16:43:04 +1200 |
|---|---|---|
| committer | Andrew Bartlett <abartlet@samba.org> | 2018-05-12 02:09:29 +0200 |
| commit | 4fb5e28b663c57cc4f67b28312a291132dae2fb6 (patch) | |
| tree | cb5169843b5a895f95eb8a4a78dd25d31e17c385 /python | |
| parent | 7181af9f9459d65df9df59ed447729e1c13a958c (diff) | |
| download | samba-4fb5e28b663c57cc4f67b28312a291132dae2fb6.tar.gz samba-4fb5e28b663c57cc4f67b28312a291132dae2fb6.tar.bz2 samba-4fb5e28b663c57cc4f67b28312a291132dae2fb6.zip | |
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>
Diffstat (limited to 'python')
| -rw-r--r-- | python/samba/emulate/traffic.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/python/samba/emulate/traffic.py b/python/samba/emulate/traffic.py index eaa0c934049..d65aec6f32c 100644 --- a/python/samba/emulate/traffic.py +++ b/python/samba/emulate/traffic.py @@ -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)) |
