mirror of
https://github.com/samba-team/samba.git
synced 2025-02-23 09:57:40 +03:00
s3: smbd: Modify vfs_stat_smb_basename() to take a const struct smb_filename * instead of const char *.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
This commit is contained in:
parent
125a1b50ab
commit
6ae59eb6d1
@ -274,7 +274,7 @@ static int smbacl4_GetFileOwner(struct connection_struct *conn,
|
||||
ZERO_STRUCTP(psbuf);
|
||||
|
||||
/* Get the stat struct for the owner info. */
|
||||
if (vfs_stat_smb_basename(conn, smb_fname->base_name, psbuf) != 0)
|
||||
if (vfs_stat_smb_basename(conn, smb_fname, psbuf) != 0)
|
||||
{
|
||||
DEBUG(8, ("vfs_stat_smb_basename failed with error %s\n",
|
||||
strerror(errno)));
|
||||
|
@ -641,7 +641,7 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
|
||||
* is fully plumbed through the VFS.
|
||||
*/
|
||||
int ret = vfs_stat_smb_basename(handle->conn,
|
||||
smb_fname->base_name,
|
||||
smb_fname,
|
||||
&sbuf);
|
||||
if (ret == -1) {
|
||||
TALLOC_FREE(frame);
|
||||
|
@ -160,7 +160,7 @@ static NTSTATUS get_acl_blob(TALLOC_CTX *ctx,
|
||||
sbuf = fsp->fsp_name->st;
|
||||
} else {
|
||||
int ret = vfs_stat_smb_basename(handle->conn,
|
||||
smb_fname->base_name,
|
||||
smb_fname,
|
||||
&sbuf);
|
||||
if (ret == -1) {
|
||||
status = map_nt_error_from_unix(errno);
|
||||
@ -285,7 +285,7 @@ static int rmdir_acl_tdb(vfs_handle_struct *handle,
|
||||
struct db_context *db = acl_db;
|
||||
int ret = -1;
|
||||
|
||||
ret = vfs_stat_smb_basename(handle->conn, smb_fname->base_name, &sbuf);
|
||||
ret = vfs_stat_smb_basename(handle->conn, smb_fname, &sbuf);
|
||||
if (ret == -1) {
|
||||
return -1;
|
||||
}
|
||||
|
@ -842,7 +842,7 @@ static NTSTATUS streams_xattr_streaminfo(vfs_handle_struct *handle,
|
||||
ret = SMB_VFS_FSTAT(fsp, &sbuf);
|
||||
} else {
|
||||
ret = vfs_stat_smb_basename(handle->conn,
|
||||
smb_fname->base_name,
|
||||
smb_fname,
|
||||
&sbuf);
|
||||
}
|
||||
|
||||
|
@ -416,7 +416,7 @@ static int xattr_tdb_rmdir(vfs_handle_struct *handle,
|
||||
});
|
||||
|
||||
if (vfs_stat_smb_basename(handle->conn,
|
||||
smb_fname->base_name,
|
||||
smb_fname,
|
||||
&sbuf) == -1) {
|
||||
TALLOC_FREE(frame);
|
||||
return -1;
|
||||
|
@ -1213,7 +1213,8 @@ NTSTATUS check_reduced_name(connection_struct *conn, const char *fname);
|
||||
NTSTATUS check_reduced_name_with_privilege(connection_struct *conn,
|
||||
const char *fname,
|
||||
struct smb_request *smbreq);
|
||||
int vfs_stat_smb_basename(struct connection_struct *conn, const char *fname,
|
||||
int vfs_stat_smb_basename(struct connection_struct *conn,
|
||||
const struct smb_filename *smb_fname_in,
|
||||
SMB_STRUCT_STAT *psbuf);
|
||||
NTSTATUS vfs_stat_fsp(files_struct *fsp);
|
||||
NTSTATUS vfs_chown_fsp(files_struct *fsp, uid_t uid, gid_t gid);
|
||||
|
@ -69,7 +69,7 @@ static NTSTATUS refuse_symlink(connection_struct *conn,
|
||||
pst = &fsp->fsp_name->st;
|
||||
} else {
|
||||
int ret = vfs_stat_smb_basename(conn,
|
||||
smb_fname->base_name,
|
||||
smb_fname,
|
||||
&sbuf);
|
||||
if (ret == -1) {
|
||||
return map_nt_error_from_unix(errno);
|
||||
|
@ -1315,15 +1315,17 @@ NTSTATUS check_reduced_name(connection_struct *conn, const char *fname)
|
||||
*
|
||||
* Called when we know stream name parsing has already been done.
|
||||
*/
|
||||
int vfs_stat_smb_basename(struct connection_struct *conn, const char *fname,
|
||||
SMB_STRUCT_STAT *psbuf)
|
||||
int vfs_stat_smb_basename(struct connection_struct *conn,
|
||||
const struct smb_filename *smb_fname_in,
|
||||
SMB_STRUCT_STAT *psbuf)
|
||||
{
|
||||
struct smb_filename smb_fname = {
|
||||
.base_name = discard_const_p(char, fname)
|
||||
.base_name = discard_const_p(char, smb_fname_in->base_name),
|
||||
.flags = smb_fname_in->flags
|
||||
};
|
||||
int ret;
|
||||
|
||||
if (lp_posix_pathnames()) {
|
||||
if (smb_fname.flags & SMB_FILENAME_POSIX_PATH) {
|
||||
ret = SMB_VFS_LSTAT(conn, &smb_fname);
|
||||
} else {
|
||||
ret = SMB_VFS_STAT(conn, &smb_fname);
|
||||
|
Loading…
x
Reference in New Issue
Block a user