From adeb4b1b8f07f31595a6e7ab97cb94b0405517c5 Mon Sep 17 00:00:00 2001 From: fandehui Date: Thu, 27 Jul 2023 10:17:29 +0800 Subject: [PATCH] linux-cm: Fds can be 0 --- gupnp.spec | 18 +++++++++++- linux-cm-Fds-can-be-0.patch | 57 +++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 linux-cm-Fds-can-be-0.patch diff --git a/gupnp.spec b/gupnp.spec index 01a8c17..48342b3 100644 --- a/gupnp.spec +++ b/gupnp.spec @@ -1,12 +1,13 @@ Name: gupnp Version: 1.2.4 -Release: 2 +Release: 3 Summary: UPnP devices & control points creation framework License: LGPLv2+ URL: http://www.gupnp.org/ Source0: http://download.gnome.org/sources/%{name}/1.2/%{name}-%{version}.tar.xz Patch0: CVE-2021-33516.patch Patch1: ServiceProxy-Remove-bogos-function-rename.patch +Patch2: linux-cm-Fds-can-be-0.patch BuildRequires: gssdp-devel >= 1.2.3 gtk-doc gobject-introspection-devel >= 1.36 BuildRequires: libsoup-devel libxml2-devel libuuid-devel vala meson @@ -75,6 +76,21 @@ This package contains help file and developer documentation for gupnp. %{_mandir}/man1/gupnp-binding-tool-* %changelog +* Thu Oct 26 2023 fandehui - 1.2.4-3 +- linux-cm: Fds can be 0 + +* Fri Oct 20 2023 fandehui - 1.2.4-2 +- ServiceProxy: Remove bogos function rename + +* Mon Jun 7 2021 weijin deng - 1.2.4-1 +- Upgrade to 1.2.4 +- Update Version, Release, Source0, BuildRequires +- Delete sed operation which existed in this version +- Add patch for fix CVE-2021-33516 +- Update stage 'prep', 'build', 'install', 'check', 'files' + +* Fri Oct 25 2019 Alex Chao - 1.0.3-2 +- Package init * Fri Oct 20 2023 fandehui - 1.2.4-2 - ServiceProxy: Remove bogos function rename diff --git a/linux-cm-Fds-can-be-0.patch b/linux-cm-Fds-can-be-0.patch new file mode 100644 index 0000000..a55077c --- /dev/null +++ b/linux-cm-Fds-can-be-0.patch @@ -0,0 +1,57 @@ +From 1024bb948ae047282421dbac6f670317e4a17001 Mon Sep 17 00:00:00 2001 +From: Jens Georg +Date: Mon, 10 May 2021 13:22:36 +0200 +Subject: [PATCH] linux-cm: Fds can be 0 + +--- + libgupnp/gupnp-linux-context-manager.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/libgupnp/gupnp-linux-context-manager.c b/libgupnp/gupnp-linux-context-manager.c +index e96ec66..03e951d 100644 +--- a/libgupnp/gupnp-linux-context-manager.c ++++ b/libgupnp/gupnp-linux-context-manager.c +@@ -943,8 +943,6 @@ create_ioctl_socket (GUPnPLinuxContextManager *self, GError **error) + priv->fd = socket (AF_INET, SOCK_DGRAM, 0); + + if (priv->fd < 0) { +- priv->fd = 0; +- + g_set_error_literal (error, + G_IO_ERROR, + g_io_error_from_errno (errno), +@@ -1045,6 +1043,7 @@ gupnp_linux_context_manager_init (GUPnPLinuxContextManager *self) + GUPnPLinuxContextManagerPrivate *priv; + + priv = gupnp_linux_context_manager_get_instance_private (self); ++ priv->fd = -1; + + priv->nl_seq = 0; + +@@ -1087,8 +1086,10 @@ gupnp_linux_context_manager_constructed (GObject *object) + NULL); + cleanup: + if (error) { +- if (priv->fd > 0) ++ if (priv->fd >= 0) { + close (priv->fd); ++ priv->fd = -1; ++ } + + g_warning ("Failed to setup Linux context manager: %s", + error->message); +@@ -1129,9 +1130,9 @@ gupnp_linux_context_manager_dispose (GObject *object) + priv->netlink_socket = NULL; + } + +- if (priv->fd != 0) { ++ if (priv->fd >= 0) { + close (priv->fd); +- priv->fd = 0; ++ priv->fd = -1; + } + + if (priv->interfaces) { +-- +2.27.0 +