IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
This reverts commit e593c38f5a8602be497a29e145ccdd4f9cc595e7.
As stated in the original commit message, "When canonicalize_snapshot_path()
starts actually stripping off @GMT tokens, we can remove this again."
canonicalize_snapshot_path() now strips off @GMT tokens from
any SMB1 names, so this is now not needed anymore.
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): Tue May 5 20:55:42 UTC 2020 on sn-devel-184
canonicalize_snapshot_path() may eat the incoming pathname in total
for SMB1, so we need to check after that call.
Fix the zero-length string check to look at state->smb_fname->base_name
instead of state->orig_path.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Leaving the exercize of removing the now unneeded stripped logic to a future
patchset.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Leaving the exercize of removing the now unneeded stripped logic to a future
patchset.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
The function returns ints and the callers expect ints. Declaring bool while
returning ints works, as generally compilers implement bools as ints.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Setting this flag was a hokey hack to trigger @GMT token processing in
filename_convert(). Now that all internal processing is based on struct
smb_filename.NTTIME twrp, we can remove this hack.
With this change, paths containing @GMT tokens received over SMB2 are
subsequently processed unchanged, the @GMT token is not stripped and will hit
the filesystem, mostly resulting in NT_STATUS_NOT_FOUND failures which is the
same behaviour as Windows.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
No change in behaviour. ucf_flags are just now checked *inside*
canonicalize_snapshot_path() instead of the caller.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
smbd and all previous-versions implementing VFS modules have been patched to
work with struct smb_filename.NTTIME twrp, so we can now safely strip @GMT
tokens from paths.
This also means that "@GMT-something/foo" and "foo" will both come out as "foo",
so we have to take care of the stat-cache now and change it to take and use an
additional twrp arg.
At the same time remove @GMT stripping from shadow_copy2. In theory this could
be made a seperate commit, but due to the absolute path and pstripped logic, it
felt too cumbersome to attempt this.
Leaving the exercize of removing the now unneeded stripped logic to a future
patchset.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Prepares for doing more stuff with the translated_path in a subsequent commit.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
@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>
@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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>