118
120
return((SMB_STRUCT_DIR *)dirp);
123
static SMB_STRUCT_DIR *shadow_copy_fdopendir(vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32 attr)
125
shadow_copy_Dir *dirp;
126
SMB_STRUCT_DIR *p = SMB_VFS_NEXT_FDOPENDIR(handle,fsp,mask,attr);
129
DEBUG(10,("shadow_copy_opendir: SMB_VFS_NEXT_FDOPENDIR() failed for [%s]\n",
130
smb_fname_str_dbg(fsp->fsp_name)));
134
dirp = SMB_MALLOC_P(shadow_copy_Dir);
136
DEBUG(0,("shadow_copy_fdopendir: Out of memory\n"));
137
SMB_VFS_NEXT_CLOSEDIR(handle,p);
138
/* We have now closed the fd in fsp. */
146
SMB_STRUCT_DIRENT *d;
148
d = SMB_VFS_NEXT_READDIR(handle, p, NULL);
153
if (shadow_copy_match_name(d->d_name)) {
154
DEBUG(8,("shadow_copy_fdopendir: hide [%s]\n",d->d_name));
158
DEBUG(10,("shadow_copy_fdopendir: not hide [%s]\n",d->d_name));
160
dirp->dirs = SMB_REALLOC_ARRAY(dirp->dirs,SMB_STRUCT_DIRENT, dirp->num+1);
162
DEBUG(0,("shadow_copy_fdopendir: Out of memory\n"));
166
dirp->dirs[dirp->num++] = *d;
169
SMB_VFS_NEXT_CLOSEDIR(handle,p);
170
/* We have now closed the fd in fsp. */
172
return((SMB_STRUCT_DIR *)dirp);
121
175
static SMB_STRUCT_DIRENT *shadow_copy_readdir(vfs_handle_struct *handle,
122
176
SMB_STRUCT_DIR *_dirp,
123
177
SMB_STRUCT_STAT *sbuf)
165
static int shadow_copy_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, bool labels)
219
static int shadow_copy_get_shadow_copy_data(vfs_handle_struct *handle,
221
struct shadow_copy_data *shadow_copy_data,
167
224
SMB_STRUCT_DIR *p = SMB_VFS_NEXT_OPENDIR(handle,fsp->conn->connectpath,NULL,0);
199
tlabels = (SHADOW_COPY_LABEL *)TALLOC_REALLOC(shadow_copy_data->mem_ctx,
256
tlabels = (SHADOW_COPY_LABEL *)TALLOC_REALLOC(shadow_copy_data,
200
257
shadow_copy_data->labels,
201
258
(shadow_copy_data->num_volumes+1)*sizeof(SHADOW_COPY_LABEL));
202
259
if (tlabels == NULL) {
217
274
static struct vfs_fn_pointers vfs_shadow_copy_fns = {
218
275
.opendir = shadow_copy_opendir,
276
.fdopendir = shadow_copy_fdopendir,
219
277
.readdir = shadow_copy_readdir,
220
278
.seekdir = shadow_copy_seekdir,
221
279
.telldir = shadow_copy_telldir,