]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:librpc: Use lp_dns_hostname() for creating the fqdn
authorAndreas Schneider <asn@samba.org>
Wed, 6 Mar 2024 14:59:14 +0000 (15:59 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 22 May 2024 20:33:36 +0000 (20:33 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/librpc/crypto/gse_krb5.c

index f1e0e5194bf827b06a71733f325eeab4cf0e0f1e..0ea3f5b09b89ea374d64a19e28af082b8f4bf2d4 100644 (file)
@@ -354,15 +354,19 @@ static krb5_error_code fill_mem_keytab_from_system_keytab(krb5_context krbctx,
        fstring my_name, my_fqdn;
        unsigned i;
        int err;
+       const char *dns_hostname = NULL;
 
        /* Generate the list of principal names which we expect
         * clients might want to use for authenticating to the file
         * service.  We allow name$,{host,cifs}/{name,fqdn,name.REALM}. */
 
        fstrcpy(my_name, lp_netbios_name());
-
-       my_fqdn[0] = '\0';
-       name_to_fqdn(my_fqdn, lp_netbios_name());
+       dns_hostname = lp_dns_hostname();
+       if (dns_hostname == NULL) {
+               ret = ENOMEM;
+               goto out;
+       }
+       fstrcpy(my_fqdn, dns_hostname);
 
        err = asprintf(&valid_princ_formats[0],
                        "%s$@%s", my_name, lp_realm());