summaryrefslogtreecommitdiff
path: root/source3/libnet
diff options
context:
space:
mode:
Diffstat (limited to 'source3/libnet')
-rw-r--r--source3/libnet/libnet_join.c11
-rw-r--r--source3/libnet/libnet_proto.h2
2 files changed, 9 insertions, 4 deletions
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index a39dee676f..ab8af0be6b 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -357,10 +357,15 @@ static ADS_STATUS libnet_join_set_machine_spn(TALLOC_CTX *mem_ctx,
strupper_m(spn);
spn_array[0] = spn;
- if (name_to_fqdn(my_fqdn, r->in.machine_name) &&
- !strequal(my_fqdn, r->in.machine_name)) {
+ if (!name_to_fqdn(my_fqdn, r->in.machine_name)
+ || (strchr(my_fqdn, '.') == NULL)) {
+ fstr_sprintf(my_fqdn, "%s.%s", r->in.machine_name,
+ r->out.dns_domain_name);
+ }
+
+ strlower_m(my_fqdn);
- strlower_m(my_fqdn);
+ if (!strequal(my_fqdn, r->in.machine_name)) {
spn = talloc_asprintf(mem_ctx, "HOST/%s", my_fqdn);
if (!spn) {
return ADS_ERROR_LDAP(LDAP_NO_MEMORY);
diff --git a/source3/libnet/libnet_proto.h b/source3/libnet/libnet_proto.h
index 43046a44c0..69a16c1c7d 100644
--- a/source3/libnet/libnet_proto.h
+++ b/source3/libnet/libnet_proto.h
@@ -53,7 +53,7 @@ krb5_error_code libnet_keytab_add(struct libnet_keytab_context *ctx);
struct libnet_keytab_entry *libnet_keytab_search(struct libnet_keytab_context *ctx,
const char *principal, int kvno,
- const const krb5_enctype enctype,
+ const krb5_enctype enctype,
TALLOC_CTX *mem_ctx);
#endif