r10488: (Missing file from previous commit, adding a new RPC-JOIN test)
This is a merge of Brad Henry's 'net join' rework, to better perform
an ADS join, particularly as a DC. This represents the bulk of his
Google SOC work, and I'm very pleased to intergrate it into the tree.
(Metze will intergrate the DRSUAPI work later).
Both metze and myself have also put a lot of time into this patch, and
in mentoring Brad in general. In return, Brad has been a very good
student, and has taken the comments well.
Since it's last appearance on samba-technical@, I have made
correctness and valgrind fixups, as well as adding a new 'BINDING'
mode to the libnet_rpc routines. This allows the exact binding string
to be passed down from the torture code, including options and exact
target host.
(This used to be commit ab20533e7db9e64c8fb5e7f971ab5d3a040e00ab)
2005-09-25 16:38:07 +04:00
# include "includes.h"
# include "libnet/libnet.h"
2006-11-24 18:56:18 +03:00
# include "libcli/libcli.h"
r10488: (Missing file from previous commit, adding a new RPC-JOIN test)
This is a merge of Brad Henry's 'net join' rework, to better perform
an ADS join, particularly as a DC. This represents the bulk of his
Google SOC work, and I'm very pleased to intergrate it into the tree.
(Metze will intergrate the DRSUAPI work later).
Both metze and myself have also put a lot of time into this patch, and
in mentoring Brad in general. In return, Brad has been a very good
student, and has taken the comments well.
Since it's last appearance on samba-technical@, I have made
correctness and valgrind fixups, as well as adding a new 'BINDING'
mode to the libnet_rpc routines. This allows the exact binding string
to be passed down from the torture code, including options and exact
target host.
(This used to be commit ab20533e7db9e64c8fb5e7f971ab5d3a040e00ab)
2005-09-25 16:38:07 +04:00
2006-03-14 04:29:56 +03:00
# include "auth/credentials/credentials.h"
2006-03-14 18:02:05 +03:00
# include "torture/rpc/rpc.h"
2006-02-04 17:08:24 +03:00
2008-01-03 03:39:01 +03:00
# include "libcli/resolve/resolve.h"
2007-12-12 04:15:29 +03:00
# include "param/param.h"
r10488: (Missing file from previous commit, adding a new RPC-JOIN test)
This is a merge of Brad Henry's 'net join' rework, to better perform
an ADS join, particularly as a DC. This represents the bulk of his
Google SOC work, and I'm very pleased to intergrate it into the tree.
(Metze will intergrate the DRSUAPI work later).
Both metze and myself have also put a lot of time into this patch, and
in mentoring Brad in general. In return, Brad has been a very good
student, and has taken the comments well.
Since it's last appearance on samba-technical@, I have made
correctness and valgrind fixups, as well as adding a new 'BINDING'
mode to the libnet_rpc routines. This allows the exact binding string
to be passed down from the torture code, including options and exact
target host.
(This used to be commit ab20533e7db9e64c8fb5e7f971ab5d3a040e00ab)
2005-09-25 16:38:07 +04:00
# define TORTURE_NETBIOS_NAME "smbtorturejoin"
2007-10-07 02:28:14 +04:00
bool torture_rpc_join ( struct torture_context * torture )
2006-11-24 18:56:18 +03:00
{
NTSTATUS status ;
r10488: (Missing file from previous commit, adding a new RPC-JOIN test)
This is a merge of Brad Henry's 'net join' rework, to better perform
an ADS join, particularly as a DC. This represents the bulk of his
Google SOC work, and I'm very pleased to intergrate it into the tree.
(Metze will intergrate the DRSUAPI work later).
Both metze and myself have also put a lot of time into this patch, and
in mentoring Brad in general. In return, Brad has been a very good
student, and has taken the comments well.
Since it's last appearance on samba-technical@, I have made
correctness and valgrind fixups, as well as adding a new 'BINDING'
mode to the libnet_rpc routines. This allows the exact binding string
to be passed down from the torture code, including options and exact
target host.
(This used to be commit ab20533e7db9e64c8fb5e7f971ab5d3a040e00ab)
2005-09-25 16:38:07 +04:00
struct test_join * tj ;
2005-10-04 03:46:21 +04:00
struct cli_credentials * machine_account ;
2006-11-24 18:56:18 +03:00
struct smbcli_state * cli ;
2007-08-28 04:16:58 +04:00
const char * host = torture_setting_string ( torture , " host " , NULL ) ;
2008-01-04 02:22:12 +03:00
struct smbcli_options options ;
r10488: (Missing file from previous commit, adding a new RPC-JOIN test)
This is a merge of Brad Henry's 'net join' rework, to better perform
an ADS join, particularly as a DC. This represents the bulk of his
Google SOC work, and I'm very pleased to intergrate it into the tree.
(Metze will intergrate the DRSUAPI work later).
Both metze and myself have also put a lot of time into this patch, and
in mentoring Brad in general. In return, Brad has been a very good
student, and has taken the comments well.
Since it's last appearance on samba-technical@, I have made
correctness and valgrind fixups, as well as adding a new 'BINDING'
mode to the libnet_rpc routines. This allows the exact binding string
to be passed down from the torture code, including options and exact
target host.
(This used to be commit ab20533e7db9e64c8fb5e7f971ab5d3a040e00ab)
2005-09-25 16:38:07 +04:00
/* Join domain as a member server. */
2007-12-03 17:53:28 +03:00
tj = torture_join_domain ( torture ,
TORTURE_NETBIOS_NAME ,
r10488: (Missing file from previous commit, adding a new RPC-JOIN test)
This is a merge of Brad Henry's 'net join' rework, to better perform
an ADS join, particularly as a DC. This represents the bulk of his
Google SOC work, and I'm very pleased to intergrate it into the tree.
(Metze will intergrate the DRSUAPI work later).
Both metze and myself have also put a lot of time into this patch, and
in mentoring Brad in general. In return, Brad has been a very good
student, and has taken the comments well.
Since it's last appearance on samba-technical@, I have made
correctness and valgrind fixups, as well as adding a new 'BINDING'
mode to the libnet_rpc routines. This allows the exact binding string
to be passed down from the torture code, including options and exact
target host.
(This used to be commit ab20533e7db9e64c8fb5e7f971ab5d3a040e00ab)
2005-09-25 16:38:07 +04:00
ACB_WSTRUST ,
2005-10-04 03:46:21 +04:00
& machine_account ) ;
r10488: (Missing file from previous commit, adding a new RPC-JOIN test)
This is a merge of Brad Henry's 'net join' rework, to better perform
an ADS join, particularly as a DC. This represents the bulk of his
Google SOC work, and I'm very pleased to intergrate it into the tree.
(Metze will intergrate the DRSUAPI work later).
Both metze and myself have also put a lot of time into this patch, and
in mentoring Brad in general. In return, Brad has been a very good
student, and has taken the comments well.
Since it's last appearance on samba-technical@, I have made
correctness and valgrind fixups, as well as adding a new 'BINDING'
mode to the libnet_rpc routines. This allows the exact binding string
to be passed down from the torture code, including options and exact
target host.
(This used to be commit ab20533e7db9e64c8fb5e7f971ab5d3a040e00ab)
2005-09-25 16:38:07 +04:00
if ( ! tj ) {
2006-11-24 18:56:18 +03:00
DEBUG ( 0 , ( " %s failed to join domain as workstation \n " ,
r10488: (Missing file from previous commit, adding a new RPC-JOIN test)
This is a merge of Brad Henry's 'net join' rework, to better perform
an ADS join, particularly as a DC. This represents the bulk of his
Google SOC work, and I'm very pleased to intergrate it into the tree.
(Metze will intergrate the DRSUAPI work later).
Both metze and myself have also put a lot of time into this patch, and
in mentoring Brad in general. In return, Brad has been a very good
student, and has taken the comments well.
Since it's last appearance on samba-technical@, I have made
correctness and valgrind fixups, as well as adding a new 'BINDING'
mode to the libnet_rpc routines. This allows the exact binding string
to be passed down from the torture code, including options and exact
target host.
(This used to be commit ab20533e7db9e64c8fb5e7f971ab5d3a040e00ab)
2005-09-25 16:38:07 +04:00
TORTURE_NETBIOS_NAME ) ) ;
2007-10-07 02:28:14 +04:00
return false ;
r10488: (Missing file from previous commit, adding a new RPC-JOIN test)
This is a merge of Brad Henry's 'net join' rework, to better perform
an ADS join, particularly as a DC. This represents the bulk of his
Google SOC work, and I'm very pleased to intergrate it into the tree.
(Metze will intergrate the DRSUAPI work later).
Both metze and myself have also put a lot of time into this patch, and
in mentoring Brad in general. In return, Brad has been a very good
student, and has taken the comments well.
Since it's last appearance on samba-technical@, I have made
correctness and valgrind fixups, as well as adding a new 'BINDING'
mode to the libnet_rpc routines. This allows the exact binding string
to be passed down from the torture code, including options and exact
target host.
(This used to be commit ab20533e7db9e64c8fb5e7f971ab5d3a040e00ab)
2005-09-25 16:38:07 +04:00
}
2006-11-24 18:56:18 +03:00
2008-01-04 02:22:12 +03:00
lp_smbcli_options ( torture - > lp_ctx , & options ) ;
2006-11-24 18:56:18 +03:00
status = smbcli_full_connection ( tj , & cli , host ,
2007-12-12 04:15:29 +03:00
lp_smb_ports ( torture - > lp_ctx ) ,
2006-11-24 18:56:18 +03:00
" IPC$ " , NULL ,
machine_account ,
2008-01-03 03:39:01 +03:00
lp_resolve_context ( torture - > lp_ctx ) ,
2008-04-22 01:58:23 +04:00
torture - > ev , & options ) ;
2006-11-24 18:56:18 +03:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
DEBUG ( 0 , ( " %s failed to connect to IPC$ with workstation credentials \n " ,
TORTURE_NETBIOS_NAME ) ) ;
2007-10-07 02:28:14 +04:00
return false ;
2006-11-24 18:56:18 +03:00
}
smbcli_tdis ( cli ) ;
r10488: (Missing file from previous commit, adding a new RPC-JOIN test)
This is a merge of Brad Henry's 'net join' rework, to better perform
an ADS join, particularly as a DC. This represents the bulk of his
Google SOC work, and I'm very pleased to intergrate it into the tree.
(Metze will intergrate the DRSUAPI work later).
Both metze and myself have also put a lot of time into this patch, and
in mentoring Brad in general. In return, Brad has been a very good
student, and has taken the comments well.
Since it's last appearance on samba-technical@, I have made
correctness and valgrind fixups, as well as adding a new 'BINDING'
mode to the libnet_rpc routines. This allows the exact binding string
to be passed down from the torture code, including options and exact
target host.
(This used to be commit ab20533e7db9e64c8fb5e7f971ab5d3a040e00ab)
2005-09-25 16:38:07 +04:00
/* Leave domain. */
2008-06-14 19:24:17 +04:00
torture_leave_domain ( torture , tj ) ;
r10488: (Missing file from previous commit, adding a new RPC-JOIN test)
This is a merge of Brad Henry's 'net join' rework, to better perform
an ADS join, particularly as a DC. This represents the bulk of his
Google SOC work, and I'm very pleased to intergrate it into the tree.
(Metze will intergrate the DRSUAPI work later).
Both metze and myself have also put a lot of time into this patch, and
in mentoring Brad in general. In return, Brad has been a very good
student, and has taken the comments well.
Since it's last appearance on samba-technical@, I have made
correctness and valgrind fixups, as well as adding a new 'BINDING'
mode to the libnet_rpc routines. This allows the exact binding string
to be passed down from the torture code, including options and exact
target host.
(This used to be commit ab20533e7db9e64c8fb5e7f971ab5d3a040e00ab)
2005-09-25 16:38:07 +04:00
/* Join domain as a domain controller. */
2007-12-03 17:53:28 +03:00
tj = torture_join_domain ( torture , TORTURE_NETBIOS_NAME ,
r10488: (Missing file from previous commit, adding a new RPC-JOIN test)
This is a merge of Brad Henry's 'net join' rework, to better perform
an ADS join, particularly as a DC. This represents the bulk of his
Google SOC work, and I'm very pleased to intergrate it into the tree.
(Metze will intergrate the DRSUAPI work later).
Both metze and myself have also put a lot of time into this patch, and
in mentoring Brad in general. In return, Brad has been a very good
student, and has taken the comments well.
Since it's last appearance on samba-technical@, I have made
correctness and valgrind fixups, as well as adding a new 'BINDING'
mode to the libnet_rpc routines. This allows the exact binding string
to be passed down from the torture code, including options and exact
target host.
(This used to be commit ab20533e7db9e64c8fb5e7f971ab5d3a040e00ab)
2005-09-25 16:38:07 +04:00
ACB_SVRTRUST ,
2005-10-04 03:46:21 +04:00
& machine_account ) ;
r10488: (Missing file from previous commit, adding a new RPC-JOIN test)
This is a merge of Brad Henry's 'net join' rework, to better perform
an ADS join, particularly as a DC. This represents the bulk of his
Google SOC work, and I'm very pleased to intergrate it into the tree.
(Metze will intergrate the DRSUAPI work later).
Both metze and myself have also put a lot of time into this patch, and
in mentoring Brad in general. In return, Brad has been a very good
student, and has taken the comments well.
Since it's last appearance on samba-technical@, I have made
correctness and valgrind fixups, as well as adding a new 'BINDING'
mode to the libnet_rpc routines. This allows the exact binding string
to be passed down from the torture code, including options and exact
target host.
(This used to be commit ab20533e7db9e64c8fb5e7f971ab5d3a040e00ab)
2005-09-25 16:38:07 +04:00
if ( ! tj ) {
2006-11-24 18:56:18 +03:00
DEBUG ( 0 , ( " %s failed to join domain as domain controller \n " ,
2005-10-04 03:46:21 +04:00
TORTURE_NETBIOS_NAME ) ) ;
2007-10-07 02:28:14 +04:00
return false ;
r10488: (Missing file from previous commit, adding a new RPC-JOIN test)
This is a merge of Brad Henry's 'net join' rework, to better perform
an ADS join, particularly as a DC. This represents the bulk of his
Google SOC work, and I'm very pleased to intergrate it into the tree.
(Metze will intergrate the DRSUAPI work later).
Both metze and myself have also put a lot of time into this patch, and
in mentoring Brad in general. In return, Brad has been a very good
student, and has taken the comments well.
Since it's last appearance on samba-technical@, I have made
correctness and valgrind fixups, as well as adding a new 'BINDING'
mode to the libnet_rpc routines. This allows the exact binding string
to be passed down from the torture code, including options and exact
target host.
(This used to be commit ab20533e7db9e64c8fb5e7f971ab5d3a040e00ab)
2005-09-25 16:38:07 +04:00
}
2006-11-24 18:56:18 +03:00
status = smbcli_full_connection ( tj , & cli , host ,
2007-12-12 04:15:29 +03:00
lp_smb_ports ( torture - > lp_ctx ) ,
2006-11-24 18:56:18 +03:00
" IPC$ " , NULL ,
machine_account ,
2008-01-03 03:39:01 +03:00
lp_resolve_context ( torture - > lp_ctx ) ,
2008-04-22 01:58:23 +04:00
torture - > ev , & options ) ;
2006-11-24 18:56:18 +03:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
DEBUG ( 0 , ( " %s failed to connect to IPC$ with workstation credentials \n " ,
TORTURE_NETBIOS_NAME ) ) ;
2007-10-07 02:28:14 +04:00
return false ;
2006-11-24 18:56:18 +03:00
}
smbcli_tdis ( cli ) ;
r10488: (Missing file from previous commit, adding a new RPC-JOIN test)
This is a merge of Brad Henry's 'net join' rework, to better perform
an ADS join, particularly as a DC. This represents the bulk of his
Google SOC work, and I'm very pleased to intergrate it into the tree.
(Metze will intergrate the DRSUAPI work later).
Both metze and myself have also put a lot of time into this patch, and
in mentoring Brad in general. In return, Brad has been a very good
student, and has taken the comments well.
Since it's last appearance on samba-technical@, I have made
correctness and valgrind fixups, as well as adding a new 'BINDING'
mode to the libnet_rpc routines. This allows the exact binding string
to be passed down from the torture code, including options and exact
target host.
(This used to be commit ab20533e7db9e64c8fb5e7f971ab5d3a040e00ab)
2005-09-25 16:38:07 +04:00
/* Leave domain. */
2008-06-14 19:24:17 +04:00
torture_leave_domain ( torture , tj ) ;
r10488: (Missing file from previous commit, adding a new RPC-JOIN test)
This is a merge of Brad Henry's 'net join' rework, to better perform
an ADS join, particularly as a DC. This represents the bulk of his
Google SOC work, and I'm very pleased to intergrate it into the tree.
(Metze will intergrate the DRSUAPI work later).
Both metze and myself have also put a lot of time into this patch, and
in mentoring Brad in general. In return, Brad has been a very good
student, and has taken the comments well.
Since it's last appearance on samba-technical@, I have made
correctness and valgrind fixups, as well as adding a new 'BINDING'
mode to the libnet_rpc routines. This allows the exact binding string
to be passed down from the torture code, including options and exact
target host.
(This used to be commit ab20533e7db9e64c8fb5e7f971ab5d3a040e00ab)
2005-09-25 16:38:07 +04:00
2007-10-07 02:28:14 +04:00
return true ;
r10488: (Missing file from previous commit, adding a new RPC-JOIN test)
This is a merge of Brad Henry's 'net join' rework, to better perform
an ADS join, particularly as a DC. This represents the bulk of his
Google SOC work, and I'm very pleased to intergrate it into the tree.
(Metze will intergrate the DRSUAPI work later).
Both metze and myself have also put a lot of time into this patch, and
in mentoring Brad in general. In return, Brad has been a very good
student, and has taken the comments well.
Since it's last appearance on samba-technical@, I have made
correctness and valgrind fixups, as well as adding a new 'BINDING'
mode to the libnet_rpc routines. This allows the exact binding string
to be passed down from the torture code, including options and exact
target host.
(This used to be commit ab20533e7db9e64c8fb5e7f971ab5d3a040e00ab)
2005-09-25 16:38:07 +04:00
}