Ignore:
Timestamp:
Nov 24, 2016, 1:14:11 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.3

Location:
vendor/current/source4/cluster
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source4/cluster/cluster.c

    r740 r988  
    2424#include "cluster/cluster_private.h"
    2525#include "librpc/gen_ndr/misc.h"
    26 #include "librpc/gen_ndr/server_id4.h"
     26#include "librpc/gen_ndr/server_id.h"
    2727
    2828static struct cluster_ops *ops;
     
    5151  create a server_id for the local node
    5252*/
    53 struct server_id cluster_id(uint64_t id, uint32_t id2)
     53struct server_id cluster_id(uint64_t pid, uint32_t task_id)
    5454{
    5555        cluster_init();
    56         return ops->cluster_id(ops, id, id2);
     56        return ops->cluster_id(ops, pid, task_id);
    5757}
    58 
    59 
    60 /*
    61   return a server_id as a string
    62 */
    63 const char *cluster_id_string(TALLOC_CTX *mem_ctx, struct server_id id)
    64 {
    65         cluster_init();
    66         return ops->cluster_id_string(ops, mem_ctx, id);
    67 }
    68 
    6958
    7059/*
    7160  open a temporary tdb in a cluster friendly manner
    7261*/
    73 struct tdb_wrap *cluster_tdb_tmp_open(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, const char *dbname, int flags)
     62struct db_context *cluster_db_tmp_open(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, const char *dbbase, int flags)
    7463{
    7564        cluster_init();
    76         return ops->cluster_tdb_tmp_open(ops, mem_ctx, lp_ctx, dbname, flags);
     65        return ops->cluster_db_tmp_open(ops, mem_ctx, lp_ctx, dbbase, flags);
    7766}
    7867
     
    8170  register a callback function for a messaging endpoint
    8271*/
    83 NTSTATUS cluster_message_init(struct messaging_context *msg, struct server_id server,
     72NTSTATUS cluster_message_init(struct imessaging_context *msg, struct server_id server,
    8473                              cluster_message_fn_t handler)
    8574{
  • vendor/current/source4/cluster/cluster.h

    r740 r988  
    2323#define __CLUSTER_H__
    2424
    25 #include "librpc/gen_ndr/server_id4.h"
     25#include "librpc/gen_ndr/server_id.h"
    2626
    2727/*
    2828  test for same cluster id
    2929*/
    30 #define cluster_id_equal(id_1, id_2) ((id_1)->id == (id_2)->id \
    31                                     && (id_1)->id2 == (id_2)->id2 \
    32                                     && (id_1)->node == (id_2)->node)
     30#define cluster_id_equal(id_1, id_2) ((id_1)->pid == (id_2)->pid \
     31                                    && (id_1)->task_id == (id_2)->task_id \
     32                                    && (id_1)->vnn == (id_2)->vnn)
    3333
    3434/*
    3535  test for same cluster node
    3636*/
    37 #define cluster_node_equal(id1, id2) ((id1)->node == (id2)->node)
     37#define cluster_node_equal(id1, id2) ((id1)->vnn == (id2)->vnn)
    3838
    39 struct messaging_context;
    40 typedef void (*cluster_message_fn_t)(struct messaging_context *, DATA_BLOB);
     39struct imessaging_context;
     40typedef void (*cluster_message_fn_t)(struct imessaging_context *, DATA_BLOB);
    4141
    4242/* prototypes */
    43 struct server_id cluster_id(uint64_t id, uint32_t id2);
    44 const char *cluster_id_string(TALLOC_CTX *mem_ctx, struct server_id id);
    45 struct tdb_wrap *cluster_tdb_tmp_open(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, const char *dbname, int flags);
     43struct server_id cluster_id(uint64_t id, uint32_t task_id);
     44struct db_context *cluster_db_tmp_open(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, const char *dbbase, int flags);
    4645void *cluster_backend_handle(void);
    4746
    48 NTSTATUS cluster_message_init(struct messaging_context *msg, struct server_id server,
     47NTSTATUS cluster_message_init(struct imessaging_context *msg, struct server_id server,
    4948                              cluster_message_fn_t handler);
    5049NTSTATUS cluster_message_send(struct server_id server, DATA_BLOB *data);
  • vendor/current/source4/cluster/cluster_private.h

    r414 r988  
    2525struct cluster_ops {
    2626        struct server_id (*cluster_id)(struct cluster_ops *ops, uint64_t id, uint32_t id2);
    27         const char *(*cluster_id_string)(struct cluster_ops *ops,
    28                                          TALLOC_CTX *, struct server_id );
    29         struct tdb_wrap *(*cluster_tdb_tmp_open)(struct cluster_ops *,
    30                                                  TALLOC_CTX *,
     27        struct db_context *(*cluster_db_tmp_open)(struct cluster_ops *,
     28                                                 TALLOC_CTX *,
    3129                                                 struct loadparm_context *,
    3230                                                 const char *, int);
    3331        void *(*backend_handle)(struct cluster_ops *);
    3432        NTSTATUS (*message_init)(struct cluster_ops *ops,
    35                                  struct messaging_context *msg, struct server_id server,
     33                                 struct imessaging_context *msg, struct server_id server,
    3634                                 cluster_message_fn_t handler);
    3735        NTSTATUS (*message_send)(struct cluster_ops *ops,
  • vendor/current/source4/cluster/local.c

    r740 r988  
    2323#include "cluster/cluster.h"
    2424#include "cluster/cluster_private.h"
    25 #include <tdb.h>
    26 #include "lib/util/tdb_wrap.h"
     25#include "dbwrap/dbwrap.h"
    2726#include "system/filesys.h"
    2827#include "param/param.h"
    29 #include "librpc/gen_ndr/server_id4.h"
     28#include "librpc/gen_ndr/server_id.h"
    3029
    3130/*
    3231  server a server_id for the local node
    3332*/
    34 static struct server_id local_id(struct cluster_ops *ops, uint64_t id, uint32_t id2)
     33static struct server_id local_id(struct cluster_ops *ops, uint64_t pid, uint32_t task_id)
    3534{
    3635        struct server_id server_id;
    3736        ZERO_STRUCT(server_id);
    38         server_id.id = id;
    39         server_id.id2 = id2;
     37        server_id.pid = pid;
     38        server_id.task_id = task_id;
     39        server_id.vnn = NONCLUSTER_VNN;
     40        /* This is because we are not in the s3 serverid database */
     41        server_id.unique_id = SERVERID_UNIQUE_ID_NOT_TO_VERIFY;
    4042        return server_id;
    41 }
    42 
    43 
    44 /*
    45   return a server_id as a string
    46 */
    47 static const char *local_id_string(struct cluster_ops *ops,
    48                                    TALLOC_CTX *mem_ctx, struct server_id id)
    49 {
    50         return talloc_asprintf(mem_ctx, "%u.%llu.%u", id.node, (unsigned long long)id.id, id.id2);
    5143}
    5244
     
    5648  TDB_CLEAR_IF_FIRST as the tmp path is wiped at startup
    5749*/
    58 static struct tdb_wrap *local_tdb_tmp_open(struct cluster_ops *ops,
    59                                            TALLOC_CTX *mem_ctx,
    60                                            struct loadparm_context *lp_ctx,
    61                                            const char *dbname, int flags)
     50static struct db_context *local_db_tmp_open(struct cluster_ops *ops,
     51                                            TALLOC_CTX *mem_ctx,
     52                                            struct loadparm_context *lp_ctx,
     53                                            const char *dbbase, int flags)
    6254{
    63         char *path = smbd_tmp_path(mem_ctx, lp_ctx, dbname);
    64         struct tdb_wrap *w;
    65         w = tdb_wrap_open(mem_ctx, path, 0, flags,
    66                           O_RDWR|O_CREAT, 0600);
    67         talloc_free(path);
    68         return w;
     55        TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
     56        char *path, *dbname;
     57        struct db_context *db;
     58
     59        dbname = talloc_asprintf(mem_ctx, "%s.tdb", dbbase);
     60
     61        path = smbd_tmp_path(tmp_ctx, lp_ctx, dbname);
     62        db = dbwrap_local_open(mem_ctx, lp_ctx, path, 0, flags, O_RDWR|O_CREAT,
     63                               0600, DBWRAP_LOCK_ORDER_NONE, DBWRAP_FLAG_NONE);
     64        talloc_free(tmp_ctx);
     65        return db;
    6966}
    7067
     
    8178*/
    8279static NTSTATUS local_message_init(struct cluster_ops *ops,
    83                                    struct messaging_context *msg,
     80                                   struct imessaging_context *msg,
    8481                                   struct server_id server,
    8582                                   cluster_message_fn_t handler)
     
    9996static struct cluster_ops cluster_local_ops = {
    10097        .cluster_id           = local_id,
    101         .cluster_id_string    = local_id_string,
    102         .cluster_tdb_tmp_open = local_tdb_tmp_open,
     98        .cluster_db_tmp_open  = local_db_tmp_open,
    10399        .backend_handle       = local_backend_handle,
    104100        .message_init         = local_message_init,
  • vendor/current/source4/cluster/wscript_build

    r740 r988  
    33bld.SAMBA_LIBRARY('cluster',
    44                  source='cluster.c local.c',
    5                   deps='tdb-wrap samba-hostconfig talloc',
     5                  deps='dbwrap samba-hostconfig talloc',
    66                  private_library=True
    77                  )
Note: See TracChangeset for help on using the changeset viewer.