Merge branch 'master' of ssh://git.samba.org/data/git/samba into singlelib
[nivanova/samba-autobuild/.git] / source4 / cluster / local.c
index dc4759ebae0621b4d53240877b876cc163b05263..f0357f0b073a0666052f2116a38974a293cc7e08 100644 (file)
 #include "includes.h"
 #include "cluster/cluster.h"
 #include "cluster/cluster_private.h"
-#include "lib/tdb/include/tdb.h"
-#include "db_wrap.h"
+#include "../tdb/include/tdb.h"
+#include "tdb_wrap.h"
 #include "system/filesys.h"
+#include "param/param.h"
+#include "librpc/gen_ndr/misc.h"
 
 /*
   server a server_id for the local node
 */
-static struct server_id local_id(struct cluster_ops *ops, uint32_t id)
+static struct server_id local_id(struct cluster_ops *ops, uint64_t id, uint32_t id2)
 {
        struct server_id server_id;
        ZERO_STRUCT(server_id);
        server_id.id = id;
+       server_id.id2 = id2;
        return server_id;
 }
 
@@ -44,7 +47,7 @@ static struct server_id local_id(struct cluster_ops *ops, uint32_t id)
 static const char *local_id_string(struct cluster_ops *ops,
                                   TALLOC_CTX *mem_ctx, struct server_id id)
 {
-       return talloc_asprintf(mem_ctx, "%u.%u", id.node, id.id);
+       return talloc_asprintf(mem_ctx, "%u.%llu.%u", id.node, (unsigned long long)id.id, id.id2);
 }
 
 
@@ -53,10 +56,11 @@ static const char *local_id_string(struct cluster_ops *ops,
   TDB_CLEAR_IF_FIRST as the tmp path is wiped at startup
 */
 static struct tdb_wrap *local_tdb_tmp_open(struct cluster_ops *ops,
-                                          TALLOC_CTX *mem_ctx, const char *dbname, 
-                                          int flags)
+                                          TALLOC_CTX *mem_ctx, 
+                                          struct loadparm_context *lp_ctx,
+                                          const char *dbname, int flags)
 {
-       char *path = smbd_tmp_path(mem_ctx, dbname);
+       char *path = smbd_tmp_path(mem_ctx, lp_ctx, dbname);
        struct tdb_wrap *w;
        w = tdb_wrap_open(mem_ctx, path, 0, flags,
                          O_RDWR|O_CREAT, 0600);