mirror of
https://github.com/samba-team/samba.git
synced 2025-08-04 08:22:08 +03:00
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>
This commit is contained in:
@ -31,7 +31,10 @@ from samba.credentials import (
|
|||||||
DONT_USE_KERBEROS
|
DONT_USE_KERBEROS
|
||||||
)
|
)
|
||||||
from samba import NTSTATUSError
|
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
|
from samba.dcerpc.misc import SEC_CHAN_WKSTA
|
||||||
import samba
|
import samba
|
||||||
samba.ensure_third_party_module("dns", "dnspython")
|
samba.ensure_third_party_module("dns", "dnspython")
|
||||||
@ -432,9 +435,11 @@ def packet_lsarpc_39(packet, conversation, context):
|
|||||||
try:
|
try:
|
||||||
c.QueryTrustedDomainInfoBySid(pol_handle, domsid, level)
|
c.QueryTrustedDomainInfoBySid(pol_handle, domsid, level)
|
||||||
except NTSTATUSError as error:
|
except NTSTATUSError as error:
|
||||||
# Object Not found is the expected result, anything else is a
|
# Object Not found is the expected result from samba,
|
||||||
# failure.
|
# while No Such Domain is the expected result from windows,
|
||||||
if not check_runtime_error(error, NT_STATUS_OBJECT_NAME_NOT_FOUND):
|
# 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
|
raise
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user