[Pkg-samba-maint] [Git][samba-team/samba][bullseye] 2 commits: two patches from upstream to fix coredump when connecting to shares with var substs

Michael Tokarev (@mjt) gitlab at salsa.debian.org
Tue Apr 12 08:20:32 BST 2022



Michael Tokarev pushed to branch bullseye at Debian Samba Team / samba


Commits:
72f4a2bd by Michael Tokarev at 2022-04-12T10:16:54+03:00
two patches from upstream to fix coredump when connecting to shares with var substs

Upstream bug: https://bugzilla.samba.org/show_bug.cgi?id=14809
Closes: #998423

- - - - -
22b70237 by Michael Tokarev at 2022-04-12T10:16:56+03:00
samba-common-bin.postinst: mkdir /run/samba before invoking samba binaries (#953530)

- - - - -


4 changed files:

- + debian/patches/bug998423-s3-mdssvc-Correctly-disconnect-the-VFS-connection-in.patch
- + debian/patches/bug998423-s3-smbd-In-create_conn_struct_cwd-don-t-TALLOC_FREE-.patch
- debian/patches/series
- debian/samba-common-bin.postinst


Changes:

=====================================
debian/patches/bug998423-s3-mdssvc-Correctly-disconnect-the-VFS-connection-in.patch
=====================================
@@ -0,0 +1,34 @@
+From b00fed3b698cc78a377d71e0574c878e262c4808 Mon Sep 17 00:00:00 2001
+From: Jeremy Allison <jra at samba.org>
+Date: Mon, 23 Aug 2021 17:40:42 -0700
+Subject: [PATCH] s3: mdssvc: Correctly disconnect the VFS connection inside
+ the mds_ctx destructor.
+
+BUG: https://bugzilla.samba.org/show_bug.cgi?id=14809
+
+Signed-off-by: Jeremy Allison <jra at samba.org>
+Reviewed-by: Ralph Boehme <slow at samba.org>
+(cherry picked from commit b4d8c62c4e8191e05fd03dd096a0bc989e224ed3)
+---
+ source3/rpc_server/mdssvc/mdssvc.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/source3/rpc_server/mdssvc/mdssvc.c b/source3/rpc_server/mdssvc/mdssvc.c
+index 715de272d32..a983a882294 100644
+--- a/source3/rpc_server/mdssvc/mdssvc.c
++++ b/source3/rpc_server/mdssvc/mdssvc.c
+@@ -1568,6 +1568,11 @@ static int mds_ctx_destructor_cb(struct mds_ctx *mds_ctx)
+ 	}
+ 	TALLOC_FREE(mds_ctx->ino_path_map);
+ 
++	if (mds_ctx->conn != NULL) {
++		SMB_VFS_DISCONNECT(mds_ctx->conn);
++		conn_free(mds_ctx->conn);
++	}
++
+ 	ZERO_STRUCTP(mds_ctx);
+ 
+ 	return 0;
+-- 
+2.30.2
+


=====================================
debian/patches/bug998423-s3-smbd-In-create_conn_struct_cwd-don-t-TALLOC_FREE-.patch
=====================================
@@ -0,0 +1,46 @@
+From 97dc8c0dcccbcecd3a8f8f3872b47d3a3c6e8036 Mon Sep 17 00:00:00 2001
+From: Jeremy Allison <jra at samba.org>
+Date: Mon, 23 Aug 2021 17:42:40 -0700
+Subject: [PATCH] s3: smbd: In create_conn_struct_cwd(), don't TALLOC_FREE() an
+ unallocated pointer on error.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Just return the status - if create_conn_struct_as_root() fails
+the connection struct never gets returned.
+
+BUG: https://bugzilla.samba.org/show_bug.cgi?id=14809
+
+Signed-off-by: Jeremy Allison <jra at samba.org>
+Reviewed-by: Ralph Boehme <slow at samba.org>
+
+Autobuild-User(master): Ralph Böhme <slow at samba.org>
+Autobuild-Date(master): Wed Aug 25 17:09:23 UTC 2021 on sn-devel-184
+
+(cherry picked from commit 857045f3a236dea125200dd09279d677e513682b)
+---
+ source3/smbd/msdfs.c | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
+index 3a1dd11d9eb..3645f5d21d5 100644
+--- a/source3/smbd/msdfs.c
++++ b/source3/smbd/msdfs.c
+@@ -525,12 +525,7 @@ NTSTATUS create_conn_struct_cwd(TALLOC_CTX *mem_ctx,
+ 					    path,
+ 					    session_info);
+ 	unbecome_root();
+-	if (!NT_STATUS_IS_OK(status)) {
+-		TALLOC_FREE(c);
+-		return status;
+-	}
+-
+-	return NT_STATUS_OK;
++	return status;
+ }
+ 
+ static void shuffle_strlist(char **list, int count)
+-- 
+2.30.2
+


=====================================
debian/patches/series
=====================================
@@ -297,3 +297,5 @@ bug1005642-lib-util-Add-a-function-nt_time_to_unix_timespec_raw.patch
 bug1005642-s3-smbd-Create-and-use-a-common-function-for-generat.patch
 bug1005642-s3-lib-In-create_clock_itime-use-timespec_current-cl.patch
 bug1005642-s3-includes-Make-the-comments-describing-itime-consi.patch
+bug998423-s3-mdssvc-Correctly-disconnect-the-VFS-connection-in.patch
+bug998423-s3-smbd-In-create_conn_struct_cwd-don-t-TALLOC_FREE-.patch


=====================================
debian/samba-common-bin.postinst
=====================================
@@ -2,10 +2,8 @@
 
 set -e
 
-# systemd-tmpfiles should be called before testparm
-# See https://bugs.debian.org/975422
-
-#DEBHELPER#
+# ensure a (tmpfs-based) /run/samba exists before running testparm
+[ -d /run/samba ] || mkdir -p /run/samba
 
 if [ "$1" = "configure" ] ; then
     SERVER_ROLE=`samba-tool testparm --parameter-name="server role"  2>/dev/null | tail -1`
@@ -19,3 +17,5 @@ if [ "$1" = "configure" ] ; then
         echo "Done"
     fi
 fi
+
+#DEBHELPER#



View it on GitLab: https://salsa.debian.org/samba-team/samba/-/compare/6807ab3433c9442b4a8e61debbe83b8c91fc4f9b...22b7023788b4bc1b98463e1dc1e039824fdc3184

-- 
View it on GitLab: https://salsa.debian.org/samba-team/samba/-/compare/6807ab3433c9442b4a8e61debbe83b8c91fc4f9b...22b7023788b4bc1b98463e1dc1e039824fdc3184
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-samba-maint/attachments/20220412/5f46eb33/attachment-0001.htm>


More information about the Pkg-samba-maint mailing list