1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
Commit Graph

3894 Commits

Author SHA1 Message Date
Jeremy Allison
b533904800 s3: VFS: fake_acls. Add missing NULL check for return of cp_smb_filename().
Found by Coverity.

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): Mon Jun 28 20:03:33 UTC 2021 on sn-devel-184
2021-06-28 20:03:33 +00:00
Jeremy Allison
c2fde31b1c s3: smbd: Cleanup - rename get_ea_names_from_file() -> get_ea_names_from_fsp().
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): Fri Jun 25 16:37:59 UTC 2021 on sn-devel-184
2021-06-25 16:37:59 +00:00
Jeremy Allison
e30094e6c0 s3: smbd: Rename get_ea_value() -> get_ea_value_fsp().
Remove the connection struct and smb_filename parameters.

There are now no more callers of SMB_VFS_GETXATTR().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
a117624bb1 s3: VFS: streams_xattr: Rename get_xattr_size() -> get_xattr_size_fsp().
It now only needs 2 parameters, fsp and EA name.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
0c210a84db s3: VFS: streams_xattr: In streams_xattr_stat() - ~S_IFMT already removes S_IFDIR.
We don't need to do this separately.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
5f54eb555d s3: VFS: streams_xattr: Use openat_pathref_fsp() to create a smb_fname->fsp (and the smb_fname->fsp->base_fsp) if the incoming name doesn't have one.
Use new smb_fname->fsp->base_fsp parameter in get_xattr_size(), change name parameter to NULL.

If openat_pathref_fsp() fails, return the correct error code (thanks Ralph!).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
33521d2df3 s3: VFS: streams_xattr: In streams_xattr_stat(), make use of smb_fname->fsp->base_fsp if it has one.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
d1a0e9b81d s3: VFS: streams_xattr: Bring streams_xattr_stat_base() inline into streams_xattr_stat().
That was its only caller.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
d515c13ba7 s3: VFS: streams_xattr: Simplify streams_xattr_lstat().
There can never be EA's on a symlink. Windows will never
see a symlink, and in SMB_FILENAME_POSIX_PATH mode we don't
allow EA's on a symlink.

All of the previous code boiled down to errno = ENOENT, return -1
so make that explicit.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
cacce8babf s3: VFS: streams_xattr: Use fsp->base_fsp for the fsp parameter to get_xattr_size() in streams_xattr_fstat().
We no longer need the 'struct smb_filename *smb_fname_base' here.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
520a78d975 s3: VFS: streams_xattr: Add an fsp parameter to get_xattr_size().
Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
3c0594d42e s3: VFS: streams_xattr: In streams_xattr_openat() we can assume fsp->base_fsp != NULL.
It should have been opened/created by this point.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
82c95d1339 s3: VFS: streams_xattr: In walk_xattr_streams() use smb_fname->fsp for get_ea_value().
We know this is a valid fsp as we have already used it above inside
walk_xattr_streams() as an argument to get_ea_names_from_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
fa3609fb89 s3: VFS: streams_xattr: In streams_xattr_ftruncate() - remove smb_fname_base.
No longer used and we were leaking it onto the talloc_tos() anyway.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
caf61fc8c9 s3: VFS: streams_xattr: In streams_xattr_ftruncate() - use the fsp->base_fsp argument for get_ea_value().
We know it must be valid here.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
5d12971c58 s3: VFS: streams_xattr: In streams_xattr_ftruncate() - remove conditional.
We know fsp->base_fsp must be valid here for SMB_VFS_FSETXATTR()

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
435c3f9ec1 s3: VFS: streams_xattr: In streams_xattr_pread() - remove smb_fname_base.
No longer used and we were leaking it onto the talloc_tos() anyway.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
fbfd4183d6 s3: VFS: streams_xattr: In streams_xattr_pread() - use the fsp->base_fsp argument for get_ea_value().
We know it must be valid here.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
b8190ce3d8 s3: VFS: streams_xattr: In streams_xattr_pwrite() - remove smb_fname_base.
No longer used and we were leaking it onto the talloc_tos() anyway.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
2fdbac2c5f s3: VFS: streams_xattr: In streams_xattr_pwrite() - use the fsp->base_fsp argument for get_ea_value().
We know it must be valid here.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
28f7846fdd s3: VFS: streams_xattr: In streams_xattr_pwrite() - remove conditional.
We know fsp->base_fsp must be valid here for SMB_VFS_FSETXATTR().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
0f04e1a47d s3: VFS: ceph_snapshots: Remove ceph_snap_get_btime().
No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
2298974b3f s3: VFS: ceph_snapshots: In ceph_snap_gmt_convert_dir() - change to use ceph_snap_get_btime_fsp().
Comment out ceph_snap_get_btime() as it has no more callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
8fc84ac100 s3: VFS: ceph_snapshots: In ceph_snap_fill_label(), use ceph_snap_get_btime_fsp() instead of ceph_snap_get_btime().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
abe3a396e0 s3: VFS: ceph_snapshots: In ceph_snap_fill_label() - pass in dirfsp instead of the raw path.
We will use this for openat_pathref_fsp() later.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
fe9575c88f s3: VFS: ceph_snapshots: Add ceph_snap_get_btime_fsp().
Handle-based copy of ceph_snap_get_btime(). Uses
SMB_VFS_NEXT_FGETXATTR() instead of SMB_VFS_NEXT_GETXATTR().

Commented out as nothing uses it yet. This will change shortly.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
da18c67732 s3: VFS: fake_acls: Remove unused fake_acls_uid()/fake_acls_gid().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
2e51807838 s3: VFS: fake_acls: In fake_acls_stat() - Now we always have a valid fsp, remove the calls to the path-based functions.
Comment out fake_acls_uid()/fake_acls_gid(), they are no longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
243bce4158 s3: VFS: fake_acls: In fake_acls_stat() - use openat_pathref_fsp() to always get a pathref fsp.
Add a recursion guard so that openat_pathref_fsp() doesn't
end up recursing into itself when it calls SMB_VFS_STAT().

We now always have a valid fsp inside fake_acls_stat().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
d2b7872851 s3: VFS: fake_acls: In fake_acls_stat() - if we have a pathref fsp, use it.
We will add a pathref open for the case where we don't next.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
6e6f532c5f s3: VFS: fake_acls: In fake_acls_stat() - remove call to get_full_smb_filename().
It serves no purpose here. We no longer need the frame pointer.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
cf51681aac s3: VFS: fake_acls: In fake_acls_lstat() - get a pathref on whatever the link points to and use the handle-based functions.
Add a recursion guard so that synthetic_pathref() can't
recurse into itself by calling SMB_VFS_LSTAT().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
13778b4c73 s3: VFS: fake_acls: In fake_acls_lstat() - remove call to get_full_smb_filename().
It serves no purpose here. We no longer need the frame pointer.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
c308ffa41c s3: VFS: streams_depot: file_is_valid(), SMB_VFS_GETXATTR() -> SMB_VFS_FGETXATTR().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
f694b36335 s3: modules: acl_xattr: getxattr_do(). Remove the smb_fname parameter.
It was always NULL. Always use the passed in fsp.

If the underlying fd is -1, we want this to fail with EBADF.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-25 15:53:31 +00:00
Jeremy Allison
1139f96cc7 s3: VFS: posixacl_xattr: Remove posixacl_xattr_acl_set_file(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>

Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Wed Jun 23 09:56:00 UTC 2021 on sn-devel-184
2021-06-23 09:56:00 +00:00
Jeremy Allison
246a196610 s3: VFS: posixacl_xattr: Remove posixacl_xattr_acl_get_file(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-06-23 09:04:36 +00:00
Jeremy Allison
fb665462b1 s3: VFS: Update status of SMB_VFS_RENAMEAT.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>

Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Tue Jun 22 14:34:06 UTC 2021 on sn-devel-184
2021-06-22 14:34:06 +00:00
Jeremy Allison
ab01a36d4a s3: VFS: streams_xattr: 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
e5274ecdb6 s3: VFS: streams_depot: 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
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
a2f3c4f5ed s3: VFS: time_audit: 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
c04d6e8464 s3: VFS: syncops: 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
Noel Power
11ec689c1d s3: VFS: virusfilter: Use real dirfsp for SMB_VFS_RENAMEAT()
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-06-22 13:44:34 +00:00
Jeremy Allison
2c5ead7fd6 s3: VFS: media_harmony: 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
69f3858904 s3: VFS: glusterfs: 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
f02f55e84d s3: VFS: full_audit.c: 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
770357f666 s3: VFS: extd_audit: 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
5235ffea59 s3: VFS: ceph: 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
a9832db6ac s3: VFS: cap: 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