]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
5 years agovfs_snapper: use struct smb_filename.twrp instead of @GMT string token
Ralph Boehme [Sat, 2 May 2020 09:45:11 +0000 (11:45 +0200)] 
vfs_snapper: use struct smb_filename.twrp instead of @GMT string token

@GMT tokens are still validated and stripped, but the previous version timestamp
is taken from the struct smb_filename twrp member.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_snapper: pass struct smb_filename to snapper_gmt_strip_snapshot()
Ralph Boehme [Sat, 2 May 2020 09:39:58 +0000 (11:39 +0200)] 
vfs_snapper: pass struct smb_filename to snapper_gmt_strip_snapshot()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_shadow_copy2: use struct smb_filename.twrp instead of @GMT string token
Ralph Boehme [Sat, 2 May 2020 10:10:38 +0000 (12:10 +0200)] 
vfs_shadow_copy2: use struct smb_filename.twrp instead of @GMT string token

Removes the asserts which were only needed to prove patchset correctness.

If smb_fname->twrp is zero, the path won't contain an @GMT token, so we can skip
the stripping logic and directly goto out.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_shadow_copy2: use smb_fname->twrp in shadow_copy2_strip_snapshot_internal()
Ralph Boehme [Fri, 1 May 2020 14:36:09 +0000 (16:36 +0200)] 
vfs_shadow_copy2: use smb_fname->twrp in shadow_copy2_strip_snapshot_internal()

Use smb_fname->twrp instead if the @GMT token and assert both the twrp value and
the converted @GMT string token have the same value.

With this commit passing CI (which it did), we can somewhat safely assume that
anything that calls into the VFS stack is correctly passing struct
smb_filename.twrp from unix_convert() to the VFS without loosing the twrp value
in one of the myriad places where we copy the original struct smb_filename value
one way or another.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_shadow_copy2: pass orig_name as struct smb_filename to shadow_copy2_strip_snapshot()
Ralph Boehme [Thu, 30 Apr 2020 15:28:16 +0000 (17:28 +0200)] 
vfs_shadow_copy2: pass orig_name as struct smb_filename to shadow_copy2_strip_snapshot()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: set twrp in target_fname in target_fname()
Ralph Boehme [Sat, 2 May 2020 08:30:24 +0000 (10:30 +0200)] 
smbd: set twrp in target_fname in target_fname()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_fruit: set twrp in smb_fname in fruit_fstat_meta_stream()
Ralph Boehme [Sat, 2 May 2020 08:28:44 +0000 (10:28 +0200)] 
vfs_fruit: set twrp in smb_fname in fruit_fstat_meta_stream()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_default: set twrp in smb_fname in vfswrap_get_dos_attributes_getxattr_done()
Ralph Boehme [Sat, 2 May 2020 08:28:00 +0000 (10:28 +0200)] 
vfs_default: set twrp in smb_fname in vfswrap_get_dos_attributes_getxattr_done()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: realign target_fname initialisation in process_symlink_open()
Ralph Boehme [Sat, 2 May 2020 08:27:04 +0000 (10:27 +0200)] 
smbd: realign target_fname initialisation in process_symlink_open()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: set twrp in vfs_stat_smb_basename()
Ralph Boehme [Sat, 2 May 2020 06:10:36 +0000 (08:10 +0200)] 
smbd: set twrp in vfs_stat_smb_basename()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: move a DEBUG in unix_convert()
Ralph Boehme [Sat, 2 May 2020 06:09:24 +0000 (08:09 +0200)] 
smbd: move a DEBUG in unix_convert()

Ensure a successfull conversion via early exit also logs a message.

While at it, use smb_fname_str_dbg() to print the string which ensure any stream
component or twrp value is also printed.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: initialize twrp in smb_fname in smbd_dirptr_get_entry()
Ralph Boehme [Fri, 1 May 2020 15:08:37 +0000 (17:08 +0200)] 
smbd: initialize twrp in smb_fname in smbd_dirptr_get_entry()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: realign smb_fname member initialisation in smbd_dirptr_get_entry()
Ralph Boehme [Fri, 1 May 2020 15:06:26 +0000 (17:06 +0200)] 
smbd: realign smb_fname member initialisation in smbd_dirptr_get_entry()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: set twrp in dptr_ReadDirName()
Ralph Boehme [Fri, 1 May 2020 15:05:48 +0000 (17:05 +0200)] 
smbd: set twrp in dptr_ReadDirName()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: realign smb_fname_base initialisation in dptr_ReadDirName()
Ralph Boehme [Fri, 1 May 2020 14:55:58 +0000 (16:55 +0200)] 
smbd: realign smb_fname_base initialisation in dptr_ReadDirName()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: fullpath based on fsp->fsp_name may contain an @GMT token
Ralph Boehme [Fri, 1 May 2020 14:38:04 +0000 (16:38 +0200)] 
smbd: fullpath based on fsp->fsp_name may contain an @GMT token

This ensure unix_convert() calls canonicalize_snapshot_path() on the path to
process the @GMT token, so smb_fname->twrp is filled in with the converted time
value of the @GMT token.

When canonicalize_snapshot_path() starts actually stripping off @GMT tokens, we
can remove this again.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_default: use cp_smb_filename_nostream() in vfswrap_streaminfo()
Ralph Boehme [Fri, 1 May 2020 14:30:57 +0000 (16:30 +0200)] 
vfs_default: use cp_smb_filename_nostream() in vfswrap_streaminfo()

Ensure twrp field and whatever else may be added in the future is correctly
copied over to smb_fname_cp.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: print twrp in smb_fname_str_dbg()
Ralph Boehme [Fri, 1 May 2020 14:30:28 +0000 (16:30 +0200)] 
smbd: print twrp in smb_fname_str_dbg()

This looses precision by going from NTTIME to time_t, but GMT_FORMAT only has
seconds granularity anyway and @GMT token as defined by MS-SMB2 as well.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: vfs: convert link_contents arg of SMB_VFS_SYMLINKAT() to struct smb_filename
Ralph Boehme [Thu, 30 Apr 2020 17:30:50 +0000 (19:30 +0200)] 
smbd: vfs: convert link_contents arg of SMB_VFS_SYMLINKAT() to struct smb_filename

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: call canonicalize_snapshot_path() on link target paths from client
Ralph Boehme [Thu, 30 Apr 2020 15:46:31 +0000 (17:46 +0200)] 
smbd: call canonicalize_snapshot_path() on link target paths from client

Prepares for having canonicalize_snapshot_path() strip any @GMT token from link
targets. In the future VFS modules won't be doing @GMT token stripping, so we
have to do it here.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: make canonicalize_snapshot_path() public
Ralph Boehme [Sat, 2 May 2020 10:55:33 +0000 (12:55 +0200)] 
smbd: make canonicalize_snapshot_path() public

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: convert SMB_VFS_GET_REAL_FILENAME() arg path to be a struct smb_filename
Ralph Boehme [Thu, 30 Apr 2020 14:40:28 +0000 (16:40 +0200)] 
smbd: convert SMB_VFS_GET_REAL_FILENAME() arg path to be a struct smb_filename

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/vfs: change VFS interface comment to be a single multi-line comment
Ralph Boehme [Mon, 4 May 2020 08:56:21 +0000 (10:56 +0200)] 
s3/vfs: change VFS interface comment to be a single multi-line comment

Looks much better imho. :)

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_glusterfs: realign vfs_gluster_get_real_filename() args
Ralph Boehme [Thu, 30 Apr 2020 14:28:55 +0000 (16:28 +0200)] 
vfs_glusterfs: realign vfs_gluster_get_real_filename() args

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: realign smb_vfs_call_get_real_filename() args
Ralph Boehme [Thu, 30 Apr 2020 14:26:48 +0000 (16:26 +0200)] 
smbd: realign smb_vfs_call_get_real_filename() args

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: pass struct smb_filename to get_real_filename()
Ralph Boehme [Thu, 30 Apr 2020 14:22:19 +0000 (16:22 +0200)] 
smbd: pass struct smb_filename to get_real_filename()

Prepares for passing struct smb_filename to SMB_VFS_GET_REAL_FILENAME().

This also makes it necessary to move the NULL or empty path checks to
unix_convert_step_stat().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: realign args of get_real_filename() and friends
Ralph Boehme [Thu, 30 Apr 2020 15:20:49 +0000 (17:20 +0200)] 
smbd: realign args of get_real_filename() and friends

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: pass twrp as NTTIME to filename_convert() and all the way down to canonicalize_...
Ralph Boehme [Thu, 30 Apr 2020 14:04:54 +0000 (16:04 +0200)] 
smbd: pass twrp as NTTIME to filename_convert() and all the way down to canonicalize_snapshot_path()

Also pass by value rather then by reference.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: let canonicalize_snapshot_path() fill in struct smb_filename.twrp
Ralph Boehme [Thu, 30 Apr 2020 13:17:11 +0000 (15:17 +0200)] 
smbd: let canonicalize_snapshot_path() fill in struct smb_filename.twrp

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: move time_t twrp to @GMT string token conversion to canonicalize_snapshot_path()
Ralph Boehme [Thu, 30 Apr 2020 13:14:36 +0000 (15:14 +0200)] 
smbd: move time_t twrp to @GMT string token conversion to canonicalize_snapshot_path()

Prepares for canonicalize_snapshot_path() being the one-stop shop for
previous-versions related stuff in subsequent commits.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: refactor canonicalize_snapshot_path()
Ralph Boehme [Thu, 30 Apr 2020 12:13:44 +0000 (14:13 +0200)] 
smbd: refactor canonicalize_snapshot_path()

This prepares for adding additional code after calling rearrange_snapshot_path().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: add twrp arg to synthetic_smb_fname()
Ralph Boehme [Thu, 30 Apr 2020 09:48:32 +0000 (11:48 +0200)] 
smbd: add twrp arg to synthetic_smb_fname()

Most places take twrp from a local struct smb_filename variable that the
function is working on. Some don't for various reasons:

o synthetic_smb_fname_split() is only called in very few places where we don't
  expect twrp paths

o implementations of SMB_VFS_GETWD(), SMB_VFS_FS_CAPABILITIES() and
  SMB_VFS_REALPATH() return the systems view of cwd and realpath without twrp info

o VFS modules implementing previous-versions support (vfs_ceph_snapshots,
  vfs_shadow_copy2, vfs_snapper) synthesize raw paths that are passed to VFS NEXT
  functions and therefor do not use twrp

o vfs_fruit: macOS doesn't support VSS

o vfs_recycle: in recycle_create_dir() we need a raw OS path to create a directory

o vfs_virusfilter: a few places where we need raw OS paths

o vfs_xattr_tdb: needs a raw OS path for SMB_VFS_NEXT_STAT()

o printing and rpc server: don't support VSS

o vfs_default_durable_reconnect: no Durable Handles on VSS handles, this might
  be enhances in the future. No idea if Windows supports this.

o get_real_filename_full_scan: hm.... FIXME??

o get_original_lcomp: working on a raw path

o msdfs: doesn't support VSS

o vfs_get_ntquota: synthesizes an smb_filename from ".", so doesn't support VSS
  even though VFS modules implement it

o fd_open: conn_rootdir_fname is a raw path

o msg_file_was_renamed: obvious

o open_np_file: pipes don't support VSS

o Python bindings: get's a raw path from the caller

o set_conn_connectpath: raw path

o set_conn_connectpath: raw path

o torture: gets raw paths from the caller

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agonet: vfs: realign synthetic_smb_fname() args in net_vfs_get_ntacl()
Ralph Boehme [Sun, 3 May 2020 13:09:15 +0000 (15:09 +0200)] 
net: vfs: realign synthetic_smb_fname() args in net_vfs_get_ntacl()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: realign synthetic_smb_fname() args in vfs_GetWd()
Ralph Boehme [Sun, 3 May 2020 13:08:59 +0000 (15:08 +0200)] 
smbd: realign synthetic_smb_fname() args in vfs_GetWd()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: realign synthetic_smb_fname() args in smbd_dirptr_lanman2_entry()
Ralph Boehme [Sun, 3 May 2020 13:08:36 +0000 (15:08 +0200)] 
smbd: realign synthetic_smb_fname() args in smbd_dirptr_lanman2_entry()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: realign synthetic_smb_fname() args in open_np_file()
Ralph Boehme [Sun, 3 May 2020 13:08:20 +0000 (15:08 +0200)] 
smbd: realign synthetic_smb_fname() args in open_np_file()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: realign synthetic_smb_fname() args in msg_file_was_renamed()
Ralph Boehme [Sun, 3 May 2020 13:08:03 +0000 (15:08 +0200)] 
smbd: realign synthetic_smb_fname() args in msg_file_was_renamed()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: realign synthetic_smb_fname() args in file_new()
Ralph Boehme [Sun, 3 May 2020 13:07:45 +0000 (15:07 +0200)] 
smbd: realign synthetic_smb_fname() args in file_new()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/rpc_server: fss: realign synthetic_smb_fname() args in snap_path_exists()
Ralph Boehme [Sun, 3 May 2020 13:07:05 +0000 (15:07 +0200)] 
s3/rpc_server: fss: realign synthetic_smb_fname() args in snap_path_exists()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/printing: realign synthetic_smb_fname() args in print_spool_open()
Ralph Boehme [Sun, 3 May 2020 13:06:51 +0000 (15:06 +0200)] 
s3/printing: realign synthetic_smb_fname() args in print_spool_open()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/printing: realign synthetic_smb_fname() args in driver_unlink_internals()
Ralph Boehme [Sun, 3 May 2020 13:06:32 +0000 (15:06 +0200)] 
s3/printing: realign synthetic_smb_fname() args in driver_unlink_internals()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_xattr_tdb: realign synthetic_smb_fname() args in xattr_tdb_get_file_id()
Ralph Boehme [Sun, 3 May 2020 13:06:12 +0000 (15:06 +0200)] 
vfs_xattr_tdb: realign synthetic_smb_fname() args in xattr_tdb_get_file_id()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_virusfilter: realign synthetic_smb_fname() args in infected_file_action_quarantine()
Ralph Boehme [Sun, 3 May 2020 13:05:46 +0000 (15:05 +0200)] 
vfs_virusfilter: realign synthetic_smb_fname() args in infected_file_action_quarantine()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_virusfilter: realign synthetic_smb_fname() args in quarantine_create_dir()
Ralph Boehme [Sun, 3 May 2020 13:05:25 +0000 (15:05 +0200)] 
vfs_virusfilter: realign synthetic_smb_fname() args in quarantine_create_dir()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_gpfs: realign synthetic_smb_fname() args in gpfsacl_emu_chmod()
Ralph Boehme [Sun, 3 May 2020 13:04:58 +0000 (15:04 +0200)] 
vfs_gpfs: realign synthetic_smb_fname() args in gpfsacl_emu_chmod()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_glusterfs: realign synthetic_smb_fname() args in vfs_gluster_realpath()
Ralph Boehme [Sun, 3 May 2020 13:04:36 +0000 (15:04 +0200)] 
vfs_glusterfs: realign synthetic_smb_fname() args in vfs_gluster_realpath()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_fruit: realign synthetic_smb_fname() args in fruit_get_bandsize()
Ralph Boehme [Sun, 3 May 2020 13:04:14 +0000 (15:04 +0200)] 
vfs_fruit: realign synthetic_smb_fname() args in fruit_get_bandsize()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_fruit: realign synthetic_smb_fname() args in delete_invalid_meta_stream()
Ralph Boehme [Sun, 3 May 2020 13:03:42 +0000 (15:03 +0200)] 
vfs_fruit: realign synthetic_smb_fname() args in delete_invalid_meta_stream()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_fruit: realign synthetic_smb_fname() args in vfswrap_realpath()
Ralph Boehme [Sun, 3 May 2020 13:03:22 +0000 (15:03 +0200)] 
vfs_fruit: realign synthetic_smb_fname() args in vfswrap_realpath()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_fruit: realign synthetic_smb_fname() args in vfswrap_realpath()
Ralph Boehme [Sun, 3 May 2020 13:03:01 +0000 (15:03 +0200)] 
vfs_fruit: realign synthetic_smb_fname() args in vfswrap_realpath()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_default: realign synthetic_smb_fname() args in vfswrap_realpath()
Ralph Boehme [Sun, 3 May 2020 13:02:38 +0000 (15:02 +0200)] 
vfs_default: realign synthetic_smb_fname() args in vfswrap_realpath()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_default: realign synthetic_smb_fname() args in vfswrap_fs_capabilities()
Ralph Boehme [Sun, 3 May 2020 13:01:54 +0000 (15:01 +0200)] 
vfs_default: realign synthetic_smb_fname() args in vfswrap_fs_capabilities()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_ceph_snapshots: realign synthetic_smb_fname() args in ceph_snap_gmt_convert_dir()
Ralph Boehme [Sun, 3 May 2020 06:33:51 +0000 (08:33 +0200)] 
vfs_ceph_snapshots: realign synthetic_smb_fname() args in ceph_snap_gmt_convert_dir()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_ceph_snapshots: realign synthetic_smb_fname() args in ceph_snap_fill_label()
Ralph Boehme [Sun, 3 May 2020 06:32:53 +0000 (08:32 +0200)] 
vfs_ceph_snapshots: realign synthetic_smb_fname() args in ceph_snap_fill_label()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_catia: realign synthetic_smb_fname() args in catia_readdir_attr()
Ralph Boehme [Sun, 3 May 2020 06:28:14 +0000 (08:28 +0200)] 
vfs_catia: realign synthetic_smb_fname() args in catia_readdir_attr()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/lib: realign synthetic_smb_fname() args in synthetic_smb_fname_split()
Ralph Boehme [Sun, 3 May 2020 06:26:47 +0000 (08:26 +0200)] 
s3/lib: realign synthetic_smb_fname() args in synthetic_smb_fname_split()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: realign synthetic_smb_fname() args in check_reduced_name_with_privilege()
Ralph Boehme [Thu, 30 Apr 2020 10:05:43 +0000 (12:05 +0200)] 
smbd: realign synthetic_smb_fname() args in check_reduced_name_with_privilege()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: realign args calling synthetic_smb_fname() in change_dir_owner_to_parent()
Ralph Boehme [Thu, 30 Apr 2020 10:01:44 +0000 (12:01 +0200)] 
smbd: realign args calling synthetic_smb_fname() in change_dir_owner_to_parent()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_vxfs: pass name as struct smb_filename to vxfs_compare()
Ralph Boehme [Thu, 30 Apr 2020 09:51:15 +0000 (11:51 +0200)] 
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>
5 years agovfs_vxfs: realign vxfs_compare() args to one per line
Ralph Boehme [Thu, 30 Apr 2020 09:48:41 +0000 (11:48 +0200)] 
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>
5 years agovfs_streams_depot: realign synthetic_smb_fname() to one arg per line
Ralph Boehme [Thu, 30 Apr 2020 09:44:15 +0000 (11:44 +0200)] 
vfs_streams_depot: realign synthetic_smb_fname() to one arg per line

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_streams_depot: pass dirname to walk_streams()/collect_one_stream() as struct...
Ralph Boehme [Thu, 30 Apr 2020 09:42:50 +0000 (11:42 +0200)] 
vfs_streams_depot: pass dirname to walk_streams()/collect_one_stream() as struct smb_filename

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_gpfs: pass smb_fname to gpfsacl_emu_chmod()
Ralph Boehme [Thu, 30 Apr 2020 09:28:57 +0000 (11:28 +0200)] 
vfs_gpfs: pass smb_fname to gpfsacl_emu_chmod()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb: Protect cli_oem_change_password() from rprcnt<2
Volker Lendecke [Sat, 2 May 2020 13:18:07 +0000 (15:18 +0200)] 
libsmb: Protect cli_oem_change_password() from rprcnt<2

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14362
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue May  5 17:12:04 UTC 2020 on sn-devel-184

5 years agolibsmb: Protect cli_RNetServerEnum against rprcnt<6
Volker Lendecke [Sat, 2 May 2020 13:10:14 +0000 (15:10 +0200)] 
libsmb: Protect cli_RNetServerEnum against rprcnt<6

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14362
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agolibsmb: Protect cli_RNetShareEnum() against rprcnt<6
Volker Lendecke [Sat, 2 May 2020 12:59:07 +0000 (14:59 +0200)] 
libsmb: Protect cli_RNetShareEnum() against rprcnt<6

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14362
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agolibsmb: Fix indentation in cli_RNetShareEnum()
Volker Lendecke [Sat, 2 May 2020 12:54:01 +0000 (14:54 +0200)] 
libsmb: Fix indentation in cli_RNetShareEnum()

Also remove a level of indentation with a "goto done;"

Best review with "git show -b", almost no code change

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14362
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agosmbd: Make share_mode_for_one_entry() use just a uint8*
Volker Lendecke [Mon, 27 Apr 2020 11:16:00 +0000 (13:16 +0200)] 
smbd: Make share_mode_for_one_entry() use just a uint8*

"num_share_modes" is passed separately, so "data.dsize" was not used

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue May  5 13:23:49 UTC 2020 on sn-devel-184

5 years agosmbd: Make share_mode_do_locked() use a const uint8_t *
Volker Lendecke [Fri, 24 Apr 2020 09:07:53 +0000 (11:07 +0200)] 
smbd: Make share_mode_do_locked() use a const uint8_t *

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Make parse_share_modes() use a const ptr
Volker Lendecke [Fri, 24 Apr 2020 07:14:55 +0000 (09:14 +0200)] 
smbd: Make parse_share_modes() use a const ptr

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Make share_mode_memcache_fetch() use a const ptr
Volker Lendecke [Fri, 24 Apr 2020 07:04:27 +0000 (09:04 +0200)] 
smbd: Make share_mode_memcache_fetch() use a const ptr

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Convert get_share_mode_blob_header() to use a const ptr
Volker Lendecke [Fri, 24 Apr 2020 06:55:35 +0000 (08:55 +0200)] 
smbd: Convert get_share_mode_blob_header() to use a const ptr

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Make share_mode_entry_find() take a const pointer
Volker Lendecke [Fri, 24 Apr 2020 13:58:59 +0000 (15:58 +0200)] 
smbd: Make share_mode_entry_find() take a const pointer

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Make sure share_mode_entry_do() maintains sorting order
Volker Lendecke [Mon, 27 Apr 2020 13:59:09 +0000 (15:59 +0200)] 
smbd: Make sure share_mode_entry_do() maintains sorting order

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Simplify reset_share_mode_entry()
Volker Lendecke [Fri, 24 Apr 2020 15:30:44 +0000 (17:30 +0200)] 
smbd: Simplify reset_share_mode_entry()

This has more lines, but it's a lot simpler: reset_share_mode_entry is
only called during durable reconnect, which only works with a single
share mode entry. See durable_reconnect_fn(). Thus we don't have to
keep the share mode array sorted, there is just a single entry.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Simplify share_mode_entry_get()
Volker Lendecke [Thu, 23 Apr 2020 15:00:25 +0000 (17:00 +0200)] 
smbd: Simplify share_mode_entry_get()

If we don't use a DATA_BLOB, we can more correctly state in the
prototype that the buffer we parse is constant.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agolibsmb: Add a NULL check
Volker Lendecke [Fri, 21 Feb 2020 21:07:19 +0000 (22:07 +0100)] 
libsmb: Add a NULL check

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agolibsmb: Align integer types in net_share_enum_rpc()
Volker Lendecke [Mon, 20 Apr 2020 07:56:51 +0000 (09:56 +0200)] 
libsmb: Align integer types in net_share_enum_rpc()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agolibsmb: Use talloc_strndup() to cut a backslash
Volker Lendecke [Tue, 21 Apr 2020 06:05:57 +0000 (08:05 +0200)] 
libsmb: Use talloc_strndup() to cut a backslash

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agolibsmb: Add a NULL check after talloc_strdup()
Volker Lendecke [Tue, 21 Apr 2020 06:02:35 +0000 (08:02 +0200)] 
libsmb: Add a NULL check after talloc_strdup()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agolib: Move push_skip_string() to clirap2.c
Volker Lendecke [Wed, 29 Apr 2020 07:07:20 +0000 (09:07 +0200)] 
lib: Move push_skip_string() to clirap2.c

It's only used there

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agolibrpc: Align integer types
Volker Lendecke [Fri, 1 May 2020 17:26:40 +0000 (19:26 +0200)] 
librpc: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agonet: Add g_lock dumpall
Volker Lendecke [Tue, 28 Apr 2020 10:18:40 +0000 (12:18 +0200)] 
net: Add g_lock dumpall

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agonet: "net g_lock locks" needs to print binary keys
Volker Lendecke [Tue, 28 Apr 2020 10:08:14 +0000 (12:08 +0200)] 
net: "net g_lock locks" needs to print binary keys

In 2017 g_lock changed to take TDB_DATA as a key

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agorpc_server3: Align integer types
Volker Lendecke [Mon, 27 Apr 2020 08:25:47 +0000 (10:25 +0200)] 
rpc_server3: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agolib: Fix a comment
Volker Lendecke [Tue, 28 Apr 2020 14:55:55 +0000 (16:55 +0200)] 
lib: Fix a comment

The "deleted bit" went away with 341223a00596e

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agolib: Remove two unused macro definitions
Volker Lendecke [Mon, 27 Apr 2020 10:22:53 +0000 (12:22 +0200)] 
lib: Remove two unused macro definitions

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agotorture4: Move a variable declaration closer to its use
Volker Lendecke [Fri, 24 Apr 2020 06:59:16 +0000 (08:59 +0200)] 
torture4: Move a variable declaration closer to its use

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agoregistry3: Align a few integer types
Volker Lendecke [Fri, 24 Apr 2020 06:54:35 +0000 (08:54 +0200)] 
registry3: Align a few integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agolocking: Move br_off typedef to where it's used
Volker Lendecke [Mon, 27 Apr 2020 09:49:55 +0000 (11:49 +0200)] 
locking: Move br_off typedef to where it's used

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agolocking: Move SMB_OFF_T_BITS macro to its only user
Volker Lendecke [Mon, 27 Apr 2020 09:49:20 +0000 (11:49 +0200)] 
locking: Move SMB_OFF_T_BITS macro to its only user

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agovfs_virusfilter: Fix canonicalizing socket path
Volker Lendecke [Thu, 23 Apr 2020 06:37:01 +0000 (08:37 +0200)] 
vfs_virusfilter: Fix canonicalizing socket path

canonicalize_absolute_path() returns its result, the previous code was
a no-op

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agovfs_widelinks: Fix small typos
Volker Lendecke [Thu, 23 Apr 2020 09:29:02 +0000 (11:29 +0200)] 
vfs_widelinks: Fix small typos

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agopytdb tests: add test for storev()
Jule Anger [Tue, 28 Apr 2020 15:01:11 +0000 (17:01 +0200)] 
pytdb tests: add test for storev()

Signed-off-by: Jule Anger <ja@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue May  5 11:24:52 UTC 2020 on sn-devel-184

5 years agopytdb: add python binding for storev()
Jule Anger [Tue, 28 Apr 2020 15:00:46 +0000 (17:00 +0200)] 
pytdb: add python binding for storev()

Signed-off-by: Jule Anger <ja@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agos3: smbd: Add a dirfsp parameter to smbd_calculate_maximum_allowed_access().
Jeremy Allison [Fri, 1 May 2020 17:18:08 +0000 (10:18 -0700)] 
s3: smbd: Add a dirfsp parameter to smbd_calculate_maximum_allowed_access().

Not yet used. Currently always conn->cwd_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): Mon May  4 15:33:09 UTC 2020 on sn-devel-184

5 years agos3: smbd: Reformat users of smbd_calculate_maximum_allowed_access().
Jeremy Allison [Fri, 1 May 2020 17:15:14 +0000 (10:15 -0700)] 
s3: smbd: Reformat users of smbd_calculate_maximum_allowed_access().

Make new parameter addition clearer.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3: smbd: Add a dirfsp parameter to smbd_calculate_access_mask().
Jeremy Allison [Fri, 1 May 2020 17:13:58 +0000 (10:13 -0700)] 
s3: smbd: Add a dirfsp parameter to smbd_calculate_access_mask().

Not yet used. Currently always conn->cwd_fsp.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3: smbd: Reformat users of smbd_calculate_access_mask().
Jeremy Allison [Fri, 1 May 2020 17:09:53 +0000 (10:09 -0700)] 
s3: smbd: Reformat users of smbd_calculate_access_mask().

Make new parameter addition clearer.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3: smbd: Add a dirfsp parameter to check_parent_access().
Jeremy Allison [Fri, 1 May 2020 01:20:29 +0000 (18:20 -0700)] 
s3: smbd: Add a dirfsp parameter to check_parent_access().

Not yet used. Currently always conn->cwd_fsp.

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