}
static NTSTATUS smb2_create_durable_reconnect(struct smbXsrv_open *op,
+ struct smb_request *smb1req,
TALLOC_CTX *mem_ctx,
files_struct **fsp)
{
struct share_mode_lock *sharemode_lock;
+ files_struct *fsp = NULL;
/* 1. check entry in locking.tdb */
messaging_server_id(op->connection->sconn->msg_ctx);
/*
- * - reopen the file with SMB_VFS_OPEN()
- * - build a files_struct
+ * is file_new() appropriate?
+ * or do we need a replacement for this special purpose?
*/
+ status = file_new(smb1req, smb1req->conn, &fsp);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ /* TODO */
+ fsp->fh->fd = SMB_VFS_OPEN(smb1req->conn, smb_fname, fsp, flags, mode);
+ if (fsp->fh->fd == -1) {
+ /* ... */
+ return ...;
+ }
/* - release the sharemode lock */
talloc_free(sharemode_lock);
}
// TODO: implement this function..
- status = smb2_create_durable_reconnect(op, mem_ctx, &result);
+ status = smb2_create_durable_reconnect(op, smb1req, mem_ctx, &result);
if (!NT_STATUS_IS_OK(status)) {
tevent_req_nterror(req, status);