summaryrefslogtreecommitdiff
path: root/source3
Commit message (Collapse)AuthorAgeFilesLines
* vfs: restore stat fields in vfs_stat_fsp()Ralph Boehme2019-09-102-0/+4
| | | | | | | | | | | | | | | | | | | | | | | This ensures we preserve btime, itime and File-ID. As the Durable Handles code calls vfs_stat_fsp() in the DH disconnect function, previously the btime was lost and NOT stored in the cookie. With this change the cookie will store the correct btime (and iflags), which requires us to call dos_mode() in the reconnect function to ensure we pass vfs_default_durable_reconnect_check_stat(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=14121 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Tue Sep 10 20:22:21 UTC 2019 on sn-devel-184 (cherry picked from commit 95655fe683d499d93f3844ed72ad332ef64adb96) Autobuild-User(v4-11-test): Stefan Metzmacher <metze@samba.org> Autobuild-Date(v4-11-test): Tue Sep 10 22:29:08 UTC 2019 on sn-devel-184
* s3:vfs: streamline vfs_stat_fsp()Ralph Boehme2019-09-101-6/+4
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14121 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit e00e78cfeda99bd5374eff8fb4ba84873e4e46b7)
* s3: replace fsp_stat() with vfs_stat_fsp()Ralph Boehme2019-09-104-31/+23
| | | | | | | | | | Both functions do the same, they differ just in the type of the returned result. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14121 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit ab03394969f8a4c748aea7d0d8ed37f9ced6cc30)
* s3:lib: add update_stat_ex_from_saved_stat()Ralph Boehme2019-09-102-0/+22
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14121 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit ac18730f10ce96a607a3a07e1360b522ebf72f38)
* vfs_catia: stat info may have been updated, make sure to return changesRalph Boehme2019-09-101-0/+4
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14121 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 4e49999c97f53acc7006f1dc6b6812bb0e156db5)
* s3:smbd: ensure to update the File-ID in struct smb_filenameRalph Boehme2019-09-101-0/+17
| | | | | | | | | | | | | | | Initialize the File-ID in fsp->fsp_name->st, any subsequent metadata fetch on this file-handle needs this, eg QFID SMB2 Create-Context or GETINFO SMB requests. It would be nice if SMB_VFS_SET_DOS_ATTRIBUTE() would do this, unfortunately it gets a const struct smb_filename. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14121 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 3483b75fed8985bd2968bbf8c85985107115fba8)
* s3:lib: round itime to NTTIME resolution in make_file_id_from_itime()Ralph Boehme2019-09-101-0/+2
| | | | | | | | | | | | | | | | | | | The rounding is needed because when a file is created via eg an SMB2 CREATE request, we need to calculate the correct File-ID for the QFID Create-Context or for a subsequent GETINFO SMB request on the same file-handle. Any later metadata request that received the File-ID will do so by going through dos_mode() -> ... -> parse_dos_attribute_blob(), where the File-ID will be calculated from the on-disk itime which has NTTIME resolution. As long as that is the only available itime backend, I'm rounding itime inside make_file_id_from_itime(), not in the callers. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14121 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 84abeaa60ffced276da2b28b8add6efaa6da5ca6)
* s4:torture: add a file-id related testRalph Boehme2019-09-101-0/+2
| | | | | | | | | | | Note I'm using the share vfs_fruit_xattr because I need a share with both a streams and a acl_* VFS object. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14121 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 2ecab3c60abf9baa16a6a5e3eba0fc4720def840)
* s3:ldap: Fix join with don't exists machine accountEvgeny Sinelnikov2019-09-101-2/+3
| | | | | | | | | | | | | | | | | | | | Add check for requested replies of existing machine object during join machine to domain. This solves regression fail during join with error: "None of the information to be translated has been translated." https://bugzilla.samba.org/show_bug.cgi?id=14007 Reviewed-by: Guenther Deschner <gd@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Wed Sep 4 17:02:37 UTC 2019 on sn-devel-184 (cherry picked from commit ad4ef1657e9b2a088a3bfadcce196cfcceead1dc) Autobuild-User(v4-11-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-11-test): Tue Sep 10 09:13:15 UTC 2019 on sn-devel-184
* s3:selftest: add delay_inject:brl_lock_windows testingStefan Metzmacher2019-09-091-0/+4
| | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Mon Sep 9 15:42:45 UTC 2019 on sn-devel-184 (cherry picked from commit 2b43ce6704ecf035e6734337a2dea3458153a4b2) Autobuild-User(v4-11-test): Stefan Metzmacher <metze@samba.org> Autobuild-Date(v4-11-test): Mon Sep 9 17:19:11 UTC 2019 on sn-devel-184
* vfs_delay_inject: add support for brl_[un]lock_windows()Stefan Metzmacher2019-09-091-0/+117
| | | | | | | | | | | | This demonstrates the two ways to handle the retry: - smb layer retry => plock->context.smblctx = UINT64_MAX - vfs backend retry => plock->context.smblctx = 0 BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit c2503a5c68e967054ab84ca0d8ce693200c2e002)
* s3:locking: add brl_req_guid() and brl_req_mem_ctx() helper functionsStefan Metzmacher2019-09-0911-5/+106
| | | | | | | | | | | This allows the vfs backend to detect a retry and keep state between the retries. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 66d92f37c3a643d97489a59bb6d1e75e91528c20)
* s3:smb2_lock: handle NT_STATUS_RETRY from the VFS backendStefan Metzmacher2019-09-091-0/+80
| | | | | | | | | | | This allows the VFS backends to implement async byte range locking. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 7471b0f63276e707784c98b832992ff08b1898ef)
* s3:blocking: handle NT_STATUS_RETRY from the VFS backendStefan Metzmacher2019-09-091-0/+84
| | | | | | | | | | | This allows the VFS backends to implement async byte range locking. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 7d1cd6f22e7e3d95aba04c45776057945c2a5e30)
* s3:blocking: make use of smbd_smb1_do_locks_try() in smbd_smb1_do_locks_send()Stefan Metzmacher2019-09-091-86/+4
| | | | | | | | | | | We only need the logic to call smbd_smb1_do_locks_check() and a possible retry once in smbd_smb1_do_locks_try(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 8975673e3c3f9f7dbdb7ba7562bb81a62cd24e2e)
* s3:blocking: call smbd_smb1_do_locks_setup_timeout() also in ↵Stefan Metzmacher2019-09-091-0/+5
| | | | | | | | | | | | | | | smbd_smb1_do_locks_try() This is a noop if smbd_smb1_do_locks_setup_timeout() was called before. But it allows us to use smbd_smb1_do_locks_try() in smbd_smb1_do_locks_send() in a following commit. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 6e30a89b3f00ad55391454fbaa1272074e1962f0)
* s3:blocking: fix the fsp->blocked_smb1_lock_reqs handlingStefan Metzmacher2019-09-091-9/+125
| | | | | | | | | | | | | | | A new request is first checks against all pending requests before checking the already granted locks. Before we retried the lock array of another request (the first in the list), but then finished current request, which is wrong. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 312327106271abafeb53e62dfb71a38bf93e2d41)
* s3:blocking: do the timeout calculation before calling ↵Stefan Metzmacher2019-09-091-16/+16
| | | | | | | | | | | | dbwrap_watched_watch_send() This makes the next commits easier to understand. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 997548a5f1a14d82f1e80cce6d9ee55e85b5107c)
* s3:blocking: split out smbd_smb1_do_locks_setup_timeout()Stefan Metzmacher2019-09-091-35/+63
| | | | | | | | | | | | | This function can be called multiple times, but only the first time will setup the endtime. And the endtime is relative to the request time and not the current time. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 8da7c10a58292022ee57406db9a365de9ffaf5cf)
* s3:blocking: use timeval_expired(&state->endtime) to stop processingStefan Metzmacher2019-09-091-8/+17
| | | | | | | | | | | | This is less racy than timeval_elapsed() > 0 as the current time is already expired and timeout = 0 will always work correct. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 5a841a43f9c4f862e2d7235429363b3066cf5850)
* s3:smb2_lock: add retry for POSIX locksStefan Metzmacher2019-09-091-0/+55
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 8decf41bbb8be2b4ac463eb6ace16a8628276ab5)
* s4:torture/smb2: add smb2.samba3misc.localposixlock1Stefan Metzmacher2019-09-091-1/+1
| | | | | | | | | | | This demonstrates that the SMB2 code path doesn't do any retry for local posix locks. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 7155d3a2c5d7237f00cccb1802c1341cf295864e)
* s3:smb2_lock: make use of smbd_smb2_lock_try() in smbd_smb2_lock_send()Stefan Metzmacher2019-09-091-62/+6
| | | | | | | | | | We only need the logic to call smbd_do_locks_try() and a possible retry once in smbd_smb2_lock_try(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 359e9992be713bbecfdb19998d69e1d3f020c5e9)
* s3:smb2_lock: let smbd_smb2_lock_try() explicitly check for the retry conditionStefan Metzmacher2019-09-091-0/+26
| | | | | | | | | | | | | This makes it possible to reuse _try() in the _send() function in the next commit. We should not retry forever on a hard error. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 7f77e0b4e9878f1f3515206d052adc012e26aafb)
* s3:smb2_lock: error out early in smbd_smb2_lock_send()Stefan Metzmacher2019-09-091-3/+19
| | | | | | | | | | | | | We no longer expect NT_STATUS_FILE_LOCK_CONFLICT from the VFS layer and assert that in a future version. This makes it easier to port the same logic to smbd_smb2_lock_try(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 39d514cdc358f175d0968f4a78f8f2f05a6c1707)
* s3:smb2_lock: split smbd_smb2_lock_retry() into _try() and _retry()Stefan Metzmacher2019-09-091-19/+30
| | | | | | | | | | | This makes it possible to reuse _try() in the _send() function in the next commits. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit d096742da1a045357f52ccd5b28d499c30e96152)
* s3:smb2_lock: move from 'blocking' to 'state->blocking'Stefan Metzmacher2019-09-091-3/+3
| | | | | | | | | | This will simplify the next commits. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit f13d13ae9da3072862a781bc926e7a06e8384337)
* s3:brlock: always return LOCK_NOT_GRANTED instead of FILE_LOCK_CONFLICTStefan Metzmacher2019-09-091-4/+4
| | | | | | | | | | | | | | Returning NT_STATUS_FILE_LOCK_CONFLICT is a SMB1 only detail for delayed brlock requests, which is handled in smbd_smb1_do_locks*(). The brlock layer should be consistent even for posix locks. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org> (cherry picked from commit ad98eec6090430ba5296a5111dde2e53b9cd217a)
* s3:blocking: maintain state->deny_statusStefan Metzmacher2019-09-091-5/+28
| | | | | | | | | | | For Windows locks we start with LOCK_NOT_GRANTED and use FILE_LOCK_CONFLICT if we retried after a timeout. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit aba0ee46258f3dd910421facb742fce3318a6946)
* s3:blocking: use dynamic posix lock wait intervalsStefan Metzmacher2019-09-091-4/+37
| | | | | | | | | | | | We want to start with a short timeout (200ms) and slow down to larger timeouts up to 2s for the default value of "lock spin time". BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 15765644d2590d6549f8fcc01c39c56387eed654)
* s3:blocking: Remove bug reproducer from a few commits agoStefan Metzmacher2019-09-091-2/+2
| | | | | | | | | | | The problem is fixed, now we can revert the change that made it easier to trigger. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 62ec58b06c38ee82bb3147c4d325413fd3a76499)
* s3:blocking: fix posix lock retryStefan Metzmacher2019-09-091-11/+25
| | | | | | | | | | | | | | | We should evaluate the timeout condition after the very last retry and not before. Otherwise we'd fail to retry when waiting for posix locks. The problem happens if the client provided timeout is smaller than the 1 sec (for testing temporary 15 secs) retry. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit e8d719d31f885d7b6d5b317165f90ec40df169c9)
* s3:blocking: move from 'timeout' to 'smbd_smb1_do_locks_state->timeout'Stefan Metzmacher2019-09-092-10/+12
| | | | | | | | | | | This will make it possible to just use smbd_smb1_do_locks_try() in a later commit. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 8fe708acb43ea36d0cbf398713b125daba180a2d)
* s3:blocking: split smbd_smb1_do_locks_retry() into _try() and _retry()Stefan Metzmacher2019-09-091-30/+42
| | | | | | | | | | | | This will make it possible to have just one caller to smbd_do_locks_try() later and use smbd_smb1_do_locks_try() from within smbd_smb1_do_locks_send(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Reviewed-by: Volker Lendecke <vl@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit e79fcfaaf2ecfca6c3747f6fe4be51f332ebf10d)
* s3:blocking: demonstrate the posix lock retry failsStefan Metzmacher2019-09-091-2/+2
| | | | | | | | | | | | | | This is just a temporary commit that shows the bug and its fix. It will be reverted once the problem is fixed. The posix lock retry fails if the client specified timeout is smaller than the hardcoded 1 second retry. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 2ec9e93a7aac2706b4a5931495d56a7b64f8d894)
* s3:torture: convert LOCK9 into LOCK9A and LOCK9BStefan Metzmacher2019-09-092-13/+28
| | | | | | | | | | | | | | LOCK9A is the original test (with a timeout of -1) and LOCK9B is the same but with timeout of 10 seconds. LOCK9B is needed to demonstrate a server bug in the next commits. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit ac28eec3e4af710feab3be3d4b25bfbe38294431)
* s3:torture: fix the timeout alarm handling on LOCK9Stefan Metzmacher2019-09-091-1/+1
| | | | | | | | | | | | | | | smbXcli_conn_disconnect(alarm_cli->conn, NT_STATUS_OK) means existing requests are not finished with an error, but instead just keep dangling arround. Pass NT_STATUS_LOCAL_DISCONNECT in order to fail the cli_lock32() call after getting SIGALARM. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit e18c8ced8e7a872deb118191595425ef6b826bfa)
* s3:blocking: remove unused timeval_brl_min()Stefan Metzmacher2019-09-092-18/+0
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 3b788d97f9995e24e4005567f90a925957fb1e00)
* s3:locking: add share_mode_wakeup_waiters() helper functionStefan Metzmacher2019-09-092-0/+13
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit bd8884e5722cbbb7783fb4ae53e4f35b31031b01)
* s3:locking: add/split out byte_range_{valid,overlap}() helper functionsStefan Metzmacher2019-09-092-16/+99
| | | | | | | | | | | | They implement the logic from [MS-FSA]. The following commits will use these functions in other locations. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 0e5613e39d6c6bb892fed939c63b4f14b878803b)
* s3:smb2_lock: call change_to_user_by_fsp() when dbwrap_watched_watch* finishesStefan Metzmacher2019-09-091-0/+10
| | | | | | | | | | | | This is not strictly required as fd-based calls are used, but it's more consistent to call SMB_VFS_BRL_LOCK_WINDOWS() in the same environment on retry. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 8b565de1acb0fda121cb0bd4cff42d66ee027529)
* s3:blocking: call change_to_user_by_fsp() when dbwrap_watched_watch* finishesStefan Metzmacher2019-09-091-0/+9
| | | | | | | | | | | | This is not strictly required as fd-based calls are used, but it's more consistent to call SMB_VFS_BRL_LOCK_WINDOWS() in the same environment on retry. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 28ac2cbaf92a8619f0380f024c5a220d9fdc4622)
* vfs_glusterfs: Use pthreadpool for scheduling aio operationsPoornima G2019-09-041-268/+294
| | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14098 Signed-off-by: Poornima G <pgurusid@redhat.com> Reviewed-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Aug 23 18:40:08 UTC 2019 on sn-devel-184 (cherry picked from commit d8863dd8cb74bb0534457ca930a71e77c367d994)
* CVE-2019-10197: smbd: split change_to_user_impersonate() out of ↵Stefan Metzmacher2019-09-031-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | change_to_user_internal() This makes sure we always call chdir_current_service() even when we still impersonated the user. Which is important in order to run the SMB* request within the correct working directory and only if the user has permissions to enter that directory. It makes sure we always update conn->lastused_count in chdir_current_service() for each request. Note that vfs_ChDir() (called from chdir_current_service()) maintains its own cache and avoids calling SMB_VFS_CHDIR() if possible. It means we still avoid syscalls if we get a multiple requests for the same session/tcon tuple. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14035 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* CVE-2019-10197: test_smbclient_s3.sh: add regression test for the no ↵Stefan Metzmacher2019-09-031-0/+30
| | | | | | | | permission on share root problem BUG: https://bugzilla.samba.org/show_bug.cgi?id=14035 Signed-off-by: Stefan Metzmacher <metze@samba.org>
* CVE-2019-10197: smbd: make sure we reset current_user.{need,done}_chdir in ↵Stefan Metzmacher2019-09-031-0/+3
| | | | | | | | become_root() BUG: https://bugzilla.samba.org/show_bug.cgi?id=14035 Signed-off-by: Stefan Metzmacher <metze@samba.org>
* CVE-2019-10197: smbd: make sure that change_to_user_internal() always resets ↵Stefan Metzmacher2019-09-031-0/+1
| | | | | | | | | | | | | | | | current_user.done_chdir We should not leave current_user.done_chdir as true if we didn't call chdir_current_service() with success. This caused problems in when calling vfs_ChDir() in pop_conn_ctx() when chdir_current_service() worked once on one share but later failed on another share. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14035 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* CVE-2019-10197: smbd: separate out impersonation debug info into a new function.Jeremy Allison2019-09-031-14/+23
| | | | | | | | | | Will be called on elsewhere on successful impersonation. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14035 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* vfs:glusterfs_fuse: build only if we have setmntent()Michael Adam2019-08-281-1/+3
| | | | | | | | | | | | | | | | | | FreeBSD and other platforms that don't have setmntent() and friends can not compile this module. This patch lets changes the build to only compile this module if the setmntent() function is found. This is the a follow-up fix to the actual fix for bug #13972. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13972 Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Thu Aug 1 09:49:04 UTC 2019 on sn-devel-184 (cherry picked from commit f258cfaa1d07af6ac6e996006f6e59955cfe34ce)
* vfs:glusterfs_fuse: ensure fileids are constant across nodesMichael Adam2019-08-281-1/+192
| | | | | | | | | | | | | | | | | | Instead of adding a new gluster-specific mode to the fileid module, this patches provides a fileid algorithm as part of the glusterfs_fuse vfs module. This can not be configured further, simply adding the glusterfs_fuse vfs module to the vfs objects configuration will enable the new fileid mode. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13972 Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Sat Jul 13 22:54:56 UTC 2019 on sn-devel-184 (cherry picked from commit 5522aa1a4c34ee1a1e81db73cf41594bb10bd989)