return vfswrap_get_shadow_copy_data(NULL, fsp, shadow_copy_data, labels);
}
-static DIR *skel_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr)
+static SMB_STRUCT_DIR *skel_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr)
{
return vfswrap_opendir(NULL, conn, fname, mask, attr);
}
-static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp)
+static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dirp)
{
return vfswrap_readdir(NULL, conn, dirp);
}
-static void skel_seekdir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp, long offset)
+static void skel_seekdir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dirp, long offset)
{
return vfswrap_seekdir(NULL, conn, dirp, offset);
}
-static long skel_telldir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp)
+static long skel_telldir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dirp)
{
return vfswrap_telldir(NULL, conn, dirp);
}
-static void skel_rewinddir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp)
+static void skel_rewinddir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dirp)
{
return vfswrap_rewinddir(NULL, conn, dirp);
}
return vfswrap_rmdir(NULL, conn, path);
}
-static int skel_closedir(vfs_handle_struct *handle, connection_struct *conn, DIR *dir)
+static int skel_closedir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dir)
{
return vfswrap_closedir(NULL, conn, dir);
}
return SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data, labels);
}
-static DIR *skel_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr)
+static SMB_STRUCT_DIR *skel_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr)
{
return SMB_VFS_NEXT_OPENDIR(handle, conn, fname, mask, attr);
}
-static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp)
+static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dirp)
{
return SMB_VFS_NEXT_READDIR(handle, conn, dirp);
}
-static void skel_seekdir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp, long offset)
+static void skel_seekdir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dirp, long offset)
{
return SMB_VFS_NEXT_SEEKDIR(handle, conn, dirp, offset);
}
-static long skel_telldir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp)
+static long skel_telldir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dirp)
{
return SMB_VFS_NEXT_TELLDIR(handle, conn, dirp);
}
-static void skel_rewinddir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp)
+static void skel_rewinddir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dirp)
{
return SMB_VFS_NEXT_REWINDDIR(handle, conn, dirp);
}
return SMB_VFS_NEXT_RMDIR(handle, conn, path);
}
-static int skel_closedir(vfs_handle_struct *handle, connection_struct *conn, DIR *dir)
+static int skel_closedir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dir)
{
return SMB_VFS_NEXT_CLOSEDIR(handle, conn, dir);
}
AC_DEFINE(HAVE_DEV64_T,1,[Whether the 'dev64_t' type is available])
fi
+AC_CACHE_CHECK([for struct dirent64],samba_cv_HAVE_STRUCT_DIR64,[
+AC_TRY_COMPILE([
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+#include <dirent.h>],
+[DIR64 de;],
+samba_cv_HAVE_STRUCT_DIR64=yes,samba_cv_HAVE_STRUCT_DIR64=no)])
+if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes" && test x"$ac_cv_func_readdir64" = x"yes"; then
+ AC_DEFINE(HAVE_STRUCT_DIRENT64,1,[Whether the 'DIR64' abstract data type is available])
+fi
+
AC_CACHE_CHECK([for struct dirent64],samba_cv_HAVE_STRUCT_DIRENT64,[
AC_TRY_COMPILE([
#if defined(HAVE_UNISTD_H)
# endif
#endif
+/*
+ * Type for DIR structure.
+ */
+
+#ifndef SMB_STRUCT_DIR
+# if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_DIR64)
+# define SMB_STRUCT_DIR DIR64
+# else
+# define SMB_STRUCT_DIR DIR
+# endif
+#endif
+
/*
* Defines for 64 bit fcntl locks.
*/
/* Changed to version 12 to add mask and attributes to opendir(). JRA
Also include aio calls. JRA. */
/* Changed to version 13 as the internal structure of files_struct has changed. JRA */
-#define SMB_VFS_INTERFACE_VERSION 13
+/* Changed to version 14 as the we had to change DIR to SMB_STRUCT_DIR. JRA */
+#define SMB_VFS_INTERFACE_VERSION 14
/* to bug old modules which are trying to compile with the old functions */
/* Directory operations */
- DIR *(*opendir)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *fname, const char *mask, uint32 attributes);
- SMB_STRUCT_DIRENT *(*readdir)(struct vfs_handle_struct *handle, struct connection_struct *conn, DIR *dirp);
- void (*seekdir)(struct vfs_handle_struct *handle, struct connection_struct *conn, DIR *dirp, long offset);
- long (*telldir)(struct vfs_handle_struct *handle, struct connection_struct *conn, DIR *dirp);
- void (*rewind_dir)(struct vfs_handle_struct *handle, struct connection_struct *conn, DIR *dirp);
+ SMB_STRUCT_DIR *(*opendir)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *fname, const char *mask, uint32 attributes);
+ SMB_STRUCT_DIRENT *(*readdir)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_STRUCT_DIR *dirp);
+ void (*seekdir)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_STRUCT_DIR *dirp, long offset);
+ long (*telldir)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_STRUCT_DIR *dirp);
+ void (*rewind_dir)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_STRUCT_DIR *dirp);
int (*mkdir)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, mode_t mode);
int (*rmdir)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path);
- int (*closedir)(struct vfs_handle_struct *handle, struct connection_struct *conn, DIR *dir);
+ int (*closedir)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_STRUCT_DIR *dir);
/* File operations */
An opendir wrapper that will deal with 64 bit filesizes.
********************************************************************/
-DIR *sys_opendir(const char *name)
+SMB_STRUCT_DIR *sys_opendir(const char *name)
{
#if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_OPENDIR64)
return opendir64(name);
A readdir wrapper that will deal with 64 bit filesizes.
********************************************************************/
-SMB_STRUCT_DIRENT *sys_readdir(DIR *dirp)
+SMB_STRUCT_DIRENT *sys_readdir(SMB_STRUCT_DIR *dirp)
{
#if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_READDIR64)
return readdir64(dirp);
A seekdir wrapper that will deal with 64 bit filesizes.
********************************************************************/
-void sys_seekdir(DIR *dirp, long offset)
+void sys_seekdir(SMB_STRUCT_DIR *dirp, long offset)
{
#if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_SEEKDIR64)
seekdir64(dirp, offset);
A telldir wrapper that will deal with 64 bit filesizes.
********************************************************************/
-long sys_telldir(DIR *dirp)
+long sys_telldir(SMB_STRUCT_DIR *dirp)
{
#if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_TELLDIR64)
return (long)telldir64(dirp);
A rewinddir wrapper that will deal with 64 bit filesizes.
********************************************************************/
-void sys_rewinddir(DIR *dirp)
+void sys_rewinddir(SMB_STRUCT_DIR *dirp)
{
#if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_REWINDDIR64)
rewinddir64(dirp);
A close wrapper that will deal with 64 bit filesizes.
********************************************************************/
-int sys_closedir(DIR *dirp)
+int sys_closedir(SMB_STRUCT_DIR *dirp)
{
#if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_CLOSEDIR64)
return closedir64(dirp);
static int audit_connect(vfs_handle_struct *handle, connection_struct *conn, const char *svc, const char *user);
static void audit_disconnect(vfs_handle_struct *handle, connection_struct *conn);
-static DIR *audit_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr);
+static SMB_STRUCT_DIR *audit_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr);
static int audit_mkdir(vfs_handle_struct *handle, connection_struct *conn, const char *path, mode_t mode);
static int audit_rmdir(vfs_handle_struct *handle, connection_struct *conn, const char *path);
static int audit_open(vfs_handle_struct *handle, connection_struct *conn, const char *fname, int flags, mode_t mode);
return;
}
-static DIR *audit_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr)
+static SMB_STRUCT_DIR *audit_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr)
{
- DIR *result;
+ SMB_STRUCT_DIR *result;
result = SMB_VFS_NEXT_OPENDIR(handle, conn, fname, mask, attr);
dfree, dsize);
}
-static DIR *cap_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr)
+static SMB_STRUCT_DIR *cap_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr)
{
pstring capname;
capencode(capname, fname);
return SMB_VFS_NEXT_OPENDIR(handle, conn, capname, mask, attr);
}
-static SMB_STRUCT_DIRENT *cap_readdir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp)
+static SMB_STRUCT_DIRENT *cap_readdir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dirp)
{
SMB_STRUCT_DIRENT *result;
DEBUG(3,("cap: cap_readdir\n"));
catia_string_replace(s, '\xb1', ' ');
}
-static DIR *catia_opendir(vfs_handle_struct *handle, connection_struct
+static SMB_STRUCT_DIR *catia_opendir(vfs_handle_struct *handle, connection_struct
*conn, const char *fname, const char *mask, uint32 attr)
{
pstring name;
}
static SMB_STRUCT_DIRENT *catia_readdir(vfs_handle_struct *handle,
- connection_struct *conn, DIR *dirp)
+ connection_struct *conn, SMB_STRUCT_DIR *dirp)
{
SMB_STRUCT_DIRENT *result = SMB_VFS_NEXT_READDIR(handle, conn, dirp);
static int audit_connect(vfs_handle_struct *handle, connection_struct *conn, const char *svc, const char *user);
static void audit_disconnect(vfs_handle_struct *handle, connection_struct *conn);
-static DIR *audit_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr);
+static SMB_STRUCT_DIR *audit_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr);
static int audit_mkdir(vfs_handle_struct *handle, connection_struct *conn, const char *path, mode_t mode);
static int audit_rmdir(vfs_handle_struct *handle, connection_struct *conn, const char *path);
static int audit_open(vfs_handle_struct *handle, connection_struct *conn, const char *fname, int flags, mode_t mode);
return;
}
-static DIR *audit_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr)
+static SMB_STRUCT_DIR *audit_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr)
{
- DIR *result;
+ SMB_STRUCT_DIR *result;
result = SMB_VFS_NEXT_OPENDIR(handle, conn, fname, mask, attr);
struct files_struct *fsp,
SHADOW_COPY_DATA *shadow_copy_data, BOOL labels);
-static DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct *conn,
+static SMB_STRUCT_DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct *conn,
const char *fname, const char *mask, uint32 attr);
static SMB_STRUCT_DIRENT *smb_full_audit_readdir(vfs_handle_struct *handle,
- connection_struct *conn, DIR *dirp);
+ connection_struct *conn, SMB_STRUCT_DIR *dirp);
static void smb_full_audit_seekdir(vfs_handle_struct *handle, connection_struct *conn,
- DIR *dirp, long offset);
+ SMB_STRUCT_DIR *dirp, long offset);
static long smb_full_audit_telldir(vfs_handle_struct *handle, connection_struct *conn,
- DIR *dirp);
+ SMB_STRUCT_DIR *dirp);
static void smb_full_audit_rewinddir(vfs_handle_struct *handle, connection_struct *conn,
- DIR *dirp);
+ SMB_STRUCT_DIR *dirp);
static int smb_full_audit_mkdir(vfs_handle_struct *handle, connection_struct *conn,
const char *path, mode_t mode);
static int smb_full_audit_rmdir(vfs_handle_struct *handle, connection_struct *conn,
const char *path);
static int smb_full_audit_closedir(vfs_handle_struct *handle, connection_struct *conn,
- DIR *dirp);
+ SMB_STRUCT_DIR *dirp);
static int smb_full_audit_open(vfs_handle_struct *handle, connection_struct *conn,
const char *fname, int flags, mode_t mode);
static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd);
return result;
}
-static DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct *conn,
+static SMB_STRUCT_DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct *conn,
const char *fname, const char *mask, uint32 attr)
{
- DIR *result;
+ SMB_STRUCT_DIR *result;
result = SMB_VFS_NEXT_OPENDIR(handle, conn, fname, mask, attr);
}
static SMB_STRUCT_DIRENT *smb_full_audit_readdir(vfs_handle_struct *handle,
- connection_struct *conn, DIR *dirp)
+ connection_struct *conn, SMB_STRUCT_DIR *dirp)
{
SMB_STRUCT_DIRENT *result;
}
static void smb_full_audit_seekdir(vfs_handle_struct *handle, connection_struct *conn,
- DIR *dirp, long offset)
+ SMB_STRUCT_DIR *dirp, long offset)
{
SMB_VFS_NEXT_SEEKDIR(handle, conn, dirp, offset);
}
static long smb_full_audit_telldir(vfs_handle_struct *handle, connection_struct *conn,
- DIR *dirp)
+ SMB_STRUCT_DIR *dirp)
{
long result;
}
static void smb_full_audit_rewinddir(vfs_handle_struct *handle, connection_struct *conn,
- DIR *dirp)
+ SMB_STRUCT_DIR *dirp)
{
SMB_VFS_NEXT_REWINDDIR(handle, conn, dirp);
}
static int smb_full_audit_closedir(vfs_handle_struct *handle, connection_struct *conn,
- DIR *dirp)
+ SMB_STRUCT_DIR *dirp)
{
int result;
{
char *dpath;
SMB_STRUCT_DIRENT *dent = 0;
- DIR *dir;
+ SMB_STRUCT_DIR *dir;
if (!path) return;
- dir = opendir(path);
+ dir = sys_opendir(path);
if (!dir) return;
while (NULL != (dent = sys_readdir(dir))) {
atalk_unlink_file(dpath);
}
- closedir(dir);
+ sys_closedir(dir);
}
/* Disk operations */
/* Directory operations */
-DIR *atalk_opendir(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *fname, const char *mask, uint32 attr)
+SMB_STRUCT_DIR *atalk_opendir(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *fname, const char *mask, uint32 attr)
{
- DIR *ret = 0;
+ SMB_STRUCT_DIR *ret = 0;
ret = SMB_VFS_NEXT_OPENDIR(handle, conn, fname, mask, attr);
return False;
}
-static DIR *shadow_copy_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr)
+static SMB_STRUCT_DIR *shadow_copy_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr)
{
shadow_copy_Dir *dirp;
- DIR *p = SMB_VFS_NEXT_OPENDIR(handle,conn,fname,mask,attr);
+ SMB_STRUCT_DIR *p = SMB_VFS_NEXT_OPENDIR(handle,conn,fname,mask,attr);
if (!p) {
DEBUG(0,("shadow_copy_opendir: SMB_VFS_NEXT_OPENDIR() failed for [%s]\n",fname));
}
SMB_VFS_NEXT_CLOSEDIR(handle,conn,p);
- return((DIR *)dirp);
+ return((SMB_STRUCT_DIR *)dirp);
}
-SMB_STRUCT_DIRENT *shadow_copy_readdir(vfs_handle_struct *handle, connection_struct *conn, DIR *_dirp)
+SMB_STRUCT_DIRENT *shadow_copy_readdir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *_dirp)
{
shadow_copy_Dir *dirp = (shadow_copy_Dir *)_dirp;
return NULL;
}
-static void shadow_copy_seekdir(struct vfs_handle_struct *handle, struct connection_struct *conn, DIR *_dirp, long offset)
+static void shadow_copy_seekdir(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_STRUCT_DIR *_dirp, long offset)
{
shadow_copy_Dir *dirp = (shadow_copy_Dir *)_dirp;
}
}
-static long shadow_copy_telldir(struct vfs_handle_struct *handle, struct connection_struct *conn, DIR *_dirp)
+static long shadow_copy_telldir(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_STRUCT_DIR *_dirp)
{
shadow_copy_Dir *dirp = (shadow_copy_Dir *)_dirp;
return( dirp->pos ) ;
}
-static void shadow_copy_rewinddir(struct vfs_handle_struct *handle, struct connection_struct *conn, DIR *_dirp)
+static void shadow_copy_rewinddir(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_STRUCT_DIR *_dirp)
{
shadow_copy_Dir *dirp = (shadow_copy_Dir *)_dirp;
dirp->pos = 0 ;
}
-int shadow_copy_closedir(vfs_handle_struct *handle, connection_struct *conn, DIR *_dirp)
+int shadow_copy_closedir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *_dirp)
{
shadow_copy_Dir *dirp = (shadow_copy_Dir *)_dirp;
static int shadow_copy_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, BOOL labels)
{
- DIR *p = SMB_VFS_NEXT_OPENDIR(handle,fsp->conn,fsp->conn->connectpath,NULL,0);
+ SMB_STRUCT_DIR *p = SMB_VFS_NEXT_OPENDIR(handle,fsp->conn,fsp->conn->connectpath,NULL,0);
shadow_copy_data->num_volumes = 0;
shadow_copy_data->labels = NULL;
gotstart = 1;
}
- if( $0 ~ /^NODE_STATUS_STRUCT/ ) {
+ if( $0 ~ /^NODE_STATUS_STRUCT|SMB_STRUCT_DIR/ ) {
gotstart = 1;
}
struct smb_Dir {
connection_struct *conn;
- DIR *dir;
+ SMB_STRUCT_DIR *dir;
long offset;
char *dir_path;
struct name_cache_entry *name_cache;
/* Directory operations */
-DIR *vfswrap_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr)
+SMB_STRUCT_DIR *vfswrap_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr)
{
- DIR *result;
+ SMB_STRUCT_DIR *result;
START_PROFILE(syscall_opendir);
result = sys_opendir(fname);
return result;
}
-SMB_STRUCT_DIRENT *vfswrap_readdir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp)
+SMB_STRUCT_DIRENT *vfswrap_readdir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dirp)
{
SMB_STRUCT_DIRENT *result;
return result;
}
-void vfswrap_seekdir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp, long offset)
+void vfswrap_seekdir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dirp, long offset)
{
START_PROFILE(syscall_seekdir);
sys_seekdir(dirp, offset);
END_PROFILE(syscall_seekdir);
}
-long vfswrap_telldir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp)
+long vfswrap_telldir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dirp)
{
long result;
START_PROFILE(syscall_telldir);
return result;
}
-void vfswrap_rewinddir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp)
+void vfswrap_rewinddir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dirp)
{
START_PROFILE(syscall_rewinddir);
sys_rewinddir(dirp);
return result;
}
-int vfswrap_closedir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp)
+int vfswrap_closedir(vfs_handle_struct *handle, connection_struct *conn, SMB_STRUCT_DIR *dirp)
{
int result;