summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Guo <joeg@catalyst.net.nz>2018-04-18 15:45:10 +1200
committerAndrew Bartlett <abartlet@samba.org>2018-05-12 02:09:28 +0200
commit8d8ef48650ca5ec49f080be7f1fd813617aa6d31 (patch)
treed40f3ad6536a5b9c6eadd58924887e3f0d9ef303
parent4e37336632bd6a26bd960d5ee2e80fa1a22e8440 (diff)
downloadsamba-8d8ef48650ca5ec49f080be7f1fd813617aa6d31.tar.gz
samba-8d8ef48650ca5ec49f080be7f1fd813617aa6d31.tar.bz2
samba-8d8ef48650ca5ec49f080be7f1fd813617aa6d31.zip
traffic_packets: support NT_STATUS_NO_SUCH_DOMAIN in packet_lsarpc_39
For packet_lsarpc_39, samba will return NT_STATUS_OBJECT_NAME_NOT_FOUND, however, windows will return NT_STATUS_NO_SUCH_DOMAIN. Allow both status for now to keep compatiable with both samba and windows DC. Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
-rw-r--r--python/samba/emulate/traffic_packets.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/python/samba/emulate/traffic_packets.py b/python/samba/emulate/traffic_packets.py
index 25a02f63c2b..390041b9513 100644
--- a/python/samba/emulate/traffic_packets.py
+++ b/python/samba/emulate/traffic_packets.py
@@ -31,7 +31,10 @@ from samba.credentials import (
DONT_USE_KERBEROS
)
from samba import NTSTATUSError
-from samba.ntstatus import NT_STATUS_OBJECT_NAME_NOT_FOUND
+from samba.ntstatus import (
+ NT_STATUS_OBJECT_NAME_NOT_FOUND,
+ NT_STATUS_NO_SUCH_DOMAIN
+)
from samba.dcerpc.misc import SEC_CHAN_WKSTA
import samba
samba.ensure_third_party_module("dns", "dnspython")
@@ -432,9 +435,11 @@ def packet_lsarpc_39(packet, conversation, context):
try:
c.QueryTrustedDomainInfoBySid(pol_handle, domsid, level)
except NTSTATUSError as error:
- # Object Not found is the expected result, anything else is a
- # failure.
- if not check_runtime_error(error, NT_STATUS_OBJECT_NAME_NOT_FOUND):
+ # Object Not found is the expected result from samba,
+ # while No Such Domain is the expected result from windows,
+ # anything else is a failure.
+ if not check_runtime_error(error, NT_STATUS_OBJECT_NAME_NOT_FOUND) \
+ and not check_runtime_error(error, NT_STATUS_NO_SUCH_DOMAIN):
raise
return True