smbd: Fix flawed share_mode_stale_pid API
commit73166e5fde3e587ba9e0e204424973ca0869cf54
authorVolker Lendecke <vl@samba.org>
Fri, 30 Aug 2013 12:49:43 +0000 (30 12:49 +0000)
committerKarolin Seeger <kseeger@samba.org>
Tue, 1 Oct 2013 07:37:09 +0000 (1 09:37 +0200)
tree41dc5b02cf50864c7c1d0be2e7548966ea3d405d
parent65c89097475205a21892c35c62fb8cf977390ef7
smbd: Fix flawed share_mode_stale_pid API

The comment for this routine said:

> Modifies d->num_share_modes, watch out in routines iterating over
> that array.

Well, it turns out that *every* caller of this API got it wrong. So I
think it's better to change the routine.

This leaves the array untouched while iterating but filters out the
deleted ones while saving them back to disk.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 7d91ffc6fdc3b371564e14f09822a96264ea372a)
source3/librpc/idl/open_files.idl
source3/locking/locking.c
source3/locking/share_mode_lock.c