1 /*
2  * VFS module with "not implemented " helper functions for other modules.
3  *
4  * Copyright (C) Tim Potter, 1999-2000
5  * Copyright (C) Alexander Bokovoy, 2002
6  * Copyright (C) Stefan (metze) Metzmacher, 2003,2018
7  * Copyright (C) Jeremy Allison 2009
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #include "includes.h"
24 #include "lib/util/tevent_unix.h"
25 #include "lib/util/tevent_ntstatus.h"
26 
vfs_not_implemented_connect(vfs_handle_struct * handle,const char * service,const char * user)27 int vfs_not_implemented_connect(
28 			vfs_handle_struct *handle,
29 			const char *service,
30 			const char *user)
31 {
32 	errno = ENOSYS;
33 	return -1;
34 }
35 
vfs_not_implemented_disconnect(vfs_handle_struct * handle)36 void vfs_not_implemented_disconnect(vfs_handle_struct *handle)
37 {
38 	;
39 }
40 
vfs_not_implemented_disk_free(vfs_handle_struct * handle,const struct smb_filename * smb_fname,uint64_t * bsize,uint64_t * dfree,uint64_t * dsize)41 uint64_t vfs_not_implemented_disk_free(vfs_handle_struct *handle,
42 				const struct smb_filename *smb_fname,
43 				uint64_t *bsize,
44 				uint64_t *dfree,
45 				uint64_t *dsize)
46 {
47 	*bsize = 0;
48 	*dfree = 0;
49 	*dsize = 0;
50 	return 0;
51 }
52 
vfs_not_implemented_get_quota(vfs_handle_struct * handle,const struct smb_filename * smb_fname,enum SMB_QUOTA_TYPE qtype,unid_t id,SMB_DISK_QUOTA * dq)53 int vfs_not_implemented_get_quota(vfs_handle_struct *handle,
54 				const struct smb_filename *smb_fname,
55 				enum SMB_QUOTA_TYPE qtype,
56 				unid_t id,
57 				SMB_DISK_QUOTA *dq)
58 {
59 	errno = ENOSYS;
60 	return -1;
61 }
62 
vfs_not_implemented_set_quota(vfs_handle_struct * handle,enum SMB_QUOTA_TYPE qtype,unid_t id,SMB_DISK_QUOTA * dq)63 int vfs_not_implemented_set_quota(vfs_handle_struct *handle,
64 				  enum SMB_QUOTA_TYPE qtype,
65 				  unid_t id, SMB_DISK_QUOTA *dq)
66 {
67 	errno = ENOSYS;
68 	return -1;
69 }
70 
vfs_not_implemented_get_shadow_copy_data(vfs_handle_struct * handle,files_struct * fsp,struct shadow_copy_data * shadow_copy_data,bool labels)71 int vfs_not_implemented_get_shadow_copy_data(vfs_handle_struct *handle,
72 				files_struct *fsp,
73 				struct shadow_copy_data *shadow_copy_data,
74 				bool labels)
75 {
76 	errno = ENOSYS;
77 	return -1;
78 }
79 
vfs_not_implemented_statvfs(struct vfs_handle_struct * handle,const struct smb_filename * smb_fname,struct vfs_statvfs_struct * statbuf)80 int vfs_not_implemented_statvfs(struct vfs_handle_struct *handle,
81 				const struct smb_filename *smb_fname,
82 				struct vfs_statvfs_struct *statbuf)
83 {
84 	errno = ENOSYS;
85 	return -1;
86 }
87 
vfs_not_implemented_fs_capabilities(struct vfs_handle_struct * handle,enum timestamp_set_resolution * p_ts_res)88 uint32_t vfs_not_implemented_fs_capabilities(struct vfs_handle_struct *handle,
89 				enum timestamp_set_resolution *p_ts_res)
90 {
91 	return 0;
92 }
93 
vfs_not_implemented_get_dfs_referrals(struct vfs_handle_struct * handle,struct dfs_GetDFSReferral * r)94 NTSTATUS vfs_not_implemented_get_dfs_referrals(struct vfs_handle_struct *handle,
95 					       struct dfs_GetDFSReferral *r)
96 {
97 	return NT_STATUS_NOT_IMPLEMENTED;
98 }
99 
vfs_not_implemented_create_dfs_pathat(struct vfs_handle_struct * handle,struct files_struct * dirfsp,const struct smb_filename * smb_fname,const struct referral * reflist,size_t referral_count)100 NTSTATUS vfs_not_implemented_create_dfs_pathat(struct vfs_handle_struct *handle,
101 				struct files_struct *dirfsp,
102 				const struct smb_filename *smb_fname,
103 				const struct referral *reflist,
104 				size_t referral_count)
105 {
106 	return NT_STATUS_NOT_IMPLEMENTED;
107 }
108 
vfs_not_implemented_read_dfs_pathat(struct vfs_handle_struct * handle,TALLOC_CTX * mem_ctx,struct files_struct * dirfsp,const struct smb_filename * smb_fname,struct referral ** ppreflist,size_t * preferral_count)109 NTSTATUS vfs_not_implemented_read_dfs_pathat(struct vfs_handle_struct *handle,
110 				TALLOC_CTX *mem_ctx,
111 				struct files_struct *dirfsp,
112 				const struct smb_filename *smb_fname,
113 				struct referral **ppreflist,
114 				size_t *preferral_count)
115 {
116 	return NT_STATUS_NOT_IMPLEMENTED;
117 }
118 
vfs_not_implemented_opendir(vfs_handle_struct * handle,const struct smb_filename * smb_fname,const char * mask,uint32_t attr)119 DIR *vfs_not_implemented_opendir(vfs_handle_struct *handle,
120 			const struct smb_filename *smb_fname,
121 			const char *mask,
122 			uint32_t attr)
123 {
124 	return NULL;
125 }
126 
vfs_not_implemented_snap_check_path(struct vfs_handle_struct * handle,TALLOC_CTX * mem_ctx,const char * service_path,char ** base_volume)127 NTSTATUS vfs_not_implemented_snap_check_path(struct vfs_handle_struct *handle,
128 				TALLOC_CTX *mem_ctx,
129 				const char *service_path,
130 				char **base_volume)
131 {
132 	return NT_STATUS_NOT_SUPPORTED;
133 }
134 
vfs_not_implemented_snap_create(struct vfs_handle_struct * handle,TALLOC_CTX * mem_ctx,const char * base_volume,time_t * tstamp,bool rw,char ** base_path,char ** snap_path)135 NTSTATUS vfs_not_implemented_snap_create(struct vfs_handle_struct *handle,
136 					 TALLOC_CTX *mem_ctx,
137 					 const char *base_volume,
138 					 time_t *tstamp,
139 					 bool rw,
140 					 char **base_path,
141 					 char **snap_path)
142 {
143 	return NT_STATUS_NOT_SUPPORTED;
144 }
145 
vfs_not_implemented_snap_delete(struct vfs_handle_struct * handle,TALLOC_CTX * mem_ctx,char * base_path,char * snap_path)146 NTSTATUS vfs_not_implemented_snap_delete(struct vfs_handle_struct *handle,
147 					 TALLOC_CTX *mem_ctx,
148 					 char *base_path,
149 					 char *snap_path)
150 {
151 	return NT_STATUS_NOT_SUPPORTED;
152 }
153 
vfs_not_implemented_fdopendir(vfs_handle_struct * handle,files_struct * fsp,const char * mask,uint32_t attr)154 DIR *vfs_not_implemented_fdopendir(vfs_handle_struct *handle, files_struct *fsp,
155 				   const char *mask, uint32_t attr)
156 {
157 	errno = ENOSYS;
158 	return NULL;
159 }
160 
vfs_not_implemented_readdir(vfs_handle_struct * handle,DIR * dirp,SMB_STRUCT_STAT * sbuf)161 struct dirent *vfs_not_implemented_readdir(vfs_handle_struct *handle,
162 					   DIR *dirp, SMB_STRUCT_STAT *sbuf)
163 {
164 	errno = ENOSYS;
165 	return NULL;
166 }
167 
vfs_not_implemented_seekdir(vfs_handle_struct * handle,DIR * dirp,long offset)168 void vfs_not_implemented_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset)
169 {
170 	;
171 }
172 
vfs_not_implemented_telldir(vfs_handle_struct * handle,DIR * dirp)173 long vfs_not_implemented_telldir(vfs_handle_struct *handle, DIR *dirp)
174 {
175 	errno = ENOSYS;
176 	return (long)-1;
177 }
178 
vfs_not_implemented_rewind_dir(vfs_handle_struct * handle,DIR * dirp)179 void vfs_not_implemented_rewind_dir(vfs_handle_struct *handle, DIR *dirp)
180 {
181 	;
182 }
183 
vfs_not_implemented_mkdirat(vfs_handle_struct * handle,struct files_struct * dirfsp,const struct smb_filename * smb_fname,mode_t mode)184 int vfs_not_implemented_mkdirat(vfs_handle_struct *handle,
185 		struct files_struct *dirfsp,
186 		const struct smb_filename *smb_fname,
187 		mode_t mode)
188 {
189 	errno = ENOSYS;
190 	return -1;
191 }
192 
vfs_not_implemented_closedir(vfs_handle_struct * handle,DIR * dir)193 int vfs_not_implemented_closedir(vfs_handle_struct *handle, DIR *dir)
194 {
195 	errno = ENOSYS;
196 	return -1;
197 }
198 
vfs_not_implemented_open(vfs_handle_struct * handle,struct smb_filename * smb_fname,files_struct * fsp,int flags,mode_t mode)199 int vfs_not_implemented_open(vfs_handle_struct *handle,
200 			     struct smb_filename *smb_fname,
201 			     files_struct *fsp, int flags, mode_t mode)
202 {
203 	errno = ENOSYS;
204 	return -1;
205 }
206 
vfs_not_implemented_create_file(struct vfs_handle_struct * handle,struct smb_request * req,uint16_t root_dir_fid,struct smb_filename * smb_fname,uint32_t access_mask,uint32_t share_access,uint32_t create_disposition,uint32_t create_options,uint32_t file_attributes,uint32_t oplock_request,const struct smb2_lease * lease,uint64_t allocation_size,uint32_t private_flags,struct security_descriptor * sd,struct ea_list * ea_list,files_struct ** result,int * pinfo,const struct smb2_create_blobs * in_context_blobs,struct smb2_create_blobs * out_context_blobs)207 NTSTATUS vfs_not_implemented_create_file(struct vfs_handle_struct *handle,
208 				struct smb_request *req,
209 				uint16_t root_dir_fid,
210 				struct smb_filename *smb_fname,
211 				uint32_t access_mask,
212 				uint32_t share_access,
213 				uint32_t create_disposition,
214 				uint32_t create_options,
215 				uint32_t file_attributes,
216 				uint32_t oplock_request,
217 				const struct smb2_lease *lease,
218 				uint64_t allocation_size,
219 				uint32_t private_flags,
220 				struct security_descriptor *sd,
221 				struct ea_list *ea_list,
222 				files_struct **result, int *pinfo,
223 				const struct smb2_create_blobs *in_context_blobs,
224 				struct smb2_create_blobs *out_context_blobs)
225 {
226 	return NT_STATUS_NOT_IMPLEMENTED;
227 }
228 
vfs_not_implemented_close_fn(vfs_handle_struct * handle,files_struct * fsp)229 int vfs_not_implemented_close_fn(vfs_handle_struct *handle, files_struct *fsp)
230 {
231 	errno = ENOSYS;
232 	return -1;
233 }
234 
vfs_not_implemented_pread(vfs_handle_struct * handle,files_struct * fsp,void * data,size_t n,off_t offset)235 ssize_t vfs_not_implemented_pread(vfs_handle_struct *handle, files_struct *fsp,
236 				  void *data, size_t n, off_t offset)
237 {
238 	errno = ENOSYS;
239 	return -1;
240 }
241 
vfs_not_implemented_pread_send(struct vfs_handle_struct * handle,TALLOC_CTX * mem_ctx,struct tevent_context * ev,struct files_struct * fsp,void * data,size_t n,off_t offset)242 struct tevent_req *vfs_not_implemented_pread_send(struct vfs_handle_struct *handle,
243 						  TALLOC_CTX *mem_ctx,
244 						  struct tevent_context *ev,
245 						  struct files_struct *fsp,
246 						  void *data, size_t n, off_t offset)
247 {
248 	return NULL;
249 }
250 
vfs_not_implemented_pread_recv(struct tevent_req * req,struct vfs_aio_state * vfs_aio_state)251 ssize_t vfs_not_implemented_pread_recv(struct tevent_req *req,
252 				       struct vfs_aio_state *vfs_aio_state)
253 {
254 	vfs_aio_state->error = ENOSYS;
255 	return -1;
256 }
257 
vfs_not_implemented_pwrite(vfs_handle_struct * handle,files_struct * fsp,const void * data,size_t n,off_t offset)258 ssize_t vfs_not_implemented_pwrite(vfs_handle_struct *handle, files_struct *fsp,
259 				   const void *data, size_t n, off_t offset)
260 {
261 	errno = ENOSYS;
262 	return -1;
263 }
264 
vfs_not_implemented_pwrite_send(struct vfs_handle_struct * handle,TALLOC_CTX * mem_ctx,struct tevent_context * ev,struct files_struct * fsp,const void * data,size_t n,off_t offset)265 struct tevent_req *vfs_not_implemented_pwrite_send(struct vfs_handle_struct *handle,
266 						   TALLOC_CTX *mem_ctx,
267 						   struct tevent_context *ev,
268 						   struct files_struct *fsp,
269 						   const void *data,
270 						   size_t n, off_t offset)
271 {
272 	return NULL;
273 }
274 
vfs_not_implemented_pwrite_recv(struct tevent_req * req,struct vfs_aio_state * vfs_aio_state)275 ssize_t vfs_not_implemented_pwrite_recv(struct tevent_req *req,
276 				struct vfs_aio_state *vfs_aio_state)
277 {
278 	vfs_aio_state->error = ENOSYS;
279 	return -1;
280 }
281 
vfs_not_implemented_lseek(vfs_handle_struct * handle,files_struct * fsp,off_t offset,int whence)282 off_t vfs_not_implemented_lseek(vfs_handle_struct *handle, files_struct *fsp,
283 			off_t offset, int whence)
284 {
285 	errno = ENOSYS;
286 	return (off_t) - 1;
287 }
288 
vfs_not_implemented_sendfile(vfs_handle_struct * handle,int tofd,files_struct * fromfsp,const DATA_BLOB * hdr,off_t offset,size_t n)289 ssize_t vfs_not_implemented_sendfile(vfs_handle_struct *handle, int tofd,
290 				     files_struct *fromfsp, const DATA_BLOB *hdr,
291 				     off_t offset, size_t n)
292 {
293 	errno = ENOSYS;
294 	return -1;
295 }
296 
vfs_not_implemented_recvfile(vfs_handle_struct * handle,int fromfd,files_struct * tofsp,off_t offset,size_t n)297 ssize_t vfs_not_implemented_recvfile(vfs_handle_struct *handle, int fromfd,
298 				     files_struct *tofsp, off_t offset, size_t n)
299 {
300 	errno = ENOSYS;
301 	return -1;
302 }
303 
vfs_not_implemented_renameat(vfs_handle_struct * handle,files_struct * srcfsp,const struct smb_filename * smb_fname_src,files_struct * dstfsp,const struct smb_filename * smb_fname_dst)304 int vfs_not_implemented_renameat(vfs_handle_struct *handle,
305 			       files_struct *srcfsp,
306 			       const struct smb_filename *smb_fname_src,
307 			       files_struct *dstfsp,
308 			       const struct smb_filename *smb_fname_dst)
309 {
310 	errno = ENOSYS;
311 	return -1;
312 }
313 
vfs_not_implemented_fsync_send(struct vfs_handle_struct * handle,TALLOC_CTX * mem_ctx,struct tevent_context * ev,struct files_struct * fsp)314 struct tevent_req *vfs_not_implemented_fsync_send(struct vfs_handle_struct *handle,
315 						  TALLOC_CTX *mem_ctx,
316 						  struct tevent_context *ev,
317 						  struct files_struct *fsp)
318 {
319 	return NULL;
320 }
321 
vfs_not_implemented_fsync_recv(struct tevent_req * req,struct vfs_aio_state * vfs_aio_state)322 int vfs_not_implemented_fsync_recv(struct tevent_req *req,
323 				   struct vfs_aio_state *vfs_aio_state)
324 {
325 	vfs_aio_state->error = ENOSYS;
326 	return -1;
327 }
328 
vfs_not_implemented_stat(vfs_handle_struct * handle,struct smb_filename * smb_fname)329 int vfs_not_implemented_stat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
330 {
331 	errno = ENOSYS;
332 	return -1;
333 }
334 
vfs_not_implemented_fstat(vfs_handle_struct * handle,files_struct * fsp,SMB_STRUCT_STAT * sbuf)335 int vfs_not_implemented_fstat(vfs_handle_struct *handle, files_struct *fsp,
336 			SMB_STRUCT_STAT *sbuf)
337 {
338 	errno = ENOSYS;
339 	return -1;
340 }
341 
vfs_not_implemented_lstat(vfs_handle_struct * handle,struct smb_filename * smb_fname)342 int vfs_not_implemented_lstat(vfs_handle_struct *handle,
343 			      struct smb_filename *smb_fname)
344 {
345 	errno = ENOSYS;
346 	return -1;
347 }
348 
vfs_not_implemented_get_alloc_size(struct vfs_handle_struct * handle,struct files_struct * fsp,const SMB_STRUCT_STAT * sbuf)349 uint64_t vfs_not_implemented_get_alloc_size(struct vfs_handle_struct *handle,
350 					    struct files_struct *fsp,
351 					    const SMB_STRUCT_STAT *sbuf)
352 {
353 	errno = ENOSYS;
354 	return -1;
355 }
356 
vfs_not_implemented_unlinkat(vfs_handle_struct * handle,struct files_struct * dirfsp,const struct smb_filename * smb_fname,int flags)357 int vfs_not_implemented_unlinkat(vfs_handle_struct *handle,
358 			struct files_struct *dirfsp,
359 			const struct smb_filename *smb_fname,
360 			int flags)
361 {
362 	errno = ENOSYS;
363 	return -1;
364 }
365 
vfs_not_implemented_chmod(vfs_handle_struct * handle,const struct smb_filename * smb_fname,mode_t mode)366 int vfs_not_implemented_chmod(vfs_handle_struct *handle,
367 			      const struct smb_filename *smb_fname,
368 			      mode_t mode)
369 {
370 	errno = ENOSYS;
371 	return -1;
372 }
373 
vfs_not_implemented_fchmod(vfs_handle_struct * handle,files_struct * fsp,mode_t mode)374 int vfs_not_implemented_fchmod(vfs_handle_struct *handle, files_struct *fsp,
375 			       mode_t mode)
376 {
377 	errno = ENOSYS;
378 	return -1;
379 }
380 
vfs_not_implemented_fchown(vfs_handle_struct * handle,files_struct * fsp,uid_t uid,gid_t gid)381 int vfs_not_implemented_fchown(vfs_handle_struct *handle, files_struct *fsp,
382 			       uid_t uid, gid_t gid)
383 {
384 	errno = ENOSYS;
385 	return -1;
386 }
387 
vfs_not_implemented_lchown(vfs_handle_struct * handle,const struct smb_filename * smb_fname,uid_t uid,gid_t gid)388 int vfs_not_implemented_lchown(vfs_handle_struct *handle,
389 			       const struct smb_filename *smb_fname,
390 			       uid_t uid,
391 			       gid_t gid)
392 {
393 	errno = ENOSYS;
394 	return -1;
395 }
396 
vfs_not_implemented_chdir(vfs_handle_struct * handle,const struct smb_filename * smb_fname)397 int vfs_not_implemented_chdir(vfs_handle_struct *handle,
398 			      const struct smb_filename *smb_fname)
399 {
400 	errno = ENOSYS;
401 	return -1;
402 }
403 
vfs_not_implemented_getwd(vfs_handle_struct * handle,TALLOC_CTX * ctx)404 struct smb_filename *vfs_not_implemented_getwd(vfs_handle_struct *handle,
405 					       TALLOC_CTX *ctx)
406 {
407 	errno = ENOSYS;
408 	return NULL;
409 }
410 
vfs_not_implemented_ntimes(vfs_handle_struct * handle,const struct smb_filename * smb_fname,struct smb_file_time * ft)411 int vfs_not_implemented_ntimes(vfs_handle_struct *handle,
412 			       const struct smb_filename *smb_fname,
413 			       struct smb_file_time *ft)
414 {
415 	errno = ENOSYS;
416 	return -1;
417 }
418 
vfs_not_implemented_ftruncate(vfs_handle_struct * handle,files_struct * fsp,off_t offset)419 int vfs_not_implemented_ftruncate(vfs_handle_struct *handle, files_struct *fsp,
420 				  off_t offset)
421 {
422 	errno = ENOSYS;
423 	return -1;
424 }
425 
vfs_not_implemented_fallocate(vfs_handle_struct * handle,files_struct * fsp,uint32_t mode,off_t offset,off_t len)426 int vfs_not_implemented_fallocate(vfs_handle_struct *handle, files_struct *fsp,
427 				  uint32_t mode, off_t offset, off_t len)
428 {
429 	errno = ENOSYS;
430 	return -1;
431 }
432 
vfs_not_implemented_lock(vfs_handle_struct * handle,files_struct * fsp,int op,off_t offset,off_t count,int type)433 bool vfs_not_implemented_lock(vfs_handle_struct *handle, files_struct *fsp, int op,
434 			      off_t offset, off_t count, int type)
435 {
436 	errno = ENOSYS;
437 	return false;
438 }
439 
vfs_not_implemented_kernel_flock(struct vfs_handle_struct * handle,struct files_struct * fsp,uint32_t share_access,uint32_t access_mask)440 int vfs_not_implemented_kernel_flock(struct vfs_handle_struct *handle,
441 				     struct files_struct *fsp,
442 				     uint32_t share_access, uint32_t access_mask)
443 {
444 	errno = ENOSYS;
445 	return -1;
446 }
447 
vfs_not_implemented_fcntl(struct vfs_handle_struct * handle,struct files_struct * fsp,int cmd,va_list cmd_arg)448 int vfs_not_implemented_fcntl(struct vfs_handle_struct *handle,
449 			      struct files_struct *fsp, int cmd,
450 			      va_list cmd_arg)
451 {
452 	errno = ENOSYS;
453 	return -1;
454 }
455 
vfs_not_implemented_linux_setlease(struct vfs_handle_struct * handle,struct files_struct * fsp,int leasetype)456 int vfs_not_implemented_linux_setlease(struct vfs_handle_struct *handle,
457 				       struct files_struct *fsp, int leasetype)
458 {
459 	errno = ENOSYS;
460 	return -1;
461 }
462 
vfs_not_implemented_getlock(vfs_handle_struct * handle,files_struct * fsp,off_t * poffset,off_t * pcount,int * ptype,pid_t * ppid)463 bool vfs_not_implemented_getlock(vfs_handle_struct *handle, files_struct *fsp,
464 				 off_t *poffset, off_t *pcount, int *ptype,
465 				 pid_t *ppid)
466 {
467 	errno = ENOSYS;
468 	return false;
469 }
470 
vfs_not_implemented_symlinkat(vfs_handle_struct * handle,const char * link_contents,struct files_struct * dirfsp,const struct smb_filename * new_smb_fname)471 int vfs_not_implemented_symlinkat(vfs_handle_struct *handle,
472 				const char *link_contents,
473 				struct files_struct *dirfsp,
474 				const struct smb_filename *new_smb_fname)
475 {
476 	errno = ENOSYS;
477 	return -1;
478 }
479 
vfs_not_implemented_vfs_readlinkat(vfs_handle_struct * handle,files_struct * dirfsp,const struct smb_filename * smb_fname,char * buf,size_t bufsiz)480 int vfs_not_implemented_vfs_readlinkat(vfs_handle_struct *handle,
481 			files_struct *dirfsp,
482 			const struct smb_filename *smb_fname,
483 			char *buf,
484 			size_t bufsiz)
485 {
486 	errno = ENOSYS;
487 	return -1;
488 }
489 
vfs_not_implemented_linkat(vfs_handle_struct * handle,files_struct * srcfsp,const struct smb_filename * old_smb_fname,files_struct * dstfsp,const struct smb_filename * new_smb_fname,int flags)490 int vfs_not_implemented_linkat(vfs_handle_struct *handle,
491 			files_struct *srcfsp,
492 			const struct smb_filename *old_smb_fname,
493 			files_struct *dstfsp,
494 			const struct smb_filename *new_smb_fname,
495 			int flags)
496 {
497 	errno = ENOSYS;
498 	return -1;
499 }
500 
vfs_not_implemented_mknodat(vfs_handle_struct * handle,files_struct * dirfsp,const struct smb_filename * smb_fname,mode_t mode,SMB_DEV_T dev)501 int vfs_not_implemented_mknodat(vfs_handle_struct *handle,
502 			files_struct *dirfsp,
503 			const struct smb_filename *smb_fname,
504 			mode_t mode,
505 			SMB_DEV_T dev)
506 {
507 	errno = ENOSYS;
508 	return -1;
509 }
510 
vfs_not_implemented_realpath(vfs_handle_struct * handle,TALLOC_CTX * ctx,const struct smb_filename * smb_fname)511 struct smb_filename *vfs_not_implemented_realpath(vfs_handle_struct *handle,
512 						  TALLOC_CTX *ctx,
513 						  const struct smb_filename *smb_fname)
514 {
515 	errno = ENOSYS;
516 	return NULL;
517 }
518 
vfs_not_implemented_chflags(vfs_handle_struct * handle,const struct smb_filename * smb_fname,uint flags)519 int vfs_not_implemented_chflags(vfs_handle_struct *handle,
520 				const struct smb_filename *smb_fname,
521 				uint flags)
522 {
523 	errno = ENOSYS;
524 	return -1;
525 }
526 
vfs_not_implemented_file_id_create(vfs_handle_struct * handle,const SMB_STRUCT_STAT * sbuf)527 struct file_id vfs_not_implemented_file_id_create(vfs_handle_struct *handle,
528 						  const SMB_STRUCT_STAT *sbuf)
529 {
530 	struct file_id id;
531 	ZERO_STRUCT(id);
532 	errno = ENOSYS;
533 	return id;
534 }
535 
vfs_not_implemented_fs_file_id(vfs_handle_struct * handle,const SMB_STRUCT_STAT * sbuf)536 uint64_t vfs_not_implemented_fs_file_id(vfs_handle_struct *handle,
537 					const SMB_STRUCT_STAT *sbuf)
538 {
539 	errno = ENOSYS;
540 	return 0;
541 }
542 
543 struct vfs_not_implemented_offload_read_state {
544 	bool dummy;
545 };
546 
vfs_not_implemented_offload_read_send(TALLOC_CTX * mem_ctx,struct tevent_context * ev,struct vfs_handle_struct * handle,struct files_struct * fsp,uint32_t fsctl,uint32_t ttl,off_t offset,size_t to_copy)547 struct tevent_req *vfs_not_implemented_offload_read_send(
548 			TALLOC_CTX *mem_ctx,
549 			struct tevent_context *ev,
550 			struct vfs_handle_struct *handle,
551 			struct files_struct *fsp,
552 			uint32_t fsctl,
553 			uint32_t ttl,
554 			off_t offset,
555 			size_t to_copy)
556 {
557 	struct tevent_req *req = NULL;
558 	struct vfs_not_implemented_offload_read_state *state = NULL;
559 
560 	req = tevent_req_create(mem_ctx, &state,
561 				struct vfs_not_implemented_offload_read_state);
562 	if (req == NULL) {
563 		return NULL;
564 	}
565 
566 	tevent_req_nterror(req, NT_STATUS_NOT_IMPLEMENTED);
567 	return tevent_req_post(req, ev);
568 }
569 
vfs_not_implemented_offload_read_recv(struct tevent_req * req,struct vfs_handle_struct * handle,TALLOC_CTX * mem_ctx,DATA_BLOB * _token_blob)570 NTSTATUS vfs_not_implemented_offload_read_recv(struct tevent_req *req,
571 				       struct vfs_handle_struct *handle,
572 				       TALLOC_CTX *mem_ctx,
573 				       DATA_BLOB *_token_blob)
574 {
575 	NTSTATUS status;
576 
577 	if (tevent_req_is_nterror(req, &status)) {
578 		tevent_req_received(req);
579 		return status;
580 	}
581 
582 	tevent_req_received(req);
583 	return NT_STATUS_OK;
584 }
585 
586 struct vfs_not_implemented_offload_write_state {
587 	uint64_t unused;
588 };
589 
vfs_not_implemented_offload_write_send(struct vfs_handle_struct * handle,TALLOC_CTX * mem_ctx,struct tevent_context * ev,uint32_t fsctl,DATA_BLOB * token,off_t transfer_offset,struct files_struct * dest_fsp,off_t dest_off,off_t num)590 struct tevent_req *vfs_not_implemented_offload_write_send(
591 			struct vfs_handle_struct *handle,
592 			TALLOC_CTX *mem_ctx,
593 			struct tevent_context *ev,
594 			uint32_t fsctl,
595 			DATA_BLOB *token,
596 			off_t transfer_offset,
597 			struct files_struct *dest_fsp,
598 			off_t dest_off,
599 			off_t num)
600 {
601 	struct tevent_req *req;
602 	struct vfs_not_implemented_offload_write_state *state;
603 
604 	req = tevent_req_create(mem_ctx, &state,
605 				struct vfs_not_implemented_offload_write_state);
606 	if (req == NULL) {
607 		return NULL;
608 	}
609 
610 	tevent_req_nterror(req, NT_STATUS_NOT_IMPLEMENTED);
611 	return tevent_req_post(req, ev);
612 }
613 
vfs_not_implemented_offload_write_recv(struct vfs_handle_struct * handle,struct tevent_req * req,off_t * copied)614 NTSTATUS vfs_not_implemented_offload_write_recv(struct vfs_handle_struct *handle,
615 						struct tevent_req *req,
616 						off_t *copied)
617 {
618 	NTSTATUS status;
619 
620 	if (tevent_req_is_nterror(req, &status)) {
621 		tevent_req_received(req);
622 		return status;
623 	}
624 
625 	tevent_req_received(req);
626 	return NT_STATUS_OK;
627 }
628 
vfs_not_implemented_get_compression(struct vfs_handle_struct * handle,TALLOC_CTX * mem_ctx,struct files_struct * fsp,struct smb_filename * smb_fname,uint16_t * _compression_fmt)629 NTSTATUS vfs_not_implemented_get_compression(struct vfs_handle_struct *handle,
630 					     TALLOC_CTX *mem_ctx,
631 					     struct files_struct *fsp,
632 					     struct smb_filename *smb_fname,
633 					     uint16_t *_compression_fmt)
634 {
635 	return NT_STATUS_INVALID_DEVICE_REQUEST;
636 }
637 
vfs_not_implemented_set_compression(struct vfs_handle_struct * handle,TALLOC_CTX * mem_ctx,struct files_struct * fsp,uint16_t compression_fmt)638 NTSTATUS vfs_not_implemented_set_compression(struct vfs_handle_struct *handle,
639 					     TALLOC_CTX *mem_ctx,
640 					     struct files_struct *fsp,
641 					     uint16_t compression_fmt)
642 {
643 	return NT_STATUS_INVALID_DEVICE_REQUEST;
644 }
645 
vfs_not_implemented_streaminfo(struct vfs_handle_struct * handle,struct files_struct * fsp,const struct smb_filename * smb_fname,TALLOC_CTX * mem_ctx,unsigned int * num_streams,struct stream_struct ** streams)646 NTSTATUS vfs_not_implemented_streaminfo(struct vfs_handle_struct *handle,
647 					struct files_struct *fsp,
648 					const struct smb_filename *smb_fname,
649 					TALLOC_CTX *mem_ctx,
650 					unsigned int *num_streams,
651 					struct stream_struct **streams)
652 {
653 	return NT_STATUS_NOT_IMPLEMENTED;
654 }
655 
vfs_not_implemented_get_real_filename(struct vfs_handle_struct * handle,const char * path,const char * name,TALLOC_CTX * mem_ctx,char ** found_name)656 int vfs_not_implemented_get_real_filename(struct vfs_handle_struct *handle,
657 					  const char *path,
658 					  const char *name,
659 					  TALLOC_CTX *mem_ctx,
660 					  char **found_name)
661 {
662 	errno = ENOSYS;
663 	return -1;
664 }
665 
vfs_not_implemented_connectpath(struct vfs_handle_struct * handle,const struct smb_filename * smb_fname)666 const char *vfs_not_implemented_connectpath(struct vfs_handle_struct *handle,
667 					    const struct smb_filename *smb_fname)
668 {
669 	errno = ENOSYS;
670 	return NULL;
671 }
672 
vfs_not_implemented_brl_lock_windows(struct vfs_handle_struct * handle,struct byte_range_lock * br_lck,struct lock_struct * plock)673 NTSTATUS vfs_not_implemented_brl_lock_windows(struct vfs_handle_struct *handle,
674 					      struct byte_range_lock *br_lck,
675 					      struct lock_struct *plock)
676 {
677 	return NT_STATUS_NOT_IMPLEMENTED;
678 }
679 
vfs_not_implemented_brl_unlock_windows(struct vfs_handle_struct * handle,struct byte_range_lock * br_lck,const struct lock_struct * plock)680 bool vfs_not_implemented_brl_unlock_windows(struct vfs_handle_struct *handle,
681 					    struct byte_range_lock *br_lck,
682 					    const struct lock_struct *plock)
683 {
684 	errno = ENOSYS;
685 	return false;
686 }
687 
vfs_not_implemented_strict_lock_check(struct vfs_handle_struct * handle,struct files_struct * fsp,struct lock_struct * plock)688 bool vfs_not_implemented_strict_lock_check(struct vfs_handle_struct *handle,
689 					   struct files_struct *fsp,
690 					   struct lock_struct *plock)
691 {
692 	errno = ENOSYS;
693 	return false;
694 }
695 
vfs_not_implemented_translate_name(struct vfs_handle_struct * handle,const char * mapped_name,enum vfs_translate_direction direction,TALLOC_CTX * mem_ctx,char ** pmapped_name)696 NTSTATUS vfs_not_implemented_translate_name(struct vfs_handle_struct *handle,
697 					    const char *mapped_name,
698 					    enum vfs_translate_direction direction,
699 					    TALLOC_CTX *mem_ctx, char **pmapped_name)
700 {
701 	return NT_STATUS_NOT_IMPLEMENTED;
702 }
703 
vfs_not_implemented_fsctl(struct vfs_handle_struct * handle,struct files_struct * fsp,TALLOC_CTX * ctx,uint32_t function,uint16_t req_flags,const uint8_t * _in_data,uint32_t in_len,uint8_t ** _out_data,uint32_t max_out_len,uint32_t * out_len)704 NTSTATUS vfs_not_implemented_fsctl(struct vfs_handle_struct *handle,
705 				   struct files_struct *fsp,
706 				   TALLOC_CTX *ctx,
707 				   uint32_t function,
708 				   uint16_t req_flags,	/* Needed for UNICODE ... */
709 				   const uint8_t *_in_data,
710 				   uint32_t in_len,
711 				   uint8_t **_out_data,
712 				   uint32_t max_out_len, uint32_t *out_len)
713 {
714 	return NT_STATUS_NOT_IMPLEMENTED;
715 }
716 
vfs_not_implemented_readdir_attr(struct vfs_handle_struct * handle,const struct smb_filename * fname,TALLOC_CTX * mem_ctx,struct readdir_attr_data ** pattr_data)717 NTSTATUS vfs_not_implemented_readdir_attr(struct vfs_handle_struct *handle,
718 					  const struct smb_filename *fname,
719 					  TALLOC_CTX *mem_ctx,
720 					  struct readdir_attr_data **pattr_data)
721 {
722 	return NT_STATUS_NOT_IMPLEMENTED;
723 }
724 
vfs_not_implemented_get_dos_attributes(struct vfs_handle_struct * handle,struct smb_filename * smb_fname,uint32_t * dosmode)725 NTSTATUS vfs_not_implemented_get_dos_attributes(struct vfs_handle_struct *handle,
726 						struct smb_filename *smb_fname,
727 						uint32_t *dosmode)
728 {
729 	return NT_STATUS_NOT_IMPLEMENTED;
730 }
731 
732 struct vfs_not_implemented_get_dos_attributes_state {
733 	struct vfs_aio_state aio_state;
734 	uint32_t dosmode;
735 };
736 
vfs_not_implemented_get_dos_attributes_send(TALLOC_CTX * mem_ctx,struct tevent_context * ev,struct vfs_handle_struct * handle,files_struct * dir_fsp,struct smb_filename * smb_fname)737 struct tevent_req *vfs_not_implemented_get_dos_attributes_send(
738 			TALLOC_CTX *mem_ctx,
739 			struct tevent_context *ev,
740 			struct vfs_handle_struct *handle,
741 			files_struct *dir_fsp,
742 			struct smb_filename *smb_fname)
743 {
744 	struct tevent_req *req = NULL;
745 	struct vfs_not_implemented_get_dos_attributes_state *state = NULL;
746 
747 	req = tevent_req_create(mem_ctx, &state,
748 			struct vfs_not_implemented_get_dos_attributes_state);
749 	if (req == NULL) {
750 		return NULL;
751 	}
752 
753 	tevent_req_nterror(req, NT_STATUS_NOT_IMPLEMENTED);
754 	return tevent_req_post(req, ev);
755 }
756 
vfs_not_implemented_get_dos_attributes_recv(struct tevent_req * req,struct vfs_aio_state * aio_state,uint32_t * dosmode)757 NTSTATUS vfs_not_implemented_get_dos_attributes_recv(
758 			struct tevent_req *req,
759 			struct vfs_aio_state *aio_state,
760 			uint32_t *dosmode)
761 {
762 	struct vfs_not_implemented_get_dos_attributes_state *state =
763 		tevent_req_data(req,
764 		struct vfs_not_implemented_get_dos_attributes_state);
765 	NTSTATUS status;
766 
767 	if (tevent_req_is_nterror(req, &status)) {
768 		tevent_req_received(req);
769 		return status;
770 	}
771 
772 	*aio_state = state->aio_state;
773 	*dosmode = state->dosmode;
774 	tevent_req_received(req);
775 	return NT_STATUS_OK;
776 }
777 
vfs_not_implemented_fget_dos_attributes(struct vfs_handle_struct * handle,struct files_struct * fsp,uint32_t * dosmode)778 NTSTATUS vfs_not_implemented_fget_dos_attributes(struct vfs_handle_struct *handle,
779 						 struct files_struct *fsp,
780 						 uint32_t *dosmode)
781 {
782 	return NT_STATUS_NOT_IMPLEMENTED;
783 }
784 
vfs_not_implemented_set_dos_attributes(struct vfs_handle_struct * handle,const struct smb_filename * smb_fname,uint32_t dosmode)785 NTSTATUS vfs_not_implemented_set_dos_attributes(struct vfs_handle_struct *handle,
786 						const struct smb_filename *smb_fname,
787 						uint32_t dosmode)
788 {
789 	return NT_STATUS_NOT_IMPLEMENTED;
790 }
791 
vfs_not_implemented_fset_dos_attributes(struct vfs_handle_struct * handle,struct files_struct * fsp,uint32_t dosmode)792 NTSTATUS vfs_not_implemented_fset_dos_attributes(struct vfs_handle_struct *handle,
793 						 struct files_struct *fsp,
794 						 uint32_t dosmode)
795 {
796 	return NT_STATUS_NOT_IMPLEMENTED;
797 }
798 
vfs_not_implemented_fget_nt_acl(vfs_handle_struct * handle,files_struct * fsp,uint32_t security_info,TALLOC_CTX * mem_ctx,struct security_descriptor ** ppdesc)799 NTSTATUS vfs_not_implemented_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
800 					 uint32_t security_info,
801 					 TALLOC_CTX *mem_ctx,
802 					 struct security_descriptor **ppdesc)
803 {
804 	return NT_STATUS_NOT_IMPLEMENTED;
805 }
806 
vfs_not_implemented_get_nt_acl(vfs_handle_struct * handle,const struct smb_filename * smb_fname,uint32_t security_info,TALLOC_CTX * mem_ctx,struct security_descriptor ** ppdesc)807 NTSTATUS vfs_not_implemented_get_nt_acl(vfs_handle_struct *handle,
808 					const struct smb_filename *smb_fname,
809 					uint32_t security_info,
810 					TALLOC_CTX *mem_ctx,
811 					struct security_descriptor **ppdesc)
812 {
813 	return NT_STATUS_NOT_IMPLEMENTED;
814 }
815 
vfs_not_implemented_fset_nt_acl(vfs_handle_struct * handle,files_struct * fsp,uint32_t security_info_sent,const struct security_descriptor * psd)816 NTSTATUS vfs_not_implemented_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
817 					 uint32_t security_info_sent,
818 					 const struct security_descriptor *psd)
819 {
820 	return NT_STATUS_NOT_IMPLEMENTED;
821 }
822 
vfs_not_implemented_sys_acl_get_file(vfs_handle_struct * handle,const struct smb_filename * smb_fname,SMB_ACL_TYPE_T type,TALLOC_CTX * mem_ctx)823 SMB_ACL_T vfs_not_implemented_sys_acl_get_file(vfs_handle_struct *handle,
824 					       const struct smb_filename *smb_fname,
825 					       SMB_ACL_TYPE_T type,
826 					       TALLOC_CTX *mem_ctx)
827 {
828 	errno = ENOSYS;
829 	return (SMB_ACL_T) NULL;
830 }
831 
vfs_not_implemented_sys_acl_get_fd(vfs_handle_struct * handle,files_struct * fsp,TALLOC_CTX * mem_ctx)832 SMB_ACL_T vfs_not_implemented_sys_acl_get_fd(vfs_handle_struct *handle,
833 					     files_struct *fsp, TALLOC_CTX *mem_ctx)
834 {
835 	errno = ENOSYS;
836 	return (SMB_ACL_T) NULL;
837 }
838 
vfs_not_implemented_sys_acl_blob_get_file(vfs_handle_struct * handle,const struct smb_filename * smb_fname,TALLOC_CTX * mem_ctx,char ** blob_description,DATA_BLOB * blob)839 int vfs_not_implemented_sys_acl_blob_get_file(vfs_handle_struct *handle,
840 				const struct smb_filename *smb_fname,
841 				TALLOC_CTX *mem_ctx,
842 				char **blob_description,
843 				DATA_BLOB *blob)
844 {
845 	errno = ENOSYS;
846 	return -1;
847 }
848 
vfs_not_implemented_sys_acl_blob_get_fd(vfs_handle_struct * handle,files_struct * fsp,TALLOC_CTX * mem_ctx,char ** blob_description,DATA_BLOB * blob)849 int vfs_not_implemented_sys_acl_blob_get_fd(vfs_handle_struct *handle,
850 				files_struct *fsp, TALLOC_CTX *mem_ctx,
851 				char **blob_description, DATA_BLOB *blob)
852 {
853 	errno = ENOSYS;
854 	return -1;
855 }
856 
vfs_not_implemented_sys_acl_set_file(vfs_handle_struct * handle,const struct smb_filename * smb_fname,SMB_ACL_TYPE_T acltype,SMB_ACL_T theacl)857 int vfs_not_implemented_sys_acl_set_file(vfs_handle_struct *handle,
858 				const struct smb_filename *smb_fname,
859 				SMB_ACL_TYPE_T acltype,
860 				SMB_ACL_T theacl)
861 {
862 	errno = ENOSYS;
863 	return -1;
864 }
865 
vfs_not_implemented_sys_acl_set_fd(vfs_handle_struct * handle,files_struct * fsp,SMB_ACL_T theacl)866 int vfs_not_implemented_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
867 				       SMB_ACL_T theacl)
868 {
869 	errno = ENOSYS;
870 	return -1;
871 }
872 
vfs_not_implemented_sys_acl_delete_def_file(vfs_handle_struct * handle,const struct smb_filename * smb_fname)873 int vfs_not_implemented_sys_acl_delete_def_file(vfs_handle_struct *handle,
874 					const struct smb_filename *smb_fname)
875 {
876 	errno = ENOSYS;
877 	return -1;
878 }
879 
vfs_not_implemented_getxattr(vfs_handle_struct * handle,const struct smb_filename * smb_fname,const char * name,void * value,size_t size)880 ssize_t vfs_not_implemented_getxattr(vfs_handle_struct *handle,
881 				const struct smb_filename *smb_fname,
882 				const char *name,
883 				void *value,
884 				size_t size)
885 {
886 	errno = ENOSYS;
887 	return -1;
888 }
889 
890 struct vfs_not_implemented_getxattrat_state {
891 	struct vfs_aio_state aio_state;
892 	ssize_t xattr_size;
893 	uint8_t *xattr_value;
894 };
895 
vfs_not_implemented_getxattrat_send(TALLOC_CTX * mem_ctx,struct tevent_context * ev,struct vfs_handle_struct * handle,files_struct * dir_fsp,const struct smb_filename * smb_fname,const char * xattr_name,size_t alloc_hint)896 struct tevent_req *vfs_not_implemented_getxattrat_send(
897 			TALLOC_CTX *mem_ctx,
898 			struct tevent_context *ev,
899 			struct vfs_handle_struct *handle,
900 			files_struct *dir_fsp,
901 			const struct smb_filename *smb_fname,
902 			const char *xattr_name,
903 			size_t alloc_hint)
904 {
905 	struct tevent_req *req = NULL;
906 	struct vfs_not_implemented_getxattrat_state *state = NULL;
907 
908 	req = tevent_req_create(mem_ctx, &state,
909 				struct vfs_not_implemented_getxattrat_state);
910 	if (req == NULL) {
911 		return NULL;
912 	}
913 
914 	tevent_req_error(req, ENOSYS);
915 	return tevent_req_post(req, ev);
916 }
917 
vfs_not_implemented_getxattrat_recv(struct tevent_req * req,struct vfs_aio_state * aio_state,TALLOC_CTX * mem_ctx,uint8_t ** xattr_value)918 ssize_t vfs_not_implemented_getxattrat_recv(struct tevent_req *req,
919 				    struct vfs_aio_state *aio_state,
920 				    TALLOC_CTX *mem_ctx,
921 				    uint8_t **xattr_value)
922 {
923 	struct vfs_not_implemented_getxattrat_state *state = tevent_req_data(
924 		req, struct vfs_not_implemented_getxattrat_state);
925 	ssize_t xattr_size;
926 
927 	if (tevent_req_is_unix_error(req, &aio_state->error)) {
928 		tevent_req_received(req);
929 		return -1;
930 	}
931 
932 	*aio_state = state->aio_state;
933 	xattr_size = state->xattr_size;
934 	if (xattr_value != NULL) {
935 		*xattr_value = talloc_move(mem_ctx, &state->xattr_value);
936 	}
937 
938 	tevent_req_received(req);
939 	return xattr_size;
940 }
941 
vfs_not_implemented_fgetxattr(vfs_handle_struct * handle,struct files_struct * fsp,const char * name,void * value,size_t size)942 ssize_t vfs_not_implemented_fgetxattr(vfs_handle_struct *handle,
943 			      struct files_struct *fsp, const char *name,
944 			      void *value, size_t size)
945 {
946 	errno = ENOSYS;
947 	return -1;
948 }
949 
vfs_not_implemented_listxattr(vfs_handle_struct * handle,const struct smb_filename * smb_fname,char * list,size_t size)950 ssize_t vfs_not_implemented_listxattr(vfs_handle_struct *handle,
951 				      const struct smb_filename *smb_fname,
952 				      char *list,
953 				      size_t size)
954 {
955 	errno = ENOSYS;
956 	return -1;
957 }
958 
vfs_not_implemented_flistxattr(vfs_handle_struct * handle,struct files_struct * fsp,char * list,size_t size)959 ssize_t vfs_not_implemented_flistxattr(vfs_handle_struct *handle,
960 				       struct files_struct *fsp, char *list,
961 				       size_t size)
962 {
963 	errno = ENOSYS;
964 	return -1;
965 }
966 
vfs_not_implemented_removexattr(vfs_handle_struct * handle,const struct smb_filename * smb_fname,const char * name)967 int vfs_not_implemented_removexattr(vfs_handle_struct *handle,
968 				    const struct smb_filename *smb_fname,
969 				    const char *name)
970 {
971 	errno = ENOSYS;
972 	return -1;
973 }
974 
vfs_not_implemented_fremovexattr(vfs_handle_struct * handle,struct files_struct * fsp,const char * name)975 int vfs_not_implemented_fremovexattr(vfs_handle_struct *handle,
976 				     struct files_struct *fsp, const char *name)
977 {
978 	errno = ENOSYS;
979 	return -1;
980 }
981 
vfs_not_implemented_setxattr(vfs_handle_struct * handle,const struct smb_filename * smb_fname,const char * name,const void * value,size_t size,int flags)982 int vfs_not_implemented_setxattr(vfs_handle_struct *handle,
983 				 const struct smb_filename *smb_fname,
984 				 const char *name,
985 				 const void *value,
986 				 size_t size,
987 				 int flags)
988 {
989 	errno = ENOSYS;
990 	return -1;
991 }
992 
vfs_not_implemented_fsetxattr(vfs_handle_struct * handle,struct files_struct * fsp,const char * name,const void * value,size_t size,int flags)993 int vfs_not_implemented_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,
994 				  const char *name, const void *value, size_t size,
995 				  int flags)
996 {
997 	errno = ENOSYS;
998 	return -1;
999 }
1000 
vfs_not_implemented_aio_force(struct vfs_handle_struct * handle,struct files_struct * fsp)1001 bool vfs_not_implemented_aio_force(struct vfs_handle_struct *handle,
1002 				   struct files_struct *fsp)
1003 {
1004 	errno = ENOSYS;
1005 	return false;
1006 }
1007 
vfs_not_implemented_audit_file(struct vfs_handle_struct * handle,struct smb_filename * file,struct security_acl * sacl,uint32_t access_requested,uint32_t access_denied)1008 NTSTATUS vfs_not_implemented_audit_file(struct vfs_handle_struct *handle,
1009 					struct smb_filename *file,
1010 					struct security_acl *sacl,
1011 					uint32_t access_requested,
1012 					uint32_t access_denied)
1013 {
1014 	return NT_STATUS_NOT_IMPLEMENTED;
1015 }
1016 
vfs_not_implemented_durable_cookie(struct vfs_handle_struct * handle,struct files_struct * fsp,TALLOC_CTX * mem_ctx,DATA_BLOB * cookie)1017 NTSTATUS vfs_not_implemented_durable_cookie(struct vfs_handle_struct *handle,
1018 					    struct files_struct *fsp,
1019 					    TALLOC_CTX *mem_ctx,
1020 					    DATA_BLOB *cookie)
1021 {
1022 	return NT_STATUS_NOT_IMPLEMENTED;
1023 }
1024 
vfs_not_implemented_durable_disconnect(struct vfs_handle_struct * handle,struct files_struct * fsp,const DATA_BLOB old_cookie,TALLOC_CTX * mem_ctx,DATA_BLOB * new_cookie)1025 NTSTATUS vfs_not_implemented_durable_disconnect(struct vfs_handle_struct *handle,
1026 						struct files_struct *fsp,
1027 						const DATA_BLOB old_cookie,
1028 						TALLOC_CTX *mem_ctx,
1029 						DATA_BLOB *new_cookie)
1030 {
1031 	return NT_STATUS_NOT_IMPLEMENTED;
1032 }
1033 
vfs_not_implemented_durable_reconnect(struct vfs_handle_struct * handle,struct smb_request * smb1req,struct smbXsrv_open * op,const DATA_BLOB old_cookie,TALLOC_CTX * mem_ctx,struct files_struct ** fsp,DATA_BLOB * new_cookie)1034 NTSTATUS vfs_not_implemented_durable_reconnect(struct vfs_handle_struct *handle,
1035 					       struct smb_request *smb1req,
1036 					       struct smbXsrv_open *op,
1037 					       const DATA_BLOB old_cookie,
1038 					       TALLOC_CTX *mem_ctx,
1039 					       struct files_struct **fsp,
1040 					       DATA_BLOB *new_cookie)
1041 {
1042 	return NT_STATUS_NOT_IMPLEMENTED;
1043 }
1044 
1045 /* VFS operations structure */
1046 
1047 static struct vfs_fn_pointers vfs_not_implemented_fns = {
1048 	/* Disk operations */
1049 
1050 	.connect_fn = vfs_not_implemented_connect,
1051 	.disconnect_fn = vfs_not_implemented_disconnect,
1052 	.disk_free_fn = vfs_not_implemented_disk_free,
1053 	.get_quota_fn = vfs_not_implemented_get_quota,
1054 	.set_quota_fn = vfs_not_implemented_set_quota,
1055 	.get_shadow_copy_data_fn = vfs_not_implemented_get_shadow_copy_data,
1056 	.statvfs_fn = vfs_not_implemented_statvfs,
1057 	.fs_capabilities_fn = vfs_not_implemented_fs_capabilities,
1058 	.get_dfs_referrals_fn = vfs_not_implemented_get_dfs_referrals,
1059 	.create_dfs_pathat_fn = vfs_not_implemented_create_dfs_pathat,
1060 	.read_dfs_pathat_fn = vfs_not_implemented_read_dfs_pathat,
1061 	.snap_check_path_fn = vfs_not_implemented_snap_check_path,
1062 	.snap_create_fn = vfs_not_implemented_snap_create,
1063 	.snap_delete_fn = vfs_not_implemented_snap_delete,
1064 
1065 	/* Directory operations */
1066 
1067 	.opendir_fn = vfs_not_implemented_opendir,
1068 	.fdopendir_fn = vfs_not_implemented_fdopendir,
1069 	.readdir_fn = vfs_not_implemented_readdir,
1070 	.seekdir_fn = vfs_not_implemented_seekdir,
1071 	.telldir_fn = vfs_not_implemented_telldir,
1072 	.rewind_dir_fn = vfs_not_implemented_rewind_dir,
1073 	.mkdirat_fn = vfs_not_implemented_mkdirat,
1074 	.closedir_fn = vfs_not_implemented_closedir,
1075 
1076 	/* File operations */
1077 
1078 	.open_fn = vfs_not_implemented_open,
1079 	.create_file_fn = vfs_not_implemented_create_file,
1080 	.close_fn = vfs_not_implemented_close_fn,
1081 	.pread_fn = vfs_not_implemented_pread,
1082 	.pread_send_fn = vfs_not_implemented_pread_send,
1083 	.pread_recv_fn = vfs_not_implemented_pread_recv,
1084 	.pwrite_fn = vfs_not_implemented_pwrite,
1085 	.pwrite_send_fn = vfs_not_implemented_pwrite_send,
1086 	.pwrite_recv_fn = vfs_not_implemented_pwrite_recv,
1087 	.lseek_fn = vfs_not_implemented_lseek,
1088 	.sendfile_fn = vfs_not_implemented_sendfile,
1089 	.recvfile_fn = vfs_not_implemented_recvfile,
1090 	.renameat_fn = vfs_not_implemented_renameat,
1091 	.fsync_send_fn = vfs_not_implemented_fsync_send,
1092 	.fsync_recv_fn = vfs_not_implemented_fsync_recv,
1093 	.stat_fn = vfs_not_implemented_stat,
1094 	.fstat_fn = vfs_not_implemented_fstat,
1095 	.lstat_fn = vfs_not_implemented_lstat,
1096 	.get_alloc_size_fn = vfs_not_implemented_get_alloc_size,
1097 	.unlinkat_fn = vfs_not_implemented_unlinkat,
1098 	.chmod_fn = vfs_not_implemented_chmod,
1099 	.fchmod_fn = vfs_not_implemented_fchmod,
1100 	.fchown_fn = vfs_not_implemented_fchown,
1101 	.lchown_fn = vfs_not_implemented_lchown,
1102 	.chdir_fn = vfs_not_implemented_chdir,
1103 	.getwd_fn = vfs_not_implemented_getwd,
1104 	.ntimes_fn = vfs_not_implemented_ntimes,
1105 	.ftruncate_fn = vfs_not_implemented_ftruncate,
1106 	.fallocate_fn = vfs_not_implemented_fallocate,
1107 	.lock_fn = vfs_not_implemented_lock,
1108 	.kernel_flock_fn = vfs_not_implemented_kernel_flock,
1109 	.fcntl_fn = vfs_not_implemented_fcntl,
1110 	.linux_setlease_fn = vfs_not_implemented_linux_setlease,
1111 	.getlock_fn = vfs_not_implemented_getlock,
1112 	.symlinkat_fn = vfs_not_implemented_symlinkat,
1113 	.readlinkat_fn = vfs_not_implemented_vfs_readlinkat,
1114 	.linkat_fn = vfs_not_implemented_linkat,
1115 	.mknodat_fn = vfs_not_implemented_mknodat,
1116 	.realpath_fn = vfs_not_implemented_realpath,
1117 	.chflags_fn = vfs_not_implemented_chflags,
1118 	.file_id_create_fn = vfs_not_implemented_file_id_create,
1119 	.fs_file_id_fn = vfs_not_implemented_fs_file_id,
1120 	.offload_read_send_fn = vfs_not_implemented_offload_read_send,
1121 	.offload_read_recv_fn = vfs_not_implemented_offload_read_recv,
1122 	.offload_write_send_fn = vfs_not_implemented_offload_write_send,
1123 	.offload_write_recv_fn = vfs_not_implemented_offload_write_recv,
1124 	.get_compression_fn = vfs_not_implemented_get_compression,
1125 	.set_compression_fn = vfs_not_implemented_set_compression,
1126 
1127 	.streaminfo_fn = vfs_not_implemented_streaminfo,
1128 	.get_real_filename_fn = vfs_not_implemented_get_real_filename,
1129 	.connectpath_fn = vfs_not_implemented_connectpath,
1130 	.brl_lock_windows_fn = vfs_not_implemented_brl_lock_windows,
1131 	.brl_unlock_windows_fn = vfs_not_implemented_brl_unlock_windows,
1132 	.strict_lock_check_fn = vfs_not_implemented_strict_lock_check,
1133 	.translate_name_fn = vfs_not_implemented_translate_name,
1134 	.fsctl_fn = vfs_not_implemented_fsctl,
1135 	.readdir_attr_fn = vfs_not_implemented_readdir_attr,
1136 	.audit_file_fn = vfs_not_implemented_audit_file,
1137 
1138 	/* DOS attributes. */
1139 	.get_dos_attributes_fn = vfs_not_implemented_get_dos_attributes,
1140 	.get_dos_attributes_send_fn = vfs_not_implemented_get_dos_attributes_send,
1141 	.get_dos_attributes_recv_fn = vfs_not_implemented_get_dos_attributes_recv,
1142 	.fget_dos_attributes_fn = vfs_not_implemented_fget_dos_attributes,
1143 	.set_dos_attributes_fn = vfs_not_implemented_set_dos_attributes,
1144 	.fset_dos_attributes_fn = vfs_not_implemented_fset_dos_attributes,
1145 
1146 	/* NT ACL operations. */
1147 
1148 	.fget_nt_acl_fn = vfs_not_implemented_fget_nt_acl,
1149 	.get_nt_acl_fn = vfs_not_implemented_get_nt_acl,
1150 	.fset_nt_acl_fn = vfs_not_implemented_fset_nt_acl,
1151 
1152 	/* POSIX ACL operations. */
1153 
1154 	.sys_acl_get_file_fn = vfs_not_implemented_sys_acl_get_file,
1155 	.sys_acl_get_fd_fn = vfs_not_implemented_sys_acl_get_fd,
1156 	.sys_acl_blob_get_file_fn = vfs_not_implemented_sys_acl_blob_get_file,
1157 	.sys_acl_blob_get_fd_fn = vfs_not_implemented_sys_acl_blob_get_fd,
1158 	.sys_acl_set_file_fn = vfs_not_implemented_sys_acl_set_file,
1159 	.sys_acl_set_fd_fn = vfs_not_implemented_sys_acl_set_fd,
1160 	.sys_acl_delete_def_file_fn = vfs_not_implemented_sys_acl_delete_def_file,
1161 
1162 	/* EA operations. */
1163 	.getxattr_fn = vfs_not_implemented_getxattr,
1164 	.getxattrat_send_fn = vfs_not_implemented_getxattrat_send,
1165 	.getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv,
1166 	.fgetxattr_fn = vfs_not_implemented_fgetxattr,
1167 	.listxattr_fn = vfs_not_implemented_listxattr,
1168 	.flistxattr_fn = vfs_not_implemented_flistxattr,
1169 	.removexattr_fn = vfs_not_implemented_removexattr,
1170 	.fremovexattr_fn = vfs_not_implemented_fremovexattr,
1171 	.setxattr_fn = vfs_not_implemented_setxattr,
1172 	.fsetxattr_fn = vfs_not_implemented_fsetxattr,
1173 
1174 	/* aio operations */
1175 	.aio_force_fn = vfs_not_implemented_aio_force,
1176 
1177 	/* durable handle operations */
1178 	.durable_cookie_fn = vfs_not_implemented_durable_cookie,
1179 	.durable_disconnect_fn = vfs_not_implemented_durable_disconnect,
1180 	.durable_reconnect_fn = vfs_not_implemented_durable_reconnect,
1181 };
1182 
1183 static_decl_vfs;
vfs_not_implemented_init(TALLOC_CTX * ctx)1184 NTSTATUS vfs_not_implemented_init(TALLOC_CTX *ctx)
1185 {
1186 	/*
1187 	 * smb_vfs_assert_all_fns() makes sure every
1188 	 * call is implemented.
1189 	 */
1190 	smb_vfs_assert_all_fns(&vfs_not_implemented_fns, "vfs_not_implemented");
1191 	return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "vfs_not_implemented",
1192 				&vfs_not_implemented_fns);
1193 }
1194