Jeremy Allison
bed09bc2d6
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>
2021-06-09 13:14:30 +00:00
Jeremy Allison
b8d43466e1
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>
2021-06-09 13:14:30 +00:00
Jeremy Allison
3f61369d15
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>
2021-06-09 13:14:30 +00:00
Jeremy Allison
af291abefa
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>
2021-06-09 13:14:30 +00:00
Jeremy Allison
11910757c6
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>
2021-06-09 13:14:30 +00:00
Jeremy Allison
26dc10bdb2
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>
2021-06-09 13:14:30 +00:00
Jeremy Allison
e5c9cfb042
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>
2021-06-09 13:14:30 +00:00
Jeremy Allison
ff8a41a1c5
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>
2021-06-09 13:14:30 +00:00
Jeremy Allison
4d0bda46ce
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>
2021-06-09 13:14:30 +00:00
Jeremy Allison
b3d54e20da
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>
2021-06-09 13:14:30 +00:00
Jeremy Allison
342a0c92c9
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>
2021-06-09 13:14:30 +00:00
Jeremy Allison
b56fc4b0d8
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>
2021-06-09 13:14:30 +00:00
Jeremy Allison
0c8f928198
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>
2021-06-09 13:14:30 +00:00
Jeremy Allison
b5e12fed54
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>
2021-06-09 13:14:30 +00:00
Jeremy Allison
b98cf3a12d
s3: smbd: Remove is_visible_file().
...
No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
a9be0e26b5
s3: smbd: Remove dptr_normal_ReadDirName().
...
No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
f47f555012
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>
2021-06-09 13:14:30 +00:00
Jeremy Allison
9f2f4affa0
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>
2021-06-09 13:14:30 +00:00
Jeremy Allison
75f7c11bb3
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>
2021-06-09 13:14:30 +00:00
Jeremy Allison
a66b7de76a
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>
2021-06-09 13:14:30 +00:00
Jeremy Allison
d3161dd1e4
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>
2021-06-09 13:14:30 +00:00
Jeremy Allison
f8a88473d3
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>
2021-06-09 13:14:30 +00:00
Jeremy Allison
5d761421d1
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>
2021-06-09 13:14:30 +00:00
Jeremy Allison
2dfd30384e
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>
2021-06-09 13:14:30 +00:00
Jeremy Allison
25debb608e
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>
2021-06-09 13:14:30 +00:00
Jeremy Allison
138078c944
s3: smbd: Fix old bug in reply_copy() where is_visible_file(), now is_visible_fsp() wasn't checking VETO files.
...
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
12cb13691e
s3: smbd: reply_copy(), is_visible_file() -> is_visible_fsp().
...
Offtopic, the function reply_copy() is insane and should be removed.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
5987fab76f
s3: smbd: rename_internals(), is_visible_file() -> is_visible_fsp().
...
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
146f7bf4fb
s3: smbd: In unlink_internals(), is_visible_file() -> is_visible_fsp().
...
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
41238eb475
s3: smbd: rmdir_internals(), fix the initial directory scan pass to use is_visible_fsp().
...
Add the same symlink accomodation as before.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
bf36c88516
s3: smbd: Allow rmdir_internals() to cope with veto'ed symlinks.
...
We are only dealing with VETO'ed objects
here. If it's a symlink, just delete the
link without caring what it is pointing
to as this operation is safe.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
452dbd10d9
s3: smbd: In rmdir_internals(), Change is_visible_file() -> is_visible_fsp().
...
This needs some slight re-arranging, as previously
is_visible_file() preceeds the call to recursive_rmdir().
As we have to move the call to is_visible_fsp()
until after we have direntry_fname->fsp, then
we must also move the recursive_rmdir() to be
after is_visible_fsp().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
e6377a909a
s3: smbd: Change recursive_rmdir(), is_visible_file() -> is_visible_fsp().
...
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
c064758fce
s3: smbd: Add user_can_write_fsp().
...
Change is_visible_fsp() to use it.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
53877296de
s3: smbd: Add user_can_read_fsp().
...
Change is_visible_fsp() to use it.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
b25109d4f4
s3: smbd: Add is_visible_fsp().
...
Not yet used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
c970badb51
s3: smbd: set_ea_dos_attribute(), smbd_check_access_rights() -> smbd_check_access_rights_fsp().
...
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
b8ef83e1f9
s3: smbd: reply_setatr(), smbd_check_access_rights() -> smbd_check_access_rights_fsp().
...
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
868457d777
s3: smbd: file_ntimes(), can_write_to_file() -> can_write_to_fsp().
...
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
fad211a706
s3: smbd: file_set_dosmode(), can_write_to_file() -> can_write_to_fsp().
...
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
d0fced7141
s3: smbd: dos_mode_from_sbuf(), can_write_to_file() -> can_write_to_fsp().
...
Code with MS-DFS link where smb_fname->fsp == NULL.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
92eff16d5a
s3: smbd: Change acl_group_override() -> acl_group_override_fsp().
...
We always have a valid fsp here. Inside acl_group_override_fsp()
change can_write_to_file() -> can_write_to_fsp().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
161836b24d
s3: smbd: set_ea_dos_attribute(), can_write_to_file() -> can_write_to_fsp().
...
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
66dd861245
s3: smbd: call_nt_transact_create(), can_write_to_file() -> can_write_to_fsp().
...
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
dc06950064
s3: smbd: In reply_ntcreate_and_X(), can_write_to_file() -> can_write_to_fsp().
...
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
2d79eddbb3
s3: smbd: Add can_write_to_fsp(). Not yet used.
...
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
8723bec340
s3: eventlog: get_nt_acl_no_snum(), SMB_VFS_GET_NT_ACL_AT() -> SMB_VFS_FGET_NT_ACL().
...
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
82efcc2359
s3: torture: cmd_get_nt_acl(), SMB_VFS_GET_NT_ACL_AT() -> SMB_VFS_FGET_NT_ACL()
...
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00
Jeremy Allison
1c8c2095d2
s3: smbd: get_nt_acl_conn(), SMB_VFS_GET_NT_ACL_AT() -> SMB_VFS_FGET_NT_ACL()
...
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
32b92d7cdf
s3/smbd: pysmbd: Ensure SMB_VFS_GET_NT_ACL_AT() has an fsp when called.
...
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09 13:14:30 +00:00