summaryrefslogtreecommitdiff
path: root/source3/utils/net_ads.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils/net_ads.c')
-rw-r--r--source3/utils/net_ads.c28
1 files changed, 5 insertions, 23 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 91f82a5dbe..71b7a0802f 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -124,7 +124,6 @@ static ADS_STRUCT *ads_startup(void)
ADS_STATUS status;
BOOL need_password = False;
BOOL second_time = False;
- char *realm;
ads = ads_init(NULL, NULL, opt_host);
@@ -151,16 +150,6 @@ retry:
ads->auth.user_name = strdup(opt_user_name);
- /*
- * If the username is of the form "name@realm",
- * extract the realm and convert to upper case.
- */
- if ((realm = strchr(ads->auth.user_name, '@'))) {
- *realm++ = '\0';
- ads->auth.realm = strdup(realm);
- strupper(ads->auth.realm);
- }
-
status = ads_connect(ads);
if (!ADS_ERR_OK(status)) {
if (!need_password && !second_time) {
@@ -575,7 +564,7 @@ static int net_ads_leave(int argc, const char **argv)
if (!opt_password) {
char *user_name;
asprintf(&user_name, "%s$", global_myname());
- opt_password = secrets_fetch_machine_password(opt_target_workgroup, NULL, NULL);
+ opt_password = secrets_fetch_machine_password();
opt_user_name = user_name;
}
@@ -607,7 +596,7 @@ static int net_ads_join_ok(void)
asprintf(&user_name, "%s$", global_myname());
opt_user_name = user_name;
- opt_password = secrets_fetch_machine_password(opt_target_workgroup, NULL, NULL);
+ opt_password = secrets_fetch_machine_password();
if (!(ads = ads_startup())) {
return -1;
@@ -648,8 +637,6 @@ int net_ads_join(int argc, const char **argv)
void *res;
DOM_SID dom_sid;
char *ou_str;
- uint32 sec_channel_type;
- uint32 account_type = UF_WORKSTATION_TRUST_ACCOUNT;
if (argc > 0) org_unit = argv[0];
@@ -658,11 +645,6 @@ int net_ads_join(int argc, const char **argv)
return -1;
}
- /* check what type of join
- TODO: make this variable like RPC
- */
- account_type = UF_WORKSTATION_TRUST_ACCOUNT;
-
tmp_password = generate_random_str(DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
password = strdup(tmp_password);
@@ -687,7 +669,7 @@ int net_ads_join(int argc, const char **argv)
return -1;
}
- rc = ads_join_realm(ads, global_myname(), account_type, org_unit);
+ rc = ads_join_realm(ads, global_myname(), org_unit);
if (!ADS_ERR_OK(rc)) {
d_printf("ads_join_realm: %s\n", ads_errstr(rc));
return -1;
@@ -710,7 +692,7 @@ int net_ads_join(int argc, const char **argv)
return -1;
}
- if (!secrets_store_machine_password(password, lp_workgroup(), sec_channel_type)) {
+ if (!secrets_store_machine_password(password)) {
DEBUG(1,("Failed to save machine password\n"));
return -1;
}
@@ -963,7 +945,7 @@ int net_ads_changetrustpw(int argc, const char **argv)
asprintf(&user_name, "%s$", global_myname());
opt_user_name = user_name;
- opt_password = secrets_fetch_machine_password(opt_target_workgroup, NULL, NULL);
+ opt_password = secrets_fetch_machine_password();
use_in_memory_ccache();