rpc_server3: Remove pipes_struct->remote_address
[samba.git] / source3 / winbindd / winbindd_dual_srv.c
index 32d11e1fa57d327f33d1eb4fc34f96f3ee57be8c..cefd134f2c6ad322eb4248833a925af22b24a5b7 100644 (file)
@@ -25,6 +25,7 @@
 #include "winbindd/winbindd_proto.h"
 #include "rpc_client/cli_pipe.h"
 #include "ntdomain.h"
+#include "librpc/rpc/dcesrv_core.h"
 #include "librpc/gen_ndr/ndr_winbind.h"
 #include "librpc/gen_ndr/ndr_winbind_scompat.h"
 #include "../librpc/gen_ndr/ndr_netlogon_c.h"
@@ -930,6 +931,12 @@ reconnect:
 NTSTATUS _winbind_SamLogon(struct pipes_struct *p,
                        struct winbind_SamLogon *r)
 {
+       struct dcesrv_call_state *dce_call = p->dce_call;
+       struct dcesrv_connection *dcesrv_conn = dce_call->conn;
+       const struct tsocket_address *local_address =
+               dcesrv_connection_get_local_address(dcesrv_conn);
+       const struct tsocket_address *remote_address =
+               dcesrv_connection_get_remote_address(dcesrv_conn);
        struct winbindd_domain *domain;
        NTSTATUS status;
        struct netr_IdentityInfo *identity_info = NULL;
@@ -941,6 +948,13 @@ NTSTATUS _winbind_SamLogon(struct pipes_struct *p,
        union netr_Validation *validation = NULL;
        bool interactive = false;
 
+       /*
+        * Make sure we start with authoritative=true,
+        * it will only set to false if we don't know the
+        * domain.
+        */
+       r->out.authoritative = true;
+
        domain = wb_child_domain();
        if (domain == NULL) {
                return NT_STATUS_REQUEST_NOT_ACCEPTED;
@@ -1019,8 +1033,8 @@ NTSTATUS _winbind_SamLogon(struct pipes_struct *p,
                                       0,
                                       challenge,
                                       lm_response, nt_response,
-                                      p->remote_address,
-                                      p->local_address,
+                                      remote_address,
+                                      local_address,
                                       &r->out.authoritative,
                                       true, /* skip_sam */
                                       &flags,