summaryrefslogtreecommitdiff
path: root/source3/winbindd/winbindd_samr.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2014-05-16 18:10:23 +1200
committerAndrew Bartlett <abartlet@samba.org>2014-06-11 10:18:26 +0200
commit2e961bf598e58178ce0d4ed5e35553acd882e436 (patch)
tree337771214caf5b77e926e36022249d9fce96d3c0 /source3/winbindd/winbindd_samr.c
parent791c38282d681c60eaedb47803b9043991f5950d (diff)
downloadsamba-2e961bf598e58178ce0d4ed5e35553acd882e436.tar.gz
winbindd: Call set_dc_type_and_flags on the internal domain
This allows the AD DC to be picked up correctly and gives the correct DNS name. To ensure no confusion, we also always init it with the full DNS name. It also means that, aside from the BUILTIN domain the initialized flag is set only in one place, which will help when we add more details to the domain structure in the future. This in turn allows kerberos authentication against winbindd on the AD DC. Andrew Bartlett Change-Id: Idc829cfe5f2e867c87107b49275b17f294821dcd Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/winbindd/winbindd_samr.c')
-rw-r--r--source3/winbindd/winbindd_samr.c91
1 files changed, 2 insertions, 89 deletions
diff --git a/source3/winbindd/winbindd_samr.c b/source3/winbindd/winbindd_samr.c
index 8a717008086..888ce648a4e 100644
--- a/source3/winbindd/winbindd_samr.c
+++ b/source3/winbindd/winbindd_samr.c
@@ -39,50 +39,6 @@
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND
-static NTSTATUS open_internal_samr_pipe(TALLOC_CTX *mem_ctx,
- struct rpc_pipe_client **samr_pipe)
-{
- struct rpc_pipe_client *cli = NULL;
- struct auth_session_info *session_info = NULL;
- NTSTATUS status;
-
- status = make_session_info_system(mem_ctx, &session_info);
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0, ("open_samr_pipe: Could not create auth_session_info: %s\n",
- nt_errstr(status)));
- return status;
- }
-
- /* create a samr connection */
- if (lp_parm_bool(-1, "winbindd", "use external pipes", false)) {
- status = rpc_pipe_open_interface(mem_ctx,
- &ndr_table_samr,
- session_info,
- NULL,
- winbind_messaging_context(),
- &cli);
- } else {
- status = rpc_pipe_open_internal(mem_ctx,
- &ndr_table_samr.syntax_id,
- session_info,
- NULL,
- winbind_messaging_context(),
- &cli);
- }
-
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0, ("open_samr_pipe: Could not connect to samr_pipe: %s\n",
- nt_errstr(status)));
- return status;
- }
-
- if (samr_pipe) {
- *samr_pipe = cli;
- }
-
- return NT_STATUS_OK;
-}
-
NTSTATUS open_internal_samr_conn(TALLOC_CTX *mem_ctx,
struct winbindd_domain *domain,
struct rpc_pipe_client **samr_pipe,
@@ -92,7 +48,7 @@ NTSTATUS open_internal_samr_conn(TALLOC_CTX *mem_ctx,
struct policy_handle samr_connect_hnd;
struct dcerpc_binding_handle *b;
- status = open_internal_samr_pipe(mem_ctx, samr_pipe);
+ status = wb_open_internal_pipe(mem_ctx, &ndr_table_samr, samr_pipe);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -124,56 +80,13 @@ NTSTATUS open_internal_samr_conn(TALLOC_CTX *mem_ctx,
return result;
}
-static NTSTATUS open_internal_lsa_pipe(TALLOC_CTX *mem_ctx,
- struct rpc_pipe_client **lsa_pipe)
-{
- struct rpc_pipe_client *cli = NULL;
- struct auth_session_info *session_info = NULL;
- NTSTATUS status;
-
- status = make_session_info_system(mem_ctx, &session_info);
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0, ("open_lsa_pipe: Could not create auth_session_info: %s\n",
- nt_errstr(status)));
- return status;
- }
-
- /* create a lsa connection */
- if (lp_parm_bool(-1, "winbindd", "use external pipes", false)) {
- status = rpc_pipe_open_interface(mem_ctx,
- &ndr_table_lsarpc,
- session_info,
- NULL,
- winbind_messaging_context(),
- &cli);
- } else {
- status = rpc_pipe_open_internal(mem_ctx,
- &ndr_table_lsarpc.syntax_id,
- session_info,
- NULL,
- winbind_messaging_context(),
- &cli);
- }
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0, ("open_lsa_pipe: Could not connect to lsa_pipe: %s\n",
- nt_errstr(status)));
- return status;
- }
-
- if (lsa_pipe) {
- *lsa_pipe = cli;
- }
-
- return NT_STATUS_OK;
-}
-
static NTSTATUS open_internal_lsa_conn(TALLOC_CTX *mem_ctx,
struct rpc_pipe_client **lsa_pipe,
struct policy_handle *lsa_hnd)
{
NTSTATUS status;
- status = open_internal_lsa_pipe(mem_ctx, lsa_pipe);
+ status = wb_open_internal_pipe(mem_ctx, &ndr_table_lsarpc, lsa_pipe);
if (!NT_STATUS_IS_OK(status)) {
return status;
}