[packages/samba] - rel 2; fixes force user = permissions on delete; https://bugzilla.samba.org/show_bug.cgi?id=14617

arekm arekm at pld-linux.org
Sun Jan 24 13:21:30 CET 2021


commit 36a66e0a401c936555adeb7a5bdada114462f2aa
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sun Jan 24 13:21:21 2021 +0100

    - rel 2; fixes force user = permissions on delete; https://bugzilla.samba.org/show_bug.cgi?id=14617

 samba-force-user.patch | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++
 samba.spec             |  6 ++---
 2 files changed, 75 insertions(+), 3 deletions(-)
---
diff --git a/samba.spec b/samba.spec
index 399816a..05ff4b0 100644
--- a/samba.spec
+++ b/samba.spec
@@ -43,7 +43,7 @@ Summary:	Samba Active Directory and SMB server
 Summary(pl.UTF-8):	Serwer Samba Active Directory i SMB
 Name:		samba
 Version:	4.13.3
-Release:	1
+Release:	2
 Epoch:		1
 License:	GPL v3
 Group:		Networking/Daemons
@@ -62,7 +62,7 @@ Source10:	https://bitbucket.org/fumiyas/samba-virusfilter/downloads/samba-virusf
 Patch0:		system-heimdal.patch
 Patch1:		%{name}-c++-nofail.patch
 Patch2:		%{name}-lprng-no-dot-printers.patch
-
+Patch3:		samba-force-user.patch
 Patch4:		unicodePwd-nthash-values-over-LDAP.patch
 Patch5:		%{name}-heimdal.patch
 Patch6:		server-role.patch
@@ -559,7 +559,7 @@ wyeksportowania do PMCD.
 %{?with_system_heimdal:%patch0 -p1}
 %patch1 -p1
 %patch2 -p1
-
+%patch3 -p1
 %patch4 -p1
 %{?with_system_heimdal:%patch5 -p1}
 %patch6 -p1
diff --git a/samba-force-user.patch b/samba-force-user.patch
new file mode 100644
index 0000000..bf302d5
--- /dev/null
+++ b/samba-force-user.patch
@@ -0,0 +1,72 @@
+From abef21596b901c00bf5d9c583ae562678d2cfbc1 Mon Sep 17 00:00:00 2001
+From: Ralph Boehme <slow at samba.org>
+Date: Sat, 23 Jan 2021 18:36:23 +0100
+Subject: [PATCH] smbd: use fsp->conn->session_info for the initial
+ delete-on-close token
+
+There's a correctly set up session_info at fsp->conn->session_info, we can just
+use that. It has all the bells and whistles ("force user" and "force group").
+
+BUG: https://bugzilla.samba.org/show_bug.cgi?id=14617
+---
+ source3/smbd/close.c | 25 ++++---------------------
+ 1 file changed, 4 insertions(+), 21 deletions(-)
+
+diff --git a/source3/smbd/close.c b/source3/smbd/close.c
+index 97d13473082..f05619d1886 100644
+--- a/source3/smbd/close.c
++++ b/source3/smbd/close.c
+@@ -342,21 +342,13 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
+ 
+ 	if (fsp->fsp_flags.initial_delete_on_close &&
+ 			!is_delete_on_close_set(lck, fsp->name_hash)) {
+-		struct auth_session_info *session_info = NULL;
+-
+ 		/* Initial delete on close was set and no one else
+ 		 * wrote a real delete on close. */
+ 
+-		status = smbXsrv_session_info_lookup(conn->sconn->client,
+-						     fsp->vuid,
+-						     &session_info);
+-		if (!NT_STATUS_IS_OK(status)) {
+-			return NT_STATUS_INTERNAL_ERROR;
+-		}
+ 		fsp->fsp_flags.delete_on_close = true;
+ 		set_delete_on_close_lck(fsp, lck,
+-					session_info->security_token,
+-					session_info->unix_token);
++					fsp->conn->session_info->security_token,
++					fsp->conn->session_info->unix_token);
+ 	}
+ 
+ 	delete_file = is_delete_on_close_set(lck, fsp->name_hash) &&
+@@ -1175,24 +1167,15 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp,
+ 	}
+ 
+ 	if (fsp->fsp_flags.initial_delete_on_close) {
+-		struct auth_session_info *session_info = NULL;
+-
+ 		/* Initial delete on close was set - for
+ 		 * directories we don't care if anyone else
+ 		 * wrote a real delete on close. */
+ 
+-		status = smbXsrv_session_info_lookup(fsp->conn->sconn->client,
+-						     fsp->vuid,
+-						     &session_info);
+-		if (!NT_STATUS_IS_OK(status)) {
+-			return NT_STATUS_INTERNAL_ERROR;
+-		}
+-
+ 		send_stat_cache_delete_message(fsp->conn->sconn->msg_ctx,
+ 					       fsp->fsp_name->base_name);
+ 		set_delete_on_close_lck(fsp, lck,
+-					session_info->security_token,
+-					session_info->unix_token);
++					fsp->conn->session_info->security_token,
++					fsp->conn->session_info->unix_token);
+ 		fsp->fsp_flags.delete_on_close = true;
+ 	}
+ 
+-- 
+2.26.2
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/samba.git/commitdiff/36a66e0a401c936555adeb7a5bdada114462f2aa



More information about the pld-cvs-commit mailing list