1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3:lib: Remove the const SMB_STRUCT_STAT * parameter from synthetic_smb_fname_split().

Only one caller uses this, and this can be handled externally.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
This commit is contained in:
Jeremy Allison 2016-03-09 15:50:02 -08:00
parent e2056f843d
commit 153af65e44
6 changed files with 16 additions and 18 deletions

View File

@ -1141,8 +1141,7 @@ struct smb_filename *synthetic_smb_fname(TALLOC_CTX *mem_ctx,
const char *stream_name,
const SMB_STRUCT_STAT *psbuf);
struct smb_filename *synthetic_smb_fname_split(TALLOC_CTX *ctx,
const char *fname,
const SMB_STRUCT_STAT *psbuf);
const char *fname);
const char *smb_fname_str_dbg(const struct smb_filename *smb_fname);
const char *fsp_str_dbg(const struct files_struct *fsp);
const char *fsp_fnum_dbg(const struct files_struct *fsp);

View File

@ -73,8 +73,7 @@ struct smb_filename *synthetic_smb_fname(TALLOC_CTX *mem_ctx,
* There are a few legitimate users of this.
*/
struct smb_filename *synthetic_smb_fname_split(TALLOC_CTX *ctx,
const char *fname,
const SMB_STRUCT_STAT *psbuf)
const char *fname)
{
char *stream_name = NULL;
char *base_name = NULL;
@ -83,7 +82,7 @@ struct smb_filename *synthetic_smb_fname_split(TALLOC_CTX *ctx,
if (lp_posix_pathnames()) {
/* No stream name looked for. */
return synthetic_smb_fname(ctx, fname, NULL, psbuf);
return synthetic_smb_fname(ctx, fname, NULL, NULL);
}
ok = split_stream_filename(ctx,
@ -94,7 +93,7 @@ struct smb_filename *synthetic_smb_fname_split(TALLOC_CTX *ctx,
return NULL;
}
ret = synthetic_smb_fname(ctx, base_name, stream_name, psbuf);
ret = synthetic_smb_fname(ctx, base_name, stream_name, NULL);
TALLOC_FREE(base_name);
TALLOC_FREE(stream_name);
return ret;

View File

@ -1423,11 +1423,11 @@ static NTSTATUS filename_convert_internal(TALLOC_CTX *ctx,
ZERO_STRUCT(st);
st.st_ex_nlink = 1;
*pp_smb_fname = synthetic_smb_fname_split(ctx,
name_in,
&st);
name_in);
if (*pp_smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;
}
(*pp_smb_fname)->st = st;
return NT_STATUS_OK;
}

View File

@ -124,7 +124,7 @@ static NTSTATUS set_nt_acl_conn(const char *fname,
so set our umask to 0 */
saved_umask = umask(0);
smb_fname = synthetic_smb_fname_split(fsp, fname, NULL);
smb_fname = synthetic_smb_fname_split(fsp, fname);
if (smb_fname == NULL) {
TALLOC_FREE(frame);
umask(saved_umask);
@ -446,7 +446,7 @@ static PyObject *py_smbd_unlink(PyObject *self, PyObject *args, PyObject *kwargs
return NULL;
}
smb_fname = synthetic_smb_fname_split(frame, fname, NULL);
smb_fname = synthetic_smb_fname_split(frame, fname);
if (smb_fname == NULL) {
TALLOC_FREE(frame);
return PyErr_NoMemory();

View File

@ -6645,7 +6645,7 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
* component of the destination.
*/
smb_fname_orig_lcomp = synthetic_smb_fname_split(
ctx, smb_fname_dst->original_lcomp, NULL);
ctx, smb_fname_dst->original_lcomp);
if (smb_fname_orig_lcomp == NULL) {
status = NT_STATUS_NO_MEMORY;
TALLOC_FREE(fname_dst_lcomp_base_mod);

View File

@ -354,7 +354,7 @@ static NTSTATUS cmd_open(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, c
}
fsp->conn = vfs->conn;
smb_fname = synthetic_smb_fname_split(NULL, argv[1], NULL);
smb_fname = synthetic_smb_fname_split(NULL, argv[1]);
if (smb_fname == NULL) {
TALLOC_FREE(fsp);
return NT_STATUS_NO_MEMORY;
@ -584,12 +584,12 @@ static NTSTATUS cmd_rename(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
return NT_STATUS_OK;
}
smb_fname_src = synthetic_smb_fname_split(mem_ctx, argv[1], NULL);
smb_fname_src = synthetic_smb_fname_split(mem_ctx, argv[1]);
if (smb_fname_src == NULL) {
return NT_STATUS_NO_MEMORY;
}
smb_fname_dst = synthetic_smb_fname_split(mem_ctx, argv[2], NULL);
smb_fname_dst = synthetic_smb_fname_split(mem_ctx, argv[2]);
if (smb_fname_dst == NULL) {
TALLOC_FREE(smb_fname_src);
return NT_STATUS_NO_MEMORY;
@ -644,7 +644,7 @@ static NTSTATUS cmd_stat(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, c
return NT_STATUS_OK;
}
smb_fname = synthetic_smb_fname_split(mem_ctx, argv[1], NULL);
smb_fname = synthetic_smb_fname_split(mem_ctx, argv[1]);
if (smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -783,7 +783,7 @@ static NTSTATUS cmd_lstat(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
return NT_STATUS_OK;
}
smb_fname = synthetic_smb_fname_split(mem_ctx, argv[1], NULL);
smb_fname = synthetic_smb_fname_split(mem_ctx, argv[1]);
if (smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -1043,7 +1043,7 @@ static NTSTATUS cmd_utime(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
ft.atime = convert_time_t_to_timespec(atoi(argv[2]));
ft.mtime = convert_time_t_to_timespec(atoi(argv[3]));
smb_fname = synthetic_smb_fname_split(mem_ctx, argv[1], NULL);
smb_fname = synthetic_smb_fname_split(mem_ctx, argv[1]);
if (smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;
}
@ -1530,7 +1530,7 @@ static NTSTATUS cmd_set_nt_acl(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int a
}
fsp->conn = vfs->conn;
smb_fname = synthetic_smb_fname_split(NULL, argv[1], NULL);
smb_fname = synthetic_smb_fname_split(NULL, argv[1]);
if (smb_fname == NULL) {
TALLOC_FREE(fsp);
return NT_STATUS_NO_MEMORY;