r9483: Changed DIR to SMB_STRUCT_DIR because of the amazing stupidity of a UNIX vendor
authorJeremy Allison <jra@samba.org>
Mon, 22 Aug 2005 18:03:08 +0000 (18:03 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:01:11 +0000 (11:01 -0500)
not understanding abstract data types :-(.
Jeremy.
(This used to be commit be5b4e2fa3ed30b0ff01b47d2354e5f782a12e25)

16 files changed:
examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
source3/configure.in
source3/include/includes.h
source3/include/vfs.h
source3/lib/system.c
source3/modules/vfs_audit.c
source3/modules/vfs_cap.c
source3/modules/vfs_catia.c
source3/modules/vfs_extd_audit.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_netatalk.c
source3/modules/vfs_shadow_copy.c
source3/script/mkproto.awk
source3/smbd/dir.c
source3/smbd/vfs-wrap.c

index a3aab55c3ea8d27923902f8e2a6148354083ee1b..065c9ecbc1a8f1f833ce6653069a61c7502b8bc0 100644 (file)
@@ -71,27 +71,27 @@ static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fs
        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);
 }
@@ -106,7 +106,7 @@ static int skel_rmdir(vfs_handle_struct *handle, connection_struct *conn, const
        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);
 }
index 81069765d0e0aedfe6a1507496eb0cd1eba0b924..0879683fdcd294655d548c420ed428c694642242 100644 (file)
@@ -70,27 +70,27 @@ static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fs
        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);
 }
@@ -105,7 +105,7 @@ static int skel_rmdir(vfs_handle_struct *handle, connection_struct *conn, const
        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);
 }
index 40c381bb67ed9c7d2c9af6409fcf62972d97c899..51fe556c4360f85fc61d910efd3bbba8f004516b 100644 (file)
@@ -1626,6 +1626,19 @@ if test x"$samba_cv_HAVE_DEV64_T" = x"yes"; then
     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)
index 6cab2525b00286f6aa3a0344ace8a4c7a8b8bb6c..c9208d2b2596d836c208548abb68d681af9bf116 100644 (file)
@@ -743,6 +743,18 @@ typedef int socklen_t;
 #  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.
  */
index c7c7575d904c3299bf1d273157ed87c1e1a83a38..3bd0fda9a43beac79be705fdc0a24361b665422c 100644 (file)
@@ -59,7 +59,8 @@
 /* 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 */
@@ -224,14 +225,14 @@ struct vfs_ops {
                
                /* 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 */
                
index 2565f92c668c22eb81dcd61a40dd9dbbd7b21f38..227cbadf8efbb0209c8d9283d980d30a84cb72f0 100644 (file)
@@ -366,7 +366,7 @@ FILE *sys_fopen(const char *path, const char *type)
  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);
@@ -379,7 +379,7 @@ DIR *sys_opendir(const char *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);
@@ -392,7 +392,7 @@ SMB_STRUCT_DIRENT *sys_readdir(DIR *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);
@@ -405,7 +405,7 @@ void sys_seekdir(DIR *dirp, long 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);
@@ -418,7 +418,7 @@ long sys_telldir(DIR *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);
@@ -431,7 +431,7 @@ void sys_rewinddir(DIR *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);
index 952cb1eddf60c8017713d6e5a8c0e24e7ecf31e8..7d97962db04418a1fec7d3d83bd6f64728bf0976 100644 (file)
@@ -31,7 +31,7 @@
 
 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);
@@ -119,9 +119,9 @@ static void audit_disconnect(vfs_handle_struct *handle, connection_struct *conn)
        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);
 
index 6ee63a577d1b29ac0fc4cd79d45684f5d18ba62e..b1bfcd75f2fafc6caebb1ad31627c9ac6763418f 100644 (file)
@@ -38,14 +38,14 @@ static SMB_BIG_UINT cap_disk_free(vfs_handle_struct *handle, connection_struct *
                                         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"));
index d4420884dddd83f06b5102234b6f1d3b91e5127b..69735de3f43ca3b15137e65aadf7541b552caa9b 100644 (file)
@@ -71,7 +71,7 @@ static void to_unix(char *s)
         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;
@@ -82,7 +82,7 @@ static DIR *catia_opendir(vfs_handle_struct *handle, connection_struct
 }
 
 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);
 
index e3b90b293b63c848b2aafaaa6093ef9439891116..d7bb9805851856d89aa36c53d2d4a69b984ba3ed 100644 (file)
@@ -34,7 +34,7 @@ static int vfs_extd_audit_debug_level = DBGC_VFS;
 
 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);
@@ -125,9 +125,9 @@ static void audit_disconnect(vfs_handle_struct *handle, connection_struct *conn)
        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);
 
index aa9e047f0aee99c6c3e85ccbf3b5e1ddc4bd5e43..d79e2e8f1ccbcf4b6373d827b9aae17e3939f255 100644 (file)
@@ -86,22 +86,22 @@ static int smb_full_audit_get_shadow_copy_data(struct vfs_handle_struct *handle,
                                 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);
@@ -845,10 +845,10 @@ static int smb_full_audit_get_shadow_copy_data(struct vfs_handle_struct *handle,
        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);
 
@@ -858,7 +858,7 @@ static DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct
 }
 
 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;
 
@@ -873,7 +873,7 @@ static SMB_STRUCT_DIRENT *smb_full_audit_readdir(vfs_handle_struct *handle,
 }
 
 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);
 
@@ -882,7 +882,7 @@ static void smb_full_audit_seekdir(vfs_handle_struct *handle, connection_struct
 }
 
 static long smb_full_audit_telldir(vfs_handle_struct *handle, connection_struct *conn,
-                       DIR *dirp)
+                       SMB_STRUCT_DIR *dirp)
 {
        long result;
 
@@ -894,7 +894,7 @@ static long smb_full_audit_telldir(vfs_handle_struct *handle, connection_struct
 }
 
 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);
 
@@ -927,7 +927,7 @@ static int smb_full_audit_rmdir(vfs_handle_struct *handle, connection_struct *co
 }
 
 static int smb_full_audit_closedir(vfs_handle_struct *handle, connection_struct *conn,
-                         DIR *dirp)
+                         SMB_STRUCT_DIR *dirp)
 {
        int result;
 
index 02ce5300ae7ff5e18fec3ddbe6923db68a89d837..e9d4360cd8028f79b6b43acd84164e8d31faa26f 100644 (file)
@@ -148,11 +148,11 @@ static void atalk_rrmdir(TALLOC_CTX *ctx, char *path)
 {
        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))) {
@@ -165,16 +165,16 @@ static void atalk_rrmdir(TALLOC_CTX *ctx, char *path)
                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);
 
index 005e2f1fbaef6cce514603f41503c1386b7be74b..8bb4598ea3dca4147b76d73466e3c631eeec8456 100644 (file)
@@ -72,10 +72,10 @@ static BOOL shadow_copy_match_name(const char *name)
        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));
@@ -119,10 +119,10 @@ static DIR *shadow_copy_opendir(vfs_handle_struct *handle, connection_struct *co
        }
 
        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;
 
@@ -133,7 +133,7 @@ SMB_STRUCT_DIRENT *shadow_copy_readdir(vfs_handle_struct *handle, connection_str
        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;
 
@@ -142,19 +142,19 @@ static void shadow_copy_seekdir(struct vfs_handle_struct *handle, struct connect
        }
 }
 
-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;
 
@@ -166,7 +166,7 @@ int shadow_copy_closedir(vfs_handle_struct *handle, connection_struct *conn, DIR
 
 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;
index 3c4826758728ace25be4f57f6d4ff23a46e541a5..3940c34700a2bf0b2762b6eab6fbcf130aa7cfb8 100644 (file)
@@ -136,7 +136,7 @@ END {
     gotstart = 1;
   }
 
-  if( $0 ~ /^NODE_STATUS_STRUCT/ ) {
+  if( $0 ~ /^NODE_STATUS_STRUCT|SMB_STRUCT_DIR/ ) {
     gotstart = 1;
   }
 
index f722bedecbb196b2a9ca1900ba7d374ef6a952c7..02e15d222a9c26c3e10d59d3ec21a8c791422d1e 100644 (file)
@@ -42,7 +42,7 @@ struct name_cache_entry {
 
 struct smb_Dir {
        connection_struct *conn;
-       DIR *dir;
+       SMB_STRUCT_DIR *dir;
        long offset;
        char *dir_path;
        struct name_cache_entry *name_cache;
index 39ac402f3468b9d4d26ccdb033956de456c7d888..2129cf85417badf66e5799db9d5a8401692578ca 100644 (file)
@@ -88,9 +88,9 @@ int vfswrap_get_shadow_copy_data(struct vfs_handle_struct *handle, struct files_
     
 /* 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);
@@ -98,7 +98,7 @@ DIR *vfswrap_opendir(vfs_handle_struct *handle, connection_struct *conn, const c
        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;
 
@@ -108,14 +108,14 @@ SMB_STRUCT_DIRENT *vfswrap_readdir(vfs_handle_struct *handle, connection_struct
        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);
@@ -124,7 +124,7 @@ long vfswrap_telldir(vfs_handle_struct *handle, connection_struct *conn, DIR *di
        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);
@@ -170,7 +170,7 @@ int vfswrap_rmdir(vfs_handle_struct *handle, connection_struct *conn, const char
        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;