From be5b4e2fa3ed30b0ff01b47d2354e5f782a12e25 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 22 Aug 2005 18:03:08 +0000 Subject: [PATCH] r9483: Changed DIR to SMB_STRUCT_DIR because of the amazing stupidity of a UNIX vendor not understanding abstract data types :-(. Jeremy. --- examples/VFS/skel_opaque.c | 12 ++++++------ examples/VFS/skel_transparent.c | 12 ++++++------ source/configure.in | 13 +++++++++++++ source/include/includes.h | 12 ++++++++++++ source/include/vfs.h | 15 ++++++++------- source/lib/system.c | 12 ++++++------ source/modules/vfs_audit.c | 6 +++--- source/modules/vfs_cap.c | 4 ++-- source/modules/vfs_catia.c | 4 ++-- source/modules/vfs_extd_audit.c | 6 +++--- source/modules/vfs_full_audit.c | 26 +++++++++++++------------- source/modules/vfs_netatalk.c | 10 +++++----- source/modules/vfs_shadow_copy.c | 18 +++++++++--------- source/script/mkproto.awk | 2 +- source/smbd/dir.c | 2 +- source/smbd/vfs-wrap.c | 14 +++++++------- 16 files changed, 97 insertions(+), 71 deletions(-) diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index a3aab55c3e..065c9ecbc1 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -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); } diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 81069765d0..0879683fdc 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -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); } diff --git a/source/configure.in b/source/configure.in index 40c381bb67..51fe556c43 100644 --- a/source/configure.in +++ b/source/configure.in @@ -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 +#endif +#include +#include ], +[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) diff --git a/source/include/includes.h b/source/include/includes.h index 6cab2525b0..c9208d2b25 100644 --- a/source/include/includes.h +++ b/source/include/includes.h @@ -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. */ diff --git a/source/include/vfs.h b/source/include/vfs.h index c7c7575d90..3bd0fda9a4 100644 --- a/source/include/vfs.h +++ b/source/include/vfs.h @@ -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 */ diff --git a/source/lib/system.c b/source/lib/system.c index 2565f92c66..227cbadf8e 100644 --- a/source/lib/system.c +++ b/source/lib/system.c @@ -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); diff --git a/source/modules/vfs_audit.c b/source/modules/vfs_audit.c index 952cb1eddf..7d97962db0 100644 --- a/source/modules/vfs_audit.c +++ b/source/modules/vfs_audit.c @@ -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); diff --git a/source/modules/vfs_cap.c b/source/modules/vfs_cap.c index 6ee63a577d..b1bfcd75f2 100644 --- a/source/modules/vfs_cap.c +++ b/source/modules/vfs_cap.c @@ -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")); diff --git a/source/modules/vfs_catia.c b/source/modules/vfs_catia.c index d4420884dd..69735de3f4 100644 --- a/source/modules/vfs_catia.c +++ b/source/modules/vfs_catia.c @@ -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); diff --git a/source/modules/vfs_extd_audit.c b/source/modules/vfs_extd_audit.c index e3b90b293b..d7bb980585 100644 --- a/source/modules/vfs_extd_audit.c +++ b/source/modules/vfs_extd_audit.c @@ -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); diff --git a/source/modules/vfs_full_audit.c b/source/modules/vfs_full_audit.c index aa9e047f0a..d79e2e8f1c 100644 --- a/source/modules/vfs_full_audit.c +++ b/source/modules/vfs_full_audit.c @@ -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; diff --git a/source/modules/vfs_netatalk.c b/source/modules/vfs_netatalk.c index 02ce5300ae..e9d4360cd8 100644 --- a/source/modules/vfs_netatalk.c +++ b/source/modules/vfs_netatalk.c @@ -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); diff --git a/source/modules/vfs_shadow_copy.c b/source/modules/vfs_shadow_copy.c index 005e2f1fba..8bb4598ea3 100644 --- a/source/modules/vfs_shadow_copy.c +++ b/source/modules/vfs_shadow_copy.c @@ -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; diff --git a/source/script/mkproto.awk b/source/script/mkproto.awk index 3c48267587..3940c34700 100644 --- a/source/script/mkproto.awk +++ b/source/script/mkproto.awk @@ -136,7 +136,7 @@ END { gotstart = 1; } - if( $0 ~ /^NODE_STATUS_STRUCT/ ) { + if( $0 ~ /^NODE_STATUS_STRUCT|SMB_STRUCT_DIR/ ) { gotstart = 1; } diff --git a/source/smbd/dir.c b/source/smbd/dir.c index f722bedecb..02e15d222a 100644 --- a/source/smbd/dir.c +++ b/source/smbd/dir.c @@ -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; diff --git a/source/smbd/vfs-wrap.c b/source/smbd/vfs-wrap.c index 39ac402f34..2129cf8541 100644 --- a/source/smbd/vfs-wrap.c +++ b/source/smbd/vfs-wrap.c @@ -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; -- 2.34.1