Re: [PATCH] Update Russian translation

2019-09-04 Thread Mikhail Efremov via networkmanager-list
On Wed,  4 Sep 2019 16:41:10 +0300 Mikhail Efremov wrote:
> From: Olesya Gerasimenko 
> 
> ---
>  po/ru.po | 103 ---
>  1 file changed, 52 insertions(+), 51 deletions(-)

This patch for nm-applet. I haven't gitlab.gnome.org so I can't create
pull request.

-- 
WBR, Mikhail Efremov
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH] Update Russian translation

2019-09-04 Thread Mikhail Efremov
From: Olesya Gerasimenko 

---
 po/ru.po | 103 ---
 1 file changed, 52 insertions(+), 51 deletions(-)

diff --git a/po/ru.po b/po/ru.po
index 3f7cc9d3..8aa89138 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -8,23 +8,23 @@
 # Andrey Cherepanov , 2009, 2010.
 # Yuri Myasoedov , 2012, 2013.
 # Stas Solovey , 2011, 2014, 2017.
-# lrintel , 2017. #zanata
+# lrintel , 2017. #zanata.
+# Olesya Gerasimenko , 2019.
 msgid ""
 msgstr ""
 "Project-Id-Version: \n"
-"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/network-manager-";
-"applet/\n"
+"Report-Msgid-Bugs-To: 
https://gitlab.gnome.org/GNOME/network-manager-applet/\n";
 "POT-Creation-Date: 2019-05-29 10:49+0200\n"
-"PO-Revision-Date: 2018-09-12 20:54+0300\n"
-"Last-Translator: Stas Solovey \n"
-"Language-Team: Русский \n"
+"PO-Revision-Date: 2019-08-22 16:07MSK\n"
+"Last-Translator: Olesya Gerasimenko \n"
+"Language-Team: Basealt Translation Team\n"
 "Language: ru\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
-"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
-"X-Generator: Poedit 2.1.1\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<"
+"=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"X-Generator: Lokalize 2.0\n"
 
 #: nm-applet.desktop.in:3 src/applet.c:3196 src/applet-dialogs.c:737
 #: src/libnma/nma-bar-code-widget.c:144
@@ -37,12 +37,11 @@ msgstr "Управление сетевыми соединениями"
 
 #: nm-applet.desktop.in:5
 msgid "nm-device-wireless"
-msgstr ""
+msgstr "nm-device-wireless"
 
 #: nm-connection-editor.desktop.in:3
-#, fuzzy
 msgid "Advanced Network Configuration"
-msgstr "Активные сетевые соединения"
+msgstr "Расширенная конфигурация сети"
 
 #: nm-connection-editor.desktop.in:4
 msgid "Manage and change your network connection settings"
@@ -50,7 +49,7 @@ msgstr "Управление параметрами сетевых соедин
 
 #: nm-connection-editor.desktop.in:5
 msgid "preferences-system-network"
-msgstr ""
+msgstr "preferences-system-network"
 
 #: org.gnome.nm-applet.gschema.xml.in:6
 msgid "Disable connected notifications"
@@ -102,9 +101,8 @@ msgstr ""
 "новую версию."
 
 #: org.gnome.nm-applet.gschema.xml.in:31
-#, fuzzy
 msgid "Disable WiFi Create"
-msgstr "Отключить создание соединения Wi-Fi"
+msgstr "Отключить создание соединений Wi-Fi"
 
 #: org.gnome.nm-applet.gschema.xml.in:32
 msgid ""
@@ -881,18 +879,16 @@ msgid "Subnet Mask"
 msgstr "Маска подсети"
 
 #: src/applet-dialogs.c:440
-#, fuzzy
 msgid "Primary DNS"
-msgstr "_Первичный"
+msgstr "Первичный DNS-сервер"
 
 #: src/applet-dialogs.c:440
-#, fuzzy
 msgid "Secondary DNS"
-msgstr "_Второй пароль:"
+msgstr "Вторичный DNS-сервер"
 
 #: src/applet-dialogs.c:440
 msgid "Tertiary DNS"
-msgstr ""
+msgstr "Третичный DNS-сервер"
 
 #: src/applet-dialogs.c:519
 #, c-format
@@ -940,9 +936,8 @@ msgid "Speed"
 msgstr "Скорость"
 
 #: src/applet-dialogs.c:616
-#, fuzzy
 msgid "Security"
-msgstr "Защита:"
+msgstr "Безопасность"
 
 #. --- IPv4 ---
 #: src/applet-dialogs.c:641 src/applet-dialogs.c:904
@@ -964,9 +959,8 @@ msgid "Hotspot"
 msgstr "Точка доступа"
 
 #: src/applet-dialogs.c:748 src/libnma/nma-bar-code-widget.c:161
-#, fuzzy
 msgid "Password"
-msgstr "Пароль:"
+msgstr "Пароль"
 
 #: src/applet-dialogs.c:878
 msgid "VPN Type"
@@ -1790,6 +1784,11 @@ msgid ""
 "option can only be used for Ethernet interfaces. nm-applet is able to "
 "activate the connection only if this option is selected."
 msgstr ""
+"Если параметр включён, интерфейс будет управляться этим соединением в"
+" монопольном режиме и будет невозможно включить другое соединение. Обратите"
+" внимание, что этот параметр можно использовать только для"
+" Ethernet-интерфейсов. Программа nm-applet может включить соединение только"
+" при условии включения этого параметра."
 
 #: src/connection-editor/ce-page-ethernet.ui:17
 #: src/connection-editor/ce-page-ethernet.ui:77
@@ -1913,7 +1912,7 @@ msgstr ""
 
 #: src/connection-editor/ce-page-ethernet.ui:414
 msgid "Lin_k negotiation"
-msgstr ""
+msgstr "Согласование _ссылок"
 
 #: src/connection-editor/ce-page-ethernet.ui:428
 msgid ""
@@ -1958,7 +1957,7 @@ msgstr ""
 
 #: src/connection-editor/ce-page-general.ui:29
 msgid "Yes"
-msgstr ""
+msgstr "Да"
 
 #: src/connection-editor/ce-page-general.ui:32
 msgid "No"
@@ -1987,6 +1986,11 @@ msgid ""
 "“No”) to indicate to applications, or “Automatic” to use a default value "
 "based on the connection type and other heuristics."
 msgstr ""
+"Служба NetworkManager сообщает приложениям о том, является ли соединение"
+" лимитным, и о необходимости соответственно ограничить трафик данных."
+" Выберите значение («Да» или «Нет»), которое будет сообщаться приложениям,"
+" или установите «Автоматический» режим, чтобы использовать значение по"
+" умолчанию в зависимости от типа соединения и другой эвристики."
 
 #: src/connection-editor/ce-page-general.ui:150
 msgid

Re: [PATCH 1/2] Don't try to use bundled urllib3 in the python-module-request

2017-10-09 Thread Mikhail Efremov
On Mon,  9 Oct 2017 18:11:54 +0300 Mikhail Efremov wrote:

I'm sorry, just ignore this garbige. 
It was sended here by mistake :(.

-- 
WBR, Mikhail Efremov
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH 2/2] Use ipa CA certificate for https checks

2017-10-09 Thread Mikhail Efremov
We don't have ipa CA certificate in the system CA bundle
at the time.
---
 freeipa/ipapython/secrets/client.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/freeipa/ipapython/secrets/client.py 
b/freeipa/ipapython/secrets/client.py
index 83411d7..4fc320c 100644
--- a/freeipa/ipapython/secrets/client.py
+++ b/freeipa/ipapython/secrets/client.py
@@ -88,7 +88,7 @@ class CustodiaClient(object):
 
 # Perform request
 r = requests.get(url, headers=headers,
- params={'type': 'kem', 'value': request})
+ params={'type': 'kem', 'value': request}, 
verify=paths.IPA_CA_CRT)
 r.raise_for_status()
 reply = r.json()
 
-- 
2.10.4

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH 1/2] Don't try to use bundled urllib3 in the python-module-request

2017-10-09 Thread Mikhail Efremov
It doesn't contain urllib3 (ALT patch from Fedora).
---
 freeipa/ipapython/secrets/client.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/freeipa/ipapython/secrets/client.py 
b/freeipa/ipapython/secrets/client.py
index 646ef7e..83411d7 100644
--- a/freeipa/ipapython/secrets/client.py
+++ b/freeipa/ipapython/secrets/client.py
@@ -12,7 +12,7 @@ import ldapurl
 import gssapi
 import os
 import requests
-
+import urllib3
 
 class CustodiaClient(object):
 
@@ -58,7 +58,7 @@ class CustodiaClient(object):
 self.keystore = self._keystore(realm, ldap_uri, auth_type)
 
 # FIXME: Remove warnings about missig subjAltName
-requests.packages.urllib3.disable_warnings()
+urllib3.disable_warnings()
 
 def init_creds(self):
 name = gssapi.Name('host@%s' % (self.client,),
-- 
2.10.4

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [PATCH] connection-editor: Fix handling of wired 802-1x security setting

2016-08-25 Thread Mikhail Efremov
On Thu, 25 Aug 2016 20:46:01 +0300 Mikhail Efremov wrote:
> Function nm_setting_duplicate() can't copy object's data.
> As a result a value of the "Ignore CA certificate" checkbox was
> always lost. So don't copy settings, just use g_object_ref() again
> and remove the 8021x setting from the temporary object to prevent
> the clearing of secrets.
> 
> Fixes: c21d56dd22057103c8125a49307b4ff47b5b644d

This patch based on commit 4eecd6409730b0e03b7cca0e21d2f7f35302965b
by Beniamino Galvani, which fixes the same issue. Definitely my
former patch in the commit c21d56dd22057103c8125a49307b4ff47b5b644d was
wrong. Dunno how I overlooked that state of the "Ignore CA certificate"
checkbox was not saved at the time...

-- 
WBR, Mikhail Efremov
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH] connection-editor: Fix handling of wired 802-1x security setting

2016-08-25 Thread Mikhail Efremov
Function nm_setting_duplicate() can't copy object's data.
As a result a value of the "Ignore CA certificate" checkbox was
always lost. So don't copy settings, just use g_object_ref() again
and remove the 8021x setting from the temporary object to prevent
the clearing of secrets.

Fixes: c21d56dd22057103c8125a49307b4ff47b5b644d
---
 src/connection-editor/page-8021x-security.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/connection-editor/page-8021x-security.c 
b/src/connection-editor/page-8021x-security.c
index 6dad8db..b1904c7 100644
--- a/src/connection-editor/page-8021x-security.c
+++ b/src/connection-editor/page-8021x-security.c
@@ -172,8 +172,12 @@ ce_page_validate_v (CEPage *page, NMConnection 
*connection, GError **error)
ws_802_1x_fill_connection (priv->security, 
"wpa_eap_auth_combo", tmp_connection);
 
s_8021x = nm_connection_get_setting (tmp_connection, 
NM_TYPE_SETTING_802_1X);
-   nm_connection_add_setting (connection, 
nm_setting_duplicate (s_8021x));
+   nm_connection_add_setting (connection, NM_SETTING 
(g_object_ref (s_8021x)));
 
+   /* Remove the 8021x setting to prevent the clearing of 
secrets when the
+* simple-connection is destroyed.
+*/
+   nm_connection_remove_setting (tmp_connection, 
NM_TYPE_SETTING_802_1X);
g_object_unref (tmp_connection);
}
} else {
-- 
2.7.4

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH] connection-editor: Fix wired 802-1x secrets saving

2016-05-26 Thread Mikhail Efremov
In case of wired 802-1x connection a temporary connection object is used,
but since NM commit 6a19e68a7d856629600655a076b0cea4be346799
secrets are cleared when the object is destroyed.
So duplicate 802-1x settings instead of using g_object_ref().
---
 src/connection-editor/page-8021x-security.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/connection-editor/page-8021x-security.c 
b/src/connection-editor/page-8021x-security.c
index 5af6111..afc4e88 100644
--- a/src/connection-editor/page-8021x-security.c
+++ b/src/connection-editor/page-8021x-security.c
@@ -159,7 +159,7 @@ ce_page_validate_v (CEPage *page, NMConnection *connection, 
GError **error)
ws_802_1x_fill_connection (priv->security, 
"wpa_eap_auth_combo", tmp_connection);
 
s_8021x = nm_connection_get_setting (tmp_connection, 
NM_TYPE_SETTING_802_1X);
-   nm_connection_add_setting (connection, NM_SETTING 
(g_object_ref (s_8021x)));
+   nm_connection_add_setting (connection, 
nm_setting_duplicate (s_8021x));
 
g_object_unref (tmp_connection);
}
-- 
2.7.4

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH] nm-pppd-plugin: fix crash

2016-04-13 Thread Mikhail Efremov
A bus name is not an object path.
Fix crash introduced by commit 17ae85788987ef1f7c92a251c535312163144c33.
---
 src/nm-pptp-pppd-plugin.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/nm-pptp-pppd-plugin.c b/src/nm-pptp-pppd-plugin.c
index 2b8c819..4567fcc 100644
--- a/src/nm-pptp-pppd-plugin.c
+++ b/src/nm-pptp-pppd-plugin.c
@@ -318,8 +318,8 @@ plugin_init (void)
proxy = g_dbus_proxy_new_sync (bus,
   
G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
   NULL,
-  NM_DBUS_SERVICE_PPTP_PPP,
   bus_name,
+  NM_DBUS_PATH_PPTP_PPP,
   NM_DBUS_INTERFACE_PPTP_PPP,
   NULL, &err);
g_object_unref (bus);
-- 
2.7.4

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [PATCH] editor: don't show connections for missing device plugins

2016-01-22 Thread Mikhail Efremov
On Fri, 22 Jan 2016 21:51:08 +0300 Mikhail Efremov wrote:
> If device plugin is missing (e.g. not installed) then no use
> to show a connection of this type in the list of connections:
> it can't be used anyway.
> ---
>  src/connection-editor/connection-helpers.c | 43 
> ++
>  1 file changed, 32 insertions(+), 11 deletions(-)

Well, I'm not sure that this patch can be applied in current state.
May be there should be some macros for path to plugins directory and
for plugins names.
Consider this patch as proof-of-concept.

-- 
WBR, Mikhail Efremov
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH] editor: don't show connections for missing device plugins

2016-01-22 Thread Mikhail Efremov
If device plugin is missing (e.g. not installed) then no use
to show a connection of this type in the list of connections:
it can't be used anyway.
---
 src/connection-editor/connection-helpers.c | 43 ++
 1 file changed, 32 insertions(+), 11 deletions(-)

diff --git a/src/connection-editor/connection-helpers.c 
b/src/connection-editor/connection-helpers.c
index ed2cd52..a465328 100644
--- a/src/connection-editor/connection-helpers.c
+++ b/src/connection-editor/connection-helpers.c
@@ -85,6 +85,22 @@ sort_types (gconstpointer a, gconstpointer b)
 #define add_type_data_virtual(a, n, new_func, type0) \
add_type_data_full(a, n, new_func, type0, G_TYPE_INVALID, 
G_TYPE_INVALID, TRUE)
 
+static gboolean
+has_device_plugin (const gchar *name)
+{
+   char *plugin_path;
+   gboolean rc;
+
+   plugin_path = g_strdup_printf 
("%s/NetworkManager/libnm-device-plugin-%s.so", LIBDIR, name);
+
+   g_assert (plugin_path != NULL);
+
+   rc = g_file_test (plugin_path, G_FILE_TEST_EXISTS);
+   g_free (plugin_path);
+
+   return rc;
+}
+
 ConnectionTypeData *
 get_connection_type_list (void)
 {
@@ -97,19 +113,24 @@ get_connection_type_list (void)
array = g_array_new (TRUE, FALSE, sizeof (ConnectionTypeData));
 
add_type_data_real (array, _("Ethernet"), ethernet_connection_new, 
NM_TYPE_SETTING_WIRED);
-   add_type_data_real (array, _("Wi-Fi"), wifi_connection_new, 
NM_TYPE_SETTING_WIRELESS);
-   add_type_data_full (array,
-   _("Mobile Broadband"),
-   mobile_connection_new,
-   NM_TYPE_SETTING_GSM,
-   NM_TYPE_SETTING_CDMA,
-   NM_TYPE_SETTING_BLUETOOTH,
-   FALSE);
-   add_type_data_real (array, _("Bluetooth"), bluetooth_connection_new, 
NM_TYPE_SETTING_BLUETOOTH);
-   add_type_data_real (array, _("DSL"), dsl_connection_new, 
NM_TYPE_SETTING_PPPOE);
+   if (has_device_plugin ("wifi"))
+   add_type_data_real (array, _("Wi-Fi"), wifi_connection_new, 
NM_TYPE_SETTING_WIRELESS);
+   if (has_device_plugin ("wwan"))
+   add_type_data_full (array,
+   _("Mobile Broadband"),
+   mobile_connection_new,
+   NM_TYPE_SETTING_GSM,
+   NM_TYPE_SETTING_CDMA,
+   NM_TYPE_SETTING_BLUETOOTH,
+   FALSE);
+   if (has_device_plugin ("bluetooth"))
+   add_type_data_real (array, _("Bluetooth"), 
bluetooth_connection_new, NM_TYPE_SETTING_BLUETOOTH);
+   if (has_device_plugin ("dsl"))
+   add_type_data_real (array, _("DSL"), dsl_connection_new, 
NM_TYPE_SETTING_PPPOE);
add_type_data_real (array, _("InfiniBand"), infiniband_connection_new, 
NM_TYPE_SETTING_INFINIBAND);
add_type_data_virtual (array, _("Bond"), bond_connection_new, 
NM_TYPE_SETTING_BOND);
-   add_type_data_virtual (array, _("Team"), team_connection_new, 
NM_TYPE_SETTING_TEAM);
+   if (has_device_plugin ("team"))
+   add_type_data_virtual (array, _("Team"), team_connection_new, 
NM_TYPE_SETTING_TEAM);
add_type_data_virtual (array, _("Bridge"), bridge_connection_new, 
NM_TYPE_SETTING_BRIDGE);
add_type_data_virtual (array, _("VLAN"), vlan_connection_new, 
NM_TYPE_SETTING_VLAN);
 
-- 
2.6.5

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [PATCH] configure.ac: Fix macro name

2016-01-22 Thread Mikhail Efremov
On Fri, 22 Jan 2016 17:42:27 +0300 Mikhail Efremov wrote:
> It is GLIB_GSETTINGS, not GLIB_SETTINGS.
> ---
>  configure.ac | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

This patch for network-manager-applet, to fix this error:
./configure: line 14774: GLIB_SETTINGS: command not found

-- 
WBR, Mikhail Efremov
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH] configure.ac: Fix macro name

2016-01-22 Thread Mikhail Efremov
It is GLIB_GSETTINGS, not GLIB_SETTINGS.
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index ee130a4..25a98c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -142,7 +142,7 @@ dnl Check for gobject introspection
 GOBJECT_INTROSPECTION_CHECK([0.9.6])
 
 GLIB_CONFIG_NMA
-GLIB_SETTINGS
+GLIB_GSETTINGS
 
 dnl
 dnl Compiler flags
-- 
2.6.5

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH] Don't generate a connection for unmanaged devices.

2014-03-31 Thread Mikhail Efremov
Hello!

I have a bridge that was created before the start of NM and it
shouldn't be managed by NM. But NM ignores unmanaged specs from a
plugin: device_has_config() always returns TRUE for bridges, so default
connection is generated and NM tries to manage the bridge.
Attached patch fixes this, although I'm not sure that's the right way.

-- 
WBR, Mikhail Efremov
>From d34100c8527b2ab3bd3d8cdcd488d3116e3c3e0b Mon Sep 17 00:00:00 2001
From: Mikhail Efremov 
Date: Mon, 31 Mar 2014 20:29:05 +0400
Subject: [PATCH] Don't generate a connection for unmanaged devices.

---
 src/nm-manager.c | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/nm-manager.c b/src/nm-manager.c
index 48ce061..5a39103 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -1751,6 +1751,7 @@ add_device (NMManager *self, NMDevice *device, gboolean generate_con)
 	char *path;
 	static guint32 devcount = 0;
 	const GSList *unmanaged_specs;
+	gboolean unmanaged = FALSE;
 	NMConnection *connection = NULL;
 	gboolean enabled = FALSE;
 	RfKillType rtype;
@@ -1847,15 +1848,17 @@ add_device (NMManager *self, NMDevice *device, gboolean generate_con)
 	nm_log_info (LOGD_CORE, "(%s): exported as %s", iface, path);
 	g_free (path);
 
+	unmanaged_specs = nm_settings_get_unmanaged_specs (priv->settings);
+	unmanaged = nm_device_spec_match_list (device, unmanaged_specs);
+
 	/* Don't generate a connection e.g. for devices NM just created, or
 	 * for the loopback */
-	if (generate_con)
+	if (generate_con && !unmanaged)
 		connection = get_existing_connection (self, device);
 
 	/* Start the device if it's supposed to be managed */
-	unmanaged_specs = nm_settings_get_unmanaged_specs (priv->settings);
 	if (   !manager_sleeping (self)
-	&& !nm_device_spec_match_list (device, unmanaged_specs)) {
+	&& !unmanaged) {
 		nm_device_set_manager_managed (device,
 		   TRUE,
 		   connection ? NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED :
-- 
1.8.5.5

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Getting NM to re-try DHCP

2011-04-08 Thread Mikhail Efremov
On Sat, 9 Apr 2011 04:01:09 +0400 Mikhail Efremov wrote:
> On Wed, 06 Apr 2011 17:24:44 -0500 Dan Williams wrote:
> > On Tue, 2011-04-05 at 11:37 -0400, Derek Atkins wrote:
> > > Hey all,
> > > 
> > > I have a strange issue.  I lost power last night and one of my
> > > systems came up before my DHCP server did (which is surprising,
> > > because my DHCP server usually comes up pretty quick!)  This
> > > "client" system was supposed to get itself on the network (it has
> > > an auto-logon system). However, NM didn't succeed because my DHCP
> > > server wasn't responding, yet.
> > > 
> > > This is a hard-wired system (not wireless).  Is there any way to
> > > get NM to periodically retry DHCP if at first it does not succeed?
> > > 
> > > I realize that DHCP has its own retry mechanism, but if the whole
> > > process times out, can I set NM to retry every, say, 5 minutes?
> > 
> > We'd need some code changes in NM; basically for wired connections
> > if the activation attempt fails a certain number of times
> > (currently 3) then the connection is marked "invalid".  What
> > probably should happen is that internally, in nm-policy.c, a
> > timeout handler should be scheduled for the connection (using
> > g_timeout_add_seconds()) that triggers after 5 minutes or so and if
> > the connection isn't currently active (ie check the NMManager's
> > active connection list) then the invalid flag is cleared from the
> > connection, which will let it be automatically retried.
> 
> Not on this issue exactly, but this is reminded me about my old patch
> which was written long time ago (it was just forgotten to submit,
> sorry). If cable was unplugged, then when it is replugged this may be
> another network, so NM should try to reconnect even if the connection
> was early marked as "invalid".
> This patch for the NM_0_8 branch, for master it should be remaked, but
> I have no time to do this right now, sorry. And there may be no
> necessary for a separate function to clear the tag.

BTW, I think in the function sleeping_changed() in nm-policy.c should be
called g_object_unref() for all connections,
nm_manager_get_connections() is still refered them in NM-0.8.

-- 
WBR, Mikhail Efremov
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Getting NM to re-try DHCP

2011-04-08 Thread Mikhail Efremov
On Wed, 06 Apr 2011 17:24:44 -0500 Dan Williams wrote:
> On Tue, 2011-04-05 at 11:37 -0400, Derek Atkins wrote:
> > Hey all,
> > 
> > I have a strange issue.  I lost power last night and one of my
> > systems came up before my DHCP server did (which is surprising,
> > because my DHCP server usually comes up pretty quick!)  This
> > "client" system was supposed to get itself on the network (it has
> > an auto-logon system). However, NM didn't succeed because my DHCP
> > server wasn't responding, yet.
> > 
> > This is a hard-wired system (not wireless).  Is there any way to
> > get NM to periodically retry DHCP if at first it does not succeed?
> > 
> > I realize that DHCP has its own retry mechanism, but if the whole
> > process times out, can I set NM to retry every, say, 5 minutes?
> 
> We'd need some code changes in NM; basically for wired connections if
> the activation attempt fails a certain number of times (currently 3)
> then the connection is marked "invalid".  What probably should happen
> is that internally, in nm-policy.c, a timeout handler should be
> scheduled for the connection (using g_timeout_add_seconds()) that
> triggers after 5 minutes or so and if the connection isn't currently
> active (ie check the NMManager's active connection list) then the
> invalid flag is cleared from the connection, which will let it be
> automatically retried.

Not on this issue exactly, but this is reminded me about my old patch
which was written long time ago (it was just forgotten to submit, sorry).
If cable was unplugged, then when it is replugged this may be another
network, so NM should try to reconnect even if the connection was
early marked as "invalid".
This patch for the NM_0_8 branch, for master it should be remaked, but
I have no time to do this right now, sorry. And there may be no
necessary for a separate function to clear the tag.

-- 
WBR, Mikhail Efremov>From 6ec40e1307186128ae4c3a3ada602576d453db13 Mon Sep 17 00:00:00 2001
From: Mikhail Efremov 
Date: Fri, 8 Apr 2011 19:19:54 +0400
Subject: [PATCH] Clear 'invalid' tag when cable is replugged.

---
 src/nm-policy.c |   34 +-
 1 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/src/nm-policy.c b/src/nm-policy.c
index aed2f89..4e0a73f 100644
--- a/src/nm-policy.c
+++ b/src/nm-policy.c
@@ -846,6 +846,33 @@ get_device_connection (NMDevice *device)
 }
 
 static void
+clear_invalid_tag(NMPolicy *policy, NMDevice *device)
+{
+
+	NMConnection *best_connection;
+	char *specific_object = NULL;
+	GSList *connections;
+
+	g_assert (device);
+	g_assert (policy);
+
+	/* System connections first, then user connections */
+	connections = nm_manager_get_connections (policy->manager, NM_CONNECTION_SCOPE_SYSTEM);
+	connections = g_slist_concat (connections, nm_manager_get_connections (policy->manager, NM_CONNECTION_SCOPE_USER));
+
+	if (!connections)
+		return;
+
+	best_connection = nm_device_get_best_auto_connection (device, connections, &specific_object);
+
+	if (best_connection)
+		g_object_set_data (G_OBJECT (best_connection), INVALID_TAG, NULL);
+
+	g_slist_foreach (connections, (GFunc) g_object_unref, NULL);
+	g_slist_free (connections);
+}
+
+static void
 device_state_changed (NMDevice *device,
   NMDeviceState new_state,
   NMDeviceState old_state,
@@ -880,9 +907,14 @@ device_state_changed (NMDevice *device,
 
 		update_routing_and_dns (policy, FALSE);
 		break;
+	case NM_DEVICE_STATE_DISCONNECTED:
+		/* Clear INVALID_TAG when carrier on. If cable was unplugged
+		   and plugged again, we should try to reconnect */
+		if(reason == NM_DEVICE_STATE_REASON_CARRIER &&
+old_state == NM_DEVICE_STATE_UNAVAILABLE)
+			clear_invalid_tag(policy, device);
 	case NM_DEVICE_STATE_UNMANAGED:
 	case NM_DEVICE_STATE_UNAVAILABLE:
-	case NM_DEVICE_STATE_DISCONNECTED:
 		update_routing_and_dns (policy, FALSE);
 		schedule_activate_check (policy, device, 0);
 		break;
-- 
1.7.4.3

___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Anyone having problems with pptp in latest git-head?

2011-04-02 Thread Mikhail Efremov
On Sat, 2 Apr 2011 12:15:35 -0700 (PDT) Eivind Naess wrote:
> Hi,
> I have been trying for some time to get the pptp plugin to work from
> latest tip of the git repository. Apparently, I can enter an password
> in the configuration dialog, but it is not saved so next time I open
> the dialog, the password is set to the value: "(null)". Trying to
> chase this down, is there any pointers to debug this. I have been
> looking through the auth-dialog (nm-pptp-auth-dialog). I know it's
> been executed, but isn't returning the correct password.

I already submitted a patch to fix this issue:
http://mail.gnome.org/archives/networkmanager-list/2011-March/msg00207.html

-- 
WBR, Mikhail Efremov
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH] nm-pptp: Fix password saving/retrieving.

2011-03-24 Thread Mikhail Efremov
On Mon, 14 Mar 2011 20:43:00 +0300 Mikhail Efremov wrote:
> But now it is not works in any case (using pptp plugin as an example,
> NetworkManager, nm-applet and network-manager-pptp are compiled from latest 
> git):
> Checkbox "Available to all users" is not checked:
> # grep -A2 vpn-secrets /etc/NetworkManager/system-connections/pptp-private
> [vpn-secrets]
> password=(null)
> 
> Checkbox "Available to all users" is checked:
> # grep -A2 vpn-secrets /etc/NetworkManager/system-connections/pptp-system-wide
> # 
> So there is no vpn-secrets section in keyfile in that case.

This patch fixes it.

-- 
WBR, Mikhail Efremov>From c0d47a62f2bef3c157bd86f6bae2e44df38aed1b Mon Sep 17 00:00:00 2001
From: Mikhail Efremov 
Date: Wed, 23 Mar 2011 16:46:33 +0300
Subject: [PATCH] Fix password saving/retrieving.

---
 auth-dialog/main.c   |3 ++-
 properties/nm-pptp.c |6 ++
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index da7436e..5045201 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -226,7 +226,8 @@ main (int argc, char *argv[])
 		return 1;
 
 	/* dump the passwords to stdout */
-	printf ("%s\n%s\n", NM_PPTP_KEY_PASSWORD, password);
+	if (password)
+		printf ("%s\n%s\n", NM_PPTP_KEY_PASSWORD, password);
 	printf ("\n\n");
 
 	if (password) {
diff --git a/properties/nm-pptp.c b/properties/nm-pptp.c
index 5f609ba..7bd3cfc 100644
--- a/properties/nm-pptp.c
+++ b/properties/nm-pptp.c
@@ -394,6 +394,12 @@ update_connection (NMVpnPluginUiWidgetInterface *iface,
 	if (str && strlen (str))
 		nm_setting_vpn_add_data_item (s_vpn, NM_PPTP_KEY_DOMAIN, str);
 
+	/* User password */
+	widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "user_password_entry"));
+	str = gtk_entry_get_text (GTK_ENTRY (widget));
+	if (str && strlen (str))
+		nm_setting_vpn_add_secret (s_vpn, NM_PPTP_KEY_PASSWORD, str);
+
 	if (priv->advanced)
 		g_hash_table_foreach (priv->advanced, hash_copy_advanced, s_vpn);
 
-- 
1.7.4.1

___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: ANN: Release of NetworkManager 0.8.996 (0.9.0-beta2)

2011-03-24 Thread Mikhail Efremov
On Wed, 16 Mar 2011 01:49:18 -0500 Dan Williams wrote:
> On Mon, 2011-03-14 at 21:30 +0300, Mikhail Efremov wrote:
> > On Fri, 11 Mar 2011 11:25:20 -0600 Dan Williams wrote:
> > > States are renumbered since there are now 3 connected states (LOCAL,
> > > SITE, GLOBAL) depending on the network connectivity.  There's also a new
> > > DISCONNECTING state that will eventually facilitate Debian's
> > > long-standing request for a "pre-down" event.  There's also space
> > > between the states in case in the future we want to add more without
> > > breaking API.
> > 
> > Thanks for the answer, but I still do not understand why it just does
> > not add the new states at the end of the enum. But since you have
> > already submitted the patches, I think it's too late to change anything.
> 
> Mainly to keep consistency, provide some space for later additions in
> the middle of the list, and to allow clients to use > and < when doing
> comparisons on states.  IE:
> 
> if (state > DISCONNECTED)
> 
> etc.

Because some applications still use the deprecated "StateChange" signal
and should be fixed, then maybe you're right and this is a good reason
to change these values ​​at the same time for more clear and consistent
code in the future.

-- 
WBR, Mikhail Efremov
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: ANN: Release of NetworkManager 0.8.996 (0.9.0-beta2)

2011-03-15 Thread Mikhail Efremov
On Mon, 14 Mar 2011 22:55:19 +0300 Mikhail Efremov wrote:
> On Fri, 11 Mar 2011 20:00:54 -0600 Dan Williams wrote:
> > What other apps are out there that  might be using libnm-glib or talking
> > to NM via D-Bus for network state?
> 
> Claws Mail (http://www.claws-mail.org).
> 
> I have written a patch, but don't tested it yet. After testing I
> will submit it.

http://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=2381

-- 
WBR, Mikhail Efremov
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: ANN: Release of NetworkManager 0.8.996 (0.9.0-beta2)

2011-03-14 Thread Mikhail Efremov
On Fri, 11 Mar 2011 20:00:54 -0600 Dan Williams wrote:
> What other apps are out there that  might be using libnm-glib or talking
> to NM via D-Bus for network state?

Claws Mail (http://www.claws-mail.org).

I have written a patch, but don't tested it yet. After testing I
will submit it.

-- 
WBR, Mikhail Efremov
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: ANN: Release of NetworkManager 0.8.996 (0.9.0-beta2)

2011-03-14 Thread Mikhail Efremov
On Fri, 11 Mar 2011 11:25:20 -0600 Dan Williams wrote:
> States are renumbered since there are now 3 connected states (LOCAL,
> SITE, GLOBAL) depending on the network connectivity.  There's also a new
> DISCONNECTING state that will eventually facilitate Debian's
> long-standing request for a "pre-down" event.  There's also space
> between the states in case in the future we want to add more without
> breaking API.

Thanks for the answer, but I still do not understand why it just does
not add the new states at the end of the enum. But since you have
already submitted the patches, I think it's too late to change anything.

-- 
WBR, Mikhail Efremov
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: ANN: Release of NetworkManager 0.8.996 (0.9.0-beta2)

2011-03-14 Thread Mikhail Efremov
On Fri, 11 Mar 2011 20:09:03 -0600 Dan Williams wrote:
> On Fri, 2011-03-11 at 20:04 +0300, Mikhail Efremov wrote:
> > On Thu, 10 Mar 2011 11:00:43 -0600 Dan Williams wrote:
> > > I've tagged and uploaded 0.8.996 which has a number of fixes:
> > 
> > Could you explain how the secret agent in nm-applet should work?
> > I guess that users' secrets should be stored in some storage like
> > gnome-keyring, but now I see that WPA passphrase (as an example) is
> > written to the file by keyfile plugin as a plain text. Do I misunderstand
> > something or it is just not completed yet?
> 
> At the moment, 0.8 imported connection secrets are marked "agent owned"
> which means that NM will ask nm-applet for those secrets.  New
> connections from the menu default to system-wide and thus the secrets
> are stored in the keyfiles, more closely aligned with what other OSes
> do, for better or worse.  If an applet (nm-applet or
> nm-connection-editor or whatever) wants secrets stored in gnome-keyring
> or in the user's session it can set the secrets flags when it creates
> the connection, or it can modify the flags afterwards via Update().
> 
> This isn't all 100% thought out yet, so suggestions on how to handle
> initial stuff like this, as well as later behavior would be great to
> discuss.  I've thought of various approaches like intelligent defaults
> (VPN connections should default to user-secrets and should be visible
> only to the owner for example) and maybe a right-click menu in editors
> for picking where to store the secrets.
> 
> But I think it's possible to have some intelligent defaults here, and
> those likely include defaulting to system-wide secrets for most types.
> There are clearly more personal secrets: VPN passwords, 802.1x user
> passwords, etc.  

Thanks for the explanation. Defaults to user-secrets for VPN
connections and to system-wide in other cases sounds reasonable for me.
I think at the moment will be enough if secrets for the new VPN
connections which are not marked as system-wide, will be stored in the
gnome-keyring.

But now it is not works in any case (using pptp plugin as an example,
NetworkManager, nm-applet and network-manager-pptp are compiled from latest 
git):
Checkbox "Available to all users" is not checked:
# grep -A2 vpn-secrets /etc/NetworkManager/system-connections/pptp-private
[vpn-secrets]
password=(null)

Checkbox "Available to all users" is checked:
# grep -A2 vpn-secrets /etc/NetworkManager/system-connections/pptp-system-wide
# 
So there is no vpn-secrets section in keyfile in that case.

> But I think it's hard to argue that keeping a WiFi
> passphrase in the user session is worthwhile in most cases...

I thought about this and now think you're right.

-- 
WBR, Mikhail Efremov
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: ANN: Release of NetworkManager 0.8.996 (0.9.0-beta2)

2011-03-11 Thread Mikhail Efremov
On Thu, 10 Mar 2011 11:00:43 -0600 Dan Williams wrote:
> I've tagged and uploaded 0.8.996 which has a number of fixes:

Could you explain how the secret agent in nm-applet should work?
I guess that users' secrets should be stored in some storage like
gnome-keyring, but now I see that WPA passphrase (as an example) is
written to the file by keyfile plugin as a plain text. Do I misunderstand
something or it is just not completed yet?

-- 
WBR, Mikhail Efremov
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH] editor: fix "Available to all users" checkbox initial state.

2011-03-11 Thread Mikhail Efremov
On Fri, 11 Mar 2011 09:49:24 +0100 Michael Biebl wrote:
> the "available to all users" checkbox is also set
> for every connection, even the private ones.

This patch should fix it.

-- 
WBR, Mikhail EfremovFrom 6055b12a8726a631ddc5aa98a131659ba610a3e6 Mon Sep 17 00:00:00 2001
From: Mikhail Efremov 
Date: Fri, 11 Mar 2011 19:05:28 +0300
Subject: [PATCH] editor: fix "Available to all users" checkbox initial state.

---
 src/connection-editor/nm-connection-editor.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/connection-editor/nm-connection-editor.c b/src/connection-editor/nm-connection-editor.c
index de61656..9793eca 100644
--- a/src/connection-editor/nm-connection-editor.c
+++ b/src/connection-editor/nm-connection-editor.c
@@ -461,6 +461,7 @@ populate_connection_ui (NMConnectionEditor *editor)
 	NMSettingConnection *s_con;
 	GtkWidget *name;
 	GtkWidget *autoconnect;
+	gboolean system_connection = TRUE;
 
 	name = GTK_WIDGET (gtk_builder_get_object (editor->builder, "connection_name"));
 	autoconnect = GTK_WIDGET (gtk_builder_get_object (editor->builder, "connection_autoconnect"));
@@ -472,6 +473,9 @@ populate_connection_ui (NMConnectionEditor *editor)
 		gtk_entry_set_text (GTK_ENTRY (name), id);
 		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (autoconnect),
 		  nm_setting_connection_get_autoconnect (s_con));
+
+		if (nm_setting_connection_get_num_permissions (s_con))
+			system_connection = FALSE;
 	} else {
 		gtk_entry_set_text (GTK_ENTRY (name), NULL);
 	}
@@ -481,7 +485,7 @@ populate_connection_ui (NMConnectionEditor *editor)
 
 	g_signal_connect (editor->all_checkbutton, "toggled", G_CALLBACK (all_checkbutton_toggled_cb), editor);
 
-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->all_checkbutton), TRUE);
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->all_checkbutton), system_connection);
 
 	connection_editor_validate (editor);
 }
-- 
1.7.4.1

___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: ANN: Release of NetworkManager 0.8.996 (0.9.0-beta2)

2011-03-11 Thread Mikhail Efremov
On Fri, 11 Mar 2011 14:58:09 +0100 Michael Biebl wrote:
> Am 11.03.2011 14:26, schrieb Mikhail Efremov:
> > On Fri, 11 Mar 2011 10:28:58 +0100 Michael Biebl wrote:
> >> Am 11.03.2011 09:49, schrieb Michael Biebl:
> >>>
> >>> Been testing the 0.8.996 packages. Looking quite ok so far.
> >>>
> >>> Some impressions:
> >>>
> >>
> >> The online/offline (D-Bus) API seems to be broken.
> >> firefox always starts in offline mode now when using
> >> toolkit.networkmanager.disable false
> > 
> > Values of NM states have been changed. See commits ec115ed4 and
> > 11a68133. So all applications which uses that API should be rebuilded.
> > But firefox uses its own hardcoded constants (see
> > toolkit/system/dbus/nsNetworkManagerListener.cpp).
> 
> I don't think NM should break that specific D-Bus API and be backwards 
> compatible.

Yes, I agree with you. I see no reasons to change these values, except
for cosmetic. But maybe Dan will explain why this was done.

-- 
WBR, Mikhail Efremov
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: ANN: Release of NetworkManager 0.8.996 (0.9.0-beta2)

2011-03-11 Thread Mikhail Efremov
On Fri, 11 Mar 2011 10:28:58 +0100 Michael Biebl wrote:
> Am 11.03.2011 09:49, schrieb Michael Biebl:
> > 
> > Been testing the 0.8.996 packages. Looking quite ok so far.
> > 
> > Some impressions:
> > 
> 
> The online/offline (D-Bus) API seems to be broken.
> firefox always starts in offline mode now when using
> toolkit.networkmanager.disable false

Values of NM states have been changed. See commits ec115ed4 and
11a68133. So all applications which uses that API should be rebuilded.
But firefox uses its own hardcoded constants (see
toolkit/system/dbus/nsNetworkManagerListener.cpp).

-- 
WBR, Mikhail Efremov
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: ANN: One the road to 0.9 - release of 0.8.995 (0.9.0-beta1)

2011-03-09 Thread Mikhail Efremov
On Thu, 10 Mar 2011 00:57:46 +0300 Andrey Borzenkov wrote:
> Could you give URL where WiMax SDK that is required can be downloaded?
> Thank you!

http://linuxwimax.org/

-- 
WBR, Mikhail Efremov
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH] Fix notify message about WiFi connection.

2011-03-03 Thread Mikhail Efremov
Hello!

Since commits 2f521e3817b6078ca4e6008d1c0b6167df3c7030 and
ec68a999c69f081b77c38c9c4d322b2cb05d434a the variable 'esc_ssid' in
wireless_device_state_changed() is always NULL.

-- 
WBR, Mikhail Efremov
>From ace8d866aeabed703f201721080bb85f353542b8 Mon Sep 17 00:00:00 2001
From: Mikhail Efremov 
Date: Thu, 3 Mar 2011 18:27:23 +0300
Subject: [PATCH] Fix notify message about WiFi connection.

---
 src/applet-device-wifi.c |   28 
 1 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/src/applet-device-wifi.c b/src/applet-device-wifi.c
index 97a03a5..e9a0d85 100644
--- a/src/applet-device-wifi.c
+++ b/src/applet-device-wifi.c
@@ -211,6 +211,22 @@ is_manufacturer_default_ssid (const GByteArray *ssid)
 	return is_ssid_in_list (ssid, manf_default_ssids);
 }
 
+static char *
+get_ssid_utf8 (NMAccessPoint *ap)
+{
+	char *ssid_utf8 = NULL;
+
+	if (ap) {
+		const GByteArray *ssid;
+
+		ssid = nm_access_point_get_ssid (ap);
+		if (ssid)
+			ssid_utf8 = nm_utils_ssid_to_utf8 (ssid);
+	}
+
+	return ssid_utf8;
+}
+
 /* List known trojan networks that should never be shown to the user */
 static const char *blacklisted_ssids[] = {
 	/* http://www.npr.org/templates/story/story.php?storyId=130451369 */
@@ -1238,10 +1254,11 @@ wireless_device_state_changed (NMDevice *device,
NMDeviceStateReason reason,
NMApplet *applet)
 {
+	NMAccessPoint *new = NULL;
 	char *msg;
 	char *esc_ssid = NULL;
 
-	update_active_ap (device, new_state, applet);
+	new = update_active_ap (device, new_state, applet);
 
 	if (new_state == NM_DEVICE_STATE_DISCONNECTED)
 		queue_avail_access_point_notification (device);
@@ -1249,6 +1266,7 @@ wireless_device_state_changed (NMDevice *device,
 	if (new_state != NM_DEVICE_STATE_ACTIVATED)
 		return;
 
+	esc_ssid = get_ssid_utf8 (new);
 	msg = g_strdup_printf (_("You are now connected to the wireless network '%s'."),
 	   esc_ssid ? esc_ssid : _("(none)"));
 	applet_do_notify_with_pref (applet, _("Connection Established"),
@@ -1272,14 +1290,8 @@ wireless_get_icon (NMDevice *device,
 	char *ssid = NULL;
 
 	ap = g_object_get_data (G_OBJECT (device), ACTIVE_AP_TAG);
-	if (ap) {
-		const GByteArray *tmp;
-
-		tmp = nm_access_point_get_ssid (ap);
-		if (tmp)
-			ssid = nm_utils_ssid_to_utf8 (tmp);
-	}
 
+	ssid = get_ssid_utf8 (ap);
 	if (!ssid)
 		ssid = g_strdup (_("(none)"));
 
-- 
1.7.4.1

___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Network-manager 0.8.992 and wpasupplicant

2011-03-03 Thread Mikhail Efremov
On Thu, 3 Mar 2011 09:02:53 +0100
Marco wrote:

> Hi everybody,
> I was trying to upgrade to network-manager from git (release 0.8.992).
[ skip ]
> I saw there are commits in nm for the new supplicant DBUS api,
> referencing supplicant dbus endpoint on fi.w1.wpa_supplicant1,
> but starting wpa_supplicant (cmpiled from git master) it says that the
> registered name is fi.epitest.hostap.WPASupplicant.
> 
> What am I missing?
> Do I have to configure wpa_supplicant to enable the new dbus api?

You need to compile wpa_supplicant with the new dbus interface support.
Check variable CONFIG_CTRL_IFACE_DBUS_NEW in wpa_supplicant/defconfig.

-- 
WBR, Mikhail Efremov
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH] settings: don't dereference NULL pointer on request removing.

2011-02-28 Thread Mikhail Efremov
Hello!

Function request_free() (nm-agent-manager.c) is registered as a
function for freeing the value for the hash table 'requests'.
But if request was created by request_new_other() then fields
'cancel_callback' and 'authority' were not setted.

-- 
WBR, Mikhail Efremov
>From dca07cb8a4820e9aaad4aaf8d0b78ba7ce92510d Mon Sep 17 00:00:00 2001
From: Mikhail Efremov 
Date: Mon, 28 Feb 2011 19:04:55 +0300
Subject: [PATCH] settings: don't dereference NULL pointer on request removing.

---
 src/settings/nm-agent-manager.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/settings/nm-agent-manager.c b/src/settings/nm-agent-manager.c
index 0ffcfd4..54b7d53 100644
--- a/src/settings/nm-agent-manager.c
+++ b/src/settings/nm-agent-manager.c
@@ -448,7 +448,8 @@ request_free (Request *req)
 	if (req->idle_id)
 		g_source_remove (req->idle_id);
 
-	req->cancel_callback (req);
+	if (req->cancel_callback)
+		req->cancel_callback (req);
 
 	g_slist_free (req->pending);
 	g_slist_free (req->asked);
@@ -459,7 +460,8 @@ request_free (Request *req)
 		g_hash_table_unref (req->existing_secrets);
 	if (req->chain)
 		nm_auth_chain_unref (req->chain);
-	g_object_unref (req->authority);
+	if (req->authority)
+		g_object_unref (req->authority);
 	memset (req, 0, sizeof (Request));
 	g_free (req);
 }
-- 
1.7.4.1

___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [PATCH] test-keyfile: drop dbus stuff.

2010-11-13 Thread Mikhail Efremov
On Fri, 12 Nov 2010 17:20:32 +0300 Mikhail Efremov wrote:
> Just drop drop a dbus stuff. It seems is unused anywhere. And in any
> case it cause segfault if dbus_g_bus_get() returns NULL.

Sorry, I haven't checked up the recent git repository before patch
sending. It has already been done by commit b42e0ceb0.

-- 
WBR, Mikhail Efremov
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH] test-keyfile: drop dbus stuff.

2010-11-12 Thread Mikhail Efremov
Hello!

Just drop drop a dbus stuff. It seems is unused anywhere. And in any
case it cause segfault if dbus_g_bus_get() returns NULL.

-- 
WBR, Mikhail Efremov
>From feb40da3359f8e88d509f49d65a835ee7291066d Mon Sep 17 00:00:00 2001
From: Mikhail Efremov 
Date: Mon, 8 Nov 2010 17:16:18 +0300
Subject: [PATCH] test-keyfile: drop dbus stuff.

---
 .../plugins/keyfile/tests/test-keyfile.c   |5 -
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/system-settings/plugins/keyfile/tests/test-keyfile.c b/system-settings/plugins/keyfile/tests/test-keyfile.c
index 7bf63ef..05131c8 100644
--- a/system-settings/plugins/keyfile/tests/test-keyfile.c
+++ b/system-settings/plugins/keyfile/tests/test-keyfile.c
@@ -27,8 +27,6 @@
 #include 
 #include 
 
-#include 
-
 #include 
 #include 
 #include 
@@ -1989,11 +1987,9 @@ test_write_gsm_connection (void)
 int main (int argc, char **argv)
 {
 	GError *error = NULL;
-	DBusGConnection *bus;
 	char *base;
 
 	g_type_init ();
-	bus = dbus_g_bus_get (DBUS_BUS_SESSION, NULL);
 
 	if (!nm_utils_init (&error))
 		FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message);
@@ -2022,7 +2018,6 @@ int main (int argc, char **argv)
 	base = g_path_get_basename (argv[0]);
 	fprintf (stdout, "%s: SUCCESS\n", base);
 	g_free (base);
-	dbus_g_connection_unref (bus);
 	return 0;
 }
 
-- 
1.7.3.2

___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH] Ensure that dhcp client is exited

2010-11-12 Thread Mikhail Efremov
Hello!

Since NM does not stop dhcp client when it exits, there may persist an
old instance of dhcp client during NM start again and it is not a child
of the current process. So we need to wait until it is actually exited,
otherwise a race condition may occurs, as I noticed in case dhcpcd
4.x.x (the pidfile was removed by exiting old dhcpcd instance).

-- 
WBR, Mikhail Efremov
>From 45e528745f7ec9e6cd4683ffc4bf1e5ee40fc394 Mon Sep 17 00:00:00 2001
From: Mikhail Efremov 
Date: Thu, 11 Nov 2010 20:07:32 +0300
Subject: [PATCH] dhcp: Ensure that dhcp client is exited.

Do not start another dhcp client until existing one
really exited.
---
 src/dhcp-manager/nm-dhcp-client.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c
index 0c7f3d4..3a8b194 100644
--- a/src/dhcp-manager/nm-dhcp-client.c
+++ b/src/dhcp-manager/nm-dhcp-client.c
@@ -156,11 +156,15 @@ stop_process (GPid pid, const char *iface)
 
 		if (ret == -1) {
 			/* Child already exited */
-			if (errno == ECHILD)
+			if (errno == ECHILD) {
+/* Was it really our child and it exited? */
+if (kill (pid, 0) < 0 && errno == ESRCH)
+	break;
+			} else {
+/* Took too long; shoot it in the head */
+i = 0;
 break;
-			/* Took too long; shoot it in the head */
-			i = 0;
-			break;
+			}
 		}
 		g_usleep (G_USEC_PER_SEC / 5);
 	}
-- 
1.7.3.2

___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH] policy: Don't lose hostnames mapped to 127.0.0.1 and ::1

2010-09-22 Thread Mikhail Efremov
If in the line for localhost mapping in /etc/hosts were some another names 
rather then
'localhost' and 'localhost.localdomain' they were lost.
This patch add those additional names to /etc/hosts as separate line.

___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH] policy: Don't lose hostnames mapped to 127.0.0.1 and ::1

2010-09-22 Thread Mikhail Efremov
---
 src/nm-policy-hosts.c |   54 +++-
 1 files changed, 44 insertions(+), 10 deletions(-)

diff --git a/src/nm-policy-hosts.c b/src/nm-policy-hosts.c
index 0403b03..e7d20bd 100644
--- a/src/nm-policy-hosts.c
+++ b/src/nm-policy-hosts.c
@@ -63,6 +63,41 @@ is_local_mapping (const char *str, gboolean ip6, const char 
*hostname)
&& nm_policy_hosts_find_token (str, hostname ? hostname : 
fallback));
 }
 
+static void
+add_local_mapping (GString *contents, const char *line, gboolean ip6,
+const char *fallback, const char *hostname, const char *short_hostname)
+{
+   const char *addr = ip6 ? "::1" : "127.0.0.1";
+   const char *short_fallback = ip6 ? "localhost6" : "localhost";
+   const char *start, *p;
+   gboolean add_line = FALSE;
+
+   start = line + strlen (addr);
+   p = start;
+   /* Walk through the line to find the next whitespace character */
+   while (p <= line + strlen (line)) {
+   if (isblank (*p) || (*p == '\0')) {
+   if ((p > start) && *start &&
+   /* Skip fallback and hostname tokens */
+   strncmp (start, short_fallback, p - 
start) &&
+   (!fallback || strncmp (start, fallback, 
p - start)) &&
+   (!short_hostname || strncmp (start, 
short_hostname, p - start)) &&
+   (!hostname || strncmp (start, hostname, 
p - start))) {
+   if (!add_line) {
+   g_string_append (contents, addr);
+   add_line = TRUE;
+   }
+   g_string_append_c (contents, '\t');
+   g_string_append_len (contents, start, p - 
start);
+   }
+   start = p + 1;
+   }
+   p++;
+   }
+   if (add_line)
+   g_string_append_c (contents, '\n');
+}
+
 static gboolean
 ip4_addr_matches (const char *str, const char *ip4_addr)
 {
@@ -283,18 +318,17 @@ nm_policy_get_etc_hosts (const char **lines,
}
 
/* Don't add the original line if it is a localhost mapping */
-   if (is_local_mapping (*line, FALSE, "localhost"))
-   add_line = FALSE;
-   else if (is_local_mapping (*line, FALSE, fallback_hostname4))
+   if (is_local_mapping (*line, FALSE, "localhost") ||
+   is_local_mapping (*line, FALSE, 
fallback_hostname4) ||
+   is_local_mapping (*line, FALSE, hostname)) {
+   add_local_mapping (contents, *line, FALSE, 
fallback_hostname4, hostname, short_hostname);
add_line = FALSE;
-   else if (is_local_mapping (*line, FALSE, hostname))
-   add_line = FALSE;
-   else if (is_local_mapping (*line, TRUE, "localhost6"))
-   add_line = FALSE;
-   else if (is_local_mapping (*line, TRUE, fallback_hostname6))
-   add_line = FALSE;
-   else if (is_local_mapping (*line, TRUE, hostname))
+   } else if (is_local_mapping (*line, TRUE, "localhost6") ||
+   is_local_mapping (*line, TRUE, 
fallback_hostname6) ||
+   is_local_mapping (*line, TRUE, hostname)) {
+   add_local_mapping (contents, *line, TRUE, 
fallback_hostname6, hostname, short_hostname);
add_line = FALSE;
+   }
 
if (add_line && !strstr (*line, ADDED_TAG)) {
g_string_append (contents, *line);
-- 
1.7.2.3

___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH] fix self-inheritance of NMDHCPDhcpcd

2010-04-29 Thread Mikhail Efremov
From: Mikhail Efremov 

---
 src/dhcp-manager/nm-dhcp-dhcpcd.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.c 
b/src/dhcp-manager/nm-dhcp-dhcpcd.c
index 56b7481..7169493 100644
--- a/src/dhcp-manager/nm-dhcp-dhcpcd.c
+++ b/src/dhcp-manager/nm-dhcp-dhcpcd.c
@@ -36,7 +36,7 @@
 #include "nm-utils.h"
 #include "nm-logging.h"
 
-G_DEFINE_TYPE (NMDHCPDhcpcd, nm_dhcp_dhcpcd, NM_TYPE_DHCP_DHCPCD)
+G_DEFINE_TYPE (NMDHCPDhcpcd, nm_dhcp_dhcpcd, NM_TYPE_DHCP_CLIENT)
 
 #define NM_DHCP_DHCPCD_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), 
NM_TYPE_DHCP_DHCPCD, NMDHCPDhcpcdPrivate))
 
-- 
1.7.0.4

___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH] nm-applet: Restore PEAP settings

2009-07-27 Thread Mikhail Efremov
Hello!

Based on code in other eap-method-*.c

-- 
WBR, Mikhail Efremov
diff --git a/src/wireless-security/eap-method-peap.c b/src/wireless-security/eap-method-peap.c
index d9f4f46..f0cacef 100644
--- a/src/wireless-security/eap-method-peap.c
+++ b/src/wireless-security/eap-method-peap.c
@@ -209,7 +209,8 @@ inner_auth_combo_changed_cb (GtkWidget *combo, gpointer user_data)
 static GtkWidget *
 inner_auth_combo_init (EAPMethodPEAP *method,
const char *glade_file,
-   NMConnection *connection)
+   NMConnection *connection,
+   NMSetting8021x *s_8021x)
 {
 	GladeXML *xml = EAP_METHOD (method)->xml;
 	GtkWidget *combo;
@@ -217,9 +218,18 @@ inner_auth_combo_init (EAPMethodPEAP *method,
 	GtkTreeIter iter;
 	EAPMethodSimple *em_mschap_v2;
 	EAPMethodSimple *em_md5;
+	guint32 active = 0;
+	const char *phase2_auth = NULL;
 
 	auth_model = gtk_list_store_new (2, G_TYPE_STRING, eap_method_get_g_type ());
 
+	if (s_8021x) {
+		if (nm_setting_802_1x_get_phase2_auth (s_8021x))
+			phase2_auth = nm_setting_802_1x_get_phase2_auth (s_8021x);
+		else if (nm_setting_802_1x_get_phase2_autheap (s_8021x))
+			phase2_auth = nm_setting_802_1x_get_phase2_autheap (s_8021x);
+	}
+
 	em_mschap_v2 = eap_method_simple_new (glade_file,
 	  method->sec_parent,
 	  connection,
@@ -231,6 +241,10 @@ inner_auth_combo_init (EAPMethodPEAP *method,
 	-1);
 	eap_method_unref (EAP_METHOD (em_mschap_v2));
 
+	/* Check for defaulting to MSCHAPv2 */
+	if (phase2_auth && !strcasecmp (phase2_auth, "mschapv2"))
+		active = 0;
+
 	em_md5 = eap_method_simple_new (glade_file,
 	 method->sec_parent,
 	 connection,
@@ -242,12 +256,16 @@ inner_auth_combo_init (EAPMethodPEAP *method,
 	-1);
 	eap_method_unref (EAP_METHOD (em_md5));
 
+	/* Check for defaulting to MD5 */
+	if (phase2_auth && !strcasecmp (phase2_auth, "md5"))
+		active = 1;
+
 	combo = glade_xml_get_widget (xml, "eap_peap_inner_auth_combo");
 	g_assert (combo);
 
 	gtk_combo_box_set_model (GTK_COMBO_BOX (combo), GTK_TREE_MODEL (auth_model));
 	g_object_unref (G_OBJECT (auth_model));
-	gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
+	gtk_combo_box_set_active (GTK_COMBO_BOX (combo), active);
 
 	g_signal_connect (G_OBJECT (combo), "changed",
 	  (GCallback) inner_auth_combo_changed_cb,
@@ -320,7 +338,7 @@ eap_method_peap_new (const char *glade_file,
 			gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget), filename);
 	}
 
-	widget = inner_auth_combo_init (method, glade_file, connection);
+	widget = inner_auth_combo_init (method, glade_file, connection, s_8021x);
 	inner_auth_combo_changed_cb (widget, (gpointer) method);
 
 	widget = glade_xml_get_widget (xml, "eap_peap_version_combo");
___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH] nm-applet: wrong index in eap-method-ttls.c

2009-07-27 Thread Mikhail Efremov
Hello!

CHAP method has index 3, not 4.

-- 
WBR, Mikhail Efremov
diff --git a/src/wireless-security/eap-method-ttls.c b/src/wireless-security/eap-method-ttls.c
index 78d0f80..043a0e8 100644
--- a/src/wireless-security/eap-method-ttls.c
+++ b/src/wireless-security/eap-method-ttls.c
@@ -272,7 +272,7 @@ inner_auth_combo_init (EAPMethodTTLS *method,
 
 	/* Check for defaulting to CHAP */
 	if (phase2_auth && !strcasecmp (phase2_auth, "chap"))
-		active = 4;
+		active = 3;
 
 	combo = glade_xml_get_widget (xml, "eap_ttls_inner_auth_combo");
 	g_assert (combo);
___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH] mobile wizard segfault

2009-07-16 Thread Mikhail Efremov
Hello!

If to select "My plan is not listed" on page "Choose your Billing Plan"
and to type own APN, then segfault occurs when "Forward" button is
pressed. This patch solves this problem.

-- 
WBR, Mikhail Efremov
diff --git a/src/utils/mobile-wizard.c b/src/utils/mobile-wizard.c
index 0045283..147a926 100644
--- a/src/utils/mobile-wizard.c
+++ b/src/utils/mobile-wizard.c
@@ -316,7 +316,8 @@ confirm_prepare (MobileWizard *self)
 			gtk_label_set_text (GTK_LABEL (self->confirm_plan), _("Unlisted"));
 
 		str = g_string_new (NULL);
-		g_string_append_printf (str, "APN: %s", method->gsm_apn);
+		g_string_append_printf (str, "APN: %s",
+method ? method->gsm_apn : gtk_entry_get_text (GTK_ENTRY (self->plan_unlisted_entry)));
 		gtk_label_set_markup (GTK_LABEL (self->confirm_apn), str->str);
 		g_string_free (str, TRUE);
 	}
___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH] mobile wizard segfault

2009-07-16 Thread Mikhail Efremov
Hello!

If to select "My plan is not listed" on page "Choose your Billing Plan"
and to type own APN, then segfault occurs when "Forward" button is
pressed. This patch solves this problem.

-- 
WBR, Mikhail Efremov
diff --git a/src/utils/mobile-wizard.c b/src/utils/mobile-wizard.c
index 0045283..147a926 100644
--- a/src/utils/mobile-wizard.c
+++ b/src/utils/mobile-wizard.c
@@ -316,7 +316,8 @@ confirm_prepare (MobileWizard *self)
 			gtk_label_set_text (GTK_LABEL (self->confirm_plan), _("Unlisted"));
 
 		str = g_string_new (NULL);
-		g_string_append_printf (str, "APN: %s", method->gsm_apn);
+		g_string_append_printf (str, "APN: %s",
+method ? method->gsm_apn : gtk_entry_get_text (GTK_ENTRY (self->plan_unlisted_entry)));
 		gtk_label_set_markup (GTK_LABEL (self->confirm_apn), str->str);
 		g_string_free (str, TRUE);
 	}
___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: NM-0.7.1rc1 fails to build with --as-needed

2009-02-27 Thread Mikhail Efremov
Hello!
On Friday 27 February 2009 17:14:34 you wrote:
> On Fri, Feb 27, 2009 at 3:32 PM, Mikhail Efremov  wrote:
> > On Friday 27 February 2009 15:03:49 Victor Ashirov wrote:
> >> > Does the following patch work better?
> >>
> >> No. It gives the same error.
> >
> > Try attached patch.
>
> NM from git compiles fine except for tests. NM-0.7.1rc1 and rc2 still fail.

Did you run autoreconf && ./configure before compiling?

-- 
WBR, Mikhail Efremov
___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: NM-0.7.1rc1 fails to build with --as-needed

2009-02-27 Thread Mikhail Efremov
On Friday 27 February 2009 15:03:49 Victor Ashirov wrote:
>
> > Does the following patch work better?
>
> No. It gives the same error.

Try attached patch.

-- 
WBR, Mikhail Efremov
diff --git a/system-settings/plugins/keyfile/tests/Makefile.am b/system-settings/plugins/keyfile/tests/Makefile.am
index 6d8666c..5f2ab72 100644
--- a/system-settings/plugins/keyfile/tests/Makefile.am
+++ b/system-settings/plugins/keyfile/tests/Makefile.am
@@ -19,9 +19,9 @@ test_keyfile_CPPFLAGS = \
 
 test_keyfile_LDADD = \
 	$(DBUS_LIBS) \
+	$(top_builddir)/system-settings/plugins/keyfile/io/libkeyfile-io.la \
 	$(top_builddir)/libnm-glib/libnm_glib.la \
-	$(top_builddir)/libnm-util/libnm-util.la \
-	$(top_builddir)/system-settings/plugins/keyfile/io/libkeyfile-io.la
+	$(top_builddir)/libnm-util/libnm-util.la 
 
 if WITH_TESTS
 
___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list