Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source4/rpc_server/common/common.h

    r414 r745  
    2525
    2626struct share_config;
     27struct dcesrv_connection;
    2728struct dcesrv_context;
    2829struct dcesrv_context;
     30struct dcesrv_call_state;
     31struct ndr_interface_table;
     32struct ncacn_packet;
    2933
    3034struct dcerpc_server_info {
     
    3539};
    3640
    37 struct ndr_interface_table;
    38 struct dcesrv_call_state;
    3941#include "rpc_server/common/proto.h"
    4042
  • trunk/server/source4/rpc_server/common/forward.c

    r414 r745  
    2121
    2222#include "includes.h"
     23#include <tevent.h>
    2324#include "rpc_server/dcerpc_server.h"
     25#include "librpc/gen_ndr/dcerpc.h"
     26#include "rpc_server/common/common.h"
    2427#include "messaging/irpc.h"
     28#include "auth/auth.h"
     29
    2530
    2631struct dcesrv_forward_state {
     
    3237  called when the forwarded rpc request is finished
    3338 */
    34 static void dcesrv_irpc_forward_callback(struct irpc_request *ireq)
     39static void dcesrv_irpc_forward_callback(struct tevent_req *subreq)
    3540{
    36         struct dcesrv_forward_state *st = talloc_get_type(ireq->async.private_data,
    37                                                           struct dcesrv_forward_state);
     41        struct dcesrv_forward_state *st =
     42                tevent_req_callback_data(subreq,
     43                struct dcesrv_forward_state);
    3844        const char *opname = st->opname;
    3945        NTSTATUS status;
    40         if (!NT_STATUS_IS_OK(ireq->status)) {
     46
     47        status = dcerpc_binding_handle_call_recv(subreq);
     48        TALLOC_FREE(subreq);
     49        if (!NT_STATUS_IS_OK(status)) {
    4150                DEBUG(0,("IRPC callback failed for %s - %s\n",
    42                          opname, nt_errstr(ireq->status)));
     51                         opname, nt_errstr(status)));
    4352                st->dce_call->fault_code = DCERPC_FAULT_CANT_PERFORM;
    4453        }
    45         talloc_free(ireq);
    4654        status = dcesrv_reply(st->dce_call);
    4755        if (!NT_STATUS_IS_OK(status)) {
     
    5361
    5462
    55 /*
    56   forward a RPC call using IRPC to another task
     63/**
     64 * Forward a RPC call using IRPC to another task
    5765 */
    5866void dcesrv_irpc_forward_rpc_call(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
    5967                                  void *r, uint32_t callid,
    6068                                  const struct ndr_interface_table *ndr_table,
    61                                   const char *dest_task, const char *opname)
     69                                  const char *dest_task, const char *opname,
     70                                  uint32_t timeout)
    6271{
    63         struct server_id *sid;
    64         struct irpc_request *ireq;
    6572        struct dcesrv_forward_state *st;
     73        struct dcerpc_binding_handle *binding_handle;
     74        struct tevent_req *subreq;
     75        struct security_token *token;
    6676
    6777        st = talloc(mem_ctx, struct dcesrv_forward_state);
     
    8393        }
    8494
    85         /* find the server task */
    86         sid = irpc_servers_byname(dce_call->msg_ctx, mem_ctx, dest_task);
    87         if (sid == NULL || sid[0].id == 0) {
    88                 DEBUG(0,("%s: Unable to find %s task\n", dest_task, opname));
     95        binding_handle = irpc_binding_handle_by_name(st, dce_call->msg_ctx,
     96                                                     dest_task, ndr_table);
     97        if (binding_handle == NULL) {
     98                DEBUG(0,("%s: Failed to forward request to %s task\n",
     99                         opname, dest_task));
    89100                dce_call->fault_code = DCERPC_FAULT_CANT_PERFORM;
    90101                return;
    91102        }
    92103
     104        /* reset timeout for the handle */
     105        dcerpc_binding_handle_set_timeout(binding_handle, timeout);
     106
     107        /* add security token to the handle*/
     108        token = dce_call->conn->auth_state.session_info->security_token;
     109        irpc_binding_handle_add_security_token(binding_handle, token);
     110
    93111        /* forward the call */
    94         ireq = irpc_call_send(dce_call->msg_ctx, sid[0], ndr_table, callid, r, mem_ctx);
    95         if (ireq == NULL) {
     112        subreq = dcerpc_binding_handle_call_send(st, dce_call->event_ctx,
     113                                                 binding_handle,
     114                                                 NULL, ndr_table,
     115                                                 callid,
     116                                                 dce_call, r);
     117        if (subreq == NULL) {
    96118                DEBUG(0,("%s: Failed to forward request to %s task\n",
    97119                         opname, dest_task));
     
    104126
    105127        /* setup the callback */
    106         ireq->async.fn = dcesrv_irpc_forward_callback;
    107         ireq->async.private_data = st;
     128        tevent_req_set_callback(subreq, dcesrv_irpc_forward_callback, st);
    108129}
  • trunk/server/source4/rpc_server/common/server_info.c

    r414 r745  
    2121
    2222#include "includes.h"
    23 #include "librpc/gen_ndr/ndr_srvsvc.h"
     23#include "librpc/gen_ndr/srvsvc.h"
    2424#include "rpc_server/dcerpc_server.h"
    2525#include "dsdb/samdb/samdb.h"
    2626#include "auth/auth.h"
    2727#include "param/param.h"
    28 #include "rpc_server/common/common.h"
    2928
    3029/*
     
    3736        enum srvsvc_PlatformId id;
    3837
    39         id = lp_parm_int(dce_ctx->lp_ctx, NULL, "server_info", "platform_id", PLATFORM_ID_NT);
     38        id = lpcfg_parm_int(dce_ctx->lp_ctx, NULL, "server_info", "platform_id", PLATFORM_ID_NT);
    4039
    4140        return id;
     
    4847        /* if there's no string return our NETBIOS name */
    4948        if (!p) {
    50                 return talloc_strdup(mem_ctx, lp_netbios_name(dce_ctx->lp_ctx));
     49                return talloc_strdup(mem_ctx, lpcfg_netbios_name(dce_ctx->lp_ctx));
    5150        }
    5251
     
    6867        default_server_announce |= SV_TYPE_SERVER_UNIX;
    6968
    70         switch (lp_announce_as(dce_ctx->lp_ctx)) {
     69        switch (lpcfg_announce_as(dce_ctx->lp_ctx)) {
    7170                case ANNOUNCE_AS_NT_SERVER:
    7271                        default_server_announce |= SV_TYPE_SERVER_NT;
     
    8584        }
    8685
    87         switch (lp_server_role(dce_ctx->lp_ctx)) {
     86        switch (lpcfg_server_role(dce_ctx->lp_ctx)) {
    8887                case ROLE_DOMAIN_MEMBER:
    8988                        default_server_announce |= SV_TYPE_DOMAIN_MEMBER;
     
    9796                        }
    9897                        /* open main ldb */
    99                         samctx = samdb_connect(tmp_ctx, event_ctx, dce_ctx->lp_ctx, anonymous_session(tmp_ctx, event_ctx, dce_ctx->lp_ctx));
     98                        samctx = samdb_connect(tmp_ctx, event_ctx, dce_ctx->lp_ctx, anonymous_session(tmp_ctx, dce_ctx->lp_ctx), 0);
    10099                        if (samctx == NULL) {
    101100                                DEBUG(2,("Unable to open samdb in determining server announce flags\n"));
     
    117116                        break;
    118117        }
    119         if (lp_time_server(dce_ctx->lp_ctx))
     118        if (lpcfg_time_server(dce_ctx->lp_ctx))
    120119                default_server_announce |= SV_TYPE_TIME_SOURCE;
    121120
    122         if (lp_host_msdfs(dce_ctx->lp_ctx))
     121        if (lpcfg_host_msdfs(dce_ctx->lp_ctx))
    123122                default_server_announce |= SV_TYPE_DFS_SERVER;
    124123
Note: See TracChangeset for help on using the changeset viewer.