struct smb_request *smb1req,
struct smb_filename *smb_fname,
TALLOC_CTX *mem_ctx,
- files_struct **_fsp)
+ files_struct **_fsp,
+ int *info)
{
struct share_mode_lock *sharemode_lock;
struct share_mode_entry *e;
files_struct *fsp = NULL;
NTSTATUS status;
+ bool ok;
DEBUG(0, ("OBNOX - durable_reconnect enter: (%s:%s)\n", __location__, __FUNCTION__));
}
*/
- sharemode_lock->data->share_modes[0].pid =
- messaging_server_id(op->connection->sconn->msg_ctx);
- sharemode_lock->data->modified = true;
-
/*
* circumstances seems ok, do the open
*/
DEBUG(0, ("OBNOX - durable_reconnect: new fsp created (%s:%s)\n", __location__, __FUNCTION__));
+ fsp->fh->private_options = e->private_options;
fsp->file_id = op->global->backend_file_id;
fsp->initial_allocation_size = 0;//TODO
fsp->file_pid = smb1req->smbpid;
fsp->vuid = smb1req->vuid;//
- //fsp->open_time = 0;//from->open_time;
+ fsp->open_time = e->time;
fsp->access_mask = e->access_mask;
fsp->share_access = e->share_access;
- fsp->oplock_type = e->op_type;
fsp->can_lock = true;//from->can_lock;
fsp->can_read = (fsp->access_mask & (FILE_READ_DATA)) ? True : False;
if (!CAN_WRITE(conn)) {
fsp->is_directory = false;//from->is_directory;
fsp->aio_write_behind = false;//from->aio_write_behind;
+ ok = set_file_oplock(fsp, e->op_type);
+
+ sharemode_lock->data->modified = true;
+ e->pid = messaging_server_id(op->connection->sconn->msg_ctx);
+ e->op_mid = smb1req->mid;
+ e->share_file_id = fsp->fh->gen_id;
+
DEBUG(0, ("OBNOX - durable_reconnect: before open file (%s:%s)\n", __location__, __FUNCTION__));
+
fsp->fh->fd = SMB_VFS_OPEN(conn,
smb_fname,
fsp,
*
* ... think about seek()
*/
+
+ *info = FILE_WAS_OPENED;
return NT_STATUS_OK;
}
smb1req,
smb_fname,
mem_ctx,
- &result);
+ &result,
+ &info);
DEBUG(0, ("OBNOX - durable_reconnect result: %s (%s:%s)\n", nt_errstr(status), __location__, __FUNCTION__));