diff options
-rw-r--r-- | source3/include/vfs.h | 9 | ||||
-rw-r--r-- | source3/lib/filename_util.c | 1 | ||||
-rw-r--r-- | source3/modules/vfs_default.c | 1 | ||||
-rw-r--r-- | source3/smbd/filename.c | 2 |
4 files changed, 13 insertions, 0 deletions
diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 1c6bc2f8fa2..3a86c627f81 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -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; \ } diff --git a/source3/lib/filename_util.c b/source3/lib/filename_util.c index 61a5f012ed0..c2beae170af 100644 --- a/source3/lib/filename_util.c +++ b/source3/lib/filename_util.c @@ -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; } diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index ea7dc2caf99..23df640b415 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -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); diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index dffa71d7b67..a1920c32207 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -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)); /* |