--- /dev/null
+<samba:parameter name="dns hostname"
+ context="G"
+ type="string"
+ function="_dns_hostname"
+ xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
+<description>
+ This value is used either register with AD during a join or by calling
+ <programlisting>
+ net ads dns register
+ </programlisting>
+ or during Kerberos authentication to create service principal names. This
+ is not supported in samba-tool yet.
+</description>
+
+<value type="default">[netbios name].[realm]</value>
+<value type="example">client-hostname.example.com</value>
+</samba:parameter>
return ret;
}
+
+const char *lpcfg_dns_hostname(struct loadparm_context *lp_ctx)
+{
+ const char *dns_hostname = lpcfg__dns_hostname(lp_ctx);
+ const char *dns_domain = lpcfg_dnsdomain(lp_ctx);
+ char *netbios_name = NULL;
+ char *hostname = NULL;
+
+ if (dns_hostname != NULL && dns_hostname[0] != '\0') {
+ return dns_hostname;
+ }
+
+ netbios_name = strlower_talloc(lp_ctx, lpcfg_netbios_name(lp_ctx));
+ if (netbios_name == NULL) {
+ return NULL;
+ }
+
+ /* If it isn't set, try to initialize with [netbios name].[realm] */
+ if (dns_domain != NULL && dns_domain[0] != '\0') {
+ hostname = talloc_asprintf(lp_ctx,
+ "%s.%s",
+ netbios_name,
+ dns_domain);
+ } else {
+ hostname = talloc_strdup(lp_ctx, netbios_name);
+ }
+ TALLOC_FREE(netbios_name);
+ if (hostname == NULL) {
+ return NULL;
+ }
+
+ lpcfg_string_set(lp_ctx->globals->ctx,
+ &lp_ctx->globals->_dns_hostname,
+ hostname);
+
+ return hostname;
+}
'max open files',
'include system krb5 conf',
'smbd max async dosmode',
+ 'dns hostname',
])
def setUp(self):
return Globals.rpc_high_port;
}
+const char *lp_dns_hostname(void)
+{
+ const char *dns_hostname = lp__dns_hostname();
+ const char *dns_domain = lp_dnsdomain();
+ char *netbios_name = NULL;
+
+ if (dns_hostname != NULL && dns_hostname[0] != '\0') {
+ return dns_hostname;
+ }
+
+ netbios_name = talloc_strdup(talloc_tos(), lp_netbios_name());
+ if (netbios_name == NULL) {
+ return NULL;
+ }
+ strlower_m(netbios_name);
+
+ /* If it isn't set, try to initialize with [netbios name].[realm] */
+ if (dns_domain != NULL && dns_domain[0] != '\0') {
+ Globals._dns_hostname = talloc_asprintf(Globals.ctx,
+ "%s.%s",
+ netbios_name,
+ dns_domain);
+ } else {
+ Globals._dns_hostname = talloc_strdup(Globals.ctx,
+ netbios_name);
+ }
+ TALLOC_FREE(netbios_name);
+ if (Globals._dns_hostname == NULL) {
+ return NULL;
+ }
+ dns_hostname = Globals._dns_hostname;
+
+ return dns_hostname;
+}
+
/*
* Do not allow LanMan auth if unless NTLMv1 is also allowed
*
bool lp_widelinks(int );
int lp_rpc_low_port(void);
int lp_rpc_high_port(void);
+const char *lp_dns_hostname(void);
bool lp_lanman_auth(void);
enum samba_weak_crypto lp_weak_crypto(void);