The branch, master has been updated
via f63b9a7 s3: libsmb: Fix error where short name length was read as 2
bytes, should be 1.
via 6eba42f selftest: Load time_audit and full_audit
via 0d9c2b9 vfs_time_audit: Assert that all VFS functions are
implemented
via 8a9f74e vfs_full_audit: Assert that all VFS functions are
implemented
via d18a0ff vfs: Add helper to check for missing VFS functions
via 94f3129 configure: Don't check for inotify on illumos
from ff6b49b nwrap: Fix the build on Solaris
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit f63b9a73b03971f41947c694e6952cd1e49b67c3
Author: Jeremy Allison <[email protected]>
Date: Tue Apr 5 13:07:06 2016 -0700
s3: libsmb: Fix error where short name length was read as 2 bytes, should
be 1.
Reported by Thomas Dvorachek <[email protected]> from a Windows 10
server.
Confirmed in MS-CIFS 2.2.8.1.7.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11822
Signed-off-by: Jeremy Allison <[email protected]>
Reviewed-by: Ralph Boehme <[email protected]>
Autobuild-User(master): Jeremy Allison <[email protected]>
Autobuild-Date(master): Wed Apr 6 03:46:55 CEST 2016 on sn-devel-144
commit 6eba42f927230e1a0c65ded4bc47ddacfb4a0ddb
Author: Christof Schmitt <[email protected]>
Date: Thu Mar 31 22:31:19 2016 -0700
selftest: Load time_audit and full_audit
This triggers the check for missing VFS functions in these modules.
Signed-off-by: Christof Schmitt <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>
commit 0d9c2b95b2954fca8a43e7d7561f04bfb7600667
Author: Christof Schmitt <[email protected]>
Date: Thu Mar 31 22:30:41 2016 -0700
vfs_time_audit: Assert that all VFS functions are implemented
Signed-off-by: Christof Schmitt <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>
commit 8a9f74e3ac821d0b4b02c778cc9abff740294693
Author: Christof Schmitt <[email protected]>
Date: Thu Mar 31 22:30:14 2016 -0700
vfs_full_audit: Assert that all VFS functions are implemented
Signed-off-by: Christof Schmitt <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>
commit d18a0ff9cba40e2e50bedb95657563ede8f586dd
Author: Christof Schmitt <[email protected]>
Date: Fri Apr 1 09:47:31 2016 -0700
vfs: Add helper to check for missing VFS functions
Some VFS modules want to ensure that they implement all VFS functions.
This helper can be used to detect missing functions in the developer
build.
Signed-off-by: Christof Schmitt <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>
commit 94f31295b12b20a68d596929ea428eb36f8c0d82
Author: Jorge Schrauwen <[email protected]>
Date: Sun Apr 3 11:43:50 2016 +0200
configure: Don't check for inotify on illumos
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11816
Reviewed-by: Volker Lendecke <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>
-----------------------------------------------------------------------
Summary of changes:
selftest/target/Samba3.pm | 2 +-
source3/include/vfs.h | 3 +++
source3/libsmb/clilist.c | 2 +-
source3/modules/vfs_full_audit.c | 10 +++++++---
source3/modules/vfs_time_audit.c | 2 ++
source3/smbd/vfs.c | 30 ++++++++++++++++++++++++++++++
source3/wscript | 11 +++++++----
source4/ntvfs/sysdep/wscript_configure | 13 +++++++++----
8 files changed, 60 insertions(+), 13 deletions(-)
Changeset truncated at 500 lines:
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index bdeebc9..f4d7403 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -548,7 +548,7 @@ sub setup_simpleserver($$)
my $simpleserver_options = "
lanman auth = yes
- vfs objects = xattr_tdb streams_depot
+ vfs objects = xattr_tdb streams_depot time_audit full_audit
change notify = no
[vfs_aio_fork]
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index 6ab9a7e..9360802 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -1381,4 +1381,7 @@ void vfs_remove_all_fsp_extensions(struct files_struct
*fsp);
void *vfs_memctx_fsp_extension(vfs_handle_struct *handle, files_struct *fsp);
void *vfs_fetch_fsp_extension(vfs_handle_struct *handle, files_struct *fsp);
+void smb_vfs_assert_all_fns(const struct vfs_fn_pointers* fns,
+ const char *module);
+
#endif /* _VFS_H */
diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c
index 94bbc57..6438d3b 100644
--- a/source3/libsmb/clilist.c
+++ b/source3/libsmb/clilist.c
@@ -186,7 +186,7 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx,
namelen = IVAL(p,0);
p += 4;
p += 4; /* EA size */
- slen = SVAL(p, 0);
+ slen = CVAL(p, 0);
if (slen > 24) {
/* Bad short name length. */
return pdata_end - base;
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 0ce44bf..edff395 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -2587,9 +2587,13 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
static_decl_vfs;
NTSTATUS vfs_full_audit_init(void)
{
- NTSTATUS ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION,
- "full_audit", &vfs_full_audit_fns);
-
+ NTSTATUS ret;
+
+ smb_vfs_assert_all_fns(&vfs_full_audit_fns, "full_audit");
+
+ ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "full_audit",
+ &vfs_full_audit_fns);
+
if (!NT_STATUS_IS_OK(ret))
return ret;
diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c
index 8d88d17..b3610ee 100644
--- a/source3/modules/vfs_time_audit.c
+++ b/source3/modules/vfs_time_audit.c
@@ -2724,6 +2724,8 @@ static struct vfs_fn_pointers vfs_time_audit_fns = {
NTSTATUS vfs_time_audit_init(void);
NTSTATUS vfs_time_audit_init(void)
{
+ smb_vfs_assert_all_fns(&vfs_time_audit_fns, "time_audit");
+
audit_timeout = (double)lp_parm_int(-1, "time_audit", "timeout",
10000) / 1000.0;
return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "time_audit",
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index efed268..605f9ad 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -316,6 +316,36 @@ void *vfs_fetch_fsp_extension(vfs_handle_struct *handle,
files_struct *fsp)
#undef EXT_DATA_AREA
+/*
+ * Ensure this module catches all VFS functions.
+ */
+#ifdef DEVELOPER
+void smb_vfs_assert_all_fns(const struct vfs_fn_pointers* fns,
+ const char *module)
+{
+ bool missing_fn = false;
+ unsigned int idx;
+ const uintptr_t *end = (const uintptr_t *)(fns + 1);
+
+ for (idx = 0; ((const uintptr_t *)fns + idx) < end; idx++) {
+ if (*((const uintptr_t *)fns + idx) == 0) {
+ DBG_ERR("VFS function at index %d not implemented "
+ "in module %s\n", idx, module);
+ missing_fn = true;
+ }
+ }
+
+ if (missing_fn) {
+ smb_panic("Required VFS function not implemented in module.\n");
+ }
+}
+#else
+void smb_vfs_assert_all_fns(const struct vfs_fn_pointers* fns,
+ const char *module)
+{
+}
+#endif
+
/*****************************************************************
Generic VFS init.
******************************************************************/
diff --git a/source3/wscript b/source3/wscript
index 9b73bfc..3118e28 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -135,10 +135,13 @@ long ret = splice(0,0,1,0,400,SPLICE_F_MOVE);
headers='fcntl.h'):
conf.CHECK_DECLS('splice', reverse=True, headers='fcntl.h')
- # Check for inotify support
- conf.CHECK_HEADERS('sys/inotify.h')
- if "HAVE_SYS_INOTIFY_H" in conf.env:
- conf.DEFINE('HAVE_INOTIFY', 1)
+ # Check for inotify support (Skip if we are SunOS)
+ #NOTE: illumos provides sys/inotify.h but is not an exact match for linux
+ host_os = sys.platform
+ if host_os.rfind('sunos') == -1:
+ conf.CHECK_HEADERS('sys/inotify.h')
+ if "HAVE_SYS_INOTIFY_H" in conf.env:
+ conf.DEFINE('HAVE_INOTIFY', 1)
# Check for kernel change notify support
conf.CHECK_CODE('''
diff --git a/source4/ntvfs/sysdep/wscript_configure
b/source4/ntvfs/sysdep/wscript_configure
index aa63000..274fc08 100644
--- a/source4/ntvfs/sysdep/wscript_configure
+++ b/source4/ntvfs/sysdep/wscript_configure
@@ -1,9 +1,14 @@
#!/usr/bin/env python
-conf.CHECK_HEADERS('sys/inotify.h', add_headers=False)
+import sys
+
+# Check for inotify support (Skip if we are SunOS)
+#NOTE: illumos provides sys/inotify.h but is not an exact match for linux
+host_os = sys.platform
+if host_os.rfind('sunos') == -1:
+ conf.CHECK_HEADERS('sys/inotify.h', add_headers=False)
+ if (conf.CONFIG_SET('HAVE_SYS_INOTIFY_H')):
+ conf.DEFINE('HAVE_LINUX_INOTIFY', 1)
conf.CHECK_DECLS('F_SETLEASE', headers='linux/fcntl.h', reverse=True)
conf.CHECK_DECLS('SA_SIGINFO', headers='signal.h', reverse=True)
-
-if (conf.CONFIG_SET('HAVE_SYS_INOTIFY_H')):
- conf.DEFINE('HAVE_LINUX_INOTIFY', 1)
--
Samba Shared Repository