smbd: Fix flawed share_mode_stale_pid API
authorVolker Lendecke <vl@samba.org>
Fri, 30 Aug 2013 12:49:43 +0000 (12:49 +0000)
committerMichael Adam <obnox@samba.org>
Tue, 3 Sep 2013 15:13:53 +0000 (17:13 +0200)
commit7d91ffc6fdc3b371564e14f09822a96264ea372a
tree7c2534a2c851707e26b66010dfee9b9fc7590d29
parent5006db98aaf1efe119f1da8be091587a9bc2b952
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>
source3/librpc/idl/open_files.idl
source3/locking/locking.c
source3/locking/share_mode_lock.c