#include "includes.h"
#include "smbd/smbd.h"
#include "system/filesys.h"
+#include "source3/smbd/dir.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_VFS
id = SMB_VFS_FILE_ID_CREATE(handle->conn, &base_sbuf_tmp);
- push_file_id_16((char *)id_buf, &id);
+ push_file_id_16(id_buf, &id);
hash = hash_fn(data_blob_const(id_buf, sizeof(id_buf)));
goto fail;
}
} else {
- /* Normalize the stream type to upercase. */
+ /* Normalize the stream type to uppercase. */
if (!strupper_m(strrchr_m(stream_fname, ':') + 1)) {
status = NT_STATUS_INVALID_PARAMETER;
goto fail;
struct smb_filename *dir_smb_fname = NULL;
struct smb_Dir *dir_hnd = NULL;
const char *dname = NULL;
- long offset = 0;
char *talloced = NULL;
NTSTATUS status;
return status;
}
- while ((dname = ReadDirName(dir_hnd, &offset, NULL, &talloced))
- != NULL)
- {
+ while ((dname = ReadDirName(dir_hnd, &talloced)) != NULL) {
if (ISDOT(dname) || ISDOTDOT(dname)) {
TALLOC_FREE(talloced);
continue;
const struct files_struct *dirfsp,
const struct smb_filename *smb_fname,
struct files_struct *fsp,
- int flags,
- mode_t mode)
+ const struct vfs_open_how *how)
{
struct smb_filename *smb_fname_stream = NULL;
struct files_struct *fspcwd = NULL;
dirfsp,
smb_fname,
fsp,
- flags,
- mode);
+ how);
+ }
+
+ if (how->resolve != 0) {
+ errno = ENOSYS;
+ return -1;
}
SMB_ASSERT(fsp_is_alternate_stream(fsp));
+ SMB_ASSERT(dirfsp == NULL);
SMB_ASSERT(VALID_STAT(fsp->base_fsp->fsp_name->st));
- create_it = (mode & O_CREAT);
+ create_it = (how->flags & O_CREAT);
/* Determine the stream name, and then open it. */
status = stream_smb_fname(
if (ret == -1) {
DBG_DEBUG("FSETXATTR failed: %s\n",
strerror(errno));
- return -1;
+ goto done;
}
}
}
fspcwd,
smb_fname_stream,
fsp,
- flags,
- mode);
+ how);
done:
TALLOC_FREE(smb_fname_stream);