The branch, v4-2-test has been updated via 6cabeb5 docs-xml: document the interaction between "write cache size" and "aio read/write size" via 553ff29 s3:smbd: document the interaction between "smb2 leases" and "write cache size" via ca0dab7 selftest:Samba3: use "smb2 leases = yes" via 73d1501 s3:smb2_negprot: announce support for SMB2.1 leases. via 1e2a543 s3:param: Add "smb2 leases" parameter. Default "false". via b93a2d4 s3:smb2_create: support leases and pass them down to the VFS layer. via 5a5345c s3:smbd: Implementation of SMB2.1 and SMB3.0 leases. via 9da5e9f s3:smbd: add lease related helper functions to oplock.c via b2b0570 s3:smbd: add lease key validation functions to open.c via dabc728 s3:smbd: add lease related helper functions to open.c via 6b15f9d s3:smbd: add file_find_one_fsp_from_lease_key() helper function via b29d5b5 s3:smb2_create: validate durable reconnects with leases via de762d2 s3:smb2_create: allow durable handles with SMB2_LEASE_HANDLE via 2a36fc7 s3:smbd: add fsp_lease_type() and get_lease_type() helper functions via 84bd71b s3:vfs.h: add more elements to struct fsp_lease via 4b74ec5 s3:locking: add downgrade_share_lease() helper function via 3f2abc4 s3:locking: cleanup leases_db from share_mode_cleanup_disconnected() via 83943f9 s3:locking: ensure all share mode removal functions go through a common lease refcount manager. via a53965d s3:open_files.idl: add data structures for SMB2.1 and SMB3.0 leases. via 42e94bc s3:locking: add leases_db infrastructure via a1492ca s3: leases: libsmbsharemodes no longer works with SMB2 leases inside our locking.tdb. via de36824 s3:smb2_server: add smbd_smb2_send_lease_break() helper function via f873966 s3:smb2_server: allow smbd_smb2_send_break() with session == NULL and tcon == NULL via 30c662e s3:smbd: Add fsp_client_guid() utility function to return the connected client guid. via 7756eb7 s3:smbd: factor out a send_break_to_none() helper function via 5f230d5 s4:torture:smb2: let smb2.lease.[v2_]complex1 check the R->NONE breaks via d6b596e s4:torture:smb2: Add smb2.lease.v2_breaking3 test. via 6986398 s4:torture:smb2: Add test that shows the client can respond to a lease break over a different connection. via 7885650 profiling: Make WITH_PROFILE span more in smbprofile.h via 24ce08e profiling: Remove a big DEBUG statement via 0090cb4 profiling: Remove some #ifdefs via ddbcf7e profiling: Only compile profile/profile.c if profiling is enabled via c4063ef profiling: Only compile utils/status_profile.c if profiling is enabled via ba7829b profiling: Fix a typo via 03c2e8a profiling: Move some #defines to profile.c via 21be4da profiling: Fix a typo via 5cc5048 profiling: Make "struct profile_header" static via ef6b3da s4: torture: leases - Add test for leases and blocking locks. via 4ee38b0 s4: smb2 : torture: Add new dynamic_share leases test. via c9ddda4 s3: leases - torture test for timeout of responding to lease break request. via 490eeac s4:torture/smb2: smb2.lease.breaking6 test via f722f42 s4:torture/smb2: smb2.lease.breaking5 test via 3002568 s4:torture/smb2: smb2.lease.breaking4 test via 34bcf75 s4:torture/smb2: smb2.lease.breaking3 test via 544e458 s4:torture/smb2: smb2.lease.breaking2 test via 44587fb s4:torture/smb2: smb2.lease.breaking1 test via fe2cac8 s4:torture/smb2: make it possible to skip the automatic ack of lease breaks. via b561f46 s4:torture/smb2: add smb2.lease.v2_epoch[2|3] tests via 3ddd8ce s4:torture/smb2: add smb2.lease.[v2_]complex1 tests via e5c0f23 s4:torture/smb2: pass the expected flags to CHECK_LEASE() via e37a059 s4:torture/smb2: don't check the lease break connection against samba3 via c5bddf4 s4:torture/smb2: always verify the v2 lease epoch. via b341d29 s4:torture/smb2: verify lease_flags in CHECK_LEASE_BREAK() via 9f6162f s4:torture/smb2: lease per test fnames via ef7ddd5 s4:torture/smb2: make lease tests more reliable by calling torture_wait_for_lease_break() via 43235a0 s4:torture/smb2: skip lease tests if the server doesn't support them via 98e2dd6 s4:libcli/smb2: initialize ls->lease_version via 4cc1b07 s4:libcli/smb2: add new_epoch to struct smb2_lease_break via 7ee9174 s4:param: don't expand PROTOCOL_DEFAULT in lpcfg_smbcli_options() via ac4b453 s4:libcli/smb2: allow the caller to specify a specific value for max_protocol. via 19141e1 s4:libcli/raw: fix up the max_protocol value for the current transport connection via 2cd321c s4:libcli/smb_composite: use the options on the transport via eecd04d s3:smb2_create: send interim responses after 0.5 milliseconds via a69a575 Revert "libcli/smb: mask off SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET for version 1" via 56da06a s3:smb2_break: First test for NT_STATUS_INVALID_OPLOCK_PROTOCOL, then for in_oplock_level being reasonable via fa9a935 s3:locking: convert brl_have_read field to brl_num_read. via eb5ae0c s3:smbd: Don't set fsp->oplock_type before we've granted any oplocks. via 55fe857 s3:smbd: move all oplock granting code to grant_fsp_oplock_type() via a2f10ba s3:smbd: break oplocks to none with FILE_OVERWRITE via ee617e4 libcli/smb: Add smb2_lease_equal() which compares client_guids and keys. via fae8aca libcli/smb: add smb2_lease_key_equal() helper function via c813932 libcli/smb: mask off SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET for version 1 via f85ee9b libcli/smb: remember the lease_version in struct smb2_lease via 6eb4aa2 s4:torture: Add smb2.oplock test batch9a and raw.oplock test batch9a via 30999a3 s3-winbindd: Allow winbindd to connect over SMB2 to servers via 53e0e53 pam_winbind: fix warn_pwd_expire implementation. from 22e6ce3 libcli: SMB2: Pure SMB2-only negprot fix to make us behave as a Windows client does.
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-2-test - Log ----------------------------------------------------------------- commit 6cabeb512e667dd9e04e3058e3cf5bddfff048d6 Author: Stefan Metzmacher <me...@samba.org> Date: Sat Nov 8 09:47:01 2014 +0100 docs-xml: document the interaction between "write cache size" and "aio read/write size" Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Thu Dec 4 08:09:15 CET 2014 on sn-devel-104 (cherry picked from commit c261072a31bed4a7f67930fed54816312a158891) BUG: https://bugzilla.samba.org/show_bug.cgi?id=10911 SMB2 leases are not yet supported Autobuild-User(v4-2-test): Karolin Seeger <ksee...@samba.org> Autobuild-Date(v4-2-test): Thu Dec 4 23:31:29 CET 2014 on sn-devel-104 commit 553ff29424ac913c14ba5a5542e1282d6f4d7eae Author: Stefan Metzmacher <me...@samba.org> Date: Sat Nov 8 09:45:59 2014 +0100 s3:smbd: document the interaction between "smb2 leases" and "write cache size" Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 5e251adbed792a53652ccaa1c3277a6ebb3af6f0) commit ca0dab761e009f4fb05c8cdcb9c35ca67ba18282 Author: Jeremy Allison <j...@samba.org> Date: Tue Oct 14 10:34:53 2014 -0700 selftest:Samba3: use "smb2 leases = yes" Signed-off-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit 7eae9460a357071a776fecc6f3cf8cb5cb0961a3) commit 73d1501d19ade2acf7aadf83db4702a39026c7e3 Author: Jeremy Allison <j...@samba.org> Date: Tue Oct 28 15:31:46 2014 -0700 s3:smb2_negprot: announce support for SMB2.1 leases. We only do this with "smb2 leases = yes" and the default values for "oplocks = yes" and "kernel oplocks = no". Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit 556bf2ee006d14eb206c701bd8d375efb940140b) commit 1e2a5435edbe9dbdf722dc5c0a4394697327fae6 Author: Jeremy Allison <j...@samba.org> Date: Tue Oct 14 10:34:53 2014 -0700 s3:param: Add "smb2 leases" parameter. Default "false". This is currently marked as experimental! Signed-off-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit 44d2612822a39b980fe2b85b2a780de2f3902155) commit b93a2d4b5d45dddac34045d1f1cb02c994d387f2 Author: Volker Lendecke <v...@samba.org> Date: Tue Oct 28 15:31:46 2014 -0700 s3:smb2_create: support leases and pass them down to the VFS layer. Pair-Programmed-With: Stefan Metzmacher <me...@samba.org> Signed-off-by: Volker Lendecke <v...@samba.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit e2d80a89d53fdd6794a344649c3c9728db93adce) commit 5a5345ca673e5661690e00883394e0081f12d3b6 Author: Volker Lendecke <v...@samba.org> Date: Tue Oct 28 15:31:46 2014 -0700 s3:smbd: Implementation of SMB2.1 and SMB3.0 leases. Pair-Programmed-With: Jeremy Allison <j...@samba.org> Pair-Programmed-With: Stefan Metzmacher <me...@samba.org> Signed-off-by: Volker Lendecke <v...@samba.org> Signed-off-by: Jeremy Allison <j...@samba.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit 02f2684dd8e88f1c55bf69fa8b2aa27c1c404a3d) commit 9da5e9f42f566635a642a2b8ecf18770a203e1e6 Author: Volker Lendecke <v...@samba.org> Date: Tue Oct 28 15:31:46 2014 -0700 s3:smbd: add lease related helper functions to oplock.c Pair-Programmed-With: Jeremy Allison <j...@samba.org> Pair-Programmed-With: Stefan Metzmacher <me...@samba.org> Signed-off-by: Volker Lendecke <v...@samba.org> Signed-off-by: Jeremy Allison <j...@samba.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit 91b2488c9ad25b35d717bca505acc9dd060be677) commit b2b057091d0ec6aa32ae2f0bf73a7c99ff922b0a Author: Volker Lendecke <v...@samba.org> Date: Tue Oct 28 15:31:46 2014 -0700 s3:smbd: add lease key validation functions to open.c This makes sure a lease key can only be used for one specific file. This also handles the dynamic share file case [homes]. Pair-Programmed-With: Jeremy Allison <j...@samba.org> Signed-off-by: Volker Lendecke <v...@samba.org> Signed-off-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit 205ef314bc78a24651683f15e7cd84d8c4b96dee) commit dabc728b54a9294387c9996de79283f673e627a3 Author: Volker Lendecke <v...@samba.org> Date: Tue Oct 28 15:31:46 2014 -0700 s3:smbd: add lease related helper functions to open.c Pair-Programmed-With: Jeremy Allison <j...@samba.org> Pair-Programmed-With: Stefan Metzmacher <me...@samba.org> Signed-off-by: Volker Lendecke <v...@samba.org> Signed-off-by: Jeremy Allison <j...@samba.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit ffbac2112dee9933dd34263f590f0eae28efab45) commit 6b15f9d697c710ea39fea11a3fd2531b6e0b5aac Author: Volker Lendecke <v...@samba.org> Date: Tue Oct 28 15:31:46 2014 -0700 s3:smbd: add file_find_one_fsp_from_lease_key() helper function Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit eb9fc01d207ce29e68027f8958d4e8534f89a9e5) commit b29d5b506fd3e46a0afb923a48b45fa310468222 Author: Volker Lendecke <v...@samba.org> Date: Tue Oct 28 15:31:46 2014 -0700 s3:smb2_create: validate durable reconnects with leases We don't support leases yet, but prepares for the comming commits. Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit d78b18dd8c510591452ebd17810261cf89868d5c) commit de762d22cdd16069e77602bfa3ab2d7589e23035 Author: Volker Lendecke <v...@samba.org> Date: Tue Oct 28 15:31:46 2014 -0700 s3:smb2_create: allow durable handles with SMB2_LEASE_HANDLE We don't support real lease yet, but this makes use of fsp_lease_type() which converts a batch oplock into and RWH lease. Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit 81a5a9e8971fad928e0a1a022e7cb841d8dbadf5) commit 2a36fc77170bc632464fe69d68dfebc8c25c7d0e Author: Volker Lendecke <v...@samba.org> Date: Tue Oct 28 15:31:46 2014 -0700 s3:smbd: add fsp_lease_type() and get_lease_type() helper functions These convert the oplock state into SMB2_LEASE_ flags. Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit b72fca52defa1fd0f7d10f2811d86bbc7c661f50) commit 84bd71b568c9383718673ad953d550379271a90f Author: Stefan Metzmacher <me...@samba.org> Date: Wed Dec 3 17:57:37 2014 +0100 s3:vfs.h: add more elements to struct fsp_lease We'll need a reference to the smbd_server_connection as well as a timeout handler. Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 7ca8785cae6529fe9b8f5546aaf3c15cca9458cd) commit 4b74ec5db48d55454eef5bccbd3125e960bb6c08 Author: Volker Lendecke <v...@samba.org> Date: Tue Oct 28 15:31:46 2014 -0700 s3:locking: add downgrade_share_lease() helper function Pair-Programmed-With: Jeremy Allison <j...@samba.org> Pair-Programmed-With: Stefan Metzmacher <me...@samba.org> Signed-off-by: Volker Lendecke <v...@samba.org> Signed-off-by: Jeremy Allison <j...@samba.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit 3e91b823e4447b936e0fafaf7807b665a51ded30) commit 3f2abc458391536a8fc19a8cad399a34fdbc8876 Author: Stefan Metzmacher <me...@samba.org> Date: Thu Nov 27 19:32:46 2014 +0100 s3:locking: cleanup leases_db from share_mode_cleanup_disconnected() Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 62e7e142aa350be8f25193bf9c39a19e354346ea) commit 83943f929dbfcb9b2d4272a8e9fbd3331e04c685 Author: Jeremy Allison <j...@samba.org> Date: Fri Oct 10 14:32:19 2014 -0700 s3:locking: ensure all share mode removal functions go through a common lease refcount manager. Pair-Programmed-With: Stefan Metzmacher <me...@samba.org> Signed-off-by: Jeremy Allison <j...@samba.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit a504b84ec147f64c428095519099104a2cb6ff1f) commit a53965da09d4d4c76fe3a16bf8b6dc2f508d37ac Author: Stefan Metzmacher <me...@samba.org> Date: Thu Nov 27 18:34:56 2014 +0100 s3:open_files.idl: add data structures for SMB2.1 and SMB3.0 leases. Pair-Programmed-With: Volker Lendecke <v...@samba.org> Signed-off-by: Volker Lendecke <v...@samba.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit 6b2f19a5e6e8b3eb2a44cd24408ba4f27cfb8745) commit 42e94bc000fa1635f698fbe5aeb801cde5ae3d01 Author: Volker Lendecke <v...@samba.org> Date: Fri Oct 10 16:36:54 2014 -0700 s3:locking: add leases_db infrastructure Will enable us to solve the dynamic share path problem with leases on [homes]. We're also able to give the correct error codes when a lease key is re-used with a different file name. Pair-Programmed-With: Jeremy Allison <j...@samba.org> Signed-off-by: Volker Lendecke <v...@samba.org> Signed-off-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit 14fac5dbc05823562760ac424522fb39817ec062) commit a1492cad6a4acdb6bd913fa756fb5b6a92ea105d Author: Jeremy Allison <j...@samba.org> Date: Wed Dec 3 17:06:08 2014 -0800 s3: leases: libsmbsharemodes no longer works with SMB2 leases inside our locking.tdb. Remove it until a maintainer can be found. Signed-off-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit a199214dfb5fc9c2b4c9e15ccb24198065c616b9) commit de3682468db05609967f74a4651fd19febfe5635 Author: Volker Lendecke <v...@samba.org> Date: Tue Oct 28 15:31:46 2014 -0700 s3:smb2_server: add smbd_smb2_send_lease_break() helper function Pair-Programmed-With: Stefan Metzmacher <me...@samba.org> Signed-off-by: Volker Lendecke <v...@samba.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit 498e7220c553155ab6e7f383d9c4377ee92774ee) commit f8739663bb0f273f62f5c73a8afb821074358a8d Author: Stefan Metzmacher <me...@samba.org> Date: Thu Nov 13 11:50:14 2014 +0100 s3:smb2_server: allow smbd_smb2_send_break() with session == NULL and tcon == NULL In future we want to use this for lease breaks and they're not attached to a session. Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit a9a39953c785e76f67ce72c776b36ad1e0130ded) commit 30c662eab91b9c3c9cad7054d7bf15d48a1e66c1 Author: Jeremy Allison <j...@samba.org> Date: Tue Nov 4 21:46:14 2014 -0800 s3:smbd: Add fsp_client_guid() utility function to return the connected client guid. Signed-off-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit c22d521d26a75a71f940088b5a01d7fa924efd88) commit 7756eb77fd5a3f4c27b630bff6d17f3cc81e8257 Author: Volker Lendecke <v...@samba.org> Date: Tue Oct 28 15:31:46 2014 -0700 s3:smbd: factor out a send_break_to_none() helper function Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit e761c80f65c690ce2d93c30bcd8d8d9d752096a8) commit 5f230d547298353567799ac0dae5467aa27fbcc3 Author: Stefan Metzmacher <me...@samba.org> Date: Wed Dec 3 22:32:33 2014 +0100 s4:torture:smb2: let smb2.lease.[v2_]complex1 check the R->NONE breaks Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 8c323f20dccb8d7a362e6ebb87fd6ec7739c336a) commit d6b596eec83031e443f325921ef07893ee49b404 Author: Jeremy Allison <j...@samba.org> Date: Tue Dec 2 12:58:28 2014 -0800 s4:torture:smb2: Add smb2.lease.v2_breaking3 test. This verifies the epoch handling in the multi step break. Signed-off-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit 99f9eee657fcc1c435d00a677395e5125070bf77) commit 6986398420f5f91302d8a66202862fa068d1fcd7 Author: Jeremy Allison <j...@samba.org> Date: Mon Dec 1 13:57:57 2014 -0800 s4:torture:smb2: Add test that shows the client can respond to a lease break over a different connection. Signed-off-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit c5b481a8d5ed6c7c18c14479bc0263f37ded4702) commit 7885650378a822d25c25767b057ae9cba1594359 Author: Volker Lendecke <v...@samba.org> Date: Thu Oct 2 13:45:01 2014 +0000 profiling: Make WITH_PROFILE span more in smbprofile.h Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Fri Oct 3 22:17:46 CEST 2014 on sn-devel-104 (cherry picked from commit 5496270d0f615aa39de0a083ec74fb40a988f64b) commit 24ce08e2dfac6b587afdcc11a95f17f2a3bc91a1 Author: Volker Lendecke <v...@samba.org> Date: Thu Oct 2 13:40:35 2014 +0000 profiling: Remove a big DEBUG statement I would like to have the freedom to play with the profiling implementation. This is kindof in the way. This code is from pre-SVN days: > commit 7914e9351abb5271ebb4990c3b1fe495d15a4eda > Author: Jeremy Allison <j...@samba.org> > AuthorDate: Thu Oct 5 18:50:18 2000 +0000 > Commit: Jeremy Allison <j...@samba.org> > CommitDate: Thu Oct 5 18:50:18 2000 +0000 > > Herb's fixes for profiling & compiler warnings. > Jeremy. Herb, please speak up quickly if you still need this :-) Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit f74ac712aea8d354b70966ffd3f617c65a17d8d0) commit 0090cb4e2c35a8a31bfc28ccd87bbd8a5511f284 Author: Volker Lendecke <v...@samba.org> Date: Thu Oct 2 13:36:22 2014 +0000 profiling: Remove some #ifdefs The DO_PROFILE_INC thingies already #define to nothing without WITH_PROFILE, and any sane compiler will just not compile the if-condition if there is no body to be executed. Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 5254a7e1e5ab216a679bfbf3584bb8a16f502a2b) commit ddbcf7e9ab6b6ec69ffb4dc10b00573e6876062a Author: Volker Lendecke <v...@samba.org> Date: Tue Sep 30 15:08:20 2014 +0000 profiling: Only compile profile/profile.c if profiling is enabled This conditional compile avoids some #ifdef WITH_PROFILE, which makes the code more readable Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit c7c300f9710f1f207b9fa0274648ba2dc11c1ffd) commit c4063ef6b6b9e06ad7ededf7966a5938a8b65f07 Author: Volker Lendecke <v...@samba.org> Date: Tue Sep 30 15:08:20 2014 +0000 profiling: Only compile utils/status_profile.c if profiling is enabled This conditional compile avoids some #ifdef WITH_PROFILE, which makes the code more readable Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 17c7f454813be526876ac750ceb6fd1422577495) commit ba7829b8f040065836a0197e2fe7295fc1bf9837 Author: Volker Lendecke <v...@samba.org> Date: Thu Oct 2 13:05:07 2014 +0000 profiling: Fix a typo Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit a33b445a7d7567b27f5247cb6060edbbeecf4d52) commit 03c2e8aed5474017e79a9ba58ffcd89c628b7374 Author: Volker Lendecke <v...@samba.org> Date: Thu Oct 2 12:52:05 2014 +0000 profiling: Move some #defines to profile.c Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 0e1b60e8c3325a1e5ea77f420326b254d5404389) commit 21be4dae4ee9ad5d492e287f8d9f53437ba601a0 Author: Volker Lendecke <v...@samba.org> Date: Tue Sep 30 13:06:02 2014 +0000 profiling: Fix a typo Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit d523e0b7ed67d1697a1b8ab5f58902afd2a496b3) commit 5cc50489240d651d51dd8d0f4bafb881d4f810d9 Author: Volker Lendecke <v...@samba.org> Date: Mon Sep 29 15:06:37 2014 +0000 profiling: Make "struct profile_header" static Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 7c1f6c7f61f27ec8e115cdce1e2ac15addd8fb84) commit ef6b3da21673e5a9dd6ba69f8fbc09b911bec1d1 Author: Jeremy Allison <j...@samba.org> Date: Fri Nov 21 21:28:14 2014 -0800 s4: torture: leases - Add test for leases and blocking locks. Signed-off-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> Autobuild-User(master): Stefan Metzmacher <me...@samba.org> Autobuild-Date(master): Thu Nov 27 19:08:24 CET 2014 on sn-devel-104 (cherry picked from commit c6a5eab3690d2926d66024a35e3c3e818d7e4935) commit 4ee38b0640be5ccd9e203e418953dc58cd0f2337 Author: Jeremy Allison <j...@samba.org> Date: Mon Nov 17 14:17:34 2014 -0800 s4: smb2 : torture: Add new dynamic_share leases test. Depends on new share "dynamic_share" being set up containing an %R in the path= statement. Shows we will break leases and fail to grant new ones if we get a lease_key+client guid pair match on files with different fileid's, as can happen on dynamic shares. Signed-off-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit 62c6c79011d7e62423fa97d4cabd9de149af8311) commit c9ddda46fbcf989e9d4fda297066e19e15429fb0 Author: Jeremy Allison <j...@samba.org> Date: Fri Nov 14 10:24:40 2014 -0800 s3: leases - torture test for timeout of responding to lease break request. Passes against W2K12. Signed-off-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit f76c7c7404c1a67389b701bd1ab24d3b2938c212) commit 490eeac608df4eb82b81ee5affedc928b45be90c Author: Stefan Metzmacher <me...@samba.org> Date: Wed Nov 26 14:00:24 2014 +0100 s4:torture/smb2: smb2.lease.breaking6 test The client is allowed to downgrade a lease to a lower value than required. Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit ea25f0d32a045e30d69aab4d84b15cf13a6e32ea) commit f722f42bbb85efede5b2d6e2e7a51582e6430c6b Author: Stefan Metzmacher <me...@samba.org> Date: Wed Nov 26 10:25:45 2014 +0100 s4:torture/smb2: smb2.lease.breaking5 test This is like breaking4, but with an initial "R" lease instead of "RH". Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 6494597c0451944e2599736af116d6838e6aac4e) commit 300256808c7218b6c4d700dce12781299572fff8 Author: Stefan Metzmacher <me...@samba.org> Date: Sat Nov 15 11:58:01 2014 +0100 s4:torture/smb2: smb2.lease.breaking4 test This demonstrates that a confliciting open with NTCREATEX_DISP_OVERWRITE isn't delayed by a "RH" lease, even if a lease is in 'breaking' mode. Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit b3a985ab6662cacb2ac399c667b48e03c0bd1bfe) commit 34bcf75f1325c391c43de470390a0a0124c6b538 Author: Stefan Metzmacher <me...@samba.org> Date: Wed Nov 12 15:43:56 2014 +0100 s4:torture/smb2: smb2.lease.breaking3 test This demonstrates a race case where the client reuses a lease, while the server already sent a break. The open succeeds with SMB2_LEASE_FLAG_BREAK_IN_PROGRESS being set. This is more complex that smb2.lease.breaking[1-2] as it generates breaks from RWH => RH => R => NONE. Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 8d16a2e36762f6da825106798689c96aff95437f) commit 544e4588589f932179a1dd347b0ad652d0faead3 Author: Stefan Metzmacher <me...@samba.org> Date: Sat Nov 15 11:58:01 2014 +0100 s4:torture/smb2: smb2.lease.breaking2 test This demonstrates that a conflicting open with NTCREATEX_DISP_OVERWRITE breaks a lease to NONE. It also shows which error codes are generated for unexpected lease break acks. Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 5a652dbb92231183070b2d139d3459be8fd89439) commit 44587fbcc04f55368c5d308a9b6582ee75b5c12f Author: Stefan Metzmacher <me...@samba.org> Date: Wed Nov 12 15:43:56 2014 +0100 s4:torture/smb2: smb2.lease.breaking1 test This demonstrates a race case where the client reuses a lease, while the server already sent a break. The open succeeds with SMB2_LEASE_FLAG_BREAK_IN_PROGRESS being set. Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit a7a59b16a4920181fd0e2484c24b448ff8642e88) commit fe2cac8d664f1cc62ca8034b99a553793c593712 Author: Stefan Metzmacher <me...@samba.org> Date: Wed Nov 12 15:43:56 2014 +0100 s4:torture/smb2: make it possible to skip the automatic ack of lease breaks. Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 0c239d32094f8cc20bd36b55a4d08f57d04bd263) commit b561f46cf692694b273d41e8a794d450442c4707 Author: Stefan Metzmacher <me...@samba.org> Date: Wed Nov 12 09:53:45 2014 +0100 s4:torture/smb2: add smb2.lease.v2_epoch[2|3] tests They demonstrate that the lease version (v1 or v2) is selected by the first open. All following opens using the other version still get the lease version of the first open. This implies that the server has to remember the lease version more globaly. Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit c18c84ca6ca04815e8ffedb3d6f8abadad06500b) commit 3ddd8ce5fb5136bcbc12477bd43388fa6598273b Author: Stefan Metzmacher <me...@samba.org> Date: Tue Nov 11 19:35:59 2014 +0100 s4:torture/smb2: add smb2.lease.[v2_]complex1 tests These tests verify the lease state is consistent between two connections with the same client_guid. Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 45c98b8069f6b94115616d7fddef515c76d7767e) commit e5c0f23b2272379505d735b6a39c69785abaadbb Author: Stefan Metzmacher <me...@samba.org> Date: Wed Nov 12 15:41:50 2014 +0100 s4:torture/smb2: pass the expected flags to CHECK_LEASE() Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 90c886e9656a1360ffdb8eaa80ad2b6c987f73ef) commit e37a059e901c34b821fb8884b6d19629d3cf14aa Author: Stefan Metzmacher <me...@samba.org> Date: Wed Nov 12 09:15:58 2014 +0100 s4:torture/smb2: don't check the lease break connection against samba3 Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit a9d46264ab3eb53cf4a70edf4e5dad2fe6d86e6c) commit c5bddf4ee3e920c4dd9a509e7de9807c71ab58de Author: Stefan Metzmacher <me...@samba.org> Date: Tue Nov 11 19:35:07 2014 +0100 s4:torture/smb2: always verify the v2 lease epoch. Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit c0f2b46d69dc7e729bac766785b26a1911a80825) commit b341d298a24f60758b587560b6a456542563ac2c Author: Stefan Metzmacher <me...@samba.org> Date: Wed Nov 12 17:00:44 2014 +0100 s4:torture/smb2: verify lease_flags in CHECK_LEASE_BREAK() Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 8fa2fb7dde10640ded645d8180d441012dbad155) commit 9f6162f969073f42ddba5ac1ed994f91ccd423cf Author: Stefan Metzmacher <me...@samba.org> Date: Wed Nov 12 07:24:16 2014 +0100 s4:torture/smb2: lease per test fnames Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 2742257be693d57c075523e2691137692aa9e34a) commit ef7ddd506917bd55dbd0f2667eff996adc297d33 Author: Stefan Metzmacher <me...@samba.org> Date: Wed Nov 12 07:23:31 2014 +0100 s4:torture/smb2: make lease tests more reliable by calling torture_wait_for_lease_break() They now work against w2k8r2, w2012, w2012r2. Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 34926bd4bd13ea6518273e94473fbb47b7cf565e) commit 43235a0fc5c9dd579992b972f847f3b33722e7ac Author: Stefan Metzmacher <me...@samba.org> Date: Wed Nov 12 07:19:49 2014 +0100 s4:torture/smb2: skip lease tests if the server doesn't support them Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 683b9569487bd30ecd0ba677367dbe9e0eff16c2) commit 98e2dd65dcd498734efc94aa6ada50a34cf03352 Author: Stefan Metzmacher <me...@samba.org> Date: Wed Nov 12 11:13:15 2014 +0100 s4:libcli/smb2: initialize ls->lease_version Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 38b0fded58f9e066ad7190f7797cdfb92d3d23ff) commit 4cc1b07f73ee39eb17719338961fa6d2ecb4b53d Author: Stefan Metzmacher <me...@samba.org> Date: Tue Nov 11 19:33:13 2014 +0100 s4:libcli/smb2: add new_epoch to struct smb2_lease_break Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 3327615c23fbfd26b572b01acfe7e1402f018a16) commit 7ee9174cacab898c6f76c0a259846df7e81d0525 Author: Stefan Metzmacher <me...@samba.org> Date: Thu Nov 20 14:38:09 2014 +0100 s4:param: don't expand PROTOCOL_DEFAULT in lpcfg_smbcli_options() We let the low-level smb1 or smb2 code assign what PROTOCOL_DEFAULT means. Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit d7669ea451fa445b6ec77fa08d951fa59b08ab5f) commit ac4b4531f37876c6851c9b0178ae219fa720ac10 Author: Stefan Metzmacher <me...@samba.org> Date: Thu Nov 20 14:35:38 2014 +0100 s4:libcli/smb2: allow the caller to specify a specific value for max_protocol. The default is still PROTOCOL_LATEST. As smb2_connect*() is about SMB2/3 only we upgrade to PROTOCOL_LATEST if PROTOCOL_NT1 or lower is given. Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit d0a1995b934895ae9f0bbeed52772a4ef5d4b0dd) commit 19141e17c672fc03fb388936f04ba5ec86055982 Author: Stefan Metzmacher <me...@samba.org> Date: Thu Nov 20 14:32:40 2014 +0100 s4:libcli/raw: fix up the max_protocol value for the current transport connection This allows the caller to pass PROTOCOL_DEFAULT, which results in PROTOCOL_NT1. As smbcli_transport_init() is about SMB1 only we downgrade to PROTOCOL_NT1 if a higher value (for SMB2 or SMB3) was given. Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit bc83e45a19deccfb0106c9ad79b0624b1c5d1fa7) commit 2cd321c2b3b6e3a302a7b3f8c2ac434c2b30aab6 Author: Stefan Metzmacher <me...@samba.org> Date: Thu Nov 20 14:30:31 2014 +0100 s4:libcli/smb_composite: use the options on the transport These are the options which really belong to the connection and might not be the the same as the hints given from the caller. Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 55750f010423b0548e9d6b8f5745d7ad5fc4b773) commit eecd04d647dd6baa4ae997973c734484bfc7d7f8 Author: Stefan Metzmacher <me...@samba.org> Date: Thu Nov 13 12:10:46 2014 +0100 s3:smb2_create: send interim responses after 0.5 milliseconds We don't have to care about delayed NT_STATUS_SHARING_VIOLATION anymore after the following commit: commit 4111fcfd4f570d39d46a0d414546ca62c7b609be Author: Jeremy Allison <j...@samba.org> Date: Thu May 2 11:12:47 2013 -0700 Only do the 1 second delay for sharing violations for SMB1, not SMB2. Match Windows behavior. Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit fe0ad5c66884da5e7cba5c7b0d40a8c41cf6a63b) commit a69a575729137d3b95ed108d32a17abb29c029ed Author: Stefan Metzmacher <me...@samba.org> Date: Wed Nov 26 11:06:16 2014 +0100 Revert "libcli/smb: mask off SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET for version 1" This reverts commit a6affb7bb3ff595165e708c56ede2181f0bb570f. This is not really needed. The caller should ignore this flag. Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 334089c1015ca35ee37d4c9bf5da455e72c3e86e) commit 56da06ab99ebead161233b45c316fcc717988c1b Author: Volker Lendecke <v...@samba.org> Date: Tue Sep 23 18:49:46 2014 +0200 s3:smb2_break: First test for NT_STATUS_INVALID_OPLOCK_PROTOCOL, then for in_oplock_level being reasonable Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Wed Nov 12 00:03:34 CET 2014 on sn-devel-104 (cherry picked from commit 2d44498740d98edd9d09f12d35dc91d8d17e0c62) commit fa9a93509682cc48fe6056d5b2d6b354958a2247 Author: Volker Lendecke <v...@samba.org> Date: Tue Oct 28 15:27:09 2014 -0700 s3:locking: convert brl_have_read field to brl_num_read. Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit 837e29035c911f3509135252c3f423d0f56b606d) commit eb5ae0c25f314949c6ffb2ecd4ff91363810b437 Author: Jeremy Allison <j...@samba.org> Date: Wed Oct 22 17:53:01 2014 -0700 s3:smbd: Don't set fsp->oplock_type before we've granted any oplocks. It's not needed, and may lead to unexpected side effects. grant_fsp_oplock_type() is the only place to touch this. Signed-off-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit 1020c5942a996e3e900e2b81f9964dd61fc9c71d) commit 55fe85747359cf3d001991a21365d051148f0d57 Author: Volker Lendecke <v...@samba.org> Date: Tue Oct 28 15:27:09 2014 -0700 s3:smbd: move all oplock granting code to grant_fsp_oplock_type() Pair-Programmed-With: Stefan Metzmacher <me...@samba.org> Pair-Programmed-With: Jeremy Allison <j...@samba.org> Signed-off-by: Volker Lendecke <v...@samba.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> Signed-off-by: Jeremy Allison <j...@samba.org> (cherry picked from commit a08b0e78220f84f87b2af1535d645a994a5c93ab) commit a2f10ba8b6a113d5d74bd5b50d0f6c34f2c1adf7 Author: Volker Lendecke <v...@samba.org> Date: Tue Sep 23 23:34:14 2014 +0200 s3:smbd: break oplocks to none with FILE_OVERWRITE Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit 87a102189bf2d87e39dd1762fff92465aa7be5ec) commit ee617e497a186a3a72af0b56ddaa915006b54adf Author: Jeremy Allison <j...@samba.org> Date: Tue Nov 4 21:44:45 2014 -0800 libcli/smb: Add smb2_lease_equal() which compares client_guids and keys. Signed-off-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Fri Nov 7 22:41:47 CET 2014 on sn-devel-104 (cherry picked from commit dbb191f35bb093ad7fc8839b3d47e508be8f6069) commit fae8acafc90a3652b7d0bd5e68821d13b1f8393c Author: Volker Lendecke <v...@samba.org> Date: Wed Oct 29 13:55:16 2014 +0100 libcli/smb: add smb2_lease_key_equal() helper function Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit 2fc8f761c188b1abc90df68003b05b7a098aeabe) commit c813932e3fe8206fa1f659d74bbc2558f20e82eb Author: Volker Lendecke <v...@samba.org> Date: Mon Sep 22 21:21:36 2014 +0200 libcli/smb: mask off SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET for version 1 Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit a6affb7bb3ff595165e708c56ede2181f0bb570f) commit f85ee9b8ebebb2022ecb1b226d5756b91f8de360 Author: Volker Lendecke <v...@samba.org> Date: Tue Sep 23 22:56:41 2014 +0200 libcli/smb: remember the lease_version in struct smb2_lease Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit 171cefe48fe1d312c60426c09876700a07d45547) commit 6eb4aa27d3af2a212b5d434f218c8c42203057ff Author: Jeremy Allison <j...@samba.org> Date: Wed Nov 5 10:12:20 2014 -0800 s4:torture: Add smb2.oplock test batch9a and raw.oplock test batch9a Shows attribute(stat) access open can create a file, and subsequent attribute(stat) opens don't break oplocks. Can be extended to explore more varients. Signed-off-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit 8db5150143c4770bf2ffc40a5234f7b090ec8208) commit 30999a33d302a144710a3ca2a8ada98c98956f9a Author: Andrew Bartlett <abart...@samba.org> Date: Tue Sep 23 14:08:10 2014 -0700 s3-winbindd: Allow winbindd to connect over SMB2 to servers This allows SMB signing to work against many more DCs, and so improves network security. The default for "client max protocol" remains NT1 in the rest of the code. Andrew Bartlett Signed-off-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit 14f6256c515ff4af4f478f947ad89b7edc8743cf) commit 53e0e53f6533b5dc418d46482b4527a8fce2335a Author: Günther Deschner <g...@samba.org> Date: Wed Dec 3 16:55:39 2014 +0100 pam_winbind: fix warn_pwd_expire implementation. BUG: https://bugzilla.samba.org/show_bug.cgi?id=9056 warn_pwd_expire parameter is not working as documented in pam_winbind manual page. This patch adds missing bit and allows disabling warning message fully, i.e. setting warn time to zero days. Guenther Signed-off-by: Guenther Deschner <g...@samba.org> Reviewed-by: Andreas Schneider <a...@samba.org> Reviewed-by: Guenther Deschner <g...@samba.org> Autobuild-User(master): Günther Deschner <g...@samba.org> Autobuild-Date(master): Wed Dec 3 21:36:49 CET 2014 on sn-devel-104 ----------------------------------------------------------------------- Summary of changes: docs-xml/smbdotconf/locking/kerneloplocks.xml | 1 + docs-xml/smbdotconf/locking/oplocks.xml | 1 + docs-xml/smbdotconf/locking/smb2leases.xml | 31 + docs-xml/smbdotconf/protocol/clientmaxprotocol.xml | 9 +- docs-xml/smbdotconf/tuning/writecachesize.xml | 5 + lib/param/loadparm.c | 11 +- lib/param/param_table.c | 12 +- libcli/smb/smb2_lease.c | 15 + libcli/smb/smb2_lease.h | 7 + libcli/smb/smb_constants.h | 3 +- librpc/idl/smb2_lease_struct.idl | 1 + nsswitch/pam_winbind.c | 5 +- packaging/RHEL-CTDB/configure.rpm | 1 - packaging/RHEL-CTDB/samba.spec.tmpl | 3 - packaging/RHEL/samba.spec.tmpl | 2 - selftest/knownfail | 14 +- selftest/target/Samba3.pm | 11 + source3/include/proto.h | 2 + source3/include/smb.h | 1 + source3/include/smbprofile.h | 20 +- source3/include/vfs.h | 2 + source3/librpc/idl/leases_db.idl | 23 + source3/librpc/idl/open_files.idl | 36 + source3/librpc/idl/wscript_build | 1 + source3/librpc/wscript_build | 7 +- source3/libsmb/smb_share_modes.c | 8 + source3/libsmb/smbsharemodes.pc.in | 11 - source3/locking/brlock.c | 123 +- source3/locking/leases_db.c | 387 +++ source3/locking/leases_db.h | 46 + source3/locking/locking.c | 188 +- source3/locking/proto.h | 17 +- source3/locking/share_mode_lock.c | 24 +- source3/param/loadparm.c | 21 +- source3/profile/profile.c | 29 +- .../profile/profile_dummy.c | 19 +- source3/smbd/durable.c | 28 +- source3/smbd/fileio.c | 36 +- source3/smbd/files.c | 39 + source3/smbd/globals.h | 10 +- source3/smbd/open.c | 793 +++++-- source3/smbd/oplock.c | 683 +++++- source3/smbd/proto.h | 24 + source3/smbd/server.c | 7 +- source3/smbd/smb2_break.c | 273 ++- source3/smbd/smb2_create.c | 164 +- source3/smbd/smb2_negprot.c | 8 + source3/smbd/smb2_server.c | 36 +- source3/utils/status.c | 9 + source3/utils/status_profile.c | 21 - .../utils/status_profile_dummy.c | 23 +- source3/winbindd/winbindd_cm.c | 2 +- source3/wscript_build | 36 +- source4/libcli/raw/clitransport.c | 8 + source4/libcli/raw/interfaces.h | 1 + source4/libcli/smb2/connect.c | 3 +- source4/libcli/smb2/create.c | 2 + source4/libcli/smb2/transport.c | 9 + source4/libcli/smb_composite/connect.c | 2 +- source4/param/loadparm.c | 2 +- source4/torture/raw/oplock.c | 121 + source4/torture/smb2/lease.c | 2484 ++++++++++++++++++-- source4/torture/smb2/oplock.c | 128 + 63 files changed, 5403 insertions(+), 646 deletions(-) create mode 100644 docs-xml/smbdotconf/locking/smb2leases.xml create mode 100644 source3/librpc/idl/leases_db.idl delete mode 100644 source3/libsmb/smbsharemodes.pc.in create mode 100644 source3/locking/leases_db.c create mode 100644 source3/locking/leases_db.h copy lib/util/close_low_fd.h => source3/profile/profile_dummy.c (69%) copy lib/util/close_low_fd.h => source3/utils/status_profile_dummy.c (66%) Changeset truncated at 500 lines: diff --git a/docs-xml/smbdotconf/locking/kerneloplocks.xml b/docs-xml/smbdotconf/locking/kerneloplocks.xml index 8e3bba5..d8fe223 100644 --- a/docs-xml/smbdotconf/locking/kerneloplocks.xml +++ b/docs-xml/smbdotconf/locking/kerneloplocks.xml @@ -25,5 +25,6 @@ <related>oplocks</related> <related>level2 oplocks</related> +<related>smb2 leases</related> <value type="default">no</value> </samba:parameter> diff --git a/docs-xml/smbdotconf/locking/oplocks.xml b/docs-xml/smbdotconf/locking/oplocks.xml index a56e921..a5e163b 100644 --- a/docs-xml/smbdotconf/locking/oplocks.xml +++ b/docs-xml/smbdotconf/locking/oplocks.xml @@ -25,5 +25,6 @@ <related>kernel oplocks</related> <related>level2 oplocks</related> +<related>smb2 leases</related> <value type="default">yes</value> </samba:parameter> diff --git a/docs-xml/smbdotconf/locking/smb2leases.xml b/docs-xml/smbdotconf/locking/smb2leases.xml new file mode 100644 index 0000000..9241bc8 --- /dev/null +++ b/docs-xml/smbdotconf/locking/smb2leases.xml @@ -0,0 +1,31 @@ +<samba:parameter name="smb2 leases" + context="G" + type="boolean" + xmlns:samba="http://www.samba.org/samba/DTD/samba-doc"> +<description> + <para> + This boolean option tells <command moreinfo="none">smbd</command> whether to + globally negotiate SMB2 leases on file open requests. Leasing is an SMB2-only + feature which allows clients to aggressively cache files locally above and + beyond the caching allowed by SMB1 oplocks. This (experimental) parameter is + set to off by default until the SMB2 leasing code is declared fully stable. + </para> + + <para> + This is only available with <smbconfoption name="oplocks">yes</smbconfoption> + and <smbconfoption name="kernel oplocks">no</smbconfoption>. + </para> + + <para>Note that the write cache won't be used for file handles with a smb2 write lease.</para> + + <para> + The Samba implementation of leases is currently marked as experimental! + </para> +</description> + +<related>oplocks</related> +<related>kernel oplocks</related> +<related>level2 oplocks</related> +<related>write cache size</related> +<value type="default">no</value> +</samba:parameter> diff --git a/docs-xml/smbdotconf/protocol/clientmaxprotocol.xml b/docs-xml/smbdotconf/protocol/clientmaxprotocol.xml index 6693cd3..121eeb8 100644 --- a/docs-xml/smbdotconf/protocol/clientmaxprotocol.xml +++ b/docs-xml/smbdotconf/protocol/clientmaxprotocol.xml @@ -2,6 +2,7 @@ context="G" type="enum" developer="1" + function="_client_max_protocol" xmlns:samba="http://www.samba.org/samba/DTD/samba-doc"> <description> <para>The value of the parameter (a string) is the highest @@ -71,11 +72,15 @@ <para>Normally this option should not be set as the automatic negotiation phase in the SMB protocol takes care of choosing the appropriate protocol.</para> + + <para>The value <constant>default</constant> refers to the default protocol in each + part of the code, currently <constant>NT1</constant> in the client tools and + <constant>SMB3_02</constant> in winbindd.</para> </description> <related>server max protocol</related> -<related>client mn protocol</related> +<related>client min protocol</related> -<value type="default">NT1</value> +<value type="default">default</value> <value type="example">LANMAN1</value> </samba:parameter> diff --git a/docs-xml/smbdotconf/tuning/writecachesize.xml b/docs-xml/smbdotconf/tuning/writecachesize.xml index 12965b4..e2fa17f 100644 --- a/docs-xml/smbdotconf/tuning/writecachesize.xml +++ b/docs-xml/smbdotconf/tuning/writecachesize.xml @@ -21,8 +21,13 @@ <para>The integer parameter specifies the size of this cache (per oplocked file) in bytes.</para> + + <para>Note that the write cache won't be used for file handles with a smb2 write lease.</para> </description> +<related>aio read size</related> +<related>aio write size</related> +<related>smb2 leases</related> <value type="default">0</value> <value type="example">262144<comment> for a 256k cache size per file</comment></value> </samba:parameter> diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c index 56c6796..dff1ca9 100644 --- a/lib/param/loadparm.c +++ b/lib/param/loadparm.c @@ -2475,7 +2475,7 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx) lpcfg_do_global_parameter(lp_ctx, "server min protocol", "LANMAN1"); lpcfg_do_global_parameter(lp_ctx, "server max protocol", "SMB3"); lpcfg_do_global_parameter(lp_ctx, "client min protocol", "CORE"); - lpcfg_do_global_parameter(lp_ctx, "client max protocol", "NT1"); + lpcfg_do_global_parameter(lp_ctx, "client max protocol", "default"); lpcfg_do_global_parameter(lp_ctx, "security", "AUTO"); lpcfg_do_global_parameter(lp_ctx, "EncryptPasswords", "True"); lpcfg_do_global_parameter(lp_ctx, "ReadRaw", "True"); @@ -3149,6 +3149,15 @@ int lpcfg_security(struct loadparm_context *lp_ctx) lpcfg__security(lp_ctx)); } +int lpcfg_client_max_protocol(struct loadparm_context *lp_ctx) +{ + int client_max_protocol = lpcfg__client_max_protocol(lp_ctx); + if (client_max_protocol == PROTOCOL_DEFAULT) { + return PROTOCOL_NT1; + } + return client_max_protocol; +} + bool lpcfg_server_signing_allowed(struct loadparm_context *lp_ctx, bool *mandatory) { bool allowed = true; diff --git a/lib/param/param_table.c b/lib/param/param_table.c index 4d0e6a9..c57f783 100644 --- a/lib/param/param_table.c +++ b/lib/param/param_table.c @@ -38,6 +38,7 @@ #endif static const struct enum_list enum_protocol[] = { + {PROTOCOL_DEFAULT, "default"}, /* the caller decides what this means */ {PROTOCOL_SMB2_10, "SMB2"}, /* for now keep PROTOCOL_SMB2_10 */ {PROTOCOL_SMB3_00, "SMB3"}, /* for now keep PROTOCOL_SMB3_00 */ {PROTOCOL_SMB3_02, "SMB3_02"}, @@ -1386,7 +1387,7 @@ struct parm_struct parm_table[] = { .label = "client max protocol", .type = P_ENUM, .p_class = P_GLOBAL, - .offset = GLOBAL_VAR(client_max_protocol), + .offset = GLOBAL_VAR(_client_max_protocol), .special = NULL, .enum_list = enum_protocol, .flags = FLAG_ADVANCED, @@ -3008,6 +3009,15 @@ struct parm_struct parm_table[] = { .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, }, { + .label = "smb2 leases", + .type = P_BOOL, + .p_class = P_GLOBAL, + .offset = GLOBAL_VAR(smb2_leases), + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { .label = "locking", .type = P_BOOL, .p_class = P_LOCAL, diff --git a/libcli/smb/smb2_lease.c b/libcli/smb/smb2_lease.c index f97f096..fc641ff 100644 --- a/libcli/smb/smb2_lease.c +++ b/libcli/smb/smb2_lease.c @@ -43,6 +43,7 @@ ssize_t smb2_lease_pull(const uint8_t *buf, size_t len, lease->lease_state = IVAL(buf, 16); lease->lease_flags = IVAL(buf, 20); lease->lease_duration = BVAL(buf, 24); + lease->lease_version = version; switch (version) { case 1: @@ -85,3 +86,17 @@ bool smb2_lease_push(const struct smb2_lease *lease, uint8_t *buf, size_t len) return true; } + +bool smb2_lease_key_equal(const struct smb2_lease_key *k1, + const struct smb2_lease_key *k2) +{ + return ((k1->data[0] == k2->data[0]) && (k1->data[1] == k2->data[1])); +} + +bool smb2_lease_equal(const struct GUID *g1, + const struct smb2_lease_key *k1, + const struct GUID *g2, + const struct smb2_lease_key *k2) +{ + return GUID_equal(g1, g2) && smb2_lease_key_equal(k1, k2); +} diff --git a/libcli/smb/smb2_lease.h b/libcli/smb/smb2_lease.h index ba8178d..2e6faf7 100644 --- a/libcli/smb/smb2_lease.h +++ b/libcli/smb/smb2_lease.h @@ -23,6 +23,7 @@ #ifndef _LIBCLI_SMB_SMB2_LEASE_H_ #define _LIBCLI_SMB_SMB2_LEASE_H_ +#include "librpc/gen_ndr/ndr_misc.h" #include "librpc/gen_ndr/smb2_lease_struct.h" /* @@ -32,5 +33,11 @@ ssize_t smb2_lease_pull(const uint8_t *buf, size_t len, struct smb2_lease *lease); bool smb2_lease_push(const struct smb2_lease *lease, uint8_t *buf, size_t len); +bool smb2_lease_key_equal(const struct smb2_lease_key *k1, + const struct smb2_lease_key *k2); +bool smb2_lease_equal(const struct GUID *g1, + const struct smb2_lease_key *k1, + const struct GUID *g2, + const struct smb2_lease_key *k2); #endif /* _LIBCLI_SMB_SMB2_LEASE_H_ */ diff --git a/libcli/smb/smb_constants.h b/libcli/smb/smb_constants.h index 763f4fa..f841ca9 100644 --- a/libcli/smb/smb_constants.h +++ b/libcli/smb/smb_constants.h @@ -76,7 +76,8 @@ /* protocol types. It assumes that higher protocols include lower protocols as subsets. */ enum protocol_types { - PROTOCOL_NONE, + PROTOCOL_DEFAULT=-1, + PROTOCOL_NONE=0, PROTOCOL_CORE, PROTOCOL_COREPLUS, PROTOCOL_LANMAN1, diff --git a/librpc/idl/smb2_lease_struct.idl b/librpc/idl/smb2_lease_struct.idl index be80d14..5ccd8a3 100644 --- a/librpc/idl/smb2_lease_struct.idl +++ b/librpc/idl/smb2_lease_struct.idl @@ -28,6 +28,7 @@ interface smb2_lease_struct uint32 lease_flags; hyper lease_duration; /* should be 0 */ smb2_lease_key parent_lease_key; + uint16 lease_version; uint16 lease_epoch; } smb2_lease; }; \ No newline at end of file diff --git a/nsswitch/pam_winbind.c b/nsswitch/pam_winbind.c index 98ec64f..1a21a83 100644 --- a/nsswitch/pam_winbind.c +++ b/nsswitch/pam_winbind.c @@ -508,6 +508,9 @@ config_from_pam: ctrl |= WINBIND_CACHED_LOGIN; else if (!strcasecmp(*v, "mkhomedir")) ctrl |= WINBIND_MKHOMEDIR; + else if (!strncasecmp(*v, "warn_pwd_expire", + strlen("warn_pwd_expire"))) + ctrl |= WINBIND_WARN_PWD_EXPIRE; else if (type != PAM_WINBIND_CLEANUP) { __pam_log(pamh, ctrl, LOG_ERR, "pam_parse: unknown option: %s", *v); @@ -2379,7 +2382,7 @@ static int get_warn_pwd_expire_from_config(struct pwb_context *ctx) ret = get_config_item_int(ctx, "warn_pwd_expire", WINBIND_WARN_PWD_EXPIRE); /* no or broken setting */ - if (ret <= 0) { + if (ret < 0) { return DEFAULT_DAYS_TO_WARN_BEFORE_PWD_EXPIRES; } return ret; diff --git a/packaging/RHEL-CTDB/configure.rpm b/packaging/RHEL-CTDB/configure.rpm index 398a3f9..62a326c 100755 --- a/packaging/RHEL-CTDB/configure.rpm +++ b/packaging/RHEL-CTDB/configure.rpm @@ -53,7 +53,6 @@ CC="$CC" CFLAGS="-Wall -g -D_GNU_SOURCE -O3" ./configure -C \ --enable-fhs \ --with-pam_smbpass \ --with-libsmbclient \ - --with-libsmbsharemodes \ --without-smbwrapper \ --with-pam \ --with-quotas \ diff --git a/packaging/RHEL-CTDB/samba.spec.tmpl b/packaging/RHEL-CTDB/samba.spec.tmpl index c1789f2..056c00f 100644 --- a/packaging/RHEL-CTDB/samba.spec.tmpl +++ b/packaging/RHEL-CTDB/samba.spec.tmpl @@ -171,7 +171,6 @@ CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \ --enable-fhs \ --with-pam_smbpass \ --with-libsmbclient \ - --with-libsmbsharemodes \ --without-smbwrapper \ --with-pam \ --with-quotas \ @@ -544,8 +543,6 @@ exit 0 %{_includedir}/libsmbclient.h %{_libarchdir}/libsmbclient.* %{_includedir}/smb_share_modes.h -%{_libarchdir}/libsmbsharemodes.so -%{_libarchdir}/libsmbsharemodes.so.0 %{_includedir}/netapi.h %{_includedir}/wbclient.h diff --git a/packaging/RHEL/samba.spec.tmpl b/packaging/RHEL/samba.spec.tmpl index 05e46e1..ed37994 100644 --- a/packaging/RHEL/samba.spec.tmpl +++ b/packaging/RHEL/samba.spec.tmpl @@ -167,7 +167,6 @@ CC="$CC" CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \ --with-fhs \ --with-pam_smbpass \ --with-libsmbclient \ - --with-libsmbsharemodes \ --without-smbwrapper \ --with-pam \ --with-quotas \ @@ -470,7 +469,6 @@ fi %{_includedir}/libsmbclient.h %{_libarchdir}/libsmbclient.* %{_includedir}/smb_share_modes.h -%{_libarchdir}/libsmbsharemodes.* %{_libarchdir}/samba/*.dat %{_libarchdir}/samba/*.msg diff --git a/selftest/knownfail b/selftest/knownfail index 6cca3dd..af7e7fd 100644 --- a/selftest/knownfail +++ b/selftest/knownfail @@ -167,6 +167,7 @@ ^samba4.smb2.oplock.batch1\(.*\)$ # samba 4 oplocks are a mess ^samba4.smb2.oplock.batch6\(.*\)$ # samba 4 oplocks are a mess ^samba4.smb2.oplock.batch9\(.*\)$ # samba 4 oplocks are a mess +^samba4.smb2.oplock.batch9a\(.*\)$ # samba 4 oplocks are a mess ^samba4.smb2.oplock.batch10\(.*\)$ # samba 4 oplocks are a mess ^samba4.smb2.oplock.batch20\(.*\)$ # samba 4 oplocks are a mess ^samba4.smb2.oplock.batch26\(.*\)$ @@ -188,25 +189,12 @@ ^samba3.smb2.notify.valid-req ^samba3.smb2.notify.dir ^samba3.smb2.notify.rec -^samba3.smb2.durable-open.lock-lease ^samba3.smb2.durable-open.delete_on_close2 -^samba3.smb2.durable-v2-open.open-lease -^samba3.smb2.durable-v2-open.persistent-open-lease ^samba3.smb2.durable-v2-open.app-instance ^samba4.smb2.ioctl.req_resume_key\(dc\) # not supported by s4 ntvfs server ^samba4.smb2.ioctl.copy_chunk_\w*\(dc\) # not supported by s4 ntvfs server ^samba3.smb2.dir.one ^samba3.smb2.dir.modify -^samba3.smb2.lease.request -^samba3.smb2.lease.upgrade -^samba3.smb2.lease.break -^samba3.smb2.lease.oplock -^samba3.smb2.lease.multibreak -^samba3.smb2.lease.v2_request -^samba3.smb2.lease.v2_request_parent -^samba3.smb2.lease.break_twice -^samba3.smb2.lease.nobreakself -^samba3.smb2.lease.v2_epoch1 ^samba3.smb2.oplock.batch20 ^samba3.smb2.oplock.stream1 ^samba3.smb2.streams.rename diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index ebe2c09..a495685 100755 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -876,6 +876,12 @@ sub provision($$$$$$) my $badnames_shrdir="$shrdir/badnames"; push(@dirs,$badnames_shrdir); + my $lease1_shrdir="$shrdir/SMB2_10"; + push(@dirs,$lease1_shrdir); + + my $lease2_shrdir="$shrdir/SMB3_00"; + push(@dirs,$lease2_shrdir); + # this gets autocreated by winbindd my $wbsockdir="$prefix_abs/winbindd"; my $wbsockprivdir="$lockdir/winbindd_privileged"; @@ -1048,6 +1054,7 @@ sub provision($$$$$$) kernel oplocks = no kernel change notify = no + smb2 leases = yes syslog = no printing = bsd @@ -1220,6 +1227,10 @@ sub provision($$$$$$) [badname-tmp] path = $badnames_shrdir guest ok = yes + +[dynamic_share] + path = $shrdir/%R + guest ok = yes "; close(CONF); diff --git a/source3/include/proto.h b/source3/include/proto.h index eed57ff..ce23289 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -987,6 +987,8 @@ bool lp_idmap_default_range(uint32_t *low, uint32_t *high); const char *lp_idmap_backend(const char *domain_name); const char *lp_idmap_default_backend (void); int lp_security(void); +int lp_client_max_protocol(void); +int lp_winbindd_max_protocol(void); int lp_smb2_max_credits(void); int lp_cups_encrypt(void); bool lp_widelinks(int ); diff --git a/source3/include/smb.h b/source3/include/smb.h index aab4ff5..7bace88 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -577,6 +577,7 @@ enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT, #define EXCLUSIVE_OPLOCK OPLOCK_EXCLUSIVE #define BATCH_OPLOCK OPLOCK_BATCH #define LEVEL_II_OPLOCK OPLOCK_LEVEL_II +#define LEASE_OPLOCK 0x100 /* The following are Samba-private. */ #define INTERNAL_OPEN_ONLY 0x8 diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h index 8ecbc30..a37ac4f 100644 --- a/source3/include/smbprofile.h +++ b/source3/include/smbprofile.h @@ -21,13 +21,11 @@ */ +#ifdef WITH_PROFILE + /* this file defines the profile structure in the profile shared memory area */ -#define PROF_SHMEM_KEY ((key_t)0x07021999) -#define PROF_SHM_MAGIC 0x6349985 -#define PROF_SHM_VERSION 13 - /* time values in the following structure are in microseconds */ #define __profile_stats_value(which, domain) domain[which] @@ -835,7 +833,7 @@ enum profile_stats_values #define smb2_break_count __profile_stats_value(PR_VALUE_SMB2_BREAK, count) #define smb2_break_time __profile_stats_value(PR_VALUE_SMB2_BREAK, time) - /* This mist remain the last value. */ + /* This must remain the last value. */ PR_VALUE_MAX }; /* enum profile_stats_values */ @@ -876,22 +874,13 @@ struct profile_stats { unsigned writecache_allocated_write_caches; }; -struct profile_header { - int prof_shm_magic; - int prof_shm_version; - struct profile_stats stats; -}; - -extern struct profile_header *profile_h; extern struct profile_stats *profile_p; extern bool do_profile_flag; extern bool do_profile_times; -#ifdef WITH_PROFILE - /* these are helper macros - do not call them directly in the code * use the DO_PROFILE_* START_PROFILE and END_PROFILE ones - * below which test for the profile flage first + * below which test for the profile flags first */ #define INC_PROFILE_COUNT(x) profile_p->x++ #define DEC_PROFILE_COUNT(x) profile_p->x-- @@ -975,6 +964,7 @@ static inline uint64_t profile_timestamp(void) #define START_PROFILE_BYTES(x,n) #define END_PROFILE_STAMP(x, _stamp) #define END_PROFILE(x) + #endif /* WITH_PROFILE */ /* The following definitions come from profile/profile.c */ diff --git a/source3/include/vfs.h b/source3/include/vfs.h index b0f00e8..e7dc079 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -205,6 +205,8 @@ struct fd_handle { struct fsp_lease { size_t ref_count; + struct smbd_server_connection *sconn; + struct tevent_timer *timeout; -- Samba Shared Repository