s4:rpc_server: pass the remote address to gensec_set_remote_address()
authorStefan Metzmacher <metze@samba.org>
Thu, 22 Jan 2015 13:05:15 +0000 (13:05 +0000)
committerStefan Metzmacher <metze@samba.org>
Mon, 26 Jan 2015 10:55:07 +0000 (11:55 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
source4/rpc_server/dcesrv_auth.c

index d3c317ba29826a07082cde74848f8ea9e9fa1305..d5aef49b35e95cf75ddc740f6ba5f5744b0ef1e0 100644 (file)
@@ -80,10 +80,24 @@ bool dcesrv_auth_bind(struct dcesrv_call_state *call)
                                           server_credentials,
                                           NULL,
                                           &auth->gensec_security);
+       if (!NT_STATUS_IS_OK(status)) {
+               DEBUG(1, ("Failed to call samba_server_gensec_start %s\n",
+                         nt_errstr(status)));
+               return false;
+       }
+
+       if (call->conn->remote_address != NULL) {
+               status = gensec_set_remote_address(auth->gensec_security,
+                                               call->conn->remote_address);
+               if (!NT_STATUS_IS_OK(status)) {
+                       DEBUG(1, ("Failed to call gensec_set_remote_address() %s\n",
+                                 nt_errstr(status)));
+                       return false;
+               }
+       }
 
        status = gensec_start_mech_by_authtype(auth->gensec_security, auth->auth_info->auth_type, 
                                               auth->auth_info->auth_level);
-
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(3, ("Failed to start GENSEC mechanism for DCERPC server: auth_type=%d, auth_level=%d: %s\n",
                          (int)auth->auth_info->auth_type,