From 14750139639b3531e57a3ca3f9e481d6e458dc06 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 4 May 2011 10:28:15 +1000 Subject: lib/util Move source3 tdb_wrap_open() into the common code. This #if _SAMBA_BUILD == 3 is very unfortunate, as it means that in the top level build, these options are not available for these databases. However, having two different tdb_wrap lists is a worse fate, so this will do for now. Andrew Bartlett --- source3/lib/serverid.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/lib/serverid.c') diff --git a/source3/lib/serverid.c b/source3/lib/serverid.c index f13c66e2c91..7105e179d78 100644 --- a/source3/lib/serverid.c +++ b/source3/lib/serverid.c @@ -21,6 +21,7 @@ #include "system/filesys.h" #include "serverid.h" #include "dbwrap.h" +#include "lib/util/tdb_wrap.h" struct serverid_key { pid_t pid; -- cgit From d8cfca3a9bd2b6b6c562fd202377d95a98eb5472 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 5 May 2011 11:25:29 +0200 Subject: s3: only include tdb headers where needed. Guenther --- source3/lib/serverid.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/lib/serverid.c') diff --git a/source3/lib/serverid.c b/source3/lib/serverid.c index 7105e179d78..b1f6a5711ef 100644 --- a/source3/lib/serverid.c +++ b/source3/lib/serverid.c @@ -20,6 +20,7 @@ #include "includes.h" #include "system/filesys.h" #include "serverid.h" +#include "util_tdb.h" #include "dbwrap.h" #include "lib/util/tdb_wrap.h" -- cgit From cc3b75b807c6dd63b6dde3b449054f6640826f7c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 2 May 2011 10:27:36 +1000 Subject: s3-server_id Add task_id to server_id to match Samba4 This will allow this structure to be shared, and allow us to create a common messaging system between all Samba processes. Samba4 uses the task_id to indicate the different tasks within a single unix process. Andrew Bartlett Signed-off-by: Andrew Tridgell --- source3/lib/serverid.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/lib/serverid.c') diff --git a/source3/lib/serverid.c b/source3/lib/serverid.c index b1f6a5711ef..e63818e1b87 100644 --- a/source3/lib/serverid.c +++ b/source3/lib/serverid.c @@ -26,6 +26,7 @@ struct serverid_key { pid_t pid; + uint32_t task_id; uint32_t vnn; }; @@ -72,6 +73,7 @@ static void serverid_fill_key(const struct server_id *id, { ZERO_STRUCTP(key); key->pid = id->pid; + key->task_id = id->task_id; key->vnn = id->vnn; } @@ -275,6 +277,7 @@ static bool serverid_rec_parse(const struct db_record *rec, memcpy(&data, rec->value.dptr, sizeof(data)); id->pid = key.pid; + id->task_id = key.task_id; id->vnn = key.vnn; id->unique_id = data.unique_id; *msg_flags = data.msg_flags; -- cgit From d925b327f4703cc141c0a7f3eec912dba8440880 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 20 Jun 2011 18:40:33 +0930 Subject: tdb_compat: Higher level API fixes. My previous patches fixed up all direct TDB callers, but there are a few utility functions and the db_context functions which are still using the old -1 / 0 return codes. It's clearer to fix up all the callers of these too, so everywhere is consistent: non-zero means an error. Signed-off-by: Rusty Russell --- source3/lib/serverid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib/serverid.c') diff --git a/source3/lib/serverid.c b/source3/lib/serverid.c index e63818e1b87..1a1141265a1 100644 --- a/source3/lib/serverid.c +++ b/source3/lib/serverid.c @@ -250,7 +250,7 @@ bool serverid_exists(const struct server_id *id) state.id = id; state.exists = false; - if (db->parse_record(db, tdbkey, server_exists_parse, &state) == -1) { + if (db->parse_record(db, tdbkey, server_exists_parse, &state) != 0) { return false; } return state.exists; -- cgit