[arch-commits] Commit in network-manager-applet/repos/extra-x86_64 (4 files)
Jan Steffens
heftig at archlinux.org
Thu Dec 21 17:42:00 UTC 2017
Date: Thursday, December 21, 2017 @ 17:41:59
Author: heftig
Revision: 313493
archrelease: copy trunk to extra-x86_64
Added:
network-manager-applet/repos/extra-x86_64/0001-shared-compat-Fix-memory-handling-of-nm_setting_vpn_.patch
(from rev 313492, network-manager-applet/trunk/0001-shared-compat-Fix-memory-handling-of-nm_setting_vpn_.patch)
network-manager-applet/repos/extra-x86_64/PKGBUILD
(from rev 313492, network-manager-applet/trunk/PKGBUILD)
Deleted:
network-manager-applet/repos/extra-x86_64/0001-shared-compat-Fix-memory-handling-of-nm_setting_vpn_.patch
network-manager-applet/repos/extra-x86_64/PKGBUILD
-----------------------------------------------------------------+
0001-shared-compat-Fix-memory-handling-of-nm_setting_vpn_.patch | 133 ++++----
PKGBUILD | 160 +++++-----
2 files changed, 149 insertions(+), 144 deletions(-)
Deleted: 0001-shared-compat-Fix-memory-handling-of-nm_setting_vpn_.patch
===================================================================
--- 0001-shared-compat-Fix-memory-handling-of-nm_setting_vpn_.patch 2017-12-21 17:41:31 UTC (rev 313492)
+++ 0001-shared-compat-Fix-memory-handling-of-nm_setting_vpn_.patch 2017-12-21 17:41:59 UTC (rev 313493)
@@ -1,64 +0,0 @@
-From 6c546a4fe86f3066545b7a8bb2900c19a66f9a2f Mon Sep 17 00:00:00 2001
-Message-Id: <6c546a4fe86f3066545b7a8bb2900c19a66f9a2f.1513772933.git.jan.steffens at gmail.com>
-From: "Jan Alexander Steffens (heftig)" <jan.steffens at gmail.com>
-Date: Wed, 20 Dec 2017 13:23:12 +0100
-Subject: [PATCH] shared/compat: Fix memory handling of
- nm_setting_vpn_get_*_keys
-
-The compat implementations return a (transfer none) strv instead of a
-(transfer container) one. This has caused double frees in nm-applet:
-https://bugs.archlinux.org/task/56772
-
-Don't copy the keys and don't free the container later.
----
- shared/nm-utils/nm-compat.c | 10 +---------
- 1 file changed, 1 insertion(+), 9 deletions(-)
-
-diff --git a/shared/nm-utils/nm-compat.c b/shared/nm-utils/nm-compat.c
-index 22ab675de8373639..22c31489dd222cd3 100644
---- a/shared/nm-utils/nm-compat.c
-+++ b/shared/nm-utils/nm-compat.c
-@@ -30,39 +30,31 @@ _get_keys_cb (const char *key, const char *val, gpointer user_data)
- {
- GPtrArray *a = user_data;
-
-- g_ptr_array_add (a, g_strdup (key));
-+ g_ptr_array_add (a, key);
- }
-
- static const char **
- _get_keys (NMSettingVpn *setting,
- gboolean is_secrets,
- guint *out_length)
- {
- guint len;
- const char **keys = NULL;
- gs_unref_ptrarray GPtrArray *a = NULL;
-
- nm_assert (NM_IS_SETTING_VPN (setting));
-
- a = g_ptr_array_new ();
- if (is_secrets)
- nm_setting_vpn_foreach_secret (setting, _get_keys_cb, a);
- else
- nm_setting_vpn_foreach_data_item (setting, _get_keys_cb, a);
- len = a->len;
-
- if (a->len) {
- g_ptr_array_sort (a, nm_strcmp_p);
- g_ptr_array_add (a, NULL);
- keys = (const char **) g_ptr_array_free (g_steal_pointer (&a), FALSE);
--
-- /* we need to cache the keys *somewhere*. */
-- g_object_set_qdata_full (G_OBJECT (setting),
-- is_secrets
-- ? NM_CACHED_QUARK ("libnm._nm_setting_vpn_get_secret_keys")
-- : NM_CACHED_QUARK ("libnm._nm_setting_vpn_get_data_keys"),
-- keys,
-- (GDestroyNotify) g_strfreev);
- }
-
- NM_SET_OUT (out_length, len);
---
-2.15.1
-
Copied: network-manager-applet/repos/extra-x86_64/0001-shared-compat-Fix-memory-handling-of-nm_setting_vpn_.patch (from rev 313492, network-manager-applet/trunk/0001-shared-compat-Fix-memory-handling-of-nm_setting_vpn_.patch)
===================================================================
--- 0001-shared-compat-Fix-memory-handling-of-nm_setting_vpn_.patch (rev 0)
+++ 0001-shared-compat-Fix-memory-handling-of-nm_setting_vpn_.patch 2017-12-21 17:41:59 UTC (rev 313493)
@@ -0,0 +1,69 @@
+From 8147a06b45ef4fc6983454b63fe81a460f761593 Mon Sep 17 00:00:00 2001
+Message-Id: <8147a06b45ef4fc6983454b63fe81a460f761593.1513877605.git.jan.steffens at gmail.com>
+From: "Jan Alexander Steffens (heftig)" <jan.steffens at gmail.com>
+Date: Thu, 21 Dec 2017 18:22:55 +0100
+Subject: [PATCH] shared/compat: fix memory handling of
+ nm_setting_vpn_get_*_keys (v2)
+
+The compat implementations return a (transfer none) strv instead of a
+(transfer container) one. This has caused double frees in nm-applet:
+https://bugs.archlinux.org/task/56772
+
+We still need to copy the keys because nm_setting_vpn_foreach_* provides
+us with copies that are freed after the iteration.
+
+Fix this by handing out a duplicate of the array. Also simplify the
+function a bit by caching the entire GPtrArray object and not just the
+array itself.
+
+Fixes: 272439cb2077a889485dd195bb6b99ca91d3e3bf
+---
+ shared/nm-utils/nm-compat.c | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/shared/nm-utils/nm-compat.c b/shared/nm-utils/nm-compat.c
+index 22ab675de8373639..2b747c700478a205 100644
+--- a/shared/nm-utils/nm-compat.c
++++ b/shared/nm-utils/nm-compat.c
+@@ -38,34 +38,32 @@ _get_keys (NMSettingVpn *setting,
+ gboolean is_secrets,
+ guint *out_length)
+ {
+- guint len;
+ const char **keys = NULL;
+ gs_unref_ptrarray GPtrArray *a = NULL;
+
+ nm_assert (NM_IS_SETTING_VPN (setting));
+
+ a = g_ptr_array_new ();
+ if (is_secrets)
+ nm_setting_vpn_foreach_secret (setting, _get_keys_cb, a);
+ else
+ nm_setting_vpn_foreach_data_item (setting, _get_keys_cb, a);
+- len = a->len;
+
+ if (a->len) {
+ g_ptr_array_sort (a, nm_strcmp_p);
+ g_ptr_array_add (a, NULL);
+- keys = (const char **) g_ptr_array_free (g_steal_pointer (&a), FALSE);
++ keys = g_memdup (a->pdata, sizeof (gpointer) * a->len);
+
+ /* we need to cache the keys *somewhere*. */
+ g_object_set_qdata_full (G_OBJECT (setting),
+ is_secrets
+ ? NM_CACHED_QUARK ("libnm._nm_setting_vpn_get_secret_keys")
+ : NM_CACHED_QUARK ("libnm._nm_setting_vpn_get_data_keys"),
+- keys,
+- (GDestroyNotify) g_strfreev);
++ g_ptr_array_ref (a),
++ (GDestroyNotify) g_ptr_array_unref);
+ }
+
+- NM_SET_OUT (out_length, len);
++ NM_SET_OUT (out_length, a->len);
+ return keys;
+ }
+
+--
+2.15.1
+
Property changes on: network-manager-applet/repos/extra-x86_64/0001-shared-compat-Fix-memory-handling-of-nm_setting_vpn_.patch
___________________________________________________________________
Added: svn:mergeinfo
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2017-12-21 17:41:31 UTC (rev 313492)
+++ PKGBUILD 2017-12-21 17:41:59 UTC (rev 313493)
@@ -1,80 +0,0 @@
-# $Id$
-# Maintainer: Jan de Groot <jgc at archlinux.org>
-# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens at gmail.com>
-# Contributor: Arjan Timmerman <arjan at archlinux.org>
-# Contributor: Wael Nasreddine <gandalf at siemens-mobiles.org>
-# Contributor: Tor Krill <tor at krill.nu>
-# Contributor: Will Rea <sillywilly at gmail.com>
-
-pkgbase=network-manager-applet
-pkgname=(nm-connection-editor network-manager-applet)
-pkgdesc="Applet for managing network connections"
-url="https://wiki.gnome.org/Projects/NetworkManager/"
-pkgver=1.8.10
-pkgrel=2
-arch=(x86_64)
-license=(GPL2 LGPL2.1)
-depends=(libnm-glib libgudev gtk3 mobile-broadband-provider-info iso-codes gcr)
-makedepends=(libsecret libnotify libmm-glib intltool gobject-introspection git gtk-doc meson)
-options=(!emptydirs)
-_commit=79bd00df3c1b7eb69db0f890ddb38516d7b4db5e # tags/1.8.10^0
-source=("git+https://git.gnome.org/browse/network-manager-applet#commit=$_commit"
- 0001-shared-compat-Fix-memory-handling-of-nm_setting_vpn_.patch)
-sha256sums=('SKIP'
- '117e7fab1a930f64bd8ce4c94de2f954a28315b2763bd4c8e1c583b32bd6feaf')
-
-pkgver() {
- cd $pkgbase
- git describe --tags | sed 's/-dev/dev/;s/-/+/g'
-}
-
-prepare() {
- mkdir -p build nma/etc/xdg nma/usr/bin \
- nma/usr/share/{applications,icons/hicolor/22x22/apps,man/man1,nm-applet}
- cd $pkgbase
-
- # https://bugs.archlinux.org/task/56772
- patch -Np1 -i ../0001-shared-compat-Fix-memory-handling-of-nm_setting_vpn_.patch
-}
-
-build() {
- cd build
- arch-meson ../$pkgbase -Dselinux=false
- ninja
-}
-
-check() {
- cd build
- meson test
-}
-
-package_nm-connection-editor() {
- pkgdesc="NetworkManager GUI connection editor and widgets"
- provides=("libnm-gtk=$pkgver-$pkgrel" "libnma=$pkgver-$pkgrel")
- conflicts=(libnm-gtk)
- replaces=(libnm-gtk)
-
- cd build
- DESTDIR="$pkgdir" ninja install
-
-### Split network-manager-applet
- cd ../nma
- mv "$pkgdir"/etc/xdg/autostart etc/xdg/
- mv "$pkgdir"/usr/bin/nm-applet usr/bin/
- mv "$pkgdir"/usr/share/GConf usr/share/
-
- cd usr/share
- mv "$pkgdir"/usr/share/applications/nm-applet.desktop applications/
- mv "$pkgdir"/usr/share/man/man1/nm-applet.1 man/man1/
-
- cd icons/hicolor/22x22
- mv "$pkgdir"/usr/share/icons/hicolor/22x22/apps/nm-{adhoc,mb-roam,wwan-tower}.png apps/
- mv "$pkgdir"/usr/share/icons/hicolor/22x22/apps/nm-{secure,vpn-active}-lock.png apps/
- mv "$pkgdir"/usr/share/icons/hicolor/22x22/apps/nm-{signal,tech}-*.png apps/
- mv "$pkgdir"/usr/share/icons/hicolor/22x22/apps/nm-*connecting*.png apps/
-}
-
-package_network-manager-applet() {
- depends=(nm-connection-editor libmm-glib libnotify libsecret networkmanager)
- mv nma/* "$pkgdir"
-}
Copied: network-manager-applet/repos/extra-x86_64/PKGBUILD (from rev 313492, network-manager-applet/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2017-12-21 17:41:59 UTC (rev 313493)
@@ -0,0 +1,80 @@
+# $Id$
+# Maintainer: Jan de Groot <jgc at archlinux.org>
+# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens at gmail.com>
+# Contributor: Arjan Timmerman <arjan at archlinux.org>
+# Contributor: Wael Nasreddine <gandalf at siemens-mobiles.org>
+# Contributor: Tor Krill <tor at krill.nu>
+# Contributor: Will Rea <sillywilly at gmail.com>
+
+pkgbase=network-manager-applet
+pkgname=(nm-connection-editor network-manager-applet)
+pkgdesc="Applet for managing network connections"
+url="https://wiki.gnome.org/Projects/NetworkManager/"
+pkgver=1.8.10
+pkgrel=3
+arch=(x86_64)
+license=(GPL2 LGPL2.1)
+depends=(libnm-glib libgudev gtk3 mobile-broadband-provider-info iso-codes gcr)
+makedepends=(libsecret libnotify libmm-glib intltool gobject-introspection git gtk-doc meson)
+options=(!emptydirs)
+_commit=79bd00df3c1b7eb69db0f890ddb38516d7b4db5e # tags/1.8.10^0
+source=("git+https://git.gnome.org/browse/network-manager-applet#commit=$_commit"
+ 0001-shared-compat-Fix-memory-handling-of-nm_setting_vpn_.patch)
+sha256sums=('SKIP'
+ 'df8f420b116155e7fd81e9d7a13e27bc3026e63cb859a0bb533b0bc74b8c614c')
+
+pkgver() {
+ cd $pkgbase
+ git describe --tags | sed 's/-dev/dev/;s/-/+/g'
+}
+
+prepare() {
+ mkdir -p build nma/etc/xdg nma/usr/bin \
+ nma/usr/share/{applications,icons/hicolor/22x22/apps,man/man1,nm-applet}
+ cd $pkgbase
+
+ # https://bugs.archlinux.org/task/56772
+ patch -Np1 -i ../0001-shared-compat-Fix-memory-handling-of-nm_setting_vpn_.patch
+}
+
+build() {
+ cd build
+ arch-meson ../$pkgbase -Dselinux=false
+ ninja
+}
+
+check() {
+ cd build
+ meson test
+}
+
+package_nm-connection-editor() {
+ pkgdesc="NetworkManager GUI connection editor and widgets"
+ provides=("libnm-gtk=$pkgver-$pkgrel" "libnma=$pkgver-$pkgrel")
+ conflicts=(libnm-gtk)
+ replaces=(libnm-gtk)
+
+ cd build
+ DESTDIR="$pkgdir" ninja install
+
+### Split network-manager-applet
+ cd ../nma
+ mv "$pkgdir"/etc/xdg/autostart etc/xdg/
+ mv "$pkgdir"/usr/bin/nm-applet usr/bin/
+ mv "$pkgdir"/usr/share/GConf usr/share/
+
+ cd usr/share
+ mv "$pkgdir"/usr/share/applications/nm-applet.desktop applications/
+ mv "$pkgdir"/usr/share/man/man1/nm-applet.1 man/man1/
+
+ cd icons/hicolor/22x22
+ mv "$pkgdir"/usr/share/icons/hicolor/22x22/apps/nm-{adhoc,mb-roam,wwan-tower}.png apps/
+ mv "$pkgdir"/usr/share/icons/hicolor/22x22/apps/nm-{secure,vpn-active}-lock.png apps/
+ mv "$pkgdir"/usr/share/icons/hicolor/22x22/apps/nm-{signal,tech}-*.png apps/
+ mv "$pkgdir"/usr/share/icons/hicolor/22x22/apps/nm-*connecting*.png apps/
+}
+
+package_network-manager-applet() {
+ depends=(nm-connection-editor libmm-glib libnotify libsecret networkmanager)
+ mv nma/* "$pkgdir"
+}
Property changes on: network-manager-applet/repos/extra-x86_64/PKGBUILD
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Added: svn:mergeinfo
More information about the arch-commits
mailing list