summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* s3:client:Use DEVICE_URI, instead of argv[0],for Device URIBryan Mason2019-09-181-7/+9
| | | | | | | | | | | | | | CUPS sanitizes argv[0] by removing username/password, so use DEVICE_URI environment variable first. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14128 Signed-off-by: Bryan Mason <bmason@redhat.com> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Sep 18 12:31:11 UTC 2019 on sn-devel-184
* s3: VFS: Remove vfs_netatalk. Old, unused and unmaintained.Jeremy Allison2019-09-185-586/+1
| | | | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Sep 18 01:26:06 UTC 2019 on sn-devel-184
* smbd: Don't always walk the share mode array in open_mode_check()Volker Lendecke2019-09-181-17/+200
| | | | | | | | | | | | | | | | | | share_mode_data->flags contains the "most restrictive" share mode of the whole array. This is maintained lazily: Whenever set_share_mode() is called, d->flags is updated if the new share mode got more restrictive. It is not updated when a file is closed, as this would mean we would have to walk the whole array, making sure that the closed handle was indeed the only most restrictive one. Instead, we walk the share mode array only when a conflict happens: Then we need to know "the truth" and recalculate it by walking the share mode array. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Sep 18 00:07:13 UTC 2019 on sn-devel-184
* smbd: Add share mode flagsVolker Lendecke2019-09-174-5/+13
| | | | | | | | | | | This will contain a summary of the "most restrictive" share mode and lease, i.e. intersection of all share_access entries and the union of all access_mask and leases in the share mode array. This way open_mode_check in the non-conflicting case will only have to look at the summary and not walk the share mode array. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Make "share_mode_flags" 16-bit wideVolker Lendecke2019-09-173-6/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Introduce share_entries.tdb - ADD COMMENT FIXME !!Volker Lendecke2019-09-173-273/+883
| | | | | | | | | | | | | | This moves share_modes[] from "struct share_mode_data" into a separate share_entries.tdb with a sorted array of fixed-length (132 byte) "struct share_mode_entry" entries. I know it's one huge commit, but I did not see a way to keep both data structures and associated code working together without a lot of code duplication after having centralized all the code accessing the share_modes[] array into a few routines. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Enable watching and storing dbwrap_watch records.Volker Lendecke2019-09-171-14/+55
| | | | | | | | | | | | Samba so far on a dbwrap_watch record either watches or stores a record, but never both from the same db_record instance acquired from a dbwrap_fetch_locked(). In one of the next commits this will change, we will watch a record and at the same time store data into it. This patch enables a watch_send() followed by a storev() by properly keeping the watchers around. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Allow another database between brlock.tdb and leases.tdbVolker Lendecke2019-09-171-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Allow a 4th lock orderVolker Lendecke2019-09-172-2/+3
| | | | | | | We will have another tdb soon Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture3: Remove cleanup3Volker Lendecke2019-09-174-184/+0
| | | | | | | This goes directly into the database, for which the format changes Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Remove stale share mode entries while walking the arrayVolker Lendecke2019-09-172-23/+12
| | | | | | | | | | Previously, we did this only when writing out the locking.tdb record. That was because we had places where the index of a particular share mode entry mattered while operating on the array. This is no longer the case, so we can remove stale entries early. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Make remove_stale_share_mode_entries() static in share_mode_lock.cVolker Lendecke2019-09-173-22/+21
| | | | | | | ... to the place where the record is stored in the database Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Avoid calling remove_stale_share_mode_entries() in open.cVolker Lendecke2019-09-171-2/+0
| | | | | | | | All places that matter explicitly check for staleness. This cleanup action should only happen before writing the database Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use share_mode_forall_entries() in remove_lease_if_stale()Volker Lendecke2019-09-171-19/+41
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Pass share_mode_lock to remove_lease_if_stale()Volker Lendecke2019-09-173-4/+5
| | | | | | | We'll want to use share_mode_forall_entries next Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Pass share_mode_lock to remove_share_mode_lease()Volker Lendecke2019-09-171-6/+5
| | | | | | | Later we'll need "lck" further down Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Avoid duplicate assignmentsVolker Lendecke2019-09-171-2/+0
| | | | | | | remove_share_mode_lease() already does this Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Remove unused share_mode_stale_pid()Volker Lendecke2019-09-172-53/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use share_mode_forall_entries() in share_entry_forall()Volker Lendecke2019-09-171-11/+27
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use share_mode_forall_leases() in share_mode_cleanup_disconnected()Volker Lendecke2019-09-171-49/+77
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use share_mode_forall_leases() in lease_match()Volker Lendecke2019-09-171-68/+91
| | | | | | | | We have to break leases referenced from multiple share modes only once. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use share_mode_forall_leases() in delay_rename_for_lease_break()Volker Lendecke2019-09-171-35/+48
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use share_mode_forall_entries() in vfs_default_durable_reconnect()Volker Lendecke2019-09-171-28/+50
| | | | | | | | The durable reconnect mainly has to check that there is one and only one entry, and it has to reset it with the new values. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Add reset_share_mode_entryVolker Lendecke2019-09-172-0/+30
| | | | | | | Mostly for durable reconnect at this point Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Pass pid/share_file_id to find_share_mode_entry()Volker Lendecke2019-09-171-7/+20
| | | | | | | | Avoid the full fsp, this makes the indexing of the share mode array clearer, and it makes the next commit easier Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use share_mode_forall_entries() in share_mode_forall_leases()Volker Lendecke2019-09-171-50/+68
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Stop passing "share_mode_lock" via share_mode_forall_leases()Volker Lendecke2019-09-174-11/+6
| | | | | | | | | | | Why? Next commit will make share_mode_forall_leases() use share_mode_forall_entries(), and that does not necessarily have to depend on "share_mode_lock". And as we can pass the required information via "private_data", don't embed the "share_mode_lock" reference into this lowlevel library routine. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Avoid "share_mode_lock" dependency cleanup_disconnected_lease()Volker Lendecke2019-09-171-3/+8
| | | | | | | share_mode_forall_leases() will stop passing "lck" soon. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Avoid "share_mode_lock" dependency in rename_lease_fn()Volker Lendecke2019-09-171-10/+13
| | | | | | | share_mode_forall_leases() will stop passing "lck" soon. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use share_mode_forall_entries() in delay_for_oplock()Volker Lendecke2019-09-171-109/+137
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Pass "struct file_id" to get_lease_type()Volker Lendecke2019-09-174-8/+6
| | | | | | | It does not have to depend on the whole struct share_mode_data. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use share_mode_forall_entries() in validate_oplock_types()Volker Lendecke2019-09-171-77/+100
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use share_mode_forall_entries() in file_has_open_streams()Volker Lendecke2019-09-171-18/+33
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use share_mode_forall_entries() in rename_share_filename()Volker Lendecke2019-09-171-63/+79
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use share_mode_forall_entries() in open_mode_check()Volker Lendecke2019-09-171-30/+47
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use share_mode_forall_entries() for validate_my_share_entries()Volker Lendecke2019-09-171-24/+35
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use share_mode_forall_entries() in has_delete_on_close()Volker Lendecke2019-09-171-10/+22
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use share_mode_forall_entries() in has_other_nonposix_opens_fn()Volker Lendecke2019-09-171-26/+42
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use share_mode_forall_entries() in set_delete_on_close_lck()Volker Lendecke2019-09-171-19/+42
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use share_mode_forall_entries() in contend_level2_oplocks_begin_default()Volker Lendecke2019-09-171-43/+42
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Add share_mode_forall_entries()Volker Lendecke2019-09-172-0/+54
| | | | | | | | Abstract away the fact that we store the share modes as an array inside "struct share_mode_data". Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use share_entry_stale_pid() in share_mode_stale_pid()Volker Lendecke2019-09-171-20/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Add share_entry_stale_pid()Volker Lendecke2019-09-172-0/+25
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Avoid passing a share mode entry to share_conflict()Volker Lendecke2019-09-171-22/+26
| | | | | | | | Make the real data dependencies clearer, we don't need a full share_entry, only its access and sharemode masks Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Rewrite share_conflict()Volker Lendecke2019-09-171-63/+67
| | | | | | | | | | It was hard for me to understand share_conflict(), so once I understood it I thought this version would be easier to follow. It violates README.Coding (one argument per line), but grouping the parameters to mask_conflict makes it clearer to me what belongs together. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Fix a debug message hickupVolker Lendecke2019-09-171-5/+5
| | | | | | | | Mind the missing space before "(e.g. another...". While there, avoid casts. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Use server_id_cmp() in server_id_equal()Volker Lendecke2019-09-171-13/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Add server_id_cmp()Volker Lendecke2019-09-172-0/+18
| | | | | | | Will be used later for sorting the share mode array Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Introduce helper variables in open_mode_check()Volker Lendecke2019-09-171-8/+9
| | | | | | | | Less bytes .text, the compiler now does not have to expect other threads to alter the pointers. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Let fsp_lease_type() look at leases.tdbVolker Lendecke2019-09-173-7/+31
| | | | | | | | | | | | The same lease can be used via different TCP connections (yes, we have tests for this!). At the end of downgrade_lease() we update all fsp's with fsps_lease_update() that link to the lease that just was changed. However, this is only in the local process, this is not cross-smbd. So other smbds using the same lease can use stale information and for example get the mandatory locking wrong. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>