1
0
mirror of https://github.com/samba-team/samba.git synced 2025-09-07 21:44:22 +03:00

CVE-2018-14628: python:provision: make DELETEDOBJECTS_DESCRIPTOR available in the ldif files

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13595

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Stefan Metzmacher
2016-01-29 23:33:37 +01:00
parent 3be190dcf7
commit 0c329a0fda
2 changed files with 9 additions and 0 deletions

View File

@@ -81,6 +81,7 @@ from samba.provision.backend import (
LDBBackend, LDBBackend,
) )
from samba.descriptor import ( from samba.descriptor import (
get_deletedobjects_descriptor,
get_config_descriptor, get_config_descriptor,
get_config_partitions_descriptor, get_config_partitions_descriptor,
get_config_sites_descriptor, get_config_sites_descriptor,
@@ -1450,6 +1451,8 @@ def fill_samdb(samdb, lp, names, logger, policyguid,
msg["subRefs"] = ldb.MessageElement(names.configdn, ldb.FLAG_MOD_ADD, msg["subRefs"] = ldb.MessageElement(names.configdn, ldb.FLAG_MOD_ADD,
"subRefs") "subRefs")
deletedobjects_descr = b64encode(get_deletedobjects_descriptor(names.domainsid)).decode('utf8')
samdb.invocation_id = invocationid samdb.invocation_id = invocationid
# If we are setting up a subdomain, then this has been replicated in, so we don't need to add it # If we are setting up a subdomain, then this has been replicated in, so we don't need to add it
@@ -1481,6 +1484,7 @@ def fill_samdb(samdb, lp, names, logger, policyguid,
"FOREST_FUNCTIONALITY": str(forestFunctionality), "FOREST_FUNCTIONALITY": str(forestFunctionality),
"DOMAIN_FUNCTIONALITY": str(domainFunctionality), "DOMAIN_FUNCTIONALITY": str(domainFunctionality),
"NTDSQUOTAS_DESCRIPTOR": ntdsquotas_descr, "NTDSQUOTAS_DESCRIPTOR": ntdsquotas_descr,
"DELETEDOBJECTS_DESCRIPTOR": deletedobjects_descr,
"LOSTANDFOUND_DESCRIPTOR": protected1wd_descr, "LOSTANDFOUND_DESCRIPTOR": protected1wd_descr,
"SERVICES_DESCRIPTOR": protected1_descr, "SERVICES_DESCRIPTOR": protected1_descr,
"PHYSICALLOCATIONS_DESCRIPTOR": protected1wd_descr, "PHYSICALLOCATIONS_DESCRIPTOR": protected1wd_descr,
@@ -1545,6 +1549,7 @@ def fill_samdb(samdb, lp, names, logger, policyguid,
"RIDAVAILABLESTART": str(next_rid + 600), "RIDAVAILABLESTART": str(next_rid + 600),
"POLICYGUID_DC": policyguid_dc, "POLICYGUID_DC": policyguid_dc,
"INFRASTRUCTURE_DESCRIPTOR": infrastructure_desc, "INFRASTRUCTURE_DESCRIPTOR": infrastructure_desc,
"DELETEDOBJECTS_DESCRIPTOR": deletedobjects_descr,
"LOSTANDFOUND_DESCRIPTOR": lostandfound_desc, "LOSTANDFOUND_DESCRIPTOR": lostandfound_desc,
"SYSTEM_DESCRIPTOR": system_desc, "SYSTEM_DESCRIPTOR": system_desc,
"BUILTIN_DESCRIPTOR": builtin_desc, "BUILTIN_DESCRIPTOR": builtin_desc,

View File

@@ -40,6 +40,7 @@ from samba.dsdb import (
DS_GUID_USERS_CONTAINER DS_GUID_USERS_CONTAINER
) )
from samba.descriptor import ( from samba.descriptor import (
get_deletedobjects_descriptor,
get_domain_descriptor, get_domain_descriptor,
get_domain_delete_protected1_descriptor, get_domain_delete_protected1_descriptor,
get_domain_delete_protected2_descriptor, get_domain_delete_protected2_descriptor,
@@ -252,6 +253,7 @@ def setup_dns_partitions(samdb, domainsid, domaindn, forestdn, configdn,
domainzone_dn = "DC=DomainDnsZones,%s" % domaindn domainzone_dn = "DC=DomainDnsZones,%s" % domaindn
forestzone_dn = "DC=ForestDnsZones,%s" % forestdn forestzone_dn = "DC=ForestDnsZones,%s" % forestdn
descriptor = get_dns_partition_descriptor(domainsid) descriptor = get_dns_partition_descriptor(domainsid)
deletedobjects_desc = get_deletedobjects_descriptor(domainsid)
setup_add_ldif(samdb, setup_path("provision_dnszones_partitions.ldif"), { setup_add_ldif(samdb, setup_path("provision_dnszones_partitions.ldif"), {
"ZONE_DN": domainzone_dn, "ZONE_DN": domainzone_dn,
@@ -274,6 +276,7 @@ def setup_dns_partitions(samdb, domainsid, domaindn, forestdn, configdn,
"ZONE_DNS": domainzone_dns, "ZONE_DNS": domainzone_dns,
"CONFIGDN": configdn, "CONFIGDN": configdn,
"SERVERDN": serverdn, "SERVERDN": serverdn,
"DELETEDOBJECTS_DESCRIPTOR": b64encode(deletedobjects_desc).decode('utf8'),
"LOSTANDFOUND_DESCRIPTOR": b64encode(protected2_desc).decode('utf8'), "LOSTANDFOUND_DESCRIPTOR": b64encode(protected2_desc).decode('utf8'),
"INFRASTRUCTURE_DESCRIPTOR": b64encode(protected1_desc).decode('utf8'), "INFRASTRUCTURE_DESCRIPTOR": b64encode(protected1_desc).decode('utf8'),
}) })
@@ -293,6 +296,7 @@ def setup_dns_partitions(samdb, domainsid, domaindn, forestdn, configdn,
"ZONE_DNS": forestzone_dns, "ZONE_DNS": forestzone_dns,
"CONFIGDN": configdn, "CONFIGDN": configdn,
"SERVERDN": serverdn, "SERVERDN": serverdn,
"DELETEDOBJECTS_DESCRIPTOR": b64encode(deletedobjects_desc).decode('utf8'),
"LOSTANDFOUND_DESCRIPTOR": b64encode(protected2_desc).decode('utf8'), "LOSTANDFOUND_DESCRIPTOR": b64encode(protected2_desc).decode('utf8'),
"INFRASTRUCTURE_DESCRIPTOR": b64encode(protected1_desc).decode('utf8'), "INFRASTRUCTURE_DESCRIPTOR": b64encode(protected1_desc).decode('utf8'),
}) })