diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-09-18 21:44:26 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-09-24 09:25:43 +1000 |
commit | 1d9a3481446e99911aaa1d55561886f1970db316 (patch) | |
tree | 04cd766397bfeeb4aefe6625742ec4f298c82073 /source4/dsdb/samdb/ldb_modules | |
parent | ccc67a03d69ed5c3c5c6b8fbed5d9e85ea4fd295 (diff) | |
download | samba-1d9a3481446e99911aaa1d55561886f1970db316.tar.gz samba-1d9a3481446e99911aaa1d55561886f1970db316.tar.bz2 samba-1d9a3481446e99911aaa1d55561886f1970db316.zip |
s4:rootdse LDB module - introduce dynamic "ldapServiceName"
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/rootdse.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/rootdse.c b/source4/dsdb/samdb/ldb_modules/rootdse.c index 041e85840e..a786a70ce3 100644 --- a/source4/dsdb/samdb/ldb_modules/rootdse.c +++ b/source4/dsdb/samdb/ldb_modules/rootdse.c @@ -206,6 +206,31 @@ static int rootdse_add_dynamic(struct ldb_module *module, struct ldb_message *ms } } + if (do_attribute(attrs, "ldapServiceName")) { + struct loadparm_context *lp_ctx + = talloc_get_type(ldb_get_opaque(ldb, "loadparm"), + struct loadparm_context); + char *ldap_service_name, *hostname; + + hostname = talloc_strdup(msg, lpcfg_netbios_name(lp_ctx)); + if (hostname == NULL) { + goto failed; + } + strlower_m(hostname); + + ldap_service_name = talloc_asprintf(msg, "%s:%s$@%s", + samdb_forest_name(ldb, msg), + hostname, lpcfg_realm(lp_ctx)); + if (ldap_service_name == NULL) { + goto failed; + } + + if (ldb_msg_add_string(msg, "ldapServiceName", + ldap_service_name) != LDB_SUCCESS) { + goto failed; + } + } + if (do_attribute(attrs, "currentTime")) { if (ldb_msg_add_steal_string(msg, "currentTime", ldb_timestring(msg, time(NULL))) != LDB_SUCCESS) { |