The branch, master has been updated via cac38aa3870 vfs: Remove vfs telldir/seekdir functions via e2fbe361bab smbd: Remove the offset argument from ReadDirName() via c37d6be2db8 smbd: Remove unused dptr_SearchDir() and the dir cache via be3232d12e1 smbd: Do the "skip to resume name" in call_trans2findnext() via c5dca6d5b7e smbd: Make dptr_ReadDirName() public via baaa0c66193 smbd: Add dptr_struct->last_name_sent via 99799bcdc85 smbd: Remove unused _prev_offset arg from smbd_dirptr_get_entry() via 94648811f5f smbd: Remove unused dptr_SeekDir() via 91fa49c11cc smbd: Avoid dptr_SeekDir() when overflowing the dir buffer via 0b27175764c smbd: Add smbd_dirptr_push_overflow() via 91c76f6514b smbd: Simplify dptr_ReadDirName() via d4c669c1cc4 smbd: Avoid a few else branches in smb2_query_directory_next_entry() via adc7fb32d34 smbd: Make get_dir_entry() static in SMB1-only code via abcc7e69ce0 smbd: Slightly simplify smbd_dirptr_lanman2_entry()'s overflow logic via ae4d8ddbeef smbd: Eliminiate some dead code via 2b725480dd4 smbd: Use dptr_RewindDir() instead of dptr_SeekDir(.., 0) via 2498a48abc7 smbd: Apply some README.Coding to call_trans2findfirst/next() via 4935c0b54c9 smbd: Introduce "dir_hnd" helper variable in smbd_dirptr_get_entry() via aa77aa3e883 smbd: Remove unused "poffset" parameter from SearchDir() via c80b34533f2 smbd: Remove unused "poffset" parameter from dptr_SearchDir() via 4fce29debac smbd: Remove unused "pst" parameter from dptr_SearchDir() via d9755c7c44d smbd: Modernize a few overlog DEBUG statements via 61c923063c3 conf: Fix wrong language in "dos charset" smb.conf.5 entry via 3f3df7dd036 testparm: Fix a typo via 7e465b8e220 smbd: Use ISDOT() in exact_match() via 4ee821ae2b2 vfs: Remove two "== true" via 4115a2e478f vfs: Modernize a few DEBUG statements via f5afcddbe45 vfs: Fix a typo via 162787cddbf lib: Fix whitespace from e0b1aaea1a3 third_party: Update nss_wrapper to version 1.1.15
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit cac38aa38704c31d20d54e6cd7f53e99685aae72 Author: Volker Lendecke <v...@samba.org> Date: Fri Jun 9 17:33:02 2023 +0200 vfs: Remove vfs telldir/seekdir functions Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Wed Jun 14 00:26:55 UTC 2023 on atb-devel-224 commit e2fbe361bab52e906886e70cbaf689393d129285 Author: Volker Lendecke <v...@samba.org> Date: Sat Jun 10 15:29:35 2023 +0200 smbd: Remove the offset argument from ReadDirName() Nobody does anything with this anymore, we just call ReadDirName() in sequence or do a RewindDir(). So we don't have to look at offsets as given by the file system anymore. Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit c37d6be2db8ee30d632275e7b1c156a8b5d791a7 Author: Volker Lendecke <v...@samba.org> Date: Fri Jun 9 16:52:48 2023 +0200 smbd: Remove unused dptr_SearchDir() and the dir cache Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit be3232d12e1cd7585608d319946fd1bce7af9aba Author: Volker Lendecke <v...@samba.org> Date: Fri Jun 9 16:47:19 2023 +0200 smbd: Do the "skip to resume name" in call_trans2findnext() This is SMB1-only logic that can be removed from dir.c Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit c5dca6d5b7e3482aa52117e66fc8e31c0a8896e4 Author: Volker Lendecke <v...@samba.org> Date: Fri Jun 9 16:38:32 2023 +0200 smbd: Make dptr_ReadDirName() public Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit baaa0c66193dd17ec08ba19689f935ff393062dd Author: Volker Lendecke <v...@samba.org> Date: Fri Jun 9 15:22:31 2023 +0200 smbd: Add dptr_struct->last_name_sent Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 99799bcdc8544e884bdf29347df540cbb313237c Author: Volker Lendecke <v...@samba.org> Date: Fri Jun 9 15:05:07 2023 +0200 smbd: Remove unused _prev_offset arg from smbd_dirptr_get_entry() Neither of the two callers looked at the result. Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 94648811f5fe08a7019597eb0445b3c09cdf606f Author: Volker Lendecke <v...@samba.org> Date: Fri Jun 9 14:53:52 2023 +0200 smbd: Remove unused dptr_SeekDir() Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 91fa49c11cc7098c6b9a6dc008d67e1781721894 Author: Volker Lendecke <v...@samba.org> Date: Fri Jun 9 14:52:11 2023 +0200 smbd: Avoid dptr_SeekDir() when overflowing the dir buffer Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 0b27175764c8b7718f85a455beda84f345243cd6 Author: Volker Lendecke <v...@samba.org> Date: Sat May 27 13:20:56 2023 +0200 smbd: Add smbd_dirptr_push_overflow() This saves the result of smbd_dirptr_get_entry() for later retrieval in case we could not marshall it to the output buffer. Return this entry when calling smbd_dirptr_get_entry() again. Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 91c76f6514b02f7f73b28fd4915fefd6a772f7f1 Author: Volker Lendecke <v...@samba.org> Date: Tue Jun 13 15:42:19 2023 +0200 smbd: Simplify dptr_ReadDirName() While trying to understand the ReadDirName() at the end of dptr_ReadDirName() in a code path that was supposed to be just a "stat"-style readdir with a non-wcard mask I came to the conclusion that this was there to find dptr->wcard with a mangled name. get_real_filename_at() already takes care of name mangling, so I think I could eliminate a source of confusion by using it. Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit d4c669c1cc47b28ead2b15d8c7d2928518cf876a Author: Volker Lendecke <v...@samba.org> Date: Sat May 27 13:07:08 2023 +0200 smbd: Avoid a few else branches in smb2_query_directory_next_entry() There's early returns or gotos anyway Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit adc7fb32d34a01e821540289a6a64d6fc61a4a43 Author: Volker Lendecke <v...@samba.org> Date: Tue May 23 09:48:24 2023 +0200 smbd: Make get_dir_entry() static in SMB1-only code We need to pass "conn" explicitly because dptr_struct is private to dir.c. Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit abcc7e69ce0b62419ac1c8712d9fbef50bbeaf54 Author: Volker Lendecke <v...@samba.org> Date: Fri Jun 9 14:44:58 2023 +0200 smbd: Slightly simplify smbd_dirptr_lanman2_entry()'s overflow logic No caller does anything with the smb_fname upon overflow, so we might as well do an early return. Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit ae4d8ddbeefeedd6ac436a0ab17571fb512e1efd Author: Volker Lendecke <v...@samba.org> Date: Tue Jun 13 15:33:03 2023 +0200 smbd: Eliminiate some dead code If I'm not completely blind then there's no way how *pst can be a valid stat. We did a SET_STAT_INVALID at the beginning of the function, and there's no code path up to this if-statement that can make *pst valid again. Review with "git show -U40". Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 2b725480dd4a4bac34cf36c4323b46a9109559a0 Author: Volker Lendecke <v...@samba.org> Date: Tue Jun 13 16:25:55 2023 +0200 smbd: Use dptr_RewindDir() instead of dptr_SeekDir(.., 0) This is a more focused call. Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 2498a48abc7754dcb0e647412301f53ad0756155 Author: Volker Lendecke <v...@samba.org> Date: Fri Jun 9 09:38:31 2023 +0200 smbd: Apply some README.Coding to call_trans2findfirst/next() Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 4935c0b54c9fb4234f49d42698efd461969a8f54 Author: Volker Lendecke <v...@samba.org> Date: Fri Jun 9 09:59:36 2023 +0200 smbd: Introduce "dir_hnd" helper variable in smbd_dirptr_get_entry() Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit aa77aa3e8831ab602238cced975ddcbf075eeb91 Author: Volker Lendecke <v...@samba.org> Date: Fri Jun 9 09:33:42 2023 +0200 smbd: Remove unused "poffset" parameter from SearchDir() The only caller threw the result away. Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit c80b34533f2243e743acf8e7d8ef7ddcc583aa89 Author: Volker Lendecke <v...@samba.org> Date: Fri Jun 9 09:33:42 2023 +0200 smbd: Remove unused "poffset" parameter from dptr_SearchDir() The only caller threw the result away. Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 4fce29debac291a3b4101a2fd46b77c4ab9a844a Author: Volker Lendecke <v...@samba.org> Date: Fri Jun 9 09:33:42 2023 +0200 smbd: Remove unused "pst" parameter from dptr_SearchDir() The only caller threw the result away. Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit d9755c7c44d4671ad1ec2098d990dc76ec7a477a Author: Volker Lendecke <v...@samba.org> Date: Fri Jun 9 12:21:14 2023 +0200 smbd: Modernize a few overlog DEBUG statements Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 61c923063c308cd37035798b4fa9c093615b0815 Author: Volker Lendecke <v...@samba.org> Date: Tue Jun 13 10:04:56 2023 +0200 conf: Fix wrong language in "dos charset" smb.conf.5 entry Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 3f3df7dd03678ec9e198d6e247aa050624a5c6ed Author: Volker Lendecke <v...@samba.org> Date: Tue Jun 13 10:03:24 2023 +0200 testparm: Fix a typo Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 7e465b8e22038cbdce5fd7716c867f45345eb7ee Author: Volker Lendecke <v...@samba.org> Date: Sat May 27 11:28:14 2023 +0200 smbd: Use ISDOT() in exact_match() Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 4ee821ae2b2606f5106b3bfecaa09ceaa87891d2 Author: Volker Lendecke <v...@samba.org> Date: Fri May 26 12:39:15 2023 +0200 vfs: Remove two "== true" Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 4115a2e478fbc44123eb97dd9966b35b50ac69af Author: Volker Lendecke <v...@samba.org> Date: Fri May 26 12:38:25 2023 +0200 vfs: Modernize a few DEBUG statements Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit f5afcddbe45bd7c59d73fe0a41eef668bc9f80fb Author: Volker Lendecke <v...@samba.org> Date: Fri May 26 12:35:48 2023 +0200 vfs: Fix a typo Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 162787cddbf0e9076bb989abb690302da46df3c3 Author: Volker Lendecke <v...@samba.org> Date: Mon May 15 17:09:41 2023 +0200 lib: Fix whitespace Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> ----------------------------------------------------------------------- Summary of changes: docs-xml/smbdotconf/base/doscharset.xml | 2 +- .../smbdotconf/misc/directorynamecachesize.xml | 14 - examples/VFS/skel_opaque.c | 12 - examples/VFS/skel_transparent.c | 12 - source3/include/smbprofile.h | 2 - source3/include/vfs.h | 12 +- source3/include/vfs_macros.h | 10 - source3/lib/errmap_unix.c | 8 +- source3/modules/The_New_VFS.org | 8 +- source3/modules/The_New_VFS.txt | 4 - source3/modules/vfs_ceph.c | 17 - source3/modules/vfs_ceph_snapshots.c | 6 +- source3/modules/vfs_default.c | 18 - source3/modules/vfs_dirsort.c | 70 --- source3/modules/vfs_fruit.c | 6 +- source3/modules/vfs_full_audit.c | 26 - source3/modules/vfs_glusterfs.c | 21 - source3/modules/vfs_media_harmony.c | 27 - source3/modules/vfs_not_implemented.c | 15 - source3/modules/vfs_shadow_copy.c | 20 +- source3/modules/vfs_shadow_copy2.c | 51 +- source3/modules/vfs_streams_depot.c | 3 +- source3/modules/vfs_time_audit.c | 38 -- source3/modules/vfs_unityed_media.c | 19 - source3/param/loadparm.c | 1 - source3/smbd/close.c | 10 +- source3/smbd/dir.c | 580 +++++---------------- source3/smbd/filename.c | 4 +- source3/smbd/globals.h | 10 +- source3/smbd/msdfs.c | 6 +- source3/smbd/proto.h | 20 +- source3/smbd/smb1_reply.c | 147 ++++++ source3/smbd/smb1_trans2.c | 107 +++- source3/smbd/smb2_query_directory.c | 16 +- source3/smbd/smb2_trans2.c | 27 +- source3/smbd/vfs.c | 14 - source3/torture/cmd_vfs.c | 7 - source3/torture/vfstest.h | 1 - source3/utils/testparm.c | 18 +- 39 files changed, 444 insertions(+), 945 deletions(-) delete mode 100644 docs-xml/smbdotconf/misc/directorynamecachesize.xml Changeset truncated at 500 lines: diff --git a/docs-xml/smbdotconf/base/doscharset.xml b/docs-xml/smbdotconf/base/doscharset.xml index ebd7586158c..d4b114c0bef 100644 --- a/docs-xml/smbdotconf/base/doscharset.xml +++ b/docs-xml/smbdotconf/base/doscharset.xml @@ -6,7 +6,7 @@ <description> <para>DOS SMB clients assume the server has the same charset as they do. This option specifies which - charset Samba should talk to DOS clients. + charset Samba should use to talk to DOS clients. </para> <para>The default depends on which charsets you have installed. diff --git a/docs-xml/smbdotconf/misc/directorynamecachesize.xml b/docs-xml/smbdotconf/misc/directorynamecachesize.xml deleted file mode 100644 index 22999a6964e..00000000000 --- a/docs-xml/smbdotconf/misc/directorynamecachesize.xml +++ /dev/null @@ -1,14 +0,0 @@ -<samba:parameter name="directory name cache size" - context="S" - type="integer" - xmlns:samba="http://www.samba.org/samba/DTD/samba-doc"> -<description> - <para> - This parameter specifies the size of the directory name cache for SMB1 - connections. It is not used for SMB2. It will be needed to turn this off - for *BSD systems. - </para> - -</description> -<value type="default">100</value> -</samba:parameter> diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index 98b090728f2..cbaf9a272a8 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -163,16 +163,6 @@ static struct dirent *skel_readdir(vfs_handle_struct *handle, return NULL; } -static void skel_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset) -{ - ; -} - -static long skel_telldir(vfs_handle_struct *handle, DIR *dirp) -{ - return (long)-1; -} - static void skel_rewind_dir(vfs_handle_struct *handle, DIR *dirp) { ; @@ -993,8 +983,6 @@ static struct vfs_fn_pointers skel_opaque_fns = { .fdopendir_fn = skel_fdopendir, .readdir_fn = skel_readdir, - .seekdir_fn = skel_seekdir, - .telldir_fn = skel_telldir, .rewind_dir_fn = skel_rewind_dir, .mkdirat_fn = skel_mkdirat, .closedir_fn = skel_closedir, diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index b152f3596c5..9c08b87f7c7 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -171,16 +171,6 @@ static struct dirent *skel_readdir(vfs_handle_struct *handle, return SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp, sbuf); } -static void skel_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset) -{ - SMB_VFS_NEXT_SEEKDIR(handle, dirp, offset); -} - -static long skel_telldir(vfs_handle_struct *handle, DIR *dirp) -{ - return SMB_VFS_NEXT_TELLDIR(handle, dirp); -} - static void skel_rewind_dir(vfs_handle_struct *handle, DIR *dirp) { SMB_VFS_NEXT_REWINDDIR(handle, dirp); @@ -1304,8 +1294,6 @@ static struct vfs_fn_pointers skel_transparent_fns = { .fdopendir_fn = skel_fdopendir, .readdir_fn = skel_readdir, - .seekdir_fn = skel_seekdir, - .telldir_fn = skel_telldir, .rewind_dir_fn = skel_rewind_dir, .mkdirat_fn = skel_mkdirat, .closedir_fn = skel_closedir, diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h index 7b080e11ee1..62873a5532b 100644 --- a/source3/include/smbprofile.h +++ b/source3/include/smbprofile.h @@ -45,8 +45,6 @@ struct tevent_context; SMBPROFILE_STATS_BASIC(syscall_opendir) \ SMBPROFILE_STATS_BASIC(syscall_fdopendir) \ SMBPROFILE_STATS_BASIC(syscall_readdir) \ - SMBPROFILE_STATS_BASIC(syscall_seekdir) \ - SMBPROFILE_STATS_BASIC(syscall_telldir) \ SMBPROFILE_STATS_BASIC(syscall_rewinddir) \ SMBPROFILE_STATS_BASIC(syscall_mkdirat) \ SMBPROFILE_STATS_BASIC(syscall_closedir) \ diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 31b657addee..eafc432be43 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -378,9 +378,11 @@ * Change to Version 48 - will ship with 4.18 * Version 48 - Add cached_dos_attributes to struct stat_ex * Version 48 - Add dirfsp to connectpath_fn() + * Change to Version 49 - will ship with 4.19 + * Version 49 - remove seekdir and telldir */ -#define SMB_VFS_INTERFACE_VERSION 48 +#define SMB_VFS_INTERFACE_VERSION 49 /* All intercepted VFS operations must be declared as static functions inside module source @@ -967,8 +969,6 @@ struct vfs_fn_pointers { struct files_struct *dirfsp, DIR *dirp, SMB_STRUCT_STAT *sbuf); - void (*seekdir_fn)(struct vfs_handle_struct *handle, DIR *dirp, long offset); - long (*telldir_fn)(struct vfs_handle_struct *handle, DIR *dirp); void (*rewind_dir_fn)(struct vfs_handle_struct *handle, DIR *dirp); int (*mkdirat_fn)(struct vfs_handle_struct *handle, struct files_struct *dirfsp, @@ -1464,10 +1464,6 @@ struct dirent *smb_vfs_call_readdir(struct vfs_handle_struct *handle, struct files_struct *dirfsp, DIR *dirp, SMB_STRUCT_STAT *sbuf); -void smb_vfs_call_seekdir(struct vfs_handle_struct *handle, - DIR *dirp, long offset); -long smb_vfs_call_telldir(struct vfs_handle_struct *handle, - DIR *dirp); void smb_vfs_call_rewind_dir(struct vfs_handle_struct *handle, DIR *dirp); int smb_vfs_call_mkdirat(struct vfs_handle_struct *handle, @@ -1910,8 +1906,6 @@ struct dirent *vfs_not_implemented_readdir(vfs_handle_struct *handle, struct files_struct *dirfsp, DIR *dirp, SMB_STRUCT_STAT *sbuf); -void vfs_not_implemented_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset); -long vfs_not_implemented_telldir(vfs_handle_struct *handle, DIR *dirp); void vfs_not_implemented_rewind_dir(vfs_handle_struct *handle, DIR *dirp); int vfs_not_implemented_mkdirat(vfs_handle_struct *handle, struct files_struct *dirfsp, diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index f1a59e1d13a..29ce22e98c5 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -116,16 +116,6 @@ #define SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp, sbuf) \ smb_vfs_call_readdir((handle)->next, (dirfsp), (dirp), (sbuf)) -#define SMB_VFS_SEEKDIR(conn, dirp, offset) \ - smb_vfs_call_seekdir((conn)->vfs_handles, (dirp), (offset)) -#define SMB_VFS_NEXT_SEEKDIR(handle, dirp, offset) \ - smb_vfs_call_seekdir((handle)->next, (dirp), (offset)) - -#define SMB_VFS_TELLDIR(conn, dirp) \ - smb_vfs_call_telldir((conn)->vfs_handles, (dirp)) -#define SMB_VFS_NEXT_TELLDIR(handle, dirp) \ - smb_vfs_call_telldir((handle)->next, (dirp)) - #define SMB_VFS_REWINDDIR(conn, dirp) \ smb_vfs_call_rewind_dir((conn)->vfs_handles, (dirp)) #define SMB_VFS_NEXT_REWINDDIR(handle, dirp) \ diff --git a/source3/lib/errmap_unix.c b/source3/lib/errmap_unix.c index 029efae0f51..209bd255be5 100644 --- a/source3/lib/errmap_unix.c +++ b/source3/lib/errmap_unix.c @@ -1,21 +1,21 @@ -/* +/* * Unix SMB/CIFS implementation. * map unix to NT errors, an excerpt of libsmb/errormap.c * Copyright (C) Andrew Tridgell 2001 * Copyright (C) Andrew Bartlett 2001 * Copyright (C) Tim Potter 2000 * Copyright (C) Jeremy Allison 2007 - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, see <http://www.gnu.org/licenses/>. */ diff --git a/source3/modules/The_New_VFS.org b/source3/modules/The_New_VFS.org index 6309986a519..d18e5ef82ad 100644 --- a/source3/modules/The_New_VFS.org +++ b/source3/modules/The_New_VFS.org @@ -260,7 +260,7 @@ whenever VFS access is done in a piecemeal fashion. | SMB_VFS_LSTAT() | [[Path][Path]] | Todo | | SMB_VFS_MKDIRAT() | [[NsC][NsC]] | - | | SMB_VFS_MKNODAT() | [[NsC][NsC]] | - | -| SMB_VFS_NTIMES() | [[Path][Path]] | - | +| SMB_VFS_NTIMES() | [[Path][Path]] | - | | SMB_VFS_OFFLOAD_READ_RECV() | [[fsp][fsp]] | - | | SMB_VFS_OFFLOAD_READ_SEND() | [[fsp][fsp]] | - | | SMB_VFS_OFFLOAD_WRITE_RECV() | [[fsp][fsp]] | - | @@ -272,14 +272,13 @@ whenever VFS access is done in a piecemeal fashion. | SMB_VFS_PWRITE_SEND() | [[fsp][fsp]] | - | | SMB_VFS_READ_DFS_PATHAT() | [[Symlink][Symlink]] | - | | SMB_VFS_READDIR() | [[fsp][fsp]] | - | -| SMB_VFS_READDIR_ATTR() | [[Path][Path]] | - | +| SMB_VFS_READDIR_ATTR() | [[Path][Path]] | - | | SMB_VFS_READLINKAT() | [[Symlink][Symlink]] | - | | SMB_VFS_REALPATH() | [[P2px][P2px]] | - | | SMB_VFS_RECVFILE() | [[fsp][fsp]] | - | | SMB_VFS_REMOVEXATTR() | [[Path][Path]] | - | | SMB_VFS_RENAMEAT() | [[Path][Path]] | ---- | | SMB_VFS_REWINDDIR() | [[fsp][fsp]] | - | -| SMB_VFS_SEEKDIR() | [[fsp][fsp]] | - | | SMB_VFS_SENDFILE() | [[fsp][fsp]] | - | | SMB_VFS_SET_COMPRESSION() | [[fsp][fsp]] | - | | SMB_VFS_SET_DOS_ATTRIBUTES() | [[Path][Path]] | - | @@ -299,7 +298,6 @@ whenever VFS access is done in a piecemeal fashion. | SMB_VFS_SYS_ACL_GET_FD() | [[xpathref][xpathref]] | - | | SMB_VFS_SYS_ACL_GET_FILE() | [[Path][Path]] | - | | SMB_VFS_SYS_ACL_SET_FD() | [[xpathref][xpathref]] | - | -| SMB_VFS_TELLDIR() | [[fsp][fsp]] | - | | SMB_VFS_TRANSLATE_NAME() | [[P2px][P2px]] | - | | SMB_VFS_UNLINKAT() | [[NsC][NsC]] | - | |-----------------------------------+----------+--------| @@ -363,11 +361,9 @@ whenever VFS access is done in a piecemeal fashion. - SMB_VFS_READDIR() - SMB_VFS_RECVFILE() - SMB_VFS_REWINDDIR() - - SMB_VFS_SEEKDIR() - SMB_VFS_SENDFILE() - SMB_VFS_SET_COMPRESSION() - SMB_VFS_STRICT_LOCK_CHECK() - - SMB_VFS_TELLDIR() If an fsp is provided by the SMB layer we use that, otherwise we use the pathref fsp =smb_fname->fsp= provided by =filename_convert()=. diff --git a/source3/modules/The_New_VFS.txt b/source3/modules/The_New_VFS.txt index 7988639d4a4..abda0cbbe9b 100644 --- a/source3/modules/The_New_VFS.txt +++ b/source3/modules/The_New_VFS.txt @@ -347,7 +347,6 @@ Table of Contents SMB_VFS_REMOVEXATTR() [Path] - SMB_VFS_RENAMEAT() [Path] - SMB_VFS_REWINDDIR() [fsp] - - SMB_VFS_SEEKDIR() [fsp] - SMB_VFS_SENDFILE() [fsp] - SMB_VFS_SET_COMPRESSION() [fsp] - SMB_VFS_SET_DOS_ATTRIBUTES() [Path] - @@ -367,7 +366,6 @@ Table of Contents SMB_VFS_SYS_ACL_GET_FD() [xpathref] - SMB_VFS_SYS_ACL_GET_FILE() [Path] - SMB_VFS_SYS_ACL_SET_FD() [xpathref] - - SMB_VFS_TELLDIR() [fsp] - SMB_VFS_TRANSLATE_NAME() [P2px] - SMB_VFS_UNLINKAT() [NsC] - ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -469,11 +467,9 @@ Table of Contents • SMB_VFS_READDIR() • SMB_VFS_RECVFILE() • SMB_VFS_REWINDDIR() - • SMB_VFS_SEEKDIR() • SMB_VFS_SENDFILE() • SMB_VFS_SET_COMPRESSION() • SMB_VFS_STRICT_LOCK_CHECK() - • SMB_VFS_TELLDIR() If an fsp is provided by the SMB layer we use that, otherwise we use the pathref fsp `smb_fname->fsp' provided by `filename_convert()'. diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c index 3978f8f589b..af303ac60b7 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -467,21 +467,6 @@ static struct dirent *cephwrap_readdir(struct vfs_handle_struct *handle, return result; } -static void cephwrap_seekdir(struct vfs_handle_struct *handle, DIR *dirp, long offset) -{ - DBG_DEBUG("[CEPH] seekdir(%p, %p, %ld)\n", handle, dirp, offset); - ceph_seekdir(handle->data, (struct ceph_dir_result *) dirp, offset); -} - -static long cephwrap_telldir(struct vfs_handle_struct *handle, DIR *dirp) -{ - long ret; - DBG_DEBUG("[CEPH] telldir(%p, %p)\n", handle, dirp); - ret = ceph_telldir(handle->data, (struct ceph_dir_result *) dirp); - DBG_DEBUG("[CEPH] telldir(...) = %ld\n", ret); - WRAP_RETURN(ret); -} - static void cephwrap_rewinddir(struct vfs_handle_struct *handle, DIR *dirp) { DBG_DEBUG("[CEPH] rewinddir(%p, %p)\n", handle, dirp); @@ -1725,8 +1710,6 @@ static struct vfs_fn_pointers ceph_fns = { .fdopendir_fn = cephwrap_fdopendir, .readdir_fn = cephwrap_readdir, - .seekdir_fn = cephwrap_seekdir, - .telldir_fn = cephwrap_telldir, .rewind_dir_fn = cephwrap_rewinddir, .mkdirat_fn = cephwrap_mkdirat, .closedir_fn = cephwrap_closedir, diff --git a/source3/modules/vfs_ceph_snapshots.c b/source3/modules/vfs_ceph_snapshots.c index c981cebd8a2..c09b1895f88 100644 --- a/source3/modules/vfs_ceph_snapshots.c +++ b/source3/modules/vfs_ceph_snapshots.c @@ -221,7 +221,6 @@ static int ceph_snap_enum_snapdir(struct vfs_handle_struct *handle, struct files_struct *dirfsp = NULL; const char *dname = NULL; char *talloced = NULL; - long offset = 0; NTSTATUS status; int ret; uint32_t slots; @@ -265,7 +264,7 @@ static int ceph_snap_enum_snapdir(struct vfs_handle_struct *handle, sc_data->num_volumes = 0; sc_data->labels = NULL; - while ((dname = ReadDirName(dir_hnd, &offset, NULL, &talloced)) + while ((dname = ReadDirName(dir_hnd, NULL, &talloced)) != NULL) { if (ISDOT(dname) || ISDOTDOT(dname)) { @@ -518,7 +517,6 @@ static int ceph_snap_gmt_convert_dir(struct vfs_handle_struct *handle, struct files_struct *dirfsp = NULL; const char *dname = NULL; char *talloced = NULL; - long offset = 0; struct smb_filename *snaps_dname = NULL; const char *snapdir = lp_parm_const_string(SNUM(handle->conn), "ceph", "snapdir", @@ -589,7 +587,7 @@ static int ceph_snap_gmt_convert_dir(struct vfs_handle_struct *handle, goto err_out; } - while ((dname = ReadDirName(dir_hnd, &offset, NULL, &talloced)) + while ((dname = ReadDirName(dir_hnd, NULL, &talloced)) != NULL) { struct smb_filename *smb_fname = NULL; diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 89eec1146d7..cbced890597 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -657,22 +657,6 @@ static NTSTATUS vfswrap_freaddir_attr(struct vfs_handle_struct *handle, return NT_STATUS_NOT_SUPPORTED; } -static void vfswrap_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset) -{ - START_PROFILE(syscall_seekdir); - seekdir(dirp, offset); - END_PROFILE(syscall_seekdir); -} - -static long vfswrap_telldir(vfs_handle_struct *handle, DIR *dirp) -{ - long result; - START_PROFILE(syscall_telldir); - result = telldir(dirp); - END_PROFILE(syscall_telldir); - return result; -} - static void vfswrap_rewinddir(vfs_handle_struct *handle, DIR *dirp) { START_PROFILE(syscall_rewinddir); @@ -4066,8 +4050,6 @@ static struct vfs_fn_pointers vfs_default_fns = { .fdopendir_fn = vfswrap_fdopendir, .readdir_fn = vfswrap_readdir, .freaddir_attr_fn = vfswrap_freaddir_attr, - .seekdir_fn = vfswrap_seekdir, - .telldir_fn = vfswrap_telldir, .rewind_dir_fn = vfswrap_rewinddir, .mkdirat_fn = vfswrap_mkdirat, .closedir_fn = vfswrap_closedir, diff --git a/source3/modules/vfs_dirsort.c b/source3/modules/vfs_dirsort.c index d9cfcadacf8..89637aa38f2 100644 --- a/source3/modules/vfs_dirsort.c +++ b/source3/modules/vfs_dirsort.c @@ -218,74 +218,6 @@ static struct dirent *dirsort_readdir(vfs_handle_struct *handle, return &data->directory_list[data->pos++]; } -static void dirsort_seekdir(vfs_handle_struct *handle, DIR *dirp, - long offset) -{ - struct timespec current_mtime; - struct dirsort_privates *data = NULL; - - SMB_VFS_HANDLE_GET_DATA(handle, data, struct dirsort_privates, return); - - /* Find the entry holding dirp. */ - while(data && (data->source_directory != dirp)) { - data = data->next; - } - if (data == NULL) { - return; - } - if (offset >= data->number_of_entries) { - return; - } - data->pos = offset; - - if (get_sorted_dir_mtime(handle, data, ¤t_mtime) == false) { - return; - } - - if (timespec_compare(¤t_mtime, &data->mtime)) { - /* Directory changed. We must re-read the - cache and search for the name that was - previously stored at the offset being - requested, otherwise after the re-sort - we will point to the wrong entry. The - OS/2 incremental delete code relies on - this. */ - unsigned int i; - char *wanted_name = talloc_strdup(handle->conn, - data->directory_list[offset].d_name); - if (wanted_name == NULL) { - return; - } - SMB_VFS_NEXT_REWINDDIR(handle, data->source_directory); - open_and_sort_dir(handle, data); - /* Now search for where we were. */ - data->pos = 0; - for (i = 0; i < data->number_of_entries; i++) { - if(strcmp(wanted_name, data->directory_list[i].d_name) == 0) { - data->pos = i; - break; - } - } - TALLOC_FREE(wanted_name); - } -} - -static long dirsort_telldir(vfs_handle_struct *handle, DIR *dirp) -{ - struct dirsort_privates *data = NULL; - SMB_VFS_HANDLE_GET_DATA(handle, data, struct dirsort_privates, - return -1); - - /* Find the entry holding dirp. */ - while(data && (data->source_directory != dirp)) { - data = data->next; - } - if (data == NULL) { - return -1; - } - return data->pos; -} - static void dirsort_rewinddir(vfs_handle_struct *handle, DIR *dirp) { struct dirsort_privates *data = NULL; @@ -328,8 +260,6 @@ static int dirsort_closedir(vfs_handle_struct *handle, DIR *dirp) static struct vfs_fn_pointers vfs_dirsort_fns = { .fdopendir_fn = dirsort_fdopendir, .readdir_fn = dirsort_readdir, - .seekdir_fn = dirsort_seekdir, - .telldir_fn = dirsort_telldir, .rewind_dir_fn = dirsort_rewinddir, .closedir_fn = dirsort_closedir, }; diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index ce5ae38505e..8be6b4c7791 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -5188,7 +5188,6 @@ static bool fruit_get_num_bands(vfs_handle_struct *handle, struct smb_Dir *dir_hnd = NULL; const char *dname = NULL; char *talloced = NULL; - long offset = 0; size_t nbands; NTSTATUS status; @@ -5225,7 +5224,7 @@ static bool fruit_get_num_bands(vfs_handle_struct *handle, nbands = 0; - while ((dname = ReadDirName(dir_hnd, &offset, NULL, &talloced)) + while ((dname = ReadDirName(dir_hnd, NULL, &talloced)) != NULL) -- Samba Shared Repository