X-Git-Url: http://git.samba.org/?a=blobdiff_plain;f=source3%2Fmodules%2Fvfs_streams_depot.c;h=9870d0d571b12b647db02562b00be4924903bd69;hb=HEAD;hp=107543f6bbce7dc9885ad2c52b467a5996d23463;hpb=a27bbfc8a961968976649aa4db71b37a0db98b38;p=samba.git diff --git a/source3/modules/vfs_streams_depot.c b/source3/modules/vfs_streams_depot.c index 107543f6bbc..1221b2c2be2 100644 --- a/source3/modules/vfs_streams_depot.c +++ b/source3/modules/vfs_streams_depot.c @@ -20,6 +20,7 @@ #include "includes.h" #include "smbd/smbd.h" #include "system/filesys.h" +#include "source3/smbd/dir.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_VFS @@ -214,7 +215,7 @@ static char *stream_dir(vfs_handle_struct *handle, 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))); @@ -466,7 +467,7 @@ static NTSTATUS stream_smb_fname(vfs_handle_struct *handle, 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; @@ -508,7 +509,6 @@ static NTSTATUS walk_streams(vfs_handle_struct *handle, 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; @@ -564,9 +564,7 @@ static NTSTATUS walk_streams(vfs_handle_struct *handle, 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; @@ -665,8 +663,7 @@ static int streams_depot_openat(struct vfs_handle_struct *handle, 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; @@ -679,14 +676,19 @@ static int streams_depot_openat(struct vfs_handle_struct *handle, 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( @@ -724,7 +726,7 @@ static int streams_depot_openat(struct vfs_handle_struct *handle, if (ret == -1) { DBG_DEBUG("FSETXATTR failed: %s\n", strerror(errno)); - return -1; + goto done; } } } @@ -740,8 +742,7 @@ static int streams_depot_openat(struct vfs_handle_struct *handle, fspcwd, smb_fname_stream, fsp, - flags, - mode); + how); done: TALLOC_FREE(smb_fname_stream);