Martin Schwenke [Mon, 9 Sep 2019 06:58:06 +0000 (16:58 +1000)]
ctdb-tests: Don't run setup_ctdb_base() for real cluster
This has not been needed for some time.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Fri, 2 Aug 2019 06:18:32 +0000 (16:18 +1000)]
ctdb-tests: Use db_ctdb_cattdb_count_records()
Avoid reinventing the wheel.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Mon, 16 Sep 2019 09:08:11 +0000 (19:08 +1000)]
ctdb-tests: Use ctdb_get_all_pnns()
The nested, arbitrary use of onnode can cause messages from ssh on
stderr to appear in the node list:
Getting list of nodes...
Output of "onnode -pq all ctdb pnn | grep '^[0-9][0-9]*$'":
Warning: Permanently added '10.0.0.72' (RSA) to the list of known hosts.^M
Warning: Permanently added '10.0.0.75' (RSA) to the list of known hosts.^M
Warning: Permanently added '10.0.0.73' (RSA) to the list of known hosts.^M
Warning: Permanently added '10.0.0.74' (RSA) to the list of known hosts.^M
1
0
3
2
Create/wipe test database rec_test.tdb
Failed to execute "Permanently added '10.0.0.72' (RSA) to the list of known hosts.^M ctdb attach rec_test.tdb" on node(s) "Warning:"
Invalid <nodespec>
Avoid that by using an existing function that does not nest ssh uses.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Mon, 9 Sep 2019 06:04:36 +0000 (16:04 +1000)]
ctdb-tests: Drop reference to unused ctdb_eventd test directory
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Garming Sam [Wed, 11 Sep 2019 01:58:48 +0000 (13:58 +1200)]
whitespace: Conform to coding convention
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Fri Sep 13 12:33:32 UTC 2019 on sn-devel-184
Garming Sam [Wed, 11 Sep 2019 01:55:37 +0000 (13:55 +1200)]
param: Allow rpc server dynamic port range to roundtrip
Originally this parameter only set two other parameters, but never set
the original string. By setting the string as well, we can make it be
emitted by testparm -v correctly (instead of ''), and set it back as the
value for the parameter.
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
Ralph Wuerthner [Thu, 12 Sep 2019 09:16:50 +0000 (11:16 +0200)]
s4:torture: fix file cleanup in smb2.create.delete
Cleanup of test files created by smb2.create.delete is broken because
READONLY is set on the test file. Clear READONLY first before doing
the cleanup.
Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep 12 17:36:50 UTC 2019 on sn-devel-184
Ralph Wuerthner [Thu, 12 Sep 2019 09:18:51 +0000 (11:18 +0200)]
s4:torture: fix closure of test directory handle
Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Wuerthner [Thu, 12 Sep 2019 08:22:58 +0000 (10:22 +0200)]
s4:torture: correctly cast printf() argument
In most cases sattrib is passed as a long int literal. Avoid
compile errors by casting the value passed to printf().
Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Stefan Metzmacher [Tue, 16 Jul 2019 12:20:33 +0000 (14:20 +0200)]
smbd: remove unused current_user.{need,done}_chdir stacking
All become_*()/unbecome_*() functions don't alter the working
directory. Only change_to_user_and_service*() does.
Pair-Programmed-With: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Sep 11 21:16:57 UTC 2019 on sn-devel-184
Stefan Metzmacher [Tue, 16 Jul 2019 12:11:22 +0000 (14:11 +0200)]
smbd: inline change_to_user_internal() into change_to_user_and_service()
There was only one caller left.
Pair-Programmed-With: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Stefan Metzmacher [Fri, 19 Jul 2019 09:14:13 +0000 (11:14 +0200)]
smbd: rename [un]become_user*() to [un]become_user_without_service*()
We should make the behavior change (that gives up some protection)
more obvious, by changing the function names.
At least some OEMs have patches relying on the 4.9/4.10 behaviour
and we want them to detect that they have to do more work when they
need to change directories.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Stefan Metzmacher [Tue, 16 Jul 2019 12:06:09 +0000 (14:06 +0200)]
smbd: remove directory changing from become_user*()
This was the behavior in versions before 4.9 and
it is hopefully not required by current callers of
become_user*().
Pair-Programmed-With: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Stefan Metzmacher [Tue, 16 Jul 2019 12:03:57 +0000 (14:03 +0200)]
smbd: inline change_to_user_and_service() into become_user()
In the next commit we'll drop the _and_service() part.
Pair-Programmed-With: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Sat, 13 Jul 2019 14:38:02 +0000 (16:38 +0200)]
smbd: inline change_to_user_by_session()
Prepares for removing changing cwd from become_user*() in a subsequent commit.
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Sat, 13 Jul 2019 14:10:53 +0000 (16:10 +0200)]
smbd: README.Coding fixes
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Sat, 13 Jul 2019 14:20:11 +0000 (16:20 +0200)]
smbd: rename change_to_user_by_fsp() to change_to_user_and_service_by_fsp()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Sat, 13 Jul 2019 14:17:17 +0000 (16:17 +0200)]
smbd: rename change_to_user() to change_to_user_and_service()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Wed, 9 Jan 2019 16:24:57 +0000 (17:24 +0100)]
smbd: Enhance debugging if chdir fails
This helps admins to figure out which user has a problem
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Wed, 9 Jan 2019 16:04:34 +0000 (17:04 +0100)]
lib: Add "utok_string"
A terse, one-line unix token representation for debugging purposes
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 23:01:20 +0000 (16:01 -0700)]
s3: VFS: Complete the replacement of SMB_VFS_MKDIR() -> SMB_VFS_MKDIRAT().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Sep 11 19:44:44 UTC 2019 on sn-devel-184
Jeremy Allison [Fri, 6 Sep 2019 22:53:12 +0000 (15:53 -0700)]
s3: VFS: vfs_time_audit. Remove mkdir_fn(). No longer used.
NB, this will now fail smb_vfs_assert_all_fns()
until we remove the mkdir_fn() from the VFS definitions.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 22:52:14 +0000 (15:52 -0700)]
s3: VFS: vfs_full_audit. Remove mkdir_fn(). No longer used.
NB, this will now fail smb_vfs_assert_all_fns()
until we remove the mkdir_fn() from the VFS definitions.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 22:50:58 +0000 (15:50 -0700)]
s3: VFS: vfs_xattr_tdb. Remove mkdir_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 22:50:19 +0000 (15:50 -0700)]
s3: VFS: vfs_unityed_media. Remove mkdir_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 22:49:37 +0000 (15:49 -0700)]
s3: VFS: vfs_syncops. Remove mkdir_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 22:49:01 +0000 (15:49 -0700)]
s3: VFS: vfs_snapper. Remove mkdir_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 22:48:20 +0000 (15:48 -0700)]
s3: VFS: vfs_shadow_copy2. Remove mkdir_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 22:47:40 +0000 (15:47 -0700)]
s3: VFS: vfs_media_harmony. Remove mkdir_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 22:46:58 +0000 (15:46 -0700)]
s3: VFS: vfs_linux_xfs_sgid. Remove mkdir_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 22:46:08 +0000 (15:46 -0700)]
s3: VFS: vfs_glusterfs. Remove mkdir_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 22:45:25 +0000 (15:45 -0700)]
s3: VFS: vfs_extd_audit. Remove mkdir_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 22:44:36 +0000 (15:44 -0700)]
s3: VFS: vfs_ceph_snapshots. Remove mkdir_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 22:43:50 +0000 (15:43 -0700)]
s3: VFS: vfs_ceph. Remove mkdir_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 22:43:03 +0000 (15:43 -0700)]
s3: VFS: vfs_catia. Remove mkdir_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 22:42:10 +0000 (15:42 -0700)]
s3: VFS: vfs_cap. Remove mkdir_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 22:10:38 +0000 (15:10 -0700)]
s3: VFS: vfs_audit. Remove mkdir_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 22:05:36 +0000 (15:05 -0700)]
s3: smbd: Change mkdir_internal() to call SMB_VFS_MKDIRAT().
Use conn->cwd_fsp as current fsp.
No logic change for now.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 22:03:50 +0000 (15:03 -0700)]
s3: pysmbd: Change py_smbd_mkdir() to call SMB_VFS_MKDIRAT().
Use conn->cwd_fsp as current fsp.
No logic change for now.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 17:06:23 +0000 (10:06 -0700)]
s3: VFS: vfs_virusfilter: Change use of SMB_VFS_NEXT_MKDIR -> SMB_VFS_NEXT_MKDIRAT.
Use conn->cwd_fsp as current fsp.
No logic change for now.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 17:02:27 +0000 (10:02 -0700)]
s3: VFS: vfs_streams_depot: Change use of SMB_VFS_NEXT_MKDIR -> SMB_VFS_NEXT_MKDIRAT.
Use conn->cwd_fsp as current fsp.
No logic change for now.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 16:51:47 +0000 (09:51 -0700)]
s3: VFS: vfs_recycle: Change use of SMB_VFS_NEXT_MKDIR -> SMB_VFS_NEXT_MKDIRAT.
Use conn->cwd_fsp as current fsp.
No logic change for now.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 5 Sep 2019 18:27:42 +0000 (11:27 -0700)]
s3: torture: Change cmd_mkdir to call SMB_VFS_MKDIRAT().
Use conn->cwd_fsp as current fsp.
No logic change for now.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 5 Sep 2019 18:09:40 +0000 (11:09 -0700)]
s3: VFS: vfs_xattr_tdb. Implement mkdirat().
Currently identical to mkdir().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 5 Sep 2019 18:08:05 +0000 (11:08 -0700)]
s3: VFS: vfs_unityed_media. Implement mkdirat().
Currently identical to mkdir().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 5 Sep 2019 18:03:29 +0000 (11:03 -0700)]
s3: VFS: vfs_time_audit. Implement mkdirat().
Currently identical to mkdir().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 5 Sep 2019 17:40:04 +0000 (10:40 -0700)]
s3: VFS: vfs_syncops. Implement mkdirat().
Currently identical to mkdir().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 5 Sep 2019 17:33:38 +0000 (10:33 -0700)]
s3: VFS: vfs_snapper. Implement mkdirat().
Currently identical to mkdir().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 5 Sep 2019 17:32:18 +0000 (10:32 -0700)]
s3: VFS: vfs_shadow_copy2. Implement mkdirat().
Currently identical to mkdir().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 5 Sep 2019 17:26:53 +0000 (10:26 -0700)]
s3: VFS: vfs_media_harmony. Implement mkdirat().
Currently identical to mkdir().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 5 Sep 2019 17:15:18 +0000 (10:15 -0700)]
s3: VFS: vfs_xfs_sgid. Implement mkdirat().
Currently identical to mkdir().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 5 Sep 2019 16:33:32 +0000 (09:33 -0700)]
s3: VFS: vfs_glusterfs. Implement mkdirat().
Currently identical to mkdir().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 4 Sep 2019 22:48:23 +0000 (15:48 -0700)]
s3: VFS: vfs_full_audit. Implement mkdirat().
Currently identical to mkdir().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 4 Sep 2019 22:46:08 +0000 (15:46 -0700)]
s3: VFS: vfs_extd_audit. Implement mkdirat().
Currently identical to mkdir().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 4 Sep 2019 22:43:44 +0000 (15:43 -0700)]
s3: VFS: vfs_ceph_snapshots. Implement mkdirat().
Currently identical to mkdir().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 4 Sep 2019 22:14:54 +0000 (15:14 -0700)]
s3: VFS: vfs_ceph. Implement mkdirat().
Currently identical to mkdir().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 4 Sep 2019 20:55:17 +0000 (13:55 -0700)]
s3: VFS: vfs_catia. Implement mkdirat().
Currently identical to mkdir().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 4 Sep 2019 20:53:43 +0000 (13:53 -0700)]
s3: VFS: vfs_cap. Implement mkdirat().
Currently identical to mkdir().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 4 Sep 2019 20:38:56 +0000 (13:38 -0700)]
s3: VFS: vfs_audit. Implement mkdirat().
Currently identical to mkdir().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 4 Sep 2019 19:20:46 +0000 (12:20 -0700)]
s3: VFS: Add SMB_VFS_MKDIRAT().
Currently identical to SMB_VFS_MKDIR().
Next, add to all VFS modules that implement
mkdir and eventually remove mkdir.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 21:51:29 +0000 (14:51 -0700)]
s3: pysmbd: Ensure conn->cwd_fsp member of created connections is initialized.
This is needed to correctly call the XXXAT() vfs calls.
We should probably just use create_conn_struct_tos_cwd() here
and pass $cwd instead of using create_conn_struct_tos() and
passing "/" as the share root. We wouldn't change the current
working directory and the created share root would be set to $cwd
but I'm not sure what effects this may have on users of pysmbd
in case any of them pass paths above the $cwd to these functions.
Less changes to just call vfs_ChDir(conn, &cwd) which doesn't
change the current directory and leaves the share root as "/".
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 21:05:43 +0000 (14:05 -0700)]
s3: torture: vfstest: Change from create_conn_struct_tos() -> create_conn_struct_tos_cwd().
This does a vfs_ChDir() to the share root (not changing the
directory) which correctly sets up the conn->cwd_fsp member
so any XXXAT() calls correctly work inside vfstest.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 6 Sep 2019 23:02:00 +0000 (16:02 -0700)]
s3: smbd: profile: Remove syscall_symlink entry now syscall is no longer used.
Missed as part of the previous replacement of symlink -> symlinkat.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Ralph Boehme [Mon, 2 Sep 2019 10:21:56 +0000 (12:21 +0200)]
s3:smbd: skip write-time fetching for directories.
The whole logic only applies to files.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Sep 11 00:33:26 UTC 2019 on sn-devel-184
Volker Lendecke [Mon, 9 Sep 2019 08:42:59 +0000 (10:42 +0200)]
smbd: Do boolean short-circuiting
&= does bitwise AND, and does not do boolean short-circuiting if the
variable is already 0. As has_other_nonposix_opens() might have its
cost, this speeds up closing a handle.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 26 Aug 2019 14:22:23 +0000 (16:22 +0200)]
smbd: Use dbwrap_do_locked() in fd_close_posix()
We don't need to make a copy of the fd array
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Fri, 23 Aug 2019 16:11:57 +0000 (18:11 +0200)]
smbd: Use dbwrap_do_locked() in add_fd_to_close_entry()
Less explicit talloc. Right now dbwrap_rbt behind the scenes does a
dbwrap_fetch_locked(), but that will eventually change.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Fri, 23 Aug 2019 15:47:47 +0000 (17:47 +0200)]
dbwrap: Initialize state in dbwrap_delete()
Probably not required, but looks safer and gives static checkers less
reason to complain about potentially uninitialized variable reads
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Thu, 5 Sep 2019 15:25:07 +0000 (17:25 +0200)]
lib: Remove an obsolete comment
At least as of
2ac9d0afa66 ctdb does not care about db prios anymore
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Tue, 3 Sep 2019 14:40:00 +0000 (16:40 +0200)]
smbd: Fix DBG typo in find_delete_on_close_token()
The routine isn't called find__delete_on_close_token. Also avoid
casts.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 9 Sep 2019 14:34:10 +0000 (16:34 +0200)]
smbd: Use file_id_str_buf() in close_remove_share_mode()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 9 Sep 2019 14:32:21 +0000 (16:32 +0200)]
smbd: Use file_id_str_buf() in setup_poll_open()
While there, remove a pointless empty line
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 9 Sep 2019 14:30:57 +0000 (16:30 +0200)]
smbd: Use file_id_str_buf() in defer_open()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 9 Sep 2019 14:28:57 +0000 (16:28 +0200)]
smbstatus: Use file_id_str_buf() in print_brl()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Fri, 6 Sep 2019 05:31:22 +0000 (07:31 +0200)]
smbd: Use file_id_str_buf() in set_sticky_write_time()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Fri, 6 Sep 2019 05:29:10 +0000 (07:29 +0200)]
smbd: Use file_id_str_buf() in share_mode_str()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Tue, 3 Sep 2019 14:26:09 +0000 (16:26 +0200)]
smbd: Use file_id_str_buf() in brl_cleanup_disconnected()
Also avoid some casts and use DBG_ instead of DEBUG()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Tue, 3 Sep 2019 14:18:00 +0000 (16:18 +0200)]
smbd: Use file_id_str_buf() in brl_get_locks()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Tue, 3 Sep 2019 14:15:40 +0000 (16:15 +0200)]
vfs: Use file_id_str_buf() in xattr_tdb_setattr()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Tue, 3 Sep 2019 14:14:28 +0000 (16:14 +0200)]
vfs: Use file_id_str_buf() in xattr_tdb_getattr()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Tue, 3 Sep 2019 14:12:35 +0000 (16:12 +0200)]
lib: Use file_id_str_buf() in file_id_string()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 2 Sep 2019 17:04:25 +0000 (19:04 +0200)]
lib: Add file_id_str_buf()
file_id_string() without talloc
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Mon, 2 Sep 2019 17:04:42 +0000 (19:04 +0200)]
lib: Properly #ifdef __LIB_FILE_ID_H__
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Mon, 9 Sep 2019 06:08:06 +0000 (08:08 +0200)]
vfs: restore stat fields in vfs_stat_fsp()
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
Ralph Boehme [Mon, 9 Sep 2019 06:03:53 +0000 (08:03 +0200)]
s3:vfs: streamline vfs_stat_fsp()
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>
Ralph Boehme [Mon, 9 Sep 2019 05:57:34 +0000 (07:57 +0200)]
s3: replace fsp_stat() with vfs_stat_fsp()
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>
Ralph Boehme [Fri, 30 Aug 2019 12:49:47 +0000 (14:49 +0200)]
s3:lib: add update_stat_ex_from_saved_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>
Ralph Boehme [Fri, 30 Aug 2019 12:48:57 +0000 (14:48 +0200)]
vfs_catia: stat info may have been updated, make sure to return changes
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>
Ralph Boehme [Fri, 30 Aug 2019 12:48:40 +0000 (14:48 +0200)]
s3:smbd: ensure to update the File-ID in struct smb_filename
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>
Ralph Boehme [Mon, 9 Sep 2019 09:12:08 +0000 (11:12 +0200)]
s3:lib: round itime to NTTIME resolution in make_file_id_from_itime()
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>
Ralph Boehme [Tue, 3 Sep 2019 15:50:54 +0000 (17:50 +0200)]
lib: add round_timespec_to_nttime()
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>
Ralph Boehme [Fri, 30 Aug 2019 12:49:24 +0000 (14:49 +0200)]
s4:torture: add a file-id related test
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>
Stefan Metzmacher [Tue, 10 Sep 2019 10:37:52 +0000 (12:37 +0200)]
s4:torture/smb2: try to fix a RESOURCE_LEAK in smb2.samba3misc.localposixlock1
CID
1453656: (RESOURCE_LEAK)
Handle variable "fd" going out of scope leaks the handle.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Sep 10 18:56:45 UTC 2019 on sn-devel-184
Stefan Metzmacher [Tue, 10 Sep 2019 08:55:15 +0000 (10:55 +0200)]
lib/torture: protect torture_assert[_goto]() with a do { } while(0) block
This hopefully fixes a lot of coverity defects like:
Control flow issues (DEADCODE)
Execution cannot reach this statement: ";".
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Stefan Metzmacher [Tue, 10 Sep 2019 10:33:34 +0000 (12:33 +0200)]
s4:torture: always add ';' after torture_assert()
The next commit will require this.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Andrew Bartlett [Thu, 5 Sep 2019 03:48:53 +0000 (15:48 +1200)]
Create SECURITY.md
This file location is shown under "Security -> Policy" on GitHub
and helps ensure people with a need to report a security issue
find us the right way.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Sep 9 21:13:35 UTC 2019 on sn-devel-184
Stefan Metzmacher [Tue, 20 Aug 2019 13:53:59 +0000 (15:53 +0200)]
s3:selftest: add delay_inject:brl_lock_windows testing
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
Stefan Metzmacher [Mon, 19 Aug 2019 16:22:38 +0000 (18:22 +0200)]
vfs_delay_inject: add support for brl_[un]lock_windows()
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>
Stefan Metzmacher [Thu, 8 Aug 2019 17:26:28 +0000 (19:26 +0200)]
s3:locking: add brl_req_guid() and brl_req_mem_ctx() helper functions
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>
Stefan Metzmacher [Mon, 19 Aug 2019 14:25:59 +0000 (16:25 +0200)]
s3:smb2_lock: handle NT_STATUS_RETRY from the VFS backend
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>