From: Ralph Boehme Date: Thu, 1 Sep 2022 16:55:52 +0000 (+0200) Subject: smbd: check for streams support in unix_convert() X-Git-Tag: samba-4.15.10~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b5792b0a2ca1b7d4114272165968aaea673fceb;p=thirdparty%2Fsamba.git smbd: check for streams support in unix_convert() Fixes a regression introduced by the fixes for bug 15126 where we crash in vfs_default in vfswrap_stat(): assert failed: !is_named_stream(smb_fname) The frontend calls into the VFS from build_stream_path() with a stream path without checking if the share supports streams. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 BUG: https://bugzilla.samba.org/show_bug.cgi?id=15161 Signed-off-by: Ralph Boehme Reviewed-by: Volker Lendecke [slow@samba.org: change from master adapted for unix_convert()] Autobuild-User(v4-15-test): Jule Anger Autobuild-Date(v4-15-test): Tue Sep 6 07:31:51 UTC 2022 on sn-devel-184 --- diff --git a/selftest/knownfail.d/samba3.smb2.create_no_streams b/selftest/knownfail.d/samba3.smb2.create_no_streams deleted file mode 100644 index c8476081f2d..00000000000 --- a/selftest/knownfail.d/samba3.smb2.create_no_streams +++ /dev/null @@ -1 +0,0 @@ -^samba3.smb2.create_no_streams.no_stream\(fileserver\) diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index ad9a0e817ff..d716bc96d81 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -1033,7 +1033,14 @@ NTSTATUS unix_convert(TALLOC_CTX *mem_ctx, state->stream = strchr_m(state->smb_fname->base_name, ':'); if (state->stream != NULL) { - char *tmp = talloc_strdup(state->smb_fname, state->stream); + char *tmp = NULL; + + if (!(conn->fs_capabilities & FILE_NAMED_STREAMS)) { + status = NT_STATUS_OBJECT_NAME_INVALID; + goto err; + } + + tmp = talloc_strdup(state->smb_fname, state->stream); if (tmp == NULL) { status = NT_STATUS_NO_MEMORY; goto err;