]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
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>
4 years agosmbd: deal with non FSA fsps in check_access_fsp()
Ralph Boehme [Tue, 17 Nov 2020 11:09:05 +0000 (12:09 +0100)] 
smbd: deal with non FSA fsps in check_access_fsp()

For fsps coming out of openat_pathref_fsp() and not SMB_VFS_CREATE_FILE(),
fsp->access_mask will be 0 and we check the requested rights against the
permissions of the object opened by the fsp.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: unconst fsp arg of check_access_fsp()
Ralph Boehme [Tue, 17 Nov 2020 11:08:48 +0000 (12:08 +0100)] 
smbd: unconst fsp arg of check_access_fsp()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: check for valid FSA fsp in smb_set_posix_acl()
Ralph Boehme [Mon, 16 Nov 2020 17:37:42 +0000 (18:37 +0100)] 
smbd: check for valid FSA fsp in smb_set_posix_acl()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: check for valid FSA fsp in smb_query_posix_acl()
Ralph Boehme [Mon, 16 Nov 2020 17:37:11 +0000 (18:37 +0100)] 
smbd: check for valid FSA fsp in smb_query_posix_acl()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: adjust allocation size check across handles in smbd_do_qfilepathinfo()
Ralph Boehme [Tue, 17 Nov 2020 06:59:13 +0000 (07:59 +0100)] 
smbd: adjust allocation size check across handles in smbd_do_qfilepathinfo()

Check all open files if either we don't have an fsp or if the fsp is not a full
FSA fsp, ie not one which was created by SMB_VFS_CREATE_FILE() but by
openat_pathref_fsp().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: add smbd_check_access_rights_fsp()
Ralph Boehme [Tue, 27 Oct 2020 10:24:03 +0000 (11:24 +0100)] 
smbd: add smbd_check_access_rights_fsp()

Handle based version of smbd_check_access_rights().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: factor out smbd_check_access_rights_sd() from smbd_check_access_rights()
Ralph Boehme [Tue, 27 Oct 2020 10:23:03 +0000 (11:23 +0100)] 
smbd: factor out smbd_check_access_rights_sd() from smbd_check_access_rights()

No change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: call open_pathref_fsp() in smbd_dirptr_get_entry()
Ralph Boehme [Thu, 12 Nov 2020 09:00:57 +0000 (10:00 +0100)] 
smbd: call open_pathref_fsp() in smbd_dirptr_get_entry()

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

Caller currently always passes true, but this will change soonish with a change
to smbd_dirptr_get_entry().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_default: return stat info for symlinks in POSIX context
Ralph Boehme [Fri, 16 Oct 2020 13:47:50 +0000 (15:47 +0200)] 
vfs_default: return stat info for symlinks in POSIX context

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_default: simplify vfswrap_readdir()
Ralph Boehme [Fri, 16 Oct 2020 13:40:56 +0000 (15:40 +0200)] 
vfs_default: simplify vfswrap_readdir()

No change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs: Add dirfsp arg to SMB_VFS_READDIR()
Ralph Boehme [Sun, 22 Nov 2020 12:57:27 +0000 (13:57 +0100)] 
vfs: Add dirfsp arg to SMB_VFS_READDIR()

This allows for optimisations in VFS module: by passing the dirfsp as an
additional arg, the function can check fsp->fsp_name->flags which may include eg
SMB_FILENAME_POSIX_PATH to trigger POSIX pathname processing.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use vfs_stat() in more places
Ralph Boehme [Wed, 25 Nov 2020 11:29:40 +0000 (12:29 +0100)] 
smbd: use vfs_stat() in more places

This replaces the code in a bunch of places where we choose between stat() and
lstat() based on req->posix_pathname. The new code inside vfs_stat() is based on
checking the smb_fname flag SMB_FILENAME_POSIX_PATH.

req->posix_pathname is inherited from the global POSIX pathnames state and the
smb_fname flags is also inherited from that indirectly via the UCF flags.

Tl;dr: no change in behaviour. :)

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: use vfs_stat() in dptr_ReadDirName()
Ralph Boehme [Wed, 14 Oct 2020 13:48:07 +0000 (15:48 +0200)] 
smbd: use vfs_stat() in dptr_ReadDirName()

This is subtle: we inherit the smb_fname flags from the directory to its
directory entries while listing a directory. This means if were listing a
directory in POSIX context, we now treat all entries as POSIX paths and
correctly call lstat() on the entries instead of stat().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: add vfs_stat()
Ralph Boehme [Fri, 16 Oct 2020 12:35:10 +0000 (14:35 +0200)] 
smbd: add vfs_stat()

Deals with POSIX paths and either calls lstat() for POSIX or stat().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3/torture: add POSIX-STAT test
Ralph Boehme [Thu, 15 Oct 2020 13:36:42 +0000 (15:36 +0200)] 
s3/torture: add POSIX-STAT test

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