[Pkg-samba-maint] [Git][samba-team/samba][upstream_4.19] 8 commits: VERSION: Bump version up to Samba 4.19.0rc5...

Michael Tokarev (@mjt) gitlab at salsa.debian.org
Mon Sep 4 21:00:05 BST 2023



Michael Tokarev pushed to branch upstream_4.19 at Debian Samba Team / samba


Commits:
087e7cdc by Jule Anger at 2023-08-28T15:55:30+02:00
VERSION: Bump version up to Samba 4.19.0rc5...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Jule Anger <janger at samba.org>

- - - - -
9f573711 by Martin Schwenke at 2023-08-29T08:25:12+00:00
ctdb-common: Improve error handling

Factor out a failure label, which will get more use in subsequent
commits, and only set private_data when success is certain.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15451

Signed-off-by: Martin Schwenke <mschwenke at ddn.com>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit d87041d8968e91db9d257445321b85693303f95e)

- - - - -
58e7d6a9 by Martin Schwenke at 2023-08-29T08:25:12+00:00
ctdb-common: Replace pcap_open_live() by lower level calls

A subsequent commit will insert an additional call before
pcap_activate().

This sequence of calls is taken from the source for pcap_open_live(),
so there should be no change in behaviour.

Given the defaults set by pcap_create_common(), it would be possible
to omit the calls to pcap_set_promisc() and pcap_set_timeout().
However, those defaults don't seem to be well documented, so continue
to explicitly set everything that was set before.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15451

Signed-off-by: Martin Schwenke <mschwenke at ddn.com>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit ffc2ae616d8fab7528fbdfd8c6b94c5b9a0e3a7c)

- - - - -
1af8a099 by Martin Schwenke at 2023-08-29T09:34:35+00:00
ctdb-common: Set immediate mode for pcap capture

Fix a problem where ctdb_killtcp (almost always) fails to capture
packets with --enable-pcap and libpcap ≥ 1.9.1.  The problem is due to
a gradual change in libpcap semantics when using
pcap_get_selectable_fd(3PCAP) to get a file descriptor and then using
that file descriptor in non-blocking mode.

pcap_set_immediate_mode(3PCAP) says:

  pcap_set_immediate_mode() sets whether immediate mode should be set
  on a capture handle when the handle is activated.  In immediate
  mode, packets are always delivered as soon as they arrive, with no
  buffering.

and

  On Linux, with previous releases of libpcap, capture devices are
  always in immediate mode; however, in 1.5.0 and later, they are, by
  default, not in immediate mode, so if pcap_set_immediate_mode() is
  available, it should be used.

However, it wasn't until libpcap commit
2ade7676101366983bd4f86bc039ffd25da8c126 (before libpcap 1.9.1) that
it became a requirement to use pcap_set_immediate_mode(), even with a
timeout of 0.

More explanation in this libpcap issue comment:

  https://github.com/the-tcpdump-group/libpcap/issues/860#issuecomment-541204548

Do a configure check for pcap_set_immediate_mode() even though it has
existed for 10 years.  It is easy enough.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15451

Signed-off-by: Martin Schwenke <mschwenke at ddn.com>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
Autobuild-Date(master): Tue Aug 15 10:53:52 UTC 2023 on atb-devel-224

(cherry picked from commit dc7b48c404337891b5105df4d6751cf549a533eb)

Autobuild-User(v4-19-test): Jule Anger <janger at samba.org>
Autobuild-Date(v4-19-test): Tue Aug 29 09:34:35 UTC 2023 on atb-devel-224

- - - - -
8a34b378 by MikeLiu at 2023-09-04T10:17:37+00:00
vfs_aio_pthread: use SMB_VFS_NEXT_OPENAT() in aio_pthread_openat_fn()

1. Set 'aio_allow_open' to false if fsp->fsp_flags.is_pathref
2. Move !(how->flags & O_CREAT) and !(how->flags & O_EXCL) up and set 'aio_allow_open' to false
3. Use SMB_VFS_NEXT_OPENAT() instead of openat() for disable async opens case.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15453

Signed-off-by: MikeLiu <mikeliu at qnap.com>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>

Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue Aug 22 17:44:00 UTC 2023 on atb-devel-224

Autobuild-User(v4-19-test): Jule Anger <janger at samba.org>
Autobuild-Date(v4-19-test): Mon Sep  4 10:17:37 UTC 2023 on atb-devel-224

- - - - -
a21e0936 by Jule Anger at 2023-09-04T14:34:46+02:00
WHATSNEW: Add release notes for Samba 4.19.0.

Signed-off-by: Jule Anger <janger at samba.org>

- - - - -
b7921852 by Jule Anger at 2023-09-04T14:35:46+02:00
VERSION: Disable GIT_SNAPSHOT for the 4.19.0 release.

Signed-off-by: Jule Anger <janger at samba.org>

- - - - -
f9931b55 by Michael Tokarev at 2023-09-04T22:40:31+03:00
New upstream version 4.19.0+dfsg
- - - - -


5 changed files:

- VERSION
- WHATSNEW.txt
- ctdb/common/system_socket.c
- ctdb/wscript
- source3/modules/vfs_aio_pthread.c


Changes:

=====================================
VERSION
=====================================
@@ -87,7 +87,7 @@ SAMBA_VERSION_PRE_RELEASE=
 # e.g. SAMBA_VERSION_RC_RELEASE=1                      #
 #  ->  "3.0.0rc1"                                      #
 ########################################################
-SAMBA_VERSION_RC_RELEASE=4
+SAMBA_VERSION_RC_RELEASE=
 
 ########################################################
 # To mark SVN snapshots this should be set to 'yes'    #


=====================================
WHATSNEW.txt
=====================================
@@ -1,17 +1,10 @@
-Release Announcements
-=====================
-
-This is the fourth release candidate of Samba 4.19.  This is *not*
-intended for production environments and is designed for testing
-purposes only.  Please report any defects via the Samba bug reporting
-system at https://bugzilla.samba.org/.
-
-Samba 4.19 will be the next version of the Samba suite.
-
-
-UPGRADING
-=========
+                   ==============================
+                   Release Notes for Samba 4.19.0
+                         September 04, 2023
+                   ==============================
 
+This is the first stable release of the Samba 4.19 release series.
+Please read the release notes carefully before upgrading.
 
 NEW FEATURES/CHANGES
 ====================
@@ -252,6 +245,18 @@ smb.conf changes
   directory name cache size               Removed
 
 
+CHANGES SINCE 4.19.0rc4
+=======================
+
+o  MikeLiu <mikeliu at qnap.com>
+   * BUG 15453: File doesn't show when user doesn't have permission if
+     aio_pthread is loaded.
+
+o  Martin Schwenke <mschwenke at ddn.com>
+   * BUG 15451: ctdb_killtcp fails to work with --enable-pcap and libpcap ≥
+     1.9.1.
+
+
 CHANGES SINCE 4.19.0rc3
 =======================
 


=====================================
ctdb/common/system_socket.c
=====================================
@@ -980,15 +980,45 @@ int ctdb_sys_open_capture_socket(const char *iface, void **private_data)
 	int pcap_packet_type;
 	const char *t = NULL;
 	int fd;
+	int ret;
 
-	pt = pcap_open_live(iface, 100, 0, 0, errbuf);
+	pt = pcap_create(iface, errbuf);
 	if (pt == NULL) {
 		DBG_ERR("Failed to open pcap capture device %s (%s)\n",
 			iface,
 			errbuf);
 		return -1;
 	}
-	*((pcap_t **)private_data) = pt;
+	/*
+	 * pcap isn't very clear about defaults...
+	 */
+	ret = pcap_set_snaplen(pt, 100);
+	if (ret < 0) {
+		DBG_ERR("Failed to set snaplen for pcap capture\n");
+		goto fail;
+	}
+	ret = pcap_set_promisc(pt, 0);
+	if (ret < 0) {
+		DBG_ERR("Failed to unset promiscuous mode for pcap capture\n");
+		goto fail;
+	}
+	ret = pcap_set_timeout(pt, 0);
+	if (ret < 0) {
+		DBG_ERR("Failed to set timeout for pcap capture\n");
+		goto fail;
+	}
+#ifdef HAVE_PCAP_SET_IMMEDIATE_MODE
+	ret = pcap_set_immediate_mode(pt, 1);
+	if (ret < 0) {
+		DBG_ERR("Failed to set immediate mode for pcap capture\n");
+		goto fail;
+	}
+#endif
+	ret = pcap_activate(pt);
+	if (ret < 0) {
+		DBG_ERR("Failed to activate pcap capture\n");
+		goto fail;
+	}
 
 	pcap_packet_type = pcap_datalink(pt);
 	switch (pcap_packet_type) {
@@ -1005,8 +1035,7 @@ int ctdb_sys_open_capture_socket(const char *iface, void **private_data)
 #endif /* DLT_LINUX_SLL2 */
 	default:
 		DBG_ERR("Unknown pcap packet type %d\n", pcap_packet_type);
-		pcap_close(pt);
-		return -1;
+		goto fail;
 	}
 
 	fd = pcap_get_selectable_fd(pt);
@@ -1014,7 +1043,12 @@ int ctdb_sys_open_capture_socket(const char *iface, void **private_data)
 		  t,
 		  fd);
 
+	*((pcap_t **)private_data) = pt;
 	return fd;
+
+fail:
+	pcap_close(pt);
+	return -1;
 }
 
 int ctdb_sys_close_capture_socket(void *private_data)


=====================================
ctdb/wscript
=====================================
@@ -221,6 +221,7 @@ def configure(conf):
         if not conf.CHECK_FUNCS_IN('pcap_open_live', 'pcap', headers='pcap.h'):
             Logs.error('Need libpcap')
             sys.exit(1)
+        conf.CHECK_FUNCS_IN('pcap_set_immediate_mode', 'pcap', headers='pcap.h')
 
     if not conf.CHECK_FUNCS_IN('backtrace backtrace_symbols', 'execinfo',
                                checklibc=True, headers='execinfo.h'):


=====================================
source3/modules/vfs_aio_pthread.c
=====================================
@@ -483,28 +483,28 @@ static int aio_pthread_openat_fn(vfs_handle_struct *handle,
 		aio_allow_open = false;
 	}
 
-	if (!aio_allow_open) {
-		/* aio opens turned off. */
-		return openat(fsp_get_pathref_fd(dirfsp),
-			      smb_fname->base_name,
-			      how->flags,
-			      how->mode);
+	if (fsp->fsp_flags.is_pathref) {
+		/* Use SMB_VFS_NEXT_OPENAT() to call openat() with O_PATH. */
+		aio_allow_open = false;
 	}
 
 	if (!(how->flags & O_CREAT)) {
 		/* Only creates matter. */
-		return openat(fsp_get_pathref_fd(dirfsp),
-			      smb_fname->base_name,
-			      how->flags,
-			      how->mode);
+		aio_allow_open = false;
 	}
 
 	if (!(how->flags & O_EXCL)) {
 		/* Only creates with O_EXCL matter. */
-		return openat(fsp_get_pathref_fd(dirfsp),
-			      smb_fname->base_name,
-			      how->flags,
-			      how->mode);
+		aio_allow_open = false;
+	}
+
+	if (!aio_allow_open) {
+		/* aio opens turned off. */
+		return SMB_VFS_NEXT_OPENAT(handle,
+			      dirfsp,
+			      smb_fname,
+			      fsp,
+			      how);
 	}
 
 	/*



View it on GitLab: https://salsa.debian.org/samba-team/samba/-/compare/ca8edd2d131d68a852a6a152f024acd5370d7dc2...f9931b55641207ee9a29e0b7129dffd090c886e6

-- 
View it on GitLab: https://salsa.debian.org/samba-team/samba/-/compare/ca8edd2d131d68a852a6a152f024acd5370d7dc2...f9931b55641207ee9a29e0b7129dffd090c886e6
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/20230904/569eb907/attachment-0001.htm>


More information about the Pkg-samba-maint mailing list