Get it from parent/deriving smb_filename if present.
Use 0 (as usually this a Windows-style lookup) if
not.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
struct smb_filename *synthetic_smb_fname(TALLOC_CTX *mem_ctx,
const char *base_name,
const char *stream_name,
- const SMB_STRUCT_STAT *psbuf);
+ const SMB_STRUCT_STAT *psbuf,
+ uint32_t flags);
struct smb_filename *synthetic_smb_fname_split(TALLOC_CTX *ctx,
const char *fname,
bool posix_path);
struct smb_filename *synthetic_smb_fname(TALLOC_CTX *mem_ctx,
const char *base_name,
const char *stream_name,
- const SMB_STRUCT_STAT *psbuf)
+ const SMB_STRUCT_STAT *psbuf,
+ uint32_t flags)
{
struct smb_filename smb_fname_loc = { 0, };
/* Setup the base_name/stream_name. */
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;
/* Copy the psbuf if one was given. */
if (psbuf)
if (posix_path) {
/* No stream name looked for. */
- return synthetic_smb_fname(ctx, fname, NULL, NULL);
+ return synthetic_smb_fname(ctx,
+ fname,
+ NULL,
+ NULL,
+ SMB_FILENAME_POSIX_PATH);
}
ok = split_stream_filename(ctx,
return NULL;
}
- ret = synthetic_smb_fname(ctx, base_name, stream_name, NULL);
+ ret = synthetic_smb_fname(ctx, base_name, stream_name, NULL, 0);
TALLOC_FREE(base_name);
TALLOC_FREE(stream_name);
return ret;
struct xattr_sys_acl_hash_wrapper acl_wrapper = {};
struct smb_filename *smb_fname;
- smb_fname = synthetic_smb_fname(frame, path_p, NULL, NULL);
+ smb_fname = synthetic_smb_fname(frame, path_p, NULL, NULL, 0);
if (smb_fname == NULL) {
TALLOC_FREE(frame);
errno = ENOMEM;
cap_smb_fname = synthetic_smb_fname(talloc_tos(),
capname,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(capname);
errno = ENOMEM;
cap_smb_fname = synthetic_smb_fname(talloc_tos(),
cappath,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);
errno = ENOMEM;
cap_smb_fname = synthetic_smb_fname(talloc_tos(),
cappath,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);
errno = ENOMEM;
cap_smb_fname = synthetic_smb_fname(talloc_tos(),
cappath,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);
errno = ENOMEM;
cap_smb_fname = synthetic_smb_fname(talloc_tos(),
cappath,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);
errno = ENOMEM;
cap_smb_fname = synthetic_smb_fname(talloc_tos(),
cappath,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);
errno = ENOMEM;
cap_smb_fname = synthetic_smb_fname(talloc_tos(),
cappath,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);
errno = ENOMEM;
mapped_smb_fname = synthetic_smb_fname(talloc_tos(),
name_mapped,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (mapped_smb_fname == NULL) {
TALLOC_FREE(mapped_smb_fname);
errno = ENOMEM;
catia_smb_fname = synthetic_smb_fname(talloc_tos(),
name,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (catia_smb_fname == NULL) {
TALLOC_FREE(name);
errno = ENOMEM;
catia_smb_fname = synthetic_smb_fname(talloc_tos(),
name,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (catia_smb_fname == NULL) {
TALLOC_FREE(name);
errno = ENOMEM;
catia_smb_fname = synthetic_smb_fname(talloc_tos(),
name,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (catia_smb_fname == NULL) {
TALLOC_FREE(name);
errno = ENOMEM;
catia_smb_fname = synthetic_smb_fname(talloc_tos(),
name,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (catia_smb_fname == NULL) {
TALLOC_FREE(name);
errno = ENOMEM;
catia_smb_fname = synthetic_smb_fname(talloc_tos(),
name,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (catia_smb_fname == NULL) {
TALLOC_FREE(name);
errno = ENOMEM;
catia_smb_fname = synthetic_smb_fname(talloc_tos(),
mapped_name,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (catia_smb_fname == NULL) {
TALLOC_FREE(mapped_name);
return NT_STATUS_NO_MEMORY;
mapped_smb_fname = synthetic_smb_fname(talloc_tos(),
mapped_name,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (mapped_smb_fname == NULL) {
TALLOC_FREE(mapped_name);
return NT_STATUS_NO_MEMORY;
mapped_smb_fname = synthetic_smb_fname(talloc_tos(),
mapped_name,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (mapped_smb_fname == NULL) {
TALLOC_FREE(mapped_name);
errno = ENOMEM;
* use when setting a timestamp. */
smb_fname_cpath = synthetic_smb_fname(talloc_tos(), conn->connectpath,
- NULL, NULL);
+ NULL, NULL, 0);
if (smb_fname_cpath == NULL) {
return caps;
}
TALLOC_CTX *frame = talloc_stackframe();
struct smb_filename *smb_fname;
- smb_fname = synthetic_smb_fname(frame, path, NULL, NULL);
+ smb_fname = synthetic_smb_fname(frame, path, NULL, NULL, 0);
if (smb_fname == NULL) {
TALLOC_FREE(frame);
errno = ENOMEM;
/* Create an smb_filename with stream_name == NULL. */
smb_fname_base = synthetic_smb_fname(talloc_tos(),
- smb_fname->base_name, NULL, NULL);
+ smb_fname->base_name,
+ NULL,
+ NULL,
+ smb_fname->flags);
if (smb_fname_base == NULL) {
errno = ENOMEM;
/* Create an smb_filename with stream_name == NULL. */
smb_fname_base = synthetic_smb_fname(talloc_tos(),
- adpath, NULL, NULL);
+ adpath,
+ NULL,
+ NULL,
+ smb_fname->flags);
if (smb_fname_base == NULL) {
errno = ENOMEM;
rc = -1;
smb_fname_adp = synthetic_smb_fname(talloc_tos(),
adp,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (smb_fname_adp == NULL) {
TALLOC_FREE(adp);
errno = ENOMEM;
adp_smb_fname = synthetic_smb_fname(talloc_tos(),
adp,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (adp_smb_fname == NULL) {
errno = ENOMEM;
rc = -1;
req,
state->src_fsp->fsp_name->base_name,
streams[i].name,
- NULL);
+ NULL,
+ state->src_fsp->fsp_name->flags);
if (tevent_req_nomem(src_fname_tmp, req)) {
return;
}
req,
state->dst_fsp->fsp_name->base_name,
streams[i].name,
- NULL);
+ NULL,
+ state->dst_fsp->fsp_name->flags);
if (tevent_req_nomem(dst_fname_tmp, req)) {
TALLOC_FREE(src_fname_tmp);
return;
/* don't add complementary DENY ACEs here */
fake_fsp.fsp_name = synthetic_smb_fname(
- frame, path, NULL, NULL);
+ frame, path, NULL, NULL, 0);
if (fake_fsp.fsp_name == NULL) {
errno = ENOMEM;
TALLOC_FREE(frame);
DEBUG(10, ("hpuxacl_sys_acl_set_file called for file '%s'\n",
name));
- smb_fname = synthetic_smb_fname(talloc_tos(), name, NULL, NULL);
+ smb_fname = synthetic_smb_fname(talloc_tos(), name, NULL, NULL, 0);
if (smb_fname == NULL) {
status = NT_STATUS_NO_MEMORY;
goto done;
synthetic_smb_fname(talloc_tos(),
dirInfo->clientPath,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (smb_fname_clientpath == NULL) {
goto err;
}
client_smb_fname = synthetic_smb_fname(talloc_tos(),
clientPath,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (client_smb_fname == NULL) {
TALLOC_FREE(clientPath);
return NT_STATUS_NO_MEMORY;
TALLOC_CTX *frame = talloc_stackframe();
DEBUG(10, ("nfs4acls_inheritacl invoked for %s\n", path));
- smb_fname = synthetic_smb_fname(frame, path, NULL, NULL);
+ smb_fname = synthetic_smb_fname(frame, path, NULL, NULL, 0);
if (smb_fname == NULL) {
TALLOC_FREE(frame);
errno = ENOMEM;
smb_fname = synthetic_smb_fname(talloc_tos(),
new_dir,
NULL,
- NULL);
+ NULL,
+ 0);
if (smb_fname == NULL) {
goto done;
}
}
/* Create smb_fname with final base name and orig stream name. */
- smb_fname_final = synthetic_smb_fname(talloc_tos(), final_name,
- smb_fname->stream_name, NULL);
+ smb_fname_final = synthetic_smb_fname(talloc_tos(),
+ final_name,
+ smb_fname->stream_name,
+ NULL,
+ smb_fname->flags);
if (smb_fname_final == NULL) {
rc = SMB_VFS_NEXT_UNLINK(handle, smb_fname);
goto done;
struct smb_filename *smb_fname = synthetic_smb_fname(talloc_tos(),
fsp->conn->connectpath,
NULL,
- NULL);
+ NULL,
+ 0);
if (smb_fname == NULL) {
errno = ENOMEM;
return -1;
conv_smb_fname = synthetic_smb_fname(talloc_tos(),
conv,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (conv_smb_fname == NULL) {
TALLOC_FREE(conv);
return NULL;
conv_smb_fname = synthetic_smb_fname(talloc_tos(),
conv,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (conv_smb_fname == NULL) {
TALLOC_FREE(conv);
errno = ENOMEM;
conv_smb_fname = synthetic_smb_fname(talloc_tos(),
conv,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (conv_smb_fname == NULL) {
TALLOC_FREE(conv);
errno = ENOMEM;
snapdir_smb_fname = synthetic_smb_fname(talloc_tos(),
snapdir,
NULL,
- NULL);
+ NULL,
+ fsp->fsp_name->flags);
if (snapdir_smb_fname == NULL) {
errno = ENOMEM;
talloc_free(tmp_ctx);
smb_fname = synthetic_smb_fname(talloc_tos(),
conv,
NULL,
- NULL);
+ NULL,
+ fsp->fsp_name->flags);
if (smb_fname == NULL) {
TALLOC_FREE(conv);
return NT_STATUS_NO_MEMORY;
conv_smb_fname = synthetic_smb_fname(talloc_tos(),
conv,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (conv_smb_fname == NULL) {
TALLOC_FREE(conv);
return NT_STATUS_NO_MEMORY;
conv_smb_fname = synthetic_smb_fname(talloc_tos(),
conv,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (conv_smb_fname == NULL) {
TALLOC_FREE(conv);
return -1;
conv_smb_fname = synthetic_smb_fname(talloc_tos(),
conv,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (conv_smb_fname == NULL) {
TALLOC_FREE(conv);
return -1;
conv_smb_fname = synthetic_smb_fname(talloc_tos(),
conv,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (conv_smb_fname == NULL) {
TALLOC_FREE(conv);
errno = ENOMEM;
conv_smb_fname = synthetic_smb_fname(talloc_tos(),
conv,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (conv_smb_fname == NULL) {
TALLOC_FREE(conv);
errno = ENOMEM;
conv_smb_fname = synthetic_smb_fname(talloc_tos(),
conv,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (conv_smb_fname == NULL) {
TALLOC_FREE(conv);
errno = ENOMEM;
conv_smb_fname = synthetic_smb_fname(talloc_tos(),
conv,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (conv_smb_fname == NULL) {
TALLOC_FREE(conv);
errno = ENOMEM;
smb_fname = synthetic_smb_fname(talloc_tos(),
conv,
NULL,
- NULL);
+ NULL,
+ fsp->fsp_name->flags);
TALLOC_FREE(conv);
if (smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;
smb_fname = synthetic_smb_fname(talloc_tos(),
conv,
NULL,
- NULL);
+ NULL,
+ fname->flags);
TALLOC_FREE(conv);
if (smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;
smb_fname = synthetic_smb_fname(talloc_tos(),
conv,
NULL,
- NULL);
+ NULL,
+ fname->flags);
TALLOC_FREE(conv);
if (smb_fname == NULL) {
errno = ENOMEM;
smb_fname = synthetic_smb_fname(talloc_tos(),
conv,
NULL,
- NULL);
+ NULL,
+ fname->flags);
TALLOC_FREE(conv);
if (smb_fname == NULL) {
errno = ENOMEM;
conv_smb_fname = synthetic_smb_fname(talloc_tos(),
conv,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (conv_smb_fname == NULL) {
TALLOC_FREE(conv);
errno = ENOMEM;
rootdir_fname = synthetic_smb_fname(talloc_tos(),
rootdir,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (rootdir_fname == NULL) {
errno = ENOMEM;
goto fail;
struct smb_filename *smb_fname_base;
smb_fname_base = synthetic_smb_fname(
- talloc_tos(), smb_fname->base_name, NULL, NULL);
+ talloc_tos(),
+ smb_fname->base_name,
+ NULL,
+ NULL,
+ smb_fname->flags);
if (smb_fname_base == NULL) {
errno = ENOMEM;
goto fail;
return NULL;
}
- smb_fname_hash = synthetic_smb_fname(talloc_tos(), result, NULL, NULL);
+ smb_fname_hash = synthetic_smb_fname(talloc_tos(),
+ result,
+ NULL,
+ NULL,
+ smb_fname->flags);
if (smb_fname_hash == NULL) {
errno = ENOMEM;
goto fail;
}
smb_fname_new = synthetic_smb_fname(
- talloc_tos(), newname, NULL, NULL);
+ talloc_tos(),
+ newname,
+ NULL,
+ NULL,
+ smb_fname->flags);
TALLOC_FREE(newname);
if (smb_fname_new == NULL) {
errno = ENOMEM;
goto fail;
}
- tmp_fname = synthetic_smb_fname(talloc_tos(), tmp, NULL, NULL);
+ tmp_fname = synthetic_smb_fname(talloc_tos(),
+ tmp,
+ NULL,
+ NULL,
+ smb_fname->flags);
if (tmp_fname == NULL) {
errno = ENOMEM;
goto fail;
goto fail;
}
- tmp_fname = synthetic_smb_fname(talloc_tos(), tmp, NULL, NULL);
+ tmp_fname = synthetic_smb_fname(talloc_tos(),
+ tmp,
+ NULL,
+ NULL,
+ smb_fname->flags);
if (tmp_fname == NULL) {
errno = ENOMEM;
goto fail;
DEBUG(10, ("stream filename = %s\n", stream_fname));
/* Create an smb_filename with stream_name == NULL. */
- *smb_fname_out = synthetic_smb_fname(
- talloc_tos(), stream_fname, NULL, NULL);
+ *smb_fname_out = synthetic_smb_fname(talloc_tos(),
+ stream_fname,
+ NULL,
+ NULL,
+ smb_fname->flags);
if (*smb_fname_out == NULL) {
return NT_STATUS_NO_MEMORY;
}
dir_smb_fname = synthetic_smb_fname(talloc_tos(),
dirname,
NULL,
- NULL);
+ NULL,
+ smb_fname_base->flags);
if (dir_smb_fname == NULL) {
TALLOC_FREE(dirname);
return NT_STATUS_NO_MEMORY;
}
/* Ensure the base file still exists. */
- smb_fname_base = synthetic_smb_fname(
- talloc_tos(), smb_fname->base_name, NULL, NULL);
+ smb_fname_base = synthetic_smb_fname(talloc_tos(),
+ smb_fname->base_name,
+ NULL,
+ NULL,
+ smb_fname->flags);
if (smb_fname_base == NULL) {
ret = -1;
errno = ENOMEM;
* We potentially need to delete the per-inode streams directory
*/
- smb_fname_base = synthetic_smb_fname(
- talloc_tos(), smb_fname->base_name, NULL, NULL);
+ smb_fname_base = synthetic_smb_fname(talloc_tos(),
+ smb_fname->base_name,
+ NULL,
+ NULL,
+ smb_fname->flags);
if (smb_fname_base == NULL) {
errno = ENOMEM;
return -1;
synthetic_smb_fname(talloc_tos(),
dirname,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (smb_fname_dir == NULL) {
TALLOC_FREE(smb_fname_base);
TALLOC_FREE(dirname);
smb_fname_base = synthetic_smb_fname(talloc_tos(),
smb_fname->base_name,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (smb_fname_base == NULL) {
errno = ENOMEM;
return -1;
synthetic_smb_fname(talloc_tos(),
dirname,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (smb_fname_dir == NULL) {
TALLOC_FREE(smb_fname_base);
TALLOC_FREE(dirname);
goto out;
}
- smb_fname = synthetic_smb_fname(talloc_tos(), sname, NULL, NULL);
+ smb_fname = synthetic_smb_fname(talloc_tos(), sname, NULL, NULL, 0);
if (smb_fname == NULL) {
state->status = NT_STATUS_NO_MEMORY;
ret = false;
smb_fname_base = synthetic_smb_fname(talloc_tos(),
smb_fname->base_name,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (smb_fname_base == NULL) {
return NT_STATUS_NO_MEMORY;
}
}
/* Create an smb_filename with stream_name == NULL. */
- smb_fname_base = synthetic_smb_fname(talloc_tos(), io->base,
- NULL, NULL);
+ smb_fname_base = synthetic_smb_fname(talloc_tos(),
+ io->base,
+ NULL,
+ NULL,
+ fsp->fsp_name->flags);
if (smb_fname_base == NULL) {
errno = ENOMEM;
return -1;
}
/* Create an smb_filename with stream_name == NULL. */
- smb_fname_base = synthetic_smb_fname(
- talloc_tos(), smb_fname->base_name, NULL, NULL);
+ smb_fname_base = synthetic_smb_fname(talloc_tos(),
+ smb_fname->base_name,
+ NULL,
+ NULL,
+ smb_fname->flags);
if (smb_fname_base == NULL) {
errno = ENOMEM;
goto fail;
synthetic_smb_fname(talloc_tos(),
dirInfo->clientPath,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (client_smb_fname == NULL) {
goto err;
}
client_smb_fname = synthetic_smb_fname(talloc_tos(),
client_path,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (client_smb_fname == NULL) {
TALLOC_FREE(client_path);
return NT_STATUS_NO_MEMORY;
goto out;
}
- smb_fname = synthetic_smb_fname(mem_ctx, name, NULL, NULL);
+ smb_fname = synthetic_smb_fname(mem_ctx, name, NULL, NULL, 0);
if (smb_fname == NULL) {
DEBUG(10, ("vfs_vxfs: Failed to create smb_fname\n"));
goto out;
TALLOC_CTX *frame = talloc_stackframe();
struct smb_filename *smb_fname;
- smb_fname = synthetic_smb_fname(frame, path, NULL, NULL);
+ smb_fname = synthetic_smb_fname(frame, path, NULL, NULL, 0);
if (smb_fname == NULL) {
TALLOC_FREE(frame);
errno = ENOMEM;
goto err_out;
}
- smb_fname = synthetic_smb_fname(tmp_ctx, print_dlr_path, NULL, NULL);
+ smb_fname = synthetic_smb_fname(tmp_ctx, print_dlr_path, NULL, NULL, 0);
if (smb_fname == NULL) {
goto err_out;
}
}
/* setup a full fsp */
- fsp->fsp_name = synthetic_smb_fname(fsp, pf->filename, NULL, NULL);
+ fsp->fsp_name = synthetic_smb_fname(fsp, pf->filename, NULL, NULL, 0);
if (fsp->fsp_name == NULL) {
status = NT_STATUS_NO_MEMORY;
goto done;
goto out;
}
- smb_fname = synthetic_smb_fname(service, sc->sc_path, NULL, NULL);
+ smb_fname = synthetic_smb_fname(service, sc->sc_path, NULL, NULL, 0);
if (smb_fname == NULL) {
goto out;
}
smb_fname_stream = synthetic_smb_fname(talloc_tos(),
smb_fname->base_name,
stream_info[i].name,
- NULL);
+ NULL,
+ smb_fname->flags);
if (smb_fname_stream == NULL) {
DEBUG(0, ("talloc_aprintf failed\n"));
goto err_break;
}
- smb_dname_full = synthetic_smb_fname(talloc_tos(), fullname,
- NULL, NULL);
+ smb_dname_full = synthetic_smb_fname(talloc_tos(),
+ fullname,
+ NULL,
+ NULL,
+ smb_dname->flags);
if (smb_dname_full == NULL) {
errno = ENOMEM;
goto err_break;
goto err_break;
}
- smb_dname_full = synthetic_smb_fname(
- talloc_tos(), fullname, NULL, NULL);
+ smb_dname_full = synthetic_smb_fname(talloc_tos(),
+ fullname,
+ NULL,
+ NULL,
+ smb_dname->flags);
if (smb_dname_full == NULL) {
errno = ENOMEM;
goto err_break;
}
/* Now check the stat value is the same. */
- smb_fname_cwd = synthetic_smb_fname(talloc_tos(), ".", NULL, NULL);
-
+ smb_fname_cwd = synthetic_smb_fname(talloc_tos(),
+ ".",
+ NULL,
+ NULL,
+ smb_dname->flags);
if (smb_fname_cwd == NULL) {
goto out;
}
}
/* Create an smb_filename with stream_name == NULL. */
- smb_fname_base = synthetic_smb_fname(talloc_tos(), entry, NULL,
- pst);
+ smb_fname_base = synthetic_smb_fname(talloc_tos(),
+ entry,
+ NULL,
+ pst,
+ 0);
if (smb_fname_base == NULL) {
ret = false;
goto out;
smb_fname_str_dbg(smb_fname),
inherit_from_dir));
- smb_fname_parent = synthetic_smb_fname(
- talloc_tos(), inherit_from_dir, NULL, NULL);
+ smb_fname_parent = synthetic_smb_fname(talloc_tos(),
+ inherit_from_dir,
+ NULL,
+ NULL,
+ smb_fname->flags);
if (smb_fname_parent == NULL) {
DEBUG(1,("unix_mode(%s) failed, [dir %s]: No memory\n",
smb_fname_str_dbg(smb_fname),
return NT_STATUS_OK;
}
- smb_fname = synthetic_smb_fname(talloc_tos(), psmb_fname->base_name,
- NULL, &psmb_fname->st);
+ smb_fname = synthetic_smb_fname(talloc_tos(),
+ psmb_fname->base_name,
+ NULL,
+ &psmb_fname->st,
+ psmb_fname->flags);
if (smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;
}
/* Create an smb_filename with stream_name == NULL. */
- smb_fname = synthetic_smb_fname(talloc_tos(), cookie.base_name,
- NULL, NULL);
+ smb_fname = synthetic_smb_fname(talloc_tos(),
+ cookie.base_name,
+ NULL,
+ NULL,
+ 0);
if (smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;
}
return False;
}
- smb_fname_parent = synthetic_smb_fname(ctx, dname, NULL, NULL);
+ smb_fname_parent = synthetic_smb_fname(ctx,
+ dname,
+ NULL,
+ NULL,
+ smb_fname->flags);
if (smb_fname_parent == NULL) {
ret = false;
goto out;
struct smb_filename *smb_fname = synthetic_smb_fname(talloc_tos(),
fname,
NULL,
- NULL);
+ NULL,
+ 0);
if (smb_fname == NULL) {
return false;
smb_fname = synthetic_smb_fname(talloc_tos(),
path,
NULL,
- NULL);
+ NULL,
+ 0);
if (smb_fname == NULL) {
TALLOC_FREE(unmangled_name);
return -1;
* few NULL checks, so make sure it's initialized with something. to
* be safe until an audit can be done.
*/
- fsp->fsp_name = synthetic_smb_fname(fsp, "", NULL, NULL);
+ fsp->fsp_name = synthetic_smb_fname(fsp, "", NULL, NULL, 0);
if (fsp->fsp_name == NULL) {
file_free(NULL, fsp);
return NT_STATUS_NO_MEMORY;
if (errno == EEXIST) {
struct smb_filename *smb_fname;
- smb_fname = synthetic_smb_fname(talloc_tos(), path,
- NULL, NULL);
+ smb_fname = synthetic_smb_fname(talloc_tos(),
+ path,
+ NULL,
+ NULL,
+ 0);
if (smb_fname == NULL) {
errno = ENOMEM;
goto out;
return false;
}
- smb_fname = synthetic_smb_fname(talloc_tos(), path, NULL, NULL);
+ smb_fname = synthetic_smb_fname(talloc_tos(),
+ path,
+ NULL,
+ NULL,
+ 0);
if (smb_fname == NULL) {
errno = ENOMEM;
return false;
smb_fname = synthetic_smb_fname(talloc_tos(),
".",
NULL,
- NULL);
+ NULL,
+ 0);
if (smb_fname == NULL) {
goto out;
}
smb_fname = synthetic_smb_fname(talloc_tos(),
".",
NULL,
- NULL);
+ NULL,
+ 0);
if (smb_fname == NULL) {
goto out;
}
parent_smb_fname = synthetic_smb_fname(talloc_tos(),
parent_dir,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (parent_smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;
}
struct smb_filename *smb_fname_parent;
int ret;
- smb_fname_parent = synthetic_smb_fname(talloc_tos(), inherit_from_dir,
- NULL, NULL);
+ smb_fname_parent = synthetic_smb_fname(talloc_tos(),
+ inherit_from_dir,
+ NULL,
+ NULL,
+ 0);
if (smb_fname_parent == NULL) {
return;
}
NTSTATUS status = NT_STATUS_OK;
int ret;
- smb_fname_parent = synthetic_smb_fname(ctx, inherit_from_dir,
- NULL, NULL);
+ smb_fname_parent = synthetic_smb_fname(ctx,
+ inherit_from_dir,
+ NULL,
+ NULL,
+ 0);
if (smb_fname_parent == NULL) {
return NT_STATUS_NO_MEMORY;
}
goto chdir;
}
- smb_fname_cwd = synthetic_smb_fname(ctx, ".", NULL, NULL);
+ smb_fname_cwd = synthetic_smb_fname(ctx, ".", NULL, NULL, 0);
if (smb_fname_cwd == NULL) {
status = NT_STATUS_NO_MEMORY;
goto chdir;
stream_name = NULL;
}
- smb_fname = synthetic_smb_fname(talloc_tos(), base_name,
- stream_name, NULL);
+ smb_fname = synthetic_smb_fname(talloc_tos(),
+ base_name,
+ stream_name,
+ NULL,
+ 0);
if (smb_fname == NULL) {
return;
}
smb_fname_cp = synthetic_smb_fname(talloc_tos(),
smb_fname->base_name,
stream_info[i].name,
- NULL);
+ NULL,
+ smb_fname->flags);
if (smb_fname_cp == NULL) {
status = NT_STATUS_NO_MEMORY;
goto fail;
parent_smb_fname = synthetic_smb_fname(talloc_tos(),
parent_name,
NULL,
- NULL);
+ NULL,
+ fsp->fsp_name->flags);
if (parent_smb_fname == NULL) {
TALLOC_FREE(frame);
/* Create an smb_filename with stream_name == NULL. */
smb_fname_base = synthetic_smb_fname(talloc_tos(),
- smb_fname->base_name,
- NULL, NULL);
+ smb_fname->base_name,
+ NULL,
+ NULL,
+ smb_fname->flags);
if (smb_fname_base == NULL) {
status = NT_STATUS_NO_MEMORY;
goto fail;
fsp->can_lock = false;
fsp->access_mask = FILE_READ_DATA | FILE_WRITE_DATA;
- smb_fname = synthetic_smb_fname(talloc_tos(), name, NULL, NULL);
+ smb_fname = synthetic_smb_fname(talloc_tos(), name, NULL, NULL, 0);
if (smb_fname == NULL) {
file_free(smb_req, fsp);
return NT_STATUS_NO_MEMORY;
struct smb_filename *smb_fname = synthetic_smb_fname(talloc_tos(),
fname,
NULL,
- NULL);
+ NULL,
+ 0);
if (smb_fname == NULL) {
TALLOC_FREE(frame);
};
struct smb_filename *smb_fname;
- smb_fname = synthetic_smb_fname(frame, path_p, NULL, NULL);
+ smb_fname = synthetic_smb_fname(frame, path_p, NULL, NULL, 0);
if (smb_fname == NULL) {
TALLOC_FREE(frame);
errno = ENOMEM;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
struct smb_filename *smb_fname = synthetic_smb_fname(talloc_tos(),
- fname,
- NULL,
- NULL);
+ fname,
+ NULL,
+ NULL,
+ lp_posix_pathnames() ?
+ SMB_FILENAME_POSIX_PATH : 0);
if (smb_fname == NULL) {
TALLOC_FREE(frame);
smb_fname = synthetic_smb_fname(talloc_tos(),
fname,
NULL,
- NULL);
+ NULL,
+ lp_posix_pathnames() ?
+ SMB_FILENAME_POSIX_PATH : 0);
if (smb_fname == NULL) {
umask(saved_umask);
TALLOC_FREE(frame);
smb_dname = synthetic_smb_fname(talloc_tos(),
directory,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (smb_dname == NULL) {
reply_nterror(req, NT_STATUS_NO_MEMORY);
goto out;
smb_fname_dir = synthetic_smb_fname(talloc_tos(),
fname_dir,
NULL,
- NULL);
+ NULL,
+ smb_fname->flags);
if (smb_fname_dir == NULL) {
status = NT_STATUS_NO_MEMORY;
goto out;
smb_fname_src_dir = synthetic_smb_fname(talloc_tos(),
fname_src_dir,
NULL,
- NULL);
+ NULL,
+ smb_fname_src->flags);
if (smb_fname_src_dir == NULL) {
status = NT_STATUS_NO_MEMORY;
goto out;
smb_fname_src_dir = synthetic_smb_fname(talloc_tos(),
fname_src_dir,
NULL,
- NULL);
+ NULL,
+ smb_fname_src->flags);
if (smb_fname_src_dir == NULL) {
reply_nterror(req, NT_STATUS_NO_MEMORY);
goto out;
set_namearray( &conn->aio_write_behind_list,
lp_aio_write_behind(talloc_tos(), snum));
}
- smb_fname_cpath = synthetic_smb_fname(talloc_tos(), conn->connectpath,
- NULL, NULL);
+ smb_fname_cpath = synthetic_smb_fname(talloc_tos(),
+ conn->connectpath,
+ NULL,
+ NULL,
+ 0);
if (smb_fname_cpath == NULL) {
status = NT_STATUS_NO_MEMORY;
goto err_root_exit;
/* Create an smb_filename with stream_name == NULL. */
smb_fname_base = synthetic_smb_fname(
- talloc_tos(), smb_fname->base_name,
- NULL, NULL);
+ talloc_tos(),
+ smb_fname->base_name,
+ NULL,
+ NULL,
+ smb_fname->flags);
if (smb_fname_base == NULL) {
reply_nterror(req, NT_STATUS_NO_MEMORY);
return;
}
/* Always operate on the base_name, even if a stream was passed in. */
- smb_fname_base = synthetic_smb_fname(
- talloc_tos(), smb_fname->base_name, NULL, &smb_fname->st);
+ smb_fname_base = synthetic_smb_fname(talloc_tos(),
+ smb_fname->base_name,
+ NULL,
+ &smb_fname->st,
+ smb_fname->flags);
if (smb_fname_base == NULL) {
return NT_STATUS_NO_MEMORY;
}
}
/* Create an smb_fname to call rename_internals_fsp() with. */
- smb_fname_dst = synthetic_smb_fname(
- talloc_tos(), fsp->base_fsp->fsp_name->base_name,
- newname, NULL);
+ smb_fname_dst = synthetic_smb_fname(talloc_tos(),
+ fsp->base_fsp->fsp_name->base_name,
+ newname,
+ NULL,
+ fsp->base_fsp->fsp_name->flags);
if (smb_fname_dst == NULL) {
status = NT_STATUS_NO_MEMORY;
goto out;
}
/* Create an smb_fname to call rename_internals_fsp() with. */
- smb_fname_dst = synthetic_smb_fname(
- talloc_tos(), fsp->base_fsp->fsp_name->base_name,
- newname, NULL);
+ smb_fname_dst = synthetic_smb_fname(talloc_tos(),
+ fsp->base_fsp->fsp_name->base_name,
+ newname,
+ NULL,
+ fsp->base_fsp->fsp_name->flags);
if (smb_fname_dst == NULL) {
status = NT_STATUS_NO_MEMORY;
goto out;
goto out;
}
/* Create an smb_fname to call rename_internals_fsp() */
- smb_fname_dst = synthetic_smb_fname(
- ctx, base_name, NULL, NULL);
+ smb_fname_dst = synthetic_smb_fname(ctx,
+ base_name,
+ NULL,
+ NULL,
+ smb_fname_src->flags);
if (smb_fname_dst == NULL) {
status = NT_STATUS_NO_MEMORY;
goto out;
goto nocache;
}
- smb_fname_dot = synthetic_smb_fname(ctx, ".", NULL, NULL);
+ smb_fname_dot = synthetic_smb_fname(ctx, ".", NULL, NULL, 0);
if (smb_fname_dot == NULL) {
errno = ENOMEM;
goto out;
&& (cache_value.data[cache_value.length-1] == '\0'));
smb_fname_full = synthetic_smb_fname(ctx, (char *)cache_value.data,
- NULL, NULL);
+ NULL, NULL, 0);
if (smb_fname_full == NULL) {
errno = ENOMEM;
goto out;
resolved_name));
/* Now check the stat value is the same. */
- smb_fname_cwd = synthetic_smb_fname(talloc_tos(), ".", NULL, NULL);
+ smb_fname_cwd = synthetic_smb_fname(talloc_tos(), ".", NULL, NULL, 0);
if (smb_fname_cwd == NULL) {
status = NT_STATUS_NO_MEMORY;
goto err;
local_smb_fname = synthetic_smb_fname(talloc_tos(),
final_component,
NULL,
- NULL);
+ NULL,
+ fsp->fsp_name->flags);
if (local_smb_fname == NULL) {
status = NT_STATUS_NO_MEMORY;
goto out;
static const char *null_string = "";
+static uint32_t ssf_flags(void)
+{
+ return lp_posix_pathnames() ? SMB_FILENAME_POSIX_PATH : 0;
+}
+
static NTSTATUS cmd_load_module(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
{
int i;
smb_fname = synthetic_smb_fname(talloc_tos(),
argv[1],
NULL,
- NULL);
+ NULL,
+ ssf_flags());
if (smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;
}
smb_fname = synthetic_smb_fname(talloc_tos(),
argv[1],
NULL,
- NULL);
+ NULL,
+ ssf_flags());
if (smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;
smb_fname = synthetic_smb_fname(talloc_tos(),
argv[1],
NULL,
- NULL);
+ NULL,
+ ssf_flags());
if (smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;
smb_fname = synthetic_smb_fname(talloc_tos(),
argv[1],
NULL,
- NULL);
+ NULL,
+ ssf_flags());
if (smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;
}
smb_fname = synthetic_smb_fname(talloc_tos(),
argv[1],
NULL,
- NULL);
+ NULL,
+ ssf_flags());
if (smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;
}
smb_fname = synthetic_smb_fname(talloc_tos(),
argv[1],
NULL,
- NULL);
+ NULL,
+ ssf_flags());
if (smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;
}
smb_fname = synthetic_smb_fname(talloc_tos(),
argv[1],
NULL,
- NULL);
+ NULL,
+ ssf_flags());
if (smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;
smb_fname = synthetic_smb_fname(talloc_tos(),
".",
NULL,
- NULL);
+ NULL,
+ ssf_flags());
if (smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;
}