2 Unix SMB/CIFS implementation.
3 VFS structures and parameters
4 Copyright (C) Jeremy Allison 1999-2005
5 Copyright (C) Tim Potter 1999
6 Copyright (C) Alexander Bokovoy 2002-2005
7 Copyright (C) Stefan (metze) Metzmacher 2003
8 Copyright (C) Volker Lendecke 2009
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 This work was sponsored by Optifacio Software Services, Inc.
29 /* Avoid conflict with an AIX include file */
36 * As we're now (thanks Andrew ! :-) using file_structs and connection
37 * structs in the vfs - then anyone writing a vfs must include includes.h...
41 * This next constant specifies the version number of the VFS interface
42 * this smbd will load. Increment this if *ANY* changes are made to the
45 * If you change anything here, please also update modules/vfs_full_audit.c.
50 * Changed to version 2 for CIFS UNIX extensions (mknod and link added). JRA.
51 * Changed to version 3 for POSIX acl extensions. JRA.
52 * Changed to version 4 for cascaded VFS interface. Alexander Bokovoy.
53 * Changed to version 5 for sendfile addition. JRA.
54 * Changed to version 6 for the new module system, fixed cascading and quota functions. --metze
55 * Changed to version 7 to include the get_nt_acl info parameter. JRA.
56 * Changed to version 8 includes EA calls. JRA.
57 * Changed to version 9 to include the get_shadow_data call. --metze
58 * Changed to version 10 to include pread pwrite calls.
59 * Changed to version 11 to include seekdir telldir rewinddir calls. JRA
60 * Changed to version 12 to add mask and attributes to opendir(). JRA
61 * Also include aio calls. JRA.
62 * Changed to version 13 as the internal structure of files_struct has changed. JRA
63 * Changed to version 14 as we had to change DIR to SMB_STRUCT_DIR. JRA
64 * Changed to version 15 as we added the statvfs call. JRA
65 * Changed to version 16 as we added the getlock call. JRA
66 * Changed to version 17 as we removed redundant connection_struct parameters. --jpeach
67 * Changed to version 18 to add fsp parameter to the open call -- jpeach
68 * Also include kernel_flock call - jmcd
69 * Changed to version 19, kernel change notify has been merged
70 * Also included linux setlease call - jmcd
71 * Changed to version 20, use ntimes call instead of utime (greater
72 * timestamp resolition. JRA.
73 * Changed to version21 to add chflags operation -- jpeach
74 * Changed to version22 to add lchown operation -- jra
75 * Leave at 22 - not yet released. But change set_nt_acl to return an NTSTATUS. jra.
76 * Leave at 22 - not yet released. Add file_id_create operation. --metze
77 * Leave at 22 - not yet released. Change all BOOL parameters (int) to bool. jra.
78 * Leave at 22 - not yet released. Added recvfile.
79 * Leave at 22 - not yet released. Change get_nt_acl to return NTSTATUS - vl
80 * Leave at 22 - not yet released. Change get_nt_acl to *not* take a
81 * files_struct. - obnox.
82 * Leave at 22 - not yet released. Remove parameter fd from fget_nt_acl. - obnox
83 * Leave at 22 - not yet released. Remove parameter fd from gset_nt_acl. - obnox
84 * Leave at 22 - not yet released. Remove parameter fd from pread. - obnox
85 * Leave at 22 - not yet released. Remove parameter fd from pwrite. - obnox
86 * Leave at 22 - not yet released. Remove parameter fd from lseek. - obnox
87 * Leave at 22 - not yet released. Remove parameter fd from fsync. - obnox
88 * Leave at 22 - not yet released. Remove parameter fd from fstat. - obnox
89 * Leave at 22 - not yet released. Remove parameter fd from fchmod. - obnox
90 * Leave at 22 - not yet released. Remove parameter fd from fchown. - obnox
91 * Leave at 22 - not yet released. Remove parameter fd from ftruncate. - obnox
92 * Leave at 22 - not yet released. Remove parameter fd from lock. - obnox
93 * Leave at 22 - not yet released. Remove parameter fd from kernel_flock. - obnox
94 * Leave at 22 - not yet released. Remove parameter fd from linux_setlease. - obnox
95 * Leave at 22 - not yet released. Remove parameter fd from getlock. - obnox
96 * Leave at 22 - not yet released. Remove parameter fd from sys_acl_get_fd. - obnox
97 * Leave at 22 - not yet released. Remove parameter fd from fchmod_acl. - obnox
98 * Leave at 22 - not yet released. Remove parameter fd from sys_acl_set_fd. - obnox
99 * Leave at 22 - not yet released. Remove parameter fd from fgetxattr. - obnox
100 * Leave at 22 - not yet released. Remove parameter fd from flistxattr. - obnox
101 * Leave at 22 - not yet released. Remove parameter fd from fremovexattr. - obnox
102 * Leave at 22 - not yet released. Remove parameter fd from fsetxattr. - obnox
103 * Leave at 22 - not yet released. Remove parameter fd from aio_cancel. - obnox
104 * Leave at 22 - not yet released. Remove parameter fd from read. - obnox
105 * Leave at 22 - not yet released. Remove parameter fd from write. - obnox
106 * Leave at 22 - not yet released. Remove parameter fromfd from sendfile. - obnox
107 * Leave at 22 - not yet released. Remove parameter fromfd from recvfile. - obnox
108 * Leave at 22 - not yet released. Additional change: add operations for offline files -- ab
109 * Leave at 22 - not yet released. Add the streaminfo call. -- jpeach, vl
110 * Leave at 22 - not yet released. Remove parameter fd from close_fn. - obnox
111 * Changed to version 23 - remove set_nt_acl call. This can only be done via an
113 * Changed to version 24 - make security descriptor const in fset_nt_acl. JRA.
114 * Changed to version 25 - Jelmer's change from SMB_BIG_UINT to uint64_t.
115 * Leave at 25 - not yet released. Add create_file call. -- tprouty.
116 * Leave at 25 - not yet released. Add create time to ntimes. -- tstecher.
117 * Leave at 25 - not yet released. Add get_alloc_size call. -- tprouty.
118 * Leave at 25 - not yet released. Add SMB_STRUCT_STAT to readdir. - sdann
119 * Leave at 25 - not yet released. Add init_search_op call. - sdann
120 * Leave at 25 - not yet released. Add locking calls. -- zkirsch.
121 * Leave at 25 - not yet released. Add strict locking calls. -- drichards.
122 * Changed to version 26 - Plumb struct smb_filename to SMB_VFS_CREATE_FILE,
123 * SMB_VFS_OPEN, SMB_VFS_STAT, SMB_VFS_LSTAT,
124 * SMB_VFS_RENAME, SMB_VFS_UNLINK, SMB_VFS_NTIMES.
125 * Changed to version 27 - not yet released. Added enum timestamp_set_resolution
126 * return to fs_capabilities call. JRA.
127 * Leave at 27 - not yet released. Add translate_name VFS call to convert
128 * UNIX names to Windows supported names -- asrinivasan.
129 * Changed to version 28 - Add private_flags uint32_t to CREATE call.
130 * Leave at 28 - not yet released. Change realpath to assume NULL and return a
131 * malloc'ed path. JRA.
132 * Leave at 28 - not yet released. Move posix_fallocate into the VFS
133 * where it belongs. JRA.
134 * Leave at 28 - not yet released. Rename posix_fallocate to fallocate
135 * to split out the two possible uses. JRA.
136 * Leave at 28 - not yet released. Add fdopendir. JRA.
137 * Leave at 28 - not yet released. Rename open function to open_fn. - gd
138 * Leave at 28 - not yet released. Make getwd function always return malloced memory. JRA.
139 * Bump to version 29 - Samba 3.6.0 will ship with interface version 28.
140 * Leave at 29 - not yet releases. Add fsctl. Richard Sharpe
141 * Leave at 29 - not yet released. add SMB_VFS_GET_DFS_REFERRAL() - metze
142 * Leave at 29 - not yet released. Remove l{list,get,set,remove}xattr - abartlet
143 * Leave at 29 - not yet released. move to plain off_t - abartlet
144 * Leave at 29 - not yet released. Remove sys_acl functions other than set and get - abartlet
145 * Leave at 29 - not yet released. Added backup_intent bool to files_struct - JRA
146 * Leave at 29 - not yet released. Add durable handle functions - metze obnox
147 * Leave at 29 - not yet released. Added sys_acl_blob_get_file and sys_acl_blob_get_fd
148 * Bump to version 30 - Samba 4.0.0 will ship with interface version 30
149 * Leave at 30 - not yet released. Added conn->cwd to save vfs_GetWd() calls.
150 * Leave at 30 - not yet released. Changed sys_acl_blob_get_file interface to remove type
151 * Bump to version 31 - Samba 4.1.0 will ship with interface version 31
152 * Leave at 31 - not yet released. Make struct vuid_cache_entry in
153 * connection_struct a pointer.
154 * Leave at 31 - not yet released. Add share_access to vuid_cache_entry.
155 * Leave at 31 - not yet released. add SMB_VFS_COPY_CHUNK()
156 * Leave at 31 - not yet released. Remove the unused
157 * fsp->pending_break_messages array
158 * Leave at 31 - not yet released. add SMB_VFS_[GET SET]_COMPRESSION()
160 * Bump to version 32 - Samba 4.2 will ship with that.
161 * Version 32 - Add "lease" to CREATE_FILE operation
162 * Version 32 - Add "lease" to struct files_struct
163 * Version 32 - Add SMB_VFS_READDIR_ATTR()
164 * Version 32 - Add in and out create context blobs to create_file
165 * Version 32 - Remove unnecessary SMB_VFS_DISK_FREE() small_query parameter
166 * Bump to version 33 - Samba 4.3 will ship with that.
167 * Version 33 - change fallocate mode flags param from enum->uint32_t
168 * Version 33 - Add snapshot create delete calls
169 * Version 33 - Add OS X SMB2 AAPL copyfile extension flag to fsp
170 * Version 33 - Remove notify_watch_fn
171 * Bump to version 34 - Samba 4.4 will ship with that
172 * Version 34 - Remove bool posix_open, add uint64_t posix_flags
173 * Version 34 - Added bool posix_pathnames to struct smb_request
174 * Bump to version 35 - Samba 4.5 will ship with that
175 * Version 35 - Change get_nt_acl_fn from const char *, to
176 * const struct smb_filename *
177 * Version 35 - Change mkdir from const char *, to
178 * const struct smb_filename *
179 * Version 35 - Change rmdir from const char *, to
180 * const struct smb_filename *
181 * Version 35 - Change opendir from const char *, to
182 * const struct smb_filename *
183 * Version 35 - Wrap aio async functions args in a struct vfs_aio_state
184 * Version 35 - Change chmod from const char *, to
185 * const struct smb_filename *
186 * Version 35 - Change chmod_acl from const char *, to
187 * const struct smb_filename *
188 * Version 35 - Change chown from const char *, to
189 * const struct smb_filename *
190 * Version 35 - Change lchown from const char *, to
191 * const struct smb_filename *
192 * Version 35 - Change streaminfo from const char *, to
193 * const struct smb_filename *
194 * Version 35 - Add uint32_t flags to struct smb_filename
195 * Version 35 - Add get set fget fset dos attribute functions.
196 * Version 35 - Add bool use_ofd_locks to struct files_struct
197 * Bump to version 36 - Samba 4.6 will ship with that
198 * Version 36 - Remove is_offline and set_offline
199 * Version 37 - Module init functions now take a TALLOC_CTX * parameter.
200 * Version 37 - Add vfs_copy_chunk_flags for DUP_EXTENTS_TO_FILE
201 * Version 37 - Change sys_acl_delete_def_file from const char *
202 * to const struct smb_filename *
203 * Version 37 - Change sys_acl_get_file from const char *
204 * to const struct smb_filename *
205 * Version 37 - Change sys_acl_blob_get_file from const char *
206 * to const struct smb_filename *
207 * Version 37 - Change sys_acl_set_file from const char *
208 * to const struct smb_filename *
209 * Version 37 - Change listxattr from const char *
210 * to const struct smb_filename *
211 * Version 37 - Change removexattr from const char *
212 * to const struct smb_filename *
213 * Version 37 - Change setxattr from const char *
214 * to const struct smb_filename *
215 * Version 37 - Change getxattr from const char *
216 * to const struct smb_filename *
217 * Version 37 - Change mknod from const char * to const struct smb_filename *
218 * Version 37 - Change chflags from const char *
219 * to const struct smb_filename *
220 * Version 37 - Change disk_free from const char *
221 * to const struct smb_filename *
222 * Version 37 - Change get_quota from const char *
223 * to const struct smb_filename *
224 * Version 37 - Change link from const char *
225 * to const struct smb_filename *
226 * Version 37 - Change statvfs from const char *
227 * to const struct smb_filename *
228 * Version 37 - Change readlink from const char *
229 * to const struct smb_filename *
230 * Version 37 - Change symlink from const char *
231 * to const struct smb_filename *
232 * Version 37 - Change chdir from const char *
233 * to const struct smb_filename *
234 * Version 37 - Change getwd from char *
235 * to const struct smb_filename *
236 * Version 37 - Change conn->cwd from char *
237 * to struct smb_filename *
238 * Version 37 - Change realpath from char *
239 * to struct smb_filename *
240 * Version 37 - Change connectpath from char *
241 * to struct smb_filename *
242 * Version 37 - Add SMB_VFS_OFFLOAD_READ_SEND RECV
243 * Version 37 - Rename SMB_VFS_COPY_CHUNK_SEND RECV to
244 * SMB_VFS_OFFLOAD_READ_SEND RECV
245 * Version 37 - Remove SMB_VFS_STRICT_UNLOCK
246 * Version 37 - Rename SMB_VFS_STRICT_LOCK to
247 * SMB_VFS_STRICT_LOCK_CHECK
248 * Version 38 - Remove SMB_VFS_INIT_SEARCH_OP
249 * Bump to version 39, Samba 4.9 will ship with that
250 * Version 39 - Remove SMB_VFS_FSYNC
251 * Only implement async versions.
252 * Version 39 - Remove SMB_VFS_READ
253 * All users are now pread or async versions.
254 * Version 39 - Remove SMB_VFS_WRITE
255 * All users are now pwrite or async versions.
256 * Version 39 - Remove SMB_VFS_CHMOD_ACL - no longer used.
257 * Version 39 - Remove SMB_VFS_FCHMOD_ACL - no longer used.
258 * Version 39 - Remove struct dfree_cached_info pointer from
260 * Bump to version 40, Samba 4.10 will ship with that
261 * Version 40 - Add SMB_VFS_GETXATTRAT_SEND RECV
262 * Version 40 - Add SMB_VFS_GET_DOS_ATTRIBUTES_SEND RECV
263 * Bump to version 41, Samba 4.11 will ship with that
264 * Version 41 - Remove SMB_VFS_BRL_CANCEL_WINDOWS
265 * Version 41 - Remove unused st_ex_mask from struct stat_ex
266 * Version 41 - convert struct stat_ex.st_ex_calculated_birthtime to flags
267 * Version 41 - add st_ex_itime to struct stat_ex
268 * Version 41 - add st_ex_file_id to struct stat_ex
269 * Version 41 - add SMB_VFS_FS_FILE_ID
270 * Version 41 - Remove "blocking_lock" parameter from
271 * SMB_VFS_BRL_LOCK_WINDOWS
272 * Version 41 - Remove "msg_ctx" parameter from SMB_VFS_BRL_UNLOCK_WINDOWS
273 * Bump to version 42, Samba 4.12 will ship with that
274 * Version 42 - Remove share_access member from struct files_struct
275 * Version 42 - Make "lease" a const* in create_file_fn
276 * Version 42 - Move SMB_VFS_RENAME -> SMB_VFS_RENAMEAT
277 * Version 42 - Move SMB_VFS_LINK -> SMB_VFS_LINKAT.
278 * Version 42 - Move SMB_VFS_MKNOD -> SMB_VFS_MKDNODAT.
279 * Version 42 - Move SMB_VFS_READLINK -> SMB_VFS_READLINKAT.
280 * Version 42 - Move SMB_VFS_SYMLINK -> SMB_VFS_SYMLINKAT.
281 * Version 42 - Move SMB_VFS_MKDIR -> SMB_VFS_MKDIRAT.
282 * Version 42 - Move change_to_user() -> change_to_user_and_service()
283 * Version 42 - Move change_to_user_by_fsp() -> change_to_user_and_service_by_fsp()
284 * Version 42 - Move [un]become_user*() -> [un]become_user_without_service*()
285 * Version 42 - Move SMB_VFS_UNLINK -> SMB_VFS_UNLINKAT.
286 * Version 42 - Add SMB_VFS_FCNTL
287 * Version 42 - Remove SMB_VFS_RMDIR.
288 * Use SMB_VFS_UNLINKAT(.., AT_REMOVEDIR) instead.
289 * Version 42 - Remove SMB_VFS_CHOWN
290 * Version 42 - Remove struct write_cache *wcp from files_struct
291 * Version 42 - SMB_VFS_NTIMES() receives null times based on UTIMES_OMIT
292 * Version 42 - Add SMB_VFS_CREATE_DFS_PATHAT()
293 * Version 42 - Add SMB_VFS_READ_DFS_PATHAT()
294 * Change to Version 43 - will ship with 4.13.
295 * Version 43 - Remove deferred_close from struct files_struct
296 * Version 43 - Remove SMB_VFS_OPENDIR()
297 * Version 43 - Remove original_lcomp from struct smb_filename
298 * Version 43 - files_struct flags:
299 * bool kernel_share_modes_taken
300 * bool update_write_time_triggered
301 * bool update_write_time_on_close
302 * bool write_time_forced
308 * bool aio_write_behind
309 * bool initial_delete_on_close
310 * bool delete_on_close
315 * bool lock_failure_seen
316 * changed to bitfields.
317 * Version 43 - convert SMB_VFS_GET_REAL_FILENAME() arg path
318 * to be a struct smb_filename
319 * Version 43 - convert link_contents arg of SMB_VFS_SYMLINKAT()
320 * to struct smb_filename
321 * Version 43 - Move SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT().
322 * Version 43 - Remove root_dir_fid from SMB_VFS_CREATE_FILE().
323 * Version 43 - Add dirfsp to struct files_struct
324 * Version 43 - Add dirfsp args to SMB_VFS_CREATE_FILE()
325 * Version 43 - Add SMB_VFS_OPENAT()
326 * Version 43 - Remove SMB_VFS_OPEN()
327 * Version 43 - SMB_VFS_READ_DFS_PATHAT() should take a non-const name.
328 There's no easy way to return stat info for a DFS link
330 * Change to Version 44 - will ship with 4.14.
331 * Version 44 - Remove dirfsp arg from struct files_struct
332 * Version 44 - Remove dirfsp arg to SMB_VFS_CREATE_FILE()
333 * Version 44 - Make dirfsp arg to SMB_VFS_READLINKAT() const
334 * Version 44 - Add a flag 'encryption_required' to files_struct that that
335 * prevents that encrypted connections can be downgraded.
336 * Version 44 - Add a flag 'is_pathref' to struct files_struct.
337 * Version 44 - Add 'is_fsa' flag to struct files_struct.
338 * Version 44 - Add 'have_proc_fds' flag to struct connection_struct.
339 * Version 44 - Add 'have_proc_fds' flag to struct files_struct.
340 * Version 44 - Add dirfsp arg to SMB_VFS_READDIR()
341 * Version 44 - Replace SMB_VFS_GET_COMPRESSION() with SMB_VFS_FGET_COMPRESSION()
342 * Version 44 - Add type argument to SMB_VFS_SYS_ACL_SET_FD()
343 * Version 44 - Remove SMB_VFS_SYS_ACL_SET_FILE()
344 * Change to Version 45 - will ship with 4.15
345 * Version 45 - Remove SMB_VFS_LISTXATTR
346 * Version 45 - Remove SMB_VFS_SETXATTR
347 * Version 45 - Remove SMB_VFS_REMOVEXATTR
348 * Version 45 - Remove SMB_VFS_GET_DOS_ATTRIBUTES()
349 * Version 45 - Remove SMB_VFS_CHMOD
350 * Version 45 - Add SMB_VFS_FNTIMES
351 * Version 45 - Remove SMB_VFS_NTIMES
352 * Version 45 - ADD SMB_VFS_FSTREAMINFO
353 * Version 45 - Add SMB_VFS_FREADDIR_ATTR
354 * Version 45 - Remove SMB_VFS_READDIR_ATTR
355 * Version 45 - Add SMB_VFS_SYS_ACL_DELETE_DEF_FD
356 * Version 45 - Remove SMB_VFS_SYS_ACL_DELETE_DEF_FILE
357 * Version 45 - Add SMB_VFS_PARENT_PATHNAME
358 * Version 45 - Remove SMB_VFS_GET_NT_ACL_AT
359 * Version 45 - Remove SYS_ACL_GET_FILE
360 * Version 45 - Remove SYS_ACL_BLOB_GET_FILE
361 * Version 45 - Add SMB_VFS_FCHFLAGS
362 * Version 45 - Remove SMB_VFS_GETXATTR
363 * Change to Version 46 - will ship with 4.16
364 * Version 46 - Rename SMB_VFS_KERNEL_FLOCK to SMB_VFS_FILESYSTEM_SHAREMODE
365 * Version 46 - Add flags and xferlen args to SMB_VFS_OFFLOAD_READ_RECV
366 * Change to Version 47 - will ship with 4.17
367 * Version 47 - Add SMB_VFS_FSTATAT
368 * Version 47 - Change SMB_VFS_GET_REAL_FILENAME to return NTSTATUS
369 * Version 47 - remove st_ex_itime from struct stat_ex
370 * Version 47 - remove (unused) struct lock_struct last_lock_failure
372 * Version 47 - Add SMB_VFS_GET_REAL_FILENAME_AT
373 * Version 47 - Replace SMB_VFS_GET_REAL_FILENAME with SMB_VFS_GET_REAL_FILENAME_AT
374 * Version 47 - Re-add dirfsp to CREATE_FILE
375 * Version 47 - Add fsp flag fstat_before_close
376 * Version 47 - Change SMB_VFS_OPENAT() to match the Linux openat2 prototype, add vfs_open_how
377 * Version 47 - Add VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS for SMB_VFS_OPENAT()
378 * Change to Version 48 - will ship with 4.18
379 * Version 48 - Add cached_dos_attributes to struct stat_ex
380 * Version 48 - Add dirfsp to connectpath_fn()
381 * Change to Version 49 - will ship with 4.19
382 * Version 49 - remove seekdir and telldir
383 * Version 49 - remove "sbuf" argument from readdir_fn()
384 * Change to Version 50 - will ship with 4.22
385 * Version 50 - Change SMB_VFS_RENAMEAT() add vfs_rename_how
386 * Version 50 - Add VFS_RENAME_HOW_NO_REPLACE to vfs_rename_how
387 * Version 50 - Remove FSP_POSIX_FLAGS_PATHNAMES, remove FSP_POSIX_FLAGS_RENAME
388 * and convert struct files_struct.posix_flags to
389 * struct files_struct.fsp_flags.posix_open
392 #define SMB_VFS_INTERFACE_VERSION 50
395 All intercepted VFS operations must be declared as static functions inside module source
396 in order to keep smbd namespace unpolluted. See source of audit, extd_audit, fake_perms and recycle
397 example VFS modules for more details.
400 /* VFS operations structure */
402 struct vfs_handle_struct
;
403 struct connection_struct
;
405 struct security_descriptor
;
406 struct vfs_statvfs_struct
;
409 struct smb_file_time
;
411 struct dfs_GetDFSReferral
;
413 typedef union unid_t
{
422 struct smbd_server_connection
*sconn
;
423 struct tevent_timer
*timeout
;
424 struct smb2_lease lease
;
427 typedef struct files_struct
{
428 struct files_struct
*next
, *prev
;
430 struct smbXsrv_open
*op
;
431 struct connection_struct
*conn
;
432 struct fd_handle
*fh
;
433 unsigned int num_smb_operations
;
434 struct file_id file_id
;
435 uint64_t initial_allocation_size
; /* Faked up initial allocation on disk. */
437 uint64_t vuid
; /* SMB2 compat */
438 struct timeval open_time
;
439 uint32_t access_mask
; /* NTCreateX access bits (FILE_READ_DATA etc.) */
441 bool is_pathref
: 1; /* See below */
442 bool is_fsa
: 1; /* See below */
443 bool have_proc_fds
: 1;
444 bool kernel_share_modes_taken
: 1;
445 bool update_write_time_triggered
: 1;
446 bool update_write_time_on_close
: 1;
447 bool write_time_forced
: 1;
452 bool is_directory
: 1;
454 bool aio_write_behind
: 1;
455 bool initial_delete_on_close
: 1;
456 bool delete_on_close
: 1;
458 bool backup_intent
: 1;
459 bool use_ofd_locks
: 1;
461 bool lock_failure_seen
: 1;
462 bool encryption_required
: 1;
463 bool fstat_before_close
: 1;
467 struct tevent_timer
*update_write_time_event
;
468 struct timespec close_write_time
;
473 * Cache of our lease_type, stored as "current_state" in
476 int leases_db_seqnum
;
479 struct fsp_lease
*lease
;
480 int sent_oplock_break
;
481 struct tevent_timer
*oplock_timeout
;
482 int current_lock_count
; /* Count the number of outstanding locks and pending locks. */
484 uint64_t posix_flags
;
485 struct smb_filename
*fsp_name
;
486 uint32_t name_hash
; /* Jenkins hash of full pathname. */
487 uint64_t mid
; /* Mid of the operation that created us. */
489 struct vfs_fsp_data
*vfs_extension
;
490 struct fake_file_handle
*fake_file_handle
;
492 struct notify_change_buf
*notify
;
494 struct files_struct
*base_fsp
; /* placeholder for delete on close */
495 struct files_struct
*stream_fsp
; /* backlink from base_fsp */
498 * Cache of share_mode_data->flags
500 int share_mode_flags_seqnum
;
501 uint16_t share_mode_flags
;
504 * Read-only cached brlock record, thrown away when the
505 * brlock.tdb seqnum changes. This avoids fetching data from
506 * the brlock.tdb on every read/write call.
509 struct byte_range_lock
*brlock_rec
;
511 struct dptr_struct
*dptr
;
513 /* if not NULL, means this is a print file */
514 struct print_file_data
*print_file
;
517 * Optimize the aio_requests array for high performance: Never
518 * shrink it, maintain num_aio_requests separately
520 unsigned num_aio_requests
;
521 struct tevent_req
**aio_requests
;
524 * Requests waiting for smb1 byte range locks. They are
525 * generated by smbd_smb1_do_locks_send and are required here,
526 * because lock cancel operations index through reply_lockingX
527 * not based on mid but on the lock type and range.
529 struct tevent_req
**blocked_smb1_lock_reqs
;
532 * SMB1 remembers lock failures and delays repeated blocking
533 * lock attempts on the same offset.
535 uint64_t lock_failure_offset
;
539 * The fsp flags "is_pathref" and "is_fsa"
540 * =======================================
545 * The flag "is_pathref" is a property of the low-level VFS-layer file
546 * handle. If "is_pathref" is true, only a subset of VFS calls are allowed
547 * on the handle and on systems that support it, the low-level fd is open
548 * with O_PATH. If "is_pathref" is false, the low-level fd is a "normal"
549 * file descriptor that can be used with all VFS calls.
551 * The flag "is_fsa" is a property of the FSA layer in Samba. The term FSA
552 * layer refers to the parts of smbd that implement Windows NTFS semantics
553 * on-top of a POSIX filesystem. If "is_fsa" is true, the fsp was
554 * processed by the SMB_VFS_CREATE_FILE() VFS call, otherwise the fsp was
555 * created by openat_pathref_fsp() which only connected the low-level
556 * handle by calling into VFS SMB_VFS_OPENAT(), but the whole FSA layer
559 * Note that only three possible combinations of "is_pathref" and "is_fsa"
562 * | is_fsa \ is_pathref | + | - |
563 * |---------------------+---+---|
567 * So a fsp can't be a full low-level fd (is_pathref=false) and not be
568 * processed by the FSA layer.
573 * On Linux the O_PATH flag to open() can be used to open a filehandle on
574 * a file or directory with interesting properties:
576 * - the file-handle indicates a location in the filesystem tree,
577 * - no permission checks are done by the kernel and
578 * - only operations that act purely at the file descriptor level are
581 * The file itself is not opened, and other file operations (e.g.,
582 * read(2), write(2), fchmod(2), fchown(2), fgetxattr(2), ioctl(2),
583 * mmap(2)) fail with the error EBADF.
585 * The following subset of operations that is relevant to Samba is allowed:
588 * - fchdir(2), if the file descriptor refers to a directory,
591 * - passing the file descriptor as the dirfd argument of openat() and the
592 * other "*at()" system calls. This includes linkat(2) with
593 * AT_EMPTY_PATH (or via procfs using AT_SYMLINK_FOLLOW) even if the
594 * file is not a directory.
596 * Opening a file or directory with the O_PATH flag requires no
597 * permissions on the object itself (but does require execute permission
598 * on the directories in the path prefix). By contrast, obtaining a
599 * reference to a filesystem object by opening it with the O_RDONLY flag
600 * requires that the caller have read permission on the object, even when
601 * the subsequent operation (e.g., fchdir(2), fstat(2)) does not require
602 * read permission on the object. [1]
604 * If for example Samba receives an SMB request to open a file requesting
605 * SEC_FILE_READ_ATTRIBUTE access rights because the client wants to read
606 * the file's metadata from the handle, Samba will have to call POSIX
607 * open() with at least O_RDONLY access rights.
609 * Usecase for O_PATH in Samba
610 * ---------------------------
612 * By leveraging this Linux specific flags we can avoid permission
613 * mismatches as described above. Additionally O_PATH allows basing all
614 * filesystem accesses done by the fileserver on handle based syscalls by
615 * opening all client pathnames with O_PATH and consistently using for
616 * example fstat() instead of stat() throughout the codebase.
618 * Subsequently we will refer to Samba file-handles (fsp's) opened with
619 * O_PATH "path referencing fsp's" or "pathref" fsp's for short.
621 * Currently Samba bases the decision whether to call POSIX open() on a
622 * client pathname or whether to leave the low-level handle at -1, what we
623 * call a stat-open, in the function open_file() and it is based on the
624 * client requested SMB access mask.
626 * The set of rights that trigger an open() include READ_CONTROL_ACCESS,
627 * resulting in a call to open() with at least O_RDONLY. If the filesystem
628 * supports NT style ACLs natively (like GPFS or ZFS), the filesystem may
629 * grant the user requested right READ_CONTROL_ACCESS, but it may not
630 * grant READ_DATA (O_RDONLY), resulting in a permission denied error.
632 * Historically the set of access rights that triggered opening a file was:
640 * SEC_FLAG_SYSTEM_SECURITY
641 * READ_CONTROL_ACCESS
643 * By using O_PATH this can be trimmed down to
650 * Fallback on systems without O_PATH support
651 * ------------------------------------------
653 * A fallback is needed that allows opening a file-handle with the same
654 * higher level semantics even if the system doesn't support O_PATH. This
655 * is implemented by impersonating the root user for the open()
656 * syscall. To avoid bypassing restrictive permissions on intermediate
657 * directories components of a path, the root user is only impersonated
658 * after changing directory to the parent directory of the client
659 * requested pathname.
661 * In order to avoid privilege escalation security issues with these root
662 * opened file-handles we must carefully control their usage throughout
663 * the codebase. Therefore we
665 * - tag the pathref fsp's with the flag "is_pathref" and
667 * - control access to the file-handle by making the structure private and only
668 * allowing access with accessor functions.
670 * Two functions are used to fetch the low-level system file-handle from an fsp
672 * - fsp_get_io_fd(fsp): enforces fsp is NOT a pathref file-handle and
674 * - fsp_get_pathref_fd(fsp): allows fsp to be either a pathref file-handle or a
675 * traditional POSIX file-handle opened with O_RDONLY or any other POSIX open
678 * The general guideline when to use which function is:
680 * - if you do something like fstat(fd), use fsp_get_pathref_fd(fsp),
681 * - if you do something like *at(dirfd, ...), use fsp_get_pathref_fd(fsp),
682 * - if you want to print the fd for example in DEBUG messages, use
683 * fsp_get_pathref_fd(fsp),
684 * - if you want to call close(fd), use fsp_get_pathref_fd(fsp),
685 * - if you're doing a logical comparison of fd values, use
686 * fsp_get_pathref_fd().
688 * In any other case use fsp_get_io_fd().
691 struct vuid_cache_entry
{
692 struct auth_session_info
*session_info
;
693 struct name_compare_entry
*hide_list
;
694 struct name_compare_entry
*veto_list
;
695 uint64_t vuid
; /* SMB2 compat */
697 uint32_t share_access
;
701 unsigned int next_entry
;
702 struct vuid_cache_entry array
[VUID_CACHE_SIZE
];
705 struct name_compare_entry
{
710 struct share_params
{
714 typedef struct connection_struct
{
715 struct connection_struct
*next
, *prev
;
716 struct smbd_server_connection
*sconn
; /* can be NULL */
717 struct smbXsrv_tcon
*tcon
; /* can be NULL */
718 uint32_t cnum
; /* an index passed over the wire */
719 struct share_params
*params
;
721 struct vuid_cache
*vuid_cache
;
724 bool read_only
; /* Attributes for the current user of the share. */
726 uint64_t open_how_resolve
; /* supported vfs_open_how.resolve features */
727 uint32_t share_access
;
728 /* Does this filesystem honor
729 sub second timestamps on files
730 and directories when setting time ? */
731 enum timestamp_set_resolution ts_res
;
733 struct files_struct
*cwd_fsp
; /* Working directory. */
736 struct vfs_handle_struct
*vfs_handles
; /* for the new plugins */
739 * This represents the user information on this connection. Depending
740 * on the vuid using this tid, this might change per SMB request.
742 struct auth_session_info
*session_info
;
745 * If the "force group" parameter is set, this is the primary gid that
746 * may be used in the users token, depending on the vuid using this tid.
748 gid_t force_group_gid
;
750 uint64_t vuid
; /* vuid of user who *opened* this connection, or UID_FIELD_INVALID */
753 time_t lastused_count
;
755 unsigned int num_smb_operations
; /* Count of smb operations on this tree. */
759 /* Semantics requested by the client or forced by the server config. */
762 bool short_case_preserve
;
764 /* Semantics provided by the underlying filesystem. */
766 /* Device number of the directory of the share mount.
767 Used to ensure unique FileIndex returns. */
768 SMB_DEV_T base_share_dev
;
770 struct name_compare_entry
*hide_list
; /* Per-share list of files to return as hidden. */
771 struct name_compare_entry
*veto_list
; /* Per-share list of files to veto (never show). */
772 struct name_compare_entry
*veto_oplock_list
; /* Per-share list of files to refuse oplocks on. */
773 struct name_compare_entry
*aio_write_behind_list
; /* Per-share list of files to use aio write behind on. */
774 struct trans_state
*pending_trans
;
776 struct rpc_pipe_client
*spoolss_pipe
;
780 struct smbd_smb2_request
;
787 uint64_t mid
; /* For compatibility with SMB2. */
789 uint64_t vuid
; /* For compatibility with SMB2. */
795 const uint8_t *inbuf
;
798 * Async handling in the main smb processing loop is directed by
799 * outbuf: reply_xxx routines indicate sync behaviour by putting their
800 * reply into "outbuf". If they leave it as NULL, they take care of it
801 * themselves, possibly later.
803 * If async handling is wanted, the reply_xxx routine must make sure
804 * that it talloc_move()s the smb_req somewhere else.
810 connection_struct
*conn
;
811 struct smbd_server_connection
*sconn
;
812 struct smbXsrv_connection
*xconn
;
815 * Pointer to session, can be NULL,
816 * eg during negprot and session setup.
818 struct smbXsrv_session
*session
;
821 * Chained request handling
823 struct files_struct
*chain_fsp
;
826 * state information for async smb handling
831 * Back pointer to smb2 request.
833 struct smbd_smb2_request
*smb2req
;
836 * Request list for chained requests, we're part of it.
838 struct smb_request
**chain
;
840 struct timeval request_time
;
842 bool posix_pathnames
;
846 * Info about an alternate data stream
849 struct stream_struct
{
856 struct smb_file_time
{
857 struct timespec mtime
;
858 struct timespec atime
;
859 struct timespec ctime
;
860 struct timespec create_time
;
866 struct smb_filename
{
874 * Internal file handle, O_PATH based if available,
875 * otherwise O_RDONLY as root.
877 struct files_struct
*fsp
;
880 * Link between the struct smb_filename and the above
881 * fsp. fsp_link is a talloc child of the fsp. Ensures a possible
882 * talloc_free(fsp) resets the smb_fname->fsp pointer to NULL in
883 * the is fsp_link talloc destructor.
885 struct fsp_smb_fname_link
*fsp_link
;
888 #define SMB_FILENAME_POSIX_PATH 0x01
890 enum vfs_translate_direction
{
891 vfs_translate_to_unix
= 0,
892 vfs_translate_to_windows
895 enum vfs_fallocate_flags
{
896 VFS_FALLOCATE_FL_KEEP_SIZE
= 0x0001,
897 VFS_FALLOCATE_FL_PUNCH_HOLE
= 0x0002,
900 struct vfs_aio_state
{
905 #define VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS 1
906 #define VFS_OPEN_HOW_WITH_BACKUP_INTENT 2
908 struct vfs_open_how
{
914 #define VFS_RENAME_HOW_NO_REPLACE 1
916 struct vfs_rename_how
{
921 Available VFS operations. These values must be in sync with vfs_ops struct
922 (struct vfs_fn_pointers and struct vfs_handle_pointers inside of struct vfs_ops).
923 In particular, if new operations are added to vfs_ops, appropriate constants
924 should be added to vfs_op_type so that order of them kept same as in vfs_ops.
926 struct shadow_copy_data
;
928 struct vfs_fn_pointers
{
929 /* Disk operations */
931 int (*connect_fn
)(struct vfs_handle_struct
*handle
, const char *service
, const char *user
);
932 void (*disconnect_fn
)(struct vfs_handle_struct
*handle
);
933 uint64_t (*disk_free_fn
)(struct vfs_handle_struct
*handle
,
934 const struct smb_filename
*smb_fname
,
938 int (*get_quota_fn
)(struct vfs_handle_struct
*handle
,
939 const struct smb_filename
*smb_fname
,
940 enum SMB_QUOTA_TYPE qtype
,
943 int (*set_quota_fn
)(struct vfs_handle_struct
*handle
, enum SMB_QUOTA_TYPE qtype
, unid_t id
, SMB_DISK_QUOTA
*qt
);
944 int (*get_shadow_copy_data_fn
)(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, struct shadow_copy_data
*shadow_copy_data
, bool labels
);
945 int (*statvfs_fn
)(struct vfs_handle_struct
*handle
,
946 const struct smb_filename
*smb_fname
,
947 struct vfs_statvfs_struct
*statbuf
);
948 uint32_t (*fs_capabilities_fn
)(struct vfs_handle_struct
*handle
, enum timestamp_set_resolution
*p_ts_res
);
951 * Note: that "struct dfs_GetDFSReferral *r"
952 * needs to be a valid TALLOC_CTX
954 NTSTATUS (*get_dfs_referrals_fn
)(struct vfs_handle_struct
*handle
,
955 struct dfs_GetDFSReferral
*r
);
956 NTSTATUS (*create_dfs_pathat_fn
)(struct vfs_handle_struct
*handle
,
957 struct files_struct
*dirfsp
,
958 const struct smb_filename
*smb_fname
,
959 const struct referral
*reflist
,
960 size_t referral_count
);
961 NTSTATUS (*read_dfs_pathat_fn
)(struct vfs_handle_struct
*handle
,
963 struct files_struct
*dirfsp
,
964 struct smb_filename
*smb_fname
,
965 struct referral
**ppreflist
,
966 size_t *preferral_count
);
968 /* Directory operations */
970 DIR *(*fdopendir_fn
)(struct vfs_handle_struct
*handle
, files_struct
*fsp
, const char *mask
, uint32_t attributes
);
971 struct dirent
*(*readdir_fn
)(struct vfs_handle_struct
*handle
,
972 struct files_struct
*dirfsp
,
974 void (*rewind_dir_fn
)(struct vfs_handle_struct
*handle
, DIR *dirp
);
975 int (*mkdirat_fn
)(struct vfs_handle_struct
*handle
,
976 struct files_struct
*dirfsp
,
977 const struct smb_filename
*smb_fname
,
979 int (*closedir_fn
)(struct vfs_handle_struct
*handle
, DIR *dir
);
981 /* File operations */
983 int (*openat_fn
)(struct vfs_handle_struct
*handle
,
984 const struct files_struct
*dirfsp
,
985 const struct smb_filename
*smb_fname
,
986 struct files_struct
*fsp
,
987 const struct vfs_open_how
*how
);
988 NTSTATUS (*create_file_fn
)(struct vfs_handle_struct
*handle
,
989 struct smb_request
*req
,
990 struct files_struct
*dirfsp
,
991 struct smb_filename
*smb_fname
,
992 uint32_t access_mask
,
993 uint32_t share_access
,
994 uint32_t create_disposition
,
995 uint32_t create_options
,
996 uint32_t file_attributes
,
997 uint32_t oplock_request
,
998 const struct smb2_lease
*lease
,
999 uint64_t allocation_size
,
1000 uint32_t private_flags
,
1001 struct security_descriptor
*sd
,
1002 struct ea_list
*ea_list
,
1003 files_struct
**result
,
1005 const struct smb2_create_blobs
*in_context_blobs
,
1006 struct smb2_create_blobs
*out_context_blobs
);
1007 int (*close_fn
)(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
);
1008 ssize_t (*pread_fn
)(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, void *data
, size_t n
, off_t offset
);
1009 struct tevent_req
*(*pread_send_fn
)(struct vfs_handle_struct
*handle
,
1010 TALLOC_CTX
*mem_ctx
,
1011 struct tevent_context
*ev
,
1012 struct files_struct
*fsp
,
1014 size_t n
, off_t offset
);
1015 ssize_t (*pread_recv_fn
)(struct tevent_req
*req
, struct vfs_aio_state
*state
);
1016 ssize_t (*pwrite_fn
)(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, const void *data
, size_t n
, off_t offset
);
1017 struct tevent_req
*(*pwrite_send_fn
)(struct vfs_handle_struct
*handle
,
1018 TALLOC_CTX
*mem_ctx
,
1019 struct tevent_context
*ev
,
1020 struct files_struct
*fsp
,
1022 size_t n
, off_t offset
);
1023 ssize_t (*pwrite_recv_fn
)(struct tevent_req
*req
, struct vfs_aio_state
*state
);
1024 off_t (*lseek_fn
)(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, off_t offset
, int whence
);
1025 ssize_t (*sendfile_fn
)(struct vfs_handle_struct
*handle
, int tofd
, files_struct
*fromfsp
, const DATA_BLOB
*header
, off_t offset
, size_t count
);
1026 ssize_t (*recvfile_fn
)(struct vfs_handle_struct
*handle
, int fromfd
, files_struct
*tofsp
, off_t offset
, size_t count
);
1027 int (*renameat_fn
)(struct vfs_handle_struct
*handle
,
1028 struct files_struct
*srcdir_fsp
,
1029 const struct smb_filename
*smb_fname_src
,
1030 struct files_struct
*dstdir_fsp
,
1031 const struct smb_filename
*smb_fname_dst
,
1032 const struct vfs_rename_how
*how
);
1033 struct tevent_req
*(*fsync_send_fn
)(struct vfs_handle_struct
*handle
,
1034 TALLOC_CTX
*mem_ctx
,
1035 struct tevent_context
*ev
,
1036 struct files_struct
*fsp
);
1037 int (*fsync_recv_fn
)(struct tevent_req
*req
, struct vfs_aio_state
*state
);
1038 int (*stat_fn
)(struct vfs_handle_struct
*handle
, struct smb_filename
*smb_fname
);
1039 int (*fstat_fn
)(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, SMB_STRUCT_STAT
*sbuf
);
1040 int (*lstat_fn
)(struct vfs_handle_struct
*handle
, struct smb_filename
*smb_filename
);
1042 struct vfs_handle_struct
*handle
,
1043 const struct files_struct
*dirfsp
,
1044 const struct smb_filename
*smb_fname
,
1045 SMB_STRUCT_STAT
*sbuf
,
1047 uint64_t (*get_alloc_size_fn
)(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, const SMB_STRUCT_STAT
*sbuf
);
1048 int (*unlinkat_fn
)(struct vfs_handle_struct
*handle
,
1049 struct files_struct
*srcdir_fsp
,
1050 const struct smb_filename
*smb_fname
,
1052 int (*fchmod_fn
)(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, mode_t mode
);
1053 int (*fchown_fn
)(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, uid_t uid
, gid_t gid
);
1054 int (*lchown_fn
)(struct vfs_handle_struct
*handle
,
1055 const struct smb_filename
*smb_fname
,
1058 int (*chdir_fn
)(struct vfs_handle_struct
*handle
,
1059 const struct smb_filename
*smb_fname
);
1060 struct smb_filename
*(*getwd_fn
)(struct vfs_handle_struct
*handle
,
1061 TALLOC_CTX
*mem_ctx
);
1062 int (*fntimes_fn
)(struct vfs_handle_struct
*handle
,
1063 struct files_struct
*fsp
,
1064 struct smb_file_time
*ft
);
1065 int (*ftruncate_fn
)(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, off_t offset
);
1066 int (*fallocate_fn
)(struct vfs_handle_struct
*handle
,
1067 struct files_struct
*fsp
,
1071 bool (*lock_fn
)(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, int op
, off_t offset
, off_t count
, int type
);
1072 int (*filesystem_sharemode_fn
)(struct vfs_handle_struct
*handle
,
1073 struct files_struct
*fsp
,
1074 uint32_t share_access
, uint32_t
1076 int (*fcntl_fn
)(struct vfs_handle_struct
*handle
,
1077 struct files_struct
*fsp
, int cmd
, va_list cmd_arg
);
1078 int (*linux_setlease_fn
)(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, int leasetype
);
1079 bool (*getlock_fn
)(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, off_t
*poffset
, off_t
*pcount
, int *ptype
, pid_t
*ppid
);
1080 int (*symlinkat_fn
)(struct vfs_handle_struct
*handle
,
1081 const struct smb_filename
*link_contents
,
1082 struct files_struct
*dirfsp
,
1083 const struct smb_filename
*new_smb_fname
);
1084 int (*readlinkat_fn
)(struct vfs_handle_struct
*handle
,
1085 const struct files_struct
*dirfsp
,
1086 const struct smb_filename
*smb_fname
,
1089 int (*linkat_fn
)(struct vfs_handle_struct
*handle
,
1090 struct files_struct
*srcfsp
,
1091 const struct smb_filename
*old_smb_fname
,
1092 struct files_struct
*dstfsp
,
1093 const struct smb_filename
*new_smb_fname
,
1095 int (*mknodat_fn
)(struct vfs_handle_struct
*handle
,
1096 struct files_struct
*dirfsp
,
1097 const struct smb_filename
*smb_fname
,
1100 struct smb_filename
*(*realpath_fn
)(struct vfs_handle_struct
*handle
,
1102 const struct smb_filename
*smb_fname
);
1103 int (*fchflags_fn
)(struct vfs_handle_struct
*handle
,
1104 struct files_struct
*fsp
,
1105 unsigned int flags
);
1106 struct file_id (*file_id_create_fn
)(struct vfs_handle_struct
*handle
,
1107 const SMB_STRUCT_STAT
*sbuf
);
1108 uint64_t (*fs_file_id_fn
)(struct vfs_handle_struct
*handle
,
1109 const SMB_STRUCT_STAT
*sbuf
);
1110 struct tevent_req
*(*offload_read_send_fn
)(TALLOC_CTX
*mem_ctx
,
1111 struct tevent_context
*ev
,
1112 struct vfs_handle_struct
*handle
,
1113 struct files_struct
*fsp
,
1118 NTSTATUS (*offload_read_recv_fn
)(struct tevent_req
*req
,
1119 struct vfs_handle_struct
*handle
,
1120 TALLOC_CTX
*mem_ctx
,
1123 DATA_BLOB
*token_blob
);
1124 struct tevent_req
*(*offload_write_send_fn
)(struct vfs_handle_struct
*handle
,
1125 TALLOC_CTX
*mem_ctx
,
1126 struct tevent_context
*ev
,
1129 off_t transfer_offset
,
1130 struct files_struct
*dest_fsp
,
1133 NTSTATUS (*offload_write_recv_fn
)(struct vfs_handle_struct
*handle
,
1134 struct tevent_req
*req
,
1136 NTSTATUS (*fget_compression_fn
)(struct vfs_handle_struct
*handle
,
1137 TALLOC_CTX
*mem_ctx
,
1138 struct files_struct
*fsp
,
1139 uint16_t *_compression_fmt
);
1140 NTSTATUS (*set_compression_fn
)(struct vfs_handle_struct
*handle
,
1141 TALLOC_CTX
*mem_ctx
,
1142 struct files_struct
*fsp
,
1143 uint16_t compression_fmt
);
1144 NTSTATUS (*snap_check_path_fn
)(struct vfs_handle_struct
*handle
,
1145 TALLOC_CTX
*mem_ctx
,
1146 const char *service_path
,
1147 char **base_volume
);
1148 NTSTATUS (*snap_create_fn
)(struct vfs_handle_struct
*handle
,
1149 TALLOC_CTX
*mem_ctx
,
1150 const char *base_volume
,
1155 NTSTATUS (*snap_delete_fn
)(struct vfs_handle_struct
*handle
,
1156 TALLOC_CTX
*mem_ctx
,
1160 NTSTATUS (*fstreaminfo_fn
)(struct vfs_handle_struct
*handle
,
1161 struct files_struct
*fsp
,
1162 TALLOC_CTX
*mem_ctx
,
1163 unsigned int *num_streams
,
1164 struct stream_struct
**streams
);
1166 NTSTATUS (*get_real_filename_at_fn
)(struct vfs_handle_struct
*handle
,
1167 struct files_struct
*dirfsp
,
1169 TALLOC_CTX
*mem_ctx
,
1172 const char *(*connectpath_fn
)(struct vfs_handle_struct
*handle
,
1173 const struct files_struct
*dirfsp
,
1174 const struct smb_filename
*smb_fname
);
1176 NTSTATUS (*brl_lock_windows_fn
)(struct vfs_handle_struct
*handle
,
1177 struct byte_range_lock
*br_lck
,
1178 struct lock_struct
*plock
);
1180 bool (*brl_unlock_windows_fn
)(struct vfs_handle_struct
*handle
,
1181 struct byte_range_lock
*br_lck
,
1182 const struct lock_struct
*plock
);
1184 bool (*strict_lock_check_fn
)(struct vfs_handle_struct
*handle
,
1185 struct files_struct
*fsp
,
1186 struct lock_struct
*plock
);
1188 NTSTATUS (*translate_name_fn
)(struct vfs_handle_struct
*handle
,
1190 enum vfs_translate_direction direction
,
1191 TALLOC_CTX
*mem_ctx
,
1192 char **mapped_name
);
1194 NTSTATUS (*parent_pathname_fn
)(struct vfs_handle_struct
*handle
,
1195 TALLOC_CTX
*mem_ctx
,
1196 const struct smb_filename
*smb_fname_in
,
1197 struct smb_filename
**parent_dir_out
,
1198 struct smb_filename
**atname_out
);
1200 NTSTATUS (*fsctl_fn
)(struct vfs_handle_struct
*handle
,
1201 struct files_struct
*fsp
,
1205 const uint8_t *_in_data
,
1207 uint8_t **_out_data
,
1208 uint32_t max_out_len
,
1211 NTSTATUS (*fget_dos_attributes_fn
)(struct vfs_handle_struct
*handle
,
1212 struct files_struct
*fsp
,
1215 NTSTATUS (*fset_dos_attributes_fn
)(struct vfs_handle_struct
*handle
,
1216 struct files_struct
*fsp
,
1219 struct tevent_req
*(*get_dos_attributes_send_fn
)(
1220 TALLOC_CTX
*mem_ctx
,
1221 struct tevent_context
*ev
,
1222 struct vfs_handle_struct
*handle
,
1223 files_struct
*dir_fsp
,
1224 struct smb_filename
*smb_fname
);
1226 NTSTATUS (*get_dos_attributes_recv_fn
)(
1227 struct tevent_req
*req
,
1228 struct vfs_aio_state
*aio_state
,
1231 /* NT ACL operations. */
1233 NTSTATUS (*fget_nt_acl_fn
)(struct vfs_handle_struct
*handle
,
1234 struct files_struct
*fsp
,
1235 uint32_t security_info
,
1236 TALLOC_CTX
*mem_ctx
,
1237 struct security_descriptor
**ppdesc
);
1238 NTSTATUS (*fset_nt_acl_fn
)(struct vfs_handle_struct
*handle
,
1239 struct files_struct
*fsp
,
1240 uint32_t security_info_sent
,
1241 const struct security_descriptor
*psd
);
1243 NTSTATUS (*audit_file_fn
)(struct vfs_handle_struct
*handle
,
1244 struct smb_filename
*file
,
1245 struct security_acl
*sacl
,
1246 uint32_t access_requested
,
1247 uint32_t access_denied
);
1249 /* POSIX ACL operations. */
1251 SMB_ACL_T (*sys_acl_get_fd_fn
)(struct vfs_handle_struct
*handle
,
1252 struct files_struct
*fsp
,
1253 SMB_ACL_TYPE_T type
,
1254 TALLOC_CTX
*mem_ctx
);
1255 int (*sys_acl_blob_get_fd_fn
)(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
,
1256 TALLOC_CTX
*mem_ctx
, char **blob_description
,
1258 int (*sys_acl_set_fd_fn
)(struct vfs_handle_struct
*handle
,
1259 struct files_struct
*fsp
,
1260 SMB_ACL_TYPE_T type
,
1262 int (*sys_acl_delete_def_fd_fn
)(struct vfs_handle_struct
*handle
,
1263 struct files_struct
*fsp
);
1265 /* EA operations. */
1266 struct tevent_req
*(*getxattrat_send_fn
)(
1267 TALLOC_CTX
*mem_ctx
,
1268 struct tevent_context
*ev
,
1269 struct vfs_handle_struct
*handle
,
1270 files_struct
*dir_fsp
,
1271 const struct smb_filename
*smb_fname
,
1272 const char *xattr_name
,
1274 ssize_t (*getxattrat_recv_fn
)(struct tevent_req
*req
,
1275 struct vfs_aio_state
*aio_state
,
1276 TALLOC_CTX
*mem_ctx
,
1277 uint8_t **xattr_value
);
1278 ssize_t (*fgetxattr_fn
)(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, const char *name
, void *value
, size_t size
);
1279 ssize_t (*flistxattr_fn
)(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, char *list
, size_t size
);
1280 int (*fremovexattr_fn
)(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, const char *name
);
1281 int (*fsetxattr_fn
)(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, const char *name
, const void *value
, size_t size
, int flags
);
1283 /* aio operations */
1284 bool (*aio_force_fn
)(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
);
1286 /* durable handle operations */
1287 NTSTATUS (*durable_cookie_fn
)(struct vfs_handle_struct
*handle
,
1288 struct files_struct
*fsp
,
1289 TALLOC_CTX
*mem_ctx
,
1291 NTSTATUS (*durable_disconnect_fn
)(struct vfs_handle_struct
*handle
,
1292 struct files_struct
*fsp
,
1293 const DATA_BLOB old_cookie
,
1294 TALLOC_CTX
*mem_ctx
,
1295 DATA_BLOB
*new_cookie
);
1296 NTSTATUS (*durable_reconnect_fn
)(struct vfs_handle_struct
*handle
,
1297 struct smb_request
*smb1req
,
1298 struct smbXsrv_open
*op
,
1299 const DATA_BLOB old_cookie
,
1300 TALLOC_CTX
*mem_ctx
,
1301 struct files_struct
**fsp
,
1302 DATA_BLOB
*new_cookie
);
1304 NTSTATUS (*freaddir_attr_fn
)(struct vfs_handle_struct
*handle
,
1305 struct files_struct
*fsp
,
1306 TALLOC_CTX
*mem_ctx
,
1307 struct readdir_attr_data
**attr_data
);
1311 VFS operation description. Each VFS module registers an array of vfs_op_tuple to VFS subsystem,
1312 which describes all operations this module is willing to intercept.
1313 VFS subsystem initializes then the conn->vfs_ops and conn->vfs_opaque_ops structs
1314 using this information.
1317 typedef struct vfs_handle_struct
{
1318 struct vfs_handle_struct
*next
, *prev
;
1320 struct connection_struct
*conn
;
1321 const struct vfs_fn_pointers
*fns
;
1323 void (*free_data
)(void **data
);
1324 } vfs_handle_struct
;
1327 struct vfs_statvfs_struct
{
1328 /* For undefined recommended transfer size return -1 in that field */
1329 uint32_t OptimalTransferSize
; /* bsize on some os, iosize on other os */
1333 The next three fields are in terms of the block size.
1334 (above). If block size is unknown, 4096 would be a
1335 reasonable block size for a server to report.
1336 Note that returning the blocks/blocksavail removes need
1337 to make a second call (to QFSInfo level 0x103 to get this info.
1338 UserBlockAvail is typically less than or equal to BlocksAvail,
1339 if no distinction is made return the same value in each.
1342 uint64_t TotalBlocks
;
1343 uint64_t BlocksAvail
; /* bfree */
1344 uint64_t UserBlocksAvail
; /* bavail */
1346 /* For undefined Node fields or FSID return -1 */
1347 uint64_t TotalFileNodes
;
1348 uint64_t FreeFileNodes
;
1349 uint64_t FsIdentifier
; /* fsid */
1350 /* NB Namelen comes from FILE_SYSTEM_ATTRIBUTE_INFO call */
1351 /* NB flags can come from FILE_SYSTEM_DEVICE_INFO call */
1356 /* Add a new FSP extension of the given type. Returns a pointer to the
1359 #define VFS_ADD_FSP_EXTENSION(handle, fsp, type, destroy_fn) \
1360 (type *)vfs_add_fsp_extension_notype(handle, (fsp), sizeof(type), (destroy_fn))
1362 /* Return a pointer to the existing FSP extension data. */
1363 #define VFS_FETCH_FSP_EXTENSION(handle, fsp) \
1364 vfs_fetch_fsp_extension(handle, (fsp))
1366 /* Return the talloc context associated with an FSP extension. */
1367 #define VFS_MEMCTX_FSP_EXTENSION(handle, fsp) \
1368 vfs_memctx_fsp_extension(handle, (fsp))
1370 /* Remove and destroy an FSP extension. */
1371 #define VFS_REMOVE_FSP_EXTENSION(handle, fsp) \
1372 vfs_remove_fsp_extension((handle), (fsp))
1374 #define SMB_VFS_HANDLE_GET_DATA(handle, datap, type, ret) { \
1375 if (!(handle)||((datap=(type *)(handle)->data)==NULL)) { \
1376 DEBUG(0,("%s() failed to get vfs_handle->data!\n",__FUNCTION__)); \
1381 #define SMB_VFS_HANDLE_SET_DATA(handle, datap, free_fn, type, ret) { \
1383 DEBUG(0,("%s() failed to set handle->data!\n",__FUNCTION__)); \
1386 if ((handle)->free_data) { \
1387 (handle)->free_data(&(handle)->data); \
1389 (handle)->data = (void *)datap; \
1390 (handle)->free_data = free_fn; \
1394 #define SMB_VFS_HANDLE_FREE_DATA(handle) { \
1395 if ((handle) && (handle)->free_data) { \
1396 (handle)->free_data(&(handle)->data); \
1400 /* Check whether module-specific data handle was already allocated or not */
1401 #define SMB_VFS_HANDLE_TEST_DATA(handle) ( !(handle) || !(handle)->data ? False : True )
1403 #define SMB_VFS_OP(x) ((void *) x)
1405 #define DEFAULT_VFS_MODULE_NAME "/[Default VFS]/"
1407 #include "vfs_macros.h"
1409 struct smb_vfs_deny_state
{
1410 struct smb_vfs_deny_state
*parent
;
1411 const char *location
;
1414 void smb_vfs_assert_allowed(void);
1416 void _smb_vfs_deny_push(struct smb_vfs_deny_state
*state
, const char *location
);
1417 #define smb_vfs_deny_push(__state) _smb_vfs_deny_push(__state, __location__);
1418 void _smb_vfs_deny_pop(struct smb_vfs_deny_state
*state
, const char *location
);
1419 #define smb_vfs_deny_pop(__state) _smb_vfs_deny_pop(__state, __location__);
1421 int smb_vfs_call_connect(struct vfs_handle_struct
*handle
,
1422 const char *service
, const char *user
);
1423 void smb_vfs_call_disconnect(struct vfs_handle_struct
*handle
);
1424 uint64_t smb_vfs_call_disk_free(struct vfs_handle_struct
*handle
,
1425 const struct smb_filename
*smb_filename
,
1429 int smb_vfs_call_get_quota(struct vfs_handle_struct
*handle
,
1430 const struct smb_filename
*smb_filename
,
1431 enum SMB_QUOTA_TYPE qtype
,
1433 SMB_DISK_QUOTA
*qt
);
1434 int smb_vfs_call_set_quota(struct vfs_handle_struct
*handle
,
1435 enum SMB_QUOTA_TYPE qtype
, unid_t id
,
1436 SMB_DISK_QUOTA
*qt
);
1437 int smb_vfs_call_get_shadow_copy_data(struct vfs_handle_struct
*handle
,
1438 struct files_struct
*fsp
,
1439 struct shadow_copy_data
*shadow_copy_data
,
1441 int smb_vfs_call_statvfs(struct vfs_handle_struct
*handle
,
1442 const struct smb_filename
*smb_fname
,
1443 struct vfs_statvfs_struct
*statbuf
);
1444 uint32_t smb_vfs_call_fs_capabilities(struct vfs_handle_struct
*handle
,
1445 enum timestamp_set_resolution
*p_ts_res
);
1447 * Note: that "struct dfs_GetDFSReferral *r" needs to be a valid TALLOC_CTX
1449 NTSTATUS
smb_vfs_call_get_dfs_referrals(struct vfs_handle_struct
*handle
,
1450 struct dfs_GetDFSReferral
*r
);
1451 NTSTATUS
smb_vfs_call_create_dfs_pathat(struct vfs_handle_struct
*handle
,
1452 struct files_struct
*dirfsp
,
1453 const struct smb_filename
*smb_fname
,
1454 const struct referral
*reflist
,
1455 size_t referral_count
);
1456 NTSTATUS
smb_vfs_call_read_dfs_pathat(struct vfs_handle_struct
*handle
,
1457 TALLOC_CTX
*mem_ctx
,
1458 struct files_struct
*dirfsp
,
1459 struct smb_filename
*smb_fname
,
1460 struct referral
**ppreflist
,
1461 size_t *preferral_count
);
1462 DIR *smb_vfs_call_fdopendir(struct vfs_handle_struct
*handle
,
1463 struct files_struct
*fsp
,
1465 uint32_t attributes
);
1466 struct dirent
*smb_vfs_call_readdir(struct vfs_handle_struct
*handle
,
1467 struct files_struct
*dirfsp
,
1469 void smb_vfs_call_rewind_dir(struct vfs_handle_struct
*handle
,
1471 int smb_vfs_call_mkdirat(struct vfs_handle_struct
*handle
,
1472 struct files_struct
*dirfsp
,
1473 const struct smb_filename
*smb_fname
,
1475 int smb_vfs_call_closedir(struct vfs_handle_struct
*handle
,
1477 int smb_vfs_call_openat(struct vfs_handle_struct
*handle
,
1478 const struct files_struct
*dirfsp
,
1479 const struct smb_filename
*smb_fname
,
1480 struct files_struct
*fsp
,
1481 const struct vfs_open_how
*how
);
1482 NTSTATUS
smb_vfs_call_create_file(struct vfs_handle_struct
*handle
,
1483 struct smb_request
*req
,
1484 struct files_struct
*dirfsp
,
1485 struct smb_filename
*smb_fname
,
1486 uint32_t access_mask
,
1487 uint32_t share_access
,
1488 uint32_t create_disposition
,
1489 uint32_t create_options
,
1490 uint32_t file_attributes
,
1491 uint32_t oplock_request
,
1492 const struct smb2_lease
*lease
,
1493 uint64_t allocation_size
,
1494 uint32_t private_flags
,
1495 struct security_descriptor
*sd
,
1496 struct ea_list
*ea_list
,
1497 files_struct
**result
,
1499 const struct smb2_create_blobs
*in_context_blobs
,
1500 struct smb2_create_blobs
*out_context_blobs
);
1501 int smb_vfs_call_close(struct vfs_handle_struct
*handle
,
1502 struct files_struct
*fsp
);
1503 ssize_t
smb_vfs_call_pread(struct vfs_handle_struct
*handle
,
1504 struct files_struct
*fsp
, void *data
, size_t n
,
1506 struct tevent_req
*smb_vfs_call_pread_send(struct vfs_handle_struct
*handle
,
1507 TALLOC_CTX
*mem_ctx
,
1508 struct tevent_context
*ev
,
1509 struct files_struct
*fsp
,
1511 size_t n
, off_t offset
);
1512 ssize_t
SMB_VFS_PREAD_RECV(struct tevent_req
*req
, struct vfs_aio_state
*state
);
1514 ssize_t
smb_vfs_call_pwrite(struct vfs_handle_struct
*handle
,
1515 struct files_struct
*fsp
, const void *data
,
1516 size_t n
, off_t offset
);
1517 struct tevent_req
*smb_vfs_call_pwrite_send(struct vfs_handle_struct
*handle
,
1518 TALLOC_CTX
*mem_ctx
,
1519 struct tevent_context
*ev
,
1520 struct files_struct
*fsp
,
1522 size_t n
, off_t offset
);
1523 ssize_t
SMB_VFS_PWRITE_RECV(struct tevent_req
*req
, struct vfs_aio_state
*state
);
1525 off_t
smb_vfs_call_lseek(struct vfs_handle_struct
*handle
,
1526 struct files_struct
*fsp
, off_t offset
,
1528 ssize_t
smb_vfs_call_sendfile(struct vfs_handle_struct
*handle
, int tofd
,
1529 files_struct
*fromfsp
, const DATA_BLOB
*header
,
1530 off_t offset
, size_t count
);
1531 ssize_t
smb_vfs_call_recvfile(struct vfs_handle_struct
*handle
, int fromfd
,
1532 files_struct
*tofsp
, off_t offset
,
1534 int smb_vfs_call_renameat(struct vfs_handle_struct
*handle
,
1535 struct files_struct
*srcfsp
,
1536 const struct smb_filename
*smb_fname_src
,
1537 struct files_struct
*dstfsp
,
1538 const struct smb_filename
*smb_fname_dst
,
1539 const struct vfs_rename_how
*how
);
1541 struct tevent_req
*smb_vfs_call_fsync_send(struct vfs_handle_struct
*handle
,
1542 TALLOC_CTX
*mem_ctx
,
1543 struct tevent_context
*ev
,
1544 struct files_struct
*fsp
);
1545 int SMB_VFS_FSYNC_RECV(struct tevent_req
*req
, struct vfs_aio_state
*state
);
1547 int smb_vfs_fsync_sync(files_struct
*fsp
);
1548 int smb_vfs_call_stat(struct vfs_handle_struct
*handle
,
1549 struct smb_filename
*smb_fname
);
1550 int smb_vfs_call_fstat(struct vfs_handle_struct
*handle
,
1551 struct files_struct
*fsp
, SMB_STRUCT_STAT
*sbuf
);
1552 int smb_vfs_call_lstat(struct vfs_handle_struct
*handle
,
1553 struct smb_filename
*smb_filename
);
1554 int smb_vfs_call_fstatat(
1555 struct vfs_handle_struct
*handle
,
1556 const struct files_struct
*dirfsp
,
1557 const struct smb_filename
*smb_fname
,
1558 SMB_STRUCT_STAT
*sbuf
,
1560 uint64_t smb_vfs_call_get_alloc_size(struct vfs_handle_struct
*handle
,
1561 struct files_struct
*fsp
,
1562 const SMB_STRUCT_STAT
*sbuf
);
1563 int smb_vfs_call_unlinkat(struct vfs_handle_struct
*handle
,
1564 struct files_struct
*dirfsp
,
1565 const struct smb_filename
*smb_fname
,
1567 int smb_vfs_call_fchmod(struct vfs_handle_struct
*handle
,
1568 struct files_struct
*fsp
, mode_t mode
);
1569 int smb_vfs_call_fchown(struct vfs_handle_struct
*handle
,
1570 struct files_struct
*fsp
, uid_t uid
, gid_t gid
);
1571 int smb_vfs_call_lchown(struct vfs_handle_struct
*handle
,
1572 const struct smb_filename
*smb_fname
,
1575 int smb_vfs_call_chdir(struct vfs_handle_struct
*handle
,
1576 const struct smb_filename
*smb_fname
);
1577 struct smb_filename
*smb_vfs_call_getwd(struct vfs_handle_struct
*handle
,
1579 int smb_vfs_call_ntimes(struct vfs_handle_struct
*handle
,
1580 const struct smb_filename
*smb_fname
,
1581 struct smb_file_time
*ft
);
1582 int smb_vfs_call_fntimes(struct vfs_handle_struct
*handle
,
1583 struct files_struct
*fsp
,
1584 struct smb_file_time
*ft
);
1585 int smb_vfs_call_ftruncate(struct vfs_handle_struct
*handle
,
1586 struct files_struct
*fsp
, off_t offset
);
1587 int smb_vfs_call_fallocate(struct vfs_handle_struct
*handle
,
1588 struct files_struct
*fsp
,
1592 bool smb_vfs_call_lock(struct vfs_handle_struct
*handle
,
1593 struct files_struct
*fsp
, int op
, off_t offset
,
1594 off_t count
, int type
);
1595 int smb_vfs_call_filesystem_sharemode(struct vfs_handle_struct
*handle
,
1596 struct files_struct
*fsp
,
1597 uint32_t share_access
,
1598 uint32_t access_mask
);
1599 int smb_vfs_call_fcntl(struct vfs_handle_struct
*handle
,
1600 struct files_struct
*fsp
, int cmd
, ...);
1601 int smb_vfs_call_linux_setlease(struct vfs_handle_struct
*handle
,
1602 struct files_struct
*fsp
, int leasetype
);
1603 bool smb_vfs_call_getlock(struct vfs_handle_struct
*handle
,
1604 struct files_struct
*fsp
, off_t
*poffset
,
1605 off_t
*pcount
, int *ptype
, pid_t
*ppid
);
1606 int smb_vfs_call_symlinkat(struct vfs_handle_struct
*handle
,
1607 const struct smb_filename
*link_contents
,
1608 struct files_struct
*dirfsp
,
1609 const struct smb_filename
*new_smb_fname
);
1610 int smb_vfs_call_readlinkat(struct vfs_handle_struct
*handle
,
1611 const struct files_struct
*dirfsp
,
1612 const struct smb_filename
*smb_fname
,
1615 int smb_vfs_call_linkat(struct vfs_handle_struct
*handle
,
1616 struct files_struct
*srcfsp
,
1617 const struct smb_filename
*old_smb_fname
,
1618 struct files_struct
*dstfsp
,
1619 const struct smb_filename
*new_smb_fname
,
1621 int smb_vfs_call_mknodat(struct vfs_handle_struct
*handle
,
1622 struct files_struct
*dirfsp
,
1623 const struct smb_filename
*smb_fname
,
1626 struct smb_filename
*smb_vfs_call_realpath(struct vfs_handle_struct
*handle
,
1628 const struct smb_filename
*smb_fname
);
1629 int smb_vfs_call_chflags(struct vfs_handle_struct
*handle
,
1630 const struct smb_filename
*smb_fname
,
1631 unsigned int flags
);
1632 int smb_vfs_call_fchflags(struct vfs_handle_struct
*handle
,
1633 struct files_struct
*fsp
,
1634 unsigned int flags
);
1635 struct file_id
smb_vfs_call_file_id_create(struct vfs_handle_struct
*handle
,
1636 const SMB_STRUCT_STAT
*sbuf
);
1637 uint64_t smb_vfs_call_fs_file_id(struct vfs_handle_struct
*handle
,
1638 const SMB_STRUCT_STAT
*sbuf
);
1639 NTSTATUS
smb_vfs_call_fstreaminfo(struct vfs_handle_struct
*handle
,
1640 struct files_struct
*fsp
,
1641 TALLOC_CTX
*mem_ctx
,
1642 unsigned int *num_streams
,
1643 struct stream_struct
**streams
);
1644 NTSTATUS
smb_vfs_call_get_real_filename_at(struct vfs_handle_struct
*handle
,
1645 struct files_struct
*dirfsp
,
1647 TALLOC_CTX
*mem_ctx
,
1649 const char *smb_vfs_call_connectpath(struct vfs_handle_struct
*handle
,
1650 const struct files_struct
*dirfsp
,
1651 const struct smb_filename
*smb_fname
);
1652 NTSTATUS
smb_vfs_call_brl_lock_windows(struct vfs_handle_struct
*handle
,
1653 struct byte_range_lock
*br_lck
,
1654 struct lock_struct
*plock
);
1655 bool smb_vfs_call_brl_unlock_windows(struct vfs_handle_struct
*handle
,
1656 struct byte_range_lock
*br_lck
,
1657 const struct lock_struct
*plock
);
1658 bool smb_vfs_call_strict_lock_check(struct vfs_handle_struct
*handle
,
1659 struct files_struct
*fsp
,
1660 struct lock_struct
*plock
);
1661 NTSTATUS
smb_vfs_call_translate_name(struct vfs_handle_struct
*handle
,
1663 enum vfs_translate_direction direction
,
1664 TALLOC_CTX
*mem_ctx
,
1665 char **mapped_name
);
1666 NTSTATUS
smb_vfs_call_parent_pathname(struct vfs_handle_struct
*handle
,
1667 TALLOC_CTX
*mem_ctx
,
1668 const struct smb_filename
*smb_fname_in
,
1669 struct smb_filename
**parent_dir_out
,
1670 struct smb_filename
**atname_out
);
1671 NTSTATUS
smb_vfs_call_fsctl(struct vfs_handle_struct
*handle
,
1672 struct files_struct
*fsp
,
1676 const uint8_t *_in_data
,
1678 uint8_t **_out_data
,
1679 uint32_t max_out_len
,
1681 NTSTATUS
smb_vfs_call_fget_dos_attributes(struct vfs_handle_struct
*handle
,
1682 struct files_struct
*fsp
,
1684 NTSTATUS
smb_vfs_call_fset_dos_attributes(struct vfs_handle_struct
*handle
,
1685 struct files_struct
*fsp
,
1687 struct tevent_req
*smb_vfs_call_get_dos_attributes_send(
1688 TALLOC_CTX
*mem_ctx
,
1689 struct tevent_context
*ev
,
1690 struct vfs_handle_struct
*handle
,
1691 files_struct
*dir_fsp
,
1692 struct smb_filename
*smb_fname
);
1693 NTSTATUS
smb_vfs_call_get_dos_attributes_recv(
1694 struct tevent_req
*req
,
1695 struct vfs_aio_state
*aio_state
,
1697 struct tevent_req
*smb_vfs_call_offload_read_send(
1698 TALLOC_CTX
*mem_ctx
,
1699 struct tevent_context
*ev
,
1700 struct vfs_handle_struct
*handle
,
1701 struct files_struct
*fsp
,
1706 NTSTATUS
smb_vfs_call_offload_read_recv(struct tevent_req
*req
,
1707 struct vfs_handle_struct
*handle
,
1708 TALLOC_CTX
*mem_ctx
,
1711 DATA_BLOB
*token_blob
);
1712 struct tevent_req
*smb_vfs_call_offload_write_send(struct vfs_handle_struct
*handle
,
1713 TALLOC_CTX
*mem_ctx
,
1714 struct tevent_context
*ev
,
1717 off_t transfer_offset
,
1718 struct files_struct
*dest_fsp
,
1721 NTSTATUS
smb_vfs_call_offload_write_recv(struct vfs_handle_struct
*handle
,
1722 struct tevent_req
*req
,
1724 NTSTATUS
smb_vfs_call_fget_compression(struct vfs_handle_struct
*handle
,
1725 TALLOC_CTX
*mem_ctx
,
1726 struct files_struct
*fsp
,
1727 uint16_t *_compression_fmt
);
1728 NTSTATUS
smb_vfs_call_set_compression(struct vfs_handle_struct
*handle
,
1729 TALLOC_CTX
*mem_ctx
,
1730 struct files_struct
*fsp
,
1731 uint16_t compression_fmt
);
1732 NTSTATUS
smb_vfs_call_snap_check_path(vfs_handle_struct
*handle
,
1733 TALLOC_CTX
*mem_ctx
,
1734 const char *service_path
,
1735 char **base_volume
);
1736 NTSTATUS
smb_vfs_call_snap_create(struct vfs_handle_struct
*handle
,
1737 TALLOC_CTX
*mem_ctx
,
1738 const char *base_volume
,
1743 NTSTATUS
smb_vfs_call_snap_delete(struct vfs_handle_struct
*handle
,
1744 TALLOC_CTX
*mem_ctx
,
1747 NTSTATUS
smb_vfs_call_fget_nt_acl(struct vfs_handle_struct
*handle
,
1748 struct files_struct
*fsp
,
1749 uint32_t security_info
,
1750 TALLOC_CTX
*mem_ctx
,
1751 struct security_descriptor
**ppdesc
);
1752 NTSTATUS
smb_vfs_call_get_nt_acl_at(struct vfs_handle_struct
*handle
,
1753 struct files_struct
*dirfsp
,
1754 const struct smb_filename
*smb_fname
,
1755 uint32_t security_info
,
1756 TALLOC_CTX
*mem_ctx
,
1757 struct security_descriptor
**ppdesc
);
1758 NTSTATUS
smb_vfs_call_fset_nt_acl(struct vfs_handle_struct
*handle
,
1759 struct files_struct
*fsp
,
1760 uint32_t security_info_sent
,
1761 const struct security_descriptor
*psd
);
1762 NTSTATUS
smb_vfs_call_audit_file(struct vfs_handle_struct
*handle
,
1763 struct smb_filename
*file
,
1764 struct security_acl
*sacl
,
1765 uint32_t access_requested
,
1766 uint32_t access_denied
);
1767 int smb_vfs_call_chmod_acl(struct vfs_handle_struct
*handle
,
1768 const struct smb_filename
*file
,
1770 SMB_ACL_T
smb_vfs_call_sys_acl_get_fd(struct vfs_handle_struct
*handle
,
1771 struct files_struct
*fsp
,
1772 SMB_ACL_TYPE_T type
,
1773 TALLOC_CTX
*mem_ctx
);
1774 int smb_vfs_call_sys_acl_blob_get_fd(struct vfs_handle_struct
*handle
,
1775 struct files_struct
*fsp
,
1776 TALLOC_CTX
*mem_ctx
,
1777 char **blob_description
,
1779 int smb_vfs_call_sys_acl_set_fd(struct vfs_handle_struct
*handle
,
1780 struct files_struct
*fsp
,
1781 SMB_ACL_TYPE_T type
,
1783 int smb_vfs_call_sys_acl_delete_def_fd(struct vfs_handle_struct
*handle
,
1784 struct files_struct
*fsp
);
1785 struct tevent_req
*smb_vfs_call_getxattrat_send(
1786 TALLOC_CTX
*mem_ctx
,
1787 struct tevent_context
*ev
,
1788 struct vfs_handle_struct
*handle
,
1789 files_struct
*dir_fsp
,
1790 const struct smb_filename
*smb_fname
,
1791 const char *xattr_name
,
1793 ssize_t
smb_vfs_call_getxattrat_recv(struct tevent_req
*req
,
1794 struct vfs_aio_state
*aio_state
,
1795 TALLOC_CTX
*mem_ctx
,
1796 uint8_t **xattr_value
);
1797 ssize_t
smb_vfs_call_fgetxattr(struct vfs_handle_struct
*handle
,
1798 struct files_struct
*fsp
, const char *name
,
1799 void *value
, size_t size
);
1800 ssize_t
smb_vfs_call_flistxattr(struct vfs_handle_struct
*handle
,
1801 struct files_struct
*fsp
, char *list
,
1803 int smb_vfs_call_fremovexattr(struct vfs_handle_struct
*handle
,
1804 struct files_struct
*fsp
, const char *name
);
1805 int smb_vfs_call_lsetxattr(struct vfs_handle_struct
*handle
, const char *path
,
1806 const char *name
, const void *value
, size_t size
,
1808 int smb_vfs_call_fsetxattr(struct vfs_handle_struct
*handle
,
1809 struct files_struct
*fsp
, const char *name
,
1810 const void *value
, size_t size
, int flags
);
1811 bool smb_vfs_call_aio_force(struct vfs_handle_struct
*handle
,
1812 struct files_struct
*fsp
);
1813 NTSTATUS
smb_vfs_call_durable_cookie(struct vfs_handle_struct
*handle
,
1814 struct files_struct
*fsp
,
1815 TALLOC_CTX
*mem_ctx
,
1817 NTSTATUS
smb_vfs_call_durable_disconnect(struct vfs_handle_struct
*handle
,
1818 struct files_struct
*fsp
,
1819 const DATA_BLOB old_cookie
,
1820 TALLOC_CTX
*mem_ctx
,
1821 DATA_BLOB
*new_cookie
);
1822 NTSTATUS
smb_vfs_call_durable_reconnect(struct vfs_handle_struct
*handle
,
1823 struct smb_request
*smb1req
,
1824 struct smbXsrv_open
*op
,
1825 const DATA_BLOB old_cookie
,
1826 TALLOC_CTX
*mem_ctx
,
1827 struct files_struct
**fsp
,
1828 DATA_BLOB
*new_cookie
);
1829 NTSTATUS
smb_vfs_call_freaddir_attr(struct vfs_handle_struct
*handle
,
1830 struct files_struct
*fsp
,
1831 TALLOC_CTX
*mem_ctx
,
1832 struct readdir_attr_data
**attr_data
);
1834 NTSTATUS
smb_register_vfs(int version
, const char *name
,
1835 const struct vfs_fn_pointers
*fns
);
1836 void *vfs_add_fsp_extension_notype(vfs_handle_struct
*handle
,
1837 files_struct
*fsp
, size_t ext_size
,
1838 void (*destroy_fn
)(void *p_data
));
1839 void vfs_remove_fsp_extension(vfs_handle_struct
*handle
, files_struct
*fsp
);
1840 void vfs_remove_all_fsp_extensions(struct files_struct
*fsp
);
1841 void *vfs_memctx_fsp_extension(vfs_handle_struct
*handle
,
1842 const struct files_struct
*fsp
);
1843 void *vfs_fetch_fsp_extension(vfs_handle_struct
*handle
, const struct files_struct
*fsp
);
1845 void smb_vfs_assert_all_fns(const struct vfs_fn_pointers
* fns
,
1846 const char *module
);
1849 * Helper functions from source3/modules/vfs_not_implemented.c
1851 int vfs_not_implemented_connect(
1852 vfs_handle_struct
*handle
,
1853 const char *service
,
1855 void vfs_not_implemented_disconnect(vfs_handle_struct
*handle
);
1856 uint64_t vfs_not_implemented_disk_free(vfs_handle_struct
*handle
,
1857 const struct smb_filename
*smb_fname
,
1861 int vfs_not_implemented_get_quota(vfs_handle_struct
*handle
,
1862 const struct smb_filename
*smb_fname
,
1863 enum SMB_QUOTA_TYPE qtype
,
1865 SMB_DISK_QUOTA
*dq
);
1866 int vfs_not_implemented_set_quota(vfs_handle_struct
*handle
,
1867 enum SMB_QUOTA_TYPE qtype
,
1868 unid_t id
, SMB_DISK_QUOTA
*dq
);
1869 int vfs_not_implemented_get_shadow_copy_data(vfs_handle_struct
*handle
,
1871 struct shadow_copy_data
*shadow_copy_data
,
1873 int vfs_not_implemented_statvfs(struct vfs_handle_struct
*handle
,
1874 const struct smb_filename
*smb_fname
,
1875 struct vfs_statvfs_struct
*statbuf
);
1876 uint32_t vfs_not_implemented_fs_capabilities(struct vfs_handle_struct
*handle
,
1877 enum timestamp_set_resolution
*p_ts_res
);
1878 NTSTATUS
vfs_not_implemented_get_dfs_referrals(struct vfs_handle_struct
*handle
,
1879 struct dfs_GetDFSReferral
*r
);
1880 NTSTATUS
vfs_not_implemented_create_dfs_pathat(struct vfs_handle_struct
*handle
,
1881 struct files_struct
*dirfsp
,
1882 const struct smb_filename
*smb_fname
,
1883 const struct referral
*reflist
,
1884 size_t referral_count
);
1885 NTSTATUS
vfs_not_implemented_read_dfs_pathat(struct vfs_handle_struct
*handle
,
1886 TALLOC_CTX
*mem_ctx
,
1887 struct files_struct
*dirfsp
,
1888 struct smb_filename
*smb_fname
,
1889 struct referral
**ppreflist
,
1890 size_t *preferral_count
);
1891 NTSTATUS
vfs_not_implemented_snap_check_path(struct vfs_handle_struct
*handle
,
1892 TALLOC_CTX
*mem_ctx
,
1893 const char *service_path
,
1894 char **base_volume
);
1895 NTSTATUS
vfs_not_implemented_snap_create(struct vfs_handle_struct
*handle
,
1896 TALLOC_CTX
*mem_ctx
,
1897 const char *base_volume
,
1902 NTSTATUS
vfs_not_implemented_snap_delete(struct vfs_handle_struct
*handle
,
1903 TALLOC_CTX
*mem_ctx
,
1906 DIR *vfs_not_implemented_fdopendir(vfs_handle_struct
*handle
, files_struct
*fsp
,
1907 const char *mask
, uint32_t attr
);
1908 struct dirent
*vfs_not_implemented_readdir(vfs_handle_struct
*handle
,
1909 struct files_struct
*dirfsp
,
1911 void vfs_not_implemented_rewind_dir(vfs_handle_struct
*handle
, DIR *dirp
);
1912 int vfs_not_implemented_mkdirat(vfs_handle_struct
*handle
,
1913 struct files_struct
*dirfsp
,
1914 const struct smb_filename
*smb_fname
,
1916 int vfs_not_implemented_closedir(vfs_handle_struct
*handle
, DIR *dir
);
1917 int vfs_not_implemented_open(vfs_handle_struct
*handle
,
1918 struct smb_filename
*smb_fname
,
1919 files_struct
*fsp
, int flags
, mode_t mode
);
1920 int vfs_not_implemented_openat(vfs_handle_struct
*handle
,
1921 const struct files_struct
*dirfsp
,
1922 const struct smb_filename
*smb_fname
,
1923 struct files_struct
*fsp
,
1924 const struct vfs_open_how
*how
);
1925 NTSTATUS
vfs_not_implemented_create_file(struct vfs_handle_struct
*handle
,
1926 struct smb_request
*req
,
1927 struct files_struct
*dirfsp
,
1928 struct smb_filename
*smb_fname
,
1929 uint32_t access_mask
,
1930 uint32_t share_access
,
1931 uint32_t create_disposition
,
1932 uint32_t create_options
,
1933 uint32_t file_attributes
,
1934 uint32_t oplock_request
,
1935 const struct smb2_lease
*lease
,
1936 uint64_t allocation_size
,
1937 uint32_t private_flags
,
1938 struct security_descriptor
*sd
,
1939 struct ea_list
*ea_list
,
1940 files_struct
**result
, int *pinfo
,
1941 const struct smb2_create_blobs
*in_context_blobs
,
1942 struct smb2_create_blobs
*out_context_blobs
);
1943 int vfs_not_implemented_close_fn(vfs_handle_struct
*handle
, files_struct
*fsp
);
1944 ssize_t
vfs_not_implemented_pread(vfs_handle_struct
*handle
, files_struct
*fsp
,
1945 void *data
, size_t n
, off_t offset
);
1946 struct tevent_req
*vfs_not_implemented_pread_send(struct vfs_handle_struct
*handle
,
1947 TALLOC_CTX
*mem_ctx
,
1948 struct tevent_context
*ev
,
1949 struct files_struct
*fsp
,
1950 void *data
, size_t n
, off_t offset
);
1951 ssize_t
vfs_not_implemented_pread_recv(struct tevent_req
*req
,
1952 struct vfs_aio_state
*vfs_aio_state
);
1953 ssize_t
vfs_not_implemented_pwrite(vfs_handle_struct
*handle
, files_struct
*fsp
,
1954 const void *data
, size_t n
, off_t offset
);
1955 struct tevent_req
*vfs_not_implemented_pwrite_send(struct vfs_handle_struct
*handle
,
1956 TALLOC_CTX
*mem_ctx
,
1957 struct tevent_context
*ev
,
1958 struct files_struct
*fsp
,
1960 size_t n
, off_t offset
);
1961 ssize_t
vfs_not_implemented_pwrite_recv(struct tevent_req
*req
,
1962 struct vfs_aio_state
*vfs_aio_state
);
1963 off_t
vfs_not_implemented_lseek(vfs_handle_struct
*handle
, files_struct
*fsp
,
1964 off_t offset
, int whence
);
1965 ssize_t
vfs_not_implemented_sendfile(vfs_handle_struct
*handle
, int tofd
,
1966 files_struct
*fromfsp
, const DATA_BLOB
*hdr
,
1967 off_t offset
, size_t n
);
1968 ssize_t
vfs_not_implemented_recvfile(vfs_handle_struct
*handle
, int fromfd
,
1969 files_struct
*tofsp
, off_t offset
, size_t n
);
1970 int vfs_not_implemented_renameat(vfs_handle_struct
*handle
,
1971 files_struct
*srcfsp
,
1972 const struct smb_filename
*smb_fname_src
,
1973 files_struct
*dstfsp
,
1974 const struct smb_filename
*smb_fname_dst
,
1975 const struct vfs_rename_how
*how
);
1976 struct tevent_req
*vfs_not_implemented_fsync_send(struct vfs_handle_struct
*handle
,
1977 TALLOC_CTX
*mem_ctx
,
1978 struct tevent_context
*ev
,
1979 struct files_struct
*fsp
);
1980 int vfs_not_implemented_fsync_recv(struct tevent_req
*req
,
1981 struct vfs_aio_state
*vfs_aio_state
);
1982 int vfs_not_implemented_stat(vfs_handle_struct
*handle
, struct smb_filename
*smb_fname
);
1983 int vfs_not_implemented_fstat(vfs_handle_struct
*handle
, files_struct
*fsp
,
1984 SMB_STRUCT_STAT
*sbuf
);
1985 int vfs_not_implemented_lstat(vfs_handle_struct
*handle
,
1986 struct smb_filename
*smb_fname
);
1987 int vfs_not_implemented_fstatat(
1988 struct vfs_handle_struct
*handle
,
1989 const struct files_struct
*dirfsp
,
1990 const struct smb_filename
*smb_fname
,
1991 SMB_STRUCT_STAT
*sbuf
,
1993 uint64_t vfs_not_implemented_get_alloc_size(struct vfs_handle_struct
*handle
,
1994 struct files_struct
*fsp
,
1995 const SMB_STRUCT_STAT
*sbuf
);
1996 int vfs_not_implemented_unlinkat(vfs_handle_struct
*handle
,
1997 struct files_struct
*dirfsp
,
1998 const struct smb_filename
*smb_fname
,
2000 int vfs_not_implemented_fchmod(vfs_handle_struct
*handle
, files_struct
*fsp
,
2002 int vfs_not_implemented_fchown(vfs_handle_struct
*handle
, files_struct
*fsp
,
2003 uid_t uid
, gid_t gid
);
2004 int vfs_not_implemented_lchown(vfs_handle_struct
*handle
,
2005 const struct smb_filename
*smb_fname
,
2008 int vfs_not_implemented_chdir(vfs_handle_struct
*handle
,
2009 const struct smb_filename
*smb_fname
);
2010 struct smb_filename
*vfs_not_implemented_getwd(vfs_handle_struct
*handle
,
2012 int vfs_not_implemented_ntimes(vfs_handle_struct
*handle
,
2013 const struct smb_filename
*smb_fname
,
2014 struct smb_file_time
*ft
);
2015 int vfs_not_implemented_fntimes(vfs_handle_struct
*handle
,
2017 struct smb_file_time
*ft
);
2018 int vfs_not_implemented_ftruncate(vfs_handle_struct
*handle
, files_struct
*fsp
,
2020 int vfs_not_implemented_fallocate(vfs_handle_struct
*handle
, files_struct
*fsp
,
2021 uint32_t mode
, off_t offset
, off_t len
);
2022 bool vfs_not_implemented_lock(vfs_handle_struct
*handle
, files_struct
*fsp
, int op
,
2023 off_t offset
, off_t count
, int type
);
2024 int vfs_not_implemented_filesystem_sharemode(struct vfs_handle_struct
*handle
,
2025 struct files_struct
*fsp
,
2026 uint32_t share_access
,
2027 uint32_t access_mask
);
2028 int vfs_not_implemented_fcntl(struct vfs_handle_struct
*handle
,
2029 struct files_struct
*fsp
, int cmd
, va_list cmd_arg
);
2030 int vfs_not_implemented_linux_setlease(struct vfs_handle_struct
*handle
,
2031 struct files_struct
*fsp
, int leasetype
);
2032 bool vfs_not_implemented_getlock(vfs_handle_struct
*handle
, files_struct
*fsp
,
2033 off_t
*poffset
, off_t
*pcount
, int *ptype
,
2035 int vfs_not_implemented_symlinkat(vfs_handle_struct
*handle
,
2036 const struct smb_filename
*link_contents
,
2037 struct files_struct
*dirfsp
,
2038 const struct smb_filename
*new_smb_fname
);
2039 int vfs_not_implemented_vfs_readlinkat(vfs_handle_struct
*handle
,
2040 const struct files_struct
*dirfsp
,
2041 const struct smb_filename
*smb_fname
,
2044 int vfs_not_implemented_linkat(vfs_handle_struct
*handle
,
2045 struct files_struct
*srcfsp
,
2046 const struct smb_filename
*old_smb_fname
,
2047 struct files_struct
*dstfsp
,
2048 const struct smb_filename
*new_smb_fname
,
2050 int vfs_not_implemented_mknodat(vfs_handle_struct
*handle
,
2051 struct files_struct
*dirfsp
,
2052 const struct smb_filename
*smb_fname
,
2055 struct smb_filename
*vfs_not_implemented_realpath(vfs_handle_struct
*handle
,
2057 const struct smb_filename
*smb_fname
);
2058 int vfs_not_implemented_chflags(vfs_handle_struct
*handle
,
2059 const struct smb_filename
*smb_fname
,
2061 int vfs_not_implemented_fchflags(vfs_handle_struct
*handle
,
2062 struct files_struct
*fst
,
2064 struct file_id
vfs_not_implemented_file_id_create(vfs_handle_struct
*handle
,
2065 const SMB_STRUCT_STAT
*sbuf
);
2066 uint64_t vfs_not_implemented_fs_file_id(vfs_handle_struct
*handle
,
2067 const SMB_STRUCT_STAT
*sbuf
);
2068 struct tevent_req
*vfs_not_implemented_offload_read_send(
2069 TALLOC_CTX
*mem_ctx
,
2070 struct tevent_context
*ev
,
2071 struct vfs_handle_struct
*handle
,
2072 struct files_struct
*fsp
,
2077 NTSTATUS
vfs_not_implemented_offload_read_recv(struct tevent_req
*req
,
2078 struct vfs_handle_struct
*handle
,
2079 TALLOC_CTX
*mem_ctx
,
2082 DATA_BLOB
*_token_blob
);
2083 struct tevent_req
*vfs_not_implemented_offload_write_send(
2084 struct vfs_handle_struct
*handle
,
2085 TALLOC_CTX
*mem_ctx
,
2086 struct tevent_context
*ev
,
2089 off_t transfer_offset
,
2090 struct files_struct
*dest_fsp
,
2093 NTSTATUS
vfs_not_implemented_offload_write_recv(struct vfs_handle_struct
*handle
,
2094 struct tevent_req
*req
,
2096 NTSTATUS
vfs_not_implemented_fget_compression(struct vfs_handle_struct
*handle
,
2097 TALLOC_CTX
*mem_ctx
,
2098 struct files_struct
*fsp
,
2099 uint16_t *_compression_fmt
);
2100 NTSTATUS
vfs_not_implemented_set_compression(struct vfs_handle_struct
*handle
,
2101 TALLOC_CTX
*mem_ctx
,
2102 struct files_struct
*fsp
,
2103 uint16_t compression_fmt
);
2104 NTSTATUS
vfs_not_implemented_fstreaminfo(struct vfs_handle_struct
*handle
,
2105 struct files_struct
*fsp
,
2106 TALLOC_CTX
*mem_ctx
,
2107 unsigned int *num_streams
,
2108 struct stream_struct
**streams
);
2109 NTSTATUS
vfs_not_implemented_get_real_filename(
2110 struct vfs_handle_struct
*handle
,
2111 const struct smb_filename
*path
,
2113 TALLOC_CTX
*mem_ctx
,
2115 NTSTATUS
vfs_not_implemented_get_real_filename_at(
2116 struct vfs_handle_struct
*handle
,
2117 struct files_struct
*dirfsp
,
2119 TALLOC_CTX
*mem_ctx
,
2121 const char *vfs_not_implemented_connectpath(
2122 struct vfs_handle_struct
*handle
,
2123 const struct files_struct
*dirfsp
,
2124 const struct smb_filename
*smb_fname
);
2125 NTSTATUS
vfs_not_implemented_brl_lock_windows(struct vfs_handle_struct
*handle
,
2126 struct byte_range_lock
*br_lck
,
2127 struct lock_struct
*plock
);
2128 bool vfs_not_implemented_brl_unlock_windows(struct vfs_handle_struct
*handle
,
2129 struct byte_range_lock
*br_lck
,
2130 const struct lock_struct
*plock
);
2131 bool vfs_not_implemented_strict_lock_check(struct vfs_handle_struct
*handle
,
2132 struct files_struct
*fsp
,
2133 struct lock_struct
*plock
);
2134 NTSTATUS
vfs_not_implemented_translate_name(struct vfs_handle_struct
*handle
,
2135 const char *mapped_name
,
2136 enum vfs_translate_direction direction
,
2137 TALLOC_CTX
*mem_ctx
, char **pmapped_name
);
2138 NTSTATUS
vfs_not_implemented_parent_pathname(struct vfs_handle_struct
*handle
,
2139 TALLOC_CTX
*mem_ctx
,
2140 const struct smb_filename
*smb_fname_in
,
2141 struct smb_filename
**parent_dir_out
,
2142 struct smb_filename
**atname_out
);
2143 NTSTATUS
vfs_not_implemented_fsctl(struct vfs_handle_struct
*handle
,
2144 struct files_struct
*fsp
,
2147 uint16_t req_flags
, /* Needed for UNICODE ... */
2148 const uint8_t *_in_data
,
2150 uint8_t **_out_data
,
2151 uint32_t max_out_len
, uint32_t *out_len
);
2152 NTSTATUS
vfs_not_implemented_freaddir_attr(struct vfs_handle_struct
*handle
,
2153 struct files_struct
*dirfsp
,
2154 TALLOC_CTX
*mem_ctx
,
2155 struct readdir_attr_data
**pattr_data
);
2156 struct tevent_req
*vfs_not_implemented_get_dos_attributes_send(
2157 TALLOC_CTX
*mem_ctx
,
2158 struct tevent_context
*ev
,
2159 struct vfs_handle_struct
*handle
,
2160 files_struct
*dir_fsp
,
2161 struct smb_filename
*smb_fname
);
2162 NTSTATUS
vfs_not_implemented_get_dos_attributes_recv(
2163 struct tevent_req
*req
,
2164 struct vfs_aio_state
*aio_state
,
2166 NTSTATUS
vfs_not_implemented_fget_dos_attributes(struct vfs_handle_struct
*handle
,
2167 struct files_struct
*fsp
,
2169 NTSTATUS
vfs_not_implemented_set_dos_attributes(struct vfs_handle_struct
*handle
,
2170 const struct smb_filename
*smb_fname
,
2172 NTSTATUS
vfs_not_implemented_fset_dos_attributes(struct vfs_handle_struct
*handle
,
2173 struct files_struct
*fsp
,
2175 NTSTATUS
vfs_not_implemented_fget_nt_acl(vfs_handle_struct
*handle
, files_struct
*fsp
,
2176 uint32_t security_info
,
2177 TALLOC_CTX
*mem_ctx
,
2178 struct security_descriptor
**ppdesc
);
2179 NTSTATUS
vfs_not_implemented_get_nt_acl_at(vfs_handle_struct
*handle
,
2180 struct files_struct
*dirfsp
,
2181 const struct smb_filename
*smb_fname
,
2182 uint32_t security_info
,
2183 TALLOC_CTX
*mem_ctx
,
2184 struct security_descriptor
**ppdesc
);
2185 NTSTATUS
vfs_not_implemented_fset_nt_acl(vfs_handle_struct
*handle
, files_struct
*fsp
,
2186 uint32_t security_info_sent
,
2187 const struct security_descriptor
*psd
);
2188 SMB_ACL_T
vfs_not_implemented_sys_acl_get_fd(vfs_handle_struct
*handle
,
2190 SMB_ACL_TYPE_T type
,
2191 TALLOC_CTX
*mem_ctx
);
2192 int vfs_not_implemented_sys_acl_blob_get_fd(vfs_handle_struct
*handle
,
2193 files_struct
*fsp
, TALLOC_CTX
*mem_ctx
,
2194 char **blob_description
, DATA_BLOB
*blob
);
2195 int vfs_not_implemented_sys_acl_set_fd(vfs_handle_struct
*handle
,
2196 struct files_struct
*fsp
,
2197 SMB_ACL_TYPE_T type
,
2199 int vfs_not_implemented_sys_acl_delete_def_fd(vfs_handle_struct
*handle
,
2201 struct tevent_req
*vfs_not_implemented_getxattrat_send(
2202 TALLOC_CTX
*mem_ctx
,
2203 struct tevent_context
*ev
,
2204 struct vfs_handle_struct
*handle
,
2205 files_struct
*dir_fsp
,
2206 const struct smb_filename
*smb_fname
,
2207 const char *xattr_name
,
2209 ssize_t
vfs_not_implemented_getxattrat_recv(struct tevent_req
*req
,
2210 struct vfs_aio_state
*aio_state
,
2211 TALLOC_CTX
*mem_ctx
,
2212 uint8_t **xattr_value
);
2213 ssize_t
vfs_not_implemented_fgetxattr(vfs_handle_struct
*handle
,
2214 struct files_struct
*fsp
, const char *name
,
2215 void *value
, size_t size
);
2216 ssize_t
vfs_not_implemented_listxattr(vfs_handle_struct
*handle
,
2217 const struct smb_filename
*smb_fname
,
2220 ssize_t
vfs_not_implemented_flistxattr(vfs_handle_struct
*handle
,
2221 struct files_struct
*fsp
, char *list
,
2223 int vfs_not_implemented_fremovexattr(vfs_handle_struct
*handle
,
2224 struct files_struct
*fsp
, const char *name
);
2225 int vfs_not_implemented_setxattr(vfs_handle_struct
*handle
,
2226 const struct smb_filename
*smb_fname
,
2231 int vfs_not_implemented_fsetxattr(vfs_handle_struct
*handle
, struct files_struct
*fsp
,
2232 const char *name
, const void *value
, size_t size
,
2234 bool vfs_not_implemented_aio_force(struct vfs_handle_struct
*handle
,
2235 struct files_struct
*fsp
);
2236 NTSTATUS
vfs_not_implemented_audit_file(struct vfs_handle_struct
*handle
,
2237 struct smb_filename
*file
,
2238 struct security_acl
*sacl
,
2239 uint32_t access_requested
,
2240 uint32_t access_denied
);
2241 NTSTATUS
vfs_not_implemented_durable_cookie(struct vfs_handle_struct
*handle
,
2242 struct files_struct
*fsp
,
2243 TALLOC_CTX
*mem_ctx
,
2245 NTSTATUS
vfs_not_implemented_durable_disconnect(struct vfs_handle_struct
*handle
,
2246 struct files_struct
*fsp
,
2247 const DATA_BLOB old_cookie
,
2248 TALLOC_CTX
*mem_ctx
,
2249 DATA_BLOB
*new_cookie
);
2250 NTSTATUS
vfs_not_implemented_durable_reconnect(struct vfs_handle_struct
*handle
,
2251 struct smb_request
*smb1req
,
2252 struct smbXsrv_open
*op
,
2253 const DATA_BLOB old_cookie
,
2254 TALLOC_CTX
*mem_ctx
,
2255 struct files_struct
**fsp
,
2256 DATA_BLOB
*new_cookie
);