summaryrefslogtreecommitdiff
path: root/source3/smbd/change_trust_pw.c
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-09-11 07:34:44 +0000
committerTim Potter <tpot@samba.org>2003-09-11 07:34:44 +0000
commit95bfe31c1f4fda39195fcc2fea0648c277a0e49d (patch)
treefea2a1d639de339db5fdc92d915ea7e8e693379a /source3/smbd/change_trust_pw.c
parent5cb04291390ccc369855449806778508d0c62ed9 (diff)
downloadsamba-95bfe31c1f4fda39195fcc2fea0648c277a0e49d.tar.gz
samba-95bfe31c1f4fda39195fcc2fea0648c277a0e49d.tar.bz2
samba-95bfe31c1f4fda39195fcc2fea0648c277a0e49d.zip
Merge from samba-3.0:
>Fix for bug #273 - smbd crash on machine account change. >Someone only half changed the code to use dc_name >instead of remote machine... Found via back trace from Dariush Forouher ><dariush@forouher.de>. >Jeremy. (This used to be commit 1956478ddece5899ebdf627969136603e1c21637)
Diffstat (limited to 'source3/smbd/change_trust_pw.c')
-rw-r--r--source3/smbd/change_trust_pw.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/source3/smbd/change_trust_pw.c b/source3/smbd/change_trust_pw.c
index 80c9fcb258..1178400e4d 100644
--- a/source3/smbd/change_trust_pw.c
+++ b/source3/smbd/change_trust_pw.c
@@ -48,22 +48,20 @@ NTSTATUS change_trust_account_password( const char *domain, const char *remote_m
if ( !name_status_find( domain, 0x1b, 0x20, pdc_ip, dc_name) )
goto failed;
- }
- /* supoport old deprecated "smbpasswd -j DOMAIN -r MACHINE" behavior */
- else {
+ } else {
+ /* supoport old deprecated "smbpasswd -j DOMAIN -r MACHINE" behavior */
fstrcpy( dc_name, remote_machine );
}
/* if this next call fails, then give up. We can't do
password changes on BDC's --jerry */
- if (!NT_STATUS_IS_OK(cli_full_connection(&cli, global_myname(), remote_machine,
+ if (!NT_STATUS_IS_OK(cli_full_connection(&cli, global_myname(), dc_name,
NULL, 0,
"IPC$", "IPC",
"", "",
- "", 0, Undefined, NULL)))
- {
- DEBUG(0,("modify_trust_password: Connection to %s failed!\n", remote_machine));
+ "", 0, Undefined, NULL))) {
+ DEBUG(0,("modify_trust_password: Connection to %s failed!\n", dc_name));
nt_status = NT_STATUS_UNSUCCESSFUL;
goto failed;
}
@@ -75,7 +73,7 @@ NTSTATUS change_trust_account_password( const char *domain, const char *remote_m
if(cli_nt_session_open(cli, PI_NETLOGON) == False) {
DEBUG(0,("modify_trust_password: unable to open the domain client session to machine %s. Error was : %s.\n",
- remote_machine, cli_errstr(cli)));
+ dc_name, cli_errstr(cli)));
cli_nt_session_close(cli);
cli_ulogoff(cli);
cli_shutdown(cli);
@@ -83,8 +81,7 @@ NTSTATUS change_trust_account_password( const char *domain, const char *remote_m
goto failed;
}
- nt_status = trust_pw_find_change_and_store_it(cli, cli->mem_ctx,
- domain);
+ nt_status = trust_pw_find_change_and_store_it(cli, cli->mem_ctx, domain);
cli_nt_session_close(cli);
cli_ulogoff(cli);