s3: smbd: Add UCF_GMT_PATHNAME, which represents FLAGS2_REPARSE_PATH.
authorJeremy Allison <jra@samba.org>
Thu, 18 May 2017 20:24:26 +0000 (13:24 -0700)
committerJeremy Allison <jra@samba.org>
Mon, 22 May 2017 16:41:16 +0000 (18:41 +0200)
This must be set by a client to use shadow copy (@GMT) paths.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
source3/smbd/filename.c
source3/smbd/smb2_create.c
source3/smbd/smbd.h

index 9586857da0bc38b49c2075a0b1ed5b082714e8ff..fbe8eb4b3257473c17c2b9607732a8b437d5775e 100644 (file)
@@ -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;
index 5a371aeef845963400d05af26c617c7d2622edb7..81e081875bc7ba3e85d4bbeb1fdbe3ef00fc48af 100644 (file)
@@ -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) {
index d372c7ed7718d3507e999e62166a0596be813058..a3c372b95b1001a84b9a6a91fabc355b9dd805e1 100644 (file)
@@ -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.