r14713: For testing, it is sometimes useful to specify a hostname for kerberos
authorAndrew Bartlett <abartlet@samba.org>
Sat, 25 Mar 2006 11:30:06 +0000 (11:30 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:59:12 +0000 (13:59 -0500)
that differs from the hostname the connect() uses.

In particular, this helps in running Kerberos tests in 'make test'.

Andrew Bartlett
(This used to be commit 78447333b0fc9450e18cd1d1c15df62acb5f0f36)

source4/auth/gensec/gensec.c

index 8dbf9fe2db36d6716aac8bed58751b93acf5350c..c334e544739cddb03197a5ece5bff38751a4637f 100644 (file)
@@ -978,6 +978,12 @@ _PUBLIC_ NTSTATUS gensec_set_target_hostname(struct gensec_security *gensec_secu
 
 _PUBLIC_ const char *gensec_get_target_hostname(struct gensec_security *gensec_security) 
 {
+       /* We allow the target hostname to be overriden for testing purposes */
+       const char *target_hostname = lp_parm_string(-1, "gensec", "target_hostname");
+       if (target_hostname) {
+               return target_hostname;
+       }
+
        if (gensec_security->target.hostname) {
                return gensec_security->target.hostname;
        }