samba.git
2 years agos3: VFS: Remove call to posix_sys_acl_blob_get_file().
Jeremy Allison [Tue, 8 Jun 2021 23:08:29 +0000 (16:08 -0700)]
s3: VFS: Remove call to posix_sys_acl_blob_get_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: nfs4acl_xattr: Remove call to nfs4acl_xattr_fail__sys_acl_blob_get_file().
Jeremy Allison [Tue, 8 Jun 2021 23:07:43 +0000 (16:07 -0700)]
s3: VFS: nfs4acl_xattr: Remove call to nfs4acl_xattr_fail__sys_acl_blob_get_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: hpuxacl: Remove call to posix_sys_acl_blob_get_file().
Jeremy Allison [Tue, 8 Jun 2021 23:07:02 +0000 (16:07 -0700)]
s3: VFS: hpuxacl: Remove call to posix_sys_acl_blob_get_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: gpfs: Remove gpfsacl_sys_acl_blob_get_file().
Jeremy Allison [Tue, 8 Jun 2021 23:06:26 +0000 (16:06 -0700)]
s3: VFS: gpfs: Remove gpfsacl_sys_acl_blob_get_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: glusterfs: Remove call to posix_sys_acl_blob_get_file().
Jeremy Allison [Tue, 8 Jun 2021 23:05:33 +0000 (16:05 -0700)]
s3: VFS: glusterfs: Remove call to posix_sys_acl_blob_get_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: fake_acls: Remove call to posix_sys_acl_blob_get_file().
Jeremy Allison [Tue, 8 Jun 2021 23:04:55 +0000 (16:04 -0700)]
s3: VFS: fake_acls: Remove call to posix_sys_acl_blob_get_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: ceph: Remove call to posix_sys_acl_blob_get_file().
Jeremy Allison [Tue, 8 Jun 2021 23:04:21 +0000 (16:04 -0700)]
s3: VFS: ceph: Remove call to posix_sys_acl_blob_get_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: aixaxcl2: Remove aixjfs2_sys_acl_blob_get_file().
Jeremy Allison [Tue, 8 Jun 2021 23:03:40 +0000 (16:03 -0700)]
s3: VFS: aixaxcl2: Remove aixjfs2_sys_acl_blob_get_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: aixacl: Remove call to posix_sys_acl_blob_get_file().
Jeremy Allison [Tue, 8 Jun 2021 23:02:48 +0000 (16:02 -0700)]
s3: VFS: aixacl: Remove call to posix_sys_acl_blob_get_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: afsacl: Remove afsacl_sys_acl_blob_get_file().
Jeremy Allison [Tue, 8 Jun 2021 23:01:50 +0000 (16:01 -0700)]
s3: VFS: afsacl: Remove afsacl_sys_acl_blob_get_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: Update status of SMB_VFS_SYS_ACL_GET_FILE
Jeremy Allison [Tue, 8 Jun 2021 22:59:34 +0000 (15:59 -0700)]
s3: VFS: Update status of SMB_VFS_SYS_ACL_GET_FILE

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: RIP SMB_VFS_SYS_ACL_GET_FILE()
Jeremy Allison [Tue, 8 Jun 2021 22:56:20 +0000 (15:56 -0700)]
s3: VFS: RIP SMB_VFS_SYS_ACL_GET_FILE()

                    (\  _  /)
                    ( \ O / )
                     (// \\)
                        X
                       / \
                      /___\
               _____/      \\_____
              |         +         ||
              |                   ||
              |   SMB_VFS_SYS_    ||
              |  ACL_GET_FILE()   ||
              |                   ||
              |                   ||
              |                   ||
              |  _     ___   _    ||
              | | \     |   | \   ||
              | |  |    |   |  |  ||
              | |_/     |   |_/   ||
              | | \     |   |     ||
              | |  \    |   |     ||
              | |   \. _|_. | .   ||
              |                   ||
      *     * | *   **    * **    |**     **
       \)),.,\(/.,(//,,..,,\||(,,.,\\,.((//

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: posixacl: Remove call to posixacl_sys_acl_get_file().
Jeremy Allison [Tue, 8 Jun 2021 22:37:35 +0000 (15:37 -0700)]
s3: VFS: posixacl: Remove call to posixacl_sys_acl_get_file().

We can't remove the code yet until the callers inside sysacl.c
are gone. We must remove the VFS function first.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: zfsacl: Remove zfsacl_fail__sys_acl_get_file().
Jeremy Allison [Tue, 8 Jun 2021 22:26:40 +0000 (15:26 -0700)]
s3: VFS: zfsacl: Remove zfsacl_fail__sys_acl_get_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: unityed_media: Remove um_sys_acl_get_file().
Jeremy Allison [Tue, 8 Jun 2021 22:26:04 +0000 (15:26 -0700)]
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>
2 years agos3: VFS: solarisacl: Make solarisacl_sys_acl_get_file() static. Still called internally.
Jeremy Allison [Tue, 8 Jun 2021 22:25:14 +0000 (15:25 -0700)]
s3: VFS: solarisacl: Make solarisacl_sys_acl_get_file() static. Still called internally.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: nfs4acl_xattr: Remove nfs4acl_xattr_fail__sys_acl_get_file().
Jeremy Allison [Tue, 8 Jun 2021 22:23:47 +0000 (15:23 -0700)]
s3: VFS: nfs4acl_xattr: Remove nfs4acl_xattr_fail__sys_acl_get_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: media_harmony: Remove mh_sys_acl_get_file().
Jeremy Allison [Tue, 8 Jun 2021 22:22:59 +0000 (15:22 -0700)]
s3: VFS: media_harmony: Remove mh_sys_acl_get_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: hpuxacl: Make hpuxacl_sys_acl_get_file() static.
Jeremy Allison [Tue, 8 Jun 2021 22:21:59 +0000 (15:21 -0700)]
s3: VFS: hpuxacl: Make hpuxacl_sys_acl_get_file() static.

Called internally as HPUX has no fd-based acl functions.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: gpfs: Remove gpfsacl_sys_acl_get_file().
Jeremy Allison [Tue, 8 Jun 2021 22:21:06 +0000 (15:21 -0700)]
s3: VFS: gpfs: Remove gpfsacl_sys_acl_get_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: glusterfs: Remove call to posixacl_xattr_acl_get_file().
Jeremy Allison [Tue, 8 Jun 2021 22:20:05 +0000 (15:20 -0700)]
s3: VFS: glusterfs: Remove call to posixacl_xattr_acl_get_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: fake_acls: Remove fake_acls_sys_acl_get_file().
Jeremy Allison [Tue, 8 Jun 2021 22:19:03 +0000 (15:19 -0700)]
s3: VFS: fake_acls: Remove fake_acls_sys_acl_get_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: ceph: Remove call to posixacl_xattr_acl_get_file().
Jeremy Allison [Tue, 8 Jun 2021 22:18:14 +0000 (15:18 -0700)]
s3: VFS: ceph: Remove call to posixacl_xattr_acl_get_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: catia: Remove catia_sys_acl_get_file().
Jeremy Allison [Tue, 8 Jun 2021 22:17:02 +0000 (15:17 -0700)]
s3: VFS: catia: Remove catia_sys_acl_get_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: cap: Remove cap_sys_acl_get_file().
Jeremy Allison [Tue, 8 Jun 2021 22:16:23 +0000 (15:16 -0700)]
s3: VFS: cap: Remove cap_sys_acl_get_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: aixacl2: Remove aixjfs2_sys_acl_get_file().
Jeremy Allison [Tue, 8 Jun 2021 22:15:41 +0000 (15:15 -0700)]
s3: VFS: aixacl2: Remove aixjfs2_sys_acl_get_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: aixacl: Remove aixacl_sys_acl_get_file().
Jeremy Allison [Tue, 8 Jun 2021 22:14:57 +0000 (15:14 -0700)]
s3: VFS: aixacl: Remove aixacl_sys_acl_get_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: Remove posix_get_nt_acl().No longer used.
Jeremy Allison [Tue, 8 Jun 2021 20:09:43 +0000 (13:09 -0700)]
s3: smbd: Remove posix_get_nt_acl().No longer used.

Comment out load_inherited_info() as that was the
only caller.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: Update status of SMB_VFS_NT_ACL_AT.
Jeremy Allison [Tue, 8 Jun 2021 20:06:42 +0000 (13:06 -0700)]
s3: VFS: Update status of SMB_VFS_NT_ACL_AT.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agovfs: RIP SMB_VFS_GET_NT_ACL_AT()
Jeremy Allison [Tue, 8 Jun 2021 20:04:57 +0000 (13:04 -0700)]
vfs: RIP SMB_VFS_GET_NT_ACL_AT()

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: acl_common: Remove the dirfsp parameter from validate_nt_acl_blob().
Jeremy Allison [Tue, 8 Jun 2021 20:02:42 +0000 (13:02 -0700)]
s3: VFS: acl_common: Remove the dirfsp parameter from validate_nt_acl_blob().

No longer needed.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: acl_common: Remove the pathname-based calls in validate_nt_acl_blob().
Jeremy Allison [Tue, 8 Jun 2021 20:01:12 +0000 (13:01 -0700)]
s3: VFS: acl_common: Remove the pathname-based calls in validate_nt_acl_blob().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: acl_common: Remove get_nt_acl_common_at().
Jeremy Allison [Tue, 8 Jun 2021 19:59:31 +0000 (12:59 -0700)]
s3: VFS: acl_common: Remove get_nt_acl_common_at().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: zfsacl: Remove zfsacl_get_nt_acl_at().
Jeremy Allison [Tue, 8 Jun 2021 19:51:26 +0000 (12:51 -0700)]
s3: VFS: zfsacl: Remove zfsacl_get_nt_acl_at().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: snapper: Remove snapper_gmt_get_nt_acl_at().
Jeremy Allison [Tue, 8 Jun 2021 19:50:31 +0000 (12:50 -0700)]
s3: VFS: snapper: Remove snapper_gmt_get_nt_acl_at().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: nfs4acl_xattr: Remove nfs4acl_xattr_get_nt_acl_at().
Jeremy Allison [Tue, 8 Jun 2021 19:49:03 +0000 (12:49 -0700)]
s3: VFS: nfs4acl_xattr: Remove nfs4acl_xattr_get_nt_acl_at().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: media_harmony. Remove mh_get_nt_acl_at().
Jeremy Allison [Tue, 8 Jun 2021 19:48:12 +0000 (12:48 -0700)]
s3: VFS: media_harmony. Remove mh_get_nt_acl_at().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: gpfs. Remove gpfsacl_get_nt_acl_at().
Jeremy Allison [Tue, 8 Jun 2021 19:47:27 +0000 (12:47 -0700)]
s3: VFS: gpfs. Remove gpfsacl_get_nt_acl_at().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: ceph_snapshots. Remove ceph_snap_gmt_get_nt_acl_at().
Jeremy Allison [Tue, 8 Jun 2021 19:46:34 +0000 (12:46 -0700)]
s3: VFS: ceph_snapshots. Remove ceph_snap_gmt_get_nt_acl_at().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: catia. Remove catia_get_nt_acl_at().
Jeremy Allison [Tue, 8 Jun 2021 19:45:43 +0000 (12:45 -0700)]
s3: VFS: catia. Remove catia_get_nt_acl_at().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: acl_xattr: Remove unused get_acl_blob_at().
Jeremy Allison [Tue, 8 Jun 2021 19:44:51 +0000 (12:44 -0700)]
s3: VFS: acl_xattr: Remove unused get_acl_blob_at().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: acl_xattr: Remove acl_xattr_get_nt_acl_at().
Jeremy Allison [Tue, 8 Jun 2021 19:44:05 +0000 (12:44 -0700)]
s3: VFS: acl_xattr: Remove acl_xattr_get_nt_acl_at().

Comment out get_acl_blob_at() as no longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: acl_tdb: Remove unused get_acl_blob_at().
Jeremy Allison [Tue, 8 Jun 2021 19:42:52 +0000 (12:42 -0700)]
s3: VFS: acl_tdb: Remove unused get_acl_blob_at().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: acl_tdb. Remove acl_tdb_get_nt_acl_at().
Jeremy Allison [Tue, 8 Jun 2021 19:42:00 +0000 (12:42 -0700)]
s3: VFS: acl_tdb. Remove acl_tdb_get_nt_acl_at().

Comment out get_acl_blob_at() as no longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: aixacl2: Remove aixjfs2_get_nt_acl_at().
Jeremy Allison [Tue, 8 Jun 2021 19:40:40 +0000 (12:40 -0700)]
s3: VFS: aixacl2: Remove aixjfs2_get_nt_acl_at().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: afsacl: Remove afsacl_get_nt_acl_at().
Jeremy Allison [Tue, 8 Jun 2021 19:39:56 +0000 (12:39 -0700)]
s3: VFS: afsacl: Remove afsacl_get_nt_acl_at().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: shadow_copy2: Remove shadow_copy2_get_nt_acl_at().
Jeremy Allison [Tue, 8 Jun 2021 19:38:43 +0000 (12:38 -0700)]
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>
2 years agos3 VFS: glusterfs: Remove get_nt_acl_at_fn().
Jeremy Allison [Tue, 8 Jun 2021 19:34:25 +0000 (12:34 -0700)]
s3 VFS: glusterfs: Remove get_nt_acl_at_fn().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: open_directory(). Pass down the real parent_dir->fsp to smbd_check_access_r...
Jeremy Allison [Tue, 8 Jun 2021 19:28:24 +0000 (12:28 -0700)]
s3: smbd: open_directory(). Pass down the real parent_dir->fsp to smbd_check_access_rights_fsp().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: open_file(). Pass down the real parent_dir->fsp to smbd_check_access_rights...
Jeremy Allison [Tue, 8 Jun 2021 19:27:09 +0000 (12:27 -0700)]
s3: smbd: open_file(). Pass down the real parent_dir->fsp to smbd_check_access_rights_fsp().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: smbd_check_access_rights_fsp(). Add dirfsp parameter.
Jeremy Allison [Tue, 8 Jun 2021 19:24:17 +0000 (12:24 -0700)]
s3: smbd: smbd_check_access_rights_fsp(). Add dirfsp parameter.

Pass down to smbd_check_access_rights_sd().

Always pass conn->cwd_fsp for now.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: smbd_check_access_rights_sd(). Add dirfsp parameter.
Jeremy Allison [Tue, 8 Jun 2021 19:16:04 +0000 (12:16 -0700)]
s3: smbd: smbd_check_access_rights_sd(). Add dirfsp parameter.

Pass down to parent_override_delete().

Always pass fsp->conn->cwd_fsp for now.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: parent_override_delete(). Add dirfsp parameter.
Jeremy Allison [Tue, 8 Jun 2021 19:14:19 +0000 (12:14 -0700)]
s3: smbd: parent_override_delete(). Add dirfsp parameter.

Pass down to can_delete_file_in_directory().

Always pass conn->cwd_fsp for now.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: open_directory(). Start passing a real parent dirfsp to smbd_calculate_acce...
Jeremy Allison [Tue, 8 Jun 2021 19:02:16 +0000 (12:02 -0700)]
s3: smbd: open_directory(). Start passing a real parent dirfsp to smbd_calculate_access_mask_fsp().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: open_file_ntcreate(). Start passing a real parent dirfsp to smbd_calculate_...
Jeremy Allison [Tue, 8 Jun 2021 19:00:56 +0000 (12:00 -0700)]
s3: smbd: open_file_ntcreate(). Start passing a real parent dirfsp to smbd_calculate_access_mask_fsp().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: smbd_calculate_access_mask_fsp(). Add dirfsp parameter.
Jeremy Allison [Tue, 8 Jun 2021 18:56:25 +0000 (11:56 -0700)]
s3: smbd: smbd_calculate_access_mask_fsp(). Add dirfsp parameter.

Pass this down into smbd_calculate_maximum_allowed_access_fsp().

Currently pass fsp->conn->cwd_fsp everywhere.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: smbd_calculate_maximum_allowed_access_fsp(), add parent dirfsp parameter...
Jeremy Allison [Tue, 8 Jun 2021 18:40:11 +0000 (11:40 -0700)]
s3: smbd: smbd_calculate_maximum_allowed_access_fsp(), add parent dirfsp parameter and pass to can_delete_file_in_directory().

Pass the same fsp->conn->cwd_fsp parameter to can_delete_file_in_directory()
dirfsp for now.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: Remove smbd_check_access_rights(). No longer used.
Jeremy Allison [Tue, 8 Jun 2021 18:37:57 +0000 (11:37 -0700)]
s3: smbd: Remove smbd_check_access_rights(). No longer used.

There are now no more callers of SMB_VFS_GET_NT_ACL_AT().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: can_delete_file_in_directory(), smbd_check_access_rights() -> smbd_check_ac...
Jeremy Allison [Tue, 8 Jun 2021 18:18:34 +0000 (11:18 -0700)]
s3: smbd: can_delete_file_in_directory(), smbd_check_access_rights() -> smbd_check_access_rights_fsp().

Last user of smbd_check_access_rights().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: can_delete_file_in_directory(), we no longer need to do the SMB_VFS_STAT...
Jeremy Allison [Tue, 8 Jun 2021 18:15:59 +0000 (11:15 -0700)]
s3: smbd: can_delete_file_in_directory(), we no longer need to do the SMB_VFS_STAT() call.

All code paths must have a valid stat here.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: In can_delete_file_in_directory(), get a real parent pathref.
Jeremy Allison [Tue, 8 Jun 2021 18:14:29 +0000 (11:14 -0700)]
s3: smbd: In can_delete_file_in_directory(), get a real parent pathref.

Not yet used but we will use this to get the parent ACL via handle.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: In can_delete_file_in_directory(), remove the assertion that dirfsp ==...
Jeremy Allison [Tue, 8 Jun 2021 18:08:06 +0000 (11:08 -0700)]
s3: smbd: In can_delete_file_in_directory(), remove the assertion that dirfsp == conn->cwd_fsp.

Allow a real parent directory fsp to be passed in. We're not doing this
yet but this will allow more efficient calling from the open code
where we have the parent directory fsp available.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: In can_delete_file_in_directory(), move a fast-path exit to before any...
Jeremy Allison [Tue, 8 Jun 2021 18:03:24 +0000 (11:03 -0700)]
s3: smbd: In can_delete_file_in_directory(), move a fast-path exit to before any pathname manipulation.

If we're root we always return true on a writable share.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: Remove smbd_calculate_maximum_allowed_access(). No longer used.
Jeremy Allison [Tue, 8 Jun 2021 00:28:58 +0000 (17:28 -0700)]
s3: smbd: Remove smbd_calculate_maximum_allowed_access(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: Remove smbd_calculate_access_mask(). No longer used.
Jeremy Allison [Tue, 8 Jun 2021 00:27:29 +0000 (17:27 -0700)]
s3: smbd: Remove smbd_calculate_access_mask(). No longer used.

Comment out smbd_calculate_maximum_allowed_access() as it is
a static function and we just removed the only caller.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: open_fake_file(), smbd_calculate_access_mask() -> smbd_calculate_access_mas...
Jeremy Allison [Tue, 8 Jun 2021 00:22:57 +0000 (17:22 -0700)]
s3: smbd: open_fake_file(), smbd_calculate_access_mask() -> smbd_calculate_access_mask_fsp().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: open_fake_file(). Move the smbd_calculate_access_mask() check until after...
Jeremy Allison [Tue, 8 Jun 2021 00:21:04 +0000 (17:21 -0700)]
s3: smbd: open_fake_file(). Move the smbd_calculate_access_mask() check until after we've initialized the file handle.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: open_directory(), smbd_calculate_access_mask() -> smbd_calculate_access_mas...
Jeremy Allison [Tue, 8 Jun 2021 00:19:25 +0000 (17:19 -0700)]
s3: smbd: open_directory(), smbd_calculate_access_mask() -> smbd_calculate_access_mask_fsp().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: open_file_ntcreate(), smbd_calculate_access_mask() -> smbd_calculate_access...
Jeremy Allison [Tue, 8 Jun 2021 00:17:40 +0000 (17:17 -0700)]
s3: smbd: open_file_ntcreate(), smbd_calculate_access_mask() -> smbd_calculate_access_mask_fsp().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: fruit: fruit_freaddir_attr(), smbd_calculate_access_mask() -> smbd_calculate...
Jeremy Allison [Tue, 8 Jun 2021 00:13:50 +0000 (17:13 -0700)]
s3: VFS: fruit: fruit_freaddir_attr(), smbd_calculate_access_mask() -> smbd_calculate_access_mask_fsp().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: smbd_smb2_create_after_exec(), smbd_calculate_access_mask() -> smbd_calcula...
Jeremy Allison [Tue, 8 Jun 2021 00:12:29 +0000 (17:12 -0700)]
s3: smbd: smbd_smb2_create_after_exec(), smbd_calculate_access_mask() -> smbd_calculate_access_mask_fsp().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: Change check_base_file_access() to take an fsp as the first argument.
Jeremy Allison [Tue, 8 Jun 2021 00:07:17 +0000 (17:07 -0700)]
s3: smbd: Change check_base_file_access() to take an fsp as the first argument.

Internally, change check_base_file_access(), smbd_calculate_access_mask() -> smbd_calculate_access_mask_fsp().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: Add smbd_calculate_access_mask_fsp().
Jeremy Allison [Tue, 8 Jun 2021 00:02:06 +0000 (17:02 -0700)]
s3: smbd: Add smbd_calculate_access_mask_fsp().

Not yet used but this now uses smbd_calculate_maximum_allowed_access_fsp(),
so uncomment it.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: Add new smbd_calculate_access_mask_fsp() function.
Jeremy Allison [Mon, 7 Jun 2021 23:37:25 +0000 (16:37 -0700)]
s3: smbd: Add new smbd_calculate_access_mask_fsp() function.

Commented out as not yet used.

Signed-off-by: Noel Power <noel.power@suse.com>
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: open_directory(). Cleanup debug message to refer to correct function.
Jeremy Allison [Mon, 7 Jun 2021 23:27:22 +0000 (16:27 -0700)]
s3: smbd: open_directory(). Cleanup debug message to refer to correct function.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: open_file(). Cleanup debug message to refer to correct function.
Jeremy Allison [Mon, 7 Jun 2021 23:25:54 +0000 (16:25 -0700)]
s3: smbd: open_file(). Cleanup debug message to refer to correct function.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: open_file(). Cleanup debug message to refer to correct function.
Jeremy Allison [Mon, 7 Jun 2021 23:24:42 +0000 (16:24 -0700)]
s3: smbd: open_file(). Cleanup debug message to refer to correct function.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: open_file(), smbd_check_access_rights() -> smbd_check_access_rights_fsp().
Jeremy Allison [Mon, 7 Jun 2021 22:08:06 +0000 (15:08 -0700)]
s3: smbd: open_file(), smbd_check_access_rights() -> smbd_check_access_rights_fsp().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: open_directory(), smbd_check_access_rights() -> smbd_check_access_rights_fsp().
Jeremy Allison [Mon, 7 Jun 2021 22:03:41 +0000 (15:03 -0700)]
s3: smbd: open_directory(), smbd_check_access_rights() -> smbd_check_access_rights_fsp().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: check_base_file_access(), smbd_check_access_rights() -> smbd_check_access_r...
Jeremy Allison [Mon, 7 Jun 2021 21:58:39 +0000 (14:58 -0700)]
s3: smbd: check_base_file_access(), smbd_check_access_rights() -> smbd_check_access_rights_fsp().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: open_file(), smbd_check_access_rights() -> smbd_check_access_rights_fsp().
Jeremy Allison [Mon, 7 Jun 2021 21:55:38 +0000 (14:55 -0700)]
s3: smbd: open_file(), smbd_check_access_rights() -> smbd_check_access_rights_fsp().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: In notify, user_can_stat_name_under_fsp(), smbd_check_access_rights ->...
Jeremy Allison [Mon, 7 Jun 2021 18:25:39 +0000 (11:25 -0700)]
s3: smbd: In notify, user_can_stat_name_under_fsp(), smbd_check_access_rights -> smbd_check_access_rights_fsp

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: ceph_snapshots: In ceph_snap_gmt_convert_dir(), re-use the directory handle...
Jeremy Allison [Mon, 7 Jun 2021 17:26:00 +0000 (10:26 -0700)]
s3: VFS: ceph_snapshots: In ceph_snap_gmt_convert_dir(), re-use the directory handle for checking SEC_DIR_LIST permission.

Similar change to the one that went into shadow_copy2.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: ceph_snapshots: In ceph_snap_enum_snapdir(), re-use the directory handle...
Jeremy Allison [Mon, 7 Jun 2021 17:22:53 +0000 (10:22 -0700)]
s3: VFS: ceph_snapshots: In ceph_snap_enum_snapdir(), re-use the directory handle for checking SEC_DIR_LIST permission.

Similar change to the one that went into shadow_copy2.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: vfs_shadow_copy2: Remove check_access_snapdir().
Jeremy Allison [Mon, 7 Jun 2021 16:56:19 +0000 (09:56 -0700)]
s3: VFS: vfs_shadow_copy2: Remove check_access_snapdir().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: shadow_copy2: In shadow_copy2_get_shadow_copy_data(), check for DIR_LIST...
Jeremy Allison [Mon, 7 Jun 2021 16:47:26 +0000 (09:47 -0700)]
s3: VFS: shadow_copy2: In shadow_copy2_get_shadow_copy_data(), check for DIR_LIST access once we already have a handle on the snap directory.

There's no sense in opening a synthetic pathref first in
order to check for DIR_LIST access, then open again to
do the SMB_VFS_NEXT_FDOPENDIR() for listing.

Just open once, and check for DIR_LIST access on the
open handle before calling SMB_VFS_NEXT_FDOPENDIR() for listing.

We no longer need check_access_snapdir(), which is
static, so comment it out. Removal next.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: Remove can_write_to_file(). Pathname call no longer used.
Jeremy Allison [Mon, 7 Jun 2021 17:14:27 +0000 (10:14 -0700)]
s3: smbd: Remove can_write_to_file(). Pathname call no longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: Remove user_can_write_file().
Jeremy Allison [Fri, 4 Jun 2021 20:46:08 +0000 (13:46 -0700)]
s3: smbd: Remove user_can_write_file().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: Remove user_can_read_file().
Jeremy Allison [Fri, 4 Jun 2021 20:45:24 +0000 (13:45 -0700)]
s3: smbd: Remove user_can_read_file().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: Remove is_visible_file().
Jeremy Allison [Fri, 4 Jun 2021 20:44:52 +0000 (13:44 -0700)]
s3: smbd: Remove is_visible_file().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: Remove dptr_normal_ReadDirName().
Jeremy Allison [Fri, 4 Jun 2021 20:44:06 +0000 (13:44 -0700)]
s3: smbd: Remove dptr_normal_ReadDirName().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: Now smbd_dirptr_get_entry() is doing the filtering, dptr_normal_ReadDirName...
Jeremy Allison [Fri, 4 Jun 2021 20:41:50 +0000 (13:41 -0700)]
s3: smbd: Now smbd_dirptr_get_entry() is doing the filtering, dptr_normal_ReadDirName() is an unneeded wrapper for ReadDirName().

Just call ReadDirName() directly.

This also means:

is_visible_file()
user_can_read_file()
user_can_write_file()

are no longer used, so commen them out for subsequent removal.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: Now all callers of is_visible_fsp() pass 'false' for the use_veto parameter...
Jeremy Allison [Fri, 4 Jun 2021 20:32:40 +0000 (13:32 -0700)]
s3: smbd: Now all callers of is_visible_fsp() pass 'false' for the use_veto parameter, remove it.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: Remove is_visible_file() from dptr_ReadDirName().
Jeremy Allison [Fri, 4 Jun 2021 20:27:52 +0000 (13:27 -0700)]
s3: smbd: Remove is_visible_file() from dptr_ReadDirName().

dptr_ReadDirName() is only called from smbd_dirptr_get_entry(),
which is now doing it's own call to is_visible_fsp().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: In smbd_dirptr_get_entry() add a call to is_visible_fsp().
Jeremy Allison [Fri, 4 Jun 2021 17:10:55 +0000 (10:10 -0700)]
s3: smbd: In smbd_dirptr_get_entry() add a call to is_visible_fsp().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: In smbd_dirptr_get_entry(), add an early check for VETO_PATH.
Jeremy Allison [Fri, 4 Jun 2021 18:20:08 +0000 (11:20 -0700)]
s3: smbd: In smbd_dirptr_get_entry(), add an early check for VETO_PATH.

Eventually we will be able to remove the 'bool use_veto' parameter
from is_visible_fsp().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: In can_delete_directory_fsp(), is_visible_file() -> is_visible_fsp().
Jeremy Allison [Fri, 4 Jun 2021 20:21:29 +0000 (13:21 -0700)]
s3: smbd: In can_delete_directory_fsp(), is_visible_file() -> is_visible_fsp().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: In can_delete_directory_fsp() explicitly call IS_VETO_PATH().
Jeremy Allison [Fri, 4 Jun 2021 19:47:11 +0000 (12:47 -0700)]
s3: smbd: In can_delete_directory_fsp() explicitly call IS_VETO_PATH().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: Allow is_visible_fsp() to cope with POSIX symlinks/MSDFS links.
Jeremy Allison [Fri, 4 Jun 2021 17:09:34 +0000 (10:09 -0700)]
s3: smbd: Allow is_visible_fsp() to cope with POSIX symlinks/MSDFS links.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: is_visible_file() is now static to dir.c.
Jeremy Allison [Thu, 3 Jun 2021 19:40:54 +0000 (12:40 -0700)]
s3: smbd: is_visible_file() is now static to dir.c.

Once fully replaced in there it can be removed.

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