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

31 Commits

Author SHA1 Message Date
Saurabh Singh
2643b7b574 Cleanup and bug fixes in vxfs vfs code.
1) Added debug messages in lib_vxfs.c for get, set and list attr functions
2) Removed vxfs_clearwxattr_fd and vxfs_clearwxattr_path code since it is no longer required now.
3) Replaced strcasecmp with vxfs_strcasecmp
4) Changed vxfs_fset_xattr to retain security.NTACL attribute
5) Fixed deny permissions not retained for a file created on CIFS share in vxfs_set_xattr

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

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Sep  2 17:40:00 UTC 2022 on sn-devel-184
2022-09-02 17:40:00 +00:00
Jeremy Allison
d460118be3 s3: VFS: vxfs: All calls to SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st) clobber fsp->fsp_name->st.st_ex_iflags.
If doing an SMB_VFS_FSTAT() returning onto the stat struct stored in the fsp,
we must call vfs_stat_fsp() as this preserves the iflags.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2022-03-24 16:28:37 +00:00
Jeremy Allison
f91fbc2aed s3: VFS: vxfs: Remove vxfs_get_xattr.
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
f4f1206c75 VFX: vxfs: Fixup some warnings
../../source3/modules/vfs_vxfs.c:343:6: error: unused variable ‘i’ [-Werror=unused-variable]
  int i, offset = 0;
      ^
../../source3/modules/vfs_vxfs.c:342:17: error: unused variable ‘n_id’ [-Werror=unused-variable]
  uint32_t e_id, n_id;
                 ^~~~
../../source3/modules/vfs_vxfs.c:342:11: error: unused variable ‘e_id’ [-Werror=unused-variable]
  uint32_t e_id, n_id;
           ^~~~
../../source3/modules/vfs_vxfs.c:341:35: error: unused variable ‘n_perm’ [-Werror=unused-variable]
  uint16_t e_type, n_type, e_perm, n_perm;
                                   ^~~~~~
../../source3/modules/vfs_vxfs.c:341:27: error: unused variable ‘e_perm’ [-Werror=unused-variable]
  uint16_t e_type, n_type, e_perm, n_perm;
                           ^~~~~~
../../source3/modules/vfs_vxfs.c: In function ‘vxfs_compare’:
../../source3/modules/vfs_vxfs.c:407:6: error: unused variable ‘i’ [-Werror=unused-variable]
  int i, count = 0;
      ^

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-06-11 09:30:53 +00:00
Noel Power
748189b29c VFS: vxfs: ifdef out vxfs_sys_acl_set_fd
as the sys_acl_set_fd_fn definition for vxfs_sys_acl_set_fd is ifdef'ed
out we also need ifdef out the vxfs_sys_acl_set_fd implementation itself
otherwise we get the following error.

source3/modules/vfs_vxfs.c:484:12: error: ‘vxfs_sys_acl_set_fd’ defined but not used [-Werror=unused-function]
 static int vxfs_sys_acl_set_fd(vfs_handle_struct *handle,

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-06-11 09:30:53 +00:00
Jeremy Allison
b62d90f91f s3: VFS: vxfs: Change use of SMB_VFS_SYS_ACL_GET_FILE() -> SMB_VFS_SYS_ACL_GET_FD().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Noel Power
0332ddde1a VFS: Remove SMB_VFS_SET_DOS_ATTRIBUTE, no longer used
-------------------
                             /                   \
                            /        REST         \
                           /          IN           \
                          /          PEACE          \
                         /                           \
                         |                           |
                         | SMB_VFS_SET_DOS_ATTRIBUTE |
                         |                           |
                         |                           |
                         |         3 March           |
                         |           2021            |
                         |                           |
                         |                           |
                        *|      *  *  *        * *   | *
                _________)/\\_//(\/(/\)/\//\/\////\\/|_)_______
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Apr  8 18:38:40 UTC 2021 on sn-devel-184
2021-04-08 18:38:40 +00:00
Jeremy Allison
b2a06e71ca s3: VFS: vxfs: Remove vxfs_remove_xattr() - no longer called.
Also remove supporting function from lib_vxfs.c.

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
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
fc6ee68c29 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>
2020-12-17 18:56:28 +00:00
Ralph Boehme
8d0ea8bafa 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>
2020-12-17 18:56:28 +00:00
Ralph Boehme
9db3ff2573 smbd: use fsp_get_io_fd() when accessing a file or it's associated metadata
In all places where we access or modify a file or it's associated metadata, we
use fsp_get_io_fd() to fetch the low-level fd from the fsp. This ensures we
don't accidentally use a pathref fsp where the fd would be opened as root on
systems lacking O_PATH.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-12-16 09:08:30 +00:00
Matthew DeVore
232054c09b lib/util: remove extra safe_string.h file
lib/util/safe_string.h is similar to source3/include/safe_string.h, but
the former has fewer checks. It is missing bcopy, strcasecmp, and
strncasecmp.

Add the missing elements to lib/util/safe_string.h remove the other
safe_string.h which is in the source3-specific path. To accomodate
existing uses of str(n?)casecmp, add #undef lines to source files where
they are used.

Signed-off-by: Matthew DeVore <matvore@google.com>
Reviewed-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Aug 28 02:18:40 UTC 2020 on sn-devel-184
2020-08-28 02:18:40 +00:00
Ralph Boehme
abc16fafd9 vfs_vxfs: pass name as struct smb_filename to vxfs_compare()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-05 19:18:38 +00:00
Ralph Boehme
fdbb90a8e1 vfs_vxfs: realign vxfs_compare() args to one per line
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-05 19:18:38 +00:00
Ralph Boehme
7e1f9c9d83 s3: vfs: add SMB_VFS_GETXATTRAT_SEND/RECV
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2018-07-27 13:07:14 +02:00
Pooja Mahadik
36b4b56554 pass 'rdonly' or 'directory' flag to open a directory file.
Signed-off-by: Pooja Mahadik <pooja.mahadik@veritas.com>
Reviewed-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 Jul 11 02:22:18 CEST 2018 on sn-devel-144
2018-07-11 02:22:18 +02:00
Christof Schmitt
4003736a3d vfs: Use static_decl_vfs in all VFS modules
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Dec 18 13:32:00 CET 2017 on sn-devel-144
2017-12-18 13:31:59 +01:00
Pooja Mahadik
3794fa0a98 Changes in samba vxfs plugin.
Implemented two VFS operations(set/fset dos attribute) for vxfs plugin.

Trapping set/clear of read-only attribute.

Signed-off-by: Pooja Mahadik <pooja.mahadik@veritas.com>
Reviewed-by: Ralph Böhme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Sep 30 06:42:10 CEST 2017 on sn-devel-144
2017-09-30 06:42:10 +02:00
Jeremy Allison
854ea4eba8 s3: VFS: Change SMB_VFS_GETXATTR to use const struct smb_filename * instead of const char *.
We need to migrate all pathname based VFS calls to use a struct
to finish modernising the VFS with extra timestamp and flags parameters.

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

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun  1 02:58:53 CEST 2017 on sn-devel-144
2017-06-01 02:58:53 +02:00
Jeremy Allison
48956fa4d3 s3: VFS: Change SMB_VFS_SETXATTR to use const struct smb_filename * instead of const char *.
We need to migrate all pathname based VFS calls to use a struct
to finish modernising the VFS with extra timestamp and flags parameters.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-05-31 22:50:22 +02:00
Jeremy Allison
12b801d9d7 s3: VFS: Change SMB_VFS_REMOVEXATTR to use const struct smb_filename * instead of const char *.
We need to migrate all pathname based VFS calls to use a struct
to finish modernising the VFS with extra timestamp and flags parameters.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-05-31 22:50:22 +02:00
Jeremy Allison
892476b555 s3: VFS: Change SMB_VFS_LISTXATTR to use const struct smb_filename * instead of const char *.
We need to migrate all pathname based VFS calls to use a struct
to finish modernising the VFS with extra timestamp and flags parameters.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-05-31 22:50:22 +02:00
Jeremy Allison
aada94885d s3: VFS: Change SMB_VFS_SYS_ACL_SET_FILE to use const struct smb_filename * instead of const char *.
We need to migrate all pathname based VFS calls to use a struct
to finish modernising the VFS with extra timestamp and flags parameters.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-05-31 22:50:22 +02:00
Jeremy Allison
cea8e57eac s3: VFS: Change SMB_VFS_SYS_ACL_GET_FILE to use const struct smb_filename * instead of const char *.
We need to migrate all pathname based VFS calls to use a struct
to finish modernising the VFS with extra timestamp and flags parameters.

Requires a few extra cleanups in calling code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-05-31 22:50:22 +02:00
Jeremy Allison
306783d6f5 lib: modules: Change XXX_init interface from XXX_init(void) to XXX_init(TALLOC_CTX *)
Not currently used - no logic changes inside.

This will make it possible to pass down a long-lived talloc
context from the loading function for modules to use instead
of having them internally all use talloc_autofree_context()
which is a hidden global.

Updated all known module interface numbers, and added a
WHATSNEW.

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Ralph Böhme <slow@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Apr 22 01:17:00 CEST 2017 on sn-devel-144
2017-04-22 01:17:00 +02:00
Abhidnya Joshi
469fdcd662 Efficient xattr handling for VxFS Signed-off-by: Abhidnya Joshi <Abhidnya.Joshi@veritas.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jun  3 07:26:34 CEST 2016 on sn-devel-144
2016-06-03 07:26:33 +02:00
Jeremy Allison
dc5dad4813 s3: Filenames: Add uint32_t flags parameter to synthetic_smb_fname().
Get it from parent/deriving smb_filename if present.
Use 0 (as usually this a Windows-style lookup) if
not.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
2016-03-24 22:57:16 +01:00
Abhidnya Joshi
9fca4f71c0 s3: vfs module: Adding new vfs module for Symantec VxFS.
This mainly handles ACL related functions.

Modified to add requirement for -DCFLAGS=-DXATTR_USER_NTACL="user.NTACL"
and to hide access to XATTR_USER_NTACL by jra.

Signed-off-by: Abhidnya Joshi <abhidnya_joshi@symantec.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep 18 02:30:06 CEST 2014 on sn-devel-104
2014-09-18 02:30:06 +02:00