summaryrefslogtreecommitdiffstats
path: root/source3/libads
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-06-09 15:31:03 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-06-09 12:40:09 +0200
commit74eed8f3ed5c333728350df1d23a4318e9104909 (patch)
treec0e4d64d876400e711bf252b73f4bdb43f0e55c1 /source3/libads
parent0e95311c235929e07fdcfd7153b91ae795a979b9 (diff)
downloadsamba-74eed8f3ed5c333728350df1d23a4318e9104909.tar.gz
samba-74eed8f3ed5c333728350df1d23a4318e9104909.tar.xz
samba-74eed8f3ed5c333728350df1d23a4318e9104909.zip
s3-param Remove special case for global_myname(), rename to lp_netbios_name()
There is no reason this can't be a normal constant string in the loadparm system, now that we have lp_set_cmdline() to handle overrides correctly. Andrew Bartlett
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/authdata.c2
-rw-r--r--source3/libads/kerberos.c2
-rw-r--r--source3/libads/kerberos_keytab.c14
-rw-r--r--source3/libads/kerberos_util.c6
-rw-r--r--source3/libads/kerberos_verify.c6
-rw-r--r--source3/libads/ldap.c12
-rw-r--r--source3/libads/sasl.c2
7 files changed, 22 insertions, 22 deletions
diff --git a/source3/libads/authdata.c b/source3/libads/authdata.c
index 6f49b857da..44279a24d7 100644
--- a/source3/libads/authdata.c
+++ b/source3/libads/authdata.c
@@ -78,7 +78,7 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
NT_STATUS_HAVE_NO_MEMORY(auth_princ);
local_service = talloc_asprintf(mem_ctx, "%s$@%s",
- global_myname(), lp_realm());
+ lp_netbios_name(), lp_realm());
NT_STATUS_HAVE_NO_MEMORY(local_service);
ret = kerberos_kinit_password_ext(auth_princ,
diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c
index a41686a495..913d690049 100644
--- a/source3/libads/kerberos.c
+++ b/source3/libads/kerberos.c
@@ -352,7 +352,7 @@ char* kerberos_standard_des_salt( void )
{
fstring salt;
- fstr_sprintf( salt, "host/%s.%s@", global_myname(), lp_realm() );
+ fstr_sprintf( salt, "host/%s.%s@", lp_netbios_name(), lp_realm() );
strlower_m( salt );
fstrcat( salt, lp_realm() );
diff --git a/source3/libads/kerberos_keytab.c b/source3/libads/kerberos_keytab.c
index 6e1b7c08fe..7654c666f4 100644
--- a/source3/libads/kerberos_keytab.c
+++ b/source3/libads/kerberos_keytab.c
@@ -316,7 +316,7 @@ int ads_keytab_add_entry(ADS_STRUCT *ads, const char *srvPrinc)
goto out;
}
- my_fqdn = ads_get_dnshostname(ads, tmpctx, global_myname());
+ my_fqdn = ads_get_dnshostname(ads, tmpctx, lp_netbios_name());
if (!my_fqdn) {
DEBUG(0, (__location__ ": unable to determine machine "
"account's dns name in AD!\n"));
@@ -324,7 +324,7 @@ int ads_keytab_add_entry(ADS_STRUCT *ads, const char *srvPrinc)
goto out;
}
- machine_name = ads_get_samaccountname(ads, tmpctx, global_myname());
+ machine_name = ads_get_samaccountname(ads, tmpctx, lp_netbios_name());
if (!machine_name) {
DEBUG(0, (__location__ ": unable to determine machine "
"account's short name in AD!\n"));
@@ -380,7 +380,7 @@ int ads_keytab_add_entry(ADS_STRUCT *ads, const char *srvPrinc)
"'%s'\n", princ_s));
aderr = ads_add_service_principal_name(ads,
- global_myname(), my_fqdn, srvPrinc);
+ lp_netbios_name(), my_fqdn, srvPrinc);
if (!ADS_ERR_OK(aderr)) {
DEBUG(1, (__location__ ": failed to "
"ads_add_service_principal_name.\n"));
@@ -389,7 +389,7 @@ int ads_keytab_add_entry(ADS_STRUCT *ads, const char *srvPrinc)
}
}
- kvno = (krb5_kvno)ads_get_machine_kvno(ads, global_myname());
+ kvno = (krb5_kvno)ads_get_machine_kvno(ads, lp_netbios_name());
if (kvno == -1) {
/* -1 indicates failure, everything else is OK */
DEBUG(1, (__location__ ": ads_get_machine_kvno failed to "
@@ -458,7 +458,7 @@ int ads_keytab_flush(ADS_STRUCT *ads)
goto out;
}
- kvno = (krb5_kvno)ads_get_machine_kvno(ads, global_myname());
+ kvno = (krb5_kvno)ads_get_machine_kvno(ads, lp_netbios_name());
if (kvno == -1) {
/* -1 indicates a failure */
DEBUG(1, (__location__ ": Error determining the kvno.\n"));
@@ -472,7 +472,7 @@ int ads_keytab_flush(ADS_STRUCT *ads)
goto out;
}
- aderr = ads_clear_service_principal_names(ads, global_myname());
+ aderr = ads_clear_service_principal_names(ads, lp_netbios_name());
if (!ADS_ERR_OK(aderr)) {
DEBUG(1, (__location__ ": Error while clearing service "
"principal listings in LDAP.\n"));
@@ -547,7 +547,7 @@ int ads_keytab_create_default(ADS_STRUCT *ads)
goto done;
}
- machine_name = talloc_strdup(tmpctx, global_myname());
+ machine_name = talloc_strdup(tmpctx, lp_netbios_name());
if (!machine_name) {
ret = -1;
goto done;
diff --git a/source3/libads/kerberos_util.c b/source3/libads/kerberos_util.c
index 4762e1b914..4935da8e79 100644
--- a/source3/libads/kerberos_util.c
+++ b/source3/libads/kerberos_util.c
@@ -72,13 +72,13 @@ int ads_kinit_password(ADS_STRUCT *ads)
account_name = lp_workgroup();
} else {
/* always use the sAMAccountName for security = domain */
- /* global_myname()$@REA.LM */
+ /* lp_netbios_name()$@REA.LM */
if ( lp_security() == SEC_DOMAIN ) {
- fstr_sprintf( acct_name, "%s$", global_myname() );
+ fstr_sprintf( acct_name, "%s$", lp_netbios_name() );
account_name = acct_name;
}
else
- /* This looks like host/global_myname()@REA.LM */
+ /* This looks like host/lp_netbios_name()@REA.LM */
account_name = ads->auth.user_name;
}
diff --git a/source3/libads/kerberos_verify.c b/source3/libads/kerberos_verify.c
index fab38dc4de..f11ea88477 100644
--- a/source3/libads/kerberos_verify.c
+++ b/source3/libads/kerberos_verify.c
@@ -151,10 +151,10 @@ static bool ads_keytab_verify_ticket(krb5_context context,
* clients might want to use for authenticating to the file
* service. We allow name$,{host,cifs}/{name,fqdn,name.REALM}. */
- fstrcpy(my_name, global_myname());
+ fstrcpy(my_name, lp_netbios_name());
my_fqdn[0] = '\0';
- name_to_fqdn(my_fqdn, global_myname());
+ name_to_fqdn(my_fqdn, lp_netbios_name());
err = asprintf(&valid_princ_formats[0],
"%s$@%s", my_name, lp_realm());
@@ -534,7 +534,7 @@ NTSTATUS ads_verify_ticket(TALLOC_CTX *mem_ctx,
krb5_auth_con_setflags( context, auth_context, flags );
}
- if (asprintf(&host_princ_s, "%s$", global_myname()) == -1) {
+ if (asprintf(&host_princ_s, "%s$", lp_netbios_name()) == -1) {
goto out;
}
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index ed17ed8473..128c133760 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -657,7 +657,7 @@ got_connection:
/* Must use the userPrincipalName value here or sAMAccountName
and not servicePrincipalName; found by Guenther Deschner */
- if (asprintf(&ads->auth.user_name, "%s$", global_myname() ) == -1) {
+ if (asprintf(&ads->auth.user_name, "%s$", lp_netbios_name() ) == -1) {
DEBUG(0,("ads_connect: asprintf fail.\n"));
ads->auth.user_name = NULL;
}
@@ -3325,10 +3325,10 @@ char* ads_get_dnshostname( ADS_STRUCT *ads, TALLOC_CTX *ctx, const char *machine
int count = 0;
char *name = NULL;
- status = ads_find_machine_acct(ads, &res, global_myname());
+ status = ads_find_machine_acct(ads, &res, lp_netbios_name());
if (!ADS_ERR_OK(status)) {
DEBUG(0,("ads_get_dnshostname: Failed to find account for %s\n",
- global_myname()));
+ lp_netbios_name()));
goto out;
}
@@ -3360,7 +3360,7 @@ char* ads_get_upn( ADS_STRUCT *ads, TALLOC_CTX *ctx, const char *machine_name )
status = ads_find_machine_acct(ads, &res, machine_name);
if (!ADS_ERR_OK(status)) {
DEBUG(0,("ads_get_upn: Failed to find account for %s\n",
- global_myname()));
+ lp_netbios_name()));
goto out;
}
@@ -3389,10 +3389,10 @@ char* ads_get_samaccountname( ADS_STRUCT *ads, TALLOC_CTX *ctx, const char *mach
int count = 0;
char *name = NULL;
- status = ads_find_machine_acct(ads, &res, global_myname());
+ status = ads_find_machine_acct(ads, &res, lp_netbios_name());
if (!ADS_ERR_OK(status)) {
DEBUG(0,("ads_get_dnshostname: Failed to find account for %s\n",
- global_myname()));
+ lp_netbios_name()));
goto out;
}
diff --git a/source3/libads/sasl.c b/source3/libads/sasl.c
index 8b2dbad434..45cf569c79 100644
--- a/source3/libads/sasl.c
+++ b/source3/libads/sasl.c
@@ -141,7 +141,7 @@ static ADS_STATUS ads_sasl_spnego_ntlmssp_bind(ADS_STRUCT *ads)
struct ntlmssp_state *ntlmssp_state;
nt_status = ntlmssp_client_start(NULL,
- global_myname(),
+ lp_netbios_name(),
lp_workgroup(),
lp_client_ntlmv2_auth(),
&ntlmssp_state);