[PATCH] smbstatus doesn't show lease info
Jeremy Allison
jra at samba.org
Mon Oct 12 16:59:05 UTC 2015
On Mon, Oct 12, 2015 at 01:17:59PM +0200, Ralph Boehme wrote:
> Hi,
>
> attached is a fix for bug 11549.
>
> Please review & push if ok. Thanks!
I think you should have a helper variable
here to make it more efficient (this is used
in may other places in the code).
How about the attached instead ?
Jeremy.
> --
> SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
> phone: +49-551-370000-0, fax: +49-551-370000-9
> AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
> http://www.sernet.de,mailto:kontakt@sernet.de
> From 704f098ab730527883819649072316fdd71db6b5 Mon Sep 17 00:00:00 2001
> From: Ralph Boehme <slow at samba.org>
> Date: Mon, 12 Oct 2015 12:28:04 +0200
> Subject: [PATCH] s3:locking: initialize lease pointer in
> share_mode_traverse_fn()
>
> Initialize lease pointer to point to the share_mode_data leases array
> entry at index lease_idx.
>
> This fixes a bug in smbstatus where the lease info is not printed.
>
> Bug: https://bugzilla.samba.org/show_bug.cgi?id=11549
>
> Signed-off-by: Ralph Boehme <slow at samba.org>
> ---
> source3/locking/share_mode_lock.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c
> index 6273aec..9b3c10c 100644
> --- a/source3/locking/share_mode_lock.c
> +++ b/source3/locking/share_mode_lock.c
> @@ -687,13 +687,16 @@ static int share_mode_traverse_fn(struct db_record *rec, void *_state)
> DEBUG(1, ("ndr_pull_share_mode_lock failed\n"));
> return 0;
> }
> +
> + for (i=0; i<d->num_share_modes; i++) {
> + d->share_modes[i].stale = false; /* [skip] in idl */
> + d->share_modes[i].lease = &d->leases[d->share_modes[i].lease_idx];
> + }
> +
> if (DEBUGLEVEL > 10) {
> DEBUG(11, ("parse_share_modes:\n"));
> NDR_PRINT_DEBUG(share_mode_data, d);
> }
> - for (i=0; i<d->num_share_modes; i++) {
> - d->share_modes[i].stale = false; /* [skip] in idl */
> - }
>
> ret = state->fn(fid, d, state->private_data);
>
> --
> 2.1.0
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s3-locking-initialize-lease-pointer-in-share_mode_tr.patch
Type: text/x-diff
Size: 1486 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20151012/28f43d38/0001-s3-locking-initialize-lease-pointer-in-share_mode_tr.diff>
More information about the samba-technical
mailing list