]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:torture: Use torture_result() in check_stream_list() in smb2.streams
authorAndreas Schneider <asn@samba.org>
Fri, 12 Jun 2026 13:02:04 +0000 (15:02 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 16 Jun 2026 11:38:33 +0000 (11:38 +0000)
This change reveals a bug in the server: currently we do fail a getinfo request
SMB_FILE_STREAM_INFORMATION with NT_STATUS_INVALID_PARAMETER when issued on a
stream handle, but according to MS-FSA this is wrong, as "2.1.5.12.29
FileStreamInformation" just tells us to return the streams associated with the
underlying File object:

* For each Stream ThisStream of Open.File ...

The existing streams tests "io" and "create-disposition" make use of this
indirectly via the helper function check_stream_list(). As these tests didn't
check the return value from check_stream_list() and check_stream_list() doesn't
update the torture result state with a failure code, the tests were passing.

Mark these tests as knownfail until we've fixed the server code.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
selftest/knownfail.d/samba3.smb2.streams [new file with mode: 0644]
source4/torture/smb2/streams.c

diff --git a/selftest/knownfail.d/samba3.smb2.streams b/selftest/knownfail.d/samba3.smb2.streams
new file mode 100644 (file)
index 0000000..ca49d07
--- /dev/null
@@ -0,0 +1,4 @@
+^samba3.smb2.streams.io\(.*\)
+^samba3.smb2.streams.create-disposition\(.*\)
+^samba3.smb2.streams streams_xattr.io\(.*\)
+^samba3.smb2.streams streams_xattr.create-disposition\(.*\)
index 4693c33e7763d71479ba5a26c68b51b68beed61f..849bde81432ae210b4d4fbf7039adb13752fae83 100644 (file)
@@ -142,13 +142,15 @@ static bool check_stream_list(struct smb2_tree *tree,
 
        status = smb2_getinfo_file(tree, tctx, &finfo);
        if (!NT_STATUS_IS_OK(status)) {
-               torture_comment(tctx, "(%s) smb_raw_pathinfo failed: %s\n",
+               torture_result(tctx, TORTURE_FAIL,
+                   "(%s) smb_raw_pathinfo failed: %s\n",
                    __location__, nt_errstr(status));
                goto fail;
        }
 
        if (finfo.stream_info.out.num_streams != num_exp) {
-               torture_comment(tctx, "(%s) expected %d streams, got %d\n",
+               torture_result(tctx, TORTURE_FAIL,
+                   "(%s) expected %d streams, got %d\n",
                    __location__, num_exp, finfo.stream_info.out.num_streams);
                goto fail;
        }
@@ -178,7 +180,7 @@ static bool check_stream_list(struct smb2_tree *tree,
 
        for (i=0; i<num_exp; i++) {
                if (strcmp(exp_sort[i], stream_sort[i].stream_name.s) != 0) {
-                       torture_comment(tctx,
+                       torture_result(tctx, TORTURE_FAIL,
                            "(%s) expected stream name %s, got %s\n",
                            __location__, exp_sort[i],
                            stream_sort[i].stream_name.s);