files_struct *fsp;
for (fsp=sconn->files; fsp; fsp=fsp->next,count++) {
- if (fsp->fh->fd == fd) {
+ if (fsp_get_pathref_fd(fsp) == fd) {
if (count > 10) {
DLIST_PROMOTE(sconn->files, fsp);
}
DLIST_PROMOTE(sconn->files, fsp);
}
/* Paranoia check. */
- if ((fsp->fh->fd == -1) &&
+ if ((fsp_get_pathref_fd(fsp) == -1) &&
(fsp->oplock_type != NO_OPLOCK &&
fsp->oplock_type != LEASE_OPLOCK)) {
struct file_id_buf idbuf;
reply_nterror(req, NT_STATUS_INVALID_DEVICE_REQUEST);
return False;
}
- if (fsp->fh->fd == -1) {
+ if (fsp_get_pathref_fd(fsp) == -1) {
reply_nterror(req, NT_STATUS_ACCESS_DENIED);
return False;
}
fsp->fh->private_options,
fsp->access_mask);
- if (fsp->fh->fd != -1 &&
+ if (fsp_get_pathref_fd(fsp) != -1 &&
fsp->vuid == req->vuid &&
fsp->file_pid == req->smbpid &&
(fsp->fh->private_options &
fsp->sent_oplock_break = NO_BREAK_SENT;
fsp->fsp_flags.is_directory = false;
- vfs->files[fsp->fh->fd] = fsp;
- printf("open: fd=%d\n", fsp->fh->fd);
+ vfs->files[fsp_get_pathref_fd(fsp)] = fsp;
+ printf("open: fd=%d\n", fsp_get_pathref_fd(fsp));
return NT_STATUS_OK;
}