summaryrefslogtreecommitdiffstats
path: root/source3/utils/net_ads.c
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/utils/net_ads.c
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/utils/net_ads.c')
-rw-r--r--source3/utils/net_ads.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 69d5b102d4..bb78ecbf12 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -915,7 +915,7 @@ static int net_ads_status(struct net_context *c, int argc, const char **argv)
return -1;
}
- rc = ads_find_machine_acct(ads, &res, global_myname());
+ rc = ads_find_machine_acct(ads, &res, lp_netbios_name());
if (!ADS_ERR_OK(rc)) {
d_fprintf(stderr, _("ads_find_machine_acct: %s\n"), ads_errstr(rc));
ads_destroy(&ads);
@@ -923,7 +923,7 @@ static int net_ads_status(struct net_context *c, int argc, const char **argv)
}
if (ads_count_replies(ads, res) == 0) {
- d_fprintf(stderr, _("No machine account for '%s' found\n"), global_myname());
+ d_fprintf(stderr, _("No machine account for '%s' found\n"), lp_netbios_name());
ads_destroy(&ads);
return -1;
}
@@ -1100,10 +1100,10 @@ static WERROR check_ads_config( void )
return WERR_INVALID_DOMAIN_ROLE;
}
- if (strlen(global_myname()) > 15) {
+ if (strlen(lp_netbios_name()) > 15) {
d_printf(_("Our netbios name can be at most 15 chars long, "
- "\"%s\" is %u chars long\n"), global_myname(),
- (unsigned int)strlen(global_myname()));
+ "\"%s\" is %u chars long\n"), lp_netbios_name(),
+ (unsigned int)strlen(lp_netbios_name()));
return WERR_INVALID_COMPUTERNAME;
}
@@ -1244,7 +1244,7 @@ static NTSTATUS net_update_dns_ext(TALLOC_CTX *mem_ctx, ADS_STRUCT *ads,
if (hostname) {
fstrcpy(machine_name, hostname);
} else {
- name_to_fqdn( machine_name, global_myname() );
+ name_to_fqdn( machine_name, lp_netbios_name() );
}
strlower_m( machine_name );
@@ -1468,7 +1468,7 @@ int net_ads_join(struct net_context *c, int argc, const char **argv)
/* kinit with the machine password */
use_in_memory_ccache();
- if (asprintf( &ads_dns->auth.user_name, "%s$", global_myname()) == -1) {
+ if (asprintf( &ads_dns->auth.user_name, "%s$", lp_netbios_name()) == -1) {
goto fail;
}
ads_dns->auth.password = secrets_fetch_machine_password(
@@ -1756,7 +1756,7 @@ static int net_ads_printer_info(struct net_context *c, int argc, const char **ar
if (argc > 1) {
servername = argv[1];
} else {
- servername = global_myname();
+ servername = lp_netbios_name();
}
rc = ads_find_printer_on_server(ads, &res, printername, servername);
@@ -1819,14 +1819,14 @@ static int net_ads_printer_publish(struct net_context *c, int argc, const char *
if (argc == 2) {
servername = argv[1];
} else {
- servername = global_myname();
+ servername = lp_netbios_name();
}
/* Get printer data from SPOOLSS */
resolve_name(servername, &server_ss, 0x20, false);
- nt_status = cli_full_connection(&cli, global_myname(), servername,
+ nt_status = cli_full_connection(&cli, lp_netbios_name(), servername,
&server_ss, 0,
"IPC$", "IPC",
c->opt_user_name, c->opt_workgroup,
@@ -1942,7 +1942,7 @@ static int net_ads_printer_remove(struct net_context *c, int argc, const char **
if (argc > 1) {
servername = argv[1];
} else {
- servername = global_myname();
+ servername = lp_netbios_name();
}
rc = ads_find_printer_on_server(ads, &res, argv[0], servername);
@@ -2135,7 +2135,7 @@ int net_ads_changetrustpw(struct net_context *c, int argc, const char **argv)
return -1;
}
- fstrcpy(my_name, global_myname());
+ fstrcpy(my_name, lp_netbios_name());
strlower_m(my_name);
if (asprintf(&host_principal, "%s$@%s", my_name, ads->config.realm) == -1) {
ads_destroy(&ads);