1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

net: Use share_mode_count_entries()

Avoid a reference to share_mode_data->num_share_modes

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2019-11-29 15:46:20 +01:00 committed by Jeremy Allison
parent 28d9c41860
commit 3e5f1be8ea

View File

@ -95,10 +95,20 @@ static int net_tdb_locking(struct net_context *c, int argc, const char **argv)
if (argc == 2 && strequal(argv[1], "dump")) {
ret = net_tdb_locking_dump(mem_ctx, lock->data);
} else {
NTSTATUS status;
size_t num_share_modes = 0;
status = share_mode_count_entries(
lock->data->id, &num_share_modes);
if (!NT_STATUS_IS_OK(status)) {
d_fprintf(stderr,
"Could not count share entries: %s\n",
nt_errstr(status));
}
d_printf("Share path: %s\n", lock->data->servicepath);
d_printf("Name: %s\n", lock->data->base_name);
d_printf("Number of share modes: %" PRIu32 "\n",
lock->data->num_share_modes);
d_printf("Number of share modes: %zu\n", num_share_modes);
}
out: