1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

s3: smbd: Add uint32_t flags field to struct smb_filename.

Only one defined flag for now, SMB_FILENAME_POSIX_PATH.
Define as the same as FSP_POSIX_FLAGS_PATHNAMES to keep
the value consistent.

Set this inside unix_convert() when a posix path parse
is selected.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
This commit is contained in:
Jeremy Allison 2016-03-17 16:20:17 -07:00
parent 09325a0ea6
commit 2e302d7007
4 changed files with 13 additions and 0 deletions

View File

@ -190,6 +190,7 @@
const struct smb_filename * */
/* Version 35 - Change streaminfo from const char *, to
const struct smb_filename * */
/* Version 35 - Add uint32_t flags to struct smb_filename */
#define SMB_VFS_INTERFACE_VERSION 35
@ -514,9 +515,17 @@ struct smb_filename {
char *base_name;
char *stream_name;
char *original_lcomp;
uint32_t flags;
SMB_STRUCT_STAT st;
};
/*
* smb_filename flags. Define in terms of the FSP_POSIX_FLAGS_XX
* to keep the numeric values consistent.
*/
#define SMB_FILENAME_POSIX_PATH FSP_POSIX_FLAGS_PATHNAMES
#define VFS_FIND(__fn__) while (handle->fns->__fn__##_fn==NULL) { \
handle = handle->next; \
}

View File

@ -212,6 +212,7 @@ struct smb_filename *cp_smb_filename(TALLOC_CTX *mem_ctx,
talloc_set_name_const(out->original_lcomp,
out->original_lcomp);
}
out->flags = in->flags;
out->st = in->st;
return out;
}

View File

@ -2211,6 +2211,7 @@ static NTSTATUS vfswrap_streaminfo(vfs_handle_struct *handle,
ZERO_STRUCT(smb_fname_cp);
smb_fname_cp.base_name = discard_const_p(char,
smb_fname->base_name);
smb_fname_cp.flags = smb_fname->flags;
if (lp_posix_pathnames()) {
ret = SMB_VFS_LSTAT(handle->conn, &smb_fname_cp);

View File

@ -273,6 +273,8 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
goto done;
}
smb_fname->flags = posix_pathnames ? SMB_FILENAME_POSIX_PATH : 0;
DEBUG(5, ("unix_convert called on file \"%s\"\n", orig_path));
/*