}
static struct dirent *skel_readdir(vfs_handle_struct *handle,
- DIR *dirp, SMB_STRUCT_STAT *sbuf)
+ struct files_struct *dirfsp,
+ DIR *dirp,
+ SMB_STRUCT_STAT *sbuf)
{
return NULL;
}
}
static struct dirent *skel_readdir(vfs_handle_struct *handle,
- DIR *dirp, SMB_STRUCT_STAT *sbuf)
+ struct files_struct *dirfsp,
+ DIR *dirp,
+ SMB_STRUCT_STAT *sbuf)
{
- return SMB_VFS_NEXT_READDIR(handle, dirp, sbuf);
+ return SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp, sbuf);
}
static void skel_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset)
* Version 44 - Add 'is_fsa' flag to struct files_struct.
* Version 44 - Add 'have_proc_fds' flag to struct connection_struct.
* Version 44 - Add 'have_proc_fds' flag to struct files_struct.
+ * Version 44 - Add dirfsp arg to SMB_VFS_READDIR()
*/
#define SMB_VFS_INTERFACE_VERSION 44
DIR *(*fdopendir_fn)(struct vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32_t attributes);
struct dirent *(*readdir_fn)(struct vfs_handle_struct *handle,
- DIR *dirp,
- SMB_STRUCT_STAT *sbuf);
+ struct files_struct *dirfsp,
+ DIR *dirp,
+ SMB_STRUCT_STAT *sbuf);
void (*seekdir_fn)(struct vfs_handle_struct *handle, DIR *dirp, long offset);
long (*telldir_fn)(struct vfs_handle_struct *handle, DIR *dirp);
void (*rewind_dir_fn)(struct vfs_handle_struct *handle, DIR *dirp);
const char *mask,
uint32_t attributes);
struct dirent *smb_vfs_call_readdir(struct vfs_handle_struct *handle,
- DIR *dirp,
- SMB_STRUCT_STAT *sbuf);
+ struct files_struct *dirfsp,
+ DIR *dirp,
+ SMB_STRUCT_STAT *sbuf);
void smb_vfs_call_seekdir(struct vfs_handle_struct *handle,
DIR *dirp, long offset);
long smb_vfs_call_telldir(struct vfs_handle_struct *handle,
DIR *vfs_not_implemented_fdopendir(vfs_handle_struct *handle, files_struct *fsp,
const char *mask, uint32_t attr);
struct dirent *vfs_not_implemented_readdir(vfs_handle_struct *handle,
- DIR *dirp, SMB_STRUCT_STAT *sbuf);
+ struct files_struct *dirfsp,
+ DIR *dirp,
+ SMB_STRUCT_STAT *sbuf);
void vfs_not_implemented_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset);
long vfs_not_implemented_telldir(vfs_handle_struct *handle, DIR *dirp);
void vfs_not_implemented_rewind_dir(vfs_handle_struct *handle, DIR *dirp);
#define SMB_VFS_NEXT_FDOPENDIR(handle, fsp, mask, attr) \
smb_vfs_call_fdopendir((handle)->next, (fsp), (mask), (attr))
-#define SMB_VFS_READDIR(conn, dirp, sbuf) \
- smb_vfs_call_readdir((conn)->vfs_handles, (dirp), (sbuf))
-#define SMB_VFS_NEXT_READDIR(handle, dirp, sbuf) \
- smb_vfs_call_readdir((handle)->next, (dirp), (sbuf))
+#define SMB_VFS_READDIR(conn, dirfsp, dirp, sbuf) \
+ smb_vfs_call_readdir((conn)->vfs_handles, (dirfsp), (dirp), (sbuf))
+#define SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp, sbuf) \
+ smb_vfs_call_readdir((handle)->next, (dirfsp), (dirp), (sbuf))
#define SMB_VFS_SEEKDIR(conn, dirp, offset) \
smb_vfs_call_seekdir((conn)->vfs_handles, (dirp), (offset))
}
static struct dirent *cap_readdir(vfs_handle_struct *handle,
- DIR *dirp,
- SMB_STRUCT_STAT *sbuf)
+ struct files_struct *dirfsp,
+ DIR *dirp,
+ SMB_STRUCT_STAT *sbuf)
{
struct dirent *result;
struct dirent *newdirent;
size_t newnamelen;
DEBUG(3,("cap: cap_readdir\n"));
- result = SMB_VFS_NEXT_READDIR(handle, dirp, NULL);
+ result = SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp, NULL);
if (!result) {
return NULL;
}
}
static struct dirent *cephwrap_readdir(struct vfs_handle_struct *handle,
+ struct files_struct *dirfsp,
DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{
static struct dirent *vfswrap_readdir(vfs_handle_struct *handle,
- DIR *dirp,
- SMB_STRUCT_STAT *sbuf)
+ struct files_struct *dirfsp,
+ DIR *dirp,
+ SMB_STRUCT_STAT *sbuf)
{
struct dirent *result;
return false;
}
- dp = SMB_VFS_NEXT_READDIR(handle, data->source_directory, NULL);
+ dp = SMB_VFS_NEXT_READDIR(handle,
+ data->fsp,
+ data->source_directory,
+ NULL);
if (dp == NULL) {
return false;
}
data->directory_list[total_count] = *dp;
total_count++;
- dp = SMB_VFS_NEXT_READDIR(handle, data->source_directory, NULL);
+ dp = SMB_VFS_NEXT_READDIR(handle,
+ data->fsp,
+ data->source_directory,
+ NULL);
} while (dp != NULL);
data->number_of_entries = total_count;
}
static struct dirent *dirsort_readdir(vfs_handle_struct *handle,
- DIR *dirp,
- SMB_STRUCT_STAT *sbuf)
+ struct files_struct *dirfsp,
+ DIR *dirp,
+ SMB_STRUCT_STAT *sbuf)
{
struct dirsort_privates *data = NULL;
struct timespec current_mtime;
}
static struct dirent *smb_full_audit_readdir(vfs_handle_struct *handle,
- DIR *dirp, SMB_STRUCT_STAT *sbuf)
+ struct files_struct *dirfsp,
+ DIR *dirp,
+ SMB_STRUCT_STAT *sbuf)
{
struct dirent *result;
- result = SMB_VFS_NEXT_READDIR(handle, dirp, sbuf);
+ result = SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp, sbuf);
/* This operation has no reasonable error condition
* (End of dir is also failure), so always succeed.
}
static struct dirent *vfs_gluster_readdir(struct vfs_handle_struct *handle,
- DIR *dirp, SMB_STRUCT_STAT *sbuf)
+ struct files_struct *dirfsp,
+ DIR *dirp,
+ SMB_STRUCT_STAT *sbuf)
{
static char direntbuf[512];
int ret;
* Failure: set errno, return NULL
*/
static struct dirent *mh_readdir(vfs_handle_struct *handle,
- DIR *dirp,
- SMB_STRUCT_STAT *sbuf)
+ struct files_struct *dirfsp,
+ DIR *dirp,
+ SMB_STRUCT_STAT *sbuf)
{
mh_dirinfo_struct* dirInfo = (mh_dirinfo_struct*)dirp;
struct dirent *d = NULL;
if (! dirInfo->isInMediaFiles)
{
- d = SMB_VFS_NEXT_READDIR(handle, dirInfo->dirstream, sbuf);
+ d = SMB_VFS_NEXT_READDIR(handle, dirfsp, dirInfo->dirstream, sbuf);
goto out;
}
bool isAppleDouble;
skip = False;
- d = SMB_VFS_NEXT_READDIR(handle, dirInfo->dirstream, sbuf);
+ d = SMB_VFS_NEXT_READDIR(handle, dirfsp, dirInfo->dirstream, sbuf);
if (d == NULL)
{
}
struct dirent *vfs_not_implemented_readdir(vfs_handle_struct *handle,
- DIR *dirp, SMB_STRUCT_STAT *sbuf)
+ struct files_struct *dirfsp,
+ DIR *dirp,
+ SMB_STRUCT_STAT *sbuf)
{
errno = ENOSYS;
return NULL;
while (True) {
struct dirent *d;
- d = SMB_VFS_NEXT_READDIR(handle, p, NULL);
+ d = SMB_VFS_NEXT_READDIR(handle, fsp, p, NULL);
if (d == NULL) {
break;
}
}
static struct dirent *shadow_copy_readdir(vfs_handle_struct *handle,
- DIR *_dirp,
- SMB_STRUCT_STAT *sbuf)
+ struct files_struct *dirfsp,
+ DIR *_dirp,
+ SMB_STRUCT_STAT *sbuf)
{
shadow_copy_Dir *dirp = (shadow_copy_Dir *)_dirp;
time(&(priv->snaps->fetch_time));
}
- while ((d = SMB_VFS_NEXT_READDIR(handle, p, NULL))) {
+ while ((d = SMB_VFS_NEXT_READDIR(handle, dirfsp, p, NULL))) {
char snapshot[GMT_NAME_LEN+1];
SHADOW_COPY_LABEL *tlabels;
}
static struct dirent *smb_time_audit_readdir(vfs_handle_struct *handle,
- DIR *dirp,
- SMB_STRUCT_STAT *sbuf)
+ struct files_struct *dirfsp,
+ DIR *dirp,
+ SMB_STRUCT_STAT *sbuf)
{
struct dirent *result;
struct timespec ts1,ts2;
double timediff;
clock_gettime_mono(&ts1);
- result = SMB_VFS_NEXT_READDIR(handle, dirp, sbuf);
+ result = SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp, sbuf);
clock_gettime_mono(&ts2);
timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
* Failure: set errno, return NULL
*/
static struct dirent *um_readdir(vfs_handle_struct *handle,
+ struct files_struct *dirfsp,
DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{
dirInfo->clientSubDirname));
if (!dirInfo->isInMediaFiles) {
- return SMB_VFS_NEXT_READDIR(handle, dirInfo->dirstream, sbuf);
+ return SMB_VFS_NEXT_READDIR(handle, dirfsp, dirInfo->dirstream, sbuf);
}
do {
uintmax_t number;
skip = false;
- d = SMB_VFS_NEXT_READDIR(handle, dirInfo->dirstream, sbuf);
+ d = SMB_VFS_NEXT_READDIR(handle, dirfsp, dirInfo->dirstream, sbuf);
if (d == NULL) {
break;
}
static struct dirent *widelinks_readdir(vfs_handle_struct *handle,
- DIR *dirp,
- SMB_STRUCT_STAT *sbuf)
+ struct files_struct *dirfsp,
+ DIR *dirp,
+ SMB_STRUCT_STAT *sbuf)
{
struct widelinks_config *config = NULL;
struct dirent *result;
return NULL);
result = SMB_VFS_NEXT_READDIR(handle,
- dirp,
- sbuf);
+ dirfsp,
+ dirp,
+ sbuf);
if (!config->active) {
/* Module not active. */
/* A real offset, seek to it. */
SeekDir(dir_hnd, *poffset);
- while ((n = vfs_readdirname(conn, dir_hnd->dir, sbuf, &talloced))) {
+ while ((n = vfs_readdirname(conn, dir_hnd->fsp, dir_hnd->dir, sbuf, &talloced))) {
/* Ignore . and .. - we've already returned them. */
if (*n == '.') {
if ((n[1] == '\0') || (n[1] == '.' && n[2] == '\0')) {
int vfs_fill_sparse(files_struct *fsp, off_t len);
int vfs_set_blocking(files_struct *fsp, bool set);
off_t vfs_transfer_file(files_struct *in, files_struct *out, off_t n);
-const char *vfs_readdirname(connection_struct *conn, void *p,
- SMB_STRUCT_STAT *sbuf, char **talloced);
+const char *vfs_readdirname(connection_struct *conn,
+ struct files_struct *dirfsp,
+ void *p,
+ SMB_STRUCT_STAT *sbuf,
+ char **talloced);
int vfs_ChDir(connection_struct *conn,
const struct smb_filename *smb_fname);
struct smb_filename *vfs_GetWd(TALLOC_CTX *ctx, connection_struct *conn);
A vfs_readdir wrapper which just returns the file name.
********************************************************************/
-const char *vfs_readdirname(connection_struct *conn, void *p,
- SMB_STRUCT_STAT *sbuf, char **talloced)
+const char *vfs_readdirname(connection_struct *conn,
+ struct files_struct *dirfsp,
+ void *p,
+ SMB_STRUCT_STAT *sbuf,
+ char **talloced)
{
struct dirent *ptr= NULL;
const char *dname;
if (!p)
return(NULL);
- ptr = SMB_VFS_READDIR(conn, (DIR *)p, sbuf);
+ ptr = SMB_VFS_READDIR(conn, dirfsp, (DIR *)p, sbuf);
if (!ptr)
return(NULL);
}
struct dirent *smb_vfs_call_readdir(struct vfs_handle_struct *handle,
- DIR *dirp,
- SMB_STRUCT_STAT *sbuf)
+ struct files_struct *dirfsp,
+ DIR *dirp,
+ SMB_STRUCT_STAT *sbuf)
{
VFS_FIND(readdir);
- return handle->fns->readdir_fn(handle, dirp, sbuf);
+ return handle->fns->readdir_fn(handle, dirfsp, dirp, sbuf);
}
void smb_vfs_call_seekdir(struct vfs_handle_struct *handle,