s3: smbd: Add dirfsp parameter to unlink_internals().
[samba.git] / source3 / smbd / smb1_reply.c
index e2e164573e36813b03589014b36eeba465f1fce8..dbdc910659c18b795a816076f062bda54407e567 100644 (file)
@@ -561,7 +561,9 @@ void reply_checkpath(struct smb_request *req)
        struct smb_filename *smb_fname = NULL;
        char *name = NULL;
        NTSTATUS status;
+       struct files_struct *dirfsp = NULL;
        uint32_t ucf_flags = ucf_flags_from_smb_request(req);
+       NTTIME twrp = 0;
        TALLOC_CTX *ctx = talloc_tos();
 
        START_PROFILE(SMBcheckpath);
@@ -578,13 +580,16 @@ void reply_checkpath(struct smb_request *req)
 
        DEBUG(3,("reply_checkpath %s mode=%d\n", name, (int)SVAL(req->vwv+0, 0)));
 
-       status = filename_convert(ctx,
-                               conn,
-                               name,
-                               ucf_flags,
-                               0,
-                               &smb_fname);
-
+       if (ucf_flags & UCF_GMT_PATHNAME) {
+               extract_snapshot_token(name, &twrp);
+       }
+       status = filename_convert_dirfsp(ctx,
+                                        conn,
+                                        name,
+                                        ucf_flags,
+                                        twrp,
+                                        &dirfsp,
+                                        &smb_fname);
        if (!NT_STATUS_IS_OK(status)) {
                if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
                        reply_botherror(req, NT_STATUS_PATH_NOT_COVERED,
@@ -2390,7 +2395,7 @@ void reply_unlink(struct smb_request *req)
 
        DEBUG(3,("reply_unlink : %s\n", smb_fname_str_dbg(smb_fname)));
 
-       status = unlink_internals(conn, req, dirtype, smb_fname);
+       status = unlink_internals(conn, req, dirtype, NULL, smb_fname);
        if (!NT_STATUS_IS_OK(status)) {
                if (open_was_deferred(req->xconn, req->mid)) {
                        /* We have re-scheduled this call. */
@@ -6080,7 +6085,9 @@ void reply_mv(struct smb_request *req)
        status = rename_internals(ctx,
                                conn,
                                req,
+                               NULL, /* src_dirfsp */
                                smb_fname_src,
+                               NULL, /* dst_dirfsp */
                                smb_fname_dst,
                                dst_original_lcomp,
                                attrs,