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!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Nov 11 19:59:03 UTC 2021 on sn-devel-184
Prior to 572d4e3a56 it was sufficient to
initialize struct timespec to zero to return NTTIME 0 (ie not set) over
SMB.
This fixes the same problem from bug 14714 where the timestamps in an SMB2 CLOSE
response.
Windows of course does return *some* timestamps, but as it's neither documented
nor was I able to figure out where they would be coming from, as well as the
Windows client apparently doesn't care, I didn't bother with implementing some
sophisticated heuristic to return some timestamps.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14731
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jun 9 20:38:02 UTC 2021 on sn-devel-184
This optimization uses the stored errno result from check_parent_exists()
which already did a STAT/LSTAT if needed.
Best viewed with 'git show -b'.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue May 11 22:52:58 UTC 2021 on sn-devel-184
Not yet used.
This will allow us to avoid an duplicate STAT/LSTAT system call
on the parent pathname in a hot code path of the caller in the next commit.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
the smb_filename/smb_filename->fsp passed to vfs_streaminfo
eventually is passed to SMB_VFS_FLISTXATTR, we need to ensure this is
properly setup and not NULL
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
NT_STATUS_STOPPED_ON_SYMLINK is returned when trying to open a symlink, most
callers are not interested in this.
Some callers that would want to know whether openat_pathref_fsp() failed
specifically on a symlink are setup_close_full_information(),
smbd_dirptr_get_entry(), unlink_internals() and filename_convert_internal(), so
we fix those callers to handle the symlink case themselves.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
If the "atname" is an absolute path we can ignore the dirfsp and just return a
copy of the atname.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This replaces the code in a bunch of places where we choose between stat() and
lstat() based on req->posix_pathname. The new code inside vfs_stat() is based on
checking the smb_fname flag SMB_FILENAME_POSIX_PATH.
req->posix_pathname is inherited from the global POSIX pathnames state and the
smb_fname flags is also inherited from that indirectly via the UCF flags.
Tl;dr: no change in behaviour. :)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This change means that if a client path is a symlink, we *always* only call
check_veto_path() for POSIX clients using a POSIX pathname, not just when a
POSIX info-level was used in an SMB request.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
In the places where wildcards are allowed in SMB1
we always pass in UCF_ALWAYS_ALLOW_WCARD_LCOMP.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Leaving p_cont_wcard unchanges as updating that would break the nice
indentation... :)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
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>
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>
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>
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>
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): Fri Apr 24 23:21:16 UTC 2020 on sn-devel-184
Again, just moving code from unix_convert_step_stat() without any logic changes.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Allows decreasing the indentation level of the bulk of the code that handles
stat failure. Best viewed with `git show -w`.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
The diff looks more complicated that it is: everything in the new
unix_convert_step_stat() is moved *as is* from unix_convert_step() without
further changes.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>