From: Volker Lendecke Date: Wed, 11 Dec 2019 09:02:54 +0000 (+0100) Subject: smbd: Don't store "num_share_modes" in locking.tdb X-Git-Tag: ldb-2.1.0~234 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a60e577db51b0ee5b450d643872463d6939ccee;p=thirdparty%2Fsamba.git smbd: Don't store "num_share_modes" in locking.tdb With the last commit we don't store the share mode entry count anymore. With this commit we go one step further and avoid storing it. If there's valid record in locking.tdb, there is a corresponding record in share_entries.tdb, so there's no point storing that once more explicitly. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/librpc/idl/open_files.idl b/source3/librpc/idl/open_files.idl index 4bfadb5656a..261aed6d04e 100644 --- a/source3/librpc/idl/open_files.idl +++ b/source3/librpc/idl/open_files.idl @@ -58,7 +58,7 @@ interface open_files [string,charset(UTF8)] char *servicepath; [string,charset(UTF8)] char *base_name; [string,charset(UTF8)] char *stream_name; - uint32 num_share_modes; + [skip] uint32 num_share_modes; uint32 num_delete_tokens; [size_is(num_delete_tokens)] delete_token delete_tokens[]; NTTIME old_write_time; diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c index 4b4faa6220b..93800a6d524 100644 --- a/source3/locking/share_mode_lock.c +++ b/source3/locking/share_mode_lock.c @@ -404,6 +404,14 @@ static struct share_mode_data *parse_share_modes(TALLOC_CTX *mem_ctx, NDR_PRINT_DEBUG(share_mode_data, d); } + /* + * We have a non-zero locking.tdb record that was correctly + * parsed. This means a share_entries.tdb entry exists, + * otherwise we'd have paniced before in + * share_mode_data_store() + */ + d->num_share_modes = 1; + return d; fail: TALLOC_FREE(d);