diff options
author | Ralph Boehme <slow@samba.org> | 2015-10-14 12:40:03 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2015-10-20 11:51:16 +0200 |
commit | 79ec9cbff9b8b84ac80c6d2a8220b37561415271 (patch) | |
tree | c12377ea75f7499c17e3d7a029bf89941cf5760c /source4/lib | |
parent | 19a0a7f33ca71a39859706d726eaf70882362c93 (diff) | |
download | samba-79ec9cbff9b8b84ac80c6d2a8220b37561415271.tar.gz |
s4:lib/messaging: use correct path for names.tdb
source3 messaging_init() calls server_id_db_init() (where names.tdb is
created) with lock_path. source4 imessaging_init() otoh wrongly used the
special lock_path subdirectory "msg.lock":
> find /opt/samba/ -name names.tdb
/opt/samba/var/lock/msg.lock/names.tdb
/opt/samba/var/lock/names.tdb
> tdbdump /opt/samba/var/lock/names.tdb
{
key(14) = "notify-daemon\00"
data(27) = "28609/12756565486113779780\00"
}
> tdbdump /opt/samba/var/lock/msg.lock/names.tdb
{
key(15) = "winbind_server\00"
data(8) = "28593/0\00"
}
With this patch both source3 and source4 messaging now use the same
names.tdb which is what we want:
> find /opt/samba/ -name names.tdb
/opt/samba/var/lock/names.tdb
> tdbdump /opt/samba/var/lock/names.tdb
{
key(15) = "winbind_server\00"
data(8) = "26434/0\00"
}
{
key(14) = "notify-daemon\00"
data(26) = "26452/3454520012124001687\00"
}
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11562
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/messaging/messaging.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c index bbc22ec0e28..6d891e56e67 100644 --- a/source4/lib/messaging/messaging.c +++ b/source4/lib/messaging/messaging.c @@ -311,6 +311,7 @@ struct imessaging_context *imessaging_init(TALLOC_CTX *mem_ctx, struct imessaging_context *msg; bool ok; int ret; + const char *lock_dir = NULL; if (ev == NULL) { return NULL; @@ -323,6 +324,11 @@ struct imessaging_context *imessaging_init(TALLOC_CTX *mem_ctx, /* create the messaging directory if needed */ + lock_dir = lpcfg_lock_directory(lp_ctx); + if (lock_dir == NULL) { + goto fail; + } + msg->sock_dir = lpcfg_private_path(msg, lp_ctx, "msg.sock"); if (msg->sock_dir == NULL) { goto fail; @@ -363,7 +369,7 @@ struct imessaging_context *imessaging_init(TALLOC_CTX *mem_ctx, msg->start_time = timeval_current(); msg->names = server_id_db_init( - msg, server_id, msg->lock_dir, 0, + msg, server_id, lock_dir, 0, TDB_INCOMPATIBLE_HASH|TDB_CLEAR_IF_FIRST| lpcfg_tdb_flags(lp_ctx, 0)); if (msg->names == NULL) { |