#include "includes.h"
#include "smbd/smbd.h"
#include "ntioctl.h"
+#include "source3/smbd/dir.h"
/*
Please read the VFS module Samba-HowTo-Collection.
while (True) {
struct dirent *d;
- d = SMB_VFS_NEXT_READDIR(handle, fsp, p, NULL);
+ d = SMB_VFS_NEXT_READDIR(handle, fsp, p);
if (d == NULL) {
break;
}
static struct dirent *shadow_copy_readdir(vfs_handle_struct *handle,
struct files_struct *dirfsp,
- DIR *_dirp,
- SMB_STRUCT_STAT *sbuf)
+ DIR *_dirp)
{
shadow_copy_Dir *dirp = (shadow_copy_Dir *)_dirp;
return NULL;
}
-static void shadow_copy_seekdir(struct vfs_handle_struct *handle, DIR *_dirp, long offset)
-{
- shadow_copy_Dir *dirp = (shadow_copy_Dir *)_dirp;
-
- if (offset < dirp->num) {
- dirp->pos = offset ;
- }
-}
-
-static long shadow_copy_telldir(struct vfs_handle_struct *handle, DIR *_dirp)
-{
- shadow_copy_Dir *dirp = (shadow_copy_Dir *)_dirp;
- return( dirp->pos ) ;
-}
-
static void shadow_copy_rewinddir(struct vfs_handle_struct *handle, DIR *_dirp)
{
shadow_copy_Dir *dirp = (shadow_copy_Dir *)_dirp;
struct smb_Dir *dir_hnd = NULL;
const char *dname = NULL;
char *talloced = NULL;
- long offset = 0;
NTSTATUS status;
struct smb_filename *smb_fname = synthetic_smb_fname(talloc_tos(),
fsp->conn->connectpath,
return -1;
}
- status = OpenDir_ntstatus(talloc_tos(),
- handle->conn,
- smb_fname,
- NULL,
- 0,
- &dir_hnd);
+ status = OpenDir(talloc_tos(),
+ handle->conn,
+ smb_fname,
+ NULL,
+ 0,
+ &dir_hnd);
TALLOC_FREE(smb_fname);
if (!NT_STATUS_IS_OK(status)) {
DBG_ERR("OpenDir() failed for [%s]\n", fsp->conn->connectpath);
SHADOW_COPY_LABEL *tlabels;
int ret;
- dname = ReadDirName(dir_hnd, &offset, NULL, &talloced);
+ dname = ReadDirName(dir_hnd, &talloced);
if (dname == NULL) {
break;
}
static struct vfs_fn_pointers vfs_shadow_copy_fns = {
.fdopendir_fn = shadow_copy_fdopendir,
.readdir_fn = shadow_copy_readdir,
- .seekdir_fn = shadow_copy_seekdir,
- .telldir_fn = shadow_copy_telldir,
.rewind_dir_fn = shadow_copy_rewinddir,
.closedir_fn = shadow_copy_closedir,
.get_shadow_copy_data_fn = shadow_copy_get_shadow_copy_data,