]> git.sur5r.net Git - openldap/blobdiff - libraries/liblutil/authpasswd.c
remove const from salt_format
[openldap] / libraries / liblutil / authpasswd.c
index 1fc4d74c71b2488207daa65497f0c67fd1fbb149..b7dab5a25d543499aaf25d6a62233c3f341db380 100644 (file)
@@ -609,9 +609,9 @@ static int chk_kerberos(
                }
 
                {
-                       char host[MAXHOSTNAMELEN];
+                       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;
@@ -619,6 +619,8 @@ static int chk_kerberos(
 
                        ret = krb5_sname_to_principal( context,
                                host, "ldap", KRB5_NT_SRV_HST, &server );
+
+                       ber_memfree( host );
                }
 
                if (ret) {
@@ -926,4 +928,4 @@ static struct berval *hash_crypt(
        return pw_string( scheme, &hash );
 }
 #endif
-#endif
\ No newline at end of file
+#endif