return NT_STATUS_NOT_IMPLEMENTED;
}
-static SMB_STRUCT_DIR *skel_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
+static DIR *skel_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
{
return NULL;
}
-static SMB_STRUCT_DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32 attr)
+static DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32 attr)
{
return NULL;
}
static struct dirent *skel_readdir(vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp,
+ DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{
return NULL;
}
-static void skel_seekdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp, long offset)
+static void skel_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset)
{
;
}
-static long skel_telldir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
+static long skel_telldir(vfs_handle_struct *handle, DIR *dirp)
{
return (long)-1;
}
-static void skel_rewind_dir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
+static void skel_rewind_dir(vfs_handle_struct *handle, DIR *dirp)
{
;
}
return -1;
}
-static int skel_closedir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dir)
+static int skel_closedir(vfs_handle_struct *handle, DIR *dir)
{
errno = ENOSYS;
return -1;
}
-static void skel_init_search_op(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
+static void skel_init_search_op(struct vfs_handle_struct *handle, DIR *dirp)
{
;
}
return SMB_VFS_NEXT_GET_DFS_REFERRALS(handle, r);
}
-static SMB_STRUCT_DIR *skel_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
+static DIR *skel_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
{
return SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr);
}
-static SMB_STRUCT_DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32 attr)
+static DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32 attr)
{
return SMB_VFS_NEXT_FDOPENDIR(handle, fsp, mask, attr);
}
static struct dirent *skel_readdir(vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp,
+ DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{
return SMB_VFS_NEXT_READDIR(handle, dirp, sbuf);
}
-static void skel_seekdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp, long offset)
+static void skel_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset)
{
SMB_VFS_NEXT_SEEKDIR(handle, dirp, offset);
}
-static long skel_telldir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
+static long skel_telldir(vfs_handle_struct *handle, DIR *dirp)
{
return SMB_VFS_NEXT_TELLDIR(handle, dirp);
}
-static void skel_rewind_dir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
+static void skel_rewind_dir(vfs_handle_struct *handle, DIR *dirp)
{
SMB_VFS_NEXT_REWINDDIR(handle, dirp);
}
return SMB_VFS_NEXT_RMDIR(handle, path);
}
-static int skel_closedir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dir)
+static int skel_closedir(vfs_handle_struct *handle, DIR *dir)
{
return SMB_VFS_NEXT_CLOSEDIR(handle, dir);
}
-static void skel_init_search_op(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
+static void skel_init_search_op(struct vfs_handle_struct *handle, DIR *dirp)
{
SMB_VFS_NEXT_INIT_SEARCH_OP(handle, dirp);
}
const char ***ext_list,
size_t *ext_list_len)
{
- SMB_STRUCT_DIR *dir = NULL;
+ DIR *dir = NULL;
struct dirent *dirent = NULL;
dir = opendir(modules_path(talloc_tos(),
static int file_find(struct file_list **list, const char *directory,
const char *expression, bool match)
{
- SMB_STRUCT_DIR *dir;
+ DIR *dir;
struct file_list *entry;
struct stat statbuf;
int ret;
typedef struct stat_ex SMB_STRUCT_STAT;
-/*
- * Type for DIR structure.
- */
-
-#ifndef SMB_STRUCT_DIR
-# define SMB_STRUCT_DIR DIR
-#endif
-
/*
* Defines for 64 bit fcntl locks.
*/
int sys_posix_fallocate(int fd, SMB_OFF_T offset, SMB_OFF_T len);
int sys_fallocate(int fd, enum vfs_fallocate_mode mode, SMB_OFF_T offset, SMB_OFF_T len);
void kernel_flock(int fd, uint32 share_mode, uint32 access_mask);
-SMB_STRUCT_DIR *sys_fdopendir(int fd);
+DIR *sys_fdopendir(int fd);
int sys_mknod(const char *path, mode_t mode, SMB_DEV_T dev);
int sys_waitpid(pid_t pid,int *status,int options);
char *sys_getwd(void);
gid_t nametogid(const char *name);
void smb_panic_s3(const char *why);
void log_stack_trace(void);
-const char *readdirname(SMB_STRUCT_DIR *p);
+const char *readdirname(DIR *p);
bool is_in_path(const char *name, name_compare_entry *namelist, bool case_sensitive);
void set_namearray(name_compare_entry **ppname_array, const char *namelist);
void free_namearray(name_compare_entry *name_array);
/* Directory operations */
- SMB_STRUCT_DIR *(*opendir_fn)(struct vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attributes);
- SMB_STRUCT_DIR *(*fdopendir_fn)(struct vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32 attributes);
+ DIR *(*opendir_fn)(struct vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attributes);
+ DIR *(*fdopendir_fn)(struct vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32 attributes);
struct dirent *(*readdir_fn)(struct vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp,
+ DIR *dirp,
SMB_STRUCT_STAT *sbuf);
- void (*seekdir_fn)(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp, long offset);
- long (*telldir_fn)(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp);
- void (*rewind_dir_fn)(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp);
+ 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);
int (*mkdir_fn)(struct vfs_handle_struct *handle, const char *path, mode_t mode);
int (*rmdir_fn)(struct vfs_handle_struct *handle, const char *path);
- int (*closedir_fn)(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dir);
- void (*init_search_op_fn)(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp);
+ int (*closedir_fn)(struct vfs_handle_struct *handle, DIR *dir);
+ void (*init_search_op_fn)(struct vfs_handle_struct *handle, DIR *dirp);
/* File operations */
*/
NTSTATUS smb_vfs_call_get_dfs_referrals(struct vfs_handle_struct *handle,
struct dfs_GetDFSReferral *r);
-SMB_STRUCT_DIR *smb_vfs_call_opendir(struct vfs_handle_struct *handle,
+DIR *smb_vfs_call_opendir(struct vfs_handle_struct *handle,
const char *fname, const char *mask,
uint32 attributes);
-SMB_STRUCT_DIR *smb_vfs_call_fdopendir(struct vfs_handle_struct *handle,
+DIR *smb_vfs_call_fdopendir(struct vfs_handle_struct *handle,
struct files_struct *fsp,
const char *mask,
uint32 attributes);
struct dirent *smb_vfs_call_readdir(struct vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp,
+ DIR *dirp,
SMB_STRUCT_STAT *sbuf);
void smb_vfs_call_seekdir(struct vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp, long offset);
+ DIR *dirp, long offset);
long smb_vfs_call_telldir(struct vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp);
+ DIR *dirp);
void smb_vfs_call_rewind_dir(struct vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp);
+ DIR *dirp);
int smb_vfs_call_mkdir(struct vfs_handle_struct *handle, const char *path,
mode_t mode);
int smb_vfs_call_rmdir(struct vfs_handle_struct *handle, const char *path);
int smb_vfs_call_closedir(struct vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dir);
+ DIR *dir);
void smb_vfs_call_init_search_op(struct vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp);
+ DIR *dirp);
int smb_vfs_call_open(struct vfs_handle_struct *handle,
struct smb_filename *smb_fname, struct files_struct *fsp,
int flags, mode_t mode);
calling code.. JRA.
********************************************************************/
-SMB_STRUCT_DIR *sys_fdopendir(int fd)
+DIR *sys_fdopendir(int fd)
{
#if defined(HAVE_FDOPENDIR) && defined(HAVE_DIRFD)
return fdopendir(fd);
A readdir wrapper which just returns the file name.
********************************************************************/
-const char *readdirname(SMB_STRUCT_DIR *p)
+const char *readdirname(DIR *p)
{
struct dirent *ptr;
char *dname;
/*
* vfs interface handlers
*/
-SMB_STRUCT_DIR *onefs_opendir(struct vfs_handle_struct *handle,
+DIR *onefs_opendir(struct vfs_handle_struct *handle,
const char *fname, const char *mask,
uint32 attributes);
struct dirent *onefs_readdir(struct vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp, SMB_STRUCT_STAT *sbuf);
+ DIR *dirp, SMB_STRUCT_STAT *sbuf);
-void onefs_seekdir(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp,
+void onefs_seekdir(struct vfs_handle_struct *handle, DIR *dirp,
long offset);
-long onefs_telldir(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp);
+long onefs_telldir(struct vfs_handle_struct *handle, DIR *dirp);
-void onefs_rewinddir(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp);
+void onefs_rewinddir(struct vfs_handle_struct *handle, DIR *dirp);
-int onefs_closedir(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dir);
+int onefs_closedir(struct vfs_handle_struct *handle, DIR *dir);
void onefs_init_search_op(struct vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp);
+ DIR *dirp);
NTSTATUS onefs_create_file(vfs_handle_struct *handle,
struct smb_request *req,
const struct smb_filename *smb_fname_in,
struct smb_filename **smb_fname_out);
-int onefs_rdp_add_dir_state(connection_struct *conn, SMB_STRUCT_DIR *dirp);
+int onefs_rdp_add_dir_state(connection_struct *conn, DIR *dirp);
/*
* System Interfaces
struct rdp_dir_state {
struct rdp_dir_state *next, *prev;
- SMB_STRUCT_DIR *dirp;
+ DIR *dirp;
char *direntries_cursor; /* cursor to last returned direntry in cache */
size_t stat_count; /* number of entries stored in the cache */
size_t stat_cursor; /* cursor to last returned stat in the cache */
static struct rdp_dir_state *dirstatelist = NULL;
-SMB_STRUCT_DIR *rdp_last_dirp = NULL;
+DIR *rdp_last_dirp = NULL;
/**
* Given a DIR pointer, return our internal state.
* @return 0 on success, 1 on failure
*/
static int
-rdp_retrieve_dir_state(SMB_STRUCT_DIR *dirp, struct rdp_dir_state **dir_state,
+rdp_retrieve_dir_state(DIR *dirp, struct rdp_dir_state **dir_state,
bool *same_as_last)
{
struct rdp_dir_state *dsp;
* call to VFS_CLOSEDIR().
*/
int
-onefs_rdp_add_dir_state(connection_struct *conn, SMB_STRUCT_DIR *dirp)
+onefs_rdp_add_dir_state(connection_struct *conn, DIR *dirp)
{
int ret = 0;
struct rdp_dir_state *dsp = NULL;
return ret;
}
- /* Set the SMB_STRUCT_DIR in the dsp */
+ /* Set the DIR in the dsp */
dsp->dirp = dirp;
DLIST_ADD(dirstatelist, dsp);
*
* @return DIR pointer, NULL if directory does not exist, NULL on error
*/
-SMB_STRUCT_DIR *
+DIR *
onefs_opendir(vfs_handle_struct *handle, const char *fname, const char *mask,
uint32 attr)
{
int ret = 0;
- SMB_STRUCT_DIR *ret_dirp;
+ DIR *ret_dirp;
/* Fallback to default system routines if readdirplus is disabled */
if (!lp_parm_bool(SNUM(handle->conn), PARM_ONEFS_TYPE,
* @return dirent structure, NULL if at the end of the directory, NULL on error
*/
struct dirent *
-onefs_readdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp,
+onefs_readdir(vfs_handle_struct *handle, DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{
struct rdp_dir_state *dsp = NULL;
ret = rdp_retrieve_dir_state(dirp, &dsp, &same_as_last);
if (ret) {
DEBUG(1, ("Could not retrieve dir_state struct for "
- "SMB_STRUCT_DIR pointer.\n"));
+ "DIR pointer.\n"));
ret_direntp = NULL;
goto end;
}
* @return no return value
*/
void
-onefs_seekdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp, long offset)
+onefs_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset)
{
struct rdp_dir_state *dsp = NULL;
bool same_as_last;
ret = rdp_retrieve_dir_state(dirp, &dsp, &same_as_last);
if (ret) {
DEBUG(1, ("Could not retrieve dir_state struct for "
- "SMB_STRUCT_DIR pointer.\n"));
+ "DIR pointer.\n"));
/* XXX: we can't return an error, should we ABORT rather than
* return without actually seeking? */
return;
* @return offset into the directory to resume reading from
*/
long
-onefs_telldir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
+onefs_telldir(vfs_handle_struct *handle, DIR *dirp)
{
struct rdp_dir_state *dsp = NULL;
bool same_as_last;
ret = rdp_retrieve_dir_state(dirp, &dsp, &same_as_last);
if (ret) {
DEBUG(1, ("Could not retrieve dir_state struct for "
- "SMB_STRUCT_DIR pointer.\n"));
+ "DIR pointer.\n"));
return -1;
}
* @return no return value
*/
void
-onefs_rewinddir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
+onefs_rewinddir(vfs_handle_struct *handle, DIR *dirp)
{
struct rdp_dir_state *dsp = NULL;
bool same_as_last;
ret = rdp_retrieve_dir_state(dirp, &dsp, &same_as_last);
if (ret) {
DEBUG(1, ("Could not retrieve dir_state struct for "
- "SMB_STRUCT_DIR pointer.\n"));
+ "DIR pointer.\n"));
return;
}
* @return -1 on failure, setting errno
*/
int
-onefs_closedir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
+onefs_closedir(vfs_handle_struct *handle, DIR *dirp)
{
struct rdp_dir_state *dsp = NULL;
bool same_as_last;
ret = rdp_retrieve_dir_state(dirp, &dsp, &same_as_last);
if (ret) {
DEBUG(1, ("Could not retrieve dir_state struct for "
- "SMB_STRUCT_DIR pointer.\n"));
+ "DIR pointer.\n"));
errno = ENOENT;
return -1;
}
* @return nothing
*/
void
-onefs_init_search_op(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
+onefs_init_search_op(vfs_handle_struct *handle, DIR *dirp)
{
/* Setting the rdp_last_dirp to NULL will cause the next readdir
* operation to refill the cache. */
int dir_fd = -1;
int stream_fd = -1;
int ret;
- SMB_STRUCT_DIR *dirp = NULL;
+ DIR *dirp = NULL;
struct dirent *dp = NULL;
files_struct fake_fs;
struct fd_handle fake_fh;
return;
}
-static SMB_STRUCT_DIR *audit_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
+static DIR *audit_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
{
- SMB_STRUCT_DIR *result;
+ DIR *result;
result = SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr);
dfree, dsize);
}
-static SMB_STRUCT_DIR *cap_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
+static DIR *cap_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
{
char *capname = capencode(talloc_tos(), fname);
}
static struct dirent *cap_readdir(vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp,
+ DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{
struct dirent *result;
return NT_STATUS_OK;
}
-static SMB_STRUCT_DIR *catia_opendir(vfs_handle_struct *handle,
+static DIR *catia_opendir(vfs_handle_struct *handle,
const char *fname,
const char *mask,
uint32 attr)
{
char *name_mapped = NULL;
NTSTATUS status;
- SMB_STRUCT_DIR *ret;
+ DIR *ret;
status = catia_string_replace_allocate(handle->conn, fname,
&name_mapped, vfs_translate_to_unix);
/* Directory operations */
-static SMB_STRUCT_DIR *vfswrap_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
+static DIR *vfswrap_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
{
- SMB_STRUCT_DIR *result;
+ DIR *result;
START_PROFILE(syscall_opendir);
result = opendir(fname);
return result;
}
-static SMB_STRUCT_DIR *vfswrap_fdopendir(vfs_handle_struct *handle,
+static DIR *vfswrap_fdopendir(vfs_handle_struct *handle,
files_struct *fsp,
const char *mask,
uint32 attr)
{
- SMB_STRUCT_DIR *result;
+ DIR *result;
START_PROFILE(syscall_fdopendir);
result = sys_fdopendir(fsp->fh->fd);
static struct dirent *vfswrap_readdir(vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp,
+ DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{
struct dirent *result;
return result;
}
-static void vfswrap_seekdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp, long offset)
+static void vfswrap_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset)
{
START_PROFILE(syscall_seekdir);
seekdir(dirp, offset);
END_PROFILE(syscall_seekdir);
}
-static long vfswrap_telldir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
+static long vfswrap_telldir(vfs_handle_struct *handle, DIR *dirp)
{
long result;
START_PROFILE(syscall_telldir);
return result;
}
-static void vfswrap_rewinddir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
+static void vfswrap_rewinddir(vfs_handle_struct *handle, DIR *dirp)
{
START_PROFILE(syscall_rewinddir);
rewinddir(dirp);
return result;
}
-static int vfswrap_closedir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
+static int vfswrap_closedir(vfs_handle_struct *handle, DIR *dirp)
{
int result;
}
static void vfswrap_init_search_op(vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp)
+ DIR *dirp)
{
/* Default behavior is a NOOP */
}
struct dirent *directory_list;
long number_of_entries;
time_t mtime;
- SMB_STRUCT_DIR *source_directory;
+ DIR *source_directory;
int fd;
};
return true;
}
-static SMB_STRUCT_DIR *dirsort_opendir(vfs_handle_struct *handle,
+static DIR *dirsort_opendir(vfs_handle_struct *handle,
const char *fname, const char *mask,
uint32 attr)
{
return data->source_directory;
}
-static SMB_STRUCT_DIR *dirsort_fdopendir(vfs_handle_struct *handle,
+static DIR *dirsort_fdopendir(vfs_handle_struct *handle,
files_struct *fsp,
const char *mask,
uint32 attr)
}
static struct dirent *dirsort_readdir(vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp,
+ DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{
struct dirsort_privates *data = NULL;
return &data->directory_list[data->pos++];
}
-static void dirsort_seekdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp,
+static void dirsort_seekdir(vfs_handle_struct *handle, DIR *dirp,
long offset)
{
struct dirsort_privates *data = NULL;
data->pos = offset;
}
-static long dirsort_telldir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
+static long dirsort_telldir(vfs_handle_struct *handle, DIR *dirp)
{
struct dirsort_privates *data = NULL;
SMB_VFS_HANDLE_GET_DATA(handle, data, struct dirsort_privates,
return data->pos;
}
-static void dirsort_rewinddir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
+static void dirsort_rewinddir(vfs_handle_struct *handle, DIR *dirp)
{
struct dirsort_privates *data = NULL;
SMB_VFS_HANDLE_GET_DATA(handle, data, struct dirsort_privates, return);
return;
}
-static SMB_STRUCT_DIR *audit_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
+static DIR *audit_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
{
- SMB_STRUCT_DIR *result;
+ DIR *result;
result = SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr);
return result;
}
-static SMB_STRUCT_DIR *smb_full_audit_opendir(vfs_handle_struct *handle,
+static DIR *smb_full_audit_opendir(vfs_handle_struct *handle,
const char *fname, const char *mask, uint32 attr)
{
- SMB_STRUCT_DIR *result;
+ DIR *result;
result = SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr);
return result;
}
-static SMB_STRUCT_DIR *smb_full_audit_fdopendir(vfs_handle_struct *handle,
+static DIR *smb_full_audit_fdopendir(vfs_handle_struct *handle,
files_struct *fsp, const char *mask, uint32 attr)
{
- SMB_STRUCT_DIR *result;
+ DIR *result;
result = SMB_VFS_NEXT_FDOPENDIR(handle, fsp, mask, attr);
}
static struct dirent *smb_full_audit_readdir(vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp, SMB_STRUCT_STAT *sbuf)
+ DIR *dirp, SMB_STRUCT_STAT *sbuf)
{
struct dirent *result;
}
static void smb_full_audit_seekdir(vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp, long offset)
+ DIR *dirp, long offset)
{
SMB_VFS_NEXT_SEEKDIR(handle, dirp, offset);
}
static long smb_full_audit_telldir(vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp)
+ DIR *dirp)
{
long result;
}
static void smb_full_audit_rewinddir(vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp)
+ DIR *dirp)
{
SMB_VFS_NEXT_REWINDDIR(handle, dirp);
}
static int smb_full_audit_closedir(vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp)
+ DIR *dirp)
{
int result;
}
static void smb_full_audit_init_search_op(vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp)
+ DIR *dirp)
{
SMB_VFS_NEXT_INIT_SEARCH_OP(handle, dirp);
{
char *dpath;
struct dirent *dent = 0;
- SMB_STRUCT_DIR *dir;
+ DIR *dir;
if (!path) return;
/* Directory operations */
-static SMB_STRUCT_DIR *atalk_opendir(struct vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
+static DIR *atalk_opendir(struct vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
{
- SMB_STRUCT_DIR *ret = 0;
+ DIR *ret = 0;
ret = SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr);
return ret;
}
-static SMB_STRUCT_DIR *atalk_fdopendir(struct vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32 attr)
+static DIR *atalk_fdopendir(struct vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32 attr)
{
- SMB_STRUCT_DIR *ret = 0;
+ DIR *ret = 0;
ret = SMB_VFS_NEXT_FDOPENDIR(handle, fsp, mask, attr);
int);
}
-static SMB_STRUCT_DIR *
+static DIR *
onefs_shadow_copy_opendir(vfs_handle_struct *handle, const char *path,
const char *mask, uint32_t attr)
{
SHADOW_NEXT(OPENDIR,
(handle, cpath ?: path, mask, attr),
- SMB_STRUCT_DIR *);
+ DIR *);
}
static int
char *base;
int recheck_tries_done; /* if 0 the directory listing has not yet
been checked for files that need to be scanned. */
- SMB_STRUCT_DIR *DIR;
+ DIR *DIR;
};
#define SCANNEDONLY_DEBUG 9
/*********************/
/* VFS functions */
/*********************/
-static SMB_STRUCT_DIR *scannedonly_opendir(vfs_handle_struct * handle,
+static DIR *scannedonly_opendir(vfs_handle_struct * handle,
const char *fname,
const char *mask, uint32 attr)
{
- SMB_STRUCT_DIR *DIRp;
+ DIR *DIRp;
struct scannedonly_DIR *sDIR;
DIRp = SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr);
("scannedonly_opendir, fname=%s, base=%s\n",fname,sDIR->base));
sDIR->DIR = DIRp;
sDIR->recheck_tries_done = 0;
- return (SMB_STRUCT_DIR *) sDIR;
+ return (DIR *) sDIR;
}
-static SMB_STRUCT_DIR *scannedonly_fdopendir(vfs_handle_struct * handle,
+static DIR *scannedonly_fdopendir(vfs_handle_struct * handle,
files_struct *fsp,
const char *mask, uint32 attr)
{
- SMB_STRUCT_DIR *DIRp;
+ DIR *DIRp;
struct scannedonly_DIR *sDIR;
const char *fname;
("scannedonly_fdopendir, fname=%s, base=%s\n",fname,sDIR->base));
sDIR->DIR = DIRp;
sDIR->recheck_tries_done = 0;
- return (SMB_STRUCT_DIR *) sDIR;
+ return (DIR *) sDIR;
}
static struct dirent *scannedonly_readdir(vfs_handle_struct *handle,
- SMB_STRUCT_DIR * dirp,
+ DIR * dirp,
SMB_STRUCT_STAT *sbuf)
{
struct dirent *result;
}
static void scannedonly_seekdir(struct vfs_handle_struct *handle,
- SMB_STRUCT_DIR * dirp, long offset)
+ DIR * dirp, long offset)
{
struct scannedonly_DIR *sDIR = (struct scannedonly_DIR *)dirp;
SMB_VFS_NEXT_SEEKDIR(handle, sDIR->DIR, offset);
}
static long scannedonly_telldir(struct vfs_handle_struct *handle,
- SMB_STRUCT_DIR * dirp)
+ DIR * dirp)
{
struct scannedonly_DIR *sDIR = (struct scannedonly_DIR *)dirp;
return SMB_VFS_NEXT_TELLDIR(handle, sDIR->DIR);
}
static void scannedonly_rewinddir(struct vfs_handle_struct *handle,
- SMB_STRUCT_DIR * dirp)
+ DIR * dirp)
{
struct scannedonly_DIR *sDIR = (struct scannedonly_DIR *)dirp;
SMB_VFS_NEXT_REWINDDIR(handle, sDIR->DIR);
}
static int scannedonly_closedir(vfs_handle_struct * handle,
- SMB_STRUCT_DIR * dirp)
+ DIR * dirp)
{
int retval;
struct scannedonly_DIR *sDIR = (struct scannedonly_DIR *)dirp;
return False;
}
-static SMB_STRUCT_DIR *shadow_copy_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
+static DIR *shadow_copy_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
{
shadow_copy_Dir *dirp;
- SMB_STRUCT_DIR *p = SMB_VFS_NEXT_OPENDIR(handle,fname,mask,attr);
+ DIR *p = SMB_VFS_NEXT_OPENDIR(handle,fname,mask,attr);
if (!p) {
DEBUG(0,("shadow_copy_opendir: SMB_VFS_NEXT_OPENDIR() failed for [%s]\n",fname));
}
SMB_VFS_NEXT_CLOSEDIR(handle,p);
- return((SMB_STRUCT_DIR *)dirp);
+ return((DIR *)dirp);
}
-static SMB_STRUCT_DIR *shadow_copy_fdopendir(vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32 attr)
+static DIR *shadow_copy_fdopendir(vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32 attr)
{
shadow_copy_Dir *dirp;
- SMB_STRUCT_DIR *p = SMB_VFS_NEXT_FDOPENDIR(handle,fsp,mask,attr);
+ DIR *p = SMB_VFS_NEXT_FDOPENDIR(handle,fsp,mask,attr);
if (!p) {
DEBUG(10,("shadow_copy_opendir: SMB_VFS_NEXT_FDOPENDIR() failed for [%s]\n",
SMB_VFS_NEXT_CLOSEDIR(handle,p);
/* We have now closed the fd in fsp. */
fsp->fh->fd = -1;
- return((SMB_STRUCT_DIR *)dirp);
+ return((DIR *)dirp);
}
static struct dirent *shadow_copy_readdir(vfs_handle_struct *handle,
- SMB_STRUCT_DIR *_dirp,
+ DIR *_dirp,
SMB_STRUCT_STAT *sbuf)
{
shadow_copy_Dir *dirp = (shadow_copy_Dir *)_dirp;
return NULL;
}
-static void shadow_copy_seekdir(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *_dirp, long offset)
+static void shadow_copy_seekdir(struct vfs_handle_struct *handle, DIR *_dirp, long offset)
{
shadow_copy_Dir *dirp = (shadow_copy_Dir *)_dirp;
}
}
-static long shadow_copy_telldir(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *_dirp)
+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, SMB_STRUCT_DIR *_dirp)
+static void shadow_copy_rewinddir(struct vfs_handle_struct *handle, DIR *_dirp)
{
shadow_copy_Dir *dirp = (shadow_copy_Dir *)_dirp;
dirp->pos = 0 ;
}
-static int shadow_copy_closedir(vfs_handle_struct *handle, SMB_STRUCT_DIR *_dirp)
+static int shadow_copy_closedir(vfs_handle_struct *handle, DIR *_dirp)
{
shadow_copy_Dir *dirp = (shadow_copy_Dir *)_dirp;
struct shadow_copy_data *shadow_copy_data,
bool labels)
{
- SMB_STRUCT_DIR *p = SMB_VFS_NEXT_OPENDIR(handle,fsp->conn->connectpath,NULL,0);
+ DIR *p = SMB_VFS_NEXT_OPENDIR(handle,fsp->conn->connectpath,NULL,0);
shadow_copy_data->num_volumes = 0;
shadow_copy_data->labels = NULL;
}
}
-static SMB_STRUCT_DIR *shadow_copy2_opendir(vfs_handle_struct *handle,
+static DIR *shadow_copy2_opendir(vfs_handle_struct *handle,
const char *fname,
const char *mask,
uint32 attr)
{
time_t timestamp;
char *stripped;
- SMB_STRUCT_DIR *ret;
+ DIR *ret;
int saved_errno;
char *conv;
struct shadow_copy_data *shadow_copy2_data,
bool labels)
{
- SMB_STRUCT_DIR *p;
+ DIR *p;
const char *snapdir;
struct dirent *d;
TALLOC_CTX *tmp_ctx = talloc_stackframe();
void *private_data)
{
char *dirname;
- SMB_STRUCT_DIR *dirhandle = NULL;
+ DIR *dirhandle = NULL;
const char *dirent = NULL;
char *talloced = NULL;
return result;
}
-static SMB_STRUCT_DIR *smb_time_audit_opendir(vfs_handle_struct *handle,
+static DIR *smb_time_audit_opendir(vfs_handle_struct *handle,
const char *fname,
const char *mask, uint32 attr)
{
- SMB_STRUCT_DIR *result;
+ DIR *result;
struct timespec ts1,ts2;
double timediff;
return result;
}
-static SMB_STRUCT_DIR *smb_time_audit_fdopendir(vfs_handle_struct *handle,
+static DIR *smb_time_audit_fdopendir(vfs_handle_struct *handle,
files_struct *fsp,
const char *mask, uint32 attr)
{
- SMB_STRUCT_DIR *result;
+ DIR *result;
struct timespec ts1,ts2;
double timediff;
}
static struct dirent *smb_time_audit_readdir(vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp,
+ DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{
struct dirent *result;
}
static void smb_time_audit_seekdir(vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp, long offset)
+ DIR *dirp, long offset)
{
struct timespec ts1,ts2;
double timediff;
}
static long smb_time_audit_telldir(vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp)
+ DIR *dirp)
{
long result;
struct timespec ts1,ts2;
}
static void smb_time_audit_rewinddir(vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp)
+ DIR *dirp)
{
struct timespec ts1,ts2;
double timediff;
}
static int smb_time_audit_closedir(vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp)
+ DIR *dirp)
{
int result;
struct timespec ts1,ts2;
}
static void smb_time_audit_init_search_op(vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp)
+ DIR *dirp)
{
struct timespec ts1,ts2;
double timediff;
const char **prefixallowlist = lp_usershare_prefix_allow_list();
const char **prefixdenylist = lp_usershare_prefix_deny_list();
int us_vers;
- SMB_STRUCT_DIR *dp;
+ DIR *dp;
SMB_STRUCT_STAT sbuf;
char *sharepath = NULL;
char *comment = NULL;
int load_usershare_shares(struct smbd_server_connection *sconn,
bool (*snumused) (struct smbd_server_connection *, int))
{
- SMB_STRUCT_DIR *dp;
+ DIR *dp;
SMB_STRUCT_STAT sbuf;
struct dirent *de;
int num_usershares = 0;
{
int master = -1;
char *line = NULL;
- SMB_STRUCT_DIR *dirp = NULL;
+ DIR *dirp = NULL;
const char *dpname;
*slave = NULL;
struct smb_Dir {
connection_struct *conn;
- SMB_STRUCT_DIR *dir;
+ DIR *dir;
long offset;
char *dir_path;
size_t name_cache_size;
static int count_dfs_links(TALLOC_CTX *ctx, int snum)
{
size_t cnt = 0;
- SMB_STRUCT_DIR *dirp = NULL;
+ DIR *dirp = NULL;
const char *dname = NULL;
char *talloced = NULL;
const char *connect_path = lp_pathname(snum);
size_t jn_remain)
{
size_t cnt = 0;
- SMB_STRUCT_DIR *dirp = NULL;
+ DIR *dirp = NULL;
const char *dname = NULL;
char *talloced = NULL;
const char *connect_path = lp_pathname(snum);
if (!p)
return(NULL);
- ptr = SMB_VFS_READDIR(conn, (SMB_STRUCT_DIR *)p, sbuf);
+ ptr = SMB_VFS_READDIR(conn, (DIR *)p, sbuf);
if (!ptr)
return(NULL);
return handle->fns->get_dfs_referrals_fn(handle, r);
}
-SMB_STRUCT_DIR *smb_vfs_call_opendir(struct vfs_handle_struct *handle,
+DIR *smb_vfs_call_opendir(struct vfs_handle_struct *handle,
const char *fname, const char *mask,
uint32 attributes)
{
return handle->fns->opendir_fn(handle, fname, mask, attributes);
}
-SMB_STRUCT_DIR *smb_vfs_call_fdopendir(struct vfs_handle_struct *handle,
+DIR *smb_vfs_call_fdopendir(struct vfs_handle_struct *handle,
struct files_struct *fsp,
const char *mask,
uint32 attributes)
}
struct dirent *smb_vfs_call_readdir(struct vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp,
+ DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{
VFS_FIND(readdir);
}
void smb_vfs_call_seekdir(struct vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp, long offset)
+ DIR *dirp, long offset)
{
VFS_FIND(seekdir);
handle->fns->seekdir_fn(handle, dirp, offset);
}
long smb_vfs_call_telldir(struct vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp)
+ DIR *dirp)
{
VFS_FIND(telldir);
return handle->fns->telldir_fn(handle, dirp);
}
void smb_vfs_call_rewind_dir(struct vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp)
+ DIR *dirp)
{
VFS_FIND(rewind_dir);
handle->fns->rewind_dir_fn(handle, dirp);
}
int smb_vfs_call_closedir(struct vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dir)
+ DIR *dir)
{
VFS_FIND(closedir);
return handle->fns->closedir_fn(handle, dir);
}
void smb_vfs_call_init_search_op(struct vfs_handle_struct *handle,
- SMB_STRUCT_DIR *dirp)
+ DIR *dirp)
{
VFS_FIND(init_search_op);
handle->fns->init_search_op_fn(handle, dirp);
static int get_share_list(TALLOC_CTX *ctx, const char *wcard, bool only_ours)
{
- SMB_STRUCT_DIR *dp;
+ DIR *dp;
struct dirent *de;
uid_t myuid = geteuid();
struct file_list *fl = NULL;
static int count_num_usershares(void)
{
- SMB_STRUCT_DIR *dp;
+ DIR *dp;
struct dirent *de;
int num_usershares = 0;
TALLOC_CTX *ctx = talloc_tos();
int net_usershare(struct net_context *c, int argc, const char **argv)
{
- SMB_STRUCT_DIR *dp;
+ DIR *dp;
struct functable func[] = {
{