s4:rootdse LDB module - make "serverName" dynamic
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Wed, 15 Sep 2010 16:36:03 +0000 (18:36 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 23 Sep 2010 23:25:43 +0000 (09:25 +1000)
This helps to fix bug #7347. "dsServiceName" cannot be made dynamic in such a
simple way since it's already needed on LDB initialisation time.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/samdb/ldb_modules/rootdse.c

index 300f622486eca9968c512afddf535b80416ed30c..4e9f63c1e75da4db570a731eca476d2a2877cc16 100644 (file)
@@ -191,6 +191,13 @@ static int rootdse_add_dynamic(struct ldb_module *module, struct ldb_message *ms
        ldb_msg_remove_attr(msg, "cn");
        ldb_msg_remove_attr(msg, "name");
 
+       if (do_attribute(attrs, "serverName")) {
+               if (ldb_msg_add_linearized_dn(msg, "serverName",
+                       samdb_server_dn(ldb, msg)) != LDB_SUCCESS) {
+                       goto failed;
+               }
+       }
+
        if (do_attribute(attrs, "currentTime")) {
                if (ldb_msg_add_steal_string(msg, "currentTime",
                                             ldb_timestring(msg, time(NULL))) != LDB_SUCCESS) {