summaryrefslogtreecommitdiff
path: root/source3/modules/util_reparse.c
AgeCommit message (Collapse)AuthorFilesLines
2024-11-22smbd: Allow symlinks to be read via GET_REPARSE_POINTVolker Lendecke1-0/+44
... to be used soon Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2024-07-12smbd: Show blk and chr devices as nfs reparse pointsVolker Lendecke1-0/+41
Can't test these in selftest, we can't create devices and I don't want us to depend on /dev to exist. Tested manually on a system where /dev/null exists: Try "help" to get a list of possible commands. smb: \> allinfo null altname: null create_time: Fri Jun 21 02:45:59 PM 2024 CEST access_time: Fri Jun 21 02:45:59 PM 2024 CEST write_time: Fri Jun 21 02:45:59 PM 2024 CEST change_time: Fri Jun 21 02:45:59 PM 2024 CEST attributes: (480) stream: [::$DATA], 0 bytes 0x80000014 (IO_REPARSE_TAG_NFS) 0x524843 (NFS_SPECFILE_CHR) 1/3 smb: \> Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Jul 12 21:36:16 UTC 2024 on atb-devel-224
2024-07-12smbd: Report sockets as NFS style reparse pointsVolker Lendecke1-0/+20
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2024-07-12smbd: Factor out fsctl_get_reparse_point_intVolker Lendecke1-13/+24
We'll use it for the other special files as well Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2024-07-12smbd: Report FIFOs as NFS style reparse pointsVolker Lendecke1-0/+41
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2024-07-12smbd: Turn an if-statement getting reparse points into a switchVolker Lendecke1-1/+5
There will be more cases soon Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2024-06-28smbd: Fix cached dos attributesVolker Lendecke1-0/+4
The callers of fset_dos_mode must set the cached attributes themselves, which I did not see. I tried, but I did not find a clean way to fix this behind SMB_VFS_FSET_DOS_ATTRIBUTES, with a smb_fname and smb_fname->fsp->fsp_name we might have two copies of the cached dos attributes around and if we only update fsp->fsp_name, we might miss the outer one. Not doing a test, this is really fresh code, and in the future we must reorganize setting and caching dos attributes anyway. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Fri Jun 28 14:32:27 UTC 2024 on atb-devel-224
2024-05-14smbd: Use fsctl_get_reparse_tag in fsctl_del_reparse_pointVolker Lendecke1-9/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2024-05-14smbd: Use fsctl_get_reparse_tag in fsctl_set_reparse_pointVolker Lendecke1-19/+7
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2024-05-14smbd: Add fsctl_get_reparse_tag() helper functionVolker Lendecke1-0/+17
There's a few places where we only care about the tag Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2024-05-14smbd: Add DEBUG message got get_reparse_pointVolker Lendecke1-0/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2024-05-06smbd: Implement FSCTL_DELETE_REPARSE_POINTVolker Lendecke1-2/+67
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon May 6 21:55:03 UTC 2024 on atb-devel-224
2024-05-06smbd: Implement fsctl_set_reparse_pointVolker Lendecke1-1/+59
Store the data in the "user.SmbReparse" xattr. Only allow this on regular files. Windows does it for directories too, but we can not allow this: Setting a symlink reparse point in a xattr on a directory would go unnoticed by our openat2-optimization. If someone really needs this, we could have a VFS module disallowing openat2 and doing the appropriate checks on every openat-call. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2024-05-06smbd: Implement fsctl_get_reparse_pointVolker Lendecke1-2/+89
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2024-05-06smbd: Use reparse_buffer_check() in fsctl_set_reparse_point()Volker Lendecke1-27/+15
check_reparse_data_buffer() was duplicated code Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2024-05-06smbd: Prepare to return the reparse tag from fsctl_get_reparse_pointVolker Lendecke1-0/+1
We'll need this in many places, for example when listing directories Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2024-05-06smbd: Change the output of fsctl_get_reparse_point to uint8Volker Lendecke1-2/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-22smbd: Implement SET_REPARSE_POINT buffer size checksVolker Lendecke1-0/+34
Partially survives samba.tests.reparsepoints.ReparsePoints.test_create_reparse NTTRANS-FSCTL needs changing: Windows 2016 returns INVALID_BUFFER_SIZE instead of our NOT_A_REPARSE_POINT. This is not the whole story, but this smbtorture3 change makes autobuild survive. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-22smbd: Rename "ctx" to the more common "mem_ctx" in reparse functionsVolker Lendecke1-3/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-22smbd: Print the file name in reparse point functionsVolker Lendecke1-3/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-06-15vfs: Move reparse point functions to util_reparse.cVolker Lendecke1-0/+50
Shamelessly copied from from Jeremy's smb2-unix branch :-) No change in behaviour, but we will have to cope with reparse points in the future. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Jun 15 19:25:40 UTC 2020 on sn-devel-184