mirror of
https://github.com/samba-team/samba.git
synced 2025-01-07 17:18:11 +03:00
099c3d5327
that is what most of the callers want anyway.
Remove and re-add the account for the torture case, rather than just
modify it.
Test with a user account (needs work to change the password).
Andrew Bartlett
(This used to be commit 38bebef024
)
44 lines
893 B
C
44 lines
893 B
C
#include "includes.h"
|
|
#include "lib/cmdline/popt_common.h"
|
|
#include "libnet/libnet.h"
|
|
#include "lib/ldb/include/ldb.h"
|
|
|
|
#define TORTURE_NETBIOS_NAME "smbtorturejoin"
|
|
|
|
|
|
BOOL torture_rpc_join(void)
|
|
{
|
|
struct test_join *tj;
|
|
struct cli_credentials *machine_account;
|
|
|
|
/* Join domain as a member server. */
|
|
tj = torture_join_domain(TORTURE_NETBIOS_NAME,
|
|
ACB_WSTRUST,
|
|
&machine_account);
|
|
|
|
if (!tj) {
|
|
DEBUG(0, ("%s failed to join domain\n",
|
|
TORTURE_NETBIOS_NAME));
|
|
return False;
|
|
}
|
|
|
|
/* Leave domain. */
|
|
torture_leave_domain(tj);
|
|
|
|
/* Join domain as a domain controller. */
|
|
tj = torture_join_domain(TORTURE_NETBIOS_NAME,
|
|
ACB_SVRTRUST,
|
|
&machine_account);
|
|
if (!tj) {
|
|
DEBUG(0, ("%s failed to join domain\n",
|
|
TORTURE_NETBIOS_NAME));
|
|
return False;
|
|
}
|
|
|
|
/* Leave domain. */
|
|
torture_leave_domain(tj);
|
|
|
|
return True;
|
|
}
|
|
|