file was created or not.
****************************************************************************/
-static NTSTATUS fd_open_atomic(files_struct *fsp,
+static NTSTATUS fd_open_atomic(struct files_struct *dirfsp,
+ struct smb_filename *smb_fname,
+ files_struct *fsp,
int flags,
mode_t mode,
bool *file_created)
/*
* We're not creating the file, just pass through.
*/
- status = fd_openat(fsp->conn->cwd_fsp, fsp->fsp_name, fsp, flags, mode);
+ status = fd_openat(dirfsp, smb_fname, fsp, flags, mode);
*file_created = false;
return status;
}
/*
* Fail if already exists, just pass through.
*/
- status = fd_openat(fsp->conn->cwd_fsp, fsp->fsp_name, fsp, flags, mode);
+ status = fd_openat(dirfsp, smb_fname, fsp, flags, mode);
/*
* Here we've opened with O_CREAT|O_EXCL. If that went
retry_status = NT_STATUS_OBJECT_NAME_COLLISION;
}
- status = fd_openat(fsp->conn->cwd_fsp, fsp->fsp_name, fsp, curr_flags, mode);
+ status = fd_openat(dirfsp, smb_fname, fsp, curr_flags, mode);
if (NT_STATUS_IS_OK(status)) {
*file_created = !file_existed;
return NT_STATUS_OK;
curr_flags = flags | O_EXCL;
}
- status = fd_openat(fsp->conn->cwd_fsp, fsp->fsp_name, fsp, curr_flags, mode);
+ status = fd_openat(dirfsp, smb_fname, fsp, curr_flags, mode);
}
*file_created = (NT_STATUS_IS_OK(status) && !file_existed);
fsp->fsp_flags.is_pathref = false;
- status = fd_open_atomic(fsp,
- flags,
- mode,
- p_file_created);
+ status = fd_open_atomic(
+ fsp->conn->cwd_fsp,
+ fsp->fsp_name,
+ fsp,
+ flags,
+ mode,
+ p_file_created);
return status;
}