summaryrefslogtreecommitdiffstats
path: root/source3/modules/vfs_scannedonly.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-02-08 15:07:48 -0800
committerJeremy Allison <jra@samba.org>2011-02-09 00:55:22 +0100
commita674a56a97c78a44bf43f1c175d106fbe70c7485 (patch)
tree78d6bab766e79d4e66de86d94d972cc96bb2a245 /source3/modules/vfs_scannedonly.c
parent224fc03cb56b0d76f6ad7f18dd0528d6b0e57fb1 (diff)
downloadsamba-a674a56a97c78a44bf43f1c175d106fbe70c7485.tar.gz
samba-a674a56a97c78a44bf43f1c175d106fbe70c7485.tar.xz
samba-a674a56a97c78a44bf43f1c175d106fbe70c7485.zip
Add fdopendir to the VFS. We will use this to reuse a directory fd already open by NtCreateX.
Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Feb 9 00:55:22 CET 2011 on sn-devel-104
Diffstat (limited to 'source3/modules/vfs_scannedonly.c')
-rw-r--r--source3/modules/vfs_scannedonly.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/source3/modules/vfs_scannedonly.c b/source3/modules/vfs_scannedonly.c
index 123bf65fd4..fd6c3e2077 100644
--- a/source3/modules/vfs_scannedonly.c
+++ b/source3/modules/vfs_scannedonly.c
@@ -526,6 +526,35 @@ static SMB_STRUCT_DIR *scannedonly_opendir(vfs_handle_struct * handle,
return (SMB_STRUCT_DIR *) sDIR;
}
+static SMB_STRUCT_DIR *scannedonly_fdopendir(vfs_handle_struct * handle,
+ files_struct *fsp,
+ const char *mask, uint32 attr)
+{
+ SMB_STRUCT_DIR *DIRp;
+ struct scannedonly_DIR *sDIR;
+ const char *fname;
+
+ DIRp = SMB_VFS_NEXT_FDOPENDIR(handle, fsp, mask, attr);
+ if (!DIRp) {
+ return NULL;
+ }
+
+ fname = (const char *)fsp->fsp_name->base_name;
+
+ sDIR = TALLOC_P(NULL, struct scannedonly_DIR);
+ if (fname[0] != '/') {
+ sDIR->base = construct_full_path(sDIR,handle, fname, true);
+ } else {
+ sDIR->base = name_w_ending_slash(sDIR, fname);
+ }
+ DEBUG(SCANNEDONLY_DEBUG,
+ ("scannedonly_fdopendir, fname=%s, base=%s\n",fname,sDIR->base));
+ sDIR->DIR = DIRp;
+ sDIR->notify_loop_done = 0;
+ return (SMB_STRUCT_DIR *) sDIR;
+}
+
+
static SMB_STRUCT_DIRENT *scannedonly_readdir(vfs_handle_struct *handle,
SMB_STRUCT_DIR * dirp,
SMB_STRUCT_STAT *sbuf)
@@ -986,6 +1015,7 @@ static int scannedonly_connect(struct vfs_handle_struct *handle,
/* VFS operations structure */
static struct vfs_fn_pointers vfs_scannedonly_fns = {
.opendir = scannedonly_opendir,
+ .fdopendir = scannedonly_fdopendir,
.readdir = scannedonly_readdir,
.seekdir = scannedonly_seekdir,
.telldir = scannedonly_telldir,