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:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source3/rpcclient/cmd_drsuapi.c

    r414 r745  
    2121#include "includes.h"
    2222#include "rpcclient.h"
    23 #include "../librpc/gen_ndr/cli_drsuapi.h"
     23#include "../librpc/gen_ndr/ndr_drsuapi_c.h"
    2424
    2525static WERROR cracknames(struct rpc_pipe_client *cli,
     
    3535        WERROR werr;
    3636        int i;
    37         int32_t level = 1;
     37        uint32_t level = 1;
    3838        union drsuapi_DsNameRequest req;
    39         int32_t level_out;
     39        uint32_t level_out;
    4040        struct drsuapi_DsNameString *names;
     41        struct dcerpc_binding_handle *b = cli->binding_handle;
    4142
    4243        names = TALLOC_ZERO_ARRAY(mem_ctx, struct drsuapi_DsNameString, argc);
     
    5556        req.req1.format_desired = format_desired;
    5657
    57         status = rpccli_drsuapi_DsCrackNames(cli, mem_ctx,
     58        status = dcerpc_drsuapi_DsCrackNames(b, mem_ctx,
    5859                                             bind_handle,
    5960                                             level,
     
    8384        struct GUID bind_guid;
    8485        struct policy_handle bind_handle;
     86        struct dcerpc_binding_handle *b = cli->binding_handle;
    8587
    8688        union drsuapi_DsNameCtr ctr;
     
    9395        GUID_from_string(DRSUAPI_DS_BIND_GUID, &bind_guid);
    9496
    95         status = rpccli_drsuapi_DsBind(cli, mem_ctx,
     97        status = dcerpc_drsuapi_DsBind(b, mem_ctx,
    9698                                       &bind_guid,
    9799                                       NULL,
     
    101103        if (!NT_STATUS_IS_OK(status)) {
    102104                return ntstatus_to_werror(status);
     105        }
     106
     107        if (!W_ERROR_IS_OK(werr)) {
     108                return werr;
    103109        }
    104110
     
    126132 out:
    127133        if (is_valid_policy_hnd(&bind_handle)) {
    128                 rpccli_drsuapi_DsUnbind(cli, mem_ctx, &bind_handle, &werr);
     134                WERROR _werr;
     135                dcerpc_drsuapi_DsUnbind(b, mem_ctx, &bind_handle, &_werr);
    129136        }
    130137
     
    235242        struct GUID bind_guid;
    236243        struct policy_handle bind_handle;
     244        struct dcerpc_binding_handle *b = cli->binding_handle;
    237245
    238246        const char *domain = NULL;
     
    254262        GUID_from_string(DRSUAPI_DS_BIND_GUID, &bind_guid);
    255263
    256         status = rpccli_drsuapi_DsBind(cli, mem_ctx,
     264        status = dcerpc_drsuapi_DsBind(b, mem_ctx,
    257265                                       &bind_guid,
    258266                                       NULL,
     
    264272        }
    265273
     274        if (!W_ERROR_IS_OK(werr)) {
     275                return werr;
     276        }
     277
    266278        req.req1.domain_name = domain;
    267279        req.req1.level = level;
    268280
    269         status = rpccli_drsuapi_DsGetDomainControllerInfo(cli, mem_ctx,
     281        status = dcerpc_drsuapi_DsGetDomainControllerInfo(b, mem_ctx,
    270282                                                          &bind_handle,
    271283                                                          1,
     
    286298 out:
    287299        if (is_valid_policy_hnd(&bind_handle)) {
    288                 rpccli_drsuapi_DsUnbind(cli, mem_ctx, &bind_handle, &werr);
     300                WERROR _werr;
     301                dcerpc_drsuapi_DsUnbind(b, mem_ctx, &bind_handle, &_werr);
    289302        }
    290303
     
    300313
    301314        struct policy_handle bind_handle;
     315        struct dcerpc_binding_handle *b = cli->binding_handle;
    302316
    303317        struct GUID bind_guid;
     
    309323        DATA_BLOB session_key;
    310324
    311         int32_t level = 8;
     325        uint32_t level = 8;
    312326        bool single = false;
    313         int32_t level_out = 0;
     327        uint32_t level_out = 0;
    314328        union drsuapi_DsGetNCChangesRequest req;
    315329        union drsuapi_DsGetNCChangesCtr ctr;
     
    319333        struct drsuapi_DsGetNCChangesCtr1 *ctr1 = NULL;
    320334        struct drsuapi_DsGetNCChangesCtr6 *ctr6 = NULL;
    321         int32_t out_level = 0;
     335        uint32_t out_level = 0;
    322336        int y;
    323337
    324338        uint32_t supported_extensions = 0;
    325         uint32_t replica_flags  = DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE |
    326                                   DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP |
    327                                   DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS |
    328                                   DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS |
    329                                   DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED;
     339        uint32_t replica_flags  = DRSUAPI_DRS_WRIT_REP |
     340                                  DRSUAPI_DRS_INIT_SYNC |
     341                                  DRSUAPI_DRS_PER_SYNC |
     342                                  DRSUAPI_DRS_GET_ANC |
     343                                  DRSUAPI_DRS_NEVER_SYNCED;
    330344
    331345        if (argc > 3) {
     
    389403        bind_info.info.info28 = info28;
    390404
    391         status = rpccli_drsuapi_DsBind(cli, mem_ctx,
     405        status = dcerpc_drsuapi_DsBind(b, mem_ctx,
    392406                                       &bind_guid,
    393407                                       &bind_info,
     
    476490                }
    477491
    478                 status = rpccli_drsuapi_DsGetNCChanges(cli, mem_ctx,
     492                status = dcerpc_drsuapi_DsGetNCChanges(b, mem_ctx,
    479493                                                       &bind_handle,
    480494                                                       level,
     
    484498                                                       &werr);
    485499                if (!NT_STATUS_IS_OK(status)) {
     500                        werr = ntstatus_to_werror(status);
     501                        printf("Failed to get NC Changes: %s",
     502                                get_friendly_nt_error_msg(status));
     503                        goto out;
     504                }
     505
     506                if (!W_ERROR_IS_OK(werr)) {
    486507                        printf("Failed to get NC Changes: %s",
    487508                                get_friendly_werror_msg(werr));
    488                         goto out;
    489                 }
    490 
    491                 if (!W_ERROR_IS_OK(werr)) {
    492                         status = werror_to_ntstatus(werr);
    493509                        goto out;
    494510                }
Note: See TracChangeset for help on using the changeset viewer.