1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-20 14:03:59 +03:00

125998 Commits

Author SHA1 Message Date
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
Noel Power
5c9f8f693c s3/smbd: pysmbd: SMB_VFS_SYS_ACL_GET_FILE -> SMB_VFS_SYS_ACL_GET_FD
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
Jeremy Allison
3bd2cfc292 s3: smbd: Inside inherit_new_acl(), change from SMB_VFS_GET_NT_ACL_AT() -> SMB_VFS_FGET_NT_ACL().
One more pathname-based call gone.

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
110de2f476 s3: smbd: Pass parent_dir_fname parameter to inherit_new_acl().
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
8d615e9096 s3: smbd: Remove directory_has_default_acl().
No more users.

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
428bceb127 s3: smbd: Change directory_has_default_acl() -> directory_has_default_acl_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
a87182b2eb s3: Add directory_has_default_acl_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
580226610f s3: smbd: Remove check_parent_access().
No more callers.

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
0e88fc3735 s3: smbd: Change open_file() to use check_parent_access_fsp() instead of check_parent_access().
No more uses of check_parent_access().

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
1509ba3c44 s3: smbd: In open_file_ntcreate(), remove the local parent_dir_fname and rename the passed in parameter to be the same.
open_file() can now use parent_dir_fname->fsp for handle-based
access calls.

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
066729f8ce s3: smbd: In open_file_ntcreate() initialize the local parent_dir_fname from the passed in parent_dir_fname_in.
We can now remove the call to parent_smb_fname().

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
64bd0ae358 s3: smbd: Pass parent_dir_fname_in, smb_fname_atname_in from create_file_unixpath() to open_file_ntcreate().
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
748f693a9c s3: smbd: In mkdir_internal(), remove the local parent_dir_fname. We pass it in from the caller now.
This will allow us to change directory_has_default_acl() to
directory_has_default_acl_fsp() later.

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
8d4a73db8b s3: smbd: In mkdir_internal(), use the passed in 'smb_fname_atname' instead of a local 'base_name' variable.
atname is a better name, as base_name refers to the name without streams
and this is nothing to do with streams.

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
da5762de71 s3: smbd: In mkdir_internal() assign the passed in parent_dir_fname_in, smb_fname_atname_in to the local variables.
We don't need the parent_pathref() and more, and as we don't
own parent_dir_fname anymore, don't free it on exit.

Next step will be to remove the local variables.

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
7a06544d18 s3: smbd: Pass parent_dir_fname_in, smb_fname_atname_in to mkdir_internal().
Not yet used. Next step will be to use them to replace the
internal parent_dir_fname,base_name variables inside mkdir_internal().

Annotate them so we know what these extra params are.

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
00baf898e8 s3: smbd: Pass in the newly created parent_dir_fname and smb_fname_atname to open_directory().
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
7aa5acb895 s3: smbd: Get a parent pathref in create_file_unixpath().
Not yet used.

We will be passing this down to open_directory() and
open_file_ntcreate() and using it within create_file_unixpath()
as all of these functions need a parent pathref to check parent
ACLs etc.

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
daadab4a85 s3: smbd: Change rename_internals_fsp() to use check_parent_access_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
8d5e5095c0 s3: smbd: Make mkdir_internal() use check_parent_access_fsp().
We already have a parent pathref fsp here.

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
133196790a s3: smbd: Add check_parent_access_fsp().
Next migrate check_parent_access() users over to 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
e81aa6e358 s3: torture: Change cmd_sys_acl_blob_get_file() to be handle based.
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
5f3599fab0 s3: smbd: copy_access_posix_acl(), 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
Jeremy Allison
23217ced3e s3: smbd: directory_has_default_posix_acl(), 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