}
fsp->fh->private_options = e->private_options;
- fsp->fh->gen_id = smbXsrv_open_hash(op);
fsp->file_id = file_id;
fsp->file_pid = smb1req->smbpid;
fsp->vuid = smb1req->vuid;
fsp->can_read = ((fsp->access_mask & (FILE_READ_DATA)) != 0);
fsp->can_write = ((fsp->access_mask & (FILE_WRITE_DATA|FILE_APPEND_DATA)) != 0);
fsp->fnum = op->local_id;
+ fsp_set_gen_id(fsp);
/*
* TODO:
return status;
}
+void fsp_set_gen_id(files_struct *fsp)
+{
+ static uint64_t gen_id = 1;
+
+ /*
+ * A billion of 64-bit increments per second gives us
+ * more than 500 years of runtime without wrap.
+ */
+ fsp->fh->gen_id = gen_id++;
+}
+
/****************************************************************************
Find first available file slot.
****************************************************************************/
fsp->op = op;
op->compat = fsp;
fsp->fnum = op->local_id;
- fsp->fh->gen_id = smbXsrv_open_hash(op);
} else {
DEBUG(10, ("%s: req==NULL, INTERNAL_OPEN_ONLY, smbXsrv_open "
"allocated\n", __func__));
}
+ fsp_set_gen_id(fsp);
+
/*
* Create an smb_filename with "" for the base_name. There are very
* few NULL checks, so make sure it's initialized with something. to
NTSTATUS fsp_new(struct connection_struct *conn, TALLOC_CTX *mem_ctx,
files_struct **result);
+void fsp_set_gen_id(files_struct *fsp);
NTSTATUS file_new(struct smb_request *req, connection_struct *conn,
files_struct **result);
void file_close_conn(connection_struct *conn);