[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#919712: Uploaded



Hello,

I've uploaded the package.

I've also added the attached diff.

Here's the changelog:

samba (2:4.5.16+dfsg-1) stretch; urgency=medium

  * New upstream release (latest 4.5.x)
    - Drop merged patches
  * Fix CVE-2018-14629 regression when there're more than 20 records on a non
    CNAME record.
  * Fix rmdir on non-empty samba directory (Closes: #915248)
  * Ignore nmbd start errors when there is no non-loopback interface
    (Closes: #893762)
  * Ignore nmbd start errors when there is  no local IPv4 non-loopback interface
    (Closes: #859526)
  * s3:ntlm_auth: fix memory leak in manage_gensec_request() (Closes: #919611)
  * Add debian/gitlab-ci.yml

 -- Mathieu Parent <sathieu@debian.org>  Thu, 31 Jan 2019 23:12:28 +0100
diff --git a/debian/changelog b/debian/changelog
index a2f86eff095..26f1ab0ddbe 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-samba (2:4.5.16+dfsg-1) UNRELEASED; urgency=medium
+samba (2:4.5.16+dfsg-1) stretch; urgency=medium
 
   * New upstream release (latest 4.5.x)
     - Drop merged patches
@@ -10,8 +10,9 @@ samba (2:4.5.16+dfsg-1) UNRELEASED; urgency=medium
   * Ignore nmbd start errors when there is  no local IPv4 non-loopback interface
     (Closes: #859526)
   * s3:ntlm_auth: fix memory leak in manage_gensec_request() (Closes: #919611)
+  * Add debian/gitlab-ci.yml
 
- -- Mathieu Parent <sathieu@debian.org>  Fri, 18 Jan 2019 07:35:15 +0100
+ -- Mathieu Parent <sathieu@debian.org>  Thu, 31 Jan 2019 23:12:28 +0100
 
 samba (2:4.5.12+dfsg-2+deb9u4) stretch-security; urgency=high
 
diff --git a/debian/gitlab-ci.yml b/debian/gitlab-ci.yml
new file mode 100644
index 00000000000..8d3e6f810f1
--- /dev/null
+++ b/debian/gitlab-ci.yml
@@ -0,0 +1,14 @@
+#include: https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
+include: https://salsa.debian.org/sathieu/pipeline/raw/master/salsa-ci.yml
+
+build:
+    extends: .build-stretch
+
+lintian:
+    extends: .test-lintian-stretch
+
+autopkgtest:
+    extends: .test-autopkgtest-stretch
+
+piuparts:
+    extends: .test-piuparts-stretch
diff --git a/debian/patches/fix-rmdir.patch b/debian/patches/fix-rmdir.patch
index 1db437695de..6b9c0eefb79 100644
--- a/debian/patches/fix-rmdir.patch
+++ b/debian/patches/fix-rmdir.patch
@@ -1,3 +1,170 @@
+From: Stefan Metzmacher <metze@samba.org>
+Date: Tue, 20 Jun 2017 08:35:13 +0200
+Subject: s3:libsmb: add cli_smb2_delete_on_close*()
+
+Signed-off-by: Stefan Metzmacher <metze@samba.org>
+Reviewed-by: Jeremy Allison <jra@samba.org>
+(cherry picked from commit 8d4005b07b08d5673b75d5d79f9b3d6936596fae)
+
+diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c
+index 43f116b681d..674c52e4405 100644
+--- a/source3/libsmb/cli_smb2_fnum.c
++++ b/source3/libsmb/cli_smb2_fnum.c
+@@ -484,6 +484,133 @@ NTSTATUS cli_smb2_close_fnum(struct cli_state *cli, uint16_t fnum)
+ 	return status;
+ }
+ 
++struct cli_smb2_delete_on_close_state {
++	struct cli_state *cli;
++	uint16_t fnum;
++	struct smb2_hnd *ph;
++	uint8_t data[1];
++	DATA_BLOB inbuf;
++};
++
++static void cli_smb2_delete_on_close_done(struct tevent_req *subreq);
++
++struct tevent_req *cli_smb2_delete_on_close_send(TALLOC_CTX *mem_ctx,
++					struct tevent_context *ev,
++					struct cli_state *cli,
++					uint16_t fnum,
++					bool flag)
++{
++	struct tevent_req *req = NULL;
++	struct cli_smb2_delete_on_close_state *state = NULL;
++	struct tevent_req *subreq = NULL;
++	uint8_t in_info_type;
++	uint8_t in_file_info_class;
++	NTSTATUS status;
++
++	req = tevent_req_create(mem_ctx, &state,
++				struct cli_smb2_delete_on_close_state);
++	if (req == NULL) {
++		return NULL;
++	}
++	state->cli = cli;
++	state->fnum = fnum;
++
++	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
++		tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
++		return tevent_req_post(req, ev);
++	}
++
++	status = map_fnum_to_smb2_handle(cli, fnum, &state->ph);
++	if (tevent_req_nterror(req, status)) {
++		return tevent_req_post(req, ev);
++	}
++
++	/*
++	 * setinfo on the handle with info_type SMB2_SETINFO_FILE (1),
++	 * level 13 (SMB_FILE_DISPOSITION_INFORMATION - 1000).
++	 */
++	in_info_type = 1;
++	in_file_info_class = SMB_FILE_DISPOSITION_INFORMATION - 1000;
++	/* Setup data array. */
++	SCVAL(&state->data[0], 0, flag ? 1 : 0);
++	state->inbuf.data = &state->data[0];
++	state->inbuf.length = 1;
++
++	subreq = smb2cli_set_info_send(state, ev,
++				       cli->conn,
++				       cli->timeout,
++				       cli->smb2.session,
++				       cli->smb2.tcon,
++				       in_info_type,
++				       in_file_info_class,
++				       &state->inbuf, /* in_input_buffer */
++				       0, /* in_additional_info */
++				       state->ph->fid_persistent,
++				       state->ph->fid_volatile);
++	if (tevent_req_nomem(subreq, req)) {
++		return tevent_req_post(req, ev);
++	}
++	tevent_req_set_callback(subreq,
++				cli_smb2_delete_on_close_done,
++				req);
++	return req;
++}
++
++static void cli_smb2_delete_on_close_done(struct tevent_req *subreq)
++{
++	NTSTATUS status = smb2cli_set_info_recv(subreq);
++	tevent_req_simple_finish_ntstatus(subreq, status);
++}
++
++NTSTATUS cli_smb2_delete_on_close_recv(struct tevent_req *req)
++{
++	struct cli_smb2_delete_on_close_state *state =
++		tevent_req_data(req,
++		struct cli_smb2_delete_on_close_state);
++	NTSTATUS status;
++
++	if (tevent_req_is_nterror(req, &status)) {
++		state->cli->raw_status = status;
++		tevent_req_received(req);
++		return status;
++	}
++
++	state->cli->raw_status = NT_STATUS_OK;
++	tevent_req_received(req);
++	return NT_STATUS_OK;
++}
++
++NTSTATUS cli_smb2_delete_on_close(struct cli_state *cli, uint16_t fnum, bool flag)
++{
++	TALLOC_CTX *frame = talloc_stackframe();
++	struct tevent_context *ev;
++	struct tevent_req *req;
++	NTSTATUS status = NT_STATUS_NO_MEMORY;
++
++	if (smbXcli_conn_has_async_calls(cli->conn)) {
++		/*
++		 * Can't use sync call while an async call is in flight
++		 */
++		status = NT_STATUS_INVALID_PARAMETER;
++		goto fail;
++	}
++	ev = samba_tevent_context_init(frame);
++	if (ev == NULL) {
++		goto fail;
++	}
++	req = cli_smb2_delete_on_close_send(frame, ev, cli, fnum, flag);
++	if (req == NULL) {
++		goto fail;
++	}
++	if (!tevent_req_poll_ntstatus(req, ev, &status)) {
++		goto fail;
++	}
++	status = cli_smb2_delete_on_close_recv(req);
++ fail:
++	TALLOC_FREE(frame);
++	return status;
++}
++
+ /***************************************************************
+  Small wrapper that allows SMB2 to create a directory
+  Synchronous only.
+diff --git a/source3/libsmb/cli_smb2_fnum.h b/source3/libsmb/cli_smb2_fnum.h
+index 435a5c28db3..b7d64f1da4d 100644
+--- a/source3/libsmb/cli_smb2_fnum.h
++++ b/source3/libsmb/cli_smb2_fnum.h
+@@ -54,6 +54,13 @@ struct tevent_req *cli_smb2_close_fnum_send(TALLOC_CTX *mem_ctx,
+ 					    uint16_t fnum);
+ NTSTATUS cli_smb2_close_fnum_recv(struct tevent_req *req);
+ NTSTATUS cli_smb2_close_fnum(struct cli_state *cli, uint16_t fnum);
++struct tevent_req *cli_smb2_delete_on_close_send(TALLOC_CTX *mem_ctx,
++					struct tevent_context *ev,
++					struct cli_state *cli,
++					uint16_t fnum,
++					bool flag);
++NTSTATUS cli_smb2_delete_on_close_recv(struct tevent_req *req);
++NTSTATUS cli_smb2_delete_on_close(struct cli_state *cli, uint16_t fnum, bool flag);
+ NTSTATUS cli_smb2_mkdir(struct cli_state *cli, const char *dirname);
+ NTSTATUS cli_smb2_rmdir(struct cli_state *cli, const char *dirname);
+ NTSTATUS cli_smb2_unlink(struct cli_state *cli,const char *fname);
+-- 
+2.20.1
+
 From: Anoop C S <anoopcs@redhat.com>
 Date: Thu, 9 Aug 2018 12:28:41 +0530
 Subject: s3/libsmb: Explicitly set delete_on_close token for rmdir
@@ -20,10 +187,10 @@ Bug-Debian: https://bugs.debian.org/915248
 Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/samba/+bug/1795772
 
 diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c
-index 237e6bb2b..d4ff8bd28 100644
+index fc99be23d03..43f116b681d 100644
 --- a/source3/libsmb/cli_smb2_fnum.c
 +++ b/source3/libsmb/cli_smb2_fnum.c
-@@ -682,13 +682,20 @@ NTSTATUS cli_smb2_rmdir(struct cli_state *cli, const char *dname)
+@@ -550,13 +550,20 @@ NTSTATUS cli_smb2_rmdir(struct cli_state *cli, const char *dname)
  			FILE_ATTRIBUTE_DIRECTORY, /* file attributes */
  			FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access */
  			FILE_OPEN,		/* create_disposition */
@@ -45,3 +212,6 @@ index 237e6bb2b..d4ff8bd28 100644
  	return cli_smb2_close_fnum(cli, fnum);
  }
  
+-- 
+2.20.1
+

Reply to: