summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2016-03-17 16:20:17 -0700
committerJeremy Allison <jra@samba.org>2016-03-24 22:57:16 +0100
commit2e302d7007a58df972f7e63382ee8c9729f80560 (patch)
tree4404b2e682abefd46f74e4e8944db4da23998d9c /source3
parent09325a0ea64e43c2a4059289e3379e5543a6b76a (diff)
downloadsamba-2e302d7007a58df972f7e63382ee8c9729f80560.tar.gz
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>
Diffstat (limited to 'source3')
-rw-r--r--source3/include/vfs.h9
-rw-r--r--source3/lib/filename_util.c1
-rw-r--r--source3/modules/vfs_default.c1
-rw-r--r--source3/smbd/filename.c2
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));
/*