mirror of
https://github.com/samba-team/samba.git
synced 2025-01-25 06:04:04 +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:
parent
28d9c41860
commit
3e5f1be8ea
@ -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")) {
|
if (argc == 2 && strequal(argv[1], "dump")) {
|
||||||
ret = net_tdb_locking_dump(mem_ctx, lock->data);
|
ret = net_tdb_locking_dump(mem_ctx, lock->data);
|
||||||
} else {
|
} 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("Share path: %s\n", lock->data->servicepath);
|
||||||
d_printf("Name: %s\n", lock->data->base_name);
|
d_printf("Name: %s\n", lock->data->base_name);
|
||||||
d_printf("Number of share modes: %" PRIu32 "\n",
|
d_printf("Number of share modes: %zu\n", num_share_modes);
|
||||||
lock->data->num_share_modes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user