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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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,
Note: See TracChangeset for help on using the changeset viewer.