1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

89 Commits

Author SHA1 Message Date
Volker Lendecke
5fc016f268 vfs: change openat propotype to match linux openat2
The Linux prototype for openat2 looks like this:

       long openat2(int dirfd, const char *pathname,
                   struct open_how *how, size_t size);

where "struct open_how" is defined in "linux/openat2.h". It is
designed to be extensible with further flags.

The "size" parameter is required because there is no type checking
between userland and kernelspace, so the way for Linux to find which
version of open_how is being passed in is looking at the size:
"open_how" is expected to only every grow with additional fields,
should a change be necessary in the future.

Samba does not have this problem, we can typecheck the struct and
pointers, we expect all VFS modules to be compiled against the current
vfs.h.

For now this adds no functionality, but it will make further patches
much smaller.

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>
2022-08-06 01:43:50 +00:00
Volker Lendecke
6086a73f4e Revert "vfs: remove dirfsp arg from SMB_VFS_CREATE_FILE()"
This reverts commit 322574834f.

Not strictly a revert anymore, but for future work we do need "dirfsp"
in create_file_default() passed through the VFS.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2022-04-28 13:12:33 +00:00
Ralph Boehme
25043ebb2e source3: move lib/substitute.c functions out of proto.h
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14897

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2021-11-11 13:49:32 +00:00
Jeremy Allison
1d3403fe21 s3: VFS: unityed_media: Remove um_getxattr.
No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-07-04 17:15:35 +00:00
Noel Power
ceb1403d04 VFS: unityed_media: Remove SMB_VFS_CHFLAGS
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-06-29 08:21:38 +00:00
Jeremy Allison
395cee80e9 s3: VFS: unityed_media: Use real dirfsp for SMB_VFS_RENAMEAT()
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-06-22 13:44:34 +00:00
Jeremy Allison
8a6e84287e s3: VFS: unityed_media: Remove um_sys_acl_get_file().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:31 +00:00
Jeremy Allison
7da81bfbe5 s3: VFS: shadow_copy2: Remove shadow_copy2_get_nt_acl_at().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:31 +00:00
Jeremy Allison
cfa4448341 s3: VFS: unityed_media: Remove um_sys_acl_delete_def_file().
No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-18 17:29:34 +00:00
Noel Power
9fca2ae73a s3/modules: VFS: unityed_media: Remove SMB_VFS_STREAMINFO
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-05-11 15:49:28 +00:00
Samuel Cabrero
adb952f01c s3: VFS: unityed_media: Remove SMB_VFS_NTIMES()
Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-04-19 12:28:30 +00:00
Noel Power
8b24b86435 s3/modules: VFS: unityed_media: Remove um_chmod function
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-04-11 22:27:34 +00:00
Jeremy Allison
721c604d28 s3: VFS: unityed_media: Remove um_removexattr(). No longer called.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-04-07 16:26:28 +00:00
Noel Power
82e1402636 VFS: Remove SMB_VFS_SETXATTR, no longer used
---------------
                                  /               \
                                 /      REST       \
                                /        IN         \
                               /        PEACE        \
                              /                       \
                              |                       |
                              |   SMB_VFS_SETXATTR    |
                              |                       |
                              |                       |
                              |       19 February     |
                              |          2021         |
                              |                       |
                              |                       |
                             *|     *  *  *           | *
                    _________)/\\_//(\/(/\)/\//\/\////|_)_______

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>

Signed-off-by: Noel Power <noel.power@suse.com>
2021-03-11 17:50:30 +00:00
Noel Power
46226cb219 VFS: Remove SMB_VFS_LISTXATTR, no longer used
---------------
                              /               \
                             /      REST       \
                            /        IN         \
                           /        PEACE        \
                          /                       \
                          |                       |
                          |   SMB_VFS_LISTXATTR   |
                          |                       |
                          |                       |
                          |       10 February     |
                          |          2021         |
                          |                       |
                          |                       |
                         *|     *  *  *           | *
                _________)/\\_//(\/(/\)/\//\/\////|_)_______

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-26 21:28:33 +00:00
Jeremy Allison
e884793cf2 s3: VFS: unityed_media: Fix um_readlinkat() to cope with real directory fsps.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
2021-02-13 00:17:31 +00:00
Jeremy Allison
a3f6495002 s3: VFS: unityed_media: Fix um_linkat() to cope with real directory fsps.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2021-02-09 00:10:29 +00:00
Ralph Boehme
2d31aef937 vfs_unityed_media: support real dirfsps in um_unlinkat()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-01-28 08:11:49 +00:00
Jeremy Allison
b324626a3c VFS: unityed_media: Fixup um_symlinkat() to correctly use the dirfsp path.
Missed in my original fixes.

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): Thu Jan 28 08:10:18 UTC 2021 on sn-devel-184
2021-01-28 08:10:18 +00:00
Jeremy Allison
e02b3484ad VFS: unityed_media: Fixup um_mknodat() to correctly use the dirfsp path.
Missed in my original fixes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2021-01-21 21:48:30 +00:00
Jeremy Allison
83686ff1e1 VFS: unityed_media: Fix um_mkdirat() to correctly look at the full pathname.
Missed in the original mkdirat fixes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2021-01-21 21:48:30 +00:00
Ralph Boehme
92b1499542 vfs: RIP SMB_VFS_SYS_ACL_SET_FILE()
.--. .-,       .-..-.__
        .'(`.-` \_.-'-./`  |\_( "\__
     __.>\ ';  _;---,._|   / __/`'--)
    /.--.  : |/' _.--.<|  /  | |
_..-'    `\     /' /`  /_/ _/_/
 >_.-``-. `Y  /' _;---.`|/))))
'` .-''. \|:  .'   __, .-'"`
 .'--._ `-:  \/:  /'  '.\             _|_
     /.'`\ :;   /'      `-           `-|-`
    -`    |     |                      |
          :.; : |                  .-'~^~`-.
          |:    |                .' _     _ `.
          |:.   |                | |_) | |_) |
          :. :  |                | | \ | |   |
          : ;   |                |           |
          : ;   |                |  SMB_VFS  |
          : ;   |                |  SYS_ACL  |
          : ;   |                | SET_FILE  |
        .jgs. : ;                |           |
-."-/\\\/:::.    `\."-._'."-"_\\-|           |///."-
" -."-.\\"-."//.-".`-."_\\-.".-\\`=.........=`//-".

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-12-17 18:56:29 +00:00
Ralph Boehme
9bafb89403 vfs_unityed_media: support real dirfsps in um_mkdirat()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-12-17 18:56:29 +00:00
Ralph Boehme
dba8593c6f 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>
2020-12-16 09:08:31 +00:00
Ralph Boehme
c4cbe0610c vfs: make dirfsp arg to SMB_VFS_READLINKAT() const
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-10-23 07:56:32 +00:00
Ralph Boehme
322574834f vfs: remove dirfsp arg from SMB_VFS_CREATE_FILE()
This was supposed to be a shortcut to avoid passing dirfsp around as an explicit
function argument throughout the whole codebase when the new VFS design idea was
based on using *AT functions throughout the VFS.

Now that we've opted for basing the VFS on handles and *AT functions will only
be used in a much more limitted extent, it makes sense to remove this internal
dirfsp reference, otherwise the combination of internal fsp->dirfsp and
smb_fname->fsp is going to be a tough to wrap your head around.

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): Fri Oct  2 21:00:05 UTC 2020 on sn-devel-184
2020-10-02 21:00:05 +00:00
Ralph Boehme
2327471756 lib: relicense smb_strtoul(l) under LGPLv3
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Aug  3 22:21:04 UTC 2020 on sn-devel-184
2020-08-03 22:21:02 +00:00
Ralph Boehme
32588c023e vfs: remove SMB_VFS_OPEN()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-21 20:38:34 +00:00
Ralph Boehme
739e100f47 vfs_unityed_media: implement SMB_VFS_OPENAT()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-21 20:38:34 +00:00
Ralph Boehme
44cd415921 smbd: add dirfsp arg to SMB_VFS_CREATE_FILE()
As create_file_default() still need to be updated in the future to replace the
SMB_VFS_STAT() calls with AT-based versions, it asserts (dirfsp ==
dirfsp->conn->cwd_fsp).

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-21 05:23:31 +00:00
Ralph Boehme
7215669d29 vfs: remove root_dir_fid arg from SMB_VFS_CREATE_FILE()
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): Thu May 14 19:43:27 UTC 2020 on sn-devel-184
2020-05-14 19:43:27 +00:00
Jeremy Allison
67b778ccfc s3: VFS: unityed_media. Remove get_nt_acl_fn().
No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-07 19:27:37 +00:00
Jeremy Allison
91f06daf33 s3: VFS: unityed_media. Add um_get_nt_acl_at().
Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-07 19:27:35 +00:00
Ralph Boehme
26ca22fa14 smbd: vfs: convert link_contents arg of SMB_VFS_SYMLINKAT() to struct smb_filename
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-05 19:18:41 +00:00
Ralph Boehme
b74653f2cd smbd: add twrp arg to synthetic_smb_fname()
Most places take twrp from a local struct smb_filename variable that the
function is working on. Some don't for various reasons:

o synthetic_smb_fname_split() is only called in very few places where we don't
  expect twrp paths

o implementations of SMB_VFS_GETWD(), SMB_VFS_FS_CAPABILITIES() and
  SMB_VFS_REALPATH() return the systems view of cwd and realpath without twrp info

o VFS modules implementing previous-versions support (vfs_ceph_snapshots,
  vfs_shadow_copy2, vfs_snapper) synthesize raw paths that are passed to VFS NEXT
  functions and therefor do not use twrp

o vfs_fruit: macOS doesn't support VSS

o vfs_recycle: in recycle_create_dir() we need a raw OS path to create a directory

o vfs_virusfilter: a few places where we need raw OS paths

o vfs_xattr_tdb: needs a raw OS path for SMB_VFS_NEXT_STAT()

o printing and rpc server: don't support VSS

o vfs_default_durable_reconnect: no Durable Handles on VSS handles, this might
  be enhances in the future. No idea if Windows supports this.

o get_real_filename_full_scan: hm.... FIXME??

o get_original_lcomp: working on a raw path

o msdfs: doesn't support VSS

o vfs_get_ntquota: synthesizes an smb_filename from ".", so doesn't support VSS
  even though VFS modules implement it

o fd_open: conn_rootdir_fname is a raw path

o msg_file_was_renamed: obvious

o open_np_file: pipes don't support VSS

o Python bindings: get's a raw path from the caller

o set_conn_connectpath: raw path

o set_conn_connectpath: raw path

o torture: gets raw paths from the caller

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-05 19:18:40 +00:00
Ralph Boehme
2a5d994b1a vfs: remove SMB_VFS_OPENDIR()
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): Tue Mar 24 21:23:43 UTC 2020 on sn-devel-184
2020-03-24 21:23:43 +00:00
Jeremy Allison
ce63e83a6a s3: VFS: vfs_cap: Remove chown_fn().
No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2019-10-15 18:46:37 +00:00
Jeremy Allison
44f9adc155 s3: VFS: vfs_unityed_media: Remove rmdir_fn. No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-10-10 06:09:40 +00:00
Jeremy Allison
7c814ef429 s3: VFS: vfs_unityed_media: Remove unlink_fn. No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-09-26 17:20:51 +00:00
Jeremy Allison
70f5cbc54d s3: VFS: vfs_unityed_media. Implement unlinkat().
This is identical to unlink(), as there
are no special cases needed for rmdir().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-09-26 17:20:47 +00:00
Jeremy Allison
fcccf3ea96 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>
2019-09-11 18:24:31 +00:00
Jeremy Allison
63132f8b04 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>
2019-09-11 18:24:29 +00:00
Jeremy Allison
a676e494cd s3: VFS: vfs_unityed_media. Remove symlink_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2019-09-03 21:15:44 +00:00
Jeremy Allison
8c851da40f s3: VFS: vfs_unityed_media. Implement symlinkat().
Currently identical to symlink().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2019-09-03 21:15:43 +00:00
Jeremy Allison
58bce531fb s3: VFS: vfs_unityed_media. Remove readlink_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2019-08-23 18:49:37 +00:00
Jeremy Allison
6f1c0d4317 s3: VFS: vfs_unityed_media. Implement readlinkat().
Currently identical to readlink().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2019-08-23 18:49:36 +00:00
Jeremy Allison
42d6d9cf4e s3: VFS: vfs_unityed_media. Remove mknod_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2019-08-22 18:00:35 +00:00
Jeremy Allison
5f115eca92 s3: VFS: vfs_unityed_media. Implement mknodat().
Currently identical to mknod().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2019-08-22 18:00:34 +00:00
Jeremy Allison
d31d52f16d s3: VFS: vfs_unityed_media. Remove link_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2019-08-20 21:09:29 +00:00
Jeremy Allison
6b6298b023 s3: VFS: vfs_unityed_media. Implement linkat().
Currently identical to link().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2019-08-20 21:09:28 +00:00