]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
4 years agovfs_default: add support for SMB_ACL_TYPE_DEFAULT and pathref fsps in vfswrap_sys_acl...
Ralph Boehme [Sun, 13 Dec 2020 08:11:37 +0000 (09:11 +0100)] 
vfs_default: add support for SMB_ACL_TYPE_DEFAULT and pathref fsps in vfswrap_sys_acl_set_fd()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_aixacl2: handle pathref fsps in aixjfs2_sys_acl_set_fd()
Ralph Boehme [Mon, 14 Dec 2020 09:07:04 +0000 (10:07 +0100)] 
vfs_aixacl2: handle pathref fsps in aixjfs2_sys_acl_set_fd()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_aixacl: handle pathref fsps in aixacl_sys_acl_set_fd()
Ralph Boehme [Mon, 14 Dec 2020 09:04:15 +0000 (10:04 +0100)] 
vfs_aixacl: handle pathref fsps in aixacl_sys_acl_set_fd()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_vxfs: add support for SMB_ACL_TYPE_DEFAULT in vxfs_sys_acl_set_fd()
Ralph Boehme [Mon, 14 Dec 2020 07:10:44 +0000 (08:10 +0100)] 
vfs_vxfs: add support for SMB_ACL_TYPE_DEFAULT in vxfs_sys_acl_set_fd()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_tru64acl: add support for SMB_ACL_TYPE_DEFAULT to tru64acl_sys_acl_set_fd()
Ralph Boehme [Mon, 14 Dec 2020 07:08:30 +0000 (08:08 +0100)] 
vfs_tru64acl: add support for SMB_ACL_TYPE_DEFAULT to tru64acl_sys_acl_set_fd()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_solarisacl: add support for SMB_ACL_TYPE_DEFAULT in solarisacl_sys_acl_set_fd()
Ralph Boehme [Mon, 14 Dec 2020 07:05:53 +0000 (08:05 +0100)] 
vfs_solarisacl: add support for SMB_ACL_TYPE_DEFAULT in solarisacl_sys_acl_set_fd()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_posixacl: support SMB_ACL_TYPE_DEFAULT in posixacl_sys_acl_set_fd()
Ralph Boehme [Mon, 14 Dec 2020 06:57:45 +0000 (07:57 +0100)] 
vfs_posixacl: support SMB_ACL_TYPE_DEFAULT in posixacl_sys_acl_set_fd()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_gpfs: add support for SMB_ACL_TYPE_DEFAULT in gpfsacl_sys_acl_set_fd()
Ralph Boehme [Sun, 13 Dec 2020 08:19:25 +0000 (09:19 +0100)] 
vfs_gpfs: add support for SMB_ACL_TYPE_DEFAULT in gpfsacl_sys_acl_set_fd()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_fake_acls: add support for SMB_ACL_TYPE_DEFAULT in fake_acls_sys_acl_set_fd()
Ralph Boehme [Sun, 13 Dec 2020 08:18:00 +0000 (09:18 +0100)] 
vfs_fake_acls: add support for SMB_ACL_TYPE_DEFAULT in fake_acls_sys_acl_set_fd()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_aixacl2: use ACL type in aixjfs2_sys_acl_set_fd()
Ralph Boehme [Sun, 13 Dec 2020 08:07:51 +0000 (09:07 +0100)] 
vfs_aixacl2: use ACL type in aixjfs2_sys_acl_set_fd()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_aixacl: use passed in ACL type in aixacl_sys_acl_set_fd()
Ralph Boehme [Sun, 13 Dec 2020 08:06:24 +0000 (09:06 +0100)] 
vfs_aixacl: use passed in ACL type in aixacl_sys_acl_set_fd()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoposixacl_xattr: add support for SMB_ACL_TYPE_DEFAULT in posixacl_xattr_acl_set_fd()
Ralph Boehme [Sun, 13 Dec 2020 07:55:39 +0000 (08:55 +0100)] 
posixacl_xattr: add support for SMB_ACL_TYPE_DEFAULT in posixacl_xattr_acl_set_fd()

No need to handle pathref fsps here, as that is taken care of by
SMB_VFS_FSETXATTR().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs: add acl type arg to SMB_VFS_SYS_ACL_SET_FD()
Ralph Boehme [Mon, 14 Dec 2020 15:28:26 +0000 (16:28 +0100)] 
vfs: add acl type arg to SMB_VFS_SYS_ACL_SET_FD()

No change in behaviour, the new arg is not yet used in any module.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: remove fd_close() from open_directory()
Ralph Boehme [Thu, 17 Dec 2020 11:41:29 +0000 (12:41 +0100)] 
smbd: remove fd_close() from open_directory()

fd_close() was accidentally added twice by
d00d09fdcf73a5839ae4f82cf8e953bb761bfbfb. If it would have been removed by
5770cdd7635a018817418f58bd37268aedebd6a9 that adds the reopen_from_procfd()
optimisation, all would be fine. But fd_close() still being called before
reopen_from_procfd() means we're closing the pathref fd prevening the
optimisation.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: Ensure close_directory() and close_normal_file() only deal with is_fsa files.
Jeremy Allison [Thu, 17 Dec 2020 00:38:28 +0000 (16:38 -0800)] 
smbd: Ensure close_directory() and close_normal_file() only deal with is_fsa files.

This must be the case, so assert it.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agosmbd: mark fsp as valid FSA fsp after Durable Handle reconnect succeeded
Ralph Boehme [Thu, 17 Dec 2020 12:41:20 +0000 (13:41 +0100)] 
smbd: mark fsp as valid FSA fsp after Durable Handle reconnect succeeded

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: Move closing a print file out of close_normal_file() (it isn't a normal file...
Jeremy Allison [Thu, 17 Dec 2020 03:49:56 +0000 (19:49 -0800)] 
smbd: Move closing a print file out of close_normal_file() (it isn't a normal file) and into close_file().

Streamlines closing print files and allows close_normal_file()
to restrict itself to is_fsa fsps.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agosmbd: On error exit in create_file_unixpath(), we can't call close_file() on uncomple...
Jeremy Allison [Wed, 16 Dec 2020 23:44:41 +0000 (15:44 -0800)] 
smbd: On error exit in create_file_unixpath(), we can't call close_file() on uncompleted opens.

We can't call directly into close_file(), as that cannot deal
with regular file and directory opens where fsp->fsp_flags.is_fsa
hasn't been set to true (uncompleted opens).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agosmbd: If an smb_filename already has a pathref fsp don't overwrite it.
Jeremy Allison [Thu, 17 Dec 2020 07:59:50 +0000 (23:59 -0800)] 
smbd: If an smb_filename already has a pathref fsp don't overwrite it.

That leaks fsps.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agosmbd: dup_file_fsp() for old DOS style opens also needs to copy the new flags.
Jeremy Allison [Thu, 17 Dec 2020 09:10:12 +0000 (01:10 -0800)] 
smbd: dup_file_fsp() for old DOS style opens also needs to copy the new flags.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agosmbd: Fix debugs in file_new() and fsp_new().
Jeremy Allison [Thu, 17 Dec 2020 07:55:31 +0000 (23:55 -0800)] 
smbd: Fix debugs in file_new() and fsp_new().

Allows grep ' files structure ' in the log
to count up and down the number of files allocated.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agosmbd/notify: add option "honor change notify privilege"
Björn Baumbach [Tue, 6 Nov 2018 14:21:37 +0000 (15:21 +0100)] 
smbd/notify: add option "honor change notify privilege"

This option can be used to make use of the change notify privilege.
By default notify results are not checked against the file system
permissions.

If "honor change notify privilege" is enabled, a user will only
receive notify results, if he has change notify privilege or sufficient
file system permissions. If a user has the change notify privilege, he
will receive all requested notify results, even if the user does not
have the permissions on the file system.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Björn Baumbach <bb@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Dec 17 15:01:53 UTC 2020 on sn-devel-184

4 years agoselftest: add tests for smb notify, using the a special share
Björn Baumbach [Mon, 20 Jul 2020 14:49:39 +0000 (16:49 +0200)] 
selftest: add tests for smb notify, using the a special share

That share will get the "honor change notify privilege = yes" option
once it's implemented. For now it's marked as knownfail.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Björn Baumbach <bb@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoselftest: add option to pass args to tests to planpythontestsuite()
Björn Baumbach [Fri, 24 Jul 2020 10:18:11 +0000 (12:18 +0200)] 
selftest: add option to pass args to tests to planpythontestsuite()

The logic is basically a copy from planoldpythontestsuite().

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Björn Baumbach <bb@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agopython/tests: add tests for smb notify and the dependency to the TRAVERSE privilege
Björn Baumbach [Mon, 20 Jul 2020 14:49:39 +0000 (16:49 +0200)] 
python/tests: add tests for smb notify and the dependency to the TRAVERSE privilege

The easiest way to run this against Windows was to use a domain
controller and configure an enforce group policy and grant the
"Bypass Traverse Checking" only to the "BUILTIN\Administrators" group.
(Note that "LOCAL SERVICE" and "NETWORK SERVICE" are always added in
the local security policy.

The test runs like this:

  SMB_CONF_PATH=/dev/null \
  SERVER=172.31.9.188 \
  TARGET_HOSTNAME=w2012r2-188.w2012r2-l6.base \
  USERNAME=administrator \
  PASSWORD=A1b2C3d4 \
  NOTIFY_SHARE=torture \
  USERNAME_UNPRIV=ldaptestuser \
  PASSWORD_UNPRIV=a1B2c3D4 \
  python/samba/tests/smb-notify.py -v -f SMBNotifyTests

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Björn Baumbach <bb@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agopython/ntacls.py: add SMBHelper.set_acl() helper function
Björn Baumbach [Tue, 21 Jul 2020 10:34:19 +0000 (12:34 +0200)] 
python/ntacls.py: add SMBHelper.set_acl() helper function

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Björn Baumbach <bb@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agopython/ntacls.py: let SMBHelper.get_acl() use the default values of self.smb_conn...
Stefan Metzmacher [Thu, 3 Dec 2020 12:59:58 +0000 (13:59 +0100)] 
python/ntacls.py: let SMBHelper.get_acl() use the default values of self.smb_conn.get_acl()

Now that self.smb_conn.get_acl() has sane default values for secinfo and
access_mask we can remove any additional logic in SMBHelper.

The resulting values are the same.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibsmb_samba_internal: calculate the access_mask for {g,s}et_acl() based on the secin...
Stefan Metzmacher [Thu, 3 Dec 2020 13:51:52 +0000 (14:51 +0100)] 
libsmb_samba_internal: calculate the access_mask for {g,s}et_acl() based on the secinfo flags

SEC_FLAG_MAXIMUM_ALLOWED will never result in SEC_FLAG_SYSTEM_SECURITY
being granted. As SECINFO_SACL is part of the default secinfo value
(SECINFO_DEFAULT_FLAGS), {g,s}et_acl() will always return
NT_STATUS_ACCESS_DENIED by default.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibsmb_samba_internal: don't send SECINFO_[UN]PROTECTED_{S,D}ACL by default
Stefan Metzmacher [Thu, 3 Dec 2020 12:58:53 +0000 (13:58 +0100)] 
libsmb_samba_internal: don't send SECINFO_[UN]PROTECTED_{S,D}ACL by default

We want to get the default behavior.

It's also pointless to set PROTECTED and UNPROTECTED at the same time.
These are defined in MS-DTYP 2.4.7 SECURITY_INFORMATION with a brief
description, but they aren't referenced in anywhere in MS-DTYP itself,
nor in MS-FSA are any other document.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:pylibsmb: remove unused SECINFO_DEFAULT_FLAGS
Stefan Metzmacher [Thu, 3 Dec 2020 12:19:58 +0000 (13:19 +0100)] 
s3:pylibsmb: remove unused SECINFO_DEFAULT_FLAGS

commit 42be033b0b0c02413a74f984c8622b5baed2689a removed the last
reference.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:pylibsmb: add notify() support
Stefan Metzmacher [Tue, 27 Aug 2019 13:49:04 +0000 (13:49 +0000)] 
s3:pylibsmb: add notify() support

The operation is a bit different from others,
as results are returned in an async fashion.
It returns a request handle.

  notify_req = conn.notify(fnum=fnum,
                           buffer_size=0xffff,
                           completion_filter=libsmb.FILE_NOTIFY_CHANGE_ALL,
                           recursive=True)

  # ... do other operations on conn.*() ...

  changes = notify_req.get_changes(wait=False)
  # changes is likely to be None if no result arrived yet

  # ... do other operations on conn.*() ...

  changes = notify_req.get_changes(wait=True)
  # changes is a list of change dictionaries
  # each containing "name" (a string) and
  # "action" (an integer, e.g. libsmb.NOTIFY_ACTION_REMOVED)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:pylibsmb: add echo() support
Stefan Metzmacher [Mon, 7 Dec 2020 16:52:49 +0000 (17:52 +0100)] 
s3:pylibsmb: add echo() support

In tests it's sometimes to have a no-op in order to check the
transport is still alive.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:pylibsmb: PyErr_NTSTATUS_IS_ERR_RAISE => PyErr_NTSTATUS_NOT_OK_RAISE
Stefan Metzmacher [Wed, 9 Dec 2020 09:13:54 +0000 (10:13 +0100)] 
s3:pylibsmb: PyErr_NTSTATUS_IS_ERR_RAISE => PyErr_NTSTATUS_NOT_OK_RAISE

We want to raise an exception for everything that's not NT_STATUS_OK.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibcli/smb: add smbXcli_conn_send_queue()
Stefan Metzmacher [Thu, 29 Aug 2019 10:28:14 +0000 (10:28 +0000)] 
libcli/smb: add smbXcli_conn_send_queue()

This is useful in order to test async requests
tevent_queue_wait_send/recv() can be used to block
the queue between requests or wait for the queue to be flushed.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:libsmb: set correct min and max smb protocol when smb2 is enforced on connect
Björn Baumbach [Thu, 29 Aug 2019 10:13:50 +0000 (12:13 +0200)] 
s3:libsmb: set correct min and max smb protocol when smb2 is enforced on connect

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

Pair-programmed-with: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Björn Baumbach <bb@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:libsmb: set min smb protocol when enforcing smb1 on connect
Björn Baumbach [Wed, 28 Aug 2019 12:11:02 +0000 (14:11 +0200)] 
s3:libsmb: set min smb protocol when enforcing smb1 on connect

Otherwise the connect fails if the configured client min protocol is
higher than NT1.

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

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoblackbox/test_samba-tool_ntacl.sh: script requires two arguments
Björn Baumbach [Tue, 27 Aug 2019 09:19:42 +0000 (11:19 +0200)] 
blackbox/test_samba-tool_ntacl.sh: script requires two arguments

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agodocs:smbdotconf: fix a typo in oldpasswordallowedperiod.xml
Björn Baumbach [Wed, 18 Mar 2020 09:31:04 +0000 (10:31 +0100)] 
docs:smbdotconf: fix a typo in oldpasswordallowedperiod.xml

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agopep8 tidy up config
Gary Lockyer [Tue, 15 Dec 2020 21:56:22 +0000 (10:56 +1300)] 
pep8 tidy up config

Enable the following warnings:

E126: continuation line over-indented for hanging indent
E131: continuation line unaligned for hanging indent
E203: whitespace before ':'
E221: multiple spaces before operator
E501: line too long
E722: do not use bare 'except'

These were originally chosen so that as much of the existing samba code
passed. With the intention of integrating PEP8 checking into build
process.  But the PEP8 output does not integrate into the known fail
mechanism, so this approach was abandoned.

setup.cfg is the default PEP8 config file having these exceptions
enabled means that new code can be added with those issues. Also tools
like pyls (python language server) use setup.cfg.

Disable the following warnings:

E402: module level import not at top of file
      Samba has a significant amount of code setting
      sys.path.insert(0, "bin/python")
W503: Line break before binary operator
      We need to have a preference, and PEP8 expresses a weak preference
      for disabling 503

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Dec 17 00:54:51 UTC 2020 on sn-devel-184

4 years agotests python krb5: initial TGS tests
Gary Lockyer [Mon, 30 Nov 2020 01:19:15 +0000 (14:19 +1300)] 
tests python krb5: initial TGS tests

Initial tests on the KDC TGS

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agotests python krb5: add test base class
Gary Lockyer [Mon, 30 Nov 2020 01:16:28 +0000 (14:16 +1300)] 
tests python krb5: add test base class

Add a base class for the KDC tests to reduce the amount of code
duplication in  the tests.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agotests python krb5: Add Authorization data ad-type constants
Gary Lockyer [Wed, 9 Dec 2020 21:15:28 +0000 (10:15 +1300)] 
tests python krb5: Add Authorization data ad-type constants

Add constants for the Authorization Data Type values.
RFC 4120 7.5.4.  Authorization Data Types

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoauth:creds: Add cli_credentials_dump()
Andreas Schneider [Thu, 10 Dec 2020 15:48:16 +0000 (16:48 +0100)] 
auth:creds: Add cli_credentials_dump()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Dec 16 13:56:49 UTC 2020 on sn-devel-184

4 years agoautobuild.py: use --enable-clangdb for the "samba-ctdb" task
Stefan Metzmacher [Tue, 15 Dec 2020 12:43:22 +0000 (13:43 +0100)] 
autobuild.py: use --enable-clangdb for the "samba-ctdb" task

The key is that we only enable it for just one task.

I plan to restructure the autobuild tasks, but 'samba-ctdb'
will stay the way it works currently.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agowafsamba: move clang_compilation_database usage behind an --enable-clangdb option
Stefan Metzmacher [Tue, 15 Dec 2020 12:39:40 +0000 (13:39 +0100)] 
wafsamba: move clang_compilation_database usage behind an --enable-clangdb option

Writing bin/default/compile_commands.json doubles the total time used
for a noop build. That price should only be paid if someone wants to
use it actually.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agosmbd: Remove the smb_fname parameter from set_ea().
Jeremy Allison [Mon, 14 Dec 2020 20:15:48 +0000 (12:15 -0800)] 
smbd: Remove the smb_fname parameter from set_ea().

We know we must have a valid fsp.

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 Dec 16 10:15:11 UTC 2020 on sn-devel-184

4 years agosmbd: set_ea() must have an fsp, so remove uses of the smb_fname parameter.
Jeremy Allison [Mon, 14 Dec 2020 18:14:46 +0000 (10:14 -0800)] 
smbd: set_ea() must have an fsp, so remove uses of the smb_fname parameter.

Next we can remove it.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agosmbd: smb_info_set_ea() can only get fsp==NULL in POSIX mode accessing a symlink.
Jeremy Allison [Mon, 14 Dec 2020 20:07:48 +0000 (12:07 -0800)] 
smbd: smb_info_set_ea() can only get fsp==NULL in POSIX mode accessing a symlink.

Ensure this is the case and force-return NT_STATUS_ACCESS_DENIED here.
Remove any race condition if anyone modifies the symlink whilst the
operation is in process.

This now allows us to require a valid fsp for operations on EAs.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agovfs: SMB_VFS_GET_COMPRESSION() -> SMB_VFS_FGET_COMPRESSION()
Ralph Boehme [Tue, 13 Oct 2020 10:02:34 +0000 (12:02 +0200)] 
vfs: SMB_VFS_GET_COMPRESSION() -> SMB_VFS_FGET_COMPRESSION()

Now that handle based fdos_mode() is used everywhere we can be sure that we're
also always getting a handle in SMB_VFS_GET_COMPRESSION() so we can now safely
remove the path parameter. :)

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: remove unused get_ea_dos_attribute()
Ralph Boehme [Tue, 3 Nov 2020 06:57:37 +0000 (07:57 +0100)] 
smbd: remove unused get_ea_dos_attribute()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs: RIP SMB_VFS_GET_DOS_ATTRIBUTES()
Ralph Boehme [Mon, 19 Oct 2020 19:48:32 +0000 (21:48 +0200)] 
vfs: RIP SMB_VFS_GET_DOS_ATTRIBUTES()

                (\  _  /)
                ( \ O / )
                 (// \\)
                    X
                   / \
                  /___\
           _____/      \\_____
          |         +         ||
          |                   ||
          |   SMB_VFS_GET_    ||
          | DOS_ATTRIBUTES()  ||
          |                   ||
          |                   ||
          |                   ||
          |  _     ___   _    ||
          | | \     |   | \   ||
          | |  |    |   |  |  ||
          | |_/     |   |_/   ||
          | | \     |   |     ||
          | |  \    |   |     ||
          | |   \. _|_. | .   ||
          |                   ||
  *     * | *   **    * **    |**     **
   \)),.,\(/.,(//,,..,,\||(,,.,\\,.((//

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs: add and use fget_ea_dos_attribute()
Ralph Boehme [Tue, 3 Nov 2020 06:57:03 +0000 (07:57 +0100)] 
vfs: add and use fget_ea_dos_attribute()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use SMB_VFS_FGET_DOS_ATTRIBUTES() in open_file_ntcreate()
Ralph Boehme [Mon, 19 Oct 2020 19:36:33 +0000 (21:36 +0200)] 
smbd: use SMB_VFS_FGET_DOS_ATTRIBUTES() in open_file_ntcreate()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: RIP dos_mode()
Ralph Boehme [Mon, 19 Oct 2020 19:14:41 +0000 (21:14 +0200)] 
smbd: RIP dos_mode()

          .--. .-,       .-..-.__
        .'(`.-` \_.-'-./`  |\_( "\__
     __.>\ ';  _;---,._|   / __/`'--)
    /.--.  : |/' _.--.<|  /  | |
_..-'    `\     /' /`  /_/ _/_/
 >_.-``-. `Y  /' _;---.`|/))))
'` .-''. \|:  .'   __, .-'"`
 .'--._ `-:  \/:  /'  '.\             _|_
     /.'`\ :;   /'      `-           `-|-`
    -`    |     |                      |
          :.; : |                  .-'~^~`-.
          |:    |                .' _     _ `.
          |:.   |                | |_) | |_) |
          :. :  |                | | \ | |   |
          : ;   |                |           |
          : ;   |                |           |
          : ;   |                | dos_mode()|
        .:| . : ;                |           |
-."-/\\\/:::.    `\."-._'."-"_\\-|           |///."-
" -."-.\\"-."//.-".`-."_\\-.".-\\`=.........=`//-".

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in tsmsm_fset_dos_attributes()
Ralph Boehme [Mon, 19 Oct 2020 19:11:51 +0000 (21:11 +0200)] 
smbd: use fdos_mode() in tsmsm_fset_dos_attributes()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in tsmsm_set_dos_attributes()
Ralph Boehme [Mon, 19 Oct 2020 19:11:19 +0000 (21:11 +0200)] 
smbd: use fdos_mode() in tsmsm_set_dos_attributes()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in dos_mode_at_vfs_get_dosmode_done()
Ralph Boehme [Mon, 19 Oct 2020 19:10:40 +0000 (21:10 +0200)] 
smbd: use fdos_mode() in dos_mode_at_vfs_get_dosmode_done()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in smb_set_file_disposition_info()
Ralph Boehme [Mon, 19 Oct 2020 19:09:00 +0000 (21:09 +0200)] 
smbd: use fdos_mode() in smb_set_file_disposition_info()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in smb_set_file_dosmode()
Ralph Boehme [Mon, 19 Oct 2020 19:08:29 +0000 (21:08 +0200)] 
smbd: use fdos_mode() in smb_set_file_dosmode()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: pass fsp to smb_set_file_dosmode()
Ralph Boehme [Fri, 30 Oct 2020 21:00:17 +0000 (22:00 +0100)] 
smbd: pass fsp to smb_set_file_dosmode()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in smbd_do_qfilepathinfo()
Ralph Boehme [Mon, 19 Oct 2020 19:07:35 +0000 (21:07 +0200)] 
smbd: use fdos_mode() in smbd_do_qfilepathinfo()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in call_trans2open()
Ralph Boehme [Mon, 19 Oct 2020 18:59:35 +0000 (20:59 +0200)] 
smbd: use fdos_mode() in call_trans2open()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in smbd_smb2_create_after_exec()
Ralph Boehme [Mon, 19 Oct 2020 18:59:09 +0000 (20:59 +0200)] 
smbd: use fdos_mode() in smbd_smb2_create_after_exec()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in setup_close_full_information()
Ralph Boehme [Mon, 19 Oct 2020 18:53:48 +0000 (20:53 +0200)] 
smbd: use fdos_mode() in setup_close_full_information()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in reply_getattrE()
Ralph Boehme [Mon, 19 Oct 2020 18:49:02 +0000 (20:49 +0200)] 
smbd: use fdos_mode() in reply_getattrE()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in copy_file()
Ralph Boehme [Mon, 19 Oct 2020 18:48:43 +0000 (20:48 +0200)] 
smbd: use fdos_mode() in copy_file()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in rename_internals_fsp()
Ralph Boehme [Fri, 30 Oct 2020 15:08:03 +0000 (16:08 +0100)] 
smbd: use fdos_mode() in rename_internals_fsp()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: README.Coding fixes in rename_internals_fsp()
Ralph Boehme [Fri, 30 Oct 2020 15:06:38 +0000 (16:06 +0100)] 
smbd: README.Coding fixes in rename_internals_fsp()

No change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use SMB_VFS_FSTAT() in rename_internals_fsp()
Ralph Boehme [Fri, 30 Oct 2020 15:03:19 +0000 (16:03 +0100)] 
smbd: use SMB_VFS_FSTAT() in rename_internals_fsp()

While at it, use the open handle on the renamed file to call fstat() instead of
stat().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: call rename_open_files() a bit earlier in rename_internals_fsp()
Ralph Boehme [Fri, 30 Oct 2020 14:38:22 +0000 (15:38 +0100)] 
smbd: call rename_open_files() a bit earlier in rename_internals_fsp()

This prepares for using handle based SMB_VFS_FSTAT() and fdos_mode() a few lines
below. As some VFS modules will use the fsp->fsp_name we have to make sure to
rename it first.

Fwiw, notify_rename() is moved as well as it needs to original name in
fsp->fsp_name.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in do_unlink()
Ralph Boehme [Mon, 19 Oct 2020 18:43:21 +0000 (20:43 +0200)] 
smbd: use fdos_mode() in do_unlink()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in can_rename()
Ralph Boehme [Mon, 19 Oct 2020 18:42:41 +0000 (20:42 +0200)] 
smbd: use fdos_mode() in can_rename()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in reply_open_and_X()
Ralph Boehme [Mon, 19 Oct 2020 18:42:03 +0000 (20:42 +0200)] 
smbd: use fdos_mode() in reply_open_and_X()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in reply_open()
Ralph Boehme [Mon, 19 Oct 2020 18:41:43 +0000 (20:41 +0200)] 
smbd: use fdos_mode() in reply_open()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in reply_getatr()
Ralph Boehme [Mon, 19 Oct 2020 18:41:18 +0000 (20:41 +0200)] 
smbd: use fdos_mode() in reply_getatr()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in open_file_ntcreate()
Ralph Boehme [Mon, 19 Oct 2020 18:40:51 +0000 (20:40 +0200)] 
smbd: use fdos_mode() in open_file_ntcreate()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in check_base_file_access()
Ralph Boehme [Mon, 19 Oct 2020 18:39:37 +0000 (20:39 +0200)] 
smbd: use fdos_mode() in check_base_file_access()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in copy_internals()
Ralph Boehme [Mon, 19 Oct 2020 18:38:27 +0000 (20:38 +0200)] 
smbd: use fdos_mode() in copy_internals()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in call_nt_transact_create()
Ralph Boehme [Mon, 19 Oct 2020 18:37:24 +0000 (20:37 +0200)] 
smbd: use fdos_mode() in call_nt_transact_create()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in reply_ntcreate_and_X()
Ralph Boehme [Mon, 19 Oct 2020 18:36:19 +0000 (20:36 +0200)] 
smbd: use fdos_mode() in reply_ntcreate_and_X()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in mark_file_modified()
Ralph Boehme [Mon, 19 Oct 2020 18:32:49 +0000 (20:32 +0200)] 
smbd: use fdos_mode() in mark_file_modified()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in vfs_default_durable_reconnect()
Ralph Boehme [Mon, 19 Oct 2020 18:32:05 +0000 (20:32 +0200)] 
smbd: use fdos_mode() in vfs_default_durable_reconnect()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in set_create_timespec_ea()
Ralph Boehme [Mon, 19 Oct 2020 18:31:15 +0000 (20:31 +0200)] 
smbd: use fdos_mode() in set_create_timespec_ea()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: drop pathref from smb_fname_dst_in in rename_internals_fsp()
Ralph Boehme [Thu, 29 Oct 2020 17:36:08 +0000 (18:36 +0100)] 
smbd: drop pathref from smb_fname_dst_in in rename_internals_fsp()

The pathref is not needed anymore below this point and it conflicts with the
code that checks for open handles on the destination just below.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: un-const smb_fname_dst_in arg of rename_internals_fsp()
Ralph Boehme [Thu, 29 Oct 2020 17:30:19 +0000 (18:30 +0100)] 
smbd: un-const smb_fname_dst_in arg of rename_internals_fsp()

A subsequent commit is going to modify smb_fname_dst_in.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfstest: use filename_convert() in cmd_utime()
Ralph Boehme [Wed, 28 Oct 2020 10:31:46 +0000 (11:31 +0100)] 
vfstest: use filename_convert() in cmd_utime()

Ensures we have a pathref fsp when calling SMB_VFS_NTIMES().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in file_set_sparse()
Ralph Boehme [Mon, 19 Oct 2020 18:29:28 +0000 (20:29 +0200)] 
smbd: use fdos_mode() in file_set_sparse()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in smbd_dirptr_8_3_mode_fn()
Ralph Boehme [Wed, 25 Nov 2020 15:35:11 +0000 (16:35 +0100)] 
smbd: use fdos_mode() in smbd_dirptr_8_3_mode_fn()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fdos_mode() in smbd_dirptr_lanman2_mode_fn()
Ralph Boehme [Mon, 19 Oct 2020 14:40:18 +0000 (16:40 +0200)] 
smbd: use fdos_mode() in smbd_dirptr_lanman2_mode_fn()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: add fdos_mode()
Ralph Boehme [Mon, 19 Oct 2020 13:44:29 +0000 (15:44 +0200)] 
smbd: add fdos_mode()

Note that this continues using the braindead dual path/handle based API mistake,
but only in order to reuse the util functions and because this is an
intermediate step to support transitioning to an all handle based flow.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_gpfs: fix bogus compiler warning
Ralph Boehme [Tue, 20 Oct 2020 19:59:35 +0000 (21:59 +0200)] 
vfs_gpfs: fix bogus compiler warning

The next commit adds the first call inside Samba to the VFS function
SMB_VFS_FGET_DOS_ATTRIBUTES() and therefor also to
vfs_gpfs_fget_dos_attributes().  No idea why gcc is generating this warning:

[4127/4716] Compiling source3/modules/vfs_aio_fork.c
../../source3/modules/vfs_gpfs.c: In function ‘vfs_gpfs_fget_dos_attributes’:
../../source3/modules/vfs_gpfs.c:1728:2: error: ‘file_id’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
 1728 |  update_stat_ex_file_id(&fsp->fsp_name->st, file_id);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
cc1: all warnings being treated as errors

This change fixes the error.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use fsp in smb_set_file_time()
Ralph Boehme [Wed, 28 Oct 2020 11:24:14 +0000 (12:24 +0100)] 
smbd: use fsp in smb_set_file_time()

Ensure we have a valid fsp whos name we pass to file_ntimes(). Remember,
file_ntimes() by default ends up calling SMB_VFS_GET_DOS_ATTRIBUTES() under the
hood in order to get/set the creation date.

As any fsp->fsp_name contains a backpointer to the fsp ie

  fsp->fsp_name->fsp == fsp

passing set_fsp->fsp_name to file_ntimes() allows replacing the path based
SMB_VFS_GET_DOS_ATTRIBUTES() with SMB_VFS_FGET_DOS_ATTRIBUTES() under the hoods.

Also use the base_fsp->fsp_name for the base name in case of setting the
timestamps on a stream.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: always use check_access_fsp() in smb_set_info_standard()
Ralph Boehme [Tue, 27 Oct 2020 20:13:36 +0000 (21:13 +0100)] 
smbd: always use check_access_fsp() in smb_set_info_standard()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: always use check_access_fsp() in smb_set_file_basic_info()
Ralph Boehme [Tue, 27 Oct 2020 20:13:12 +0000 (21:13 +0100)] 
smbd: always use check_access_fsp() in smb_set_file_basic_info()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: in reply_setatr() pass pathref fsp to smb_set_file_time()
Ralph Boehme [Wed, 4 Nov 2020 09:09:34 +0000 (10:09 +0100)] 
smbd: in reply_setatr() pass pathref fsp to smb_set_file_time()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use check_access_fsp() in set_ea()
Ralph Boehme [Tue, 27 Oct 2020 20:12:22 +0000 (21:12 +0100)] 
smbd: use check_access_fsp() in set_ea()

We now always have a fsp.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use pathref fsp in call_trans2setfilepathinfo()
Ralph Boehme [Tue, 17 Nov 2020 11:14:19 +0000 (12:14 +0100)] 
smbd: use pathref fsp in call_trans2setfilepathinfo()

This means we're now passing a valid fsp to all setinfo functions. The only
special case being when dealing with a symlink in POSIX context.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use pathref fsp in call_trans2qfilepathinfo()
Ralph Boehme [Tue, 17 Nov 2020 06:54:42 +0000 (07:54 +0100)] 
smbd: use pathref fsp in call_trans2qfilepathinfo()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use SMB_VFS_CREATE_FILE() in call_trans2mkdir()
Ralph Boehme [Wed, 28 Oct 2020 09:35:59 +0000 (10:35 +0100)] 
smbd: use SMB_VFS_CREATE_FILE() in call_trans2mkdir()

Use SMB_VFS_CREATE_FILE() instead of the create_directory() in order to have a
fsp that we can pass to set_ea().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: check for non FSA fsps in smb_file_rename_information()
Ralph Boehme [Tue, 17 Nov 2020 11:11:13 +0000 (12:11 +0100)] 
smbd: check for non FSA fsps in smb_file_rename_information()

If the fsp is a non FSA fsp created by openat_pathref_fsp(), we can't pass it to
rename_internals_fsp(). We have to go via rename_internals() which internally
uses SMB_VFS_CREATE_FILE() to open an fsp which ensure we go through the lease
checking code.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>