summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-09-11 07:33:05 +0000
committerTim Potter <tpot@samba.org>2003-09-11 07:33:05 +0000
commit5cb04291390ccc369855449806778508d0c62ed9 (patch)
treeaca93c4144aeda92f0046e19b2e3bee129ea6eb4 /source3/utils
parent0788e30fe18901df92a497a9ceddb898cd3d07b9 (diff)
downloadsamba-5cb04291390ccc369855449806778508d0c62ed9.tar.gz
samba-5cb04291390ccc369855449806778508d0c62ed9.tar.bz2
samba-5cb04291390ccc369855449806778508d0c62ed9.zip
Merge from samba-3.0:
>Revision 1.8.2.33 >Fix error return path memory leaks in vampire code for creating users. > >Display an error if we can't create a posix account for the user >(e.g no add user/machine script was specified; bug #323). >Revision 1.8.2.32: >Use opt_target_workgroup instead of lp_workgroup() in vampire code so >we can override the value in smb.conf with the -w option. > >Migrating accounts from another domain can now be done like: > ># bin/net join bdc -w nt4dom -Uadministrator%password ># bin/net rpc vampire -w nt4dom -U administrator%password (This used to be commit 36f7d88edd15bff1b7dfa78f3908dae272b96215)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rpc_samsync.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source3/utils/net_rpc_samsync.c b/source3/utils/net_rpc_samsync.c
index ed69f8a326..64f2d3f68f 100644
--- a/source3/utils/net_rpc_samsync.c
+++ b/source3/utils/net_rpc_samsync.c
@@ -428,9 +428,10 @@ static NTSTATUS fetch_account_info(uint32 rid, SAM_ACCOUNT_INFO *delta)
(delta->acb_info & ACB_DOMTRUST) ) {
pstrcpy(add_script, lp_addmachine_script());
} else {
- *add_script = '\0';
DEBUG(1, ("Unknown user type: %s\n",
smbpasswd_encode_acb_info(delta->acb_info)));
+ nt_ret = NT_STATUS_UNSUCCESSFUL;
+ goto done;
}
if (*add_script) {
int add_ret;
@@ -448,8 +449,11 @@ static NTSTATUS fetch_account_info(uint32 rid, SAM_ACCOUNT_INFO *delta)
}
/* try and find the possible unix account again */
- if ( !(passwd = Get_Pwnam(account)) )
- return NT_STATUS_NO_SUCH_USER;
+ if ( !(passwd = Get_Pwnam(account)) ) {
+ d_printf("Could not create posix account info for '%s'\n", account);
+ nt_ret = NT_STATUS_NO_SUCH_USER;
+ goto done;
+ }
}
@@ -499,6 +503,7 @@ static NTSTATUS fetch_account_info(uint32 rid, SAM_ACCOUNT_INFO *delta)
pdb_get_username(sam_account)));
}
+ done:
pdb_free_sam(&sam_account);
return nt_ret;
}
@@ -1034,7 +1039,7 @@ int rpc_vampire(int argc, const char **argv)
goto fail;
}
- if (!secrets_fetch_trust_account_password(lp_workgroup(),
+ if (!secrets_fetch_trust_account_password(opt_target_workgroup,
trust_password, NULL,
&sec_channel)) {
d_printf("Could not retrieve domain trust secret\n");
@@ -1056,7 +1061,7 @@ int rpc_vampire(int argc, const char **argv)
nt_errstr(result));
if (NT_STATUS_EQUAL(result, NT_STATUS_NOT_SUPPORTED))
d_printf("Perhaps %s is a Windows 2000 native mode "
- "domain?\n", lp_workgroup());
+ "domain?\n", opt_target_workgroup);
goto fail;
}