summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/schema/schema_init.c47
-rw-r--r--source4/param/provision.c8
-rw-r--r--source4/param/util.c2
-rw-r--r--source4/scripting/python/samba/provision.py3
4 files changed, 47 insertions, 13 deletions
diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c
index fbd8946bb5..a67aecd1e8 100644
--- a/source4/dsdb/schema/schema_init.c
+++ b/source4/dsdb/schema/schema_init.c
@@ -1202,6 +1202,34 @@ static struct drsuapi_DsReplicaAttribute *dsdb_find_object_attr_name(struct dsdb
} \
} while (0)
+#define GET_STRING_LIST_DS(s, r, attr, mem_ctx, p, elem, strict) do { \
+ int get_string_list_counter; \
+ struct drsuapi_DsReplicaAttribute *_a; \
+ _a = dsdb_find_object_attr_name(s, r, attr, NULL); \
+ if (strict && !_a) { \
+ d_printf("%s: %s == NULL\n", __location__, attr); \
+ return WERR_INVALID_PARAM; \
+ } \
+ (p)->elem = _a ? talloc_array(mem_ctx, const char *, _a->value_ctr.num_values + 1) : NULL; \
+ for (get_string_list_counter=0; \
+ _a && get_string_list_counter < _a->value_ctr.num_values; \
+ get_string_list_counter++) { \
+ size_t _ret; \
+ if (!convert_string_talloc_convenience(mem_ctx, s->iconv_convenience, CH_UTF16, CH_UNIX, \
+ _a->value_ctr.values[get_string_list_counter].blob->data, \
+ _a->value_ctr.values[get_string_list_counter].blob->length, \
+ (void **)discard_const(&(p)->elem[get_string_list_counter]), &_ret, false)) { \
+ DEBUG(0,("%s: invalid data!\n", attr)); \
+ dump_data(0, \
+ _a->value_ctr.values[get_string_list_counter].blob->data, \
+ _a->value_ctr.values[get_string_list_counter].blob->length); \
+ return WERR_FOOBAR; \
+ } \
+ (p)->elem[get_string_list_counter+1] = NULL; \
+ } \
+ talloc_steal(mem_ctx, (p)->elem); \
+} while (0)
+
#define GET_DN_DS(s, r, attr, mem_ctx, p, elem, strict) do { \
struct drsuapi_DsReplicaAttribute *_a; \
_a = dsdb_find_object_attr_name(s, r, attr, NULL); \
@@ -1412,17 +1440,18 @@ WERROR dsdb_class_from_drsuapi(struct dsdb_schema *schema,
GET_STRING_DS(schema, r, "subClassOf", mem_ctx, obj, subClassOf, true);
- obj->systemAuxiliaryClass = NULL;
- obj->systemPossSuperiors = NULL;
- obj->systemMustContain = NULL;
- obj->systemMayContain = NULL;
- obj->auxiliaryClass = NULL;
- obj->possSuperiors = NULL;
- obj->mustContain = NULL;
- obj->mayContain = NULL;
+ GET_STRING_LIST_DS(schema, r, "systemAuxiliaryClass", mem_ctx, obj, systemAuxiliaryClass, false);
+ GET_STRING_LIST_DS(schema, r, "auxiliaryClass", mem_ctx, obj, auxiliaryClass, false);
+
+ GET_STRING_LIST_DS(schema, r, "systemMustContain", mem_ctx, obj, systemMustContain, false);
+ GET_STRING_LIST_DS(schema, r, "systemMayContain", mem_ctx, obj, systemMayContain, false);
+ GET_STRING_LIST_DS(schema, r, "mustContain", mem_ctx, obj, mustContain, false);
+ GET_STRING_LIST_DS(schema, r, "mayContain", mem_ctx, obj, mayContain, false);
- obj->possibleInferiors = NULL;
+ GET_STRING_LIST_DS(schema, r, "systemPossSuperiors", mem_ctx, obj, systemPossSuperiors, false);
+ GET_STRING_LIST_DS(schema, r, "possSuperiors", mem_ctx, obj, possSuperiors, false);
+ GET_STRING_LIST_DS(schema, r, "possibleInferiors", mem_ctx, obj, possibleInferiors, false);
GET_STRING_DS(schema, r, "defaultSecurityDescriptor", mem_ctx, obj, defaultSecurityDescriptor, false);
diff --git a/source4/param/provision.c b/source4/param/provision.c
index 7a06f77d96..c8bff59deb 100644
--- a/source4/param/provision.c
+++ b/source4/param/provision.c
@@ -34,6 +34,7 @@ NTSTATUS provision_bare(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,
struct provision_settings *settings,
struct provision_result *result)
{
+ char *configfile;
PyObject *provision_mod, *provision_dict, *provision_fn, *py_result, *parameters;
DEBUG(0,("Provision for Become-DC test using python\n"));
@@ -76,8 +77,11 @@ NTSTATUS provision_bare(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,
settings->targetdir));
parameters = PyDict_New();
- PyDict_SetItemString(parameters, "smbconf",
- PyString_FromString(lp_configfile(lp_ctx)));
+ configfile = lp_configfile(lp_ctx);
+ if (configfile != NULL) {
+ PyDict_SetItemString(parameters, "smbconf",
+ PyString_FromString(configfile));
+ }
PyDict_SetItemString(parameters, "rootdn",
PyString_FromString(settings->root_dn_str));
diff --git a/source4/param/util.c b/source4/param/util.c
index 92728d505a..3881107cbc 100644
--- a/source4/param/util.c
+++ b/source4/param/util.c
@@ -107,7 +107,7 @@ char *config_path(TALLOC_CTX* mem_ctx, struct loadparm_context *lp_ctx,
char *fname, *config_dir, *p;
config_dir = talloc_strdup(mem_ctx, lp_configfile(lp_ctx));
if (config_dir == NULL) {
- return NULL;
+ config_dir = talloc_strdup(mem_ctx, lp_default_path());
}
p = strrchr(config_dir, '/');
if (p == NULL) {
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py
index 0aa84ec6db..d96857661e 100644
--- a/source4/scripting/python/samba/provision.py
+++ b/source4/scripting/python/samba/provision.py
@@ -1136,7 +1136,8 @@ def provision(setup_dir, message, session_info,
message("NetBIOS Domain: %s" % names.domain)
message("DNS Domain: %s" % names.dnsdomain)
message("DOMAIN SID: %s" % str(domainsid))
- message("Admin password: %s" % adminpass)
+ if samdb_fill == FILL_FULL:
+ message("Admin password: %s" % adminpass)
result = ProvisionResult()
result.domaindn = domaindn