From: Andreas Schneider Date: Fri, 12 Jun 2026 13:02:04 +0000 (+0200) Subject: s4:torture: Use torture_result() in check_stream_list() in smb2.streams X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9bd0fee89a32ad098396cdd3cb7ab2add7f565b9;p=thirdparty%2Fsamba.git s4:torture: Use torture_result() in check_stream_list() in smb2.streams 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 Reviewed-by: Ralph Boehme --- diff --git a/selftest/knownfail.d/samba3.smb2.streams b/selftest/knownfail.d/samba3.smb2.streams new file mode 100644 index 00000000000..ca49d072fc1 --- /dev/null +++ b/selftest/knownfail.d/samba3.smb2.streams @@ -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\(.*\) diff --git a/source4/torture/smb2/streams.c b/source4/torture/smb2/streams.c index 4693c33e776..849bde81432 100644 --- a/source4/torture/smb2/streams.c +++ b/source4/torture/smb2/streams.c @@ -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