1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/source3/locking
Ralph Boehme bf04ca5658 s3/locking: prime flags in a fresh sharemode data object
This is needed to prime the logic in share_mode_flags_restrict() for the
following scenario:

* (First) CREATE on a file with FILE_SHARE_NONE and
  access_mask=FILE_READ_ATTRIBUTES (a stat-open).

* share_mode_flags_restrict() gets called with

    share_mode_flags_restrict(flags=0,
                              access_mask=0x80,
                              share_mode=0,
                              lease_type=UINT32_MAX)

  and returns a value where none of the FILE_SHARE_* flags is set.

As a result share_mode_data.flags doesn't reflect the share-modes in effect.

This doesn't change any current visible behaviour outside of open_mode_check(),
but it avoids calling share_mode_forall_entries() in open_mode_check_fn().

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14375

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue May 12 19:52:48 UTC 2020 on sn-devel-184
2020-05-12 19:52:48 +00:00
..
brlock.c smbd: Use ARRAY_DEL_ELEMENT() in brl_unlock_windows_default() 2020-03-26 14:43:31 +00:00
leases_db.c dbwrap: Pass "value" to dbwrap_do_locked() callback 2019-11-22 23:57:46 +00:00
leases_db.h smbd: Add quick leases_db_get_current_state() 2019-09-17 22:49:36 +00:00
leases_util.c smbd: Let fsp_lease_type() look at leases.tdb 2019-09-17 22:49:36 +00:00
locking.c smbd: Make share_mode_do_locked() use a const uint8_t * 2020-05-05 11:48:40 +00:00
posix.c locking: Move SMB_OFF_T_BITS macro to its only user 2020-05-05 11:48:38 +00:00
proto.h smbd: Make share_mode_do_locked() use a const uint8_t * 2020-05-05 11:48:40 +00:00
share_mode_lock.c s3/locking: prime flags in a fresh sharemode data object 2020-05-12 19:52:48 +00:00