From c52e61f7ba215da28cbb7b8e328aea110ad79b11 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 8 Jul 2013 16:31:13 +0200 Subject: s3-lib: hide incomplete smbXsrv_tcon_global records MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Part of fix for bug #10003 Pair-programmed-with: Björn Baumbach Signed-off-by: Stefan Metzmacher Signed-off-by: Björn Baumbach Reviewed-by: Jeremy Allison --- source3/lib/conn_tdb.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source3/lib') diff --git a/source3/lib/conn_tdb.c b/source3/lib/conn_tdb.c index bb7618f0d4..b218831d19 100644 --- a/source3/lib/conn_tdb.c +++ b/source3/lib/conn_tdb.c @@ -91,6 +91,19 @@ static int traverse_tcon_fn(struct smbXsrv_tcon_global0 *global, TDB_DATA val = tdb_null; + /* + * Note: that share_name is defined as array without a pointer. + * that's why it's always a valid pointer here. + */ + if (strlen(global->share_name) == 0) { + /* + * when a smbXsrv_tcon is created it's created + * with emtpy share_name first in order to allocate + * an id, before filling in the details. + */ + return 0; + } + status = dbwrap_fetch(state->session_by_pid, state, make_tdb_data((void*)&sess_id, sizeof(sess_id)), &val); -- cgit