]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Don't store "num_share_modes" in locking.tdb
authorVolker Lendecke <vl@samba.org>
Wed, 11 Dec 2019 09:02:54 +0000 (10:02 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 17 Dec 2019 22:40:32 +0000 (22:40 +0000)
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 <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/librpc/idl/open_files.idl
source3/locking/share_mode_lock.c

index 4bfadb5656a1e6efba93b90c63c57e7e4f980431..261aed6d04e56e7d016d12165eef8def9fe5114c 100644 (file)
@@ -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;
index 4b4faa6220bc33d42ccf60b6fa4f1a89364c21f4..93800a6d524aad0e0297b55557c251929c72104c 100644 (file)
@@ -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);