From aa72d09b3130ef61f1be5713b8f2c016ac5bc551 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 May 2017 13:24:26 -0700 Subject: [PATCH] s3: smbd: Add UCF_GMT_PATHNAME, which represents FLAGS2_REPARSE_PATH. This must be set by a client to use shadow copy (@GMT) paths. Signed-off-by: Jeremy Allison Reviewed-by: Uri Simchoni --- source3/smbd/filename.c | 3 +++ source3/smbd/smb2_create.c | 5 +++++ source3/smbd/smbd.h | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index 9586857da0b..fbe8eb4b325 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -41,6 +41,9 @@ uint32_t ucf_flags_from_smb_request(struct smb_request *req) if (req->flags2 & FLAGS2_DFS_PATHNAMES) { ucf_flags |= UCF_DFS_PATHNAME; } + if (req->flags2 & FLAGS2_REPARSE_PATH) { + ucf_flags |= UCF_GMT_PATHNAME; + } } return ucf_flags; diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c index 5a371aeef84..81e081875bc 100644 --- a/source3/smbd/smb2_create.c +++ b/source3/smbd/smb2_create.c @@ -925,6 +925,11 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx, if (tevent_req_nomem(fname, req)) { return tevent_req_post(req, ev); } + /* + * Tell filename_create_ucf_flags() this + * is an @GMT path. + */ + smb1req->flags2 |= FLAGS2_REPARSE_PATH; } if (qfid) { diff --git a/source3/smbd/smbd.h b/source3/smbd/smbd.h index d372c7ed771..a3c372b95b1 100644 --- a/source3/smbd/smbd.h +++ b/source3/smbd/smbd.h @@ -74,6 +74,11 @@ struct trans_state { #define UCF_POSIX_PATHNAMES 0x00000008 #define UCF_UNIX_NAME_LOOKUP 0x00000010 #define UCF_PREP_CREATEFILE 0x00000020 +/* + * Use the same bit as FLAGS2_REPARSE_PATH + * which means the same thing. + */ +#define UCF_GMT_PATHNAME 0x00000400 /* * Use the same bit as FLAGS2_DFS_PATHNAMES * which means the same thing.