summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/include/smb.h1
-rw-r--r--source3/smbd/dir.c4
-rw-r--r--source3/smbd/vfs-wrap.c8
-rw-r--r--source3/smbd/vfs.c2
4 files changed, 13 insertions, 2 deletions
diff --git a/source3/include/smb.h b/source3/include/smb.h
index aa1f743996..29c119df95 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -629,6 +629,7 @@ struct vfs_ops {
struct dirent *(*readdir)(DIR *dirp);
int (*mkdir)(char *path, mode_t mode);
int (*rmdir)(char *path);
+ int (*closedir)(DIR *dir);
/* File operations */
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 52d271e284..b7ae2af47c 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -524,7 +524,7 @@ void *OpenDir(connection_struct *conn, char *name, BOOL use_veto)
if (!p) return(NULL);
dirp = (Dir *)malloc(sizeof(Dir));
if (!dirp) {
- closedir(p);
+ conn->vfs_ops.closedir(p);
return(NULL);
}
dirp->pos = dirp->numentries = dirp->mallocsize = 0;
@@ -554,7 +554,7 @@ void *OpenDir(connection_struct *conn, char *name, BOOL use_veto)
dirp->numentries++;
}
- closedir(p);
+ conn->vfs_ops.closedir(p);
return((void *)dirp);
}
diff --git a/source3/smbd/vfs-wrap.c b/source3/smbd/vfs-wrap.c
index b3d1a35329..da69b3f006 100644
--- a/source3/smbd/vfs-wrap.c
+++ b/source3/smbd/vfs-wrap.c
@@ -66,6 +66,14 @@ int vfswrap_rmdir(char *path)
return result;
}
+int vfswrap_closedir(DIR *dirp)
+{
+ int result;
+
+ result = closedir(path);
+ return result;
+}
+
/* File operations */
int vfswrap_open(char *fname, int flags, mode_t mode)
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 59e7bb4935..fdff87496b 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -53,6 +53,7 @@ struct vfs_syminfo vfs_syminfo[] = {
{"vfs_readdir", &dl_ops.readdir},
{"vfs_mkdir", &dl_ops.mkdir},
{"vfs_rmdir", &dl_ops.rmdir},
+ {"vfs_closedir", &dl_ops.closedir},
/* File operations */
@@ -95,6 +96,7 @@ struct vfs_ops default_vfs_ops = {
vfswrap_readdir,
vfswrap_mkdir,
vfswrap_rmdir,
+ vfswrap_closedir,
/* File operations */