[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Fri Jan 13 01:14:01 UTC 2023
The branch, master has been updated
via 1421969b86b CI: add a test for @GMT mask in SMB1 find
from 425aaf6f7eb lib: Fix a use-after-free in "net vfs getntacl"
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 1421969b86bf2eab2d192d4a071080b2d021cd38
Author: Ralph Boehme <slow at samba.org>
Date: Thu Nov 24 16:59:49 2022 +0100
CI: add a test for @GMT mask in SMB1 find
Without FLAGS2_REPARSE_PATH a path containing an @GMT token can be used to
create a file including the @GMT token in the name and a directory list will
also return the file as result. Verified against Windows. Samba behaves exactly
the same.
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Fri Jan 13 01:13:01 UTC 2023 on sn-devel-184
-----------------------------------------------------------------------
Summary of changes:
source4/torture/basic/base.c | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
Changeset truncated at 500 lines:
diff --git a/source4/torture/basic/base.c b/source4/torture/basic/base.c
index 232ba9c5cb3..602eb226d0b 100644
--- a/source4/torture/basic/base.c
+++ b/source4/torture/basic/base.c
@@ -1979,6 +1979,44 @@ static bool torture_smb1_twrp_openroot(struct torture_context *tctx,
return ret;
}
+static void torture_smb1_find_gmt_mask_list_fn(struct clilist_file_info *finfo,
+ const char *name,
+ void *state)
+{
+}
+
+/**
+ * SMB1 @GMT token as search mask is valid
+ */
+static bool torture_smb1_find_gmt_mask(struct torture_context *tctx,
+ struct smbcli_state *cli)
+{
+ const char *dname = "\\torture_smb1_find_gmt_mask";
+ const char *path = "\\torture_smb1_find_gmt_mask\\@GMT-2022.11.24-16.24.00";
+ int fnum;
+ int n;
+ NTSTATUS status;
+ bool ret = true;
+
+ smbcli_unlink(cli->tree, path);
+ smbcli_rmdir(cli->tree, dname);
+
+ status = smbcli_mkdir(cli->tree, dname);
+ torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
+ "smbcli_mkdir() failed\n");
+ fnum = smbcli_open(cli->tree, path, O_RDWR | O_CREAT, DENY_NONE);
+ smbcli_close(cli->tree, fnum);
+
+ /* Note: we don't set FLAGS2_REPARSE_PATH, so this is just a path */
+ n = smbcli_list(cli->tree, path, 0, torture_smb1_find_gmt_mask_list_fn, cli);
+ torture_assert_int_equal_goto(tctx, n, 1, ret, done, "Wrong count\n");
+
+done:
+ smbcli_unlink(cli->tree, path);
+ smbcli_rmdir(cli->tree, dname);
+ return ret;
+}
+
NTSTATUS torture_base_init(TALLOC_CTX *ctx)
{
struct torture_suite *suite = torture_suite_create(ctx, "base");
@@ -2039,6 +2077,9 @@ NTSTATUS torture_base_init(TALLOC_CTX *ctx)
torture_suite_add_1smb_test(suite,
"smb1-twrp-openroot",
torture_smb1_twrp_openroot);
+ torture_suite_add_1smb_test(suite,
+ "smb1-find-gmt-mask",
+ torture_smb1_find_gmt_mask);
suite->description = talloc_strdup(suite,
"Basic SMB tests (imported from the original smbtorture)");
--
Samba Shared Repository
More information about the samba-cvs
mailing list