/[gentoo-x86]/net-misc/networkmanager/files/networkmanager-0.9.4.0-libnm-glib-ensure_inited.patch
Gentoo

Contents of /net-misc/networkmanager/files/networkmanager-0.9.4.0-libnm-glib-ensure_inited.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Fri Apr 13 21:18:23 2012 UTC (2 years, 3 months ago) by tetromino
Branch: MAIN
CVS Tags: HEAD
Fix gnome-shell crashes when networkmanager is not running (thanks to Firartix for reporting). Do not use obsolete wext API by default, and build against libnl:3 when USE=-wimax (bug #410143, thanks to Davide Pesavento). Add a separate USE flag for modemmanager because not very many people need it. Drop old.

(Portage version: 2.2.0_alpha100/cvs/Linux x86_64)

1 From a4f450aa0bf087453a8d605db81a83368cbe3b0a Mon Sep 17 00:00:00 2001
2 From: Dan Winship <danw@gnome.org>
3 Date: Wed, 28 Mar 2012 09:06:12 -0400
4 Subject: [PATCH] libnm-glib: more ensure_inited() fixing
5
6 We need to do _nm_object_ensure_inited() /
7 _nm_remote_settings_ensure_inited() from the get_property()
8 implementations; in most cases, get_property() just calls another
9 accessor method (which will call _nm_object_ensure_inited()), but in a
10 few places, it reads priv->whatever directly, so we need to make sure
11 that it's valid.
12 ---
13 libnm-glib/nm-access-point.c | 2 ++
14 libnm-glib/nm-active-connection.c | 2 ++
15 libnm-glib/nm-client.c | 2 ++
16 libnm-glib/nm-device-bond.c | 2 ++
17 libnm-glib/nm-device-bt.c | 2 ++
18 libnm-glib/nm-device-ethernet.c | 2 ++
19 libnm-glib/nm-device-infiniband.c | 2 ++
20 libnm-glib/nm-device-modem.c | 2 ++
21 libnm-glib/nm-device-olpc-mesh.c | 2 ++
22 libnm-glib/nm-device-vlan.c | 2 ++
23 libnm-glib/nm-device-wifi.c | 2 ++
24 libnm-glib/nm-device-wimax.c | 2 ++
25 libnm-glib/nm-device.c | 2 ++
26 libnm-glib/nm-dhcp4-config.c | 2 ++
27 libnm-glib/nm-dhcp6-config.c | 2 ++
28 libnm-glib/nm-ip4-config.c | 2 ++
29 libnm-glib/nm-ip6-config.c | 2 ++
30 libnm-glib/nm-remote-settings.c | 2 ++
31 libnm-glib/nm-vpn-connection.c | 2 ++
32 libnm-glib/nm-wimax-nsp.c | 2 ++
33 20 files changed, 40 insertions(+), 0 deletions(-)
34
35 diff --git a/libnm-glib/nm-access-point.c b/libnm-glib/nm-access-point.c
36 index 53993b0..a6218ed 100644
37 --- a/libnm-glib/nm-access-point.c
38 +++ b/libnm-glib/nm-access-point.c
39 @@ -464,6 +464,8 @@ get_property (GObject *object,
40 {
41 NMAccessPoint *ap = NM_ACCESS_POINT (object);
42
43 + _nm_object_ensure_inited (NM_OBJECT (object));
44 +
45 switch (prop_id) {
46 case PROP_FLAGS:
47 g_value_set_uint (value, nm_access_point_get_flags (ap));
48 diff --git a/libnm-glib/nm-active-connection.c b/libnm-glib/nm-active-connection.c
49 index 59d8a6a..81b1f01 100644
50 --- a/libnm-glib/nm-active-connection.c
51 +++ b/libnm-glib/nm-active-connection.c
52 @@ -394,6 +394,8 @@ get_property (GObject *object,
53 {
54 NMActiveConnection *self = NM_ACTIVE_CONNECTION (object);
55
56 + _nm_object_ensure_inited (NM_OBJECT (object));
57 +
58 switch (prop_id) {
59 case PROP_CONNECTION:
60 g_value_set_string (value, nm_active_connection_get_connection (self));
61 diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c
62 index b879206..3949b6d 100644
63 --- a/libnm-glib/nm-client.c
64 +++ b/libnm-glib/nm-client.c
65 @@ -1600,6 +1600,8 @@ get_property (GObject *object,
66 NMClient *self = NM_CLIENT (object);
67 NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (self);
68
69 + _nm_object_ensure_inited (NM_OBJECT (object));
70 +
71 switch (prop_id) {
72 case PROP_VERSION:
73 g_value_set_string (value, nm_client_get_version (self));
74 diff --git a/libnm-glib/nm-device-bond.c b/libnm-glib/nm-device-bond.c
75 index 034b7b3..7d8bf57 100644
76 --- a/libnm-glib/nm-device-bond.c
77 +++ b/libnm-glib/nm-device-bond.c
78 @@ -241,6 +241,8 @@ get_property (GObject *object,
79 {
80 NMDeviceBond *device = NM_DEVICE_BOND (object);
81
82 + _nm_object_ensure_inited (NM_OBJECT (object));
83 +
84 switch (prop_id) {
85 case PROP_HW_ADDRESS:
86 g_value_set_string (value, nm_device_bond_get_hw_address (device));
87 diff --git a/libnm-glib/nm-device-bt.c b/libnm-glib/nm-device-bt.c
88 index 8e0ff20..bd8ccd2 100644
89 --- a/libnm-glib/nm-device-bt.c
90 +++ b/libnm-glib/nm-device-bt.c
91 @@ -303,6 +303,8 @@ get_property (GObject *object,
92 {
93 NMDeviceBt *device = NM_DEVICE_BT (object);
94
95 + _nm_object_ensure_inited (NM_OBJECT (object));
96 +
97 switch (prop_id) {
98 case PROP_HW_ADDRESS:
99 g_value_set_string (value, nm_device_bt_get_hw_address (device));
100 diff --git a/libnm-glib/nm-device-ethernet.c b/libnm-glib/nm-device-ethernet.c
101 index 62aedbb..2c35a97 100644
102 --- a/libnm-glib/nm-device-ethernet.c
103 +++ b/libnm-glib/nm-device-ethernet.c
104 @@ -311,6 +311,8 @@ get_property (GObject *object,
105 {
106 NMDeviceEthernet *device = NM_DEVICE_ETHERNET (object);
107
108 + _nm_object_ensure_inited (NM_OBJECT (object));
109 +
110 switch (prop_id) {
111 case PROP_HW_ADDRESS:
112 g_value_set_string (value, nm_device_ethernet_get_hw_address (device));
113 diff --git a/libnm-glib/nm-device-infiniband.c b/libnm-glib/nm-device-infiniband.c
114 index ec5f4a8..4f28823 100644
115 --- a/libnm-glib/nm-device-infiniband.c
116 +++ b/libnm-glib/nm-device-infiniband.c
117 @@ -250,6 +250,8 @@ get_property (GObject *object,
118 {
119 NMDeviceInfiniband *device = NM_DEVICE_INFINIBAND (object);
120
121 + _nm_object_ensure_inited (NM_OBJECT (object));
122 +
123 switch (prop_id) {
124 case PROP_HW_ADDRESS:
125 g_value_set_string (value, nm_device_infiniband_get_hw_address (device));
126 diff --git a/libnm-glib/nm-device-modem.c b/libnm-glib/nm-device-modem.c
127 index f1d1389..09b6df1 100644
128 --- a/libnm-glib/nm-device-modem.c
129 +++ b/libnm-glib/nm-device-modem.c
130 @@ -205,6 +205,8 @@ get_property (GObject *object,
131 {
132 NMDeviceModem *self = NM_DEVICE_MODEM (object);
133
134 + _nm_object_ensure_inited (NM_OBJECT (object));
135 +
136 switch (prop_id) {
137 case PROP_MODEM_CAPS:
138 g_value_set_uint (value, nm_device_modem_get_modem_capabilities (self));
139 diff --git a/libnm-glib/nm-device-olpc-mesh.c b/libnm-glib/nm-device-olpc-mesh.c
140 index ed48ecb..96e1c36 100644
141 --- a/libnm-glib/nm-device-olpc-mesh.c
142 +++ b/libnm-glib/nm-device-olpc-mesh.c
143 @@ -257,6 +257,8 @@ get_property (GObject *object,
144 {
145 NMDeviceOlpcMesh *device = NM_DEVICE_OLPC_MESH (object);
146
147 + _nm_object_ensure_inited (NM_OBJECT (object));
148 +
149 switch (prop_id) {
150 case PROP_HW_ADDRESS:
151 g_value_set_string (value, nm_device_olpc_mesh_get_hw_address (device));
152 diff --git a/libnm-glib/nm-device-vlan.c b/libnm-glib/nm-device-vlan.c
153 index 08b1142..7ebc8dd 100644
154 --- a/libnm-glib/nm-device-vlan.c
155 +++ b/libnm-glib/nm-device-vlan.c
156 @@ -264,6 +264,8 @@ get_property (GObject *object,
157 {
158 NMDeviceVlan *device = NM_DEVICE_VLAN (object);
159
160 + _nm_object_ensure_inited (NM_OBJECT (object));
161 +
162 switch (prop_id) {
163 case PROP_HW_ADDRESS:
164 g_value_set_string (value, nm_device_vlan_get_hw_address (device));
165 diff --git a/libnm-glib/nm-device-wifi.c b/libnm-glib/nm-device-wifi.c
166 index 6975898..aba43f9 100644
167 --- a/libnm-glib/nm-device-wifi.c
168 +++ b/libnm-glib/nm-device-wifi.c
169 @@ -501,6 +501,8 @@ get_property (GObject *object,
170 {
171 NMDeviceWifi *self = NM_DEVICE_WIFI (object);
172
173 + _nm_object_ensure_inited (NM_OBJECT (object));
174 +
175 switch (prop_id) {
176 case PROP_HW_ADDRESS:
177 g_value_set_string (value, nm_device_wifi_get_hw_address (self));
178 diff --git a/libnm-glib/nm-device-wimax.c b/libnm-glib/nm-device-wimax.c
179 index 48a518d..e49b4f3 100644
180 --- a/libnm-glib/nm-device-wimax.c
181 +++ b/libnm-glib/nm-device-wimax.c
182 @@ -444,6 +444,8 @@ get_property (GObject *object,
183 {
184 NMDeviceWimax *self = NM_DEVICE_WIMAX (object);
185
186 + _nm_object_ensure_inited (NM_OBJECT (object));
187 +
188 switch (prop_id) {
189 case PROP_HW_ADDRESS:
190 g_value_set_string (value, nm_device_wimax_get_hw_address (self));
191 diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c
192 index 96a037d..a8a6338 100644
193 --- a/libnm-glib/nm-device.c
194 +++ b/libnm-glib/nm-device.c
195 @@ -313,6 +313,8 @@ get_property (GObject *object,
196 NMDevice *device = NM_DEVICE (object);
197 NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device);
198
199 + _nm_object_ensure_inited (NM_OBJECT (object));
200 +
201 switch (prop_id) {
202 case PROP_DEVICE_TYPE:
203 g_value_set_uint (value, nm_device_get_device_type (device));
204 diff --git a/libnm-glib/nm-dhcp4-config.c b/libnm-glib/nm-dhcp4-config.c
205 index 2074e6d..89ccf25 100644
206 --- a/libnm-glib/nm-dhcp4-config.c
207 +++ b/libnm-glib/nm-dhcp4-config.c
208 @@ -132,6 +132,8 @@ get_property (GObject *object,
209 {
210 NMDHCP4Config *self = NM_DHCP4_CONFIG (object);
211
212 + _nm_object_ensure_inited (NM_OBJECT (object));
213 +
214 switch (prop_id) {
215 case PROP_OPTIONS:
216 g_value_set_boxed (value, nm_dhcp4_config_get_options (self));
217 diff --git a/libnm-glib/nm-dhcp6-config.c b/libnm-glib/nm-dhcp6-config.c
218 index 3764cbf..88b3b10 100644
219 --- a/libnm-glib/nm-dhcp6-config.c
220 +++ b/libnm-glib/nm-dhcp6-config.c
221 @@ -132,6 +132,8 @@ get_property (GObject *object,
222 {
223 NMDHCP6Config *self = NM_DHCP6_CONFIG (object);
224
225 + _nm_object_ensure_inited (NM_OBJECT (object));
226 +
227 switch (prop_id) {
228 case PROP_OPTIONS:
229 g_value_set_boxed (value, nm_dhcp6_config_get_options (self));
230 diff --git a/libnm-glib/nm-ip4-config.c b/libnm-glib/nm-ip4-config.c
231 index 5667854..862e7a0 100644
232 --- a/libnm-glib/nm-ip4-config.c
233 +++ b/libnm-glib/nm-ip4-config.c
234 @@ -187,6 +187,8 @@ get_property (GObject *object,
235 NMIP4Config *self = NM_IP4_CONFIG (object);
236 NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (self);
237
238 + _nm_object_ensure_inited (NM_OBJECT (object));
239 +
240 switch (prop_id) {
241 case PROP_ADDRESSES:
242 nm_utils_ip4_addresses_to_gvalue (priv->addresses, value);
243 diff --git a/libnm-glib/nm-ip6-config.c b/libnm-glib/nm-ip6-config.c
244 index c9a2627..988dcd3 100644
245 --- a/libnm-glib/nm-ip6-config.c
246 +++ b/libnm-glib/nm-ip6-config.c
247 @@ -268,6 +268,8 @@ get_property (GObject *object,
248 NMIP6Config *self = NM_IP6_CONFIG (object);
249 NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (self);
250
251 + _nm_object_ensure_inited (NM_OBJECT (object));
252 +
253 switch (prop_id) {
254 case PROP_ADDRESSES:
255 nm_utils_ip6_addresses_to_gvalue (priv->addresses, value);
256 diff --git a/libnm-glib/nm-remote-settings.c b/libnm-glib/nm-remote-settings.c
257 index b6b6c18..70285f1 100644
258 --- a/libnm-glib/nm-remote-settings.c
259 +++ b/libnm-glib/nm-remote-settings.c
260 @@ -1066,6 +1066,8 @@ get_property (GObject *object, guint prop_id,
261 {
262 NMRemoteSettingsPrivate *priv = NM_REMOTE_SETTINGS_GET_PRIVATE (object);
263
264 + _nm_remote_settings_ensure_inited (NM_REMOTE_SETTINGS (object));
265 +
266 switch (prop_id) {
267 case PROP_BUS:
268 g_value_set_boxed (value, priv->bus);
269 diff --git a/libnm-glib/nm-vpn-connection.c b/libnm-glib/nm-vpn-connection.c
270 index 5393421..1fe59e5 100644
271 --- a/libnm-glib/nm-vpn-connection.c
272 +++ b/libnm-glib/nm-vpn-connection.c
273 @@ -211,6 +211,8 @@ get_property (GObject *object,
274 {
275 NMVPNConnection *self = NM_VPN_CONNECTION (object);
276
277 + _nm_object_ensure_inited (NM_OBJECT (object));
278 +
279 switch (prop_id) {
280 case PROP_VPN_STATE:
281 g_value_set_uint (value, nm_vpn_connection_get_vpn_state (self));
282 diff --git a/libnm-glib/nm-wimax-nsp.c b/libnm-glib/nm-wimax-nsp.c
283 index c3b222d..39553ce 100644
284 --- a/libnm-glib/nm-wimax-nsp.c
285 +++ b/libnm-glib/nm-wimax-nsp.c
286 @@ -247,6 +247,8 @@ get_property (GObject *object,
287 {
288 NMWimaxNsp *nsp = NM_WIMAX_NSP (object);
289
290 + _nm_object_ensure_inited (NM_OBJECT (object));
291 +
292 switch (prop_id) {
293 case PROP_NAME:
294 g_value_set_string (value, nm_wimax_nsp_get_name (nsp));
295 --
296 1.7.8.5

  ViewVC Help
Powered by ViewVC 1.1.20