s4:rootdse LDB module - introduce dynamic "dnsHostName" attribute
[mat/samba.git] / source4 / dsdb / samdb / ldb_modules / rootdse.c
index 4e9f63c1e75da4db570a731eca476d2a2877cc16..041e85840ed5c871d579bb0c30aca6fae55883dd 100644 (file)
@@ -198,6 +198,14 @@ static int rootdse_add_dynamic(struct ldb_module *module, struct ldb_message *ms
                }
        }
 
+       if (do_attribute(attrs, "dnsHostName")) {
+               if (ldb_msg_add_string(msg, "dnsHostName",
+                       samdb_search_string(ldb, msg, samdb_server_dn(ldb, msg),
+                                           "dNSHostName", NULL)) != LDB_SUCCESS) {
+                       goto failed;
+               }
+       }
+
        if (do_attribute(attrs, "currentTime")) {
                if (ldb_msg_add_steal_string(msg, "currentTime",
                                             ldb_timestring(msg, time(NULL))) != LDB_SUCCESS) {