#include "smbd/globals.h"
#include "../libcli/smb/smb_common.h"
#include "../librpc/gen_ndr/ndr_security.h"
+#include "libcli/security/security.h"
#include "../lib/util/tevent_ntstatus.h"
#include "messages.h"
#include "librpc/gen_ndr/open_files.h"
}
static NTSTATUS smb2_create_durable_reconnect(struct smbXsrv_open *op,
- /* struct smb_request *smb1req, */
struct connection_struct *conn,
+ struct smb_request *smb1req,
struct smb_filename *smb_fname,
TALLOC_CTX *mem_ctx,
files_struct **_fsp)
/*
* circumstances seems ok, do the open
*/
- status = new_durable_reconnect_fsp(op, conn, smb_fname, mem_ctx, &fsp);
+ status = new_durable_reconnect_fsp(op, conn, smb_fname, conn, &fsp);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
/* - release the sharemode lock: this writes the changes */
talloc_free(sharemode_lock);
+ fsp->file_id = op->global->backend_file_id;
+ fsp->initial_allocation_size = 0;//TODO
+ fsp->file_pid = 0;//smb1req->pid;
+ fsp->vuid = smb1req->vuid;//
+ //fsp->open_time = 0;//from->open_time;
+ fsp->access_mask = sharemode_lock->data->share_modes[0].access_mask;
+ fsp->share_access = sharemode_lock->data->share_modes[0].share_access;
+ //fsp->oplock_type = sharemode_lock->data->share_modes[0].oplock_type;
+ fsp->can_lock = true;//from->can_lock;
+ fsp->can_read = (fsp->access_mask & (FILE_READ_DATA)) ? True : False;
+ if (!CAN_WRITE(conn)) {
+ fsp->can_write = False;
+ } else {
+ fsp->can_write = (fsp->access_mask & (FILE_WRITE_DATA | FILE_APPEND_DATA)) ? True : False;
+ }
+ fsp->modified = false;//from->modified;
+ fsp->is_directory = false;//from->is_directory;
+ fsp->aio_write_behind = false;//from->aio_write_behind;
/* Q: do this in fsp creation? */
op->fsp = fsp;
if (do_durable_reconnect) {
status = smb2_create_durable_reconnect(op,
smb1req->conn,
+ smb1req,
smb_fname,
mem_ctx,
&result);