]> git.sur5r.net Git - openldap/blobdiff - libraries/liblutil/authpasswd.c
Import changes from devel including:
[openldap] / libraries / liblutil / authpasswd.c
index e179f32dbcd661ac233ad78ce62c7043123abae2..b7dab5a25d543499aaf25d6a62233c3f341db380 100644 (file)
@@ -609,18 +609,18 @@ static int chk_kerberos(
                }
 
                {
-                       char host[MAXHOSTNAMELEN+1];
+                       char *host = ldap_pvt_get_fqdn( NULL );
 
-                       if( gethostname( host, MAXHOSTNAMELEN ) != 0 ) {
+                       if( host == NULL ) {
                                krb5_free_principal( context, client );
                                krb5_free_context( context );
                                return 1;
                        }
 
-                       host[MAXHOSTNAMELEN] = '\0';
-
                        ret = krb5_sname_to_principal( context,
                                host, "ldap", KRB5_NT_SRV_HST, &server );
+
+                       ber_memfree( host );
                }
 
                if (ret) {