smbd: add twrp arg to synthetic_smb_fname()
[amitay/samba.git] / source3 / smbd / files.c
index 78df1fad6f4f9c0a9396c5a64a97cef795f3e231..a700b3edd271470411f347e9acd6c4b050b22ba4 100644 (file)
@@ -52,12 +52,12 @@ NTSTATUS fsp_new(struct connection_struct *conn, TALLOC_CTX *mem_ctx,
        }
 
 #if defined(HAVE_OFD_LOCKS)
-       fsp->use_ofd_locks = true;
+       fsp->fsp_flags.use_ofd_locks = true;
        if (lp_parm_bool(SNUM(conn),
                         "smbd",
                         "force process locks",
                         false)) {
-               fsp->use_ofd_locks = false;
+               fsp->fsp_flags.use_ofd_locks = false;
        }
 #endif
        fsp->fh->ref_count = 1;
@@ -140,7 +140,12 @@ NTSTATUS file_new(struct smb_request *req, connection_struct *conn,
         * few NULL checks, so make sure it's initialized with something. to
         * be safe until an audit can be done.
         */
-       fsp->fsp_name = synthetic_smb_fname(fsp, "", NULL, NULL, 0);
+       fsp->fsp_name = synthetic_smb_fname(fsp,
+                                           "",
+                                           NULL,
+                                           NULL,
+                                           0,
+                                           0);
        if (fsp->fsp_name == NULL) {
                file_free(NULL, fsp);
                return NT_STATUS_NO_MEMORY;
@@ -208,7 +213,7 @@ NTSTATUS create_internal_dirfsp_at(connection_struct *conn,
 
        fsp->file_id = vfs_file_id_from_sbuf(conn, &fsp->fsp_name->st);
        fsp->access_mask = FILE_LIST_DIRECTORY;
-       fsp->is_directory = true;
+       fsp->fsp_flags.is_directory = true;
 
        *_fsp = fsp;
        return NT_STATUS_OK;
@@ -663,7 +668,7 @@ files_struct *file_fsp(struct smb_request *req, uint16_t fid)
        }
 
        if (req->chain_fsp != NULL) {
-               if (req->chain_fsp->closing) {
+               if (req->chain_fsp->fsp_flags.closing) {
                        return NULL;
                }
                return req->chain_fsp;
@@ -686,7 +691,7 @@ files_struct *file_fsp(struct smb_request *req, uint16_t fid)
                return NULL;
        }
 
-       if (fsp->closing) {
+       if (fsp->fsp_flags.closing) {
                return NULL;
        }
 
@@ -733,7 +738,7 @@ struct files_struct *file_fsp_get(struct smbd_smb2_request *smb2req,
                return NULL;
        }
 
-       if (fsp->closing) {
+       if (fsp->fsp_flags.closing) {
                return NULL;
        }
 
@@ -747,7 +752,7 @@ struct files_struct *file_fsp_smb2(struct smbd_smb2_request *smb2req,
        struct files_struct *fsp;
 
        if (smb2req->compat_chain_fsp != NULL) {
-               if (smb2req->compat_chain_fsp->closing) {
+               if (smb2req->compat_chain_fsp->fsp_flags.closing) {
                        return NULL;
                }
                return smb2req->compat_chain_fsp;
@@ -793,9 +798,9 @@ NTSTATUS dup_file_fsp(
        to->fsp_flags.can_write =
                CAN_WRITE(from->conn) &&
                ((access_mask & (FILE_WRITE_DATA | FILE_APPEND_DATA)) != 0);
-       to->modified = from->modified;
-       to->is_directory = from->is_directory;
-       to->aio_write_behind = from->aio_write_behind;
+       to->fsp_flags.modified = from->fsp_flags.modified;
+       to->fsp_flags.is_directory = from->fsp_flags.is_directory;
+       to->fsp_flags.aio_write_behind = from->fsp_flags.aio_write_behind;
 
        return fsp_set_smb_fname(to, from->fsp_name);
 }