s4:provision.c - "provsion_store_self_join" - don't set the realm if it's NULL
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Mon, 15 Feb 2010 09:29:47 +0000 (10:29 +0100)
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Mon, 15 Feb 2010 09:33:35 +0000 (10:33 +0100)
The realm can be NULL when this function is called by "libnet_Join_primary_domain".
This seems to be a valid value since "libnet_JoinDomain" is allowed to return an
empty realm if we are not in a ADS domain.

source4/param/provision.c

index 920a5d8639e8a5b0e664c159a9d7d7b376eca2a1..9191400f59a0232edbb77cb9437f583d8c90ede3 100644 (file)
@@ -280,8 +280,10 @@ NTSTATUS provision_store_self_join(TALLOC_CTX *mem_ctx, struct loadparm_context
                             PyLdb_FromLdbContext(ldb));
        PyDict_SetItemString(parameters, "domain", 
                             PyString_FromString(settings->domain_name));
-       PyDict_SetItemString(parameters, "realm", 
-                            PyString_FromString(settings->realm));
+       if (settings->realm != NULL) {
+               PyDict_SetItemString(parameters, "realm",
+                                    PyString_FromString(settings->realm));
+       }
        PyDict_SetItemString(parameters, "machinepass", 
                             PyString_FromString(settings->machine_password));
        PyDict_SetItemString(parameters, "netbiosname",