1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-22 05:57:43 +03:00

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>
This commit is contained in:
Ralph Boehme 2020-04-30 11:48:32 +02:00 committed by Jeremy Allison
parent ab3152bf22
commit b74653f2cd
44 changed files with 170 additions and 0 deletions

View File

@ -980,6 +980,7 @@ struct smb_filename *synthetic_smb_fname(TALLOC_CTX *mem_ctx,
const char *base_name,
const char *stream_name,
const SMB_STRUCT_STAT *psbuf,
NTTIME twrp,
uint32_t flags);
struct smb_filename *synthetic_smb_fname_split(TALLOC_CTX *ctx,
const char *fname,

View File

@ -1095,6 +1095,7 @@ static bool ad_convert_xattr(vfs_handle_struct *handle,
smb_fname->base_name,
mapped_name,
NULL,
smb_fname->twrp,
smb_fname->flags);
TALLOC_FREE(mapped_name);
if (stream_name == NULL) {
@ -1225,6 +1226,7 @@ static bool ad_convert_finderinfo(vfs_handle_struct *handle,
smb_fname->base_name,
AFPINFO_STREAM,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (stream_name == NULL) {
data_blob_free(&aiblob);
@ -1597,6 +1599,7 @@ static bool ad_collect_one_stream(struct vfs_handle_struct *handle,
smb_fname->base_name,
stream->name,
NULL,
smb_fname->twrp,
0);
if (sname == NULL) {
return false;

View File

@ -54,6 +54,7 @@ struct smb_filename *synthetic_smb_fname(TALLOC_CTX *mem_ctx,
const char *base_name,
const char *stream_name,
const SMB_STRUCT_STAT *psbuf,
NTTIME twrp,
uint32_t flags)
{
struct smb_filename smb_fname_loc = { 0, };
@ -62,6 +63,7 @@ struct smb_filename *synthetic_smb_fname(TALLOC_CTX *mem_ctx,
smb_fname_loc.base_name = discard_const_p(char, base_name);
smb_fname_loc.stream_name = discard_const_p(char, stream_name);
smb_fname_loc.flags = flags;
smb_fname_loc.twrp = twrp;
/* Copy the psbuf if one was given. */
if (psbuf)
@ -105,6 +107,7 @@ struct smb_filename *synthetic_smb_fname_split(TALLOC_CTX *ctx,
fname,
NULL,
NULL,
0,
SMB_FILENAME_POSIX_PATH);
}
@ -120,6 +123,7 @@ struct smb_filename *synthetic_smb_fname_split(TALLOC_CTX *ctx,
base_name,
stream_name,
NULL,
0,
0);
TALLOC_FREE(base_name);
TALLOC_FREE(stream_name);

View File

@ -46,6 +46,7 @@ static uint64_t cap_disk_free(vfs_handle_struct *handle,
capname,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(capname);
@ -73,6 +74,7 @@ static int cap_get_quota(vfs_handle_struct *handle,
cappath,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);
@ -131,6 +133,7 @@ static int cap_mkdirat(vfs_handle_struct *handle,
cappath,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);
@ -318,6 +321,7 @@ static int cap_chmod(vfs_handle_struct *handle,
cappath,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);
@ -352,6 +356,7 @@ static int cap_lchown(vfs_handle_struct *handle,
cappath,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);
@ -385,6 +390,7 @@ static int cap_chdir(vfs_handle_struct *handle,
cappath,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);
@ -452,6 +458,7 @@ static int cap_symlinkat(vfs_handle_struct *handle,
capnew,
NULL,
NULL,
new_smb_fname->twrp,
new_smb_fname->flags);
if (new_cap_smb_fname == NULL) {
TALLOC_FREE(capold);
@ -494,6 +501,7 @@ static int cap_readlinkat(vfs_handle_struct *handle,
cappath,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);
@ -538,6 +546,7 @@ static int cap_linkat(vfs_handle_struct *handle,
capold,
NULL,
NULL,
old_smb_fname->twrp,
old_smb_fname->flags);
if (old_cap_smb_fname == NULL) {
TALLOC_FREE(capold);
@ -549,6 +558,7 @@ static int cap_linkat(vfs_handle_struct *handle,
capnew,
NULL,
NULL,
new_smb_fname->twrp,
new_smb_fname->flags);
if (new_cap_smb_fname == NULL) {
TALLOC_FREE(capold);
@ -595,6 +605,7 @@ static int cap_mknodat(vfs_handle_struct *handle,
cappath,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);
@ -635,6 +646,7 @@ static struct smb_filename *cap_realpath(vfs_handle_struct *handle,
cappath,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);
@ -671,6 +683,7 @@ static SMB_ACL_T cap_sys_acl_get_file(vfs_handle_struct *handle,
cappath,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);
@ -708,6 +721,7 @@ static int cap_sys_acl_set_file(vfs_handle_struct *handle,
cappath,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);
@ -743,6 +757,7 @@ static int cap_sys_acl_delete_def_file(vfs_handle_struct *handle,
cappath,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);
@ -781,6 +796,7 @@ static ssize_t cap_getxattr(vfs_handle_struct *handle,
cappath,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);
@ -831,6 +847,7 @@ static ssize_t cap_listxattr(vfs_handle_struct *handle,
cappath,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);
@ -867,6 +884,7 @@ static int cap_removexattr(vfs_handle_struct *handle,
cappath,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);
@ -919,6 +937,7 @@ static int cap_setxattr(vfs_handle_struct *handle,
cappath,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);
@ -968,6 +987,7 @@ static NTSTATUS cap_create_dfs_pathat(vfs_handle_struct *handle,
cappath,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);
@ -1001,6 +1021,7 @@ static NTSTATUS cap_read_dfs_pathat(struct vfs_handle_struct *handle,
cappath,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);

View File

@ -697,6 +697,7 @@ static int catia_lchown(vfs_handle_struct *handle,
name,
NULL,
&smb_fname->st,
smb_fname->twrp,
smb_fname->flags);
if (catia_smb_fname == NULL) {
TALLOC_FREE(name);
@ -734,6 +735,7 @@ static int catia_chmod(vfs_handle_struct *handle,
name,
NULL,
&smb_fname->st,
smb_fname->twrp,
smb_fname->flags);
if (catia_smb_fname == NULL) {
TALLOC_FREE(name);
@ -771,6 +773,7 @@ static int catia_mkdirat(vfs_handle_struct *handle,
name,
NULL,
&smb_fname->st,
smb_fname->twrp,
smb_fname->flags);
if (catia_smb_fname == NULL) {
TALLOC_FREE(name);
@ -809,6 +812,7 @@ static int catia_chdir(vfs_handle_struct *handle,
name,
NULL,
&smb_fname->st,
smb_fname->twrp,
smb_fname->flags);
if (catia_smb_fname == NULL) {
TALLOC_FREE(name);
@ -875,6 +879,7 @@ catia_realpath(vfs_handle_struct *handle,
mapped_name,
NULL,
&smb_fname->st,
smb_fname->twrp,
smb_fname->flags);
if (catia_smb_fname == NULL) {
TALLOC_FREE(mapped_name);
@ -908,6 +913,7 @@ static int catia_chflags(struct vfs_handle_struct *handle,
name,
NULL,
&smb_fname->st,
smb_fname->twrp,
smb_fname->flags);
if (catia_smb_fname == NULL) {
TALLOC_FREE(name);
@ -953,6 +959,7 @@ catia_streaminfo(struct vfs_handle_struct *handle,
mapped_name,
NULL,
&smb_fname->st,
smb_fname->twrp,
smb_fname->flags);
if (catia_smb_fname == NULL) {
TALLOC_FREE(mapped_name);
@ -1033,6 +1040,7 @@ catia_get_nt_acl(struct vfs_handle_struct *handle,
mapped_name,
NULL,
&smb_fname->st,
smb_fname->twrp,
smb_fname->flags);
if (mapped_smb_fname == NULL) {
TALLOC_FREE(mapped_name);
@ -1072,6 +1080,7 @@ catia_sys_acl_get_file(vfs_handle_struct *handle,
mapped_name,
NULL,
&smb_fname->st,
smb_fname->twrp,
smb_fname->flags);
if (mapped_smb_fname == NULL) {
TALLOC_FREE(mapped_name);
@ -1117,6 +1126,7 @@ catia_sys_acl_set_file(vfs_handle_struct *handle,
mapped_name,
NULL,
&smb_fname->st,
smb_fname->twrp,
smb_fname->flags);
if (mapped_smb_fname == NULL) {
TALLOC_FREE(mapped_name);
@ -1160,6 +1170,7 @@ catia_sys_acl_delete_def_file(vfs_handle_struct *handle,
mapped_name,
NULL,
&smb_fname->st,
smb_fname->twrp,
smb_fname->flags);
if (mapped_smb_fname == NULL) {
TALLOC_FREE(mapped_name);
@ -1213,6 +1224,7 @@ catia_getxattr(vfs_handle_struct *handle,
mapped_name,
NULL,
&smb_fname->st,
smb_fname->twrp,
smb_fname->flags);
if (mapped_smb_fname == NULL) {
TALLOC_FREE(mapped_name);
@ -1260,6 +1272,7 @@ catia_listxattr(vfs_handle_struct *handle,
mapped_name,
NULL,
&smb_fname->st,
smb_fname->twrp,
smb_fname->flags);
if (mapped_smb_fname == NULL) {
TALLOC_FREE(mapped_name);
@ -1313,6 +1326,7 @@ catia_removexattr(vfs_handle_struct *handle,
mapped_name,
NULL,
&smb_fname->st,
smb_fname->twrp,
smb_fname->flags);
if (mapped_smb_fname == NULL) {
TALLOC_FREE(mapped_name);
@ -1372,6 +1386,7 @@ catia_setxattr(vfs_handle_struct *handle,
mapped_name,
NULL,
&smb_fname->st,
smb_fname->twrp,
smb_fname->flags);
if (mapped_smb_fname == NULL) {
TALLOC_FREE(mapped_name);
@ -2181,6 +2196,7 @@ static NTSTATUS catia_get_compression(vfs_handle_struct *handle,
mapped_name,
NULL,
&smb_fname->st,
smb_fname->twrp,
smb_fname->flags);
if (mapped_smb_fname == NULL) {
TALLOC_FREE(mapped_name);
@ -2249,6 +2265,7 @@ static NTSTATUS catia_readdir_attr(struct vfs_handle_struct *handle,
fname,
NULL,
&smb_fname_in->st,
smb_fname_in->twrp,
0);
status = SMB_VFS_NEXT_READDIR_ATTR(handle, smb_fname, mem_ctx, pattr_data);
@ -2277,6 +2294,7 @@ static NTSTATUS catia_get_dos_attributes(struct vfs_handle_struct *handle,
mapped_name,
NULL,
&smb_fname->st,
smb_fname->twrp,
smb_fname->flags);
if (mapped_smb_fname == NULL) {
TALLOC_FREE(mapped_name);
@ -2315,6 +2333,7 @@ static NTSTATUS catia_set_dos_attributes(struct vfs_handle_struct *handle,
mapped_name,
NULL,
&smb_fname->st,
smb_fname->twrp,
smb_fname->flags);
if (mapped_smb_fname == NULL) {
TALLOC_FREE(mapped_name);
@ -2353,6 +2372,7 @@ static NTSTATUS catia_create_dfs_pathat(struct vfs_handle_struct *handle,
mapped_name,
NULL,
&smb_fname->st,
smb_fname->twrp,
smb_fname->flags);
if (mapped_smb_fname == NULL) {
TALLOC_FREE(mapped_name);
@ -2393,6 +2413,7 @@ static NTSTATUS catia_read_dfs_pathat(struct vfs_handle_struct *handle,
mapped_name,
NULL,
&smb_fname->st,
smb_fname->twrp,
smb_fname->flags);
if (mapped_smb_fname == NULL) {
TALLOC_FREE(mapped_name);

View File

@ -877,6 +877,7 @@ static struct smb_filename *cephwrap_getwd(struct vfs_handle_struct *handle,
cwd,
NULL,
NULL,
0,
0);
}
@ -1122,6 +1123,7 @@ static struct smb_filename *cephwrap_realpath(struct vfs_handle_struct *handle,
result,
NULL,
NULL,
0,
0);
SAFE_FREE(result);
return result_fname;

View File

@ -147,6 +147,7 @@ static int ceph_snap_fill_label(struct vfs_handle_struct *handle,
snap_path,
NULL,
NULL,
0,
0);
if (smb_fname == NULL) {
return -ENOMEM;
@ -413,6 +414,7 @@ static int ceph_snap_get_shadow_copy_data(struct vfs_handle_struct *handle,
snaps_path,
NULL,
NULL,
0,
fsp->fsp_name->flags);
if (snaps_dname == NULL) {
ret = -ENOMEM;
@ -562,6 +564,7 @@ static int ceph_snap_gmt_convert_dir(struct vfs_handle_struct *handle,
_converted_buf,
NULL,
NULL,
0,
0); /* XXX check? */
if (snaps_dname == NULL) {
ret = -ENOMEM;
@ -619,6 +622,7 @@ static int ceph_snap_gmt_convert_dir(struct vfs_handle_struct *handle,
_converted_buf,
NULL,
NULL,
0,
0);
if (smb_fname == NULL) {
ret = -ENOMEM;

View File

@ -135,6 +135,7 @@ static uint32_t vfswrap_fs_capabilities(struct vfs_handle_struct *handle,
conn->connectpath,
NULL,
NULL,
0,
0);
if (smb_fname_cpath == NULL) {
return caps;
@ -2465,6 +2466,7 @@ static struct smb_filename *vfswrap_getwd(vfs_handle_struct *handle,
result,
NULL,
NULL,
0,
0);
/*
* sys_getwd() *always* returns malloced memory.
@ -2931,6 +2933,7 @@ static struct smb_filename *vfswrap_realpath(vfs_handle_struct *handle,
result,
NULL,
NULL,
0,
0);
SAFE_FREE(result);
}

View File

@ -304,6 +304,7 @@ static int get_connectpath_ino(struct vfs_handle_struct *handle,
handle->conn->connectpath,
NULL,
NULL,
0,
0);
if (fname == NULL) {
DBG_ERR("synthetic_smb_fname failed\n");

View File

@ -884,6 +884,7 @@ static bool readdir_attr_meta_finderi_stream(
smb_fname->base_name,
AFPINFO_STREAM_NAME,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (stream_name == NULL) {
return false;
@ -1059,6 +1060,7 @@ static uint64_t readdir_attr_rfork_size_stream(
smb_fname->base_name,
AFPRESOURCE_STREAM_NAME,
NULL,
smb_fname->twrp,
0);
if (stream_name == NULL) {
return 0;
@ -2065,6 +2067,7 @@ static int fruit_unlinkat(vfs_handle_struct *handle,
smb_fname->base_name,
AFPRESOURCE_STREAM_NAME,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (rsrc_smb_fname == NULL) {
return -1;
@ -3335,6 +3338,7 @@ static NTSTATUS delete_invalid_meta_stream(
smb_fname->base_name,
AFPINFO_STREAM_NAME,
NULL,
smb_fname->twrp,
0);
if (sname == NULL) {
return NT_STATUS_NO_MEMORY;
@ -4494,6 +4498,7 @@ static void fruit_offload_write_done(struct tevent_req *subreq)
state->src_fsp->fsp_name->base_name,
streams[i].name,
NULL,
state->src_fsp->fsp_name->twrp,
state->src_fsp->fsp_name->flags);
if (tevent_req_nomem(src_fname_tmp, req)) {
return;
@ -4509,6 +4514,7 @@ static void fruit_offload_write_done(struct tevent_req *subreq)
state->dst_fsp->fsp_name->base_name,
streams[i].name,
NULL,
state->dst_fsp->fsp_name->twrp,
state->dst_fsp->fsp_name->flags);
if (tevent_req_nomem(dst_fname_tmp, req)) {
TALLOC_FREE(src_fname_tmp);
@ -4672,6 +4678,7 @@ static bool fruit_get_bandsize(vfs_handle_struct *handle,
plist,
NULL,
NULL,
0,
0);
if (smb_fname == NULL) {
ok = false;
@ -4810,6 +4817,7 @@ static bool fruit_get_num_bands(vfs_handle_struct *handle,
path,
NULL,
NULL,
0,
0);
TALLOC_FREE(path);
if (bands_dir == NULL) {

View File

@ -1387,6 +1387,7 @@ static struct smb_filename *vfs_gluster_getwd(struct vfs_handle_struct *handle,
ret,
NULL,
NULL,
0,
0);
SAFE_FREE(cwd);
return smb_fname;
@ -1527,6 +1528,7 @@ static struct smb_filename *vfs_gluster_realpath(struct vfs_handle_struct *handl
result,
NULL,
NULL,
0,
0);
}

View File

@ -1493,6 +1493,7 @@ static int gpfsacl_emu_chmod(vfs_handle_struct *handle,
path,
NULL,
NULL,
fname->twrp,
0);
if (fake_fsp.fsp_name == NULL) {
errno = ENOMEM;

View File

@ -1928,6 +1928,7 @@ static NTSTATUS mh_get_nt_acl(vfs_handle_struct *handle,
clientPath,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (client_smb_fname == NULL) {
TALLOC_FREE(clientPath);

View File

@ -300,6 +300,7 @@ static bool recycle_create_dir(vfs_handle_struct *handle, const char *dname)
new_dir,
NULL,
NULL,
0,
0);
if (smb_fname == NULL) {
goto done;
@ -630,6 +631,7 @@ static int recycle_unlink_internal(vfs_handle_struct *handle,
final_name,
smb_fname->stream_name,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (smb_fname_final == NULL) {
rc = SMB_VFS_NEXT_UNLINKAT(handle,

View File

@ -182,6 +182,7 @@ static int shadow_copy_get_shadow_copy_data(vfs_handle_struct *handle,
fsp->conn->connectpath,
NULL,
NULL,
0,
0);
if (smb_fname == NULL) {
errno = ENOMEM;

View File

@ -1553,6 +1553,7 @@ static int shadow_copy2_chdir(vfs_handle_struct *handle,
conv,
NULL,
NULL,
0,
smb_fname->flags);
} else {
conv_smb_fname = cp_smb_filename(talloc_tos(), smb_fname);
@ -2013,6 +2014,7 @@ static int shadow_copy2_get_shadow_copy_data(
snapdir,
NULL,
NULL,
0,
fsp->fsp_name->flags);
if (snapdir_smb_fname == NULL) {
errno = ENOMEM;
@ -2188,6 +2190,7 @@ static NTSTATUS shadow_copy2_get_nt_acl(vfs_handle_struct *handle,
conv,
NULL,
NULL,
0,
smb_fname->flags);
if (conv_smb_fname == NULL) {
TALLOC_FREE(conv);
@ -2278,6 +2281,7 @@ static ssize_t shadow_copy2_getxattr(vfs_handle_struct *handle,
conv,
NULL,
NULL,
0,
smb_fname->flags);
if (conv_smb_fname == NULL) {
TALLOC_FREE(conv);
@ -2326,6 +2330,7 @@ static ssize_t shadow_copy2_listxattr(struct vfs_handle_struct *handle,
conv,
NULL,
NULL,
0,
smb_fname->flags);
if (conv_smb_fname == NULL) {
TALLOC_FREE(conv);
@ -2644,6 +2649,7 @@ static uint64_t shadow_copy2_disk_free(vfs_handle_struct *handle,
conv,
NULL,
NULL,
0,
smb_fname->flags);
if (conv_smb_fname == NULL) {
TALLOC_FREE(conv);
@ -2695,6 +2701,7 @@ static int shadow_copy2_get_quota(vfs_handle_struct *handle,
conv,
NULL,
NULL,
0,
smb_fname->flags);
if (conv_smb_fname == NULL) {
TALLOC_FREE(conv);

View File

@ -2244,6 +2244,7 @@ static int snapper_gmt_chdir(vfs_handle_struct *handle,
conv,
NULL,
NULL,
0,
smb_fname->flags);
if (conv_smb_fname == NULL) {
TALLOC_FREE(conv);
@ -2427,6 +2428,7 @@ static NTSTATUS snapper_gmt_get_nt_acl(vfs_handle_struct *handle,
conv,
NULL,
NULL,
0,
fname->flags);
TALLOC_FREE(conv);
if (smb_fname == NULL) {
@ -2510,6 +2512,7 @@ static ssize_t snapper_gmt_getxattr(vfs_handle_struct *handle,
conv,
NULL,
NULL,
0,
smb_fname->flags);
TALLOC_FREE(conv);
if (conv_smb_fname == NULL) {
@ -2558,6 +2561,7 @@ static ssize_t snapper_gmt_listxattr(struct vfs_handle_struct *handle,
conv,
NULL,
NULL,
0,
smb_fname->flags);
TALLOC_FREE(conv);
if (conv_smb_fname == NULL) {
@ -2690,6 +2694,7 @@ static uint64_t snapper_gmt_disk_free(vfs_handle_struct *handle,
conv,
NULL,
NULL,
0,
smb_fname->flags);
if (conv_smb_fname == NULL) {
TALLOC_FREE(conv);
@ -2740,6 +2745,7 @@ static int snapper_gmt_get_quota(vfs_handle_struct *handle,
conv,
NULL,
NULL,
0,
smb_fname->flags);
TALLOC_FREE(conv);
if (conv_smb_fname == NULL) {

View File

@ -155,6 +155,7 @@ static char *stream_dir(vfs_handle_struct *handle,
rootdir,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (rootdir_fname == NULL) {
errno = ENOMEM;
@ -170,6 +171,7 @@ static char *stream_dir(vfs_handle_struct *handle,
smb_fname->base_name,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (smb_fname_base == NULL) {
errno = ENOMEM;
@ -215,6 +217,7 @@ static char *stream_dir(vfs_handle_struct *handle,
result,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (smb_fname_hash == NULL) {
errno = ENOMEM;
@ -273,6 +276,7 @@ static char *stream_dir(vfs_handle_struct *handle,
newname,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
TALLOC_FREE(newname);
if (smb_fname_new == NULL) {
@ -319,6 +323,7 @@ static char *stream_dir(vfs_handle_struct *handle,
tmp,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (tmp_fname == NULL) {
errno = ENOMEM;
@ -347,6 +352,7 @@ static char *stream_dir(vfs_handle_struct *handle,
tmp,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (tmp_fname == NULL) {
errno = ENOMEM;
@ -452,6 +458,7 @@ static NTSTATUS stream_smb_fname(vfs_handle_struct *handle,
stream_fname,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (*smb_fname_out == NULL) {
return NT_STATUS_NO_MEMORY;
@ -499,6 +506,7 @@ static NTSTATUS walk_streams(vfs_handle_struct *handle,
dirname,
NULL,
NULL,
smb_fname_base->twrp,
smb_fname_base->flags);
if (dir_smb_fname == NULL) {
TALLOC_FREE(dirname);
@ -624,6 +632,7 @@ static int streams_depot_open(vfs_handle_struct *handle,
smb_fname->base_name,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (smb_fname_base == NULL) {
ret = -1;
@ -692,6 +701,7 @@ static int streams_depot_unlink_internal(vfs_handle_struct *handle,
smb_fname->base_name,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (smb_fname_base == NULL) {
errno = ENOMEM;
@ -724,6 +734,7 @@ static int streams_depot_unlink_internal(vfs_handle_struct *handle,
dirname,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (smb_fname_dir == NULL) {
TALLOC_FREE(smb_fname_base);
@ -765,6 +776,7 @@ static int streams_depot_rmdir_internal(vfs_handle_struct *handle,
smb_fname->base_name,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (smb_fname_base == NULL) {
errno = ENOMEM;
@ -797,6 +809,7 @@ static int streams_depot_rmdir_internal(vfs_handle_struct *handle,
dirname,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (smb_fname_dir == NULL) {
TALLOC_FREE(smb_fname_base);
@ -957,6 +970,7 @@ static bool collect_one_stream(const struct smb_filename *dirfname,
sname,
NULL,
NULL,
dirfname->twrp,
0);
if (smb_fname == NULL) {
state->status = NT_STATUS_NO_MEMORY;
@ -1004,6 +1018,7 @@ static NTSTATUS streams_depot_streaminfo(vfs_handle_struct *handle,
smb_fname->base_name,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (smb_fname_base == NULL) {
return NT_STATUS_NO_MEMORY;

View File

@ -219,6 +219,7 @@ static int streams_xattr_fstat(vfs_handle_struct *handle, files_struct *fsp,
io->base,
NULL,
NULL,
fsp->fsp_name->twrp,
fsp->fsp_name->flags);
if (smb_fname_base == NULL) {
errno = ENOMEM;
@ -939,6 +940,7 @@ static ssize_t streams_xattr_pwrite(vfs_handle_struct *handle,
sio->base,
NULL,
NULL,
fsp->fsp_name->twrp,
fsp->fsp_name->flags);
if (smb_fname_base == NULL) {
errno = ENOMEM;
@ -1009,6 +1011,7 @@ static ssize_t streams_xattr_pread(vfs_handle_struct *handle,
sio->base,
NULL,
NULL,
fsp->fsp_name->twrp,
fsp->fsp_name->flags);
if (smb_fname_base == NULL) {
errno = ENOMEM;
@ -1226,6 +1229,7 @@ static int streams_xattr_ftruncate(struct vfs_handle_struct *handle,
sio->base,
NULL,
NULL,
fsp->fsp_name->twrp,
fsp->fsp_name->flags);
if (smb_fname_base == NULL) {
errno = ENOMEM;

View File

@ -1518,6 +1518,7 @@ static NTSTATUS um_get_nt_acl(vfs_handle_struct *handle,
client_path,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (client_smb_fname == NULL) {
TALLOC_FREE(client_path);

View File

@ -157,6 +157,7 @@ static bool quarantine_create_dir(
new_dir,
NULL,
NULL,
0,
0);
if (smb_fname == NULL) {
goto done;
@ -670,6 +671,7 @@ static virusfilter_action infected_file_action_quarantine(
q_filepath,
smb_fname->stream_name,
NULL,
0,
smb_fname->flags);
if (q_smb_fname == NULL) {
action = VIRUSFILTER_ACTION_DO_NOTHING;
@ -751,6 +753,7 @@ static virusfilter_action infected_file_action_rename(
q_smb_fname = synthetic_smb_fname(frame, q_filepath,
smb_fname->stream_name, NULL,
0,
smb_fname->flags);
if (q_smb_fname == NULL) {
action = VIRUSFILTER_ACTION_DO_NOTHING;

View File

@ -238,6 +238,7 @@ static struct smb_filename *widelinks_getwd(vfs_handle_struct *handle,
config->cwd,
NULL,
NULL,
0,
0);
}
@ -298,6 +299,7 @@ static struct smb_filename *widelinks_realpath(vfs_handle_struct *handle,
resolved_pathname,
NULL,
NULL,
0,
0);
TALLOC_FREE(pathname);
TALLOC_FREE(resolved_pathname);

View File

@ -42,6 +42,7 @@ static int xattr_tdb_get_file_id(struct vfs_handle_struct *handle,
path,
NULL,
NULL,
0,
0);
if (smb_fname == NULL) {
TALLOC_FREE(frame);

View File

@ -2033,6 +2033,7 @@ static NTSTATUS driver_unlink_internals(connection_struct *conn,
print_dlr_path,
NULL,
NULL,
0,
0);
if (smb_fname == NULL) {
goto err_out;

View File

@ -217,6 +217,7 @@ NTSTATUS print_spool_open(files_struct *fsp,
pf->filename,
NULL,
NULL,
0,
0);
if (fsp->fsp_name == NULL) {
status = NT_STATUS_NO_MEMORY;

View File

@ -102,6 +102,7 @@ static NTSTATUS get_nt_acl_no_snum(TALLOC_CTX *ctx,
fname,
NULL,
NULL,
0,
0);
if (smb_fname == NULL) {

View File

@ -177,6 +177,7 @@ static bool snap_path_exists(TALLOC_CTX *ctx, struct messaging_context *msg_ctx,
sc->sc_path,
NULL,
NULL,
0,
0);
if (smb_fname == NULL) {
goto out;

View File

@ -191,6 +191,7 @@ NTSTATUS delete_all_streams(connection_struct *conn,
smb_fname->base_name,
stream_info[i].name,
NULL,
smb_fname->twrp,
(smb_fname->flags &
~SMB_FILENAME_POSIX_PATH));
@ -855,6 +856,7 @@ bool recursive_rmdir(TALLOC_CTX *ctx,
fullname,
NULL,
NULL,
smb_dname->twrp,
smb_dname->flags);
if (smb_dname_full == NULL) {
errno = ENOMEM;
@ -1033,6 +1035,7 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, files_struct *fsp)
fullname,
NULL,
NULL,
smb_dname->twrp,
smb_dname->flags);
if (smb_dname_full == NULL) {
errno = ENOMEM;

View File

@ -1258,6 +1258,7 @@ bool is_visible_file(connection_struct *conn,
entry,
NULL,
pst,
dir_path->twrp,
0);
if (smb_fname_base == NULL) {
ret = false;

View File

@ -910,6 +910,7 @@ static void dos_mode_at_vfs_get_dosmode_done(struct tevent_req *subreq)
path,
NULL,
&state->smb_fname->st,
state->smb_fname->twrp,
0);
if (tevent_req_nomem(smb_path, req)) {
return;
@ -1321,6 +1322,7 @@ NTSTATUS set_create_timespec_ea(connection_struct *conn,
psmb_fname->base_name,
NULL,
&psmb_fname->st,
psmb_fname->twrp,
psmb_fname->flags);
if (smb_fname == NULL) {

View File

@ -587,6 +587,7 @@ NTSTATUS vfs_default_durable_reconnect(struct connection_struct *conn,
cookie.base_name,
NULL,
NULL,
0,
0);
if (smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;

View File

@ -195,6 +195,7 @@ static NTSTATUS check_parent_exists(TALLOC_CTX *ctx,
parent_name,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (parent_fname == NULL) {
return NT_STATUS_NO_MEMORY;
@ -1552,6 +1553,7 @@ static int get_real_filename_full_scan(connection_struct *conn,
path,
NULL,
NULL,
0,
0);
if (smb_fname == NULL) {
TALLOC_FREE(unmangled_name);
@ -1776,6 +1778,7 @@ char *get_original_lcomp(TALLOC_CTX *ctx,
filename_in,
NULL,
NULL,
0,
0);
if (smb_fname == NULL) {
TALLOC_FREE(fname);

View File

@ -144,6 +144,7 @@ NTSTATUS file_new(struct smb_request *req, connection_struct *conn,
"",
NULL,
NULL,
0,
0);
if (fsp->fsp_name == NULL) {
file_free(NULL, fsp);

View File

@ -1418,6 +1418,7 @@ bool create_msdfs_link(const struct junction_map *jucn,
path,
NULL,
NULL,
0,
0);
if (smb_fname == NULL) {
goto out;
@ -1491,6 +1492,7 @@ bool remove_msdfs_link(const struct junction_map *jucn,
path,
NULL,
NULL,
0,
0);
if (smb_fname == NULL) {
TALLOC_FREE(frame);
@ -1567,6 +1569,7 @@ static size_t count_dfs_links(TALLOC_CTX *ctx,
".",
NULL,
NULL,
0,
0);
if (smb_fname == NULL) {
goto out;
@ -1586,6 +1589,7 @@ static size_t count_dfs_links(TALLOC_CTX *ctx,
dname,
NULL,
NULL,
0,
0);
if (smb_dname == NULL) {
goto out;
@ -1702,6 +1706,7 @@ static int form_junctions(TALLOC_CTX *ctx,
".",
NULL,
NULL,
0,
0);
if (smb_fname == NULL) {
goto out;
@ -1728,6 +1733,7 @@ static int form_junctions(TALLOC_CTX *ctx,
dname,
NULL,
NULL,
0,
0);
if (smb_dname == NULL) {
TALLOC_FREE(talloced);

View File

@ -87,6 +87,7 @@ NTSTATUS vfs_get_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype,
".",
NULL,
NULL,
0,
0);
if (smb_fname_cwd == NULL) {
return NT_STATUS_NO_MEMORY;

View File

@ -628,6 +628,7 @@ static int non_widelink_open(struct connection_struct *conn,
".",
smb_fname->stream_name,
&smb_fname->st,
smb_fname->twrp,
smb_fname->flags);
if (smb_fname_rel == NULL) {
saved_errno = errno;
@ -771,6 +772,7 @@ NTSTATUS fd_open(struct connection_struct *conn,
conn_rootdir,
NULL,
NULL,
0,
0);
if (conn_rootdir_fname == NULL) {
return NT_STATUS_NO_MEMORY;
@ -948,6 +950,7 @@ static NTSTATUS change_dir_owner_to_parent(connection_struct *conn,
".",
NULL,
NULL,
smb_dname->twrp,
0);
if (smb_fname_cwd == NULL) {
status = NT_STATUS_NO_MEMORY;
@ -4689,6 +4692,7 @@ void msg_file_was_renamed(struct messaging_context *msg_ctx,
msg->base_name,
msg->stream_name,
NULL,
0,
0);
if (smb_fname == NULL) {
DBG_DEBUG("synthetic_smb_fname failed\n");
@ -4790,6 +4794,7 @@ static NTSTATUS open_streams_for_delete(connection_struct *conn,
smb_fname->base_name,
stream_info[i].name,
NULL,
smb_fname->twrp,
(smb_fname->flags &
~SMB_FILENAME_POSIX_PATH));
if (smb_fname_cp == NULL) {
@ -5521,6 +5526,7 @@ static NTSTATUS create_file_unixpath(connection_struct *conn,
smb_fname->base_name,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (smb_fname_base == NULL) {
status = NT_STATUS_NO_MEMORY;

View File

@ -55,6 +55,7 @@ NTSTATUS open_np_file(struct smb_request *smb_req, const char *name,
name,
NULL,
NULL,
0,
0);
if (smb_fname == NULL) {
file_free(smb_req, fsp);

View File

@ -262,6 +262,7 @@ static NTSTATUS get_nt_acl_conn(TALLOC_CTX *mem_ctx,
fname,
NULL,
NULL,
0,
lp_posix_pathnames() ?
SMB_FILENAME_POSIX_PATH : 0);
@ -1022,6 +1023,7 @@ static PyObject *py_smbd_mkdir(PyObject *self, PyObject *args, PyObject *kwargs)
fname,
NULL,
NULL,
0,
lp_posix_pathnames() ?
SMB_FILENAME_POSIX_PATH : 0);

View File

@ -1869,6 +1869,7 @@ void reply_search(struct smb_request *req)
directory,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (smb_dname == NULL) {
reply_nterror(req, NT_STATUS_NO_MEMORY);
@ -3443,6 +3444,7 @@ NTSTATUS unlink_internals(connection_struct *conn, struct smb_request *req,
fname_dir,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (smb_fname_dir == NULL) {
status = NT_STATUS_NO_MEMORY;
@ -8110,6 +8112,7 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
fname_src_dir,
NULL,
NULL,
smb_fname_src->twrp,
smb_fname_src->flags);
if (smb_fname_src_dir == NULL) {
status = NT_STATUS_NO_MEMORY;
@ -8860,6 +8863,7 @@ void reply_copy(struct smb_request *req)
fname_src_dir,
NULL,
NULL,
smb_fname_src->twrp,
smb_fname_src->flags);
if (smb_fname_src_dir == NULL) {
reply_nterror(req, NT_STATUS_NO_MEMORY);

View File

@ -80,6 +80,7 @@ bool set_conn_connectpath(connection_struct *conn, const char *connectpath)
conn->connectpath,
NULL,
NULL,
0,
0);
if (conn->cwd_fsp->fsp_name == NULL) {
return false;
@ -828,6 +829,7 @@ static NTSTATUS make_connection_snum(struct smbXsrv_connection *xconn,
conn->connectpath,
NULL,
NULL,
0,
0);
if (smb_fname_cpath == NULL) {
status = NT_STATUS_NO_MEMORY;

View File

@ -2636,6 +2636,7 @@ NTSTATUS smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx,
fname,
NULL,
&smb_fname->st,
smb_fname->twrp,
0);
if (name == NULL) {
TALLOC_FREE(smb_fname);
@ -6208,6 +6209,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
smb_fname->base_name,
NULL,
NULL,
smb_fname->twrp,
smb_fname->flags);
if (smb_fname_base == NULL) {
reply_nterror(req, NT_STATUS_NO_MEMORY);
@ -6639,6 +6641,7 @@ static NTSTATUS smb_set_file_dosmode(connection_struct *conn,
smb_fname->base_name,
NULL,
&smb_fname->st,
smb_fname->twrp,
smb_fname->flags);
if (smb_fname_base == NULL) {
return NT_STATUS_NO_MEMORY;
@ -7158,6 +7161,7 @@ static NTSTATUS smb2_file_rename_information(connection_struct *conn,
fsp->base_fsp->fsp_name->base_name,
newname,
NULL,
fsp->base_fsp->fsp_name->twrp,
fsp->base_fsp->fsp_name->flags);
if (smb_fname_dst == NULL) {
status = NT_STATUS_NO_MEMORY;
@ -7360,6 +7364,7 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn,
fsp->base_fsp->fsp_name->base_name,
newname,
NULL,
fsp->base_fsp->fsp_name->twrp,
fsp->base_fsp->fsp_name->flags);
if (smb_fname_dst == NULL) {
status = NT_STATUS_NO_MEMORY;
@ -7443,6 +7448,7 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn,
base_name,
NULL,
NULL,
smb_fname_src->twrp,
smb_fname_src->flags);
if (smb_fname_dst == NULL) {
status = NT_STATUS_NO_MEMORY;

View File

@ -927,6 +927,7 @@ struct smb_filename *vfs_GetWd(TALLOC_CTX *ctx, connection_struct *conn)
".",
NULL,
NULL,
0,
0);
if (smb_fname_dot == NULL) {
errno = ENOMEM;
@ -1082,6 +1083,7 @@ NTSTATUS check_reduced_name_with_privilege(connection_struct *conn,
".",
NULL,
NULL,
parent_name->twrp,
0);
if (smb_fname_cwd == NULL) {
status = NT_STATUS_NO_MEMORY;

View File

@ -130,6 +130,7 @@ static NTSTATUS cmd_disk_free(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int ar
argv[1],
NULL,
NULL,
0,
ssf_flags());
if (smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;
@ -158,6 +159,7 @@ static NTSTATUS cmd_opendir(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc
argv[1],
NULL,
NULL,
0,
ssf_flags());
if (smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;
@ -250,6 +252,7 @@ static NTSTATUS cmd_mkdir(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
argv[1],
NULL,
NULL,
0,
ssf_flags());
if (smb_fname == NULL) {
@ -450,6 +453,7 @@ static NTSTATUS cmd_pathfunc(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int arg
argv[1],
NULL,
NULL,
0,
ssf_flags());
if (smb_fname == NULL) {
@ -905,6 +909,7 @@ static NTSTATUS cmd_chmod(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
argv[1],
NULL,
NULL,
0,
ssf_flags());
if (smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;
@ -1456,6 +1461,7 @@ static NTSTATUS cmd_removexattr(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
argv[1],
NULL,
NULL,
0,
ssf_flags());
if (smb_fname == NULL) {
@ -1521,6 +1527,7 @@ static NTSTATUS cmd_get_nt_acl(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
argv[1],
NULL,
NULL,
0,
ssf_flags());
if (smb_fname == NULL) {
@ -1846,6 +1853,7 @@ static NTSTATUS cmd_sys_acl_delete_def_file(struct vfs_state *vfs, TALLOC_CTX *m
argv[1],
NULL,
NULL,
0,
ssf_flags());
if (smb_fname == NULL) {
@ -1886,6 +1894,7 @@ static NTSTATUS cmd_translate_name(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
".",
NULL,
NULL,
0,
ssf_flags());
if (smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;

View File

@ -228,6 +228,7 @@ static int net_vfs_get_ntacl(struct net_context *net,
path,
NULL,
NULL,
0,
0);
if (smb_fname == NULL) {
goto done;
@ -319,6 +320,7 @@ static bool do_unfruit(const char *path)
path,
NULL,
NULL,
0,
0);
if (smb_fname == NULL) {
return false;