60 lines
2.9 KiB
Diff
60 lines
2.9 KiB
Diff
|
|
diff -Nurp samba-4.9.1/python/samba/tests/dcerpc/dnsserver.py samba-4.9.1-bak/python/samba/tests/dcerpc/dnsserver.py
|
||
|
|
--- samba-4.9.1/python/samba/tests/dcerpc/dnsserver.py 2018-07-12 04:23:36.000000000 -0400
|
||
|
|
+++ samba-4.9.1-bak/python/samba/tests/dcerpc/dnsserver.py 2019-07-29 11:47:02.701000000 -0400
|
||
|
|
@@ -28,6 +28,7 @@ from samba.dcerpc import dnsp, dnsserver
|
||
|
|
from samba.tests import RpcInterfaceTestCase, env_get_var_value
|
||
|
|
from samba.netcmd.dns import ARecord, AAAARecord, PTRRecord, CNameRecord, NSRecord, MXRecord, SRVRecord, TXTRecord
|
||
|
|
from samba import sd_utils, descriptor
|
||
|
|
+from samba import WERRORError, werror
|
||
|
|
|
||
|
|
class DnsserverTests(RpcInterfaceTestCase):
|
||
|
|
|
||
|
|
@@ -707,6 +708,29 @@ class DnsserverTests(RpcInterfaceTestCas
|
||
|
|
'ServerInfo')
|
||
|
|
self.assertEquals(dnsserver.DNSSRV_TYPEID_SERVER_INFO, typeid)
|
||
|
|
|
||
|
|
+ # This test is to confirm that we do not support multizone operations,
|
||
|
|
+ # which are designated by a non-zero dwContext value (the 3rd argument
|
||
|
|
+ # to DnssrvOperation).
|
||
|
|
+ def test_operation_invalid(self):
|
||
|
|
+ non_zone = 'a-zone-that-does-not-exist'
|
||
|
|
+ typeid = dnsserver.DNSSRV_TYPEID_NAME_AND_PARAM
|
||
|
|
+ name_and_param = dnsserver.DNS_RPC_NAME_AND_PARAM()
|
||
|
|
+ name_and_param.pszNodeName = 'AllowUpdate'
|
||
|
|
+ name_and_param.dwParam = dnsp.DNS_ZONE_UPDATE_SECURE
|
||
|
|
+ try:
|
||
|
|
+ res = self.conn.DnssrvOperation(self.server,
|
||
|
|
+ non_zone,
|
||
|
|
+ 1,
|
||
|
|
+ 'ResetDwordProperty',
|
||
|
|
+ typeid,
|
||
|
|
+ name_and_param)
|
||
|
|
+ except WERRORError as e:
|
||
|
|
+ if e.args[0] == werror.WERR_DNS_ERROR_ZONE_DOES_NOT_EXIST:
|
||
|
|
+ return
|
||
|
|
+
|
||
|
|
+ # We should always encounter a DOES_NOT_EXIST error.
|
||
|
|
+ self.fail()
|
||
|
|
+
|
||
|
|
def test_operation2(self):
|
||
|
|
client_version = dnsserver.DNS_CLIENT_VERSION_LONGHORN
|
||
|
|
rev_zone = '1.168.192.in-addr.arpa'
|
||
|
|
diff -Nurp samba-4.9.1/source4/rpc_server/dnsserver/dcerpc_dnsserver.c samba-4.9.1-bak/source4/rpc_server/dnsserver/dcerpc_dnsserver.c
|
||
|
|
--- samba-4.9.1/source4/rpc_server/dnsserver/dcerpc_dnsserver.c 2018-07-12 04:23:36.000000000 -0400
|
||
|
|
+++ samba-4.9.1-bak/source4/rpc_server/dnsserver/dcerpc_dnsserver.c 2019-07-29 11:51:52.408000000 -0400
|
||
|
|
@@ -1955,7 +1955,13 @@ static WERROR dcesrv_DnssrvOperation(str
|
||
|
|
&r->in.pData);
|
||
|
|
} else {
|
||
|
|
z = dnsserver_find_zone(dsstate->zones, r->in.pszZone);
|
||
|
|
- if (z == NULL && request_filter == 0) {
|
||
|
|
+ /*
|
||
|
|
+ * In the case that request_filter is not 0 and z is NULL,
|
||
|
|
+ * the request is for a multizone operation, which we do not
|
||
|
|
+ * yet support, so just error on NULL zone name.
|
||
|
|
+ */
|
||
|
|
+ if (z == NULL) {
|
||
|
|
+
|
||
|
|
return WERR_DNS_ERROR_ZONE_DOES_NOT_EXIST;
|
||
|
|
}
|
||
|
|
|