From d0ec39e66dd16d2bfe518a9e1ae39278e4bc9e06 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 20 May 2010 00:22:56 -0700 Subject: nm-online: print warnings not critical errors (rh #593677) Otherwise we'll segfault if critical errors are set to abort. --- test/nm-online.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/nm-online.c b/test/nm-online.c index 3827c74690..27bf1789fb 100644 --- a/test/nm-online.c +++ b/test/nm-online.c @@ -153,7 +153,7 @@ int main (int argc, char *argv[]) g_option_context_free (opt_ctx); if (!success) { - g_error ("Invalid option. Please use --help to see a list of valid options."); + g_warning ("Invalid option. Please use --help to see a list of valid options."); return 2; } @@ -162,7 +162,7 @@ int main (int argc, char *argv[]) else timeout.value = 30; if (timeout.value < 0 || timeout.value > 3600) { - g_error ("Invalid option. Please use --help to see a list of valid options."); + g_warning ("Invalid option. Please use --help to see a list of valid options."); return 2; } -- cgit v1.2.1 From a729d2f649fefc77fcff7ad250c5c403a4dd59b7 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 20 May 2010 10:24:13 -0700 Subject: ip6: remove standalone DHCP method since DHCPv6 can't provide gateways All IPv6 enabled sites are expected to provide router advertisement support apparently. If standalone DHCP is really used in the wild then we can clearly re-enable it later. --- libnm-util/nm-setting-ip6-config.c | 71 ++++++++++++++----------------- libnm-util/nm-setting-ip6-config.h | 1 - src/nm-device.c | 10 +---- system-settings/plugins/ifcfg-rh/reader.c | 5 +-- system-settings/plugins/ifcfg-rh/writer.c | 4 -- 5 files changed, 35 insertions(+), 56 deletions(-) diff --git a/libnm-util/nm-setting-ip6-config.c b/libnm-util/nm-setting-ip6-config.c index e8af058041..32c3a4a2a2 100644 --- a/libnm-util/nm-setting-ip6-config.c +++ b/libnm-util/nm-setting-ip6-config.c @@ -471,8 +471,7 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) NM_SETTING_IP6_CONFIG_ADDRESSES); return FALSE; } - } else if ( !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_AUTO) - || !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) { + } else if (!strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) { /* nothing to do */ } else { g_set_error (error, @@ -613,34 +612,30 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class) * NMSettingIP6Config:method: * * IPv6 configuration method. If 'auto' is specified then the appropriate - * automatic method (DHCP, PPP, advertisement, etc) is used for the - * interface and most other properties can be left unset. To force the use - * of DHCP only, specify 'dhcp'; this method is only valid for ethernet- - * based hardware. If 'link-local' is specified, then an IPv6 link-local - * address will be assigned to the interface. If 'manual' is specified, - * static IP addressing is used and at least one IP address must be given - * in the 'addresses' property. If 'ignored' is specified, IPv6 - * configuration is not done. This property must be set. NOTE: the 'shared' - * method are not yet supported. + * automatic method (DHCP, PPP, router advertisement, etc) is used for the + * interface and most other properties can be left unset. If 'link-local' + * is specified, then an IPv6 link-local address will be assigned to the + * interface. If 'manual' is specified, static IP addressing is used and + * at least one IP address must be given in the 'addresses' property. If + * 'ignored' is specified, IPv6 configuration is not done. This property + * must be set. NOTE: the 'shared' method are not yet supported. **/ g_object_class_install_property (object_class, PROP_METHOD, g_param_spec_string (NM_SETTING_IP6_CONFIG_METHOD, "Method", "IPv6 configuration method. If 'auto' is specified " - "then the appropriate automatic method (PPP, router " - "advertisement, etc) is used for the device and " - "most other properties can be left unset. To force " - "the use of DHCP only, specify 'dhcp'; this method " - "is only valid for ethernet-based hardware. If " - "'link-local' is specified, then an IPv6 link-local " - "address will be assigned to the interface. If " - "'manual' is specified, static IP addressing is " - "used and at least one IP address must be given in " - " the 'addresses' property. If 'ignored' is " - "specified, IPv6 configuration is not done. This " - "property must be set. NOTE: the 'shared' method" - "is not yet supported.", + "then the appropriate automatic method (DHCP, PPP, " + "router advertisement, etc) is used for the " + "interface and most other properties can be left " + "unset. If 'link-local' is specified, then an " + "IPv6 link-local address will be assigned to the " + "interface. If 'manual' is specified, static IP " + "addressing is used and at least one IP address " + "must be given in the 'addresses' property. If " + "'ignored' is specified, IPv6 configuration is not " + "done. This property must be set. NOTE: the " + "'shared' method are not yet supported.", NULL, G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); @@ -766,26 +761,26 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class) /** * NMSettingIP6Config:ignore-auto-routes: * - * When the method is set to 'auto' or 'dhcp' and this property is set to - * TRUE, automatically configured routes are ignored and only routes - * specified in #NMSettingIP6Config:routes, if any, are used. + * When the method is set to 'auto' and this property is set to TRUE, + * automatically configured routes are ignored and only routes specified + * in #NMSettingIP6Config:routes, if any, are used. **/ g_object_class_install_property (object_class, PROP_IGNORE_AUTO_ROUTES, g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES, "Ignore automatic routes", - "When the method is set to 'auto' or 'dhcp' and this " - "property is set to TRUE, automatically configured " - "routes are ignored and only routes specified in the " - "'routes' property, if any, are used.", + "When the method is set to 'auto' and this property " + "is set to TRUE, automatically configured routes are " + "ignored and only routes specified in the 'routes' " + "property, if any, are used.", FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); /** * NMSettingIP6Config:ignore-auto-dns: * - * When the method is set to 'auto' or 'dhcp' and this property is set to - * TRUE, automatically configured nameservers and search domains are ignored + * When the method is set to 'auto' and this property is set to TRUE, + * automatically configured nameservers and search domains are ignored * and only nameservers and search domains specified in * #NMSettingIP6Config:dns and #NMSettingIP6Config:dns-search, if any, are * used. @@ -794,11 +789,11 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class) (object_class, PROP_IGNORE_AUTO_DNS, g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS, "Ignore DHCPv6/RDNSS DNS", - "When the method is set to 'auto' or 'dhcp' and this " - "property is set to TRUE, automatically configured " - "nameservers and search domains are ignored and only " - "nameservers and search domains specified in the 'dns' " - "and 'dns-search' properties, if any, are used.", + "When the method is set to 'auto' and this property " + "is set to TRUE, automatically configured nameservers " + "and search domains are ignored and only nameservers " + "and search domains specified in 'dns' and 'dns-search' " + "properties, if any, are used.", FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); diff --git a/libnm-util/nm-setting-ip6-config.h b/libnm-util/nm-setting-ip6-config.h index e3e286e684..06e5c5c18f 100644 --- a/libnm-util/nm-setting-ip6-config.h +++ b/libnm-util/nm-setting-ip6-config.h @@ -66,7 +66,6 @@ GQuark nm_setting_ip6_config_error_quark (void); #define NM_SETTING_IP6_CONFIG_METHOD_IGNORE "ignore" #define NM_SETTING_IP6_CONFIG_METHOD_AUTO "auto" -#define NM_SETTING_IP6_CONFIG_METHOD_DHCP "dhcp" #define NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL "link-local" #define NM_SETTING_IP6_CONFIG_METHOD_MANUAL "manual" #define NM_SETTING_IP6_CONFIG_METHOD_SHARED "shared" diff --git a/src/nm-device.c b/src/nm-device.c index 7d9913d478..a6ad3be581 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -1648,13 +1648,6 @@ real_act_stage3_ip6_config_start (NMDevice *self, NMDeviceStateReason *reason) } nm_ip6_manager_begin_addrconf (priv->ip6_manager, nm_device_get_ip_ifindex (self)); ret = NM_ACT_STAGE_RETURN_POSTPONE; - } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) { - /* Router advertisements shouldn't be used in pure DHCP mode */ - if (priv->ip6_accept_ra_path) - nm_utils_do_sysctl (priv->ip6_accept_ra_path, "0\n"); - - priv->dhcp6_mode = IP6_DHCP_OPT_MANAGED; - ret = dhcp6_start (self, connection, priv->dhcp6_mode, reason); } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) { /* reset the saved RA value when ipv6 is ignored */ if (priv->ip6_accept_ra_path) { @@ -2108,8 +2101,7 @@ real_act_stage4_get_ip6_config (NMDevice *self, *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; goto out; } - } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) - g_assert (priv->dhcp6_client); /* sanity check */ + } /* Autoconf might have triggered DHCPv6 too */ if (priv->dhcp6_client) { diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index 28244206a9..a084d30b16 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -1389,7 +1389,7 @@ make_ip6_setting (shvarFile *ifcfg, char *value = NULL; char *str_value; char *route6_path = NULL; - gboolean bool_value, ipv6forwarding, ipv6_autoconf, dhcp6 = FALSE; + gboolean bool_value, ipv6forwarding, ipv6_autoconf; char *method = NM_SETTING_IP6_CONFIG_METHOD_MANUAL; guint32 i; shvarFile *network_ifcfg; @@ -1466,12 +1466,9 @@ make_ip6_setting (shvarFile *ifcfg, /* Find out method property */ ipv6forwarding = svTrueValue (ifcfg, "IPV6FORWARDING", FALSE); ipv6_autoconf = svTrueValue (ifcfg, "IPV6_AUTOCONF", !ipv6forwarding); - dhcp6 = svTrueValue (ifcfg, "DHCPV6C", FALSE); if (ipv6_autoconf) method = NM_SETTING_IP6_CONFIG_METHOD_AUTO; - else if (dhcp6) - method = NM_SETTING_IP6_CONFIG_METHOD_DHCP; else { /* IPV6_AUTOCONF=no and no IPv6 address -> method 'link-local' */ str_value = svGetValue (ifcfg, "IPV6ADDR", FALSE); diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c index 30ef6e3941..de69e0039e 100644 --- a/system-settings/plugins/ifcfg-rh/writer.c +++ b/system-settings/plugins/ifcfg-rh/writer.c @@ -1271,10 +1271,6 @@ write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); svSetValue (ifcfg, "IPV6_AUTOCONF", "yes", FALSE); svSetValue (ifcfg, "DHCPV6C", NULL, FALSE); - } else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) { - svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); - svSetValue (ifcfg, "IPV6_AUTOCONF", "no", FALSE); - svSetValue (ifcfg, "DHCPV6C", "yes", FALSE); } else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); svSetValue (ifcfg, "IPV6_AUTOCONF", "no", FALSE); -- cgit v1.2.1 From 63404b0877c4d337d3f550f976442a4d5a5995c7 Mon Sep 17 00:00:00 2001 From: Runa Bhattacharjee Date: Thu, 20 May 2010 18:48:18 -0700 Subject: po: updated Bengali translation (rh #589230) --- po/bn_IN.po | 1144 +++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 720 insertions(+), 424 deletions(-) diff --git a/po/bn_IN.po b/po/bn_IN.po index 602ba3fa0c..f6c295c975 100644 --- a/po/bn_IN.po +++ b/po/bn_IN.po @@ -1,4 +1,4 @@ -# translation of NetworkManager.master.po to Bengali INDIA +# translation of bn_IN.po to Bengali INDIA # Bengali (India) translation of NetworkManager. # Copyright (C) 2009 NetworkManager's COPYRIGHT HOLDER # This file is distributed under the same license as the NetworkManager package. @@ -6,10 +6,10 @@ # Runa Bhattacharjee , 2009, 2010. msgid "" msgstr "" -"Project-Id-Version: NetworkManager.master\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-04-30 03:24+0000\n" -"PO-Revision-Date: 2010-05-07 11:04+0530\n" +"Project-Id-Version: bn_IN\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 10:43+0530\n" "Last-Translator: Runa Bhattacharjee \n" "Language-Team: Bengali INDIA \n" "MIME-Version: 1.0\n" @@ -18,7 +18,76 @@ msgstr "" "X-Generator: KBabel 1.11.4\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../cli/src/connections.c:86 +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -39,310 +108,514 @@ msgstr "" "]\n" " down id | uuid \n" -#: ../cli/src/connections.c:158 -msgid "Connections" -msgstr "সংযোগ" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/devices.c:298 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "Type" -msgstr "ধরন" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "UUID" -msgstr "UUID" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Name" -msgstr "নাম" - -#: ../cli/src/connections.c:163 +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 #, c-format -msgid "System connections:\n" -msgstr "সিস্টেমের সংযোগ:\n" +msgid "Error: 'con list': %s" +msgstr "ত্রুটি: 'con list': %s" -#: ../cli/src/connections.c:167 +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 #, c-format -msgid "User connections:\n" -msgstr "ব্যবহারকারীর সংযোগ:\n" +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "ত্রুটি: 'con list': %s; অনুমোদিত ক্ষেত্র: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "সংযোগ সংক্রান্ত বিবরণ" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "সিস্টেম" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "ব্যবহারকারী" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "কখনো নয়" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "হ্যাঁ" -#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 -#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 -#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 -#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 -#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "না" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "সিস্টেমের সংযোগ" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "ব্যবহারকারীর সংযোগ" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 #, c-format msgid "Error: %s argument is missing." msgstr "ত্রুটি: %s আর্গুমেন্ট অনুপস্থিত।" -#: ../cli/src/connections.c:189 +#: ../cli/src/connections.c:487 #, c-format msgid "Error: %s - no such connection." msgstr "ত্রুটি: %s - এই ধরনের কোনো সংযোগ উপস্থিত নেই।" -#: ../cli/src/connections.c:196 -msgid "System-wide connections" -msgstr "সিস্টেম ব্যাপী সংযোগ" - -#: ../cli/src/connections.c:205 -msgid "User connections" -msgstr "ব্যবহারকারীর সংযোগ" - -#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 -#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 -#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 -#: ../cli/src/devices.c:798 +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 #, c-format msgid "Unknown parameter: %s\n" msgstr "অজানা পরামিতি: %s\n" -#: ../cli/src/connections.c:221 +#: ../cli/src/connections.c:528 #, c-format msgid "Error: no valid parameter specified." msgstr "ত্রুটি: বৈধ পরামিতি উল্লেখ করা যায়নি।" -#. FIXME: Fix the output -#: ../cli/src/connections.c:268 ../cli/src/devices.c:302 -#: ../cli/src/devices.c:321 ../cli/src/devices.c:353 ../cli/src/devices.c:355 -#: ../cli/src/devices.c:357 ../cli/src/devices.c:359 ../cli/src/devices.c:361 -msgid "yes" -msgstr "হ্যাঁ" +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "ত্রুটি: %s।" -#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 -msgid "no" -msgstr "না" +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "ত্রুটি: 'con status': %s" -#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "ত্রুটি: 'con status': %s; অনুমোদিত ক্ষেত্র: %s" + +#: ../cli/src/connections.c:658 msgid "Active connections" msgstr "সক্রিয় সংযোগ" -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 -msgid "Default" -msgstr "ডিফল্ট" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Service" -msgstr "পরিসেবা" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Devices" -msgstr "ডিভাইস" - -#: ../cli/src/connections.c:659 +#: ../cli/src/connections.c:1026 #, c-format msgid "no active connection on device '%s'" msgstr "'%s' ডিভাইসের মধ্যে কোনো সক্রিয় সংযোগ উপস্থিত নেই" -#: ../cli/src/connections.c:667 +#: ../cli/src/connections.c:1034 #, c-format msgid "no active connection or device" msgstr "কোনো সক্রিয় সংযোগ অথবা ডিভাইস উপস্থিত নেই" -#: ../cli/src/connections.c:730 +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "'%s' ডিভাইসের সাথে '%s' সংযোগটি সুসংগত নয়" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "'%s' সংযোগের জন্য কোনো ডিভাইস পাওয়া যায়নি" + +#: ../cli/src/connections.c:1097 msgid "activating" msgstr "সক্রিয় করা হচ্ছে" -#: ../cli/src/connections.c:732 +#: ../cli/src/connections.c:1099 msgid "activated" msgstr "সক্রিয় করা হয়েছে" -#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 -#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 -#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 msgid "unknown" msgstr "অজানা" -#: ../cli/src/connections.c:744 +#: ../cli/src/connections.c:1111 msgid "VPN connecting (prepare)" msgstr "VPN সংযোগ স্থাপন করা হচ্ছে (প্রস্তুতি)" -#: ../cli/src/connections.c:746 +#: ../cli/src/connections.c:1113 msgid "VPN connecting (need authentication)" msgstr "VPN সংযোগ স্থাপন করা হচ্ছে (অনুমোদন প্রয়োজন)" -#: ../cli/src/connections.c:748 +#: ../cli/src/connections.c:1115 msgid "VPN connecting" msgstr "VPN সংযোগ স্থাপন করা হচ্ছে" -#: ../cli/src/connections.c:750 +#: ../cli/src/connections.c:1117 msgid "VPN connecting (getting IP configuration)" msgstr "VPN সংযোগ স্থাপন করা হচ্ছে (IP কনফিগারেশন প্রাপ্ত করা হচ্ছে)" -#: ../cli/src/connections.c:752 +#: ../cli/src/connections.c:1119 msgid "VPN connected" msgstr "VPN সংযোগ স্থাপন করা হয়েছে" -#: ../cli/src/connections.c:754 +#: ../cli/src/connections.c:1121 msgid "VPN connection failed" msgstr "VPN সংযোগ বিফল হয়েছে" -#: ../cli/src/connections.c:756 +#: ../cli/src/connections.c:1123 msgid "VPN disconnected" msgstr "VPN সংযোগ বিচ্ছিন্ন করা হয়েছে" -#: ../cli/src/connections.c:767 +#: ../cli/src/connections.c:1134 msgid "unknown reason" msgstr "অজানা কারণ" -#: ../cli/src/connections.c:769 +#: ../cli/src/connections.c:1136 msgid "none" msgstr "শূণ্য" -#: ../cli/src/connections.c:771 +#: ../cli/src/connections.c:1138 msgid "the user was disconnected" msgstr "ব্যবহারকারীর সাথে সংযোগ বিচ্ছিন্ন করা হয়েছে" -#: ../cli/src/connections.c:773 +#: ../cli/src/connections.c:1140 msgid "the base network connection was interrupted" msgstr "মূল নেটওয়ার্ক সংযোগ বিঘ্নিত হয়েছে" -#: ../cli/src/connections.c:775 +#: ../cli/src/connections.c:1142 msgid "the VPN service stopped unexpectedly" msgstr "অপ্রত্যাশিতভাবে VPN পরিসেবা বন্ধ করা হয়েছে" -#: ../cli/src/connections.c:777 +#: ../cli/src/connections.c:1144 msgid "the VPN service returned invalid configuration" msgstr "VPN পরিসেবা থেকে অবৈধ কনফিগারেশন পাওয়া গিয়েছে" -#: ../cli/src/connections.c:779 +#: ../cli/src/connections.c:1146 msgid "the connection attempt timed out" msgstr "সংযোগের প্রয়াসকালে সময়সীমা উত্তীর্ণ হয়েছে" -#: ../cli/src/connections.c:781 +#: ../cli/src/connections.c:1148 msgid "the VPN service did not start in time" msgstr "যথাযত সময়ে VPN পরিসেবা আরম্ভ করা হয়নি" -#: ../cli/src/connections.c:783 +#: ../cli/src/connections.c:1150 msgid "the VPN service failed to start" msgstr "VPN পরিসেবা আরম্ভ করা যায়নি" -#: ../cli/src/connections.c:785 +#: ../cli/src/connections.c:1152 msgid "no valid VPN secrets" msgstr "VPN-র বৈধ গোপন তথ্য উপস্থিত নেই" -#: ../cli/src/connections.c:787 +#: ../cli/src/connections.c:1154 msgid "invalid VPN secrets" msgstr "VPN-র অবৈধ গোপন তথ্য" -#: ../cli/src/connections.c:789 +#: ../cli/src/connections.c:1156 msgid "the connection was removed" msgstr "সংযোগ মুছে ফেলা হয়েছে" -#: ../cli/src/connections.c:803 +#: ../cli/src/connections.c:1170 #, c-format msgid "state: %s\n" msgstr "অবস্থা: %s\n" -#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 #, c-format msgid "Connection activated\n" msgstr "সংযোগ সক্রিয় করা হয়েছে\n" -#: ../cli/src/connections.c:809 +#: ../cli/src/connections.c:1176 #, c-format msgid "Error: Connection activation failed." msgstr "ত্রুটি: সংযোগ সক্রিয় করতে ব্যর্থ।" -#: ../cli/src/connections.c:828 +#: ../cli/src/connections.c:1195 #, c-format msgid "state: %s (%d)\n" msgstr "অবস্থা: %s (%d)\n" -#: ../cli/src/connections.c:838 +#: ../cli/src/connections.c:1205 #, c-format msgid "Error: Connection activation failed: %s." msgstr "ত্রুটি: সংযোগ সক্রিয় করতে ব্যর্থ: %s।" -#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 #, c-format msgid "Error: Timeout %d sec expired." msgstr "ত্রুটি: %d সেকেন্ডের সময়সীমা উত্তীর্ণ হয়েছে।" -#: ../cli/src/connections.c:898 +#: ../cli/src/connections.c:1265 #, c-format msgid "Error: Connection activation failed: %s" msgstr "ত্রুটি: সংযোগ সক্রিয় করতে ব্যর্থ: %s" -#: ../cli/src/connections.c:912 +#: ../cli/src/connections.c:1279 #, c-format msgid "Error: Obtaining active connection for '%s' failed." msgstr "ত্রুটি: '%s'-র জন্য সক্রিয় সংযোগ প্রাপ্ত করতে ব্যর্থ।" -#: ../cli/src/connections.c:921 +#: ../cli/src/connections.c:1288 #, c-format msgid "Active connection state: %s\n" msgstr "সক্রিয় সংযোগের অবস্থা: %s\n" -#: ../cli/src/connections.c:922 +#: ../cli/src/connections.c:1289 #, c-format msgid "Active connection path: %s\n" msgstr "সক্রিয় সংযোগের পাথ: %s\n" -#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 #, c-format msgid "Error: Unknown connection: %s." msgstr "ত্রুটি: অজানা সংযোগ: %s." -#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 #, c-format msgid "Error: timeout value '%s' is not valid." msgstr "ত্রুটি: '%s' সময়সীমার মান বৈধ নয়।" -#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 #, c-format msgid "Error: id or uuid has to be specified." msgstr "ত্রুটি: id অথবা uuid নির্ধারণ করা আবশ্যক।" -#: ../cli/src/connections.c:1044 +#: ../cli/src/connections.c:1411 #, c-format msgid "Error: No suitable device found: %s." msgstr "ত্রুটি: প্রযোজ্য কোনো ডিভাইস পাওয়া যায়নি: %s." -#: ../cli/src/connections.c:1046 +#: ../cli/src/connections.c:1413 #, c-format msgid "Error: No suitable device found." msgstr "ত্রুটি: কোনো প্রযোজ্য ডিভাইস পাওয়া যায়নি।" -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1505 #, c-format msgid "Warning: Connection not active\n" msgstr "সতর্কবার্তা: সংযোগ সক্রিয় নয়\n" -#: ../cli/src/connections.c:1189 +#: ../cli/src/connections.c:1561 #, c-format msgid "Error: 'con' command '%s' is not valid." msgstr "ত্রুটি: 'con' কমান্ড '%s', বৈধ নয়।" -#: ../cli/src/connections.c:1216 +#: ../cli/src/connections.c:1597 #, c-format msgid "Error: could not connect to D-Bus." msgstr "ত্রুটি: D-Bus-র সাথে সংযোগ করতে ব্যর্থ।" -#: ../cli/src/connections.c:1223 +#: ../cli/src/connections.c:1604 #, c-format msgid "Error: Could not get system settings." msgstr "ত্রুটি: সিস্টেমের বৈশিষ্ট্য প্রাপ্ত করতে ব্যর্থ।" -#: ../cli/src/connections.c:1231 +#: ../cli/src/connections.c:1612 #, c-format msgid "Error: Could not get user settings." msgstr "ত্রুটি: ব্যবহারকারীর বৈশিষ্ট্য প্রাপ্ত করতে ব্যর্থ" -#: ../cli/src/connections.c:1241 +#: ../cli/src/connections.c:1622 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "ত্রুটি: সংযোগ প্রাপ্ত করতে ব্যর্থ: বৈশিষ্ট্যের পরিসেবা বর্তমানে চলছে না।" +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 #: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:186 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -352,7 +625,7 @@ msgid "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" msgstr "" "ব্যবহারপ্রণালী: nmcli dev { COMMAND | help }\n" @@ -362,349 +635,236 @@ msgstr "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" -#: ../cli/src/devices.c:93 +#: ../cli/src/devices.c:206 msgid "unmanaged" msgstr "পরিচালিত নয়" -#: ../cli/src/devices.c:95 +#: ../cli/src/devices.c:208 msgid "unavailable" msgstr "উপলব্ধ নয়" -#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 msgid "disconnected" msgstr "বিচ্ছিন্ন" -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:212 msgid "connecting (prepare)" msgstr "সংযোগ করা হচ্ছে (প্রস্তুতি)" -#: ../cli/src/devices.c:101 +#: ../cli/src/devices.c:214 msgid "connecting (configuring)" msgstr "সংযোগ করা হচ্ছে (কনফিগার করা হচ্ছে)" -#: ../cli/src/devices.c:103 +#: ../cli/src/devices.c:216 msgid "connecting (need authentication)" msgstr "সংযোগ করা হচ্ছে (অনুমোদন প্রয়োজন)" -#: ../cli/src/devices.c:105 +#: ../cli/src/devices.c:218 msgid "connecting (getting IP configuration)" msgstr "সংযোগ করা হচ্ছে (IP কনফিগারেশন প্রাপ্ত করা হচ্ছে)" -#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 msgid "connected" msgstr "সংযোগ স্থাপিত" -#: ../cli/src/devices.c:109 +#: ../cli/src/devices.c:222 msgid "connection failed" msgstr "সংযোগ বিফল" -#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 msgid "Unknown" msgstr "অজানা" -#. print them -#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 -#: ../cli/src/devices.c:879 +#: ../cli/src/devices.c:277 msgid "(none)" msgstr "(শূণ্য)" -#: ../cli/src/devices.c:209 +#: ../cli/src/devices.c:302 #, c-format msgid "%s: error converting IP4 address 0x%X" msgstr "%s: IP4 ঠিকানা 0x%X রূপান্তর করতে ত্রুটি" -#: ../cli/src/devices.c:238 +#: ../cli/src/devices.c:349 #, c-format -msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" -msgstr "%s, %s, ফ্রিকোয়েন্সি %d MHz, হার %d Mb/s, ক্ষমতা %d" - -#: ../cli/src/devices.c:239 -msgid "Ad-Hoc" -msgstr "অ্যাড-হক" - -#: ../cli/src/devices.c:248 -msgid ", Encrypted: " -msgstr ", এনক্রিপশন সহ: " - -#: ../cli/src/devices.c:253 -msgid " WEP" -msgstr " WEP" +msgid "%u MHz" +msgstr "%u MHz" -#: ../cli/src/devices.c:255 -msgid " WPA" -msgstr " WPA" +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u মেগাবাইট/সেকেন্ড" -#: ../cli/src/devices.c:257 -msgid " WPA2" -msgstr " WPA2" +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "এনক্রিপশন সহ: " -#: ../cli/src/devices.c:260 -msgid " Enterprise" -msgstr " এন্টারপ্রাইজ" +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " -#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "Device" -msgstr "ডিভাইস" +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " -#: ../cli/src/devices.c:299 -msgid "Driver" -msgstr "ড্রাইভার" +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " -#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 -msgid "(unknown)" -msgstr "(অজানা)" +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "এন্টারপ্রাইজ " -#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "State" -msgstr "অবস্থা" +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "অ্যাড-হক" -#: ../cli/src/devices.c:313 -msgid "HW Address" -msgstr "হার্ডওয়্যারের ঠিকানা" +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "পরিকাঠামো" -#: ../cli/src/devices.c:319 +#: ../cli/src/devices.c:442 #, c-format -msgid "" -"\n" -" Capabilities:\n" -msgstr "" -"\n" -" কর্মক্ষমতা:\n" - -#: ../cli/src/devices.c:321 -msgid "Carrier Detect" -msgstr "পরিবহণকারী সনাক্তকরণ" +msgid "Error: 'dev list': %s" +msgstr "ত্রুটি: 'dev list': %s" -#: ../cli/src/devices.c:336 +#: ../cli/src/devices.c:444 #, c-format -msgid "%u Mb/s" -msgstr "%u মেগাবাইট/সেকেন্ড" +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "ত্রুটি: 'dev list': %s; অনুমোদিত ক্ষেত্র: %s" -#: ../cli/src/devices.c:337 -msgid "Speed" -msgstr "গতি" +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "ডিভাইসের বিবরণ" -#: ../cli/src/devices.c:348 -#, c-format -msgid "" -"\n" -" Wireless Properties\n" -msgstr "" -"\n" -" বেতারের বৈশিষ্ট্য\n" - -#: ../cli/src/devices.c:353 -msgid "WEP Encryption" -msgstr "WEP এনক্রিপশন" - -#: ../cli/src/devices.c:355 -msgid "WPA Encryption" -msgstr "WPA এনক্রিপশন" - -#: ../cli/src/devices.c:357 -msgid "WPA2 Encryption" -msgstr "WPA2 এনক্রিপশন" - -#: ../cli/src/devices.c:359 -msgid "TKIP cipher" -msgstr "TKIP সাইফার" - -#: ../cli/src/devices.c:361 -msgid "CCMP cipher" -msgstr "CCMP সাইফার" - -#: ../cli/src/devices.c:368 -#, c-format -msgid "" -"\n" -" Wireless Access Points %s\n" -msgstr "" -"\n" -" বেতার অ্যাকসেস পয়েন্ট %s\n" +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(অজানা)" -#: ../cli/src/devices.c:368 -msgid "(* = current AP)" -msgstr "(* = বর্তমান অ্যাকসেস পয়েন্ট)" +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "অজানা)" -#: ../cli/src/devices.c:374 +#: ../cli/src/devices.c:510 #, c-format -msgid "" -"\n" -" Wired Properties\n" -msgstr "" -"\n" -" তারযুক্ত সংযোগের বৈশিষ্ট্য\n" - -#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 -msgid "Carrier" -msgstr "পরিবহণকারী" +msgid "%u Mb/s" +msgstr "%u মেগাবাইট/সেকেন্ড" -#: ../cli/src/devices.c:377 +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 msgid "on" msgstr "চালু" -#: ../cli/src/devices.c:379 +#: ../cli/src/devices.c:583 msgid "off" msgstr "বন্ধ" -#: ../cli/src/devices.c:387 +#: ../cli/src/devices.c:710 #, c-format -msgid "" -"\n" -" IPv4 Settings:\n" -msgstr "" -"\n" -" IPv4 সংক্রান্ত বৈশিষ্ট্য:\n" - -#: ../cli/src/devices.c:395 -msgid "Address" -msgstr "ঠিকানা" - -#: ../cli/src/devices.c:401 -msgid "Prefix" -msgstr "প্রি-ফিক্স" +msgid "Error: 'dev status': %s" +msgstr "ত্রুটি: 'dev status': %s" -#: ../cli/src/devices.c:405 -msgid "Gateway" -msgstr "গেটওয়ে" - -#: ../cli/src/devices.c:416 -msgid "DNS" -msgstr "DNS" +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "ত্রুটি: 'dev status': %s; অনুমোদিত ক্ষেত্র: %s" -#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:719 msgid "Status of devices" msgstr "ডিভাইসের অবস্থা" -#: ../cli/src/devices.c:487 +#: ../cli/src/devices.c:747 #, c-format msgid "Error: '%s' argument is missing." msgstr "ত্রুটি: '%s' আর্গুমেন্ট অনুপস্থিত।" -#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 #, c-format msgid "Error: Device '%s' not found." msgstr "ত্রুটি: '%s' ডিভাইস পাওয়া যায়নি।" -#: ../cli/src/devices.c:539 +#: ../cli/src/devices.c:799 #, c-format msgid "Success: Device '%s' successfully disconnected." msgstr "সাফল্য: '%s' ডিভাইস সাফল্যের সাথে সংযোগ বিচ্ছিন্ন করা হয়েছে।" -#: ../cli/src/devices.c:564 +#: ../cli/src/devices.c:824 #, c-format msgid "Error: Device '%s' (%s) disconnecting failed: %s" msgstr "ত্রুটি: '%s' (%s) ডিভাইসের সাথে সংযোগ বিচ্ছিন্ন করতে ব্যর্থ: %s" -#: ../cli/src/devices.c:572 +#: ../cli/src/devices.c:832 #, c-format msgid "Device state: %d (%s)\n" msgstr "ডিভাইসের অবস্থা: %d (%s)\n" -#: ../cli/src/devices.c:636 +#: ../cli/src/devices.c:896 #, c-format msgid "Error: iface has to be specified." msgstr "ত্রুটি: iface নির্ধারণ করা আবশ্যক।" -#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 -msgid "WiFi scan list" -msgstr "ওয়াই-ফাই স্ক্যানের তালিকা" - -#: ../cli/src/devices.c:740 +#: ../cli/src/devices.c:1011 #, c-format -msgid "Error: Device '%s' is not a WiFi device." -msgstr "ত্রুটি: '%s' ডিভাইসটি ওয়াই-ফাই ডিভাইস নয়।" - -#: ../cli/src/devices.c:754 -msgid "Device:" -msgstr "ডিভাইস:" +msgid "Error: 'dev wifi': %s" +msgstr "ত্রুটি: 'dev wifi': %s" -#: ../cli/src/devices.c:806 +#: ../cli/src/devices.c:1013 #, c-format -msgid "Error: hwaddr has to be specified." -msgstr "ত্রুটি: hwaddr নির্ধারণ করা আবশ্যক।" +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "ত্রুটি: 'dev wifi': %s; অনুমোদিত ক্ষেত্র: %s" -#: ../cli/src/devices.c:844 +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "ওয়াই-ফাই স্ক্যানের তালিকা" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 #, c-format msgid "Error: Access point with hwaddr '%s' not found." msgstr "ত্রুটি: hwaddr '%s' সহ অ্যাকসেস পয়েন্ট পাওয়া যায়নি।" -#: ../cli/src/devices.c:862 -#, c-format -msgid "%u MHz" -msgstr "%u MHz" - -#: ../cli/src/devices.c:863 +#: ../cli/src/devices.c:1072 #, c-format -msgid "%u MB/s" -msgstr "%u মেগাবাইট/সেকেন্ড" - -#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 -msgid "AP parameters" -msgstr "অ্যাকসেস পয়েন্ট সংক্রান্ত পরামিতি" - -#: ../cli/src/devices.c:873 -msgid "SSID:" -msgstr "SSID:" - -#: ../cli/src/devices.c:874 -msgid "BSSID:" -msgstr "BSSID:" - -#: ../cli/src/devices.c:875 -msgid "Frequency:" -msgstr "ফ্রিকোয়েন্সি:" - -#: ../cli/src/devices.c:876 -msgid "Mode:" -msgstr "মোড:" - -#: ../cli/src/devices.c:876 -msgid "Ad-hoc" -msgstr "অ্যাড-হক" - -#: ../cli/src/devices.c:876 -msgid "Infrastructure" -msgstr "পরিকাঠামো" - -#: ../cli/src/devices.c:877 -msgid "Maximal bitrate:" -msgstr "সর্বাধিক বিট-রেট:" - -#: ../cli/src/devices.c:878 -msgid "Strength:" -msgstr "ক্ষমতা:" - -#: ../cli/src/devices.c:879 -msgid "Flags:" -msgstr "ফ্ল্যাগ:" - -#: ../cli/src/devices.c:879 -msgid "privacy" -msgstr "গোপনীয়তা" - -#: ../cli/src/devices.c:880 -msgid "WPA flags:" -msgstr "WPA ফ্ল্যাগ:" - -#: ../cli/src/devices.c:881 -msgid "RSN flags:" -msgstr "RSN ফ্ল্যাগ:" +msgid "Error: Device '%s' is not a WiFi device." +msgstr "ত্রুটি: '%s' ডিভাইসটি ওয়াই-ফাই ডিভাইস নয়।" -#: ../cli/src/devices.c:907 +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: 'dev wifi' command '%s' is not valid." msgstr "ত্রুটি: 'dev wifi' কমান্ড '%s' বৈধ নয়।" -#: ../cli/src/devices.c:943 +#: ../cli/src/devices.c:1183 #, c-format msgid "Error: 'dev' command '%s' is not valid." msgstr "ত্রুটি: 'dev' কমান্ড '%s' বৈধ নয়।" -#: ../cli/src/network-manager.c:46 +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "RUNNING" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 #, c-format msgid "" "Usage: nmcli nm { COMMAND | help }\n" @@ -729,89 +889,91 @@ msgstr "" " wwan [on|off]\n" "\n" -#: ../cli/src/network-manager.c:67 +#: ../cli/src/network-manager.c:83 msgid "asleep" msgstr "নিদ্রিত" -#: ../cli/src/network-manager.c:69 +#: ../cli/src/network-manager.c:85 msgid "connecting" msgstr "সংযোগ করা হচ্ছে" -#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 -#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 -#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 -msgid "enabled" -msgstr "সক্রিয়" +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "ত্রুটি: 'nm status': %s" -#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 -#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 -#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 -msgid "disabled" -msgstr "নিষ্ক্রিয়" +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "ত্রুটি: 'nm status': %s; অনুমোদিত ক্ষেত্র: %s" -#: ../cli/src/network-manager.c:102 +#: ../cli/src/network-manager.c:134 msgid "NetworkManager status" msgstr "NetworkManager-র অবস্থা" -#: ../cli/src/network-manager.c:104 -msgid "NM running:" -msgstr "NM চলমান:" +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "সক্রিয়" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "নিষ্ক্রিয়" -#: ../cli/src/network-manager.c:104 +#: ../cli/src/network-manager.c:148 msgid "running" msgstr "চলমান" -#: ../cli/src/network-manager.c:104 +#: ../cli/src/network-manager.c:148 msgid "not running" msgstr "চলমান নয়" -#: ../cli/src/network-manager.c:105 -msgid "NM state:" -msgstr "NM-র অবস্থা:" - -#: ../cli/src/network-manager.c:106 -msgid "NM wireless hardware:" -msgstr "NM-র বেতার সংক্রান্ত হার্ডওয়্যার:" - -#. no argument, show current state -#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 -msgid "NM wireless:" -msgstr "NM-র বেতার:" - -#: ../cli/src/network-manager.c:108 -msgid "NM WWAN hardware:" -msgstr "NM WWAN হার্ডওয়্যার:" +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "ত্রুটি: '--fields' মান '%s' এইখানে বৈধ নয়; অনুমোদিত ক্ষেত্র: %s" -#. no argument, show current state -#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 -msgid "NM WWAN:" -msgstr "NM WWAN:" +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi সক্রিয়" -#: ../cli/src/network-manager.c:150 +#: ../cli/src/network-manager.c:220 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." msgstr "ত্রুটর: অবৈধ 'wifi' পরামিতি: '%s'।" -#: ../cli/src/network-manager.c:167 +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN সক্রিয়" + +#: ../cli/src/network-manager.c:252 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." msgstr "ত্রুটি: অবৈধ 'wwan' পরামিতি: '%s'।" -#: ../cli/src/network-manager.c:178 +#: ../cli/src/network-manager.c:263 #, c-format msgid "Error: 'nm' command '%s' is not valid." msgstr "ত্রুটি: 'nm' কমান্ড '%s' বৈধ নয়।" -#: ../cli/src/nmcli.c:65 +#: ../cli/src/nmcli.c:69 #, c-format msgid "" "Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" "\n" "OPTIONS\n" -" -t[erse] terse output\n" -" -p[retty] pretty output\n" -" -v[ersion] show program version\n" -" -h[elp] print this help\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" "\n" "OBJECT\n" " nm NetworkManager status\n" @@ -822,10 +984,14 @@ msgstr "" "ব্যবহারপ্রণালী: %s [OPTIONS] OBJECT { COMMAND | help }\n" "\n" "OPTIONS\n" -" -t[erse] terse output\n" -" -p[retty] pretty output\n" -" -v[ersion] show program version\n" -" -h[elp] print this help\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" "\n" "OBJECT\n" " nm NetworkManager status\n" @@ -833,35 +999,165 @@ msgstr "" " dev devices managed by NetworkManager\n" "\n" -#: ../cli/src/nmcli.c:106 +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "ত্রুটি: '%s' অবজেক্ট অজানা, 'nmcli help' ব্যবহারের প্রচেষ্টা করুন।" + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "ত্রুটি: '--terse' বিকল্পটি দুইবার উল্লিখিত হয়েছে।" + +#: ../cli/src/nmcli.c:148 #, c-format -msgid "Object '%s' is unknown, try 'nmcli help'." -msgstr "'%s' অবজেক্ট অজানা, 'nmcli help' ব্যবহারের প্রচেষ্টা করুন।" +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "ত্রুটি: '--terse' ও '--pretty' বিকল্প দুটি এক অপরের উপর নির্ভরশীল নয়।" -#: ../cli/src/nmcli.c:139 +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "ত্রুটি: '--pretty' বিকল্পটি দুইবার উল্লিখিত হয়েছে।" + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "ত্রুটি: '--pretty' ও '--terse' বিকল্প দুটি এক অপরের উপর নির্ভরশীল নয়।" + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "ত্রুটি: '%s' বিকল্পের ক্ষেত্রে আর্গুমেন্ট অনুপস্থিত।" + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "ত্রুটি: '%s' আর্গুমেন্টটি '%s' বিকল্পের জন্য বৈধ নয়।" + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "ত্রুটি: '%s' বিকল্পের ক্ষেত্র অনুপস্থিত।" + +#: ../cli/src/nmcli.c:209 #, c-format msgid "nmcli tool, version %s\n" msgstr "nmcli সরঞ্জাম, সংস্করণ %s\n" -#: ../cli/src/nmcli.c:145 +#: ../cli/src/nmcli.c:215 #, c-format -msgid "Option '%s' is unknown, try 'nmcli -help'." -msgstr "'%s' বিকল্পটি অজানা, 'nmcli -help' ব্যবহারের প্রয়োগ করুন।" +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "ত্রুটি: '%s' বিকল্পটি অজানা, 'nmcli -help' ব্যবহারের প্রয়োগ করুন।" -#: ../cli/src/nmcli.c:164 +#: ../cli/src/nmcli.c:234 #, c-format msgid "Caught signal %d, shutting down..." msgstr "%d সংকেত প্রাপ্ত হয়েছে, বন্ধ করা হচ্ছে..." -#: ../cli/src/nmcli.c:189 +#: ../cli/src/nmcli.c:259 #, c-format msgid "Error: Could not connect to NetworkManager." msgstr "ত্রুটি: NetworkManager-র সাথে সংযোগ স্থাপন করতে ব্যর্থ।" -#: ../cli/src/nmcli.c:205 +#: ../cli/src/nmcli.c:275 msgid "Success" msgstr "সফল" +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (১০৪/১২৮-বিট পরিচয়পংক্তি)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (অজানা)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "০ (অজানা)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "যে কোনো, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "৯০০ MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "১৮০০ MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "১৯০০ MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "৮৫০ MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS ২১০০ MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS ১৮০০ MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS ১৭০০/২১০০ MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS ৮০০ MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS ৮৫০ MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS ৯০০ MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS ১৭০০ MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "স্বয়ংক্রিয়" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "নির্ধারিত হয়নি" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "'%s' ক্ষেত্রটি পৃথক থাকা আবশ্যক" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "অবৈধ ক্ষেত্র '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "'--terse' বিকল্পের ক্ষেত্রে '--fields' নির্ধারণ করা আবশ্যক" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "'--terse' বিকল্পের ক্ষেত্রে '--fields' বিকল্পের সুনির্দিষ্ট মান উল্লেখ করা আবশ্যক, '%s' ব্যবহার করা যাবে না" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." @@ -1177,26 +1473,26 @@ msgstr "PKCS#12 ফাইল যাচাই করতে ব্যর্থ: %d msgid "Could not generate random data." msgstr "র‍্যান্ড তথ্য নির্মাণ করতে ব্যর্থ।" -#: ../libnm-util/nm-utils.c:1924 +#: ../libnm-util/nm-utils.c:1925 #, c-format msgid "Not enough memory to make encryption key." msgstr "এনক্রিপশন-কি নির্মাণের জন্য পর্যাপ্ত মেমরি অনুপস্থিত।" -#: ../libnm-util/nm-utils.c:2034 +#: ../libnm-util/nm-utils.c:2035 msgid "Could not allocate memory for PEM file creation." msgstr "PEM ফাইল নির্মাণের জন্য মেমরি বরাদ্দ করতে ব্যর্থ।" -#: ../libnm-util/nm-utils.c:2046 +#: ../libnm-util/nm-utils.c:2047 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "PEM ফাইলের মধ্যে IV লেখার জন্য মেমরি বরাদ্দ করতে ব্যর্থ।" -#: ../libnm-util/nm-utils.c:2058 +#: ../libnm-util/nm-utils.c:2059 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "PEM ফাইলের মধ্যে এনক্রিপ্ট করা কি লেখার জন্য মেমরি বরাদ্দ করা যায়নি।" -#: ../libnm-util/nm-utils.c:2077 +#: ../libnm-util/nm-utils.c:2078 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "PEM ফাইলের তথ্যে সংরক্ষণের জন্য মেমরি বরাদ্দ করতে ব্যর্থ।" @@ -1306,7 +1602,7 @@ msgstr "নিম্নলিখিত নেম-সার্ভারগুল msgid "Auto %s" msgstr "স্বয়ংক্রিয় %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3254 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 msgid "System" msgstr "সিস্টেম" -- cgit v1.2.1 From 44ae001182981932dbe49e3043e10f7ec93f6d99 Mon Sep 17 00:00:00 2001 From: Gladys Guerrero Date: Thu, 20 May 2010 18:49:27 -0700 Subject: po: updated Spanish translation (rh #589230) --- po/es.po | 1388 +++++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 834 insertions(+), 554 deletions(-) diff --git a/po/es.po b/po/es.po index 1390671209..f751c27ada 100644 --- a/po/es.po +++ b/po/es.po @@ -1,28 +1,98 @@ -# translation of NetworkManager.HEAD.po to Spanish +# translation of es.po to Spanish +# translation of NetworkManager.HEAD.po to +# Traducción de NetworkManager al español. # Copyright (C) Spanish translation for NetworkManager # This file is distributed under the same license as the NetworkManager package. # # Antonio Ognio , 2004. -# Francisco Javier F. Serrador , 2004, 2005, 2006, 2010. +# Francisco Javier F. Serrador , 2004, 2005, 2006. # Lucas Vieites Fariña , 2005, 2006. # Jorge González , 2007, 2008, 2010. -# +# Gladys Guerrero , 2010. msgid "" msgstr "" -"Project-Id-Version: NetworkManager.HEAD\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" -"product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-04-27 15:25+0000\n" -"PO-Revision-Date: 2010-05-01 10:55+0200\n" -"Last-Translator: Jorge González \n" -"Language-Team: Español \n" +"Project-Id-Version: es\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 14:32+1000\n" +"Last-Translator: Gladys Guerrero \n" +"Language-Team: Spanish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../cli/src/connections.c:86 +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NOMBRE" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DISPOSITIVOS" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "ALCANCE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "PREDETERMINADO" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "SERVICIO DBUS" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "OBJETO SPEC" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TIPO" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "MARCA DE TIEMPO" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "MARCA DE TIEMPO-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONECTAR" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "SÓLOLECTURA" + +#: ../cli/src/connections.c:157 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -34,321 +104,525 @@ msgid "" "]\n" " down id | uuid \n" msgstr "" -"Uso: nmcli con { COMANDO | help }\n" -" COMANDO := { list | status | up | down }\n" +"Uso: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" "\n" " list [id | uuid | system | user]\n" " status\n" -" up id | uuid [iface ] [ap ] [--" -"nowait] [--timeout ]\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" " down id | uuid \n" -#: ../cli/src/connections.c:158 -msgid "Connections" -msgstr "Conexiones" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/devices.c:298 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "Type" -msgstr "Tipo" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "UUID" -msgstr "UUID" +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Error: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Error: 'con list': %s; campos permitidos: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "Detalles de conexiones" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "sistema" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "usuario" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "nunca" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "sí" -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Name" -msgstr "Nombre" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "no" -#: ../cli/src/connections.c:163 -#, c-format -msgid "System connections:\n" -msgstr "Conexiones del sistema:\n" +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "Conexiones de sistema" -#: ../cli/src/connections.c:167 -#, c-format -msgid "User connections:\n" -msgstr "Conexiones del usuario:\n" +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "Conexiones de usuario" -#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 -#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 -#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 -#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 -#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 #, c-format msgid "Error: %s argument is missing." msgstr "Error: falta el argumento %s." -#: ../cli/src/connections.c:189 +#: ../cli/src/connections.c:487 #, c-format msgid "Error: %s - no such connection." -msgstr "Error: %s; no existe tal conexión." - -#: ../cli/src/connections.c:196 -msgid "System-wide connections" -msgstr "Conexiones amplias del sistema" +msgstr "Error: %s - no hay tal conexión." -#: ../cli/src/connections.c:205 -msgid "User connections" -msgstr "Conexiones del usuario" - -#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 -#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 -#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 -#: ../cli/src/devices.c:798 +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 #, c-format msgid "Unknown parameter: %s\n" msgstr "Parámetro desconocido: %s\n" -#: ../cli/src/connections.c:221 +#: ../cli/src/connections.c:528 #, c-format msgid "Error: no valid parameter specified." msgstr "Error: no se especificó un parámetro válido." -#. FIXME: Fix the output -#: ../cli/src/connections.c:268 ../cli/src/devices.c:302 -#: ../cli/src/devices.c:321 ../cli/src/devices.c:353 ../cli/src/devices.c:355 -#: ../cli/src/devices.c:357 ../cli/src/devices.c:359 ../cli/src/devices.c:361 -msgid "yes" -msgstr "sí" - -#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 -msgid "no" -msgstr "no" - -#: ../cli/src/connections.c:297 -msgid "Active connections" -msgstr "Activar conexiones" +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "Error: %s." -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 -msgid "Default" -msgstr "Predeterminada" +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Error: 'con status': %s" -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Service" -msgstr "Servicio" +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Error: 'con status': %s; campos permitidos: %s" -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Devices" -msgstr "Dispositivos" +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "Conexiones activas" -#: ../cli/src/connections.c:659 +#: ../cli/src/connections.c:1026 #, c-format msgid "no active connection on device '%s'" -msgstr "no existe una conexión activa en el dispositivo «%s»" +msgstr "conexión no activa en dispositivo '%s'" -#: ../cli/src/connections.c:667 +#: ../cli/src/connections.c:1034 #, c-format msgid "no active connection or device" -msgstr "no existe una conexión o dispositivo activo" +msgstr "conexión o dispositivo no activos" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "dispositivo '%s' incompatible con conexión '%s'" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "no se encontró dispositivo para conexión '%s'" -#: ../cli/src/connections.c:730 +#: ../cli/src/connections.c:1097 msgid "activating" msgstr "activando" -#: ../cli/src/connections.c:732 +#: ../cli/src/connections.c:1099 msgid "activated" msgstr "activada" -#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 -#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 -#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 msgid "unknown" msgstr "desconocido" -#: ../cli/src/connections.c:744 +#: ../cli/src/connections.c:1111 msgid "VPN connecting (prepare)" -msgstr "Conectando con la VPN (preparación)" +msgstr "Conectando VPN (preparar)" -#: ../cli/src/connections.c:746 +#: ../cli/src/connections.c:1113 msgid "VPN connecting (need authentication)" -msgstr "Conectando con la VPN (necesita autorización)" +msgstr "Conectando VPN (necesita autenticación)" -#: ../cli/src/connections.c:748 +#: ../cli/src/connections.c:1115 msgid "VPN connecting" -msgstr "Conectando con la VPN" +msgstr "Conectando VPN" -#: ../cli/src/connections.c:750 +#: ../cli/src/connections.c:1117 msgid "VPN connecting (getting IP configuration)" -msgstr "Conectando con la VPN (obteniendo configuración IP)" +msgstr "Conectando VPN (Obteniendo configuración IP)" -#: ../cli/src/connections.c:752 +#: ../cli/src/connections.c:1119 msgid "VPN connected" msgstr "VPN conectada" -#: ../cli/src/connections.c:754 +#: ../cli/src/connections.c:1121 msgid "VPN connection failed" -msgstr "Falló la conexión VPN" +msgstr "Conexión VPN falló" -#: ../cli/src/connections.c:756 +#: ../cli/src/connections.c:1123 msgid "VPN disconnected" msgstr "VPN desconectada" -#: ../cli/src/connections.c:767 +#: ../cli/src/connections.c:1134 msgid "unknown reason" msgstr "razón desconocida" -#: ../cli/src/connections.c:769 +#: ../cli/src/connections.c:1136 msgid "none" msgstr "ninguna" -#: ../cli/src/connections.c:771 +#: ../cli/src/connections.c:1138 msgid "the user was disconnected" -msgstr "se desconectó al usuario" +msgstr "el usuario estaba desconectado" -#: ../cli/src/connections.c:773 +#: ../cli/src/connections.c:1140 msgid "the base network connection was interrupted" -msgstr "se interrumpió la conexión base de red" +msgstr "la conexión de red de base fue interrumpida" -#: ../cli/src/connections.c:775 +#: ../cli/src/connections.c:1142 msgid "the VPN service stopped unexpectedly" -msgstr "el servicio VPN finalizó inesperadamente" +msgstr "El servicio VPN se detuvo inesperadamente" -#: ../cli/src/connections.c:777 +#: ../cli/src/connections.c:1144 msgid "the VPN service returned invalid configuration" -msgstr "el servicio VPN devolvió una configuración no válida" +msgstr "El servicio VPN retornó configuración inválida" -#: ../cli/src/connections.c:779 +#: ../cli/src/connections.c:1146 msgid "the connection attempt timed out" -msgstr "expiró el intento de conexión" +msgstr "El intento de conexión se agotó" -#: ../cli/src/connections.c:781 +#: ../cli/src/connections.c:1148 msgid "the VPN service did not start in time" -msgstr "el servicio VPN no se inició a tiempo" +msgstr "el servicio VPN no inició a tiempo" -#: ../cli/src/connections.c:783 +#: ../cli/src/connections.c:1150 msgid "the VPN service failed to start" -msgstr "el servicio VPN falló al iniciar" +msgstr "el servicio VPN falló en el inicio" -#: ../cli/src/connections.c:785 +#: ../cli/src/connections.c:1152 msgid "no valid VPN secrets" -msgstr "secretos VPN no válidos" +msgstr "secretos VPN inválidos" -#: ../cli/src/connections.c:787 +#: ../cli/src/connections.c:1154 msgid "invalid VPN secrets" -msgstr "secretos VPN inválidos" +msgstr "secretos VPN válidos" -#: ../cli/src/connections.c:789 +#: ../cli/src/connections.c:1156 msgid "the connection was removed" -msgstr "se rechazó la conexión" +msgstr "la conexión fue eliminada" -#: ../cli/src/connections.c:803 +#: ../cli/src/connections.c:1170 #, c-format msgid "state: %s\n" msgstr "estado: %s\n" -#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 #, c-format msgid "Connection activated\n" msgstr "Conexión activada\n" -#: ../cli/src/connections.c:809 +#: ../cli/src/connections.c:1176 #, c-format msgid "Error: Connection activation failed." -msgstr "Error: falló la activación de la conexión." +msgstr "Error: Activación de conexión falló." -#: ../cli/src/connections.c:828 +#: ../cli/src/connections.c:1195 #, c-format msgid "state: %s (%d)\n" msgstr "estado: %s (%d)\n" -#: ../cli/src/connections.c:838 +#: ../cli/src/connections.c:1205 #, c-format msgid "Error: Connection activation failed: %s." -msgstr "Error: falló la activación de la conexión: %s." +msgstr "Error: Activación de conexión falló: %s." -#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 #, c-format msgid "Error: Timeout %d sec expired." -msgstr "Error: Expiró el tiempo de conexión de %d segs." +msgstr "Error: Pausa de %d segundos expiró." -#: ../cli/src/connections.c:898 +#: ../cli/src/connections.c:1265 #, c-format msgid "Error: Connection activation failed: %s" -msgstr "Error: falló la activación de la conexión: %s" +msgstr "Error: Activación de conexión falló: %s" -#: ../cli/src/connections.c:912 +#: ../cli/src/connections.c:1279 #, c-format msgid "Error: Obtaining active connection for '%s' failed." -msgstr "Error: falló la obtención de una conexión activa para «%s»." +msgstr "Error: Obtención de conexión activa para '%s' falló." -#: ../cli/src/connections.c:921 +#: ../cli/src/connections.c:1288 #, c-format msgid "Active connection state: %s\n" -msgstr "Estado de la conexión activa: %s\n" +msgstr "Estado de conexión activa: %s\n" -#: ../cli/src/connections.c:922 +#: ../cli/src/connections.c:1289 #, c-format msgid "Active connection path: %s\n" -msgstr "Ruta de la conexión activa: %s\n" +msgstr "Ruta de conexión activa: %s\n" -#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 #, c-format msgid "Error: Unknown connection: %s." -msgstr "Error: conexión desconocida: %s." +msgstr "Error: Conexión desconocida: %s." -#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 #, c-format msgid "Error: timeout value '%s' is not valid." -msgstr "Error: el valor «%s» no es válido para el tiempo de expiración." +msgstr "Error: valor de pausa '%s' inválido." -#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 #, c-format msgid "Error: id or uuid has to be specified." -msgstr "Error: se debe especificar el «id» o «uuid»." +msgstr "Error: id o uuid ha sido especificado." -#: ../cli/src/connections.c:1044 +#: ../cli/src/connections.c:1411 #, c-format msgid "Error: No suitable device found: %s." -msgstr "Error: no se encontró un dispositivo apropiado: %s." +msgstr "Error: Dispositivo inapropiado: %s." -#: ../cli/src/connections.c:1046 +#: ../cli/src/connections.c:1413 #, c-format msgid "Error: No suitable device found." -msgstr "Error: no se encontró un dispositivo apropiado." +msgstr "Error: Dispositivo no apropiado." -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1505 #, c-format msgid "Warning: Connection not active\n" -msgstr "Aviso: la conexión no está activa\n" +msgstr "Advertencia: Conexión inactiva\n" -#: ../cli/src/connections.c:1189 +#: ../cli/src/connections.c:1561 #, c-format msgid "Error: 'con' command '%s' is not valid." -msgstr "Error: el comando «con» «%s» no es válido." +msgstr "Error: comando 'con' '%s' es inválido." -#: ../cli/src/connections.c:1216 +#: ../cli/src/connections.c:1597 #, c-format msgid "Error: could not connect to D-Bus." -msgstr "Error: no se pudo conectar con D-Bus." +msgstr "Error: no se pudo conectar a D-Bus." -#: ../cli/src/connections.c:1223 +#: ../cli/src/connections.c:1604 #, c-format msgid "Error: Could not get system settings." -msgstr "Error: no se pudo obtener la configuración del sistema." +msgstr "Error: no se pudo obtener configuración de sistema." -#: ../cli/src/connections.c:1231 +#: ../cli/src/connections.c:1612 #, c-format msgid "Error: Could not get user settings." -msgstr "Error: no se pudo obtener la configuración del usuario." +msgstr "Error: No se pudo obtener configuración de usuario." -#: ../cli/src/connections.c:1241 +#: ../cli/src/connections.c:1622 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "" -"Error: no se pueden obtener las conexiones: los servicios de configuración " -"no se están ejecutando." - +"Error: No se pudieron obtener conexiones: servicios de configuración no se " +"están ejecutando." + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DISPOSITIVO" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "ESTADO" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "FUNCIONALIDADES" + +#. 1 #: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "PROPIEDADES-WIFI" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "PROPIEDADES ALÁMBRICAS" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "CONFIGURACIONES IP4" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "DNS IP4" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "CONTROLADOR" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "DETECTAR-PORTADOR" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "VELOCIDAD" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "PORTADOR" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "DIRECCIÓN" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIJO" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "PUERTA DE ENLACE" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODO" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREC" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "TASA" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SEÑAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SEGURIDAD" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "INDICADORES-WPA" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "INDICADORES-RSN" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVO" + +#: ../cli/src/devices.c:186 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -358,360 +632,246 @@ msgid "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" msgstr "" -"Uso: nmcli dev { COMANDO | help }\n" +"Uso: nmcli dev { COMMAND | help }\n" "\n" -" COMANDO := { status | list | disconnect | wifi }\n" +" COMMAND := { status | list | disconnect | wifi }\n" "\n" " status\n" -" list [iface ]\n" -" disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" -#: ../cli/src/devices.c:93 +#: ../cli/src/devices.c:206 msgid "unmanaged" -msgstr "sin gestionar" +msgstr "sin gestión" -#: ../cli/src/devices.c:95 +#: ../cli/src/devices.c:208 msgid "unavailable" msgstr "no disponible" -#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 msgid "disconnected" msgstr "desconectado" -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:212 msgid "connecting (prepare)" -msgstr "conectando (preparación)" +msgstr "conectando (preparar)" -#: ../cli/src/devices.c:101 +#: ../cli/src/devices.c:214 msgid "connecting (configuring)" -msgstr "conectando (configuración)" +msgstr "conectando (configurando)" -#: ../cli/src/devices.c:103 +#: ../cli/src/devices.c:216 msgid "connecting (need authentication)" -msgstr "conectando (necesita autorización)" +msgstr "conectando (necesita autenticación)" -#: ../cli/src/devices.c:105 +#: ../cli/src/devices.c:218 msgid "connecting (getting IP configuration)" msgstr "conectando (obteniendo configuración IP)" -#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 msgid "connected" msgstr "conectado" -#: ../cli/src/devices.c:109 +#: ../cli/src/devices.c:222 msgid "connection failed" -msgstr "falló la conexión" +msgstr "conexión falló" -#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 msgid "Unknown" -msgstr "Desconocido" +msgstr "desconocido" -#. print them -#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 -#: ../cli/src/devices.c:879 +#: ../cli/src/devices.c:277 msgid "(none)" -msgstr "(nada)" +msgstr "(ninguno)" -#: ../cli/src/devices.c:209 +#: ../cli/src/devices.c:302 #, c-format msgid "%s: error converting IP4 address 0x%X" -msgstr "%s: error al convertir la dirección IP4 en 0x%X" +msgstr "%s: error convirtiendo dirección IP4 0x%X" -#: ../cli/src/devices.c:238 +#: ../cli/src/devices.c:349 #, c-format -msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" -msgstr "%s, %s, frecuencia %d MHz, tasa %d Mb/s, intensidad %d" - -#: ../cli/src/devices.c:239 -msgid "Ad-Hoc" -msgstr "Ad-Hoc" - -#: ../cli/src/devices.c:248 -msgid ", Encrypted: " -msgstr ", cifrado: " - -#: ../cli/src/devices.c:253 -msgid " WEP" -msgstr " WEP" +msgid "%u MHz" +msgstr "%u MHz" -#: ../cli/src/devices.c:255 -msgid " WPA" -msgstr " WPA" +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" -#: ../cli/src/devices.c:257 -msgid " WPA2" -msgstr " WPA2" +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "Encriptado: " -#: ../cli/src/devices.c:260 -msgid " Enterprise" -msgstr " Enterprise" +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP" -#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "Device" -msgstr "Dispositivo" +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA" -#: ../cli/src/devices.c:299 -msgid "Driver" -msgstr "Controlador" +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2" -#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 -msgid "(unknown)" -msgstr "(desconocido)" +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "Empresa" -#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "State" -msgstr "Estado" +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" -#: ../cli/src/devices.c:313 -msgid "HW Address" -msgstr "Dirección hardware" +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "Infraestructura" -#: ../cli/src/devices.c:319 +#: ../cli/src/devices.c:442 #, c-format -msgid "" -"\n" -" Capabilities:\n" -msgstr "" -"\n" -" Capacidades:\n" +msgid "Error: 'dev list': %s" +msgstr "Error: 'dev list': %s" -#: ../cli/src/devices.c:321 -msgid "Carrier Detect" -msgstr "Detector de portadora" - -#: ../cli/src/devices.c:336 +#: ../cli/src/devices.c:444 #, c-format -msgid "%u Mb/s" -msgstr "%u Mb/s" +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Error: 'dev list': %s; campos permitidos: %s" -#: ../cli/src/devices.c:337 -msgid "Speed" -msgstr "Velocidad" +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "Detalles de dispositivos" -#: ../cli/src/devices.c:348 -#, c-format -msgid "" -"\n" -" Wireless Properties\n" -msgstr "" -"\n" -" Propiedades de la conexión inalámbrica\n" - -#: ../cli/src/devices.c:353 -msgid "WEP Encryption" -msgstr "Cifrado WEP" - -#: ../cli/src/devices.c:355 -msgid "WPA Encryption" -msgstr "Cifrado WPA" - -#: ../cli/src/devices.c:357 -msgid "WPA2 Encryption" -msgstr "Cifrado WPA2" - -#: ../cli/src/devices.c:359 -msgid "TKIP cipher" -msgstr "Cifrado TKIP" - -#: ../cli/src/devices.c:361 -msgid "CCMP cipher" -msgstr "Cifrado CCMP" - -#: ../cli/src/devices.c:368 -#, c-format -msgid "" -"\n" -" Wireless Access Points %s\n" -msgstr "" -"\n" -" Puntos de acceso inalámbricos %s\n" +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(desconocido)" -#: ../cli/src/devices.c:368 -msgid "(* = current AP)" -msgstr "(* = PA actual)" +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "desconocido" -#: ../cli/src/devices.c:374 +#: ../cli/src/devices.c:510 #, c-format -msgid "" -"\n" -" Wired Properties\n" -msgstr "" -"\n" -" Propiedades de la conexión cableada\n" - -#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 -msgid "Carrier" -msgstr "Portadora" +msgid "%u Mb/s" +msgstr "%u Mb/s" -#: ../cli/src/devices.c:377 +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 msgid "on" msgstr "encendido" -#: ../cli/src/devices.c:379 +#: ../cli/src/devices.c:583 msgid "off" msgstr "apagado" -#: ../cli/src/devices.c:387 +#: ../cli/src/devices.c:710 #, c-format -msgid "" -"\n" -" IPv4 Settings:\n" -msgstr "" -"\n" -" Ajustes de IPv4:\n" - -#: ../cli/src/devices.c:395 -msgid "Address" -msgstr "Dirección" - -#: ../cli/src/devices.c:401 -msgid "Prefix" -msgstr "Prefijo" - -#: ../cli/src/devices.c:405 -msgid "Gateway" -msgstr "Pasarela" +msgid "Error: 'dev status': %s" +msgstr "Error: 'dev status': %s" -#: ../cli/src/devices.c:416 -msgid "DNS" -msgstr "DNS" +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Error: 'dev status': %s; campos permitidos: %s" -#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:719 msgid "Status of devices" -msgstr "Estado de los dispositivos" +msgstr "Estado de dispositivos" -#: ../cli/src/devices.c:487 +#: ../cli/src/devices.c:747 #, c-format msgid "Error: '%s' argument is missing." -msgstr "Error: falta el argumento «%s»." +msgstr "Error: '%s' falta argumento." -#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 #, c-format msgid "Error: Device '%s' not found." -msgstr "Error: no se encontró el dispositivo «%s»" +msgstr "Error: Dispositivo '%s' no encontrado." -#: ../cli/src/devices.c:539 +#: ../cli/src/devices.c:799 #, c-format msgid "Success: Device '%s' successfully disconnected." -msgstr "Éxito: se desconectó correctamente el dispositivo «%s»." +msgstr "Éxito: Dispositivo '%s' desconectado correctamente." -#: ../cli/src/devices.c:564 +#: ../cli/src/devices.c:824 #, c-format msgid "Error: Device '%s' (%s) disconnecting failed: %s" -msgstr "Error: falló la desconexión del dispositivo «%s» (%s): %s" +msgstr "Error: Desconexión de dispositivo '%s' (%s) falló: %s" -#: ../cli/src/devices.c:572 +#: ../cli/src/devices.c:832 #, c-format msgid "Device state: %d (%s)\n" -msgstr "Estado del dispositivo: %d (%s)\n" +msgstr "Estado de dispositivo: %d (%s)\n" -#: ../cli/src/devices.c:636 +#: ../cli/src/devices.c:896 #, c-format msgid "Error: iface has to be specified." -msgstr "Error: se debe especificar la interfaz." +msgstr "Error: iface tiene que especificarse." -#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 -msgid "WiFi scan list" -msgstr "Lista de la inspección inalámbrica" - -#: ../cli/src/devices.c:740 +#: ../cli/src/devices.c:1011 #, c-format -msgid "Error: Device '%s' is not a WiFi device." -msgstr "Error: el dispositivo «%s» no es un dispositivo inalámbrico." - -#: ../cli/src/devices.c:754 -msgid "Device:" -msgstr "Dispositivo:" +msgid "Error: 'dev wifi': %s" +msgstr "Error: 'dev wifi' '%s'" -#: ../cli/src/devices.c:806 +#: ../cli/src/devices.c:1013 #, c-format -msgid "Error: hwaddr has to be specified." -msgstr "Error: se debe especificar la dirección hardware." +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Error: 'dev wifi': %s; campos permitidos: %s" -#: ../cli/src/devices.c:844 +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "lista de scan WiFi" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 #, c-format msgid "Error: Access point with hwaddr '%s' not found." -msgstr "Error: no se encontró el punto de acceso con dirección hardware «%s»." +msgstr "Error: Punto de acceso con hwaddr '%s' no se encontró." -#: ../cli/src/devices.c:862 +#: ../cli/src/devices.c:1072 #, c-format -msgid "%u MHz" -msgstr "%u MHz" +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Error: Dispositivo '%s' no es un dispositivo WiFi." -#: ../cli/src/devices.c:863 +#: ../cli/src/devices.c:1136 #, c-format -msgid "%u MB/s" -msgstr "%u MB/s" - -#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 -msgid "AP parameters" -msgstr "Parámetros del PA" - -#: ../cli/src/devices.c:873 -msgid "SSID:" -msgstr "SSID:" - -#: ../cli/src/devices.c:874 -msgid "BSSID:" -msgstr "BSSID:" - -#: ../cli/src/devices.c:875 -msgid "Frequency:" -msgstr "Frecuencia:" - -#: ../cli/src/devices.c:876 -msgid "Mode:" -msgstr "Modo:" - -#: ../cli/src/devices.c:876 -msgid "Ad-hoc" -msgstr "Ad-hoc" - -#: ../cli/src/devices.c:876 -msgid "Infrastructure" -msgstr "Infraestructura" - -#: ../cli/src/devices.c:877 -msgid "Maximal bitrate:" -msgstr "Tasa de bits máxima:" - -#: ../cli/src/devices.c:878 -msgid "Strength:" -msgstr "Intensidad:" +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Error: comando 'dev wifi' '%s' inválido." -#: ../cli/src/devices.c:879 -msgid "Flags:" -msgstr "Opciones:" +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Error: comando 'dev' '%s' inválido." -#: ../cli/src/devices.c:879 -msgid "privacy" -msgstr "privacidad" +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "EJECUTANDO" -#: ../cli/src/devices.c:880 -msgid "WPA flags:" -msgstr "Opciones WPA:" +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "HARDWARE-WIFI" -#: ../cli/src/devices.c:881 -msgid "RSN flags:" -msgstr "Opciones RSN:" +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" -#: ../cli/src/devices.c:907 -#, c-format -msgid "Error: 'dev wifi' command '%s' is not valid." -msgstr "Error: el comando «dev wifi» «%s» no es válido." +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "HARDWARE-WWAN" -#: ../cli/src/devices.c:943 -#, c-format -msgid "Error: 'dev' command '%s' is not valid." -msgstr "Error: el comando «dev» «%s» no es válido." +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" -#: ../cli/src/network-manager.c:46 +#: ../cli/src/network-manager.c:62 #, c-format msgid "" "Usage: nmcli nm { COMMAND | help }\n" @@ -725,100 +885,102 @@ msgid "" " wwan [on|off]\n" "\n" msgstr "" -"Uso: nmcli nm {COMANDO | help }\n" +"Uso: nmcli nm { COMANDO | ayuda }\n" "\n" " COMANDO := { status | sleep | wakeup | wifi | wwan }\n" "\n" -" status\n" -" sleep\n" -" wakeup\n" -" wifi [on|off]\n" -" wwan [on|off]\n" +" estatus\n" +" dormir\n" +" despertar\n" +" wifi [encendido|apagado]\n" +" wwan [encendido|apagado]\n" "\n" -#: ../cli/src/network-manager.c:67 +#: ../cli/src/network-manager.c:83 msgid "asleep" -msgstr "dormida" +msgstr "dormido" -#: ../cli/src/network-manager.c:69 +#: ../cli/src/network-manager.c:85 msgid "connecting" msgstr "conectando" -#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 -#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 -#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 -msgid "enabled" -msgstr "activado" +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Error: 'nm status': %s" -#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 -#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 -#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 -msgid "disabled" -msgstr "desactivado" +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Error: 'nm status': %s; campos permitidos: %s" -#: ../cli/src/network-manager.c:102 +#: ../cli/src/network-manager.c:134 msgid "NetworkManager status" msgstr "Estado de NetworkManager" -#: ../cli/src/network-manager.c:104 -msgid "NM running:" -msgstr "NM en ejecución:" +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "habilitado" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "inhabilitado" -#: ../cli/src/network-manager.c:104 +#: ../cli/src/network-manager.c:148 msgid "running" -msgstr "en ejecución" +msgstr "ejecutando" -#: ../cli/src/network-manager.c:104 +#: ../cli/src/network-manager.c:148 msgid "not running" -msgstr "no está en ejecución" - -#: ../cli/src/network-manager.c:105 -msgid "NM state:" -msgstr "Estado de NM:" - -#: ../cli/src/network-manager.c:106 -msgid "NM wireless hardware:" -msgstr "Hardware inalámbrico de NM:" - -#. no argument, show current state -#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 -msgid "NM wireless:" -msgstr "Inalámbrico de NM:" +msgstr "no ejecutando" -#: ../cli/src/network-manager.c:108 -msgid "NM WWAN hardware:" -msgstr "Hardware WWAN de NM:" +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Error: '--fields' valor '%s' no es válido aquí; campos permitidos: %s" -#. no argument, show current state -#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 -msgid "NM WWAN:" -msgstr "WWAN de NM:" +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi habilitado" -#: ../cli/src/network-manager.c:150 +#: ../cli/src/network-manager.c:220 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." -msgstr "Error: parámetro «wifi» no válido: «%s»." +msgstr "Error: parámetro 'wifi' inválido: '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN habilitado" -#: ../cli/src/network-manager.c:167 +#: ../cli/src/network-manager.c:252 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." -msgstr "Error: parámetro «wwan» no válido: «%s»." +msgstr "Error: parámetro 'wwan' inválido: '%s'." -#: ../cli/src/network-manager.c:178 +#: ../cli/src/network-manager.c:263 #, c-format msgid "Error: 'nm' command '%s' is not valid." -msgstr "Error: el comando «nm» «%s» no es válido." +msgstr "Error: comando 'nm' command '%s' inválido." -#: ../cli/src/nmcli.c:65 +#: ../cli/src/nmcli.c:69 #, c-format msgid "" "Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" "\n" "OPTIONS\n" -" -t[erse] terse output\n" -" -p[retty] pretty output\n" -" -v[ersion] show program version\n" -" -h[elp] print this help\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" "\n" "OBJECT\n" " nm NetworkManager status\n" @@ -826,49 +988,179 @@ msgid "" " dev devices managed by NetworkManager\n" "\n" msgstr "" -"Uso: %s [OPCIONES] OBJETO { COMANDO | help }\n" +"Uso: %s [OPCIONES] OBJETO { COMANDO | ayuda }\n" "\n" -"OPTIONS\n" -" -t[erse] salida breve\n" -" -p[retty] salida bonita\n" -" -v[ersion] mostrar la versión del programa\n" -" -h[elp] mostrar esta ayuda\n" +"OPCIONES\n" +" -t[erse] salida terse \n" +" -p[retty] salida pretty\n" +" -v[ersion] mostrar versión programa\n" +" -h[elp] imprimir esta ayuda\n" "\n" -"OBJECT\n" -" nm estado de NetworkManager\n" +"OBJETO\n" +" nm estatus de NetworkManager\n" " con conexiones de NetworkManager\n" -" dev dispositivos gestionados por NetworkManager\n" +" dev dispositivos administrados por NetworkManager\n" "\n" -#: ../cli/src/nmcli.c:106 +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Error: Objeto '%s' desconocido, intente 'nmcli help'." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Error: Opción '--terse' se especifica la segunda vez." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Error: Opción '--terse' es mutuamente exclusiva con '--pretty'." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Error: Opción '--pretty' se especifica la segunda vez." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Error: Opción '--pretty' es mutuamente exclusiva con '--terse'." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 #, c-format -msgid "Object '%s' is unknown, try 'nmcli help'." -msgstr "Se desconoce el objeto «%s», intente «nmcli help»." +msgid "Error: missing argument for '%s' option." +msgstr "Error: falta argumento para opción '%s'." -#: ../cli/src/nmcli.c:139 +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Error: '%s' no es válido argumento para opción '%s'." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Error: faltan campos para opciones '%s'." + +#: ../cli/src/nmcli.c:209 #, c-format msgid "nmcli tool, version %s\n" msgstr "herramienta nmcli, versión %s\n" -#: ../cli/src/nmcli.c:145 +#: ../cli/src/nmcli.c:215 #, c-format -msgid "Option '%s' is unknown, try 'nmcli -help'." -msgstr "Se desconoce la opción «%s», intente «nmcli -help»." +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Error: Opción '%s' desconocida, intente 'nmcli -help'." -#: ../cli/src/nmcli.c:164 +#: ../cli/src/nmcli.c:234 #, c-format msgid "Caught signal %d, shutting down..." -msgstr "Se capturó la señal %d, apagando..." +msgstr "Señal capturada %d, apagando..." -#: ../cli/src/nmcli.c:189 +#: ../cli/src/nmcli.c:259 #, c-format msgid "Error: Could not connect to NetworkManager." -msgstr "Error: no se pudo conectar con NetworkManager." +msgstr "Error: No se pudo conectar al NetworkManager." -#: ../cli/src/nmcli.c:205 +#: ../cli/src/nmcli.c:275 msgid "Success" msgstr "Éxito" +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (clave-hex-ascii)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (frase de acceso 104/128-bits)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (desconocido)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (desconocido)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "cualquiera," + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "auto" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "no establecido" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "campo '%s' tiene que estar solo" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "campo inválido '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Opción '--terse' requiere especificar '--fields'" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "Opción '--terse' requiere valores de '--fields' específicos, no '%s'" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." @@ -907,8 +1199,7 @@ msgstr "Archivo PEM mal formado: no se encontró IV en la etiqueta DEK-Info." #: ../libnm-util/crypto.c:190 #, c-format msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." -msgstr "" -"Archivo PEM mal formado: formato de IV no válido en la etiqueta DEK-Info." +msgstr "Archivo PEM mal formado: formato de IV no válido en la etiqueta DEK-Info." #: ../libnm-util/crypto.c:203 #, c-format @@ -989,7 +1280,7 @@ msgstr "Falló al inicializar el motor MD5: %s / %s." #: ../libnm-util/crypto_gnutls.c:156 #, c-format msgid "Invalid IV length (must be at least %zd)." -msgstr "Longitud IV no válida (debe ser al menos %zd)." +msgstr "Longitud IV inválida (debe ser al menos de %zd)." #: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format @@ -1034,7 +1325,7 @@ msgstr "No se pudo reservar memoria para el cifrado." #: ../libnm-util/crypto_gnutls.c:294 #, c-format msgid "Failed to initialize the encryption cipher context: %s / %s." -msgstr "Falló al inicializar el contexto de cifrado: %s / %s." +msgstr "Falló al inicializar el contexto de cifrador: %s / %s." #: ../libnm-util/crypto_gnutls.c:303 #, c-format @@ -1089,7 +1380,7 @@ msgstr "Falló al inicializar el contexto MD5: %d" #: ../libnm-util/crypto_nss.c:179 #, c-format msgid "Invalid IV length (must be at least %d)." -msgstr "Longitud de IV no válida (debe ser al menos %d)." +msgstr "Longitud IV inválida (debe ser al menos de %d)." #: ../libnm-util/crypto_nss.c:196 #, c-format @@ -1156,7 +1447,7 @@ msgstr "Falló al cifrar: %d." #: ../libnm-util/crypto_nss.c:404 #, c-format msgid "Unexpected amount of data after encrypting." -msgstr "Cantidad de datos inesperada después de cifrar." +msgstr "Cantidad inesperada de datos después del encriptado." #: ../libnm-util/crypto_nss.c:447 #, c-format @@ -1187,27 +1478,26 @@ msgstr "No se pudo verificar el archivo PKCS#12: %d" msgid "Could not generate random data." msgstr "No se pudo generar datos aleatorios." -#: ../libnm-util/nm-utils.c:1924 +#: ../libnm-util/nm-utils.c:1925 #, c-format msgid "Not enough memory to make encryption key." msgstr "No hay memoria suficiente para crear la clave privada de cifrado." -#: ../libnm-util/nm-utils.c:2034 +#: ../libnm-util/nm-utils.c:2035 msgid "Could not allocate memory for PEM file creation." msgstr "No se pudo reservar memoria para crear el archivo PEM." -#: ../libnm-util/nm-utils.c:2046 +#: ../libnm-util/nm-utils.c:2047 #, c-format msgid "Could not allocate memory for writing IV to PEM file." -msgstr "No se pudo asignar memoria para escribir IV en el archivo PEM." +msgstr "No pudo asignar memoria para escribir IV al archivo PEM." -#: ../libnm-util/nm-utils.c:2058 +#: ../libnm-util/nm-utils.c:2059 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." -msgstr "" -"No se pudo asignar memoria para escribir la clave cifrada en el archivo PEM." +msgstr "No se pudo asignar memoria para escribir llave encriptada al archivo PEM." -#: ../libnm-util/nm-utils.c:2077 +#: ../libnm-util/nm-utils.c:2078 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "No se pudo reservar memoria para el archivo de datos PEM." @@ -1225,14 +1515,12 @@ msgstr "ha ocurrido un error mientras esperaban datos en un socket" #: ../src/nm-netlink-monitor.c:254 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" -msgstr "" -"no se puede conectar con netlink para monitorizar el estado del enlace: %s" +msgstr "no se puede conectar con netlink para monitorizar el estado del enlace: %s" #: ../src/nm-netlink-monitor.c:265 #, c-format -#| msgid "unable to allocate netlink handle: %s" msgid "unable to enable netlink handle credential passing: %s" -msgstr "no se pudo activar el manejador de paso de credenciales de netlink: %s" +msgstr "no se puede habilitar el manejador netlink para pasar credenciales: %s" #: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 #, c-format @@ -1245,7 +1533,7 @@ msgstr "" #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "" -"no se puede asignar el enlace a la caché de netlink para monitorizar el " +"no se puede asignar el enlace a la cache de netlink para monitorizar el " "estado del enlace: %s" #: ../src/nm-netlink-monitor.c:502 @@ -1261,13 +1549,12 @@ msgstr "error al actualizar el enlace caché: %s" #: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" -msgstr "" -"Opción no válida. Use --help para ver una lista de las opciones válidas.\n" +msgstr "Opción no válida. Use --help para ver una lista de las opciones válidas.\n" #: ../src/main.c:562 #, c-format msgid "%s. Please use --help to see a list of valid options.\n" -msgstr "%s. Use --help para ver una lista de las opciones válidas.\n" +msgstr "%s. Por favor use --help para ver la lista de opciones válidas.\n" #: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 msgid "# Created by NetworkManager\n" @@ -1284,35 +1571,35 @@ msgstr "" #: ../src/dhcp-manager/nm-dhcp-manager.c:279 msgid "no usable DHCP client could be found." -msgstr "no se encontró ningún cliente de DHCP usable." +msgstr "cliente DHCP inútil pudo ser hallado." #: ../src/dhcp-manager/nm-dhcp-manager.c:288 msgid "'dhclient' could be found." -msgstr "no se pudo encontrar «dhclient»." +msgstr "'dhclient' pudo ser hallado." #: ../src/dhcp-manager/nm-dhcp-manager.c:298 msgid "'dhcpcd' could be found." -msgstr "no se pudo encontrar «dhcpd»." +msgstr "'dhcpcd' pudo ser hallado." #: ../src/dhcp-manager/nm-dhcp-manager.c:306 #, c-format msgid "unsupported DHCP client '%s'" -msgstr "no se soporta el cliente de DHCP «%s»" +msgstr "'%s' Cliente DHCP sin soporte " #: ../src/logging/nm-logging.c:146 #, c-format msgid "Unknown log level '%s'" -msgstr "Nivel de registro «%s» desconocido" +msgstr "Nivel de registro desconocido '%s'" #: ../src/logging/nm-logging.c:171 #, c-format msgid "Unknown log domain '%s'" -msgstr "Dominio de registro «%s» desconocido" +msgstr "Dominio de registro desconocido '%s'" #: ../src/named-manager/nm-named-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" -"NOTA: el resolutor de nombres de libc puede que no soporte más de 3 " +"NOTA: el 'resolver' de nombres de libc puede que no soporte más de 3 " "servidores de nombres." #: ../src/named-manager/nm-named-manager.c:345 @@ -1324,52 +1611,45 @@ msgstr "Puede que los servidores de nombres listados abajo no se reconozcan." msgid "Auto %s" msgstr "Auto %ss" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3254 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 msgid "System" msgstr "Sistema" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 msgid "Connection sharing via a protected WiFi network" -msgstr "Compartir la conexión a través de una red inalámbrica protegida" +msgstr "Compartir conexión a través de una red WIFI protegida" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 msgid "Connection sharing via an open WiFi network" -msgstr "Compartir la conexión a través de una red inalámbrica abierta" +msgstr "Compartir conexión a través de una red WIFI abierta" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 msgid "Modify persistent system hostname" -msgstr "Modificar el nombre de equipo persistente del sistema" +msgstr "Modificar nombre de host de sistema persistente" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 msgid "Modify system connections" -msgstr "Modificar las conexiones del sistema" +msgstr "Modificar conexiones de sistema" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 msgid "System policy prevents modification of system settings" -msgstr "" -"La política del sistema impide modificaciones de los ajustes del sistema" +msgstr "Política de sistema evita modificación de configuración de sistema" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 msgid "System policy prevents modification of the persistent system hostname" msgstr "" -"La política del sistema impide la modificaciones del nombre de equipo " -"persistente del sistema" +"Política de sistema evita modificación de nombre de host de sistema " +"persistente" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 msgid "System policy prevents sharing connections via a protected WiFi network" msgstr "" -"La política del sistema impide compartir conexiones a través de una red " -"inalámbrica protegida" +"Política de sistema evita compartir conexiones a través de una red WIFI " +"protegida" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 msgid "System policy prevents sharing connections via an open WiFi network" msgstr "" -"La política del sistema impide compartir conexiones a través de una red " -"inalámbrica abierta" - -#~ msgid "unable to join netlink group for monitoring link status: %s" -#~ msgstr "" -#~ "no pudo unirse al grupo netlink para monitorizar el estado del enlace: %s" +"Política de sistema evita compartir conexiones a través de una red WIFI " +"abierta" -#~ msgid "unable to connect to netlink: %s" -#~ msgstr "no se puede conectar con netlink: %s" -- cgit v1.2.1 From 6c9e27a57ed22f59946f82d742cc10f9df4e0f29 Mon Sep 17 00:00:00 2001 From: Sam Friedmann Date: Thu, 20 May 2010 18:49:56 -0700 Subject: po: updated French translation (rh #589230) --- po/fr.po | 1616 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 1510 insertions(+), 106 deletions(-) diff --git a/po/fr.po b/po/fr.po index b61f094831..f7cd9a2f76 100644 --- a/po/fr.po +++ b/po/fr.po @@ -1,266 +1,1670 @@ +# translation of fr.po to French # French translation of NetworkManager. # Copyright (C) 2004-2008 The GNOME Foundation. # This file is distributed under the same license as the NetworkManager package. # +# # Raphaël Tournoy , 2004. # Stéphane Raimbault , 2006-2008. # Jonathan Ernst , 2007. # Robert-André Mauchin , 2007-2008. -# +# Sam Friedmann , 2010. msgid "" msgstr "" -"Project-Id-Version: NetworkManager 0.7.0\n" +"Project-Id-Version: fr\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-09-25 22:59+0200\n" -"PO-Revision-Date: 2008-09-25 23:04+0200\n" -"Last-Translator: Claude Paroz \n" -"Language-Team: GNOME French Team \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 15:23+1000\n" +"Last-Translator: Sam Friedmann \n" +"Language-Team: French \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n>1;\n" +"X-Generator: KBabel 1.11.4\n" -#: ../src/nm-netlink-monitor.c:193 ../src/nm-netlink-monitor.c:474 -#, c-format -msgid "error processing netlink message: %s" -msgstr "erreur lors du traitement du message netlink : %s" +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NOM" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "PÉRIPHÉRIQUES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "ÉTENDUE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DÉFAUT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" -#: ../src/nm-netlink-monitor.c:250 +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 #, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" msgstr "" -"impossible d'allouer un gestionnaire netlink pour surveiller l'état de la " -"connexion : %s" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" -#: ../src/nm-netlink-monitor.c:260 +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 #, c-format -msgid "unable to connect to netlink for monitoring link status: %s" -msgstr "" -"impossible de se connecter à netlink pour surveiller l'état de la " -"connexion : %s" +msgid "Error: 'con list': %s" +msgstr "Erreur : 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Erreur : 'con list': %s ; champs autorisés : %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "Détails de connexion" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "système" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "utilisateur" -#: ../src/nm-netlink-monitor.c:268 +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "jamais" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "oui" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "non" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "Connexions système" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "Connexions utilisateur" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Erreur : l'argument %s est manquant." + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Erreur : %s - connexion introuvable." + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Paramètre inconnu : %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Erreur : aucun paramètre valide spécifié." + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "Erreur : %s." + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Erreur : 'con status' : %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Erreur : 'con status' : %s ; champs autorisés : %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "Connexions actives" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "aucune connexion active sur le périphérique '%s'" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "aucune connexion active ou périphérique" + +#: ../cli/src/connections.c:1084 #, c-format -msgid "unable to join netlink group for monitoring link status: %s" +msgid "device '%s' not compatible with connection '%s'" +msgstr "périphérique '%s' incompatible avec la connexion '%s'" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "aucun périphérique trouvé pour la connexion '%s'" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "activation" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "activé" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "inconnu" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "Connexion VPN (préparation)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "Connexion VPN (authentification requise)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "Connexion VPN" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "Connexion VPN (obtention de la configuration IP)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN connecté" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "Échec de la connexion VPN" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN déconnecté" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "raison inconnue" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "aucun" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "l'utilisateur a été déconnecté" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "la connexion réseau de base a été interrompue" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "arrêt inattendu du service VPN" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "le service VPN a retourné une configuration invalide" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "le délai d'attente de la tentative de connexion a été dépassé" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "le service VPN n'a pas démarré à temps" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "échec du démarrage du service VPN" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "aucun secret VPN valide" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "secrets VPN invalides" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "la connexion a été supprimée" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "état : %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "Connexion activée\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Erreur : Échec de l'activation de la connexion" + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "état : %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Erreur : L'activation de la connexion a échoué : %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Erreur : Le délai d'attente de %d sec a expiré." + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Erreur : L'activation de la connexion a échoué : %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Erreur : L'obtention d'une connexion active pour '%s' a échoué." + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "État de connexion active : %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "État de chemin actif : %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Erreur : Connexion inconnue : %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Erreur : Valeur de délai d'attente '%s' invalide." + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Erreur : ID ou UUID doit être spécifié." + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Erreur : Aucun périphérique convenable trouvé : %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "Erreur : Aucun périphérique convenable trouvé." + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Avertissement : Connexion inactive\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Erreur : Commande 'con' '%s' invalide." + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Erreur : impossible de connecter à D-Bus." + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Erreur : Paramètres système introuvables." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Erreur : Paramètres utilisteur introuvables." + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." msgstr "" -"impossible de joindre le groupe netlink pour surveiller l'état de la " -"connexion : %s" +"Erreur : Impossible d'obtenir les connexions : les services des " +"paramètres ne sont pas en cours d'exécution." + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "PÉRIPHÉRIQUE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "ÉTAT" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GÉNÉRAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITÉS" -#: ../src/nm-netlink-monitor.c:276 +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "PROPRIÉTÉS-WIFI" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "PA" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "PROPRIÉTÉS-CABLÉES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "PARAMÈTRES-IP4" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "DNS-IP4" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "PILOTE" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "DÉTECTION-OPÉRATEUR" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "VITESSE" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "OPÉRATEUR" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADRESSE" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PRÉFIXE" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "PASSERELLE" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "DÉBIT" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SÉCURITÉ" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "DRAPEAUX-WPA" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "DRAPEAUX-RSN" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIF" + +#: ../cli/src/devices.c:186 #, c-format -msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" msgstr "" -"impossible d'allouer un cache de connexion netlink pour surveiller l'état de " -"la connexion : %s" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "non-géré" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "indisponible" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "déconnecté" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "connexion (préparer)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "connexion (configuration)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "connexion (authentification requise)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "connexion (obtention de la configuration IP)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "connecté" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "échec de la connexion" -#: ../src/nm-netlink-monitor.c:439 +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "Inconnu" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(aucun)" + +#: ../cli/src/devices.c:302 #, c-format -msgid "error updating link cache: %s" -msgstr "erreur lors de la mise à jour du cache de connexion : %s" +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s : erreur lors de la conversion de l'adresse IP4 0x%X" -#: ../src/nm-netlink-monitor.c:497 -msgid "error occurred while waiting for data on socket" -msgstr "une erreur est survenue pendant l'attente de données sur le connecteur" +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" -#: ../src/NetworkManager.c:250 -msgid "Invalid option. Please use --help to see a list of valid options.\n" -msgstr "" -"Option non valide. Utilisez --help pour afficher une liste d'options " -"valides.\n" +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u Mo/s" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:89 -msgid "# Created by NetworkManager\n" -msgstr "# Créé par NetworkManager\n" +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "Chiffré : " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:95 +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "Enterprise " + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "Infrastructure" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "Erreur : 'dev list' : %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Erreur : 'dev list' : %s ; champs autorisés : %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "Détails périphérique" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(inconnu)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "inconnu)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mo/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "marche" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "arrêt" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "Erreur : 'dev status' : %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Erreur : 'dev status' : %s ; champs autorisés : %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "Statut des périphériques" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Erreur : L'argument '%s' est manquant." + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Erreur : Périphérique '%s' introuvable." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Opération réussie : Périphérique '%s' correctement déconnecté." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Erreur : Échec de la déconnexion du périphérique '%s' (%s) : %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "État du périphérique : %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Erreur : iface doit être spécifié." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "Erreur : 'dev wifi' : %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Erreur : 'dev wifi' : %s ; champs autorisés : %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "Liste du balayage WiFi" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Erreur : Point d'accès avec hwaddr '%s' introuvable." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Erreur : Le périphérique '%s' n'est pas un périphérique WiFi." + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Erreur : Commande 'dev wifi' '%s' invalide." + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Erreur : Commande 'dev' '%s' invalide." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "EN COURS D'EXÉCUTION" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "MATÉRIEL-WIFI" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "MATÉRIEL-WWAN" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 #, c-format msgid "" -"# Merged from %s\n" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" "\n" msgstr "" -"# Fusionné depuis %s\n" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" "\n" -#: ../src/named-manager/nm-named-manager.c:256 -msgid "NOTE: the libc resolver may not support more than 3 nameservers." +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "veille" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "connexion" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Erreur : 'nm status' : %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Erreur : 'nm status' : %s ; champs autorisés : %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "État de NetworkManager" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "activé" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "désactivé" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "actif" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "inactif" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Erreur : Valeur '--fields' '%s' est invalide ; champs autorisés : %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi activé" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Erreur : Paramètre 'wifi' invalide : '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN activé" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Erreur : Paramètre 'wwan' invalide : '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Erreur : Commande 'nm' '%s' invalide." + +#: ../cli/src/nmcli.c:69 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" msgstr "" -"NOTE : il se peut que le solveur libc ne prenne pas en charge plus de 3 serveurs de noms." +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] sortie laconique\n" +" -p[retty] sortie formatée\n" +" -m[ode] tabular|multiline mode de sortie\n" +" -f[ields] |all|common spécifie les champs à sortir\n" +" -e[scape] yes|no échapper les séprateurs de colonnes dans les valeurs\n" +" -v[ersion] afficher la version du programme\n" +" -h[elp] imprimer l'aide\n" +"\n" +"OBJECT\n" +" nm statut de NetworkManager\n" +" con connexions de NetworkManager\n" +" dev périphériques gérés par NetworkManager\n" +"\n" -#: ../src/named-manager/nm-named-manager.c:258 -msgid "The nameservers listed below may not be recognized." -msgstr "Les serveurs de noms listés ci-dessous peuvent ne pas être reconnus." +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Erreur : Objet '%s' inconnu, essayez 'nmcli help'." -#: ../system-settings/src/main.c:366 +#: ../cli/src/nmcli.c:143 #, c-format -msgid "Auto %s" -msgstr "Auto %s" +msgid "Error: Option '--terse' is specified the second time." +msgstr "Erreur : Option '--terse' est spécifiée la seconde fois." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Erreur : Option '--terse' est mutuellement exclusive avec '--pretty'." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Erreur : Option '--pretty' est spécifiée la seconde fois." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Erreur : Option '--pretty' est mutuellement exclusive avec '--terse'." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Erreur : argument manquant pour l'option '%s'." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Erreur : '%s' est un argument invalide pour l'option '%s'." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Erreur : Les champs pour les options '%s' sont manquants." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "outil nmcli, version %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Erreur : Option '%s' inconnue, essayez 'nmcli -help'." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "Signal %d reçu, arrêt en cours..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Erreur : Impossible de connecter à NetworkManager." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "Réussite" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-bit passphrase)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (inconnu)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (inconnu)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "any, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " -#: ../libnm-util/crypto.c:125 +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "auto" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "non défini" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "champ '%s' doit être seul" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "champ '%s' invalide" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Option '--terse' requiert la spécification de '--fields'" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "Option '--terse' requiert des valeurs d'options '--fields' spécifiques, pas '%s'" + +#: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." msgstr "Le fichier de clé PEM n'a pas de balise de fin « %s »." -#: ../libnm-util/crypto.c:135 +#: ../libnm-util/crypto.c:130 +#, c-format msgid "Doesn't look like a PEM private key file." msgstr "Cela ne semble pas être un fichier de clé privée PEM." -#: ../libnm-util/crypto.c:143 +#: ../libnm-util/crypto.c:138 +#, c-format msgid "Not enough memory to store PEM file data." msgstr "Mémoire insuffisante pour contenir les données du fichier PEM." -#: ../libnm-util/crypto.c:159 +#: ../libnm-util/crypto.c:154 +#, c-format msgid "Malformed PEM file: Proc-Type was not first tag." msgstr "Fichier PEM incorrect : Proc-Type n'est pas la première balise." -#: ../libnm-util/crypto.c:167 +#: ../libnm-util/crypto.c:162 #, c-format msgid "Malformed PEM file: unknown Proc-Type tag '%s'." msgstr "Fichier PEM incorrect : étiquette Proc-Type « %s » inconnue." -#: ../libnm-util/crypto.c:177 +#: ../libnm-util/crypto.c:172 +#, c-format msgid "Malformed PEM file: DEK-Info was not the second tag." msgstr "Fichier PEM incorrect : DEK-Info n'est pas la deuxième balise." -#: ../libnm-util/crypto.c:188 +#: ../libnm-util/crypto.c:183 +#, c-format msgid "Malformed PEM file: no IV found in DEK-Info tag." msgstr "Fichier PEM incorrect : aucun IV trouvé dans la balise DEK-Info." -#: ../libnm-util/crypto.c:195 +#: ../libnm-util/crypto.c:190 +#, c-format msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." -msgstr "Fichier PEM incorrect : format de IV invalide dans la balise DEK-Info." +msgstr "Fichier PEM incorrect : format IV invalide dans la balise DEK-Info." -#: ../libnm-util/crypto.c:208 +#: ../libnm-util/crypto.c:203 #, c-format msgid "Malformed PEM file: unknown private key cipher '%s'." msgstr "Fichier PEM incorrect : chiffre de clé privée « %s » inconnu." -#: ../libnm-util/crypto.c:227 +#: ../libnm-util/crypto.c:222 +#, c-format msgid "Could not decode private key." msgstr "Impossible de décoder la clé privée." -#: ../libnm-util/crypto.c:271 +#: ../libnm-util/crypto.c:267 #, c-format msgid "PEM certificate '%s' had no end tag '%s'." msgstr "Le certificat PEM « %s » n'a pas de balise de fin « %s »." -#: ../libnm-util/crypto.c:281 +#: ../libnm-util/crypto.c:277 +#, c-format msgid "Failed to decode certificate." msgstr "Impossible de décoder le certificat." -#: ../libnm-util/crypto.c:290 ../libnm-util/crypto.c:298 +#: ../libnm-util/crypto.c:286 +#, c-format msgid "Not enough memory to store certificate data." msgstr "Mémoire insuffisante pour contenir les données du certificat." -#: ../libnm-util/crypto.c:328 +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "Mémoire insuffisante pour contenir les données du fichier." + +#: ../libnm-util/crypto.c:324 +#, c-format msgid "IV must be an even number of bytes in length." -msgstr "La longueur en octets de IV doit être paire." +msgstr "La longueur en octets d'IV doit être paire." -#: ../libnm-util/crypto.c:337 +#: ../libnm-util/crypto.c:333 +#, c-format msgid "Not enough memory to store the IV." -msgstr "Mémoire insuffisante pour contenir IV." +msgstr "Mémoire insuffisante pour contenir l'IV." -#: ../libnm-util/crypto.c:348 +#: ../libnm-util/crypto.c:344 +#, c-format msgid "IV contains non-hexadecimal digits." -msgstr "IV contient des chiffres non-hexadécimaux." +msgstr "L'IV contient des chiffres non-hexadécimaux." -#: ../libnm-util/crypto.c:386 ../libnm-util/crypto_gnutls.c:143 -#: ../libnm-util/crypto_nss.c:157 +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "Le chiffre « %s » de la clé privée est inconnu." -#: ../libnm-util/crypto.c:395 -msgid "Not enough memory to create private key decryption key." -msgstr "" -"Mémoire insuffisante pour créer une clé de déchiffrement de la clé privée." +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "Mémoire insuffisante pour contenir la clé privée déchiffrée." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "Impossible de déterminer le type de la clé privée." -#: ../libnm-util/crypto.c:513 +#: ../libnm-util/crypto.c:530 +#, c-format msgid "Not enough memory to store decrypted private key." msgstr "Mémoire insuffisante pour contenir la clé privée déchiffrée." -#: ../libnm-util/crypto_gnutls.c:45 +#: ../libnm-util/crypto_gnutls.c:49 msgid "Failed to initialize the crypto engine." msgstr "L'initialisation du moteur de chiffrement a échoué." -#: ../libnm-util/crypto_gnutls.c:89 +#: ../libnm-util/crypto_gnutls.c:93 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." msgstr "L'initialisation du moteur MD5 a échoué : %s / %s." -#: ../libnm-util/crypto_gnutls.c:152 ../libnm-util/crypto_nss.c:166 +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Longueur IV invalide (minimum %zd)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format msgid "Not enough memory for decrypted key buffer." msgstr "Mémoire insuffisante pour le tampon de clé déchiffrée." -#: ../libnm-util/crypto_gnutls.c:160 +#: ../libnm-util/crypto_gnutls.c:173 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." -msgstr "" -"L'initialisation du contexte du chiffre de déchiffrement a échoué : %s / %s." +msgstr "L'initialisation du contexte du chiffre de déchiffrement a échoué : %s / %s." -#: ../libnm-util/crypto_gnutls.c:169 +#: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." -msgstr "" -"La définition de la clé symétrique pour le déchiffrement a échoué : %s / %s." +msgstr "La définition de la clé symétrique pour le déchiffrement a échoué : %s / %s." -#: ../libnm-util/crypto_gnutls.c:178 +#: ../libnm-util/crypto_gnutls.c:191 #, c-format msgid "Failed to set IV for decryption: %s / %s." -msgstr "La définition de IV pour le déchiffrement a échoué : %s / %s." +msgstr "La définition d'IV pour le déchiffrement a échoué : %s / %s." -#: ../libnm-util/crypto_gnutls.c:187 +#: ../libnm-util/crypto_gnutls.c:200 #, c-format msgid "Failed to decrypt the private key: %s / %s." msgstr "Le déchiffrement de la clé privée a échoué : %s / %s." -#: ../libnm-util/crypto_gnutls.c:225 +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "" +"Le déchiffrement de la clé privée a échoué : Longueur de remplissage " +"inattendue." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "Le déchiffrement de la clé privée a échoué." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Allocation de mémoire pour chiffrement impossible." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "" +"L'initialisation du contexte du cryptage de chiffrement a échoué : %s / " +"%s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "" +"La définition de la clé symétrique pour le chiffrement a échoué : %s / %" +"s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "La définition d'IV pour le chiffrement a échoué : %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Le chiffrement des données a échoué ; %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 #, c-format msgid "Error initializing certificate data: %s" msgstr "Erreur lors de l'initialisation des données du certificat : %s" -#: ../libnm-util/crypto_gnutls.c:237 +#: ../libnm-util/crypto_gnutls.c:384 #, c-format msgid "Couldn't decode certificate: %s" msgstr "Impossible de décoder le certificat : %s" -#: ../libnm-util/crypto_nss.c:52 +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "L'initialisation du décodeur PKCS#12 a échoué : %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Impossible de décoder le fichier PKCS#12 : %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "Impossible de vérifier le fichier PKCS#12 : %s" + +#: ../libnm-util/crypto_nss.c:56 #, c-format msgid "Failed to initialize the crypto engine: %d." msgstr "L'initialisation du moteur de chiffrement a échoué : %d." -#: ../libnm-util/crypto_nss.c:98 +#: ../libnm-util/crypto_nss.c:111 #, c-format msgid "Failed to initialize the MD5 context: %d." msgstr "L'initialisation du contexte MD5 a échoué : %d." -#: ../libnm-util/crypto_nss.c:174 +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Longueur IV invalide (minimum %d)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format msgid "Failed to initialize the decryption cipher slot." -msgstr "" -"L'initialisation de l'emplacement du chiffre de déchiffrement a échoué." +msgstr "L'initialisation de l'emplacement du chiffre de déchiffrement a échoué." -#: ../libnm-util/crypto_nss.c:184 +#: ../libnm-util/crypto_nss.c:206 +#, c-format msgid "Failed to set symmetric key for decryption." msgstr "La définition de la clé symétrique pour le déchiffrement a échoué." -#: ../libnm-util/crypto_nss.c:194 +#: ../libnm-util/crypto_nss.c:216 +#, c-format msgid "Failed to set IV for decryption." -msgstr "La définition de IV pour le déchiffrement a échoué." +msgstr "La définition d'IV pour le déchiffrement a échoué." -#: ../libnm-util/crypto_nss.c:202 +#: ../libnm-util/crypto_nss.c:224 +#, c-format msgid "Failed to initialize the decryption context." msgstr "L'initialisation du contexte de déchiffrement a échoué." -#: ../libnm-util/crypto_nss.c:215 +#: ../libnm-util/crypto_nss.c:237 #, c-format msgid "Failed to decrypt the private key: %d." msgstr "Le déchiffrement de la clé privée a échoué : %d." -#: ../libnm-util/crypto_nss.c:227 +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "" +"Le déchiffrement de la clé privée a échoué : les données déchiffrées " +"sont trop longues." + +#: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." msgstr "La finalisation du déchiffrement de la clé privée a échoué : %d." -#: ../libnm-util/crypto_nss.c:271 +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "L'initialisation de l'emplacement du cryptage de chiffrement a échoué." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "La définition de la clé symétrique pour le chiffrement a échoué." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "La définition d'IV pour le déchiffrement a échoué." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "L'initialisation du contexte de chiffrement a échoué." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Le chiffrement a échoué : %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Quantité de données inattendue après chiffrement." + +#: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" msgstr "Impossible de décoder le certificat : %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Impossible de convertir le mot de passe en UCS2 : %d." + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Impossible d'initialiser le décodeur PKCS#12 : %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Impossible de décoder le fichier PKCS#12 : %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Impossible de vérifier le fichier PKCS#12 : %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "Impossible des données aléatoires." + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Mémoire insuffisante pour créer une clé de chiffrement." + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "Allocation de mémoire pour la création du fichier PEM impossible." + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Allocation de mémoire pour l'écriture d'IV sur le fichier PEM impossible." + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "" +"Allocation de mémoire pour l'écriture de la clé chiffrée sur le fichier PEM " +"impossible." + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Allocation de mémoire pour les données du fichier PEM impossible." + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "erreur lors du traitement du message netlink : %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "une erreur est survenue pendant l'attente de données sur le connecteur" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "" +"impossible de se connecter à netlink pour surveiller l'état de la " +"connexion : %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "impossible d'activer le passage de crédentiels de gestion netlink : %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"impossible d'allouer un gestionnaire netlink pour surveiller l'état de la " +"connexion : %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "" +"impossible d'allouer un cache de connexion netlink pour surveiller l'état de " +"la connexion : %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "impossible de joindre le groupe netlink : %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "erreur lors de la mise à jour du cache de connexion : %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"Option non valide. Utilisez --help pour afficher une liste d'options " +"valides.\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. Veuillez utiliser --help pour afficher une liste d'options valides.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# Créé par NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Fusionné depuis %s\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "aucun client DHCP utilisable n'a pu être trouvé." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' a été trouvé.be found." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' introuvable." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "client DHCP '%s' non pris en charge" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "Niveau de journalisation inconnu '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "Domaine de journalisation inconnu '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "" +"NOTE : il se peut que le solveur libc ne prenne pas en charge plus de 3 " +"serveurs de noms." + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "Les serveurs de noms listés ci-dessous peuvent ne pas être reconnus." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "Auto %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "Système" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Partage de connexion via un réseau WiFi protégé" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Partage de connexion via un réseau WiFi ouvert" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Modifier le nom d'hôte du système persistant" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Modifier les connexions système" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "La stratégie du système empêche toute modification des paramètres du système" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "" +"La stratégie du système empêche toute modification du nom d'hôte du système " +"persistant" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"La stratégie du système empêche tout partage des connexions via un réseau " +"WiFi protégé" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"La stratégie du système empêche tout partage des connexions via un réseau " +"WiFi ouvert" + -- cgit v1.2.1 From cf3e838939d9fa11b17c04b3fa199c1e0fd25158 Mon Sep 17 00:00:00 2001 From: Kiyoto Hashida Date: Thu, 20 May 2010 18:50:23 -0700 Subject: po: updated Japanese translation (rh #589230) --- po/ja.po | 1137 +++++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 716 insertions(+), 421 deletions(-) diff --git a/po/ja.po b/po/ja.po index 7dc8ba50fc..dad755239c 100644 --- a/po/ja.po +++ b/po/ja.po @@ -8,9 +8,9 @@ msgid "" msgstr "" "Project-Id-Version: ja\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-04-30 03:24+0000\n" -"PO-Revision-Date: 2010-05-07 18:50+0900\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 16:04+0900\n" "Last-Translator: Kiyoto Hashida \n" "Language-Team: Japanese \n" "MIME-Version: 1.0\n" @@ -19,10 +19,78 @@ msgstr "" "Plural-Forms: Plural-Forms: nplurals=1; plural=0;\n\n" "\n" "\n" -"\n" "X-Generator: KBabel 1.11.4\n" -#: ../cli/src/connections.c:86 +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "名前" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "デバイス" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "範囲" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "デフォルト" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-サービス" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "スペックオブジェクト" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "タイプ" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "タイムスタンプ" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "タイムスタンプ-リアル" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "自動接続" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "読み込み専用" + +#: ../cli/src/connections.c:157 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -43,310 +111,514 @@ msgstr "" "]\n" " down id | uuid \n" -#: ../cli/src/connections.c:158 -msgid "Connections" -msgstr "接続" +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "エラー:'con list': %s" -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/devices.c:298 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "Type" -msgstr "タイプ" +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "エラー:'con list': %s ; 許可されるフィールド: %s" -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "UUID" -msgstr "UUID" +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "接続の詳細" -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Name" -msgstr "名前" +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "システム" -#: ../cli/src/connections.c:163 -#, c-format -msgid "System connections:\n" -msgstr "システム接続:\n" +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "ユーザー" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "しない" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "はい" -#: ../cli/src/connections.c:167 -#, c-format -msgid "User connections:\n" -msgstr "ユーザー接続:\n" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "いいえ" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "システム接続" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "ユーザー接続" -#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 -#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 -#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 -#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 -#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 #, c-format msgid "Error: %s argument is missing." msgstr "エラー: %s 引数がありません。" -#: ../cli/src/connections.c:189 +#: ../cli/src/connections.c:487 #, c-format msgid "Error: %s - no such connection." msgstr "エラー: %s - そのような接続はありません。" -#: ../cli/src/connections.c:196 -msgid "System-wide connections" -msgstr "システム全域接続" - -#: ../cli/src/connections.c:205 -msgid "User connections" -msgstr "ユーザー接続" - -#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 -#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 -#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 -#: ../cli/src/devices.c:798 +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 #, c-format msgid "Unknown parameter: %s\n" msgstr "不明なパラメータ: %s\n" -#: ../cli/src/connections.c:221 +#: ../cli/src/connections.c:528 #, c-format msgid "Error: no valid parameter specified." msgstr "エラー: 有効なパラメータが指定されていません。" -#. FIXME: Fix the output -#: ../cli/src/connections.c:268 ../cli/src/devices.c:302 -#: ../cli/src/devices.c:321 ../cli/src/devices.c:353 ../cli/src/devices.c:355 -#: ../cli/src/devices.c:357 ../cli/src/devices.c:359 ../cli/src/devices.c:361 -msgid "yes" -msgstr "はい" +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "エラー: %s" -#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 -msgid "no" -msgstr "いいえ" +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "エラー: 'con status': %s" -#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "エラー: 'con status': %s ; 許可されるフィールド: %s" + +#: ../cli/src/connections.c:658 msgid "Active connections" msgstr "アクティブな接続" -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 -msgid "Default" -msgstr "デフォルト" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Service" -msgstr "サービス" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Devices" -msgstr "デバイス" - -#: ../cli/src/connections.c:659 +#: ../cli/src/connections.c:1026 #, c-format msgid "no active connection on device '%s'" msgstr "デバイス '%s'上にアクティブな接続がありません" -#: ../cli/src/connections.c:667 +#: ../cli/src/connections.c:1034 #, c-format msgid "no active connection or device" msgstr "アクティブな接続、又はデバイスがありません" -#: ../cli/src/connections.c:730 +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "デバイス '%s' は接続 '%s' と互換性がありません" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "接続 '%s'用のデバイスが見付かりません" + +#: ../cli/src/connections.c:1097 msgid "activating" msgstr "アクティベート中" -#: ../cli/src/connections.c:732 +#: ../cli/src/connections.c:1099 msgid "activated" msgstr "アクティベート済み" -#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 -#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 -#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 msgid "unknown" msgstr "不明" -#: ../cli/src/connections.c:744 +#: ../cli/src/connections.c:1111 msgid "VPN connecting (prepare)" msgstr "VPN 接続(準備)" -#: ../cli/src/connections.c:746 +#: ../cli/src/connections.c:1113 msgid "VPN connecting (need authentication)" msgstr "VPN 接続(認証が必要)" -#: ../cli/src/connections.c:748 +#: ../cli/src/connections.c:1115 msgid "VPN connecting" msgstr "VPN 接続" -#: ../cli/src/connections.c:750 +#: ../cli/src/connections.c:1117 msgid "VPN connecting (getting IP configuration)" msgstr "VPN 接続(IP 設定を取得)" -#: ../cli/src/connections.c:752 +#: ../cli/src/connections.c:1119 msgid "VPN connected" msgstr "VPN 接続済み" -#: ../cli/src/connections.c:754 +#: ../cli/src/connections.c:1121 msgid "VPN connection failed" msgstr "VPN 接続失敗" -#: ../cli/src/connections.c:756 +#: ../cli/src/connections.c:1123 msgid "VPN disconnected" msgstr "VPN 切断済み" -#: ../cli/src/connections.c:767 +#: ../cli/src/connections.c:1134 msgid "unknown reason" msgstr "不明な理由" -#: ../cli/src/connections.c:769 +#: ../cli/src/connections.c:1136 msgid "none" msgstr "なし" -#: ../cli/src/connections.c:771 +#: ../cli/src/connections.c:1138 msgid "the user was disconnected" msgstr "ユーザーの接続が切断されました。" -#: ../cli/src/connections.c:773 +#: ../cli/src/connections.c:1140 msgid "the base network connection was interrupted" msgstr "基本ネットワーク接続が妨害されました。" -#: ../cli/src/connections.c:775 +#: ../cli/src/connections.c:1142 msgid "the VPN service stopped unexpectedly" msgstr "VPN サービスが予期しない停止をしました" -#: ../cli/src/connections.c:777 +#: ../cli/src/connections.c:1144 msgid "the VPN service returned invalid configuration" msgstr "VPN サービスは無効な設定を返しました" -#: ../cli/src/connections.c:779 +#: ../cli/src/connections.c:1146 msgid "the connection attempt timed out" msgstr "接続試行は時間切れです" -#: ../cli/src/connections.c:781 +#: ../cli/src/connections.c:1148 msgid "the VPN service did not start in time" msgstr "VPN サービスは時間内に開始していません" -#: ../cli/src/connections.c:783 +#: ../cli/src/connections.c:1150 msgid "the VPN service failed to start" msgstr "VPN サービスの開始は失敗しました" -#: ../cli/src/connections.c:785 +#: ../cli/src/connections.c:1152 msgid "no valid VPN secrets" msgstr "有効な VPN シークレットはありません" -#: ../cli/src/connections.c:787 +#: ../cli/src/connections.c:1154 msgid "invalid VPN secrets" msgstr "無効な VPN シークレット" -#: ../cli/src/connections.c:789 +#: ../cli/src/connections.c:1156 msgid "the connection was removed" msgstr "接続は削除されました" -#: ../cli/src/connections.c:803 +#: ../cli/src/connections.c:1170 #, c-format msgid "state: %s\n" msgstr "状態: %s\n" -#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 #, c-format msgid "Connection activated\n" msgstr "接続はアクティベート済み\n" -#: ../cli/src/connections.c:809 +#: ../cli/src/connections.c:1176 #, c-format msgid "Error: Connection activation failed." msgstr "エラー: 接続のアクティベーションに失敗" -#: ../cli/src/connections.c:828 +#: ../cli/src/connections.c:1195 #, c-format msgid "state: %s (%d)\n" msgstr "状態: %s (%d)\n" -#: ../cli/src/connections.c:838 +#: ../cli/src/connections.c:1205 #, c-format msgid "Error: Connection activation failed: %s." msgstr "エラー: 接続のアクティベーションに失敗: %s." -#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 #, c-format msgid "Error: Timeout %d sec expired." msgstr "エラー: 制限時間の %d 秒が経過" -#: ../cli/src/connections.c:898 +#: ../cli/src/connections.c:1265 #, c-format msgid "Error: Connection activation failed: %s" msgstr "エラー: 接続のアクティベーションに失敗: %s" -#: ../cli/src/connections.c:912 +#: ../cli/src/connections.c:1279 #, c-format msgid "Error: Obtaining active connection for '%s' failed." msgstr "エラー: '%s'用のアクティブ接続の取得に失敗" -#: ../cli/src/connections.c:921 +#: ../cli/src/connections.c:1288 #, c-format msgid "Active connection state: %s\n" msgstr "アクティブ接続の状態: %s\n" -#: ../cli/src/connections.c:922 +#: ../cli/src/connections.c:1289 #, c-format msgid "Active connection path: %s\n" msgstr "アクティブ接続のパス: %s\n" -#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 #, c-format msgid "Error: Unknown connection: %s." msgstr "エラー: 不明な接続: %s" -#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 #, c-format msgid "Error: timeout value '%s' is not valid." msgstr "エラー: 制限時間値の '%s' は有効でありません" -#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 #, c-format msgid "Error: id or uuid has to be specified." msgstr "エラー: id か又は uuid の指定が必要です" -#: ../cli/src/connections.c:1044 +#: ../cli/src/connections.c:1411 #, c-format msgid "Error: No suitable device found: %s." msgstr "エラー: 適切なデバイスが見付かりません: %s" -#: ../cli/src/connections.c:1046 +#: ../cli/src/connections.c:1413 #, c-format msgid "Error: No suitable device found." msgstr "エラー: 適切なデバイスが見付かりません" -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1505 #, c-format msgid "Warning: Connection not active\n" msgstr "警告: 接続はアクティブでありません\n" -#: ../cli/src/connections.c:1189 +#: ../cli/src/connections.c:1561 #, c-format msgid "Error: 'con' command '%s' is not valid." msgstr "エラー: 'con' コマンド '%s' は有効ではありません" -#: ../cli/src/connections.c:1216 +#: ../cli/src/connections.c:1597 #, c-format msgid "Error: could not connect to D-Bus." msgstr "エラー: D-Bus に接続できませんでした" -#: ../cli/src/connections.c:1223 +#: ../cli/src/connections.c:1604 #, c-format msgid "Error: Could not get system settings." msgstr "エラー: システム設定を取得できませんでした" -#: ../cli/src/connections.c:1231 +#: ../cli/src/connections.c:1612 #, c-format msgid "Error: Could not get user settings." msgstr "エラー: ユーザー設定を取得できませんでした" -#: ../cli/src/connections.c:1241 +#: ../cli/src/connections.c:1622 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "エラー: 接続を取得できません: 設定サービスが稼働していません" +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "デバイス" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "状態" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "全般" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "能力" + +#. 1 #: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-プロパティ" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "有線接続-プロパティ" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-セッティング" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "ドライバー" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "キャリア検出" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "速度" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "キャリア" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "アドレス" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "接頭辞" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "ゲートウェイ" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "モード" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "周波数" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "レート" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "信号" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "セキュリティ" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-フラグ" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-フラグ" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "アクティブ" + +#: ../cli/src/devices.c:186 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -356,7 +628,7 @@ msgid "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" msgstr "" "使用法: nmcli dev { COMMAND | help }\n" @@ -366,349 +638,236 @@ msgstr "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" -#: ../cli/src/devices.c:93 +#: ../cli/src/devices.c:206 msgid "unmanaged" msgstr "管理無し" -#: ../cli/src/devices.c:95 +#: ../cli/src/devices.c:208 msgid "unavailable" msgstr "利用不可" -#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 msgid "disconnected" msgstr "切断済み" -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:212 msgid "connecting (prepare)" msgstr "接続中(準備)" -#: ../cli/src/devices.c:101 +#: ../cli/src/devices.c:214 msgid "connecting (configuring)" msgstr "接続中(設定中)" -#: ../cli/src/devices.c:103 +#: ../cli/src/devices.c:216 msgid "connecting (need authentication)" msgstr "接続中(認証が必要)" -#: ../cli/src/devices.c:105 +#: ../cli/src/devices.c:218 msgid "connecting (getting IP configuration)" msgstr "接続中(IP 設定を取得中)" -#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 msgid "connected" msgstr "接続済み" -#: ../cli/src/devices.c:109 +#: ../cli/src/devices.c:222 msgid "connection failed" msgstr "接続に失敗" -#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 msgid "Unknown" msgstr "不明" -#. print them -#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 -#: ../cli/src/devices.c:879 +#: ../cli/src/devices.c:277 msgid "(none)" msgstr "(なし)" -#: ../cli/src/devices.c:209 +#: ../cli/src/devices.c:302 #, c-format msgid "%s: error converting IP4 address 0x%X" msgstr "%s: IP4 アドレス 0x%X を変換中にエラー発生" -#: ../cli/src/devices.c:238 +#: ../cli/src/devices.c:349 #, c-format -msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" -msgstr "%s, %s, 周波数 %d MHz, レート %d Mb/s, 強さ %d" - -#: ../cli/src/devices.c:239 -msgid "Ad-Hoc" -msgstr "アドホック" - -#: ../cli/src/devices.c:248 -msgid ", Encrypted: " -msgstr ", 暗号化:" - -#: ../cli/src/devices.c:253 -msgid " WEP" -msgstr " WEP" - -#: ../cli/src/devices.c:255 -msgid " WPA" -msgstr " WPA" - -#: ../cli/src/devices.c:257 -msgid " WPA2" -msgstr " WPA2" +msgid "%u MHz" +msgstr "%u MHz" -#: ../cli/src/devices.c:260 -msgid " Enterprise" -msgstr " Enterprise" +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" -#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "Device" -msgstr "デバイス" +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "暗号化:" -#: ../cli/src/devices.c:299 -msgid "Driver" -msgstr "ドライバー" +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " -#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 -msgid "(unknown)" -msgstr "(不明)" +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " -#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "State" -msgstr "状態" +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " -#: ../cli/src/devices.c:313 -msgid "HW Address" -msgstr "HW アドレス" +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "Enterprise " -#: ../cli/src/devices.c:319 -#, c-format -msgid "" -"\n" -" Capabilities:\n" -msgstr "" -"\n" -" 能力:\n" +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "アドホック" -#: ../cli/src/devices.c:321 -msgid "Carrier Detect" -msgstr "キャリア検出" +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "インフラストラクチャ" -#: ../cli/src/devices.c:336 +#: ../cli/src/devices.c:442 #, c-format -msgid "%u Mb/s" -msgstr "%u Mb/s" +msgid "Error: 'dev list': %s" +msgstr "エラー: 'dev list': %s" -#: ../cli/src/devices.c:337 -msgid "Speed" -msgstr "速度" - -#: ../cli/src/devices.c:348 +#: ../cli/src/devices.c:444 #, c-format -msgid "" -"\n" -" Wireless Properties\n" -msgstr "" -"\n" -" 無線接続のプロパティ\n" - -#: ../cli/src/devices.c:353 -msgid "WEP Encryption" -msgstr "WEP 暗号化" - -#: ../cli/src/devices.c:355 -msgid "WPA Encryption" -msgstr "WPA 暗号化" +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "エラー: 'dev list': %s; 許可されるフィールド: %s" -#: ../cli/src/devices.c:357 -msgid "WPA2 Encryption" -msgstr "WPA2 暗号化" +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "デバイスの詳細" -#: ../cli/src/devices.c:359 -msgid "TKIP cipher" -msgstr "TKIP 暗号" - -#: ../cli/src/devices.c:361 -msgid "CCMP cipher" -msgstr "CCMP 暗号" - -#: ../cli/src/devices.c:368 -#, c-format -msgid "" -"\n" -" Wireless Access Points %s\n" -msgstr "" -"\n" -" 無線アクセスポイント %s\n" +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(不明)" -#: ../cli/src/devices.c:368 -msgid "(* = current AP)" -msgstr "(* = 現在の AP)" +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "不明)" -#: ../cli/src/devices.c:374 +#: ../cli/src/devices.c:510 #, c-format -msgid "" -"\n" -" Wired Properties\n" -msgstr "" -"\n" -" 有線接続のプロパティ\n" - -#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 -msgid "Carrier" -msgstr "キャリア" +msgid "%u Mb/s" +msgstr "%u Mb/s" -#: ../cli/src/devices.c:377 +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 msgid "on" msgstr "オン" -#: ../cli/src/devices.c:379 +#: ../cli/src/devices.c:583 msgid "off" msgstr "オフ" -#: ../cli/src/devices.c:387 +#: ../cli/src/devices.c:710 #, c-format -msgid "" -"\n" -" IPv4 Settings:\n" -msgstr "" -"\n" -" IPv4 セッティング:\n" - -#: ../cli/src/devices.c:395 -msgid "Address" -msgstr "アドレス" - -#: ../cli/src/devices.c:401 -msgid "Prefix" -msgstr "接頭辞" +msgid "Error: 'dev status': %s" +msgstr "エラー: 'dev status': %s" -#: ../cli/src/devices.c:405 -msgid "Gateway" -msgstr "ゲートウェイ" - -#: ../cli/src/devices.c:416 -msgid "DNS" -msgstr "DNS" +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "エラー: 'dev status': %s; 許可されるフィールド: %s" -#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:719 msgid "Status of devices" msgstr "デバイスのステータス" -#: ../cli/src/devices.c:487 +#: ../cli/src/devices.c:747 #, c-format msgid "Error: '%s' argument is missing." msgstr "エラー: '%s' 引数がありません。" -#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 #, c-format msgid "Error: Device '%s' not found." msgstr "エラー: デバイス'%s' が見付かりません" -#: ../cli/src/devices.c:539 +#: ../cli/src/devices.c:799 #, c-format msgid "Success: Device '%s' successfully disconnected." msgstr "成功: デバイス '%s' は正常に切断されました。" -#: ../cli/src/devices.c:564 +#: ../cli/src/devices.c:824 #, c-format msgid "Error: Device '%s' (%s) disconnecting failed: %s" msgstr "エラー: デバイス '%s' (%s) の切断に失敗しました: %s" -#: ../cli/src/devices.c:572 +#: ../cli/src/devices.c:832 #, c-format msgid "Device state: %d (%s)\n" msgstr "デバイスの状態: %d (%s)\n" -#: ../cli/src/devices.c:636 +#: ../cli/src/devices.c:896 #, c-format msgid "Error: iface has to be specified." msgstr "エラー: iface を指定する必要があります。" -#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 -msgid "WiFi scan list" -msgstr "WiFi スキャン一覧" - -#: ../cli/src/devices.c:740 +#: ../cli/src/devices.c:1011 #, c-format -msgid "Error: Device '%s' is not a WiFi device." -msgstr "エラー: デバイス '%s' は WiFi デバイスではありません。" +msgid "Error: 'dev wifi': %s" +msgstr "エラー: 'dev wifi': %s" -#: ../cli/src/devices.c:754 -msgid "Device:" -msgstr "デバイス:" - -#: ../cli/src/devices.c:806 +#: ../cli/src/devices.c:1013 #, c-format -msgid "Error: hwaddr has to be specified." -msgstr "エラー: hwaddr を指定する必要があります。" +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "エラー: 'dev wifi': %s; 許可されるフィールド: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi スキャン一覧" -#: ../cli/src/devices.c:844 +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 #, c-format msgid "Error: Access point with hwaddr '%s' not found." msgstr "エラー: hwaddr '%s' のアクセスポイントが見付かりません" -#: ../cli/src/devices.c:862 -#, c-format -msgid "%u MHz" -msgstr "%u MHz" - -#: ../cli/src/devices.c:863 +#: ../cli/src/devices.c:1072 #, c-format -msgid "%u MB/s" -msgstr "%u MB/s" - -#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 -msgid "AP parameters" -msgstr "AP パラメータ" - -#: ../cli/src/devices.c:873 -msgid "SSID:" -msgstr "SSID:" - -#: ../cli/src/devices.c:874 -msgid "BSSID:" -msgstr "BSSID:" - -#: ../cli/src/devices.c:875 -msgid "Frequency:" -msgstr "周波数:" - -#: ../cli/src/devices.c:876 -msgid "Mode:" -msgstr "モード:" - -#: ../cli/src/devices.c:876 -msgid "Ad-hoc" -msgstr "アドホック" - -#: ../cli/src/devices.c:876 -msgid "Infrastructure" -msgstr "インフラストラクチャ" - -#: ../cli/src/devices.c:877 -msgid "Maximal bitrate:" -msgstr "最大ビットレート:" - -#: ../cli/src/devices.c:878 -msgid "Strength:" -msgstr "強さ:" - -#: ../cli/src/devices.c:879 -msgid "Flags:" -msgstr "フラグ:" - -#: ../cli/src/devices.c:879 -msgid "privacy" -msgstr "プライバシー" - -#: ../cli/src/devices.c:880 -msgid "WPA flags:" -msgstr "WPA フラグ:" - -#: ../cli/src/devices.c:881 -msgid "RSN flags:" -msgstr "RSN フラグ:" +msgid "Error: Device '%s' is not a WiFi device." +msgstr "エラー: デバイス '%s' は WiFi デバイスではありません。" -#: ../cli/src/devices.c:907 +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: 'dev wifi' command '%s' is not valid." msgstr "エラー: 'dev wifi' コマンド '%s' は無効です。" -#: ../cli/src/devices.c:943 +#: ../cli/src/devices.c:1183 #, c-format msgid "Error: 'dev' command '%s' is not valid." msgstr "エラー: 'dev' コマンド '%s' は無効です。" -#: ../cli/src/network-manager.c:46 +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "実行中" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI ハードウェア" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN ハードウェア" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 #, c-format msgid "" "Usage: nmcli nm { COMMAND | help }\n" @@ -733,89 +892,91 @@ msgstr "" " wwan [on|off]\n" "\n" -#: ../cli/src/network-manager.c:67 +#: ../cli/src/network-manager.c:83 msgid "asleep" msgstr "休止中" -#: ../cli/src/network-manager.c:69 +#: ../cli/src/network-manager.c:85 msgid "connecting" msgstr "接続中" -#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 -#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 -#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 -msgid "enabled" -msgstr "有効" +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "エラー: 'nm status': %s" -#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 -#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 -#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 -msgid "disabled" -msgstr "無効" +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "エラー: 'nm status': %s; 許可されるフィールド: %s" -#: ../cli/src/network-manager.c:102 +#: ../cli/src/network-manager.c:134 msgid "NetworkManager status" msgstr "NetworkManager のステータス" -#: ../cli/src/network-manager.c:104 -msgid "NM running:" -msgstr "NM が実行中:" +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "有効" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "無効" -#: ../cli/src/network-manager.c:104 +#: ../cli/src/network-manager.c:148 msgid "running" msgstr "実行中" -#: ../cli/src/network-manager.c:104 +#: ../cli/src/network-manager.c:148 msgid "not running" msgstr "実行していません" -#: ../cli/src/network-manager.c:105 -msgid "NM state:" -msgstr "NM の状態: " - -#: ../cli/src/network-manager.c:106 -msgid "NM wireless hardware:" -msgstr "NM ワイヤレスハードウェア:" - -#. no argument, show current state -#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 -msgid "NM wireless:" -msgstr "NM ワイヤレス:" - -#: ../cli/src/network-manager.c:108 -msgid "NM WWAN hardware:" -msgstr "NM WWAN ハードウェア:" +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "エラー: '--fields' の値 '%s' はここでは有効ではありません; 許可されるフィールド: %s" -#. no argument, show current state -#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 -msgid "NM WWAN:" -msgstr "NM WWAN:" +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi は有効です" -#: ../cli/src/network-manager.c:150 +#: ../cli/src/network-manager.c:220 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." msgstr "エラー: 無効な'wifi' パラメータ: '%s'" -#: ../cli/src/network-manager.c:167 +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN は有効です" + +#: ../cli/src/network-manager.c:252 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." msgstr "エラー: 無効な'wwan' パラメータ: '%s'" -#: ../cli/src/network-manager.c:178 +#: ../cli/src/network-manager.c:263 #, c-format msgid "Error: 'nm' command '%s' is not valid." msgstr "エラー: 'nm' コマンド '%s' は無効です。" -#: ../cli/src/nmcli.c:65 +#: ../cli/src/nmcli.c:69 #, c-format msgid "" "Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" "\n" "OPTIONS\n" -" -t[erse] terse output\n" -" -p[retty] pretty output\n" -" -v[ersion] show program version\n" -" -h[elp] print this help\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" "\n" "OBJECT\n" " nm NetworkManager status\n" @@ -826,10 +987,14 @@ msgstr "" "使用法: %s [OPTIONS] OBJECT { COMMAND | help }\n" "\n" "OPTIONS\n" -" -t[erse] terse output\n" -" -p[retty] pretty output\n" -" -v[ersion] show program version\n" -" -h[elp] print this help\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" "\n" "OBJECT\n" " nm NetworkManager status\n" @@ -837,35 +1002,165 @@ msgstr "" " dev devices managed by NetworkManager\n" "\n" -#: ../cli/src/nmcli.c:106 +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "エラー: オブジェクト '%s' は不明です。'nmcli help' を試して下さい。" + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "エラー: オプション '--terse' は2回目の指定です。" + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "エラー: オプション '--terse' は '--pretty' と相互に独占的です。" + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "エラー: オプション '--pretty' は2回目の指定です。" + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "エラー: オプション '--pretty' は '--terse' と相互に独占的です。" + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "エラー: %s オプション用の引数がありません。" + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 #, c-format -msgid "Object '%s' is unknown, try 'nmcli help'." -msgstr "オブジェクト'%s' は不明です。'nmcli help' を試して下さい。" +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "エラー: '%s' は '%s' オプション用の有効な引数ではありません。" -#: ../cli/src/nmcli.c:139 +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "エラー: '%s' オプション用のフィールドがありません。" + +#: ../cli/src/nmcli.c:209 #, c-format msgid "nmcli tool, version %s\n" msgstr "nmcli ツール、バージョン %s\n" -#: ../cli/src/nmcli.c:145 +#: ../cli/src/nmcli.c:215 #, c-format -msgid "Option '%s' is unknown, try 'nmcli -help'." -msgstr "オプション '%s' は不明です、'nmcli -help' を試して下さい。" +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "エラー: オプション '%s' は不明です、'nmcli -help' を試して下さい。" -#: ../cli/src/nmcli.c:164 +#: ../cli/src/nmcli.c:234 #, c-format msgid "Caught signal %d, shutting down..." msgstr "シグナル %d が出ました、シャットダウンします..." -#: ../cli/src/nmcli.c:189 +#: ../cli/src/nmcli.c:259 #, c-format msgid "Error: Could not connect to NetworkManager." msgstr "エラー: NetworkManager へ接続出来ませんでした。" -#: ../cli/src/nmcli.c:205 +#: ../cli/src/nmcli.c:275 msgid "Success" msgstr "成功" +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-bit パスフレーズ)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (不明)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (不明)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "いずれでも、" + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "自動" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "セットされていません" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "フィールド '%s' は孤立する必要があります" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "無効なフィールド '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "オプション '--terse' には '--fields' の指定が必要です" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "オプション'--terse' には特定の '--fields' オプションの値が必要で、 '%s' ではありません" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." @@ -1181,26 +1476,26 @@ msgstr "PKCS#12 ファイルを確証出来ません: %d" msgid "Could not generate random data." msgstr "ランダムデータを生成できません。" -#: ../libnm-util/nm-utils.c:1924 +#: ../libnm-util/nm-utils.c:1925 #, c-format msgid "Not enough memory to make encryption key." msgstr "暗号化キーを作成するのに十分なメモリーがありません。" -#: ../libnm-util/nm-utils.c:2034 +#: ../libnm-util/nm-utils.c:2035 msgid "Could not allocate memory for PEM file creation." msgstr "PEM ファイル作成用にメモリーを割り当て出来ません。" -#: ../libnm-util/nm-utils.c:2046 +#: ../libnm-util/nm-utils.c:2047 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "PEM ファイルへの IV の書き込み用にメモリーを割り当て出来ません。" -#: ../libnm-util/nm-utils.c:2058 +#: ../libnm-util/nm-utils.c:2059 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "PEM ファイルへの暗号化キーの書き込み用にメモリーを割り当て出来ません。" -#: ../libnm-util/nm-utils.c:2077 +#: ../libnm-util/nm-utils.c:2078 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "PEM ファイルデータ用にメモリーを割り当て出来ません。" @@ -1308,7 +1603,7 @@ msgstr "以下の一覧にあるネームサーバーは認識されないかも msgid "Auto %s" msgstr "自動 %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3254 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 msgid "System" msgstr "システム" -- cgit v1.2.1 From cc6086aec90e193e1654e51196659e7ea4a0ef30 Mon Sep 17 00:00:00 2001 From: Sandeep Shedmake Date: Thu, 20 May 2010 18:51:01 -0700 Subject: po: updated Marathi translation (rh #589230) --- po/mr.po | 1140 +++++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 718 insertions(+), 422 deletions(-) diff --git a/po/mr.po b/po/mr.po index 33cb1976e8..d2bc41c869 100644 --- a/po/mr.po +++ b/po/mr.po @@ -7,9 +7,9 @@ msgid "" msgstr "" "Project-Id-Version: mr\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-04-30 03:24+0000\n" -"PO-Revision-Date: 2010-05-10 13:46+0530\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-10 10:40+0530\n" "Last-Translator: Sandeep Shedmake \n" "Language-Team: Marathi \n" "MIME-Version: 1.0\n" @@ -18,7 +18,76 @@ msgstr "" "X-Generator: KBabel 1.11.4\n" "Plural-Forms: nplurals=2; plural=(n!=1);\n" -#: ../cli/src/connections.c:86 +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -39,310 +108,514 @@ msgstr "" "]\n" " down id | uuid \n" -#: ../cli/src/connections.c:158 -msgid "Connections" -msgstr "जोडण्या" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/devices.c:298 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "Type" -msgstr "प्रकार" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "UUID" -msgstr "UUID" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Name" -msgstr "नाव" - -#: ../cli/src/connections.c:163 +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 #, c-format -msgid "System connections:\n" -msgstr "प्रणाली जोडण्या:\n" +msgid "Error: 'con list': %s" +msgstr "त्रुटी: 'con list': %s" -#: ../cli/src/connections.c:167 +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 #, c-format -msgid "User connections:\n" -msgstr "वापरकर्ताच्या जोडण्या:\n" +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "त्रुटी: 'con list': %s; स्वीकार्य क्षेत्र: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "जोडणीचे तपशील" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "प्रणाली" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "वापरकर्ता" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "कधिच नाही" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "होय" -#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 -#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 -#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 -#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 -#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "नाही" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "प्रणाली जोडणी" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "वापरकर्त्याची जोडणी" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 #, c-format msgid "Error: %s argument is missing." msgstr "त्रुटी: %s घटक आढळले नाही." -#: ../cli/src/connections.c:189 +#: ../cli/src/connections.c:487 #, c-format msgid "Error: %s - no such connection." msgstr "त्रुटी: %s - याप्रकारची जोडणी आढळली नाही." -#: ../cli/src/connections.c:196 -msgid "System-wide connections" -msgstr "प्रणाली-भर जोडण्या" - -#: ../cli/src/connections.c:205 -msgid "User connections" -msgstr "वापरकर्त्याची जोडणी" - -#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 -#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 -#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 -#: ../cli/src/devices.c:798 +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 #, c-format msgid "Unknown parameter: %s\n" msgstr "अपरिचीत घटक: %s\n" -#: ../cli/src/connections.c:221 +#: ../cli/src/connections.c:528 #, c-format msgid "Error: no valid parameter specified." msgstr "त्रुटी: वैध घटक निर्देशीत नाही." -#. FIXME: Fix the output -#: ../cli/src/connections.c:268 ../cli/src/devices.c:302 -#: ../cli/src/devices.c:321 ../cli/src/devices.c:353 ../cli/src/devices.c:355 -#: ../cli/src/devices.c:357 ../cli/src/devices.c:359 ../cli/src/devices.c:361 -msgid "yes" -msgstr "होय" +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "त्रुटी: %s." -#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 -msgid "no" -msgstr "नाही" +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "त्रुटी: 'con status': %s" -#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "त्रुटी: 'con status': %s; स्वीकार्य क्षेत्र: %s" + +#: ../cli/src/connections.c:658 msgid "Active connections" msgstr "सक्रिय जोडणी" -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 -msgid "Default" -msgstr "पूर्वनिर्धारीत" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Service" -msgstr "सर्व्हिस्" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Devices" -msgstr "साधणे" - -#: ../cli/src/connections.c:659 +#: ../cli/src/connections.c:1026 #, c-format msgid "no active connection on device '%s'" msgstr "साधण '%s' वरील सक्रिय जोडणी आढळली नाही" -#: ../cli/src/connections.c:667 +#: ../cli/src/connections.c:1034 #, c-format msgid "no active connection or device" msgstr "सक्रिय जोडणी किंवा साधण आढळले नाही" -#: ../cli/src/connections.c:730 +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "साधण '%s' जोडणी '%s' सह सहत्व नाही" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "जोडणी '%s' करीता साधण आढळले नाही" + +#: ../cli/src/connections.c:1097 msgid "activating" msgstr "सक्रिय करत आहे" -#: ../cli/src/connections.c:732 +#: ../cli/src/connections.c:1099 msgid "activated" msgstr "सक्रिय केले" -#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 -#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 -#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 msgid "unknown" msgstr "अपरिचीत" -#: ../cli/src/connections.c:744 +#: ../cli/src/connections.c:1111 msgid "VPN connecting (prepare)" msgstr "VPN जोडणी (तयार करा)" -#: ../cli/src/connections.c:746 +#: ../cli/src/connections.c:1113 msgid "VPN connecting (need authentication)" msgstr "VPN जोडणी (ओळख पटवणे आवश्यक आहे)" -#: ../cli/src/connections.c:748 +#: ../cli/src/connections.c:1115 msgid "VPN connecting" msgstr "VPN जोडणी" -#: ../cli/src/connections.c:750 +#: ../cli/src/connections.c:1117 msgid "VPN connecting (getting IP configuration)" msgstr "VPN जोडणी (IP संरचना प्राप्त करत आहे)" -#: ../cli/src/connections.c:752 +#: ../cli/src/connections.c:1119 msgid "VPN connected" msgstr "VPN जोडणी यशस्वी" -#: ../cli/src/connections.c:754 +#: ../cli/src/connections.c:1121 msgid "VPN connection failed" msgstr "VPN जोडणी अपयशी" -#: ../cli/src/connections.c:756 +#: ../cli/src/connections.c:1123 msgid "VPN disconnected" msgstr "VPN जोडणी खंडीत झाली" -#: ../cli/src/connections.c:767 +#: ../cli/src/connections.c:1134 msgid "unknown reason" msgstr "अपरिचीत कारण" -#: ../cli/src/connections.c:769 +#: ../cli/src/connections.c:1136 msgid "none" msgstr "काहिच नाही" -#: ../cli/src/connections.c:771 +#: ../cli/src/connections.c:1138 msgid "the user was disconnected" msgstr "वापरकर्ता खंडीत झाले" -#: ../cli/src/connections.c:773 +#: ../cli/src/connections.c:1140 msgid "the base network connection was interrupted" msgstr "बेस नेटवर्क जोडणी खंडीत झाले" -#: ../cli/src/connections.c:775 +#: ../cli/src/connections.c:1142 msgid "the VPN service stopped unexpectedly" msgstr "VPN सेवा अनपेक्षीतरित्या थांबली" -#: ../cli/src/connections.c:777 +#: ../cli/src/connections.c:1144 msgid "the VPN service returned invalid configuration" msgstr "VPN सेवाने अवैध संरचना रिटर्न केली" -#: ../cli/src/connections.c:779 +#: ../cli/src/connections.c:1146 msgid "the connection attempt timed out" msgstr "जोडणी प्रयत्नाची वेळ समाप्ती आढळली" -#: ../cli/src/connections.c:781 +#: ../cli/src/connections.c:1148 msgid "the VPN service did not start in time" msgstr "VPN सेवा वेळेवर सुरू झाली नाही" -#: ../cli/src/connections.c:783 +#: ../cli/src/connections.c:1150 msgid "the VPN service failed to start" msgstr "VPN सेवा सुरू होण्यास अपयशी" -#: ../cli/src/connections.c:785 +#: ../cli/src/connections.c:1152 msgid "no valid VPN secrets" msgstr "वैध VPN गोपणीयता आढळले नाही" -#: ../cli/src/connections.c:787 +#: ../cli/src/connections.c:1154 msgid "invalid VPN secrets" msgstr "अवैध VPN गोपणीयता" -#: ../cli/src/connections.c:789 +#: ../cli/src/connections.c:1156 msgid "the connection was removed" msgstr "जोडणी काढून टाकली" -#: ../cli/src/connections.c:803 +#: ../cli/src/connections.c:1170 #, c-format msgid "state: %s\n" msgstr "स्तर: %s\n" -#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 #, c-format msgid "Connection activated\n" msgstr "जोडणी सक्रिय केली\n" -#: ../cli/src/connections.c:809 +#: ../cli/src/connections.c:1176 #, c-format msgid "Error: Connection activation failed." msgstr "त्रुटी: जोडणी सक्रिय करण्यास अपयशी." -#: ../cli/src/connections.c:828 +#: ../cli/src/connections.c:1195 #, c-format msgid "state: %s (%d)\n" msgstr "स्तर: %s (%d)\n" -#: ../cli/src/connections.c:838 +#: ../cli/src/connections.c:1205 #, c-format msgid "Error: Connection activation failed: %s." msgstr "त्रुटी: जोडणी सक्रिय करण्यास अपयशी: %s." -#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 #, c-format msgid "Error: Timeout %d sec expired." msgstr "त्रुटी: वेळसमाप्ती %d सेकंद समाप्त." -#: ../cli/src/connections.c:898 +#: ../cli/src/connections.c:1265 #, c-format msgid "Error: Connection activation failed: %s" msgstr "त्रुटी: जोडणी सक्रिय करण्यास अपयशी: %s" -#: ../cli/src/connections.c:912 +#: ../cli/src/connections.c:1279 #, c-format msgid "Error: Obtaining active connection for '%s' failed." msgstr "त्रुटी: '%s' करीता सक्रिय जोडणी प्राप्त करण्यास अपयशी." -#: ../cli/src/connections.c:921 +#: ../cli/src/connections.c:1288 #, c-format msgid "Active connection state: %s\n" msgstr "सक्रिय जोडणीचे स्तर: %s\n" -#: ../cli/src/connections.c:922 +#: ../cli/src/connections.c:1289 #, c-format msgid "Active connection path: %s\n" msgstr "सक्रिय जोडणीचे मार्ग: %s\n" -#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 #, c-format msgid "Error: Unknown connection: %s." msgstr "त्रुटी: अपरिचीत जोडणी: %s." -#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 #, c-format msgid "Error: timeout value '%s' is not valid." msgstr "त्रुटी: वेळसमाप्तीचे मुल्य '%s' वैध नाही." -#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 #, c-format msgid "Error: id or uuid has to be specified." msgstr "त्रुटी: id किंवा uuid निर्देशीत करणे आवश्यक आहे." -#: ../cli/src/connections.c:1044 +#: ../cli/src/connections.c:1411 #, c-format msgid "Error: No suitable device found: %s." msgstr "त्रुटी: योग्य साधण आढळले नाही: %s." -#: ../cli/src/connections.c:1046 +#: ../cli/src/connections.c:1413 #, c-format msgid "Error: No suitable device found." msgstr "त्रुटी: योग्य साधण आढळले नाही." -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1505 #, c-format msgid "Warning: Connection not active\n" msgstr "सावधान: जोडणी सक्रिय नाही\n" -#: ../cli/src/connections.c:1189 +#: ../cli/src/connections.c:1561 #, c-format msgid "Error: 'con' command '%s' is not valid." msgstr "त्रुटी: 'con' आदेश '%s' वैध नाही." -#: ../cli/src/connections.c:1216 +#: ../cli/src/connections.c:1597 #, c-format msgid "Error: could not connect to D-Bus." msgstr "त्रुटी: D-Bus सह जोडणी करणे अशक्य." -#: ../cli/src/connections.c:1223 +#: ../cli/src/connections.c:1604 #, c-format msgid "Error: Could not get system settings." msgstr "त्रुटी: प्रणालीची संयोजना प्राप्त करणे अशक्य." -#: ../cli/src/connections.c:1231 +#: ../cli/src/connections.c:1612 #, c-format msgid "Error: Could not get user settings." msgstr "त्रुटी: वापरकर्ताची संयोजना प्राप्त करणे अशक्य." -#: ../cli/src/connections.c:1241 +#: ../cli/src/connections.c:1622 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "त्रुटी: जोडणी प्राप्त करण्यास अशक्य: सेटिंग्स् सेवा कार्यरत नाही." +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 #: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:186 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -352,7 +625,7 @@ msgid "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" msgstr "" "वापर: nmcli dev { COMMAND | help }\n" @@ -362,349 +635,236 @@ msgstr "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" -#: ../cli/src/devices.c:93 +#: ../cli/src/devices.c:206 msgid "unmanaged" msgstr "अव्यवस्थापीत" -#: ../cli/src/devices.c:95 +#: ../cli/src/devices.c:208 msgid "unavailable" msgstr "अनुपल्बध" -#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 msgid "disconnected" msgstr "खंडीत" -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:212 msgid "connecting (prepare)" msgstr "जोडणी (तयार करत आहे)" -#: ../cli/src/devices.c:101 +#: ../cli/src/devices.c:214 msgid "connecting (configuring)" msgstr "जोडणी (संरचीत करत आहे)" -#: ../cli/src/devices.c:103 +#: ../cli/src/devices.c:216 msgid "connecting (need authentication)" msgstr "जोडणी (ओळख पटवणे आवश्यक आहे)" -#: ../cli/src/devices.c:105 +#: ../cli/src/devices.c:218 msgid "connecting (getting IP configuration)" msgstr "जोडणी (IP संरचना प्राप्त करत आहे)" -#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 msgid "connected" msgstr "जोडणी यशस्वी" -#: ../cli/src/devices.c:109 +#: ../cli/src/devices.c:222 msgid "connection failed" msgstr "जोडणी अपयशी" -#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 msgid "Unknown" msgstr "अपरिचीत" -#. print them -#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 -#: ../cli/src/devices.c:879 +#: ../cli/src/devices.c:277 msgid "(none)" msgstr "(काहिच नाही)" -#: ../cli/src/devices.c:209 +#: ../cli/src/devices.c:302 #, c-format msgid "%s: error converting IP4 address 0x%X" msgstr "%s: IP4 पत्ता 0x%X यांस रूपांतरीत करतेवेळी त्रुटी" -#: ../cli/src/devices.c:238 +#: ../cli/src/devices.c:349 #, c-format -msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" -msgstr "%s, %s, क्रिक %d MHz, रेट %d Mb/s, स्ट्रेंग्थ् %d" - -#: ../cli/src/devices.c:239 -msgid "Ad-Hoc" -msgstr "ऍड-हॉक" - -#: ../cli/src/devices.c:248 -msgid ", Encrypted: " -msgstr ", एनक्रिप्टेड: " - -#: ../cli/src/devices.c:253 -msgid " WEP" -msgstr " WEP" +msgid "%u MHz" +msgstr "%u MHz" -#: ../cli/src/devices.c:255 -msgid " WPA" -msgstr " WPA" +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" -#: ../cli/src/devices.c:257 -msgid " WPA2" -msgstr " WPA2" +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "एनक्रिप्टेड: " -#: ../cli/src/devices.c:260 -msgid " Enterprise" -msgstr " एंटरप्राइज" +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " -#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "Device" -msgstr "साधण" +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " -#: ../cli/src/devices.c:299 -msgid "Driver" -msgstr "ड्राइव्हर" +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " -#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 -msgid "(unknown)" -msgstr "(अपरिचीत)" +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "एंटरप्राइज" -#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "State" -msgstr "स्तर" +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "ऍड-हॉक" -#: ../cli/src/devices.c:313 -msgid "HW Address" -msgstr "HW पत्ता" +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "इंफ्रास्ट्रक्चर" -#: ../cli/src/devices.c:319 +#: ../cli/src/devices.c:442 #, c-format -msgid "" -"\n" -" Capabilities:\n" -msgstr "" -"\n" -" क्षमता:\n" - -#: ../cli/src/devices.c:321 -msgid "Carrier Detect" -msgstr "कॅरिअर आढळले" +msgid "Error: 'dev list': %s" +msgstr "त्रुटी: 'dev list': %s" -#: ../cli/src/devices.c:336 +#: ../cli/src/devices.c:444 #, c-format -msgid "%u Mb/s" -msgstr "%u Mb/s" +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "त्रुटी: 'dev list': %s; स्वीकार्य क्षेत्र: %s" -#: ../cli/src/devices.c:337 -msgid "Speed" -msgstr "गती" +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "साधणाचे तपशील" -#: ../cli/src/devices.c:348 -#, c-format -msgid "" -"\n" -" Wireless Properties\n" -msgstr "" -"\n" -" वायरलेस् गुणधर्म\n" - -#: ../cli/src/devices.c:353 -msgid "WEP Encryption" -msgstr "WEP एनक्रिप्शन" - -#: ../cli/src/devices.c:355 -msgid "WPA Encryption" -msgstr "WPA एनक्रिप्शन" - -#: ../cli/src/devices.c:357 -msgid "WPA2 Encryption" -msgstr "WPA2 एनक्रिप्शन" - -#: ../cli/src/devices.c:359 -msgid "TKIP cipher" -msgstr "TKIP सिफर" - -#: ../cli/src/devices.c:361 -msgid "CCMP cipher" -msgstr "CCMP सिफर" - -#: ../cli/src/devices.c:368 -#, c-format -msgid "" -"\n" -" Wireless Access Points %s\n" -msgstr "" -"\n" -" वायरलेस् ऍक्सेस् पॉईंटस् %s\n" +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(अपरिचीत)" -#: ../cli/src/devices.c:368 -msgid "(* = current AP)" -msgstr "(* = सध्याचे AP)" +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "अपरिचीत)" -#: ../cli/src/devices.c:374 +#: ../cli/src/devices.c:510 #, c-format -msgid "" -"\n" -" Wired Properties\n" -msgstr "" -"\n" -" वायर्ड् गुणधर्म\n" - -#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 -msgid "Carrier" -msgstr "कॅरिअर" +msgid "%u Mb/s" +msgstr "%u Mb/s" -#: ../cli/src/devices.c:377 +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 msgid "on" msgstr "सुरू करा" -#: ../cli/src/devices.c:379 +#: ../cli/src/devices.c:583 msgid "off" msgstr "बंद करा" -#: ../cli/src/devices.c:387 +#: ../cli/src/devices.c:710 #, c-format -msgid "" -"\n" -" IPv4 Settings:\n" -msgstr "" -"\n" -" IPv4 संरचना:\n" - -#: ../cli/src/devices.c:395 -msgid "Address" -msgstr "पत्ता" - -#: ../cli/src/devices.c:401 -msgid "Prefix" -msgstr "प्रिफिक्स्" +msgid "Error: 'dev status': %s" +msgstr "त्रुटी: 'dev status': %s" -#: ../cli/src/devices.c:405 -msgid "Gateway" -msgstr "गेटवे" - -#: ../cli/src/devices.c:416 -msgid "DNS" -msgstr "DNS" +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "त्रुटी: 'dev status': %s; स्वीकार्य क्षेत्र: %s" -#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:719 msgid "Status of devices" msgstr "साधणांची स्थिती" -#: ../cli/src/devices.c:487 +#: ../cli/src/devices.c:747 #, c-format msgid "Error: '%s' argument is missing." msgstr "त्रुटी: '%s' घटक आढळले नाही." -#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 #, c-format msgid "Error: Device '%s' not found." msgstr "त्रुटी: साधण '%s' आढळले नाही." -#: ../cli/src/devices.c:539 +#: ../cli/src/devices.c:799 #, c-format msgid "Success: Device '%s' successfully disconnected." msgstr "यशस्वी: साधण '%s' यशस्वीरित्या खंडीत झाले." -#: ../cli/src/devices.c:564 +#: ../cli/src/devices.c:824 #, c-format msgid "Error: Device '%s' (%s) disconnecting failed: %s" msgstr "त्रुटी: साधण '%s' (%s) खंडीत होणे अपयशी झाले: %s" -#: ../cli/src/devices.c:572 +#: ../cli/src/devices.c:832 #, c-format msgid "Device state: %d (%s)\n" msgstr "साधणाचे स्तर: %d (%s)\n" -#: ../cli/src/devices.c:636 +#: ../cli/src/devices.c:896 #, c-format msgid "Error: iface has to be specified." msgstr "त्रुटी: iface निर्देशीत करणे आवश्यक आहे." -#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 -msgid "WiFi scan list" -msgstr "WiFi स्कॅन सूची" - -#: ../cli/src/devices.c:740 +#: ../cli/src/devices.c:1011 #, c-format -msgid "Error: Device '%s' is not a WiFi device." -msgstr "त्रुटी: साधण '%s' WiFi साधण नाही." - -#: ../cli/src/devices.c:754 -msgid "Device:" -msgstr "साधण:" +msgid "Error: 'dev wifi': %s" +msgstr "त्रुटी: 'dev wifi': %s" -#: ../cli/src/devices.c:806 +#: ../cli/src/devices.c:1013 #, c-format -msgid "Error: hwaddr has to be specified." -msgstr "त्रुटी: hwaddr निर्देशीत करणे आवश्यक आहे." +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "त्रुटी: 'dev wifi': %s; स्वीकार्य क्षेत्र: %s" -#: ../cli/src/devices.c:844 +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi स्कॅन सूची" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 #, c-format msgid "Error: Access point with hwaddr '%s' not found." msgstr "त्रुटी: ऍक्सेस पॉईंट hwaddr '%s' सह आढळले नाही." -#: ../cli/src/devices.c:862 -#, c-format -msgid "%u MHz" -msgstr "%u MHz" - -#: ../cli/src/devices.c:863 +#: ../cli/src/devices.c:1072 #, c-format -msgid "%u MB/s" -msgstr "%u MB/s" - -#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 -msgid "AP parameters" -msgstr "AP घटके" - -#: ../cli/src/devices.c:873 -msgid "SSID:" -msgstr "SSID:" - -#: ../cli/src/devices.c:874 -msgid "BSSID:" -msgstr "BSSID:" - -#: ../cli/src/devices.c:875 -msgid "Frequency:" -msgstr "क्रिक्वेंसी:" - -#: ../cli/src/devices.c:876 -msgid "Mode:" -msgstr "मोड:" - -#: ../cli/src/devices.c:876 -msgid "Ad-hoc" -msgstr "ऍड-हॉक" - -#: ../cli/src/devices.c:876 -msgid "Infrastructure" -msgstr "इंफ्रास्ट्रक्चर" - -#: ../cli/src/devices.c:877 -msgid "Maximal bitrate:" -msgstr "कमाल बिटरेट:" - -#: ../cli/src/devices.c:878 -msgid "Strength:" -msgstr "स्ट्रेंग्थ्:" - -#: ../cli/src/devices.c:879 -msgid "Flags:" -msgstr "फ्लॅग्स्:" - -#: ../cli/src/devices.c:879 -msgid "privacy" -msgstr "गोपणीयता" - -#: ../cli/src/devices.c:880 -msgid "WPA flags:" -msgstr "WPA फ्लॅग्स्:" - -#: ../cli/src/devices.c:881 -msgid "RSN flags:" -msgstr "RSN फ्लॅग्स्:" +msgid "Error: Device '%s' is not a WiFi device." +msgstr "त्रुटी: साधण '%s' WiFi साधण नाही." -#: ../cli/src/devices.c:907 +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: 'dev wifi' command '%s' is not valid." msgstr "त्रुटी: 'dev wifi' आदेश '%s' वैध नाही." -#: ../cli/src/devices.c:943 +#: ../cli/src/devices.c:1183 #, c-format msgid "Error: 'dev' command '%s' is not valid." msgstr "त्रुटी: 'dev' आदेश '%s' वैध नाही." -#: ../cli/src/network-manager.c:46 +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "RUNNING" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 #, c-format msgid "" "Usage: nmcli nm { COMMAND | help }\n" @@ -729,89 +889,91 @@ msgstr "" " wwan [on|off]\n" "\n" -#: ../cli/src/network-manager.c:67 +#: ../cli/src/network-manager.c:83 msgid "asleep" msgstr "अस्लीप्" -#: ../cli/src/network-manager.c:69 +#: ../cli/src/network-manager.c:85 msgid "connecting" msgstr "जोडणी करत आहे" -#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 -#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 -#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 -msgid "enabled" -msgstr "सुरू केले" +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "त्रुटी: 'nm status': %s" -#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 -#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 -#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 -msgid "disabled" -msgstr "बंद केले" +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "त्रुटी: 'nm status': %s; स्वीकार्य क्षेत्र: %s" -#: ../cli/src/network-manager.c:102 +#: ../cli/src/network-manager.c:134 msgid "NetworkManager status" msgstr "NetworkManager स्थिती" -#: ../cli/src/network-manager.c:104 -msgid "NM running:" -msgstr "NM सुरू आहे:" +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "सुरू केले" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "बंद केले" -#: ../cli/src/network-manager.c:104 +#: ../cli/src/network-manager.c:148 msgid "running" msgstr "कार्यरत आहे" -#: ../cli/src/network-manager.c:104 +#: ../cli/src/network-manager.c:148 msgid "not running" msgstr "कार्यरत नाही" -#: ../cli/src/network-manager.c:105 -msgid "NM state:" -msgstr "NM स्तर:" - -#: ../cli/src/network-manager.c:106 -msgid "NM wireless hardware:" -msgstr "NM वायरलेस् हार्डवेअर:" - -#. no argument, show current state -#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 -msgid "NM wireless:" -msgstr "NM वायरलेस्:" - -#: ../cli/src/network-manager.c:108 -msgid "NM WWAN hardware:" -msgstr "NM WWAN हार्डवेअर:" +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "त्रुटी: येथील '--fields' मूल्य '%s' वैध नाही; स्वीकार्य क्षेत्र: %s" -#. no argument, show current state -#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 -msgid "NM WWAN:" -msgstr "NM WWAN:" +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi समर्थीत" -#: ../cli/src/network-manager.c:150 +#: ../cli/src/network-manager.c:220 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." msgstr "त्रुटी: अवैध 'wifi' घटक: '%s'." -#: ../cli/src/network-manager.c:167 +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN समर्थीत" + +#: ../cli/src/network-manager.c:252 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." msgstr "त्रुटी: अवैध 'wwan' घटक: '%s'." -#: ../cli/src/network-manager.c:178 +#: ../cli/src/network-manager.c:263 #, c-format msgid "Error: 'nm' command '%s' is not valid." msgstr "त्रुटी: 'nm' आदेश '%s' वैध नाही." -#: ../cli/src/nmcli.c:65 +#: ../cli/src/nmcli.c:69 #, c-format msgid "" "Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" "\n" "OPTIONS\n" -" -t[erse] terse output\n" -" -p[retty] pretty output\n" -" -v[ersion] show program version\n" -" -h[elp] print this help\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" "\n" "OBJECT\n" " nm NetworkManager status\n" @@ -822,10 +984,14 @@ msgstr "" "वापर: %s [OPTIONS] OBJECT { COMMAND | help }\n" "\n" "OPTIONS\n" -" -t[erse] terse output\n" -" -p[retty] pretty output\n" -" -v[ersion] show program version\n" -" -h[elp] print this help\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" "\n" "OBJECT\n" " nm NetworkManager status\n" @@ -833,35 +999,165 @@ msgstr "" " dev devices managed by NetworkManager\n" "\n" -#: ../cli/src/nmcli.c:106 +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "त्रुटी: घटक '%s' अपरिचीत आहे, 'nmcli help' वापरून पहा." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "त्रुटी: पर्याय '--terse' दुसऱ्यावेळी निर्देशीत केले." + +#: ../cli/src/nmcli.c:148 #, c-format -msgid "Object '%s' is unknown, try 'nmcli help'." -msgstr "घटक '%s' अपरिचीत आहे, 'nmcli help' वापरून पहा." +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "त्रुटी: '--pretty' च्या तुलनेत पर्याय '--terse' वेगळे आहे." -#: ../cli/src/nmcli.c:139 +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "त्रुटी: पर्याय '--pretty' दुसऱ्यावेळी निर्देशीत केले." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "त्रुटी: '--terse' च्या तुलनेत पर्याय '--pretty' वेगळे आहे." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "त्रुटी: '%s' पर्यायकरीता न आढळलेले घटक." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "त्रुटी: '%s' पर्यायकरीता '%s' वैध घटक नाही." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "त्रुटी: '%s' पर्यायकरीता क्षेत्र आढळले नाही." + +#: ../cli/src/nmcli.c:209 #, c-format msgid "nmcli tool, version %s\n" msgstr "nmcli साधण, आवृत्ती %s\n" -#: ../cli/src/nmcli.c:145 +#: ../cli/src/nmcli.c:215 #, c-format -msgid "Option '%s' is unknown, try 'nmcli -help'." -msgstr "पर्याय '%s' अपरिचीत आहे, 'nmcli -help' वापरून पहा." +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "त्रुटी: पर्याय '%s' अपरिचीत आहे, 'nmcli -help' वापरून पहा." -#: ../cli/src/nmcli.c:164 +#: ../cli/src/nmcli.c:234 #, c-format msgid "Caught signal %d, shutting down..." msgstr "संकेत %d प्राप्त झाले, बंद करत आहे..." -#: ../cli/src/nmcli.c:189 +#: ../cli/src/nmcli.c:259 #, c-format msgid "Error: Could not connect to NetworkManager." msgstr "त्रुटी: NetworkManager सह जोडणी करण्यास अशक्य." -#: ../cli/src/nmcli.c:205 +#: ../cli/src/nmcli.c:275 msgid "Success" msgstr "यश" +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-बीट पासफ्रेज)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (अपरिचीत)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (अपरिचीत)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "कुठलेही, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "स्वयं" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "सेट केले नाही" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "क्षेत्र '%s' वेगळे असायला हवे" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "अवैध क्षेत्र '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "पर्याय '--terse' यांस '--fields' निर्देशीत करणे आवश्यक आहे" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "पर्याय '--terse' यांस '--fields' पर्याय मूल्ये निर्देशीत करणे आवश्यक आहे , '%s' नाही" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." @@ -1177,26 +1473,26 @@ msgstr "PKCS#12 फाइल तपास करण्यास अशक्य: msgid "Could not generate random data." msgstr "विनाक्रम डाटा निर्माण करणे अशक्य." -#: ../libnm-util/nm-utils.c:1924 +#: ../libnm-util/nm-utils.c:1925 #, c-format msgid "Not enough memory to make encryption key." msgstr "एनक्रिप्शन कि निर्माण करण्यास अतिरीक्त मेमरी आढळली नाही." -#: ../libnm-util/nm-utils.c:2034 +#: ../libnm-util/nm-utils.c:2035 msgid "Could not allocate memory for PEM file creation." msgstr "PEM फाइल निर्माणकरीता मेमरीचे वाटप करणे अशक्य." -#: ../libnm-util/nm-utils.c:2046 +#: ../libnm-util/nm-utils.c:2047 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "IV ला PEM फाइलवर लिहण्यासाठी मेमरीचे वाटप करणे अशक्य." -#: ../libnm-util/nm-utils.c:2058 +#: ../libnm-util/nm-utils.c:2059 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "एनक्रिप्टेड किला PEM फाइलवर लिहण्यासाठी मेमरीचे वाटप करणे अशक्य." -#: ../libnm-util/nm-utils.c:2077 +#: ../libnm-util/nm-utils.c:2078 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "PEM फाइल डाटाकरीता मेमरीचे वाटप करणे अशक्य." @@ -1304,7 +1600,7 @@ msgstr "खालिल यादीतील नेमसर्व्हर् msgid "Auto %s" msgstr "स्वयं %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3254 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 msgid "System" msgstr "प्रणाली" -- cgit v1.2.1 From c1b3b137d977f97f101751d0aea80e5a8d595962 Mon Sep 17 00:00:00 2001 From: Yulia Date: Thu, 20 May 2010 18:51:40 -0700 Subject: po: updated Russian translation (rh #589230) --- po/ru.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/po/ru.po b/po/ru.po index d9df5d3f03..eaf0b8964c 100644 --- a/po/ru.po +++ b/po/ru.po @@ -10,8 +10,8 @@ msgstr "" "Project-Id-Version: ru\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-05-06 14:31+0530\n" -"PO-Revision-Date: 2010-05-07 14:56+1000\n" -"Last-Translator: Yulia \n" +"PO-Revision-Date: 2010-05-19 12:20+1000\n" +"Last-Translator: \n" "Language-Team: Russian\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -490,7 +490,7 @@ msgstr "СВОЙСТВА ПРОВОДНОГО СОЕДИНЕНИЯ" #. 4 #: ../cli/src/devices.c:76 msgid "IP4-SETTINGS" -msgstr "НАСТРОЙКИ IP4" +msgstr "ПАРАМЕТРЫ IP4" #. 5 #: ../cli/src/devices.c:77 -- cgit v1.2.1 From fa70542c618665cf203a2b71fa0e504f759f7902 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 22 May 2010 08:55:30 -0700 Subject: core: add networking enable/disable knob distinct from sleep/wake (rh #589108) (bgo #346615) Since forever we've used sleep/wake as the way to implement Networking Enabled. When the state file was introduced to make the networking and wifi states persistent, we ran into a bug where a failed suspend (like if the machine ran out of power while suspended) would result in networking being disabled on reboot since suspend/resume used the same knob as enable/disable. This patch adds a distinct call for enable/disable networking which changes the state file, while sleep/wake no longer change the state file. --- introspection/nm-manager-client.xml | 6 ++ introspection/nm-manager.xml | 29 +++++- libnm-glib/libnm-glib.ver | 2 + libnm-glib/nm-client.c | 49 ++++++++-- libnm-glib/nm-client.h | 6 +- src/nm-manager.c | 177 +++++++++++++++++++++++++----------- src/nm-manager.h | 10 +- src/nm-policy.c | 9 +- 8 files changed, 220 insertions(+), 68 deletions(-) diff --git a/introspection/nm-manager-client.xml b/introspection/nm-manager-client.xml index 9a0d4da214..7a9e311ca7 100644 --- a/introspection/nm-manager-client.xml +++ b/introspection/nm-manager-client.xml @@ -39,6 +39,12 @@ object. dbus-glib generates the same bound function names for D-Bus the methods + + + + + + diff --git a/introspection/nm-manager.xml b/introspection/nm-manager.xml index 3adbd9cb2b..46db5afd8b 100644 --- a/introspection/nm-manager.xml +++ b/introspection/nm-manager.xml @@ -87,7 +87,10 @@ - Control the NetworkManager daemon's sleep state. When asleep, all interfaces that it manages are deactivated. When awake, devices are available to be activated. + Control the NetworkManager daemon's sleep state. When asleep, all + interfaces that it manages are deactivated. When awake, devices are + available to be activated. This command should not be called directly + by users or clients; it is intended for system suspend/resume tracking. @@ -96,6 +99,23 @@ + + + + Control whether overall networking is enabled or disabled. When + disabled, all interfaces that NM manages are deactivated. When enabled, + all managed interfaces are re-enabled and available to be activated. + This command should be used by clients that provide to users the ability + to enable/disable all networking. + + + + If FALSE, indicates that all networking should be disabled. If TRUE, + indicates that NetworkManager should begin managing network devices. + + + + @@ -118,6 +138,13 @@ + + + Indicates if overall networking is currently enabled or not. See the + Enable() method. + + + Indicates if wireless is currently enabled or not. diff --git a/libnm-glib/libnm-glib.ver b/libnm-glib/libnm-glib.ver index 47312d01bb..6d48fb38eb 100644 --- a/libnm-glib/libnm-glib.ver +++ b/libnm-glib/libnm-glib.ver @@ -36,6 +36,8 @@ global: nm_client_get_manager_running; nm_client_get_state; nm_client_get_type; + nm_client_networking_get_enabled; + nm_client_networking_set_enabled; nm_client_new; nm_client_sleep; nm_client_wireless_get_enabled; diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c index 05fa4dbf24..dd10e247ad 100644 --- a/libnm-glib/nm-client.c +++ b/libnm-glib/nm-client.c @@ -18,7 +18,7 @@ * Boston, MA 02110-1301 USA. * * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2008 Red Hat, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. */ #include @@ -58,6 +58,7 @@ typedef struct { GPtrArray *devices; GPtrArray *active_connections; + gboolean networking_enabled; gboolean wireless_enabled; gboolean wireless_hw_enabled; @@ -69,6 +70,7 @@ enum { PROP_0, PROP_STATE, PROP_MANAGER_RUNNING, + PROP_NETWORKING_ENABLED, PROP_WIRELESS_ENABLED, PROP_WIRELESS_HARDWARE_ENABLED, PROP_WWAN_ENABLED, @@ -250,6 +252,7 @@ register_for_property_changed (NMClient *client) NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client); const NMPropertiesChangedInfo property_changed_info[] = { { NM_CLIENT_STATE, _nm_object_demarshal_generic, &priv->state }, + { NM_CLIENT_NETWORKING_ENABLED, _nm_object_demarshal_generic, &priv->networking_enabled }, { NM_CLIENT_WIRELESS_ENABLED, _nm_object_demarshal_generic, &priv->wireless_enabled }, { NM_CLIENT_WIRELESS_HARDWARE_ENABLED, _nm_object_demarshal_generic, &priv->wireless_hw_enabled }, { NM_CLIENT_WWAN_ENABLED, _nm_object_demarshal_generic, &priv->wwan_enabled }, @@ -427,6 +430,9 @@ get_property (GObject *object, case PROP_MANAGER_RUNNING: g_value_set_boolean (value, priv->manager_running); break; + case PROP_NETWORKING_ENABLED: + g_value_set_boolean (value, priv->networking_enabled); + break; case PROP_WIRELESS_ENABLED: g_value_set_boolean (value, priv->wireless_enabled); break; @@ -489,6 +495,19 @@ nm_client_class_init (NMClientClass *client_class) FALSE, G_PARAM_READABLE)); + /** + * NMClient::networking-enabled: + * + * Whether networking is enabled. + **/ + g_object_class_install_property + (object_class, PROP_NETWORKING_ENABLED, + g_param_spec_boolean (NM_CLIENT_NETWORKING_ENABLED, + "NetworkingEnabled", + "Is networking enabled", + TRUE, + G_PARAM_READABLE)); + /** * NMClient::wireless-enabled: * @@ -1042,26 +1061,40 @@ nm_client_get_state (NMClient *client) } /** - * nm_client_sleep: + * nm_client_networking_set_enabled: * @client: a #NMClient - * @sleep: %TRUE to put the daemon to sleep + * @enabled: %TRUE to set networking enabled, %FALSE to set networking disabled * - * Enables or disables networking. When the daemon is put to sleep, it'll deactivate and disable - * all the active devices. + * Enables or disables networking. When networking is disabled, all controlled + * interfaces are disconnected and deactivated. When networking is enabled, + * all controlled interfaces are available for activation. **/ void -nm_client_sleep (NMClient *client, gboolean sleep) +nm_client_networking_set_enabled (NMClient *client, gboolean enable) { GError *err = NULL; g_return_if_fail (NM_IS_CLIENT (client)); - if (!org_freedesktop_NetworkManager_sleep (NM_CLIENT_GET_PRIVATE (client)->client_proxy, sleep, &err)) { - g_warning ("Error in sleep: %s", err->message); + if (!org_freedesktop_NetworkManager_enable (NM_CLIENT_GET_PRIVATE (client)->client_proxy, enable, &err)) { + g_warning ("Error enabling/disabling networking: %s", err->message); g_error_free (err); } } +/** + * nm_client_sleep: + * @client: a #NMClient + * @sleep: %TRUE to put the daemon to sleep + * + * Deprecated; use nm_client_networking_set_enabled() instead. + **/ +void +nm_client_sleep (NMClient *client, gboolean sleep) +{ + nm_client_networking_set_enabled (client, !sleep); +} + /** * nm_client_get_manager_running: * @client: a #NMClient diff --git a/libnm-glib/nm-client.h b/libnm-glib/nm-client.h index 6aafc0872c..6b912e05aa 100644 --- a/libnm-glib/nm-client.h +++ b/libnm-glib/nm-client.h @@ -18,7 +18,7 @@ * Boston, MA 02110-1301 USA. * * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2008 Red Hat, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. */ #ifndef NM_CLIENT_H @@ -43,6 +43,7 @@ G_BEGIN_DECLS #define NM_CLIENT_STATE "state" #define NM_CLIENT_MANAGER_RUNNING "manager-running" +#define NM_CLIENT_NETWORKING_ENABLED "networking-enabled" #define NM_CLIENT_WIRELESS_ENABLED "wireless-enabled" #define NM_CLIENT_WIRELESS_HARDWARE_ENABLED "wireless-hardware-enabled" #define NM_CLIENT_WWAN_ENABLED "wwan-enabled" @@ -88,6 +89,9 @@ void nm_client_activate_connection (NMClient *client, void nm_client_deactivate_connection (NMClient *client, NMActiveConnection *active); +gboolean nm_client_networking_get_enabled (NMClient *client); +void nm_client_networking_set_enabled (NMClient *client, gboolean enabled); + gboolean nm_client_wireless_get_enabled (NMClient *client); void nm_client_wireless_set_enabled (NMClient *client, gboolean enabled); gboolean nm_client_wireless_hardware_get_enabled (NMClient *client); diff --git a/src/nm-manager.c b/src/nm-manager.c index f158e50982..9655567286 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -58,13 +58,6 @@ #define NM_AUTOIP_DBUS_SERVICE "org.freedesktop.nm_avahi_autoipd" #define NM_AUTOIP_DBUS_IFACE "org.freedesktop.nm_avahi_autoipd" -#define NM_MANAGER_STATE "state" -#define NM_MANAGER_WIRELESS_ENABLED "wireless-enabled" -#define NM_MANAGER_WIRELESS_HARDWARE_ENABLED "wireless-hardware-enabled" -#define NM_MANAGER_WWAN_ENABLED "wwan-enabled" -#define NM_MANAGER_WWAN_HARDWARE_ENABLED "wwan-hardware-enabled" -#define NM_MANAGER_ACTIVE_CONNECTIONS "active-connections" - static gboolean impl_manager_get_devices (NMManager *manager, GPtrArray **devices, GError **err); static void impl_manager_activate_connection (NMManager *manager, const char *service_name, @@ -79,6 +72,8 @@ static gboolean impl_manager_deactivate_connection (NMManager *manager, static gboolean impl_manager_sleep (NMManager *manager, gboolean sleep, GError **err); +static gboolean impl_manager_enable (NMManager *manager, gboolean enable, GError **err); + static gboolean impl_manager_set_logging (NMManager *manager, const char *level, const char *domains, @@ -190,6 +185,7 @@ typedef struct { RadioState radio_states[RFKILL_TYPE_MAX]; gboolean sleeping; + gboolean net_enabled; NMVPNManager *vpn_manager; guint vpn_manager_id; @@ -228,6 +224,7 @@ static guint signals[LAST_SIGNAL] = { 0 }; enum { PROP_0, PROP_STATE, + PROP_NETWORKING_ENABLED, PROP_WIRELESS_ENABLED, PROP_WIRELESS_HARDWARE_ENABLED, PROP_WWAN_ENABLED, @@ -251,6 +248,7 @@ typedef enum NM_MANAGER_ERROR_PERMISSION_DENIED, NM_MANAGER_ERROR_CONNECTION_NOT_ACTIVE, NM_MANAGER_ERROR_ALREADY_ASLEEP_OR_AWAKE, + NM_MANAGER_ERROR_ALREADY_ENABLED_OR_DISABLED, } NMManagerError; #define NM_MANAGER_ERROR (nm_manager_error_quark ()) @@ -293,6 +291,8 @@ nm_manager_error_get_type (void) ENUM_ENTRY (NM_MANAGER_ERROR_CONNECTION_NOT_ACTIVE, "ConnectionNotActive"), /* The manager is already in the requested sleep state */ ENUM_ENTRY (NM_MANAGER_ERROR_ALREADY_ASLEEP_OR_AWAKE, "AlreadyAsleepOrAwake"), + /* The manager is already in the requested enabled/disabled state */ + ENUM_ENTRY (NM_MANAGER_ERROR_ALREADY_ENABLED_OR_DISABLED, "AlreadyEnabledOrDisabled"), { 0, 0, 0 }, }; etype = g_enum_register_static ("NMManagerError", values); @@ -300,6 +300,16 @@ nm_manager_error_get_type (void) return etype; } +static gboolean +manager_sleeping (NMManager *self) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + + if (priv->sleeping || !priv->net_enabled) + return TRUE; + return FALSE; +} + static void vpn_manager_connection_deactivated_cb (NMVPNManager *manager, NMVPNConnection *vpn, @@ -372,9 +382,9 @@ nm_manager_update_state (NMManager *manager) priv = NM_MANAGER_GET_PRIVATE (manager); - if (priv->sleeping) { + if (manager_sleeping (manager)) new_state = NM_STATE_ASLEEP; - } else { + else { GSList *iter; for (iter = priv->devices; iter; iter = iter->next) { @@ -1239,7 +1249,7 @@ manager_set_radio_enabled (NMManager *manager, } /* Don't touch devices if asleep/networking disabled */ - if (priv->sleeping) + if (manager_sleeping (manager)) return; /* enable/disable wireless devices as required */ @@ -1559,7 +1569,7 @@ add_device (NMManager *self, NMDevice *device) /* Start the device if it's supposed to be managed */ unmanaged_specs = nm_sysconfig_settings_get_unmanaged_specs (priv->sys_settings); - if ( !priv->sleeping + if ( !manager_sleeping (self) && !nm_device_interface_spec_match_list (NM_DEVICE_INTERFACE (device), unmanaged_specs)) { nm_device_set_managed (device, TRUE, @@ -1810,7 +1820,6 @@ udev_device_added_cb (NMUdevManager *udev_mgr, gpointer user_data) { NMManager *self = NM_MANAGER (user_data); - NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); GObject *device; guint32 ifindex; @@ -1818,7 +1827,7 @@ udev_device_added_cb (NMUdevManager *udev_mgr, if (find_device_by_ifindex (self, ifindex)) return; - device = creator_fn (udev_mgr, udev_device, priv->sleeping); + device = creator_fn (udev_mgr, udev_device, manager_sleeping (self)); if (device) add_device (self, NM_DEVICE (device)); } @@ -2646,54 +2655,25 @@ impl_manager_deactivate_connection (NMManager *manager, error); } -static gboolean -impl_manager_sleep (NMManager *self, gboolean sleep, GError **error) +static void +do_sleep_wake (NMManager *self) { - NMManagerPrivate *priv; + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + const GSList *unmanaged_specs; GSList *iter; - g_return_val_if_fail (NM_IS_MANAGER (self), FALSE); - - priv = NM_MANAGER_GET_PRIVATE (self); - - if (priv->sleeping == sleep) { - g_set_error (error, - NM_MANAGER_ERROR, NM_MANAGER_ERROR_ALREADY_ASLEEP_OR_AWAKE, - "Already %s", sleep ? "asleep" : "awake"); - return FALSE; - } - - priv->sleeping = sleep; - - /* Update "NetworkingEnabled" key in state file */ - if (priv->state_file) { - GError *err = NULL; - gboolean networking_enabled = !sleep; - - if (!write_value_to_state_file (priv->state_file, - "main", "NetworkingEnabled", - G_TYPE_BOOLEAN, (gpointer) &networking_enabled, - &err)) { - nm_log_warn (LOGD_SUSPEND, "writing to state file %s failed: (%d) %s.", - priv->state_file, - err ? err->code : -1, - (err && err->message) ? err->message : "unknown"); - } - - } - - if (sleep) { - nm_log_info (LOGD_SUSPEND, "sleeping..."); + if (manager_sleeping (self)) { + nm_log_info (LOGD_SUSPEND, "sleeping or disabling..."); /* Just deactivate and down all devices from the device list, - * we'll remove them in 'wake' for speed's sake. + * to keep things fast the device list will get resynced when + * the manager wakes up. */ for (iter = priv->devices; iter; iter = iter->next) nm_device_set_managed (NM_DEVICE (iter->data), FALSE, NM_DEVICE_STATE_REASON_SLEEPING); - } else { - const GSList *unmanaged_specs; - nm_log_info (LOGD_SUSPEND, "waking up..."); + } else { + nm_log_info (LOGD_SUSPEND, "waking up and re-enabling..."); unmanaged_specs = nm_sysconfig_settings_get_unmanaged_specs (priv->sys_settings); @@ -2738,11 +2718,82 @@ impl_manager_sleep (NMManager *self, gboolean sleep, GError **error) } nm_manager_update_state (self); +} + +static gboolean +impl_manager_sleep (NMManager *self, gboolean sleep, GError **error) +{ + NMManagerPrivate *priv; + + g_return_val_if_fail (NM_IS_MANAGER (self), FALSE); + + priv = NM_MANAGER_GET_PRIVATE (self); + + if (priv->sleeping == sleep) { + g_set_error (error, + NM_MANAGER_ERROR, NM_MANAGER_ERROR_ALREADY_ASLEEP_OR_AWAKE, + "Already %s", sleep ? "asleep" : "awake"); + return FALSE; + } + + nm_log_info (LOGD_SUSPEND, "%s requested (sleeping: %s enabled: %s)", + sleep ? "sleep" : "wake", + priv->sleeping ? "yes" : "no", + priv->net_enabled ? "yes" : "no"); + + priv->sleeping = sleep; + + do_sleep_wake (self); g_object_notify (G_OBJECT (self), NM_MANAGER_SLEEPING); return TRUE; } +static gboolean +impl_manager_enable (NMManager *self, gboolean enable, GError **error) +{ + NMManagerPrivate *priv; + + g_return_val_if_fail (NM_IS_MANAGER (self), FALSE); + + priv = NM_MANAGER_GET_PRIVATE (self); + + if (priv->net_enabled == enable) { + g_set_error (error, + NM_MANAGER_ERROR, NM_MANAGER_ERROR_ALREADY_ENABLED_OR_DISABLED, + "Already %s", enable ? "enabled" : "disabled"); + return FALSE; + } + + /* Update "NetworkingEnabled" key in state file */ + if (priv->state_file) { + GError *err = NULL; + + if (!write_value_to_state_file (priv->state_file, + "main", "NetworkingEnabled", + G_TYPE_BOOLEAN, (gpointer) &enable, + &err)) { + /* Not a hard error */ + nm_log_warn (LOGD_SUSPEND, "writing to state file %s failed: (%d) %s.", + priv->state_file, + err ? err->code : -1, + (err && err->message) ? err->message : "unknown"); + } + } + + nm_log_info (LOGD_SUSPEND, "%s requested (sleeping: %s enabled: %s)", + enable ? "enable" : "disable", + priv->sleeping ? "yes" : "no", + priv->net_enabled ? "yes" : "no"); + + priv->net_enabled = enable; + + do_sleep_wake (self); + + g_object_notify (G_OBJECT (self), NM_MANAGER_NETWORKING_ENABLED); + return TRUE; +} + /* Legacy 0.6 compatibility interface */ static gboolean @@ -2910,9 +2961,9 @@ nm_manager_start (NMManager *self) manager_set_radio_enabled (self, rstate, rstate->enabled && enabled); } - /* Log overall networking status - asleep/running */ + /* Log overall networking status - enabled/disabled */ nm_log_info (LOGD_CORE, "Networking is %s by state file", - priv->sleeping ? "disabled" : "enabled"); + priv->net_enabled ? "enabled" : "disabled"); system_unmanaged_devices_changed_cb (priv->sys_settings, NULL, self); system_hostname_changed_cb (priv->sys_settings, NULL, self); @@ -2964,7 +3015,7 @@ nm_manager_get (const char *config_file, priv->state_file = g_strdup (state_file); - priv->sleeping = !initial_net_enabled; + priv->net_enabled = initial_net_enabled; priv->radio_states[RFKILL_TYPE_WLAN].enabled = initial_wifi_enabled; priv->radio_states[RFKILL_TYPE_WWAN].enabled = initial_wwan_enabled; @@ -3088,6 +3139,10 @@ set_property (GObject *object, guint prop_id, NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); switch (prop_id) { + case PROP_NETWORKING_ENABLED: + /* Construct only for now */ + priv->net_enabled = g_value_get_boolean (value); + break; case PROP_WIRELESS_ENABLED: manager_set_radio_enabled (NM_MANAGER (object), &priv->radio_states[RFKILL_TYPE_WLAN], @@ -3116,6 +3171,9 @@ get_property (GObject *object, guint prop_id, nm_manager_update_state (self); g_value_set_uint (value, priv->state); break; + case PROP_NETWORKING_ENABLED: + g_value_set_boolean (value, priv->net_enabled); + break; case PROP_WIRELESS_ENABLED: g_value_set_boolean (value, priv->radio_states[RFKILL_TYPE_WLAN].enabled); break; @@ -3255,6 +3313,14 @@ nm_manager_class_init (NMManagerClass *manager_class) 0, NM_STATE_DISCONNECTED, 0, G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_NETWORKING_ENABLED, + g_param_spec_boolean (NM_MANAGER_NETWORKING_ENABLED, + "NetworkingEnabled", + "Is networking enabled", + TRUE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (object_class, PROP_WIRELESS_ENABLED, g_param_spec_boolean (NM_MANAGER_WIRELESS_ENABLED, @@ -3304,6 +3370,7 @@ nm_manager_class_init (NMManagerClass *manager_class) NULL, G_PARAM_READABLE | NM_PROPERTY_PARAM_NO_EXPORT)); + /* Sleeping is not exported over D-Bus */ g_object_class_install_property (object_class, PROP_SLEEPING, g_param_spec_boolean (NM_MANAGER_SLEEPING, diff --git a/src/nm-manager.h b/src/nm-manager.h index 1090409a9b..0f4d72f2fd 100644 --- a/src/nm-manager.h +++ b/src/nm-manager.h @@ -16,7 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2008 Red Hat, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. */ #ifndef NM_MANAGER_H @@ -35,6 +35,14 @@ #define NM_IS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_MANAGER)) #define NM_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_MANAGER, NMManagerClass)) +#define NM_MANAGER_STATE "state" +#define NM_MANAGER_NETWORKING_ENABLED "networking-enabled" +#define NM_MANAGER_WIRELESS_ENABLED "wireless-enabled" +#define NM_MANAGER_WIRELESS_HARDWARE_ENABLED "wireless-hardware-enabled" +#define NM_MANAGER_WWAN_ENABLED "wwan-enabled" +#define NM_MANAGER_WWAN_HARDWARE_ENABLED "wwan-hardware-enabled" +#define NM_MANAGER_ACTIVE_CONNECTIONS "active-connections" + /* Not exported */ #define NM_MANAGER_HOSTNAME "hostname" #define NM_MANAGER_SLEEPING "sleeping" diff --git a/src/nm-policy.c b/src/nm-policy.c index a7bd96f1bb..455545b655 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -718,13 +718,14 @@ hostname_changed (NMManager *manager, GParamSpec *pspec, gpointer user_data) static void sleeping_changed (NMManager *manager, GParamSpec *pspec, gpointer user_data) { - gboolean sleeping = FALSE; + gboolean sleeping = FALSE, enabled = FALSE; GSList *connections, *iter; g_object_get (G_OBJECT (manager), NM_MANAGER_SLEEPING, &sleeping, NULL); + g_object_get (G_OBJECT (manager), NM_MANAGER_NETWORKING_ENABLED, &enabled, NULL); /* Clear the invalid flag on all connections so they'll get retried on wakeup */ - if (sleeping) { + if (sleeping || !enabled) { connections = nm_manager_get_connections (manager, NM_CONNECTION_SCOPE_SYSTEM); connections = g_slist_concat (connections, nm_manager_get_connections (manager, NM_CONNECTION_SCOPE_USER)); for (iter = connections; iter; iter = g_slist_next (iter)) @@ -1055,6 +1056,10 @@ nm_policy_new (NMManager *manager, NMVPNManager *vpn_manager) G_CALLBACK (sleeping_changed), policy); policy->signal_ids = g_slist_append (policy->signal_ids, (gpointer) id); + id = g_signal_connect (manager, "notify::" NM_MANAGER_NETWORKING_ENABLED, + G_CALLBACK (sleeping_changed), policy); + policy->signal_ids = g_slist_append (policy->signal_ids, (gpointer) id); + id = g_signal_connect (manager, "device-added", G_CALLBACK (device_added), policy); policy->signal_ids = g_slist_append (policy->signal_ids, (gpointer) id); -- cgit v1.2.1 From 6221afc790a88eadccdcc15af56806d45b0438ab Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 22 May 2010 11:27:05 -0700 Subject: libnm-glib: add nm_client_networking_get_enabled() (rh #589108) (bgo #346615) Forgot this in the last commit. --- libnm-glib/nm-client.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c index dd10e247ad..00d729a2ed 100644 --- a/libnm-glib/nm-client.c +++ b/libnm-glib/nm-client.c @@ -58,6 +58,7 @@ typedef struct { GPtrArray *devices; GPtrArray *active_connections; + gboolean have_networking_enabled; gboolean networking_enabled; gboolean wireless_enabled; gboolean wireless_hw_enabled; @@ -98,12 +99,29 @@ static void proxy_name_owner_changed (DBusGProxy *proxy, static void client_device_added_proxy (DBusGProxy *proxy, char *path, gpointer user_data); static void client_device_removed_proxy (DBusGProxy *proxy, char *path, gpointer user_data); +static void +handle_net_enabled_changed (GObject *object, + GParamSpec *pspec, + GValue *value, + gpointer user_data) +{ + NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (object); + + /* Update the cache flag when it changes */ + priv->have_networking_enabled = TRUE; +} + static void nm_client_init (NMClient *client) { NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client); priv->state = NM_STATE_UNKNOWN; + + g_signal_connect (client, + "notify::" NM_CLIENT_NETWORKING_ENABLED, + G_CALLBACK (handle_net_enabled_changed), + client); } static void @@ -1060,6 +1078,35 @@ nm_client_get_state (NMClient *client) return priv->state; } +/** + * nm_client_networking_get_enabled: + * @client: a #NMClient + * + * Whether networking is enabled or disabled. + * + * Returns: %TRUE if networking is disabled, %FALSE if networking is enabled + **/ +gboolean +nm_client_networking_get_enabled (NMClient *client) +{ + NMClientPrivate *priv; + + g_return_val_if_fail (NM_IS_CLIENT (client), FALSE); + + priv = NM_CLIENT_GET_PRIVATE (client); + if (!priv->have_networking_enabled) { + priv = NM_CLIENT_GET_PRIVATE (client); + if (!priv->networking_enabled) { + priv->networking_enabled = _nm_object_get_boolean_property (NM_OBJECT (client), + NM_DBUS_INTERFACE, + "NetworkingEnabled"); + priv->have_networking_enabled = TRUE; + } + } + + return priv->networking_enabled; +} + /** * nm_client_networking_set_enabled: * @client: a #NMClient -- cgit v1.2.1 From 2e92d84ef027d4aa1cf1edb628db771ccfda2d23 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 24 May 2010 17:07:46 -0700 Subject: modem: fix WWAN hardware enable state tracking (rh #591622) --- src/nm-device-modem.c | 12 ++++++++++++ src/nm-device-modem.h | 2 ++ src/nm-manager.c | 6 ++---- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/nm-device-modem.c b/src/nm-device-modem.c index 3ba26ddcdd..441f92cece 100644 --- a/src/nm-device-modem.c +++ b/src/nm-device-modem.c @@ -46,6 +46,7 @@ enum { enum { PPP_STATS, + ENABLE_CHANGED, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = { 0 }; @@ -158,6 +159,8 @@ modem_enabled_cb (NMModem *modem, GParamSpec *pspec, gpointer user_data) NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (self); real_set_enabled (NM_DEVICE_INTERFACE (self), nm_modem_get_mm_enabled (priv->modem)); + + g_signal_emit (G_OBJECT (self), signals[ENABLE_CHANGED], 0); } /*****************************************************************************/ @@ -453,6 +456,15 @@ nm_device_modem_class_init (NMDeviceModemClass *mclass) G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); + signals[ENABLE_CHANGED] = + g_signal_new (NM_DEVICE_MODEM_ENABLE_CHANGED, + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + 0, + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (mclass), nm_modem_get_serial_dbus_info ()); } diff --git a/src/nm-device-modem.h b/src/nm-device-modem.h index 40e89d4b7c..c6ef4d2184 100644 --- a/src/nm-device-modem.h +++ b/src/nm-device-modem.h @@ -36,6 +36,8 @@ #define NM_DEVICE_MODEM_MODEM "modem" +#define NM_DEVICE_MODEM_ENABLE_CHANGED "enable-changed" + typedef struct { NMDevice parent; } NMDeviceModem; diff --git a/src/nm-manager.c b/src/nm-manager.c index 9655567286..1bc9e5a466 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -1459,9 +1459,7 @@ manager_ipw_rfkill_state_changed (NMDeviceWifi *device, } static void -manager_modem_enabled_changed (NMModem *device, - GParamSpec *pspec, - gpointer user_data) +manager_modem_enabled_changed (NMModem *device, gpointer user_data) { nm_manager_rfkill_update (NM_MANAGER (user_data), RFKILL_TYPE_WWAN); } @@ -1515,7 +1513,7 @@ add_device (NMManager *self, NMDevice *device) nm_device_interface_set_enabled (NM_DEVICE_INTERFACE (device), priv->radio_states[RFKILL_TYPE_WLAN].enabled); } else if (NM_IS_DEVICE_MODEM (device)) { - g_signal_connect (device, "notify::" NM_MODEM_ENABLED, + g_signal_connect (device, NM_DEVICE_MODEM_ENABLE_CHANGED, G_CALLBACK (manager_modem_enabled_changed), self); -- cgit v1.2.1 From ba1717479835577b0f416b3465f7edd767a61762 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 24 May 2010 17:11:47 -0700 Subject: core: NL_CB_VERBOSE breaks error propagation (rh #594578) Plus we don't really need the VERBOSE bits anyway. --- src/nm-netlink-monitor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c index 10bf239d5d..13b3ab9850 100644 --- a/src/nm-netlink-monitor.c +++ b/src/nm-netlink-monitor.c @@ -282,7 +282,7 @@ event_connection_setup (NMNetlinkMonitor *self, GError **error) g_return_val_if_fail (priv->io_channel == NULL, FALSE); /* Set up the event listener connection */ - cb = nl_cb_alloc (NL_CB_VERBOSE); + cb = nl_cb_alloc (NL_CB_DEFAULT); priv->nlh_event = nl_handle_alloc_cb (cb); nl_cb_put (cb); if (!priv->nlh_event) { @@ -344,7 +344,7 @@ sync_connection_setup (NMNetlinkMonitor *self, GError **error) #endif /* Set up the event listener connection */ - cb = nl_cb_alloc (NL_CB_VERBOSE); + cb = nl_cb_alloc (NL_CB_DEFAULT); priv->nlh_sync = nl_handle_alloc_cb (cb); nl_cb_put (cb); if (!priv->nlh_sync) { -- cgit v1.2.1 From fea6431a20674ab4d732b9e1ecd2839ea0939f6a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 25 May 2010 10:52:25 -0700 Subject: core/libnm-glib: implement better missing firmware support (rh #594578) Track missing firmware and ensure the device can't be used when firmware is missing. Add a property for missing firmware so that clients can do something intelligent with this information. --- introspection/nm-device.xml | 6 ++++ libnm-glib/Makefile.am | 2 +- libnm-glib/libnm-glib.ver | 1 + libnm-glib/nm-device.c | 67 ++++++++++++++++++++++++++++++++++++++------- libnm-glib/nm-device.h | 28 ++++++++++--------- src/nm-device-interface.c | 7 +++++ src/nm-device-interface.h | 34 ++++++++++++----------- src/nm-device.c | 29 ++++++++++++++++++++ 8 files changed, 134 insertions(+), 40 deletions(-) diff --git a/introspection/nm-device.xml b/introspection/nm-device.xml index 0d0a9508ae..7a02b73ef2 100644 --- a/introspection/nm-device.xml +++ b/introspection/nm-device.xml @@ -52,6 +52,12 @@ Whether or not this device is managed by NetworkManager. + + + If TRUE, indicates the device is likely missing firmware necessary for + its operation. + + The general type of the network device; ie Ethernet, WiFi, etc. diff --git a/libnm-glib/Makefile.am b/libnm-glib/Makefile.am index 8f03b0abda..e230a7c149 100644 --- a/libnm-glib/Makefile.am +++ b/libnm-glib/Makefile.am @@ -132,7 +132,7 @@ libnm_glib_la_LIBADD = \ $(GUDEV_LIBS) libnm_glib_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-glib.ver \ - -version-info "4:2:2" + -version-info "5:0:3" noinst_PROGRAMS = libnm-glib-test diff --git a/libnm-glib/libnm-glib.ver b/libnm-glib/libnm-glib.ver index 6d48fb38eb..2b84dace1e 100644 --- a/libnm-glib/libnm-glib.ver +++ b/libnm-glib/libnm-glib.ver @@ -68,6 +68,7 @@ global: nm_device_get_capabilities; nm_device_get_dhcp4_config; nm_device_get_driver; + nm_device_get_firmware_missing; nm_device_get_iface; nm_device_get_ip4_config; nm_device_get_ip6_config; diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c index a24eb06efa..b07c9b0dcb 100644 --- a/libnm-glib/nm-device.c +++ b/libnm-glib/nm-device.c @@ -18,7 +18,7 @@ * Boston, MA 02110-1301 USA. * * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2008 Red Hat, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. */ #include @@ -53,6 +53,7 @@ typedef struct { char *driver; guint32 capabilities; gboolean managed; + gboolean firmware_missing; NMIP4Config *ip4_config; gboolean null_ip4_config; NMDHCP4Config *dhcp4_config; @@ -75,6 +76,7 @@ enum { PROP_DRIVER, PROP_CAPABILITIES, PROP_MANAGED, + PROP_FIRMWARE_MISSING, PROP_IP4_CONFIG, PROP_DHCP4_CONFIG, PROP_IP6_CONFIG, @@ -268,15 +270,16 @@ register_for_property_changed (NMDevice *device) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device); const NMPropertiesChangedInfo property_changed_info[] = { - { NM_DEVICE_UDI, _nm_object_demarshal_generic, &priv->udi }, - { NM_DEVICE_INTERFACE, _nm_object_demarshal_generic, &priv->iface }, - { NM_DEVICE_DRIVER, _nm_object_demarshal_generic, &priv->driver }, - { NM_DEVICE_CAPABILITIES, _nm_object_demarshal_generic, &priv->capabilities }, - { NM_DEVICE_MANAGED, _nm_object_demarshal_generic, &priv->managed }, - { NM_DEVICE_IP4_CONFIG, demarshal_ip4_config, &priv->ip4_config }, - { NM_DEVICE_DHCP4_CONFIG, demarshal_dhcp4_config, &priv->dhcp4_config }, - { NM_DEVICE_IP6_CONFIG, demarshal_ip6_config, &priv->ip6_config }, - { NM_DEVICE_DHCP6_CONFIG, demarshal_dhcp6_config, &priv->dhcp6_config }, + { NM_DEVICE_UDI, _nm_object_demarshal_generic, &priv->udi }, + { NM_DEVICE_INTERFACE, _nm_object_demarshal_generic, &priv->iface }, + { NM_DEVICE_DRIVER, _nm_object_demarshal_generic, &priv->driver }, + { NM_DEVICE_CAPABILITIES, _nm_object_demarshal_generic, &priv->capabilities }, + { NM_DEVICE_MANAGED, _nm_object_demarshal_generic, &priv->managed }, + { NM_DEVICE_FIRMWARE_MISSING, _nm_object_demarshal_generic, &priv->firmware_missing }, + { NM_DEVICE_IP4_CONFIG, demarshal_ip4_config, &priv->ip4_config }, + { NM_DEVICE_DHCP4_CONFIG, demarshal_dhcp4_config, &priv->dhcp4_config }, + { NM_DEVICE_IP6_CONFIG, demarshal_ip6_config, &priv->ip6_config }, + { NM_DEVICE_DHCP6_CONFIG, demarshal_dhcp6_config, &priv->dhcp6_config }, { NULL }, }; @@ -408,6 +411,9 @@ get_property (GObject *object, case PROP_MANAGED: g_value_set_boolean (value, nm_device_get_managed (device)); break; + case PROP_FIRMWARE_MISSING: + g_value_set_boolean (value, nm_device_get_firmware_missing (device)); + break; case PROP_IP4_CONFIG: g_value_set_object (value, nm_device_get_ip4_config (device)); break; @@ -515,6 +521,20 @@ nm_device_class_init (NMDeviceClass *device_class) FALSE, G_PARAM_READABLE)); + /** + * NMDevice:firmware-missing: + * + * When %TRUE indicates the device is likely missing firmware required + * for its operation. + **/ + g_object_class_install_property + (object_class, PROP_FIRMWARE_MISSING, + g_param_spec_boolean (NM_DEVICE_FIRMWARE_MISSING, + "FirmwareMissing", + "Firmware missing", + FALSE, + G_PARAM_READABLE)); + /** * NMDevice:ip4-config: * @@ -829,6 +849,33 @@ nm_device_get_managed (NMDevice *device) return priv->managed; } +/** + * nm_device_get_firmware_missing: + * @device: a #NMDevice + * + * Indicates that firmware required for the device's operation is likely + * to be missing. + * + * Returns: %TRUE if firmware required for the device's operation is likely + * to be missing. + **/ +gboolean +nm_device_get_firmware_missing (NMDevice *device) +{ + NMDevicePrivate *priv; + + g_return_val_if_fail (NM_IS_DEVICE (device), 0); + + priv = NM_DEVICE_GET_PRIVATE (device); + if (!priv->firmware_missing) { + priv->firmware_missing = _nm_object_get_boolean_property (NM_OBJECT (device), + NM_DBUS_INTERFACE_DEVICE, + "FirmwareMissing"); + } + + return priv->firmware_missing; +} + /** * nm_device_get_ip4_config: * @device: a #NMDevice diff --git a/libnm-glib/nm-device.h b/libnm-glib/nm-device.h index 64694ec833..5a47ff9a63 100644 --- a/libnm-glib/nm-device.h +++ b/libnm-glib/nm-device.h @@ -18,7 +18,7 @@ * Boston, MA 02110-1301 USA. * * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2008 Red Hat, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. */ #ifndef NM_DEVICE_H @@ -49,6 +49,7 @@ G_BEGIN_DECLS #define NM_DEVICE_DRIVER "driver" #define NM_DEVICE_CAPABILITIES "capabilities" #define NM_DEVICE_MANAGED "managed" +#define NM_DEVICE_FIRMWARE_MISSING "firmware-missing" #define NM_DEVICE_IP4_CONFIG "ip4-config" #define NM_DEVICE_DHCP4_CONFIG "dhcp4-config" #define NM_DEVICE_IP6_CONFIG "ip6-config" @@ -83,18 +84,19 @@ GType nm_device_get_type (void); GObject * nm_device_new (DBusGConnection *connection, const char *path); -const char * nm_device_get_iface (NMDevice *device); -const char * nm_device_get_udi (NMDevice *device); -const char * nm_device_get_driver (NMDevice *device); -guint32 nm_device_get_capabilities (NMDevice *device); -gboolean nm_device_get_managed (NMDevice *device); -NMIP4Config * nm_device_get_ip4_config (NMDevice *device); -NMDHCP4Config * nm_device_get_dhcp4_config (NMDevice *device); -NMIP6Config * nm_device_get_ip6_config (NMDevice *device); -NMDHCP6Config * nm_device_get_dhcp6_config (NMDevice *device); -NMDeviceState nm_device_get_state (NMDevice *device); -const char * nm_device_get_product (NMDevice *device); -const char * nm_device_get_vendor (NMDevice *device); +const char * nm_device_get_iface (NMDevice *device); +const char * nm_device_get_udi (NMDevice *device); +const char * nm_device_get_driver (NMDevice *device); +guint32 nm_device_get_capabilities (NMDevice *device); +gboolean nm_device_get_managed (NMDevice *device); +gboolean nm_device_get_firmware_missing (NMDevice *device); +NMIP4Config * nm_device_get_ip4_config (NMDevice *device); +NMDHCP4Config * nm_device_get_dhcp4_config (NMDevice *device); +NMIP6Config * nm_device_get_ip6_config (NMDevice *device); +NMDHCP6Config * nm_device_get_dhcp6_config (NMDevice *device); +NMDeviceState nm_device_get_state (NMDevice *device); +const char * nm_device_get_product (NMDevice *device); +const char * nm_device_get_vendor (NMDevice *device); typedef void (*NMDeviceDeactivateFn) (NMDevice *device, GError *error, gpointer user_data); diff --git a/src/nm-device-interface.c b/src/nm-device-interface.c index 85f58d5563..bbc54a8626 100644 --- a/src/nm-device-interface.c +++ b/src/nm-device-interface.c @@ -169,6 +169,13 @@ nm_device_interface_init (gpointer g_iface) FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + g_object_interface_install_property + (g_iface, g_param_spec_boolean (NM_DEVICE_INTERFACE_FIRMWARE_MISSING, + "FirmwareMissing", + "Firmware missing", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + g_object_interface_install_property (g_iface, g_param_spec_string (NM_DEVICE_INTERFACE_TYPE_DESC, diff --git a/src/nm-device-interface.h b/src/nm-device-interface.h index ec27f6e820..ea152602e0 100644 --- a/src/nm-device-interface.h +++ b/src/nm-device-interface.h @@ -16,7 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2008 Red Hat, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. */ #ifndef NM_DEVICE_INTERFACE_H @@ -45,21 +45,22 @@ typedef enum #define NM_DEVICE_INTERFACE_ERROR (nm_device_interface_error_quark ()) #define NM_TYPE_DEVICE_INTERFACE_ERROR (nm_device_interface_error_get_type ()) -#define NM_DEVICE_INTERFACE_UDI "udi" -#define NM_DEVICE_INTERFACE_IFACE "interface" -#define NM_DEVICE_INTERFACE_DRIVER "driver" -#define NM_DEVICE_INTERFACE_CAPABILITIES "capabilities" -#define NM_DEVICE_INTERFACE_IP4_ADDRESS "ip4-address" -#define NM_DEVICE_INTERFACE_IP4_CONFIG "ip4-config" -#define NM_DEVICE_INTERFACE_DHCP4_CONFIG "dhcp4-config" -#define NM_DEVICE_INTERFACE_IP6_CONFIG "ip6-config" -#define NM_DEVICE_INTERFACE_DHCP6_CONFIG "dhcp6-config" -#define NM_DEVICE_INTERFACE_STATE "state" -#define NM_DEVICE_INTERFACE_DEVICE_TYPE "device-type" /* ugh */ -#define NM_DEVICE_INTERFACE_MANAGED "managed" -#define NM_DEVICE_INTERFACE_TYPE_DESC "type-desc" /* Internal only */ -#define NM_DEVICE_INTERFACE_RFKILL_TYPE "rfkill-type" /* Internal only */ -#define NM_DEVICE_INTERFACE_IFINDEX "ifindex" /* Internal only */ +#define NM_DEVICE_INTERFACE_UDI "udi" +#define NM_DEVICE_INTERFACE_IFACE "interface" +#define NM_DEVICE_INTERFACE_DRIVER "driver" +#define NM_DEVICE_INTERFACE_CAPABILITIES "capabilities" +#define NM_DEVICE_INTERFACE_IP4_ADDRESS "ip4-address" +#define NM_DEVICE_INTERFACE_IP4_CONFIG "ip4-config" +#define NM_DEVICE_INTERFACE_DHCP4_CONFIG "dhcp4-config" +#define NM_DEVICE_INTERFACE_IP6_CONFIG "ip6-config" +#define NM_DEVICE_INTERFACE_DHCP6_CONFIG "dhcp6-config" +#define NM_DEVICE_INTERFACE_STATE "state" +#define NM_DEVICE_INTERFACE_DEVICE_TYPE "device-type" /* ugh */ +#define NM_DEVICE_INTERFACE_MANAGED "managed" +#define NM_DEVICE_INTERFACE_FIRMWARE_MISSING "firmware-missing" +#define NM_DEVICE_INTERFACE_TYPE_DESC "type-desc" /* Internal only */ +#define NM_DEVICE_INTERFACE_RFKILL_TYPE "rfkill-type" /* Internal only */ +#define NM_DEVICE_INTERFACE_IFINDEX "ifindex" /* Internal only */ typedef enum { NM_DEVICE_INTERFACE_PROP_FIRST = 0x1000, @@ -76,6 +77,7 @@ typedef enum { NM_DEVICE_INTERFACE_PROP_STATE, NM_DEVICE_INTERFACE_PROP_DEVICE_TYPE, NM_DEVICE_INTERFACE_PROP_MANAGED, + NM_DEVICE_INTERFACE_PROP_FIRMWARE_MISSING, NM_DEVICE_INTERFACE_PROP_TYPE_DESC, NM_DEVICE_INTERFACE_PROP_RFKILL_TYPE, NM_DEVICE_INTERFACE_PROP_IFINDEX, diff --git a/src/nm-device.c b/src/nm-device.c index a6ad3be581..fcd3120538 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -92,6 +92,7 @@ typedef struct { char * driver; gboolean managed; /* whether managed by NM or not */ RfKillType rfkill_type; + gboolean firmware_missing; guint32 ip4_address; @@ -492,6 +493,11 @@ nm_device_get_act_request (NMDevice *self) gboolean nm_device_is_available (NMDevice *self) { + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + + if (priv->firmware_missing) + return FALSE; + if (NM_DEVICE_GET_CLASS (self)->is_available) return NM_DEVICE_GET_CLASS (self)->is_available (self); return TRUE; @@ -3384,6 +3390,9 @@ set_property (GObject *object, guint prop_id, case NM_DEVICE_INTERFACE_PROP_MANAGED: priv->managed = g_value_get_boolean (value); break; + case NM_DEVICE_INTERFACE_PROP_FIRMWARE_MISSING: + priv->firmware_missing = g_value_get_boolean (value); + break; case NM_DEVICE_INTERFACE_PROP_DEVICE_TYPE: g_return_if_fail (priv->type == NM_DEVICE_TYPE_UNKNOWN); priv->type = g_value_get_uint (value); @@ -3471,6 +3480,9 @@ get_property (GObject *object, guint prop_id, case NM_DEVICE_INTERFACE_PROP_MANAGED: g_value_set_boolean (value, priv->managed); break; + case NM_DEVICE_INTERFACE_PROP_FIRMWARE_MISSING: + g_value_set_boolean (value, priv->firmware_missing); + break; case NM_DEVICE_INTERFACE_PROP_TYPE_DESC: g_value_set_string (value, priv->type_desc); break; @@ -3563,6 +3575,10 @@ nm_device_class_init (NMDeviceClass *klass) NM_DEVICE_INTERFACE_PROP_MANAGED, NM_DEVICE_INTERFACE_MANAGED); + g_object_class_override_property (object_class, + NM_DEVICE_INTERFACE_PROP_FIRMWARE_MISSING, + NM_DEVICE_INTERFACE_FIRMWARE_MISSING); + g_object_class_override_property (object_class, NM_DEVICE_INTERFACE_PROP_TYPE_DESC, NM_DEVICE_INTERFACE_TYPE_DESC); @@ -3607,6 +3623,17 @@ unavailable_to_disconnected (gpointer user_data) return FALSE; } +static void +set_firmware_missing (NMDevice *self, gboolean new_missing) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + + if (priv->firmware_missing != new_missing) { + priv->firmware_missing = new_missing; + g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_FIRMWARE_MISSING); + } +} + void nm_device_state_changed (NMDevice *device, NMDeviceState state, @@ -3639,6 +3666,7 @@ nm_device_state_changed (NMDevice *device, */ switch (state) { case NM_DEVICE_STATE_UNMANAGED: + set_firmware_missing (device, FALSE); if (old_state > NM_DEVICE_STATE_UNMANAGED) nm_device_take_down (device, TRUE, reason); break; @@ -3646,6 +3674,7 @@ nm_device_state_changed (NMDevice *device, if (old_state == NM_DEVICE_STATE_UNMANAGED) { if (!nm_device_bring_up (device, TRUE, &no_firmware) && no_firmware) { nm_log_warn (LOGD_HW, "%s: firmware may be missing.", nm_device_get_iface (device)); + set_firmware_missing (device, TRUE); } } /* Ensure the device gets deactivated in response to stuff like -- cgit v1.2.1 From 1cd1a85eab6687365e018cee8d200859de1d510a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 25 May 2010 13:56:56 -0700 Subject: libnm-glib: fix memory leak getting device descriptions --- libnm-glib/nm-device.c | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c index b07c9b0dcb..7d5a7f0019 100644 --- a/libnm-glib/nm-device.c +++ b/libnm-glib/nm-device.c @@ -1098,7 +1098,7 @@ nm_device_update_description (NMDevice *device) { NMDevicePrivate *priv; const char *subsys[3] = { "net", "tty", NULL }; - GUdevDevice *udev_device = NULL, *tmpdev; + GUdevDevice *udev_device = NULL, *tmpdev, *olddev; const char *ifname; guint32 count = 0; const char *vendor, *model; @@ -1131,7 +1131,11 @@ nm_device_update_description (NMDevice *device) /* Walk up the chain of the device and its parents a few steps to grab * vendor and device ID information off it. */ - tmpdev = udev_device; + + /* Ref the device again becuase we have to unref it each iteration, + * as g_udev_device_get_parent() returns a ref-ed object. + */ + tmpdev = g_object_ref (udev_device); while ((count++ < 3) && tmpdev && (!priv->vendor || !priv->product)) { if (!priv->vendor) priv->vendor = get_decoded_property (tmpdev, "ID_VENDOR_ENC"); @@ -1139,11 +1143,23 @@ nm_device_update_description (NMDevice *device) if (!priv->product) priv->product = get_decoded_property (tmpdev, "ID_MODEL_ENC"); + olddev = tmpdev; tmpdev = g_udev_device_get_parent (tmpdev); + g_object_unref (olddev); } + /* Unref the last device if we found what we needed before running out + * of parents. + */ + if (tmpdev) + g_object_unref (tmpdev); + /* If we didn't get strings directly from the device, try database strings */ - tmpdev = udev_device; + + /* Again, ref the original device as we need to unref it every iteration + * since g_udev_device_get_parent() returns a refed object. + */ + tmpdev = g_object_ref (udev_device); count = 0; while ((count++ < 3) && tmpdev && (!priv->vendor || !priv->product)) { if (!priv->vendor) { @@ -1158,9 +1174,20 @@ nm_device_update_description (NMDevice *device) priv->product = g_strdup (model); } + olddev = tmpdev; tmpdev = g_udev_device_get_parent (tmpdev); + g_object_unref (olddev); } + /* Unref the last device if we found what we needed before running out + * of parents. + */ + if (tmpdev) + g_object_unref (tmpdev); + + /* Balance the initial g_udev_client_query_by_subsystem_and_name() */ + g_object_unref (udev_device); + _nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_VENDOR); _nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_PRODUCT); } -- cgit v1.2.1 From 7ebf9641a0ce610ef9854e0c06c34dce5635f66b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 25 May 2010 13:57:20 -0700 Subject: libnm-glib: fix getting descriptions for some mobile broadband devices 3G devices can be 'net' subsystem too (ie, mbm, hso). --- libnm-glib/nm-device.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c index 7d5a7f0019..53fe0b73ad 100644 --- a/libnm-glib/nm-device.c +++ b/libnm-glib/nm-device.c @@ -1116,9 +1116,8 @@ nm_device_update_description (NMDevice *device) if (!ifname) return; - if (NM_IS_DEVICE_ETHERNET (device) || NM_IS_DEVICE_WIFI (device)) - udev_device = g_udev_client_query_by_subsystem_and_name (priv->client, "net", ifname); - else if (NM_IS_GSM_DEVICE (device) || NM_IS_CDMA_DEVICE (device)) + udev_device = g_udev_client_query_by_subsystem_and_name (priv->client, "net", ifname); + if (!udev_device) udev_device = g_udev_client_query_by_subsystem_and_name (priv->client, "tty", ifname); if (!udev_device) return; -- cgit v1.2.1 From 61448016f406016479796aa3b6ec4f1ad073b8cc Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 25 May 2010 23:34:09 -0700 Subject: keyfile: parse Bluetooth addresses as MAC addresses --- system-settings/plugins/keyfile/io/reader.c | 5 +++++ system-settings/plugins/keyfile/io/writer.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/system-settings/plugins/keyfile/io/reader.c b/system-settings/plugins/keyfile/io/reader.c index a71c05c577..b8e5845f68 100644 --- a/system-settings/plugins/keyfile/io/reader.c +++ b/system-settings/plugins/keyfile/io/reader.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -776,6 +777,10 @@ static KeyParser key_parsers[] = { NM_SETTING_WIRELESS_BSSID, TRUE, mac_address_parser }, + { NM_SETTING_BLUETOOTH_SETTING_NAME, + NM_SETTING_BLUETOOTH_BDADDR, + TRUE, + mac_address_parser }, { NULL, NULL, FALSE } }; diff --git a/system-settings/plugins/keyfile/io/writer.c b/system-settings/plugins/keyfile/io/writer.c index 355d624c19..b1398067bb 100644 --- a/system-settings/plugins/keyfile/io/writer.c +++ b/system-settings/plugins/keyfile/io/writer.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -493,6 +494,9 @@ static KeyWriter key_writers[] = { { NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_BSSID, mac_address_writer }, + { NM_SETTING_BLUETOOTH_SETTING_NAME, + NM_SETTING_BLUETOOTH_BDADDR, + mac_address_writer }, { NULL, NULL, NULL } }; -- cgit v1.2.1 From 12dcc07b74cd745381bb523b7896f9cdc10fd4ef Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 25 May 2010 23:34:39 -0700 Subject: keyfile: don't write out default values --- system-settings/plugins/keyfile/io/writer.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/system-settings/plugins/keyfile/io/writer.c b/system-settings/plugins/keyfile/io/writer.c index b1398067bb..348fa515f4 100644 --- a/system-settings/plugins/keyfile/io/writer.c +++ b/system-settings/plugins/keyfile/io/writer.c @@ -509,10 +509,9 @@ write_setting_value (NMSetting *setting, { GKeyFile *file = (GKeyFile *) user_data; const char *setting_name; - GType type; + GType type = G_VALUE_TYPE (value); KeyWriter *writer = &key_writers[0]; - - type = G_VALUE_TYPE (value); + GParamSpec *pspec; /* Setting name gets picked up from the keyfile's section name instead */ if (!strcmp (key, NM_SETTING_NAME)) @@ -525,6 +524,15 @@ write_setting_value (NMSetting *setting, setting_name = nm_setting_get_name (setting); + /* If the value is the default value, remove the item from the keyfile */ + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (setting), key); + if (pspec) { + if (g_param_value_defaults (pspec, (GValue *) value)) { + g_key_file_remove_key (file, setting_name, key, NULL); + return; + } + } + /* Look through the list of handlers for non-standard format key values */ while (writer->setting_name) { if (!strcmp (writer->setting_name, setting_name) && !strcmp (writer->key, key)) { -- cgit v1.2.1 From 7b6a89896784f2a0d2096e11b289596a23e007ae Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 26 May 2010 00:10:42 -0700 Subject: keyfile: ensure wired setting gets added if it's all default values If the wired setting isn't modified at all from the default values it won't get written out anymore after 12dcc07b74cd745381bb523b7896f9cdc10fd4ef, so make sure we include it when necessary. --- system-settings/plugins/keyfile/io/reader.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/system-settings/plugins/keyfile/io/reader.c b/system-settings/plugins/keyfile/io/reader.c index b8e5845f68..e8d4024faa 100644 --- a/system-settings/plugins/keyfile/io/reader.c +++ b/system-settings/plugins/keyfile/io/reader.c @@ -995,17 +995,18 @@ connection_from_file (const char *filename) key_file = g_key_file_new (); if (g_key_file_load_from_file (key_file, filename, G_KEY_FILE_NONE, &err)) { + NMSettingConnection *s_con; + NMSetting *setting; gchar **groups; gsize length; int i; gboolean vpn_secrets = FALSE; + const char *ctype; connection = nm_connection_new (); groups = g_key_file_get_groups (key_file, &length); for (i = 0; i < length; i++) { - NMSetting *setting; - /* Only read out secrets when needed */ if (!strcmp (groups[i], VPN_SECRETS_GROUP)) { vpn_secrets = TRUE; @@ -1017,6 +1018,23 @@ connection_from_file (const char *filename) nm_connection_add_setting (connection, setting); } + /* Make sure that we have the base device type setting even if + * the keyfile didn't include it, which can happen when the base + * device type setting is all default values (like ethernet). + */ + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + if (s_con) { + ctype = nm_setting_connection_get_connection_type (s_con); + setting = nm_connection_get_setting_by_name (connection, ctype); + if (!setting && ctype) { + if (!strcmp (ctype, NM_SETTING_WIRED_SETTING_NAME)) + setting = nm_setting_wired_new (); + + if (setting) + nm_connection_add_setting (connection, setting); + } + } + /* Handle vpn secrets after the 'vpn' setting was read */ if (vpn_secrets) { NMSettingVPN *s_vpn; -- cgit v1.2.1 From 7754690e7e9d43f88b5a17503de2de5356915a68 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 26 May 2010 00:28:26 -0700 Subject: libnm-util: use hash table iterators for simpler code --- libnm-util/nm-connection.c | 49 +++++++++++++++------------------------------- 1 file changed, 16 insertions(+), 33 deletions(-) diff --git a/libnm-util/nm-connection.c b/libnm-util/nm-connection.c index d9cdc270cf..3d73f4db01 100644 --- a/libnm-util/nm-connection.c +++ b/libnm-util/nm-connection.c @@ -556,30 +556,6 @@ nm_connection_compare (NMConnection *a, return info.failed ? FALSE : TRUE; } -typedef struct { - gboolean success; - GSList *all_settings; - GError **error; -} VerifySettingsInfo; - -static void -verify_one_setting (gpointer data, gpointer user_data) -{ - NMSetting *setting = NM_SETTING (data); - VerifySettingsInfo *info = (VerifySettingsInfo *) user_data; - - if (info->success) - info->success = nm_setting_verify (setting, info->all_settings, info->error); -} - -static void -hash_values_to_slist (gpointer key, gpointer value, gpointer user_data) -{ - GSList **list = (GSList **) user_data; - - *list = g_slist_prepend (*list, value); -} - /** * nm_connection_verify: * @connection: the #NMConnection to verify @@ -602,7 +578,10 @@ nm_connection_verify (NMConnection *connection, GError **error) { NMConnectionPrivate *priv; NMSetting *s_con; - VerifySettingsInfo info; + GHashTableIter iter; + gpointer value; + GSList *all_settings = NULL; + gboolean success = TRUE; if (error) g_return_val_if_fail (*error == NULL, FALSE); @@ -627,15 +606,19 @@ nm_connection_verify (NMConnection *connection, GError **error) return FALSE; } + /* Build up the list of settings */ + g_hash_table_iter_init (&iter, priv->settings); + while (g_hash_table_iter_next (&iter, NULL, &value)) { + all_settings = g_slist_append (all_settings, value); + } + /* Now, run the verify function of each setting */ - memset (&info, 0, sizeof (info)); - info.success = TRUE; - info.error = error; - g_hash_table_foreach (priv->settings, hash_values_to_slist, &info.all_settings); - - g_slist_foreach (info.all_settings, verify_one_setting, &info); - g_slist_free (info.all_settings); - return info.success; + g_hash_table_iter_init (&iter, priv->settings); + while (g_hash_table_iter_next (&iter, NULL, &value) && success) + success = nm_setting_verify (NM_SETTING (value), all_settings, error); + + g_slist_free (all_settings); + return success; } /** -- cgit v1.2.1 From 22aee1ac8bb5f2b174ca575f5e24b012f680c491 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 26 May 2010 00:30:32 -0700 Subject: libnm-util: remove useless semicolons --- libnm-util/nm-connection.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libnm-util/nm-connection.c b/libnm-util/nm-connection.c index 3d73f4db01..33790a6363 100644 --- a/libnm-util/nm-connection.c +++ b/libnm-util/nm-connection.c @@ -608,9 +608,8 @@ nm_connection_verify (NMConnection *connection, GError **error) /* Build up the list of settings */ g_hash_table_iter_init (&iter, priv->settings); - while (g_hash_table_iter_next (&iter, NULL, &value)) { + while (g_hash_table_iter_next (&iter, NULL, &value)) all_settings = g_slist_append (all_settings, value); - } /* Now, run the verify function of each setting */ g_hash_table_iter_init (&iter, priv->settings); -- cgit v1.2.1 From 71bae14f2cee42ddf7f441d5a07834988a2b38ac Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 26 May 2010 00:32:05 -0700 Subject: libnm-util: better error message about missing PPP setting --- libnm-util/nm-setting-serial.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libnm-util/nm-setting-serial.c b/libnm-util/nm-setting-serial.c index 7a20688a40..779e53a8d5 100644 --- a/libnm-util/nm-setting-serial.c +++ b/libnm-util/nm-setting-serial.c @@ -149,10 +149,10 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) /* Serial connections require a PPP setting */ if (all_settings && !g_slist_find_custom (all_settings, NM_SETTING_PPP_SETTING_NAME, find_setting_by_name)) { - g_set_error (error, - NM_SETTING_SERIAL_ERROR, - NM_SETTING_SERIAL_ERROR_MISSING_PPP_SETTING, - NULL); + g_set_error_literal (error, + NM_SETTING_SERIAL_ERROR, + NM_SETTING_SERIAL_ERROR_MISSING_PPP_SETTING, + "Missing required PPP setting"); return FALSE; } -- cgit v1.2.1 From 23736bc73c1ccb3a2502d0815b7dbb4d44c81958 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 26 May 2010 00:34:12 -0700 Subject: keyfile: add required PPP setting for serial-based connections --- system-settings/plugins/keyfile/io/reader.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/system-settings/plugins/keyfile/io/reader.c b/system-settings/plugins/keyfile/io/reader.c index e8d4024faa..011e86042c 100644 --- a/system-settings/plugins/keyfile/io/reader.c +++ b/system-settings/plugins/keyfile/io/reader.c @@ -33,6 +33,8 @@ #include #include #include +#include +#include #include #include #include @@ -1035,6 +1037,12 @@ connection_from_file (const char *filename) } } + /* Serial connections require a PPP setting too */ + if (nm_connection_get_setting (connection, NM_TYPE_SETTING_SERIAL)) { + if (!nm_connection_get_setting (connection, NM_TYPE_SETTING_PPP)) + nm_connection_add_setting (connection, nm_setting_ppp_new ()); + } + /* Handle vpn secrets after the 'vpn' setting was read */ if (vpn_secrets) { NMSettingVPN *s_vpn; -- cgit v1.2.1 From d422ce42c400611369a6951bbc9dc012515a3e5b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 26 May 2010 00:39:58 -0700 Subject: keyfile: add testcase for BT DUN connection --- .../keyfile/tests/keyfiles/ATT_Data_Connect_BT | 23 +++ .../plugins/keyfile/tests/keyfiles/Makefile.am | 3 +- .../plugins/keyfile/tests/test-keyfile.c | 173 +++++++++++++++++++++ 3 files changed, 198 insertions(+), 1 deletion(-) create mode 100644 system-settings/plugins/keyfile/tests/keyfiles/ATT_Data_Connect_BT diff --git a/system-settings/plugins/keyfile/tests/keyfiles/ATT_Data_Connect_BT b/system-settings/plugins/keyfile/tests/keyfiles/ATT_Data_Connect_BT new file mode 100644 index 0000000000..cc8a9ee390 --- /dev/null +++ b/system-settings/plugins/keyfile/tests/keyfiles/ATT_Data_Connect_BT @@ -0,0 +1,23 @@ + +[connection] +id=AT&T Data Connect BT +uuid=089130ab-ce28-46e4-ad77-d44869b03d19 +type=bluetooth +autoconnect=false + +[ipv4] +method=auto + +[gsm] +number=*99# +username=ISP@CINGULARGPRS.COM +password=CINGULAR1 +apn=ISP.CINGULAR + +[serial] +baud=115200 + +[bluetooth] +bdaddr=00:11:22:33:44:55 +type=dun + diff --git a/system-settings/plugins/keyfile/tests/keyfiles/Makefile.am b/system-settings/plugins/keyfile/tests/keyfiles/Makefile.am index bf5a5ab060..280596a092 100644 --- a/system-settings/plugins/keyfile/tests/keyfiles/Makefile.am +++ b/system-settings/plugins/keyfile/tests/keyfiles/Makefile.am @@ -3,7 +3,8 @@ EXTRA_DIST = \ Test_GSM_Connection \ Test_Wireless_Connection \ Test_Wired_Connection_MAC_Case \ - Test_Wired_Connection_IP6 + Test_Wired_Connection_IP6 \ + ATT_Data_Connect_BT check-local: @for f in $(EXTRA_DIST); do \ diff --git a/system-settings/plugins/keyfile/tests/test-keyfile.c b/system-settings/plugins/keyfile/tests/test-keyfile.c index aae823642b..d0a49c4b1a 100644 --- a/system-settings/plugins/keyfile/tests/test-keyfile.c +++ b/system-settings/plugins/keyfile/tests/test-keyfile.c @@ -35,6 +35,10 @@ #include #include #include +#include +#include +#include +#include #include "nm-test-helpers.h" @@ -1292,6 +1296,173 @@ test_write_wireless_connection (void) g_object_unref (connection); } +#define TEST_BT_DUN_FILE TEST_KEYFILES_DIR"/ATT_Data_Connect_BT" + +static void +test_read_bt_dun_connection (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingBluetooth *s_bluetooth; + NMSettingSerial *s_serial; + NMSettingPPP *s_ppp; + NMSettingGsm *s_gsm; + GError *error = NULL; + const GByteArray *array; + char expected_bdaddr[ETH_ALEN] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 }; + const char *tmp; + const char *expected_id = "AT&T Data Connect BT"; + const char *expected_uuid = "089130ab-ce28-46e4-ad77-d44869b03d19"; + const char *expected_apn = "ISP.CINGULAR"; + const char *expected_username = "ISP@CINGULARGPRS.COM"; + const char *expected_password = "CINGULAR1"; + + connection = connection_from_file (TEST_BT_DUN_FILE); + ASSERT (connection != NULL, + "connection-read", "failed to read %s", TEST_BT_DUN_FILE); + + ASSERT (nm_connection_verify (connection, &error), + "connection-verify", "failed to verify %s: %s", TEST_BT_DUN_FILE, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "connection-verify-connection", "failed to verify %s: missing %s setting", + TEST_BT_DUN_FILE, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "connection-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_BT_DUN_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "connection-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_BT_DUN_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* UUID */ + tmp = nm_setting_connection_get_uuid (s_con); + ASSERT (tmp != NULL, + "connection-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_WIRELESS_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_UUID); + ASSERT (strcmp (tmp, expected_uuid) == 0, + "connection-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRELESS_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_UUID); + + /* ===== BLUETOOTH SETTING ===== */ + + s_bluetooth = NM_SETTING_BLUETOOTH (nm_connection_get_setting (connection, NM_TYPE_SETTING_BLUETOOTH)); + ASSERT (s_bluetooth != NULL, + "connection-verify-bt", "failed to verify %s: missing %s setting", + TEST_WIRELESS_FILE, + NM_SETTING_WIRED_SETTING_NAME); + + /* BDADDR */ + array = nm_setting_bluetooth_get_bdaddr (s_bluetooth); + ASSERT (array != NULL, + "connection-verify-bt", "failed to verify %s: missing %s / %s key", + TEST_BT_DUN_FILE, + NM_SETTING_BLUETOOTH_SETTING_NAME, + NM_SETTING_BLUETOOTH_BDADDR); + ASSERT (array->len == ETH_ALEN, + "connection-verify-bt", "failed to verify %s: unexpected %s / %s key value length", + TEST_BT_DUN_FILE, + NM_SETTING_BLUETOOTH_SETTING_NAME, + NM_SETTING_BLUETOOTH_BDADDR); + ASSERT (memcmp (array->data, &expected_bdaddr[0], sizeof (expected_bdaddr)) == 0, + "connection-verify-bt", "failed to verify %s: unexpected %s / %s key value", + TEST_BT_DUN_FILE, + NM_SETTING_BLUETOOTH_SETTING_NAME, + NM_SETTING_BLUETOOTH_BDADDR); + + /* Type */ + tmp = nm_setting_bluetooth_get_connection_type (s_bluetooth); + ASSERT (tmp != NULL, + "connection-verify-bt", "failed to verify %s: missing %s / %s key", + TEST_BT_DUN_FILE, + NM_SETTING_BLUETOOTH_SETTING_NAME, + NM_SETTING_BLUETOOTH_TYPE); + ASSERT (strcmp (tmp, NM_SETTING_BLUETOOTH_TYPE_DUN) == 0, + "connection-verify-bt", "failed to verify %s: unexpected %s / %s key value", + TEST_BT_DUN_FILE, + NM_SETTING_BLUETOOTH_SETTING_NAME, + NM_SETTING_BLUETOOTH_TYPE); + + /* ===== GSM SETTING ===== */ + + s_gsm = NM_SETTING_GSM (nm_connection_get_setting (connection, NM_TYPE_SETTING_GSM)); + ASSERT (s_gsm != NULL, + "connection-verify-gsm", "failed to verify %s: missing %s setting", + TEST_BT_DUN_FILE, + NM_SETTING_GSM_SETTING_NAME); + + /* APN */ + tmp = nm_setting_gsm_get_apn (s_gsm); + ASSERT (tmp != NULL, + "connection-verify-gsm", "failed to verify %s: missing %s / %s key", + TEST_BT_DUN_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_APN); + ASSERT (strcmp (tmp, expected_apn) == 0, + "connection-verify-bt", "failed to verify %s: unexpected %s / %s key value", + TEST_BT_DUN_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_APN); + + /* Username */ + tmp = nm_setting_gsm_get_username (s_gsm); + ASSERT (tmp != NULL, + "connection-verify-gsm", "failed to verify %s: missing %s / %s key", + TEST_BT_DUN_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_USERNAME); + ASSERT (strcmp (tmp, expected_username) == 0, + "connection-verify-bt", "failed to verify %s: unexpected %s / %s key value", + TEST_BT_DUN_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_USERNAME); + + /* Password */ + tmp = nm_setting_gsm_get_password (s_gsm); + ASSERT (tmp != NULL, + "connection-verify-gsm", "failed to verify %s: missing %s / %s key", + TEST_BT_DUN_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_PASSWORD); + ASSERT (strcmp (tmp, expected_password) == 0, + "connection-verify-bt", "failed to verify %s: unexpected %s / %s key value", + TEST_BT_DUN_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_PASSWORD); + + /* ===== SERIAL SETTING ===== */ + + s_serial = NM_SETTING_SERIAL (nm_connection_get_setting (connection, NM_TYPE_SETTING_SERIAL)); + ASSERT (s_serial != NULL, + "connection-verify-serial", "failed to verify %s: missing %s setting", + TEST_BT_DUN_FILE, + NM_SETTING_SERIAL_SETTING_NAME); + + /* ===== PPP SETTING ===== */ + + s_ppp = NM_SETTING_PPP (nm_connection_get_setting (connection, NM_TYPE_SETTING_PPP)); + ASSERT (s_ppp != NULL, + "connection-verify-ppp", "failed to verify %s: missing %s setting", + TEST_BT_DUN_FILE, + NM_SETTING_PPP_SETTING_NAME); + + g_object_unref (connection); +} + int main (int argc, char **argv) { GError *error = NULL; @@ -1316,6 +1487,8 @@ int main (int argc, char **argv) test_read_valid_wireless_connection (); test_write_wireless_connection (); + test_read_bt_dun_connection (); + base = g_path_get_basename (argv[0]); fprintf (stdout, "%s: SUCCESS\n", base); g_free (base); -- cgit v1.2.1 From 11d63b63f25cd936879b79b4492cacd7ef4df8b9 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 26 May 2010 01:03:38 -0700 Subject: keyfile: fixups for msising settings for mobile broadband --- system-settings/plugins/keyfile/io/reader.c | 35 ++++-- .../plugins/keyfile/tests/test-keyfile.c | 119 +++++++++++++++++++++ 2 files changed, 147 insertions(+), 7 deletions(-) diff --git a/system-settings/plugins/keyfile/io/reader.c b/system-settings/plugins/keyfile/io/reader.c index 011e86042c..5582733f66 100644 --- a/system-settings/plugins/keyfile/io/reader.c +++ b/system-settings/plugins/keyfile/io/reader.c @@ -34,6 +34,8 @@ #include #include #include +#include +#include #include #include #include @@ -998,12 +1000,13 @@ connection_from_file (const char *filename) key_file = g_key_file_new (); if (g_key_file_load_from_file (key_file, filename, G_KEY_FILE_NONE, &err)) { NMSettingConnection *s_con; + NMSettingBluetooth *s_bt; NMSetting *setting; gchar **groups; gsize length; int i; gboolean vpn_secrets = FALSE; - const char *ctype; + const char *ctype, *tmp; connection = nm_connection_new (); @@ -1028,12 +1031,30 @@ connection_from_file (const char *filename) if (s_con) { ctype = nm_setting_connection_get_connection_type (s_con); setting = nm_connection_get_setting_by_name (connection, ctype); - if (!setting && ctype) { - if (!strcmp (ctype, NM_SETTING_WIRED_SETTING_NAME)) - setting = nm_setting_wired_new (); - - if (setting) - nm_connection_add_setting (connection, setting); + if (ctype) { + gboolean add_serial = FALSE; + NMSetting *new_setting = NULL; + + if (!setting && !strcmp (ctype, NM_SETTING_WIRED_SETTING_NAME)) + new_setting = nm_setting_wired_new (); + else if (!strcmp (ctype, NM_SETTING_BLUETOOTH_SETTING_NAME)) { + s_bt = (NMSettingBluetooth *) nm_connection_get_setting (connection, NM_TYPE_SETTING_BLUETOOTH); + if (s_bt) { + tmp = nm_setting_bluetooth_get_connection_type (s_bt); + if (tmp && !strcmp (tmp, NM_SETTING_BLUETOOTH_TYPE_DUN)) + add_serial = TRUE; + } + } else if (!strcmp (ctype, NM_SETTING_GSM_SETTING_NAME)) + add_serial = TRUE; + else if (!strcmp (ctype, NM_SETTING_CDMA_SETTING_NAME)) + add_serial = TRUE; + + /* Bluetooth DUN, GSM, and CDMA connections require a serial setting */ + if (add_serial && !nm_connection_get_setting (connection, NM_TYPE_SETTING_SERIAL)) + new_setting = nm_setting_serial_new (); + + if (new_setting) + nm_connection_add_setting (connection, new_setting); } } diff --git a/system-settings/plugins/keyfile/tests/test-keyfile.c b/system-settings/plugins/keyfile/tests/test-keyfile.c index d0a49c4b1a..0aac81fff8 100644 --- a/system-settings/plugins/keyfile/tests/test-keyfile.c +++ b/system-settings/plugins/keyfile/tests/test-keyfile.c @@ -1463,6 +1463,124 @@ test_read_bt_dun_connection (void) g_object_unref (connection); } +static void +test_write_bt_dun_connection (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingBluetooth *s_bt; + NMSettingIP4Config *s_ip4; + NMSettingGsm *s_gsm; + char *uuid; + GByteArray *bdaddr; + unsigned char tmpbdaddr[] = { 0xaa, 0xb9, 0xa1, 0x74, 0x55, 0x44 }; + gboolean success; + NMConnection *reread; + char *testfile = NULL; + GError *error = NULL; + pid_t owner_grp; + uid_t owner_uid; + guint64 timestamp = 0x12344433L; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "connection-write", "failed to allocate new connection"); + + /* Connection setting */ + + s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ()); + ASSERT (s_con != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "T-Mobile Funkadelic", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, FALSE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_BLUETOOTH_SETTING_NAME, + NM_SETTING_CONNECTION_TIMESTAMP, timestamp, + NULL); + g_free (uuid); + + /* Bluetooth setting */ + + s_bt = NM_SETTING_BLUETOOTH (nm_setting_bluetooth_new ()); + ASSERT (s_bt != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_BLUETOOTH_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_bt)); + + bdaddr = g_byte_array_sized_new (ETH_ALEN); + g_byte_array_append (bdaddr, &tmpbdaddr[0], sizeof (tmpbdaddr)); + + g_object_set (s_bt, + NM_SETTING_BLUETOOTH_BDADDR, bdaddr, + NM_SETTING_BLUETOOTH_TYPE, NM_SETTING_BLUETOOTH_TYPE_DUN, + NULL); + + g_byte_array_free (bdaddr, TRUE); + + /* IP4 setting */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ()); + ASSERT (s_ip4 != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_IP4_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip4)); + + g_object_set (s_ip4, + NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, + NULL); + + /* GSM setting */ + s_gsm = NM_SETTING_GSM (nm_setting_gsm_new ()); + ASSERT (s_gsm != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_GSM_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_gsm)); + + g_object_set (s_gsm, + NM_SETTING_GSM_APN, "internet2.voicestream.com", + NM_SETTING_GSM_USERNAME, "george.clinton", + NM_SETTING_GSM_PASSWORD, "parliament", + NM_SETTING_GSM_NUMBER, "*99#", + NULL); + + /* Serial setting */ + nm_connection_add_setting (connection, nm_setting_serial_new ()); + + /* PPP setting */ + nm_connection_add_setting (connection, nm_setting_ppp_new ()); + + + /* Write out the connection */ + owner_uid = geteuid (); + owner_grp = getegid (); + success = write_connection (connection, TEST_SCRATCH_DIR, owner_uid, owner_grp, &testfile, &error); + ASSERT (success == TRUE, + "connection-write", "failed to allocate write keyfile: %s", + error ? error->message : "(none)"); + + ASSERT (testfile != NULL, + "connection-write", "didn't get keyfile name back after writing connection"); + + /* Read the connection back in and compare it to the one we just wrote out */ + reread = connection_from_file (testfile); + ASSERT (reread != NULL, "connection-write", "failed to re-read test connection"); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "connection-write", "written and re-read connection weren't the same"); + + g_clear_error (&error); + unlink (testfile); + g_free (testfile); + + g_object_unref (reread); + g_object_unref (connection); +} + int main (int argc, char **argv) { GError *error = NULL; @@ -1488,6 +1606,7 @@ int main (int argc, char **argv) test_write_wireless_connection (); test_read_bt_dun_connection (); + test_write_bt_dun_connection (); base = g_path_get_basename (argv[0]); fprintf (stdout, "%s: SUCCESS\n", base); -- cgit v1.2.1 From c9ee78f238b553c9ef3a89c60bb7f3aeb65c63bd Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 26 May 2010 01:19:21 -0700 Subject: keyfile: add testcases for plain GSM connections --- .../keyfile/tests/keyfiles/ATT_Data_Connect_Plain | 20 ++ .../plugins/keyfile/tests/keyfiles/Makefile.am | 3 +- .../plugins/keyfile/tests/test-keyfile.c | 265 +++++++++++++++++++++ 3 files changed, 287 insertions(+), 1 deletion(-) create mode 100644 system-settings/plugins/keyfile/tests/keyfiles/ATT_Data_Connect_Plain diff --git a/system-settings/plugins/keyfile/tests/keyfiles/ATT_Data_Connect_Plain b/system-settings/plugins/keyfile/tests/keyfiles/ATT_Data_Connect_Plain new file mode 100644 index 0000000000..236cca0edf --- /dev/null +++ b/system-settings/plugins/keyfile/tests/keyfiles/ATT_Data_Connect_Plain @@ -0,0 +1,20 @@ + +[connection] +id=AT&T Data Connect +uuid=15d742f1-2b5a-421e-9f27-fcb1fc26d72c +type=gsm +autoconnect=false + +[ipv4] +method=auto + +[gsm] +number=*99# +username=ISP@CINGULARGPRS.COM +password=CINGULAR1 +apn=ISP.CINGULAR +network-id=24005 +pin=2345 + +[serial] +baud=115200 diff --git a/system-settings/plugins/keyfile/tests/keyfiles/Makefile.am b/system-settings/plugins/keyfile/tests/keyfiles/Makefile.am index 280596a092..52252f9a61 100644 --- a/system-settings/plugins/keyfile/tests/keyfiles/Makefile.am +++ b/system-settings/plugins/keyfile/tests/keyfiles/Makefile.am @@ -4,7 +4,8 @@ EXTRA_DIST = \ Test_Wireless_Connection \ Test_Wired_Connection_MAC_Case \ Test_Wired_Connection_IP6 \ - ATT_Data_Connect_BT + ATT_Data_Connect_BT \ + ATT_Data_Connect_Plain check-local: @for f in $(EXTRA_DIST); do \ diff --git a/system-settings/plugins/keyfile/tests/test-keyfile.c b/system-settings/plugins/keyfile/tests/test-keyfile.c index 0aac81fff8..81e17440c9 100644 --- a/system-settings/plugins/keyfile/tests/test-keyfile.c +++ b/system-settings/plugins/keyfile/tests/test-keyfile.c @@ -1581,6 +1581,268 @@ test_write_bt_dun_connection (void) g_object_unref (connection); } +#define TEST_GSM_FILE TEST_KEYFILES_DIR"/ATT_Data_Connect_Plain" + +static void +test_read_gsm_connection (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingSerial *s_serial; + NMSettingPPP *s_ppp; + NMSettingGsm *s_gsm; + NMSetting *s_bluetooth; + GError *error = NULL; + const char *tmp; + const char *expected_id = "AT&T Data Connect"; + const char *expected_apn = "ISP.CINGULAR"; + const char *expected_username = "ISP@CINGULARGPRS.COM"; + const char *expected_password = "CINGULAR1"; + const char *expected_network_id = "24005"; + const char *expected_pin = "2345"; + + connection = connection_from_file (TEST_GSM_FILE); + ASSERT (connection != NULL, + "connection-read", "failed to read %s", TEST_GSM_FILE); + + ASSERT (nm_connection_verify (connection, &error), + "connection-verify", "failed to verify %s: %s", TEST_GSM_FILE, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "connection-verify-connection", "failed to verify %s: missing %s setting", + TEST_GSM_FILE, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "connection-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_GSM_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "connection-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_GSM_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + tmp = nm_setting_connection_get_connection_type (s_con); + ASSERT (tmp != NULL, + "connection-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_GSM_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, NM_SETTING_GSM_SETTING_NAME) == 0, + "connection-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_GSM_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_TYPE); + + /* ===== BLUETOOTH SETTING ===== */ + + /* Plain GSM, so no BT setting expected */ + s_bluetooth = nm_connection_get_setting (connection, NM_TYPE_SETTING_BLUETOOTH); + ASSERT (s_bluetooth == NULL, + "connection-verify-bt", "unexpected %s setting", + TEST_GSM_FILE, + NM_SETTING_BLUETOOTH_SETTING_NAME); + + /* ===== GSM SETTING ===== */ + + s_gsm = NM_SETTING_GSM (nm_connection_get_setting (connection, NM_TYPE_SETTING_GSM)); + ASSERT (s_gsm != NULL, + "connection-verify-gsm", "failed to verify %s: missing %s setting", + TEST_GSM_FILE, + NM_SETTING_GSM_SETTING_NAME); + + /* APN */ + tmp = nm_setting_gsm_get_apn (s_gsm); + ASSERT (tmp != NULL, + "connection-verify-gsm", "failed to verify %s: missing %s / %s key", + TEST_GSM_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_APN); + ASSERT (strcmp (tmp, expected_apn) == 0, + "connection-verify-gsm", "failed to verify %s: unexpected %s / %s key value", + TEST_GSM_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_APN); + + /* Username */ + tmp = nm_setting_gsm_get_username (s_gsm); + ASSERT (tmp != NULL, + "connection-verify-gsm", "failed to verify %s: missing %s / %s key", + TEST_GSM_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_USERNAME); + ASSERT (strcmp (tmp, expected_username) == 0, + "connection-verify-gsm", "failed to verify %s: unexpected %s / %s key value", + TEST_GSM_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_USERNAME); + + /* Password */ + tmp = nm_setting_gsm_get_password (s_gsm); + ASSERT (tmp != NULL, + "connection-verify-gsm", "failed to verify %s: missing %s / %s key", + TEST_GSM_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_PASSWORD); + ASSERT (strcmp (tmp, expected_password) == 0, + "connection-verify-gsm", "failed to verify %s: unexpected %s / %s key value", + TEST_GSM_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_PASSWORD); + + /* Network ID */ + tmp = nm_setting_gsm_get_network_id (s_gsm); + ASSERT (tmp != NULL, + "connection-verify-gsm", "failed to verify %s: missing %s / %s key", + TEST_GSM_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_NETWORK_ID); + ASSERT (strcmp (tmp, expected_network_id) == 0, + "connection-verify-gsm", "failed to verify %s: unexpected %s / %s key value", + TEST_GSM_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_NETWORK_ID); + + /* PIN */ + tmp = nm_setting_gsm_get_pin (s_gsm); + ASSERT (tmp != NULL, + "connection-verify-gsm", "failed to verify %s: missing %s / %s key", + TEST_GSM_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_PIN); + ASSERT (strcmp (tmp, expected_pin) == 0, + "connection-verify-gsm", "failed to verify %s: unexpected %s / %s key value", + TEST_GSM_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_PIN); + + /* ===== SERIAL SETTING ===== */ + + s_serial = NM_SETTING_SERIAL (nm_connection_get_setting (connection, NM_TYPE_SETTING_SERIAL)); + ASSERT (s_serial != NULL, + "connection-verify-serial", "failed to verify %s: missing %s setting", + TEST_GSM_FILE, + NM_SETTING_SERIAL_SETTING_NAME); + + /* ===== PPP SETTING ===== */ + + s_ppp = NM_SETTING_PPP (nm_connection_get_setting (connection, NM_TYPE_SETTING_PPP)); + ASSERT (s_ppp != NULL, + "connection-verify-ppp", "failed to verify %s: missing %s setting", + TEST_GSM_FILE, + NM_SETTING_PPP_SETTING_NAME); + + g_object_unref (connection); +} + +static void +test_write_gsm_connection (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingIP4Config *s_ip4; + NMSettingGsm *s_gsm; + char *uuid; + gboolean success; + NMConnection *reread; + char *testfile = NULL; + GError *error = NULL; + pid_t owner_grp; + uid_t owner_uid; + guint64 timestamp = 0x12344433L; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "connection-write", "failed to allocate new connection"); + + /* Connection setting */ + + s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ()); + ASSERT (s_con != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "T-Mobile Funkadelic 2", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, FALSE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_CONNECTION_TIMESTAMP, timestamp, + NULL); + g_free (uuid); + + /* IP4 setting */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ()); + ASSERT (s_ip4 != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_IP4_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip4)); + + g_object_set (s_ip4, + NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, + NULL); + + /* GSM setting */ + s_gsm = NM_SETTING_GSM (nm_setting_gsm_new ()); + ASSERT (s_gsm != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_GSM_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_gsm)); + + g_object_set (s_gsm, + NM_SETTING_GSM_APN, "internet2.voicestream.com", + NM_SETTING_GSM_USERNAME, "george.clinton.again", + NM_SETTING_GSM_PASSWORD, "parliament2", + NM_SETTING_GSM_NUMBER, "*99#", + NM_SETTING_GSM_PIN, "123456", + NM_SETTING_GSM_NETWORK_ID, "254098", + NM_SETTING_GSM_HOME_ONLY, TRUE, + NM_SETTING_GSM_NETWORK_TYPE, NM_SETTING_GSM_NETWORK_TYPE_PREFER_UMTS_HSPA, + NULL); + + /* Serial setting */ + nm_connection_add_setting (connection, nm_setting_serial_new ()); + + /* PPP setting */ + nm_connection_add_setting (connection, nm_setting_ppp_new ()); + + + /* Write out the connection */ + owner_uid = geteuid (); + owner_grp = getegid (); + success = write_connection (connection, TEST_SCRATCH_DIR, owner_uid, owner_grp, &testfile, &error); + ASSERT (success == TRUE, + "connection-write", "failed to allocate write keyfile: %s", + error ? error->message : "(none)"); + + ASSERT (testfile != NULL, + "connection-write", "didn't get keyfile name back after writing connection"); + + /* Read the connection back in and compare it to the one we just wrote out */ + reread = connection_from_file (testfile); + ASSERT (reread != NULL, "connection-write", "failed to re-read test connection"); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "connection-write", "written and re-read connection weren't the same"); + + g_clear_error (&error); + unlink (testfile); + g_free (testfile); + + g_object_unref (reread); + g_object_unref (connection); +} + int main (int argc, char **argv) { GError *error = NULL; @@ -1608,6 +1870,9 @@ int main (int argc, char **argv) test_read_bt_dun_connection (); test_write_bt_dun_connection (); + test_read_gsm_connection (); + test_write_gsm_connection (); + base = g_path_get_basename (argv[0]); fprintf (stdout, "%s: SUCCESS\n", base); g_free (base); -- cgit v1.2.1 From 7ffcb98afda40e1d311cc7f9b3f955de7417e3f3 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 26 May 2010 01:20:20 -0700 Subject: doc: trivial fix --- libnm-util/nm-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c index 5a8a8800db..ddb02a220e 100644 --- a/libnm-util/nm-utils.c +++ b/libnm-util/nm-utils.c @@ -352,7 +352,7 @@ nm_utils_ssid_to_utf8 (const char *ssid, guint32 len) /* Shamelessly ripped from the Linux kernel ieee80211 stack */ /** - * nm_utils_deinit: + * nm_utils_is_empty_ssid: * @ssid: pointer to a buffer containing the SSID data * @len: length of the SSID data in @ssid * -- cgit v1.2.1 From 8bd51680316798e3c19f836c9df07f7411fa12b4 Mon Sep 17 00:00:00 2001 From: I Felix Date: Wed, 26 May 2010 01:35:26 -0700 Subject: po: add Tamil translation --- po/LINGUAS | 1 + po/ta.po | 1806 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1807 insertions(+) create mode 100644 po/ta.po diff --git a/po/LINGUAS b/po/LINGUAS index 9494643213..2428598623 100644 --- a/po/LINGUAS +++ b/po/LINGUAS @@ -54,6 +54,7 @@ sq sr sr@latin sv +ta te th uk diff --git a/po/ta.po b/po/ta.po new file mode 100644 index 0000000000..1642030c33 --- /dev/null +++ b/po/ta.po @@ -0,0 +1,1806 @@ +# translation of NetworkManager.po.master.ta.po to Tamil +# Tamil translation for NetworkManager. +# Copyright (C) 2009 NetworkManager's COPYRIGHT HOLDER +# This file is distributed under the same license as the NetworkManager package. +# +# Felix I , 2009. +# I. Felix , 2009, 2010. +# I Felix , 2010. +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager.po.master.ta\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-10 13:26+0530\n" +"Last-Translator: I Felix \n" +"Language-Team: Tamil \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Lokalize 1.0\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\\n" +"\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"பயன்பாடு: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "பிழை: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Error: 'con list': %s; அனுமதிக்கப்பட்ட புலங்கள்: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "இணைப்பு விவரங்கள்" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "கணினி" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "பயனர்" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "ஒருபோதும் இல்லை" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "ஆம்" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "இல்லை" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "கணினி இணைப்புகள்" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "பயனர் இணைப்புகள்" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "பிழை: %s விவாதம் விடுபட்டுள்ளது." + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "பிழை: %s - அது போன்ற இணைப்பு இல்லை." + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "தெரியாத அளவுரு: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "பிழை: குறிப்பிடப்பட்ட சரியான அளவுரு இல்லை." + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "பிழை: %s." + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "பிழை: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "பிழை: 'con status': %s; அனுமதிக்கப்பட்ட புலங்கள்: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "இணைப்புகளை செயற்படுத்து" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "சாதனம் '%s' இல் செயல்படும் இணைப்பு இல்லை" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "செயல்படும் இணைப்பு அல்லது சாதனம் இல்லை" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "சாதனம் '%s' இணைப்பு '%s' உடன் உகந்தது அல்ல" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "இணைப்பு '%s'க்கு சாதனம் எதுவும் இல்லை" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "செயல்படுகிறது" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "செயல்படுத்தப்பட்டது" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "தெரியாத" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN இணைக்கிறது (தயாராகு)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN இணைக்கிறது (அங்கீகாரம் தேவை)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN இணைக்கிறது" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN இணைக்கிறது (IP கட்டமைப்பை பெறுகிறது)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN இணைக்கிறது" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN ஐ இணைக்க முடியவில்லை" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN துண்டிக்கப்பட்டது" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "தெரியாத காரணம்" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "ஒன்றுமில்லாத" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "பயனர் செயல்நீக்கப்பட்டார்" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "தளப் பிணைய இணைப்பானது தடை செய்யப்பட்டிருந்தது" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "எதிர்பாராமல் VPN சேவை நிறுத்தப்பட்டது" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "VPN சேவையானது தவறான கட்டமைப்பிற்கு திரும்பியது" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "இணைப்பு முயற்சியின் நேரம் முடிந்தது" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "VPN சேவை நேரத்திற்கு துவங்கவில்லை" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "VPN சேவையை துவக முடியவில்லை" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "சரியான VPN இரகசியங்கள் இல்லை" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "தவறான VPN இரகசியங்கள்" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "இணைப்பானது நீக்கப்பட்டது" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "நிலை: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "இணைப்பு செயல்படுத்தப்பட்டது\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "பிழை: இணைப்பை செயல்படுத்த முடியவில்லை." + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "நிலை: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "பிழை: இணைப்பை செயல்படுத்த முடியவில்லை: %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "பிழை: நேரமுடிந்த %d விநாடி காலாவதியானது." + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "பிழை: இணைப்பை செயல்படுத்த முடியவில்லை:%s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Error: Obtaining active connection for '%s' failed." + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "செயல்படும் இணைப்பின் நிலை: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "செயல்படும் இணைப்பின் பாதை: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "பிழை: தெரியாத பிழை: %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "பிழை: நேரமுடிவு மதிப்பு '%s' சரியானதல்ல." + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "பிழை: id அல்லது uuid குறிப்பிடப்பட வேண்டும்." + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "பிழை: தகுதியான சாதனம் காணப்படவில்லை: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "பிழை: தகுதியான சாதனம் காணப்படவில்லை." + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "எச்சரிக்கை: இணைப்பு செயல்பாட்டில் இல்லை\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "பிழை: 'con' கட்டளை '%s' சரியானதல்ல." + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "பிழை: D-பஸ்ஸை இணைக்க முடியவில்லை." + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "பிழை: கணினி அமைவுகளை பெற முடியவில்லை." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "பிழை: பயனர் அமைவுகளை பெற முடியவில்லை." + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "பிழை: இணைப்பை பெற முடியவில்லை: அமைவுகளின் சேவைகள் இயங்கவில்லை." + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "பராமரிக்கப்படாத" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "கிடைக்கப்பெறாத" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "துண்டிக்கப்பட்டது" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "இணைக்கிறது (தயாராக்கு)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "இணைக்கிறது (கட்டமைக்கிறது)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "இணைக்கிறது (அங்கீகாரம் தேவை)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "இணைக்கிறது (IP கட்டமைப்பை பெறுகிறது)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "இணைக்கப்பட்டது" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "இணைக்க முடியவில்லை" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "தெரியாத" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(ஒன்றுமில்லாத)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: IP4 முகவரி 0x%X ஐ மாற்றுவதில் பிழை" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "மறைகுறியாக்கப்பட்டது: " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "என்டர்பிரைசஸ்" + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "அடித்தளம்" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "பிழை: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "பிழை: 'dev list': %s; அனுமதிக்கப்பட்ட புலங்கள்: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "சாதன விவரங்கள்" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(தெரியாத)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "தெரியாத)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "ஆன் " + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "ஆஃப்" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "பிழை: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "பிழை: 'dev status': %s; அனுமதிக்கப்பட்ட புலங்கள்: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "சாதனங்களின் நிலை" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "பிழை: '%s' விவாதம் விடுபட்டது." + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "பிழை: சாதனம் '%s' காணப்படவில்லை." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "வெற்றி: சாதனம் '%s' வெற்றிகரமாக துண்டிக்கப்பட்டது." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "பிழை: சாதனம் '%s' (%s) துண்டிக்கபடவில்லை: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "சாதன நிலை: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "பிழை: iபேஸ் குறிப்பிடப்பட வேண்டும்." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "பிழை: 'dev wifi': '%s'" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "பிழை: 'dev wifi': %s; அனுமதிக்கப்பட்ட புலங்கள்: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi ஸ்கேன் பட்டியல்" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "பிழை:hwaddr '%s' உடன் அணுகல் புள்ளி காணப்படவில்லை." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "பிழை: சாதனம் '%s' ஒரு WiFi சாதனம் இல்லை." + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "பிழை: 'dev wifi' கட்டளை '%s' ஆனது தவறானது." + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "பிழை: 'dev' கட்டளை '%s' தவறானது." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "RUNNING" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"பயன்பாடு: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" நிலை\n" +" தூக்கம்\n" +" விழிப்பு\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "தூங்கிக் கொண்டிருத்தல்" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "இணைக்கிறது" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "பிழை: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "பிழை: 'nm status': %s; அனுமதிக்கப்பட்ட புலங்கள்: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "பிணைய மேலாளர் நிலை" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "செயல்படுத்தப்பட்டது" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "செயல்நீக்கப்பட்டது" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "இயங்குகிறது" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "இயங்கவில்லை" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "பிழை: '--fields' மதிப்பு '%s' இங்கே சரியாக இல்லை; அனுமதிக்கப்பட்ட புலங்கள்: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi செயல்படுத்தப்பட்டது" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "பிழை: தவறான 'wifi' அளவுரு: '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN செயல்படுத்தப்பட்டது" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "பிழை: தவறான 'wwan' அளவுரு: '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Error: 'nm' கட்டளை '%s' தவனாறது." + +#: ../cli/src/nmcli.c:69 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "பிழை: பொருள் '%s' ஆனது தெரியாதது, 'nmcli உதவியை' முயற்சிக்கவும்." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "பிழை: விருப்பம் '--terse' இரண்டாவது முறை குறிப்பிடப்பட்டது." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "பிழை: விருப்பம் '--terse'ஆனது '--pretty' உடன் ஒன்றாக உள்ளது." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "பிழை: விருப்பம் '--pretty' இரண்டாவது முறை குறிப்பிட்டது." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "பிழை: விருப்பம் '--pretty'ஆனது '--terse' உடன் ஒன்றாக உள்ளது" + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "பிழை: '%s' விருப்பத்திற்கு விவாதம் விடுபட்டுள்ளது." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "பிழை: '%s' ஆனது '%s' விருப்பத்திற்கு சரியான விவாதம் அல்ல." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "பிழை: '%s' க்கு புலங்கள் விடுபட்டது." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli கருவி, பதிப்பு %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "பிழை: விருப்பம் '%s'ஆனது தெரியாதது, 'nmcli -உதவியை' முயற்சிக்கவும்." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "%d சிக்னல் கிடைத்துவிட்டது, பணி நிறுத்துகிறது..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "பிழை: பிணைய மேலாளரை இணைக்க முடியவில்லை." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "வெற்றி" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-bit கடவுச்சொல்)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (தெரியாத)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (தெரியாத)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "ஏதாவது," + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "தானே" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "அமைக்கப்படவில்லை" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "புலம் '%s' தனியாக இருக்க வேண்டும்" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "தவறான புலம் '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "விருப்பம் '--terse' '--fields'ஐ குறிப்பிட தேவைப்படுகிறது" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "" +"விருப்பம் '--terse'க்கு குறிப்பிட்ட '--fields' விருப்ப மதிப்புகள் தேவை, '%s' அல்ல" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM விசைக் கோப்பிற்கு முடிவு ஒட்டு'%s' இல்லை." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "இதைப் பார்ப்பதற்கு ஒரு PEM தனிப்பட்ட விசைக் கோப்பு போல் இல்லை." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "PEM கோப்பு தரவை சேமிக்க போதைய நினைவகம் இல்லை." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "முறையற்ற PEM கோப்பு: Proc-வகையானது முதல் ஒட்டு இல்லை." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "முறையற்ற PEM கோப்பு: தெரியாத Proc-வகை ஒட்டு '%s'." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "முறையற்ற PEM கோப்பு: DEK-தகவலானது இரண்டாவது ஒட்டாக இருக்க முடியாது." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "முறையற்ற PEM கோப்பு: IV ஆனது DEK-தகவல் ஒட்டில் காணப்படவில்லை." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "முறையற்ற PEM கோப்பு: DEK-தகவல் ஒட்டினுள் IV ன் தவறான வடிவம்." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "முறையற்ற PEM கோப்பு: தெரியாத தனிப்பட்ட விசை cipher '%s'." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "தனிப்பட்ட விசையை குறியாக்க முடியவில்லை." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM சான்றிதழானது '%s' முடிவு ஒட்டு '%s'ஐ பெற்றிருக்கவில்லை." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "சான்றிதழை குறியாக முடியவில்லை." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "சான்றிதழ் தரவை சேமிக்க போதைய நினைவகம் இல்லை." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "கோப்பு தரவை சேமிக்க போதைய நினைவகம் இல்லை." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV ஆனது நீளத்தில் ஒரு பைட்டிகளின் எண்னைப் பெற்றுள்ளது." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "IVஐ சேமிக்க போதைய நினைவகம் இல்லை." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV ஆனது-ஹெக்ஸா தசம எண்களை பெற்றிருக்கவில்லை." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "தனிப்பட்ட விசை cipher '%s' ஆனது தெரியாதது." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "தனிப்பட்ட விசையின் மறைகுறிமுறையை நீக்க போதை நினைவகம் இல்லை." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "தனிப்பட்ட விசை வகையை வரையறுக்க முடியவில்லை." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "தனிப்பட்ட விசையின் மறைகுறிமுறையை நீக்கத்தை சேமிக்க போதை நினைவகம் இல்லை." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "crypto என்ஜினைத் துவக்க முடியவில்லை." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "MD5 என்ஜினைத் துவக்க முடியவில்லை: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "தவறான IV நீளம் ( %zdவது இருக்க வேண்டும்)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "மறைகுறிமுறைநீக்க விசை பஃப்பருக்கான போதைய நினைவகம் இல்லை." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "cipher சேர்த்து மறைகுறிமுறை நீக்கத்தை துவக்க முடியவில்லை: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "மறைகுறிமுறைநீக்கத்திற்கான ஒத்த விசையை அமைக்க முடியவில்லை.: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "IV கான மறைகுறிமுறை நீக்கத்தை அமைக்க முடியவில்லை: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "தனிப்பட்ட விசைக்கு மறைகுறிமுறையை நீக்க முடியவில்லை: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "தனிப்பட்ட விசைக்கு மறைகுறிமுறையை நீக்க முடியவில்லை: எதிர்பாராத பாடிங் நீளம்." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "தனிப்பட்ட விசைக்கு மறைகுறிமுறையை நீக்க முடியவில்லை." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "மறைகுறியாக்கத்திற்கான நினைவகத்தை ஒதுக்கிட முடியவில்லை." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "cipher சேர்த்து மறைகுறியாக்கத்தை துவக்க முடியவில்லை: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "மறைகுறியாக்கத்திற்கான ஒத்த விசையை அமைக்க முடியவில்லை.: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "IV கான மறைகுறியாக்கத்தை அமைக்க முடியவில்லை: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "தரவை மறைகுறியாக்க முடியவில்லை: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "சான்றிதழ் தரவை துவக்குவதில் பிழை: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "சான்றிதழை குறியாக்க முடியவில்லை: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "PKCS#12 குறியாளரை துவக்க முடியவில்லை: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "PKCS#12 கோப்பை குறியாக்க முடியவில்லை: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "PKCS#12 கோப்பை சரிபார்க்க முடியவில்லை: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "crypto என்ஜினைத் துவக்க முடியவில்லை: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "MD5 உரையை துவக்க முடியவில்லை: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "தவறான IV நீளம் (%dயாவது இருக்க வேண்டும்)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "மறைகுறிமுறையை நீக்க cipher வரிசையை துவக்க முடியவில்லை." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "மறைகுறிமுறைநீக்கத்திற்கான ஒத்த விசையை அமைக்க முடியவில்லை." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "IV கான மறைகுறிமுறையை அமைக்க முடியவில்லை." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "மறைகுறிமுறைநீக்கத்தை சேர்த்து துவக்க முடியவில்லை." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "தனிப்பட்ட விசையின் மறைகுறிமுறையை நீக்க முடியவில்லை: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "" +"தனிப்பட்ட விசையின் மறைகுறிமுறையை நீக்க முடியவில்லை: மறைகுறிமுறை நீக்கப்பட்ட தரவு மிக " +"நீளமானது." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "தனிப்பட்ட விசையின் மறைகுறிமுறையை முடி முடியவில்லை: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "மறைகுறியாக்க cipher வரிசையை துவக்க முடியவில்லை." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "மறைகுறியாக்கத்திற்கான ஒத்த விசையை அமைக்க முடியவில்லை." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "IV கான மறைகுறியாக்கத்தை அமைக்க முடியவில்லை." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "மறைகுறியாக்க சேர்த்து துவக்க முடியவில்லை." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "மறைகுறியாக்க முடியவில்லை: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "மறைகுறியாக்கத்திற்குப் பின் எதிர்பாராத தரவின் எண்ணிக்கை." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "சான்றிதழை குறியாக்க முடியவில்லை: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "கடவுச்சொல்லை UCS2க்கு மாற்ற முடியவில்லை: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "PKCS#12 குறியாக்கத்தை துவக்க முடியவில்லை: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "PKCS#12 கோப்பை குறியாக்க முடியவில்லை: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "PKCS#12 கோப்பை சரிபார்க்க முடியவில்லை: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "தற்செயலான தரவை உருவாக்க முடியவில்லை." + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "மறைகுறியாக்க விசையை செய்ய போதைய நினைவகம் இல்லை." + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM கோப்பிற்கான உருவாக்கத்திற்கு போதைய நினைவ ஒதுக்கீடு இல்லை." + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "PEM கோப்பில் IVஐ எழுதுவதற்கு போதைய நினைவக ஒதுக்கீடு இல்லை." + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "PEM கோப்பிற்கு மறைகுறியாக்க விசையை எழுதுவதற்கான போதைய நினைவகத்தை ஒதுக்கவில்லை." + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "PEM கோப்பு தரவிற்காக போதைய நினைவக ஒதுக்கீடு இல்லை." + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "netlink செய்தியின் செயல்முறையில் பிழை: %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "சாக்கெட்டில் தரவிற்காக காத்திருக்கும் போது பிழை ஏற்பட்டது" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "இணைப்பு நிலையை பார்வையிட நெட்இணைப்பை இணைக்க முடியவில்லை: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "netlink ஹாண்டில் நற்சான்றை செயல்படுத்த முடியவில்லை: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "இணைப்பு நிலைக்கான netlink ஹாண்டிலை ஒதுக்கிட முடியவில்லை: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "இணைப்பு நிலையை கண்கானிக்க netlink இணைப்பு செக்கை ஒதுக்கிட முடியவில்லை: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "netlink குழுவுடன் சேர முடியவில்லை: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "பிழை மேம்படுத்தும் இணைப்பு செக்: %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"தவறான விருப்பம். உதவியை --பயன்படுத்தி சரியான விருப்பங்களின் பட்டியலைப் பார்க்கவும்.\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. --helpஐ பயன்படுத்தி சரியான விருப்பங்களின் பட்டியலைப் பார்க்கவும்.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# Created by NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Merged from %s\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "பயன்படக்கூடிய DHCP வாடிக்கையாளர் காணப்படவில்லை" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' காணப்படவில்லை." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' காணப்படவில்லை." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "துணைபுரியாத DHCP வாடிக்கையாளர் '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "தெரியாத பதிவு நிலை '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "தெரியாத பதிவு டொமைன் '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "குறிப்பு: இந்த libc மறுதீர்வாளர் 3 பெயர்சேவையர்களுக்கு மேல் துணைபுரியவதில்லை." + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "கீழே பட்டியலிட்டப்படுள்ள பெயர்சேவையகங்கள் கண்டுபிடிக்கப்படவில்லை." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "தானியக்கி %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "கணினி" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "ஒரு பாதுகாக்கப்ப WiFi நெட்வொர்க்கின் வழியாக இணைப்பு பகிரப்படுகிறது" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "ஒரு திறந்த WiFi நெட்வொர்க்கின் வழியாக இணைப்பு பகிரப்படுகிறது" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "நிலையான கணினி புரவலப்பெயரை மாற்றியமை" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "கணினி இணைப்புகளை மாற்றியமைக்கவும்" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "கணினி அமைவுகளின் மாற்றத்தை கணினி பாலிசி தடுக்கிறது" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "நிலையான கணினி புரவலபெயர் மாற்றியமைப்பதை கணினி பாலிசி தடுக்கிறது" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"பாதுகாக்கப்பட்ட WiFi நெட்வொர்க்கின் வழியாக இணைப்புகளை பகிருவதை கணினி பாலிசி தடுக்கிறது" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "திறந்த WiFi நெட்வொர்க்கின் வழியாக இணைப்புகளை பகிருவதை கணினி பாலிசி தடுக்கிறது" + +#~ msgid "Type" +#~ msgstr "வகை" + +#~ msgid "Name" +#~ msgstr "பெயர்" + +#~ msgid "User connections:\n" +#~ msgstr "பயனர் இணைப்புகள்:\n" + +#~ msgid "System-wide connections" +#~ msgstr "பரந்த கணினி இணைப்புகள்" + +#~ msgid "Default" +#~ msgstr "முன்னிருப்பு" + +#~ msgid "Service" +#~ msgstr "சேவை" + +#~ msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +#~ msgstr "%s, %s, Freq %d MHz, விகிதம் %d Mb/s, வலிமை %d" + +#~ msgid "Device" +#~ msgstr "சாதனம்" + +#~ msgid "Driver" +#~ msgstr "இயக்கி" + +#~ msgid "State" +#~ msgstr "நிலை" + +#~ msgid "HW Address" +#~ msgstr "HW முகவரி" + +#~ msgid "" +#~ "\n" +#~ " Capabilities:\n" +#~ msgstr "" +#~ "\n" +#~ " ஆற்றல்கள்:\n" + +#~ msgid "Carrier Detect" +#~ msgstr "கேரியர் கண்டுபிடிப்பு" + +#~ msgid "Speed" +#~ msgstr "வேகம்" + +#~ msgid "" +#~ "\n" +#~ " Wireless Properties\n" +#~ msgstr "" +#~ "\n" +#~ " கம்பியில்லா தன்மைகள்\n" + +#~ msgid "WEP Encryption" +#~ msgstr "WEP மறைகுறியநாக்கம்" + +#~ msgid "WPA Encryption" +#~ msgstr "WPA மறைகுறியாக்கம்" + +#~ msgid "WPA2 Encryption" +#~ msgstr "WPA2 மறைகுறியாக்கம்" + +#~ msgid "TKIP cipher" +#~ msgstr "TKIP cipher" + +#~ msgid "CCMP cipher" +#~ msgstr "CCMP சிப்பர்" + +#~ msgid "" +#~ "\n" +#~ " Wireless Access Points %s\n" +#~ msgstr "" +#~ "\n" +#~ " வயர்லெஸ் அணுகல் புள்ளி %s\n" + +#~ msgid "(* = current AP)" +#~ msgstr "(* = நடப்பு AP)" + +#~ msgid "" +#~ "\n" +#~ " Wired Properties\n" +#~ msgstr "" +#~ "\n" +#~ " வயர்டு தன்மைகள்\n" + +#~ msgid "Carrier" +#~ msgstr "கேரியர்" + +#~ msgid "" +#~ "\n" +#~ " IPv4 Settings:\n" +#~ msgstr "" +#~ "\n" +#~ " IPv4 அமைவுகள்:\n" + +#~ msgid "Address" +#~ msgstr "முகவரி" + +#~ msgid "Prefix" +#~ msgstr "முன்பொருத்தம்" + +#~ msgid "Gateway" +#~ msgstr "நுழைவாயில்" + +#~ msgid "Device:" +#~ msgstr "சாதனம்:" + +#~ msgid "Error: hwaddr has to be specified." +#~ msgstr "பிழை: hwaddr குறிப்பிடப்பட வேண்டும்." + +#~ msgid "AP parameters" +#~ msgstr "AP அளவுருக்கள்" + +#~ msgid "Frequency:" +#~ msgstr "அடிக்கடி:" + +#~ msgid "Mode:" +#~ msgstr "முறைமை:" + +#~ msgid "Ad-hoc" +#~ msgstr "Ad-hoc" + +#~ msgid "Maximal bitrate:" +#~ msgstr "அதிகபட்ச பிட்ரெட்:" + +#~ msgid "Strength:" +#~ msgstr "வலிமை:" + +#~ msgid "Flags:" +#~ msgstr "கொடிகள்:" + +#~ msgid "privacy" +#~ msgstr "தனிப்பட்ட" + +#~ msgid "WPA flags:" +#~ msgstr "WPA கொடிகள்:" + +#~ msgid "RSN flags:" +#~ msgstr "RSN கொடிகள்:" + +#~ msgid "NM running:" +#~ msgstr "NM இயங்குகிறது:" + +#~ msgid "NM state:" +#~ msgstr "NM நிலை:" + +#~ msgid "NM wireless hardware:" +#~ msgstr "NM வயர்லெஸ் வன்பொருள்:" + +#~ msgid "NM wireless:" +#~ msgstr "NM வயர்லெஸ்:" + +#~ msgid "NM WWAN hardware:" +#~ msgstr "NM WWAN வன்பொருள்:" + +#~ msgid "unable to join netlink group for monitoring link status: %s" +#~ msgstr "இணைப்பு நிலையை கண்கானிக்க netlink குழுவில் சேர முடியவில்லை: %s" + +#~ msgid "unable to connect to netlink: %s" +#~ msgstr "netlinkஉடன் இணைக்க முடியவில்லை: %s" -- cgit v1.2.1 From 0f494b2445079fea10cafd7039808dbd29cc00dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=20Di=C3=A9guez?= Date: Wed, 26 May 2010 10:25:05 -0700 Subject: po: update Galican translation (bgo #619579) --- po/gl.po | 1013 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 929 insertions(+), 84 deletions(-) diff --git a/po/gl.po b/po/gl.po index ca5d3d53cd..50cfafafb7 100644 --- a/po/gl.po +++ b/po/gl.po @@ -7,8 +7,9 @@ msgid "" msgstr "" "Project-Id-Version: gl\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2009-09-29 03:25+0000\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-04-27 15:25+0000\n" "PO-Revision-Date: 2010-02-25 11:06+0100\n" "Last-Translator: Miguel Anxo Bouzada \n" "Language-Team: Galego \n" @@ -17,6 +18,808 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" +#: ../cli/src/connections.c:86 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" + +#: ../cli/src/connections.c:158 +msgid "Connections" +msgstr "" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/devices.c:298 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Type" +msgstr "" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "UUID" +msgstr "" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Name" +msgstr "" + +#: ../cli/src/connections.c:163 +#, fuzzy, c-format +#| msgid "Modify system connections" +msgid "System connections:\n" +msgstr "Modificar as conexións do sistema" + +#: ../cli/src/connections.c:167 +#, fuzzy, c-format +#| msgid "Modify system connections" +msgid "User connections:\n" +msgstr "Modificar as conexións do sistema" + +#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 +#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 +#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 +#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 +#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 +#, c-format +msgid "Error: %s argument is missing." +msgstr "" + +#: ../cli/src/connections.c:189 +#, c-format +msgid "Error: %s - no such connection." +msgstr "" + +#: ../cli/src/connections.c:196 +#, fuzzy +#| msgid "Modify system connections" +msgid "System-wide connections" +msgstr "Modificar as conexións do sistema" + +#: ../cli/src/connections.c:205 +#, fuzzy +#| msgid "Modify system connections" +msgid "User connections" +msgstr "Modificar as conexións do sistema" + +#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 +#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 +#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 +#: ../cli/src/devices.c:798 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "" + +#: ../cli/src/connections.c:221 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "" + +#. FIXME: Fix the output +#: ../cli/src/connections.c:268 ../cli/src/devices.c:302 +#: ../cli/src/devices.c:321 ../cli/src/devices.c:353 ../cli/src/devices.c:355 +#: ../cli/src/devices.c:357 ../cli/src/devices.c:359 ../cli/src/devices.c:361 +msgid "yes" +msgstr "" + +#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 +msgid "no" +msgstr "" + +#: ../cli/src/connections.c:297 +#, fuzzy +#| msgid "Modify system connections" +msgid "Active connections" +msgstr "Modificar as conexións do sistema" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 +msgid "Default" +msgstr "" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Service" +msgstr "" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Devices" +msgstr "" + +#: ../cli/src/connections.c:659 +#, c-format +msgid "no active connection on device '%s'" +msgstr "" + +#: ../cli/src/connections.c:667 +#, c-format +msgid "no active connection or device" +msgstr "" + +#: ../cli/src/connections.c:730 +msgid "activating" +msgstr "" + +#: ../cli/src/connections.c:732 +msgid "activated" +msgstr "" + +#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 +#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 +#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 +msgid "unknown" +msgstr "" + +#: ../cli/src/connections.c:744 +msgid "VPN connecting (prepare)" +msgstr "" + +#: ../cli/src/connections.c:746 +msgid "VPN connecting (need authentication)" +msgstr "" + +#: ../cli/src/connections.c:748 +msgid "VPN connecting" +msgstr "" + +#: ../cli/src/connections.c:750 +msgid "VPN connecting (getting IP configuration)" +msgstr "" + +#: ../cli/src/connections.c:752 +msgid "VPN connected" +msgstr "" + +#: ../cli/src/connections.c:754 +msgid "VPN connection failed" +msgstr "" + +#: ../cli/src/connections.c:756 +msgid "VPN disconnected" +msgstr "" + +#: ../cli/src/connections.c:767 +msgid "unknown reason" +msgstr "" + +#: ../cli/src/connections.c:769 +msgid "none" +msgstr "" + +#: ../cli/src/connections.c:771 +msgid "the user was disconnected" +msgstr "" + +#: ../cli/src/connections.c:773 +msgid "the base network connection was interrupted" +msgstr "" + +#: ../cli/src/connections.c:775 +msgid "the VPN service stopped unexpectedly" +msgstr "" + +#: ../cli/src/connections.c:777 +msgid "the VPN service returned invalid configuration" +msgstr "" + +#: ../cli/src/connections.c:779 +msgid "the connection attempt timed out" +msgstr "" + +#: ../cli/src/connections.c:781 +msgid "the VPN service did not start in time" +msgstr "" + +#: ../cli/src/connections.c:783 +msgid "the VPN service failed to start" +msgstr "" + +#: ../cli/src/connections.c:785 +msgid "no valid VPN secrets" +msgstr "" + +#: ../cli/src/connections.c:787 +msgid "invalid VPN secrets" +msgstr "" + +#: ../cli/src/connections.c:789 +msgid "the connection was removed" +msgstr "" + +#: ../cli/src/connections.c:803 +#, c-format +msgid "state: %s\n" +msgstr "" + +#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#, c-format +msgid "Connection activated\n" +msgstr "" + +#: ../cli/src/connections.c:809 +#, c-format +msgid "Error: Connection activation failed." +msgstr "" + +#: ../cli/src/connections.c:828 +#, c-format +msgid "state: %s (%d)\n" +msgstr "" + +#: ../cli/src/connections.c:838 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "" + +#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "" + +#: ../cli/src/connections.c:898 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "" + +#: ../cli/src/connections.c:912 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "" + +#: ../cli/src/connections.c:921 +#, c-format +msgid "Active connection state: %s\n" +msgstr "" + +#: ../cli/src/connections.c:922 +#, c-format +msgid "Active connection path: %s\n" +msgstr "" + +#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "" + +#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "" + +#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "" + +#: ../cli/src/connections.c:1044 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "" + +#: ../cli/src/connections.c:1046 +#, c-format +msgid "Error: No suitable device found." +msgstr "" + +#: ../cli/src/connections.c:1138 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "" + +#: ../cli/src/connections.c:1189 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "" + +#: ../cli/src/connections.c:1216 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "" + +#: ../cli/src/connections.c:1223 +#, c-format +msgid "Error: Could not get system settings." +msgstr "" + +#: ../cli/src/connections.c:1231 +#, c-format +msgid "Error: Could not get user settings." +msgstr "" + +#: ../cli/src/connections.c:1241 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "" + +#: ../cli/src/devices.c:73 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" +msgstr "" + +#: ../cli/src/devices.c:93 +msgid "unmanaged" +msgstr "" + +#: ../cli/src/devices.c:95 +msgid "unavailable" +msgstr "" + +#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +msgid "disconnected" +msgstr "" + +#: ../cli/src/devices.c:99 +msgid "connecting (prepare)" +msgstr "" + +#: ../cli/src/devices.c:101 +msgid "connecting (configuring)" +msgstr "" + +#: ../cli/src/devices.c:103 +msgid "connecting (need authentication)" +msgstr "" + +#: ../cli/src/devices.c:105 +msgid "connecting (getting IP configuration)" +msgstr "" + +#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +msgid "connected" +msgstr "" + +#: ../cli/src/devices.c:109 +msgid "connection failed" +msgstr "" + +#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +msgid "Unknown" +msgstr "" + +#. print them +#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 +#: ../cli/src/devices.c:879 +msgid "(none)" +msgstr "" + +#: ../cli/src/devices.c:209 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "" + +#: ../cli/src/devices.c:238 +#, c-format +msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +msgstr "" + +#: ../cli/src/devices.c:239 +msgid "Ad-Hoc" +msgstr "" + +#: ../cli/src/devices.c:248 +msgid ", Encrypted: " +msgstr "" + +#: ../cli/src/devices.c:253 +msgid " WEP" +msgstr "" + +#: ../cli/src/devices.c:255 +msgid " WPA" +msgstr "" + +#: ../cli/src/devices.c:257 +msgid " WPA2" +msgstr "" + +#: ../cli/src/devices.c:260 +msgid " Enterprise" +msgstr "" + +#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Device" +msgstr "" + +#: ../cli/src/devices.c:299 +msgid "Driver" +msgstr "" + +#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 +msgid "(unknown)" +msgstr "" + +#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "State" +msgstr "" + +#: ../cli/src/devices.c:313 +msgid "HW Address" +msgstr "" + +#: ../cli/src/devices.c:319 +#, c-format +msgid "" +"\n" +" Capabilities:\n" +msgstr "" + +#: ../cli/src/devices.c:321 +msgid "Carrier Detect" +msgstr "" + +#: ../cli/src/devices.c:336 +#, c-format +msgid "%u Mb/s" +msgstr "" + +#: ../cli/src/devices.c:337 +msgid "Speed" +msgstr "" + +#: ../cli/src/devices.c:348 +#, c-format +msgid "" +"\n" +" Wireless Properties\n" +msgstr "" + +#: ../cli/src/devices.c:353 +msgid "WEP Encryption" +msgstr "" + +#: ../cli/src/devices.c:355 +msgid "WPA Encryption" +msgstr "" + +#: ../cli/src/devices.c:357 +msgid "WPA2 Encryption" +msgstr "" + +#: ../cli/src/devices.c:359 +msgid "TKIP cipher" +msgstr "" + +#: ../cli/src/devices.c:361 +msgid "CCMP cipher" +msgstr "" + +#: ../cli/src/devices.c:368 +#, c-format +msgid "" +"\n" +" Wireless Access Points %s\n" +msgstr "" + +#: ../cli/src/devices.c:368 +msgid "(* = current AP)" +msgstr "" + +#: ../cli/src/devices.c:374 +#, c-format +msgid "" +"\n" +" Wired Properties\n" +msgstr "" + +#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 +msgid "Carrier" +msgstr "" + +#: ../cli/src/devices.c:377 +msgid "on" +msgstr "" + +#: ../cli/src/devices.c:379 +msgid "off" +msgstr "" + +#: ../cli/src/devices.c:387 +#, c-format +msgid "" +"\n" +" IPv4 Settings:\n" +msgstr "" + +#: ../cli/src/devices.c:395 +msgid "Address" +msgstr "" + +#: ../cli/src/devices.c:401 +msgid "Prefix" +msgstr "" + +#: ../cli/src/devices.c:405 +msgid "Gateway" +msgstr "" + +#: ../cli/src/devices.c:416 +msgid "DNS" +msgstr "" + +#: ../cli/src/devices.c:458 +msgid "Status of devices" +msgstr "" + +#: ../cli/src/devices.c:487 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "" + +#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "" + +#: ../cli/src/devices.c:539 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "" + +#: ../cli/src/devices.c:564 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "" + +#: ../cli/src/devices.c:572 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "" + +#: ../cli/src/devices.c:636 +#, c-format +msgid "Error: iface has to be specified." +msgstr "" + +#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 +msgid "WiFi scan list" +msgstr "" + +#: ../cli/src/devices.c:740 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "" + +#: ../cli/src/devices.c:754 +msgid "Device:" +msgstr "" + +#: ../cli/src/devices.c:806 +#, c-format +msgid "Error: hwaddr has to be specified." +msgstr "" + +#: ../cli/src/devices.c:844 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "" + +#: ../cli/src/devices.c:862 +#, c-format +msgid "%u MHz" +msgstr "" + +#: ../cli/src/devices.c:863 +#, c-format +msgid "%u MB/s" +msgstr "" + +#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 +msgid "AP parameters" +msgstr "" + +#: ../cli/src/devices.c:873 +msgid "SSID:" +msgstr "" + +#: ../cli/src/devices.c:874 +msgid "BSSID:" +msgstr "" + +#: ../cli/src/devices.c:875 +msgid "Frequency:" +msgstr "" + +#: ../cli/src/devices.c:876 +msgid "Mode:" +msgstr "" + +#: ../cli/src/devices.c:876 +msgid "Ad-hoc" +msgstr "" + +#: ../cli/src/devices.c:876 +msgid "Infrastructure" +msgstr "" + +#: ../cli/src/devices.c:877 +msgid "Maximal bitrate:" +msgstr "" + +#: ../cli/src/devices.c:878 +msgid "Strength:" +msgstr "" + +#: ../cli/src/devices.c:879 +msgid "Flags:" +msgstr "" + +#: ../cli/src/devices.c:879 +msgid "privacy" +msgstr "" + +#: ../cli/src/devices.c:880 +msgid "WPA flags:" +msgstr "" + +#: ../cli/src/devices.c:881 +msgid "RSN flags:" +msgstr "" + +#: ../cli/src/devices.c:907 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "" + +#: ../cli/src/devices.c:943 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "" + +#: ../cli/src/network-manager.c:46 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" + +#: ../cli/src/network-manager.c:67 +msgid "asleep" +msgstr "" + +#: ../cli/src/network-manager.c:69 +msgid "connecting" +msgstr "" + +#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 +msgid "enabled" +msgstr "" + +#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 +msgid "disabled" +msgstr "" + +#: ../cli/src/network-manager.c:102 +msgid "NetworkManager status" +msgstr "" + +#: ../cli/src/network-manager.c:104 +msgid "NM running:" +msgstr "" + +#: ../cli/src/network-manager.c:104 +msgid "running" +msgstr "" + +#: ../cli/src/network-manager.c:104 +msgid "not running" +msgstr "" + +#: ../cli/src/network-manager.c:105 +msgid "NM state:" +msgstr "" + +#: ../cli/src/network-manager.c:106 +msgid "NM wireless hardware:" +msgstr "" + +#. no argument, show current state +#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 +msgid "NM wireless:" +msgstr "" + +#: ../cli/src/network-manager.c:108 +msgid "NM WWAN hardware:" +msgstr "" + +#. no argument, show current state +#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 +msgid "NM WWAN:" +msgstr "" + +#: ../cli/src/network-manager.c:150 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "" + +#: ../cli/src/network-manager.c:167 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "" + +#: ../cli/src/network-manager.c:178 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "" + +#: ../cli/src/nmcli.c:65 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" + +#: ../cli/src/nmcli.c:106 +#, c-format +msgid "Object '%s' is unknown, try 'nmcli help'." +msgstr "" + +#: ../cli/src/nmcli.c:139 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "" + +#: ../cli/src/nmcli.c:145 +#, c-format +msgid "Option '%s' is unknown, try 'nmcli -help'." +msgstr "" + +#: ../cli/src/nmcli.c:164 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "" + +#: ../cli/src/nmcli.c:189 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "" + +#: ../cli/src/nmcli.c:205 +msgid "Success" +msgstr "" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." @@ -102,11 +905,9 @@ msgstr "Non hai memoria abondo para almacenar o IV." msgid "IV contains non-hexadecimal digits." msgstr "IV contén díxitos non hexadecimais." -#: ../libnm-util/crypto.c:382 -#: ../libnm-util/crypto_gnutls.c:148 -#: ../libnm-util/crypto_gnutls.c:266 -#: ../libnm-util/crypto_nss.c:171 -#: ../libnm-util/crypto_nss.c:335 +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "O cifrado «%s» da chave privada é descoñecido." @@ -140,8 +941,7 @@ msgstr "Produciuse un erro ao iniciar a arquitectura MD5: %s / %s." msgid "Invalid IV length (must be at least %zd)." msgstr "Lonxitude de IV incorrecta (debe ser polo menos %zd)." -#: ../libnm-util/crypto_gnutls.c:165 -#: ../libnm-util/crypto_nss.c:188 +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format msgid "Not enough memory for decrypted key buffer." msgstr "Non hai memoria abondo para o búfer da chave descifrada." @@ -149,12 +949,16 @@ msgstr "Non hai memoria abondo para o búfer da chave descifrada." #: ../libnm-util/crypto_gnutls.c:173 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." -msgstr "Produciuse un erro ao inicializar o contexto de cifrado para o descifrado: %s / %s." +msgstr "" +"Produciuse un erro ao inicializar o contexto de cifrado para o descifrado: %" +"s / %s." #: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." -msgstr "Produciuse un erro ao establecer a chave simétrica para o descifrado: %s / %s." +msgstr "" +"Produciuse un erro ao establecer a chave simétrica para o descifrado: %s / %" +"s." #: ../libnm-util/crypto_gnutls.c:191 #, c-format @@ -166,20 +970,19 @@ msgstr "Produciuse un erro ao establecer IV para o descifrado: %s / %s." msgid "Failed to decrypt the private key: %s / %s." msgstr "Produciuse un erro ao descifrar a chave privada: %s / %s." -#: ../libnm-util/crypto_gnutls.c:210 -#: ../libnm-util/crypto_nss.c:266 +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 #, c-format msgid "Failed to decrypt the private key: unexpected padding length." -msgstr "Produciuse un fallo ao descifrar a chave privada: lonxitude de desprazamento non esperada." +msgstr "" +"Produciuse un fallo ao descifrar a chave privada: lonxitude de desprazamento " +"non esperada." -#: ../libnm-util/crypto_gnutls.c:221 -#: ../libnm-util/crypto_nss.c:277 +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 #, c-format msgid "Failed to decrypt the private key." msgstr "Produciuse un erro ao descifrar a chave privada" -#: ../libnm-util/crypto_gnutls.c:286 -#: ../libnm-util/crypto_nss.c:355 +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 #, c-format msgid "Could not allocate memory for encrypting." msgstr "Non foi posíbel asignar a memoria para cifrar." @@ -187,12 +990,14 @@ msgstr "Non foi posíbel asignar a memoria para cifrar." #: ../libnm-util/crypto_gnutls.c:294 #, c-format msgid "Failed to initialize the encryption cipher context: %s / %s." -msgstr "Produciuse un erro ao inicializar o contexto da chave de cifrado: %s / %s." +msgstr "" +"Produciuse un erro ao inicializar o contexto da chave de cifrado: %s / %s." #: ../libnm-util/crypto_gnutls.c:303 #, c-format msgid "Failed to set symmetric key for encryption: %s / %s." -msgstr "Produciuse un erro ao establecer a chave simétrica para o cifrado: %s / %s." +msgstr "" +"Produciuse un erro ao establecer a chave simétrica para o cifrado: %s / %s." #: ../libnm-util/crypto_gnutls.c:313 #, c-format @@ -229,7 +1034,7 @@ msgstr "Non foi posíbel decodificar o ficheiro PKCS#12: %s" msgid "Couldn't verify PKCS#12 file: %s" msgstr "Non foi posíbel verificar o ficheiro PKCS#12: %s" -#: ../libnm-util/crypto_nss.c:57 +#: ../libnm-util/crypto_nss.c:56 #, c-format msgid "Failed to initialize the crypto engine: %d." msgstr "Produciuse un erro ao iniciar o motor de cifrado:%d." @@ -272,145 +1077,162 @@ msgstr "Produciuse un erro ao descifrar a chave privada: %d." #: ../libnm-util/crypto_nss.c:245 #, c-format msgid "Failed to decrypt the private key: decrypted data too large." -msgstr "Produciuse un erro ao descifrar a chave privada: os datos descifrados son moi grandes." +msgstr "" +"Produciuse un erro ao descifrar a chave privada: os datos descifrados son " +"moi grandes." #: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." msgstr "Produciuse un erro ao finalizar o descifrado da chave privada: %d." -#: ../libnm-util/crypto_nss.c:363 +#: ../libnm-util/crypto_nss.c:364 #, c-format msgid "Failed to initialize the encryption cipher slot." msgstr "Produciuse un erro ao inicializar a rañura da cifra de cifrado." -#: ../libnm-util/crypto_nss.c:371 +#: ../libnm-util/crypto_nss.c:372 #, c-format msgid "Failed to set symmetric key for encryption." msgstr "Produciuse un erro ao establecer a chave simétrica para o cifrado." -#: ../libnm-util/crypto_nss.c:379 +#: ../libnm-util/crypto_nss.c:380 #, c-format msgid "Failed to set IV for encryption." msgstr "Produciuse un erro ao establecer IV para o cifrado." -#: ../libnm-util/crypto_nss.c:387 +#: ../libnm-util/crypto_nss.c:388 #, c-format msgid "Failed to initialize the encryption context." msgstr "Produciuse un erro ao inicializar o contexto de cifrado." -#: ../libnm-util/crypto_nss.c:395 +#: ../libnm-util/crypto_nss.c:396 #, c-format msgid "Failed to encrypt: %d." msgstr "Produciuse un erro ao cifrar: %d." -#: ../libnm-util/crypto_nss.c:403 +#: ../libnm-util/crypto_nss.c:404 #, c-format msgid "Unexpected amount of data after encrypting." msgstr "Tamaño non agardado de datos despois de cifrar." -#: ../libnm-util/crypto_nss.c:446 +#: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" msgstr "Non foi posíbel decodificar o certificado: %d" -#: ../libnm-util/crypto_nss.c:481 +#: ../libnm-util/crypto_nss.c:482 #, c-format msgid "Couldn't convert password to UCS2: %d" msgstr "Non foi posíbel converter a chave a UCS2: %d" -#: ../libnm-util/crypto_nss.c:509 +#: ../libnm-util/crypto_nss.c:510 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" msgstr "Non foi posíbel iniciar o decodificador PKCS#12: %d" -#: ../libnm-util/crypto_nss.c:518 +#: ../libnm-util/crypto_nss.c:519 #, c-format msgid "Couldn't decode PKCS#12 file: %d" msgstr "Non fo posíbel decodificar o ficheiro PKCS#12: %d" -#: ../libnm-util/crypto_nss.c:527 +#: ../libnm-util/crypto_nss.c:528 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "Non foi posíbel verficar o ficheiro PKCS#12: %d" -#: ../libnm-util/crypto_nss.c:556 +#: ../libnm-util/crypto_nss.c:557 msgid "Could not generate random data." msgstr "Non foi posíbel xerar datos aleatorios." -#: ../libnm-util/nm-utils.c:1522 +#: ../libnm-util/nm-utils.c:1924 #, c-format msgid "Not enough memory to make encryption key." msgstr "Sen memoria abondo para crear a chave de cifrado." -#: ../libnm-util/nm-utils.c:1633 +#: ../libnm-util/nm-utils.c:2034 msgid "Could not allocate memory for PEM file creation." msgstr "Non foi posíbel asignar memoria para a creación do ficheiro PEM," -#: ../libnm-util/nm-utils.c:1645 +#: ../libnm-util/nm-utils.c:2046 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "Non foi posíbel asignar memoria para escribir IV no ficheiro PEM." -#: ../libnm-util/nm-utils.c:1657 +#: ../libnm-util/nm-utils.c:2058 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." -msgstr "Non foi posíbel asignar memoria para escribir a chave cifrada no ficheiro PEM." +msgstr "" +"Non foi posíbel asignar memoria para escribir a chave cifrada no ficheiro " +"PEM." -#: ../libnm-util/nm-utils.c:1676 +#: ../libnm-util/nm-utils.c:2077 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "Non foi posíbel asignar memoria para os datos do ficheiro PEM." -#: ../src/nm-netlink-monitor.c:194 -#: ../src/nm-netlink-monitor.c:464 -#: ../src/nm-netlink-monitor.c:569 -#: ../src/ip6-manager/nm-netlink-listener.c:352 +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format msgid "error processing netlink message: %s" msgstr "produciuse un erro procesando a mensaxe netlink: %s" -#: ../src/nm-netlink-monitor.c:260 -#, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "non é posíbel crear o manexador netlink para monitorizar o estado da ligazón: %s" +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "producouse un erro agardando por datos nun socket" -#: ../src/nm-netlink-monitor.c:270 +#: ../src/nm-netlink-monitor.c:254 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" -msgstr "non é posíbel conectar ao netlink para monitorizar o estado da lingazón: %s" +msgstr "" +"non é posíbel conectar ao netlink para monitorizar o estado da lingazón: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, fuzzy, c-format +#| msgid "unable to allocate netlink handle: %s" +msgid "unable to enable netlink handle credential passing: %s" +msgstr "non é posíbel asignar un manexador para a ligazon de rede: %s" -#: ../src/nm-netlink-monitor.c:278 +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 #, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "non é posíbel unir ao grupo netlink para monitorizar o estado da ligazón: %s" +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"non é posíbel crear o manexador netlink para monitorizar o estado da " +"ligazón: %s" -#: ../src/nm-netlink-monitor.c:286 +#: ../src/nm-netlink-monitor.c:376 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" -msgstr "non é posíbel asignar a ligazón á caché netlink para monitorizar o estado da ligazón: %s" +msgstr "" +"non é posíbel asignar a ligazón á caché netlink para monitorizar o estado da " +"ligazón: %s" -#: ../src/nm-netlink-monitor.c:494 -#: ../src/ip6-manager/nm-netlink-listener.c:382 -msgid "error occurred while waiting for data on socket" -msgstr "producouse un erro agardando por datos nun socket" +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "non é posíbel unir ao grupo da ligazón de rede: %s" -#: ../src/nm-netlink-monitor.c:558 +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 #, c-format -#| msgid "error processing netlink message: %s" msgid "error updating link cache: %s" msgstr "produciuse un erro ao actualizar a caché de ligazóns: %s" -#: ../src/NetworkManager.c:330 +#: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "Opción incorrecta. Use --help para ver a lista de opcións válidas.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 +#: ../src/main.c:562 +#, fuzzy, c-format +#| msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "Opción incorrecta. Use --help para ver a lista de opcións válidas.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 msgid "# Created by NetworkManager\n" msgstr "# Creado por NetworkManager\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 #, c-format msgid "" "# Merged from %s\n" @@ -419,38 +1241,47 @@ msgstr "" "# Fusionado desde %s\n" "\n" -#: ../src/ip6-manager/nm-netlink-listener.c:200 +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 #, c-format -#| msgid "unable to allocate netlink handle for monitoring link status: %s" -msgid "unable to allocate netlink handle: %s" -msgstr "non é posíbel asignar un manexador para a ligazon de rede: %s" +msgid "unsupported DHCP client '%s'" +msgstr "" -#: ../src/ip6-manager/nm-netlink-listener.c:210 +#: ../src/logging/nm-logging.c:146 #, c-format -#| msgid "unable to connect to netlink for monitoring link status: %s" -msgid "unable to connect to netlink: %s" -msgstr "non é posíbel conectar coa ligazón de rede: %s" +msgid "Unknown log level '%s'" +msgstr "" -#: ../src/ip6-manager/nm-netlink-listener.c:307 +#: ../src/logging/nm-logging.c:171 #, c-format -#| msgid "unable to join netlink group for monitoring link status: %s" -msgid "unable to join netlink group: %s" -msgstr "non é posíbel unir ao grupo da ligazón de rede: %s" +msgid "Unknown log domain '%s'" +msgstr "" -#: ../src/named-manager/nm-named-manager.c:315 +#: ../src/named-manager/nm-named-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "NOTE: o importador libc non permite máis de 3 nomes de servidores." -#: ../src/named-manager/nm-named-manager.c:317 +#: ../src/named-manager/nm-named-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "Os nomes de servidores listados a seguir poden non ser recoñecidos" -#: ../src/system-settings/nm-default-wired-connection.c:194 +#: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" msgstr "Auto %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:2406 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3254 msgid "System" msgstr "Sistema" @@ -472,17 +1303,31 @@ msgstr "Modificar as conexións do sistema" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 msgid "System policy prevents modification of system settings" -msgstr "A política do sistema impide a modificación da configuración do sistema" +msgstr "" +"A política do sistema impide a modificación da configuración do sistema" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 msgid "System policy prevents modification of the persistent system hostname" -msgstr "A política do sistema impide a modificación do nome do anfitrión do sistema" +msgstr "" +"A política do sistema impide a modificación do nome do anfitrión do sistema" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 msgid "System policy prevents sharing connections via a protected WiFi network" -msgstr "A política do sistema impide compartir conexións a través dunha rede WiFi protexida" +msgstr "" +"A política do sistema impide compartir conexións a través dunha rede WiFi " +"protexida" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 msgid "System policy prevents sharing connections via an open WiFi network" -msgstr "A política do sistema impide compartir conexións a través dunha rede WiFi aberta" +msgstr "" +"A política do sistema impide compartir conexións a través dunha rede WiFi " +"aberta" + +#~ msgid "unable to join netlink group for monitoring link status: %s" +#~ msgstr "" +#~ "non é posíbel unir ao grupo netlink para monitorizar o estado da ligazón: " +#~ "%s" +#~| msgid "unable to connect to netlink for monitoring link status: %s" +#~ msgid "unable to connect to netlink: %s" +#~ msgstr "non é posíbel conectar coa ligazón de rede: %s" -- cgit v1.2.1 From d0ff1fd2ec51dc33a19aa2e037b755213b07ee7a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 26 May 2010 15:30:37 -0700 Subject: system-settings: add unmanaged spec for z/VM subchannels (rh #591533) --- src/system-settings/nm-system-config-interface.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/system-settings/nm-system-config-interface.h b/src/system-settings/nm-system-config-interface.h index c5bbaaa917..5d59cd3ceb 100644 --- a/src/system-settings/nm-system-config-interface.h +++ b/src/system-settings/nm-system-config-interface.h @@ -107,6 +107,12 @@ struct _NMSystemConfigInterface { * * Method: mac Data: device MAC address formatted with leading zeros and * lowercase letters, like 00:0a:0b:0c:0d:0e + * + * Method: zvm-subchannels Data: string of 3 z/VM subchannels separated by + * commas (,) that identify the device, + * like "0.0.09a0,0.0.09a1,0.0.09a2". The + * string may contain only the following + * characters: [a-fA-F0-9,.] */ GSList * (*get_unmanaged_specs) (NMSystemConfigInterface *config); -- cgit v1.2.1 From 9c45b52f38b22927ba6a2d79f0666350fa0b7d6b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 26 May 2010 15:31:01 -0700 Subject: libnm-util: add wired setting property for z/VM subchannel (rh #591533) On s390 and z-Series, the hypervisor assigns the MAC address, so we need to use subchannels to uniquely identify the device instead of using the MAC address. --- libnm-util/libnm-util.ver | 1 + libnm-util/nm-setting-wired.c | 57 ++++++++++++++++++++++++++++++++++++++++++- libnm-util/nm-setting-wired.h | 18 ++++++++------ 3 files changed, 67 insertions(+), 9 deletions(-) diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver index ed1d8a484f..f3d4344ca6 100644 --- a/libnm-util/libnm-util.ver +++ b/libnm-util/libnm-util.ver @@ -289,6 +289,7 @@ global: nm_setting_wired_get_auto_negotiate; nm_setting_wired_get_mac_address; nm_setting_wired_get_mtu; + nm_setting_wired_get_zvm_subchannels; nm_setting_wireless_ap_security_compatible; nm_setting_wireless_error_get_type; nm_setting_wireless_error_quark; diff --git a/libnm-util/nm-setting-wired.c b/libnm-util/nm-setting-wired.c index 2f25243318..738302a378 100644 --- a/libnm-util/nm-setting-wired.c +++ b/libnm-util/nm-setting-wired.c @@ -19,7 +19,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2010 Red Hat, Inc. * (C) Copyright 2007 - 2008 Novell, Inc. */ @@ -29,6 +29,7 @@ #include "nm-param-spec-specialized.h" #include "nm-utils.h" #include "nm-utils-private.h" +#include "nm-dbus-glib-types.h" GQuark nm_setting_wired_error_quark (void) @@ -75,6 +76,7 @@ typedef struct { gboolean auto_negotiate; GByteArray *mac_address; guint32 mtu; + GPtrArray *zvm_subchannels; } NMSettingWiredPrivate; enum { @@ -85,6 +87,7 @@ enum { PROP_AUTO_NEGOTIATE, PROP_MAC_ADDRESS, PROP_MTU, + PROP_ZVM_SUBCHANNELS, LAST_PROP }; @@ -143,6 +146,14 @@ nm_setting_wired_get_mtu (NMSettingWired *setting) return NM_SETTING_WIRED_GET_PRIVATE (setting)->mtu; } +const GPtrArray * +nm_setting_wired_get_zvm_subchannels (NMSettingWired *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), NULL); + + return NM_SETTING_WIRED_GET_PRIVATE (setting)->zvm_subchannels; +} + static gboolean verify (NMSetting *setting, GSList *all_settings, GError **error) { @@ -174,6 +185,14 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) return FALSE; } + if (priv->zvm_subchannels && priv->zvm_subchannels->len != 3) { + g_set_error (error, + NM_SETTING_WIRED_ERROR, + NM_SETTING_WIRED_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRED_ZVM_SUBCHANNELS); + return FALSE; + } + return TRUE; } @@ -226,6 +245,13 @@ set_property (GObject *object, guint prop_id, case PROP_MTU: priv->mtu = g_value_get_uint (value); break; + case PROP_ZVM_SUBCHANNELS: + if (priv->zvm_subchannels) { + g_ptr_array_foreach (priv->zvm_subchannels, (GFunc) g_free, NULL); + g_ptr_array_free (priv->zvm_subchannels, TRUE); + } + priv->zvm_subchannels = g_value_dup_boxed (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -257,6 +283,9 @@ get_property (GObject *object, guint prop_id, case PROP_MTU: g_value_set_uint (value, nm_setting_wired_get_mtu (setting)); break; + case PROP_ZVM_SUBCHANNELS: + g_value_set_boxed (value, nm_setting_wired_get_zvm_subchannels (setting)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -380,5 +409,31 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class) "multiple Ethernet frames.", 0, G_MAXUINT32, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE)); + + /** + * NMSettingWired:zvm-subchannels: + * + * Identifies specific subchannels that this network device uses for + * communcation with z/VM or s390 host. Like #NMSettingWired:mac-address + * for non-z/VM devices, this property can be used to ensure this connection + * only applies to the network device that uses these subchannels. The + * list should contain exactly 3 strings, and each string may only only be + * composed of hexadecimal characters and the period (.) character. + **/ + g_object_class_install_property + (object_class, PROP_ZVM_SUBCHANNELS, + _nm_param_spec_specialized (NM_SETTING_WIRED_ZVM_SUBCHANNELS, + "z/VM Subchannels", + "Identifies specific subchannels that this " + "network device uses for communcation with z/VM " + "or s390 host. Like the 'mac-address' property " + "for non-z/VM devices, this property can be used " + "to ensure this connection only applies to the " + "network device that uses these subchannels. The " + "list should contain exactly 3 strings, and each " + "string may only only be composed of hexadecimal " + "characters and the period (.) character.", + DBUS_TYPE_G_ARRAY_OF_STRING, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); } diff --git a/libnm-util/nm-setting-wired.h b/libnm-util/nm-setting-wired.h index 44127347f2..9bb8877127 100644 --- a/libnm-util/nm-setting-wired.h +++ b/libnm-util/nm-setting-wired.h @@ -19,7 +19,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2010 Red Hat, Inc. * (C) Copyright 2007 - 2008 Novell, Inc. */ @@ -58,6 +58,7 @@ GQuark nm_setting_wired_error_quark (void); #define NM_SETTING_WIRED_AUTO_NEGOTIATE "auto-negotiate" #define NM_SETTING_WIRED_MAC_ADDRESS "mac-address" #define NM_SETTING_WIRED_MTU "mtu" +#define NM_SETTING_WIRED_ZVM_SUBCHANNELS "zvm-subchannels" typedef struct { NMSetting parent; @@ -75,13 +76,14 @@ typedef struct { GType nm_setting_wired_get_type (void); -NMSetting *nm_setting_wired_new (void); -const char *nm_setting_wired_get_port (NMSettingWired *setting); -guint32 nm_setting_wired_get_speed (NMSettingWired *setting); -const char *nm_setting_wired_get_duplex (NMSettingWired *setting); -gboolean nm_setting_wired_get_auto_negotiate (NMSettingWired *setting); -const GByteArray *nm_setting_wired_get_mac_address (NMSettingWired *setting); -guint32 nm_setting_wired_get_mtu (NMSettingWired *setting); +NMSetting * nm_setting_wired_new (void); +const char * nm_setting_wired_get_port (NMSettingWired *setting); +guint32 nm_setting_wired_get_speed (NMSettingWired *setting); +const char * nm_setting_wired_get_duplex (NMSettingWired *setting); +gboolean nm_setting_wired_get_auto_negotiate (NMSettingWired *setting); +const GByteArray *nm_setting_wired_get_mac_address (NMSettingWired *setting); +guint32 nm_setting_wired_get_mtu (NMSettingWired *setting); +const GPtrArray * nm_setting_wired_get_zvm_subchannels (NMSettingWired *setting); G_END_DECLS -- cgit v1.2.1 From 5f03706a6b1ad3db3b9bce5852b1ed885039d719 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 26 May 2010 16:28:51 -0700 Subject: ethernet: handle zvm-subchannels unmanaged spec (rh #591533) --- src/NetworkManagerUtils.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++ src/NetworkManagerUtils.h | 3 +- src/nm-device-ethernet.c | 5 +++ 3 files changed, 103 insertions(+), 1 deletion(-) diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c index 22cf2fa0d8..86f66f76d2 100644 --- a/src/NetworkManagerUtils.c +++ b/src/NetworkManagerUtils.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "NetworkManagerUtils.h" #include "nm-utils.h" @@ -487,6 +488,101 @@ nm_match_spec_hwaddr (const GSList *specs, const char *hwaddr) return FALSE; } +#define BUFSIZE 10 + +static gboolean +parse_subchannels (const char *subchannels, guint32 *a, guint32 *b, guint32 *c) +{ + long unsigned int tmp; + char buf[BUFSIZE + 1]; + const char *p = subchannels; + int i = 0; + char *pa = NULL, *pb = NULL, *pc = NULL; + + g_return_val_if_fail (subchannels != NULL, FALSE); + g_return_val_if_fail (a != NULL, FALSE); + g_return_val_if_fail (*a == 0, FALSE); + g_return_val_if_fail (b != NULL, FALSE); + g_return_val_if_fail (*b == 0, FALSE); + g_return_val_if_fail (c != NULL, FALSE); + g_return_val_if_fail (*c == 0, FALSE); + + /* sanity check */ + if (!isxdigit (subchannels[0])) + return FALSE; + + /* Get the first channel */ + while (*p && (*p != ',')) { + if (!isxdigit (*p) && (*p != '.')) + return FALSE; /* Invalid chars */ + if (i >= BUFSIZE) + return FALSE; /* Too long to be a subchannel */ + buf[i++] = *p++; + } + buf[i] = '\0'; + + /* and grab each of its elements, there should be 3 */ + pa = &buf[0]; + pb = strchr (buf, '.'); + if (pb) + pc = strchr (pb + 1, '.'); + if (!pa || !pb || !pc) + return FALSE; + + /* Split the string */ + *pb++ = '\0'; + *pc++ = '\0'; + + errno = 0; + tmp = strtoul (pa, NULL, 16); + if (errno) + return FALSE; + *a = (guint32) tmp; + + errno = 0; + tmp = strtoul (pb, NULL, 16); + if (errno) + return FALSE; + *b = (guint32) tmp; + + errno = 0; + tmp = strtoul (pc, NULL, 16); + if (errno) + return FALSE; + *c = (guint32) tmp; + + return TRUE; +} + +#define SUBCHAN_TAG "zvm-subchannels:" + +gboolean +nm_match_spec_zvm_subchannels (const GSList *specs, const char *subchannels) +{ + const GSList *iter; + guint32 a = 0, b = 0, c = 0; + guint32 spec_a = 0, spec_b = 0, spec_c = 0; + + g_return_val_if_fail (subchannels != NULL, FALSE); + + if (!parse_subchannels (subchannels, &a, &b, &c)) + return FALSE; + + for (iter = specs; iter; iter = g_slist_next (iter)) { + const char *spec = iter->data; + + if (!strncmp (spec, SUBCHAN_TAG, strlen (SUBCHAN_TAG))) { + spec += strlen (SUBCHAN_TAG); + if (parse_subchannels (spec, &spec_a, &spec_b, &spec_c)) { + if (a == spec_a && b == spec_b && c == spec_c) + return TRUE; + } + } + } + + return FALSE; +} + /*********************************/ static void diff --git a/src/NetworkManagerUtils.h b/src/NetworkManagerUtils.h index e3d1793b4d..93a11c31cb 100644 --- a/src/NetworkManagerUtils.h +++ b/src/NetworkManagerUtils.h @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2004 - 2008 Red Hat, Inc. + * Copyright (C) 2004 - 2010 Red Hat, Inc. * Copyright (C) 2005 - 2008 Novell, Inc. */ @@ -48,6 +48,7 @@ void nm_utils_call_dispatcher (const char *action, const char *vpn_iface); gboolean nm_match_spec_hwaddr (const GSList *specs, const char *hwaddr); +gboolean nm_match_spec_zvm_subchannels (const GSList *specs, const char *subchannels); GHashTable *value_hash_create (void); diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index be6d4e2f3c..5af9ec5f50 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -105,6 +105,7 @@ typedef struct { gboolean disposed; struct ether_addr hw_addr; + char * zvm_subchannels; gboolean carrier; NMNetlinkMonitor * monitor; @@ -1519,6 +1520,7 @@ real_check_connection_compatible (NMDevice *device, static gboolean spec_match_list (NMDevice *device, const GSList *specs) { + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); struct ether_addr ether; char *hwaddr; gboolean matched; @@ -1528,6 +1530,9 @@ spec_match_list (NMDevice *device, const GSList *specs) matched = nm_match_spec_hwaddr (specs, hwaddr); g_free (hwaddr); + if (!matched && priv->zvm_subchannels) + matched = nm_match_spec_zvm_subchannels (specs, priv->zvm_subchannels); + return matched; } -- cgit v1.2.1 From 04370354f0708c7c3355f4091bbc38d1386a0de8 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 26 May 2010 17:04:32 -0700 Subject: libnm-util: pretty-print DBUS_TYPE_G_ARRAY_OF_STRING --- libnm-util/nm-utils.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c index ddb02a220e..b8d2bc33ea 100644 --- a/libnm-util/nm-utils.c +++ b/libnm-util/nm-utils.c @@ -593,6 +593,32 @@ nm_utils_convert_strv_to_string (const GValue *src_value, GValue *dest_value) g_string_free (printable, FALSE); } +static void +nm_utils_convert_string_array_to_string (const GValue *src_value, GValue *dest_value) +{ + GPtrArray *strings; + GString *printable; + int i; + + g_return_if_fail (g_type_is_a (G_VALUE_TYPE (src_value), DBUS_TYPE_G_ARRAY_OF_STRING)); + + strings = (GPtrArray *) g_value_get_boxed (src_value); + + printable = g_string_new ("["); + for (i = 0; strings && i < strings->len; i++) { + if (i > 0) + g_string_append (printable, ", '"); + else + g_string_append_c (printable, '\''); + g_string_append (printable, g_ptr_array_index (strings, i)); + g_string_append_c (printable, '\''); + } + g_string_append_c (printable, ']'); + + g_value_take_string (dest_value, printable->str); + g_string_free (printable, FALSE); +} + static void nm_utils_convert_uint_array_to_string (const GValue *src_value, GValue *dest_value) { @@ -1058,6 +1084,9 @@ _nm_utils_register_value_transformations (void) g_value_register_transform_func (DBUS_TYPE_G_LIST_OF_STRING, G_TYPE_STRING, nm_utils_convert_strv_to_string); + g_value_register_transform_func (DBUS_TYPE_G_ARRAY_OF_STRING, + G_TYPE_STRING, + nm_utils_convert_string_array_to_string); g_value_register_transform_func (DBUS_TYPE_G_UINT_ARRAY, G_TYPE_STRING, nm_utils_convert_uint_array_to_string); -- cgit v1.2.1 From 860e8a13eb59874a8171faa766baefd9c1580a65 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 26 May 2010 17:27:37 -0700 Subject: system-settings: some s390 device types only use 2 channels --- src/system-settings/nm-system-config-interface.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/system-settings/nm-system-config-interface.h b/src/system-settings/nm-system-config-interface.h index 5d59cd3ceb..2cbe2095ff 100644 --- a/src/system-settings/nm-system-config-interface.h +++ b/src/system-settings/nm-system-config-interface.h @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Red Hat, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. * Copyright (C) 2008 Novell, Inc. */ @@ -108,10 +108,10 @@ struct _NMSystemConfigInterface { * Method: mac Data: device MAC address formatted with leading zeros and * lowercase letters, like 00:0a:0b:0c:0d:0e * - * Method: zvm-subchannels Data: string of 3 z/VM subchannels separated by - * commas (,) that identify the device, - * like "0.0.09a0,0.0.09a1,0.0.09a2". The - * string may contain only the following + * Method: zvm-subchannels Data: string of 2 or 3 z/VM subchannels + * separated by commas (,) that identify the + * device, like "0.0.09a0,0.0.09a1,0.0.09a2". + * The string may contain only the following * characters: [a-fA-F0-9,.] */ GSList * (*get_unmanaged_specs) (NMSystemConfigInterface *config); -- cgit v1.2.1 From e22346b9d095783975b10cb18d78277fe3aae81e Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 26 May 2010 17:35:57 -0700 Subject: ifcfg-rh: handle z/VM subchannels (rh #591533) --- system-settings/plugins/ifcfg-rh/reader.c | 58 ++++- .../ifcfg-rh/tests/network-scripts/Makefile.am | 3 +- .../network-scripts/ifcfg-test-wired-qeth-static | 10 + .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 256 +++++++++++++++++++++ system-settings/plugins/ifcfg-rh/writer.c | 19 ++ 5 files changed, 339 insertions(+), 7 deletions(-) create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-qeth-static diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index a084d30b16..5ff70c7c84 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -2951,15 +2951,61 @@ make_wired_setting (shvarFile *ifcfg, } g_byte_array_free (mac, TRUE); - } else if (!nm_controlled) { - /* If NM_CONTROLLED=no but there wasn't a MAC address, notify - * the user that the device cannot be unmanaged. - */ - PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: NM_CONTROLLED was false but HWADDR was missing; device will be managed"); } } else { g_object_unref (s_wired); - s_wired = NULL; + return NULL; + } + + value = svGetValue (ifcfg, "SUBCHANNELS", FALSE); + if (value) { + const char *p = value; + gboolean success = TRUE; + char **chans = NULL; + + /* basic sanity checks */ + while (*p) { + if (!isxdigit (*p) && (*p != ',') && (*p != '.')) { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: invalid SUBCHANNELS '%s'", value); + success = FALSE; + break; + } + p++; + } + + if (success) { + guint32 num_chans; + + chans = g_strsplit_set (value, ",", 0); + num_chans = g_strv_length (chans); + if (num_chans < 2 || num_chans > 3) { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: invalid SUBCHANNELS '%s' (%d channels, 2 or 3 expected)", + value, g_strv_length (chans)); + } else { + GPtrArray *array = g_ptr_array_sized_new (num_chans); + + g_ptr_array_add (array, chans[0]); + g_ptr_array_add (array, chans[1]); + if (num_chans == 3) + g_ptr_array_add (array, chans[2]); + + g_object_set (s_wired, NM_SETTING_WIRED_ZVM_SUBCHANNELS, array, NULL); + g_ptr_array_free (array, TRUE); + + /* set the unmanaged spec too */ + if (!nm_controlled && !*unmanaged) + *unmanaged = g_strdup_printf ("zvm-subchannels:%s", value); + } + g_strfreev (chans); + } + g_free (value); + } + + if (!nm_controlled && !*unmanaged) { + /* If NM_CONTROLLED=no but there wasn't a MAC address or z/VM + * subchannels, notify the user that the device cannot be unmanaged. + */ + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: NM_CONTROLLED was false but HWADDR or SUBCHANNELS was missing; device will be managed"); } value = svGetValue (ifcfg, "KEY_MGMT", FALSE); diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am b/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am index 66435acbcb..8a93c9deea 100644 --- a/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am @@ -60,7 +60,8 @@ EXTRA_DIST = \ ifcfg-test-wired-static-no-prefix-24 \ ifcfg-test-wired-ipv6-only \ ifcfg-test-wifi-wep-passphrase \ - keys-test-wifi-wep-passphrase + keys-test-wifi-wep-passphrase \ + ifcfg-test-wired-qeth-static check-local: @for f in $(EXTRA_DIST); do \ diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-qeth-static b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-qeth-static new file mode 100644 index 0000000000..b0ec2a9a56 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-qeth-static @@ -0,0 +1,10 @@ +# IBM QETH +DEVICE=eth1 +BOOTPROTO=static +IPADDR=192.168.70.87 +NETMASK=255.255.255.0 +ONBOOT=yes +NETTYPE=qeth +SUBCHANNELS=0.0.0600,0.0.0601,0.0.0602 +TYPE=Ethernet + diff --git a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index 35cea36cf5..b4aa60a86e 100644 --- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -5080,6 +5080,132 @@ test_read_wifi_wep_eap_ttls_chap (void) g_object_unref (connection); } +#define TEST_IFCFG_WIRED_QETH_STATIC TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-qeth-static" + +static void +test_read_wired_qeth_static (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4; + char *unmanaged = NULL; + char *keyfile = NULL; + char *routefile = NULL; + char *route6file = NULL; + gboolean ignore_error = FALSE; + GError *error = NULL; + const char *tmp; + const char *expected_id = "System test-wired-qeth-static"; + const GByteArray *array; + const char *expected_channel0 = "0.0.0600"; + const char *expected_channel1 = "0.0.0601"; + const char *expected_channel2 = "0.0.0602"; + const GPtrArray *subchannels; + + connection = connection_from_file (TEST_IFCFG_WIRED_QETH_STATIC, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wired-qeth-static-read", "failed to read %s: %s", TEST_IFCFG_WIRED_QETH_STATIC, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wired-qeth-static-verify", "failed to verify %s: %s", TEST_IFCFG_WIRED_QETH_STATIC, error->message); + + ASSERT (unmanaged == FALSE, + "wired-qeth-static-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIRED_QETH_STATIC); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wired-qeth-static-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_QETH_STATIC, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wired-qeth-static-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_QETH_STATIC, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wired-qeth-static-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_QETH_STATIC, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "wired-qeth-static-verify-wired", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_QETH_STATIC, + NM_SETTING_WIRED_SETTING_NAME); + + /* MAC address */ + array = nm_setting_wired_get_mac_address (s_wired); + ASSERT (array == NULL, + "wired-qeth-static-verify-wired", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIRED_QETH_STATIC, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + + /* Subchannels */ + subchannels = nm_setting_wired_get_zvm_subchannels (s_wired); + ASSERT (subchannels != NULL, + "wired-qeth-static-verify-wired", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_QETH_STATIC, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_ZVM_SUBCHANNELS); + ASSERT (subchannels->len == 3, + "wired-qeth-static-verify-wired", "failed to verify %s: invalid %s / %s key (not 3 elements)", + TEST_IFCFG_WIRED_QETH_STATIC, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_ZVM_SUBCHANNELS); + + tmp = (const char *) g_ptr_array_index (subchannels, 0); + ASSERT (strcmp (tmp, expected_channel0) == 0, + "wired-qeth-static-verify-wired", "failed to verify %s: unexpected subchannel #0", + TEST_IFCFG_WIRED_QETH_STATIC); + + tmp = (const char *) g_ptr_array_index (subchannels, 1); + ASSERT (strcmp (tmp, expected_channel1) == 0, + "wired-qeth-static-verify-wired", "failed to verify %s: unexpected subchannel #1", + TEST_IFCFG_WIRED_QETH_STATIC); + + tmp = (const char *) g_ptr_array_index (subchannels, 2); + ASSERT (strcmp (tmp, expected_channel2) == 0, + "wired-qeth-static-verify-wired", "failed to verify %s: unexpected subchannel #2", + TEST_IFCFG_WIRED_QETH_STATIC); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wired-qeth-static-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_QETH_STATIC, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_config_get_method (s_ip4); + ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_MANUAL) == 0, + "wired-qeth-static-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_QETH_STATIC, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_METHOD); + + g_object_unref (connection); +} + static void test_write_wired_static (void) { @@ -8128,6 +8254,134 @@ test_read_ibft_malformed (const char *name, const char *iscsiadm_path) name, "unexpectedly able to read %s", TEST_IFCFG_IBFT_STATIC); } +static void +test_write_wired_qeth_dhcp (void) +{ + NMConnection *connection; + NMConnection *reread; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; + char *uuid; + GPtrArray *subchans; + gboolean success; + GError *error = NULL; + char *testfile = NULL; + char *unmanaged = NULL; + char *keyfile = NULL; + char *routefile = NULL; + char *route6file = NULL; + gboolean ignore_error = FALSE; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "wired-qeth-dhcp-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wired-qeth-dhcp-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write Wired qeth Static", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRED_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wired setting */ + s_wired = (NMSettingWired *) nm_setting_wired_new (); + ASSERT (s_wired != NULL, + "wired-qeth-dhcp-write", "failed to allocate new %s setting", + NM_SETTING_WIRED_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wired)); + + subchans = g_ptr_array_sized_new (3); + g_ptr_array_add (subchans, "0.0.600"); + g_ptr_array_add (subchans, "0.0.601"); + g_ptr_array_add (subchans, "0.0.602"); + g_object_set (s_wired, + NM_SETTING_WIRED_ZVM_SUBCHANNELS, subchans, + NULL); + g_ptr_array_free (subchans, TRUE); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wired-qeth-dhcp-write", "failed to allocate new %s setting", + NM_SETTING_IP4_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip4)); + + g_object_set (s_ip4, + NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, + NULL); + + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wired-qeth-dhcp-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + + g_object_set (s_ip6, + NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, + NULL); + + /* Verify */ + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wired-qeth-dhcp-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == TRUE, + "wired-qeth-dhcp-write", "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + "wired-qeth-dhcp-write", "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + unlink (testfile); + + ASSERT (reread != NULL, + "wired-qeth-dhcp-write-reread", "failed to read %s: %s", testfile, error->message); + + ASSERT (nm_connection_verify (reread, &error), + "wired-qeth-dhcp-write-reread-verify", "failed to verify %s: %s", testfile, error->message); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "wired-qeth-dhcp-write", "written and re-read connection weren't the same."); + + if (route6file) + unlink (route6file); + + g_free (testfile); + g_free (keyfile); + g_free (routefile); + g_free (route6file); + g_object_unref (connection); + g_object_unref (reread); +} + static void test_write_wired_pppoe (void) { @@ -8450,6 +8704,7 @@ int main (int argc, char **argv) test_read_wifi_wpa_eap_tls (); test_read_wifi_wpa_eap_ttls_tls (); test_read_wifi_wep_eap_ttls_chap (); + test_read_wired_qeth_static (); test_write_wired_static (); test_write_wired_static_ip6_only (); @@ -8497,6 +8752,7 @@ int main (int argc, char **argv) test_write_wifi_wpa_eap_tls (); test_write_wifi_wpa_eap_ttls_tls (); test_write_wifi_wpa_eap_ttls_mschapv2 (); + test_write_wired_qeth_dhcp (); /* iSCSI / ibft */ test_read_ibft_dhcp (); diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c index de69e0039e..04dac8ec4f 100644 --- a/system-settings/plugins/ifcfg-rh/writer.c +++ b/system-settings/plugins/ifcfg-rh/writer.c @@ -816,6 +816,7 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) const GByteArray *mac; char *tmp; guint32 mtu; + const GPtrArray *zvm_subchannels; s_wired = (NMSettingWired *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED); if (!s_wired) { @@ -824,6 +825,7 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) return FALSE; } + svSetValue (ifcfg, "HWADDR", NULL, FALSE); mac = nm_setting_wired_get_mac_address (s_wired); if (mac) { tmp = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", @@ -841,6 +843,23 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) g_free (tmp); } + svSetValue (ifcfg, "SUBCHANNELS", NULL, FALSE); + zvm_subchannels = nm_setting_wired_get_zvm_subchannels (s_wired); + if (zvm_subchannels) { + if (zvm_subchannels->len == 2) { + tmp = g_strdup_printf ("%s,%s", + (const char *) g_ptr_array_index (zvm_subchannels, 0), + (const char *) g_ptr_array_index (zvm_subchannels, 1)); + } else if (zvm_subchannels->len == 3) { + tmp = g_strdup_printf ("%s,%s,%s", + (const char *) g_ptr_array_index (zvm_subchannels, 0), + (const char *) g_ptr_array_index (zvm_subchannels, 1), + (const char *) g_ptr_array_index (zvm_subchannels, 2)); + } + svSetValue (ifcfg, "SUBCHANNELS", tmp, FALSE); + g_free (tmp); + } + svSetValue (ifcfg, "TYPE", TYPE_ETHERNET, FALSE); return TRUE; -- cgit v1.2.1 From 6810ef1422ec873240520b4f0b6e626908bc320c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 28 May 2010 13:06:14 -0700 Subject: core: don't shadow 'sleep' --- src/nm-manager.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 1bc9e5a466..7d46285b35 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -2719,7 +2719,7 @@ do_sleep_wake (NMManager *self) } static gboolean -impl_manager_sleep (NMManager *self, gboolean sleep, GError **error) +impl_manager_sleep (NMManager *self, gboolean do_sleep, GError **error) { NMManagerPrivate *priv; @@ -2727,19 +2727,19 @@ impl_manager_sleep (NMManager *self, gboolean sleep, GError **error) priv = NM_MANAGER_GET_PRIVATE (self); - if (priv->sleeping == sleep) { + if (priv->sleeping == do_sleep) { g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_ALREADY_ASLEEP_OR_AWAKE, - "Already %s", sleep ? "asleep" : "awake"); + "Already %s", do_sleep ? "asleep" : "awake"); return FALSE; } nm_log_info (LOGD_SUSPEND, "%s requested (sleeping: %s enabled: %s)", - sleep ? "sleep" : "wake", + do_sleep ? "sleep" : "wake", priv->sleeping ? "yes" : "no", priv->net_enabled ? "yes" : "no"); - priv->sleeping = sleep; + priv->sleeping = do_sleep; do_sleep_wake (self); -- cgit v1.2.1 From 716a9c6c0df95c18840c700a4320c81869b8b78d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 28 May 2010 18:23:00 -0700 Subject: core: add permissions framework for various operations (rh #585182) (bgo #619323) --- introspection/nm-manager-client.xml | 8 + introspection/nm-manager.xml | 28 ++++ libnm-glib/libnm-glib.ver | 1 + libnm-glib/nm-client.c | 166 +++++++++++++++++++ libnm-glib/nm-client.h | 22 +++ po/POTFILES.in | 3 +- policy/Makefile.am | 5 +- policy/org.freedesktop.NetworkManager.policy.in | 49 ++++++ src/Makefile.am | 4 + src/nm-manager-auth.c | 212 ++++++++++++++++++++++++ src/nm-manager-auth.h | 69 ++++++++ src/nm-manager.c | 133 +++++++++++++++ 12 files changed, 698 insertions(+), 2 deletions(-) create mode 100644 policy/org.freedesktop.NetworkManager.policy.in create mode 100644 src/nm-manager-auth.c create mode 100644 src/nm-manager-auth.h diff --git a/introspection/nm-manager-client.xml b/introspection/nm-manager-client.xml index 7a9e311ca7..9ede13e3c0 100644 --- a/introspection/nm-manager-client.xml +++ b/introspection/nm-manager-client.xml @@ -44,6 +44,14 @@ object. dbus-glib generates the same bound function names for D-Bus the methods + + + + + + + + diff --git a/introspection/nm-manager.xml b/introspection/nm-manager.xml index 46db5afd8b..df3a2ab3ef 100644 --- a/introspection/nm-manager.xml +++ b/introspection/nm-manager.xml @@ -116,6 +116,34 @@ + + + + + Returns the permissions a caller has for various authenticated operations + that NetworkManager provides, like Enable/Disable networking, changing + WiFi, WWAN, and WiMAX state, etc. + + + + Dictionary of available permissions and results. Each permission + is represented by a name (ie "org.freedesktop.NetworkManager.Foobar") + and each result is one of the following values: "yes" (the permission + is available), "auth" (the permission is available after a successful + authentication), or "no" (the permission is denied). Clients may use + these values in the UI to indicate the ability to perform certain + operations. + + + + + + + Emitted when system authorization details change, indicating that + clients may wish to recheck permissions with GetPermissions. + + + diff --git a/libnm-glib/libnm-glib.ver b/libnm-glib/libnm-glib.ver index 2b84dace1e..1c4d8f43c7 100644 --- a/libnm-glib/libnm-glib.ver +++ b/libnm-glib/libnm-glib.ver @@ -34,6 +34,7 @@ global: nm_client_get_device_by_path; nm_client_get_devices; nm_client_get_manager_running; + nm_client_get_permission_result; nm_client_get_state; nm_client_get_type; nm_client_networking_get_enabled; diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c index 00d729a2ed..a1f986f493 100644 --- a/libnm-glib/nm-client.c +++ b/libnm-glib/nm-client.c @@ -58,6 +58,9 @@ typedef struct { GPtrArray *devices; GPtrArray *active_connections; + DBusGProxyCall *perm_call; + GHashTable *permissions; + gboolean have_networking_enabled; gboolean networking_enabled; gboolean wireless_enabled; @@ -84,6 +87,7 @@ enum { enum { DEVICE_ADDED, DEVICE_REMOVED, + PERMISSION_CHANGED, LAST_SIGNAL }; @@ -118,6 +122,8 @@ nm_client_init (NMClient *client) priv->state = NM_STATE_UNKNOWN; + priv->permissions = g_hash_table_new (g_direct_hash, g_direct_equal); + g_signal_connect (client, "notify::" NM_CLIENT_NETWORKING_ENABLED, G_CALLBACK (handle_net_enabled_changed), @@ -284,6 +290,114 @@ register_for_property_changed (NMClient *client) property_changed_info); } +#define NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK "org.freedesktop.NetworkManager.enable-disable-network" +#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI "org.freedesktop.NetworkManager.enable-disable-wifi" +#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN "org.freedesktop.NetworkManager.enable-disable-wwan" +#define NM_AUTH_PERMISSION_USE_USER_CONNECTIONS "org.freedesktop.NetworkManager.use-user-connections" + +static NMClientPermission +nm_permission_to_client (const char *nm) +{ + if (!strcmp (nm, NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK)) + return NM_CLIENT_PERMISSION_ENABLE_DISABLE_NETWORK; + else if (!strcmp (nm, NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI)) + return NM_CLIENT_PERMISSION_ENABLE_DISABLE_WIFI; + else if (!strcmp (nm, NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN)) + return NM_CLIENT_PERMISSION_ENABLE_DISABLE_WWAN; + else if (!strcmp (nm, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS)) + return NM_CLIENT_PERMISSION_USE_USER_CONNECTIONS; + return NM_CLIENT_PERMISSION_NONE; +} + +static NMClientPermissionResult +nm_permission_result_to_client (const char *nm) +{ + if (!strcmp (nm, "yes")) + return NM_CLIENT_PERMISSION_RESULT_YES; + else if (!strcmp (nm, "no")) + return NM_CLIENT_PERMISSION_RESULT_NO; + else if (!strcmp (nm, "auth")) + return NM_CLIENT_PERMISSION_RESULT_AUTH; + return NM_CLIENT_PERMISSION_RESULT_UNKNOWN; +} + +static void +get_permissions_reply (DBusGProxy *proxy, + GHashTable *permissions, + GError *error, + gpointer user_data) +{ + NMClient *self = NM_CLIENT (user_data); + NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (self); + GHashTableIter iter; + gpointer key, value; + NMClientPermission perm; + NMClientPermissionResult perm_result; + GList *keys, *keys_iter; + + priv->perm_call = NULL; + + /* get list of old permissions for change notification */ + keys = g_hash_table_get_keys (priv->permissions); + g_hash_table_remove_all (priv->permissions); + + if (!error) { + /* Process new permissions */ + g_hash_table_iter_init (&iter, permissions); + while (g_hash_table_iter_next (&iter, &key, &value)) { + perm = nm_permission_to_client ((const char *) key); + perm_result = nm_permission_result_to_client ((const char *) value); + if (perm) { + g_hash_table_insert (priv->permissions, + GUINT_TO_POINTER (perm), + GUINT_TO_POINTER (perm_result)); + + /* Remove this permission from the list of previous permissions + * we'll be sending NM_CLIENT_PERMISSION_RESULT_UNKNOWN for + * in the change signal since it is still a known permission. + */ + keys = g_list_remove (keys, GUINT_TO_POINTER (perm)); + } + } + } + + /* Signal changes in all updated permissions */ + g_hash_table_iter_init (&iter, priv->permissions); + while (g_hash_table_iter_next (&iter, &key, &value)) { + g_signal_emit (self, signals[PERMISSION_CHANGED], 0, + GPOINTER_TO_UINT (key), + GPOINTER_TO_UINT (value)); + } + + /* And signal changes in all permissions that used to be valid but for + * some reason weren't received in the last request (if any). + */ + for (keys_iter = keys; keys_iter; keys_iter = g_list_next (keys_iter)) { + g_signal_emit (self, signals[PERMISSION_CHANGED], 0, + GPOINTER_TO_UINT (keys_iter->data), + NM_CLIENT_PERMISSION_RESULT_UNKNOWN); + } + g_list_free (keys); +} + +static DBusGProxyCall * +get_permissions (NMClient *self) +{ + return org_freedesktop_NetworkManager_get_permissions_async (NM_CLIENT_GET_PRIVATE (self)->client_proxy, + get_permissions_reply, + self); +} + +static void +client_recheck_permissions (DBusGProxy *proxy, gpointer user_data) +{ + NMClient *self = NM_CLIENT (user_data); + NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (self); + + if (!priv->perm_call) + priv->perm_call = get_permissions (self); +} + static GObject* constructor (GType type, guint n_construct_params, @@ -324,6 +438,15 @@ constructor (GType type, object, NULL); + /* Permissions */ + dbus_g_proxy_add_signal (priv->client_proxy, "CheckPermissions", G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->client_proxy, + "CheckPermissions", + G_CALLBACK (client_recheck_permissions), + object, + NULL); + priv->perm_call = get_permissions (NM_CLIENT (object)); + priv->bus_proxy = dbus_g_proxy_new_for_name (connection, "org.freedesktop.DBus", "/org/freedesktop/DBus", @@ -381,12 +504,17 @@ dispose (GObject *object) return; } + if (priv->perm_call) + dbus_g_proxy_cancel_call (priv->client_proxy, priv->perm_call); + g_object_unref (priv->client_proxy); g_object_unref (priv->bus_proxy); free_object_array (&priv->devices); free_object_array (&priv->active_connections); + g_hash_table_destroy (priv->permissions); + G_OBJECT_CLASS (nm_client_parent_class)->dispose (object); } @@ -626,6 +754,22 @@ nm_client_class_init (NMClientClass *client_class) g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT); + + /** + * NMClient::permission-changed: + * @widget: the client that received the signal + * @permission: a permission from #NMClientPermission + * @result: the permission's result, one of #NMClientPermissionResult + * + * Notifies that a permission has changed + **/ + signals[PERMISSION_CHANGED] = + g_signal_new ("permission-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + 0, NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); } /** @@ -1158,3 +1302,25 @@ nm_client_get_manager_running (NMClient *client) return NM_CLIENT_GET_PRIVATE (client)->manager_running; } +/** + * nm_client_get_permission_result: + * @client: a #NMClient + * @permission: the permission for which to return the result, one of #NMClientPermission + * + * Requests the result of a specific permission, which indicates whether the + * client can or cannot perform the action the permission represents + * + * Returns: the permission's result, one of #NMClientPermissionResult + **/ +NMClientPermissionResult +nm_client_get_permission_result (NMClient *client, NMClientPermission permission) +{ + gpointer result; + + g_return_val_if_fail (NM_IS_CLIENT (client), NM_CLIENT_PERMISSION_RESULT_UNKNOWN); + + result = g_hash_table_lookup (NM_CLIENT_GET_PRIVATE (client)->permissions, + GUINT_TO_POINTER (permission)); + return GPOINTER_TO_UINT (result); +} + diff --git a/libnm-glib/nm-client.h b/libnm-glib/nm-client.h index 6b912e05aa..c67e0d8f84 100644 --- a/libnm-glib/nm-client.h +++ b/libnm-glib/nm-client.h @@ -50,6 +50,25 @@ G_BEGIN_DECLS #define NM_CLIENT_WWAN_HARDWARE_ENABLED "wwan-hardware-enabled" #define NM_CLIENT_ACTIVE_CONNECTIONS "active-connections" +/* Permissions */ +typedef enum { + NM_CLIENT_PERMISSION_NONE = 0, + NM_CLIENT_PERMISSION_ENABLE_DISABLE_NETWORK = 1, + NM_CLIENT_PERMISSION_ENABLE_DISABLE_WIFI = 2, + NM_CLIENT_PERMISSION_ENABLE_DISABLE_WWAN = 3, + NM_CLIENT_PERMISSION_USE_USER_CONNECTIONS = 4, + + NM_CLIENT_PERMISSION_LAST = NM_CLIENT_PERMISSION_USE_USER_CONNECTIONS +} NMClientPermission; + +typedef enum { + NM_CLIENT_PERMISSION_RESULT_UNKNOWN = 0, + NM_CLIENT_PERMISSION_RESULT_YES, + NM_CLIENT_PERMISSION_RESULT_AUTH, + NM_CLIENT_PERMISSION_RESULT_NO +} NMClientPermissionResult; + + typedef struct { NMObject parent; } NMClient; @@ -105,6 +124,9 @@ gboolean nm_client_get_manager_running (NMClient *client); const GPtrArray *nm_client_get_active_connections (NMClient *client); void nm_client_sleep (NMClient *client, gboolean sleep); +NMClientPermissionResult nm_client_get_permission_result (NMClient *client, + NMClientPermission permission); + G_END_DECLS #endif /* NM_CLIENT_H */ diff --git a/po/POTFILES.in b/po/POTFILES.in index 4d7faa5873..22e8cf3822 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -11,6 +11,8 @@ libnm-util/crypto.c libnm-util/crypto_gnutls.c libnm-util/crypto_nss.c libnm-util/nm-utils.c +policy/org.freedesktop.network-manager-settings.system.policy.in +policy/org.freedesktop.NetworkManager.policy.in src/nm-netlink-monitor.c src/main.c src/dhcp-manager/nm-dhcp-dhclient.c @@ -19,5 +21,4 @@ src/logging/nm-logging.c src/named-manager/nm-named-manager.c src/system-settings/nm-default-wired-connection.c system-settings/plugins/ifcfg-rh/reader.c -policy/org.freedesktop.network-manager-settings.system.policy.in diff --git a/policy/Makefile.am b/policy/Makefile.am index 409e8edda8..4778ce230a 100644 --- a/policy/Makefile.am +++ b/policy/Makefile.am @@ -1,6 +1,9 @@ polkit_policydir = $(datadir)/polkit-1/actions -dist_polkit_policy_in_files = org.freedesktop.network-manager-settings.system.policy.in +dist_polkit_policy_in_files = \ + org.freedesktop.network-manager-settings.system.policy.in \ + org.freedesktop.NetworkManager.policy.in + dist_polkit_policy_DATA = $(dist_polkit_policy_in_files:.policy.in=.policy) @INTLTOOL_POLICY_RULE@ diff --git a/policy/org.freedesktop.NetworkManager.policy.in b/policy/org.freedesktop.NetworkManager.policy.in new file mode 100644 index 0000000000..fb8654c249 --- /dev/null +++ b/policy/org.freedesktop.NetworkManager.policy.in @@ -0,0 +1,49 @@ + + + + + + NetworkManager + http://www.gnome.org/projects/NetworkManager + nm-icon + + + <_description>Enable or disable system networking + <_message>System policy prevents enabling or disabling system networking + + no + yes + + + + + <_description>Enable or disable WiFi devices + <_message>System policy prevents enabling or disabling WiFi devices + + no + yes + + + + + <_description>Enable or disable mobile broadband devices + <_message>System policy prevents enabling or disabling mobile broadband devices + + no + yes + + + + + <_description>Allow use of user-specific connections + <_message>System policy prevents use of user-specific connections + + no + yes + + + + + diff --git a/src/Makefile.am b/src/Makefile.am index 5d2db6e36d..9a28751a30 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -133,6 +133,8 @@ NetworkManager_SOURCES = \ nm-system.h \ nm-manager.c \ nm-manager.h \ + nm-manager-auth.c \ + nm-manager-auth.h \ nm-netlink-monitor.c \ nm-netlink-monitor.h \ nm-activation-request.c \ @@ -211,6 +213,7 @@ NetworkManager_CPPFLAGS = \ $(GUDEV_CFLAGS) \ $(LIBNL_CFLAGS) \ $(GMODULE_CFLAGS) \ + $(POLKIT_CFLAGS) \ -DG_DISABLE_DEPRECATED \ -DBINDIR=\"$(bindir)\" \ -DSBINDIR=\"$(sbindir)\" \ @@ -242,6 +245,7 @@ NetworkManager_LDADD = \ $(GUDEV_LIBS) \ $(LIBNL_LIBS) \ $(GMODULE_LIBS) \ + $(POLKIT_LIBS) \ $(LIBM) \ $(LIBDL) diff --git a/src/nm-manager-auth.c b/src/nm-manager-auth.c new file mode 100644 index 0000000000..bc04e2544b --- /dev/null +++ b/src/nm-manager-auth.c @@ -0,0 +1,212 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2010 Red Hat, Inc. + */ + +#include "nm-manager-auth.h" +#include "nm-logging.h" + +#include +#include + +struct NMAuthChain { + guint32 refcount; + PolkitAuthority *authority; + GSList *calls; + + DBusGMethodInvocation *context; + GError *error; + + NMAuthChainResultFunc done_func; + NMAuthChainCallFunc call_func; + gpointer user_data; + gpointer user_data2; +}; + +typedef struct { + NMAuthChain *chain; + GCancellable *cancellable; + char *permission; + gboolean disposed; +} PolkitCall; + + +NMAuthChain * +nm_auth_chain_new (PolkitAuthority *authority, + DBusGMethodInvocation *context, + NMAuthChainResultFunc done_func, + NMAuthChainCallFunc call_func, + gpointer user_data, + gpointer user_data2) +{ + NMAuthChain *self; + + self = g_malloc0 (sizeof (NMAuthChain)); + self->refcount = 1; + self->authority = g_object_ref (authority); + self->done_func = done_func; + self->call_func = call_func; + self->context = context; + self->user_data = user_data; + self->user_data2 = user_data2; + return self; +} + +static void +nm_auth_chain_check_done (NMAuthChain *self) +{ + g_return_if_fail (self != NULL); + + if (g_slist_length (self->calls) == 0) { + /* Ensure we say alive across the callback */ + self->refcount++; + self->done_func (self, self->error, self->context, self->user_data, self->user_data2); + nm_auth_chain_unref (self); + } +} + +static void +polkit_call_cancel (PolkitCall *call) +{ + call->disposed = TRUE; + g_cancellable_cancel (call->cancellable); +} + +static void +polkit_call_free (PolkitCall *call) +{ + g_return_if_fail (call != NULL); + + call->disposed = TRUE; + g_free (call->permission); + call->permission = NULL; + call->chain = NULL; + g_object_unref (call->cancellable); + call->cancellable = NULL; + g_free (call); +} + +static void +pk_call_cb (GObject *object, GAsyncResult *result, gpointer user_data) +{ + PolkitCall *call = user_data; + NMAuthChain *chain; + PolkitAuthorizationResult *pk_result; + GError *error = NULL; + guint call_result = NM_AUTH_CALL_RESULT_UNKNOWN; + + /* If the call is already disposed do nothing */ + if (call->disposed) { + polkit_call_free (call); + return; + } + + chain = call->chain; + chain->calls = g_slist_remove (chain->calls, call); + + pk_result = polkit_authority_check_authorization_finish (chain->authority, + result, + &error); + if (error) { + if (!chain->error) + chain->error = g_error_copy (error); + + nm_log_warn (LOGD_CORE, "error requesting auth for %s: (%d) %s", + call->permission, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + } else { + if (polkit_authorization_result_get_is_authorized (pk_result)) { + /* Caller has the permission */ + call_result = NM_AUTH_CALL_RESULT_YES; + } else if (polkit_authorization_result_get_is_challenge (pk_result)) { + /* Caller could authenticate to get the permission */ + call_result = NM_AUTH_CALL_RESULT_AUTH; + } else + call_result = NM_AUTH_CALL_RESULT_NO; + } + + chain->call_func (chain, call->permission, error, call_result, chain->user_data, chain->user_data2); + nm_auth_chain_check_done (chain); + + g_clear_error (&error); + polkit_call_free (call); + if (pk_result) + g_object_unref (pk_result); +} + +gboolean +nm_auth_chain_add_call (NMAuthChain *self, + const char *permission) +{ + PolkitCall *call; + char *sender; + PolkitSubject *subject; + + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (self->context != NULL, FALSE); + g_return_val_if_fail (permission != NULL, FALSE); + + sender = dbus_g_method_get_sender (self->context); + subject = polkit_system_bus_name_new (sender); + g_free (sender); + if (!subject) + return FALSE; + + call = g_malloc0 (sizeof (PolkitCall)); + call->chain = self; + call->permission = g_strdup (permission); + call->cancellable = g_cancellable_new (); + + self->calls = g_slist_append (self->calls, call); + + polkit_authority_check_authorization (self->authority, + subject, + permission, + NULL, + POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE, + call->cancellable, + pk_call_cb, + call); + g_object_unref (subject); + return TRUE; +} + +void +nm_auth_chain_unref (NMAuthChain *self) +{ + GSList *iter; + + g_return_if_fail (self != NULL); + + self->refcount--; + if (self->refcount > 0) + return; + + g_object_unref (self->authority); + + for (iter = self->calls; iter; iter = g_slist_next (iter)) + polkit_call_cancel ((PolkitCall *) iter->data); + g_slist_free (self->calls); + + g_clear_error (&self->error); + + memset (self, 0, sizeof (NMAuthChain)); + g_free (self); +} + diff --git a/src/nm-manager-auth.h b/src/nm-manager-auth.h new file mode 100644 index 0000000000..968b28eafe --- /dev/null +++ b/src/nm-manager-auth.h @@ -0,0 +1,69 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2010 Red Hat, Inc. + */ + +#ifndef NM_MANAGER_AUTH_H +#define NM_MANAGER_AUTH_H + +#include +#include +#include + +#define NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK "org.freedesktop.NetworkManager.enable-disable-network" +#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI "org.freedesktop.NetworkManager.enable-disable-wifi" +#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN "org.freedesktop.NetworkManager.enable-disable-wwan" +#define NM_AUTH_PERMISSION_USE_USER_CONNECTIONS "org.freedesktop.NetworkManager.use-user-connections" + + +typedef struct NMAuthChain NMAuthChain; + +enum { + NM_AUTH_CALL_RESULT_UNKNOWN, + NM_AUTH_CALL_RESULT_YES, + NM_AUTH_CALL_RESULT_AUTH, + NM_AUTH_CALL_RESULT_NO, +}; + +typedef void (*NMAuthChainResultFunc) (NMAuthChain *chain, + GError *error, + DBusGMethodInvocation *context, + gpointer user_data, + gpointer user_data2); + +typedef void (*NMAuthChainCallFunc) (NMAuthChain *chain, + const char *permission, + GError *error, + guint result, + gpointer user_data, + gpointer user_data2); + +NMAuthChain *nm_auth_chain_new (PolkitAuthority *authority, + DBusGMethodInvocation *context, + NMAuthChainResultFunc done_func, + NMAuthChainCallFunc call_func, + gpointer user_data, + gpointer user_data2); + +gboolean nm_auth_chain_add_call (NMAuthChain *chain, + const char *permission); + +void nm_auth_chain_unref (NMAuthChain *chain); + +#endif /* NM_MANAGER_AUTH_H */ + diff --git a/src/nm-manager.c b/src/nm-manager.c index 7d46285b35..f37c4a6bad 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -54,6 +54,7 @@ #include "nm-secrets-provider-interface.h" #include "nm-settings-interface.h" #include "nm-settings-system-interface.h" +#include "nm-manager-auth.h" #define NM_AUTOIP_DBUS_SERVICE "org.freedesktop.nm_avahi_autoipd" #define NM_AUTOIP_DBUS_IFACE "org.freedesktop.nm_avahi_autoipd" @@ -74,6 +75,9 @@ static gboolean impl_manager_sleep (NMManager *manager, gboolean sleep, GError * static gboolean impl_manager_enable (NMManager *manager, gboolean enable, GError **err); +static void impl_manager_get_permissions (NMManager *manager, + DBusGMethodInvocation *context); + static gboolean impl_manager_set_logging (NMManager *manager, const char *level, const char *domains, @@ -196,6 +200,10 @@ typedef struct { DBusGProxy *aipd_proxy; + PolkitAuthority *authority; + guint auth_changed_id; + GSList *auth_chains; + gboolean disposed; } NMManagerPrivate; @@ -215,6 +223,7 @@ enum { CONNECTION_ADDED, CONNECTION_UPDATED, CONNECTION_REMOVED, + CHECK_PERMISSIONS, LAST_SIGNAL }; @@ -2792,6 +2801,109 @@ impl_manager_enable (NMManager *self, gboolean enable, GError **error) return TRUE; } +/* Permissions */ + +static void +pk_authority_changed_cb (GObject *object, gpointer user_data) +{ + /* Let clients know they should re-check their authorization */ + g_signal_emit (NM_MANAGER (user_data), signals[CHECK_PERMISSIONS], 0); +} + +static void +get_permissions_done_cb (NMAuthChain *chain, + GError *error, + DBusGMethodInvocation *context, + gpointer user_data, + gpointer user_data2) +{ + NMManager *self = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + GHashTable *hash = user_data2; + GError *ret_error; + + priv->auth_chains = g_slist_remove (priv->auth_chains, chain); + if (error) { + nm_log_dbg (LOGD_CORE, "Permissions request failed: %s", error->message); + ret_error = g_error_new (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + "Permissions request failed: %s", + error->message); + dbus_g_method_return_error (context, ret_error); + g_error_free (ret_error); + } else { + g_assert (user_data2); + dbus_g_method_return (context, hash); + } + + g_hash_table_destroy (hash); + nm_auth_chain_unref (chain); +} + +static void +get_permissions_call_done_cb (NMAuthChain *chain, + const char *permission, + GError *error, + guint result, + gpointer user_data, + gpointer user_data2) +{ + GHashTable *hash = user_data2; + const char *str_result = NULL; + + if (!error) { + g_assert (result != NM_AUTH_CALL_RESULT_UNKNOWN); + + if (result == NM_AUTH_CALL_RESULT_YES) + str_result = "yes"; + else if (result == NM_AUTH_CALL_RESULT_NO) + str_result = "no"; + else if (result == NM_AUTH_CALL_RESULT_AUTH) + str_result = "auth"; + else { + nm_log_dbg (LOGD_CORE, "unknown auth chain result %d", result); + } + + if (str_result) + g_hash_table_insert (hash, g_strdup (permission), g_strdup (str_result)); + } +} + +static void +impl_manager_get_permissions (NMManager *self, + DBusGMethodInvocation *context) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + NMAuthChain *chain; + GHashTable *results; + + if (!priv->authority) { + GError *error; + + error = g_error_new_literal (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + "Permissions request failed: PolicyKit not initialized"); + dbus_g_method_return_error (context, error); + g_error_free (error); + return; + } + + results = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + chain = nm_auth_chain_new (priv->authority, + context, + get_permissions_done_cb, + get_permissions_call_done_cb, + self, + results); + g_assert (chain); + priv->auth_chains = g_slist_append (priv->auth_chains, chain); + + nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK); + nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI); + nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN); + nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS); +} + /* Legacy 0.6 compatibility interface */ static gboolean @@ -3078,6 +3190,10 @@ dispose (GObject *object) pending_connection_info_destroy (priv->pending_connection_info); priv->pending_connection_info = NULL; + g_slist_foreach (priv->auth_chains, (GFunc) nm_auth_chain_unref, NULL); + g_slist_free (priv->auth_chains); + g_object_unref (priv->authority); + while (g_slist_length (priv->secrets_calls)) free_get_secrets_info ((GetSecretsInfo *) priv->secrets_calls->data); @@ -3286,6 +3402,15 @@ nm_manager_init (NMManager *manager) NULL); } else nm_log_warn (LOGD_AUTOIP4, "could not initialize avahi-autoipd D-Bus proxy"); + + priv->authority = polkit_authority_get (); + if (priv->authority) { + priv->auth_changed_id = g_signal_connect (priv->authority, + "changed", + G_CALLBACK (pk_authority_changed_cb), + manager); + } else + nm_log_warn (LOGD_CORE, "failed to create PolicyKit authority."); } static void @@ -3445,6 +3570,14 @@ nm_manager_class_init (NMManagerClass *manager_class) _nm_marshal_VOID__OBJECT_UINT, G_TYPE_NONE, 2, G_TYPE_OBJECT, G_TYPE_UINT); + signals[CHECK_PERMISSIONS] = + g_signal_new ("check-permissions", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + 0, NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + /* StateChange is DEPRECATED */ signals[STATE_CHANGE] = g_signal_new ("state-change", -- cgit v1.2.1 From c013490ba31f36ef8d2d996aacd111835e8a6a2c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 29 May 2010 23:00:46 -0700 Subject: core: PolicyKit-protect enable/disable networking method --- introspection/nm-manager.xml | 1 + src/nm-manager-auth.c | 70 ++++++++++++++-- src/nm-manager-auth.h | 25 +++--- src/nm-manager.c | 187 ++++++++++++++++++++++++++++++++----------- 4 files changed, 218 insertions(+), 65 deletions(-) diff --git a/introspection/nm-manager.xml b/introspection/nm-manager.xml index df3a2ab3ef..370d98a59e 100644 --- a/introspection/nm-manager.xml +++ b/introspection/nm-manager.xml @@ -101,6 +101,7 @@ + Control whether overall networking is enabled or disabled. When disabled, all interfaces that NM manages are deactivated. When enabled, diff --git a/src/nm-manager-auth.c b/src/nm-manager-auth.c index bc04e2544b..fa621a7b50 100644 --- a/src/nm-manager-auth.c +++ b/src/nm-manager-auth.c @@ -28,6 +28,7 @@ struct NMAuthChain { guint32 refcount; PolkitAuthority *authority; GSList *calls; + GHashTable *data; DBusGMethodInvocation *context; GError *error; @@ -35,7 +36,6 @@ struct NMAuthChain { NMAuthChainResultFunc done_func; NMAuthChainCallFunc call_func; gpointer user_data; - gpointer user_data2; }; typedef struct { @@ -45,28 +45,76 @@ typedef struct { gboolean disposed; } PolkitCall; +typedef struct { + gpointer data; + GDestroyNotify destroy; +} ChainData; + +static void +free_data (gpointer data) +{ + ChainData *tmp = data; + + if (tmp->destroy) + tmp->destroy (tmp->data); + memset (tmp, 0, sizeof (ChainData)); + g_free (tmp); +} NMAuthChain * nm_auth_chain_new (PolkitAuthority *authority, DBusGMethodInvocation *context, NMAuthChainResultFunc done_func, NMAuthChainCallFunc call_func, - gpointer user_data, - gpointer user_data2) + gpointer user_data) { NMAuthChain *self; self = g_malloc0 (sizeof (NMAuthChain)); self->refcount = 1; self->authority = g_object_ref (authority); + self->data = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, free_data); self->done_func = done_func; self->call_func = call_func; self->context = context; self->user_data = user_data; - self->user_data2 = user_data2; return self; } +gpointer +nm_auth_chain_get_data (NMAuthChain *self, const char *tag) +{ + ChainData *tmp; + + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (tag != NULL, NULL); + + tmp = g_hash_table_lookup (self->data, tag); + return tmp ? tmp->data : NULL; +} + +void +nm_auth_chain_set_data (NMAuthChain *self, + const char *tag, + gpointer data, + GDestroyNotify data_destroy) +{ + ChainData *tmp; + + g_return_if_fail (self != NULL); + g_return_if_fail (tag != NULL); + + if (data == NULL) + g_hash_table_remove (self->data, tag); + else { + tmp = g_malloc0 (sizeof (ChainData)); + tmp->data = data; + tmp->destroy = data_destroy; + + g_hash_table_insert (self->data, g_strdup (tag), tmp); + } +} + static void nm_auth_chain_check_done (NMAuthChain *self) { @@ -75,7 +123,7 @@ nm_auth_chain_check_done (NMAuthChain *self) if (g_slist_length (self->calls) == 0) { /* Ensure we say alive across the callback */ self->refcount++; - self->done_func (self, self->error, self->context, self->user_data, self->user_data2); + self->done_func (self, self->error, self->context, self->user_data); nm_auth_chain_unref (self); } } @@ -141,7 +189,7 @@ pk_call_cb (GObject *object, GAsyncResult *result, gpointer user_data) call_result = NM_AUTH_CALL_RESULT_NO; } - chain->call_func (chain, call->permission, error, call_result, chain->user_data, chain->user_data2); + chain->call_func (chain, call->permission, error, call_result, chain->user_data); nm_auth_chain_check_done (chain); g_clear_error (&error); @@ -152,11 +200,13 @@ pk_call_cb (GObject *object, GAsyncResult *result, gpointer user_data) gboolean nm_auth_chain_add_call (NMAuthChain *self, - const char *permission) + const char *permission, + gboolean allow_interaction) { PolkitCall *call; char *sender; PolkitSubject *subject; + PolkitCheckAuthorizationFlags flags = POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (self->context != NULL, FALSE); @@ -175,11 +225,14 @@ nm_auth_chain_add_call (NMAuthChain *self, self->calls = g_slist_append (self->calls, call); + if (allow_interaction) + flags = POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION; + polkit_authority_check_authorization (self->authority, subject, permission, NULL, - POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE, + flags, call->cancellable, pk_call_cb, call); @@ -205,6 +258,7 @@ nm_auth_chain_unref (NMAuthChain *self) g_slist_free (self->calls); g_clear_error (&self->error); + g_hash_table_destroy (self->data); memset (self, 0, sizeof (NMAuthChain)); g_free (self); diff --git a/src/nm-manager-auth.h b/src/nm-manager-auth.h index 968b28eafe..f0f01c2839 100644 --- a/src/nm-manager-auth.h +++ b/src/nm-manager-auth.h @@ -33,35 +33,40 @@ typedef struct NMAuthChain NMAuthChain; -enum { +typedef enum { NM_AUTH_CALL_RESULT_UNKNOWN, NM_AUTH_CALL_RESULT_YES, NM_AUTH_CALL_RESULT_AUTH, NM_AUTH_CALL_RESULT_NO, -}; +} NMAuthCallResult; typedef void (*NMAuthChainResultFunc) (NMAuthChain *chain, GError *error, DBusGMethodInvocation *context, - gpointer user_data, - gpointer user_data2); + gpointer user_data); typedef void (*NMAuthChainCallFunc) (NMAuthChain *chain, const char *permission, GError *error, - guint result, - gpointer user_data, - gpointer user_data2); + NMAuthCallResult result, + gpointer user_data); NMAuthChain *nm_auth_chain_new (PolkitAuthority *authority, DBusGMethodInvocation *context, NMAuthChainResultFunc done_func, NMAuthChainCallFunc call_func, - gpointer user_data, - gpointer user_data2); + gpointer user_data); + +gpointer nm_auth_chain_get_data (NMAuthChain *chain, const char *tag); + +void nm_auth_chain_set_data (NMAuthChain *chain, + const char *tag, + gpointer data, + GDestroyNotify data_destroy); gboolean nm_auth_chain_add_call (NMAuthChain *chain, - const char *permission); + const char *permission, + gboolean allow_interaction); void nm_auth_chain_unref (NMAuthChain *chain); diff --git a/src/nm-manager.c b/src/nm-manager.c index f37c4a6bad..984db5fc94 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -73,7 +73,9 @@ static gboolean impl_manager_deactivate_connection (NMManager *manager, static gboolean impl_manager_sleep (NMManager *manager, gboolean sleep, GError **err); -static gboolean impl_manager_enable (NMManager *manager, gboolean enable, GError **err); +static void impl_manager_enable (NMManager *manager, + gboolean enable, + DBusGMethodInvocation *context); static void impl_manager_get_permissions (NMManager *manager, DBusGMethodInvocation *context); @@ -2727,6 +2729,27 @@ do_sleep_wake (NMManager *self) nm_manager_update_state (self); } +static gboolean +return_permission_denied_error (PolkitAuthority *authority, + const char *detail, + DBusGMethodInvocation *context) +{ + GError *error; + + g_assert (context); + + if (!authority) { + error = g_error_new (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + "%s request failed: PolicyKit not initialized", + detail); + dbus_g_method_return_error (context, error); + g_error_free (error); + return FALSE; + } + return TRUE; +} + static gboolean impl_manager_sleep (NMManager *self, gboolean do_sleep, GError **error) { @@ -2756,26 +2779,14 @@ impl_manager_sleep (NMManager *self, gboolean do_sleep, GError **error) return TRUE; } -static gboolean -impl_manager_enable (NMManager *self, gboolean enable, GError **error) +static void +_internal_enable (NMManager *self, gboolean enable) { - NMManagerPrivate *priv; - - g_return_val_if_fail (NM_IS_MANAGER (self), FALSE); - - priv = NM_MANAGER_GET_PRIVATE (self); - - if (priv->net_enabled == enable) { - g_set_error (error, - NM_MANAGER_ERROR, NM_MANAGER_ERROR_ALREADY_ENABLED_OR_DISABLED, - "Already %s", enable ? "enabled" : "disabled"); - return FALSE; - } + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + GError *err = NULL; /* Update "NetworkingEnabled" key in state file */ if (priv->state_file) { - GError *err = NULL; - if (!write_value_to_state_file (priv->state_file, "main", "NetworkingEnabled", G_TYPE_BOOLEAN, (gpointer) &enable, @@ -2798,7 +2809,92 @@ impl_manager_enable (NMManager *self, gboolean enable, GError **error) do_sleep_wake (self); g_object_notify (G_OBJECT (self), NM_MANAGER_NETWORKING_ENABLED); - return TRUE; +} + +static void +enable_net_done_cb (NMAuthChain *chain, + GError *error, + DBusGMethodInvocation *context, + gpointer user_data) +{ + NMManager *self = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + GError *ret_error; + NMAuthCallResult result; + gboolean enable; + + result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, "result")); + enable = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, "enable")); + + priv->auth_chains = g_slist_remove (priv->auth_chains, chain); + if (error) { + nm_log_dbg (LOGD_CORE, "Enable request failed: %s", error->message); + ret_error = g_error_new (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + "Enable request failed: %s", + error->message); + dbus_g_method_return_error (context, ret_error); + g_error_free (ret_error); + } else if (result != NM_AUTH_CALL_RESULT_YES) { + ret_error = g_error_new_literal (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + "Not authorized to enable/disable networking"); + dbus_g_method_return_error (context, ret_error); + g_error_free (ret_error); + } else { + _internal_enable (self, enable); + dbus_g_method_return (context); + } + + nm_auth_chain_unref (chain); +} + +static void +enable_net_call_done_cb (NMAuthChain *chain, + const char *permission, + GError *error, + NMAuthCallResult result, + gpointer user_data) +{ + if (!error) + nm_auth_chain_set_data (chain, "result", GUINT_TO_POINTER (result), NULL); +} + +static void +impl_manager_enable (NMManager *self, + gboolean enable, + DBusGMethodInvocation *context) +{ + NMManagerPrivate *priv; + NMAuthChain *chain; + GError *error; + + g_return_if_fail (NM_IS_MANAGER (self)); + + priv = NM_MANAGER_GET_PRIVATE (self); + + if (priv->net_enabled == enable) { + error = g_error_new (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_ALREADY_ENABLED_OR_DISABLED, + "Already %s", enable ? "enabled" : "disabled"); + dbus_g_method_return_error (context, error); + g_error_free (error); + return; + } + + if (!return_permission_denied_error (priv->authority, "Permission", context)) + return; + + chain = nm_auth_chain_new (priv->authority, + context, + enable_net_done_cb, + enable_net_call_done_cb, + self); + g_assert (chain); + priv->auth_chains = g_slist_append (priv->auth_chains, chain); + + nm_auth_chain_set_data (chain, "enable", GUINT_TO_POINTER (enable), NULL); + nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK, TRUE); } /* Permissions */ @@ -2814,12 +2910,10 @@ static void get_permissions_done_cb (NMAuthChain *chain, GError *error, DBusGMethodInvocation *context, - gpointer user_data, - gpointer user_data2) + gpointer user_data) { NMManager *self = NM_MANAGER (user_data); NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); - GHashTable *hash = user_data2; GError *ret_error; priv->auth_chains = g_slist_remove (priv->auth_chains, chain); @@ -2832,11 +2926,9 @@ get_permissions_done_cb (NMAuthChain *chain, dbus_g_method_return_error (context, ret_error); g_error_free (ret_error); } else { - g_assert (user_data2); - dbus_g_method_return (context, hash); + dbus_g_method_return (context, nm_auth_chain_get_data (chain, "results")); } - g_hash_table_destroy (hash); nm_auth_chain_unref (chain); } @@ -2845,28 +2937,28 @@ get_permissions_call_done_cb (NMAuthChain *chain, const char *permission, GError *error, guint result, - gpointer user_data, - gpointer user_data2) + gpointer user_data) { - GHashTable *hash = user_data2; + GHashTable *hash; const char *str_result = NULL; - if (!error) { - g_assert (result != NM_AUTH_CALL_RESULT_UNKNOWN); + if (error) + return; - if (result == NM_AUTH_CALL_RESULT_YES) - str_result = "yes"; - else if (result == NM_AUTH_CALL_RESULT_NO) - str_result = "no"; - else if (result == NM_AUTH_CALL_RESULT_AUTH) - str_result = "auth"; - else { - nm_log_dbg (LOGD_CORE, "unknown auth chain result %d", result); - } + hash = nm_auth_chain_get_data (chain, "results"); - if (str_result) - g_hash_table_insert (hash, g_strdup (permission), g_strdup (str_result)); + if (result == NM_AUTH_CALL_RESULT_YES) + str_result = "yes"; + else if (result == NM_AUTH_CALL_RESULT_NO) + str_result = "no"; + else if (result == NM_AUTH_CALL_RESULT_AUTH) + str_result = "auth"; + else { + nm_log_dbg (LOGD_CORE, "unknown auth chain result %d", result); } + + if (str_result) + g_hash_table_insert (hash, g_strdup (permission), g_strdup (str_result)); } static void @@ -2888,20 +2980,21 @@ impl_manager_get_permissions (NMManager *self, return; } - results = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); chain = nm_auth_chain_new (priv->authority, context, get_permissions_done_cb, get_permissions_call_done_cb, - self, - results); + self); g_assert (chain); priv->auth_chains = g_slist_append (priv->auth_chains, chain); - nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK); - nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI); - nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN); - nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS); + results = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + nm_auth_chain_set_data (chain, "results", results, (GDestroyNotify) g_hash_table_destroy); + + nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK, FALSE); + nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI, FALSE); + nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN, FALSE); + nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS, FALSE); } /* Legacy 0.6 compatibility interface */ -- cgit v1.2.1 From 1e69294204e201ac284e9547d8f41e4a41fbd494 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 29 May 2010 23:01:28 -0700 Subject: trivial: update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2df9a0d4b0..22f990911d 100644 --- a/.gitignore +++ b/.gitignore @@ -106,5 +106,6 @@ m4/libtool.m4 m4/lt*.m4 policy/org.freedesktop.network-manager-settings.system.policy +policy/org.freedesktop.NetworkManager.policy cli/src/nmcli -- cgit v1.2.1 From 65818d517e386c03daca08db4be7b53aff94359a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 29 May 2010 23:11:45 -0700 Subject: core: PolicyKit-protect sleep/wake Default to 'not allowed', distros that need backwards compatibility can flip this to 'yes' if they need to. At this point, only power management scripts should call these functions. --- introspection/nm-manager.xml | 3 + policy/org.freedesktop.NetworkManager.policy.in | 9 ++ src/nm-manager-auth.h | 1 + src/nm-manager.c | 125 +++++++++++++++++++----- 4 files changed, 114 insertions(+), 24 deletions(-) diff --git a/introspection/nm-manager.xml b/introspection/nm-manager.xml index 370d98a59e..88686566d0 100644 --- a/introspection/nm-manager.xml +++ b/introspection/nm-manager.xml @@ -86,6 +86,7 @@ + Control the NetworkManager daemon's sleep state. When asleep, all interfaces that it manages are deactivated. When awake, devices are @@ -303,6 +304,7 @@ DEPRECATED. Control the NetworkManager daemon's sleep state. When asleep, all interfaces that it manages are deactivated. + @@ -310,6 +312,7 @@ DEPRECATED. Control the NetworkManager daemon's sleep state. When awake, all known interfaces are available to be activated. + diff --git a/policy/org.freedesktop.NetworkManager.policy.in b/policy/org.freedesktop.NetworkManager.policy.in index fb8654c249..a912872491 100644 --- a/policy/org.freedesktop.NetworkManager.policy.in +++ b/policy/org.freedesktop.NetworkManager.policy.in @@ -18,6 +18,15 @@ + + <_description>Put NetworkManager to sleep or wake it up (should only be used by system power management) + <_message>System policy prevents putting NetworkManager to sleep or waking it up + + no + no + + + <_description>Enable or disable WiFi devices <_message>System policy prevents enabling or disabling WiFi devices diff --git a/src/nm-manager-auth.h b/src/nm-manager-auth.h index f0f01c2839..faafbdbd2e 100644 --- a/src/nm-manager-auth.h +++ b/src/nm-manager-auth.h @@ -26,6 +26,7 @@ #include #define NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK "org.freedesktop.NetworkManager.enable-disable-network" +#define NM_AUTH_PERMISSION_SLEEP_WAKE "org.freedesktop.NetworkManager.sleep-wake" #define NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI "org.freedesktop.NetworkManager.enable-disable-wifi" #define NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN "org.freedesktop.NetworkManager.enable-disable-wwan" #define NM_AUTH_PERMISSION_USE_USER_CONNECTIONS "org.freedesktop.NetworkManager.use-user-connections" diff --git a/src/nm-manager.c b/src/nm-manager.c index 984db5fc94..9bf7f4a873 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -71,7 +71,9 @@ static gboolean impl_manager_deactivate_connection (NMManager *manager, const char *connection_path, GError **error); -static gboolean impl_manager_sleep (NMManager *manager, gboolean sleep, GError **err); +static void impl_manager_sleep (NMManager *manager, + gboolean do_sleep, + DBusGMethodInvocation *context); static void impl_manager_enable (NMManager *manager, gboolean enable, @@ -87,8 +89,8 @@ static gboolean impl_manager_set_logging (NMManager *manager, /* Legacy 0.6 compatibility interface */ -static gboolean impl_manager_legacy_sleep (NMManager *manager, GError **err); -static gboolean impl_manager_legacy_wake (NMManager *manager, GError **err); +static void impl_manager_legacy_sleep (NMManager *manager, DBusGMethodInvocation *context); +static void impl_manager_legacy_wake (NMManager *manager, DBusGMethodInvocation *context); static gboolean impl_manager_legacy_state (NMManager *manager, guint32 *state, GError **err); #include "nm-manager-glue.h" @@ -2750,21 +2752,10 @@ return_permission_denied_error (PolkitAuthority *authority, return TRUE; } -static gboolean -impl_manager_sleep (NMManager *self, gboolean do_sleep, GError **error) +static void +_internal_sleep (NMManager *self, gboolean do_sleep) { - NMManagerPrivate *priv; - - g_return_val_if_fail (NM_IS_MANAGER (self), FALSE); - - priv = NM_MANAGER_GET_PRIVATE (self); - - if (priv->sleeping == do_sleep) { - g_set_error (error, - NM_MANAGER_ERROR, NM_MANAGER_ERROR_ALREADY_ASLEEP_OR_AWAKE, - "Already %s", do_sleep ? "asleep" : "awake"); - return FALSE; - } + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); nm_log_info (LOGD_SUSPEND, "%s requested (sleeping: %s enabled: %s)", do_sleep ? "sleep" : "wake", @@ -2776,7 +2767,92 @@ impl_manager_sleep (NMManager *self, gboolean do_sleep, GError **error) do_sleep_wake (self); g_object_notify (G_OBJECT (self), NM_MANAGER_SLEEPING); - return TRUE; +} + +static void +sleep_auth_done_cb (NMAuthChain *chain, + GError *error, + DBusGMethodInvocation *context, + gpointer user_data) +{ + NMManager *self = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + GError *ret_error; + NMAuthCallResult result; + gboolean do_sleep; + + result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, "result")); + do_sleep = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, "sleep")); + + priv->auth_chains = g_slist_remove (priv->auth_chains, chain); + if (error) { + nm_log_dbg (LOGD_CORE, "Sleep/wake request failed: %s", error->message); + ret_error = g_error_new (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + "Sleep/wake request failed: %s", + error->message); + dbus_g_method_return_error (context, ret_error); + g_error_free (ret_error); + } else if (result != NM_AUTH_CALL_RESULT_YES) { + ret_error = g_error_new_literal (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + "Not authorized to sleep/wake"); + dbus_g_method_return_error (context, ret_error); + g_error_free (ret_error); + } else { + _internal_sleep (self, do_sleep); + dbus_g_method_return (context); + } + + nm_auth_chain_unref (chain); +} + +static void +sleep_auth_call_done_cb (NMAuthChain *chain, + const char *permission, + GError *error, + NMAuthCallResult result, + gpointer user_data) +{ + if (!error) + nm_auth_chain_set_data (chain, "result", GUINT_TO_POINTER (result), NULL); +} + +static void +impl_manager_sleep (NMManager *self, + gboolean do_sleep, + DBusGMethodInvocation *context) +{ + NMManagerPrivate *priv; + NMAuthChain *chain; + GError *error; + + g_return_if_fail (NM_IS_MANAGER (self)); + + priv = NM_MANAGER_GET_PRIVATE (self); + + if (priv->sleeping == do_sleep) { + error = g_error_new (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_ALREADY_ASLEEP_OR_AWAKE, + "Already %s", do_sleep ? "asleep" : "awake"); + dbus_g_method_return_error (context, error); + g_error_free (error); + return; + } + + if (!return_permission_denied_error (priv->authority, "Permission", context)) + return; + + chain = nm_auth_chain_new (priv->authority, + context, + sleep_auth_done_cb, + sleep_auth_call_done_cb, + self); + g_assert (chain); + priv->auth_chains = g_slist_append (priv->auth_chains, chain); + + nm_auth_chain_set_data (chain, "sleep", GUINT_TO_POINTER (do_sleep), NULL); + nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_SLEEP_WAKE, TRUE); } static void @@ -2992,6 +3068,7 @@ impl_manager_get_permissions (NMManager *self, nm_auth_chain_set_data (chain, "results", results, (GDestroyNotify) g_hash_table_destroy); nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK, FALSE); + nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_SLEEP_WAKE, FALSE); nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI, FALSE); nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN, FALSE); nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS, FALSE); @@ -2999,16 +3076,16 @@ impl_manager_get_permissions (NMManager *self, /* Legacy 0.6 compatibility interface */ -static gboolean -impl_manager_legacy_sleep (NMManager *manager, GError **error) +static void +impl_manager_legacy_sleep (NMManager *manager, DBusGMethodInvocation *context) { - return impl_manager_sleep (manager, TRUE, error); + return impl_manager_sleep (manager, TRUE, context); } -static gboolean -impl_manager_legacy_wake (NMManager *manager, GError **error) +static void +impl_manager_legacy_wake (NMManager *manager, DBusGMethodInvocation *context) { - return impl_manager_sleep (manager, FALSE, error); + return impl_manager_sleep (manager, FALSE, context); } static gboolean -- cgit v1.2.1 From 41faf87b0eaa94e8a13c4c18b5670f6daccea0c4 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 30 May 2010 08:30:37 -0700 Subject: core: root can always enable/disable and sleep/wake --- src/nm-manager-auth.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/nm-manager-auth.h | 8 ++++++++ src/nm-manager.c | 50 ++++++++++++++++++++++++++++++++++++++++++------- 3 files changed, 103 insertions(+), 7 deletions(-) diff --git a/src/nm-manager-auth.c b/src/nm-manager-auth.c index fa621a7b50..8d9d83271f 100644 --- a/src/nm-manager-auth.c +++ b/src/nm-manager-auth.c @@ -264,3 +264,55 @@ nm_auth_chain_unref (NMAuthChain *self) g_free (self); } +/************ utils **************/ + +gboolean +nm_auth_is_caller_root (DBusGMethodInvocation *context, + NMDBusManager *dbus_mgr, + gboolean *out_is_root, + const char **out_error_desc) +{ + DBusConnection *connection; + char *sender = NULL; + gulong sender_uid = G_MAXULONG; + gboolean success = FALSE; + DBusError dbus_error; + + g_return_val_if_fail (context != NULL, FALSE); + g_return_val_if_fail (dbus_mgr != NULL, FALSE); + g_return_val_if_fail (out_is_root != NULL, FALSE); + + *out_is_root = FALSE; + + sender = dbus_g_method_get_sender (context); + if (!sender) { + if (out_error_desc) + *out_error_desc = "Could not determine D-Bus requestor"; + goto out; + } + + connection = nm_dbus_manager_get_dbus_connection (dbus_mgr); + if (!connection) { + if (out_error_desc) + *out_error_desc = "Could not get the D-Bus system bus"; + goto out; + } + + dbus_error_init (&dbus_error); + /* FIXME: do this async */ + sender_uid = dbus_bus_get_unix_user (connection, sender, &dbus_error); + if (dbus_error_is_set (&dbus_error)) { + if (out_error_desc) + *out_error_desc = "Could not determine the Unix user ID of the requestor"; + dbus_error_free (&dbus_error); + goto out; + } + + success = TRUE; + if (0 == sender_uid) + *out_is_root = TRUE; + +out: + return success; +} + diff --git a/src/nm-manager-auth.h b/src/nm-manager-auth.h index faafbdbd2e..433f10fea7 100644 --- a/src/nm-manager-auth.h +++ b/src/nm-manager-auth.h @@ -25,6 +25,8 @@ #include #include +#include "nm-dbus-manager.h" + #define NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK "org.freedesktop.NetworkManager.enable-disable-network" #define NM_AUTH_PERMISSION_SLEEP_WAKE "org.freedesktop.NetworkManager.sleep-wake" #define NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI "org.freedesktop.NetworkManager.enable-disable-wifi" @@ -71,5 +73,11 @@ gboolean nm_auth_chain_add_call (NMAuthChain *chain, void nm_auth_chain_unref (NMAuthChain *chain); +/* Utils */ +gboolean nm_auth_is_caller_root (DBusGMethodInvocation *context, + NMDBusManager *dbus_mgr, + gboolean *out_is_root, + const char **out_error_desc); + #endif /* NM_MANAGER_AUTH_H */ diff --git a/src/nm-manager.c b/src/nm-manager.c index 9bf7f4a873..171ea26259 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -2732,9 +2732,9 @@ do_sleep_wake (NMManager *self) } static gboolean -return_permission_denied_error (PolkitAuthority *authority, - const char *detail, - DBusGMethodInvocation *context) +return_no_pk_error (PolkitAuthority *authority, + const char *detail, + DBusGMethodInvocation *context) { GError *error; @@ -2825,7 +2825,9 @@ impl_manager_sleep (NMManager *self, { NMManagerPrivate *priv; NMAuthChain *chain; - GError *error; + GError *error = NULL; + gboolean is_root = FALSE; + const char *error_desc = NULL; g_return_if_fail (NM_IS_MANAGER (self)); @@ -2840,7 +2842,23 @@ impl_manager_sleep (NMManager *self, return; } - if (!return_permission_denied_error (priv->authority, "Permission", context)) + if (!nm_auth_is_caller_root (context, priv->dbus_mgr, &is_root, &error_desc)) { + error = g_error_new_literal (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + error_desc); + dbus_g_method_return_error (context, error); + g_error_free (error); + return; + } + + /* Root doesn't need PK authentication */ + if (is_root) { + _internal_sleep (self, do_sleep); + dbus_g_method_return (context); + return; + } + + if (!return_no_pk_error (priv->authority, "Permission", context)) return; chain = nm_auth_chain_new (priv->authority, @@ -2943,7 +2961,9 @@ impl_manager_enable (NMManager *self, { NMManagerPrivate *priv; NMAuthChain *chain; - GError *error; + GError *error = NULL; + gboolean is_root = FALSE; + const char *error_desc = NULL; g_return_if_fail (NM_IS_MANAGER (self)); @@ -2958,7 +2978,23 @@ impl_manager_enable (NMManager *self, return; } - if (!return_permission_denied_error (priv->authority, "Permission", context)) + if (!nm_auth_is_caller_root (context, priv->dbus_mgr, &is_root, &error_desc)) { + error = g_error_new_literal (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + error_desc); + dbus_g_method_return_error (context, error); + g_error_free (error); + return; + } + + /* Root doesn't need PK authentication */ + if (is_root) { + _internal_enable (self, enable); + dbus_g_method_return (context); + return; + } + + if (!return_no_pk_error (priv->authority, "Permission", context)) return; chain = nm_auth_chain_new (priv->authority, -- cgit v1.2.1 From 12d26643e96197ee356c49d07d5f63598d1b2d36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 31 May 2010 15:32:13 +0200 Subject: libnm-util: add nm_utils_wifi_* functions to handle frequencies/channels --- libnm-util/Makefile.am | 2 +- libnm-util/libnm-util.ver | 4 + libnm-util/nm-setting-wireless.c | 32 ++---- libnm-util/nm-utils.c | 211 ++++++++++++++++++++++++++++++++++++++- libnm-util/nm-utils.h | 5 + src/nm-wifi-ap.c | 129 ++---------------------- src/nm-wifi-ap.h | 5 +- 7 files changed, 236 insertions(+), 152 deletions(-) diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am index ddc68408ab..3233d4067b 100644 --- a/libnm-util/Makefile.am +++ b/libnm-util/Makefile.am @@ -59,7 +59,7 @@ libnm_util_la_SOURCES= \ libnm_util_la_LIBADD = $(GLIB_LIBS) $(DBUS_LIBS) $(UUID_LIBS) libnm_util_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-util.ver \ - -version-info "4:4:3" + -version-info "5:0:4" if WITH_GNUTLS libnm_util_la_SOURCES += crypto_gnutls.c diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver index ed1d8a484f..2c4919c16c 100644 --- a/libnm-util/libnm-util.ver +++ b/libnm-util/libnm-util.ver @@ -365,6 +365,10 @@ global: nm_utils_ssid_to_utf8; nm_utils_uuid_generate; nm_utils_uuid_generate_from_string; + nm_utils_wifi_freq_to_channel; + nm_utils_wifi_channel_to_freq; + nm_utils_wifi_find_next_channel; + nm_utils_wifi_is_channel_valid; nm_ip4_address_compare; nm_ip4_address_dup; nm_ip4_address_get_address; diff --git a/libnm-util/nm-setting-wireless.c b/libnm-util/nm-setting-wireless.c index 9213429c84..44d010f7ac 100644 --- a/libnm-util/nm-setting-wireless.c +++ b/libnm-util/nm-setting-wireless.c @@ -19,7 +19,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2010 Red Hat, Inc. * (C) Copyright 2007 - 2008 Novell, Inc. */ @@ -480,31 +480,11 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) } if (priv->channel) { - if (!strcmp (priv->band, "a")) { - int i; - int valid_channels[] = { 7, 8, 9, 11, 12, 16, 34, 36, 40, 44, 48, - 52, 56, 60, 64, 100, 104, 108, 112, 116, - 120, 124, 128, 132, 136, 140, 149, 153, - 157, 161, 165, 183, 184, 185, 187, 188, - 192, 196, 0 }; - - for (i = 0; valid_channels[i]; i++) { - if (priv->channel == valid_channels[i]) - break; - } - - if (valid_channels[i] == 0) { - g_set_error (error, - NM_SETTING_WIRELESS_ERROR, - NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY, - NM_SETTING_WIRELESS_CHANNEL); - return FALSE; - } - } else if (!strcmp (priv->band, "bg") && priv->channel > 14) { - g_set_error (error, - NM_SETTING_WIRELESS_ERROR, - NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY, - NM_SETTING_WIRELESS_CHANNEL); + if (!nm_utils_wifi_is_channel_valid (priv->channel, priv->band)) { + g_set_error (error, + NM_SETTING_WIRELESS_ERROR, + NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_CHANNEL); return FALSE; } } diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c index ddb02a220e..7be41629bf 100644 --- a/libnm-util/nm-utils.c +++ b/libnm-util/nm-utils.c @@ -117,7 +117,7 @@ static const struct IsoLangToEncodings isoLangEntries2[] = /* Arabic */ { "ar", {"iso-8859-6", "windows-1256", NULL} }, - /* Balitc */ + /* Baltic */ { "et", {"iso-8859-4", "windows-1257", NULL} }, /* Estonian */ { "lt", {"iso-8859-4", "windows-1257", NULL} }, /* Lithuanian */ { "lv", {"iso-8859-4", "windows-1257", NULL} }, /* Latvian */ @@ -2102,3 +2102,212 @@ out: return ret; } +/* Band, channel/frequency stuff for wireless */ +struct cf_pair { + guint32 chan; + guint32 freq; +}; + +static struct cf_pair a_table[] = { + /* A band */ + { 7, 5035 }, + { 8, 5040 }, + { 9, 5045 }, + { 11, 5055 }, + { 12, 5060 }, + { 16, 5080 }, + { 34, 5170 }, + { 36, 5180 }, + { 38, 5190 }, + { 40, 5200 }, + { 42, 5210 }, + { 44, 5220 }, + { 46, 5230 }, + { 48, 5240 }, + { 50, 5250 }, + { 52, 5260 }, + { 56, 5280 }, + { 58, 5290 }, + { 60, 5300 }, + { 64, 5320 }, + { 100, 5500 }, + { 104, 5520 }, + { 108, 5540 }, + { 112, 5560 }, + { 116, 5580 }, + { 120, 5600 }, + { 124, 5620 }, + { 128, 5640 }, + { 132, 5660 }, + { 136, 5680 }, + { 140, 5700 }, + { 149, 5745 }, + { 152, 5760 }, + { 153, 5765 }, + { 157, 5785 }, + { 160, 5800 }, + { 161, 5805 }, + { 165, 5825 }, + { 183, 4915 }, + { 184, 4920 }, + { 185, 4925 }, + { 187, 4935 }, + { 188, 4945 }, + { 192, 4960 }, + { 196, 4980 }, + { 0, -1 } +}; + +static struct cf_pair bg_table[] = { + /* B/G band */ + { 1, 2412 }, + { 2, 2417 }, + { 3, 2422 }, + { 4, 2427 }, + { 5, 2432 }, + { 6, 2437 }, + { 7, 2442 }, + { 8, 2447 }, + { 9, 2452 }, + { 10, 2457 }, + { 11, 2462 }, + { 12, 2467 }, + { 13, 2472 }, + { 14, 2484 }, + { 0, -1 } +}; + +/** + * nm_utils_wifi_freq_to_channel: + * @freq: frequency + * + * Utility function to translate a WiFi frequency to its corresponding channel. + * + * Returns: the channel represented by the frequency or 0 + **/ +guint32 +nm_utils_wifi_freq_to_channel (guint32 freq) +{ + int i = 0; + + if (freq > 4900) { + while (a_table[i].chan && (a_table[i].freq != freq)) + i++; + return a_table[i].chan; + } else { + while (bg_table[i].chan && (bg_table[i].freq != freq)) + i++; + return bg_table[i].chan; + } + + return 0; +} + +/** + * nm_utils_wifi_channel_to_freq: + * @channel: channel + * @band: frequency band for wireless ("a" or "bg") + * + * Utility function to translate a WiFi channel to its corresponding frequency. + * + * Returns: the frequency represented by the channel of the band, + * or -1 when the freq is invalid, or 0 when the band + * is invalid + **/ +guint32 +nm_utils_wifi_channel_to_freq (guint32 channel, const char *band) +{ + int i = 0; + + if (!strcmp (band, "a")) { + while (a_table[i].chan && (a_table[i].chan != channel)) + i++; + return a_table[i].freq; + } else if (!strcmp (band, "bg")) { + while (bg_table[i].chan && (bg_table[i].chan != channel)) + i++; + return bg_table[i].freq; + } + + return 0; +} + +/** + * nm_utils_wifi_find_next_channel: + * @channel: current channel + * @direction: whether going downward (0 or less) or upward (1 or more) + * @band: frequency band for wireless ("a" or "bg") + * + * Utility function to find out next/previous WiFi channel for a channel. + * + * Returns: the next channel in the specified direction or 0 + **/ +guint32 +nm_utils_wifi_find_next_channel (guint32 channel, int direction, char *band) +{ + size_t a_size = sizeof (a_table) / sizeof (struct cf_pair); + size_t bg_size = sizeof (bg_table) / sizeof (struct cf_pair); + struct cf_pair *pair = NULL; + + if (!strcmp (band, "a")) { + if (channel < a_table[0].chan) + return a_table[0].chan; + if (channel > a_table[a_size - 2].chan) + return a_table[a_size - 2].chan; + pair = &a_table[0]; + } else if (!strcmp (band, "bg")) { + if (channel < bg_table[0].chan) + return bg_table[0].chan; + if (channel > bg_table[bg_size - 2].chan) + return bg_table[bg_size - 2].chan; + pair = &bg_table[0]; + } else { + g_assert_not_reached (); + return 0; + } + + while (pair->chan) { + if (channel == pair->chan) + return channel; + if ((channel < (pair+1)->chan) && (channel > pair->chan)) { + if (direction > 0) + return (pair+1)->chan; + else + return pair->chan; + } + pair++; + } + return 0; +} + +/** + * nm_utils_wifi_is_channel_valid: + * @channel: channel + * @band: frequency band for wireless ("a" or "bg") + * + * Utility function to verify WiFi channel validity. + * + * Returns: TRUE or FALSE + **/ +gboolean +nm_utils_wifi_is_channel_valid (guint32 channel, const char *band) +{ + struct cf_pair *table = NULL; + int i = 0; + + if (!strcmp (band, "a")) + table = a_table; + else if (!strcmp (band, "bg")) + table = bg_table; + else + return FALSE; + + while (table[i].chan && (table[i].chan != channel)) + i++; + + if (table[i].chan != 0) + return TRUE; + else + return FALSE; +} + diff --git a/libnm-util/nm-utils.h b/libnm-util/nm-utils.h index 68501d53fb..6be91793eb 100644 --- a/libnm-util/nm-utils.h +++ b/libnm-util/nm-utils.h @@ -215,4 +215,9 @@ GByteArray *nm_utils_rsa_key_encrypt (const GByteArray *data, G_END_DECLS +guint32 nm_utils_wifi_freq_to_channel (guint32 freq); +guint32 nm_utils_wifi_channel_to_freq (guint32 channel, const char *band); +guint32 nm_utils_wifi_find_next_channel (guint32 channel, int direction, char *band); +gboolean nm_utils_wifi_is_channel_valid (guint32 channel, const char *band); + #endif /* NM_UTILS_H */ diff --git a/src/nm-wifi-ap.c b/src/nm-wifi-ap.c index c7b5d8a51a..8a7e4e84d1 100644 --- a/src/nm-wifi-ap.c +++ b/src/nm-wifi-ap.c @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2004 - 2008 Red Hat, Inc. + * Copyright (C) 2004 - 2010 Red Hat, Inc. * Copyright (C) 2006 - 2008 Novell, Inc. */ @@ -604,7 +604,7 @@ nm_ap_new_fake_from_connection (NMConnection *connection) channel = nm_setting_wireless_get_channel (s_wireless); if (band && channel) { - guint32 freq = channel_to_freq (channel, band); + guint32 freq = nm_utils_wifi_channel_to_freq (channel, band); if (freq == 0) goto error; @@ -1256,21 +1256,21 @@ nm_ap_check_compatible (NMAccessPoint *self, channel = nm_setting_wireless_get_channel (s_wireless); if (channel) { - guint32 ap_chan = freq_to_channel (priv->freq); + guint32 ap_chan = nm_utils_wifi_freq_to_channel (priv->freq); if (channel != ap_chan) return FALSE; } s_wireless_sec = (NMSettingWirelessSecurity *) nm_connection_get_setting (connection, - NM_TYPE_SETTING_WIRELESS_SECURITY); + NM_TYPE_SETTING_WIRELESS_SECURITY); return nm_setting_wireless_ap_security_compatible (s_wireless, - s_wireless_sec, - nm_ap_get_flags (self), - nm_ap_get_wpa_flags (self), - nm_ap_get_rsn_flags (self), - nm_ap_get_mode (self)); + s_wireless_sec, + nm_ap_get_flags (self), + nm_ap_get_wpa_flags (self), + nm_ap_get_rsn_flags (self), + nm_ap_get_mode (self)); } static gboolean @@ -1364,114 +1364,3 @@ nm_ap_match_in_list (NMAccessPoint *find_ap, return NULL; } - -struct cf_pair { - guint32 chan; - guint32 freq; -}; - -static struct cf_pair a_table[] = { - /* A band */ - { 7, 5035 }, - { 8, 5040 }, - { 9, 5045 }, - { 11, 5055 }, - { 12, 5060 }, - { 16, 5080 }, - { 34, 5170 }, - { 36, 5180 }, - { 38, 5190 }, - { 40, 5200 }, - { 42, 5210 }, - { 44, 5220 }, - { 46, 5230 }, - { 48, 5240 }, - { 50, 5250 }, - { 52, 5260 }, - { 56, 5280 }, - { 58, 5290 }, - { 60, 5300 }, - { 64, 5320 }, - { 100, 5500 }, - { 104, 5520 }, - { 108, 5540 }, - { 112, 5560 }, - { 116, 5580 }, - { 120, 5600 }, - { 124, 5620 }, - { 128, 5640 }, - { 132, 5660 }, - { 136, 5680 }, - { 140, 5700 }, - { 149, 5745 }, - { 152, 5760 }, - { 153, 5765 }, - { 157, 5785 }, - { 160, 5800 }, - { 161, 5805 }, - { 165, 5825 }, - { 183, 4915 }, - { 184, 4920 }, - { 185, 4925 }, - { 187, 4935 }, - { 188, 4945 }, - { 192, 4960 }, - { 196, 4980 }, - { 0, -1 } -}; - -static struct cf_pair bg_table[] = { - /* B/G band */ - { 1, 2412 }, - { 2, 2417 }, - { 3, 2422 }, - { 4, 2427 }, - { 5, 2432 }, - { 6, 2437 }, - { 7, 2442 }, - { 8, 2447 }, - { 9, 2452 }, - { 10, 2457 }, - { 11, 2462 }, - { 12, 2467 }, - { 13, 2472 }, - { 14, 2484 }, - { 0, -1 } -}; - -guint32 -freq_to_channel (guint32 freq) -{ - int i = 0; - - if (freq > 4900) { - while (a_table[i].chan && (a_table[i].freq != freq)) - i++; - return a_table[i].chan; - } else { - while (bg_table[i].chan && (bg_table[i].freq != freq)) - i++; - return bg_table[i].chan; - } - - return 0; -} - -guint32 -channel_to_freq (guint32 channel, const char *band) -{ - int i = 0; - - if (!strcmp (band, "a")) { - while (a_table[i].chan && (a_table[i].chan != channel)) - i++; - return a_table[i].freq; - } else if (!strcmp (band, "bg")) { - while (bg_table[i].chan && (bg_table[i].chan != channel)) - i++; - return bg_table[i].freq; - } - - return 0; -} - diff --git a/src/nm-wifi-ap.h b/src/nm-wifi-ap.h index edc9e56bfb..86b785a316 100644 --- a/src/nm-wifi-ap.h +++ b/src/nm-wifi-ap.h @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2004 - 2008 Red Hat, Inc. + * Copyright (C) 2004 - 2010 Red Hat, Inc. * Copyright (C) 2006 - 2008 Novell, Inc. */ @@ -123,7 +123,4 @@ NMAccessPoint * nm_ap_match_in_list (NMAccessPoint *find_ap, void nm_ap_print_self (NMAccessPoint *ap, const char * prefix); -guint32 freq_to_channel (guint32 freq); -guint32 channel_to_freq (guint32 channel, const char *band); - #endif /* NM_ACCESS_POINT_H */ -- cgit v1.2.1 From 3b6917f74b75f09f5d28283768242cce9274a554 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 31 May 2010 09:45:26 -0700 Subject: core: make nm_auth_is_caller_root() more generic --- src/nm-manager-auth.c | 23 ++++++++++------------- src/nm-manager-auth.h | 4 ++-- src/nm-manager.c | 52 ++++++++++++++++----------------------------------- 3 files changed, 28 insertions(+), 51 deletions(-) diff --git a/src/nm-manager-auth.c b/src/nm-manager-auth.c index 8d9d83271f..7d6bcddf77 100644 --- a/src/nm-manager-auth.c +++ b/src/nm-manager-auth.c @@ -267,22 +267,21 @@ nm_auth_chain_unref (NMAuthChain *self) /************ utils **************/ gboolean -nm_auth_is_caller_root (DBusGMethodInvocation *context, +nm_auth_get_caller_uid (DBusGMethodInvocation *context, NMDBusManager *dbus_mgr, - gboolean *out_is_root, + gulong *out_uid, const char **out_error_desc) { DBusConnection *connection; char *sender = NULL; - gulong sender_uid = G_MAXULONG; gboolean success = FALSE; DBusError dbus_error; g_return_val_if_fail (context != NULL, FALSE); g_return_val_if_fail (dbus_mgr != NULL, FALSE); - g_return_val_if_fail (out_is_root != NULL, FALSE); + g_return_val_if_fail (out_uid != NULL, FALSE); - *out_is_root = FALSE; + *out_uid = G_MAXULONG; sender = dbus_g_method_get_sender (context); if (!sender) { @@ -300,19 +299,17 @@ nm_auth_is_caller_root (DBusGMethodInvocation *context, dbus_error_init (&dbus_error); /* FIXME: do this async */ - sender_uid = dbus_bus_get_unix_user (connection, sender, &dbus_error); + *out_uid = dbus_bus_get_unix_user (connection, sender, &dbus_error); if (dbus_error_is_set (&dbus_error)) { if (out_error_desc) - *out_error_desc = "Could not determine the Unix user ID of the requestor"; + *out_error_desc = "Could not determine the user ID of the requestor"; dbus_error_free (&dbus_error); - goto out; - } - - success = TRUE; - if (0 == sender_uid) - *out_is_root = TRUE; + *out_uid = G_MAXULONG; + } else + success = TRUE; out: + g_free (sender); return success; } diff --git a/src/nm-manager-auth.h b/src/nm-manager-auth.h index 433f10fea7..ba27b474b9 100644 --- a/src/nm-manager-auth.h +++ b/src/nm-manager-auth.h @@ -74,9 +74,9 @@ gboolean nm_auth_chain_add_call (NMAuthChain *chain, void nm_auth_chain_unref (NMAuthChain *chain); /* Utils */ -gboolean nm_auth_is_caller_root (DBusGMethodInvocation *context, +gboolean nm_auth_get_caller_uid (DBusGMethodInvocation *context, NMDBusManager *dbus_mgr, - gboolean *out_is_root, + gulong *out_uid, const char **out_error_desc); #endif /* NM_MANAGER_AUTH_H */ diff --git a/src/nm-manager.c b/src/nm-manager.c index 171ea26259..da17ef04d1 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -2430,13 +2430,13 @@ is_user_request_authorized (NMManager *manager, { NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); DBusConnection *connection; - char *sender = NULL; gulong sender_uid = G_MAXULONG; DBusError dbus_error; char *service_owner = NULL; const char *service_name; gulong service_uid = G_MAXULONG; gboolean success = FALSE; + const char *error_desc = NULL; /* Ensure the request to activate the user connection came from the * same session as the user settings service. FIXME: use ConsoleKit @@ -2449,36 +2449,15 @@ is_user_request_authorized (NMManager *manager, goto out; } - sender = dbus_g_method_get_sender (context); - if (!sender) { - g_set_error (error, NM_MANAGER_ERROR, - NM_MANAGER_ERROR_PERMISSION_DENIED, - "%s", "Could not determine D-Bus requestor"); - goto out; - } - - connection = nm_dbus_manager_get_dbus_connection (priv->dbus_mgr); - if (!connection) { - g_set_error (error, NM_MANAGER_ERROR, - NM_MANAGER_ERROR_PERMISSION_DENIED, - "%s", "Could not get the D-Bus system bus"); - goto out; - } - - dbus_error_init (&dbus_error); - /* FIXME: do this async */ - sender_uid = dbus_bus_get_unix_user (connection, sender, &dbus_error); - if (dbus_error_is_set (&dbus_error)) { - dbus_error_free (&dbus_error); - g_set_error (error, NM_MANAGER_ERROR, - NM_MANAGER_ERROR_PERMISSION_DENIED, - "%s", "Could not determine the Unix user ID of the requestor"); + if (!nm_auth_get_caller_uid (context, priv->dbus_mgr, &sender_uid, &error_desc)) { + g_set_error_literal (error, + NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + error_desc); goto out; } - /* Let root activate anything. - * FIXME: use a PolicyKit permission instead - */ + /* Let root activate anything */ if (0 == sender_uid) { success = TRUE; goto out; @@ -2489,8 +2468,8 @@ is_user_request_authorized (NMManager *manager, g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_PERMISSION_DENIED, "%s", "Could not determine user settings service name"); - goto out; } + goto out; service_owner = nm_dbus_manager_get_name_owner (priv->dbus_mgr, service_name, NULL); if (!service_owner) { @@ -2522,11 +2501,12 @@ is_user_request_authorized (NMManager *manager, success = TRUE; out: - g_free (sender); g_free (service_owner); return success; } + + static void impl_manager_activate_connection (NMManager *manager, const char *service_name, @@ -2826,7 +2806,7 @@ impl_manager_sleep (NMManager *self, NMManagerPrivate *priv; NMAuthChain *chain; GError *error = NULL; - gboolean is_root = FALSE; + gulong sender_uid = G_MAXULONG; const char *error_desc = NULL; g_return_if_fail (NM_IS_MANAGER (self)); @@ -2842,7 +2822,7 @@ impl_manager_sleep (NMManager *self, return; } - if (!nm_auth_is_caller_root (context, priv->dbus_mgr, &is_root, &error_desc)) { + if (!nm_auth_get_caller_uid (context, priv->dbus_mgr, &sender_uid, &error_desc)) { error = g_error_new_literal (NM_MANAGER_ERROR, NM_MANAGER_ERROR_PERMISSION_DENIED, error_desc); @@ -2852,7 +2832,7 @@ impl_manager_sleep (NMManager *self, } /* Root doesn't need PK authentication */ - if (is_root) { + if (0 == sender_uid) { _internal_sleep (self, do_sleep); dbus_g_method_return (context); return; @@ -2962,7 +2942,7 @@ impl_manager_enable (NMManager *self, NMManagerPrivate *priv; NMAuthChain *chain; GError *error = NULL; - gboolean is_root = FALSE; + gulong sender_uid = G_MAXULONG; const char *error_desc = NULL; g_return_if_fail (NM_IS_MANAGER (self)); @@ -2978,7 +2958,7 @@ impl_manager_enable (NMManager *self, return; } - if (!nm_auth_is_caller_root (context, priv->dbus_mgr, &is_root, &error_desc)) { + if (!nm_auth_get_caller_uid (context, priv->dbus_mgr, &sender_uid, &error_desc)) { error = g_error_new_literal (NM_MANAGER_ERROR, NM_MANAGER_ERROR_PERMISSION_DENIED, error_desc); @@ -2988,7 +2968,7 @@ impl_manager_enable (NMManager *self, } /* Root doesn't need PK authentication */ - if (is_root) { + if (0 == sender_uid) { _internal_enable (self, enable); dbus_g_method_return (context); return; -- cgit v1.2.1 From c4946a6dfee0b5d1f0a84e1a341108e96d020446 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 31 May 2010 16:47:38 -0700 Subject: core: fix some problems with the user auth rework --- src/nm-manager.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index da17ef04d1..aaf1409639 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -2468,8 +2468,8 @@ is_user_request_authorized (NMManager *manager, g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_PERMISSION_DENIED, "%s", "Could not determine user settings service name"); - } goto out; + } service_owner = nm_dbus_manager_get_name_owner (priv->dbus_mgr, service_name, NULL); if (!service_owner) { @@ -2479,6 +2479,15 @@ is_user_request_authorized (NMManager *manager, goto out; } + connection = nm_dbus_manager_get_dbus_connection (priv->dbus_mgr); + if (!connection) { + g_set_error_literal (error, + NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + "Could not get the D-Bus system bus"); + goto out; + } + dbus_error_init (&dbus_error); /* FIXME: do this async */ service_uid = dbus_bus_get_unix_user (connection, service_owner, &dbus_error); @@ -2495,10 +2504,8 @@ is_user_request_authorized (NMManager *manager, g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_PERMISSION_DENIED, "%s", "Requestor UID does not match the UID of the user settings service"); - goto out; - } - - success = TRUE; + } else + success = TRUE; out: g_free (service_owner); -- cgit v1.2.1 From a3d8cb9b6de42ddaa80868b6f41ad908741e2415 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 1 Jun 2010 00:36:46 -0700 Subject: core: rework pending activation to be more flexible In preparation for more granular permissions. --- src/nm-manager.c | 198 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 128 insertions(+), 70 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index aaf1409639..ecd25f3612 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -150,13 +150,17 @@ static NMDevice *nm_manager_get_device_by_udi (NMManager *manager, const char *u #define ORIGDEV_TAG "originating-device" typedef struct { - DBusGMethodInvocation *context; + NMManager *manager; + + /* More than one caller may have requested this connection */ + GSList *contexts; + NMConnectionScope scope; char *connection_path; char *specific_object_path; char *device_path; guint timeout_id; -} PendingConnectionInfo; +} PendingActivation; typedef struct { gboolean enabled; @@ -189,7 +193,7 @@ typedef struct { GSList *secrets_calls; - PendingConnectionInfo *pending_connection_info; + GSList *pending_activations; RadioState radio_states[RFKILL_TYPE_MAX]; gboolean sleeping; @@ -573,19 +577,73 @@ emit_removed (gpointer key, gpointer value, gpointer user_data) } static void -pending_connection_info_destroy (PendingConnectionInfo *info) +nm_manager_pending_activation_remove (NMManager *self, + PendingActivation *pending) { - if (!info) - return; + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); - if (info->timeout_id) - g_source_remove (info->timeout_id); + priv->pending_activations = g_slist_remove (priv->pending_activations, pending); +} - g_free (info->connection_path); - g_free (info->specific_object_path); - g_free (info->device_path); +static PendingActivation * +pending_activation_new (NMManager *manager, + const char *device_path, + NMConnectionScope scope, + const char *connection_path, + const char *specific_object_path) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + PendingActivation *pending; + + pending = g_slice_new0 (PendingActivation); + pending->manager = manager; + pending->device_path = g_strdup (device_path); + pending->scope = scope; + pending->connection_path = g_strdup (connection_path); + pending->specific_object_path = g_strdup (specific_object_path); - g_slice_free (PendingConnectionInfo, info); + priv->pending_activations = g_slist_append (priv->pending_activations, pending); + + return pending; +} + +static void +pending_activation_add_caller (PendingActivation *pending, + DBusGMethodInvocation *context) +{ + /* Ensure no dupes */ + if (!g_slist_find (pending->contexts, context)) + pending->contexts = g_slist_prepend (pending->contexts, context); +} + +static void +pending_activation_destroy (PendingActivation *pending, + GError *error, + const char *ac_path) +{ + GSList *iter; + + g_return_if_fail (pending != NULL); + + if (pending->timeout_id) + g_source_remove (pending->timeout_id); + g_free (pending->connection_path); + g_free (pending->specific_object_path); + g_free (pending->device_path); + + /* Send a reply (either error or the ActiveConnection path) if needed */ + for (iter = pending->contexts; iter; iter = g_slist_next (iter)) { + DBusGMethodInvocation *context = iter->data; + + if (error) + dbus_g_method_return_error (context, error); + else if (ac_path) + dbus_g_method_return (context, ac_path); + } + g_slist_free (pending->contexts); + + memset (pending, 0, sizeof (PendingActivation)); + g_slice_free (PendingActivation, pending); } static GPtrArray * @@ -2253,25 +2311,21 @@ internal_activate_device (NMManager *manager, static gboolean wait_for_connection_expired (gpointer data) { - NMManager *manager = NM_MANAGER (data); - NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); - PendingConnectionInfo *info = priv->pending_connection_info; + PendingActivation *pending = data; GError *error = NULL; - g_return_val_if_fail (info != NULL, FALSE); + g_return_val_if_fail (pending != NULL, FALSE); - g_set_error (&error, - NM_MANAGER_ERROR, NM_MANAGER_ERROR_UNKNOWN_CONNECTION, - "%s", "Connection was not provided by any settings service"); - nm_log_warn (LOGD_CORE, "connection (%d) %s failed to activate (timeout): (%d) %s", - info->scope, info->connection_path, error->code, error->message); - dbus_g_method_return_error (info->context, error); - g_error_free (error); + nm_log_warn (LOGD_CORE, "connection %s (scope %d) failed to activate (timeout)", + pending->scope, pending->connection_path); - info->timeout_id = 0; - pending_connection_info_destroy (priv->pending_connection_info); - priv->pending_connection_info = NULL; + nm_manager_pending_activation_remove (pending->manager, pending); + error = g_error_new_literal (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_UNKNOWN_CONNECTION, + "Connection was not provided by any settings service"); + pending_activation_destroy (pending, error, NULL); + g_error_free (error); return FALSE; } @@ -2382,45 +2436,55 @@ nm_manager_activate_connection (NMManager *manager, return path; } +static PendingActivation * +nm_manager_pending_activation_find (NMManager *self, + const char *path, + NMConnectionScope scope) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + GSList *iter; + + for (iter = priv->pending_activations; iter; iter = g_slist_next (iter)) { + PendingActivation *pending = iter->data; + + if (!strcmp (pending->connection_path, path) && (pending->scope == scope)) + return pending; + } + return NULL; +} + static void connection_added_default_handler (NMManager *manager, - NMConnection *connection, - NMConnectionScope scope) + NMConnection *connection, + NMConnectionScope scope) { - NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); - PendingConnectionInfo *info = priv->pending_connection_info; - const char *path; + PendingActivation *pending; + const char *path = NULL; GError *error = NULL; - if (!info) - return; - - if (scope != info->scope) - return; - - if (strcmp (info->connection_path, nm_connection_get_path (connection))) + pending = nm_manager_pending_activation_find (manager, + nm_connection_get_path (connection), + scope); + if (!pending) return; /* Will destroy below; can't be valid during the initial activation start */ - priv->pending_connection_info = NULL; + nm_manager_pending_activation_remove (manager, pending); path = nm_manager_activate_connection (manager, connection, - info->specific_object_path, - info->device_path, + pending->specific_object_path, + pending->device_path, TRUE, &error); - if (path) { - dbus_g_method_return (info->context, path); - g_object_notify (G_OBJECT (manager), NM_MANAGER_ACTIVE_CONNECTIONS); - } else { - dbus_g_method_return_error (info->context, error); + if (!path) { nm_log_warn (LOGD_CORE, "connection (%d) %s failed to activate: (%d) %s", - scope, info->connection_path, error->code, error->message); - g_error_free (error); - } + scope, pending->connection_path, error->code, error->message); + } else + g_object_notify (G_OBJECT (manager), NM_MANAGER_ACTIVE_CONNECTIONS); - pending_connection_info_destroy (info); + pending_activation_destroy (pending, error, path); + g_clear_error (&error); } static gboolean @@ -2559,28 +2623,19 @@ impl_manager_activate_connection (NMManager *manager, g_object_notify (G_OBJECT (manager), NM_MANAGER_ACTIVE_CONNECTIONS); } } else { - PendingConnectionInfo *info; - NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); - - if (priv->pending_connection_info) { - pending_connection_info_destroy (priv->pending_connection_info); - priv->pending_connection_info = NULL; - } + PendingActivation *pending; /* Don't have the connection quite yet, probably created by - * the client on-the-fly. Defer the activation until we have it + * the client on-the-fly. Defer the activation until we have it. */ - info = g_slice_new0 (PendingConnectionInfo); - info->context = context; - info->device_path = g_strdup (device_path); - info->scope = scope; - info->connection_path = g_strdup (connection_path); - info->specific_object_path = g_strdup (real_sop); - info->timeout_id = g_timeout_add_seconds (5, wait_for_connection_expired, manager); - - // FIXME: should probably be per-device, not global to the manager - NM_MANAGER_GET_PRIVATE (manager)->pending_connection_info = info; + pending = nm_manager_pending_activation_find (manager, connection_path, scope); + if (!pending) { + pending = pending_activation_new (manager, device_path, scope, connection_path, real_sop); + /* Add a timeout waiting for the connection to be added */ + pending->timeout_id = g_timeout_add_seconds (5, wait_for_connection_expired, pending); + } + pending_activation_add_caller (pending, context); } err: @@ -3373,6 +3428,7 @@ dispose (GObject *object) { NMManager *manager = NM_MANAGER (object); NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + GSList *iter; if (priv->disposed) { G_OBJECT_CLASS (nm_manager_parent_class)->dispose (object); @@ -3380,8 +3436,10 @@ dispose (GObject *object) } priv->disposed = TRUE; - pending_connection_info_destroy (priv->pending_connection_info); - priv->pending_connection_info = NULL; + for (iter = priv->pending_activations; iter; iter = g_slist_next (iter)) + pending_activation_destroy ((PendingActivation *) iter->data, NULL, NULL); + g_slist_free (priv->pending_activations); + priv->pending_activations = NULL; g_slist_foreach (priv->auth_chains, (GFunc) nm_auth_chain_unref, NULL); g_slist_free (priv->auth_chains); -- cgit v1.2.1 From a3e3405fff3ba4c570d95dbb97455077221b3f4f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 1 Jun 2010 00:39:01 -0700 Subject: po: updated German translation (bgo #620122) --- po/de.po | 1492 ++++++++++++++++++++++++++------------------------------------ 1 file changed, 618 insertions(+), 874 deletions(-) diff --git a/po/de.po b/po/de.po index ad8f810f56..ef04aae232 100644 --- a/po/de.po +++ b/po/de.po @@ -1,4 +1,6 @@ -# translation of de.po to +# German translation of NetworkManager. +# Copyright (C) 2005 Dan Williams +# This file is distributed under the same license as the NetworkManager package. # Hendrik Brandt , 2004, 2005. # Frank Arnold , 2005. # Hendrik Richter , 2006. @@ -6,94 +8,23 @@ # Andre Klapper , 2007. # Hauke Mehrtens , 2008. # Christian Kirbach , 2009, 2010. -# Timo Trinks , 2010. -# German translation of NetworkManager. -# Copyright (C) 2005 Dan Williams -# This file is distributed under the same license as the NetworkManager package. +# Daniel Schury , 2010. +# msgid "" msgstr "" -"Project-Id-Version: de\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-05-06 14:31+0530\n" -"PO-Revision-Date: 2010-05-07 10:49+1000\n" -"Last-Translator: Timo Trinks \n" -"Language-Team: \n" +"Project-Id-Version: NetworkManager HEAD\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-04-30 03:24+0000\n" +"PO-Revision-Date: 2010-05-15 11:50+0200\n" +"Last-Translator: Daniel Schury \n" +"Language-Team: Deutsch \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"X-Generator: KBabel 1.11.4\n" -#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 -#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 -#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 -#: ../cli/src/devices.c:152 -msgid "NAME" -msgstr "NAME" - -#. 0 -#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 -msgid "UUID" -msgstr "UUID" - -#. 1 -#: ../cli/src/connections.c:61 -msgid "DEVICES" -msgstr "GERÄTE" - -#. 2 -#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 -msgid "SCOPE" -msgstr "BANDBREITE" - -#. 3 -#: ../cli/src/connections.c:63 -msgid "DEFAULT" -msgstr "VORGABE" - -#. 4 -#: ../cli/src/connections.c:64 -msgid "DBUS-SERVICE" -msgstr "DBUS-DIENST" - -#. 5 -#: ../cli/src/connections.c:65 -msgid "SPEC-OBJECT" -msgstr "SPEC-OBJEKT" - -#. 6 -#: ../cli/src/connections.c:66 -msgid "VPN" -msgstr "VPN" - -#. 1 -#. 0 -#. 1 -#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 -msgid "TYPE" -msgstr "TYP" - -#. 3 -#: ../cli/src/connections.c:78 -msgid "TIMESTAMP" -msgstr "ZEITSTEMPEL" - -#. 4 -#: ../cli/src/connections.c:79 -msgid "TIMESTAMP-REAL" -msgstr "ZEITSTEMPEL-REAL" - -#. 5 -#: ../cli/src/connections.c:80 -msgid "AUTOCONNECT" -msgstr "AUTOCONNECT" - -#. 6 -#: ../cli/src/connections.c:81 -msgid "READONLY" -msgstr "NURLESEN" - -#: ../cli/src/connections.c:157 +#: ../cli/src/connections.c:86 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -114,516 +45,312 @@ msgstr "" "]\n" " down id | uuid \n" -#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 -#, c-format -msgid "Error: 'con list': %s" -msgstr "Fehler: 'con list': %s" - -#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 -#, c-format -msgid "Error: 'con list': %s; allowed fields: %s" -msgstr "Fehler: 'con list': %s; erlaubte Felder: %s" - -#: ../cli/src/connections.c:207 -msgid "Connection details" -msgstr "Verbindungsdetails" - -#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 -msgid "system" -msgstr "System" - -#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 -msgid "user" -msgstr "Benutzer" - -#: ../cli/src/connections.c:383 -msgid "never" -msgstr "nie" - -#. "CAPABILITIES" -#. Print header -#. "WIFI-PROPERTIES" -#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 -#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 -#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 -#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 -#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 -#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 -#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 -#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 -#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 -#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 -#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 -#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 -#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 -#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 -#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 -#: ../cli/src/settings.c:1210 -msgid "yes" -msgstr "ja" +#: ../cli/src/connections.c:158 +msgid "Connections" +msgstr "Verbindungen" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/devices.c:298 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Type" +msgstr "Typ" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "UUID" +msgstr "UUID" -#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 -#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 -#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 -#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 -#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 -#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 -#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 -#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 -#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 -#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 -#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 -#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 -#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 -#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 -#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 -#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 -msgid "no" -msgstr "nein" +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Name" +msgstr "Name" -#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 -msgid "System connections" -msgstr "System-Verbindungen" +#: ../cli/src/connections.c:163 +#, c-format +msgid "System connections:\n" +msgstr "Systemverbindungen:\n" -#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 -msgid "User connections" -msgstr "Benutzer-Verbindungen" +#: ../cli/src/connections.c:167 +#, c-format +msgid "User connections:\n" +msgstr "Benutzerverbindungen:\n" -#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 -#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 -#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 -#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 -#: ../cli/src/devices.c:980 +#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 +#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 +#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 +#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 +#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 #, c-format msgid "Error: %s argument is missing." -msgstr "Fehler: %s Argument fehlt." +msgstr "Fehler: Argument %s fehlt." -#: ../cli/src/connections.c:487 +#: ../cli/src/connections.c:189 #, c-format msgid "Error: %s - no such connection." -msgstr "Fehler: %s - keine solche Verbindung." +msgstr "Fehler: Verbindung %s existiert nicht." + +#: ../cli/src/connections.c:196 +msgid "System-wide connections" +msgstr "Systemweite Verbindungen" -#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 -#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 -#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#: ../cli/src/connections.c:205 +msgid "User connections" +msgstr "Benutzerverbindungen" + +#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 +#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 +#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 +#: ../cli/src/devices.c:798 #, c-format msgid "Unknown parameter: %s\n" msgstr "Unbekannter Parameter: %s\n" -#: ../cli/src/connections.c:528 +#: ../cli/src/connections.c:221 #, c-format msgid "Error: no valid parameter specified." -msgstr "Fehler: Kein gültiger Parameter angegeben." - -#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 -#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 -#, c-format -msgid "Error: %s." -msgstr "Fehler: %s." +msgstr "Fehler: Es wurde kein gültiger Parameter angegeben." -#: ../cli/src/connections.c:649 -#, c-format -msgid "Error: 'con status': %s" -msgstr "Fehler: 'con status': %s" +#. FIXME: Fix the output +#: ../cli/src/connections.c:268 ../cli/src/devices.c:302 +#: ../cli/src/devices.c:321 ../cli/src/devices.c:353 ../cli/src/devices.c:355 +#: ../cli/src/devices.c:357 ../cli/src/devices.c:359 ../cli/src/devices.c:361 +msgid "yes" +msgstr "ja" -#: ../cli/src/connections.c:651 -#, c-format -msgid "Error: 'con status': %s; allowed fields: %s" -msgstr "Fehler: 'con status': %s; erlaubte Felder: %s" +#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 +msgid "no" +msgstr "nein" -#: ../cli/src/connections.c:658 +#: ../cli/src/connections.c:297 msgid "Active connections" msgstr "Aktive Verbindungen" -#: ../cli/src/connections.c:1026 -#, c-format -msgid "no active connection on device '%s'" -msgstr "keine aktive Verbindung auf Gerät '%s'" +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 +msgid "Default" +msgstr "Vorgabe" -#: ../cli/src/connections.c:1034 -#, c-format -msgid "no active connection or device" -msgstr "keine aktive Verbindung auf Gerät" +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Service" +msgstr "Dienst" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Devices" +msgstr "Geräte" -#: ../cli/src/connections.c:1084 +#: ../cli/src/connections.c:659 #, c-format -msgid "device '%s' not compatible with connection '%s'" -msgstr "Gerät '%s' nicht mit Verbindung '%s' kompatibel" +msgid "no active connection on device '%s'" +msgstr "Keine aktive Verbindung auf Gerät »%s«" -#: ../cli/src/connections.c:1086 +#: ../cli/src/connections.c:667 #, c-format -msgid "no device found for connection '%s'" -msgstr "kein Gerät für Verbindung '%s' gefunden" +msgid "no active connection or device" +msgstr "Keine aktive Verbindung oder Gerät" -#: ../cli/src/connections.c:1097 +#: ../cli/src/connections.c:730 msgid "activating" msgstr "wird aktiviert" -#: ../cli/src/connections.c:1099 +#: ../cli/src/connections.c:732 msgid "activated" msgstr "aktiviert" -#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 -#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 -#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 -#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 +#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 +#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 msgid "unknown" msgstr "unbekannt" -#: ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:744 msgid "VPN connecting (prepare)" -msgstr "VPN wird verbunden (vorbereiten)" +msgstr "VPN wird verbunden (wird vorbereitet)" -#: ../cli/src/connections.c:1113 +#: ../cli/src/connections.c:746 msgid "VPN connecting (need authentication)" -msgstr "VPN wird verbunden (Authentifizierung erforderlich)" +msgstr "VPN wird verbunden (Legitimierung wird benötigt)" -#: ../cli/src/connections.c:1115 +#: ../cli/src/connections.c:748 msgid "VPN connecting" msgstr "VPN wird verbunden" -#: ../cli/src/connections.c:1117 +#: ../cli/src/connections.c:750 msgid "VPN connecting (getting IP configuration)" -msgstr "VPN wird verbunden (IP-Konfiguration wird ermittelt)" +msgstr "VPN wird verbunden (IP-Einstellungen werden ermittelt)" -#: ../cli/src/connections.c:1119 +#: ../cli/src/connections.c:752 msgid "VPN connected" msgstr "VPN verbunden" -#: ../cli/src/connections.c:1121 +#: ../cli/src/connections.c:754 msgid "VPN connection failed" -msgstr "VPN-Verbindung fehlgeschlagen" +msgstr "VPN-Verbindung gescheitert" -#: ../cli/src/connections.c:1123 +#: ../cli/src/connections.c:756 msgid "VPN disconnected" msgstr "VPN getrennt" -#: ../cli/src/connections.c:1134 +#: ../cli/src/connections.c:767 msgid "unknown reason" msgstr "unbekannter Grund" -#: ../cli/src/connections.c:1136 +#: ../cli/src/connections.c:769 msgid "none" msgstr "kein" -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:771 msgid "the user was disconnected" -msgstr "der Benutzer wurde getrennt" +msgstr "Der Benutzer wurde getrennt" -#: ../cli/src/connections.c:1140 +#: ../cli/src/connections.c:773 msgid "the base network connection was interrupted" -msgstr "die Basisverbindung wurde unterbrochen" +msgstr "Die Basisverbindung wurde unterbrochen" -#: ../cli/src/connections.c:1142 +#: ../cli/src/connections.c:775 msgid "the VPN service stopped unexpectedly" -msgstr "der VPN-Dienst brach unerwartet ab" +msgstr "Der VPN-Dienst wurde unerwartet gestoppt" -#: ../cli/src/connections.c:1144 +#: ../cli/src/connections.c:777 msgid "the VPN service returned invalid configuration" -msgstr "der VPN-Dienst gab eine ungültige Konfiguration zurück" +msgstr "Der VPN-Dienst gab ungültige Einstellungen zurück" -#: ../cli/src/connections.c:1146 +#: ../cli/src/connections.c:779 msgid "the connection attempt timed out" -msgstr "Der Verbindungsversuch ist zeitlich abgelaufen" +msgstr "Der Verbindungsversuch benötigte zu viel Zeit" -#: ../cli/src/connections.c:1148 +#: ../cli/src/connections.c:781 msgid "the VPN service did not start in time" -msgstr "der VPN-Dienst ist nicht rechtzeitig gestartet" +msgstr "Der VPN-Dienst wurde nicht rechtzeitig gestartet" -#: ../cli/src/connections.c:1150 +#: ../cli/src/connections.c:783 msgid "the VPN service failed to start" -msgstr "der VPN-Dienst konnte nicht starten" +msgstr "Der VPN-Dienst konnte nicht gestartet werden" -#: ../cli/src/connections.c:1152 +#: ../cli/src/connections.c:785 msgid "no valid VPN secrets" -msgstr "keine gültigen VPN-Geheimnisse" +msgstr "Keine gültigen VPN-Schlüssel" -#: ../cli/src/connections.c:1154 +#: ../cli/src/connections.c:787 msgid "invalid VPN secrets" -msgstr "ungültige VPN-Geheimnisse" +msgstr "Ungültige VPN-Schlüssel" -#: ../cli/src/connections.c:1156 +#: ../cli/src/connections.c:789 msgid "the connection was removed" msgstr "Die Verbindung wurde entfernt" -#: ../cli/src/connections.c:1170 +#: ../cli/src/connections.c:803 #, c-format msgid "state: %s\n" msgstr "Status: %s\n" -#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 #, c-format msgid "Connection activated\n" msgstr "Verbindung aktiviert\n" -#: ../cli/src/connections.c:1176 +#: ../cli/src/connections.c:809 #, c-format msgid "Error: Connection activation failed." -msgstr "Fehler: Aktivierung der Verbindung fehlgeschlagen." +msgstr "Fehler: Aktivierung der Verbindung ist gescheitert." -#: ../cli/src/connections.c:1195 +#: ../cli/src/connections.c:828 #, c-format msgid "state: %s (%d)\n" msgstr "Status: %s (%d)\n" -#: ../cli/src/connections.c:1205 +#: ../cli/src/connections.c:838 #, c-format msgid "Error: Connection activation failed: %s." -msgstr "Fehler: Aktivierung der Verbindung fehlgeschlagen: %s." +msgstr "Fehler: Aktivierung der Verbindung ist gescheitert: %s." -#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 #, c-format msgid "Error: Timeout %d sec expired." -msgstr "Fehler: Zeitbeschränkung von %d Sekunden abgelaufen." +msgstr "Fehler: Zeitbeschränkung von %d Sekunden ist abgelaufen." -#: ../cli/src/connections.c:1265 +#: ../cli/src/connections.c:898 #, c-format msgid "Error: Connection activation failed: %s" -msgstr "Fehler: Aktivierung der Verbindung fehlgeschlagen: %s" +msgstr "Fehler: Aktivierung der Verbindung ist gescheitert: %s" -#: ../cli/src/connections.c:1279 +#: ../cli/src/connections.c:912 #, c-format msgid "Error: Obtaining active connection for '%s' failed." -msgstr "Fehler: Erlangen der Verbindung für '%s' ist fehlgeschlagen." +msgstr "Fehler: Ermittlung der aktiven Verbindung für »%s« ist gescheitert." -#: ../cli/src/connections.c:1288 +#: ../cli/src/connections.c:921 #, c-format msgid "Active connection state: %s\n" msgstr "Status der aktiven Verbindung: %s\n" -#: ../cli/src/connections.c:1289 +#: ../cli/src/connections.c:922 #, c-format msgid "Active connection path: %s\n" msgstr "Pfad der aktiven Verbindung: %s\n" -#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 #, c-format msgid "Error: Unknown connection: %s." msgstr "Fehler: Unbekannte Verbindung: %s." -#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 #, c-format msgid "Error: timeout value '%s' is not valid." -msgstr "Fehler: Der Wert '%s' für den Zeitablauf ist nicht gültig." +msgstr "Fehler: Der Wert »%s« ist keine gültige Zeitangabe." -#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 #, c-format msgid "Error: id or uuid has to be specified." -msgstr "Fehler: id oder uuid muss angegeben werden." +msgstr "Fehler: id oder uuid müssen angegeben werden." -#: ../cli/src/connections.c:1411 +#: ../cli/src/connections.c:1044 #, c-format msgid "Error: No suitable device found: %s." -msgstr "Fehler: Kein passendes Gerät gefunden: %s." +msgstr "Fehler: Es wurde kein passendes Gerät gefunden: %s." -#: ../cli/src/connections.c:1413 +#: ../cli/src/connections.c:1046 #, c-format msgid "Error: No suitable device found." -msgstr "Fehler: Kein passendes Gerät gefunden." +msgstr "Fehler: Es wurde kein passendes Gerät gefunden." -#: ../cli/src/connections.c:1505 +#: ../cli/src/connections.c:1138 #, c-format msgid "Warning: Connection not active\n" -msgstr "Warnung: Verbindung ist derzeit nicht aktiv\n" +msgstr "Warnung: Verbindung ist nicht aktiv\n" -#: ../cli/src/connections.c:1561 +#: ../cli/src/connections.c:1189 #, c-format msgid "Error: 'con' command '%s' is not valid." -msgstr "Fehler: Der Befehl '%s' für 'con' ist nicht gültig." +msgstr "Fehler: Der »con«-Befehl »%s« ist ungültig." -#: ../cli/src/connections.c:1597 +#: ../cli/src/connections.c:1216 #, c-format msgid "Error: could not connect to D-Bus." -msgstr "Fehler: Es konnte nicht mit D-Bus verbunden werden." +msgstr "Fehler: Verbindung zu D-Bus konnte nicht hergestellt werden." -#: ../cli/src/connections.c:1604 +#: ../cli/src/connections.c:1223 #, c-format msgid "Error: Could not get system settings." -msgstr "Fehler: Systemeinstellungen konnten nicht ermittelt werden" +msgstr "Fehler: Systemeinstellungen konnten nicht ermittelt werden." -#: ../cli/src/connections.c:1612 +#: ../cli/src/connections.c:1231 #, c-format msgid "Error: Could not get user settings." msgstr "Fehler: Benutzereinstellungen konnten nicht ermittelt werden." -#: ../cli/src/connections.c:1622 +#: ../cli/src/connections.c:1241 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "" -"Fehler: Verbindungen können nicht erlangt werden: Die Einstellungsdienste " +"Fehler: Verbindungen konnten nicht ermittelt werden: Die Einstellungsdienste " "werden nicht ausgeführt." -#. 0 -#. 9 -#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 -msgid "DEVICE" -msgstr "GERÄT" - -#. 1 -#. 4 -#. 0 -#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 -#: ../cli/src/network-manager.c:36 -msgid "STATE" -msgstr "STATUS" - -#: ../cli/src/devices.c:71 -msgid "GENERAL" -msgstr "ALLGEMEIN" - -#. 0 -#: ../cli/src/devices.c:72 -msgid "CAPABILITIES" -msgstr "FÄHIGKEITEN" - -#. 1 #: ../cli/src/devices.c:73 -msgid "WIFI-PROPERTIES" -msgstr "WIFI-EIGENSCHAFTEN" - -#. 2 -#: ../cli/src/devices.c:74 -msgid "AP" -msgstr "AP" - -#. 3 -#: ../cli/src/devices.c:75 -msgid "WIRED-PROPERTIES" -msgstr "KABEL-EIGENSCHAFTEN" - -#. 4 -#: ../cli/src/devices.c:76 -msgid "IP4-SETTINGS" -msgstr "IP4-EINSTELLUNGEN" - -#. 5 -#: ../cli/src/devices.c:77 -msgid "IP4-DNS" -msgstr "IP4-DNS" - -#. 2 -#: ../cli/src/devices.c:88 -msgid "DRIVER" -msgstr "TREIBER" - -#. 3 -#: ../cli/src/devices.c:89 -msgid "HWADDR" -msgstr "HWADDR" - -#. 0 -#: ../cli/src/devices.c:99 -msgid "CARRIER-DETECT" -msgstr "ANBIETER-SUCHE" - -#. 1 -#: ../cli/src/devices.c:100 -msgid "SPEED" -msgstr "GESCHWINDIGKEIT" - -#. 0 -#: ../cli/src/devices.c:109 -msgid "CARRIER" -msgstr "ANBIETER" - -#. 0 -#: ../cli/src/devices.c:119 -msgid "WEP" -msgstr "WEP" - -#. 1 -#: ../cli/src/devices.c:120 -msgid "WPA" -msgstr "WPA" - -#. 2 -#: ../cli/src/devices.c:121 -msgid "WPA2" -msgstr "WPA2" - -#. 3 -#: ../cli/src/devices.c:122 -msgid "TKIP" -msgstr "TKIP" - -#. 4 -#: ../cli/src/devices.c:123 -msgid "CCMP" -msgstr "CCMP" - -#. 0 -#: ../cli/src/devices.c:132 -msgid "ADDRESS" -msgstr "ADRESSE" - -#. 1 -#: ../cli/src/devices.c:133 -msgid "PREFIX" -msgstr "PRÄFIX" - -#. 2 -#: ../cli/src/devices.c:134 -msgid "GATEWAY" -msgstr "GATEWAY" - -#. 0 -#: ../cli/src/devices.c:143 -msgid "DNS" -msgstr "DNS" - -#. 0 -#: ../cli/src/devices.c:153 -msgid "SSID" -msgstr "SSID" - -#. 1 -#: ../cli/src/devices.c:154 -msgid "BSSID" -msgstr "BSSID" - -#. 2 -#: ../cli/src/devices.c:155 -msgid "MODE" -msgstr "MODUS" - -#. 3 -#: ../cli/src/devices.c:156 -msgid "FREQ" -msgstr "FREQ" - -#. 4 -#: ../cli/src/devices.c:157 -msgid "RATE" -msgstr "RATE" - -#. 5 -#: ../cli/src/devices.c:158 -msgid "SIGNAL" -msgstr "SIGNAL" - -#. 6 -#: ../cli/src/devices.c:159 -msgid "SECURITY" -msgstr "SICHERHEIT" - -#. 7 -#: ../cli/src/devices.c:160 -msgid "WPA-FLAGS" -msgstr "WPA-FLAGS" - -#. 8 -#: ../cli/src/devices.c:161 -msgid "RSN-FLAGS" -msgstr "RSN-FLAGS" - -#. 10 -#: ../cli/src/devices.c:163 -msgid "ACTIVE" -msgstr "AKTIV" - -#: ../cli/src/devices.c:186 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -633,7 +360,7 @@ msgid "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] [hwaddr ]]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" "\n" msgstr "" "Aufruf: nmcli dev { BEFEHL | help }\n" @@ -643,237 +370,351 @@ msgstr "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] [hwaddr ]]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" "\n" -#: ../cli/src/devices.c:206 +#: ../cli/src/devices.c:93 msgid "unmanaged" msgstr "nicht verwaltet" -#: ../cli/src/devices.c:208 +#: ../cli/src/devices.c:95 msgid "unavailable" msgstr "nicht verfügbar" -#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 msgid "disconnected" -msgstr "getrennt" +msgstr "nicht verbunden" -#: ../cli/src/devices.c:212 +#: ../cli/src/devices.c:99 msgid "connecting (prepare)" -msgstr "wird verbunden (vorbereiten)" +msgstr "wird verbunden (wird vorbereitet)" -#: ../cli/src/devices.c:214 +#: ../cli/src/devices.c:101 msgid "connecting (configuring)" -msgstr "wird verbunden (konfigurieren)" +msgstr "wird verbunden (wird eingerichtet)" -#: ../cli/src/devices.c:216 +#: ../cli/src/devices.c:103 msgid "connecting (need authentication)" -msgstr "wird verbunden (Authentifizierung erforderlich)" +msgstr "wird verbunden (Legitimierung wird benötigt)" -#: ../cli/src/devices.c:218 +#: ../cli/src/devices.c:105 msgid "connecting (getting IP configuration)" -msgstr "wird verbunden (IP-Konfiguration wird ermittelt)" +msgstr "wird verbunden (IP-Einstellungen werden ermittelt)" -#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 msgid "connected" msgstr "verbunden" -#: ../cli/src/devices.c:222 +#: ../cli/src/devices.c:109 msgid "connection failed" -msgstr "Verbindung fehlgeschlagen" +msgstr "Verbindung gescheitert" -#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 msgid "Unknown" msgstr "Unbekannt" -#: ../cli/src/devices.c:277 +#. print them +#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 +#: ../cli/src/devices.c:879 msgid "(none)" msgstr "(keine)" -#: ../cli/src/devices.c:302 +#: ../cli/src/devices.c:209 #, c-format msgid "%s: error converting IP4 address 0x%X" msgstr "%s: Fehler bei Umwandlung der IPv4-Addresse 0x%X" -#: ../cli/src/devices.c:349 +#: ../cli/src/devices.c:238 #, c-format -msgid "%u MHz" -msgstr "%u MHz" +msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +msgstr "%s, %s, Frequenz %d MHz, Durchsatz %d Mb/s, Stärke %d" -#: ../cli/src/devices.c:350 -#, c-format -msgid "%u MB/s" -msgstr "%u MB/s" +#: ../cli/src/devices.c:239 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" -#: ../cli/src/devices.c:359 -msgid "Encrypted: " -msgstr "Verschlüsselt: " +#: ../cli/src/devices.c:248 +msgid ", Encrypted: " +msgstr ", Verschlüsselt: " -#: ../cli/src/devices.c:364 -msgid "WEP " -msgstr "WEP " +#: ../cli/src/devices.c:253 +msgid " WEP" +msgstr " WEP" -#: ../cli/src/devices.c:366 -msgid "WPA " -msgstr "WPA " +#: ../cli/src/devices.c:255 +msgid " WPA" +msgstr " WPA" -#: ../cli/src/devices.c:368 -msgid "WPA2 " -msgstr "WPA2 " +#: ../cli/src/devices.c:257 +msgid " WPA2" +msgstr " WPA2" # Das ergibt z.B. WPA-Enterprise, klingt komisch mit »Unternehmen« -#: ../cli/src/devices.c:371 -msgid "Enterprise " -msgstr "Enterprise " +#: ../cli/src/devices.c:260 +msgid " Enterprise" +msgstr " Enterprise" -#: ../cli/src/devices.c:380 -msgid "Ad-Hoc" -msgstr "Ad-Hoc" +#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Device" +msgstr "Gerät" -#: ../cli/src/devices.c:380 -msgid "Infrastructure" -msgstr "Infrastuktur" +#: ../cli/src/devices.c:299 +msgid "Driver" +msgstr "Treiber" -#: ../cli/src/devices.c:442 -#, c-format -msgid "Error: 'dev list': %s" -msgstr "Fehler: 'dev list': %s" +#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 +msgid "(unknown)" +msgstr "(unbekannt)" -#: ../cli/src/devices.c:444 -#, c-format -msgid "Error: 'dev list': %s; allowed fields: %s" -msgstr "Fehler: 'dev list': %s; erlaubte Felder: %s" +#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "State" +msgstr "Status" -#: ../cli/src/devices.c:453 -msgid "Device details" -msgstr "Gerätedetails" +#: ../cli/src/devices.c:313 +msgid "HW Address" +msgstr "Hardwareadresse" -#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 -msgid "(unknown)" -msgstr "(unbekannt)" +#: ../cli/src/devices.c:319 +#, c-format +msgid "" +"\n" +" Capabilities:\n" +msgstr "" +"\n" +" Fähigkeiten:\n" -#: ../cli/src/devices.c:484 -msgid "unknown)" -msgstr "unbekannt)" +#: ../cli/src/devices.c:321 +msgid "Carrier Detect" +msgstr "Trägersignalkennung" -#: ../cli/src/devices.c:510 +#: ../cli/src/devices.c:336 #, c-format msgid "%u Mb/s" msgstr "%u Mb/s" -#. Print header -#. "WIRED-PROPERTIES" -#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:337 +msgid "Speed" +msgstr "Geschwindigkeit" + +#: ../cli/src/devices.c:348 +#, c-format +msgid "" +"\n" +" Wireless Properties\n" +msgstr "" +"\n" +" Eigenschaften der Funkverbindung\n" + +#: ../cli/src/devices.c:353 +msgid "WEP Encryption" +msgstr "WEP-Verschlüsselung" + +#: ../cli/src/devices.c:355 +msgid "WPA Encryption" +msgstr "WPA-Verschlüsselung" + +#: ../cli/src/devices.c:357 +msgid "WPA2 Encryption" +msgstr "WPA2-Verschlüsselung" + +#: ../cli/src/devices.c:359 +msgid "TKIP cipher" +msgstr "TKIP-Chiffre" + +#: ../cli/src/devices.c:361 +msgid "CCMP cipher" +msgstr "CCMP-Chiffre" + +#: ../cli/src/devices.c:368 +#, c-format +msgid "" +"\n" +" Wireless Access Points %s\n" +msgstr "" +"\n" +" Funknetzwerk-Zugangspunkte %s\n" + +#: ../cli/src/devices.c:368 +msgid "(* = current AP)" +msgstr "(* = momentaner Zugangspunkt)" + +#: ../cli/src/devices.c:374 +#, c-format +msgid "" +"\n" +" Wired Properties\n" +msgstr "" +"\n" +" Eigenschaften der kabelgebundenen Verbindung\n" + +#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 +msgid "Carrier" +msgstr "Trägersignal" + +#: ../cli/src/devices.c:377 msgid "on" msgstr "an" -#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:379 msgid "off" msgstr "aus" -#: ../cli/src/devices.c:710 +#: ../cli/src/devices.c:387 #, c-format -msgid "Error: 'dev status': %s" -msgstr "Fehler: 'dev status': %s" +msgid "" +"\n" +" IPv4 Settings:\n" +msgstr "" +"\n" +" IPv4-Einstellungen:\n" -#: ../cli/src/devices.c:712 -#, c-format -msgid "Error: 'dev status': %s; allowed fields: %s" -msgstr "Fehler: 'dev status': %s; erlaubte Felder: %s" +#: ../cli/src/devices.c:395 +msgid "Address" +msgstr "Adresse" + +#: ../cli/src/devices.c:401 +msgid "Prefix" +msgstr "Präfix" -#: ../cli/src/devices.c:719 +#: ../cli/src/devices.c:405 +msgid "Gateway" +msgstr "Gateway" + +#: ../cli/src/devices.c:416 +msgid "DNS" +msgstr "DNS" + +#: ../cli/src/devices.c:458 msgid "Status of devices" -msgstr "Status von Geräten" +msgstr "Status der Geräte" -#: ../cli/src/devices.c:747 +#: ../cli/src/devices.c:487 #, c-format msgid "Error: '%s' argument is missing." -msgstr "Fehler: Argument '%s' fehlt." +msgstr "Fehler: Argument »%s« fehlt." -#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 #, c-format msgid "Error: Device '%s' not found." -msgstr "Fehler: Gerät '%s' wurde nicht gefunden" +msgstr "Fehler: Gerät »%s« wurde nicht gefunden." -#: ../cli/src/devices.c:799 +#: ../cli/src/devices.c:539 #, c-format msgid "Success: Device '%s' successfully disconnected." -msgstr "Erfolg: Gerät '%s' wurde erfolgreich getrennt." +msgstr "Erfolg: Gerät »%s« wurde erfolgreich getrennt." -#: ../cli/src/devices.c:824 +#: ../cli/src/devices.c:564 #, c-format msgid "Error: Device '%s' (%s) disconnecting failed: %s" -msgstr "Fehler: Trennung des Gerätes '%s' (%s) ist fehlgeschlagen: %s" +msgstr "Fehler: Trennung des Gerätes »%s« (%s) ist gescheitert: %s" -#: ../cli/src/devices.c:832 +#: ../cli/src/devices.c:572 #, c-format msgid "Device state: %d (%s)\n" -msgstr "Gerätezustand: %d (%s)\n" +msgstr "Gerätezustand: %d (%s)\n" -#: ../cli/src/devices.c:896 +#: ../cli/src/devices.c:636 #, c-format msgid "Error: iface has to be specified." -msgstr "Fehler: Schnittstelle muss angegeben werden." +msgstr "Fehler: Es muss eine Schnittstelle angegeben werden." -#: ../cli/src/devices.c:1011 -#, c-format -msgid "Error: 'dev wifi': %s" -msgstr "Fehler: 'dev wifi': %s" +#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 +msgid "WiFi scan list" +msgstr "Suchliste des WLAN" -#: ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:740 #, c-format -msgid "Error: 'dev wifi': %s; allowed fields: %s" -msgstr "Fehler: 'dev wifi': %s; erlaubte Felder: %s" +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Fehler: Gerät »%s« ist kein WLAN-Gerät." -#: ../cli/src/devices.c:1020 -msgid "WiFi scan list" -msgstr "Suchliste für WiFi" +#: ../cli/src/devices.c:754 +msgid "Device:" +msgstr "Gerät:" -#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#: ../cli/src/devices.c:806 #, c-format -msgid "Error: Access point with hwaddr '%s' not found." -msgstr "Fehler: Der Zugangspunkt mit Hardware-Adresse '%s' wurde nicht gefunden." +msgid "Error: hwaddr has to be specified." +msgstr "Fehler: Es muss eine Hardwareadresse angegeben werden." -#: ../cli/src/devices.c:1072 +#: ../cli/src/devices.c:844 #, c-format -msgid "Error: Device '%s' is not a WiFi device." -msgstr "Fehler: Gerät '%s' ist kein WiFi-Gerät." +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "" +"Fehler: Der Zugangspunkt mit der Hardware-Adresse »%s« wurde nicht gefunden." -#: ../cli/src/devices.c:1136 +#: ../cli/src/devices.c:862 #, c-format -msgid "Error: 'dev wifi' command '%s' is not valid." -msgstr "Fehler: Der Befehl '%s' für 'dev wifi' ist nicht gültig." +msgid "%u MHz" +msgstr "%u MHz" -#: ../cli/src/devices.c:1183 +#: ../cli/src/devices.c:863 #, c-format -msgid "Error: 'dev' command '%s' is not valid." -msgstr "Fehler: Der Befehl '%s' für 'dev' ist nicht gültig." +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 +msgid "AP parameters" +msgstr "Parameter des Zugangspunkts" + +#: ../cli/src/devices.c:873 +msgid "SSID:" +msgstr "SSID:" -#: ../cli/src/network-manager.c:35 -msgid "RUNNING" -msgstr "WIRD AUSGEFÜHRT" +#: ../cli/src/devices.c:874 +msgid "BSSID:" +msgstr "BSSID:" -#. 1 -#: ../cli/src/network-manager.c:37 -msgid "WIFI-HARDWARE" -msgstr "WIFI-HARDWARE" +#: ../cli/src/devices.c:875 +msgid "Frequency:" +msgstr "Frequenz:" -#. 2 -#: ../cli/src/network-manager.c:38 -msgid "WIFI" -msgstr "WIFI" +#: ../cli/src/devices.c:876 +msgid "Mode:" +msgstr "Modus:" -#. 3 -#: ../cli/src/network-manager.c:39 -msgid "WWAN-HARDWARE" -msgstr "WWAN-HARDWARE" +#: ../cli/src/devices.c:876 +msgid "Ad-hoc" +msgstr "Ad-hoc" -#. 4 -#: ../cli/src/network-manager.c:40 -msgid "WWAN" -msgstr "WWAN" +#: ../cli/src/devices.c:876 +msgid "Infrastructure" +msgstr "Infrastuktur" + +#: ../cli/src/devices.c:877 +msgid "Maximal bitrate:" +msgstr "Maximale Übertragungsgeschwindigkeit:" + +#: ../cli/src/devices.c:878 +msgid "Strength:" +msgstr "Stärke:" + +#: ../cli/src/devices.c:879 +msgid "Flags:" +msgstr "Flags:" + +#: ../cli/src/devices.c:879 +msgid "privacy" +msgstr "Vertraulichkeit" + +#: ../cli/src/devices.c:880 +msgid "WPA flags:" +msgstr "WPA-Flags:" + +#: ../cli/src/devices.c:881 +msgid "RSN flags:" +msgstr "RSN-Flags:" -#: ../cli/src/network-manager.c:62 +#: ../cli/src/devices.c:907 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Fehler: Der Befehl »%s« für »dev wifi« ist ungültig." + +#: ../cli/src/devices.c:943 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Fehler: Der Befehl »%s« für »dev« ist ungültig." + +#: ../cli/src/network-manager.c:46 #, c-format msgid "" "Usage: nmcli nm { COMMAND | help }\n" @@ -898,91 +739,89 @@ msgstr "" " wwan [on|off]\n" "\n" -#: ../cli/src/network-manager.c:83 +#: ../cli/src/network-manager.c:67 msgid "asleep" msgstr "schlafend" -#: ../cli/src/network-manager.c:85 +#: ../cli/src/network-manager.c:69 msgid "connecting" msgstr "wird verbunden" -#: ../cli/src/network-manager.c:125 -#, c-format -msgid "Error: 'nm status': %s" -msgstr "Fehler: 'nm status': %s" - -#: ../cli/src/network-manager.c:127 -#, c-format -msgid "Error: 'nm status': %s; allowed fields: %s" -msgstr "Fehler: 'nm status': %s; erlaubte Felder: %s" - -#: ../cli/src/network-manager.c:134 -msgid "NetworkManager status" -msgstr "Status von NetworkManager" - -#. Print header -#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 -#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 -#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 msgid "enabled" msgstr "aktiviert" -#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 -#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 -#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 msgid "disabled" msgstr "deaktiviert" -#: ../cli/src/network-manager.c:148 +#: ../cli/src/network-manager.c:102 +msgid "NetworkManager status" +msgstr "Status von NetworkManager" + +#: ../cli/src/network-manager.c:104 +msgid "NM running:" +msgstr "NM läuft:" + +#: ../cli/src/network-manager.c:104 msgid "running" msgstr "wird ausgeführt" -#: ../cli/src/network-manager.c:148 +#: ../cli/src/network-manager.c:104 msgid "not running" msgstr "wird nicht ausgeführt" -#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 -#, c-format -msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" -msgstr "Fehler: '--fields' Wert '%s' hier nicht gültig; erlaubte Felder: %s" +#: ../cli/src/network-manager.c:105 +msgid "NM state:" +msgstr "Status von NM:" + +#: ../cli/src/network-manager.c:106 +msgid "NM wireless hardware:" +msgstr "NM Funknetzwerk-Hardware:" -#: ../cli/src/network-manager.c:209 -msgid "WiFi enabled" -msgstr "WiFi aktiviert" +#. no argument, show current state +#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 +msgid "NM wireless:" +msgstr "NM Funk:" -#: ../cli/src/network-manager.c:220 +#: ../cli/src/network-manager.c:108 +msgid "NM WWAN hardware:" +msgstr "NM WWAN-Hardware:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 +msgid "NM WWAN:" +msgstr "NM WWAN:" + +#: ../cli/src/network-manager.c:150 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." -msgstr "Fehler: Ungültiger 'wifi'-Parameter: '%s'." - -#: ../cli/src/network-manager.c:241 -msgid "WWAN enabled" -msgstr "WWAN aktiviert" +msgstr "Fehler: Ungültiger »wifi«-Parameter: »%s«." -#: ../cli/src/network-manager.c:252 +#: ../cli/src/network-manager.c:167 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." -msgstr "Fehler: Ungültiger 'wwan'-Parameter: '%s'." +msgstr "Fehler: Ungültiger »wwan«-Parameter: »%s«." -#: ../cli/src/network-manager.c:263 +#: ../cli/src/network-manager.c:178 #, c-format msgid "Error: 'nm' command '%s' is not valid." -msgstr "Fehler: Der Befehl '%s' für 'nm' ist nicht gültig." +msgstr "Fehler: Der Befehl »%s« für »nm« ist ungültig." -#: ../cli/src/nmcli.c:69 +#: ../cli/src/nmcli.c:65 #, c-format msgid "" "Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" "\n" "OPTIONS\n" -" -t[erse] terse output\n" -" -p[retty] pretty output\n" -" -m[ode] tabular|multiline output mode\n" -" -f[ields] |all|common specify fields to output\n" -" -e[scape] yes|no escape columns separators in " -"values\n" -" -v[ersion] show program version\n" -" -h[elp] print this help\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" "\n" "OBJECT\n" " nm NetworkManager status\n" @@ -993,13 +832,10 @@ msgstr "" "Aufruf: %s [OPTIONEN] OBJEKT { BEFEHL | help }\n" "\n" "OPTIONEN\n" -" -t[erse] knappe Ausgabe\n" -" -p[retty] hübsche Ausgabe\n" -" -m[ode] tabular|multiline Ausgabemodus\n" -" -f[ields] |all|common Ausgabefelder angeben\n" -" -e[scape] yes|no Spaltentrenner in den Werten mit Maskierungszeichen versehen\n" -" -v[ersion] Programm-Version anzeigen\n" -" -h[elp] dies Hilfe ausgeben\n" +" -t[erse] kurze Ausgabe\n" +" -p[retty] hübsche Ausgabe\n" +" -v[ersion] Programmversion anzeigen\n" +" -h[elp] diese Hilfe ausgeben\n" "\n" "OBJEKT\n" " nm Status von NetworkManager\n" @@ -1007,361 +843,239 @@ msgstr "" " dev von NetworkManager verwaltete Verbindungen\n" "\n" -#: ../cli/src/nmcli.c:113 +#: ../cli/src/nmcli.c:106 #, c-format -msgid "Error: Object '%s' is unknown, try 'nmcli help'." -msgstr "Fehler: Objekt '%s' ist unbekannt, versuchen Sie 'nmcli help'." +msgid "Object '%s' is unknown, try 'nmcli help'." +msgstr "Objekt »%s« ist unbekannt, versuchen Sie »nmcli help«." -#: ../cli/src/nmcli.c:143 -#, c-format -msgid "Error: Option '--terse' is specified the second time." -msgstr "Fehler: Option '--terse' wird als zweite Option angegeben." - -#: ../cli/src/nmcli.c:148 -#, c-format -msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." -msgstr "Fehler: Option '--terse' und '--pretty' schließen sich gegenseitig aus." - -#: ../cli/src/nmcli.c:156 -#, c-format -msgid "Error: Option '--pretty' is specified the second time." -msgstr "Fehler: Option '--pretty' wird als zweite Option angegeben." - -#: ../cli/src/nmcli.c:161 -#, c-format -msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." -msgstr "Fehler: Option '--pretty' und '--terse' schließen sich gegenseitig aus." - -#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 -#, c-format -msgid "Error: missing argument for '%s' option." -msgstr "Fehler: Fehlendes Argument für die Option '%s'." - -#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 -#, c-format -msgid "Error: '%s' is not valid argument for '%s' option." -msgstr "Fehler: '%s' kein gültiges Argument für die Option '%s'." - -#: ../cli/src/nmcli.c:203 -#, c-format -msgid "Error: fields for '%s' options are missing." -msgstr "Fehler: Felder für die Optionen '%s' fehlen." - -#: ../cli/src/nmcli.c:209 +#: ../cli/src/nmcli.c:139 #, c-format msgid "nmcli tool, version %s\n" -msgstr "nmcli, Version %s\n" +msgstr "nmcli-Werkzeug, Version %s\n" -#: ../cli/src/nmcli.c:215 +#: ../cli/src/nmcli.c:145 #, c-format -msgid "Error: Option '%s' is unknown, try 'nmcli -help'." -msgstr "Fehler: Option '%s' ist unbekannt, versuchen Sie 'nmcli -help'." +msgid "Option '%s' is unknown, try 'nmcli -help'." +msgstr "Option »%s« ist unbekannt, versuchen Sie »nmcli -help«." -#: ../cli/src/nmcli.c:234 +#: ../cli/src/nmcli.c:164 #, c-format msgid "Caught signal %d, shutting down..." msgstr "Signal %d wurde empfangen, wird beendet …" -#: ../cli/src/nmcli.c:259 +#: ../cli/src/nmcli.c:189 #, c-format msgid "Error: Could not connect to NetworkManager." msgstr "Fehler: Verbindung mit NetworkManager konnte nicht hergestellt werden." -#: ../cli/src/nmcli.c:275 +#: ../cli/src/nmcli.c:205 msgid "Success" msgstr "Erfolg" -#: ../cli/src/settings.c:407 -#, c-format -msgid "%d (hex-ascii-key)" -msgstr "%d (hex-ascii-key)" - -#: ../cli/src/settings.c:409 -#, c-format -msgid "%d (104/128-bit passphrase)" -msgstr "%d (104/128-Bit Passphrase)" - -#: ../cli/src/settings.c:412 -#, c-format -msgid "%d (unknown)" -msgstr "%d (unbekannt)" - -#: ../cli/src/settings.c:438 -msgid "0 (unknown)" -msgstr "0 (unbekannt)" - -#: ../cli/src/settings.c:444 -msgid "any, " -msgstr "beliebig, " - -#: ../cli/src/settings.c:446 -msgid "900 MHz, " -msgstr "900 MHz, " - -#: ../cli/src/settings.c:448 -msgid "1800 MHz, " -msgstr "1800 MHz, " - -#: ../cli/src/settings.c:450 -msgid "1900 MHz, " -msgstr "1900 MHz, " - -#: ../cli/src/settings.c:452 -msgid "850 MHz, " -msgstr "850 MHz, " - -#: ../cli/src/settings.c:454 -msgid "WCDMA 3GPP UMTS 2100 MHz, " -msgstr "WCDMA 3GPP UMTS 2100 MHz, " - -#: ../cli/src/settings.c:456 -msgid "WCDMA 3GPP UMTS 1800 MHz, " -msgstr "WCDMA 3GPP UMTS 1800 MHz, " - -#: ../cli/src/settings.c:458 -msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " -msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " - -#: ../cli/src/settings.c:460 -msgid "WCDMA 3GPP UMTS 800 MHz, " -msgstr "WCDMA 3GPP UMTS 800 MHz, " - -#: ../cli/src/settings.c:462 -msgid "WCDMA 3GPP UMTS 850 MHz, " -msgstr "WCDMA 3GPP UMTS 850 MHz, " - -#: ../cli/src/settings.c:464 -msgid "WCDMA 3GPP UMTS 900 MHz, " -msgstr "WCDMA 3GPP UMTS 900 MHz, " - -#: ../cli/src/settings.c:466 -msgid "WCDMA 3GPP UMTS 1700 MHz, " -msgstr "WCDMA 3GPP UMTS 1700 MHz, " - -#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 -msgid "auto" -msgstr "auto" - -#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 -msgid "not set" -msgstr "nicht gesetzt" - -#: ../cli/src/utils.c:124 -#, c-format -msgid "field '%s' has to be alone" -msgstr "Feld '%s' muss isoliert sein" - -#: ../cli/src/utils.c:127 -#, c-format -msgid "invalid field '%s'" -msgstr "ungültiges Feld '%s'" - -#: ../cli/src/utils.c:146 -#, c-format -msgid "Option '--terse' requires specifying '--fields'" -msgstr "Option '--terse' erfordert die Angabe von '--fields'" - -#: ../cli/src/utils.c:150 -#, c-format -msgid "Option '--terse' requires specific '--fields' option values , not '%s'" -msgstr "Option '--terse' erfordert spezielle '--fields' Optionswerte , nicht '%s'" - #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." -msgstr "PEM-Schlüssel Datei hat kein abschließendes Tag '%s'." +msgstr "PEM-Schlüsseldatei hat kein abschließendes Tag »%s«." #: ../libnm-util/crypto.c:130 #, c-format msgid "Doesn't look like a PEM private key file." -msgstr "Dies scheint kein privater PEM-Schlüssel zu sein." +msgstr "Das sieht nicht nach einer privaten PEM-Schlüsseldatei aus." #: ../libnm-util/crypto.c:138 #, c-format msgid "Not enough memory to store PEM file data." -msgstr "Es steht nicht genug Speicher zum Speichern der PEM-Datei zur Verfügung." +msgstr "Nicht genügend freier Speicher zum Speichern der PEM-Datendatei." #: ../libnm-util/crypto.c:154 #, c-format msgid "Malformed PEM file: Proc-Type was not first tag." -msgstr "Fehlerhafte PEM-Datei: Proc-Type ist nicht der erste Tag." +msgstr "Fehlerhafte PEM-Datei: Proc-Type ist nicht das erste Tag." #: ../libnm-util/crypto.c:162 #, c-format msgid "Malformed PEM file: unknown Proc-Type tag '%s'." -msgstr "Fehlerhafte PEM-Datei: unbekannter Proc-Type Tag '%s'." +msgstr "Fehlerhafte PEM-Datei: unbekannter Proc-Type-Tag »%s«." #: ../libnm-util/crypto.c:172 #, c-format msgid "Malformed PEM file: DEK-Info was not the second tag." -msgstr "Fehlerhafte PEM-Datei: DEK-Info ist nicht der zweite Tag." +msgstr "Fehlerhafte PEM-Datei: DEK-Info ist nicht das zweite Tag." #: ../libnm-util/crypto.c:183 #, c-format msgid "Malformed PEM file: no IV found in DEK-Info tag." -msgstr "Fehlerhafte PEM-Datei: kein IV im DEK-Info Tag gefunden." +msgstr "Fehlerhafte PEM-Datei: kein IV im DEK-Info-Tag gefunden." #: ../libnm-util/crypto.c:190 #, c-format msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." -msgstr "Fehlerhafte PEM-Datei: falsches Format des IV in DEK-Info Tag." +msgstr "Fehlerhafte PEM-Datei: falsches Format des IV im DEK-Info-Tag." #: ../libnm-util/crypto.c:203 #, c-format msgid "Malformed PEM file: unknown private key cipher '%s'." -msgstr "" -"Fehlerhafte PEM-Datei: Unbekannte Verschlüsselung '%s' des privaten " -"Schlüssels." +msgstr "Fehlerhafte PEM-Datei: Unbekannter privater Schlüsselstrom »%s«." #: ../libnm-util/crypto.c:222 #, c-format msgid "Could not decode private key." -msgstr "Der private Schlüssel konnte nicht dekodiert werden." +msgstr "Der private Schlüssel konnte nicht entschlüsselt werden." #: ../libnm-util/crypto.c:267 #, c-format msgid "PEM certificate '%s' had no end tag '%s'." -msgstr "PEM-Zertifikat '%s' hat kein abschließendes Tag '%s'." +msgstr "PEM-Zertifikat »%s« hat kein abschließendes Tag »%s«." #: ../libnm-util/crypto.c:277 #, c-format msgid "Failed to decode certificate." -msgstr "Das Dekodieren des Zertifikats ist fehlgeschlagen." +msgstr "Die Entschlüsselung des Zertifikats scheiterte." #: ../libnm-util/crypto.c:286 #, c-format msgid "Not enough memory to store certificate data." -msgstr "Nicht genug Speicher zum Abspeichern des Zertifikates." +msgstr "Nicht genug freier Speicher zum Speichern des Zertifikats." #: ../libnm-util/crypto.c:294 #, c-format msgid "Not enough memory to store file data." -msgstr "Nicht genug Speicher zum Abspeichern der Datei." +msgstr "Nicht genug freier Speicher zum Speichern der Datei." #: ../libnm-util/crypto.c:324 #, c-format msgid "IV must be an even number of bytes in length." -msgstr "IV muss eine gerade Anzahl an Zeichen lang sein." +msgstr "IV muss eine gerade Anzahl an Byte lang sein." #: ../libnm-util/crypto.c:333 #, c-format msgid "Not enough memory to store the IV." -msgstr "Nicht genug Speicher zum Sichern des IV." +msgstr "Nicht genug freier Speicher zum Speichern des IV." #: ../libnm-util/crypto.c:344 #, c-format msgid "IV contains non-hexadecimal digits." -msgstr "IV enthält nicht hexadezimale Zeichen." +msgstr "IV enthält nicht-hexadezimale Zeichen." #: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 #: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 #: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." -msgstr "Unbekannte Verschlüsselung '%s' des privaten Schlüssels." +msgstr "Privater Schlüsselstrom »%s« ist unbekannt." #: ../libnm-util/crypto.c:391 #, c-format msgid "Not enough memory to decrypt private key." -msgstr "Nicht genug Speicher zum Entschlüsseln des privaten Schlüssels." +msgstr "Nicht genug freier Speicher zum Entschlüsseln des privaten Schlüssels." #: ../libnm-util/crypto.c:511 #, c-format msgid "Unable to determine private key type." -msgstr "Die Art des privaten Schlüssels kann nicht bestimmt werden." +msgstr "Der Typ des privaten Schlüssels konnte nicht bestimmt werden." #: ../libnm-util/crypto.c:530 #, c-format msgid "Not enough memory to store decrypted private key." -msgstr "Nicht genug Speicher zum Speichern des entschlüsselten privaten Schlüssels." +msgstr "" +"Nicht genug freier Speicher zum Speichern des entschlüsselten privaten " +"Schlüssels." #: ../libnm-util/crypto_gnutls.c:49 msgid "Failed to initialize the crypto engine." -msgstr "Fehler beim Initialisieren der Verschlüsselung." +msgstr "Die Initialisierung der crypto-engine scheiterte." #: ../libnm-util/crypto_gnutls.c:93 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." -msgstr "Fehler beim Initialisieren von MD5: %s / %s." +msgstr "Die Initialisierung der MD5-engine %s / %s scheiterte." #: ../libnm-util/crypto_gnutls.c:156 #, c-format msgid "Invalid IV length (must be at least %zd)." -msgstr "Ungültige Länge des IV (muss zumindest %zd sein)." +msgstr "Ungültige IV-Länge (muss mindestens %zd betragen)." #: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format msgid "Not enough memory for decrypted key buffer." -msgstr "Nicht genug Speicher für den Puffer zur Entschlüsselung." +msgstr "" +"Nicht genug freier Speicher zum Zwischenspeichern des entschlüsselten " +"Schlüssels." #: ../libnm-util/crypto_gnutls.c:173 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." -msgstr "Fehler beim Initialisieren des Entschlüsselungs-Kontextes: %s / %s." +msgstr "" +"Die Initialisierung des Entschlüsselung-Chiffrekontextes scheiterte: %s / %s." #: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." msgstr "" -"Fehler beim Festlegen des symmetrischen Schlüssels für die Entschlüsselung: %" -"s / %s." +"Das Anlegen der symmetrischen Schlüssel zum Entschlüsseln scheiterte: %s / %" +"s." #: ../libnm-util/crypto_gnutls.c:191 #, c-format msgid "Failed to set IV for decryption: %s / %s." -msgstr "Fehler beim Festlegen des IV für die Verschlüsselung: %s / %s." +msgstr "Das Anlegen des IV zum Entschlüsseln scheiterte: %s / %s." #: ../libnm-util/crypto_gnutls.c:200 #, c-format msgid "Failed to decrypt the private key: %s / %s." -msgstr "Fehler beim Entschlüsseln des privaten Schlüssels: %s / %s." +msgstr "Die Entschlüsselung des privaten Schlüssels scheiterte: %s / %s." #: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 #, c-format msgid "Failed to decrypt the private key: unexpected padding length." -msgstr "Fehler beim Entschlüsseln des privaten Schlüssels: Unerwartete Fülllänge." +msgstr "" +"Die Entschlüsselung des privaten Schlüssels scheiterte: Unerwartete " +"Zeilenlänge." #: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 #, c-format msgid "Failed to decrypt the private key." -msgstr "Fehler beim Entschlüsseln des privaten Schlüssels." +msgstr "Die Entschlüsselung des privaten Schlüssels scheiterte." #: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 #, c-format msgid "Could not allocate memory for encrypting." -msgstr "Es konnte kein Arbeitsspeicher zur Verschlüsselung angefordert werden." +msgstr "" +"Es konnte nicht genügend freier Speicher zum Verschlüsseln angefordert " +"werden." #: ../libnm-util/crypto_gnutls.c:294 #, c-format msgid "Failed to initialize the encryption cipher context: %s / %s." -msgstr "Fehler beim Initialisieren des Verschlüsselungs-Kontextes: %s / %s." +msgstr "" +"Die Initialisierung des Verschlüsselung-Chiffrekontextes scheiterte: %s / %s." #: ../libnm-util/crypto_gnutls.c:303 #, c-format msgid "Failed to set symmetric key for encryption: %s / %s." msgstr "" -"Fehler beim Festlegen des symmetrischen Schlüssels für die Verschlüsselung: %" -"s / %s." +"Das Anlegen des symmetrischen Schlüssels zum Verschlüsseln scheiterte: %s / %" +"s." #: ../libnm-util/crypto_gnutls.c:313 #, c-format msgid "Failed to set IV for encryption: %s / %s." -msgstr "Fehler beim Festlegen des IV für die Verschlüsselung: %s / %s." +msgstr "Das Anlegen des IV zur Verschlüsselung scheiterte: %s / %s." #: ../libnm-util/crypto_gnutls.c:322 #, c-format msgid "Failed to encrypt the data: %s / %s." -msgstr "Fehler beim Verschlüsseln der Daten: %s / %s." +msgstr "Die Verschlüsselung der Daten scheiterte: %s / %s." #: ../libnm-util/crypto_gnutls.c:362 #, c-format msgid "Error initializing certificate data: %s" -msgstr "Fehler beim Initialisieren des Zertifikats: %s" +msgstr "Die Initialisierung der Zertifikatsdaten schlug fehl: %s" #: ../libnm-util/crypto_gnutls.c:384 #, c-format msgid "Couldn't decode certificate: %s" -msgstr "Zertifikat konnte nicht dekodiert werden: %s" +msgstr "Zertifikat konnte nicht entschlüsselt werden: %s" #: ../libnm-util/crypto_gnutls.c:408 #, c-format @@ -1371,7 +1085,7 @@ msgstr "PKCS#12-Decoder konnte nicht initialisiert werden: %s" #: ../libnm-util/crypto_gnutls.c:421 #, c-format msgid "Couldn't decode PKCS#12 file: %s" -msgstr "PKCS#12 konnte nicht decodiert werden: %s" +msgstr "PKCS#12 konnte nicht entschlüsselt werden: %s" #: ../libnm-util/crypto_gnutls.c:433 #, c-format @@ -1381,79 +1095,82 @@ msgstr "PKCS#12-Datei konnte nicht überprüft werden: %s" #: ../libnm-util/crypto_nss.c:56 #, c-format msgid "Failed to initialize the crypto engine: %d." -msgstr "Fehler beim Initialisieren der Verschlüsselung: %d." +msgstr "Die Initialisierung der crypto-engine scheiterte: %d." #: ../libnm-util/crypto_nss.c:111 #, c-format msgid "Failed to initialize the MD5 context: %d." -msgstr "Fehler beim Initialisieren des MD5-Kontextes: %d." +msgstr "Die Initialisierung des MD5-Kontexts scheiterte: %d." #: ../libnm-util/crypto_nss.c:179 #, c-format msgid "Invalid IV length (must be at least %d)." -msgstr "Ungültige Länge des IV (muss zumindest %d sein)." +msgstr "Ungültige IV-Länge (muss mindestens %d betragen)." #: ../libnm-util/crypto_nss.c:196 #, c-format msgid "Failed to initialize the decryption cipher slot." -msgstr "Fehler beim Einrichten des Verschlüsselungs-Slots." +msgstr "Die Initialisierung des Entschlüsselungsstromslots scheiterte." #: ../libnm-util/crypto_nss.c:206 #, c-format msgid "Failed to set symmetric key for decryption." -msgstr "Fehler beim Festlegen des symmetrischen Schlüssels für die Entschlüsselung." +msgstr "" +"Das Anlegen des symmetrischen Schlüssels zur Entschlüsselung scheiterte." #: ../libnm-util/crypto_nss.c:216 #, c-format msgid "Failed to set IV for decryption." -msgstr "Fehler beim Festlegen des IV für die Entschlüsselung." +msgstr "Das Anlegen des IV zur Entschlüsselung scheiterte." #: ../libnm-util/crypto_nss.c:224 #, c-format msgid "Failed to initialize the decryption context." -msgstr "Fehler beim Einrichten des Entschlüsselungs-Kontextes." +msgstr "Die Initialisierung des Entschlüsselungskontexts scheiterte." #: ../libnm-util/crypto_nss.c:237 #, c-format msgid "Failed to decrypt the private key: %d." -msgstr "Fehler beim Entschlüsseln des privaten Schlüssels: %d." +msgstr "Das Entschlüsseln des privaten Schlüssels scheiterte: %d." #: ../libnm-util/crypto_nss.c:245 #, c-format msgid "Failed to decrypt the private key: decrypted data too large." msgstr "" -"Fehler beim Entschlüsseln des privaten Schlüssels: Die entschlüsselten Daten " -"sind zu groß." +"Das Entschlüsseln des privaten Schlüssels scheiterte: Die entschlüsselten " +"Daten sind zu groß." #: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." -msgstr "Fehler beim Abschließen der Entschlüsselung des privaten Schlüssels: %d." +msgstr "" +"Das Abschließen der Entschlüsselung des privaten Schlüssels scheiterte: %d." #: ../libnm-util/crypto_nss.c:364 #, c-format msgid "Failed to initialize the encryption cipher slot." -msgstr "Fehler beim Einrichten des Verschlüsselungs-Slots." +msgstr "Die Initialisierung des Verschlüsselungsstromslots scheiterte." #: ../libnm-util/crypto_nss.c:372 #, c-format msgid "Failed to set symmetric key for encryption." -msgstr "Fehler beim Festlegen des symmetrischen Schlüssels für die Verschlüsselung." +msgstr "" +"Das Anlegen des symmetrischen Schlüssels zur Verschlüsselung scheiterte." #: ../libnm-util/crypto_nss.c:380 #, c-format msgid "Failed to set IV for encryption." -msgstr "Fehler beim Festlegen des IV für die Verschlüsselung." +msgstr "Das Anlegen des IV zur Verschlüsselung scheiterte." #: ../libnm-util/crypto_nss.c:388 #, c-format msgid "Failed to initialize the encryption context." -msgstr "Fehler beim Initialisieren des Verschlüsselungs-Kontextes." +msgstr "Die Initialisierung des Verschlusselungskontexts scheiterte." #: ../libnm-util/crypto_nss.c:396 #, c-format msgid "Failed to encrypt: %d." -msgstr "Fehler beim Verschlüsseln: %d." +msgstr "Das Verschlüsseln scheiterte: %d." #: ../libnm-util/crypto_nss.c:404 #, c-format @@ -1463,12 +1180,12 @@ msgstr "Unerwartete Datenmenge nach der Verschlüsselung." #: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" -msgstr "Zertifikat konnte nicht dekodiert werden: %d" +msgstr "Das Zertifikat konnte nicht entschlüsselt werden: %d" #: ../libnm-util/crypto_nss.c:482 #, c-format msgid "Couldn't convert password to UCS2: %d" -msgstr "Passwort konnte nicht zu UCS2 konvertiert werden: %d" +msgstr "Das Passwort konnte nicht zu UCS2 konvertiert werden: %d" #: ../libnm-util/crypto_nss.c:510 #, c-format @@ -1478,7 +1195,7 @@ msgstr "PKCS#12-Decoder konnte nicht initialisiert werden: %d" #: ../libnm-util/crypto_nss.c:519 #, c-format msgid "Couldn't decode PKCS#12 file: %d" -msgstr "PKCS#12-Datei konnte nicht decodiert werden: %d" +msgstr "PKCS#12-Datei konnte nicht verschlüsselt werden: %d" #: ../libnm-util/crypto_nss.c:528 #, c-format @@ -1487,35 +1204,40 @@ msgstr "PKCS#12-Datei konnte nicht überprüft werden: %d" #: ../libnm-util/crypto_nss.c:557 msgid "Could not generate random data." -msgstr "Zufällige Daten konnten nicht erstellt werden." +msgstr "Es konnten keine Zufallsdaten generiert werden." -#: ../libnm-util/nm-utils.c:1925 +#: ../libnm-util/nm-utils.c:1924 #, c-format msgid "Not enough memory to make encryption key." -msgstr "Nicht genug Speicher zum Erstellen eines Schlüssels." +msgstr "" +"Nicht genügend freier Speicher zur Erstellung des Verschlüsselungsschlüssels." -#: ../libnm-util/nm-utils.c:2035 +#: ../libnm-util/nm-utils.c:2034 msgid "Could not allocate memory for PEM file creation." -msgstr "Es konnte kein Speicher zum Erstellen der PEM-Datei angefordert werden." +msgstr "" +"Es konnte nicht genügend freier Speicher zur Erstellung der PEM-Datei " +"angefordert werden." -#: ../libnm-util/nm-utils.c:2047 +#: ../libnm-util/nm-utils.c:2046 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "" -"Es konnte kein Speicher zum Schreiben des IV in die PEM-Datei angefordert " -"werden." +"Es konnte nicht genügend freier Speicher zum Schreiben des IV in die PEM-" +"Datei angefordert werden." -#: ../libnm-util/nm-utils.c:2059 +#: ../libnm-util/nm-utils.c:2058 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "" -"Es konnte kein Speicher zum Schreiben des IV in die PEM-Datei angefordert " -"werden." +"Es konnte nicht genügend freier Speicher zum Schreiben des verschlüsselten " +"Schlüssels in die PEM-Datei angefordert werden." -#: ../libnm-util/nm-utils.c:2078 +#: ../libnm-util/nm-utils.c:2077 #, c-format msgid "Could not allocate memory for PEM file data." -msgstr "Es konnte kein Speicher für die Daten der PEM-Datei angefordert werden." +msgstr "" +"Es konnte nicht genügend freier Speicher für die PEM-Datei angefordert " +"werden." #: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 #: ../src/nm-netlink-monitor.c:653 @@ -1531,50 +1253,52 @@ msgstr "Während des Wartens auf Daten am Socket ist ein Fehler aufgetreten" #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "" -"Es kann nicht mit netlink zur Überwachung der Netzwerkverbindung verbunden " -"werden: %s" +"Die Verbindung zu netlink zur Überwachung der Netzwerkverbindung konnte " +"nicht hergestellt werden: %s" #: ../src/nm-netlink-monitor.c:265 #, c-format msgid "unable to enable netlink handle credential passing: %s" -msgstr "Kann Weitergabe von Berechtigungen des netlink-Handle nicht aktivieren: %s" +msgstr "" +"Die netlink-Handle-Berechtigungsnachweisfreigabe konnte nicht aktiviert " +"werden: %s" #: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 #, c-format msgid "unable to allocate netlink handle for monitoring link status: %s" msgstr "" -"Es kann kein netlink-Handle zur Überwachung der Netzwerkverbindung " +"Es konnte kein netlink-Handle zur Überwachung der Netzwerkverbindung " "angefordert werden: %s" #: ../src/nm-netlink-monitor.c:376 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "" -"Es kann kein netlink-Cache zur Überwachung der Netzwerkverbindung belegt " -"werden: %s" +"Es konnte kein netlink-Verbindungszwischenspeicher zur Überwachung der " +"Netzwerkverbindung angefordert werden: %s" #: ../src/nm-netlink-monitor.c:502 #, c-format msgid "unable to join netlink group: %s" -msgstr "Der netlink-Gruppe kann nicht beigetreten werden: %s" +msgstr "Der netlink-Gruppe konnte nicht beigetreten werden: %s" #: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 #, c-format msgid "error updating link cache: %s" -msgstr "Fehler beim Aktualisieren des Verbindungs-Cache: %s" +msgstr "Die Aktualisierung des Verbindungszwischenspeichers schlug fehl: %s" #: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "" -"Ungültige Option. Verwenden Sie bitte '--help', um eine Liste der gültigen " +"Ungültige Option. Verwenden Sie --help um eine Liste der verfügbaren " "Optionen zu erhalten.\n" #: ../src/main.c:562 #, c-format msgid "%s. Please use --help to see a list of valid options.\n" msgstr "" -"%s Verwenden Sie bitte '--help', um eine Liste der gültigen Optionen zu " +"%s. Verwenden Sie --help, um eine Liste der verfügbaren Optionen zu " "erhalten.\n" #: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 @@ -1587,64 +1311,62 @@ msgid "" "# Merged from %s\n" "\n" msgstr "" -"# Zusammengefügt aus %s\n" +"# Zusammengeführt aus %s\n" "\n" #: ../src/dhcp-manager/nm-dhcp-manager.c:279 msgid "no usable DHCP client could be found." -msgstr "Kein brauchbarer DHCP-Client gefunden." +msgstr "Es konnte kein verwendbarer DHCP-Client gefunden werden." #: ../src/dhcp-manager/nm-dhcp-manager.c:288 msgid "'dhclient' could be found." -msgstr "'dhclient' wurde gefunden." +msgstr "»dhclient« konnte nicht gefunden werden." #: ../src/dhcp-manager/nm-dhcp-manager.c:298 msgid "'dhcpcd' could be found." -msgstr "'dhcpcd' wurde gefunden." +msgstr "»dhcpcd« konnte nicht gefunden werden." #: ../src/dhcp-manager/nm-dhcp-manager.c:306 #, c-format msgid "unsupported DHCP client '%s'" -msgstr "Nicht unterstützter DHCP-Client '%s'" +msgstr "Nicht unterstützter DHCP-Client »%s«" #: ../src/logging/nm-logging.c:146 #, c-format msgid "Unknown log level '%s'" -msgstr "Unbekanntes Log-Level '%s'" +msgstr "Unbekannte Protokollstufe »%s«" #: ../src/logging/nm-logging.c:171 #, c-format msgid "Unknown log domain '%s'" -msgstr "Unbekannte Log-Domain '%s'" +msgstr "Unbekannte Protokolldomäne »%s«" #: ../src/named-manager/nm-named-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" -"HINWEIS: Der libc-Auflöser unterstützt eventuell nicht mehr als 3 Server zur " -"Namensauflösung." +"HINWEIS: Der libc-resolver unterstützt eventuell nicht mehr als drei " +"Nameserver." #: ../src/named-manager/nm-named-manager.c:345 msgid "The nameservers listed below may not be recognized." -msgstr "" -"Die nachfolgend aufgelisteten Server zur Namensauflösung werden eventuell " -"nicht erkannt." +msgstr "Die nachfolgend gelisteten Nameserver werden eventuell nicht erkannt." #: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" msgstr "Auto %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3254 msgid "System" msgstr "System" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 msgid "Connection sharing via a protected WiFi network" -msgstr "Verbindungsfreigabe über ein geschütztes WiFi-Netzwerk" +msgstr "Verbindungsfreigabe über ein geschütztes WLAN-Netzwerk" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 msgid "Connection sharing via an open WiFi network" -msgstr "Verbindungsfreigabe über ein offenes WiFi-Netzwerk" +msgstr "Verbindungsfreigabe über ein offenes WLAN-Netzwerk" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 msgid "Modify persistent system hostname" @@ -1652,11 +1374,12 @@ msgstr "Den ständigen Rechnernamen des Systems bearbeiten" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 msgid "Modify system connections" -msgstr "System-Verbindungen bearbeiten" +msgstr "Systemverbindungen bearbeiten" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 msgid "System policy prevents modification of system settings" -msgstr "Die Systemrichtlinien verhindern das Bearbeiten von Systemeinstellungen" +msgstr "" +"Die Systemrichtlinien verhindern das Bearbeiten von Systemeinstellungen" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 msgid "System policy prevents modification of the persistent system hostname" @@ -1668,11 +1391,32 @@ msgstr "" msgid "System policy prevents sharing connections via a protected WiFi network" msgstr "" "Die Systemrichtlinien verhindern Verbindungsfreigaben über ein geschütztes " -"WiFi-Netzwerk" +"WLAN-Netzwerk" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 msgid "System policy prevents sharing connections via an open WiFi network" msgstr "" -"Die Systemrichtlinien verhindern Verbindungsfreigaben über ein offenes WiFi-" +"Die Systemrichtlinien verhindern Verbindungsfreigaben über ein offenes WLAN-" "Netzwerk" +#~ msgid "unable to join netlink group for monitoring link status: %s" +#~ msgstr "" +#~ "Es kann nicht mit einer netlink-Gruppe zur Überwachung der " +#~ "Netzwerkverbindung verbunden werden: %s" + +#~ msgid "unable to connect to netlink: %s" +#~ msgstr "Es kann nicht mit netlink verbunden werden: %s" + +#~ msgid "operation took too long" +#~ msgstr "Vorgang dauerte zu lange" + +#~ msgid "received data from wrong type of sender" +#~ msgstr "Daten von einem falschen Absendertyp erhalten" + +#~ msgid "received data from unexpected sender" +#~ msgstr "Daten von einem unerwarteten Absender erhalten" + +#~ msgid "too much data was sent over socket and some of it was lost" +#~ msgstr "" +#~ "Es wurden zu viele Daten über den Socket gesendet und einige davon sind " +#~ "verloren gegangen" -- cgit v1.2.1 From a08227525c40daf1fd239ab75df4019986a53a86 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 2 Jun 2010 02:16:14 -0700 Subject: core: simplify auth chain permission callback handling --- src/nm-manager-auth.c | 14 ++++++- src/nm-manager-auth.h | 1 - src/nm-manager.c | 114 ++++++++++++++++---------------------------------- 3 files changed, 49 insertions(+), 80 deletions(-) diff --git a/src/nm-manager-auth.c b/src/nm-manager-auth.c index 7d6bcddf77..bc257e979f 100644 --- a/src/nm-manager-auth.c +++ b/src/nm-manager-auth.c @@ -61,11 +61,21 @@ free_data (gpointer data) g_free (tmp); } +static void +default_call_func (NMAuthChain *chain, + const char *permission, + GError *error, + NMAuthCallResult result, + gpointer user_data) +{ + if (!error) + nm_auth_chain_set_data (chain, permission, GUINT_TO_POINTER (result), NULL); +} + NMAuthChain * nm_auth_chain_new (PolkitAuthority *authority, DBusGMethodInvocation *context, NMAuthChainResultFunc done_func, - NMAuthChainCallFunc call_func, gpointer user_data) { NMAuthChain *self; @@ -75,7 +85,7 @@ nm_auth_chain_new (PolkitAuthority *authority, self->authority = g_object_ref (authority); self->data = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, free_data); self->done_func = done_func; - self->call_func = call_func; + self->call_func = /* call_func ? call_func : */ default_call_func; self->context = context; self->user_data = user_data; return self; diff --git a/src/nm-manager-auth.h b/src/nm-manager-auth.h index ba27b474b9..14e130115e 100644 --- a/src/nm-manager-auth.h +++ b/src/nm-manager-auth.h @@ -57,7 +57,6 @@ typedef void (*NMAuthChainCallFunc) (NMAuthChain *chain, NMAuthChain *nm_auth_chain_new (PolkitAuthority *authority, DBusGMethodInvocation *context, NMAuthChainResultFunc done_func, - NMAuthChainCallFunc call_func, gpointer user_data); gpointer nm_auth_chain_get_data (NMAuthChain *chain, const char *tag); diff --git a/src/nm-manager.c b/src/nm-manager.c index ecd25f3612..eaad533e45 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -2823,10 +2823,9 @@ sleep_auth_done_cb (NMAuthChain *chain, NMAuthCallResult result; gboolean do_sleep; - result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, "result")); - do_sleep = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, "sleep")); - priv->auth_chains = g_slist_remove (priv->auth_chains, chain); + + result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, NM_AUTH_PERMISSION_SLEEP_WAKE)); if (error) { nm_log_dbg (LOGD_CORE, "Sleep/wake request failed: %s", error->message); ret_error = g_error_new (NM_MANAGER_ERROR, @@ -2842,6 +2841,8 @@ sleep_auth_done_cb (NMAuthChain *chain, dbus_g_method_return_error (context, ret_error); g_error_free (ret_error); } else { + /* Auth success */ + do_sleep = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, "sleep")); _internal_sleep (self, do_sleep); dbus_g_method_return (context); } @@ -2849,17 +2850,6 @@ sleep_auth_done_cb (NMAuthChain *chain, nm_auth_chain_unref (chain); } -static void -sleep_auth_call_done_cb (NMAuthChain *chain, - const char *permission, - GError *error, - NMAuthCallResult result, - gpointer user_data) -{ - if (!error) - nm_auth_chain_set_data (chain, "result", GUINT_TO_POINTER (result), NULL); -} - static void impl_manager_sleep (NMManager *self, gboolean do_sleep, @@ -2903,11 +2893,7 @@ impl_manager_sleep (NMManager *self, if (!return_no_pk_error (priv->authority, "Permission", context)) return; - chain = nm_auth_chain_new (priv->authority, - context, - sleep_auth_done_cb, - sleep_auth_call_done_cb, - self); + chain = nm_auth_chain_new (priv->authority, context, sleep_auth_done_cb, self); g_assert (chain); priv->auth_chains = g_slist_append (priv->auth_chains, chain); @@ -2959,10 +2945,9 @@ enable_net_done_cb (NMAuthChain *chain, NMAuthCallResult result; gboolean enable; - result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, "result")); - enable = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, "enable")); - priv->auth_chains = g_slist_remove (priv->auth_chains, chain); + + result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK)); if (error) { nm_log_dbg (LOGD_CORE, "Enable request failed: %s", error->message); ret_error = g_error_new (NM_MANAGER_ERROR, @@ -2978,6 +2963,8 @@ enable_net_done_cb (NMAuthChain *chain, dbus_g_method_return_error (context, ret_error); g_error_free (ret_error); } else { + /* Auth success */ + enable = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, "enable")); _internal_enable (self, enable); dbus_g_method_return (context); } @@ -2985,17 +2972,6 @@ enable_net_done_cb (NMAuthChain *chain, nm_auth_chain_unref (chain); } -static void -enable_net_call_done_cb (NMAuthChain *chain, - const char *permission, - GError *error, - NMAuthCallResult result, - gpointer user_data) -{ - if (!error) - nm_auth_chain_set_data (chain, "result", GUINT_TO_POINTER (result), NULL); -} - static void impl_manager_enable (NMManager *self, gboolean enable, @@ -3039,11 +3015,7 @@ impl_manager_enable (NMManager *self, if (!return_no_pk_error (priv->authority, "Permission", context)) return; - chain = nm_auth_chain_new (priv->authority, - context, - enable_net_done_cb, - enable_net_call_done_cb, - self); + chain = nm_auth_chain_new (priv->authority, context, enable_net_done_cb, self); g_assert (chain); priv->auth_chains = g_slist_append (priv->auth_chains, chain); @@ -3060,6 +3032,23 @@ pk_authority_changed_cb (GObject *object, gpointer user_data) g_signal_emit (NM_MANAGER (user_data), signals[CHECK_PERMISSIONS], 0); } +static void +get_perm_add_result (NMAuthChain *chain, GHashTable *results, const char *permission) +{ + NMAuthCallResult result; + + result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, permission)); + if (result == NM_AUTH_CALL_RESULT_YES) + g_hash_table_insert (results, (char *) permission, "yes"); + else if (result == NM_AUTH_CALL_RESULT_NO) + g_hash_table_insert (results, (char *) permission, "no"); + else if (result == NM_AUTH_CALL_RESULT_AUTH) + g_hash_table_insert (results, (char *) permission, "auth"); + else { + nm_log_dbg (LOGD_CORE, "unknown auth chain result %d", result); + } +} + static void get_permissions_done_cb (NMAuthChain *chain, GError *error, @@ -3069,6 +3058,7 @@ get_permissions_done_cb (NMAuthChain *chain, NMManager *self = NM_MANAGER (user_data); NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); GError *ret_error; + GHashTable *results; priv->auth_chains = g_slist_remove (priv->auth_chains, chain); if (error) { @@ -3080,48 +3070,25 @@ get_permissions_done_cb (NMAuthChain *chain, dbus_g_method_return_error (context, ret_error); g_error_free (ret_error); } else { - dbus_g_method_return (context, nm_auth_chain_get_data (chain, "results")); + results = g_hash_table_new (g_str_hash, g_str_equal); + get_perm_add_result (chain, results, NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK); + get_perm_add_result (chain, results, NM_AUTH_PERMISSION_SLEEP_WAKE); + get_perm_add_result (chain, results, NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI); + get_perm_add_result (chain, results, NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN); + get_perm_add_result (chain, results, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS); + dbus_g_method_return (context, results); + g_hash_table_destroy (results); } nm_auth_chain_unref (chain); } -static void -get_permissions_call_done_cb (NMAuthChain *chain, - const char *permission, - GError *error, - guint result, - gpointer user_data) -{ - GHashTable *hash; - const char *str_result = NULL; - - if (error) - return; - - hash = nm_auth_chain_get_data (chain, "results"); - - if (result == NM_AUTH_CALL_RESULT_YES) - str_result = "yes"; - else if (result == NM_AUTH_CALL_RESULT_NO) - str_result = "no"; - else if (result == NM_AUTH_CALL_RESULT_AUTH) - str_result = "auth"; - else { - nm_log_dbg (LOGD_CORE, "unknown auth chain result %d", result); - } - - if (str_result) - g_hash_table_insert (hash, g_strdup (permission), g_strdup (str_result)); -} - static void impl_manager_get_permissions (NMManager *self, DBusGMethodInvocation *context) { NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); NMAuthChain *chain; - GHashTable *results; if (!priv->authority) { GError *error; @@ -3134,17 +3101,10 @@ impl_manager_get_permissions (NMManager *self, return; } - chain = nm_auth_chain_new (priv->authority, - context, - get_permissions_done_cb, - get_permissions_call_done_cb, - self); + chain = nm_auth_chain_new (priv->authority, context, get_permissions_done_cb, self); g_assert (chain); priv->auth_chains = g_slist_append (priv->auth_chains, chain); - results = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); - nm_auth_chain_set_data (chain, "results", results, (GDestroyNotify) g_hash_table_destroy); - nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK, FALSE); nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_SLEEP_WAKE, FALSE); nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI, FALSE); -- cgit v1.2.1 From 299ab139e4058da7f89defc148940e0a67b9a90e Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 2 Jun 2010 02:23:51 -0700 Subject: core: add policy for overall network control Allows for locking down connections completely and disallowing certain users from touching networking at all. --- policy/org.freedesktop.NetworkManager.policy.in | 9 +++++++++ src/nm-manager-auth.h | 1 + src/nm-manager.c | 2 ++ 3 files changed, 12 insertions(+) diff --git a/policy/org.freedesktop.NetworkManager.policy.in b/policy/org.freedesktop.NetworkManager.policy.in index a912872491..e6540655d4 100644 --- a/policy/org.freedesktop.NetworkManager.policy.in +++ b/policy/org.freedesktop.NetworkManager.policy.in @@ -54,5 +54,14 @@ + + <_description>Allow control of network connections + <_message>System policy prevents control of network connections + + yes + yes + + + diff --git a/src/nm-manager-auth.h b/src/nm-manager-auth.h index 14e130115e..44bb309973 100644 --- a/src/nm-manager-auth.h +++ b/src/nm-manager-auth.h @@ -32,6 +32,7 @@ #define NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI "org.freedesktop.NetworkManager.enable-disable-wifi" #define NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN "org.freedesktop.NetworkManager.enable-disable-wwan" #define NM_AUTH_PERMISSION_USE_USER_CONNECTIONS "org.freedesktop.NetworkManager.use-user-connections" +#define NM_AUTH_PERMISSION_NETWORK_CONTROL "org.freedesktop.NetworkManager.network-control" typedef struct NMAuthChain NMAuthChain; diff --git a/src/nm-manager.c b/src/nm-manager.c index eaad533e45..874433a1e2 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -3076,6 +3076,7 @@ get_permissions_done_cb (NMAuthChain *chain, get_perm_add_result (chain, results, NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI); get_perm_add_result (chain, results, NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN); get_perm_add_result (chain, results, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS); + get_perm_add_result (chain, results, NM_AUTH_PERMISSION_NETWORK_CONTROL); dbus_g_method_return (context, results); g_hash_table_destroy (results); } @@ -3110,6 +3111,7 @@ impl_manager_get_permissions (NMManager *self, nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI, FALSE); nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN, FALSE); nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS, FALSE); + nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL, FALSE); } /* Legacy 0.6 compatibility interface */ -- cgit v1.2.1 From f31022bfbc6c6cc8eda2fa17e8af527aa494bf32 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 2 Jun 2010 11:20:38 -0700 Subject: core: use return_no_pk_error() more and fix returned error messages --- src/nm-manager.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 874433a1e2..b91ba1348a 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -2780,8 +2780,6 @@ return_no_pk_error (PolkitAuthority *authority, { GError *error; - g_assert (context); - if (!authority) { error = g_error_new (NM_MANAGER_ERROR, NM_MANAGER_ERROR_PERMISSION_DENIED, @@ -2890,7 +2888,7 @@ impl_manager_sleep (NMManager *self, return; } - if (!return_no_pk_error (priv->authority, "Permission", context)) + if (!return_no_pk_error (priv->authority, "Sleep/wake", context)) return; chain = nm_auth_chain_new (priv->authority, context, sleep_auth_done_cb, self); @@ -3012,7 +3010,7 @@ impl_manager_enable (NMManager *self, return; } - if (!return_no_pk_error (priv->authority, "Permission", context)) + if (!return_no_pk_error (priv->authority, "Enable/disable", context)) return; chain = nm_auth_chain_new (priv->authority, context, enable_net_done_cb, self); @@ -3091,16 +3089,8 @@ impl_manager_get_permissions (NMManager *self, NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); NMAuthChain *chain; - if (!priv->authority) { - GError *error; - - error = g_error_new_literal (NM_MANAGER_ERROR, - NM_MANAGER_ERROR_PERMISSION_DENIED, - "Permissions request failed: PolicyKit not initialized"); - dbus_g_method_return_error (context, error); - g_error_free (error); + if (!return_no_pk_error (priv->authority, "Permissions", context)) return; - } chain = nm_auth_chain_new (priv->authority, context, get_permissions_done_cb, self); g_assert (chain); -- cgit v1.2.1 From 78c4e0798e49001fc903133f3dc537f8922581ca Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 3 Jun 2010 13:03:07 -0700 Subject: core: check permissions on the user settings service too And if the permissions change, make sure we allow or deny user settings connections as appropriate. --- src/nm-manager-auth.c | 27 ++++-- src/nm-manager-auth.h | 1 + src/nm-manager.c | 244 ++++++++++++++++++++++++++++++++++++++++---------- 3 files changed, 219 insertions(+), 53 deletions(-) diff --git a/src/nm-manager-auth.c b/src/nm-manager-auth.c index bc257e979f..56ab1af1fe 100644 --- a/src/nm-manager-auth.c +++ b/src/nm-manager-auth.c @@ -31,6 +31,7 @@ struct NMAuthChain { GHashTable *data; DBusGMethodInvocation *context; + char *owner; GError *error; NMAuthChainResultFunc done_func; @@ -75,19 +76,35 @@ default_call_func (NMAuthChain *chain, NMAuthChain * nm_auth_chain_new (PolkitAuthority *authority, DBusGMethodInvocation *context, + DBusGProxy *proxy, NMAuthChainResultFunc done_func, gpointer user_data) { NMAuthChain *self; + g_return_val_if_fail (context || proxy, NULL); + self = g_malloc0 (sizeof (NMAuthChain)); self->refcount = 1; self->authority = g_object_ref (authority); self->data = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, free_data); self->done_func = done_func; self->call_func = /* call_func ? call_func : */ default_call_func; - self->context = context; self->user_data = user_data; + self->context = context; + + if (proxy) + self->owner = g_strdup (dbus_g_proxy_get_bus_name (proxy)); + else if (context) + self->owner = dbus_g_method_get_sender (context); + + if (!self->owner) { + /* Need an owner */ + g_warn_if_fail (self->owner); + nm_auth_chain_unref (self); + self = NULL; + } + return self; } @@ -214,17 +231,14 @@ nm_auth_chain_add_call (NMAuthChain *self, gboolean allow_interaction) { PolkitCall *call; - char *sender; PolkitSubject *subject; PolkitCheckAuthorizationFlags flags = POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE; g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (self->context != NULL, FALSE); + g_return_val_if_fail (self->owner != NULL, FALSE); g_return_val_if_fail (permission != NULL, FALSE); - sender = dbus_g_method_get_sender (self->context); - subject = polkit_system_bus_name_new (sender); - g_free (sender); + subject = polkit_system_bus_name_new (self->owner); if (!subject) return FALSE; @@ -262,6 +276,7 @@ nm_auth_chain_unref (NMAuthChain *self) return; g_object_unref (self->authority); + g_free (self->owner); for (iter = self->calls; iter; iter = g_slist_next (iter)) polkit_call_cancel ((PolkitCall *) iter->data); diff --git a/src/nm-manager-auth.h b/src/nm-manager-auth.h index 44bb309973..6eedb28369 100644 --- a/src/nm-manager-auth.h +++ b/src/nm-manager-auth.h @@ -57,6 +57,7 @@ typedef void (*NMAuthChainCallFunc) (NMAuthChain *chain, NMAuthChain *nm_auth_chain_new (PolkitAuthority *authority, DBusGMethodInvocation *context, + DBusGProxy *proxy, NMAuthChainResultFunc done_func, gpointer user_data); diff --git a/src/nm-manager.c b/src/nm-manager.c index b91ba1348a..ac7eb2ea65 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -95,8 +95,6 @@ static gboolean impl_manager_legacy_state (NMManager *manager, guint32 *state, G #include "nm-manager-glue.h" -static void user_destroy_connections (NMManager *manager); - static void connection_added_default_handler (NMManager *manager, NMConnection *connection, NMConnectionScope scope); @@ -186,6 +184,8 @@ typedef struct { GHashTable *user_connections; DBusGProxy *user_proxy; + NMAuthCallResult user_con_perm; + NMAuthCallResult user_net_perm; GHashTable *system_connections; NMSysconfigSettings *sys_settings; @@ -703,19 +703,27 @@ remove_connection (NMManager *manager, /*******************************************************************/ static void -user_destroy_connections (NMManager *manager) +user_proxy_cleanup (NMManager *self, gboolean resync_bt) { - NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); if (priv->user_connections) { - g_hash_table_foreach (priv->user_connections, emit_removed, manager); + g_hash_table_foreach (priv->user_connections, emit_removed, self); g_hash_table_remove_all (priv->user_connections); } + priv->user_net_perm = NM_AUTH_CALL_RESULT_UNKNOWN; + priv->user_con_perm = NM_AUTH_CALL_RESULT_UNKNOWN; + if (priv->user_proxy) { g_object_unref (priv->user_proxy); priv->user_proxy = NULL; } + + if (resync_bt) { + /* Resync BT devices since they are generated from connections */ + bluez_manager_resync_devices (self); + } } typedef struct GetSettingsInfo { @@ -996,50 +1004,144 @@ out: return; } +static void +user_proxy_destroyed_cb (DBusGProxy *proxy, NMManager *self) +{ + nm_log_dbg (LOGD_USER_SET, "Removing user connections..."); + + /* At this point the user proxy is already being disposed */ + NM_MANAGER_GET_PRIVATE (self)->user_proxy = NULL; + + /* User Settings service disappeared; throw away user connections */ + user_proxy_cleanup (self, TRUE); +} + static void user_new_connection_cb (DBusGProxy *proxy, const char *path, gpointer user_data) { user_internal_new_connection_cb (proxy, path, NM_MANAGER (user_data), NULL); } +static gboolean +user_settings_authorized (NMManager *self, NMAuthChain *chain) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + + /* If the user could potentially get authorization to use networking and/or + * to use user connections, the user settings service is authorized. + */ + priv->user_net_perm = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL)); + priv->user_con_perm = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS)); + + nm_log_dbg (LOGD_USER_SET, "User connections permissions: net %d, con %d", + priv->user_net_perm, priv->user_con_perm); + + /* If the user can't control the network they certainly aren't allowed + * to provide user connections. + */ + if ( priv->user_net_perm == NM_AUTH_CALL_RESULT_UNKNOWN + || priv->user_net_perm == NM_AUTH_CALL_RESULT_NO) + return FALSE; + + /* And of course if they aren't allowed to use user connections, they can't + * provide them either. + */ + if ( priv->user_con_perm == NM_AUTH_CALL_RESULT_UNKNOWN + || priv->user_con_perm == NM_AUTH_CALL_RESULT_NO) + return FALSE; + + return TRUE; +} + static void -user_query_connections (NMManager *manager) +user_proxy_auth_done (NMAuthChain *chain, + GError *error, + DBusGMethodInvocation *context, + gpointer user_data) { - NMManagerPrivate *priv; - DBusGProxyCall *call; - DBusGConnection *g_connection; + NMManager *self = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + gboolean authorized = FALSE; - g_return_if_fail (NM_IS_MANAGER (manager)); + priv->auth_chains = g_slist_remove (priv->auth_chains, chain); - priv = NM_MANAGER_GET_PRIVATE (manager); - if (!priv->user_proxy) { - g_connection = nm_dbus_manager_get_connection (priv->dbus_mgr); - priv->user_proxy = dbus_g_proxy_new_for_name (g_connection, - NM_DBUS_SERVICE_USER_SETTINGS, - NM_DBUS_PATH_SETTINGS, - NM_DBUS_IFACE_SETTINGS); - if (!priv->user_proxy) { - nm_log_err (LOGD_USER_SET, "could not init user settings proxy"); - return; - } + if (error) { + nm_log_warn (LOGD_USER_SET, "User connections unavailable: (%d) %s", + error->code, error->message ? error->message : "(unknown)"); + } else + authorized = user_settings_authorized (self, chain); - dbus_g_proxy_add_signal (priv->user_proxy, - "NewConnection", - DBUS_TYPE_G_OBJECT_PATH, - G_TYPE_INVALID); + if (authorized) { + /* If authorized, finish setting up the user settings service proxy */ + nm_log_dbg (LOGD_USER_SET, "Requesting user connections..."); + authorized = TRUE; + + dbus_g_proxy_add_signal (priv->user_proxy, + "NewConnection", + DBUS_TYPE_G_OBJECT_PATH, + G_TYPE_INVALID); dbus_g_proxy_connect_signal (priv->user_proxy, "NewConnection", - G_CALLBACK (user_new_connection_cb), - manager, - NULL); + G_CALLBACK (user_new_connection_cb), + self, + NULL); + + /* Clean up when the user settings proxy goes away */ + g_signal_connect (priv->user_proxy, "destroy", + G_CALLBACK (user_proxy_destroyed_cb), + self); + + /* Request user connections */ + dbus_g_proxy_begin_call (priv->user_proxy, "ListConnections", + user_list_connections_cb, + self, + NULL, + G_TYPE_INVALID); + } else { + /* Otherwise, we ignore the user settings service completely */ + user_proxy_cleanup (self, TRUE); } - /* grab connections */ - call = dbus_g_proxy_begin_call (priv->user_proxy, "ListConnections", - user_list_connections_cb, - manager, - NULL, - G_TYPE_INVALID); + nm_auth_chain_unref (chain); +} + +static void +user_proxy_init (NMManager *self) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + DBusGConnection *bus; + NMAuthChain *chain; + GError *error = NULL; + + g_return_if_fail (self != NULL); + g_return_if_fail (priv->user_proxy == NULL); + + bus = nm_dbus_manager_get_connection (priv->dbus_mgr); + priv->user_proxy = dbus_g_proxy_new_for_name_owner (bus, + NM_DBUS_SERVICE_USER_SETTINGS, + NM_DBUS_PATH_SETTINGS, + NM_DBUS_IFACE_SETTINGS, + &error); + if (!priv->user_proxy) { + nm_log_err (LOGD_USER_SET, "could not init user settings proxy: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); + return; + } + + /* Kick off some PolicyKit authorization requests to figure out what + * permissions this user settings service has. + */ + chain = nm_auth_chain_new (priv->authority, + NULL, + priv->user_proxy, + user_proxy_auth_done, + self); + priv->auth_chains = g_slist_prepend (priv->auth_chains, chain); + + nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS, FALSE); + nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL, FALSE); } /*******************************************************************/ @@ -1221,14 +1323,10 @@ nm_manager_name_owner_changed (NMDBusManager *mgr, gboolean new_owner_good = (new && (strlen (new) > 0)); if (strcmp (name, NM_DBUS_SERVICE_USER_SETTINGS) == 0) { - if (!old_owner_good && new_owner_good) { - /* User Settings service appeared, update stuff */ - user_query_connections (manager); - } else { - /* User Settings service disappeared, throw them away (?) */ - user_destroy_connections (manager); - bluez_manager_resync_devices (manager); - } + if (!old_owner_good && new_owner_good) + user_proxy_init (manager); + else + user_proxy_cleanup (manager, TRUE); } } @@ -2891,7 +2989,7 @@ impl_manager_sleep (NMManager *self, if (!return_no_pk_error (priv->authority, "Sleep/wake", context)) return; - chain = nm_auth_chain_new (priv->authority, context, sleep_auth_done_cb, self); + chain = nm_auth_chain_new (priv->authority, context, NULL, sleep_auth_done_cb, self); g_assert (chain); priv->auth_chains = g_slist_append (priv->auth_chains, chain); @@ -3013,7 +3111,7 @@ impl_manager_enable (NMManager *self, if (!return_no_pk_error (priv->authority, "Enable/disable", context)) return; - chain = nm_auth_chain_new (priv->authority, context, enable_net_done_cb, self); + chain = nm_auth_chain_new (priv->authority, context, NULL, enable_net_done_cb, self); g_assert (chain); priv->auth_chains = g_slist_append (priv->auth_chains, chain); @@ -3023,9 +3121,61 @@ impl_manager_enable (NMManager *self, /* Permissions */ +static void +user_proxy_permissions_changed_done (NMAuthChain *chain, + GError *error, + DBusGMethodInvocation *context, + gpointer user_data) +{ + NMManager *self = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + gboolean authorized = FALSE; + + priv->auth_chains = g_slist_remove (priv->auth_chains, chain); + + if (error) { + nm_log_warn (LOGD_USER_SET, "User connections unavailable: (%d) %s", + error->code, error->message ? error->message : "(unknown)"); + } else + authorized = user_settings_authorized (self, chain); + + if (authorized) { + /* User connections are authorized */ + if (!priv->user_proxy) + user_proxy_init (self); + } else + user_proxy_cleanup (self, TRUE); + + nm_auth_chain_unref (chain); +} + static void pk_authority_changed_cb (GObject *object, gpointer user_data) { + NMManager *self = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + NMAuthChain *chain; + + /* If the user settings service wasn't previously authorized, we wouldn't + * care about it. But it might be authorized now, so lets check. + */ + if (!priv->user_proxy) + user_proxy_init (self); + else { + /* Otherwise the user settings permissions could have changed so we + * need to recheck them. + */ + chain = nm_auth_chain_new (priv->authority, + NULL, + priv->user_proxy, + user_proxy_permissions_changed_done, + self); + priv->auth_chains = g_slist_prepend (priv->auth_chains, chain); + + nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS, FALSE); + nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL, FALSE); + } + /* Let clients know they should re-check their authorization */ g_signal_emit (NM_MANAGER (user_data), signals[CHECK_PERMISSIONS], 0); } @@ -3092,7 +3242,7 @@ impl_manager_get_permissions (NMManager *self, if (!return_no_pk_error (priv->authority, "Permissions", context)) return; - chain = nm_auth_chain_new (priv->authority, context, get_permissions_done_cb, self); + chain = nm_auth_chain_new (priv->authority, context, NULL, get_permissions_done_cb, self); g_assert (chain); priv->auth_chains = g_slist_append (priv->auth_chains, chain); @@ -3284,7 +3434,7 @@ nm_manager_start (NMManager *self) * bus in nm_manager_name_owner_changed(). */ if (nm_dbus_manager_name_has_owner (priv->dbus_mgr, NM_DBUS_SERVICE_USER_SETTINGS)) - user_query_connections (self); + user_proxy_init (self); nm_udev_manager_query_devices (priv->udev_mgr); bluez_manager_resync_devices (self); @@ -3408,7 +3558,7 @@ dispose (GObject *object) FALSE); } - user_destroy_connections (manager); + user_proxy_cleanup (manager, FALSE); g_hash_table_destroy (priv->user_connections); priv->user_connections = NULL; -- cgit v1.2.1 From 6cbe50ffbd861fc705035fd17f6a88eb58377890 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 3 Jun 2010 23:04:10 -0700 Subject: core: add nm_auth_uid_authorized() to check user permissions Basically cleaned up is_user_request_authorized() from nm-manager.c. --- src/nm-manager-auth.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/nm-manager-auth.h | 5 +++++ 2 files changed, 67 insertions(+) diff --git a/src/nm-manager-auth.c b/src/nm-manager-auth.c index 56ab1af1fe..5bd480f385 100644 --- a/src/nm-manager-auth.c +++ b/src/nm-manager-auth.c @@ -338,3 +338,65 @@ out: return success; } +gboolean +nm_auth_uid_authorized (gulong uid, + NMDBusManager *dbus_mgr, + DBusGProxy *user_proxy, + const char **out_error_desc) +{ + DBusConnection *connection; + DBusError dbus_error; + char *service_owner = NULL; + const char *service_name; + gulong service_uid = G_MAXULONG; + + g_return_val_if_fail (dbus_mgr != NULL, FALSE); + g_return_val_if_fail (out_error_desc != NULL, FALSE); + + /* Ensure the request to activate the user connection came from the + * same session as the user settings service. FIXME: use ConsoleKit + * too. + */ + + if (!user_proxy) { + *out_error_desc = "No user settings service available"; + return FALSE; + } + + service_name = dbus_g_proxy_get_bus_name (user_proxy); + if (!service_name) { + *out_error_desc = "Could not determine user settings service name"; + return FALSE; + } + + connection = nm_dbus_manager_get_dbus_connection (dbus_mgr); + if (!connection) { + *out_error_desc = "Could not get the D-Bus system bus"; + return FALSE; + } + + service_owner = nm_dbus_manager_get_name_owner (dbus_mgr, service_name, NULL); + if (!service_owner) { + *out_error_desc = "Could not determine D-Bus owner of the user settings service"; + return FALSE; + } + + dbus_error_init (&dbus_error); + service_uid = dbus_bus_get_unix_user (connection, service_owner, &dbus_error); + g_free (service_owner); + + if (dbus_error_is_set (&dbus_error)) { + dbus_error_free (&dbus_error); + *out_error_desc = "Could not determine the Unix UID of the sender of the request"; + return FALSE; + } + + /* And finally, the actual UID check */ + if (uid != service_uid) { + *out_error_desc = "Requestor UID does not match the UID of the user settings service"; + return FALSE; + } + + return TRUE; +} + diff --git a/src/nm-manager-auth.h b/src/nm-manager-auth.h index 6eedb28369..dab32b0f54 100644 --- a/src/nm-manager-auth.h +++ b/src/nm-manager-auth.h @@ -80,5 +80,10 @@ gboolean nm_auth_get_caller_uid (DBusGMethodInvocation *context, gulong *out_uid, const char **out_error_desc); +gboolean nm_auth_uid_authorized (gulong uid, + NMDBusManager *dbus_mgr, + DBusGProxy *user_proxy, + const char **out_error_desc); + #endif /* NM_MANAGER_AUTH_H */ -- cgit v1.2.1 From 25e758c77041bec8014a4f28333dd9ccd559487e Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 3 Jun 2010 23:20:11 -0700 Subject: core: PolicyKit protect connection activation --- src/nm-manager.c | 452 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 276 insertions(+), 176 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index ac7eb2ea65..7560b81afb 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -61,11 +61,11 @@ static gboolean impl_manager_get_devices (NMManager *manager, GPtrArray **devices, GError **err); static void impl_manager_activate_connection (NMManager *manager, - const char *service_name, - const char *connection_path, - const char *device_path, - const char *specific_object_path, - DBusGMethodInvocation *context); + const char *service_name, + const char *connection_path, + const char *device_path, + const char *specific_object_path, + DBusGMethodInvocation *context); static gboolean impl_manager_deactivate_connection (NMManager *manager, const char *connection_path, @@ -147,18 +147,27 @@ static NMDevice *nm_manager_get_device_by_udi (NMManager *manager, const char *u #define SSD_POKE_INTERVAL 120 #define ORIGDEV_TAG "originating-device" -typedef struct { +typedef struct PendingActivation PendingActivation; +typedef void (*PendingActivationFunc) (PendingActivation *pending, + GError *error); + +struct PendingActivation { NMManager *manager; - /* More than one caller may have requested this connection */ - GSList *contexts; + DBusGMethodInvocation *context; + PolkitAuthority *authority; + PendingActivationFunc callback; + NMAuthChain *chain; + + gboolean have_connection; + gboolean authorized; NMConnectionScope scope; char *connection_path; char *specific_object_path; char *device_path; guint timeout_id; -} PendingActivation; +}; typedef struct { gboolean enabled; @@ -587,33 +596,178 @@ nm_manager_pending_activation_remove (NMManager *self, static PendingActivation * pending_activation_new (NMManager *manager, + PolkitAuthority *authority, + DBusGMethodInvocation *context, const char *device_path, NMConnectionScope scope, const char *connection_path, - const char *specific_object_path) + const char *specific_object_path, + PendingActivationFunc callback) { - NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); PendingActivation *pending; + g_return_val_if_fail (manager != NULL, NULL); + g_return_val_if_fail (authority != NULL, NULL); + g_return_val_if_fail (context != NULL, NULL); + g_return_val_if_fail (device_path != NULL, NULL); + g_return_val_if_fail (connection_path != NULL, NULL); + pending = g_slice_new0 (PendingActivation); pending->manager = manager; + pending->authority = authority; + pending->context = context; + pending->callback = callback; + pending->device_path = g_strdup (device_path); pending->scope = scope; pending->connection_path = g_strdup (connection_path); - pending->specific_object_path = g_strdup (specific_object_path); - priv->pending_activations = g_slist_append (priv->pending_activations, pending); + /* "/" is special-cased to NULL to get through D-Bus */ + if (specific_object_path && strcmp (specific_object_path, "/")) + pending->specific_object_path = g_strdup (specific_object_path); return pending; } static void -pending_activation_add_caller (PendingActivation *pending, - DBusGMethodInvocation *context) +pending_auth_user_done (NMAuthChain *chain, + GError *error, + DBusGMethodInvocation *context, + gpointer user_data) +{ + PendingActivation *pending = user_data; + NMAuthCallResult result; + + pending->chain = NULL; + + if (error) { + pending->callback (pending, error); + goto out; + } + + /* Caller has had a chance to obtain authorization, so we only need to + * check for 'yes' here. + */ + result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS)); + if (result != NM_AUTH_CALL_RESULT_YES) { + error = g_error_new_literal (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + "Not authorized to use user connections."); + pending->callback (pending, error); + g_error_free (error); + } else + pending->callback (pending, NULL); + +out: + nm_auth_chain_unref (chain); +} + +static void +pending_auth_net_done (NMAuthChain *chain, + GError *error, + DBusGMethodInvocation *context, + gpointer user_data) +{ + PendingActivation *pending = user_data; + NMAuthCallResult result; + + pending->chain = NULL; + + if (error) { + pending->callback (pending, error); + goto out; + } + + /* Caller has had a chance to obtain authorization, so we only need to + * check for 'yes' here. + */ + result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL)); + if (result != NM_AUTH_CALL_RESULT_YES) { + error = g_error_new_literal (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + "Not authorized to control networking."); + pending->callback (pending, error); + g_error_free (error); + goto out; + } + + if (pending->scope == NM_CONNECTION_SCOPE_SYSTEM) { + /* System connection and the user is authorized for that if they have + * the network-control permission. + */ + pending->callback (pending, NULL); + } else { + g_assert (pending->scope == NM_CONNECTION_SCOPE_USER); + + /* User connection, check the 'use-user-connections' permission */ + pending->chain = nm_auth_chain_new (pending->authority, + pending->context, + NULL, + pending_auth_user_done, + pending); + nm_auth_chain_add_call (pending->chain, + NM_AUTH_PERMISSION_USE_USER_CONNECTIONS, + TRUE); + } + +out: + nm_auth_chain_unref (chain); +} + +static void +pending_activation_check_authorized (PendingActivation *pending, + NMDBusManager *dbus_mgr, + DBusGProxy *user_proxy) { - /* Ensure no dupes */ - if (!g_slist_find (pending->contexts, context)) - pending->contexts = g_slist_prepend (pending->contexts, context); + const char *error_desc = NULL; + gulong sender_uid = G_MAXULONG; + GError *error; + + g_return_if_fail (pending != NULL); + g_return_if_fail (dbus_mgr != NULL); + g_return_if_fail (user_proxy != NULL); + + /* Get the UID */ + if (!nm_auth_get_caller_uid (pending->context, dbus_mgr, &sender_uid, &error_desc)) { + error = g_error_new_literal (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + error_desc); + pending->callback (pending, error); + g_error_free (error); + return; + } + + /* root gets to do anything */ + if (0 == sender_uid) { + pending->callback (pending, NULL); + return; + } + + /* Check whether the UID is authorized for user connections */ + if ( pending->scope == NM_CONNECTION_SCOPE_USER + && !nm_auth_uid_authorized (sender_uid, + dbus_mgr, + user_proxy, + &error_desc)) { + error = g_error_new_literal (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + error_desc); + pending->callback (pending, error); + g_error_free (error); + return; + } + + /* First check if the user is allowed to use networking at all, giving + * the user a chance to authenticate to gain the permission. + */ + pending->chain = nm_auth_chain_new (pending->authority, + pending->context, + NULL, + pending_auth_net_done, + pending); + nm_auth_chain_add_call (pending->chain, + NM_AUTH_PERMISSION_NETWORK_CONTROL, + TRUE); } static void @@ -621,8 +775,6 @@ pending_activation_destroy (PendingActivation *pending, GError *error, const char *ac_path) { - GSList *iter; - g_return_if_fail (pending != NULL); if (pending->timeout_id) @@ -631,16 +783,13 @@ pending_activation_destroy (PendingActivation *pending, g_free (pending->specific_object_path); g_free (pending->device_path); - /* Send a reply (either error or the ActiveConnection path) if needed */ - for (iter = pending->contexts; iter; iter = g_slist_next (iter)) { - DBusGMethodInvocation *context = iter->data; + if (error) + dbus_g_method_return_error (pending->context, error); + else if (ac_path) + dbus_g_method_return (pending->context, ac_path); - if (error) - dbus_g_method_return_error (context, error); - else if (ac_path) - dbus_g_method_return (context, ac_path); - } - g_slist_free (pending->contexts); + if (pending->chain) + nm_auth_chain_unref (pending->chain); memset (pending, 0, sizeof (PendingActivation)); g_slice_free (PendingActivation, pending); @@ -1016,10 +1165,33 @@ user_proxy_destroyed_cb (DBusGProxy *proxy, NMManager *self) user_proxy_cleanup (self, TRUE); } +typedef struct { + DBusGProxy *proxy; + char *path; + NMManager *manager; +} Foo; + +static gboolean +blah (gpointer user_data) +{ + Foo *f = user_data; + + user_internal_new_connection_cb (f->proxy, f->path, f->manager, NULL); + g_free (f->path); + g_free (f); + return FALSE; +} + static void user_new_connection_cb (DBusGProxy *proxy, const char *path, gpointer user_data) { - user_internal_new_connection_cb (proxy, path, NM_MANAGER (user_data), NULL); + Foo *f = g_malloc0 (sizeof (Foo)); + + f->proxy = proxy; + f->path = g_strdup (path); + f->manager = NM_MANAGER (user_data); + + g_timeout_add_seconds (6, blah, f); } static gboolean @@ -2415,7 +2587,7 @@ wait_for_connection_expired (gpointer data) g_return_val_if_fail (pending != NULL, FALSE); nm_log_warn (LOGD_CORE, "connection %s (scope %d) failed to activate (timeout)", - pending->scope, pending->connection_path); + pending->connection_path, pending->scope); nm_manager_pending_activation_remove (pending->manager, pending); @@ -2552,24 +2724,30 @@ nm_manager_pending_activation_find (NMManager *self, } static void -connection_added_default_handler (NMManager *manager, - NMConnection *connection, - NMConnectionScope scope) +check_pending_ready (NMManager *self, PendingActivation *pending) { - PendingActivation *pending; + NMConnection *connection; const char *path = NULL; GError *error = NULL; - pending = nm_manager_pending_activation_find (manager, - nm_connection_get_path (connection), - scope); - if (!pending) + if (!pending->have_connection || !pending->authorized) return; - /* Will destroy below; can't be valid during the initial activation start */ - nm_manager_pending_activation_remove (manager, pending); + /* Ok, we're authorized and the connection is available */ - path = nm_manager_activate_connection (manager, + nm_manager_pending_activation_remove (self, pending); + + connection = nm_manager_get_connection_by_object_path (self, + pending->scope, + pending->connection_path); + if (!connection) { + error = g_error_new_literal (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_UNKNOWN_CONNECTION, + "Connection could not be found."); + goto out; + } + + path = nm_manager_activate_connection (self, connection, pending->specific_object_path, pending->device_path, @@ -2577,174 +2755,96 @@ connection_added_default_handler (NMManager *manager, &error); if (!path) { nm_log_warn (LOGD_CORE, "connection (%d) %s failed to activate: (%d) %s", - scope, pending->connection_path, error->code, error->message); + pending->scope, pending->connection_path, error->code, error->message); } else - g_object_notify (G_OBJECT (manager), NM_MANAGER_ACTIVE_CONNECTIONS); + g_object_notify (G_OBJECT (pending->manager), NM_MANAGER_ACTIVE_CONNECTIONS); +out: pending_activation_destroy (pending, error, path); g_clear_error (&error); } -static gboolean -is_user_request_authorized (NMManager *manager, - DBusGMethodInvocation *context, - GError **error) +static void +connection_added_default_handler (NMManager *self, + NMConnection *connection, + NMConnectionScope scope) { - NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); - DBusConnection *connection; - gulong sender_uid = G_MAXULONG; - DBusError dbus_error; - char *service_owner = NULL; - const char *service_name; - gulong service_uid = G_MAXULONG; - gboolean success = FALSE; - const char *error_desc = NULL; - - /* Ensure the request to activate the user connection came from the - * same session as the user settings service. FIXME: use ConsoleKit - * too. - */ - if (!priv->user_proxy) { - g_set_error (error, NM_MANAGER_ERROR, - NM_MANAGER_ERROR_INVALID_SERVICE, - "%s", "No user settings service available"); - goto out; - } - - if (!nm_auth_get_caller_uid (context, priv->dbus_mgr, &sender_uid, &error_desc)) { - g_set_error_literal (error, - NM_MANAGER_ERROR, - NM_MANAGER_ERROR_PERMISSION_DENIED, - error_desc); - goto out; - } - - /* Let root activate anything */ - if (0 == sender_uid) { - success = TRUE; - goto out; - } + PendingActivation *pending; - service_name = dbus_g_proxy_get_bus_name (priv->user_proxy); - if (!service_name) { - g_set_error (error, NM_MANAGER_ERROR, - NM_MANAGER_ERROR_PERMISSION_DENIED, - "%s", "Could not determine user settings service name"); - goto out; + pending = nm_manager_pending_activation_find (self, + nm_connection_get_path (connection), + scope); + if (pending) { + pending->have_connection = TRUE; + check_pending_ready (self, pending); } +} - service_owner = nm_dbus_manager_get_name_owner (priv->dbus_mgr, service_name, NULL); - if (!service_owner) { - g_set_error (error, NM_MANAGER_ERROR, - NM_MANAGER_ERROR_PERMISSION_DENIED, - "%s", "Could not determine D-Bus owner of the user settings service"); - goto out; - } +static void +activation_auth_done (PendingActivation *pending, GError *error) +{ + if (error) { + nm_manager_pending_activation_remove (pending->manager, pending); + pending_activation_destroy (pending, error, NULL); + return; + } else { + pending->authorized = TRUE; - connection = nm_dbus_manager_get_dbus_connection (priv->dbus_mgr); - if (!connection) { - g_set_error_literal (error, - NM_MANAGER_ERROR, - NM_MANAGER_ERROR_PERMISSION_DENIED, - "Could not get the D-Bus system bus"); - goto out; - } + /* Now that we're authorized, if the connection hasn't shown up yet, + * start a timer and wait for it. + */ + if (!pending->have_connection && !pending->timeout_id) + pending->timeout_id = g_timeout_add_seconds (5, wait_for_connection_expired, pending); - dbus_error_init (&dbus_error); - /* FIXME: do this async */ - service_uid = dbus_bus_get_unix_user (connection, service_owner, &dbus_error); - if (dbus_error_is_set (&dbus_error)) { - dbus_error_free (&dbus_error); - g_set_error (error, NM_MANAGER_ERROR, - NM_MANAGER_ERROR_PERMISSION_DENIED, - "%s", "Could not determine the Unix UID of the sender of the request"); - goto out; + check_pending_ready (pending->manager, pending); } - - /* And finally, the actual UID check */ - if (sender_uid != service_uid) { - g_set_error (error, NM_MANAGER_ERROR, - NM_MANAGER_ERROR_PERMISSION_DENIED, - "%s", "Requestor UID does not match the UID of the user settings service"); - } else - success = TRUE; - -out: - g_free (service_owner); - return success; } - - static void -impl_manager_activate_connection (NMManager *manager, +impl_manager_activate_connection (NMManager *self, const char *service_name, const char *connection_path, const char *device_path, const char *specific_object_path, DBusGMethodInvocation *context) { + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); NMConnectionScope scope = NM_CONNECTION_SCOPE_UNKNOWN; - NMConnection *connection; + PendingActivation *pending; GError *error = NULL; - char *real_sop = NULL; - char *path = NULL; - - if (!strcmp (service_name, NM_DBUS_SERVICE_USER_SETTINGS)) { - if (!is_user_request_authorized (manager, context, &error)) - goto err; + if (!strcmp (service_name, NM_DBUS_SERVICE_USER_SETTINGS)) scope = NM_CONNECTION_SCOPE_USER; - } else if (!strcmp (service_name, NM_DBUS_SERVICE_SYSTEM_SETTINGS)) + else if (!strcmp (service_name, NM_DBUS_SERVICE_SYSTEM_SETTINGS)) scope = NM_CONNECTION_SCOPE_SYSTEM; else { - g_set_error (&error, - NM_MANAGER_ERROR, NM_MANAGER_ERROR_INVALID_SERVICE, - "%s", "Invalid settings service name"); - goto err; - } - - /* "/" is special-cased to NULL to get through D-Bus */ - if (specific_object_path && strcmp (specific_object_path, "/")) - real_sop = g_strdup (specific_object_path); - - connection = nm_manager_get_connection_by_object_path (manager, scope, connection_path); - if (connection) { - path = (char *) nm_manager_activate_connection (manager, - connection, - real_sop, - device_path, - TRUE, - &error); - if (path) { - dbus_g_method_return (context, path); - g_object_notify (G_OBJECT (manager), NM_MANAGER_ACTIVE_CONNECTIONS); - } - } else { - PendingActivation *pending; - - /* Don't have the connection quite yet, probably created by - * the client on-the-fly. Defer the activation until we have it. - */ - - pending = nm_manager_pending_activation_find (manager, connection_path, scope); - if (!pending) { - pending = pending_activation_new (manager, device_path, scope, connection_path, real_sop); - /* Add a timeout waiting for the connection to be added */ - pending->timeout_id = g_timeout_add_seconds (5, wait_for_connection_expired, pending); - } - pending_activation_add_caller (pending, context); - } - - err: - if (error) { + error = g_error_new_literal (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_INVALID_SERVICE, + "Invalid settings service name"); dbus_g_method_return_error (context, error); nm_log_warn (LOGD_CORE, "connection (%d) %s failed to activate: (%d) %s", scope, connection_path, error->code, error->message); g_error_free (error); + return; } - g_free (real_sop); + /* Need to check the caller's permissions and stuff before we can + * activate the connection. + */ + pending = pending_activation_new (self, + priv->authority, + context, + device_path, + scope, + connection_path, + specific_object_path, + activation_auth_done); + priv->pending_activations = g_slist_prepend (priv->pending_activations, pending); + + if (nm_manager_get_connection_by_object_path (self, scope, connection_path)) + pending->have_connection = TRUE; + + pending_activation_check_authorized (pending, priv->dbus_mgr, priv->user_proxy); } gboolean -- cgit v1.2.1 From ae4b47ca998bdbcf844cbaf8a1b9607cabb47c45 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 4 Jun 2010 00:42:10 -0700 Subject: core: PolicyKit protect Deactivate and Disconnect --- introspection/nm-device.xml | 3 +- introspection/nm-manager-client.xml | 3 + introspection/nm-manager.xml | 1 + src/nm-device-interface.c | 19 +- src/nm-device-interface.h | 2 + src/nm-manager.c | 415 +++++++++++++++++++++++++++++++++--- src/vpn-manager/nm-vpn-manager.c | 27 +++ src/vpn-manager/nm-vpn-manager.h | 3 + 8 files changed, 438 insertions(+), 35 deletions(-) diff --git a/introspection/nm-device.xml b/introspection/nm-device.xml index 7a02b73ef2..02b7501344 100644 --- a/introspection/nm-device.xml +++ b/introspection/nm-device.xml @@ -65,10 +65,11 @@ + + Disconnects a device and prevents the device from automatically activating further connections without user intervention. - diff --git a/introspection/nm-manager-client.xml b/introspection/nm-manager-client.xml index 9ede13e3c0..f30d1d671d 100644 --- a/introspection/nm-manager-client.xml +++ b/introspection/nm-manager-client.xml @@ -31,16 +31,19 @@ object. dbus-glib generates the same bound function names for D-Bus the methods + + + diff --git a/introspection/nm-manager.xml b/introspection/nm-manager.xml index 88686566d0..e1b466799f 100644 --- a/introspection/nm-manager.xml +++ b/introspection/nm-manager.xml @@ -77,6 +77,7 @@ Deactivate an active connection. + The currently active connection to deactivate. diff --git a/src/nm-device-interface.c b/src/nm-device-interface.c index bbc54a8626..a2eb746221 100644 --- a/src/nm-device-interface.c +++ b/src/nm-device-interface.c @@ -19,6 +19,8 @@ * Copyright (C) 2007 - 2010 Red Hat, Inc. */ +#include + #include "nm-marshal.h" #include "nm-setting-connection.h" #include "nm-device-interface.h" @@ -26,8 +28,8 @@ #include "nm-properties-changed-signal.h" #include "nm-rfkill.h" -static gboolean impl_device_disconnect (NMDeviceInterface *device, - GError **error); +static void impl_device_disconnect (NMDeviceInterface *device, + DBusGMethodInvocation *context); #include "nm-device-interface-glue.h" @@ -211,6 +213,13 @@ nm_device_interface_init (gpointer g_iface) G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT); + g_signal_new (NM_DEVICE_INTERFACE_DISCONNECT_REQUEST, + iface_type, + G_SIGNAL_RUN_FIRST, + 0, NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); + dbus_g_object_type_install_info (iface_type, &dbus_glib_nm_device_interface_object_info); @@ -334,11 +343,11 @@ nm_device_interface_disconnect (NMDeviceInterface *device, return success; } -static gboolean +static void impl_device_disconnect (NMDeviceInterface *device, - GError **error) + DBusGMethodInvocation *context) { - return nm_device_interface_disconnect (device, error); + g_signal_emit_by_name (device, NM_DEVICE_INTERFACE_DISCONNECT_REQUEST, context); } void diff --git a/src/nm-device-interface.h b/src/nm-device-interface.h index ea152602e0..1fee131bd1 100644 --- a/src/nm-device-interface.h +++ b/src/nm-device-interface.h @@ -45,6 +45,8 @@ typedef enum #define NM_DEVICE_INTERFACE_ERROR (nm_device_interface_error_quark ()) #define NM_TYPE_DEVICE_INTERFACE_ERROR (nm_device_interface_error_get_type ()) +#define NM_DEVICE_INTERFACE_DISCONNECT_REQUEST "disconnect-request" + #define NM_DEVICE_INTERFACE_UDI "udi" #define NM_DEVICE_INTERFACE_IFACE "interface" #define NM_DEVICE_INTERFACE_DRIVER "driver" diff --git a/src/nm-manager.c b/src/nm-manager.c index 7560b81afb..85b847b0dd 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -67,9 +67,9 @@ static void impl_manager_activate_connection (NMManager *manager, const char *specific_object_path, DBusGMethodInvocation *context); -static gboolean impl_manager_deactivate_connection (NMManager *manager, - const char *connection_path, - GError **error); +static void impl_manager_deactivate_connection (NMManager *manager, + const char *connection_path, + DBusGMethodInvocation *context); static void impl_manager_sleep (NMManager *manager, gboolean do_sleep, @@ -714,6 +714,41 @@ out: nm_auth_chain_unref (chain); } +static gboolean +check_user_authorized (NMDBusManager *dbus_mgr, + DBusGProxy *user_proxy, + DBusGMethodInvocation *context, + NMConnectionScope scope, + gulong *out_sender_uid, + const char **out_error_desc) +{ + g_return_val_if_fail (dbus_mgr != NULL, FALSE); + g_return_val_if_fail (user_proxy != NULL, FALSE); + g_return_val_if_fail (context != NULL, FALSE); + g_return_val_if_fail (out_sender_uid != NULL, FALSE); + g_return_val_if_fail (out_error_desc != NULL, FALSE); + + *out_sender_uid = G_MAXULONG; + + /* Get the UID */ + if (!nm_auth_get_caller_uid (context, dbus_mgr, out_sender_uid, out_error_desc)) + return FALSE; + + /* root gets to do anything */ + if (0 == *out_sender_uid) + return TRUE; + + /* Check whether the UID is authorized for user connections */ + if ( scope == NM_CONNECTION_SCOPE_USER + && !nm_auth_uid_authorized (*out_sender_uid, + dbus_mgr, + user_proxy, + out_error_desc)) + return FALSE; + + return TRUE; +} + static void pending_activation_check_authorized (PendingActivation *pending, NMDBusManager *dbus_mgr, @@ -727,8 +762,12 @@ pending_activation_check_authorized (PendingActivation *pending, g_return_if_fail (dbus_mgr != NULL); g_return_if_fail (user_proxy != NULL); - /* Get the UID */ - if (!nm_auth_get_caller_uid (pending->context, dbus_mgr, &sender_uid, &error_desc)) { + if (!check_user_authorized (dbus_mgr, + user_proxy, + pending->context, + pending->scope, + &sender_uid, + &error_desc)) { error = g_error_new_literal (NM_MANAGER_ERROR, NM_MANAGER_ERROR_PERMISSION_DENIED, error_desc); @@ -737,26 +776,12 @@ pending_activation_check_authorized (PendingActivation *pending, return; } - /* root gets to do anything */ + /* Yay for root */ if (0 == sender_uid) { pending->callback (pending, NULL); return; } - /* Check whether the UID is authorized for user connections */ - if ( pending->scope == NM_CONNECTION_SCOPE_USER - && !nm_auth_uid_authorized (sender_uid, - dbus_mgr, - user_proxy, - &error_desc)) { - error = g_error_new_literal (NM_MANAGER_ERROR, - NM_MANAGER_ERROR_PERMISSION_DENIED, - error_desc); - pending->callback (pending, error); - g_error_free (error); - return; - } - /* First check if the user is allowed to use networking at all, giving * the user a chance to authenticate to gain the permission. */ @@ -765,6 +790,7 @@ pending_activation_check_authorized (PendingActivation *pending, NULL, pending_auth_net_done, pending); + g_assert (pending->chain); nm_auth_chain_add_call (pending->chain, NM_AUTH_PERMISSION_NETWORK_CONTROL, TRUE); @@ -1805,6 +1831,175 @@ manager_modem_enabled_changed (NMModem *device, gpointer user_data) nm_manager_rfkill_update (NM_MANAGER (user_data), RFKILL_TYPE_WWAN); } +static GError * +deactivate_disconnect_check_error (GError *auth_error, + NMAuthCallResult result, + const char *detail) +{ + if (auth_error) { + nm_log_dbg (LOGD_CORE, "%s request failed: %s", detail, auth_error->message); + return g_error_new (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + "%s request failed: %s", + detail, auth_error->message); + } else if (result != NM_AUTH_CALL_RESULT_YES) { + return g_error_new (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + "Not authorized to %s user connections", + detail); + } + return NULL; +} + +static void +disconnect_user_auth_done_cb (NMAuthChain *chain, + GError *error, + DBusGMethodInvocation *context, + gpointer user_data) +{ + NMManager *self = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + GError *ret_error = NULL; + NMAuthCallResult result; + NMDevice *device; + + priv->auth_chains = g_slist_remove (priv->auth_chains, chain); + + result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS)); + ret_error = deactivate_disconnect_check_error (error, result, "Disconnect"); +g_message ("%s: here! ret error %p", __func__, ret_error); + if (!ret_error) { + /* Everything authorized, deactivate the connection */ + device = nm_auth_chain_get_data (chain, "device"); +g_message ("%s: here! device %p", __func__, device); + if (nm_device_interface_disconnect (NM_DEVICE_INTERFACE (device), &ret_error)) + dbus_g_method_return (context); + } + + if (ret_error) + dbus_g_method_return_error (context, ret_error); + g_clear_error (&ret_error); + + nm_auth_chain_unref (chain); +} + +static void +disconnect_net_auth_done_cb (NMAuthChain *chain, + GError *error, + DBusGMethodInvocation *context, + gpointer user_data) +{ + NMManager *self = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + GError *ret_error = NULL; + NMAuthCallResult result; + NMConnectionScope scope; + NMDevice *device; + + priv->auth_chains = g_slist_remove (priv->auth_chains, chain); + + result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL)); + ret_error = deactivate_disconnect_check_error (error, result, "Disconnect"); +g_message ("%s: here! ret error %p", __func__, ret_error); + if (ret_error) { + dbus_g_method_return_error (context, ret_error); + g_error_free (ret_error); + goto done; + } + + /* If it's a system connection, we're done */ + device = nm_auth_chain_get_data (chain, "device"); + scope = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, "scope")); + if (scope == NM_CONNECTION_SCOPE_USER) { + NMAuthChain *user_chain; + + /* It's a user connection, so we need to ensure the caller is + * authorized to manipulate user connections. + */ + user_chain = nm_auth_chain_new (priv->authority, context, NULL, disconnect_user_auth_done_cb, self); + g_assert (user_chain); + priv->auth_chains = g_slist_append (priv->auth_chains, user_chain); + + nm_auth_chain_set_data (user_chain, "device", g_object_ref (device), g_object_unref); + nm_auth_chain_set_data (user_chain, "scope", GUINT_TO_POINTER (scope), NULL); + nm_auth_chain_add_call (user_chain, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS, TRUE); + } else { + if (!nm_device_interface_disconnect (NM_DEVICE_INTERFACE (device), &ret_error)) { + dbus_g_method_return_error (context, ret_error); + g_clear_error (&ret_error); + } else + dbus_g_method_return (context); + } + +done: + nm_auth_chain_unref (chain); +} + +static void +manager_device_disconnect_request (NMDevice *device, + DBusGMethodInvocation *context, + NMManager *self) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + NMActRequest *req; + NMConnection *connection; + GError *error = NULL; + NMConnectionScope scope; + gulong sender_uid = G_MAXULONG; + const char *error_desc = NULL; + + req = nm_device_get_act_request (device); + if (!req) { + error = g_error_new_literal (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_UNKNOWN_CONNECTION, + "This device is not active"); + dbus_g_method_return_error (context, error); + g_error_free (error); + return; + } + + connection = nm_act_request_get_connection (req); + g_assert (connection); + + /* Need to check the caller's permissions and stuff before we can + * deactivate the connection. + */ + scope = nm_connection_get_scope (connection); + if (!check_user_authorized (priv->dbus_mgr, + priv->user_proxy, + context, + scope, + &sender_uid, + &error_desc)) { + error = g_error_new_literal (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + error_desc); + dbus_g_method_return_error (context, error); + g_error_free (error); + return; + } + + /* Yay for root */ + if (0 == sender_uid) { + if (!nm_device_interface_disconnect (NM_DEVICE_INTERFACE (device), &error)) { + dbus_g_method_return_error (context, error); + g_clear_error (&error); + } else + dbus_g_method_return (context); + } else { + NMAuthChain *chain; + + /* Otherwise validate the user request */ + chain = nm_auth_chain_new (priv->authority, context, NULL, disconnect_net_auth_done_cb, self); + g_assert (chain); + priv->auth_chains = g_slist_append (priv->auth_chains, chain); + + nm_auth_chain_set_data (chain, "device", g_object_ref (device), g_object_unref); + nm_auth_chain_set_data (chain, "scope", GUINT_TO_POINTER (scope), NULL); + nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL, TRUE); + } +} + static void add_device (NMManager *self, NMDevice *device) { @@ -1832,6 +2027,10 @@ add_device (NMManager *self, NMDevice *device) G_CALLBACK (manager_device_state_changed), self); + g_signal_connect (device, NM_DEVICE_INTERFACE_DISCONNECT_REQUEST, + G_CALLBACK (manager_device_disconnect_request), + self); + if (NM_IS_DEVICE_WIFI (device)) { /* Attach to the access-point-added signal so that the manager can fill * non-SSID-broadcasting APs with an SSID. @@ -2895,15 +3094,173 @@ done: return success; } -static gboolean -impl_manager_deactivate_connection (NMManager *manager, - const char *connection_path, - GError **error) -{ - return nm_manager_deactivate_connection (manager, - connection_path, - NM_DEVICE_STATE_REASON_USER_REQUESTED, - error); +static void +deactivate_user_auth_done_cb (NMAuthChain *chain, + GError *error, + DBusGMethodInvocation *context, + gpointer user_data) +{ + NMManager *self = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + GError *ret_error = NULL; + NMAuthCallResult result; + + priv->auth_chains = g_slist_remove (priv->auth_chains, chain); + + result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS)); + ret_error = deactivate_disconnect_check_error (error, result, "Deactivate"); + if (!ret_error) { + /* Everything authorized, deactivate the connection */ + if (nm_manager_deactivate_connection (self, + nm_auth_chain_get_data (chain, "path"), + NM_DEVICE_STATE_REASON_USER_REQUESTED, + &ret_error)) + dbus_g_method_return (context); + } + + if (ret_error) + dbus_g_method_return_error (context, ret_error); + g_clear_error (&ret_error); + + nm_auth_chain_unref (chain); +} + +static void +deactivate_net_auth_done_cb (NMAuthChain *chain, + GError *error, + DBusGMethodInvocation *context, + gpointer user_data) +{ + NMManager *self = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + GError *ret_error = NULL; + NMAuthCallResult result; + const char *active_path; + NMConnectionScope scope; + + priv->auth_chains = g_slist_remove (priv->auth_chains, chain); + + result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL)); + ret_error = deactivate_disconnect_check_error (error, result, "Deactivate"); + if (ret_error) { + dbus_g_method_return_error (context, ret_error); + g_error_free (ret_error); + goto done; + } + + /* If it's a system connection, we're done */ + active_path = nm_auth_chain_get_data (chain, "path"); + scope = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, "scope")); + if (scope == NM_CONNECTION_SCOPE_USER) { + NMAuthChain *user_chain; + + /* It's a user connection, so we need to ensure the caller is + * authorized to manipulate user connections. + */ + user_chain = nm_auth_chain_new (priv->authority, context, NULL, deactivate_user_auth_done_cb, self); + g_assert (user_chain); + priv->auth_chains = g_slist_append (priv->auth_chains, user_chain); + + nm_auth_chain_set_data (user_chain, "path", g_strdup (active_path), g_free); + nm_auth_chain_set_data (user_chain, "scope", GUINT_TO_POINTER (scope), NULL); + nm_auth_chain_add_call (user_chain, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS, TRUE); + } else { + if (!nm_manager_deactivate_connection (self, + active_path, + NM_DEVICE_STATE_REASON_USER_REQUESTED, + &ret_error)) { + dbus_g_method_return_error (context, ret_error); + g_clear_error (&ret_error); + } else + dbus_g_method_return (context); + } + +done: + nm_auth_chain_unref (chain); +} + +static void +impl_manager_deactivate_connection (NMManager *self, + const char *active_path, + DBusGMethodInvocation *context) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + NMConnection *connection = NULL; + GError *error = NULL; + GSList *iter; + NMAuthChain *chain; + gulong sender_uid = G_MAXULONG; + NMConnectionScope scope; + const char *error_desc = NULL; + + /* Check for device connections first */ + for (iter = priv->devices; iter; iter = g_slist_next (iter)) { + NMActRequest *req; + const char *req_path = NULL; + + req = nm_device_get_act_request (NM_DEVICE (iter->data)); + if (req) + req_path = nm_act_request_get_active_connection_path (req); + + if (req_path && !strcmp (active_path, req_path)) { + connection = nm_act_request_get_connection (req); + break; + } + } + + /* Maybe it's a VPN */ + if (!connection) + connection = nm_vpn_manager_get_connection_for_active (priv->vpn_manager, active_path); + + if (!connection) { + error = g_error_new_literal (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_CONNECTION_NOT_ACTIVE, + "The connection was not active."); + dbus_g_method_return_error (context, error); + g_error_free (error); + return; + } + + /* Need to check the caller's permissions and stuff before we can + * deactivate the connection. + */ + scope = nm_connection_get_scope (connection); + if (!check_user_authorized (priv->dbus_mgr, + priv->user_proxy, + context, + scope, + &sender_uid, + &error_desc)) { + error = g_error_new_literal (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + error_desc); + dbus_g_method_return_error (context, error); + g_error_free (error); + return; + } + + /* Yay for root */ + if (0 == sender_uid) { + if (!nm_manager_deactivate_connection (self, + active_path, + NM_DEVICE_STATE_REASON_USER_REQUESTED, + &error)) { + dbus_g_method_return_error (context, error); + g_clear_error (&error); + } else + dbus_g_method_return (context); + + return; + } + + /* Otherwise validate the user request */ + chain = nm_auth_chain_new (priv->authority, context, NULL, deactivate_net_auth_done_cb, self); + g_assert (chain); + priv->auth_chains = g_slist_append (priv->auth_chains, chain); + + nm_auth_chain_set_data (chain, "path", g_strdup (active_path), g_free); + nm_auth_chain_set_data (chain, "scope", GUINT_TO_POINTER (scope), NULL); + nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL, TRUE); } static void diff --git a/src/vpn-manager/nm-vpn-manager.c b/src/vpn-manager/nm-vpn-manager.c index 221a8b548c..309331aede 100644 --- a/src/vpn-manager/nm-vpn-manager.c +++ b/src/vpn-manager/nm-vpn-manager.c @@ -304,6 +304,33 @@ nm_vpn_manager_get_active_connections (NMVPNManager *manager) return list; } +NMConnection * +nm_vpn_manager_get_connection_for_active (NMVPNManager *manager, + const char *active_path) +{ + NMVPNManagerPrivate *priv; + GSList *iter; + + g_return_val_if_fail (NM_IS_VPN_MANAGER (manager), NULL); + + priv = NM_VPN_MANAGER_GET_PRIVATE (manager); + for (iter = priv->services; iter; iter = g_slist_next (iter)) { + GSList *active, *elt; + + active = nm_vpn_service_get_active_connections (NM_VPN_SERVICE (iter->data)); + for (elt = active; elt; elt = g_slist_next (elt)) { + NMVPNConnection *candidate = NM_VPN_CONNECTION (elt->data); + const char *ac_path; + + ac_path = nm_vpn_connection_get_active_connection_path (candidate); + if (ac_path && !strcmp (ac_path, active_path)) + return nm_vpn_connection_get_connection (candidate); + } + } + + return NULL; +} + NMVPNManager * nm_vpn_manager_get (void) { diff --git a/src/vpn-manager/nm-vpn-manager.h b/src/vpn-manager/nm-vpn-manager.h index d07aa25099..f14844a9d4 100644 --- a/src/vpn-manager/nm-vpn-manager.h +++ b/src/vpn-manager/nm-vpn-manager.h @@ -83,4 +83,7 @@ void nm_vpn_manager_add_active_connections (NMVPNManager *manager, GSList *nm_vpn_manager_get_active_connections (NMVPNManager *manager); +NMConnection *nm_vpn_manager_get_connection_for_active (NMVPNManager *manager, + const char *active_path); + #endif /* NM_VPN_VPN_MANAGER_H */ -- cgit v1.2.1 From 5c3139709186ac5e8c17de4425b10cd30b5a09f5 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 4 Jun 2010 13:05:27 -0700 Subject: core: don't auto-activate user connections if the user lacks permissions --- src/nm-manager.c | 23 +++++++++++++++++++++++ src/nm-manager.h | 2 ++ src/nm-policy.c | 17 +++++++++++++---- 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 85b847b0dd..2a74187ae8 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -241,6 +241,7 @@ enum { CONNECTION_UPDATED, CONNECTION_REMOVED, CHECK_PERMISSIONS, + USER_PERMISSIONS_CHANGED, LAST_SIGNAL }; @@ -1224,6 +1225,8 @@ static gboolean user_settings_authorized (NMManager *self, NMAuthChain *chain) { NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + NMAuthCallResult old_net_perm = priv->user_net_perm; + NMAuthCallResult old_con_perm = priv->user_con_perm; /* If the user could potentially get authorization to use networking and/or * to use user connections, the user settings service is authorized. @@ -1234,6 +1237,9 @@ user_settings_authorized (NMManager *self, NMAuthChain *chain) nm_log_dbg (LOGD_USER_SET, "User connections permissions: net %d, con %d", priv->user_net_perm, priv->user_con_perm); + if (old_net_perm != priv->user_net_perm || old_con_perm != priv->user_con_perm) + g_signal_emit (self, signals[USER_PERMISSIONS_CHANGED], 0); + /* If the user can't control the network they certainly aren't allowed * to provide user connections. */ @@ -3755,6 +3761,15 @@ impl_manager_set_logging (NMManager *manager, /* Connections */ +gboolean +nm_manager_auto_user_connections_allowed (NMManager *self) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + + return priv->user_net_perm == NM_AUTH_CALL_RESULT_YES + && priv->user_con_perm == NM_AUTH_CALL_RESULT_YES; +} + static int connection_sort (gconstpointer pa, gconstpointer pb) { @@ -4388,6 +4403,14 @@ nm_manager_class_init (NMManagerClass *manager_class) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + signals[USER_PERMISSIONS_CHANGED] = + g_signal_new ("user-permissions-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + 0, NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + /* StateChange is DEPRECATED */ signals[STATE_CHANGE] = g_signal_new ("state-change", diff --git a/src/nm-manager.h b/src/nm-manager.h index 0f4d72f2fd..889938d977 100644 --- a/src/nm-manager.h +++ b/src/nm-manager.h @@ -111,6 +111,8 @@ NMState nm_manager_get_state (NMManager *manager); GSList *nm_manager_get_connections (NMManager *manager, NMConnectionScope scope); +gboolean nm_manager_auto_user_connections_allowed (NMManager *manager); + NMConnection * nm_manager_get_connection_by_object_path (NMManager *manager, NMConnectionScope scope, const char *path); diff --git a/src/nm-policy.c b/src/nm-policy.c index 455545b655..6e065489dc 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -633,7 +633,8 @@ auto_activate_device (gpointer user_data) /* 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 (nm_manager_auto_user_connections_allowed (policy->manager)) + connections = g_slist_concat (connections, nm_manager_get_connections (policy->manager, NM_CONNECTION_SCOPE_USER)); /* Remove connections that are in the invalid list. */ iter = connections; @@ -652,13 +653,11 @@ auto_activate_device (gpointer user_data) best_connection = nm_device_get_best_auto_connection (data->device, connections, &specific_object); if (best_connection) { GError *error = NULL; - const char *device_path; - device_path = nm_device_get_path (data->device); if (!nm_manager_activate_connection (policy->manager, best_connection, specific_object, - device_path, + nm_device_get_path (data->device), FALSE, &error)) { NMSettingConnection *s_con; @@ -1013,6 +1012,12 @@ connection_removed (NMManager *manager, g_ptr_array_free (list, TRUE); } +static void +manager_user_permissions_changed (NMManager *manager, NMPolicy *policy) +{ + schedule_activate_all (policy); +} + NMPolicy * nm_policy_new (NMManager *manager, NMVPNManager *vpn_manager) { @@ -1088,6 +1093,10 @@ nm_policy_new (NMManager *manager, NMVPNManager *vpn_manager) G_CALLBACK (connection_removed), policy); policy->signal_ids = g_slist_append (policy->signal_ids, (gpointer) id); + id = g_signal_connect (manager, "user-permissions-changed", + G_CALLBACK (manager_user_permissions_changed), policy); + policy->signal_ids = g_slist_append (policy->signal_ids, (gpointer) id); + return policy; } -- cgit v1.2.1 From 0e047687b3eff7b031f0740fbf4e9463fed22282 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 4 Jun 2010 13:05:54 -0700 Subject: core: remove some debugging left-overs --- src/nm-manager.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 2a74187ae8..32aeba5511 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -1873,11 +1873,9 @@ disconnect_user_auth_done_cb (NMAuthChain *chain, result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS)); ret_error = deactivate_disconnect_check_error (error, result, "Disconnect"); -g_message ("%s: here! ret error %p", __func__, ret_error); if (!ret_error) { /* Everything authorized, deactivate the connection */ device = nm_auth_chain_get_data (chain, "device"); -g_message ("%s: here! device %p", __func__, device); if (nm_device_interface_disconnect (NM_DEVICE_INTERFACE (device), &ret_error)) dbus_g_method_return (context); } @@ -1906,7 +1904,6 @@ disconnect_net_auth_done_cb (NMAuthChain *chain, result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL)); ret_error = deactivate_disconnect_check_error (error, result, "Disconnect"); -g_message ("%s: here! ret error %p", __func__, ret_error); if (ret_error) { dbus_g_method_return_error (context, ret_error); g_error_free (ret_error); -- cgit v1.2.1 From 6d719a0a385e61651cbe8500c3dd3c0e14eedb37 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 4 Jun 2010 13:55:45 -0700 Subject: core: NULL user_proxy means no user settings allowed Which means we should return an error to the caller. --- src/nm-manager.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 32aeba5511..31628f8766 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -724,7 +724,6 @@ check_user_authorized (NMDBusManager *dbus_mgr, const char **out_error_desc) { g_return_val_if_fail (dbus_mgr != NULL, FALSE); - g_return_val_if_fail (user_proxy != NULL, FALSE); g_return_val_if_fail (context != NULL, FALSE); g_return_val_if_fail (out_sender_uid != NULL, FALSE); g_return_val_if_fail (out_error_desc != NULL, FALSE); @@ -761,7 +760,6 @@ pending_activation_check_authorized (PendingActivation *pending, g_return_if_fail (pending != NULL); g_return_if_fail (dbus_mgr != NULL); - g_return_if_fail (user_proxy != NULL); if (!check_user_authorized (dbus_mgr, user_proxy, -- cgit v1.2.1 From 276fed03225bc6a29c4efd8aa6428a502f857e1b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 7 Jun 2010 22:42:33 -0700 Subject: initscript: fix RH initscript return value on double-start (rh #584321) (rh #448393) --- initscript/RedHat/NetworkManager.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/initscript/RedHat/NetworkManager.in b/initscript/RedHat/NetworkManager.in index 66f949597f..e26e59ed42 100755 --- a/initscript/RedHat/NetworkManager.in +++ b/initscript/RedHat/NetworkManager.in @@ -49,7 +49,7 @@ start() echo echo -n $"Starting NetworkManager daemon: " - daemon --check $servicename $processname --pid-file=$pidfile + daemon --pidfile $pidfile --check $servicename $processname --pid-file=$pidfile RETVAL=$? echo if [ -n "${NETWORKWAIT}" ]; then -- cgit v1.2.1 From 773c006a4c9d3162e9b371762dc59fd5948e4b43 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 8 Jun 2010 10:40:08 -0700 Subject: policy: support IPv6 address reverse-lookup for hostname too --- src/nm-policy-hostname.c | 84 +++++++++++++++++++++++++++----- src/nm-policy-hostname.h | 10 ++-- src/nm-policy.c | 122 ++++++++++++++++++++++++++++++++--------------- 3 files changed, 163 insertions(+), 53 deletions(-) diff --git a/src/nm-policy-hostname.c b/src/nm-policy-hostname.c index a273a9202f..baa6d3a3e3 100644 --- a/src/nm-policy-hostname.c +++ b/src/nm-policy-hostname.c @@ -24,6 +24,7 @@ #include #include #include +#include #include @@ -40,7 +41,10 @@ struct HostnameThread { gboolean dead; int ret; - guint32 ip4_addr; + struct sockaddr_in addr4; + struct sockaddr_in6 addr6; + struct sockaddr *addr; + size_t addr_size; char hostname[NI_MAXHOST + 1]; HostnameThreadCallback callback; @@ -53,9 +57,10 @@ hostname_thread_run_cb (gpointer user_data) HostnameThread *ht = (HostnameThread *) user_data; const char *hostname = NULL; - if (strlen (ht->hostname)) + if (strlen (ht->hostname) && strcmp (hostname, ".")) hostname = ht->hostname; + nm_log_dbg (LOGD_DNS, "(%p) calling address reverse-lookup result handler", ht); (*ht->callback) (ht, ht->ret, hostname, ht->user_data); return FALSE; } @@ -64,9 +69,10 @@ static gpointer hostname_thread_worker (gpointer data) { HostnameThread *ht = (HostnameThread *) data; - struct sockaddr_in addr; int i; + nm_log_dbg (LOGD_DNS, "(%p) starting address reverse-lookup", ht); + g_mutex_lock (ht->lock); if (ht->dead) { g_mutex_unlock (ht->lock); @@ -74,21 +80,22 @@ hostname_thread_worker (gpointer data) } g_mutex_unlock (ht->lock); - addr.sin_family = AF_INET; - addr.sin_addr.s_addr = ht->ip4_addr; - - ht->ret = getnameinfo ((struct sockaddr *) &addr, sizeof (struct sockaddr_in), - ht->hostname, NI_MAXHOST, NULL, 0, - NI_NAMEREQD); + ht->ret = getnameinfo (ht->addr, ht->addr_size, ht->hostname, NI_MAXHOST, NULL, 0, NI_NAMEREQD); if (ht->ret == 0) { + nm_log_dbg (LOGD_DNS, "(%p) address reverse-lookup returned hostname '%s'", + ht, ht->hostname); for (i = 0; i < strlen (ht->hostname); i++) ht->hostname[i] = tolower (ht->hostname[i]); + } else { + nm_log_dbg (LOGD_DNS, "(%p) address reverse-lookup failed: (%d) %s", + ht, ht->ret, gai_strerror (ht->ret)); } /* Don't track the idle handler ID because by the time the g_idle_add() * returns the ID, the handler may already have run and freed the * HostnameThread. */ + nm_log_dbg (LOGD_DNS, "(%p) scheduling address reverse-lookup result handler", ht); g_idle_add (hostname_thread_run_cb, ht); return (gpointer) TRUE; } @@ -98,15 +105,56 @@ hostname_thread_free (HostnameThread *ht) { g_return_if_fail (ht != NULL); + nm_log_dbg (LOGD_DNS, "(%p) freeing reverse-lookup thread", ht); + g_mutex_free (ht->lock); memset (ht, 0, sizeof (HostnameThread)); g_free (ht); } HostnameThread * -hostname_thread_new (guint32 ip4_addr, HostnameThreadCallback callback, gpointer user_data) +hostname4_thread_new (guint32 ip4_addr, + HostnameThreadCallback callback, + gpointer user_data) +{ + HostnameThread *ht; + struct sockaddr_in addr4; + char buf[INET_ADDRSTRLEN + 1]; + + ht = g_malloc0 (sizeof (HostnameThread)); + g_assert (ht); + + ht->lock = g_mutex_new (); + ht->callback = callback; + ht->user_data = user_data; + + ht->addr4.sin_family = AF_INET; + ht->addr4.sin_addr.s_addr = ip4_addr; + ht->addr = (struct sockaddr *) &ht->addr4; + ht->addr_size = sizeof (ht->addr4); + + ht->thread = g_thread_create (hostname_thread_worker, ht, FALSE, NULL); + if (!ht->thread) { + hostname_thread_free (ht); + return NULL; + } + + if (!inet_ntop (AF_INET, &addr4.sin_addr, buf, sizeof (buf))) + strcpy (buf, "(unknown)"); + + nm_log_dbg (LOGD_DNS, "(%p) started IPv4 reverse-lookup thread for address '%s'", + ht, buf); + + return ht; +} + +HostnameThread * +hostname6_thread_new (const struct in6_addr *ip6_addr, + HostnameThreadCallback callback, + gpointer user_data) { HostnameThread *ht; + char buf[INET6_ADDRSTRLEN + 1]; ht = g_malloc0 (sizeof (HostnameThread)); g_assert (ht); @@ -114,14 +162,24 @@ hostname_thread_new (guint32 ip4_addr, HostnameThreadCallback callback, gpointer ht->lock = g_mutex_new (); ht->callback = callback; ht->user_data = user_data; - ht->ip4_addr = ip4_addr; + + ht->addr6.sin6_family = AF_INET6; + ht->addr6.sin6_addr = *ip6_addr; + ht->addr = (struct sockaddr *) &ht->addr6; + ht->addr_size = sizeof (ht->addr6); ht->thread = g_thread_create (hostname_thread_worker, ht, FALSE, NULL); if (!ht->thread) { hostname_thread_free (ht); - ht = NULL; + return NULL; } + if (!inet_ntop (AF_INET, ip6_addr, buf, sizeof (buf))) + strcpy (buf, "(unknown)"); + + nm_log_dbg (LOGD_DNS, "(%p) started IPv6 reverse-lookup thread for address '%s'", + ht, buf); + return ht; } @@ -130,6 +188,8 @@ hostname_thread_kill (HostnameThread *ht) { g_return_if_fail (ht != NULL); + nm_log_dbg (LOGD_DNS, "(%p) stopping reverse-lookup thread", ht); + g_mutex_lock (ht->lock); ht->dead = TRUE; g_mutex_unlock (ht->lock); diff --git a/src/nm-policy-hostname.h b/src/nm-policy-hostname.h index c59ca41078..e76713f16d 100644 --- a/src/nm-policy-hostname.h +++ b/src/nm-policy-hostname.h @@ -34,9 +34,13 @@ typedef void (*HostnameThreadCallback) (HostnameThread *ht, const char *hostname, gpointer user_data); -HostnameThread * hostname_thread_new (guint32 ip4_addr, - HostnameThreadCallback callback, - gpointer user_data); +HostnameThread * hostname4_thread_new (guint32 ip4_addr, + HostnameThreadCallback callback, + gpointer user_data); + +HostnameThread * hostname6_thread_new (const struct in6_addr *ip6_addr, + HostnameThreadCallback callback, + gpointer user_data); void hostname_thread_free (HostnameThread *ht); diff --git a/src/nm-policy.c b/src/nm-policy.c index 6e065489dc..1fb9848b75 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -255,13 +255,12 @@ lookup_callback (HostnameThread *thread, } static void -update_system_hostname (NMPolicy *policy, NMDevice *best) +update_system_hostname (NMPolicy *policy, NMDevice *best4, NMDevice *best6) { char *configured_hostname = NULL; - NMActRequest *best_req = NULL; - NMDHCP4Config *dhcp4_config; - NMIP4Config *ip4_config; - NMIP4Address *addr; + NMActRequest *best_req4 = NULL; + NMActRequest *best_req6 = NULL; + const char *dhcp_hostname, *p; g_return_if_fail (policy != NULL); @@ -288,10 +287,12 @@ update_system_hostname (NMPolicy *policy, NMDevice *best) } /* Try automatically determined hostname from the best device's IP config */ - if (!best) - best = get_best_ip4_device (policy->manager, &best_req); + if (!best4) + best4 = get_best_ip4_device (policy->manager, &best_req4); + if (!best6) + best6 = get_best_ip6_device (policy->manager, &best_req6); - if (!best) { + if (!best4 && !best6) { /* No best device; fall back to original hostname or if there wasn't * one, 'localhost.localdomain' */ @@ -299,22 +300,43 @@ update_system_hostname (NMPolicy *policy, NMDevice *best) return; } - /* Grab a hostname out of the device's DHCP4 config */ - dhcp4_config = nm_device_get_dhcp4_config (best); - if (dhcp4_config) { - const char *dhcp4_hostname, *p; - - p = dhcp4_hostname = nm_dhcp4_config_get_option (dhcp4_config, "host_name"); - if (dhcp4_hostname && strlen (dhcp4_hostname)) { - /* Sanity check */ - while (*p) { - if (!isblank (*p++)) { - _set_hostname (dhcp4_hostname, "from DHCP"); - return; + if (best4) { + NMDHCP4Config *dhcp4_config; + + /* Grab a hostname out of the device's DHCP4 config */ + dhcp4_config = nm_device_get_dhcp4_config (best4); + if (dhcp4_config) { + p = dhcp_hostname = nm_dhcp4_config_get_option (dhcp4_config, "host_name"); + if (dhcp_hostname && strlen (dhcp_hostname)) { + /* Sanity check; strip leading spaces */ + while (*p) { + if (!isblank (*p++)) { + _set_hostname (dhcp_hostname, "from DHCPv4"); + return; + } + } + nm_log_warn (LOGD_DNS, "DHCPv4-provided hostname '%s' looks invalid; ignoring it", + dhcp_hostname); + } + } + } else if (best6) { + NMDHCP6Config *dhcp6_config; + + /* Grab a hostname out of the device's DHCP4 config */ + dhcp6_config = nm_device_get_dhcp6_config (best6); + if (dhcp6_config) { + p = dhcp_hostname = nm_dhcp6_config_get_option (dhcp6_config, "host_name"); + if (dhcp_hostname && strlen (dhcp_hostname)) { + /* Sanity check; strip leading spaces */ + while (*p) { + if (!isblank (*p++)) { + _set_hostname (dhcp_hostname, "from DHCPv6"); + return; + } } + nm_log_warn (LOGD_DNS, "DHCPv6-provided hostname '%s' looks invalid; ignoring it", + dhcp_hostname); } - nm_log_warn (LOGD_DNS, "DHCP-provided hostname '%s' looks invalid; ignoring it", - dhcp4_hostname); } } @@ -326,23 +348,47 @@ update_system_hostname (NMPolicy *policy, NMDevice *best) return; } - /* No configured hostname, no automatically determined hostname, and - * no bootup hostname. Start reverse DNS of the current IP address. + /* No configured hostname, no automatically determined hostname, and no + * bootup hostname. Start reverse DNS of the current IPv4 or IPv6 address. */ - ip4_config = nm_device_get_ip4_config (best); - if ( !ip4_config - || (nm_ip4_config_get_num_nameservers (ip4_config) == 0) - || (nm_ip4_config_get_num_addresses (ip4_config) == 0)) { - /* No valid IP4 config (!!); fall back to localhost.localdomain */ - _set_hostname (NULL, "no IPv4 config"); - return; - } + if (best4) { + NMIP4Config *ip4_config; + NMIP4Address *addr4; + + ip4_config = nm_device_get_ip4_config (best4); + if ( !ip4_config + || (nm_ip4_config_get_num_nameservers (ip4_config) == 0) + || (nm_ip4_config_get_num_addresses (ip4_config) == 0)) { + /* No valid IP4 config (!!); fall back to localhost.localdomain */ + _set_hostname (NULL, "no IPv4 config"); + return; + } + + addr4 = nm_ip4_config_get_address (ip4_config, 0); + g_assert (addr4); /* checked for > 1 address above */ + + /* Start the hostname lookup thread */ + policy->lookup = hostname4_thread_new (nm_ip4_address_get_address (addr4), lookup_callback, policy); + } else if (best6) { + NMIP6Config *ip6_config; + NMIP6Address *addr6; + + ip6_config = nm_device_get_ip6_config (best6); + if ( !ip6_config + || (nm_ip6_config_get_num_nameservers (ip6_config) == 0) + || (nm_ip6_config_get_num_addresses (ip6_config) == 0)) { + /* No valid IP6 config (!!); fall back to localhost.localdomain */ + _set_hostname (NULL, "no IPv6 config"); + return; + } - addr = nm_ip4_config_get_address (ip4_config, 0); - g_assert (addr); /* checked for > 1 address above */ + addr6 = nm_ip6_config_get_address (ip6_config, 0); + g_assert (addr6); /* checked for > 1 address above */ + + /* Start the hostname lookup thread */ + policy->lookup = hostname6_thread_new (nm_ip6_address_get_address (addr6), lookup_callback, policy); + } - /* Start the hostname lookup thread */ - policy->lookup = hostname_thread_new (nm_ip4_address_get_address (addr), lookup_callback, policy); if (!policy->lookup) { /* Fall back to 'localhost.localdomain' */ _set_hostname (NULL, "error starting hostname thread"); @@ -603,7 +649,7 @@ update_routing_and_dns (NMPolicy *policy, gboolean force_update) update_ip6_routing_and_dns (policy, force_update); /* Update the system hostname */ - update_system_hostname (policy, policy->default_device4); + update_system_hostname (policy, policy->default_device4, policy->default_device6); } typedef struct { @@ -711,7 +757,7 @@ global_state_changed (NMManager *manager, NMState state, gpointer user_data) static void hostname_changed (NMManager *manager, GParamSpec *pspec, gpointer user_data) { - update_system_hostname ((NMPolicy *) user_data, NULL); + update_system_hostname ((NMPolicy *) user_data, NULL, NULL); } static void -- cgit v1.2.1 From d3688c7bcd0ee0e578a769332b7e47301f540b1e Mon Sep 17 00:00:00 2001 From: "Henrique P. Machado" Date: Tue, 8 Jun 2010 14:11:23 -0700 Subject: po: updated Brazilian Portuguese translation (bgo #620777) --- po/pt_BR.po | 1391 +++++++++++++++++++++++------------------------------------ 1 file changed, 550 insertions(+), 841 deletions(-) diff --git a/po/pt_BR.po b/po/pt_BR.po index a347564bec..13c7a27624 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -1,98 +1,27 @@ -# translation of pt_BR.po to Portuguese # Brazilian Portuguese translation of NetworkManager. -# Copyright (C) 2004-2008, 2010 Free Software Foundation, Inc. +# Copyright (C) 2004-2008 Free Software Foundation, Inc. # This file is distributed under the same license as the NetworkManager package. -# -# Raphael Higino , 2004-2007. +# Raphael Higino , 2004-2007 # Luiz Armesto , 2007. -# Henrique P. Machado , 2008. +# Henrique P. Machado , 2008, 2010. # Og Maciel , 2008. # Fabrício Godoy , 2008. -# Glaucia Cintra , 2010. +# msgid "" msgstr "" -"Project-Id-Version: pt_BR\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-05-06 14:31+0530\n" -"PO-Revision-Date: 2010-05-07 14:38+1000\n" -"Last-Translator: Glaucia Cintra \n" -"Language-Team: Portuguese \n" +"Project-Id-Version: NetworkManager\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-04-27 15:25+0000\n" +"PO-Revision-Date: 2010-06-06 18:36-0300\n" +"Last-Translator: Henrique P. Machado \n" +"Language-Team: Brazilian Portuguese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: KBabel 1.11.4\n" -#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 -#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 -#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 -#: ../cli/src/devices.c:152 -msgid "NAME" -msgstr "NOME" - -#. 0 -#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 -msgid "UUID" -msgstr "UUID" - -#. 1 -#: ../cli/src/connections.c:61 -msgid "DEVICES" -msgstr "DISPOSITIVOS" - -#. 2 -#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 -msgid "SCOPE" -msgstr "ESCOPO" - -#. 3 -#: ../cli/src/connections.c:63 -msgid "DEFAULT" -msgstr "PADRÃO" - -#. 4 -#: ../cli/src/connections.c:64 -msgid "DBUS-SERVICE" -msgstr "SERVIÇO-DBUS" - -#. 5 -#: ../cli/src/connections.c:65 -msgid "SPEC-OBJECT" -msgstr "ESPECIFICAÇÕES DO OBJETO" - -#. 6 -#: ../cli/src/connections.c:66 -msgid "VPN" -msgstr "VPN" - -#. 1 -#. 0 -#. 1 -#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 -msgid "TYPE" -msgstr "TIPO" - -#. 3 -#: ../cli/src/connections.c:78 -msgid "TIMESTAMP" -msgstr "CARIMBO DE DATA E HORA" - -#. 4 -#: ../cli/src/connections.c:79 -msgid "TIMESTAMP-REAL" -msgstr "CARIMBO DE DATA E HORA REAL" - -#. 5 -#: ../cli/src/connections.c:80 -msgid "AUTOCONNECT" -msgstr "CONEXÃO AUTOMÁTICA" - -#. 6 -#: ../cli/src/connections.c:81 -msgid "READONLY" -msgstr "SOMENTE LEITURA" - -#: ../cli/src/connections.c:157 +#: ../cli/src/connections.c:86 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -104,8 +33,8 @@ msgid "" "]\n" " down id | uuid \n" msgstr "" -"Usage: nmcli con { COMMAND | help }\n" -" COMMAND := { list | status | up | down }\n" +"Uso: nmcli con { COMANDO | help }\n" +" COMANDO := { list | status | up | down }\n" "\n" " list [id | uuid | system | user]\n" " status\n" @@ -113,516 +42,312 @@ msgstr "" "]\n" " down id | uuid \n" -#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 -#, c-format -msgid "Error: 'con list': %s" -msgstr "Erro: lista 'con': %s" - -#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 -#, c-format -msgid "Error: 'con list': %s; allowed fields: %s" -msgstr "Erro: 'con list': %s; campos permitidos: %s" - -#: ../cli/src/connections.c:207 -msgid "Connection details" -msgstr "Detalhes de Conexões" - -#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 -msgid "system" -msgstr "sistema" - -#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 -msgid "user" -msgstr "usuário" - -#: ../cli/src/connections.c:383 -msgid "never" -msgstr "nunca" - -#. "CAPABILITIES" -#. Print header -#. "WIFI-PROPERTIES" -#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 -#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 -#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 -#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 -#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 -#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 -#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 -#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 -#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 -#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 -#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 -#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 -#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 -#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 -#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 -#: ../cli/src/settings.c:1210 -msgid "yes" -msgstr "sim" +#: ../cli/src/connections.c:158 +msgid "Connections" +msgstr "Conexões" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/devices.c:298 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Type" +msgstr "Tipo" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "UUID" +msgstr "UUID" -#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 -#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 -#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 -#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 -#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 -#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 -#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 -#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 -#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 -#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 -#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 -#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 -#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 -#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 -#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 -#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 -msgid "no" -msgstr "não" +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Name" +msgstr "Nome" -#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 -msgid "System connections" -msgstr "Conexões de sistema" +#: ../cli/src/connections.c:163 +#, c-format +msgid "System connections:\n" +msgstr "Conexões de sistema:\n" -#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 -msgid "User connections" -msgstr "Conexões de usuário" +#: ../cli/src/connections.c:167 +#, c-format +msgid "User connections:\n" +msgstr "Conexões de usuário:\n" -#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 -#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 -#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 -#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 -#: ../cli/src/devices.c:980 +#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 +#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 +#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 +#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 +#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 #, c-format msgid "Error: %s argument is missing." -msgstr "Erro: argumento %s está faltando" +msgstr "Erro: faltando argumento %s." -#: ../cli/src/connections.c:487 +#: ../cli/src/connections.c:189 #, c-format msgid "Error: %s - no such connection." -msgstr "Erro: %s - não existe tal conexão" +msgstr "Erro: %s - não existe esta conexão." + +#: ../cli/src/connections.c:196 +msgid "System-wide connections" +msgstr "Conexões de sistema" -#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 -#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 -#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#: ../cli/src/connections.c:205 +msgid "User connections" +msgstr "Conexões de usuário" + +#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 +#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 +#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 +#: ../cli/src/devices.c:798 #, c-format msgid "Unknown parameter: %s\n" msgstr "Parâmetro desconhecido: %s\n" -#: ../cli/src/connections.c:528 +#: ../cli/src/connections.c:221 #, c-format msgid "Error: no valid parameter specified." -msgstr "Erro: não existe um parâmetro válido especificado" +msgstr "Erro: nenhum parâmetro válido especificado." -#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 -#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 -#, c-format -msgid "Error: %s." -msgstr "Erro: %s" - -#: ../cli/src/connections.c:649 -#, c-format -msgid "Error: 'con status': %s" -msgstr "Erro: status 'con':%s" +#. FIXME: Fix the output +#: ../cli/src/connections.c:268 ../cli/src/devices.c:302 +#: ../cli/src/devices.c:321 ../cli/src/devices.c:353 ../cli/src/devices.c:355 +#: ../cli/src/devices.c:357 ../cli/src/devices.c:359 ../cli/src/devices.c:361 +msgid "yes" +msgstr "sim" -#: ../cli/src/connections.c:651 -#, c-format -msgid "Error: 'con status': %s; allowed fields: %s" -msgstr "Erro: status 'con':%s, campos permitidos: %s" +#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 +msgid "no" +msgstr "não" -#: ../cli/src/connections.c:658 +#: ../cli/src/connections.c:297 msgid "Active connections" msgstr "Conexões ativas" -#: ../cli/src/connections.c:1026 -#, c-format -msgid "no active connection on device '%s'" -msgstr "nenhuma conexão ativa no dispositivo '%s'" +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 +msgid "Default" +msgstr "Padrão" -#: ../cli/src/connections.c:1034 -#, c-format -msgid "no active connection or device" -msgstr "nenhuma conexão ativa ou dispositivo" +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Service" +msgstr "Serviço" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Devices" +msgstr "Dispositivos" -#: ../cli/src/connections.c:1084 +#: ../cli/src/connections.c:659 #, c-format -msgid "device '%s' not compatible with connection '%s'" -msgstr "dispositivo '%s' não compatível com a conexão '%s'" +msgid "no active connection on device '%s'" +msgstr "nenhuma conexão ativa no dispositivo \"%s\"" -#: ../cli/src/connections.c:1086 +#: ../cli/src/connections.c:667 #, c-format -msgid "no device found for connection '%s'" -msgstr "nenhum dispositivo encontrado para a conexão '%s'" +msgid "no active connection or device" +msgstr "nenhuma conexão ou dispositivo ativo" -#: ../cli/src/connections.c:1097 +#: ../cli/src/connections.c:730 msgid "activating" msgstr "ativando" -#: ../cli/src/connections.c:1099 +#: ../cli/src/connections.c:732 msgid "activated" msgstr "ativado" -#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 -#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 -#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 -#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 +#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 +#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 msgid "unknown" msgstr "desconhecido" -#: ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:744 msgid "VPN connecting (prepare)" -msgstr "Conectando com o VPN (preparar)" +msgstr "Conexão VPN (preparando)" -#: ../cli/src/connections.c:1113 +#: ../cli/src/connections.c:746 msgid "VPN connecting (need authentication)" -msgstr "Conectando ao VPN (autenticação necessária)" +msgstr "Conexão VPN (precisa de autenticação)" -#: ../cli/src/connections.c:1115 +#: ../cli/src/connections.c:748 msgid "VPN connecting" -msgstr "Conectando ao VPN" +msgstr "Conexão VPN" -#: ../cli/src/connections.c:1117 +#: ../cli/src/connections.c:750 msgid "VPN connecting (getting IP configuration)" -msgstr "Conectando ao VPN (obtendo configuração do IP)" +msgstr "Conexão VPN (obtendo configuração de IP)" -#: ../cli/src/connections.c:1119 +#: ../cli/src/connections.c:752 msgid "VPN connected" -msgstr "VPN conectado" +msgstr "VPN conectada" -#: ../cli/src/connections.c:1121 +#: ../cli/src/connections.c:754 msgid "VPN connection failed" -msgstr "Falha da conexão ao VPN" +msgstr "Conexão VPN falhou" -#: ../cli/src/connections.c:1123 +#: ../cli/src/connections.c:756 msgid "VPN disconnected" -msgstr "VPN desconectado" +msgstr "VPN desconectada" -#: ../cli/src/connections.c:1134 +#: ../cli/src/connections.c:767 msgid "unknown reason" msgstr "razão desconhecida" -#: ../cli/src/connections.c:1136 +#: ../cli/src/connections.c:769 msgid "none" -msgstr "nenhuma" +msgstr "nenhum(a)" -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:771 msgid "the user was disconnected" msgstr "o usuário foi desconectado" -#: ../cli/src/connections.c:1140 +#: ../cli/src/connections.c:773 msgid "the base network connection was interrupted" msgstr "a conexão de rede base foi interrompida" -#: ../cli/src/connections.c:1142 +#: ../cli/src/connections.c:775 msgid "the VPN service stopped unexpectedly" msgstr "o serviço VPN parou inesperadamente" -#: ../cli/src/connections.c:1144 +#: ../cli/src/connections.c:777 msgid "the VPN service returned invalid configuration" -msgstr "O serviço VPN retornou configurações inválidas" +msgstr "o serviço VPN retornou uma configuração inválida" -#: ../cli/src/connections.c:1146 +#: ../cli/src/connections.c:779 msgid "the connection attempt timed out" -msgstr "a tentativa de conexão expirou o tempo limite" +msgstr "tentativa de conexão esgotada" -#: ../cli/src/connections.c:1148 +#: ../cli/src/connections.c:781 msgid "the VPN service did not start in time" -msgstr "o serviço VPN não iniciou em tempo" +msgstr "o serviço VPN não iniciou a tempo" -#: ../cli/src/connections.c:1150 +#: ../cli/src/connections.c:783 msgid "the VPN service failed to start" msgstr "o serviço VPN falhou ao iniciar" -#: ../cli/src/connections.c:1152 +#: ../cli/src/connections.c:785 msgid "no valid VPN secrets" -msgstr "Segredos do VPN não válidos" +msgstr "sem segredos VPN válidos" -#: ../cli/src/connections.c:1154 +#: ../cli/src/connections.c:787 msgid "invalid VPN secrets" -msgstr "Segredos do VPN inválidos" +msgstr "segredos VPN inválidos" -#: ../cli/src/connections.c:1156 +#: ../cli/src/connections.c:789 msgid "the connection was removed" msgstr "a conexão foi removida" -#: ../cli/src/connections.c:1170 +#: ../cli/src/connections.c:803 #, c-format msgid "state: %s\n" -msgstr "stado: %s\n" +msgstr "estado: %s\n" -#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 #, c-format msgid "Connection activated\n" msgstr "Conexão ativada\n" -#: ../cli/src/connections.c:1176 +#: ../cli/src/connections.c:809 #, c-format msgid "Error: Connection activation failed." -msgstr "Erro: Ativação da conexão falhou." +msgstr "Erro: a ativação da conexão falhou." -#: ../cli/src/connections.c:1195 +#: ../cli/src/connections.c:828 #, c-format msgid "state: %s (%d)\n" msgstr "estado: %s (%d)\n" -#: ../cli/src/connections.c:1205 +#: ../cli/src/connections.c:838 #, c-format msgid "Error: Connection activation failed: %s." -msgstr "Erro: Ativação de conexão falhou: %s" +msgstr "Erro: a ativação da conexão falhou: %s." -#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 #, c-format msgid "Error: Timeout %d sec expired." -msgstr "Erro: o Timeout%d de segundos expirou" +msgstr "Erro: tempo expirado - %d seg." -#: ../cli/src/connections.c:1265 +#: ../cli/src/connections.c:898 #, c-format msgid "Error: Connection activation failed: %s" -msgstr "Erro: Ativação de conexão falhou: %s" +msgstr "Erro: a ativação da conexão falhou: %s" -#: ../cli/src/connections.c:1279 +#: ../cli/src/connections.c:912 #, c-format msgid "Error: Obtaining active connection for '%s' failed." -msgstr "Erro: Obtenção de conexão ativa para '%s' falhou." +msgstr "Erro: falha na obtenção da conexão ativa para \"%s\"." -#: ../cli/src/connections.c:1288 +#: ../cli/src/connections.c:921 #, c-format msgid "Active connection state: %s\n" -msgstr "Estado de conexão ativa: %s\n" +msgstr "Estado da conexão ativa: %s\n" -#: ../cli/src/connections.c:1289 +#: ../cli/src/connections.c:922 #, c-format msgid "Active connection path: %s\n" -msgstr "Caminho de conexão ativa: %s\n" +msgstr "Caminho da conexão ativa: %s\n" -#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 #, c-format msgid "Error: Unknown connection: %s." -msgstr "Erro: Conexão desconhecida: %s" +msgstr "Erro: conexão desconhecida: %s." -#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 #, c-format msgid "Error: timeout value '%s' is not valid." -msgstr "Erro: valor timeout '%s' não é válido." +msgstr "Erro: valor do tempo de expiração \"%s\" não é válido." -#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 #, c-format msgid "Error: id or uuid has to be specified." -msgstr "Erro: id ou uuid deve ser especificada." +msgstr "Erro: id ou uuid tem que ser especificada." -#: ../cli/src/connections.c:1411 +#: ../cli/src/connections.c:1044 #, c-format msgid "Error: No suitable device found: %s." -msgstr "Erro: Não foi encontrado nenhum dispositivo adequado: %s." +msgstr "Erro: nenhum dispositivo adequado encontrado: %s." -#: ../cli/src/connections.c:1413 +#: ../cli/src/connections.c:1046 #, c-format msgid "Error: No suitable device found." -msgstr "Erro: Não foi encontrado nenhum dispositivo adequado." +msgstr "Erro: nenhum dispositivo adequado encontrado." -#: ../cli/src/connections.c:1505 +#: ../cli/src/connections.c:1138 #, c-format msgid "Warning: Connection not active\n" -msgstr "Aviso: Conexão não ativa\n" +msgstr "Aviso: conexão inativa\n" -#: ../cli/src/connections.c:1561 +#: ../cli/src/connections.c:1189 #, c-format msgid "Error: 'con' command '%s' is not valid." -msgstr "Erro: 'con' comando '%s' não é válido." +msgstr "Erro: comando \"con\" \"%s\" não é válido." -#: ../cli/src/connections.c:1597 +#: ../cli/src/connections.c:1216 #, c-format msgid "Error: could not connect to D-Bus." -msgstr "Erro: Nâo foi possível conectar ao D-Bus." +msgstr "Erro: não foi possível conectar ao D-Bus." -#: ../cli/src/connections.c:1604 +#: ../cli/src/connections.c:1223 #, c-format msgid "Error: Could not get system settings." -msgstr "Erro: Não foi possível obter configurações de sistema" +msgstr "Erro: não foi possível obter as configurações do sistema." -#: ../cli/src/connections.c:1612 +#: ../cli/src/connections.c:1231 #, c-format msgid "Error: Could not get user settings." -msgstr "Erro: Não foi possível obter configurações de usuário." +msgstr "Erro: não foi possível obter as configurações do usuário." -#: ../cli/src/connections.c:1622 +#: ../cli/src/connections.c:1241 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "" -"Erro: Não foi possível obter conexões: serviços de configuração não estão " -"funcionando." - -#. 0 -#. 9 -#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 -msgid "DEVICE" -msgstr "DISPOSITIVO" - -#. 1 -#. 4 -#. 0 -#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 -#: ../cli/src/network-manager.c:36 -msgid "STATE" -msgstr "ESTADO" - -#: ../cli/src/devices.c:71 -msgid "GENERAL" -msgstr "GERAL" - -#. 0 -#: ../cli/src/devices.c:72 -msgid "CAPABILITIES" -msgstr "CAPACIDADES" - -#. 1 -#: ../cli/src/devices.c:73 -msgid "WIFI-PROPERTIES" -msgstr "PROPRIEDADES DO WIFI" - -#. 2 -#: ../cli/src/devices.c:74 -msgid "AP" -msgstr "AP" - -#. 3 -#: ../cli/src/devices.c:75 -msgid "WIRED-PROPERTIES" -msgstr "PROPRIEDADES CABEADAS" - -#. 4 -#: ../cli/src/devices.c:76 -msgid "IP4-SETTINGS" -msgstr "CONFIGURAÇÕES DO IP4" - -#. 5 -#: ../cli/src/devices.c:77 -msgid "IP4-DNS" -msgstr "DNS DO IP4" - -#. 2 -#: ../cli/src/devices.c:88 -msgid "DRIVER" -msgstr "DRIVER" - -#. 3 -#: ../cli/src/devices.c:89 -msgid "HWADDR" -msgstr "HWADDR" - -#. 0 -#: ../cli/src/devices.c:99 -msgid "CARRIER-DETECT" -msgstr "DETECTOR DE CARREGADOR" - -#. 1 -#: ../cli/src/devices.c:100 -msgid "SPEED" -msgstr "VELOCIDADE" +"Erro: Não é possível obter conexões - serviços de configuração não estão em " +"execução." -#. 0 -#: ../cli/src/devices.c:109 -msgid "CARRIER" -msgstr "CARREGADOR" - -#. 0 -#: ../cli/src/devices.c:119 -msgid "WEP" -msgstr "WEP" - -#. 1 -#: ../cli/src/devices.c:120 -msgid "WPA" -msgstr "WPA" - -#. 2 -#: ../cli/src/devices.c:121 -msgid "WPA2" -msgstr "WPA2" - -#. 3 -#: ../cli/src/devices.c:122 -msgid "TKIP" -msgstr "TKIP" - -#. 4 -#: ../cli/src/devices.c:123 -msgid "CCMP" -msgstr "CCMP" - -#. 0 -#: ../cli/src/devices.c:132 -msgid "ADDRESS" -msgstr "ENDEREÇO" - -#. 1 -#: ../cli/src/devices.c:133 -msgid "PREFIX" -msgstr "PREFIXO" - -#. 2 -#: ../cli/src/devices.c:134 -msgid "GATEWAY" -msgstr "GATEWAY" - -#. 0 -#: ../cli/src/devices.c:143 -msgid "DNS" -msgstr "DNS" - -#. 0 -#: ../cli/src/devices.c:153 -msgid "SSID" -msgstr "SSID" - -#. 1 -#: ../cli/src/devices.c:154 -msgid "BSSID" -msgstr "BSSID" - -#. 2 -#: ../cli/src/devices.c:155 -msgid "MODE" -msgstr "MODO" - -#. 3 -#: ../cli/src/devices.c:156 -msgid "FREQ" -msgstr "FREQ" - -#. 4 -#: ../cli/src/devices.c:157 -msgid "RATE" -msgstr "TAXA" - -#. 5 -#: ../cli/src/devices.c:158 -msgid "SIGNAL" -msgstr "SINAL" - -#. 6 -#: ../cli/src/devices.c:159 -msgid "SECURITY" -msgstr "SEGURANÇA" - -#. 7 -#: ../cli/src/devices.c:160 -msgid "WPA-FLAGS" -msgstr "SINALIZADOR DO WPA" - -#. 8 -#: ../cli/src/devices.c:161 -msgid "RSN-FLAGS" -msgstr "SINALIZADOR DO RSN" - -#. 10 -#: ../cli/src/devices.c:163 -msgid "ACTIVE" -msgstr "ATIVO" - -#: ../cli/src/devices.c:186 +#: ../cli/src/devices.c:73 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -632,246 +357,359 @@ msgid "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] [hwaddr ]]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" "\n" msgstr "" -"Usage: nmcli dev { COMMAND | help }\n" +"Uso: nmcli dev { COMANDO | help }\n" "\n" -" COMMAND := { status | list | disconnect | wifi }\n" +" COMANDO := { status | list | disconnect | wifi }\n" "\n" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] [hwaddr ]]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" "\n" -#: ../cli/src/devices.c:206 +#: ../cli/src/devices.c:93 msgid "unmanaged" -msgstr "Não gerenciado" +msgstr "não gerenciável" -#: ../cli/src/devices.c:208 +#: ../cli/src/devices.c:95 msgid "unavailable" msgstr "indisponível" -#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 msgid "disconnected" -msgstr "disconectado" +msgstr "desconectado" -#: ../cli/src/devices.c:212 +#: ../cli/src/devices.c:99 msgid "connecting (prepare)" -msgstr "conectando (preparar)" +msgstr "conectando (preparando)" -#: ../cli/src/devices.c:214 +#: ../cli/src/devices.c:101 msgid "connecting (configuring)" msgstr "conectando (configurando)" -#: ../cli/src/devices.c:216 +#: ../cli/src/devices.c:103 msgid "connecting (need authentication)" -msgstr "conectando (é necessário uma autenticação)" +msgstr "conectando (precisa de autenticação)" -#: ../cli/src/devices.c:218 +#: ../cli/src/devices.c:105 msgid "connecting (getting IP configuration)" -msgstr "conectando (obtendo configuração do IP)" +msgstr "conectando (obtendo configuração de IP)" -#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 msgid "connected" msgstr "conectado" -#: ../cli/src/devices.c:222 +#: ../cli/src/devices.c:109 msgid "connection failed" -msgstr "conexão falhou" +msgstr "falha na conexão" -#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 msgid "Unknown" -msgstr "desconhecido" +msgstr "Desconhecido" -#: ../cli/src/devices.c:277 +#. print them +#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 +#: ../cli/src/devices.c:879 msgid "(none)" -msgstr "(nenhum)" +msgstr "(nenhum(a))" -#: ../cli/src/devices.c:302 +#: ../cli/src/devices.c:209 #, c-format msgid "%s: error converting IP4 address 0x%X" msgstr "%s: erro ao converter endereço IP4 0x%X" -#: ../cli/src/devices.c:349 +#: ../cli/src/devices.c:238 #, c-format -msgid "%u MHz" -msgstr "%u MHz" +msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +msgstr "%s, %s, Freq %d MHz, Taxa %d Mb/s, Força %d" -#: ../cli/src/devices.c:350 -#, c-format -msgid "%u MB/s" -msgstr "%u MB/s" +#: ../cli/src/devices.c:239 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" -#: ../cli/src/devices.c:359 -msgid "Encrypted: " -msgstr "Criptografado:" +#: ../cli/src/devices.c:248 +msgid ", Encrypted: " +msgstr ", Criptografada:" -#: ../cli/src/devices.c:364 -msgid "WEP " -msgstr "WEP" +#: ../cli/src/devices.c:253 +msgid " WEP" +msgstr " WEP" -#: ../cli/src/devices.c:366 -msgid "WPA " -msgstr "WPA" +#: ../cli/src/devices.c:255 +msgid " WPA" +msgstr " WPA" -#: ../cli/src/devices.c:368 -msgid "WPA2 " -msgstr "WPA2" +#: ../cli/src/devices.c:257 +msgid " WPA2" +msgstr " WPA2" -#: ../cli/src/devices.c:371 -msgid "Enterprise " -msgstr "Enterprise" +#: ../cli/src/devices.c:260 +msgid " Enterprise" +msgstr " Enterprise" -#: ../cli/src/devices.c:380 -msgid "Ad-Hoc" -msgstr "Ad-Hoc" +#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Device" +msgstr "Dispositivo" -#: ../cli/src/devices.c:380 -msgid "Infrastructure" -msgstr "Infraestrutura" +#: ../cli/src/devices.c:299 +msgid "Driver" +msgstr "Controlador" -#: ../cli/src/devices.c:442 -#, c-format -msgid "Error: 'dev list': %s" -msgstr "Erro: 'dev list': %s" +#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 +msgid "(unknown)" +msgstr "(desconhecido)" -#: ../cli/src/devices.c:444 -#, c-format -msgid "Error: 'dev list': %s; allowed fields: %s" -msgstr "Erro: 'dev list': %s, campos permitidos '%s'" +#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "State" +msgstr "Estado" -#: ../cli/src/devices.c:453 -msgid "Device details" -msgstr "Detalhes do Dispositivos" +#: ../cli/src/devices.c:313 +msgid "HW Address" +msgstr "Endereço de HW" -#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 -msgid "(unknown)" -msgstr "(desconhecido)" +#: ../cli/src/devices.c:319 +#, c-format +msgid "" +"\n" +" Capabilities:\n" +msgstr "" +"\n" +" Capacidades:\n" -#: ../cli/src/devices.c:484 -msgid "unknown)" -msgstr "desconhecido)" +#: ../cli/src/devices.c:321 +msgid "Carrier Detect" +msgstr "Detecção de Operadora" -#: ../cli/src/devices.c:510 +#: ../cli/src/devices.c:336 #, c-format msgid "%u Mb/s" msgstr "%u Mb/s" -#. Print header -#. "WIRED-PROPERTIES" -#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:337 +msgid "Speed" +msgstr "Velocidade" + +#: ../cli/src/devices.c:348 +#, c-format +msgid "" +"\n" +" Wireless Properties\n" +msgstr "" +"\n" +" Propriedades de rede sem fio\n" + +#: ../cli/src/devices.c:353 +msgid "WEP Encryption" +msgstr "Criptografia WEP" + +#: ../cli/src/devices.c:355 +msgid "WPA Encryption" +msgstr "Criptografia WPA" + +#: ../cli/src/devices.c:357 +msgid "WPA2 Encryption" +msgstr "Criptografia WPA2" + +#: ../cli/src/devices.c:359 +msgid "TKIP cipher" +msgstr "Cifrador TKIP" + +#: ../cli/src/devices.c:361 +msgid "CCMP cipher" +msgstr "Cifrador CCMP" + +#: ../cli/src/devices.c:368 +#, c-format +msgid "" +"\n" +" Wireless Access Points %s\n" +msgstr "" +"\n" +" Pontos de acesso sem fio %s\n" + +#: ../cli/src/devices.c:368 +msgid "(* = current AP)" +msgstr "(* = PA atual)" + +#: ../cli/src/devices.c:374 +#, c-format +msgid "" +"\n" +" Wired Properties\n" +msgstr "" +"\n" +" Propriedades de rede com fio\n" + +#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 +msgid "Carrier" +msgstr "Operadora" + +#: ../cli/src/devices.c:377 msgid "on" msgstr "ligado" -#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:379 msgid "off" msgstr "desligado" -#: ../cli/src/devices.c:710 +#: ../cli/src/devices.c:387 #, c-format -msgid "Error: 'dev status': %s" -msgstr "Erro: 'dev status': %s" +msgid "" +"\n" +" IPv4 Settings:\n" +msgstr "" +"\n" +" Configurações IPv4\n" -#: ../cli/src/devices.c:712 -#, c-format -msgid "Error: 'dev status': %s; allowed fields: %s" -msgstr "Erro: 'dev status': %s; campos permitidos: %s" +#: ../cli/src/devices.c:395 +msgid "Address" +msgstr "Endereço" + +#: ../cli/src/devices.c:401 +msgid "Prefix" +msgstr "Prefixo" + +#: ../cli/src/devices.c:405 +msgid "Gateway" +msgstr "Gateway" + +#: ../cli/src/devices.c:416 +msgid "DNS" +msgstr "DNS" -#: ../cli/src/devices.c:719 +#: ../cli/src/devices.c:458 msgid "Status of devices" -msgstr "Estado dos dispositivos" +msgstr "Status dos dispositivos" -#: ../cli/src/devices.c:747 +#: ../cli/src/devices.c:487 #, c-format msgid "Error: '%s' argument is missing." -msgstr "Erro: argumento '%s' está faltando" +msgstr "Erro: argumento \"%s\" está faltando." -#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 #, c-format msgid "Error: Device '%s' not found." -msgstr "Erro: Dispositivo '%s' não foi encontrado." +msgstr "Erro: dispositivo \"%s\" não encontrado." -#: ../cli/src/devices.c:799 +#: ../cli/src/devices.c:539 #, c-format msgid "Success: Device '%s' successfully disconnected." -msgstr "Sucesso: Dispositivo '%s' foi desconectado com sucesso." +msgstr "Sucesso: dispositivo \"%s\" desconectado com sucesso." -#: ../cli/src/devices.c:824 +#: ../cli/src/devices.c:564 #, c-format msgid "Error: Device '%s' (%s) disconnecting failed: %s" -msgstr "Erro: Desconexão do Dispositivo '%s' (%s) falhou: %s" +msgstr "Erro: desconexão do dispositivo \"%s\" (%s) falhou: %s" -#: ../cli/src/devices.c:832 +#: ../cli/src/devices.c:572 #, c-format msgid "Device state: %d (%s)\n" -msgstr "Estado do Dispositivo: %d (%s)\n" +msgstr "Estado do dispositivo: %d (%s)\n" -#: ../cli/src/devices.c:896 +#: ../cli/src/devices.c:636 #, c-format msgid "Error: iface has to be specified." -msgstr "Erro: iface precisa ser especificado." +msgstr "Erro: iface tem que ser especificada." -#: ../cli/src/devices.c:1011 -#, c-format -msgid "Error: 'dev wifi': %s" -msgstr "Erro: dev wifi '%s' " +#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 +msgid "WiFi scan list" +msgstr "Lista de varredura de redes sem fio" -#: ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:740 #, c-format -msgid "Error: 'dev wifi': %s; allowed fields: %s" -msgstr "Erro: 'dev wifi': %s;campos permitidos: %s" +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Erro: dispositivo \"%s\" não é um dispositivo sem fio." -#: ../cli/src/devices.c:1020 -msgid "WiFi scan list" -msgstr "Lista de scan do WiFi " +#: ../cli/src/devices.c:754 +msgid "Device:" +msgstr "Dispositivo:" -#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#: ../cli/src/devices.c:806 #, c-format -msgid "Error: Access point with hwaddr '%s' not found." -msgstr "Erro: Ponto de aceso com o hwaddr '%s' não foi encontrado." +msgid "Error: hwaddr has to be specified." +msgstr "Erro: hwaddr tem que ser especificado." -#: ../cli/src/devices.c:1072 +#: ../cli/src/devices.c:844 #, c-format -msgid "Error: Device '%s' is not a WiFi device." -msgstr "Erro: Dispositivo '%s' não é um dispositivo WiFi." +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Erro: Ponto de acesso com hwaddr \"%s\" não encontrado." -#: ../cli/src/devices.c:1136 +#: ../cli/src/devices.c:862 #, c-format -msgid "Error: 'dev wifi' command '%s' is not valid." -msgstr "Erro: comando dev wifi '%s' não é válido" +msgid "%u MHz" +msgstr "%u MHz" -#: ../cli/src/devices.c:1183 +#: ../cli/src/devices.c:863 #, c-format -msgid "Error: 'dev' command '%s' is not valid." -msgstr "Erro: comando 'dev' '%s' não é válido" +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 +msgid "AP parameters" +msgstr "Parâmetros do PA" + +#: ../cli/src/devices.c:873 +msgid "SSID:" +msgstr "SSID:" + +#: ../cli/src/devices.c:874 +msgid "BSSID:" +msgstr "BSSID:" + +#: ../cli/src/devices.c:875 +msgid "Frequency:" +msgstr "Frequência:" + +#: ../cli/src/devices.c:876 +msgid "Mode:" +msgstr "Modo:" + +#: ../cli/src/devices.c:876 +msgid "Ad-hoc" +msgstr "Ad-hoc" -#: ../cli/src/network-manager.c:35 -msgid "RUNNING" -msgstr "EXECUTANDO" +#: ../cli/src/devices.c:876 +msgid "Infrastructure" +msgstr "Infraestrutura" + +#: ../cli/src/devices.c:877 +msgid "Maximal bitrate:" +msgstr "Bitrate máxima:" + +#: ../cli/src/devices.c:878 +msgid "Strength:" +msgstr "Potência:" -#. 1 -#: ../cli/src/network-manager.c:37 -msgid "WIFI-HARDWARE" -msgstr "HARDWARE DO WIFI" +#: ../cli/src/devices.c:879 +msgid "Flags:" +msgstr "Flags:" -#. 2 -#: ../cli/src/network-manager.c:38 -msgid "WIFI" -msgstr "WIFI" +#: ../cli/src/devices.c:879 +msgid "privacy" +msgstr "privacidade" -#. 3 -#: ../cli/src/network-manager.c:39 -msgid "WWAN-HARDWARE" -msgstr "HARDWARE DO WWAN" +#: ../cli/src/devices.c:880 +msgid "WPA flags:" +msgstr "Flags WPA:" + +#: ../cli/src/devices.c:881 +msgid "RSN flags:" +msgstr "Flags RSN:" + +#: ../cli/src/devices.c:907 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Erro: comando \"dev wifi %s\" é inválido." -#. 4 -#: ../cli/src/network-manager.c:40 -msgid "WWAN" -msgstr "WWAN" +#: ../cli/src/devices.c:943 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Erro: comando \"dev %s\" é inválido." -#: ../cli/src/network-manager.c:62 +#: ../cli/src/network-manager.c:46 #, c-format msgid "" "Usage: nmcli nm { COMMAND | help }\n" @@ -885,9 +723,9 @@ msgid "" " wwan [on|off]\n" "\n" msgstr "" -"Usage: nmcli nm { COMMAND | help }\n" +"Uso: nmcli nm { COMANDO | help }\n" "\n" -" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +" COMANDO := { status | sleep | wakeup | wifi | wwan }\n" "\n" " status\n" " sleep\n" @@ -896,91 +734,89 @@ msgstr "" " wwan [on|off]\n" "\n" -#: ../cli/src/network-manager.c:83 +#: ../cli/src/network-manager.c:67 msgid "asleep" -msgstr "modo de espera" +msgstr "adormecido" -#: ../cli/src/network-manager.c:85 +#: ../cli/src/network-manager.c:69 msgid "connecting" msgstr "conectando" -#: ../cli/src/network-manager.c:125 -#, c-format -msgid "Error: 'nm status': %s" -msgstr "Erro: 'nm status': %s" +#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 +msgid "enabled" +msgstr "habilitado" -#: ../cli/src/network-manager.c:127 -#, c-format -msgid "Error: 'nm status': %s; allowed fields: %s" -msgstr "Erro: 'nm status': %s; campos permitidos: %s" +#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 +msgid "disabled" +msgstr "desabilitado" -#: ../cli/src/network-manager.c:134 +#: ../cli/src/network-manager.c:102 msgid "NetworkManager status" -msgstr "status do NetworkManager " +msgstr "Status do NetworkManager" -#. Print header -#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 -#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 -#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 -msgid "enabled" -msgstr "ativado" +#: ../cli/src/network-manager.c:104 +msgid "NM running:" +msgstr "NM rodando:" -#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 -#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 -#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 -msgid "disabled" -msgstr "desativado" - -#: ../cli/src/network-manager.c:148 +#: ../cli/src/network-manager.c:104 msgid "running" -msgstr "executando:" +msgstr "executando" -#: ../cli/src/network-manager.c:148 +#: ../cli/src/network-manager.c:104 msgid "not running" -msgstr "não está executando:" +msgstr "não executando" -#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 -#, c-format -msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" -msgstr "Erro: valor do '--fields' '%s' não é válido aqui; campos permitidos: %s" +#: ../cli/src/network-manager.c:105 +msgid "NM state:" +msgstr "Estado do NM:" -#: ../cli/src/network-manager.c:209 -msgid "WiFi enabled" -msgstr "WiFi ativado" +#: ../cli/src/network-manager.c:106 +msgid "NM wireless hardware:" +msgstr "Hardware sem fio do NM:" -#: ../cli/src/network-manager.c:220 +#. no argument, show current state +#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 +msgid "NM wireless:" +msgstr "NM sem fio:" + +#: ../cli/src/network-manager.c:108 +msgid "NM WWAN hardware:" +msgstr "Hardware NM WWAN:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 +msgid "NM WWAN:" +msgstr "NM WWAN:" + +#: ../cli/src/network-manager.c:150 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." -msgstr "Erro: parâmetro do 'wifi' inválido: '%s'" +msgstr "Erro: parâmetro \"wifi\" inválido: \"%s\"" -#: ../cli/src/network-manager.c:241 -msgid "WWAN enabled" -msgstr "WWAN ativado" - -#: ../cli/src/network-manager.c:252 +#: ../cli/src/network-manager.c:167 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." -msgstr "Erro: parâmetro 'wwan' inválido: '%s'." +msgstr "Erro: parâmetro \"wwan\" inválido: \"%s\"" -#: ../cli/src/network-manager.c:263 +#: ../cli/src/network-manager.c:178 #, c-format msgid "Error: 'nm' command '%s' is not valid." -msgstr "Erro: comando 'nm' '%s' não é válido." +msgstr "Erro: comando \"nm %s\" é inválido." -#: ../cli/src/nmcli.c:69 +#: ../cli/src/nmcli.c:65 #, c-format msgid "" "Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" "\n" "OPTIONS\n" -" -t[erse] terse output\n" -" -p[retty] pretty output\n" -" -m[ode] tabular|multiline output mode\n" -" -f[ields] |all|common specify fields to output\n" -" -e[scape] yes|no escape columns separators in " -"values\n" -" -v[ersion] show program version\n" -" -h[elp] print this help\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" "\n" "OBJECT\n" " nm NetworkManager status\n" @@ -988,187 +824,53 @@ msgid "" " dev devices managed by NetworkManager\n" "\n" msgstr "" -"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"Uso: %s [OPÇÕES] OBJETO { COMANDO | help }\n" "\n" -"OPTIONS\n" -" -t[erse] terse output\n" -" -p[retty] pretty output\n" -" -m[ode] tabular|multiline output mode\n" -" -f[ields] |all|common specify fields to output\n" -" -e[scape] yes|no escape columns separators in " -"values\n" -" -v[ersion] show program version\n" -" -h[elp] print this help\n" +"OPÇÕES\n" +" -t[erse] saída concisa\n" +" -p[retty] saída elegante\n" +" -v[ersion] mostra a versão do programa\n" +" -h[elp] imprime esta ajuda\n" "\n" -"OBJECT\n" -" nm NetworkManager status\n" -" con NetworkManager connections\n" -" dev devices managed by NetworkManager\n" +"OBJETO\n" +" nm Status do NetworkManager\n" +" con Conexões do NetworkManager\n" +" dev Dispositivos gerenciados pelo NetworkManager\n" "\n" -#: ../cli/src/nmcli.c:113 -#, c-format -msgid "Error: Object '%s' is unknown, try 'nmcli help'." -msgstr "Erro: Objeto '%s' é desconhecido, tente o 'nmcli help'." - -#: ../cli/src/nmcli.c:143 -#, c-format -msgid "Error: Option '--terse' is specified the second time." -msgstr "Erro: Opção '--terse' está especificada uma segunda vez" - -#: ../cli/src/nmcli.c:148 -#, c-format -msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." -msgstr "Erro: Opção '--terse'é mutualmente exclusivo com o '--pretty'" - -#: ../cli/src/nmcli.c:156 -#, c-format -msgid "Error: Option '--pretty' is specified the second time." -msgstr "Erro: Opção '--pretty' está especificado uma segunda vez" - -#: ../cli/src/nmcli.c:161 -#, c-format -msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." -msgstr "Erro: Opção '--pretty'é mutualmente exclusivo com o '--terse'" - -#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#: ../cli/src/nmcli.c:106 #, c-format -msgid "Error: missing argument for '%s' option." -msgstr "Erro: argumento está faltando para a opção %s." +msgid "Object '%s' is unknown, try 'nmcli help'." +msgstr "Objeto \"%s\" é desconhecido, tente \"nmcli help\"." -#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 -#, c-format -msgid "Error: '%s' is not valid argument for '%s' option." -msgstr "Erro: '%s' não é um argumento válido para a opção '%s'" - -#: ../cli/src/nmcli.c:203 -#, c-format -msgid "Error: fields for '%s' options are missing." -msgstr "Erro: campos para as opções '%s' estão faltando" - -#: ../cli/src/nmcli.c:209 +#: ../cli/src/nmcli.c:139 #, c-format msgid "nmcli tool, version %s\n" msgstr "ferramenta nmcli, versão %s\n" -#: ../cli/src/nmcli.c:215 +#: ../cli/src/nmcli.c:145 #, c-format -msgid "Error: Option '%s' is unknown, try 'nmcli -help'." -msgstr "Erro: Opção '%s' é desconhecida, tente 'nmcli help'." +msgid "Option '%s' is unknown, try 'nmcli -help'." +msgstr "Opção \"%s\" é desconhecida, tente \"nmcli -help\"." -#: ../cli/src/nmcli.c:234 +#: ../cli/src/nmcli.c:164 #, c-format msgid "Caught signal %d, shutting down..." -msgstr "Obtenção de sinal %d, fechando..." +msgstr "Sinal capturado %d, desligando..." -#: ../cli/src/nmcli.c:259 +#: ../cli/src/nmcli.c:189 #, c-format msgid "Error: Could not connect to NetworkManager." -msgstr "Erro: Não foi possível conectar ao NetworkManager." +msgstr "Erro: não foi possível conectar ao NetworkManager." -#: ../cli/src/nmcli.c:275 +#: ../cli/src/nmcli.c:205 msgid "Success" msgstr "Sucesso" -#: ../cli/src/settings.c:407 -#, c-format -msgid "%d (hex-ascii-key)" -msgstr "%d (hex-ascii-key)" - -#: ../cli/src/settings.c:409 -#, c-format -msgid "%d (104/128-bit passphrase)" -msgstr "%d (104/128-bit passphrase)" - -#: ../cli/src/settings.c:412 -#, c-format -msgid "%d (unknown)" -msgstr "%d (desconhecido)" - -#: ../cli/src/settings.c:438 -msgid "0 (unknown)" -msgstr "0 (desconhecido)" - -#: ../cli/src/settings.c:444 -msgid "any, " -msgstr "qualquer um" - -#: ../cli/src/settings.c:446 -msgid "900 MHz, " -msgstr "900 MHz, " - -#: ../cli/src/settings.c:448 -msgid "1800 MHz, " -msgstr "1800 MHz, " - -#: ../cli/src/settings.c:450 -msgid "1900 MHz, " -msgstr "1900 MHz, " - -#: ../cli/src/settings.c:452 -msgid "850 MHz, " -msgstr "850 MHz, " - -#: ../cli/src/settings.c:454 -msgid "WCDMA 3GPP UMTS 2100 MHz, " -msgstr "WCDMA 3GPP UMTS 2100 MHz, " - -#: ../cli/src/settings.c:456 -msgid "WCDMA 3GPP UMTS 1800 MHz, " -msgstr "WCDMA 3GPP UMTS 1800 MHz, " - -#: ../cli/src/settings.c:458 -msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " -msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " - -#: ../cli/src/settings.c:460 -msgid "WCDMA 3GPP UMTS 800 MHz, " -msgstr "WCDMA 3GPP UMTS 800 MHz, " - -#: ../cli/src/settings.c:462 -msgid "WCDMA 3GPP UMTS 850 MHz, " -msgstr "WCDMA 3GPP UMTS 850 MHz, " - -#: ../cli/src/settings.c:464 -msgid "WCDMA 3GPP UMTS 900 MHz, " -msgstr "WCDMA 3GPP UMTS 900 MHz, " - -#: ../cli/src/settings.c:466 -msgid "WCDMA 3GPP UMTS 1700 MHz, " -msgstr "WCDMA 3GPP UMTS 1700 MHz, " - -#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 -msgid "auto" -msgstr "auto" - -#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 -msgid "not set" -msgstr "não definido" - -#: ../cli/src/utils.c:124 -#, c-format -msgid "field '%s' has to be alone" -msgstr "campo '%s' precisa estar sozinho" - -#: ../cli/src/utils.c:127 -#, c-format -msgid "invalid field '%s'" -msgstr "campo inválido '%s'" - -#: ../cli/src/utils.c:146 -#, c-format -msgid "Option '--terse' requires specifying '--fields'" -msgstr "Opção '--terse' requer a especificação de '..fields' " - -#: ../cli/src/utils.c:150 -#, c-format -msgid "Option '--terse' requires specific '--fields' option values , not '%s'" -msgstr "Opção '--terse' requer que especifique os valores da opção '--fields', e não '%s'" - #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." -msgstr "A chave do arquivo PEM não tinha a marca de finalização '%s'." +msgstr "A chave do arquivo PEM não tinha a marca de finalização \"%s\"." #: ../libnm-util/crypto.c:130 #, c-format @@ -1270,7 +972,8 @@ msgstr "Não foi possível determinar o tipo da chave privada." #: ../libnm-util/crypto.c:530 #, c-format msgid "Not enough memory to store decrypted private key." -msgstr "Memória insuficiente para armazenar a chave privada de descriptografia." +msgstr "" +"Memória insuficiente para armazenar a chave privada de descriptografia." #: ../libnm-util/crypto_gnutls.c:49 msgid "Failed to initialize the crypto engine." @@ -1284,7 +987,7 @@ msgstr "Falha ao inicializar o motor MD5: %s / %s." #: ../libnm-util/crypto_gnutls.c:156 #, c-format msgid "Invalid IV length (must be at least %zd)." -msgstr "Comprimento IV inválido (deve ter ao menos %zd)." +msgstr "Tamanho do IV inválido (tem que ser pelo menos %zd)." #: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format @@ -1314,7 +1017,9 @@ msgstr "Falha ao descriptografar a chave privada: %s / %s." #: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 #, c-format msgid "Failed to decrypt the private key: unexpected padding length." -msgstr "Falha ao descriptografar a chave privada: comprimento da proteção inesperado." +msgstr "" +"Falha ao descriptografar a chave privada: comprimento de preenchimento não " +"esperado." #: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 #, c-format @@ -1329,22 +1034,22 @@ msgstr "Não foi possível alocar memória para criptografia." #: ../libnm-util/crypto_gnutls.c:294 #, c-format msgid "Failed to initialize the encryption cipher context: %s / %s." -msgstr "Falha ao inicializar o contexto da cifra de descriptografia: %s / %s. " +msgstr "Falha ao inicializar o contexto da cifra de criptografia: %s / %s." #: ../libnm-util/crypto_gnutls.c:303 #, c-format msgid "Failed to set symmetric key for encryption: %s / %s." -msgstr "Falha ao definir chave simétrica para descriptografia: %s / %s. " +msgstr "Falha ao definir chave simétrica para criptografia: %s / %s." #: ../libnm-util/crypto_gnutls.c:313 #, c-format msgid "Failed to set IV for encryption: %s / %s." -msgstr "Falha ao definir IV para descriptografia: %s / %s. " +msgstr "Falha ao definir IV para criptografia: %s / %s." #: ../libnm-util/crypto_gnutls.c:322 #, c-format msgid "Failed to encrypt the data: %s / %s." -msgstr "Falha ao descriptografar a chave privada: %s / %s. " +msgstr "Falha ao criptografar a chave privada: %s / %s." #: ../libnm-util/crypto_gnutls.c:362 #, c-format @@ -1384,7 +1089,7 @@ msgstr "Falha ao inicializar o contexto MD5: %d." #: ../libnm-util/crypto_nss.c:179 #, c-format msgid "Invalid IV length (must be at least %d)." -msgstr "Comprimento IV inválido (deve ter ao menos %d)." +msgstr "Tamanho inválido do IV (tem que ser pelo menos %d)." #: ../libnm-util/crypto_nss.c:196 #, c-format @@ -1416,7 +1121,7 @@ msgstr "Falha ao descriptografar a chave privada: %d." msgid "Failed to decrypt the private key: decrypted data too large." msgstr "" "Falha ao descriptografar a chave privada: dados descriptografados muito " -"grandes." +"compridos." #: ../libnm-util/crypto_nss.c:256 #, c-format @@ -1426,7 +1131,7 @@ msgstr "Falha ao finalizar a descriptografia da chave privada: %d." #: ../libnm-util/crypto_nss.c:364 #, c-format msgid "Failed to initialize the encryption cipher slot." -msgstr "Falha ao inicializar o espaço de cifra de criptografia. " +msgstr "Falha ao inicializar o espaço de cifra de criptografia." #: ../libnm-util/crypto_nss.c:372 #, c-format @@ -1446,12 +1151,12 @@ msgstr "Falha ao inicializar o contexto de criptografia." #: ../libnm-util/crypto_nss.c:396 #, c-format msgid "Failed to encrypt: %d." -msgstr "Falha ao criptografar: %d." +msgstr "Falha ao criptografar a chave privada: %d." #: ../libnm-util/crypto_nss.c:404 #, c-format msgid "Unexpected amount of data after encrypting." -msgstr "Quantia inesperada de dados após criptografia." +msgstr "Quantidade de dados inesperados depois da criptografia." #: ../libnm-util/crypto_nss.c:447 #, c-format @@ -1482,31 +1187,31 @@ msgstr "Não foi possível verificar o arquivo PKCS#12: %d" msgid "Could not generate random data." msgstr "Não foi possível gerar dados aleatórios." -#: ../libnm-util/nm-utils.c:1925 +#: ../libnm-util/nm-utils.c:1924 #, c-format msgid "Not enough memory to make encryption key." -msgstr "Memória insuficiente para criptografar a chave." +msgstr "Memória insuficiente para criar a chave de criptografia." -#: ../libnm-util/nm-utils.c:2035 +#: ../libnm-util/nm-utils.c:2034 msgid "Could not allocate memory for PEM file creation." -msgstr "Não foi possível alocar memória criar arquivo PEM." +msgstr "Não foi possível alocar memória para criação do arquivo PEM." -#: ../libnm-util/nm-utils.c:2047 +#: ../libnm-util/nm-utils.c:2046 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "Não foi possível alocar memória para gravar IV no arquivo PEM." -#: ../libnm-util/nm-utils.c:2059 +#: ../libnm-util/nm-utils.c:2058 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "" -"Não foi possível alocar memória para gravar chave criptografada no arquivo " +"Não foi possível alocar memória para gravar a chave criptografada no arquivo " "PEM." -#: ../libnm-util/nm-utils.c:2078 +#: ../libnm-util/nm-utils.c:2077 #, c-format msgid "Could not allocate memory for PEM file data." -msgstr "Nâo foi possível alocar memória para daods de arquivo PEM." +msgstr "Não foi possível alocar memória para os dados do arquivo PEM." #: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 #: ../src/nm-netlink-monitor.c:653 @@ -1521,12 +1226,15 @@ msgstr "ocorreu um erro ao esperar pelos dados da conexão" #: ../src/nm-netlink-monitor.c:254 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" -msgstr "não foi possível conectar ao netlink para monitoração de status do link: %s" +msgstr "" +"não foi possível conectar ao netlink para monitoração de status do link: %s" #: ../src/nm-netlink-monitor.c:265 #, c-format msgid "unable to enable netlink handle credential passing: %s" -msgstr "não foi possível ativar o netlink para manipular a passagem da credencial: %s" +msgstr "" +"não foi possível habilitar o manipulador de credencial de passagem do " +"netlink: %s" #: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 #, c-format @@ -1545,7 +1253,7 @@ msgstr "" #: ../src/nm-netlink-monitor.c:502 #, c-format msgid "unable to join netlink group: %s" -msgstr "não foi possível associar-se ao grupo do netlink : %s" +msgstr "não foi possível associar-se ao grupo do netlink: %s" #: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 #, c-format @@ -1555,7 +1263,8 @@ msgstr "erro ao atualizar o cache de link: %s" #: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" -msgstr "Opção inválida. Por favor, use --help para ver uma lista de opções válidas.\n" +msgstr "" +"Opção inválida. Por favor, use --help para ver uma lista de opções válidas.\n" #: ../src/main.c:562 #, c-format @@ -1577,30 +1286,30 @@ msgstr "" #: ../src/dhcp-manager/nm-dhcp-manager.c:279 msgid "no usable DHCP client could be found." -msgstr "Não foi encontrado nenhum cliente DHCP usável." +msgstr "nenhum cliente DHCP utilizável pôde ser encontrado." #: ../src/dhcp-manager/nm-dhcp-manager.c:288 msgid "'dhclient' could be found." -msgstr "'dhclient' não pôde ser encontrado." +msgstr "\"dhclient\" não pôde ser encontrado." #: ../src/dhcp-manager/nm-dhcp-manager.c:298 msgid "'dhcpcd' could be found." -msgstr "Não foi possível encontrar 'dhcpcd'" +msgstr "\"dhcpd\" não pôde ser encontrado." #: ../src/dhcp-manager/nm-dhcp-manager.c:306 #, c-format msgid "unsupported DHCP client '%s'" -msgstr "Cliente DHCP sem suporte '%s'" +msgstr "cliente DHCP \"%s\" não suportado" #: ../src/logging/nm-logging.c:146 #, c-format msgid "Unknown log level '%s'" -msgstr "Nível de log desconhecido '%s'" +msgstr "Nível de registro \"%s\" desconhecido" #: ../src/logging/nm-logging.c:171 #, c-format msgid "Unknown log domain '%s'" -msgstr "Domínio de log desconhecido '%s'" +msgstr "Domínio de registro \"%s\" desconhecido" #: ../src/named-manager/nm-named-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." @@ -1617,21 +1326,21 @@ msgstr "Os servidores de nomes listados abaixo podem não ser reconhecidos." msgid "Auto %s" msgstr "Auto %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3254 msgid "System" msgstr "Sistema" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 msgid "Connection sharing via a protected WiFi network" -msgstr "Compartilhamento de conexão via rede WiFi protegida" +msgstr "Compartilhamento de conexão via rede sem fio protegida" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 msgid "Connection sharing via an open WiFi network" -msgstr "Compartilhamento de conexão via rede de WiFi aberta" +msgstr "Compartilhamento de conexão via rede sem fio aberta" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 msgid "Modify persistent system hostname" -msgstr "Modificar hostname do sistema persistente" +msgstr "Modificar máquina de sistema persistente" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 msgid "Modify system connections" @@ -1639,21 +1348,21 @@ msgstr "Modificar conexões de sistema" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 msgid "System policy prevents modification of system settings" -msgstr "Política de sistema evita modificação de configuração de sistema" +msgstr "Políticas de sistema previnem modificação das configurações do sistema" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 msgid "System policy prevents modification of the persistent system hostname" -msgstr "Política de sistema evita modificação de hostname de sistema persistente" +msgstr "" +"Políticas de sistema previnem modificação da máquina persistente do sistema" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 msgid "System policy prevents sharing connections via a protected WiFi network" msgstr "" -"Política de Sistema evita compartilhamento de conexões via rede de WiFi " -"protegida." +"Políticas de sistema previnem compartilhamento de conexões através de uma " +"rede sem fio protegida" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 msgid "System policy prevents sharing connections via an open WiFi network" msgstr "" -"Política de Sistema evita compartilhamento de conexões via rede de WiFi " -"aberta" - +"Políticas de sistema previnem compartilhamento de conexões através de uma " +"rede sem fio aberta" -- cgit v1.2.1 From 7e054ff138e80d31df235171fed5bf9d5c038072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 9 Jun 2010 15:01:23 +0200 Subject: core: add a multicast route entry for connections with link-local IPv4 address --- src/nm-device.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/nm-device.c b/src/nm-device.c index fcd3120538..ba26decaa3 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -1019,6 +1019,7 @@ aipd_get_ip4_config (NMDevice *self, NMDeviceStateReason *reason) NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); NMIP4Config *config = NULL; NMIP4Address *addr; + NMIP4Route *route; g_return_val_if_fail (priv->aipd_addr > 0, NULL); @@ -1033,6 +1034,14 @@ aipd_get_ip4_config (NMDevice *self, NMDeviceStateReason *reason) nm_ip4_address_set_prefix (addr, 16); nm_ip4_config_take_address (config, addr); + /* Add a multicast route for link-local connections: destination= 224.0.0.0, netmask=240.0.0.0 */ + route = nm_ip4_route_new (); + nm_ip4_route_set_dest (route, (guint32) htonl (0xE0000000L)); + nm_ip4_route_set_prefix (route, 4); + nm_ip4_route_set_next_hop (route, (guint32) 0); + nm_ip4_route_set_metric (route, 0); + nm_ip4_config_take_route (config, route); + return config; } -- cgit v1.2.1 From 691698fe47f33f688885cc45810867900ee2fc2c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 9 Jun 2010 16:58:06 -0700 Subject: dnsmasq: don't allow rogue config file screwing up connection sharing dnsmasq may read from its default config file location, which if that location is a valid config file, it will combine with the options here and cause undesirable side-effects. Like sending bogus IP addresses as the gateway or whatever. So give dnsmasq a bogus config file location to avoid screwing up the configuration we're passing to it. --- src/dnsmasq-manager/nm-dnsmasq-manager.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/dnsmasq-manager/nm-dnsmasq-manager.c b/src/dnsmasq-manager/nm-dnsmasq-manager.c index ea529c77eb..e6c67a1e31 100644 --- a/src/dnsmasq-manager/nm-dnsmasq-manager.c +++ b/src/dnsmasq-manager/nm-dnsmasq-manager.c @@ -251,8 +251,9 @@ create_dm_cmd_line (const char *iface, GString *s; NMIP4Address *tmp; struct in_addr addr; - char buf[INET_ADDRSTRLEN + 1]; + char buf[INET_ADDRSTRLEN + 15]; char localaddr[INET_ADDRSTRLEN + 1]; + int i; dm_binary = nm_find_dnsmasq (); if (!dm_binary) { @@ -273,6 +274,21 @@ create_dm_cmd_line (const char *iface, nm_cmd_line_add_string (cmd, "--log-queries"); } + /* dnsmasq may read from it's default config file location, which if that + * location is a valid config file, it will combine with the options here + * and cause undesirable side-effects. Like sending bogus IP addresses + * as the gateway or whatever. So give dnsmasq a bogus config file + * location to avoid screwing up the configuration we're passing to it. + */ + memset (buf, 0, sizeof (buf)); + strcpy (buf, "/tmp/"); + for (i = 5; i < 15; i++) + buf[i] = (char) (g_random_int_range ((guint32) 'a', (guint32) 'z') & 0xFF); + strcat (buf, ".conf"); + + nm_cmd_line_add_string (cmd, "--conf-file"); + nm_cmd_line_add_string (cmd, buf); + nm_cmd_line_add_string (cmd, "--no-hosts"); nm_cmd_line_add_string (cmd, "--keep-in-foreground"); nm_cmd_line_add_string (cmd, "--bind-interfaces"); -- cgit v1.2.1 From 69f25ca5cb413e41b1fcab9acf16501f6e1bdfc1 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 10 Jun 2010 10:12:04 -0700 Subject: policy: fix possible crash when looking up hostname Regression in 773c006a4c9d3162e9b371762dc59fd5948e4b43 --- src/nm-policy-hostname.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nm-policy-hostname.c b/src/nm-policy-hostname.c index baa6d3a3e3..5fe8a1cee3 100644 --- a/src/nm-policy-hostname.c +++ b/src/nm-policy-hostname.c @@ -57,7 +57,7 @@ hostname_thread_run_cb (gpointer user_data) HostnameThread *ht = (HostnameThread *) user_data; const char *hostname = NULL; - if (strlen (ht->hostname) && strcmp (hostname, ".")) + if (strlen (ht->hostname) && strcmp (ht->hostname, ".")) hostname = ht->hostname; nm_log_dbg (LOGD_DNS, "(%p) calling address reverse-lookup result handler", ht); -- cgit v1.2.1 From 763f2f1d01680093dea197fb4658eba6c1451483 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 10 Jun 2010 10:16:39 -0700 Subject: core: expose device's IP interface when activated Lets apps find out what the actual kernel interface name is for the device so they can do fun stuff with it. --- introspection/nm-device.xml | 10 +++++++++- src/nm-device-ethernet.c | 2 -- src/nm-device-interface.c | 10 +++++++++- src/nm-device-interface.h | 2 ++ src/nm-device.c | 22 +++++++++++++++++++++- 5 files changed, 41 insertions(+), 5 deletions(-) diff --git a/introspection/nm-device.xml b/introspection/nm-device.xml index 02b7501344..016c121e72 100644 --- a/introspection/nm-device.xml +++ b/introspection/nm-device.xml @@ -9,7 +9,15 @@ - The network interface offered by the device. + The name of the device's control (and often data) interface. + + + + + The name of the device's data interface when available. This property + may not refer to the actual data interface until the device has + successfully established a data connection, indicated by the device's + State becoming ACTIVATED. diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index be6d4e2f3c..4333d0f5d4 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -1448,8 +1448,6 @@ real_deactivate_quickly (NMDevice *device) { NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); - nm_device_set_ip_iface (device, NULL); - if (priv->pending_ip4_config) { g_object_unref (priv->pending_ip4_config); priv->pending_ip4_config = NULL; diff --git a/src/nm-device-interface.c b/src/nm-device-interface.c index a2eb746221..a0b9877bcc 100644 --- a/src/nm-device-interface.c +++ b/src/nm-device-interface.c @@ -90,7 +90,15 @@ nm_device_interface_init (gpointer g_iface) "Interface", "Interface", NULL, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_interface_install_property + (g_iface, + g_param_spec_string (NM_DEVICE_INTERFACE_IP_IFACE, + "IP Interface", + "IP Interface", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_interface_install_property (g_iface, diff --git a/src/nm-device-interface.h b/src/nm-device-interface.h index 1fee131bd1..0d8772dfce 100644 --- a/src/nm-device-interface.h +++ b/src/nm-device-interface.h @@ -49,6 +49,7 @@ typedef enum #define NM_DEVICE_INTERFACE_UDI "udi" #define NM_DEVICE_INTERFACE_IFACE "interface" +#define NM_DEVICE_INTERFACE_IP_IFACE "ip-interface" #define NM_DEVICE_INTERFACE_DRIVER "driver" #define NM_DEVICE_INTERFACE_CAPABILITIES "capabilities" #define NM_DEVICE_INTERFACE_IP4_ADDRESS "ip4-address" @@ -69,6 +70,7 @@ typedef enum { NM_DEVICE_INTERFACE_PROP_UDI = NM_DEVICE_INTERFACE_PROP_FIRST, NM_DEVICE_INTERFACE_PROP_IFACE, + NM_DEVICE_INTERFACE_PROP_IP_IFACE, NM_DEVICE_INTERFACE_PROP_DRIVER, NM_DEVICE_INTERFACE_PROP_CAPABILITIES, NM_DEVICE_INTERFACE_PROP_IP4_ADDRESS, diff --git a/src/nm-device.c b/src/nm-device.c index ba26decaa3..01874c5fde 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -388,11 +388,12 @@ void nm_device_set_ip_iface (NMDevice *self, const char *iface) { NMDevicePrivate *priv; + char *old_ip_iface; g_return_if_fail (NM_IS_DEVICE (self)); priv = NM_DEVICE_GET_PRIVATE (self); - g_free (priv->ip_iface); + old_ip_iface = priv->ip_iface; priv->ip_ifindex = 0; priv->ip_iface = g_strdup (iface); @@ -402,6 +403,11 @@ nm_device_set_ip_iface (NMDevice *self, const char *iface) nm_log_warn (LOGD_HW, "(%s): failed to look up interface index", iface); } } + + /* Emit change notification */ + if (g_strcmp0 (old_ip_iface, priv->ip_iface)) + g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_IP_IFACE); + g_free (old_ip_iface); } @@ -2746,6 +2752,8 @@ nm_device_deactivate_quickly (NMDevice *self) dnsmasq_cleanup (self); aipd_cleanup (self); + nm_device_set_ip_iface (self, NULL); + /* Turn off router advertisements until they are needed */ if (priv->ip6_accept_ra_path) nm_utils_do_sysctl (priv->ip6_accept_ra_path, "0\n"); @@ -3387,6 +3395,8 @@ set_property (GObject *object, guint prop_id, } } break; + case NM_DEVICE_INTERFACE_PROP_IP_IFACE: + break; case NM_DEVICE_INTERFACE_PROP_DRIVER: priv->driver = g_strdup (g_value_get_string (value)); break; @@ -3436,6 +3446,12 @@ get_property (GObject *object, guint prop_id, case NM_DEVICE_INTERFACE_PROP_IFACE: g_value_set_string (value, priv->iface); break; + case NM_DEVICE_INTERFACE_PROP_IP_IFACE: + if ((state == NM_DEVICE_STATE_ACTIVATED) || (state == NM_DEVICE_STATE_IP_CONFIG)) + g_value_set_string (value, nm_device_get_ip_iface (self)); + else + g_value_set_string (value, NULL); + break; case NM_DEVICE_INTERFACE_PROP_IFINDEX: g_value_set_int (value, priv->ifindex); break; @@ -3540,6 +3556,10 @@ nm_device_class_init (NMDeviceClass *klass) NM_DEVICE_INTERFACE_PROP_IFACE, NM_DEVICE_INTERFACE_IFACE); + g_object_class_override_property (object_class, + NM_DEVICE_INTERFACE_PROP_IP_IFACE, + NM_DEVICE_INTERFACE_IP_IFACE); + g_object_class_override_property (object_class, NM_DEVICE_INTERFACE_PROP_IFINDEX, NM_DEVICE_INTERFACE_IFINDEX); -- cgit v1.2.1 From 6ab5a9597a26235c9839df346fc3ce95f35a240f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 10 Jun 2010 10:21:19 -0700 Subject: libnm-glib: add IpInterface property --- libnm-glib/nm-device.c | 34 ++++++++++++++++++++++++++++++++++ libnm-glib/nm-device.h | 2 ++ 2 files changed, 36 insertions(+) diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c index 53fe0b73ad..a38c646a25 100644 --- a/libnm-glib/nm-device.c +++ b/libnm-glib/nm-device.c @@ -49,6 +49,7 @@ typedef struct { DBusGProxy *proxy; char *iface; + char *ip_iface; char *udi; char *driver; guint32 capabilities; @@ -84,6 +85,7 @@ enum { PROP_PRODUCT, PROP_VENDOR, PROP_DHCP6_CONFIG, + PROP_IP_INTERFACE, LAST_PROP }; @@ -272,6 +274,7 @@ register_for_property_changed (NMDevice *device) const NMPropertiesChangedInfo property_changed_info[] = { { NM_DEVICE_UDI, _nm_object_demarshal_generic, &priv->udi }, { NM_DEVICE_INTERFACE, _nm_object_demarshal_generic, &priv->iface }, + { NM_DEVICE_IP_INTERFACE, _nm_object_demarshal_generic, &priv->ip_iface }, { NM_DEVICE_DRIVER, _nm_object_demarshal_generic, &priv->driver }, { NM_DEVICE_CAPABILITIES, _nm_object_demarshal_generic, &priv->capabilities }, { NM_DEVICE_MANAGED, _nm_object_demarshal_generic, &priv->managed }, @@ -379,6 +382,7 @@ finalize (GObject *object) NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (object); g_free (priv->iface); + g_free (priv->ip_iface); g_free (priv->udi); g_free (priv->driver); g_free (priv->product); @@ -402,6 +406,9 @@ get_property (GObject *object, case PROP_INTERFACE: g_value_set_string (value, nm_device_get_iface (device)); break; + case PROP_IP_INTERFACE: + g_value_set_string (value, nm_device_get_ip_iface (device)); + break; case PROP_DRIVER: g_value_set_string (value, nm_device_get_driver (device)); break; @@ -746,6 +753,33 @@ nm_device_get_iface (NMDevice *device) return priv->iface; } +/** + * nm_device_get_ip_iface: + * @device: a #NMDevice + * + * Gets the IP interface name of the #NMDevice over which IP traffic flows + * when the device is in the ACTIVATED state. + * + * Returns: the IP traffic interface of the device. This is the internal string + * used by the device, and must not be modified. + **/ +const char * +nm_device_get_ip_iface (NMDevice *device) +{ + NMDevicePrivate *priv; + + g_return_val_if_fail (NM_IS_DEVICE (device), NULL); + + priv = NM_DEVICE_GET_PRIVATE (device); + if (!priv->ip_iface) { + priv->ip_iface = _nm_object_get_string_property (NM_OBJECT (device), + NM_DBUS_INTERFACE_DEVICE, + "IpInterface"); + } + + return priv->ip_iface; +} + /** * nm_device_get_udi: * @device: a #NMDevice diff --git a/libnm-glib/nm-device.h b/libnm-glib/nm-device.h index 5a47ff9a63..59bf4de6b1 100644 --- a/libnm-glib/nm-device.h +++ b/libnm-glib/nm-device.h @@ -46,6 +46,7 @@ G_BEGIN_DECLS #define NM_DEVICE_UDI "udi" #define NM_DEVICE_INTERFACE "interface" +#define NM_DEVICE_IP_INTERFACE "ip-interface" #define NM_DEVICE_DRIVER "driver" #define NM_DEVICE_CAPABILITIES "capabilities" #define NM_DEVICE_MANAGED "managed" @@ -85,6 +86,7 @@ GType nm_device_get_type (void); GObject * nm_device_new (DBusGConnection *connection, const char *path); const char * nm_device_get_iface (NMDevice *device); +const char * nm_device_get_ip_iface (NMDevice *device); const char * nm_device_get_udi (NMDevice *device); const char * nm_device_get_driver (NMDevice *device); guint32 nm_device_get_capabilities (NMDevice *device); -- cgit v1.2.1 From 4e02c67a940e265d6655672a9051087d2bd2ac60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Thu, 17 Jun 2010 14:57:25 +0200 Subject: ifcfg-rh: fix reading/writing ASCII WEP keys ifcfg-rh plugin didn't prepend 's:' prefix when writing out ASCII WEP keys. That rendered the keys file invalid. Moreover, the reading part was incorrect too not having recognized correct ASCII keys. --- system-settings/plugins/ifcfg-rh/reader.c | 14 ++++++++++---- system-settings/plugins/ifcfg-rh/writer.c | 12 +++++++++++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index a084d30b16..1c7e8eb6c7 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -1622,21 +1622,27 @@ add_one_wep_key (shvarFile *ifcfg, p++; } key = g_strdup (value); - } else if ( strncmp (value, "s:", 2) + } else if ( !strncmp (value, "s:", 2) && (strlen (value) == 7 || strlen (value) == 15)) { - /* ASCII passphrase */ + /* ASCII key */ char *p = value + 2; while (*p) { if (!isascii ((int) (*p))) { g_set_error (error, ifcfg_plugin_error_quark (), 0, - "Invalid ASCII WEP passphrase."); + "Invalid ASCII WEP key."); goto out; } p++; } - key = utils_bin2hexstr (value, strlen (value), strlen (value) * 2); + /* Remove 's:' prefix. + * Don't convert to hex string. wpa_supplicant takes 'wep_key0' option over D-Bus as byte array + * and converts it to hex string itself. Even though we convert hex string keys into a bin string + * before passing to wpa_supplicant, this prevents two unnecessary conversions. And mainly, + * ASCII WEP key doesn't change to HEX WEP key in UI, which could confuse users. + */ + key = g_strdup (value + 2); } } diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c index de69e0039e..2d206c7354 100644 --- a/system-settings/plugins/ifcfg-rh/writer.c +++ b/system-settings/plugins/ifcfg-rh/writer.c @@ -605,6 +605,8 @@ write_wireless_security_setting (NMConnection *connection, key = nm_setting_wireless_security_get_wep_key (s_wsec, i); if (key) { + char *ascii_key = NULL; + /* Passphrase needs a different ifcfg key since with WEP, there * are some passphrases that are indistinguishable from WEP hex * keys. @@ -612,11 +614,19 @@ write_wireless_security_setting (NMConnection *connection, key_type = nm_setting_wireless_security_get_wep_key_type (s_wsec); if (key_type == NM_WEP_KEY_TYPE_PASSPHRASE) tmp = g_strdup_printf ("KEY_PASSPHRASE%d", i + 1); - else + else { tmp = g_strdup_printf ("KEY%d", i + 1); + /* Add 's:' prefix for ASCII keys */ + if (strlen (key) == 5 || strlen (key) == 13) { + ascii_key = g_strdup_printf ("s:%s", key); + key = ascii_key; + } + } + set_secret (ifcfg, tmp, key, FALSE); g_free (tmp); + g_free (ascii_key); } } } -- cgit v1.2.1 From 0b41797b49ae46e1b61d1c94f6706cfa497cdfba Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 17 Jun 2010 21:24:14 -0700 Subject: s390: replace 'zvm' with s390 ZVM isn't the right terminology here. s390 is. --- libnm-util/libnm-util.ver | 2 +- libnm-util/nm-setting-wired.c | 32 +++++++++++----------- libnm-util/nm-setting-wired.h | 18 ++++++------ src/NetworkManagerUtils.c | 4 +-- src/NetworkManagerUtils.h | 2 +- src/nm-device-ethernet.c | 6 ++-- src/system-settings/nm-system-config-interface.h | 10 +++---- system-settings/plugins/ifcfg-rh/reader.c | 4 +-- .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 8 +++--- system-settings/plugins/ifcfg-rh/writer.c | 20 +++++++------- 10 files changed, 53 insertions(+), 53 deletions(-) diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver index e630b00ec8..508ac6de4e 100644 --- a/libnm-util/libnm-util.ver +++ b/libnm-util/libnm-util.ver @@ -289,7 +289,7 @@ global: nm_setting_wired_get_auto_negotiate; nm_setting_wired_get_mac_address; nm_setting_wired_get_mtu; - nm_setting_wired_get_zvm_subchannels; + nm_setting_wired_get_s390_subchannels; nm_setting_wireless_ap_security_compatible; nm_setting_wireless_error_get_type; nm_setting_wireless_error_quark; diff --git a/libnm-util/nm-setting-wired.c b/libnm-util/nm-setting-wired.c index 738302a378..8d562cd59d 100644 --- a/libnm-util/nm-setting-wired.c +++ b/libnm-util/nm-setting-wired.c @@ -76,7 +76,7 @@ typedef struct { gboolean auto_negotiate; GByteArray *mac_address; guint32 mtu; - GPtrArray *zvm_subchannels; + GPtrArray *s390_subchannels; } NMSettingWiredPrivate; enum { @@ -87,7 +87,7 @@ enum { PROP_AUTO_NEGOTIATE, PROP_MAC_ADDRESS, PROP_MTU, - PROP_ZVM_SUBCHANNELS, + PROP_S390_SUBCHANNELS, LAST_PROP }; @@ -147,11 +147,11 @@ nm_setting_wired_get_mtu (NMSettingWired *setting) } const GPtrArray * -nm_setting_wired_get_zvm_subchannels (NMSettingWired *setting) +nm_setting_wired_get_s390_subchannels (NMSettingWired *setting) { g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), NULL); - return NM_SETTING_WIRED_GET_PRIVATE (setting)->zvm_subchannels; + return NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_subchannels; } static gboolean @@ -185,11 +185,11 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) return FALSE; } - if (priv->zvm_subchannels && priv->zvm_subchannels->len != 3) { + if (priv->s390_subchannels && priv->s390_subchannels->len != 3) { g_set_error (error, NM_SETTING_WIRED_ERROR, NM_SETTING_WIRED_ERROR_INVALID_PROPERTY, - NM_SETTING_WIRED_ZVM_SUBCHANNELS); + NM_SETTING_WIRED_S390_SUBCHANNELS); return FALSE; } @@ -245,12 +245,12 @@ set_property (GObject *object, guint prop_id, case PROP_MTU: priv->mtu = g_value_get_uint (value); break; - case PROP_ZVM_SUBCHANNELS: - if (priv->zvm_subchannels) { - g_ptr_array_foreach (priv->zvm_subchannels, (GFunc) g_free, NULL); - g_ptr_array_free (priv->zvm_subchannels, TRUE); + case PROP_S390_SUBCHANNELS: + if (priv->s390_subchannels) { + g_ptr_array_foreach (priv->s390_subchannels, (GFunc) g_free, NULL); + g_ptr_array_free (priv->s390_subchannels, TRUE); } - priv->zvm_subchannels = g_value_dup_boxed (value); + priv->s390_subchannels = g_value_dup_boxed (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -283,8 +283,8 @@ get_property (GObject *object, guint prop_id, case PROP_MTU: g_value_set_uint (value, nm_setting_wired_get_mtu (setting)); break; - case PROP_ZVM_SUBCHANNELS: - g_value_set_boxed (value, nm_setting_wired_get_zvm_subchannels (setting)); + case PROP_S390_SUBCHANNELS: + g_value_set_boxed (value, nm_setting_wired_get_s390_subchannels (setting)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -411,7 +411,7 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class) G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE)); /** - * NMSettingWired:zvm-subchannels: + * NMSettingWired:s390-subchannels: * * Identifies specific subchannels that this network device uses for * communcation with z/VM or s390 host. Like #NMSettingWired:mac-address @@ -421,8 +421,8 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class) * composed of hexadecimal characters and the period (.) character. **/ g_object_class_install_property - (object_class, PROP_ZVM_SUBCHANNELS, - _nm_param_spec_specialized (NM_SETTING_WIRED_ZVM_SUBCHANNELS, + (object_class, PROP_S390_SUBCHANNELS, + _nm_param_spec_specialized (NM_SETTING_WIRED_S390_SUBCHANNELS, "z/VM Subchannels", "Identifies specific subchannels that this " "network device uses for communcation with z/VM " diff --git a/libnm-util/nm-setting-wired.h b/libnm-util/nm-setting-wired.h index 9bb8877127..ee2c4da1a0 100644 --- a/libnm-util/nm-setting-wired.h +++ b/libnm-util/nm-setting-wired.h @@ -58,7 +58,7 @@ GQuark nm_setting_wired_error_quark (void); #define NM_SETTING_WIRED_AUTO_NEGOTIATE "auto-negotiate" #define NM_SETTING_WIRED_MAC_ADDRESS "mac-address" #define NM_SETTING_WIRED_MTU "mtu" -#define NM_SETTING_WIRED_ZVM_SUBCHANNELS "zvm-subchannels" +#define NM_SETTING_WIRED_S390_SUBCHANNELS "s390-subchannels" typedef struct { NMSetting parent; @@ -76,14 +76,14 @@ typedef struct { GType nm_setting_wired_get_type (void); -NMSetting * nm_setting_wired_new (void); -const char * nm_setting_wired_get_port (NMSettingWired *setting); -guint32 nm_setting_wired_get_speed (NMSettingWired *setting); -const char * nm_setting_wired_get_duplex (NMSettingWired *setting); -gboolean nm_setting_wired_get_auto_negotiate (NMSettingWired *setting); -const GByteArray *nm_setting_wired_get_mac_address (NMSettingWired *setting); -guint32 nm_setting_wired_get_mtu (NMSettingWired *setting); -const GPtrArray * nm_setting_wired_get_zvm_subchannels (NMSettingWired *setting); +NMSetting * nm_setting_wired_new (void); +const char * nm_setting_wired_get_port (NMSettingWired *setting); +guint32 nm_setting_wired_get_speed (NMSettingWired *setting); +const char * nm_setting_wired_get_duplex (NMSettingWired *setting); +gboolean nm_setting_wired_get_auto_negotiate (NMSettingWired *setting); +const GByteArray *nm_setting_wired_get_mac_address (NMSettingWired *setting); +guint32 nm_setting_wired_get_mtu (NMSettingWired *setting); +const GPtrArray * nm_setting_wired_get_s390_subchannels (NMSettingWired *setting); G_END_DECLS diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c index 86f66f76d2..10240960b0 100644 --- a/src/NetworkManagerUtils.c +++ b/src/NetworkManagerUtils.c @@ -554,10 +554,10 @@ parse_subchannels (const char *subchannels, guint32 *a, guint32 *b, guint32 *c) return TRUE; } -#define SUBCHAN_TAG "zvm-subchannels:" +#define SUBCHAN_TAG "s390-subchannels:" gboolean -nm_match_spec_zvm_subchannels (const GSList *specs, const char *subchannels) +nm_match_spec_s390_subchannels (const GSList *specs, const char *subchannels) { const GSList *iter; guint32 a = 0, b = 0, c = 0; diff --git a/src/NetworkManagerUtils.h b/src/NetworkManagerUtils.h index 93a11c31cb..72c0e532b8 100644 --- a/src/NetworkManagerUtils.h +++ b/src/NetworkManagerUtils.h @@ -48,7 +48,7 @@ void nm_utils_call_dispatcher (const char *action, const char *vpn_iface); gboolean nm_match_spec_hwaddr (const GSList *specs, const char *hwaddr); -gboolean nm_match_spec_zvm_subchannels (const GSList *specs, const char *subchannels); +gboolean nm_match_spec_s390_subchannels (const GSList *specs, const char *subchannels); GHashTable *value_hash_create (void); diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index ce79664a8e..05d79de052 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -105,7 +105,7 @@ typedef struct { gboolean disposed; struct ether_addr hw_addr; - char * zvm_subchannels; + char * s390_subchannels; gboolean carrier; NMNetlinkMonitor * monitor; @@ -1528,8 +1528,8 @@ spec_match_list (NMDevice *device, const GSList *specs) matched = nm_match_spec_hwaddr (specs, hwaddr); g_free (hwaddr); - if (!matched && priv->zvm_subchannels) - matched = nm_match_spec_zvm_subchannels (specs, priv->zvm_subchannels); + if (!matched && priv->s390_subchannels) + matched = nm_match_spec_s390_subchannels (specs, priv->s390_subchannels); return matched; } diff --git a/src/system-settings/nm-system-config-interface.h b/src/system-settings/nm-system-config-interface.h index 2cbe2095ff..3daceb89bd 100644 --- a/src/system-settings/nm-system-config-interface.h +++ b/src/system-settings/nm-system-config-interface.h @@ -108,11 +108,11 @@ struct _NMSystemConfigInterface { * Method: mac Data: device MAC address formatted with leading zeros and * lowercase letters, like 00:0a:0b:0c:0d:0e * - * Method: zvm-subchannels Data: string of 2 or 3 z/VM subchannels - * separated by commas (,) that identify the - * device, like "0.0.09a0,0.0.09a1,0.0.09a2". - * The string may contain only the following - * characters: [a-fA-F0-9,.] + * Method: s390-subchannels Data: string of 2 or 3 s390 subchannels + * separated by commas (,) that identify the + * device, like "0.0.09a0,0.0.09a1,0.0.09a2". + * The string may contain only the following + * characters: [a-fA-F0-9,.] */ GSList * (*get_unmanaged_specs) (NMSystemConfigInterface *config); diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index edccd1efbd..2bac57940c 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -2995,12 +2995,12 @@ make_wired_setting (shvarFile *ifcfg, if (num_chans == 3) g_ptr_array_add (array, chans[2]); - g_object_set (s_wired, NM_SETTING_WIRED_ZVM_SUBCHANNELS, array, NULL); + g_object_set (s_wired, NM_SETTING_WIRED_S390_SUBCHANNELS, array, NULL); g_ptr_array_free (array, TRUE); /* set the unmanaged spec too */ if (!nm_controlled && !*unmanaged) - *unmanaged = g_strdup_printf ("zvm-subchannels:%s", value); + *unmanaged = g_strdup_printf ("s390-subchannels:%s", value); } g_strfreev (chans); } diff --git a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index b4aa60a86e..a97effbf88 100644 --- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -5160,17 +5160,17 @@ test_read_wired_qeth_static (void) NM_SETTING_WIRED_MAC_ADDRESS); /* Subchannels */ - subchannels = nm_setting_wired_get_zvm_subchannels (s_wired); + subchannels = nm_setting_wired_get_s390_subchannels (s_wired); ASSERT (subchannels != NULL, "wired-qeth-static-verify-wired", "failed to verify %s: missing %s / %s key", TEST_IFCFG_WIRED_QETH_STATIC, NM_SETTING_WIRED_SETTING_NAME, - NM_SETTING_WIRED_ZVM_SUBCHANNELS); + NM_SETTING_WIRED_S390_SUBCHANNELS); ASSERT (subchannels->len == 3, "wired-qeth-static-verify-wired", "failed to verify %s: invalid %s / %s key (not 3 elements)", TEST_IFCFG_WIRED_QETH_STATIC, NM_SETTING_WIRED_SETTING_NAME, - NM_SETTING_WIRED_ZVM_SUBCHANNELS); + NM_SETTING_WIRED_S390_SUBCHANNELS); tmp = (const char *) g_ptr_array_index (subchannels, 0); ASSERT (strcmp (tmp, expected_channel0) == 0, @@ -8306,7 +8306,7 @@ test_write_wired_qeth_dhcp (void) g_ptr_array_add (subchans, "0.0.601"); g_ptr_array_add (subchans, "0.0.602"); g_object_set (s_wired, - NM_SETTING_WIRED_ZVM_SUBCHANNELS, subchans, + NM_SETTING_WIRED_S390_SUBCHANNELS, subchans, NULL); g_ptr_array_free (subchans, TRUE); diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c index a9caf90a1e..a27c49961e 100644 --- a/system-settings/plugins/ifcfg-rh/writer.c +++ b/system-settings/plugins/ifcfg-rh/writer.c @@ -826,7 +826,7 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) const GByteArray *mac; char *tmp; guint32 mtu; - const GPtrArray *zvm_subchannels; + const GPtrArray *s390_subchannels; s_wired = (NMSettingWired *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED); if (!s_wired) { @@ -854,17 +854,17 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) } svSetValue (ifcfg, "SUBCHANNELS", NULL, FALSE); - zvm_subchannels = nm_setting_wired_get_zvm_subchannels (s_wired); - if (zvm_subchannels) { - if (zvm_subchannels->len == 2) { + s390_subchannels = nm_setting_wired_get_s390_subchannels (s_wired); + if (s390_subchannels) { + if (s390_subchannels->len == 2) { tmp = g_strdup_printf ("%s,%s", - (const char *) g_ptr_array_index (zvm_subchannels, 0), - (const char *) g_ptr_array_index (zvm_subchannels, 1)); - } else if (zvm_subchannels->len == 3) { + (const char *) g_ptr_array_index (s390_subchannels, 0), + (const char *) g_ptr_array_index (s390_subchannels, 1)); + } else if (s390_subchannels->len == 3) { tmp = g_strdup_printf ("%s,%s,%s", - (const char *) g_ptr_array_index (zvm_subchannels, 0), - (const char *) g_ptr_array_index (zvm_subchannels, 1), - (const char *) g_ptr_array_index (zvm_subchannels, 2)); + (const char *) g_ptr_array_index (s390_subchannels, 0), + (const char *) g_ptr_array_index (s390_subchannels, 1), + (const char *) g_ptr_array_index (s390_subchannels, 2)); } svSetValue (ifcfg, "SUBCHANNELS", tmp, FALSE); g_free (tmp); -- cgit v1.2.1 From 89572383a381280beed8b0af5e9c2cbced4b03d4 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 17 Jun 2010 22:35:03 -0700 Subject: wifi: fix updating of IBSS BSSIDs First by is OR-ed with 0x02, it won't always equal 0x02. --- src/nm-device-wifi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 1fa2937253..134e4f4449 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -966,8 +966,10 @@ periodic_update (NMDeviceWifi *self) struct ether_addr bssid = { {0x0, 0x0, 0x0, 0x0, 0x0, 0x0} }; nm_device_wifi_get_bssid (self, &bssid); - /* 0x02 is the first byte of IBSS BSSIDs */ - if ( (bssid.ether_addr_octet[0] == 0x02) + /* 0x02 means "locally administered" and should be OR-ed into + * the first byte of IBSS BSSIDs. + */ + if ( (bssid.ether_addr_octet[0] & 0x02) && nm_ethernet_address_is_valid (&bssid)) nm_ap_set_address (priv->current_ap, &bssid); } -- cgit v1.2.1 From 171dcf51b527ab52f6c97277a5f94900dcb749f5 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 17 Jun 2010 23:01:40 -0700 Subject: policy: pass default IPv4 and IPv6 addresses to hostname functions In preparation for updating /etc/hosts to assign the current hostname to the current IP address to allow programs that (somewhat incorrectly) do DNS lookups on the machine's current hostname to find out its IP address. --- src/nm-policy-hostname.c | 7 +++-- src/nm-policy-hostname.h | 5 +++- src/nm-policy-hosts.c | 4 +++ src/nm-policy-hosts.h | 2 ++ src/nm-policy.c | 75 +++++++++++++++++++++++++++++++++++++++--------- 5 files changed, 77 insertions(+), 16 deletions(-) diff --git a/src/nm-policy-hostname.c b/src/nm-policy-hostname.c index 5fe8a1cee3..5a5ed07504 100644 --- a/src/nm-policy-hostname.c +++ b/src/nm-policy-hostname.c @@ -208,7 +208,10 @@ hostname_thread_is_dead (HostnameThread *ht) #define FALLBACK_HOSTNAME "localhost.localdomain" gboolean -nm_policy_set_system_hostname (const char *new_hostname, const char *msg) +nm_policy_set_system_hostname (const char *new_hostname, + const char *ip4_addr, + const char *ip6_addr, + const char *msg) { char old_hostname[HOST_NAME_MAX + 1]; int ret = 0; @@ -250,7 +253,7 @@ nm_policy_set_system_hostname (const char *new_hostname, const char *msg) * nm_policy_hosts_update_etc_hosts() will just return and won't touch * /etc/hosts at all. */ - if (!nm_policy_hosts_update_etc_hosts (name, FALLBACK_HOSTNAME, &changed)) { + if (!nm_policy_hosts_update_etc_hosts (name, FALLBACK_HOSTNAME, ip4_addr, ip6_addr, &changed)) { /* error updating /etc/hosts; fallback to localhost.localdomain */ nm_log_info (LOGD_DNS, "Setting system hostname to '" FALLBACK_HOSTNAME "' (error updating /etc/hosts)"); ret = sethostname (FALLBACK_HOSTNAME, strlen (FALLBACK_HOSTNAME)); diff --git a/src/nm-policy-hostname.h b/src/nm-policy-hostname.h index e76713f16d..9c76884726 100644 --- a/src/nm-policy-hostname.h +++ b/src/nm-policy-hostname.h @@ -24,7 +24,10 @@ #include -gboolean nm_policy_set_system_hostname (const char *new_hostname, const char *msg); +gboolean nm_policy_set_system_hostname (const char *new_hostname, + const char *ip4_addr, + const char *ip6_addr, + const char *msg); typedef struct HostnameThread HostnameThread; diff --git a/src/nm-policy-hosts.c b/src/nm-policy-hosts.c index 7723c99759..4fe17f6fbd 100644 --- a/src/nm-policy-hosts.c +++ b/src/nm-policy-hosts.c @@ -175,6 +175,8 @@ nm_policy_get_etc_hosts (const char **lines, gboolean nm_policy_hosts_update_etc_hosts (const char *hostname, const char *fallback_hostname, + const char *ip4_addr, + const char *ip6_addr, gboolean *out_changed) { char *contents = NULL; @@ -187,6 +189,8 @@ nm_policy_hosts_update_etc_hosts (const char *hostname, g_return_val_if_fail (hostname != NULL, FALSE); g_return_val_if_fail (out_changed != NULL, FALSE); +g_message ("%s: ip4 '%s', ip6 '%s'", __func__, ip4_addr, ip6_addr); + if (!g_file_get_contents (SYSCONFDIR "/hosts", &contents, &contents_len, &error)) { nm_log_warn (LOGD_DNS, "couldn't read " SYSCONFDIR "/hosts: (%d) %s", error ? error->code : 0, diff --git a/src/nm-policy-hosts.h b/src/nm-policy-hosts.h index 0a77e6678a..00b586ee5a 100644 --- a/src/nm-policy-hosts.h +++ b/src/nm-policy-hosts.h @@ -25,6 +25,8 @@ gboolean nm_policy_hosts_update_etc_hosts (const char *hostname, const char *fallback_hostname, + const char *ip4_addr, + const char *ip6_addr, gboolean *out_changed); /* Only for testcases; don't use outside of nm-policy-hosts.c */ diff --git a/src/nm-policy.c b/src/nm-policy.c index 1fb9848b75..352be12dc1 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -61,6 +61,7 @@ struct NMPolicy { HostnameThread *lookup; char *orig_hostname; /* hostname at NM start time */ + char *cur_hostname; /* hostname we want to assign */ }; #define INVALID_TAG "invalid" @@ -225,9 +226,56 @@ get_best_ip6_device (NMManager *manager, NMActRequest **out_req) } static void -_set_hostname (const char *new_hostname, const char *msg) +_set_hostname (NMPolicy *policy, + gboolean change_hostname, + const char *new_hostname, + const char *msg) { - if (nm_policy_set_system_hostname (new_hostname, msg)) + char ip4_addr[INET_ADDRSTRLEN + 1]; + char ip6_addr[INET6_ADDRSTRLEN + 1]; + + if (change_hostname) { + g_free (policy->cur_hostname); + policy->cur_hostname = g_strdup (new_hostname); + } + + /* Get the default IPv4 and IPv6 addresses so we can assign + * the hostname to them in /etc/hosts. + */ + memset (ip4_addr, 0, sizeof (ip4_addr)); + if (policy->default_device4) { + NMIP4Config *config = NULL; + NMIP4Address *addr = NULL; + + config = nm_device_get_ip4_config (policy->default_device4); + if (config) + addr = nm_ip4_config_get_address (config, 0); + + if (addr) { + struct in_addr tmp; + + tmp.s_addr = nm_ip4_address_get_address (addr); + inet_ntop (AF_INET, &tmp, ip4_addr, sizeof (ip4_addr)); + } + } + + memset (ip6_addr, 0, sizeof (ip6_addr)); + if (policy->default_device6) { + NMIP6Config *config = NULL; + NMIP6Address *addr = NULL; + + config = nm_device_get_ip6_config (policy->default_device6); + if (config) + addr = nm_ip6_config_get_address (config, 0); + + if (addr) + inet_ntop (AF_INET6, nm_ip6_address_get_address (addr), ip6_addr, sizeof (ip6_addr)); + } + + if (nm_policy_set_system_hostname (policy->cur_hostname, + strlen (ip4_addr) ? ip4_addr : NULL, + strlen (ip6_addr) ? ip6_addr : NULL, + msg)) nm_utils_call_dispatcher ("hostname", NULL, NULL, NULL); } @@ -244,12 +292,12 @@ lookup_callback (HostnameThread *thread, if (!hostname_thread_is_dead (thread) && (thread == policy->lookup)) { policy->lookup = NULL; if (!hostname) { - /* No valid IP4 config (!!); fall back to localhost.localdomain */ + /* Fall back to localhost.localdomain */ msg = g_strdup_printf ("address lookup failed: %d", result); - _set_hostname (NULL, msg); + _set_hostname (policy, TRUE, NULL, msg); g_free (msg); } else - _set_hostname (hostname, "from address lookup"); + _set_hostname (policy, TRUE, hostname, "from address lookup"); } hostname_thread_free (thread); } @@ -281,7 +329,7 @@ update_system_hostname (NMPolicy *policy, NMDevice *best4, NMDevice *best6) /* Try a persistent hostname first */ g_object_get (G_OBJECT (policy->manager), NM_MANAGER_HOSTNAME, &configured_hostname, NULL); if (configured_hostname) { - _set_hostname (configured_hostname, "from system configuration"); + _set_hostname (policy, TRUE, configured_hostname, "from system configuration"); g_free (configured_hostname); return; } @@ -296,7 +344,7 @@ update_system_hostname (NMPolicy *policy, NMDevice *best4, NMDevice *best6) /* No best device; fall back to original hostname or if there wasn't * one, 'localhost.localdomain' */ - _set_hostname (policy->orig_hostname, "no default device"); + _set_hostname (policy, TRUE, policy->orig_hostname, "no default device"); return; } @@ -311,7 +359,7 @@ update_system_hostname (NMPolicy *policy, NMDevice *best4, NMDevice *best6) /* Sanity check; strip leading spaces */ while (*p) { if (!isblank (*p++)) { - _set_hostname (dhcp_hostname, "from DHCPv4"); + _set_hostname (policy, TRUE, dhcp_hostname, "from DHCPv4"); return; } } @@ -330,7 +378,7 @@ update_system_hostname (NMPolicy *policy, NMDevice *best4, NMDevice *best6) /* Sanity check; strip leading spaces */ while (*p) { if (!isblank (*p++)) { - _set_hostname (dhcp_hostname, "from DHCPv6"); + _set_hostname (policy, TRUE, dhcp_hostname, "from DHCPv6"); return; } } @@ -344,7 +392,7 @@ update_system_hostname (NMPolicy *policy, NMDevice *best4, NMDevice *best6) * when NM started up. */ if (policy->orig_hostname) { - _set_hostname (policy->orig_hostname, "from system startup"); + _set_hostname (policy, TRUE, policy->orig_hostname, "from system startup"); return; } @@ -360,7 +408,7 @@ update_system_hostname (NMPolicy *policy, NMDevice *best4, NMDevice *best6) || (nm_ip4_config_get_num_nameservers (ip4_config) == 0) || (nm_ip4_config_get_num_addresses (ip4_config) == 0)) { /* No valid IP4 config (!!); fall back to localhost.localdomain */ - _set_hostname (NULL, "no IPv4 config"); + _set_hostname (policy, TRUE, NULL, "no IPv4 config"); return; } @@ -378,7 +426,7 @@ update_system_hostname (NMPolicy *policy, NMDevice *best4, NMDevice *best6) || (nm_ip6_config_get_num_nameservers (ip6_config) == 0) || (nm_ip6_config_get_num_addresses (ip6_config) == 0)) { /* No valid IP6 config (!!); fall back to localhost.localdomain */ - _set_hostname (NULL, "no IPv6 config"); + _set_hostname (policy, TRUE, NULL, "no IPv6 config"); return; } @@ -391,7 +439,7 @@ update_system_hostname (NMPolicy *policy, NMDevice *best4, NMDevice *best6) if (!policy->lookup) { /* Fall back to 'localhost.localdomain' */ - _set_hostname (NULL, "error starting hostname thread"); + _set_hostname (policy, TRUE, NULL, "error starting hostname thread"); } } @@ -1186,6 +1234,7 @@ nm_policy_destroy (NMPolicy *policy) g_slist_free (policy->dev_signal_ids); g_free (policy->orig_hostname); + g_free (policy->cur_hostname); g_object_unref (policy->manager); g_free (policy); -- cgit v1.2.1 From debb16cfc035802b14bcf4b9a490a47c8c08ef08 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 21 Jun 2010 21:18:25 -0700 Subject: policy: map hostname to current IP address (bgo #619931) Instead of always mapping the current hostname to 127.0.0.1 or whatever the user mapped it to manually, make sure the hostname maps to the default device's IPv4 and IPv6 address if there's a default device. This helps out services that do a lookup on the machine hostname to determine the IP address, which while a broken behavior (since there are too many edge-cases) is pretty wide-spread and thus we should support it. --- src/nm-policy-hostname.c | 20 ++- src/nm-policy-hosts.c | 220 +++++++++++++++++++++++--------- src/nm-policy-hosts.h | 8 +- src/tests/test-policy-hosts.c | 288 ++++++++++++++++++++++++++++++++++++------ 4 files changed, 431 insertions(+), 105 deletions(-) diff --git a/src/nm-policy-hostname.c b/src/nm-policy-hostname.c index 5a5ed07504..0a49f9e2ea 100644 --- a/src/nm-policy-hostname.c +++ b/src/nm-policy-hostname.c @@ -205,7 +205,8 @@ hostname_thread_is_dead (HostnameThread *ht) /************************************************************************/ -#define FALLBACK_HOSTNAME "localhost.localdomain" +#define FALLBACK_HOSTNAME4 "localhost.localdomain" +#define FALLBACK_HOSTNAME6 "localhost6.localdomain6" gboolean nm_policy_set_system_hostname (const char *new_hostname, @@ -221,7 +222,7 @@ nm_policy_set_system_hostname (const char *new_hostname, if (new_hostname) g_warn_if_fail (strlen (new_hostname)); - name = (new_hostname && strlen (new_hostname)) ? new_hostname : FALLBACK_HOSTNAME; + name = (new_hostname && strlen (new_hostname)) ? new_hostname : FALLBACK_HOSTNAME4; old_hostname[HOST_NAME_MAX] = '\0'; errno = 0; @@ -232,7 +233,7 @@ nm_policy_set_system_hostname (const char *new_hostname, } else { /* Don't set the hostname if it isn't actually changing */ if ( (new_hostname && !strcmp (old_hostname, new_hostname)) - || (!new_hostname && !strcmp (old_hostname, FALLBACK_HOSTNAME))) + || (!new_hostname && !strcmp (old_hostname, FALLBACK_HOSTNAME4))) set_hostname = FALSE; } @@ -253,13 +254,18 @@ nm_policy_set_system_hostname (const char *new_hostname, * nm_policy_hosts_update_etc_hosts() will just return and won't touch * /etc/hosts at all. */ - if (!nm_policy_hosts_update_etc_hosts (name, FALLBACK_HOSTNAME, ip4_addr, ip6_addr, &changed)) { + if (!nm_policy_hosts_update_etc_hosts (name, + FALLBACK_HOSTNAME4, + FALLBACK_HOSTNAME6, + ip4_addr, + ip6_addr, + &changed)) { /* error updating /etc/hosts; fallback to localhost.localdomain */ - nm_log_info (LOGD_DNS, "Setting system hostname to '" FALLBACK_HOSTNAME "' (error updating /etc/hosts)"); - ret = sethostname (FALLBACK_HOSTNAME, strlen (FALLBACK_HOSTNAME)); + nm_log_info (LOGD_DNS, "Setting system hostname to '" FALLBACK_HOSTNAME4 "' (error updating /etc/hosts)"); + ret = sethostname (FALLBACK_HOSTNAME4, strlen (FALLBACK_HOSTNAME4)); if (ret != 0) { nm_log_warn (LOGD_DNS, "couldn't set the fallback system hostname (%s): (%d) %s", - FALLBACK_HOSTNAME, errno, strerror (errno)); + FALLBACK_HOSTNAME4, errno, strerror (errno)); } } diff --git a/src/nm-policy-hosts.c b/src/nm-policy-hosts.c index 4fe17f6fbd..8e6d151963 100644 --- a/src/nm-policy-hosts.c +++ b/src/nm-policy-hosts.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "nm-policy-hosts.h" #include "nm-logging.h" @@ -53,59 +54,133 @@ nm_policy_hosts_find_token (const char *line, const char *token) } static gboolean -is_local_mapping (const char *str, const char *hostname) +is_local_mapping (const char *str, gboolean ip6, const char *hostname) { - return ( !strncmp (str, "127.0.0.1", strlen ("127.0.0.1")) - && nm_policy_hosts_find_token (str, hostname ? hostname : "localhost")); + const char *addr = ip6 ? "::1" : "127.0.0.1"; + const char *fallback = ip6 ? "localhost6" : "localhost"; + + return ( !strncmp (str, addr, strlen (addr)) + && nm_policy_hosts_find_token (str, hostname ? hostname : fallback)); } +static gboolean +ip4_addr_matches (const char *str, const char *ip4_addr) +{ + struct in_addr found, given; + char buf[INET_ADDRSTRLEN + 2]; + const char *p = str; + guint32 i = 0; + + g_return_val_if_fail (ip4_addr != NULL, FALSE); + + memset (buf, 0, sizeof (buf)); + while (*p && !isblank (*p) && (i < sizeof (buf))) + buf[i++] = *p++; + + if (inet_pton (AF_INET, buf, &found) != 1) + return FALSE; + if (inet_pton (AF_INET, ip4_addr, &given) != 1) + return FALSE; + + return memcmp (&found, &given, sizeof (found)) == 0; +} + +static gboolean +ip6_addr_matches (const char *str, const char *ip6_addr) +{ + struct in6_addr found, given; + char buf[INET6_ADDRSTRLEN + 2]; + const char *p = str; + guint32 i = 0; + + g_return_val_if_fail (ip6_addr != NULL, FALSE); + + memset (buf, 0, sizeof (buf)); + while (*p && !isblank (*p) && (i < sizeof (buf))) + buf[i++] = *p++; + + if (inet_pton (AF_INET6, buf, &found) != 1) + return FALSE; + if (inet_pton (AF_INET6, ip6_addr, &given) != 1) + return FALSE; + + return memcmp (&found, &given, sizeof (found)) == 0; +} + +#define ADDED_TAG "# Added by NetworkManager" + GString * nm_policy_get_etc_hosts (const char **lines, gsize existing_len, const char *hostname, - const char *fallback_hostname, + const char *fallback_hostname4, + const char *fallback_hostname6, + const char *ip4_addr, + const char *ip6_addr, GError **error) { GString *contents = NULL; const char **line; - gboolean found_host_nonlocal = FALSE; - gboolean found_host = FALSE; - gboolean found_localhost = FALSE; + gboolean found_localhost4 = FALSE; + gboolean found_localhost6 = FALSE; + gboolean found_host4 = FALSE; + gboolean found_host6 = FALSE; + gboolean found_user_host4 = FALSE; + gboolean found_user_host6 = FALSE; gboolean initial_comments = TRUE; gboolean added = FALSE; + gboolean hostname4_is_fallback; + gboolean hostname6_is_fallback; g_return_val_if_fail (lines != NULL, FALSE); g_return_val_if_fail (hostname != NULL, FALSE); - /* /etc/hosts needs at least two things: + hostname4_is_fallback = !strcmp (hostname, fallback_hostname4); + hostname6_is_fallback = !strcmp (hostname, fallback_hostname6); + + /* We need the following in /etc/hosts: * - * 1) current hostname mapped to any address - * 2) 'localhost' mapped to 127.0.0.1 + * 1) current hostname mapped to current IPv4 addresses if IPv4 is active + * 2) current hostname mapped to current IPv6 addresses if IPv6 is active + * 3) 'localhost' mapped to 127.0.0.1 + * 4) 'localhost6' mapped to ::1 * - * If both these conditions exist in /etc/hosts, we don't need to bother - * updating the file. + * If all these things exist we don't need to bother updating the file. */ - /* Look for the two cases from above */ + if (!ip4_addr) + found_host4 = TRUE; + if (!ip6_addr) + found_host6 = TRUE; + + /* Look for the four cases from above */ for (line = lines; lines && *line; line++) { - if (strlen (*line) && (*line[0] != '#')) { - if (nm_policy_hosts_find_token (*line, hostname)) { - if (!is_local_mapping (*line, "localhost")) { - /* hostname is not on a 127.0.0.1 line or the line does not - * contain 'localhost'. - */ - found_host_nonlocal = TRUE; - } - found_host = TRUE; + if (!strlen (*line) || (*line[0] == '#')) + continue; + + if (nm_policy_hosts_find_token (*line, hostname)) { + /* Found the current hostname on this line */ + if (ip4_addr && ip4_addr_matches (*line, ip4_addr)) { + found_host4 = TRUE; + if (!strstr (*line, ADDED_TAG)) + found_user_host4 = TRUE; } - - if (is_local_mapping (*line, "localhost")) { - /* a 127.0.0.1 line containing 'localhost' */ - found_localhost = TRUE; + if (ip6_addr && ip6_addr_matches (*line, ip6_addr)) { + found_host6 = TRUE; + if (!strstr (*line, ADDED_TAG)) + found_user_host6 = TRUE; } } - if (found_localhost && found_host) + if (is_local_mapping (*line, FALSE, "localhost")) { + /* a 127.0.0.1 line containing 'localhost' */ + found_localhost4 = TRUE; + } else if (is_local_mapping (*line, TRUE, "localhost6")) { + /* a ::1 line containing 'localhost6' */ + found_localhost6 = TRUE; + } + + if (found_localhost4 && found_host4 && found_localhost6 && found_host6) return NULL; /* No update required */ } @@ -115,11 +190,13 @@ nm_policy_get_etc_hosts (const char **lines, return NULL; } - /* Construct the new hosts file; replace any 127.0.0.1 entry that is at the - * beginning of the file or right after initial comments and contains - * the string 'localhost'. If there is no 127.0.0.1 entry at the beginning - * or after initial comments that contains 'localhost', add one there - * and ignore any other 127.0.0.1 entries that contain 'localhost'. + /* Construct the new hosts file; replace any 127.0.0.1/::1 entry that is + * at the beginning of the file or right after initial comments and contains + * the string 'localhost' (for IPv4) or 'localhost6' (for IPv6). If there + * is no 127.0.0.1 or ::1 entry at the beginning or after initial comments + * that contains 'localhost' or 'localhost6', add one there + * and ignore any other 127.0.0.1/::1 entries that contain 'localhost' or + * 'localhost6'. */ for (line = lines, initial_comments = TRUE; lines && *line; line++) { gboolean add_line = TRUE; @@ -128,33 +205,49 @@ nm_policy_get_etc_hosts (const char **lines, if (strlen (*line) && initial_comments && (*line[0] != '#')) { initial_comments = FALSE; - /* If some other line contained the hostname but not 'localhost', - * make a simple localhost mapping and assume the user knows what - * they are doing with their manual hostname entry. Otherwise if - * the hostname wasn't found somewhere else, add it to the localhost + /* If the user added their own mapping for the hostname, just make + * a simple 'localhost' mapping and assume the user knows what they + * are doing with their manual hostname entry. Otherwise if the + * hostname wasn't found somewhere else, add it to the localhost * mapping line to make sure it's mapped to something. */ - if (found_host_nonlocal) - g_string_append (contents, "127.0.0.1"); - else - g_string_append_printf (contents, "127.0.0.1\t%s", hostname); - - if (strcmp (hostname, fallback_hostname)) { - g_string_append_printf (contents, "\t%s", fallback_hostname); - /* Don't add a standalone 'localhost.localdomain' 127 mapping */ - if (is_local_mapping (*line, fallback_hostname)) - add_line = FALSE; - } - g_string_append (contents, "\tlocalhost\n"); - added = TRUE; + /* IPv4 localhost line */ + g_string_append (contents, "127.0.0.1"); + if (!hostname4_is_fallback && !ip4_addr && !found_user_host4) + g_string_append_printf (contents, "\t%s", hostname); + g_string_append_printf (contents, "\t%s\tlocalhost\n", fallback_hostname4); - /* Don't add the original line if it is a 'localhost' mapping */ - if (is_local_mapping (*line, "localhost")) - add_line = FALSE; + /* IPv6 localhost line */ + g_string_append (contents, "::1"); + if (!hostname6_is_fallback && !hostname4_is_fallback && !ip6_addr && !found_user_host6) + g_string_append_printf (contents, "\t%s", hostname); + g_string_append_printf (contents, "\t%s\tlocalhost6\n", fallback_hostname6); + + /* Add the address mappings */ + if (!hostname4_is_fallback && ip4_addr && !found_user_host4) + g_string_append_printf (contents, "%s\t%s\t%s\n", ip4_addr, hostname, ADDED_TAG); + if (!hostname6_is_fallback && ip6_addr && !found_user_host6) + g_string_append_printf (contents, "%s\t%s\t%s\n", ip6_addr, hostname, ADDED_TAG); + + added = TRUE; } - if (add_line) { + /* 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)) + 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)) + add_line = FALSE; + + if (add_line && !strstr (*line, ADDED_TAG)) { g_string_append (contents, *line); /* Only append the new line if this isn't the last line in the file */ if (*(line+1)) @@ -164,9 +257,16 @@ nm_policy_get_etc_hosts (const char **lines, /* Hmm, /etc/hosts was empty for some reason */ if (!added) { - g_string_append (contents, "# Do not remove the following line, or various programs\n"); + g_string_append (contents, "# Do not remove the following lines, or various programs\n"); g_string_append (contents, "# that require network functionality will fail.\n"); - g_string_append_printf (contents, "127.0.0.1\t%s\tlocalhost\n", fallback_hostname); + g_string_append_printf (contents, "127.0.0.1\t%s\tlocalhost\n", fallback_hostname4); + g_string_append_printf (contents, "::1\t%s\tlocalhost6\n", fallback_hostname6); + + /* Add the address mappings */ + if (!hostname4_is_fallback && ip4_addr) + g_string_append_printf (contents, "%s\t%s\t%s\n", ip4_addr, hostname, ADDED_TAG); + if (!hostname6_is_fallback && ip6_addr) + g_string_append_printf (contents, "%s\t%s\t%s\n", ip6_addr, hostname, ADDED_TAG); } return contents; @@ -174,7 +274,8 @@ nm_policy_get_etc_hosts (const char **lines, gboolean nm_policy_hosts_update_etc_hosts (const char *hostname, - const char *fallback_hostname, + const char *fallback_hostname4, + const char *fallback_hostname6, const char *ip4_addr, const char *ip6_addr, gboolean *out_changed) @@ -189,8 +290,6 @@ nm_policy_hosts_update_etc_hosts (const char *hostname, g_return_val_if_fail (hostname != NULL, FALSE); g_return_val_if_fail (out_changed != NULL, FALSE); -g_message ("%s: ip4 '%s', ip6 '%s'", __func__, ip4_addr, ip6_addr); - if (!g_file_get_contents (SYSCONFDIR "/hosts", &contents, &contents_len, &error)) { nm_log_warn (LOGD_DNS, "couldn't read " SYSCONFDIR "/hosts: (%d) %s", error ? error->code : 0, @@ -204,7 +303,10 @@ g_message ("%s: ip4 '%s', ip6 '%s'", __func__, ip4_addr, ip6_addr); new_contents = nm_policy_get_etc_hosts ((const char **) lines, contents_len, hostname, - fallback_hostname, + fallback_hostname4, + fallback_hostname6, + ip4_addr, + ip6_addr, &error); g_strfreev (lines); g_free (contents); diff --git a/src/nm-policy-hosts.h b/src/nm-policy-hosts.h index 00b586ee5a..76288bf56b 100644 --- a/src/nm-policy-hosts.h +++ b/src/nm-policy-hosts.h @@ -24,7 +24,8 @@ #include gboolean nm_policy_hosts_update_etc_hosts (const char *hostname, - const char *fallback_hostname, + const char *fallback_hostname4, + const char *fallback_hostname6, const char *ip4_addr, const char *ip6_addr, gboolean *out_changed); @@ -35,7 +36,10 @@ gboolean nm_policy_hosts_find_token (const char *line, const char *token); GString *nm_policy_get_etc_hosts (const char **lines, gsize existing_len, const char *hostname, - const char *fallback_hostname, + const char *fallback_hostname4, + const char *fallback_hostname6, + const char *ip4_addr, + const char *ip6_addr, GError **error); #endif /* NM_POLICY_HOSTS_H */ diff --git a/src/tests/test-policy-hosts.c b/src/tests/test-policy-hosts.c index e14f15e5f2..69a061e8e7 100644 --- a/src/tests/test-policy-hosts.c +++ b/src/tests/test-policy-hosts.c @@ -23,12 +23,15 @@ #include "nm-policy-hosts.h" -#define FALLBACK_HOSTNAME "localhost.localdomain" +#define FALLBACK_HOSTNAME4 "localhost.localdomain" +#define FALLBACK_HOSTNAME6 "localhost6.localdomain6" static void test_generic (const char *before, const char *after, const char *hostname, + const char *ip4_addr, + const char *ip6_addr, gboolean expect_error) { char **lines; @@ -40,7 +43,10 @@ test_generic (const char *before, newc = nm_policy_get_etc_hosts ((const char **) lines, strlen (before), hostname, - FALLBACK_HOSTNAME, + FALLBACK_HOSTNAME4, + FALLBACK_HOSTNAME6, + ip4_addr, + ip6_addr, &error); g_strfreev (lines); @@ -50,6 +56,14 @@ test_generic (const char *before, g_clear_error (&error); } else if (after == NULL) { /* No change to /etc/hosts required */ +#if 0 + if (newc != NULL) { + g_message ("\n- NEW ---------------------------------\n" + "%s" + "- EXPECTED NONE -------------------------\n", + newc->str); + } +#endif g_assert (newc == NULL); g_assert (error == NULL); } else { @@ -57,10 +71,12 @@ test_generic (const char *before, g_assert (error == NULL); #if 0 - g_message ("\n--------------------------------------\n" + g_message ("\n- NEW ---------------------------------\n" "%s" - "--------------------------------------", - newc->str); + "- EXPECTED ------------------------------\n" + "%s" + "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + newc->str, after); #endif g_assert (strlen (newc->str) == strlen (after)); g_assert (strcmp (newc->str, after) == 0); @@ -80,7 +96,7 @@ static const char *generic_before = \ static void test_hosts_generic (void) { - test_generic (generic_before, NULL, "localhost.localdomain", FALSE); + test_generic (generic_before, NULL, "localhost.localdomain", NULL, NULL, FALSE); } /*******************************************/ @@ -93,20 +109,19 @@ static const char *generic_no_boilerplate_before = \ static void test_hosts_generic_no_boilerplate (void) { - test_generic (generic_no_boilerplate_before, NULL, "localhost.localdomain", FALSE); + test_generic (generic_no_boilerplate_before, NULL, "localhost.localdomain", NULL, NULL, FALSE); } /*******************************************/ static const char *generic_no_boilerplate_no_lh_before = \ "127.0.0.1 localhost.localdomain\n" - "::1 localhost6.localdomain6 localhost6\n" + "::1 localhost6.localdomain6 localhost6\n" "127.0.0.1 lcmd.us.intellitxt.com\n"; static const char *generic_no_boilerplate_no_lh_after = \ - "127.0.0.1 localhost\n" - "127.0.0.1 localhost.localdomain\n" - "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" "127.0.0.1 lcmd.us.intellitxt.com\n"; static void @@ -115,6 +130,8 @@ test_hosts_generic_no_boilerplate_no_lh (void) test_generic (generic_no_boilerplate_no_lh_before, generic_no_boilerplate_no_lh_after, "localhost.localdomain", + NULL, + NULL, FALSE); } @@ -128,7 +145,7 @@ static const char *generic_no_boilerplate_no_lh_no_host_before = \ static const char *generic_no_boilerplate_no_lh_no_host_after = \ "127.0.0.1 comet localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n" + "::1 comet localhost6.localdomain6 localhost6\n" "127.0.0.1 lcmd.us.intellitxt.com\n"; static void @@ -137,6 +154,8 @@ test_hosts_generic_no_boilerplate_no_lh_no_host (void) test_generic (generic_no_boilerplate_no_lh_no_host_before, generic_no_boilerplate_no_lh_no_host_after, "comet", + NULL, + NULL, FALSE); } @@ -151,32 +170,48 @@ static const char *named_generic_before = \ static void test_hosts_named_generic (void) { - test_generic (named_generic_before, NULL, "playboy", FALSE); + test_generic (named_generic_before, NULL, "playboy", NULL, NULL, FALSE); } /*******************************************/ -static const char *named_non127_before = \ +static const char *named4_non127_before = \ "# Do not remove the following line, or various programs\n" "# that require network functionality will fail.\n" "127.0.0.1 localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n" + "::1 tomcat localhost6.localdomain6 localhost6\n" "127.0.0.1 lcmd.us.intellitxt.com\n" "192.168.1.2 tomcat\n"; static void -test_hosts_named_non127 (void) +test_hosts_named4_non127 (void) +{ + test_generic (named4_non127_before, NULL, "tomcat", "192.168.1.2", NULL, FALSE); +} + +/*******************************************/ + +static const char *named6_non127_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 tomcat localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n" + "3001:abba::3234 tomcat\n"; + +static void +test_hosts_named6_non127 (void) { - test_generic (named_non127_before, NULL, "tomcat", FALSE); + test_generic (named6_non127_before, NULL, "tomcat", NULL, "3001:abba::3234", FALSE); } /*******************************************/ -static const char *named2_non127_before = \ +static const char *named4_non127_more_before = \ "# Do not remove the following line, or various programs\n" "# that require network functionality will fail.\n" "127.0.0.1 localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n" + "::1 tomcat localhost6.localdomain6 localhost6\n" "127.0.0.1 lcmd.us.intellitxt.com\n" "192.168.1.2 tomcat\n" "127.0.0.1 lcmd.us.intellitxt.com\n" @@ -184,9 +219,28 @@ static const char *named2_non127_before = \ "127.0.0.1 cdn5.tribalfusion.com\n"; static void -test_hosts_named2_non127 (void) +test_hosts_named4_non127_more (void) +{ + test_generic (named4_non127_more_before, NULL, "tomcat", "192.168.1.2", NULL, FALSE); +} + +/*******************************************/ + +static const char *named6_non127_more_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 tomcat localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n" + "3001:abba::3234 tomcat\n" + "127.0.0.1 lcmd.us.intellitxt.com\n" + "127.0.0.1 srx.main.ebayrtm.com\n" + "127.0.0.1 cdn5.tribalfusion.com\n"; + +static void +test_hosts_named6_non127_more (void) { - test_generic (named2_non127_before, NULL, "tomcat", FALSE); + test_generic (named6_non127_more_before, NULL, "tomcat", NULL, "3001:abba::3234", FALSE); } /*******************************************/ @@ -203,14 +257,14 @@ static const char *named_no_lh_after = \ "# Do not remove the following line, or various programs\n" "# that require network functionality will fail.\n" "127.0.0.1 localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n" + "::1 tomcat localhost6.localdomain6 localhost6\n" "127.0.0.1 lcmd.us.intellitxt.com\n" "192.168.1.2 tomcat\n"; static void test_hosts_named_no_localhost (void) { - test_generic (named_no_lh_before, named_no_lh_after, "tomcat", FALSE); + test_generic (named_no_lh_before, named_no_lh_after, "tomcat", "192.168.1.2", NULL, FALSE); } /*******************************************/ @@ -225,15 +279,14 @@ static const char *no_lh_before = \ static const char *no_lh_after = \ "# Do not remove the following line, or various programs\n" "# that require network functionality will fail.\n" - "127.0.0.1 localhost.localdomain localhost\n" - "127.0.0.1 tomcat\n" - "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 tomcat localhost.localdomain localhost\n" + "::1 tomcat localhost6.localdomain6 localhost6\n" "127.0.0.1 lcmd.us.intellitxt.com\n"; static void test_hosts_no_localhost (void) { - test_generic (no_lh_before, no_lh_after, "tomcat", FALSE); + test_generic (no_lh_before, no_lh_after, "tomcat", NULL, NULL, FALSE); } /*******************************************/ @@ -247,12 +300,12 @@ static const char *named_last_before = \ static void test_hosts_named_last (void) { - test_generic (named_last_before, NULL, "sparcbook.ausil.us", FALSE); + test_generic (named_last_before, NULL, "sparcbook.ausil.us", NULL, NULL, FALSE); } /*******************************************/ -static const char *no_host_before = \ +static const char *no_host4_before = \ "# Do not remove the following line, or various programs\n" "# that require network functionality will fail.\n" "::1 localhost6.localdomain6 localhost6\n" @@ -262,11 +315,11 @@ static const char *no_host_before = \ "127.0.0.1 cdn5.tribalfusion.com\n" "127.0.0.1 a.tribalfusion.com\n"; -static const char *no_host_after = \ +static const char *no_host4_after = \ "# Do not remove the following line, or various programs\n" "# that require network functionality will fail.\n" "127.0.0.1 comet localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n" + "::1 comet localhost6.localdomain6 localhost6\n" "\n" "127.0.0.1 lcmd.us.intellitxt.com\n" "127.0.0.1 srx.main.ebayrtm.com\n" @@ -274,9 +327,162 @@ static const char *no_host_after = \ "127.0.0.1 a.tribalfusion.com\n"; static void -test_hosts_no_host (void) +test_hosts_no_host4 (void) +{ + test_generic (no_host4_before, no_host4_after, "comet", NULL, NULL, FALSE); +} + +/*******************************************/ + +static const char *no_host6_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static const char *no_host6_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 comet localhost.localdomain localhost\n" + "::1 comet localhost6.localdomain6 localhost6\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_no_host6 (void) +{ + test_generic (no_host6_before, no_host6_after, "comet", NULL, NULL, FALSE); +} + +/*******************************************/ + +static const char *named46_non127_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "192.168.1.2 comet\n" + "3001:abba::3234 comet\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_named46_non127 (void) +{ + test_generic (named46_non127_before, NULL, "comet", "192.168.1.2", "3001:abba::3234", FALSE); +} + +/*******************************************/ + +static const char *named46_non127_other4_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "192.168.1.3 comet\n" + "3001:abba::3234 comet\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static const char *named46_non127_other4_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "192.168.1.2 comet # Added by NetworkManager\n" + "192.168.1.3 comet\n" + "3001:abba::3234 comet\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_named46_non127_other4 (void) +{ + test_generic (named46_non127_other4_before, named46_non127_other4_after, "comet", "192.168.1.2", "3001:abba::3234", FALSE); +} + +/*******************************************/ + +static const char *named46_non127_other6_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "192.168.1.2 comet\n" + "3001:abba::9675 comet\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static const char *named46_non127_other6_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "3001:abba::3234 comet # Added by NetworkManager\n" + "192.168.1.2 comet\n" + "3001:abba::9675 comet\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_named46_non127_other6 (void) +{ + test_generic (named46_non127_other6_before, named46_non127_other6_after, "comet", "192.168.1.2", "3001:abba::3234", FALSE); +} + +/*******************************************/ + +static const char *unnamed46_non127_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static const char *unnamed46_non127_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "192.168.1.2 comet # Added by NetworkManager\n" + "3001:abba::3234 comet # Added by NetworkManager\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_unnamed46_non127 (void) +{ + test_generic (unnamed46_non127_before, unnamed46_non127_after, "comet", "192.168.1.2", "3001:abba::3234", FALSE); +} + +/*******************************************/ + +static const char *named46_non127_wrong_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "192.168.1.3 comet # Added by NetworkManager\n" + "3001:abba::9876 comet # Added by NetworkManager\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static const char *named46_non127_wrong_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "192.168.1.2 comet # Added by NetworkManager\n" + "3001:abba::3234 comet # Added by NetworkManager\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_named46_non127_wrong (void) { - test_generic (no_host_before, no_host_after, "comet", FALSE); + test_generic (named46_non127_wrong_before, named46_non127_wrong_after, "comet", "192.168.1.2", "3001:abba::3234", FALSE); } /*******************************************/ @@ -318,7 +524,7 @@ static const char *long_before = \ static void test_hosts_long (void) { - test_generic (long_before, NULL, "comet", FALSE); + test_generic (long_before, NULL, "comet", NULL, NULL, FALSE); } /*******************************************/ @@ -381,12 +587,20 @@ int main (int argc, char **argv) g_test_suite_add (suite, TESTCASE (test_hosts_generic_no_boilerplate_no_lh, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_generic_no_boilerplate_no_lh_no_host, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_named_generic, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_named_non127, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_named2_non127, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named4_non127, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named6_non127, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named4_non127_more, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named6_non127_more, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127_other4, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127_other6, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127_wrong, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_unnamed46_non127, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_named_no_localhost, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_no_localhost, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_named_last, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_no_host, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_no_host4, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_no_host6, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_long, NULL)); return g_test_run (); -- cgit v1.2.1 From a8e0c2637b3a439908d8996300abc9aba7c8d297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Tue, 22 Jun 2010 12:51:02 +0200 Subject: ifcfg-rh: test case for WEP ASCII keys --- .../ifcfg-rh/tests/network-scripts/Makefile.am | 6 +- .../network-scripts/ifcfg-test-wifi-wep-104-ascii | 14 + .../network-scripts/ifcfg-test-wifi-wep-40-ascii | 14 + .../network-scripts/keys-test-wifi-wep-104-ascii | 1 + .../network-scripts/keys-test-wifi-wep-40-ascii | 1 + .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 572 +++++++++++++++++++++ 6 files changed, 607 insertions(+), 1 deletion(-) create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-104-ascii create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-40-ascii create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-104-ascii create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-40-ascii diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am b/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am index 66435acbcb..6005901920 100644 --- a/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am @@ -60,7 +60,11 @@ EXTRA_DIST = \ ifcfg-test-wired-static-no-prefix-24 \ ifcfg-test-wired-ipv6-only \ ifcfg-test-wifi-wep-passphrase \ - keys-test-wifi-wep-passphrase + keys-test-wifi-wep-passphrase \ + ifcfg-test-wifi-wep-40-ascii \ + keys-test-wifi-wep-40-ascii \ + ifcfg-test-wifi-wep-104-ascii \ + keys-test-wifi-wep-104-ascii check-local: @for f in $(EXTRA_DIST); do \ diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-104-ascii b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-104-ascii new file mode 100644 index 0000000000..250efa134c --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-104-ascii @@ -0,0 +1,14 @@ +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +NM_CONTROLLED=yes +BOOTPROTO=dhcp +ESSID=blahblah +CHANNEL=1 +MODE=Managed +RATE=auto +ONBOOT=yes +USERCTL=yes +PEERDNS=yes +IPV6INIT=no +SECURITYMODE=open diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-40-ascii b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-40-ascii new file mode 100644 index 0000000000..250efa134c --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-40-ascii @@ -0,0 +1,14 @@ +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +NM_CONTROLLED=yes +BOOTPROTO=dhcp +ESSID=blahblah +CHANNEL=1 +MODE=Managed +RATE=auto +ONBOOT=yes +USERCTL=yes +PEERDNS=yes +IPV6INIT=no +SECURITYMODE=open diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-104-ascii b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-104-ascii new file mode 100644 index 0000000000..f5d532b283 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-104-ascii @@ -0,0 +1 @@ +KEY1=s:LoremIpsumSit diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-40-ascii b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-40-ascii new file mode 100644 index 0000000000..b0d1470827 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-40-ascii @@ -0,0 +1 @@ +KEY1=s:Lorem diff --git a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index 35cea36cf5..2e61e4b2c4 100644 --- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -3680,6 +3680,272 @@ test_read_wifi_wep_passphrase (void) g_object_unref (connection); } +#define TEST_IFCFG_WIFI_WEP_40_ASCII TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-wep-40-ascii" + +static void +test_read_wifi_wep_40_ascii (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWireless *s_wireless; + NMSettingWirelessSecurity *s_wsec; + char *unmanaged = NULL; + char *keyfile = NULL; + char *routefile = NULL; + char *route6file = NULL; + gboolean ignore_error = FALSE; + GError *error = NULL; + const char *tmp; + const char *expected_wep_key0 = "Lorem"; + NMWepKeyType key_type; + + connection = connection_from_file (TEST_IFCFG_WIFI_WEP_40_ASCII, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wifi-wep-40-ascii-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_40_ASCII, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wifi-wep-40-ascii-verify", "failed to verify %s: %s", TEST_IFCFG_WIFI_WEP_40_ASCII, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wifi-wep-40-ascii-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ===== WIRELESS SETTING ===== */ + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + ASSERT (s_wireless != NULL, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_WIRELESS_SETTING_NAME); + + /* Security */ + tmp = nm_setting_wireless_get_security (s_wireless); + ASSERT (tmp != NULL, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + ASSERT (strcmp (tmp, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME) == 0, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + + /* ===== WIRELESS SECURITY SETTING ===== */ + + s_wsec = NM_SETTING_WIRELESS_SECURITY (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY)); + ASSERT (s_wsec != NULL, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + + /* Key management */ + ASSERT (strcmp (nm_setting_wireless_security_get_key_mgmt (s_wsec), "none") == 0, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); + + /* WEP key index */ + ASSERT (nm_setting_wireless_security_get_wep_tx_keyidx (s_wsec) == 0, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX); + + /* WEP key type */ + key_type = nm_setting_wireless_security_get_wep_key_type (s_wsec); + ASSERT (key_type == NM_WEP_KEY_TYPE_UNKNOWN || key_type == NM_WEP_KEY_TYPE_KEY, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: unexpected WEP key type %d", + TEST_IFCFG_WIFI_WEP_40_ASCII, + key_type); + + /* WEP key index 0 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 0); + ASSERT (tmp != NULL, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY0); + ASSERT (strcmp (tmp, expected_wep_key0) == 0, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY0); + + /* WEP key index 1 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 1); + ASSERT (tmp == NULL, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY1); + + /* WEP key index 2 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 2); + ASSERT (tmp == NULL, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY2); + + /* WEP key index 3 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 3); + ASSERT (tmp == NULL, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY3); + + g_object_unref (connection); +} + +#define TEST_IFCFG_WIFI_WEP_104_ASCII TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-wep-104-ascii" + +static void +test_read_wifi_wep_104_ascii (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWireless *s_wireless; + NMSettingWirelessSecurity *s_wsec; + char *unmanaged = NULL; + char *keyfile = NULL; + char *routefile = NULL; + char *route6file = NULL; + gboolean ignore_error = FALSE; + GError *error = NULL; + const char *tmp; + const char *expected_wep_key0 = "LoremIpsumSit"; + NMWepKeyType key_type; + + connection = connection_from_file (TEST_IFCFG_WIFI_WEP_104_ASCII, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wifi-wep-104-ascii-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_104_ASCII, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wifi-wep-104-ascii-verify", "failed to verify %s: %s", TEST_IFCFG_WIFI_WEP_104_ASCII, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wifi-wep-104-ascii-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ===== WIRELESS SETTING ===== */ + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + ASSERT (s_wireless != NULL, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_WIRELESS_SETTING_NAME); + + /* Security */ + tmp = nm_setting_wireless_get_security (s_wireless); + ASSERT (tmp != NULL, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + ASSERT (strcmp (tmp, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME) == 0, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + + /* ===== WIRELESS SECURITY SETTING ===== */ + + s_wsec = NM_SETTING_WIRELESS_SECURITY (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY)); + ASSERT (s_wsec != NULL, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + + /* Key management */ + ASSERT (strcmp (nm_setting_wireless_security_get_key_mgmt (s_wsec), "none") == 0, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); + + /* WEP key index */ + ASSERT (nm_setting_wireless_security_get_wep_tx_keyidx (s_wsec) == 0, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX); + + /* WEP key type */ + key_type = nm_setting_wireless_security_get_wep_key_type (s_wsec); + ASSERT (key_type == NM_WEP_KEY_TYPE_UNKNOWN || key_type == NM_WEP_KEY_TYPE_KEY, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: unexpected WEP key type %d", + TEST_IFCFG_WIFI_WEP_104_ASCII, + key_type); + + /* WEP key index 0 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 0); + ASSERT (tmp != NULL, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY0); + ASSERT (strcmp (tmp, expected_wep_key0) == 0, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY0); + + /* WEP key index 1 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 1); + ASSERT (tmp == NULL, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY1); + + /* WEP key index 2 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 2); + ASSERT (tmp == NULL, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY2); + + /* WEP key index 3 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 3); + ASSERT (tmp == NULL, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY3); + + g_object_unref (connection); +} + #define TEST_IFCFG_WIFI_LEAP TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-leap" static void @@ -6751,6 +7017,308 @@ test_write_wifi_wep_passphrase (void) g_object_unref (reread); } +static void +test_write_wifi_wep_40_ascii (void) +{ + NMConnection *connection; + NMConnection *reread; + NMSettingConnection *s_con; + NMSettingWireless *s_wifi; + NMSettingWirelessSecurity *s_wsec; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; + char *uuid; + gboolean success; + GError *error = NULL; + char *testfile = NULL; + char *unmanaged = NULL; + char *keyfile = NULL; + char *routefile = NULL; + char *route6file = NULL; + gboolean ignore_error = FALSE; + GByteArray *ssid; + const unsigned char ssid_data[] = "blahblah40"; + struct stat statbuf; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "wifi-wep-40-ascii-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wifi-wep-40-ascii-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write Wifi WEP 40 ASCII", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRELESS_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wifi setting */ + s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); + ASSERT (s_wifi != NULL, + "wifi-wep-40-ascii-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wifi)); + + ssid = g_byte_array_sized_new (sizeof (ssid_data)); + g_byte_array_append (ssid, ssid_data, sizeof (ssid_data)); + + g_object_set (s_wifi, + NM_SETTING_WIRELESS_SSID, ssid, + NM_SETTING_WIRELESS_MODE, "infrastructure", + NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NULL); + + g_byte_array_free (ssid, TRUE); + + /* Wireless security setting */ + s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new (); + ASSERT (s_wsec != NULL, + "wifi-wep-40-ascii-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wsec)); + + g_object_set (s_wsec, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "none", + NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX, 2, + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "shared", + NULL); + nm_setting_wireless_security_set_wep_key (s_wsec, 0, "lorem"); + nm_setting_wireless_security_set_wep_key (s_wsec, 1, "ipsum"); + nm_setting_wireless_security_set_wep_key (s_wsec, 2, "dolor"); + nm_setting_wireless_security_set_wep_key (s_wsec, 3, "donec"); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wifi-wep-40-ascii-write", "failed to allocate new %s setting", + NM_SETTING_IP4_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip4)); + + g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL); + + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-wep-40-ascii-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + + g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wifi-wep-40-ascii-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == TRUE, + "wifi-wep-40-ascii-write", "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + "wifi-wep-40-ascii-write", "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + unlink (testfile); + + ASSERT (keyfile != NULL, + "wifi-wep-40-ascii-write-reread", "expected keyfile for '%s'", testfile); + + ASSERT (stat (keyfile, &statbuf) == 0, + "wifi-wep-40-ascii-write-reread", "couldn't stat() '%s'", keyfile); + ASSERT (S_ISREG (statbuf.st_mode), + "wifi-wep-40-ascii-write-reread", "keyfile '%s' wasn't a normal file", keyfile); + ASSERT ((statbuf.st_mode & 0077) == 0, + "wifi-wep-40-ascii-write-reread", "keyfile '%s' wasn't readable only by its owner", keyfile); + + unlink (keyfile); + + ASSERT (reread != NULL, + "wifi-wep-40-ascii-write-reread", "failed to read %s: %s", testfile, error->message); + + ASSERT (nm_connection_verify (reread, &error), + "wifi-wep-40-ascii-write-reread-verify", "failed to verify %s: %s", testfile, error->message); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "wifi-wep-40-ascii-write", "written and re-read connection weren't the same."); + + g_free (testfile); + g_object_unref (connection); + g_object_unref (reread); +} + +static void +test_write_wifi_wep_104_ascii (void) +{ + NMConnection *connection; + NMConnection *reread; + NMSettingConnection *s_con; + NMSettingWireless *s_wifi; + NMSettingWirelessSecurity *s_wsec; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; + char *uuid; + gboolean success; + GError *error = NULL; + char *testfile = NULL; + char *unmanaged = NULL; + char *keyfile = NULL; + char *routefile = NULL; + char *route6file = NULL; + gboolean ignore_error = FALSE; + GByteArray *ssid; + const unsigned char ssid_data[] = "blahblah104"; + struct stat statbuf; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "wifi-wep-104-ascii-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wifi-wep-104-ascii-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write Wifi WEP 104 ASCII", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRELESS_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wifi setting */ + s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); + ASSERT (s_wifi != NULL, + "wifi-wep-104-ascii-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wifi)); + + ssid = g_byte_array_sized_new (sizeof (ssid_data)); + g_byte_array_append (ssid, ssid_data, sizeof (ssid_data)); + + g_object_set (s_wifi, + NM_SETTING_WIRELESS_SSID, ssid, + NM_SETTING_WIRELESS_MODE, "infrastructure", + NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NULL); + + g_byte_array_free (ssid, TRUE); + + /* Wireless security setting */ + s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new (); + ASSERT (s_wsec != NULL, + "wifi-wep-104-ascii-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wsec)); + + g_object_set (s_wsec, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "none", + NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX, 0, + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "open", + NULL); + nm_setting_wireless_security_set_wep_key (s_wsec, 0, "LoremIpsumSit"); + nm_setting_wireless_security_set_wep_key (s_wsec, 1, "AlfaBetaGamma"); + nm_setting_wireless_security_set_wep_key (s_wsec, 2, "WEP-104 ASCII"); + nm_setting_wireless_security_set_wep_key (s_wsec, 3, "thisismyascii"); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wifi-wep-104-ascii-write", "failed to allocate new %s setting", + NM_SETTING_IP4_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip4)); + + g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL); + + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-wep-104-ascii-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + + g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wifi-wep-104-ascii-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == TRUE, + "wifi-wep-104-ascii-write", "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + "wifi-wep-104-ascii-write", "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + unlink (testfile); + + ASSERT (keyfile != NULL, + "wifi-wep-104-ascii-write-reread", "expected keyfile for '%s'", testfile); + + ASSERT (stat (keyfile, &statbuf) == 0, + "wifi-wep-104-ascii-write-reread", "couldn't stat() '%s'", keyfile); + ASSERT (S_ISREG (statbuf.st_mode), + "wifi-wep-104-ascii-write-reread", "keyfile '%s' wasn't a normal file", keyfile); + ASSERT ((statbuf.st_mode & 0077) == 0, + "wifi-wep-104-ascii-write-reread", "keyfile '%s' wasn't readable only by its owner", keyfile); + + unlink (keyfile); + + ASSERT (reread != NULL, + "wifi-wep-104-ascii-write-reread", "failed to read %s: %s", testfile, error->message); + + ASSERT (nm_connection_verify (reread, &error), + "wifi-wep-104-ascii-write-reread-verify", "failed to verify %s: %s", testfile, error->message); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "wifi-wep-104-ascii-write", "written and re-read connection weren't the same."); + + g_free (testfile); + g_object_unref (connection); + g_object_unref (reread); +} + static void test_write_wifi_leap (void) { @@ -8441,6 +9009,8 @@ int main (int argc, char **argv) test_read_wifi_wep (); test_read_wifi_wep_adhoc (); test_read_wifi_wep_passphrase (); + test_read_wifi_wep_40_ascii (); + test_read_wifi_wep_104_ascii (); test_read_wifi_leap (); test_read_wifi_wpa_psk (); test_read_wifi_wpa_psk_unquoted (); @@ -8462,6 +9032,8 @@ int main (int argc, char **argv) test_write_wifi_wep (); test_write_wifi_wep_adhoc (); test_write_wifi_wep_passphrase (); + test_write_wifi_wep_40_ascii (); + test_write_wifi_wep_104_ascii (); test_write_wifi_leap (); test_write_wifi_wpa_psk ("Test Write Wifi WPA PSK", "wifi-wpa-psk-write", -- cgit v1.2.1 From 1b49f941a69af910b0e68530be7339e8053068e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Tue, 22 Jun 2010 14:21:25 +0200 Subject: core: MAC address spoofing/cloning (rh #447827) (bgo #553771) This commit implements MAC cloning feature in NetworkManager. To support that, 'PermHwAddress' property is added into *.Device.Wired and *.Device.Wireless interfaces. The permanent MAC address is obtained when creating the device, and is used for 'locking' connections to the device. If a cloned MAC is specified in connection to be activated, the MAC is set to the interface in stage1. While disconecting, the permanent MAC is set back to the interface. --- cli/src/connections.c | 4 +- cli/src/settings.c | 58 ++++++----- introspection/nm-device-ethernet.xml | 8 +- introspection/nm-device-wifi.xml | 9 +- libnm-glib/Makefile.am | 2 +- libnm-glib/libnm-glib.ver | 2 + libnm-glib/nm-device-ethernet.c | 69 +++++++++++-- libnm-glib/nm-device-ethernet.h | 4 +- libnm-glib/nm-device-wifi.c | 69 +++++++++++-- libnm-glib/nm-device-wifi.h | 4 +- libnm-util/Makefile.am | 2 +- libnm-util/libnm-util.ver | 2 + libnm-util/nm-setting-wired.c | 73 +++++++++++--- libnm-util/nm-setting-wired.h | 4 +- libnm-util/nm-setting-wireless.c | 70 ++++++++++--- libnm-util/nm-setting-wireless.h | 4 +- src/nm-device-ethernet.c | 146 ++++++++++++++++++++++++++-- src/nm-device-ethernet.h | 6 +- src/nm-device-wifi.c | 145 ++++++++++++++++++++++++--- src/nm-device-wifi.h | 18 ++-- src/nm-device.c | 3 + src/nm-device.h | 3 +- src/nm-system.c | 42 ++++++++ src/nm-system.h | 5 +- system-settings/plugins/ifcfg-rh/reader.c | 28 ++++-- system-settings/plugins/ifcfg-rh/writer.c | 39 ++++++-- system-settings/plugins/keyfile/io/reader.c | 8 ++ system-settings/plugins/keyfile/io/writer.c | 6 ++ 28 files changed, 705 insertions(+), 128 deletions(-) diff --git a/cli/src/connections.c b/cli/src/connections.c index e9aa597d11..b0d9883cdd 100644 --- a/cli/src/connections.c +++ b/cli/src/connections.c @@ -713,7 +713,7 @@ check_ethernet_compatible (NMDeviceEthernet *device, NMConnection *connection, G const char *device_mac_str; struct ether_addr *device_mac; - device_mac_str = nm_device_ethernet_get_hw_address (device); + device_mac_str = nm_device_ethernet_get_permanent_hw_address (device); device_mac = ether_aton (device_mac_str); if (!device_mac) { g_set_error (error, 0, 0, "Invalid device MAC address."); @@ -762,7 +762,7 @@ check_wifi_compatible (NMDeviceWifi *device, NMConnection *connection, GError ** const char *device_mac_str; struct ether_addr *device_mac; - device_mac_str = nm_device_wifi_get_hw_address (device); + device_mac_str = nm_device_wifi_get_permanent_hw_address (device); device_mac = ether_aton (device_mac_str); if (!device_mac) { g_set_error (error, 0, 0, "Invalid device MAC address."); diff --git a/cli/src/settings.c b/cli/src/settings.c index 1371bfbef5..8b62876479 100644 --- a/cli/src/settings.c +++ b/cli/src/settings.c @@ -50,13 +50,14 @@ static NmcOutputField nmc_fields_setting_connection[] = { /* Available fields for NM_SETTING_WIRED_SETTING_NAME */ static NmcOutputField nmc_fields_setting_wired[] = { - SETTING_FIELD ("name", 17), /* 0 */ - SETTING_FIELD (NM_SETTING_WIRED_PORT, 8), /* 1 */ - SETTING_FIELD (NM_SETTING_WIRED_SPEED, 10), /* 2 */ - SETTING_FIELD (NM_SETTING_WIRED_DUPLEX, 10), /* 3 */ - SETTING_FIELD (NM_SETTING_WIRED_AUTO_NEGOTIATE, 15), /* 4 */ - SETTING_FIELD (NM_SETTING_WIRED_MAC_ADDRESS, 19), /* 5 */ - SETTING_FIELD (NM_SETTING_WIRED_MTU, 6), /* 6 */ + SETTING_FIELD ("name", 17), /* 0 */ + SETTING_FIELD (NM_SETTING_WIRED_PORT, 8), /* 1 */ + SETTING_FIELD (NM_SETTING_WIRED_SPEED, 10), /* 2 */ + SETTING_FIELD (NM_SETTING_WIRED_DUPLEX, 10), /* 3 */ + SETTING_FIELD (NM_SETTING_WIRED_AUTO_NEGOTIATE, 15), /* 4 */ + SETTING_FIELD (NM_SETTING_WIRED_MAC_ADDRESS, 19), /* 5 */ + SETTING_FIELD (NM_SETTING_WIRED_CLONED_MAC_ADDRESS, 19), /* 6 */ + SETTING_FIELD (NM_SETTING_WIRED_MTU, 6), /* 7 */ {NULL, NULL, 0, NULL, 0} }; #define NMC_FIELDS_SETTING_WIRED_ALL "name"","\ @@ -65,6 +66,7 @@ static NmcOutputField nmc_fields_setting_wired[] = { NM_SETTING_WIRED_DUPLEX","\ NM_SETTING_WIRED_AUTO_NEGOTIATE","\ NM_SETTING_WIRED_MAC_ADDRESS","\ + NM_SETTING_WIRED_CLONED_MAC_ADDRESS","\ NM_SETTING_WIRED_MTU #define NMC_FIELDS_SETTING_WIRED_COMMON NMC_FIELDS_SETTING_WIRED_ALL @@ -131,9 +133,10 @@ static NmcOutputField nmc_fields_setting_wireless[] = { SETTING_FIELD (NM_SETTING_WIRELESS_RATE, 10), /* 6 */ SETTING_FIELD (NM_SETTING_WIRELESS_TX_POWER, 10), /* 7 */ SETTING_FIELD (NM_SETTING_WIRELESS_MAC_ADDRESS, 19), /* 8 */ - SETTING_FIELD (NM_SETTING_WIRELESS_MTU, 6), /* 9 */ - SETTING_FIELD (NM_SETTING_WIRELESS_SEEN_BSSIDS, 35), /* 10 */ - SETTING_FIELD (NM_SETTING_WIRELESS_SEC, 10), /* 11 */ + SETTING_FIELD (NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS, 19), /* 9 */ + SETTING_FIELD (NM_SETTING_WIRELESS_MTU, 6), /* 10 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SEEN_BSSIDS, 35), /* 11 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SEC, 10), /* 12 */ {NULL, NULL, 0, NULL, 0} }; #define NMC_FIELDS_SETTING_WIRELESS_ALL "name"","\ @@ -145,6 +148,7 @@ static NmcOutputField nmc_fields_setting_wireless[] = { NM_SETTING_WIRELESS_RATE","\ NM_SETTING_WIRELESS_TX_POWER","\ NM_SETTING_WIRELESS_MAC_ADDRESS","\ + NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS","\ NM_SETTING_WIRELESS_MTU","\ NM_SETTING_WIRELESS_SEEN_BSSIDS","\ NM_SETTING_WIRELESS_SEC @@ -518,7 +522,7 @@ setting_wired_details (NMSetting *setting, NmCli *nmc) { NMSettingWired *s_wired; const GByteArray *mac; - char *speed_str, *mtu_str, *mac_str = NULL; + char *speed_str, *mtu_str, *device_mac_str = NULL, *cloned_mac_str = NULL; guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; @@ -535,21 +539,26 @@ setting_wired_details (NMSetting *setting, NmCli *nmc) mtu_str = g_strdup_printf ("%d", nm_setting_wired_get_mtu (s_wired)); mac = nm_setting_wired_get_mac_address (s_wired); if (mac) - mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", mac->data[0], mac->data[1], mac->data[2], mac->data[3], mac->data[4], mac->data[5]); + device_mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", mac->data[0], mac->data[1], mac->data[2], mac->data[3], mac->data[4], mac->data[5]); + mac = nm_setting_wired_get_cloned_mac_address (s_wired); + if (mac) + cloned_mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", mac->data[0], mac->data[1], mac->data[2], mac->data[3], mac->data[4], mac->data[5]); nmc->allowed_fields[0].value = NM_SETTING_WIRED_SETTING_NAME; nmc->allowed_fields[1].value = nm_setting_wired_get_port (s_wired); nmc->allowed_fields[2].value = speed_str; nmc->allowed_fields[3].value = nm_setting_wired_get_duplex (s_wired); nmc->allowed_fields[4].value = nm_setting_wired_get_auto_negotiate (s_wired) ? _("yes") : _("no"); - nmc->allowed_fields[5].value = mac_str; - nmc->allowed_fields[6].value = strcmp (mtu_str, "0") ? mtu_str : _("auto"); + nmc->allowed_fields[5].value = device_mac_str; + nmc->allowed_fields[6].value = cloned_mac_str; + nmc->allowed_fields[7].value = strcmp (mtu_str, "0") ? mtu_str : _("auto"); nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ g_free (speed_str); - g_free (mac_str); + g_free (device_mac_str); + g_free (cloned_mac_str); g_free (mtu_str); return TRUE; @@ -663,7 +672,7 @@ setting_wireless_details (NMSetting *setting, NmCli *nmc) int i; const GByteArray *ssid, *bssid, *mac; char *ssid_str, *channel_str, *rate_str, *tx_power_str, *mtu_str; - char *mac_str = NULL, *bssid_str = NULL; + char *device_mac_str = NULL, *cloned_mac_str = NULL, *bssid_str = NULL; GString *seen_bssids; guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; @@ -688,7 +697,10 @@ setting_wireless_details (NMSetting *setting, NmCli *nmc) mtu_str = g_strdup_printf ("%d", nm_setting_wireless_get_mtu (s_wireless)); mac = nm_setting_wireless_get_mac_address (s_wireless); if (mac) - mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", mac->data[0], mac->data[1], mac->data[2], mac->data[3], mac->data[4], mac->data[5]); + device_mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", mac->data[0], mac->data[1], mac->data[2], mac->data[3], mac->data[4], mac->data[5]); + mac = nm_setting_wireless_get_cloned_mac_address (s_wireless); + if (mac) + cloned_mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", mac->data[0], mac->data[1], mac->data[2], mac->data[3], mac->data[4], mac->data[5]); seen_bssids = g_string_new (NULL); for (i = 0; i < nm_setting_wireless_get_num_seen_bssids (s_wireless); i++) { if (i > 0) @@ -704,10 +716,11 @@ setting_wireless_details (NMSetting *setting, NmCli *nmc) nmc->allowed_fields[5].value = bssid_str ? bssid_str : _("not set"); nmc->allowed_fields[6].value = rate_str; nmc->allowed_fields[7].value = tx_power_str; - nmc->allowed_fields[8].value = mac_str ? mac_str : _("not set"); - nmc->allowed_fields[9].value = strcmp (mtu_str, "0") ? mtu_str : _("auto"); - nmc->allowed_fields[10].value = seen_bssids->str; - nmc->allowed_fields[11].value = nm_setting_wireless_get_security (s_wireless); + nmc->allowed_fields[8].value = device_mac_str ? device_mac_str : _("not set"); + nmc->allowed_fields[9].value = cloned_mac_str ? cloned_mac_str : _("not set"); + nmc->allowed_fields[10].value = strcmp (mtu_str, "0") ? mtu_str : _("auto"); + nmc->allowed_fields[11].value = seen_bssids->str; + nmc->allowed_fields[12].value = nm_setting_wireless_get_security (s_wireless); nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ @@ -717,7 +730,8 @@ setting_wireless_details (NMSetting *setting, NmCli *nmc) g_free (bssid_str); g_free (rate_str); g_free (tx_power_str); - g_free (mac_str); + g_free (device_mac_str); + g_free (cloned_mac_str); g_free (mtu_str); g_string_free (seen_bssids, TRUE); diff --git a/introspection/nm-device-ethernet.xml b/introspection/nm-device-ethernet.xml index 5b7c88ebfd..000caf752f 100644 --- a/introspection/nm-device-ethernet.xml +++ b/introspection/nm-device-ethernet.xml @@ -5,7 +5,13 @@ - Hardware address of the device. + Active hardware address of the device. + + + + + + Permanent hardware address of the device. diff --git a/introspection/nm-device-wifi.xml b/introspection/nm-device-wifi.xml index 21ace0a49e..fb50762438 100644 --- a/introspection/nm-device-wifi.xml +++ b/introspection/nm-device-wifi.xml @@ -16,9 +16,16 @@ - The hardware address of the device. + The active hardware address of the device. + + + + The permanent hardware address of the device. + + + The operating mode of the wireless device. diff --git a/libnm-glib/Makefile.am b/libnm-glib/Makefile.am index e230a7c149..6462766b6e 100644 --- a/libnm-glib/Makefile.am +++ b/libnm-glib/Makefile.am @@ -132,7 +132,7 @@ libnm_glib_la_LIBADD = \ $(GUDEV_LIBS) libnm_glib_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-glib.ver \ - -version-info "5:0:3" + -version-info "6:0:4" noinst_PROGRAMS = libnm-glib-test diff --git a/libnm-glib/libnm-glib.ver b/libnm-glib/libnm-glib.ver index 1c4d8f43c7..1596afaad9 100644 --- a/libnm-glib/libnm-glib.ver +++ b/libnm-glib/libnm-glib.ver @@ -63,6 +63,7 @@ global: nm_device_bt_get_type; nm_device_ethernet_get_carrier; nm_device_ethernet_get_hw_address; + nm_device_ethernet_get_permanent_hw_address; nm_device_ethernet_get_speed; nm_device_ethernet_get_type; nm_device_ethernet_new; @@ -86,6 +87,7 @@ global: nm_device_wifi_get_bitrate; nm_device_wifi_get_capabilities; nm_device_wifi_get_hw_address; + nm_device_wifi_get_permanent_hw_address; nm_device_wifi_get_mode; nm_device_wifi_get_type; nm_device_wifi_new; diff --git a/libnm-glib/nm-device-ethernet.c b/libnm-glib/nm-device-ethernet.c index 7a0cd925d0..44b2742765 100644 --- a/libnm-glib/nm-device-ethernet.c +++ b/libnm-glib/nm-device-ethernet.c @@ -18,7 +18,7 @@ * Boston, MA 02110-1301 USA. * * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2008 Red Hat, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. */ #include "nm-device-ethernet.h" @@ -34,7 +34,8 @@ G_DEFINE_TYPE (NMDeviceEthernet, nm_device_ethernet, NM_TYPE_DEVICE) typedef struct { DBusGProxy *proxy; - char * hw_address; + char *hw_address; + char *perm_hw_address; guint32 speed; gboolean carrier; gboolean carrier_valid; @@ -45,6 +46,7 @@ typedef struct { enum { PROP_0, PROP_HW_ADDRESS, + PROP_PERM_HW_ADDRESS, PROP_SPEED, PROP_CARRIER, @@ -52,6 +54,7 @@ enum { }; #define DBUS_PROP_HW_ADDRESS "HwAddress" +#define DBUS_PROP_PERM_HW_ADDRESS "PermHwAddress" #define DBUS_PROP_SPEED "Speed" #define DBUS_PROP_CARRIER "Carrier" @@ -80,9 +83,9 @@ nm_device_ethernet_new (DBusGConnection *connection, const char *path) * nm_device_ethernet_get_hw_address: * @device: a #NMDeviceEthernet * - * Gets the hardware (MAC) address of the #NMDeviceEthernet + * Gets the active hardware (MAC) address of the #NMDeviceEthernet * - * Returns: the hardware address. This is the internal string used by the + * Returns: the active hardware address. This is the internal string used by the * device, and must not be modified. **/ const char * @@ -102,6 +105,32 @@ nm_device_ethernet_get_hw_address (NMDeviceEthernet *device) return priv->hw_address; } +/** + * nm_device_ethernet_get_permanent_hw_address: + * @device: a #NMDeviceEthernet + * + * Gets the permanent hardware (MAC) address of the #NMDeviceEthernet + * + * Returns: the permanent hardware address. This is the internal string used by the + * device, and must not be modified. + **/ +const char * +nm_device_ethernet_get_permanent_hw_address (NMDeviceEthernet *device) +{ + NMDeviceEthernetPrivate *priv; + + g_return_val_if_fail (NM_IS_DEVICE_ETHERNET (device), NULL); + + priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); + if (!priv->perm_hw_address) { + priv->perm_hw_address = _nm_object_get_string_property (NM_OBJECT (device), + NM_DBUS_INTERFACE_DEVICE_WIRED, + DBUS_PROP_PERM_HW_ADDRESS); + } + + return priv->perm_hw_address; +} + /** * nm_device_ethernet_get_speed: * @device: a #NMDeviceEthernet @@ -168,9 +197,10 @@ register_for_property_changed (NMDeviceEthernet *device) { NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); const NMPropertiesChangedInfo property_changed_info[] = { - { NM_DEVICE_ETHERNET_HW_ADDRESS, _nm_object_demarshal_generic, &priv->hw_address }, - { NM_DEVICE_ETHERNET_SPEED, _nm_object_demarshal_generic, &priv->speed }, - { NM_DEVICE_ETHERNET_CARRIER, _nm_object_demarshal_generic, &priv->carrier }, + { NM_DEVICE_ETHERNET_HW_ADDRESS, _nm_object_demarshal_generic, &priv->hw_address }, + { NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS, _nm_object_demarshal_generic, &priv->perm_hw_address }, + { NM_DEVICE_ETHERNET_SPEED, _nm_object_demarshal_generic, &priv->speed }, + { NM_DEVICE_ETHERNET_CARRIER, _nm_object_demarshal_generic, &priv->carrier }, { NULL }, }; @@ -230,6 +260,9 @@ finalize (GObject *object) if (priv->hw_address) g_free (priv->hw_address); + if (priv->perm_hw_address) + g_free (priv->perm_hw_address); + G_OBJECT_CLASS (nm_device_ethernet_parent_class)->finalize (object); } @@ -245,6 +278,9 @@ get_property (GObject *object, case PROP_HW_ADDRESS: g_value_set_string (value, nm_device_ethernet_get_hw_address (device)); break; + case PROP_PERM_HW_ADDRESS: + g_value_set_string (value, nm_device_ethernet_get_permanent_hw_address (device)); + break; case PROP_SPEED: g_value_set_uint (value, nm_device_ethernet_get_speed (device)); break; @@ -275,13 +311,26 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *device_class) /** * NMDeviceEthernet:hw-address: * - * The hardware (MAC) address of the device. + * The active hardware (MAC) address of the device. **/ g_object_class_install_property (object_class, PROP_HW_ADDRESS, g_param_spec_string (NM_DEVICE_ETHERNET_HW_ADDRESS, - "MAC Address", - "Hardware MAC address", + "Active MAC Address", + "Currently set hardware MAC address", + NULL, + G_PARAM_READABLE)); + + /** + * NMDeviceEthernet:perm-hw-address: + * + * The permanent hardware (MAC) address of the device. + **/ + g_object_class_install_property + (object_class, PROP_PERM_HW_ADDRESS, + g_param_spec_string (NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS, + "Permanent MAC Address", + "Permanent hardware MAC address", NULL, G_PARAM_READABLE)); diff --git a/libnm-glib/nm-device-ethernet.h b/libnm-glib/nm-device-ethernet.h index 565e3e7e05..305ca022e8 100644 --- a/libnm-glib/nm-device-ethernet.h +++ b/libnm-glib/nm-device-ethernet.h @@ -18,7 +18,7 @@ * Boston, MA 02110-1301 USA. * * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2008 Red Hat, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. */ #ifndef NM_DEVICE_ETHERNET_H @@ -36,6 +36,7 @@ G_BEGIN_DECLS #define NM_DEVICE_ETHERNET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_ETHERNET, NMDeviceEthernetClass)) #define NM_DEVICE_ETHERNET_HW_ADDRESS "hw-address" +#define NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS "perm-hw-address" #define NM_DEVICE_ETHERNET_SPEED "speed" #define NM_DEVICE_ETHERNET_CARRIER "carrier" @@ -60,6 +61,7 @@ GType nm_device_ethernet_get_type (void); GObject *nm_device_ethernet_new (DBusGConnection *connection, const char *path); const char * nm_device_ethernet_get_hw_address (NMDeviceEthernet *device); +const char * nm_device_ethernet_get_permanent_hw_address (NMDeviceEthernet *device); guint32 nm_device_ethernet_get_speed (NMDeviceEthernet *device); gboolean nm_device_ethernet_get_carrier (NMDeviceEthernet *device); diff --git a/libnm-glib/nm-device-wifi.c b/libnm-glib/nm-device-wifi.c index 1729c8aae9..3d17023950 100644 --- a/libnm-glib/nm-device-wifi.c +++ b/libnm-glib/nm-device-wifi.c @@ -18,7 +18,7 @@ * Boston, MA 02110-1301 USA. * * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2008 Red Hat, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. */ #include @@ -45,6 +45,7 @@ typedef struct { DBusGProxy *proxy; char *hw_address; + char *perm_hw_address; NM80211Mode mode; guint32 rate; NMAccessPoint *active_ap; @@ -58,6 +59,7 @@ typedef struct { enum { PROP_0, PROP_HW_ADDRESS, + PROP_PERM_HW_ADDRESS, PROP_MODE, PROP_BITRATE, PROP_ACTIVE_ACCESS_POINT, @@ -67,6 +69,7 @@ enum { }; #define DBUS_PROP_HW_ADDRESS "HwAddress" +#define DBUS_PROP_PERM_HW_ADDRESS "PermHwAddress" #define DBUS_PROP_MODE "Mode" #define DBUS_PROP_BITRATE "Bitrate" #define DBUS_PROP_ACTIVE_ACCESS_POINT "ActiveAccessPoint" @@ -106,9 +109,9 @@ nm_device_wifi_new (DBusGConnection *connection, const char *path) * nm_device_wifi_get_hw_address: * @device: a #NMDeviceWifi * - * Gets the hardware (MAC) address of the #NMDeviceWifi + * Gets the actual hardware (MAC) address of the #NMDeviceWifi * - * Returns: the hardware address. This is the internal string used by the + * Returns: the actual hardware address. This is the internal string used by the * device, and must not be modified. **/ const char * @@ -128,6 +131,32 @@ nm_device_wifi_get_hw_address (NMDeviceWifi *device) return priv->hw_address; } +/** + * nm_device_wifi_get_permanent_hw_address: + * @device: a #NMDeviceWifi + * + * Gets the permanent hardware (MAC) address of the #NMDeviceWifi + * + * Returns: the permanent hardware address. This is the internal string used by the + * device, and must not be modified. + **/ +const char * +nm_device_wifi_get_permanent_hw_address (NMDeviceWifi *device) +{ + NMDeviceWifiPrivate *priv; + + g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), NULL); + + priv = NM_DEVICE_WIFI_GET_PRIVATE (device); + if (!priv->perm_hw_address) { + priv->perm_hw_address = _nm_object_get_string_property (NM_OBJECT (device), + NM_DBUS_INTERFACE_DEVICE_WIRELESS, + DBUS_PROP_PERM_HW_ADDRESS); + } + + return priv->perm_hw_address; +} + /** * nm_device_wifi_get_mode: * @device: a #NMDeviceWifi @@ -464,6 +493,9 @@ get_property (GObject *object, case PROP_HW_ADDRESS: g_value_set_string (value, nm_device_wifi_get_hw_address (self)); break; + case PROP_PERM_HW_ADDRESS: + g_value_set_string (value, nm_device_wifi_get_permanent_hw_address (self)); + break; case PROP_MODE: g_value_set_uint (value, nm_device_wifi_get_mode (self)); break; @@ -554,11 +586,12 @@ register_for_property_changed (NMDeviceWifi *device) { NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (device); const NMPropertiesChangedInfo property_changed_info[] = { - { NM_DEVICE_WIFI_HW_ADDRESS, _nm_object_demarshal_generic, &priv->hw_address }, - { NM_DEVICE_WIFI_MODE, _nm_object_demarshal_generic, &priv->mode }, - { NM_DEVICE_WIFI_BITRATE, _nm_object_demarshal_generic, &priv->rate }, - { NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT, demarshal_active_ap, &priv->active_ap }, - { NM_DEVICE_WIFI_CAPABILITIES, _nm_object_demarshal_generic, &priv->wireless_caps }, + { NM_DEVICE_WIFI_HW_ADDRESS, _nm_object_demarshal_generic, &priv->hw_address }, + { NM_DEVICE_WIFI_PERMANENT_HW_ADDRESS, _nm_object_demarshal_generic, &priv->perm_hw_address }, + { NM_DEVICE_WIFI_MODE, _nm_object_demarshal_generic, &priv->mode }, + { NM_DEVICE_WIFI_BITRATE, _nm_object_demarshal_generic, &priv->rate }, + { NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT, demarshal_active_ap, &priv->active_ap }, + { NM_DEVICE_WIFI_CAPABILITIES, _nm_object_demarshal_generic, &priv->wireless_caps }, { NULL }, }; @@ -638,6 +671,9 @@ finalize (GObject *object) if (priv->hw_address) g_free (priv->hw_address); + if (priv->perm_hw_address) + g_free (priv->perm_hw_address); + G_OBJECT_CLASS (nm_device_wifi_parent_class)->finalize (object); } @@ -664,8 +700,21 @@ nm_device_wifi_class_init (NMDeviceWifiClass *device_class) g_object_class_install_property (object_class, PROP_HW_ADDRESS, g_param_spec_string (NM_DEVICE_WIFI_HW_ADDRESS, - "MAC Address", - "Hardware MAC address", + "Active MAC Address", + "Currently set hardware MAC address", + NULL, + G_PARAM_READABLE)); + + /** + * NMDeviceWifi:perm-hw-address: + * + * The hardware (MAC) address of the device. + **/ + g_object_class_install_property + (object_class, PROP_PERM_HW_ADDRESS, + g_param_spec_string (NM_DEVICE_WIFI_PERMANENT_HW_ADDRESS, + "Permanent MAC Address", + "Permanent hardware MAC address", NULL, G_PARAM_READABLE)); diff --git a/libnm-glib/nm-device-wifi.h b/libnm-glib/nm-device-wifi.h index 9152ab29db..21f3558af3 100644 --- a/libnm-glib/nm-device-wifi.h +++ b/libnm-glib/nm-device-wifi.h @@ -18,7 +18,7 @@ * Boston, MA 02110-1301 USA. * * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2008 Red Hat, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. */ #ifndef NM_DEVICE_WIFI_H @@ -37,6 +37,7 @@ G_BEGIN_DECLS #define NM_DEVICE_WIFI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_WIFI, NMDeviceWifiClass)) #define NM_DEVICE_WIFI_HW_ADDRESS "hw-address" +#define NM_DEVICE_WIFI_PERMANENT_HW_ADDRESS "perm-hw-address" #define NM_DEVICE_WIFI_MODE "mode" #define NM_DEVICE_WIFI_BITRATE "bitrate" #define NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT "active-access-point" @@ -67,6 +68,7 @@ GType nm_device_wifi_get_type (void); GObject *nm_device_wifi_new (DBusGConnection *connection, const char *path); const char * nm_device_wifi_get_hw_address (NMDeviceWifi *device); +const char * nm_device_wifi_get_permanent_hw_address (NMDeviceWifi *device); NM80211Mode nm_device_wifi_get_mode (NMDeviceWifi *device); guint32 nm_device_wifi_get_bitrate (NMDeviceWifi *device); guint32 nm_device_wifi_get_capabilities (NMDeviceWifi *device); diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am index 3233d4067b..327693e4de 100644 --- a/libnm-util/Makefile.am +++ b/libnm-util/Makefile.am @@ -59,7 +59,7 @@ libnm_util_la_SOURCES= \ libnm_util_la_LIBADD = $(GLIB_LIBS) $(DBUS_LIBS) $(UUID_LIBS) libnm_util_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-util.ver \ - -version-info "5:0:4" + -version-info "6:0:5" if WITH_GNUTLS libnm_util_la_SOURCES += crypto_gnutls.c diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver index 2c4919c16c..3983cd7c1b 100644 --- a/libnm-util/libnm-util.ver +++ b/libnm-util/libnm-util.ver @@ -288,6 +288,7 @@ global: nm_setting_wired_get_duplex; nm_setting_wired_get_auto_negotiate; nm_setting_wired_get_mac_address; + nm_setting_wired_get_cloned_mac_address; nm_setting_wired_get_mtu; nm_setting_wireless_ap_security_compatible; nm_setting_wireless_error_get_type; @@ -302,6 +303,7 @@ global: nm_setting_wireless_get_rate; nm_setting_wireless_get_tx_power; nm_setting_wireless_get_mac_address; + nm_setting_wireless_get_cloned_mac_address; nm_setting_wireless_get_mtu; nm_setting_wireless_get_security; nm_setting_wireless_add_seen_bssid; diff --git a/libnm-util/nm-setting-wired.c b/libnm-util/nm-setting-wired.c index 2f25243318..0f01832b50 100644 --- a/libnm-util/nm-setting-wired.c +++ b/libnm-util/nm-setting-wired.c @@ -19,7 +19,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2010 Red Hat, Inc. * (C) Copyright 2007 - 2008 Novell, Inc. */ @@ -73,7 +73,8 @@ typedef struct { guint32 speed; char *duplex; gboolean auto_negotiate; - GByteArray *mac_address; + GByteArray *device_mac_address; + GByteArray *cloned_mac_address; guint32 mtu; } NMSettingWiredPrivate; @@ -84,6 +85,7 @@ enum { PROP_DUPLEX, PROP_AUTO_NEGOTIATE, PROP_MAC_ADDRESS, + PROP_CLONED_MAC_ADDRESS, PROP_MTU, LAST_PROP @@ -132,7 +134,15 @@ nm_setting_wired_get_mac_address (NMSettingWired *setting) { g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), NULL); - return NM_SETTING_WIRED_GET_PRIVATE (setting)->mac_address; + return NM_SETTING_WIRED_GET_PRIVATE (setting)->device_mac_address; +} + +const GByteArray * +nm_setting_wired_get_cloned_mac_address (NMSettingWired *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), NULL); + + return NM_SETTING_WIRED_GET_PRIVATE (setting)->cloned_mac_address; } guint32 @@ -166,7 +176,7 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) return FALSE; } - if (priv->mac_address && priv->mac_address->len != ETH_ALEN) { + if (priv->device_mac_address && priv->device_mac_address->len != ETH_ALEN) { g_set_error (error, NM_SETTING_WIRED_ERROR, NM_SETTING_WIRED_ERROR_INVALID_PROPERTY, @@ -174,6 +184,14 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) return FALSE; } + if (priv->cloned_mac_address && priv->cloned_mac_address->len != ETH_ALEN) { + g_set_error (error, + NM_SETTING_WIRED_ERROR, + NM_SETTING_WIRED_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRED_CLONED_MAC_ADDRESS); + return FALSE; + } + return TRUE; } @@ -191,8 +209,11 @@ finalize (GObject *object) g_free (priv->port); g_free (priv->duplex); - if (priv->mac_address) - g_byte_array_free (priv->mac_address, TRUE); + if (priv->device_mac_address) + g_byte_array_free (priv->device_mac_address, TRUE); + + if (priv->cloned_mac_address) + g_byte_array_free (priv->cloned_mac_address, TRUE); G_OBJECT_CLASS (nm_setting_wired_parent_class)->finalize (object); } @@ -219,9 +240,14 @@ set_property (GObject *object, guint prop_id, priv->auto_negotiate = g_value_get_boolean (value); break; case PROP_MAC_ADDRESS: - if (priv->mac_address) - g_byte_array_free (priv->mac_address, TRUE); - priv->mac_address = g_value_dup_boxed (value); + if (priv->device_mac_address) + g_byte_array_free (priv->device_mac_address, TRUE); + priv->device_mac_address = g_value_dup_boxed (value); + break; + case PROP_CLONED_MAC_ADDRESS: + if (priv->cloned_mac_address) + g_byte_array_free (priv->cloned_mac_address, TRUE); + priv->cloned_mac_address = g_value_dup_boxed (value); break; case PROP_MTU: priv->mtu = g_value_get_uint (value); @@ -254,6 +280,9 @@ get_property (GObject *object, guint prop_id, case PROP_MAC_ADDRESS: g_value_set_boxed (value, nm_setting_wired_get_mac_address (setting)); break; + case PROP_CLONED_MAC_ADDRESS: + g_value_set_boxed (value, nm_setting_wired_get_cloned_mac_address (setting)); + break; case PROP_MTU: g_value_set_uint (value, nm_setting_wired_get_mtu (setting)); break; @@ -351,20 +380,36 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class) * NMSettingWired:mac-address: * * If specified, this connection will only apply to the ethernet device - * whose MAC address matches. This property does not change the MAC address - * of the device (known as MAC spoofing). + * whose permanent MAC address matches. This property does not change the MAC address + * of the device (i.e. MAC spoofing). **/ g_object_class_install_property (object_class, PROP_MAC_ADDRESS, _nm_param_spec_specialized (NM_SETTING_WIRED_MAC_ADDRESS, - "MAC Address", + "Device MAC Address", "If specified, this connection will only apply to " - "the ethernet device whose MAC address matches. " + "the ethernet device whose permanent MAC address matches. " "This property does not change the MAC address " - "of the device (known as MAC spoofing).", + "of the device (i.e. MAC spoofing).", DBUS_TYPE_G_UCHAR_ARRAY, G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + /** + * NMSettingWired:cloned-mac-address: + * + * If specified, request that the device use this MAC address instead of its + * permanent MAC address. This is known as MAC cloning or spoofing. + **/ + g_object_class_install_property + (object_class, PROP_CLONED_MAC_ADDRESS, + _nm_param_spec_specialized (NM_SETTING_WIRED_CLONED_MAC_ADDRESS, + "Cloned MAC Address", + "If specified, request that the device use " + "this MAC address instead of its permanent MAC address. " + "This is known as MAC cloning or spoofing.", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + /** * NMSettingWired:mtu: * diff --git a/libnm-util/nm-setting-wired.h b/libnm-util/nm-setting-wired.h index 44127347f2..a3f9ac86d9 100644 --- a/libnm-util/nm-setting-wired.h +++ b/libnm-util/nm-setting-wired.h @@ -19,7 +19,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2010 Red Hat, Inc. * (C) Copyright 2007 - 2008 Novell, Inc. */ @@ -57,6 +57,7 @@ GQuark nm_setting_wired_error_quark (void); #define NM_SETTING_WIRED_DUPLEX "duplex" #define NM_SETTING_WIRED_AUTO_NEGOTIATE "auto-negotiate" #define NM_SETTING_WIRED_MAC_ADDRESS "mac-address" +#define NM_SETTING_WIRED_CLONED_MAC_ADDRESS "cloned-mac-address" #define NM_SETTING_WIRED_MTU "mtu" typedef struct { @@ -81,6 +82,7 @@ guint32 nm_setting_wired_get_speed (NMSettingWired *setting); const char *nm_setting_wired_get_duplex (NMSettingWired *setting); gboolean nm_setting_wired_get_auto_negotiate (NMSettingWired *setting); const GByteArray *nm_setting_wired_get_mac_address (NMSettingWired *setting); +const GByteArray *nm_setting_wired_get_cloned_mac_address (NMSettingWired *setting); guint32 nm_setting_wired_get_mtu (NMSettingWired *setting); G_END_DECLS diff --git a/libnm-util/nm-setting-wireless.c b/libnm-util/nm-setting-wireless.c index 44d010f7ac..99af8f2a34 100644 --- a/libnm-util/nm-setting-wireless.c +++ b/libnm-util/nm-setting-wireless.c @@ -86,7 +86,8 @@ typedef struct { GByteArray *bssid; guint32 rate; guint32 tx_power; - GByteArray *mac_address; + GByteArray *device_mac_address; + GByteArray *cloned_mac_address; guint32 mtu; GSList *seen_bssids; char *security; @@ -102,6 +103,7 @@ enum { PROP_RATE, PROP_TX_POWER, PROP_MAC_ADDRESS, + PROP_CLONED_MAC_ADDRESS, PROP_MTU, PROP_SEEN_BSSIDS, PROP_SEC, @@ -353,7 +355,15 @@ nm_setting_wireless_get_mac_address (NMSettingWireless *setting) { g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), NULL); - return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->mac_address; + return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->device_mac_address; +} + +const GByteArray * +nm_setting_wireless_get_cloned_mac_address (NMSettingWireless *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), NULL); + + return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->cloned_mac_address; } guint32 @@ -497,7 +507,7 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) return FALSE; } - if (priv->mac_address && priv->mac_address->len != ETH_ALEN) { + if (priv->device_mac_address && priv->device_mac_address->len != ETH_ALEN) { g_set_error (error, NM_SETTING_WIRELESS_ERROR, NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY, @@ -505,6 +515,14 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) return FALSE; } + if (priv->cloned_mac_address && priv->cloned_mac_address->len != ETH_ALEN) { + g_set_error (error, + NM_SETTING_WIRELESS_ERROR, + NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS); + return FALSE; + } + for (iter = priv->seen_bssids; iter; iter = iter->next) { struct ether_addr addr; @@ -548,8 +566,10 @@ finalize (GObject *object) g_byte_array_free (priv->ssid, TRUE); if (priv->bssid) g_byte_array_free (priv->bssid, TRUE); - if (priv->mac_address) - g_byte_array_free (priv->mac_address, TRUE); + if (priv->device_mac_address) + g_byte_array_free (priv->device_mac_address, TRUE); + if (priv->cloned_mac_address) + g_byte_array_free (priv->cloned_mac_address, TRUE); nm_utils_slist_free (priv->seen_bssids, g_free); @@ -591,9 +611,14 @@ set_property (GObject *object, guint prop_id, priv->tx_power = g_value_get_uint (value); break; case PROP_MAC_ADDRESS: - if (priv->mac_address) - g_byte_array_free (priv->mac_address, TRUE); - priv->mac_address = g_value_dup_boxed (value); + if (priv->device_mac_address) + g_byte_array_free (priv->device_mac_address, TRUE); + priv->device_mac_address = g_value_dup_boxed (value); + break; + case PROP_CLONED_MAC_ADDRESS: + if (priv->cloned_mac_address) + g_byte_array_free (priv->cloned_mac_address, TRUE); + priv->cloned_mac_address = g_value_dup_boxed (value); break; case PROP_MTU: priv->mtu = g_value_get_uint (value); @@ -643,6 +668,9 @@ get_property (GObject *object, guint prop_id, case PROP_MAC_ADDRESS: g_value_set_boxed (value, nm_setting_wireless_get_mac_address (setting)); break; + case PROP_CLONED_MAC_ADDRESS: + g_value_set_boxed (value, nm_setting_wireless_get_cloned_mac_address (setting)); + break; case PROP_MTU: g_value_set_uint (value, nm_setting_wireless_get_mtu (setting)); break; @@ -809,20 +837,36 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class) * NMSettingWireless:mac-address: * * If specified, this connection will only apply to the WiFi device - * whose MAC address matches. This property does not change the MAC address - * of the device (known as MAC spoofing). + * whose permanent MAC address matches. This property does not change the MAC address + * of the device (i.e. MAC spoofing). **/ g_object_class_install_property (object_class, PROP_MAC_ADDRESS, _nm_param_spec_specialized (NM_SETTING_WIRELESS_MAC_ADDRESS, - "MAC Address", + "Device MAC Address", "If specified, this connection will only apply to " - "the WiFi device whose MAC address matches. " + "the WiFi device whose permanent MAC address matches. " "This property does not change the MAC address " - "of the device (known as MAC spoofing).", + "of the device (i.e. MAC spoofing).", DBUS_TYPE_G_UCHAR_ARRAY, G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + /** + * NMSettingWireless:cloned-mac-address: + * + * If specified, request that the Wifi device use this MAC address instead of its + * permanent MAC address. This is known as MAC cloning or spoofing. + **/ + g_object_class_install_property + (object_class, PROP_CLONED_MAC_ADDRESS, + _nm_param_spec_specialized (NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS, + "Spoof MAC Address", + "If specified, request that the WiFi device use " + "this MAC address instead of its permanent MAC address. " + "This is known as MAC cloning or spoofing.", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + /** * NMSettingWireless:seen-bssids: * diff --git a/libnm-util/nm-setting-wireless.h b/libnm-util/nm-setting-wireless.h index da2ea5b6b0..2216a246af 100644 --- a/libnm-util/nm-setting-wireless.h +++ b/libnm-util/nm-setting-wireless.h @@ -19,7 +19,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2010 Red Hat, Inc. * (C) Copyright 2007 - 2008 Novell, Inc. */ @@ -63,6 +63,7 @@ GQuark nm_setting_wireless_error_quark (void); #define NM_SETTING_WIRELESS_RATE "rate" #define NM_SETTING_WIRELESS_TX_POWER "tx-power" #define NM_SETTING_WIRELESS_MAC_ADDRESS "mac-address" +#define NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS "cloned-mac-address" #define NM_SETTING_WIRELESS_MTU "mtu" #define NM_SETTING_WIRELESS_SEEN_BSSIDS "seen-bssids" #define NM_SETTING_WIRELESS_SEC "security" @@ -93,6 +94,7 @@ const GByteArray *nm_setting_wireless_get_bssid (NMSettingWireless guint32 nm_setting_wireless_get_rate (NMSettingWireless *setting); guint32 nm_setting_wireless_get_tx_power (NMSettingWireless *setting); const GByteArray *nm_setting_wireless_get_mac_address (NMSettingWireless *setting); +const GByteArray *nm_setting_wireless_get_cloned_mac_address (NMSettingWireless *setting); guint32 nm_setting_wireless_get_mtu (NMSettingWireless *setting); const char *nm_setting_wireless_get_security (NMSettingWireless *setting); diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index 4333d0f5d4..8a22b6b9bb 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -102,10 +102,11 @@ typedef struct Supplicant { } Supplicant; typedef struct { - gboolean disposed; + gboolean disposed; - struct ether_addr hw_addr; - gboolean carrier; + struct ether_addr hw_addr; /* Currently set MAC address */ + struct ether_addr perm_hw_addr; /* Permanent MAC address */ + gboolean carrier; NMNetlinkMonitor * monitor; gulong link_connected_id; @@ -131,6 +132,7 @@ static guint signals[LAST_SIGNAL] = { 0 }; enum { PROP_0, PROP_HW_ADDRESS, + PROP_PERM_HW_ADDRESS, PROP_SPEED, PROP_CARRIER, @@ -455,6 +457,21 @@ nm_device_ethernet_get_address (NMDeviceEthernet *self, struct ether_addr *addr) memcpy (addr, &(NM_DEVICE_ETHERNET_GET_PRIVATE (self)->hw_addr), sizeof (struct ether_addr)); } +/* + * nm_device_ethernet_get_permanent_address + * + * Get a device's permanent hardware address + * + */ +void +nm_device_ethernet_get_permanent_address (NMDeviceEthernet *self, struct ether_addr *addr) +{ + g_return_if_fail (self != NULL); + g_return_if_fail (addr != NULL); + + memcpy (addr, &(NM_DEVICE_ETHERNET_GET_PRIVATE (self)->perm_hw_addr), sizeof (struct ether_addr)); +} + /* Returns speed in Mb/s */ static guint32 nm_device_ethernet_get_speed (NMDeviceEthernet *self) @@ -527,11 +544,50 @@ out: close (fd); } +static void +real_obtain_permanent_hw_address (NMDevice *dev) +{ + NMDeviceEthernet *self = NM_DEVICE_ETHERNET (dev); + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + struct ifreq req; + struct ethtool_perm_addr *epaddr = NULL; + int fd; + + fd = socket (PF_INET, SOCK_DGRAM, 0); + if (fd < 0) { + nm_log_warn (LOGD_HW, "couldn't open control socket."); + return; + } + + /* Get permanent MAC address */ + memset (&req, 0, sizeof (struct ifreq)); + strncpy (req.ifr_name, nm_device_get_iface (dev), IFNAMSIZ); + epaddr = (struct ethtool_perm_addr *) g_malloc0 (sizeof(struct ethtool_perm_addr) + ETH_ALEN); + epaddr->cmd = ETHTOOL_GPERMADDR; + epaddr->size = ETH_ALEN; + req.ifr_data = epaddr; + errno = 0; + if (ioctl (fd, SIOCETHTOOL, &req) < 0) { + nm_log_err (LOGD_HW | LOGD_ETHER, "SIOCETHTOOL failed: %d; unable to get permanent MAC address for %s", + errno, nm_device_get_iface (dev)); + goto out; + } + + if (memcmp (&priv->perm_hw_addr, epaddr->data, sizeof (struct ether_addr))) { + memcpy (&priv->perm_hw_addr, epaddr->data, sizeof (struct ether_addr)); + g_object_notify (G_OBJECT (dev), NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS); + } + +out: + g_free (epaddr); + close (fd); +} + static guint32 real_get_generic_capabilities (NMDevice *dev) { - NMDeviceEthernet * self = NM_DEVICE_ETHERNET (dev); - guint32 caps = NM_DEVICE_CAP_NONE; + NMDeviceEthernet *self = NM_DEVICE_ETHERNET (dev); + guint32 caps = NM_DEVICE_CAP_NONE; /* cipsec devices are also explicitly unsupported at this time */ if (strstr (nm_device_get_iface (dev), "cipsec")) @@ -1218,6 +1274,45 @@ supplicant_interface_init (NMDeviceEthernet *self) return TRUE; } +static NMActStageReturn +real_act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason) +{ + NMDeviceEthernet *self = NM_DEVICE_ETHERNET (dev); + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + NMActRequest *req; + NMSettingWired *s_wired; + const GByteArray *cloned_mac; + NMActStageReturn ret = NM_ACT_STAGE_RETURN_SUCCESS; + + g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); + + req = nm_device_get_act_request (NM_DEVICE (self)); + g_return_val_if_fail (req != NULL, NM_ACT_STAGE_RETURN_FAILURE); + + s_wired = NM_SETTING_WIRED (device_get_setting (dev, NM_TYPE_SETTING_WIRED)); + g_assert (s_wired); + + cloned_mac = nm_setting_wired_get_cloned_mac_address (s_wired); + if (cloned_mac) { + char *mac_str = NULL; + + mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", cloned_mac->data[0], cloned_mac->data[1], cloned_mac->data[2], + cloned_mac->data[3], cloned_mac->data[4], cloned_mac->data[5]); + real_hw_take_down (dev); + if (nm_system_device_set_mac (nm_device_get_iface (dev), (struct ether_addr *) cloned_mac->data)) { + /* MAC address succesfully spoofed on interface, set it to hw_addr too */ + memcpy (priv->hw_addr.ether_addr_octet, cloned_mac->data, ETH_ALEN); + nm_log_info (LOGD_DEVICE | LOGD_ETHER, "cloned MAC %s set to %s", mac_str, nm_device_get_iface (dev)); + } else { + nm_log_warn (LOGD_DEVICE | LOGD_ETHER, "failed to set cloned MAC %s to %s", mac_str, nm_device_get_iface (dev)); + } + real_hw_bring_up (dev, NULL); + g_free (mac_str); + } + + return ret; +} + static NMActStageReturn nm_8021x_stage2_config (NMDeviceEthernet *self, NMDeviceStateReason *reason) { @@ -1447,6 +1542,7 @@ static void real_deactivate_quickly (NMDevice *device) { NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); + char *mac_str = NULL; if (priv->pending_ip4_config) { g_object_unref (priv->pending_ip4_config); @@ -1459,6 +1555,22 @@ real_deactivate_quickly (NMDevice *device) } supplicant_interface_release (NM_DEVICE_ETHERNET (device)); + + /* Set permanent MAC address back to the interface */ + mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", + priv->perm_hw_addr.ether_addr_octet[0], priv->perm_hw_addr.ether_addr_octet[1], priv->perm_hw_addr.ether_addr_octet[2], + priv->perm_hw_addr.ether_addr_octet[3], priv->perm_hw_addr.ether_addr_octet[4], priv->perm_hw_addr.ether_addr_octet[5]); + real_hw_take_down (device); + if (nm_system_device_set_mac (nm_device_get_iface (device), &priv->perm_hw_addr)) { + /* MAC address succesfully spoofed on interface, set it to hw_addr too */ + memcpy (priv->hw_addr.ether_addr_octet, &priv->perm_hw_addr, ETH_ALEN); + nm_log_info (LOGD_DEVICE | LOGD_ETHER, "permanent MAC address %s set back to %s", mac_str, nm_device_get_iface (device)); + } else { + nm_log_warn (LOGD_DEVICE | LOGD_ETHER, "failed to set permanent MAC address %s back to %s", mac_str, nm_device_get_iface (device)); + } + real_hw_bring_up (device, NULL); + + g_free (mac_str); } static gboolean @@ -1501,7 +1613,7 @@ real_check_connection_compatible (NMDevice *device, const GByteArray *mac; mac = nm_setting_wired_get_mac_address (s_wired); - if (mac && memcmp (mac->data, &(priv->hw_addr.ether_addr_octet), ETH_ALEN)) { + if (mac && memcmp (mac->data, &(priv->perm_hw_addr.ether_addr_octet), ETH_ALEN)) { g_set_error (error, NM_ETHERNET_ERROR, NM_ETHERNET_ERROR_CONNECTION_INCOMPATIBLE, "The connection's MAC address did not match this device."); @@ -1521,7 +1633,7 @@ spec_match_list (NMDevice *device, const GSList *specs) char *hwaddr; gboolean matched; - nm_device_ethernet_get_address (NM_DEVICE_ETHERNET (device), ðer); + nm_device_ethernet_get_permanent_address (NM_DEVICE_ETHERNET (device), ðer); hwaddr = nm_ether_ntop (ðer); matched = nm_match_spec_hwaddr (specs, hwaddr); g_free (hwaddr); @@ -1543,7 +1655,7 @@ wired_match_config (NMDevice *self, NMConnection *connection) /* MAC address check */ s_ether = nm_setting_wired_get_mac_address (s_wired); if (s_ether) { - nm_device_ethernet_get_address (NM_DEVICE_ETHERNET (self), ðer); + nm_device_ethernet_get_permanent_address (NM_DEVICE_ETHERNET (self), ðer); if (memcmp (s_ether->data, ether.ether_addr_octet, ETH_ALEN)) return FALSE; @@ -1770,6 +1882,10 @@ get_property (GObject *object, guint prop_id, nm_device_ethernet_get_address (self, &hw_addr); g_value_take_string (value, nm_ether_ntop (&hw_addr)); break; + case PROP_PERM_HW_ADDRESS: + nm_device_ethernet_get_permanent_address (self, &hw_addr); + g_value_take_string (value, nm_ether_ntop (&hw_addr)); + break; case PROP_SPEED: g_value_set_uint (value, nm_device_ethernet_get_speed (self)); break; @@ -1816,11 +1932,13 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *klass) parent_class->take_down = real_take_down; parent_class->can_interrupt_activation = real_can_interrupt_activation; parent_class->update_hw_address = real_update_hw_address; + parent_class->obtain_permanent_hw_address = real_obtain_permanent_hw_address; parent_class->get_best_auto_connection = real_get_best_auto_connection; parent_class->is_available = real_is_available; parent_class->connection_secrets_updated = real_connection_secrets_updated; parent_class->check_connection_compatible = real_check_connection_compatible; + parent_class->act_stage1_prepare = real_act_stage1_prepare; parent_class->act_stage2_config = real_act_stage2_config; parent_class->act_stage3_ip4_config_start = real_act_stage3_ip4_config_start; parent_class->act_stage4_get_ip4_config = real_act_stage4_get_ip4_config; @@ -1832,8 +1950,16 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *klass) g_object_class_install_property (object_class, PROP_HW_ADDRESS, g_param_spec_string (NM_DEVICE_ETHERNET_HW_ADDRESS, - "MAC Address", - "Hardware MAC address", + "Active MAC Address", + "Currently set hardware MAC address", + NULL, + G_PARAM_READABLE)); + + g_object_class_install_property + (object_class, PROP_PERM_HW_ADDRESS, + g_param_spec_string (NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS, + "Permanent MAC Address", + "Permanent hardware MAC address", NULL, G_PARAM_READABLE)); diff --git a/src/nm-device-ethernet.h b/src/nm-device-ethernet.h index 7bb3db0086..243fbedb29 100644 --- a/src/nm-device-ethernet.h +++ b/src/nm-device-ethernet.h @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2005 - 2008 Red Hat, Inc. + * Copyright (C) 2005 - 2010 Red Hat, Inc. * Copyright (C) 2006 - 2008 Novell, Inc. */ @@ -37,6 +37,7 @@ G_BEGIN_DECLS #define NM_DEVICE_ETHERNET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_ETHERNET, NMDeviceEthernetClass)) #define NM_DEVICE_ETHERNET_HW_ADDRESS "hw-address" +#define NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS "perm-hw-address" #define NM_DEVICE_ETHERNET_SPEED "speed" #define NM_DEVICE_ETHERNET_CARRIER "carrier" @@ -62,6 +63,9 @@ NMDevice *nm_device_ethernet_new (const char *udi, void nm_device_ethernet_get_address (NMDeviceEthernet *dev, struct ether_addr *addr); +void nm_device_ethernet_get_permanent_address (NMDeviceEthernet *dev, + struct ether_addr *addr); + G_END_DECLS #endif /* NM_DEVICE_ETHERNET_H */ diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 134e4f4449..729dc0690d 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -30,6 +30,9 @@ #include #include #include +#include +#include +#include #include "nm-glib-compat.h" #include "nm-device.h" @@ -78,6 +81,7 @@ G_DEFINE_TYPE_EXTENDED (NMDeviceWifi, nm_device_wifi, NM_TYPE_DEVICE, 0, enum { PROP_0, PROP_HW_ADDRESS, + PROP_PERM_HW_ADDRESS, PROP_MODE, PROP_BITRATE, PROP_ACTIVE_ACCESS_POINT, @@ -142,7 +146,9 @@ typedef struct Supplicant { struct _NMDeviceWifiPrivate { gboolean disposed; - struct ether_addr hw_addr; + struct ether_addr hw_addr; /* Currently set MAC address */ + struct ether_addr perm_hw_addr; /* Permanent MAC address */ + gboolean perm_hw_addr_is_set; /* Legacy rfkill for ipw2x00; will be fixed with 2.6.33 kernel */ char * ipw_rfkill_path; @@ -1129,6 +1135,7 @@ real_deactivate_quickly (NMDevice *dev) NMDeviceWifi *self = NM_DEVICE_WIFI (dev); NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); NMAccessPoint *orig_ap = nm_device_wifi_get_activation_ap (self); + char *mac_str = NULL; cleanup_association_attempt (self, TRUE); @@ -1148,6 +1155,22 @@ real_deactivate_quickly (NMDevice *dev) priv->ap_list = g_slist_remove (priv->ap_list, orig_ap); g_object_unref (orig_ap); } + + /* Set permanent MAC address back to the interface */ + mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", + priv->perm_hw_addr.ether_addr_octet[0], priv->perm_hw_addr.ether_addr_octet[1], priv->perm_hw_addr.ether_addr_octet[2], + priv->perm_hw_addr.ether_addr_octet[3], priv->perm_hw_addr.ether_addr_octet[4], priv->perm_hw_addr.ether_addr_octet[5]); + real_hw_take_down (dev); + if (nm_system_device_set_mac (nm_device_get_iface (dev), &priv->perm_hw_addr)) { + /* MAC address succesfully spoofed on interface, set it to hw_addr too */ + memcpy (priv->hw_addr.ether_addr_octet, &priv->perm_hw_addr, ETH_ALEN); + nm_log_info (LOGD_DEVICE | LOGD_ETHER, "permanent MAC address %s set back to %s", mac_str, nm_device_get_iface (dev)); + } else { + nm_log_warn (LOGD_DEVICE | LOGD_ETHER, "failed to set permanent MAC address %s back to %s", mac_str, nm_device_get_iface (dev)); + } + real_hw_bring_up (dev, NULL); + + g_free (mac_str); } static void @@ -1190,7 +1213,7 @@ real_check_connection_compatible (NMDevice *device, } mac = nm_setting_wireless_get_mac_address (s_wireless); - if (mac && memcmp (mac->data, &(priv->hw_addr.ether_addr_octet), ETH_ALEN)) { + if (mac && memcmp (mac->data, &(priv->perm_hw_addr.ether_addr_octet), ETH_ALEN)) { g_set_error (error, NM_WIFI_ERROR, NM_WIFI_ERROR_CONNECTION_INCOMPATIBLE, "The connection's MAC address did not match this device."); @@ -1308,6 +1331,25 @@ nm_device_wifi_get_address (NMDeviceWifi *self, memcpy (addr, &(priv->hw_addr), sizeof (struct ether_addr)); } +/* + * nm_device_wifi_get_permanent_address + * + * Get a device's permanent hardware address + * + */ +void +nm_device_wifi_get_permanent_address (NMDeviceWifi *self, + struct ether_addr *addr) +{ + NMDeviceWifiPrivate *priv; + + g_return_if_fail (self != NULL); + g_return_if_fail (addr != NULL); + + priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + memcpy (addr, &(priv->perm_hw_addr), sizeof (struct ether_addr)); +} + static void nm_device_wifi_ap_list_print (NMDeviceWifi *self) { @@ -2949,6 +2991,51 @@ out: close (fd); } +static void +real_obtain_permanent_hw_address (NMDevice *dev) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (dev); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + struct ifreq req; + struct ethtool_perm_addr *epaddr = NULL; + int fd; + + fd = socket (PF_INET, SOCK_DGRAM, 0); + if (fd < 0) { + nm_log_err (LOGD_HW, "could not open control socket."); + return; + } + + /* Get permanent MAC address */ + memset (&req, 0, sizeof (struct ifreq)); + strncpy (req.ifr_name, nm_device_get_iface (dev), IFNAMSIZ); + epaddr = (struct ethtool_perm_addr *) g_malloc0 (sizeof(struct ethtool_perm_addr) + ETH_ALEN); + epaddr->cmd = ETHTOOL_GPERMADDR; + epaddr->size = ETH_ALEN; + req.ifr_data = (void *) epaddr; + errno = 0; + if (ioctl (fd, SIOCETHTOOL, &req) < 0) { + nm_log_err (LOGD_HW | LOGD_ETHER, "SIOCETHTOOL failed: %d; unable to get permanent MAC address for %s", + errno, nm_device_get_iface (dev)); + + nm_log_warn (LOGD_HW | LOGD_ETHER, "Using current address as permanent address for %s", + nm_device_get_iface (dev)); + memcpy (&priv->perm_hw_addr, &priv->hw_addr, sizeof (struct ether_addr)); + g_object_notify (G_OBJECT (dev), NM_DEVICE_WIFI_PERMANENT_HW_ADDRESS); + + goto out; + } + + if (memcmp (&priv->perm_hw_addr, epaddr->data, sizeof (struct ether_addr))) { + memcpy (&priv->perm_hw_addr, epaddr->data, sizeof (struct ether_addr)); + g_object_notify (G_OBJECT (dev), NM_DEVICE_WIFI_PERMANENT_HW_ADDRESS); + } + +out: + g_free (epaddr); + close (fd); +} + static NMActStageReturn real_act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason) @@ -2958,8 +3045,38 @@ real_act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason) NMAccessPoint *ap = NULL; NMActRequest *req; NMConnection *connection; + NMSettingWireless *s_wireless; + const GByteArray *cloned_mac; GSList *iter; + req = nm_device_get_act_request (NM_DEVICE (self)); + g_return_val_if_fail (req != NULL, NM_ACT_STAGE_RETURN_FAILURE); + + connection = nm_act_request_get_connection (req); + g_return_val_if_fail (connection != NULL, NM_ACT_STAGE_RETURN_FAILURE); + + /* Set spoof MAC to the interface */ + s_wireless = (NMSettingWireless *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS); + g_assert (s_wireless); + + cloned_mac = nm_setting_wireless_get_cloned_mac_address (s_wireless); + if (cloned_mac) { + char *mac_str = NULL; + + mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", cloned_mac->data[0], cloned_mac->data[1], cloned_mac->data[2], + cloned_mac->data[3], cloned_mac->data[4], cloned_mac->data[5]); + real_hw_take_down (dev); + if (nm_system_device_set_mac (nm_device_get_iface (dev), (struct ether_addr *) cloned_mac->data)) { + /* MAC address succesfully spoofed on interface, set it to hw_addr too */ + memcpy (priv->hw_addr.ether_addr_octet, cloned_mac->data, ETH_ALEN); + nm_log_info (LOGD_DEVICE | LOGD_ETHER, "cloned MAC %s set to %s", mac_str, nm_device_get_iface (dev)); + } else { + nm_log_warn (LOGD_DEVICE | LOGD_ETHER, "failed to set cloned MAC %s to %s", mac_str, nm_device_get_iface (dev)); + } + real_hw_bring_up (dev, NULL); + g_free (mac_str); + } + /* If the user is trying to connect to an AP that NM doesn't yet know about * (hidden network or something), create an fake AP from the security * settings in the connection to use until the AP is recognized from the @@ -2969,12 +3086,6 @@ real_act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason) if (ap) goto done; - req = nm_device_get_act_request (NM_DEVICE (self)); - g_return_val_if_fail (req != NULL, NM_ACT_STAGE_RETURN_FAILURE); - - connection = nm_act_request_get_connection (req); - g_return_val_if_fail (connection != NULL, NM_ACT_STAGE_RETURN_FAILURE); - /* Find a compatible AP in the scan list */ for (iter = priv->ap_list; iter; iter = g_slist_next (iter)) { NMAccessPoint *candidate = NM_AP (iter->data); @@ -3430,7 +3541,7 @@ spec_match_list (NMDevice *device, const GSList *specs) char *hwaddr; gboolean matched; - nm_device_wifi_get_address (NM_DEVICE_WIFI (device), ðer); + nm_device_wifi_get_permanent_address (NM_DEVICE_WIFI (device), ðer); hwaddr = nm_ether_ntop (ðer); matched = nm_match_spec_hwaddr (specs, hwaddr); g_free (hwaddr); @@ -3696,6 +3807,10 @@ get_property (GObject *object, guint prop_id, nm_device_wifi_get_address (device, &hw_addr); g_value_take_string (value, nm_ether_ntop (&hw_addr)); break; + case PROP_PERM_HW_ADDRESS: + nm_device_wifi_get_permanent_address (device, &hw_addr); + g_value_take_string (value, nm_ether_ntop (&hw_addr)); + break; case PROP_MODE: g_value_set_uint (value, nm_device_wifi_get_mode (device)); break; @@ -3763,6 +3878,7 @@ nm_device_wifi_class_init (NMDeviceWifiClass *klass) parent_class->bring_up = real_bring_up; parent_class->take_down = real_take_down; parent_class->update_hw_address = real_update_hw_address; + parent_class->obtain_permanent_hw_address = real_obtain_permanent_hw_address; parent_class->get_best_auto_connection = real_get_best_auto_connection; parent_class->is_available = real_is_available; parent_class->connection_secrets_updated = real_connection_secrets_updated; @@ -3783,8 +3899,15 @@ nm_device_wifi_class_init (NMDeviceWifiClass *klass) /* Properties */ g_object_class_install_property (object_class, PROP_HW_ADDRESS, g_param_spec_string (NM_DEVICE_WIFI_HW_ADDRESS, - "MAC Address", - "Hardware MAC address", + "Active MAC Address", + "Currently set hardware MAC address", + NULL, + G_PARAM_READABLE)); + + g_object_class_install_property (object_class, PROP_PERM_HW_ADDRESS, + g_param_spec_string (NM_DEVICE_WIFI_PERMANENT_HW_ADDRESS, + "Permanent MAC Address", + "Permanent hardware MAC address", NULL, G_PARAM_READABLE)); diff --git a/src/nm-device-wifi.h b/src/nm-device-wifi.h index 11ac885735..d8b8522858 100644 --- a/src/nm-device-wifi.h +++ b/src/nm-device-wifi.h @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2005 - 2008 Red Hat, Inc. + * Copyright (C) 2005 - 2010 Red Hat, Inc. * Copyright (C) 2006 - 2008 Novell, Inc. */ @@ -43,6 +43,7 @@ G_BEGIN_DECLS #define NM_DEVICE_WIFI_HW_ADDRESS "hw-address" +#define NM_DEVICE_WIFI_PERMANENT_HW_ADDRESS "perm-hw-address" #define NM_DEVICE_WIFI_MODE "mode" #define NM_DEVICE_WIFI_BITRATE "bitrate" #define NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT "active-access-point" @@ -85,18 +86,17 @@ NMDevice *nm_device_wifi_new (const char *udi, const char *iface, const char *driver); -void nm_device_wifi_get_address (NMDeviceWifi *dev, - struct ether_addr *addr); +void nm_device_wifi_get_address (NMDeviceWifi *dev, struct ether_addr *addr); -void nm_device_wifi_get_bssid (NMDeviceWifi *dev, - struct ether_addr *bssid); +void nm_device_wifi_get_permanent_address (NMDeviceWifi *dev, struct ether_addr *addr); -const GByteArray * nm_device_wifi_get_ssid (NMDeviceWifi *self); +void nm_device_wifi_get_bssid (NMDeviceWifi *dev, struct ether_addr *bssid); -gboolean nm_device_wifi_set_mode (NMDeviceWifi *self, - const NM80211Mode mode); +const GByteArray * nm_device_wifi_get_ssid (NMDeviceWifi *self); -NM80211Mode nm_device_wifi_get_mode (NMDeviceWifi *self); +gboolean nm_device_wifi_set_mode (NMDeviceWifi *self, const NM80211Mode mode); + +NM80211Mode nm_device_wifi_get_mode (NMDeviceWifi *self); NMAccessPoint * nm_device_wifi_get_activation_ap (NMDeviceWifi *self); diff --git a/src/nm-device.c b/src/nm-device.c index 01874c5fde..9981f9b44c 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -283,6 +283,9 @@ constructor (GType type, if (NM_DEVICE_GET_CLASS (dev)->update_hw_address) NM_DEVICE_GET_CLASS (dev)->update_hw_address (dev); + if (NM_DEVICE_GET_CLASS (dev)->obtain_permanent_hw_address) + NM_DEVICE_GET_CLASS (dev)->obtain_permanent_hw_address (dev); + priv->dhcp_manager = nm_dhcp_manager_get (); update_accept_ra_save (dev); diff --git a/src/nm-device.h b/src/nm-device.h index 202f392413..a2e0749598 100644 --- a/src/nm-device.h +++ b/src/nm-device.h @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2005 - 2008 Red Hat, Inc. + * Copyright (C) 2005 - 2010 Red Hat, Inc. * Copyright (C) 2006 - 2008 Novell, Inc. */ @@ -72,6 +72,7 @@ typedef struct { void (*take_down) (NMDevice *self); void (* update_hw_address) (NMDevice *self); + void (* obtain_permanent_hw_address) (NMDevice *self); guint32 (* get_type_capabilities) (NMDevice *self); guint32 (* get_generic_capabilities) (NMDevice *self); diff --git a/src/nm-system.c b/src/nm-system.c index 35aa36a111..3e490933f3 100644 --- a/src/nm-system.c +++ b/src/nm-system.c @@ -772,6 +772,48 @@ nm_system_device_set_mtu (const char *iface, guint32 mtu) return success; } +gboolean +nm_system_device_set_mac (const char *iface, const struct ether_addr *mac) +{ + struct rtnl_link *old; + struct rtnl_link *new; + gboolean success = FALSE; + struct nl_handle *nlh; + int iface_idx; + struct nl_addr *addr = NULL; + + g_return_val_if_fail (iface != NULL, FALSE); + g_return_val_if_fail (mac != NULL, FALSE); + + new = rtnl_link_alloc (); + if (!new) + return FALSE; + + iface_idx = nm_netlink_iface_to_index (iface); + old = nm_netlink_index_to_rtnl_link (iface_idx); + if (old) { + addr = nl_addr_build (AF_LLC, (void *) mac, ETH_ALEN); + if (!addr) { + char *mac_str; + mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", mac->ether_addr_octet[0], mac->ether_addr_octet[1], mac->ether_addr_octet[2], + mac->ether_addr_octet[3], mac->ether_addr_octet[4], mac->ether_addr_octet[5]); + nm_log_err (LOGD_DEVICE, "(%s): could not allocate memory for MAC address (%s)", iface, mac_str); + g_free (mac_str); + return FALSE; + } + rtnl_link_set_addr (new, addr); + nlh = nm_netlink_get_default_handle (); + if (nlh) { + rtnl_link_change (nlh, old, new, 0); + success = TRUE; + } + rtnl_link_put (old); + } + + rtnl_link_put (new); + return success; +} + static struct rtnl_route * add_ip4_route_to_gateway (const char *iface, guint32 gw, guint32 mss) { diff --git a/src/nm-system.h b/src/nm-system.h index 2eee01417d..29455cb4bf 100644 --- a/src/nm-system.h +++ b/src/nm-system.h @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2004 - 2008 Red Hat, Inc. + * Copyright (C) 2004 - 2010 Red Hat, Inc. * Copyright (C) 2005 - 2008 Novell, Inc. */ @@ -25,6 +25,8 @@ #include #include +#include + #include #include "nm-device.h" #include "nm-ip4-config.h" @@ -80,5 +82,6 @@ gboolean nm_system_device_is_up (NMDevice *device); gboolean nm_system_device_is_up_with_iface (const char *iface); gboolean nm_system_device_set_mtu (const char *iface, guint32 mtu); +gboolean nm_system_device_set_mac (const char *iface, const struct ether_addr *mac); #endif diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index 1c7e8eb6c7..01ac32d8ae 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -185,7 +185,7 @@ make_connection_setting (const char *file, } static gboolean -read_mac_address (shvarFile *ifcfg, GByteArray **array, GError **error) +read_mac_address (shvarFile *ifcfg, const char *key, GByteArray **array, GError **error) { char *value = NULL; struct ether_addr *mac; @@ -196,7 +196,7 @@ read_mac_address (shvarFile *ifcfg, GByteArray **array, GError **error) g_return_val_if_fail (error != NULL, FALSE); g_return_val_if_fail (*error == NULL, FALSE); - value = svGetValue (ifcfg, "HWADDR", FALSE); + value = svGetValue (ifcfg, key, FALSE); if (!value || !strlen (value)) { g_free (value); return TRUE; @@ -206,7 +206,7 @@ read_mac_address (shvarFile *ifcfg, GByteArray **array, GError **error) if (!mac) { g_free (value); g_set_error (error, ifcfg_plugin_error_quark (), 0, - "The MAC address '%s' was invalid.", value); + "%s: the MAC address '%s' was invalid.", key, value); return FALSE; } @@ -294,7 +294,7 @@ fill_ip4_setting_from_ibft (shvarFile *ifcfg, goto done; } - if (!read_mac_address (ifcfg, &ifcfg_mac, error)) + if (!read_mac_address (ifcfg, "HWADDR", &ifcfg_mac, error)) goto done; /* Ensure we got a MAC */ if (!ifcfg_mac) { @@ -2655,7 +2655,7 @@ make_wireless_setting (shvarFile *ifcfg, s_wireless = NM_SETTING_WIRELESS (nm_setting_wireless_new ()); - if (read_mac_address (ifcfg, &array, error)) { + if (read_mac_address (ifcfg, "HWADDR", &array, error)) { if (array) { g_object_set (s_wireless, NM_SETTING_WIRELESS_MAC_ADDRESS, array, NULL); @@ -2678,6 +2678,14 @@ make_wireless_setting (shvarFile *ifcfg, return NULL; } + array = NULL; + if (read_mac_address (ifcfg, "MACADDR", &array, error)) { + if (array) { + g_object_set (s_wireless, NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS, array, NULL); + g_byte_array_free (array, TRUE); + } + } + value = svGetValue (ifcfg, "ESSID", TRUE); if (value) { gsize ssid_len = 0, value_len = strlen (value); @@ -2945,7 +2953,7 @@ make_wired_setting (shvarFile *ifcfg, g_free (value); } - if (read_mac_address (ifcfg, &mac, error)) { + if (read_mac_address (ifcfg, "HWADDR", &mac, error)) { if (mac) { g_object_set (s_wired, NM_SETTING_WIRED_MAC_ADDRESS, mac, NULL); @@ -2968,6 +2976,14 @@ make_wired_setting (shvarFile *ifcfg, s_wired = NULL; } + mac = NULL; + if (read_mac_address (ifcfg, "MACADDR", &mac, error)) { + if (mac) { + g_object_set (s_wired, NM_SETTING_WIRED_CLONED_MAC_ADDRESS, mac, NULL); + g_byte_array_free (mac, TRUE); + } + } + value = svGetValue (ifcfg, "KEY_MGMT", FALSE); if (value) { if (!strcmp (value, "IEEE8021X")) { diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c index 2d206c7354..dd75193e91 100644 --- a/system-settings/plugins/ifcfg-rh/writer.c +++ b/system-settings/plugins/ifcfg-rh/writer.c @@ -704,7 +704,7 @@ write_wireless_setting (NMConnection *connection, { NMSettingWireless *s_wireless; char *tmp, *tmp2; - const GByteArray *ssid, *mac, *bssid; + const GByteArray *ssid, *device_mac, *cloned_mac, *bssid; const char *mode; char buf[33]; guint32 mtu, chan, i; @@ -718,15 +718,25 @@ write_wireless_setting (NMConnection *connection, } svSetValue (ifcfg, "HWADDR", NULL, FALSE); - mac = nm_setting_wireless_get_mac_address (s_wireless); - if (mac) { + device_mac = nm_setting_wireless_get_mac_address (s_wireless); + if (device_mac) { tmp = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", - mac->data[0], mac->data[1], mac->data[2], - mac->data[3], mac->data[4], mac->data[5]); + device_mac->data[0], device_mac->data[1], device_mac->data[2], + device_mac->data[3], device_mac->data[4], device_mac->data[5]); svSetValue (ifcfg, "HWADDR", tmp, FALSE); g_free (tmp); } + svSetValue (ifcfg, "MACADDR", NULL, FALSE); + cloned_mac = nm_setting_wireless_get_cloned_mac_address (s_wireless); + if (cloned_mac) { + tmp = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", + cloned_mac->data[0], cloned_mac->data[1], cloned_mac->data[2], + cloned_mac->data[3], cloned_mac->data[4], cloned_mac->data[5]); + svSetValue (ifcfg, "MACADDR", tmp, FALSE); + g_free (tmp); + } + svSetValue (ifcfg, "MTU", NULL, FALSE); mtu = nm_setting_wireless_get_mtu (s_wireless); if (mtu) { @@ -823,7 +833,7 @@ static gboolean write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) { NMSettingWired *s_wired; - const GByteArray *mac; + const GByteArray *device_mac, *cloned_mac; char *tmp; guint32 mtu; @@ -834,15 +844,24 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) return FALSE; } - mac = nm_setting_wired_get_mac_address (s_wired); - if (mac) { + device_mac = nm_setting_wired_get_mac_address (s_wired); + if (device_mac) { tmp = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", - mac->data[0], mac->data[1], mac->data[2], - mac->data[3], mac->data[4], mac->data[5]); + device_mac->data[0], device_mac->data[1], device_mac->data[2], + device_mac->data[3], device_mac->data[4], device_mac->data[5]); svSetValue (ifcfg, "HWADDR", tmp, FALSE); g_free (tmp); } + cloned_mac = nm_setting_wired_get_cloned_mac_address (s_wired); + if (cloned_mac) { + tmp = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", + cloned_mac->data[0], cloned_mac->data[1], cloned_mac->data[2], + cloned_mac->data[3], cloned_mac->data[4], cloned_mac->data[5]); + svSetValue (ifcfg, "MACADDR", tmp, FALSE); + g_free (tmp); + } + svSetValue (ifcfg, "MTU", NULL, FALSE); mtu = nm_setting_wired_get_mtu (s_wired); if (mtu) { diff --git a/system-settings/plugins/keyfile/io/reader.c b/system-settings/plugins/keyfile/io/reader.c index 5582733f66..50c3efe850 100644 --- a/system-settings/plugins/keyfile/io/reader.c +++ b/system-settings/plugins/keyfile/io/reader.c @@ -773,10 +773,18 @@ static KeyParser key_parsers[] = { NM_SETTING_WIRED_MAC_ADDRESS, TRUE, mac_address_parser }, + { NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_CLONED_MAC_ADDRESS, + TRUE, + mac_address_parser }, { NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_MAC_ADDRESS, TRUE, mac_address_parser }, + { NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS, + TRUE, + mac_address_parser }, { NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_BSSID, TRUE, diff --git a/system-settings/plugins/keyfile/io/writer.c b/system-settings/plugins/keyfile/io/writer.c index 348fa515f4..7bba71e685 100644 --- a/system-settings/plugins/keyfile/io/writer.c +++ b/system-settings/plugins/keyfile/io/writer.c @@ -488,9 +488,15 @@ static KeyWriter key_writers[] = { { NM_SETTING_WIRED_SETTING_NAME, NM_SETTING_WIRED_MAC_ADDRESS, mac_address_writer }, + { NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_CLONED_MAC_ADDRESS, + mac_address_writer }, { NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_MAC_ADDRESS, mac_address_writer }, + { NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS, + mac_address_writer }, { NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_BSSID, mac_address_writer }, -- cgit v1.2.1 From 3ec6ffe85fae4f8c184e567c9de1a37db903aee0 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 22 Jun 2010 10:26:13 -0700 Subject: core: remove debugging delay from new user connection handling Introduced by 25e758c77041bec8014a4f28333dd9ccd559487e when ensuring that the code that waits for connections to become advertised by teh user settings service worked correctly. --- src/nm-manager.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 31628f8766..1e94f01285 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -1190,33 +1190,10 @@ user_proxy_destroyed_cb (DBusGProxy *proxy, NMManager *self) user_proxy_cleanup (self, TRUE); } -typedef struct { - DBusGProxy *proxy; - char *path; - NMManager *manager; -} Foo; - -static gboolean -blah (gpointer user_data) -{ - Foo *f = user_data; - - user_internal_new_connection_cb (f->proxy, f->path, f->manager, NULL); - g_free (f->path); - g_free (f); - return FALSE; -} - static void user_new_connection_cb (DBusGProxy *proxy, const char *path, gpointer user_data) { - Foo *f = g_malloc0 (sizeof (Foo)); - - f->proxy = proxy; - f->path = g_strdup (path); - f->manager = NM_MANAGER (user_data); - - g_timeout_add_seconds (6, blah, f); + user_internal_new_connection_cb (proxy, path, NM_MANAGER (user_data), NULL); } static gboolean -- cgit v1.2.1 From b880cbe829270627cc6f20933c195d675feba283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 23 Jun 2010 10:53:44 +0200 Subject: trivial: fix a typo in nm-tool --- test/nm-tool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/nm-tool.c b/test/nm-tool.c index 9d1a245718..9a1a0ba61b 100644 --- a/test/nm-tool.c +++ b/test/nm-tool.c @@ -16,7 +16,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * (C) Copyright 2005 - 2009 Red Hat, Inc. + * (C) Copyright 2005 - 2010 Red Hat, Inc. * (C) Copyright 2007 Novell, Inc. */ @@ -481,7 +481,7 @@ detail_vpn (gpointer data, gpointer user_data) g_return_if_fail (connection != NULL); s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); - g_return_if_fail (connection != NULL); + g_return_if_fail (s_con != NULL); print_header ("VPN", NULL, nm_setting_connection_get_id (s_con)); -- cgit v1.2.1 From 759bf7946669a70d42c7d8a5f8f56f661ccfb45f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 23 Jun 2010 11:59:46 -0700 Subject: dns: include domain part of hostname in resolv.conf 'searches' (rh #600407) Add the current domain name (from the hostname) to the searches list. The bug report is that when the hostname is set to something like 'dcbw.foobar.com' (ie an FQDN) that pinging 'dcbw' doesn't work because the resolver doesn't have anything to append to 'dcbw' when looking it up. --- src/named-manager/nm-named-manager.c | 62 ++++++++++++++++++++++++++++++++++++ src/named-manager/nm-named-manager.h | 5 ++- src/nm-policy.c | 6 ++++ 3 files changed, 72 insertions(+), 1 deletion(-) diff --git a/src/named-manager/nm-named-manager.c b/src/named-manager/nm-named-manager.c index fc3b6e2c17..dc1a6c1db6 100644 --- a/src/named-manager/nm-named-manager.c +++ b/src/named-manager/nm-named-manager.c @@ -66,6 +66,13 @@ struct NMNamedManagerPrivate { NMIP6Config *ip6_vpn_config; NMIP6Config *ip6_device_config; GSList *configs; + char *hostname; + + /* This is a hack because SUSE's netconfig always wants changes + * associated with a network interface, but sometimes a change isn't + * associated with a network interface (like hostnames). + */ + char *last_iface; }; @@ -512,6 +519,11 @@ rewrite_resolv_conf (NMNamedManager *mgr, const char *iface, GError **error) priv = NM_NAMED_MANAGER_GET_PRIVATE (mgr); + if (iface) { + g_free (priv->last_iface); + priv->last_iface = g_strdup (iface); + } + rc.nameservers = g_ptr_array_new (); rc.domain = NULL; rc.searches = g_ptr_array_new (); @@ -545,6 +557,20 @@ rewrite_resolv_conf (NMNamedManager *mgr, const char *iface, GError **error) g_assert_not_reached (); } + /* Add the current domain name (from the hostname) to the searches list; + * see rh #600407. The bug report is that when the hostname is set to + * something like 'dcbw.foobar.com' (ie an FQDN) that pinging 'dcbw' doesn't + * work because the resolver doesn't have anything to append to 'dcbw' when + * looking it up. + */ + if (priv->hostname) { + const char *hostsearch = strchr (priv->hostname, '.'); + + /* +1 to get rid of the dot */ + if (hostsearch && strlen (hostsearch + 1)) + add_string_item (rc.searches, hostsearch + 1); + } + domain = rc.domain; /* Per 'man resolv.conf', the search list is limited to 6 domains @@ -742,6 +768,40 @@ nm_named_manager_remove_ip6_config (NMNamedManager *mgr, return TRUE; } +void +nm_named_manager_set_hostname (NMNamedManager *mgr, + const char *hostname) +{ + NMNamedManagerPrivate *priv = NM_NAMED_MANAGER_GET_PRIVATE (mgr); + GError *error = NULL; + const char *filtered = NULL; + + /* Certain hostnames we don't want to include in resolv.conf 'searches' */ + if ( hostname + && strcmp (hostname, "localhost.localdomain") + && strcmp (hostname, "localhost6.localdomain6") + && !strstr (hostname, ".in-addr.arpa") + && strchr (hostname, '.')) { + filtered = hostname; + } + + if ( (!priv->hostname && !filtered) + || (priv->hostname && filtered && !strcmp (priv->hostname, filtered))) + return; + + g_free (priv->hostname); + priv->hostname = g_strdup (filtered); + + /* Passing the last interface here is completely bogus, but SUSE's netconfig + * wants one. But hostname changes are system-wide and *not* tied to a + * specific interface, so netconfig can't really handle this. Fake it. + */ + if (!rewrite_resolv_conf (mgr, priv->last_iface, &error)) { + nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); + g_clear_error (&error); + } +} + static void nm_named_manager_init (NMNamedManager *mgr) @@ -755,6 +815,8 @@ nm_named_manager_finalize (GObject *object) g_slist_foreach (priv->configs, (GFunc) g_object_unref, NULL); g_slist_free (priv->configs); + g_free (priv->hostname); + g_free (priv->last_iface); G_OBJECT_CLASS (nm_named_manager_parent_class)->finalize (object); } diff --git a/src/named-manager/nm-named-manager.h b/src/named-manager/nm-named-manager.h index 47c8e7115d..27d5bc259d 100644 --- a/src/named-manager/nm-named-manager.h +++ b/src/named-manager/nm-named-manager.h @@ -16,7 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Copyright (C) 2004 - 2005 Colin Walters - * Copyright (C) 2004 - 2008 Red Hat, Inc. + * Copyright (C) 2004 - 2010 Red Hat, Inc. * Copyright (C) 2005 - 2008 Novell, Inc. * and others */ @@ -87,6 +87,9 @@ gboolean nm_named_manager_remove_ip6_config (NMNamedManager *mgr, const char *iface, NMIP6Config *config); +void nm_named_manager_set_hostname (NMNamedManager *mgr, + const char *hostname); + G_END_DECLS #endif /* __NM_NAMED_MANAGER_H__ */ diff --git a/src/nm-policy.c b/src/nm-policy.c index 352be12dc1..833a58764c 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -235,8 +235,14 @@ _set_hostname (NMPolicy *policy, char ip6_addr[INET6_ADDRSTRLEN + 1]; if (change_hostname) { + NMNamedManager *named_mgr; + g_free (policy->cur_hostname); policy->cur_hostname = g_strdup (new_hostname); + + named_mgr = nm_named_manager_get (); + nm_named_manager_set_hostname (named_mgr, policy->cur_hostname); + g_object_unref (named_mgr); } /* Get the default IPv4 and IPv6 addresses so we can assign -- cgit v1.2.1 From 138876b4b1c23d320e5a82c870d859bed70382d3 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 23 Jun 2010 13:24:12 -0700 Subject: policy: add public address mappings before localhost ones Otherwise glibc will count the localhost IPv6 (::1) mapping as resolving to the IPv4 localhost mapping as well, so this: 127.0.0.1 localhost.localdomain localhost ::1 foobar localhost6.localdomain6 localhost6 192.168.1.2 fooar causes a lookup of 'foobar' (or even just 'ping foobar') to resolve to 127.0.0.1, even though the hostname is *not* listed on the IPv4 localhost line. Apparently glibc just looks for the hostname on any IPv4 or IPv6 localhost line. We need to ensure that even if you don't have a routable IP address for one of [IPv4, IPv6] that the hostname resolves to the localhost address for that IP version, otherwise lots of stuff starts breaking. But for the IP versions that you do have a routable IP address, we want the hostname to map to that IP address too. --- src/nm-policy-hosts.c | 45 +++++++++++++++++++++++++++++-------------- src/tests/test-policy-hosts.c | 12 ++++++------ 2 files changed, 37 insertions(+), 20 deletions(-) diff --git a/src/nm-policy-hosts.c b/src/nm-policy-hosts.c index 8e6d151963..138b0fecd3 100644 --- a/src/nm-policy-hosts.c +++ b/src/nm-policy-hosts.c @@ -131,6 +131,8 @@ nm_policy_get_etc_hosts (const char **lines, gboolean added = FALSE; gboolean hostname4_is_fallback; gboolean hostname6_is_fallback; + gboolean host4_before = FALSE; + gboolean host6_before = FALSE; g_return_val_if_fail (lines != NULL, FALSE); g_return_val_if_fail (hostname != NULL, FALSE); @@ -148,10 +150,14 @@ nm_policy_get_etc_hosts (const char **lines, * If all these things exist we don't need to bother updating the file. */ - if (!ip4_addr) + if (!ip4_addr) { found_host4 = TRUE; - if (!ip6_addr) + host4_before = TRUE; + } + if (!ip6_addr) { found_host6 = TRUE; + host6_before = TRUE; + } /* Look for the four cases from above */ for (line = lines; lines && *line; line++) { @@ -162,13 +168,23 @@ nm_policy_get_etc_hosts (const char **lines, /* Found the current hostname on this line */ if (ip4_addr && ip4_addr_matches (*line, ip4_addr)) { found_host4 = TRUE; - if (!strstr (*line, ADDED_TAG)) + if (strstr (*line, ADDED_TAG)) { + if (!host4_before) + host4_before = !found_localhost4; + } else { found_user_host4 = TRUE; + host4_before = TRUE; /* Ignore if user added mapping manually */ + } } if (ip6_addr && ip6_addr_matches (*line, ip6_addr)) { found_host6 = TRUE; - if (!strstr (*line, ADDED_TAG)) + if (strstr (*line, ADDED_TAG)) { + if (!host6_before) + host6_before = !found_localhost6; + } else { found_user_host6 = TRUE; + host6_before = TRUE; /* Ignore if user added mapping manually */ + } } } @@ -180,7 +196,7 @@ nm_policy_get_etc_hosts (const char **lines, found_localhost6 = TRUE; } - if (found_localhost4 && found_host4 && found_localhost6 && found_host6) + if (found_localhost4 && found_host4 && found_localhost6 && found_host6 && host4_before && host6_before) return NULL; /* No update required */ } @@ -212,6 +228,12 @@ nm_policy_get_etc_hosts (const char **lines, * mapping line to make sure it's mapped to something. */ + /* Add the address mappings first so they take precedence */ + if (!hostname4_is_fallback && ip4_addr && !found_user_host4) + g_string_append_printf (contents, "%s\t%s\t%s\n", ip4_addr, hostname, ADDED_TAG); + if (!hostname6_is_fallback && ip6_addr && !found_user_host6) + g_string_append_printf (contents, "%s\t%s\t%s\n", ip6_addr, hostname, ADDED_TAG); + /* IPv4 localhost line */ g_string_append (contents, "127.0.0.1"); if (!hostname4_is_fallback && !ip4_addr && !found_user_host4) @@ -224,12 +246,6 @@ nm_policy_get_etc_hosts (const char **lines, g_string_append_printf (contents, "\t%s", hostname); g_string_append_printf (contents, "\t%s\tlocalhost6\n", fallback_hostname6); - /* Add the address mappings */ - if (!hostname4_is_fallback && ip4_addr && !found_user_host4) - g_string_append_printf (contents, "%s\t%s\t%s\n", ip4_addr, hostname, ADDED_TAG); - if (!hostname6_is_fallback && ip6_addr && !found_user_host6) - g_string_append_printf (contents, "%s\t%s\t%s\n", ip6_addr, hostname, ADDED_TAG); - added = TRUE; } @@ -259,14 +275,15 @@ nm_policy_get_etc_hosts (const char **lines, if (!added) { g_string_append (contents, "# Do not remove the following lines, or various programs\n"); g_string_append (contents, "# that require network functionality will fail.\n"); - g_string_append_printf (contents, "127.0.0.1\t%s\tlocalhost\n", fallback_hostname4); - g_string_append_printf (contents, "::1\t%s\tlocalhost6\n", fallback_hostname6); - /* Add the address mappings */ + /* Add the address mappings first so they take precedence */ if (!hostname4_is_fallback && ip4_addr) g_string_append_printf (contents, "%s\t%s\t%s\n", ip4_addr, hostname, ADDED_TAG); if (!hostname6_is_fallback && ip6_addr) g_string_append_printf (contents, "%s\t%s\t%s\n", ip6_addr, hostname, ADDED_TAG); + + g_string_append_printf (contents, "127.0.0.1\t%s\tlocalhost\n", fallback_hostname4); + g_string_append_printf (contents, "::1\t%s\tlocalhost6\n", fallback_hostname6); } return contents; diff --git a/src/tests/test-policy-hosts.c b/src/tests/test-policy-hosts.c index 69a061e8e7..e3401fe6b4 100644 --- a/src/tests/test-policy-hosts.c +++ b/src/tests/test-policy-hosts.c @@ -388,9 +388,9 @@ static const char *named46_non127_other4_before = \ static const char *named46_non127_other4_after = \ "# Do not remove the following line, or various programs\n" "# that require network functionality will fail.\n" + "192.168.1.2 comet # Added by NetworkManager\n" "127.0.0.1 localhost.localdomain localhost\n" "::1 localhost6.localdomain6 localhost6\n" - "192.168.1.2 comet # Added by NetworkManager\n" "192.168.1.3 comet\n" "3001:abba::3234 comet\n" "\n" @@ -417,9 +417,9 @@ static const char *named46_non127_other6_before = \ static const char *named46_non127_other6_after = \ "# Do not remove the following line, or various programs\n" "# that require network functionality will fail.\n" + "3001:abba::3234 comet # Added by NetworkManager\n" "127.0.0.1 localhost.localdomain localhost\n" "::1 localhost6.localdomain6 localhost6\n" - "3001:abba::3234 comet # Added by NetworkManager\n" "192.168.1.2 comet\n" "3001:abba::9675 comet\n" "\n" @@ -444,10 +444,10 @@ static const char *unnamed46_non127_before = \ static const char *unnamed46_non127_after = \ "# Do not remove the following line, or various programs\n" "# that require network functionality will fail.\n" - "127.0.0.1 localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n" "192.168.1.2 comet # Added by NetworkManager\n" "3001:abba::3234 comet # Added by NetworkManager\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" "\n" "127.0.0.1 lcmd.us.intellitxt.com\n"; @@ -472,10 +472,10 @@ static const char *named46_non127_wrong_before = \ static const char *named46_non127_wrong_after = \ "# Do not remove the following line, or various programs\n" "# that require network functionality will fail.\n" - "127.0.0.1 localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n" "192.168.1.2 comet # Added by NetworkManager\n" "3001:abba::3234 comet # Added by NetworkManager\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" "\n" "127.0.0.1 lcmd.us.intellitxt.com\n"; -- cgit v1.2.1 From dc02eee6524629c0b58457c4a8114d4ca4255b2c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 23 Jun 2010 14:17:52 -0700 Subject: vpn: ensure the IP interface passed to the dispatcher is the tunnel iface priv->ip_iface gets destroyed in vpn_cleanup() when the class signal handler handles FAILED/DISCONNECTED, but the dispatcher is only called *after* that, so it gets a NULL ip_iface. Fix that so that the dispatcher always gets the tunnel interface for vpn-up and vpn-down. --- src/vpn-manager/nm-vpn-connection.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c index eee181ef01..16fa64d007 100644 --- a/src/vpn-manager/nm-vpn-connection.c +++ b/src/vpn-manager/nm-vpn-connection.c @@ -119,6 +119,7 @@ nm_vpn_connection_set_vpn_state (NMVPNConnection *connection, NMVPNConnectionPrivate *priv; NMActiveConnectionState new_ac_state; NMVPNConnectionState old_vpn_state; + char *ip_iface; g_return_if_fail (NM_IS_VPN_CONNECTION (connection)); @@ -130,6 +131,11 @@ nm_vpn_connection_set_vpn_state (NMVPNConnection *connection, old_vpn_state = priv->vpn_state; priv->vpn_state = vpn_state; + /* Save ip_iface since when the VPN goes down it may get freed + * before we're done with it. + */ + ip_iface = g_strdup (priv->ip_iface); + /* Set the NMActiveConnection state based on VPN state */ switch (vpn_state) { case NM_VPN_CONNECTION_STATE_PREPARE: @@ -166,7 +172,7 @@ nm_vpn_connection_set_vpn_state (NMVPNConnection *connection, nm_utils_call_dispatcher ("vpn-up", priv->connection, priv->parent_dev, - priv->ip_iface); + ip_iface); break; case NM_VPN_CONNECTION_STATE_FAILED: case NM_VPN_CONNECTION_STATE_DISCONNECTED: @@ -174,13 +180,14 @@ nm_vpn_connection_set_vpn_state (NMVPNConnection *connection, nm_utils_call_dispatcher ("vpn-down", priv->connection, priv->parent_dev, - priv->ip_iface); + ip_iface); } break; default: break; } + g_free (ip_iface); g_object_unref (connection); } -- cgit v1.2.1 From 66319f616caa9c716d3226832f45435f689b9911 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 24 Jun 2010 11:59:40 -0700 Subject: libnm-util: add more necessary s390 properties --- libnm-util/libnm-util.ver | 4 ++ libnm-util/nm-setting-wired.c | 147 ++++++++++++++++++++++++++++++++++++++++++ libnm-util/nm-setting-wired.h | 8 +++ 3 files changed, 159 insertions(+) diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver index 508ac6de4e..000542ca8d 100644 --- a/libnm-util/libnm-util.ver +++ b/libnm-util/libnm-util.ver @@ -290,6 +290,10 @@ global: nm_setting_wired_get_mac_address; nm_setting_wired_get_mtu; nm_setting_wired_get_s390_subchannels; + nm_setting_wired_get_s390_port_name; + nm_setting_wired_get_s390_port_number; + nm_setting_wired_get_s390_qeth_layer; + nm_setting_wired_get_s390_nettype; nm_setting_wireless_ap_security_compatible; nm_setting_wireless_error_get_type; nm_setting_wireless_error_quark; diff --git a/libnm-util/nm-setting-wired.c b/libnm-util/nm-setting-wired.c index 8d562cd59d..4b163199a3 100644 --- a/libnm-util/nm-setting-wired.c +++ b/libnm-util/nm-setting-wired.c @@ -23,6 +23,7 @@ * (C) Copyright 2007 - 2008 Novell, Inc. */ +#include #include #include #include "nm-setting-wired.h" @@ -77,6 +78,10 @@ typedef struct { GByteArray *mac_address; guint32 mtu; GPtrArray *s390_subchannels; + char *s390_port_name; + guint32 s390_port_number; + guint32 s390_qeth_layer; + char *s390_nettype; } NMSettingWiredPrivate; enum { @@ -88,6 +93,10 @@ enum { PROP_MAC_ADDRESS, PROP_MTU, PROP_S390_SUBCHANNELS, + PROP_S390_PORT_NAME, + PROP_S390_PORT_NUMBER, + PROP_S390_QETH_LAYER, + PROP_S390_NETTYPE, LAST_PROP }; @@ -154,6 +163,38 @@ nm_setting_wired_get_s390_subchannels (NMSettingWired *setting) return NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_subchannels; } +const char * +nm_setting_wired_get_s390_port_name (NMSettingWired *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), NULL); + + return NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_port_name; +} + +guint32 +nm_setting_wired_get_s390_port_number (NMSettingWired *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), 0); + + return NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_port_number; +} + +guint32 +nm_setting_wired_get_s390_qeth_layer (NMSettingWired *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), 2); + + return NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_qeth_layer; +} + +const char * +nm_setting_wired_get_s390_nettype (NMSettingWired *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), NULL); + + return NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_nettype; +} + static gboolean verify (NMSetting *setting, GSList *all_settings, GError **error) { @@ -193,6 +234,26 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) return FALSE; } + if (priv->s390_nettype) { + if ( strcmp (priv->s390_nettype, "qeth") + && strcmp (priv->s390_nettype, "lcs") + && strcmp (priv->s390_nettype, "ctc")) { + g_set_error (error, + NM_SETTING_WIRED_ERROR, + NM_SETTING_WIRED_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRED_S390_NETTYPE); + return FALSE; + } + } + + if (priv->s390_port_name && strlen (priv->s390_port_name) > 8) { + g_set_error (error, + NM_SETTING_WIRED_ERROR, + NM_SETTING_WIRED_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRED_S390_PORT_NAME); + return FALSE; + } + return TRUE; } @@ -209,6 +270,8 @@ finalize (GObject *object) g_free (priv->port); g_free (priv->duplex); + g_free (priv->s390_port_name); + g_free (priv->s390_nettype); if (priv->mac_address) g_byte_array_free (priv->mac_address, TRUE); @@ -252,6 +315,20 @@ set_property (GObject *object, guint prop_id, } priv->s390_subchannels = g_value_dup_boxed (value); break; + case PROP_S390_PORT_NAME: + g_free (priv->s390_port_name); + priv->s390_port_name = g_value_dup_string (value); + break; + case PROP_S390_PORT_NUMBER: + priv->s390_port_number = g_value_get_uint (value); + break; + case PROP_S390_QETH_LAYER: + priv->s390_qeth_layer = g_value_get_uint (value); + break; + case PROP_S390_NETTYPE: + g_free (priv->s390_nettype); + priv->s390_nettype = g_value_dup_string (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -286,6 +363,18 @@ get_property (GObject *object, guint prop_id, case PROP_S390_SUBCHANNELS: g_value_set_boxed (value, nm_setting_wired_get_s390_subchannels (setting)); break; + case PROP_S390_PORT_NAME: + g_value_set_string (value, nm_setting_wired_get_s390_port_name (setting)); + break; + case PROP_S390_PORT_NUMBER: + g_value_set_uint (value, nm_setting_wired_get_s390_port_number (setting)); + break; + case PROP_S390_QETH_LAYER: + g_value_set_uint (value, nm_setting_wired_get_s390_qeth_layer (setting)); + break; + case PROP_S390_NETTYPE: + g_value_set_string (value, nm_setting_wired_get_s390_nettype (setting)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -435,5 +524,63 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class) "characters and the period (.) character.", DBUS_TYPE_G_ARRAY_OF_STRING, G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingWired:s390-port-name: + * + * s390 device port name, if required by your configuration. + **/ + g_object_class_install_property + (object_class, PROP_S390_PORT_NAME, + g_param_spec_string (NM_SETTING_WIRED_S390_PORT_NAME, + "s390 Port Name", + "s390 device port name, if required by your configuration.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingWired:s390-port-number: + * + * s390 device port number, if required by your configuration. For 'qeth' + * devices, this is the "relative port number". + **/ + g_object_class_install_property + (object_class, PROP_S390_PORT_NUMBER, + g_param_spec_uint (NM_SETTING_WIRED_S390_PORT_NUMBER, + "s390 Port Number", + "s390 device port number, if required by your " + "configuration. For 'qeth' devices, this is the " + "'relative port number'.", + 0, 100, 0, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingWired:s390-qeth-layer: + * + * s390 'qeth' device layer, either '2' or '3'. + **/ + g_object_class_install_property + (object_class, PROP_S390_QETH_LAYER, + g_param_spec_uint (NM_SETTING_WIRED_S390_QETH_LAYER, + "s390 'qeth' layer", + "s390 'qeth' device layer, either '2' or '3'.", + 2, 3, 2, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingWired:s390-nettype: + * + * s390 network device type; one of 'qeth', 'lcs', or 'ctc', representing + * the different types of virtual network devices available on s390 systems. + **/ + g_object_class_install_property + (object_class, PROP_S390_NETTYPE, + g_param_spec_string (NM_SETTING_WIRED_S390_NETTYPE, + "s390 Net Type", + "s390 network device type; one of 'qeth', 'lcs', or " + "'ctc', representing the different types of virtual " + "network devices available on s390 systems.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); } diff --git a/libnm-util/nm-setting-wired.h b/libnm-util/nm-setting-wired.h index ee2c4da1a0..3efb8d48d3 100644 --- a/libnm-util/nm-setting-wired.h +++ b/libnm-util/nm-setting-wired.h @@ -59,6 +59,10 @@ GQuark nm_setting_wired_error_quark (void); #define NM_SETTING_WIRED_MAC_ADDRESS "mac-address" #define NM_SETTING_WIRED_MTU "mtu" #define NM_SETTING_WIRED_S390_SUBCHANNELS "s390-subchannels" +#define NM_SETTING_WIRED_S390_PORT_NAME "s390-port-name" +#define NM_SETTING_WIRED_S390_PORT_NUMBER "s390-port-number" +#define NM_SETTING_WIRED_S390_QETH_LAYER "s390-qeth-layer" +#define NM_SETTING_WIRED_S390_NETTYPE "s390-nettype" typedef struct { NMSetting parent; @@ -84,6 +88,10 @@ gboolean nm_setting_wired_get_auto_negotiate (NMSettingWired *setting const GByteArray *nm_setting_wired_get_mac_address (NMSettingWired *setting); guint32 nm_setting_wired_get_mtu (NMSettingWired *setting); const GPtrArray * nm_setting_wired_get_s390_subchannels (NMSettingWired *setting); +const char * nm_setting_wired_get_s390_port_name (NMSettingWired *setting); +guint32 nm_setting_wired_get_s390_port_number (NMSettingWired *setting); +guint32 nm_setting_wired_get_s390_qeth_layer (NMSettingWired *setting); +const char * nm_setting_wired_get_s390_nettype (NMSettingWired *setting); G_END_DECLS -- cgit v1.2.1 From 3beea85a0bb04c0e59a1d5ecfdbfe0dd8b1ce36c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 24 Jun 2010 14:21:49 -0700 Subject: core: s/obtain/update for permanant HW address --- src/nm-device-ethernet.c | 4 ++-- src/nm-device-wifi.c | 4 ++-- src/nm-device.c | 4 ++-- src/nm-device.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index 8a22b6b9bb..2045ee7d70 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -545,7 +545,7 @@ out: } static void -real_obtain_permanent_hw_address (NMDevice *dev) +real_update_permanent_hw_address (NMDevice *dev) { NMDeviceEthernet *self = NM_DEVICE_ETHERNET (dev); NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); @@ -1932,7 +1932,7 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *klass) parent_class->take_down = real_take_down; parent_class->can_interrupt_activation = real_can_interrupt_activation; parent_class->update_hw_address = real_update_hw_address; - parent_class->obtain_permanent_hw_address = real_obtain_permanent_hw_address; + parent_class->update_permanent_hw_address = real_update_permanent_hw_address; parent_class->get_best_auto_connection = real_get_best_auto_connection; parent_class->is_available = real_is_available; parent_class->connection_secrets_updated = real_connection_secrets_updated; diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 729dc0690d..9aac25fa3c 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -2992,7 +2992,7 @@ out: } static void -real_obtain_permanent_hw_address (NMDevice *dev) +real_update_permanent_hw_address (NMDevice *dev) { NMDeviceWifi *self = NM_DEVICE_WIFI (dev); NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); @@ -3878,7 +3878,7 @@ nm_device_wifi_class_init (NMDeviceWifiClass *klass) parent_class->bring_up = real_bring_up; parent_class->take_down = real_take_down; parent_class->update_hw_address = real_update_hw_address; - parent_class->obtain_permanent_hw_address = real_obtain_permanent_hw_address; + parent_class->update_permanent_hw_address = real_update_permanent_hw_address; parent_class->get_best_auto_connection = real_get_best_auto_connection; parent_class->is_available = real_is_available; parent_class->connection_secrets_updated = real_connection_secrets_updated; diff --git a/src/nm-device.c b/src/nm-device.c index 9981f9b44c..fd46ee33e2 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -283,8 +283,8 @@ constructor (GType type, if (NM_DEVICE_GET_CLASS (dev)->update_hw_address) NM_DEVICE_GET_CLASS (dev)->update_hw_address (dev); - if (NM_DEVICE_GET_CLASS (dev)->obtain_permanent_hw_address) - NM_DEVICE_GET_CLASS (dev)->obtain_permanent_hw_address (dev); + if (NM_DEVICE_GET_CLASS (dev)->update_permanent_hw_address) + NM_DEVICE_GET_CLASS (dev)->update_permanent_hw_address (dev); priv->dhcp_manager = nm_dhcp_manager_get (); diff --git a/src/nm-device.h b/src/nm-device.h index a2e0749598..ca067f441e 100644 --- a/src/nm-device.h +++ b/src/nm-device.h @@ -72,7 +72,7 @@ typedef struct { void (*take_down) (NMDevice *self); void (* update_hw_address) (NMDevice *self); - void (* obtain_permanent_hw_address) (NMDevice *self); + void (* update_permanent_hw_address) (NMDevice *self); guint32 (* get_type_capabilities) (NMDevice *self); guint32 (* get_generic_capabilities) (NMDevice *self); -- cgit v1.2.1 From 88eb6ced3f04f2f9bd7cc47c1e0ebbe2b4b5dab7 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 24 Jun 2010 15:14:53 -0700 Subject: core: consolidate and clean up MAC cloning code - Just use a byte array to old MAC addresses so we don't need to use .ether_addr_octet everywhere - Consolidate setting the current MAC address into one location - Make sure that if the GPERMADDR call fails we use the current MAC (this wasn't done for wired devices) - Make log messages consistent --- src/nm-device-ethernet.c | 186 ++++++++++++++++++++++++----------------------- src/nm-device-ethernet.h | 3 - src/nm-device-wifi.c | 174 +++++++++++++++++++++----------------------- src/nm-device-wifi.h | 2 - 4 files changed, 180 insertions(+), 185 deletions(-) diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index 2045ee7d70..30100c8197 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -104,8 +104,8 @@ typedef struct Supplicant { typedef struct { gboolean disposed; - struct ether_addr hw_addr; /* Currently set MAC address */ - struct ether_addr perm_hw_addr; /* Permanent MAC address */ + guint8 hw_addr[ETH_ALEN]; /* Currently set MAC address */ + guint8 perm_hw_addr[ETH_ALEN]; /* Currently set MAC address */ gboolean carrier; NMNetlinkMonitor * monitor; @@ -451,25 +451,13 @@ nm_device_ethernet_new (const char *udi, void nm_device_ethernet_get_address (NMDeviceEthernet *self, struct ether_addr *addr) { - g_return_if_fail (self != NULL); - g_return_if_fail (addr != NULL); - - memcpy (addr, &(NM_DEVICE_ETHERNET_GET_PRIVATE (self)->hw_addr), sizeof (struct ether_addr)); -} + NMDeviceEthernetPrivate *priv; -/* - * nm_device_ethernet_get_permanent_address - * - * Get a device's permanent hardware address - * - */ -void -nm_device_ethernet_get_permanent_address (NMDeviceEthernet *self, struct ether_addr *addr) -{ g_return_if_fail (self != NULL); g_return_if_fail (addr != NULL); - memcpy (addr, &(NM_DEVICE_ETHERNET_GET_PRIVATE (self)->perm_hw_addr), sizeof (struct ether_addr)); + priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + memcpy (addr, &priv->hw_addr, sizeof (priv->hw_addr)); } /* Returns speed in Mb/s */ @@ -512,11 +500,66 @@ out: return speed; } +static void +_update_hw_addr (NMDeviceEthernet *self, const guint8 *addr) +{ + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + + g_return_if_fail (addr != NULL); + + if (memcmp (&priv->hw_addr, addr, ETH_ALEN)) { + memcpy (&priv->hw_addr, addr, ETH_ALEN); + g_object_notify (G_OBJECT (self), NM_DEVICE_ETHERNET_HW_ADDRESS); + } +} + +static gboolean +_set_hw_addr (NMDeviceEthernet *self, const guint8 *addr, const char *detail) +{ + NMDevice *dev = NM_DEVICE (self); + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + const char *iface; + char *mac_str = NULL; + gboolean success = FALSE; + + g_return_val_if_fail (addr != NULL, FALSE); + + iface = nm_device_get_iface (dev); + + mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", + addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); + + /* Do nothing if current MAC is same */ + if (!memcmp (&priv->hw_addr, addr, ETH_ALEN)) { + nm_log_dbg (LOGD_DEVICE | LOGD_ETHER, "(%s): no MAC address change needed", + iface, detail, mac_str); + g_free (mac_str); + return TRUE; + } + + /* Can't change MAC address while device is up */ + real_hw_take_down (dev); + + success = nm_system_device_set_mac (iface, (struct ether_addr *) addr); + if (success) { + /* MAC address succesfully changed; update the current MAC to match */ + _update_hw_addr (self, addr); + nm_log_info (LOGD_DEVICE | LOGD_ETHER, "(%s): %s MAC address to %s", + iface, detail, mac_str); + } else { + nm_log_warn (LOGD_DEVICE | LOGD_ETHER, "(%s): failed to %s MAC address to %s", + iface, detail, mac_str); + } + real_hw_bring_up (dev, NULL); + g_free (mac_str); + + return success; +} + static void real_update_hw_address (NMDevice *dev) { NMDeviceEthernet *self = NM_DEVICE_ETHERNET (dev); - NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); struct ifreq req; int fd; @@ -528,19 +571,15 @@ real_update_hw_address (NMDevice *dev) memset (&req, 0, sizeof (struct ifreq)); strncpy (req.ifr_name, nm_device_get_iface (dev), IFNAMSIZ); + + errno = 0; if (ioctl (fd, SIOCGIFHWADDR, &req) < 0) { nm_log_err (LOGD_HW | LOGD_ETHER, - "(%s) error getting hardware address: %d", + "(%s) failed to read hardware address (error %d)", nm_device_get_iface (dev), errno); - goto out; - } - - if (memcmp (&priv->hw_addr, &req.ifr_hwaddr.sa_data, sizeof (struct ether_addr))) { - memcpy (&priv->hw_addr, &req.ifr_hwaddr.sa_data, sizeof (struct ether_addr)); - g_object_notify (G_OBJECT (dev), NM_DEVICE_ETHERNET_HW_ADDRESS); - } + } else + _update_hw_addr (self, (const guint8 *) &req.ifr_hwaddr.sa_data); -out: close (fd); } @@ -551,7 +590,7 @@ real_update_permanent_hw_address (NMDevice *dev) NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); struct ifreq req; struct ethtool_perm_addr *epaddr = NULL; - int fd; + int fd, ret; fd = socket (PF_INET, SOCK_DGRAM, 0); if (fd < 0) { @@ -562,24 +601,26 @@ real_update_permanent_hw_address (NMDevice *dev) /* Get permanent MAC address */ memset (&req, 0, sizeof (struct ifreq)); strncpy (req.ifr_name, nm_device_get_iface (dev), IFNAMSIZ); - epaddr = (struct ethtool_perm_addr *) g_malloc0 (sizeof(struct ethtool_perm_addr) + ETH_ALEN); + + epaddr = g_malloc0 (sizeof (struct ethtool_perm_addr) + ETH_ALEN); epaddr->cmd = ETHTOOL_GPERMADDR; epaddr->size = ETH_ALEN; - req.ifr_data = epaddr; + req.ifr_data = (void *) epaddr; + errno = 0; - if (ioctl (fd, SIOCETHTOOL, &req) < 0) { - nm_log_err (LOGD_HW | LOGD_ETHER, "SIOCETHTOOL failed: %d; unable to get permanent MAC address for %s", - errno, nm_device_get_iface (dev)); - goto out; + ret = ioctl (fd, SIOCETHTOOL, &req); + if (ret < 0) { + nm_log_err (LOGD_HW | LOGD_ETHER, "(%s): unable to read permanent MAC address (error %d)", + nm_device_get_iface (dev), errno); + /* Fall back to current address */ + memcpy (epaddr->data, &priv->hw_addr, ETH_ALEN); } - if (memcmp (&priv->perm_hw_addr, epaddr->data, sizeof (struct ether_addr))) { - memcpy (&priv->perm_hw_addr, epaddr->data, sizeof (struct ether_addr)); + if (memcmp (&priv->perm_hw_addr, epaddr->data, ETH_ALEN)) { + memcpy (&priv->perm_hw_addr, epaddr->data, ETH_ALEN); g_object_notify (G_OBJECT (dev), NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS); } -out: - g_free (epaddr); close (fd); } @@ -666,7 +707,7 @@ real_get_best_auto_connection (NMDevice *dev, const GByteArray *mac; mac = nm_setting_wired_get_mac_address (s_wired); - if (mac && memcmp (mac->data, priv->hw_addr.ether_addr_octet, ETH_ALEN)) + if (mac && memcmp (mac->data, &priv->perm_hw_addr, ETH_ALEN)) continue; } @@ -1278,7 +1319,6 @@ static NMActStageReturn real_act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason) { NMDeviceEthernet *self = NM_DEVICE_ETHERNET (dev); - NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); NMActRequest *req; NMSettingWired *s_wired; const GByteArray *cloned_mac; @@ -1292,23 +1332,10 @@ real_act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason) s_wired = NM_SETTING_WIRED (device_get_setting (dev, NM_TYPE_SETTING_WIRED)); g_assert (s_wired); + /* Set device MAC address if the connection wants to change it */ cloned_mac = nm_setting_wired_get_cloned_mac_address (s_wired); - if (cloned_mac) { - char *mac_str = NULL; - - mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", cloned_mac->data[0], cloned_mac->data[1], cloned_mac->data[2], - cloned_mac->data[3], cloned_mac->data[4], cloned_mac->data[5]); - real_hw_take_down (dev); - if (nm_system_device_set_mac (nm_device_get_iface (dev), (struct ether_addr *) cloned_mac->data)) { - /* MAC address succesfully spoofed on interface, set it to hw_addr too */ - memcpy (priv->hw_addr.ether_addr_octet, cloned_mac->data, ETH_ALEN); - nm_log_info (LOGD_DEVICE | LOGD_ETHER, "cloned MAC %s set to %s", mac_str, nm_device_get_iface (dev)); - } else { - nm_log_warn (LOGD_DEVICE | LOGD_ETHER, "failed to set cloned MAC %s to %s", mac_str, nm_device_get_iface (dev)); - } - real_hw_bring_up (dev, NULL); - g_free (mac_str); - } + if (cloned_mac && (cloned_mac->len == ETH_ALEN)) + _set_hw_addr (self, (const guint8 *) cloned_mac->data, "set"); return ret; } @@ -1541,8 +1568,8 @@ real_act_stage4_get_ip4_config (NMDevice *device, static void real_deactivate_quickly (NMDevice *device) { - NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); - char *mac_str = NULL; + NMDeviceEthernet *self = NM_DEVICE_ETHERNET (device); + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); if (priv->pending_ip4_config) { g_object_unref (priv->pending_ip4_config); @@ -1554,23 +1581,10 @@ real_deactivate_quickly (NMDevice *device) priv->ppp_manager = NULL; } - supplicant_interface_release (NM_DEVICE_ETHERNET (device)); - - /* Set permanent MAC address back to the interface */ - mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", - priv->perm_hw_addr.ether_addr_octet[0], priv->perm_hw_addr.ether_addr_octet[1], priv->perm_hw_addr.ether_addr_octet[2], - priv->perm_hw_addr.ether_addr_octet[3], priv->perm_hw_addr.ether_addr_octet[4], priv->perm_hw_addr.ether_addr_octet[5]); - real_hw_take_down (device); - if (nm_system_device_set_mac (nm_device_get_iface (device), &priv->perm_hw_addr)) { - /* MAC address succesfully spoofed on interface, set it to hw_addr too */ - memcpy (priv->hw_addr.ether_addr_octet, &priv->perm_hw_addr, ETH_ALEN); - nm_log_info (LOGD_DEVICE | LOGD_ETHER, "permanent MAC address %s set back to %s", mac_str, nm_device_get_iface (device)); - } else { - nm_log_warn (LOGD_DEVICE | LOGD_ETHER, "failed to set permanent MAC address %s back to %s", mac_str, nm_device_get_iface (device)); - } - real_hw_bring_up (device, NULL); + supplicant_interface_release (self); - g_free (mac_str); + /* Reset MAC address back to permanent address */ + _set_hw_addr (self, priv->perm_hw_addr, "reset"); } static gboolean @@ -1613,7 +1627,7 @@ real_check_connection_compatible (NMDevice *device, const GByteArray *mac; mac = nm_setting_wired_get_mac_address (s_wired); - if (mac && memcmp (mac->data, &(priv->perm_hw_addr.ether_addr_octet), ETH_ALEN)) { + if (mac && memcmp (mac->data, &priv->perm_hw_addr, ETH_ALEN)) { g_set_error (error, NM_ETHERNET_ERROR, NM_ETHERNET_ERROR_CONNECTION_INCOMPATIBLE, "The connection's MAC address did not match this device."); @@ -1629,12 +1643,11 @@ real_check_connection_compatible (NMDevice *device, static gboolean spec_match_list (NMDevice *device, const GSList *specs) { - struct ether_addr ether; + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); char *hwaddr; gboolean matched; - nm_device_ethernet_get_permanent_address (NM_DEVICE_ETHERNET (device), ðer); - hwaddr = nm_ether_ntop (ðer); + hwaddr = nm_ether_ntop ((struct ether_addr *) &priv->perm_hw_addr); matched = nm_match_spec_hwaddr (specs, hwaddr); g_free (hwaddr); @@ -1644,8 +1657,8 @@ spec_match_list (NMDevice *device, const GSList *specs) static gboolean wired_match_config (NMDevice *self, NMConnection *connection) { + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); NMSettingWired *s_wired; - struct ether_addr ether; const GByteArray *s_ether; s_wired = (NMSettingWired *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED); @@ -1654,12 +1667,8 @@ wired_match_config (NMDevice *self, NMConnection *connection) /* MAC address check */ s_ether = nm_setting_wired_get_mac_address (s_wired); - if (s_ether) { - nm_device_ethernet_get_permanent_address (NM_DEVICE_ETHERNET (self), ðer); - - if (memcmp (s_ether->data, ether.ether_addr_octet, ETH_ALEN)) - return FALSE; - } + if (s_ether && memcmp (s_ether->data, priv->perm_hw_addr, ETH_ALEN)) + return FALSE; return TRUE; } @@ -1875,16 +1884,13 @@ get_property (GObject *object, guint prop_id, { NMDeviceEthernet *self = NM_DEVICE_ETHERNET (object); NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); - struct ether_addr hw_addr; switch (prop_id) { case PROP_HW_ADDRESS: - nm_device_ethernet_get_address (self, &hw_addr); - g_value_take_string (value, nm_ether_ntop (&hw_addr)); + g_value_take_string (value, nm_ether_ntop ((struct ether_addr *) &priv->hw_addr)); break; case PROP_PERM_HW_ADDRESS: - nm_device_ethernet_get_permanent_address (self, &hw_addr); - g_value_take_string (value, nm_ether_ntop (&hw_addr)); + g_value_take_string (value, nm_ether_ntop ((struct ether_addr *) &priv->perm_hw_addr)); break; case PROP_SPEED: g_value_set_uint (value, nm_device_ethernet_get_speed (self)); diff --git a/src/nm-device-ethernet.h b/src/nm-device-ethernet.h index 243fbedb29..b9e2afd402 100644 --- a/src/nm-device-ethernet.h +++ b/src/nm-device-ethernet.h @@ -63,9 +63,6 @@ NMDevice *nm_device_ethernet_new (const char *udi, void nm_device_ethernet_get_address (NMDeviceEthernet *dev, struct ether_addr *addr); -void nm_device_ethernet_get_permanent_address (NMDeviceEthernet *dev, - struct ether_addr *addr); - G_END_DECLS #endif /* NM_DEVICE_ETHERNET_H */ diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 9aac25fa3c..bbc365e7ba 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -146,9 +146,8 @@ typedef struct Supplicant { struct _NMDeviceWifiPrivate { gboolean disposed; - struct ether_addr hw_addr; /* Currently set MAC address */ - struct ether_addr perm_hw_addr; /* Permanent MAC address */ - gboolean perm_hw_addr_is_set; + guint8 hw_addr[ETH_ALEN]; /* Currently set MAC address */ + guint8 perm_hw_addr[ETH_ALEN]; /* Permanent MAC address */ /* Legacy rfkill for ipw2x00; will be fixed with 2.6.33 kernel */ char * ipw_rfkill_path; @@ -1090,6 +1089,62 @@ real_bring_up (NMDevice *dev) return TRUE; } +static void +_update_hw_addr (NMDeviceWifi *self, const guint8 *addr) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + + g_return_if_fail (addr != NULL); + + if (memcmp (&priv->hw_addr, addr, ETH_ALEN)) { + memcpy (&priv->hw_addr, addr, ETH_ALEN); + g_object_notify (G_OBJECT (self), NM_DEVICE_WIFI_HW_ADDRESS); + } +} + +static gboolean +_set_hw_addr (NMDeviceWifi *self, const guint8 *addr, const char *detail) +{ + NMDevice *dev = NM_DEVICE (self); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + const char *iface; + char *mac_str = NULL; + gboolean success = FALSE; + + g_return_val_if_fail (addr != NULL, FALSE); + + iface = nm_device_get_iface (dev); + + mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", + addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); + + /* Do nothing if current MAC is same */ + if (!memcmp (&priv->hw_addr, addr, ETH_ALEN)) { + nm_log_dbg (LOGD_DEVICE | LOGD_ETHER, "(%s): no MAC address change needed", + iface, detail, mac_str); + g_free (mac_str); + return TRUE; + } + + /* Can't change MAC address while device is up */ + real_hw_take_down (dev); + + success = nm_system_device_set_mac (iface, (struct ether_addr *) addr); + if (success) { + /* MAC address succesfully changed; update the current MAC to match */ + _update_hw_addr (self, addr); + nm_log_info (LOGD_DEVICE | LOGD_ETHER, "(%s): %s MAC address to %s", + iface, detail, mac_str); + } else { + nm_log_warn (LOGD_DEVICE | LOGD_ETHER, "(%s): failed to %s MAC address to %s", + iface, detail, mac_str); + } + real_hw_bring_up (dev, NULL); + g_free (mac_str); + + return success; +} + static void access_point_removed (NMDeviceWifi *device, NMAccessPoint *ap) { @@ -1135,7 +1190,6 @@ real_deactivate_quickly (NMDevice *dev) NMDeviceWifi *self = NM_DEVICE_WIFI (dev); NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); NMAccessPoint *orig_ap = nm_device_wifi_get_activation_ap (self); - char *mac_str = NULL; cleanup_association_attempt (self, TRUE); @@ -1156,21 +1210,7 @@ real_deactivate_quickly (NMDevice *dev) g_object_unref (orig_ap); } - /* Set permanent MAC address back to the interface */ - mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", - priv->perm_hw_addr.ether_addr_octet[0], priv->perm_hw_addr.ether_addr_octet[1], priv->perm_hw_addr.ether_addr_octet[2], - priv->perm_hw_addr.ether_addr_octet[3], priv->perm_hw_addr.ether_addr_octet[4], priv->perm_hw_addr.ether_addr_octet[5]); - real_hw_take_down (dev); - if (nm_system_device_set_mac (nm_device_get_iface (dev), &priv->perm_hw_addr)) { - /* MAC address succesfully spoofed on interface, set it to hw_addr too */ - memcpy (priv->hw_addr.ether_addr_octet, &priv->perm_hw_addr, ETH_ALEN); - nm_log_info (LOGD_DEVICE | LOGD_ETHER, "permanent MAC address %s set back to %s", mac_str, nm_device_get_iface (dev)); - } else { - nm_log_warn (LOGD_DEVICE | LOGD_ETHER, "failed to set permanent MAC address %s back to %s", mac_str, nm_device_get_iface (dev)); - } - real_hw_bring_up (dev, NULL); - - g_free (mac_str); + _set_hw_addr (self, priv->perm_hw_addr, "reset"); } static void @@ -1213,7 +1253,7 @@ real_check_connection_compatible (NMDevice *device, } mac = nm_setting_wireless_get_mac_address (s_wireless); - if (mac && memcmp (mac->data, &(priv->perm_hw_addr.ether_addr_octet), ETH_ALEN)) { + if (mac && memcmp (mac->data, &priv->perm_hw_addr, ETH_ALEN)) { g_set_error (error, NM_WIFI_ERROR, NM_WIFI_ERROR_CONNECTION_INCOMPATIBLE, "The connection's MAC address did not match this device."); @@ -1288,7 +1328,7 @@ real_get_best_auto_connection (NMDevice *dev, continue; mac = nm_setting_wireless_get_mac_address (s_wireless); - if (mac && memcmp (mac->data, priv->hw_addr.ether_addr_octet, ETH_ALEN)) + if (mac && memcmp (mac->data, &priv->perm_hw_addr, ETH_ALEN)) continue; /* Use the connection if it's a shared connection */ @@ -1328,26 +1368,7 @@ nm_device_wifi_get_address (NMDeviceWifi *self, g_return_if_fail (addr != NULL); priv = NM_DEVICE_WIFI_GET_PRIVATE (self); - memcpy (addr, &(priv->hw_addr), sizeof (struct ether_addr)); -} - -/* - * nm_device_wifi_get_permanent_address - * - * Get a device's permanent hardware address - * - */ -void -nm_device_wifi_get_permanent_address (NMDeviceWifi *self, - struct ether_addr *addr) -{ - NMDeviceWifiPrivate *priv; - - g_return_if_fail (self != NULL); - g_return_if_fail (addr != NULL); - - priv = NM_DEVICE_WIFI_GET_PRIVATE (self); - memcpy (addr, &(priv->perm_hw_addr), sizeof (struct ether_addr)); + memcpy (addr, &priv->hw_addr, sizeof (struct ether_addr)); } static void @@ -2964,7 +2985,6 @@ static void real_update_hw_address (NMDevice *dev) { NMDeviceWifi *self = NM_DEVICE_WIFI (dev); - NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); struct ifreq req; int fd; @@ -2976,18 +2996,13 @@ real_update_hw_address (NMDevice *dev) memset (&req, 0, sizeof (struct ifreq)); strncpy (req.ifr_name, nm_device_get_iface (dev), IFNAMSIZ); + errno = 0; if (ioctl (fd, SIOCGIFHWADDR, &req) < 0) { - nm_log_err (LOGD_HW | LOGD_WIFI, "(%s) error getting hardware address: %d", + nm_log_err (LOGD_HW | LOGD_WIFI, "(%s): unable to read hardware address (error %d)", nm_device_get_iface (dev), errno); - goto out; - } - - if (memcmp (&priv->hw_addr, &req.ifr_hwaddr.sa_data, sizeof (struct ether_addr))) { - memcpy (&priv->hw_addr, &req.ifr_hwaddr.sa_data, sizeof (struct ether_addr)); - g_object_notify (G_OBJECT (dev), NM_DEVICE_WIFI_HW_ADDRESS); - } + } else + _update_hw_addr (self, (const guint8 *) &req.ifr_hwaddr.sa_data); -out: close (fd); } @@ -2998,7 +3013,7 @@ real_update_permanent_hw_address (NMDevice *dev) NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); struct ifreq req; struct ethtool_perm_addr *epaddr = NULL; - int fd; + int fd, ret; fd = socket (PF_INET, SOCK_DGRAM, 0); if (fd < 0) { @@ -3009,29 +3024,26 @@ real_update_permanent_hw_address (NMDevice *dev) /* Get permanent MAC address */ memset (&req, 0, sizeof (struct ifreq)); strncpy (req.ifr_name, nm_device_get_iface (dev), IFNAMSIZ); - epaddr = (struct ethtool_perm_addr *) g_malloc0 (sizeof(struct ethtool_perm_addr) + ETH_ALEN); + + epaddr = g_malloc0 (sizeof (struct ethtool_perm_addr) + ETH_ALEN); epaddr->cmd = ETHTOOL_GPERMADDR; epaddr->size = ETH_ALEN; req.ifr_data = (void *) epaddr; - errno = 0; - if (ioctl (fd, SIOCETHTOOL, &req) < 0) { - nm_log_err (LOGD_HW | LOGD_ETHER, "SIOCETHTOOL failed: %d; unable to get permanent MAC address for %s", - errno, nm_device_get_iface (dev)); - - nm_log_warn (LOGD_HW | LOGD_ETHER, "Using current address as permanent address for %s", - nm_device_get_iface (dev)); - memcpy (&priv->perm_hw_addr, &priv->hw_addr, sizeof (struct ether_addr)); - g_object_notify (G_OBJECT (dev), NM_DEVICE_WIFI_PERMANENT_HW_ADDRESS); - goto out; + errno = 0; + ret = ioctl (fd, SIOCETHTOOL, &req); + if (ret < 0) { + nm_log_err (LOGD_HW | LOGD_ETHER, "(%s): unable to read permanent MAC address (error %d)", + nm_device_get_iface (dev), errno); + /* Fall back to current address */ + memcpy (epaddr->data, &priv->hw_addr, ETH_ALEN); } - if (memcmp (&priv->perm_hw_addr, epaddr->data, sizeof (struct ether_addr))) { - memcpy (&priv->perm_hw_addr, epaddr->data, sizeof (struct ether_addr)); + if (memcmp (&priv->perm_hw_addr, epaddr->data, ETH_ALEN)) { + memcpy (&priv->perm_hw_addr, epaddr->data, ETH_ALEN); g_object_notify (G_OBJECT (dev), NM_DEVICE_WIFI_PERMANENT_HW_ADDRESS); } -out: g_free (epaddr); close (fd); } @@ -3060,22 +3072,8 @@ real_act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason) g_assert (s_wireless); cloned_mac = nm_setting_wireless_get_cloned_mac_address (s_wireless); - if (cloned_mac) { - char *mac_str = NULL; - - mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", cloned_mac->data[0], cloned_mac->data[1], cloned_mac->data[2], - cloned_mac->data[3], cloned_mac->data[4], cloned_mac->data[5]); - real_hw_take_down (dev); - if (nm_system_device_set_mac (nm_device_get_iface (dev), (struct ether_addr *) cloned_mac->data)) { - /* MAC address succesfully spoofed on interface, set it to hw_addr too */ - memcpy (priv->hw_addr.ether_addr_octet, cloned_mac->data, ETH_ALEN); - nm_log_info (LOGD_DEVICE | LOGD_ETHER, "cloned MAC %s set to %s", mac_str, nm_device_get_iface (dev)); - } else { - nm_log_warn (LOGD_DEVICE | LOGD_ETHER, "failed to set cloned MAC %s to %s", mac_str, nm_device_get_iface (dev)); - } - real_hw_bring_up (dev, NULL); - g_free (mac_str); - } + if (cloned_mac && (cloned_mac->len == ETH_ALEN)) + _set_hw_addr (self, (const guint8 *) cloned_mac->data, "set"); /* If the user is trying to connect to an AP that NM doesn't yet know about * (hidden network or something), create an fake AP from the security @@ -3537,12 +3535,11 @@ real_get_type_capabilities (NMDevice *dev) static gboolean spec_match_list (NMDevice *device, const GSList *specs) { - struct ether_addr ether; + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (device); char *hwaddr; gboolean matched; - nm_device_wifi_get_permanent_address (NM_DEVICE_WIFI (device), ðer); - hwaddr = nm_ether_ntop (ðer); + hwaddr = nm_ether_ntop ((struct ether_addr *) &priv->perm_hw_addr); matched = nm_match_spec_hwaddr (specs, hwaddr); g_free (hwaddr); @@ -3800,16 +3797,13 @@ get_property (GObject *object, guint prop_id, { NMDeviceWifi *device = NM_DEVICE_WIFI (object); NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (device); - struct ether_addr hw_addr; switch (prop_id) { case PROP_HW_ADDRESS: - nm_device_wifi_get_address (device, &hw_addr); - g_value_take_string (value, nm_ether_ntop (&hw_addr)); + g_value_take_string (value, nm_ether_ntop ((struct ether_addr *) &priv->hw_addr)); break; case PROP_PERM_HW_ADDRESS: - nm_device_wifi_get_permanent_address (device, &hw_addr); - g_value_take_string (value, nm_ether_ntop (&hw_addr)); + g_value_take_string (value, nm_ether_ntop ((struct ether_addr *) &priv->perm_hw_addr)); break; case PROP_MODE: g_value_set_uint (value, nm_device_wifi_get_mode (device)); diff --git a/src/nm-device-wifi.h b/src/nm-device-wifi.h index d8b8522858..31ac5ad5b5 100644 --- a/src/nm-device-wifi.h +++ b/src/nm-device-wifi.h @@ -88,8 +88,6 @@ NMDevice *nm_device_wifi_new (const char *udi, void nm_device_wifi_get_address (NMDeviceWifi *dev, struct ether_addr *addr); -void nm_device_wifi_get_permanent_address (NMDeviceWifi *dev, struct ether_addr *addr); - void nm_device_wifi_get_bssid (NMDeviceWifi *dev, struct ether_addr *bssid); const GByteArray * nm_device_wifi_get_ssid (NMDeviceWifi *self); -- cgit v1.2.1 From 157959a1c5496d1c9a130ea737062636bbe05527 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 24 Jun 2010 15:18:53 -0700 Subject: core: fall back to current MAC address if permanent one is invalid Not all drivers will return errors when even when they don't provide the GPERMADDR ethtool call; sometimes you'll get 00:00:00:00:00:00 which is clearly not right. In this case, fall back to the current HW address just like if the ethtool GPERMADDR call failed. --- src/nm-device-ethernet.c | 2 +- src/nm-device-wifi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index 30100c8197..3bef9bc8e2 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -609,7 +609,7 @@ real_update_permanent_hw_address (NMDevice *dev) errno = 0; ret = ioctl (fd, SIOCETHTOOL, &req); - if (ret < 0) { + if ((ret < 0) || !nm_ethernet_address_is_valid ((struct ether_addr *) epaddr->data)) { nm_log_err (LOGD_HW | LOGD_ETHER, "(%s): unable to read permanent MAC address (error %d)", nm_device_get_iface (dev), errno); /* Fall back to current address */ diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index bbc365e7ba..808bddc3f4 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -3032,7 +3032,7 @@ real_update_permanent_hw_address (NMDevice *dev) errno = 0; ret = ioctl (fd, SIOCETHTOOL, &req); - if (ret < 0) { + if ((ret < 0) || !nm_ethernet_address_is_valid ((struct ether_addr *) epaddr->data)) { nm_log_err (LOGD_HW | LOGD_ETHER, "(%s): unable to read permanent MAC address (error %d)", nm_device_get_iface (dev), errno); /* Fall back to current address */ -- cgit v1.2.1 From 91ab673b5c1af7ee0f2f4a483f24bcce940ac373 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 25 Jun 2010 09:56:53 -0700 Subject: ifcfg-rh: ensure SSIDs don't get double-quoted when written out (rh #606518) --- system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 18 ++++++++++++++++++ system-settings/plugins/ifcfg-rh/writer.c | 17 ++++++++++++----- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index 2e61e4b2c4..6e873fe82b 100644 --- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -6329,6 +6329,8 @@ test_write_wifi_open (void) guint32 channel = 9, mtu = 1345; GByteArray *mac; const unsigned char mac_data[] = { 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; + shvarFile *ifcfg; + char *tmp; connection = nm_connection_new (); ASSERT (connection != NULL, @@ -6423,6 +6425,22 @@ test_write_wifi_open (void) &route6file, &error, &ignore_error); + + /* Now make sure that the ESSID item isn't double-quoted (rh #606518) */ + ifcfg = svNewFile (testfile); + ASSERT (ifcfg != NULL, + "wifi-open-write-reread", "failed to load %s as shvarfile", testfile); + + tmp = svGetValue (ifcfg, "ESSID", TRUE); + ASSERT (tmp != NULL, + "wifi-open-write-reread", "failed to read ESSID key from %s", testfile); + + g_message (tmp); + ASSERT (strncmp (tmp, "\"\"", 2) != 0, + "wifi-open-write-reread", "unexpected ESSID double-quote in %s", testfile); + + svCloseFile (ifcfg); + unlink (testfile); ASSERT (reread != NULL, diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c index dd75193e91..52ca518925 100644 --- a/system-settings/plugins/ifcfg-rh/writer.c +++ b/system-settings/plugins/ifcfg-rh/writer.c @@ -778,13 +778,20 @@ write_wireless_setting (NMConnection *connection, svSetValue (ifcfg, "ESSID", str->str, TRUE); g_string_free (str, TRUE); } else { - /* Printable SSIDs get quoted */ + /* Printable SSIDs always get quoted */ memset (buf, 0, sizeof (buf)); memcpy (buf, ssid->data, ssid->len); - tmp2 = svEscape (buf); - tmp = g_strdup_printf ("\"%s\"", tmp2); - svSetValue (ifcfg, "ESSID", tmp, TRUE); - g_free (tmp2); + tmp = svEscape (buf); + + /* svEscape will usually quote the string, but just for consistency, + * if svEscape doesn't quote the ESSID, we quote it ourselves. + */ + if (tmp[0] != '"' && tmp[strlen (tmp) - 1] != '"') { + tmp2 = g_strdup_printf ("\"%s\"", tmp); + svSetValue (ifcfg, "ESSID", tmp2, TRUE); + g_free (tmp2); + } else + svSetValue (ifcfg, "ESSID", tmp, TRUE); g_free (tmp); } -- cgit v1.2.1 From 3f089fe41d779313dee4e91a6b48f3269f4d81b6 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 25 Jun 2010 19:49:39 -0700 Subject: core: grab s390 subchannels when available --- src/nm-device-ethernet.c | 110 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index 05d79de052..c888f9c6af 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -34,6 +34,9 @@ #include #include +#define G_UDEV_API_IS_SUBJECT_TO_CHANGE +#include + #include #include "nm-glib-compat.h" @@ -116,6 +119,11 @@ typedef struct { Supplicant supplicant; guint supplicant_timeout_id; + /* s390 */ + char * subchan1; + char * subchan2; + char * subchan3; + /* PPPoE */ NMPPPManager *ppp_manager; NMIP4Config *pending_ip4_config; @@ -290,6 +298,101 @@ carrier_off (NMNetlinkMonitor *monitor, } } +static void +_update_s390_subchannels (NMDeviceEthernet *self) +{ + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + const char *iface; + GUdevClient *client; + GUdevDevice *dev; + GUdevDevice *parent; + const char *parent_path, *item, *driver; + const char *subsystems[] = { "net", NULL }; + GDir *dir; + GError *error = NULL; + + iface = nm_device_get_iface (NM_DEVICE (self)); + + client = g_udev_client_new (subsystems); + if (!client) { + nm_log_warn (LOGD_DEVICE | LOGD_HW, "(%s): failed to initialize GUdev client", iface); + return; + } + + dev = g_udev_client_query_by_subsystem_and_name (client, "net", iface); + if (!dev) { + nm_log_warn (LOGD_DEVICE | LOGD_HW, "(%s): failed to find device with udev", iface); + goto out; + } + + /* Try for the "ccwgroup" parent */ + parent = g_udev_device_get_parent_with_subsystem (dev, "ccwgroup", NULL); + if (!parent) { + /* FIXME: whatever 'lcs' devices' subsystem is here... */ + if (!parent) { + /* Not an s390 device */ + goto out; + } + } + + parent_path = g_udev_device_get_sysfs_path (parent); + dir = g_dir_open (parent_path, 0, &error); + if (!dir) { + nm_log_warn (LOGD_DEVICE | LOGD_HW, "(%s): failed to open directory '%s': %s", + iface, parent_path, + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); + goto out; + } + + /* FIXME: we probably care about ordering here to ensure that we map + * cdev0 -> subchan1, cdev1 -> subchan2, etc. + */ + while ((item = g_dir_read_name (dir))) { + char buf[50]; + char *cdev_path; + + if (strncmp (item, "cdev", 4)) + continue; /* Not a subchannel link */ + + cdev_path = g_strdup_printf ("%s/%s", parent_path, item); + + memset (buf, 0, sizeof (buf)); + errno = 0; + if (readlink (cdev_path, &buf[0], sizeof (buf) - 1) >= 0) { + if (!priv->subchan1) + priv->subchan1 = g_path_get_basename (buf); + else if (!priv->subchan2) + priv->subchan2 = g_path_get_basename (buf); + else if (!priv->subchan3) + priv->subchan3 = g_path_get_basename (buf); + } else { + nm_log_warn (LOGD_DEVICE | LOGD_HW, + "(%s): failed to read cdev link '%s': %s", + iface, cdev_path, errno); + } + g_free (cdev_path); + }; + + driver = nm_device_get_driver (NM_DEVICE (self)); + nm_log_info (LOGD_DEVICE | LOGD_HW, + "(%s): found s390 '%s' subchannels [%s, %s, %s]", + iface, + driver ? driver : "(unknown driver)", + priv->subchan1 ? priv->subchan1 : "(none)", + priv->subchan2 ? priv->subchan2 : "(none)", + priv->subchan3 ? priv->subchan3 : "(none)"); + + g_dir_close (dir); + +out: + if (parent) + g_object_unref (parent); + if (dev) + g_object_unref (dev); + g_object_unref (client); +} + static GObject* constructor (GType type, guint n_construct_params, @@ -313,6 +416,9 @@ constructor (GType type, nm_device_get_iface (NM_DEVICE (self)), nm_device_get_ifindex (NM_DEVICE (self))); + /* s390 stuff */ + _update_s390_subchannels (NM_DEVICE_ETHERNET (self)); + caps = nm_device_get_capabilities (self); if (caps & NM_DEVICE_CAP_CARRIER_DETECT) { GError *error = NULL; @@ -1759,6 +1865,10 @@ dispose (GObject *object) priv->monitor = NULL; } + g_free (priv->subchan1); + g_free (priv->subchan2); + g_free (priv->subchan3); + G_OBJECT_CLASS (nm_device_ethernet_parent_class)->dispose (object); } -- cgit v1.2.1 From fd10f97d98b95a205ffe3370a39c50a5afe713d1 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 25 Jun 2010 20:08:09 -0700 Subject: libnm-util: fix default s390 property values --- libnm-util/nm-setting-wired.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libnm-util/nm-setting-wired.c b/libnm-util/nm-setting-wired.c index 77b210cfaf..90f0a1ad12 100644 --- a/libnm-util/nm-setting-wired.c +++ b/libnm-util/nm-setting-wired.c @@ -597,7 +597,7 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class) "configuration. For 'qeth' devices, this is the " "'relative port number'.", 0, 100, 0, - G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); /** * NMSettingWired:s390-qeth-layer: @@ -610,7 +610,7 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class) "s390 'qeth' layer", "s390 'qeth' device layer, either '2' or '3'.", 2, 3, 2, - G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); /** * NMSettingWired:s390-nettype: -- cgit v1.2.1 From d08b7895fbe11d8b535b2bbfd17b4e3deb3411a3 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 25 Jun 2010 21:44:01 -0700 Subject: core: build composite subchannels for unmanaged spec matching --- src/nm-device-ethernet.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index 80c4795dac..099af34e8a 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -109,7 +109,6 @@ typedef struct { guint8 hw_addr[ETH_ALEN]; /* Currently set MAC address */ guint8 perm_hw_addr[ETH_ALEN]; /* Currently set MAC address */ - char * s390_subchannels; gboolean carrier; NMNetlinkMonitor * monitor; @@ -124,6 +123,7 @@ typedef struct { char * subchan1; char * subchan2; char * subchan3; + char * subchannels; /* Composite used for checking unmanaged specs */ /* PPPoE */ NMPPPManager *ppp_manager; @@ -387,6 +387,18 @@ _update_s390_subchannels (NMDeviceEthernet *self) g_dir_close (dir); + if (priv->subchan3) { + priv->subchannels = g_strdup_printf ("%s,%s,%s", + priv->subchan1, + priv->subchan2, + priv->subchan3); + } else if (priv->subchan2) { + priv->subchannels = g_strdup_printf ("%s,%s", + priv->subchan1, + priv->subchan2); + } else + priv->subchannels = g_strdup (priv->subchan1); + out: if (parent) g_object_unref (parent); @@ -1758,8 +1770,8 @@ spec_match_list (NMDevice *device, const GSList *specs) matched = nm_match_spec_hwaddr (specs, hwaddr); g_free (hwaddr); - if (!matched && priv->s390_subchannels) - matched = nm_match_spec_s390_subchannels (specs, priv->s390_subchannels); + if (!matched && priv->subchannels) + matched = nm_match_spec_s390_subchannels (specs, priv->subchannels); return matched; } @@ -1988,6 +2000,7 @@ dispose (GObject *object) g_free (priv->subchan1); g_free (priv->subchan2); g_free (priv->subchan3); + g_free (priv->subchannels); G_OBJECT_CLASS (nm_device_ethernet_parent_class)->dispose (object); } -- cgit v1.2.1 From 79752954427ed460d530c1551be25fd5819d4dc0 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 25 Jun 2010 21:46:57 -0700 Subject: core: trivial subchannels logging cleanup --- src/nm-device-ethernet.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index 099af34e8a..3a296988f5 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -376,15 +376,6 @@ _update_s390_subchannels (NMDeviceEthernet *self) g_free (cdev_path); }; - driver = nm_device_get_driver (NM_DEVICE (self)); - nm_log_info (LOGD_DEVICE | LOGD_HW, - "(%s): found s390 '%s' subchannels [%s, %s, %s]", - iface, - driver ? driver : "(unknown driver)", - priv->subchan1 ? priv->subchan1 : "(none)", - priv->subchan2 ? priv->subchan2 : "(none)", - priv->subchan3 ? priv->subchan3 : "(none)"); - g_dir_close (dir); if (priv->subchan3) { @@ -399,6 +390,11 @@ _update_s390_subchannels (NMDeviceEthernet *self) } else priv->subchannels = g_strdup (priv->subchan1); + driver = nm_device_get_driver (NM_DEVICE (self)); + nm_log_info (LOGD_DEVICE | LOGD_HW, + "(%s): found s390 '%s' subchannels [%s]", + iface, driver ? driver : "(unknown driver)", priv->subchannels); + out: if (parent) g_object_unref (parent); -- cgit v1.2.1 From cdf8c079ef7f849184a0860cb3856510e9b1c188 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 25 Jun 2010 23:46:47 -0700 Subject: ifcfg-rh: read and write various s390 settings --- system-settings/plugins/ifcfg-rh/reader.c | 70 +++++++++++++++++++++- .../network-scripts/ifcfg-test-wired-qeth-static | 3 + .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 47 +++++++++++++++ system-settings/plugins/ifcfg-rh/writer.c | 28 ++++++++- 4 files changed, 146 insertions(+), 2 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index 5a7d18931e..57eaae9206 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -2926,6 +2926,35 @@ wireless_connection_from_ifcfg (const char *file, return connection; } +#define LAYER2_TAG "layer2=" +#define PORTNO_TAG "portno=" + +static gboolean +get_s390_option (const char *tag, + guint32 min, + guint32 max, + const char *value, + int *out_int_val) +{ + g_return_val_if_fail (tag != NULL, FALSE); + g_return_val_if_fail (value != NULL, FALSE); + + if (strncmp (value, tag, strlen (tag))) + return FALSE; + + if (get_int (value + strlen (tag), out_int_val)) { + if (*out_int_val < min || *out_int_val > max) { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: invalid s390 %s value '%d'", tag, *out_int_val); + return FALSE; + } + } else { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: invalid s390 %s '%s'", tag, value); + return FALSE; + } + + return TRUE; +} + static NMSetting * make_wired_setting (shvarFile *ifcfg, const char *file, @@ -2936,8 +2965,9 @@ make_wired_setting (shvarFile *ifcfg, { NMSettingWired *s_wired; char *value = NULL; - int mtu; + int mtu, portno, layer2; GByteArray *mac = NULL; + char *nettype; s_wired = NM_SETTING_WIRED (nm_setting_wired_new ()); @@ -3015,6 +3045,44 @@ make_wired_setting (shvarFile *ifcfg, g_free (value); } + value = svGetValue (ifcfg, "PORTNAME", FALSE); + if (value && strlen (value)) + g_object_set (s_wired, NM_SETTING_WIRED_S390_PORT_NAME, value, NULL); + g_free (value); + + nettype = svGetValue (ifcfg, "NETTYPE", FALSE); + if (nettype && strlen (nettype)) { + if (!strcmp (nettype, "qeth") || !strcmp (nettype, "lcs") || !strcmp (nettype, "ctc")) + g_object_set (s_wired, NM_SETTING_WIRED_S390_NETTYPE, nettype, NULL); + else + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: unknown s390 NETTYPE '%s'", nettype); + } + + value = svGetValue (ifcfg, "OPTIONS", FALSE); + if (value && strlen (value)) { + char **options, **iter; + + iter = options = g_strsplit_set (value, " ", 0); + while (iter && *iter) { + if (get_s390_option (LAYER2_TAG, 0, 1, *iter, &layer2)) { + if (!nettype || strcmp (nettype, "qeth")) { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: s390 layer2 set but NETTYPE not 'qeth'"); + } else { + if (layer2 == 0) + g_object_set (s_wired, NM_SETTING_WIRED_S390_QETH_LAYER, 3, NULL); + else if (layer2 == 1) + g_object_set (s_wired, NM_SETTING_WIRED_S390_QETH_LAYER, 2, NULL); + } + } else if (get_s390_option (PORTNO_TAG, 0, 100, *iter, &portno)) + g_object_set (s_wired, NM_SETTING_WIRED_S390_PORT_NUMBER, portno, NULL); + iter++; + } + g_strfreev (options); + } + g_free (value); + + g_free (nettype); + if (!nm_controlled && !*unmanaged) { /* If NM_CONTROLLED=no but there wasn't a MAC address or z/VM * subchannels, notify the user that the device cannot be unmanaged. diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-qeth-static b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-qeth-static index b0ec2a9a56..4719de2175 100644 --- a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-qeth-static +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-qeth-static @@ -7,4 +7,7 @@ ONBOOT=yes NETTYPE=qeth SUBCHANNELS=0.0.0600,0.0.0601,0.0.0602 TYPE=Ethernet +PORTNAME=OSAPORT +OPTIONS='layer2=1 portno=0' +MACADDR=02:00:00:23:65:1a diff --git a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index 4cf663f263..829727d82d 100644 --- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -5368,6 +5368,7 @@ test_read_wired_qeth_static (void) const char *expected_channel1 = "0.0.0601"; const char *expected_channel2 = "0.0.0602"; const GPtrArray *subchannels; + guint32 num; connection = connection_from_file (TEST_IFCFG_WIRED_QETH_STATIC, NULL, @@ -5453,6 +5454,48 @@ test_read_wired_qeth_static (void) "wired-qeth-static-verify-wired", "failed to verify %s: unexpected subchannel #2", TEST_IFCFG_WIRED_QETH_STATIC); + /* Nettype */ + tmp = nm_setting_wired_get_s390_nettype (s_wired); + ASSERT (tmp != NULL, + "wired-qeth-static-verify-wired", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_QETH_STATIC, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_S390_NETTYPE); + ASSERT (strcmp (tmp, "qeth") == 0, + "wired-qeth-static-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_QETH_STATIC, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_S390_NETTYPE); + + /* port name */ + tmp = nm_setting_wired_get_s390_port_name (s_wired); + ASSERT (tmp != NULL, + "wired-qeth-static-verify-wired", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_QETH_STATIC, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_S390_PORT_NAME); + ASSERT (strcmp (tmp, "OSAPORT") == 0, + "wired-qeth-static-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_QETH_STATIC, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_S390_PORT_NAME); + + /* port number */ + num = nm_setting_wired_get_s390_port_number (s_wired); + ASSERT (num == 0, + "wired-qeth-static-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_QETH_STATIC, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_S390_PORT_NUMBER); + + /* layer */ + num = nm_setting_wired_get_s390_qeth_layer (s_wired); + ASSERT (num == 2, + "wired-qeth-static-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_QETH_STATIC, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_S390_QETH_LAYER); + /* ===== IPv4 SETTING ===== */ s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); @@ -8893,6 +8936,10 @@ test_write_wired_qeth_dhcp (void) g_ptr_array_add (subchans, "0.0.602"); g_object_set (s_wired, NM_SETTING_WIRED_S390_SUBCHANNELS, subchans, + NM_SETTING_WIRED_S390_NETTYPE, "qeth", + NM_SETTING_WIRED_S390_PORT_NAME, "OSAPORT", + NM_SETTING_WIRED_S390_PORT_NUMBER, 5, + NM_SETTING_WIRED_S390_QETH_LAYER, 3, NULL); g_ptr_array_free (subchans, TRUE); diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c index 511796bf9b..7a64700ab2 100644 --- a/system-settings/plugins/ifcfg-rh/writer.c +++ b/system-settings/plugins/ifcfg-rh/writer.c @@ -842,8 +842,10 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) NMSettingWired *s_wired; const GByteArray *device_mac, *cloned_mac; char *tmp; - guint32 mtu; + const char *nettype, *portname; + guint32 mtu, layer, portno; const GPtrArray *s390_subchannels; + GString *str; s_wired = (NMSettingWired *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED); if (!s_wired) { @@ -896,6 +898,30 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) g_free (tmp); } + svSetValue (ifcfg, "NETTYPE", NULL, FALSE); + nettype = nm_setting_wired_get_s390_nettype (s_wired); + if (nettype) + svSetValue (ifcfg, "NETTYPE", nettype, FALSE); + + svSetValue (ifcfg, "PORTNAME", NULL, FALSE); + portname = nm_setting_wired_get_s390_port_name (s_wired); + if (portname) + svSetValue (ifcfg, "PORTNAME", portname, FALSE); + + svSetValue (ifcfg, "OPTIONS", NULL, FALSE); + if (s390_subchannels && nettype) { + str = g_string_sized_new (20); + if (!strcmp (nettype, "qeth")) { + layer = nm_setting_wired_get_s390_qeth_layer (s_wired); + g_string_append_printf (str, "layer2=%d ", layer == 2 ? 1 : 0); + } + portno = nm_setting_wired_get_s390_port_number (s_wired); + g_string_append_printf (str, "portno=%d", portno); + + svSetValue (ifcfg, "OPTIONS", str->str, FALSE); + g_string_free (str, TRUE); + } + svSetValue (ifcfg, "TYPE", TYPE_ETHERNET, FALSE); return TRUE; -- cgit v1.2.1 From 74a221ab36038361dc02b01986ce15fe69f2e9bf Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 26 Jun 2010 00:14:50 -0700 Subject: core: respect s390 subchannels for auto-activation and config matching --- src/nm-device-ethernet.c | 52 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index 3a296988f5..b851ea12d5 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -1702,6 +1702,41 @@ real_deactivate_quickly (NMDevice *device) _set_hw_addr (self, priv->perm_hw_addr, "reset"); } +static gboolean +match_subchans (NMDeviceEthernet *self, NMSettingWired *s_wired, gboolean *try_mac) +{ + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + const GPtrArray *subchans; + int i; + + *try_mac = TRUE; + + subchans = nm_setting_wired_get_s390_subchannels (s_wired); + if (!subchans) + return TRUE; + + /* connection requires subchannels but the device has none */ + if (!priv->subchannels) + return FALSE; + + /* Make sure each subchannel in the connection is a subchannel of this device */ + for (i = 0; i < subchans->len; i++) { + const char *candidate = g_ptr_array_index (subchans, i); + gboolean found = FALSE; + + if ( (priv->subchan1 && !strcmp (priv->subchan1, candidate)) + || (priv->subchan2 && !strcmp (priv->subchan2, candidate)) + || (priv->subchan3 && !strcmp (priv->subchan3, candidate))) + found = TRUE; + + if (!found) + return FALSE; + } + + *try_mac = FALSE; + return TRUE; +} + static gboolean real_check_connection_compatible (NMDevice *device, NMConnection *connection, @@ -1713,6 +1748,8 @@ real_check_connection_compatible (NMDevice *device, NMSettingWired *s_wired; const char *connection_type; gboolean is_pppoe = FALSE; + const GByteArray *mac; + gboolean try_mac = TRUE; s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); g_assert (s_con); @@ -1739,10 +1776,15 @@ real_check_connection_compatible (NMDevice *device, } if (s_wired) { - const GByteArray *mac; + if (!match_subchans (self, s_wired, &try_mac)) { + g_set_error (error, + NM_ETHERNET_ERROR, NM_ETHERNET_ERROR_CONNECTION_INCOMPATIBLE, + "The connection's s390 subchannels did not match this device."); + return FALSE; + } mac = nm_setting_wired_get_mac_address (s_wired); - if (mac && memcmp (mac->data, &priv->perm_hw_addr, ETH_ALEN)) { + if (try_mac && mac && memcmp (mac->data, &priv->perm_hw_addr, ETH_ALEN)) { g_set_error (error, NM_ETHERNET_ERROR, NM_ETHERNET_ERROR_CONNECTION_INCOMPATIBLE, "The connection's MAC address did not match this device."); @@ -1778,14 +1820,18 @@ wired_match_config (NMDevice *self, NMConnection *connection) NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); NMSettingWired *s_wired; const GByteArray *s_ether; + gboolean try_mac = TRUE; s_wired = (NMSettingWired *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED); if (!s_wired) return FALSE; + if (!match_subchans (NM_DEVICE_ETHERNET (self), s_wired, &try_mac)) + return FALSE; + /* MAC address check */ s_ether = nm_setting_wired_get_mac_address (s_wired); - if (s_ether && memcmp (s_ether->data, priv->perm_hw_addr, ETH_ALEN)) + if (try_mac && s_ether && memcmp (s_ether->data, priv->perm_hw_addr, ETH_ALEN)) return FALSE; return TRUE; -- cgit v1.2.1 From 0ea9329b6e75e86ab64fc29614c911abc8e3658b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 26 Jun 2010 10:03:48 -0700 Subject: wifi: don't request periodic scans when connection is BSSID-locked (bgo #513820) In this case the large user of periodic scanning, intra-ESS roaming, isn't used due to the specific AP lock, so don't scan periodically. --- src/nm-device-wifi.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 808bddc3f4..aecb035255 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -1803,13 +1803,15 @@ scanning_allowed (NMDeviceWifi *self) || nm_supplicant_interface_get_scanning (priv->supplicant.iface)) return FALSE; - /* Don't scan when a shared connection is active; it makes drivers mad */ req = nm_device_get_act_request (NM_DEVICE (self)); if (req) { NMConnection *connection; NMSettingIP4Config *s_ip4; + NMSettingWireless *s_wifi; const char *ip4_method = NULL; + const GByteArray *bssid; + /* Don't scan when a shared connection is active; it makes drivers mad */ connection = nm_act_request_get_connection (req); s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); if (s_ip4) @@ -1817,6 +1819,16 @@ scanning_allowed (NMDeviceWifi *self) if (s_ip4 && !strcmp (ip4_method, NM_SETTING_IP4_CONFIG_METHOD_SHARED)) return FALSE; + + /* Don't scan when the connection is locked to a specifc AP, since + * intra-ESS roaming (which requires periodic scanning) isn't being + * used due to the specific AP lock. (bgo #513820) + */ + s_wifi = (NMSettingWireless *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS); + g_assert (s_wifi); + bssid = nm_setting_wireless_get_bssid (s_wifi); + if (bssid && bssid->len == ETH_ALEN) + return FALSE; } return TRUE; -- cgit v1.2.1 From 44d2f9c4362d0cad9557a0dd47ef0b7f80865767 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDygimantas=20Beru=C4=8Dka?= Date: Sat, 26 Jun 2010 10:27:28 -0700 Subject: po: update Lithuanian translation (bgo #622738) --- po/lt.po | 1145 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 1083 insertions(+), 62 deletions(-) diff --git a/po/lt.po b/po/lt.po index 53092d20b4..3ef27117ff 100644 --- a/po/lt.po +++ b/po/lt.po @@ -1,23 +1,867 @@ # Lithuanian translation of NetworkManager. -# Copyright (C) 2005-2006 Free Software Foundation, Inc. +# Copyright (C) 2005-2010 Free Software Foundation, Inc. # This file is distributed under the same license as the NetworkManager package. -# Žygimantas Beručka , 2005-2006, 2008. -# -# +# Žygimantas Beručka , 2005-2006, 2008, 2010. +# Aurimas Černius , 2010. msgid "" msgstr "" "Project-Id-Version: NetworkManager HEAD\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-03-12 13:21+0200\n" -"PO-Revision-Date: 2009-03-12 13:21+0200\n" -"Last-Translator: Žygimantas Beručka \n" -"Language-Team: Lithuanian \n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-04-30 03:24+0000\n" +"PO-Revision-Date: 2010-06-25 18:30+0300\n" +"Last-Translator: Aurimas Černius \n" +"Language-Team: Lietuvių \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" +"Content-Transfer-Encoding: UTF-8\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%" "100<10 || n%100>=20) ? 1 : 2);\n" +#: ../cli/src/connections.c:86 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Naudojimas: nmcli con { KOMANDA | help }\n" +" KOMANDA := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:158 +msgid "Connections" +msgstr "Ryšiai" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/devices.c:298 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Type" +msgstr "Tipas" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "UUID" +msgstr "UUID" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Name" +msgstr "Pavadinimas" + +#: ../cli/src/connections.c:163 +#, c-format +msgid "System connections:\n" +msgstr "Sistemos ryšiai:\n" + +#: ../cli/src/connections.c:167 +#, c-format +msgid "User connections:\n" +msgstr "Naudotojo ryšiai:\n" + +#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 +#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 +#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 +#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 +#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Klaida: trūksta argumento %s." + +#: ../cli/src/connections.c:189 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Klaida: ryšio %s nėra." + +#: ../cli/src/connections.c:196 +msgid "System-wide connections" +msgstr "Sistemos ryšiai" + +#: ../cli/src/connections.c:205 +msgid "User connections" +msgstr "Naudotojo ryšiai" + +#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 +#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 +#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 +#: ../cli/src/devices.c:798 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Nežinomas parametras: %s\n" + +#: ../cli/src/connections.c:221 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Klaida: nenurodyta tinkamų parametrų." + +#. FIXME: Fix the output +#: ../cli/src/connections.c:268 ../cli/src/devices.c:302 +#: ../cli/src/devices.c:321 ../cli/src/devices.c:353 ../cli/src/devices.c:355 +#: ../cli/src/devices.c:357 ../cli/src/devices.c:359 ../cli/src/devices.c:361 +msgid "yes" +msgstr "taip" + +#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 +msgid "no" +msgstr "ne" + +#: ../cli/src/connections.c:297 +msgid "Active connections" +msgstr "Aktyvūs ryšiai" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 +msgid "Default" +msgstr "Numatyta" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Service" +msgstr "Tarnyba" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Devices" +msgstr "Įrenginiai" + +#: ../cli/src/connections.c:659 +#, c-format +msgid "no active connection on device '%s'" +msgstr "nėra aktyvaus ryšio įrenginyje „%s“" + +#: ../cli/src/connections.c:667 +#, c-format +msgid "no active connection or device" +msgstr "nėra aktyvaus ryšio įrenginyje" + +#: ../cli/src/connections.c:730 +msgid "activating" +msgstr "aktyvuojama" + +#: ../cli/src/connections.c:732 +msgid "activated" +msgstr "aktyvuota" + +#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 +#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 +#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 +msgid "unknown" +msgstr "nežinoma" + +#: ../cli/src/connections.c:744 +msgid "VPN connecting (prepare)" +msgstr "VPN jungiamasi (ruošiama)" + +#: ../cli/src/connections.c:746 +msgid "VPN connecting (need authentication)" +msgstr "VPN jungiamasi (reikia nustatyti tapatybę)" + +#: ../cli/src/connections.c:748 +msgid "VPN connecting" +msgstr "VPN jungiamasi" + +#: ../cli/src/connections.c:750 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN jungiamasi (gaunama IP konfigūracija)" + +#: ../cli/src/connections.c:752 +msgid "VPN connected" +msgstr "VPN prisijungta" + +#: ../cli/src/connections.c:754 +msgid "VPN connection failed" +msgstr "VPN prisijungti nepavyko" + +#: ../cli/src/connections.c:756 +msgid "VPN disconnected" +msgstr "VPN atsijungta" + +#: ../cli/src/connections.c:767 +msgid "unknown reason" +msgstr "nežinoma priežastis" + +#: ../cli/src/connections.c:769 +msgid "none" +msgstr "jokia" + +#: ../cli/src/connections.c:771 +msgid "the user was disconnected" +msgstr "naudotojas buvo atjungtas" + +#: ../cli/src/connections.c:773 +msgid "the base network connection was interrupted" +msgstr "bazinis tinklo ryšys buvo pertrauktas" + +#: ../cli/src/connections.c:775 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN tarnyba netikėtai sustojo" + +#: ../cli/src/connections.c:777 +msgid "the VPN service returned invalid configuration" +msgstr "VPN tarnyba grąžino netinkamą konfigūraciją" + +#: ../cli/src/connections.c:779 +msgid "the connection attempt timed out" +msgstr "bandymo jungtis laikas baigėsi" + +#: ../cli/src/connections.c:781 +msgid "the VPN service did not start in time" +msgstr "VPN tarnyba nebuvo paleista laiku" + +#: ../cli/src/connections.c:783 +msgid "the VPN service failed to start" +msgstr "nepavyko paleisti VPN tarnybos" + +#: ../cli/src/connections.c:785 +msgid "no valid VPN secrets" +msgstr "nėra tinkamų VPN paslapčių" + +#: ../cli/src/connections.c:787 +msgid "invalid VPN secrets" +msgstr "netinkamos VPN paslaptys" + +#: ../cli/src/connections.c:789 +msgid "the connection was removed" +msgstr "ryšys buvo pašalintas" + +#: ../cli/src/connections.c:803 +#, c-format +msgid "state: %s\n" +msgstr "būsena: %s\n" + +#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#, c-format +msgid "Connection activated\n" +msgstr "Ryšys aktyvuotas\n" + +#: ../cli/src/connections.c:809 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Klaida: nepavyko aktyvuoti ryšio." + +#: ../cli/src/connections.c:828 +#, c-format +msgid "state: %s (%d)\n" +msgstr "būsena: %s (%d)\n" + +#: ../cli/src/connections.c:838 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Klaida: nepavyko aktyvuoti ryšio: %s." + +#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Klaida: baigėsi %d sek. laikas." + +#: ../cli/src/connections.c:898 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Klaida: nepavyko aktyvuoti ryšio: %s" + +#: ../cli/src/connections.c:912 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Klaida: nepavyko „%s“ gauti aktyvaus ryšio." + +#: ../cli/src/connections.c:921 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Aktyvaus ryšio būsena: %s\n" + +#: ../cli/src/connections.c:922 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Aktyvaus ryšio kelias: %s\n" + +#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Klaida: nežinomas ryšys: %s" + +#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Klaida: netinkama laukimo laiko reikšmė „%s“." + +#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Klaida: id arba uuid turi būti nurodytas." + +#: ../cli/src/connections.c:1044 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Klaida: nerastas tinkamas įrenginys: %s." + +#: ../cli/src/connections.c:1046 +#, c-format +msgid "Error: No suitable device found." +msgstr "Klaida: nerastas tinkamas įrenginys." + +#: ../cli/src/connections.c:1138 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Įspėjimas: ryšys neaktyvus\n" + +#: ../cli/src/connections.c:1189 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Klaida: netinkama „con“ komanda „%s“." + +#: ../cli/src/connections.c:1216 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Klaida: nepavyko prisijungti prie D-Bus." + +#: ../cli/src/connections.c:1223 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Klaida: nepavyko gauti sistemos nustatymų." + +#: ../cli/src/connections.c:1231 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Klaida: nepavyko gauti naudotojo nustatymų." + +#: ../cli/src/connections.c:1241 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "Klaida: nepavyko gauti ryšių: nustatymų tarnybos neveikia." + +#: ../cli/src/devices.c:73 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" +msgstr "" +"Naudojimas: nmcli dev { KOMANDA | help }\n" +"\n" +" KOMANDA := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" + +#: ../cli/src/devices.c:93 +msgid "unmanaged" +msgstr "nevaldomas" + +#: ../cli/src/devices.c:95 +msgid "unavailable" +msgstr "neprieinamas" + +#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +msgid "disconnected" +msgstr "atjungtas" + +#: ../cli/src/devices.c:99 +msgid "connecting (prepare)" +msgstr "jungiamasi (ruošiama)" + +#: ../cli/src/devices.c:101 +msgid "connecting (configuring)" +msgstr "jungiamasi (konfigūruojama)" + +#: ../cli/src/devices.c:103 +msgid "connecting (need authentication)" +msgstr "jungiamasi (reikia nustatyti tapatybę)" + +#: ../cli/src/devices.c:105 +msgid "connecting (getting IP configuration)" +msgstr "jungiamasi (gaunama IP konfigūracija)" + +#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +msgid "connected" +msgstr "prisijungta" + +#: ../cli/src/devices.c:109 +msgid "connection failed" +msgstr "prisijungti nepavyko" + +#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +msgid "Unknown" +msgstr "Nežinoma" + +#. print them +#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 +#: ../cli/src/devices.c:879 +msgid "(none)" +msgstr "(jokios)" + +#: ../cli/src/devices.c:209 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: klaida konvertuojant IP4 adresą 0x%X" + +#: ../cli/src/devices.c:238 +#, c-format +msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +msgstr "%s, %s, dažnis %d MHz, sparta %d Mb/s, stiprumas %d" + +#: ../cli/src/devices.c:239 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:248 +msgid ", Encrypted: " +msgstr ", šifruota: " + +#: ../cli/src/devices.c:253 +msgid " WEP" +msgstr " WEP" + +#: ../cli/src/devices.c:255 +msgid " WPA" +msgstr " WPA" + +#: ../cli/src/devices.c:257 +msgid " WPA2" +msgstr " WPA2" + +#: ../cli/src/devices.c:260 +msgid " Enterprise" +msgstr " Kompanija" + +#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Device" +msgstr "Įrenginys" + +#: ../cli/src/devices.c:299 +msgid "Driver" +msgstr "Tvarkyklė" + +#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 +msgid "(unknown)" +msgstr "(nežinoma)" + +#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "State" +msgstr "Būsena" + +#: ../cli/src/devices.c:313 +msgid "HW Address" +msgstr "Aparatinis adresas" + +#: ../cli/src/devices.c:319 +#, c-format +msgid "" +"\n" +" Capabilities:\n" +msgstr "" +"\n" +"Galimybės:\n" + +#: ../cli/src/devices.c:321 +msgid "Carrier Detect" +msgstr "Perdavimo aptikimas" + +#: ../cli/src/devices.c:336 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#: ../cli/src/devices.c:337 +msgid "Speed" +msgstr "Sparta" + +#: ../cli/src/devices.c:348 +#, c-format +msgid "" +"\n" +" Wireless Properties\n" +msgstr "" +"\n" +" Belaidžio ryšio savybės\n" + +#: ../cli/src/devices.c:353 +msgid "WEP Encryption" +msgstr "WEP šifravimas" + +#: ../cli/src/devices.c:355 +msgid "WPA Encryption" +msgstr "WPA šifravimas" + +#: ../cli/src/devices.c:357 +msgid "WPA2 Encryption" +msgstr "WPA2 šifravimas" + +#: ../cli/src/devices.c:359 +msgid "TKIP cipher" +msgstr "TKIP šifras" + +#: ../cli/src/devices.c:361 +msgid "CCMP cipher" +msgstr "CCMP šifras" + +#: ../cli/src/devices.c:368 +#, c-format +msgid "" +"\n" +" Wireless Access Points %s\n" +msgstr "" +"\n" +" Belaidžiai prieigos taškai %s\n" + +#: ../cli/src/devices.c:368 +msgid "(* = current AP)" +msgstr "(* = dabartinis prieigos taškas)" + +#: ../cli/src/devices.c:374 +#, c-format +msgid "" +"\n" +" Wired Properties\n" +msgstr "" +"\n" +"Laidinio ryšio savybės\n" + +#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 +msgid "Carrier" +msgstr "Perdavimas" + +#: ../cli/src/devices.c:377 +msgid "on" +msgstr "įjungta" + +#: ../cli/src/devices.c:379 +msgid "off" +msgstr "išjungta" + +#: ../cli/src/devices.c:387 +#, c-format +msgid "" +"\n" +" IPv4 Settings:\n" +msgstr "" +"\n" +" IPv4 nustatymai:\n" + +#: ../cli/src/devices.c:395 +msgid "Address" +msgstr "Adresas" + +#: ../cli/src/devices.c:401 +msgid "Prefix" +msgstr "Priešdėlis" + +#: ../cli/src/devices.c:405 +msgid "Gateway" +msgstr "Šliuzas" + +#: ../cli/src/devices.c:416 +msgid "DNS" +msgstr "DNS" + +#: ../cli/src/devices.c:458 +msgid "Status of devices" +msgstr "Įrenginių būsena" + +#: ../cli/src/devices.c:487 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Klaida: trūksta argumento „%s“." + +#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Klaida: nerastas įrenginys „%s“." + +#: ../cli/src/devices.c:539 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Pavyko: sėkmingai atjungtas įrenginys „%s“." + +#: ../cli/src/devices.c:564 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Klaida: įrenginio „%s“ (%s) atjungti nepavyko: %s" + +#: ../cli/src/devices.c:572 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Įrenginio būsena: %d (%s)\n" + +#: ../cli/src/devices.c:636 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Klaida: turi būti nurodytas iface." + +#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 +msgid "WiFi scan list" +msgstr "WiFi skenavimo sąrašas" + +#: ../cli/src/devices.c:740 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Klaida: „%s“ nėra WiFi įrenginys " + +#: ../cli/src/devices.c:754 +msgid "Device:" +msgstr "Įrenginys:" + +#: ../cli/src/devices.c:806 +#, c-format +msgid "Error: hwaddr has to be specified." +msgstr "Klaida: turi būti nurodytas hwaddr." + +#: ../cli/src/devices.c:844 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Klaida: nerastas prieigos taškas su hwaddr „%s“." + +#: ../cli/src/devices.c:862 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:863 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 +msgid "AP parameters" +msgstr "Prieigos taško parametrai" + +#: ../cli/src/devices.c:873 +msgid "SSID:" +msgstr "SSID:" + +#: ../cli/src/devices.c:874 +msgid "BSSID:" +msgstr "BSSID:" + +#: ../cli/src/devices.c:875 +msgid "Frequency:" +msgstr "Dažnis:" + +#: ../cli/src/devices.c:876 +msgid "Mode:" +msgstr "Veiksena:" + +#: ../cli/src/devices.c:876 +msgid "Ad-hoc" +msgstr "Ad-hoc" + +#: ../cli/src/devices.c:876 +msgid "Infrastructure" +msgstr "Infrastruktūra" + +#: ../cli/src/devices.c:877 +msgid "Maximal bitrate:" +msgstr "Didžiausias galimas bitų dažnis:" + +#: ../cli/src/devices.c:878 +msgid "Strength:" +msgstr "Stiprumas:" + +#: ../cli/src/devices.c:879 +msgid "Flags:" +msgstr "Požymiai:" + +#: ../cli/src/devices.c:879 +msgid "privacy" +msgstr "privatumas" + +#: ../cli/src/devices.c:880 +msgid "WPA flags:" +msgstr "WPA požymiai:" + +#: ../cli/src/devices.c:881 +msgid "RSN flags:" +msgstr "RSN požymiai:" + +#: ../cli/src/devices.c:907 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Klaida: netinkama „dev wifi“ komanda „%s“." + +#: ../cli/src/devices.c:943 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Klaida: netinkama „dev“ komanda „%s“." + +#: ../cli/src/network-manager.c:46 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Naudojimas: nmcli nm { KOMANDA | help }\n" +"\n" +" KOMANDA := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:67 +msgid "asleep" +msgstr "miegantis" + +#: ../cli/src/network-manager.c:69 +msgid "connecting" +msgstr "jungiamasi" + +#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 +msgid "enabled" +msgstr "įjungta" + +#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 +msgid "disabled" +msgstr "išjungta" + +#: ../cli/src/network-manager.c:102 +msgid "NetworkManager status" +msgstr "NetworkManager būsena" + +#: ../cli/src/network-manager.c:104 +msgid "NM running:" +msgstr "NM veikimas:" + +#: ../cli/src/network-manager.c:104 +msgid "running" +msgstr "veikia" + +#: ../cli/src/network-manager.c:104 +msgid "not running" +msgstr "neveikia" + +#: ../cli/src/network-manager.c:105 +msgid "NM state:" +msgstr "NM būsena" + +#: ../cli/src/network-manager.c:106 +msgid "NM wireless hardware:" +msgstr "NM belaidė įranga:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 +msgid "NM wireless:" +msgstr "NM belaidis:" + +#: ../cli/src/network-manager.c:108 +msgid "NM WWAN hardware:" +msgstr "NM WWAN įranga:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 +msgid "NM WWAN:" +msgstr "NM WWAN:" + +#: ../cli/src/network-manager.c:150 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Klaida: netinkamas „wifi“ parametras: „%s“." + +#: ../cli/src/network-manager.c:167 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Klaida: netinkamas „wwan“ parametras: „%s“." + +#: ../cli/src/network-manager.c:178 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Klaida: netinkama „nm“ komanda „%s“." + +#: ../cli/src/nmcli.c:65 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Naudojimas: %s [PARINKTYS] OBJEKTAS { KOMANDA | help }\n" +"\n" +"PARINKTYS\n" +" -t[erse] trumpa išvestis\n" +" -p[retty] graži išvestis\n" +" -v[ersion] rodyti programos versiją\n" +" -h[elp] išvesti šią pagalbą\n" +"\n" +"OBJEKTAS\n" +" nm NetworkManager būsena\n" +" con NetworkManager ryšiai\n" +" dev NetworkManager valdomi įrenginiai\n" +"\n" + +#: ../cli/src/nmcli.c:106 +#, c-format +msgid "Object '%s' is unknown, try 'nmcli help'." +msgstr "Nežinomas objektas „%s“, bandykite „nmcli help“." + +#: ../cli/src/nmcli.c:139 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli įrankis, versija %s\n" + +#: ../cli/src/nmcli.c:145 +#, c-format +msgid "Option '%s' is unknown, try 'nmcli -help'." +msgstr "Nežinoma parinktis „%s“, bandykite „nmcli help“." + +#: ../cli/src/nmcli.c:164 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "Gautas signalas %d, išjungiama..." + +#: ../cli/src/nmcli.c:189 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Klaida: nepavyko prisijungti prie NetworkManager." + +#: ../cli/src/nmcli.c:205 +msgid "Success" +msgstr "Pavyko" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." @@ -105,8 +949,9 @@ msgstr "Nepakanka atminties IV saugojimui." msgid "IV contains non-hexadecimal digits." msgstr "IV yra ne šešioliktainių skaitmenų." -#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:143 -#: ../libnm-util/crypto_nss.c:169 +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "Asmeninio rakto šifras „%s“ nežinomas." @@ -126,71 +971,106 @@ msgstr "Nepavyko nustatyti asmeninio rakto tipo." msgid "Not enough memory to store decrypted private key." msgstr "Nepakanka atminties iššifruoto asmeninio rakto saugojimui." -#: ../libnm-util/crypto_gnutls.c:46 +#: ../libnm-util/crypto_gnutls.c:49 msgid "Failed to initialize the crypto engine." msgstr "Nepavyko inicijuoti šifravimo posistemės." -#: ../libnm-util/crypto_gnutls.c:90 +#: ../libnm-util/crypto_gnutls.c:93 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." msgstr "Nepavyko inicijuoti MD5 posistemės: %s / %s." -#: ../libnm-util/crypto_gnutls.c:152 ../libnm-util/crypto_nss.c:178 +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Netinkamas IV ilgis (turi būti bent %zd)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format msgid "Not enough memory for decrypted key buffer." msgstr "Nepakanka atminties iššifruoto rakto buferiui." -#: ../libnm-util/crypto_gnutls.c:160 +#: ../libnm-util/crypto_gnutls.c:173 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." msgstr "Nepavyko inicijuoti iššifravimo šifro konteksto: %s / %s." -#: ../libnm-util/crypto_gnutls.c:169 +#: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." msgstr "Nepavyko iššifravimui nustatyti simetriško rakto: %s / %s." -#: ../libnm-util/crypto_gnutls.c:178 +#: ../libnm-util/crypto_gnutls.c:191 #, c-format msgid "Failed to set IV for decryption: %s / %s." msgstr "Nepavyko iššifravimui nustatyti IV: %s / %s." -#: ../libnm-util/crypto_gnutls.c:187 +#: ../libnm-util/crypto_gnutls.c:200 #, c-format msgid "Failed to decrypt the private key: %s / %s." msgstr "Nepavyko iššifruoti asmeninio rakto: %s / %s." -#: ../libnm-util/crypto_gnutls.c:200 +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "Nepavyko iššifruoti asmeninio rakto: netikėtas užpildo ilgis." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 #, c-format msgid "Failed to decrypt the private key." msgstr "Nepavyko iššifruoti asmeninio rakto." -#: ../libnm-util/crypto_gnutls.c:235 +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Nepavyko išskirti atminties šifravimui." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Nepavyko inicijuoti šifravimo šifro konteksto: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Nepavyko šifravimui nustatyti simetriško rakto: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Nepavyko šifravimui nustatyti IV: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Nepavyko šifruoti duomenų: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 #, c-format msgid "Error initializing certificate data: %s" msgstr "Klaida inicijuojant liudijimo duomenis: %s" -#: ../libnm-util/crypto_gnutls.c:257 +#: ../libnm-util/crypto_gnutls.c:384 #, c-format msgid "Couldn't decode certificate: %s" msgstr "Nepavyko iškoduoti liudijimo: %s" -#: ../libnm-util/crypto_gnutls.c:281 +#: ../libnm-util/crypto_gnutls.c:408 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %s" msgstr "Nepavyko inicializuoti PKCS#12 dekoderio: %s" -#: ../libnm-util/crypto_gnutls.c:294 +#: ../libnm-util/crypto_gnutls.c:421 #, c-format msgid "Couldn't decode PKCS#12 file: %s" msgstr "Nepavyko iškoduoti PKCS#12 failo: %s" -#: ../libnm-util/crypto_gnutls.c:306 +#: ../libnm-util/crypto_gnutls.c:433 #, c-format msgid "Couldn't verify PKCS#12 file: %s" msgstr "Nepavyko patvirtinti PKCS#12 failo: %s" -#: ../libnm-util/crypto_nss.c:57 +#: ../libnm-util/crypto_nss.c:56 #, c-format msgid "Failed to initialize the crypto engine: %d." msgstr "Nepavyko inicijuoti šifravimo posistemės: %d." @@ -200,107 +1080,186 @@ msgstr "Nepavyko inicijuoti šifravimo posistemės: %d." msgid "Failed to initialize the MD5 context: %d." msgstr "Nepavyko inicijuoti MD5 konteksto: %d." -#: ../libnm-util/crypto_nss.c:186 +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Netinkamas IV ilgis (turi būti bent %d)." + +#: ../libnm-util/crypto_nss.c:196 #, c-format msgid "Failed to initialize the decryption cipher slot." msgstr "Nepavyko inicijuoti iššifravimo šifro lizdo." -#: ../libnm-util/crypto_nss.c:196 +#: ../libnm-util/crypto_nss.c:206 #, c-format msgid "Failed to set symmetric key for decryption." msgstr "Nepavyko iššifravimui nustatyti simetriško rakto." -#: ../libnm-util/crypto_nss.c:206 +#: ../libnm-util/crypto_nss.c:216 #, c-format msgid "Failed to set IV for decryption." msgstr "Nepavyko iššifravimui nustatyti IV." -#: ../libnm-util/crypto_nss.c:214 +#: ../libnm-util/crypto_nss.c:224 #, c-format msgid "Failed to initialize the decryption context." msgstr "Nepavyko inicijuoti iššifravimo konteksto." -#: ../libnm-util/crypto_nss.c:227 +#: ../libnm-util/crypto_nss.c:237 #, c-format msgid "Failed to decrypt the private key: %d." msgstr "Nepavyko iššifruoti asmeninio rakto: %d." -#: ../libnm-util/crypto_nss.c:239 +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "Nepavyko iššifruoti asmeninio rakto: iššifruoti duomenys per dideli." + +#: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." msgstr "Nepavyko baigti asmeninio rakto iššifravimo: %d." -#: ../libnm-util/crypto_nss.c:284 +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "Nepavyko inicijuoti šifravimo šifro lizdo." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "Nepavyko šifravimui nustatyti simetriško rakto." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Nepavyko šifravimui nustatyti IV." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "Nepavyko inicijuoti šifravimo konteksto." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Nepavyko šifruoti: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Netikėtas duomenų kiekis po šifravimo." + +#: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" msgstr "Nepavyko iškoduoti liudijimo: %d" -#: ../libnm-util/crypto_nss.c:319 +#: ../libnm-util/crypto_nss.c:482 #, c-format msgid "Couldn't convert password to UCS2: %d" msgstr "Nepavyko konvertuoti slaptažodžio į UCS-2: %d" -#: ../libnm-util/crypto_nss.c:347 +#: ../libnm-util/crypto_nss.c:510 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" msgstr "Nepavyko inicializuoti PKCS#12 dekoderio: %d" -#: ../libnm-util/crypto_nss.c:356 +#: ../libnm-util/crypto_nss.c:519 #, c-format msgid "Couldn't decode PKCS#12 file: %d" msgstr "Nepavyko iškoduoti PKCS#12 failo: %d" -#: ../libnm-util/crypto_nss.c:365 +#: ../libnm-util/crypto_nss.c:528 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "Nepavyko patvirtinti PKCS#12 failo: %d" -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:458 +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "Nepavyko sugeneruoti atsitiktinių duomenų." + +#: ../libnm-util/nm-utils.c:1924 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Nepakanka atminties šifravimo raktui sukurti." + +#: ../libnm-util/nm-utils.c:2034 +msgid "Could not allocate memory for PEM file creation." +msgstr "Nepakanka atminties PEM failui sukurti." + +#: ../libnm-util/nm-utils.c:2046 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Nepakanka atminties IV įrašyti į PEM failą." + +#: ../libnm-util/nm-utils.c:2058 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "Nepakanka atminties šifruotam raktui įrašyti į PEM failą." + +#: ../libnm-util/nm-utils.c:2077 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Nepakanka atminties PEM failo duomenims." + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format msgid "error processing netlink message: %s" -msgstr "klaida apdorojant netlink pranešimo: %s" +msgstr "klaida apdorojant netlink pranešimą: %s" -#: ../src/nm-netlink-monitor.c:255 +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "laukiant lizde duomenų įvyko klaida" + +#: ../src/nm-netlink-monitor.c:254 #, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "nepavyko rezervuoti netlink valdiklio saito būsenos stebėjimui: %s" +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "nepavyko prisijungti prie netlink saito būsenai stebėti: %s" #: ../src/nm-netlink-monitor.c:265 #, c-format -msgid "unable to connect to netlink for monitoring link status: %s" -msgstr "nepavyko prisijungti prie netlink saito būsenos stebėjimui: %s" +msgid "unable to enable netlink handle credential passing: %s" +msgstr "nepavyko įjungti netlink valdiklio įgaliojimams perduoti: %s" -#: ../src/nm-netlink-monitor.c:273 +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 #, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "nepavyko prisijungti prie netlink grupės saito būsenos stebėjimui: %s" +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "nepavyko rezervuoti netlink valdiklio saito būsenai stebėti: %s" -#: ../src/nm-netlink-monitor.c:281 +#: ../src/nm-netlink-monitor.c:376 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" -msgstr "nepavyko rezervuoti netlink saito podėlio saito būsenos stebėjimui: %s" +msgstr "nepavyko rezervuoti netlink saito podėlio saito būsenai stebėti: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "nepavyko prisijungti prie netlink grupės: %s" -#: ../src/nm-netlink-monitor.c:422 +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 #, c-format msgid "error updating link cache: %s" msgstr "klaida atnaujinant saito podėlį: %s" -#: ../src/nm-netlink-monitor.c:488 -msgid "error occurred while waiting for data on socket" -msgstr "laukiant lizde duomenų įvyko klaida" - -#: ../src/NetworkManager.c:293 +#: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "" "Netinkama parinktis. Galimų parinkčių sąrašą galite pamatyti naudodami " "parametrą --help.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:94 +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. Naudokite --help, galimų parinkčių sąrašui gauti.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 msgid "# Created by NetworkManager\n" msgstr "# Sukurta NetworkManager programos\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:100 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 #, c-format msgid "" "# Merged from %s\n" @@ -309,19 +1268,81 @@ msgstr "" "# Sulieta iš %s\n" "\n" -#: ../src/named-manager/nm-named-manager.c:256 +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "nerastas veikiantis DHCP klientas." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "nerastas „dhclient“." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "nerastas „dhcpcd“." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "nepalaikomas DHCP klientas „%s“." + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "Nežinomas žurnalo vedimo lygis „%s“" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "Nežinomas žurnalo domenas „%s“" + +#: ../src/named-manager/nm-named-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "PASTABA: libc sprendiklis gali nepalaikyti daugiau nei 3 vardų serverių." -#: ../src/named-manager/nm-named-manager.c:258 +#: ../src/named-manager/nm-named-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "Žemiau pateikti vardų serveriai gali būti neatpažinti." -#: ../system-settings/src/nm-default-wired-connection.c:182 +#: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" msgstr "Automatinis %s" -#~ msgid "Not enough memory to create private key decryption key." -#~ msgstr "Nepakanka atminties asmeninio rakto iššifravimo rakto sukūrimui." +#: ../system-settings/plugins/ifcfg-rh/reader.c:3254 +msgid "System" +msgstr "Sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Dalijimasis ryšiu naudojant apsaugotą WiFi tinklą" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Dalijimasis ryšiu naudojant atvirą WiFi tinklą" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Keisti pastovų sistemos vardą" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Keisti sistemos ryšius" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Sistemos politika neleidžia keisti sistemos nustatymų" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "Sistemos politika neleidžia keisti įsiminto sistemos vardo" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"Sistemos politika nelaidžia dalytis ryšiais naudojant apsaugotą WiFi tinklą" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"Sistemos politika neleidžia dalytis ryšiais naudojant atvirą WiFi tinklą" -- cgit v1.2.1 From 067ed11d348b68a52fde728554aecd68460c2743 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 27 Jun 2010 09:02:38 -0700 Subject: build: bump version of git master for post-0.8.1 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index c8499a7ef6..1c54f6088f 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ AC_PREREQ(2.52) -AC_INIT(NetworkManager, 0.8.0.997, dcbw@redhat.com, NetworkManager) +AC_INIT(NetworkManager, 0.8.1, dcbw@redhat.com, NetworkManager) AM_INIT_AUTOMAKE([1.9 subdir-objects tar-ustar no-dist-gzip dist-bzip2]) AM_MAINTAINER_MODE -- cgit v1.2.1 From d83872f46db11e9e7bf752afb7a74b2258bac85a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 28 Jun 2010 18:46:59 +0200 Subject: ipv6: fix a crash when getting 'nameservers' property over D-Bus dbus-send --system --print-reply --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager/IP6Config/0 org.freedesktop.DBus.Properties.Get string:org.freedesktop.NetworkManager string:Nameservers --- src/nm-ip6-config.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c index 2fea38f331..4c6c5c6273 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -654,6 +654,27 @@ finalize (GObject *object) G_OBJECT_CLASS (nm_ip6_config_parent_class)->finalize (object); } +static void +nameservers_to_gvalue (GArray *array, GValue *value) +{ + GPtrArray *dns; + guint i = 0; + + dns = g_ptr_array_new (); + + while (array && (i < array->len)) { + struct in6_addr *addr; + GByteArray *bytearray; + addr = &g_array_index (array, struct in6_addr, i++); + + bytearray = g_byte_array_sized_new (16); + g_byte_array_append (bytearray, (guint8 *) addr->s6_addr, 16); + g_ptr_array_add (dns, bytearray); + } + + g_value_take_boxed (value, dns); +} + static void get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) @@ -665,7 +686,7 @@ get_property (GObject *object, guint prop_id, nm_utils_ip6_addresses_to_gvalue (priv->addresses, value); break; case PROP_NAMESERVERS: - g_value_set_boxed (value, priv->nameservers); + nameservers_to_gvalue (priv->nameservers, value); break; case PROP_DOMAINS: g_value_set_boxed (value, priv->domains); -- cgit v1.2.1 From aa104f9950f81f1c5507c29a77dc9c0bc6c100b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 28 Jun 2010 19:05:40 +0200 Subject: libnm-glib: fix handling of 'nameservers' property in NMIP6Config --- libnm-glib/Makefile.am | 2 +- libnm-glib/nm-ip6-config.c | 6 ++++-- libnm-glib/nm-types.c | 12 ++++++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/libnm-glib/Makefile.am b/libnm-glib/Makefile.am index 6462766b6e..66b72c5416 100644 --- a/libnm-glib/Makefile.am +++ b/libnm-glib/Makefile.am @@ -132,7 +132,7 @@ libnm_glib_la_LIBADD = \ $(GUDEV_LIBS) libnm_glib_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-glib.ver \ - -version-info "6:0:4" + -version-info "6:1:4" noinst_PROGRAMS = libnm-glib-test diff --git a/libnm-glib/nm-ip6-config.c b/libnm-glib/nm-ip6-config.c index f7a2107520..1f2d13beff 100644 --- a/libnm-glib/nm-ip6-config.c +++ b/libnm-glib/nm-ip6-config.c @@ -92,7 +92,7 @@ demarshal_ip6_nameserver_array (NMObject *object, GParamSpec *pspec, GValue *val if (!_nm_ip6_address_array_demarshal (value, (GSList **) field)) return FALSE; - if (!strcmp (pspec->name, NM_IP6_CONFIG_NAMESERVERS)) + if (pspec && !strcmp (pspec->name, NM_IP6_CONFIG_NAMESERVERS)) _nm_object_queue_notify (object, NM_IP6_CONFIG_NAMESERVERS); return TRUE; @@ -188,6 +188,7 @@ const GSList * nm_ip6_config_get_nameservers (NMIP6Config *config) { NMIP6ConfigPrivate *priv; + GParamSpec *pspec; GValue value = {0,}; g_return_val_if_fail (NM_IS_IP6_CONFIG (config), NULL); @@ -203,7 +204,8 @@ nm_ip6_config_get_nameservers (NMIP6Config *config) return NULL; } - demarshal_ip6_nameserver_array (NM_OBJECT (config), NULL, &value, &priv->nameservers); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (G_OBJECT (config)), NM_IP6_CONFIG_NAMESERVERS); + demarshal_ip6_nameserver_array (NM_OBJECT (config), pspec, &value, &priv->nameservers); g_value_unset (&value); return priv->nameservers; diff --git a/libnm-glib/nm-types.c b/libnm-glib/nm-types.c index baceb86ba6..cf9e084c77 100644 --- a/libnm-glib/nm-types.c +++ b/libnm-glib/nm-types.c @@ -359,7 +359,7 @@ _nm_ip6_address_array_demarshal (GValue *value, GSList **dest) { GPtrArray *array; - if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_UINT_ARRAY)) + if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UCHAR)) return FALSE; if (*dest) { @@ -373,12 +373,12 @@ _nm_ip6_address_array_demarshal (GValue *value, GSList **dest) int i; for (i = 0; i < array->len; i++) { - struct in6_addr *addr = g_ptr_array_index (array, i); - struct in6_addr *dup; + GByteArray *bytearray = (GByteArray *) g_ptr_array_index (array, i); + struct in6_addr *addr; - dup = g_malloc0 (sizeof (struct in6_addr)); - memcpy (dup, addr, sizeof (struct in6_addr)); - *dest = g_slist_append (*dest, dup); + addr = g_malloc0 (sizeof (struct in6_addr)); + memcpy (addr->s6_addr, bytearray->data, bytearray->len); + *dest = g_slist_append (*dest, addr); } } -- cgit v1.2.1 From 2767195a9c85478a7e81bf5d8756cc0102632f07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 28 Jun 2010 19:23:35 +0200 Subject: nm-tool: print IPv6 settings in nm-tool --- test/nm-tool.c | 100 ++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 77 insertions(+), 23 deletions(-) diff --git a/test/nm-tool.c b/test/nm-tool.c index 9a1a0ba61b..700e1c430d 100644 --- a/test/nm-tool.c +++ b/test/nm-tool.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -210,6 +211,28 @@ ip4_address_as_string (guint32 ip) } } +static gchar * +ip6_address_as_string (const struct in6_addr *ip) +{ + char buf[INET6_ADDRSTRLEN]; + + memset (&buf, '\0', sizeof (buf)); + + if (inet_ntop (AF_INET6, ip, buf, INET6_ADDRSTRLEN)) { + return g_strdup (buf); + } else { + int j; + GString *ip6_str = g_string_new (NULL); + g_string_append_printf (ip6_str, "%02X", ip->s6_addr[0]); + for (j = 1; j < 16; j++) + g_string_append_printf (ip6_str, " %02X", ip->s6_addr[j]); + nm_warning ("%s: error converting IP6 address %s", + __func__, ip6_str->str); + g_string_free (ip6_str, TRUE); + return NULL; + } +} + static const char * get_dev_state_string (NMDeviceState state) { @@ -399,38 +422,69 @@ detail_device (gpointer data, gpointer user_data) /* IP Setup info */ if (state == NM_DEVICE_STATE_ACTIVATED) { - NMIP4Config *cfg = nm_device_get_ip4_config (device); + NMIP4Config *cfg4 = nm_device_get_ip4_config (device); + NMIP6Config *cfg6 = nm_device_get_ip6_config (device); GSList *iter; - printf ("\n IPv4 Settings:\n"); + if (cfg4) { + printf ("\n IPv4 Settings:\n"); + + for (iter = (GSList *) nm_ip4_config_get_addresses (cfg4); iter; iter = g_slist_next (iter)) { + NMIP4Address *addr = (NMIP4Address *) iter->data; + guint32 prefix = nm_ip4_address_get_prefix (addr); + char *tmp2; + + tmp = ip4_address_as_string (nm_ip4_address_get_address (addr)); + print_string (" Address", tmp); + g_free (tmp); - for (iter = (GSList *) nm_ip4_config_get_addresses (cfg); iter; iter = g_slist_next (iter)) { - NMIP4Address *addr = (NMIP4Address *) iter->data; - guint32 prefix = nm_ip4_address_get_prefix (addr); - char *tmp2; + tmp2 = ip4_address_as_string (nm_utils_ip4_prefix_to_netmask (prefix)); + tmp = g_strdup_printf ("%d (%s)", prefix, tmp2); + g_free (tmp2); + print_string (" Prefix", tmp); + g_free (tmp); - tmp = ip4_address_as_string (nm_ip4_address_get_address (addr)); - print_string (" Address", tmp); - g_free (tmp); + tmp = ip4_address_as_string (nm_ip4_address_get_gateway (addr)); + print_string (" Gateway", tmp); + g_free (tmp); + printf ("\n"); + } - tmp2 = ip4_address_as_string (nm_utils_ip4_prefix_to_netmask (prefix)); - tmp = g_strdup_printf ("%d (%s)", prefix, tmp2); - g_free (tmp2); - print_string (" Prefix", tmp); - g_free (tmp); + array = nm_ip4_config_get_nameservers (cfg4); + if (array) { + int i; - tmp = ip4_address_as_string (nm_ip4_address_get_gateway (addr)); - print_string (" Gateway", tmp); - g_free (tmp); - printf ("\n"); + for (i = 0; i < array->len; i++) { + tmp = ip4_address_as_string (g_array_index (array, guint32, i)); + print_string (" DNS", tmp); + g_free (tmp); + } + } } - array = nm_ip4_config_get_nameservers (cfg); - if (array) { - int i; + if (cfg6) { + printf ("\n IPv6 Settings:\n"); + + for (iter = (GSList *) nm_ip6_config_get_addresses (cfg6); iter; iter = g_slist_next (iter)) { + NMIP6Address *addr = (NMIP6Address *) iter->data; + guint32 prefix = nm_ip6_address_get_prefix (addr); + + tmp = ip6_address_as_string (nm_ip6_address_get_address (addr)); + print_string (" Address", tmp); + g_free (tmp); + + tmp = g_strdup_printf ("%d", prefix); + print_string (" Prefix", tmp); + g_free (tmp); + + tmp = ip6_address_as_string (nm_ip6_address_get_gateway (addr)); + print_string (" Gateway", tmp); + g_free (tmp); + printf ("\n"); + } - for (i = 0; i < array->len; i++) { - tmp = ip4_address_as_string (g_array_index (array, guint32, i)); + for (iter = (GSList *) nm_ip6_config_get_nameservers (cfg6); iter; iter = g_slist_next (iter)) { + tmp = ip6_address_as_string (iter->data); print_string (" DNS", tmp); g_free (tmp); } -- cgit v1.2.1 From 3d4b6163b97179b5dd0e55c66fee9ba3aef5e983 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 28 Jun 2010 11:18:12 -0700 Subject: dhcp: try /etc/dhcp too for !SUSE && !DEBIAN && !GENTOO (rh #607759) --- src/dhcp-manager/nm-dhcp-dhclient.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c index d7a6e32fb3..25a57a3a6a 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.c +++ b/src/dhcp-manager/nm-dhcp-dhclient.c @@ -450,6 +450,18 @@ create_dhclient_config (const char *iface, return FALSE; } +#if !defined(TARGET_SUSE) && !defined(TARGET_DEBIAN) && !defined(TARGET_GENTOO) + /* Try /etc/dhcp/ too (rh #607759) */ + if (!g_file_test (orig, G_FILE_TEST_EXISTS)) { + g_free (orig); + orig = g_strdup_printf (SYSCONFDIR "/dhcp/dhclient-%s.conf", iface); + if (!orig) { + nm_log_warn (LOGD_DHCP, "(%s): not enough memory for dhclient options.", iface); + return FALSE; + } + } +#endif + tmp = g_strdup_printf ("nm-dhclient-%s.conf", iface); conf_file = g_build_filename ("/var", "run", tmp, NULL); g_free (tmp); -- cgit v1.2.1 From 6893b3d0dde4e05ee47b60fcba8e2710346722a4 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 28 Jun 2010 15:15:23 -0700 Subject: libnm-util: ensure empty VPN secrets are not used (rh #587784) --- libnm-util/nm-setting-vpn.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/libnm-util/nm-setting-vpn.c b/libnm-util/nm-setting-vpn.c index cef8323432..53b609e2d8 100644 --- a/libnm-util/nm-setting-vpn.c +++ b/libnm-util/nm-setting-vpn.c @@ -248,6 +248,7 @@ static gboolean update_one_secret (NMSetting *setting, const char *key, GValue *value, GError **error) { NMSettingVPNPrivate *priv = NM_SETTING_VPN_GET_PRIVATE (setting); + char *str; g_return_val_if_fail (key != NULL, FALSE); g_return_val_if_fail (value != NULL, FALSE); @@ -259,8 +260,17 @@ update_one_secret (NMSetting *setting, const char *key, GValue *value, GError ** return FALSE; } - g_hash_table_insert (priv->secrets, g_strdup (key), g_value_dup_string (value)); - return FALSE; + str = g_value_dup_string (value); + if (!str || !strlen (str)) { + g_set_error (error, NM_SETTING_ERROR, + NM_SETTING_ERROR_PROPERTY_TYPE_MISMATCH, + "Secret %s was empty", key); + g_free (str); + return FALSE; + } + + g_hash_table_insert (priv->secrets, g_strdup (key), str); + return TRUE; } static void -- cgit v1.2.1 From 26312c087e3b6a4789278abdc1aa356cfce8b38d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 28 Jun 2010 17:17:24 -0700 Subject: core: simplify DHCP hostname handling Reduce memory usage by not duplicating the IP4 setting. --- src/dhcp-manager/nm-dhcp-client.c | 8 +++++--- src/dhcp-manager/nm-dhcp-client.h | 8 ++++++-- src/dhcp-manager/nm-dhcp-dhclient.c | 19 +++++++++-------- src/dhcp-manager/nm-dhcp-dhcpcd.c | 7 ++++--- src/dhcp-manager/nm-dhcp-manager.c | 41 +++++++++++++++++++------------------ 5 files changed, 47 insertions(+), 36 deletions(-) diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c index 5cebaa84ee..1ed62ab9df 100644 --- a/src/dhcp-manager/nm-dhcp-client.c +++ b/src/dhcp-manager/nm-dhcp-client.c @@ -293,7 +293,8 @@ start_monitor (NMDHCPClient *self) gboolean nm_dhcp_client_start_ip4 (NMDHCPClient *self, NMSettingIP4Config *s_ip4, - guint8 *dhcp_anycast_addr) + guint8 *dhcp_anycast_addr, + const char *hostname) { NMDHCPClientPrivate *priv; @@ -308,7 +309,7 @@ nm_dhcp_client_start_ip4 (NMDHCPClient *self, nm_log_info (LOGD_DHCP, "Activation (%s) Beginning DHCPv4 transaction (timeout in %d seconds)", priv->iface, priv->timeout); - priv->pid = NM_DHCP_CLIENT_GET_CLASS (self)->ip4_start (self, s_ip4, dhcp_anycast_addr); + priv->pid = NM_DHCP_CLIENT_GET_CLASS (self)->ip4_start (self, s_ip4, dhcp_anycast_addr, hostname); if (priv->pid) start_monitor (self); @@ -319,6 +320,7 @@ gboolean nm_dhcp_client_start_ip6 (NMDHCPClient *self, NMSettingIP6Config *s_ip6, guint8 *dhcp_anycast_addr, + const char *hostname, gboolean info_only) { NMDHCPClientPrivate *priv; @@ -336,7 +338,7 @@ nm_dhcp_client_start_ip6 (NMDHCPClient *self, nm_log_info (LOGD_DHCP, "Activation (%s) Beginning DHCPv6 transaction (timeout in %d seconds)", priv->iface, priv->timeout); - priv->pid = NM_DHCP_CLIENT_GET_CLASS (self)->ip6_start (self, s_ip6, dhcp_anycast_addr, info_only); + priv->pid = NM_DHCP_CLIENT_GET_CLASS (self)->ip6_start (self, s_ip6, dhcp_anycast_addr, hostname, info_only); if (priv->pid > 0) start_monitor (self); diff --git a/src/dhcp-manager/nm-dhcp-client.h b/src/dhcp-manager/nm-dhcp-client.h index 92b2b8fe51..8c2d465310 100644 --- a/src/dhcp-manager/nm-dhcp-client.h +++ b/src/dhcp-manager/nm-dhcp-client.h @@ -87,11 +87,13 @@ typedef struct { GPid (*ip4_start) (NMDHCPClient *self, NMSettingIP4Config *s_ip4, - guint8 *anycast_addr); + guint8 *anycast_addr, + const char *hostname); GPid (*ip6_start) (NMDHCPClient *self, NMSettingIP6Config *s_ip6, guint8 *anycast_addr, + const char *hostname, gboolean info_only); void (*stop) (NMDHCPClient *self); @@ -114,11 +116,13 @@ const char *nm_dhcp_client_get_uuid (NMDHCPClient *self); gboolean nm_dhcp_client_start_ip4 (NMDHCPClient *self, NMSettingIP4Config *s_ip4, - guint8 *dhcp_anycast_addr); + guint8 *dhcp_anycast_addr, + const char *hostname); gboolean nm_dhcp_client_start_ip6 (NMDHCPClient *self, NMSettingIP6Config *s_ip6, guint8 *dhcp_anycast_addr, + const char *hostname, gboolean info_only); void nm_dhcp_client_stop (NMDHCPClient *self); diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c index 25a57a3a6a..7529a57f13 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.c +++ b/src/dhcp-manager/nm-dhcp-dhclient.c @@ -312,6 +312,7 @@ merge_dhclient_config (const char *iface, const char *conf_file, NMSettingIP4Config *s_ip4, guint8 *anycast_addr, + const char *hostname, const char *orig_path, GError **error) { @@ -353,7 +354,7 @@ merge_dhclient_config (const char *iface, ignore = TRUE; if ( s_ip4 - && nm_setting_ip4_config_get_dhcp_hostname (s_ip4) + && hostname && !strncmp (*line, DHCP_HOSTNAME_TAG, strlen (DHCP_HOSTNAME_TAG))) ignore = TRUE; @@ -396,9 +397,8 @@ merge_dhclient_config (const char *iface, g_string_append_printf (new_contents, DHCP_CLIENT_ID_FORMAT "\n", tmp); } - tmp = nm_setting_ip4_config_get_dhcp_hostname (s_ip4); - if (tmp) - g_string_append_printf (new_contents, DHCP_HOSTNAME_FORMAT "\n", tmp); + if (hostname) + g_string_append_printf (new_contents, DHCP_HOSTNAME_FORMAT "\n", hostname); } if (anycast_addr) { @@ -427,7 +427,8 @@ merge_dhclient_config (const char *iface, static char * create_dhclient_config (const char *iface, NMSettingIP4Config *s_ip4, - guint8 *dhcp_anycast_addr) + guint8 *dhcp_anycast_addr, + const char *hostname) { char *orig = NULL, *tmp, *conf_file = NULL; GError *error = NULL; @@ -467,7 +468,7 @@ create_dhclient_config (const char *iface, g_free (tmp); error = NULL; - success = merge_dhclient_config (iface, conf_file, s_ip4, dhcp_anycast_addr, orig, &error); + success = merge_dhclient_config (iface, conf_file, s_ip4, dhcp_anycast_addr, hostname, orig, &error); if (!success) { nm_log_warn (LOGD_DHCP, "(%s): error creating dhclient configuration: %s", iface, error->message); @@ -580,14 +581,15 @@ dhclient_start (NMDHCPClient *client, static GPid real_ip4_start (NMDHCPClient *client, NMSettingIP4Config *s_ip4, - guint8 *dhcp_anycast_addr) + guint8 *dhcp_anycast_addr, + const char *hostname) { NMDHCPDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE (client); const char *iface; iface = nm_dhcp_client_get_iface (client); - priv->conf_file = create_dhclient_config (iface, s_ip4, dhcp_anycast_addr); + priv->conf_file = create_dhclient_config (iface, s_ip4, dhcp_anycast_addr, hostname); if (!priv->conf_file) { nm_log_warn (LOGD_DHCP4, "(%s): error creating dhclient configuration file.", iface); return -1; @@ -600,6 +602,7 @@ static GPid real_ip6_start (NMDHCPClient *client, NMSettingIP6Config *s_ip6, guint8 *dhcp_anycast_addr, + const char *hostname, gboolean info_only) { return dhclient_start (client, "-6", info_only ? "-S" : "-N"); diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.c b/src/dhcp-manager/nm-dhcp-dhcpcd.c index 403431fcb4..c9fdc956e3 100644 --- a/src/dhcp-manager/nm-dhcp-dhcpcd.c +++ b/src/dhcp-manager/nm-dhcp-dhcpcd.c @@ -88,14 +88,15 @@ dhcpcd_child_setup (gpointer user_data G_GNUC_UNUSED) static GPid real_ip4_start (NMDHCPClient *client, NMSettingIP4Config *s_ip4, - guint8 *dhcp_anycast_addr) + guint8 *dhcp_anycast_addr, + const char *hostname) { NMDHCPDhcpcdPrivate *priv = NM_DHCP_DHCPCD_GET_PRIVATE (client); GPtrArray *argv = NULL; GPid pid = -1; GError *error = NULL; char *pid_contents = NULL, *binary_name, *cmd_str; - const char *iface, *uuid, *hostname; + const char *iface, *uuid; g_return_val_if_fail (priv->pid_file == NULL, -1); @@ -130,7 +131,6 @@ real_ip4_start (NMDHCPClient *client, g_ptr_array_add (argv, (gpointer) "-c"); /* Set script file */ g_ptr_array_add (argv, (gpointer) ACTION_SCRIPT_PATH ); - hostname = nm_setting_ip4_config_get_dhcp_hostname (s_ip4); if (hostname && strlen (hostname)) { g_ptr_array_add (argv, (gpointer) "-h"); /* Send hostname to DHCP server */ g_ptr_array_add (argv, (gpointer) hostname ); @@ -160,6 +160,7 @@ static GPid real_ip6_start (NMDHCPClient *client, NMSettingIP6Config *s_ip6, guint8 *dhcp_anycast_addr, + const char *hostname, gboolean info_only) { nm_log_warn (LOGD_DHCP6, "the dhcpcd backend does not support IPv6."); diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c index 7b110fb232..bde874fb7b 100644 --- a/src/dhcp-manager/nm-dhcp-manager.c +++ b/src/dhcp-manager/nm-dhcp-manager.c @@ -407,6 +407,7 @@ client_start (NMDHCPManager *self, NMSettingIP6Config *s_ip6, guint32 timeout, guint8 *dhcp_anycast_addr, + const char *hostname, gboolean info_only) { NMDHCPManagerPrivate *priv; @@ -438,9 +439,9 @@ client_start (NMDHCPManager *self, add_client (self, client); if (ipv6) - success = nm_dhcp_client_start_ip6 (client, s_ip6, dhcp_anycast_addr, info_only); + success = nm_dhcp_client_start_ip6 (client, s_ip6, dhcp_anycast_addr, hostname, info_only); else - success = nm_dhcp_client_start_ip4 (client, s_ip4, dhcp_anycast_addr); + success = nm_dhcp_client_start_ip4 (client, s_ip4, dhcp_anycast_addr, hostname); if (!success) { remove_client (self, client); @@ -462,6 +463,7 @@ nm_dhcp_manager_start_ip4 (NMDHCPManager *self, { NMDHCPManagerPrivate *priv; NMDHCPClient *client = NULL; + const char *hostname = NULL; g_return_val_if_fail (self, NULL); g_return_val_if_fail (NM_IS_DHCP_MANAGER (self), NULL); @@ -476,27 +478,26 @@ nm_dhcp_manager_start_ip4 (NMDHCPManager *self, g_return_val_if_fail (strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0, NULL); } - if ( nm_setting_ip4_config_get_dhcp_send_hostname (s_ip4) - && (nm_setting_ip4_config_get_dhcp_hostname (s_ip4) == NULL) - && priv->hostname_provider != NULL) { + /* If we're asked to send the hostname to DHCP server, and the hostname + * isn't specified, and a hostname provider is registered: use that + */ + if (nm_setting_ip4_config_get_dhcp_send_hostname (s_ip4)) { + hostname = nm_setting_ip4_config_get_dhcp_hostname (s_ip4); - s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_duplicate (NM_SETTING (s_ip4))); - - /* We're asked to send the hostname to DHCP server, the hostname - * isn't specified, and a hostname provider is registered: use that + /* If we're supposed to send the hostname to the DHCP server but + * the user didn't specify one, use the persistent hostname. */ - g_object_set (G_OBJECT (s_ip4), - NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, - nm_hostname_provider_get_hostname (priv->hostname_provider), - NULL); - } else - g_object_ref (s_ip4); + if (!hostname && priv->hostname_provider) { + hostname = nm_hostname_provider_get_hostname (priv->hostname_provider); + if ( hostname + && (!strcmp (hostname, "localhost.localdomain") || + !strcmp (hostname, "localhost6.localdomain6"))) + hostname = NULL; + } + } } - client = client_start (self, iface, uuid, FALSE, s_ip4, NULL, timeout, dhcp_anycast_addr, FALSE); - - if (s_ip4) - g_object_unref (s_ip4); + client = client_start (self, iface, uuid, FALSE, s_ip4, NULL, timeout, dhcp_anycast_addr, hostname, FALSE); return client; } @@ -511,7 +512,7 @@ nm_dhcp_manager_start_ip6 (NMDHCPManager *self, guint8 *dhcp_anycast_addr, gboolean info_only) { - return client_start (self, iface, uuid, TRUE, NULL, s_ip6, timeout, dhcp_anycast_addr, info_only); + return client_start (self, iface, uuid, TRUE, NULL, s_ip6, timeout, dhcp_anycast_addr, NULL, info_only); } static void -- cgit v1.2.1 From 16bccfd672e7584ce52f191bfbcec6dc2b1893b9 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 29 Jun 2010 00:37:14 -0700 Subject: core: handle s390 options more cleanly There are so many... so handle them as a table of key/value pairs instead of having separate functions for each one. At the moment nothing but subchannels is used internally, but this allows plugins to preserve options that NM doesn't care about when reading/writing system configuration. --- libnm-util/libnm-util.ver | 10 +- libnm-util/nm-setting-wired.c | 323 +++++++++++++++------ libnm-util/nm-setting-wired.h | 21 +- system-settings/plugins/ifcfg-rh/reader.c | 56 +--- .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 47 +-- system-settings/plugins/ifcfg-rh/writer.c | 30 +- 6 files changed, 307 insertions(+), 180 deletions(-) diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver index 7afab54ddc..6c2b9fc71e 100644 --- a/libnm-util/libnm-util.ver +++ b/libnm-util/libnm-util.ver @@ -290,11 +290,13 @@ global: nm_setting_wired_get_mac_address; nm_setting_wired_get_cloned_mac_address; nm_setting_wired_get_mtu; - nm_setting_wired_get_s390_subchannels; - nm_setting_wired_get_s390_port_name; - nm_setting_wired_get_s390_port_number; - nm_setting_wired_get_s390_qeth_layer; + nm_setting_wired_get_num_s390_options; nm_setting_wired_get_s390_nettype; + nm_setting_wired_get_s390_option; + nm_setting_wired_get_s390_option_by_key; + nm_setting_wired_add_s390_option; + nm_setting_wired_get_s390_subchannels; + nm_setting_wired_remove_s390_option; nm_setting_wireless_ap_security_compatible; nm_setting_wireless_error_get_type; nm_setting_wireless_error_quark; diff --git a/libnm-util/nm-setting-wired.c b/libnm-util/nm-setting-wired.c index 90f0a1ad12..b18f691f21 100644 --- a/libnm-util/nm-setting-wired.c +++ b/libnm-util/nm-setting-wired.c @@ -24,8 +24,10 @@ */ #include +#include #include #include + #include "nm-setting-wired.h" #include "nm-param-spec-specialized.h" #include "nm-utils.h" @@ -79,10 +81,8 @@ typedef struct { GByteArray *cloned_mac_address; guint32 mtu; GPtrArray *s390_subchannels; - char *s390_port_name; - guint32 s390_port_number; - guint32 s390_qeth_layer; char *s390_nettype; + GHashTable *s390_options; } NMSettingWiredPrivate; enum { @@ -95,14 +95,22 @@ enum { PROP_CLONED_MAC_ADDRESS, PROP_MTU, PROP_S390_SUBCHANNELS, - PROP_S390_PORT_NAME, - PROP_S390_PORT_NUMBER, - PROP_S390_QETH_LAYER, PROP_S390_NETTYPE, + PROP_S390_OPTIONS, LAST_PROP }; +static const char *valid_s390_opts[] = { + "portno", "layer2", "portname", "protocol", "priority_queueing", + "buffer_count", "isolation", "total", "inter", "inter_jumbo", "route4", + "route6", "fake_broadcast", "broadcast_mode", "canonical_macaddr", + "checksumming", "sniffer", "large_send", "ipato_enable", "ipato_invert4", + "ipato_add4", "ipato_invert6", "ipato_add6", "vipa_add4", "vipa_add6", + "rxip_add4", "rxip_add6", "lancmd_timeout", + NULL +}; + NMSetting * nm_setting_wired_new (void) { @@ -165,6 +173,17 @@ nm_setting_wired_get_mtu (NMSettingWired *setting) return NM_SETTING_WIRED_GET_PRIVATE (setting)->mtu; } +/** + * nm_setting_wired_get_s390_subchannels: + * @setting: the #NMSettingWired + * + * Return the list of s390 subchannels that identify the device that this + * connection is applicable to. The connection should only be used in + * conjunction with that device. + * + * Returns: a #GPtrArray of strings, each specifying one subchannel the + * s390 device uses to communicate to the host. + **/ const GPtrArray * nm_setting_wired_get_s390_subchannels (NMSettingWired *setting) { @@ -173,36 +192,167 @@ nm_setting_wired_get_s390_subchannels (NMSettingWired *setting) return NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_subchannels; } +/** + * nm_setting_wired_get_s390_nettype: + * @setting: the #NMSettingWired + * + * Returns the s390 device type this connection should apply to. Will be one + * of 'qeth', 'lcs', or 'ctcm'. + * + * Returns: the s390 device type + **/ const char * -nm_setting_wired_get_s390_port_name (NMSettingWired *setting) +nm_setting_wired_get_s390_nettype (NMSettingWired *setting) { g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), NULL); - return NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_port_name; + return NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_nettype; } +/** + * nm_setting_wired_get_num_s390_options: + * @setting: the #NMSettingWired + * + * Returns the number of s390-specific options that should be set for this + * device when it is activated. This can be used to retrieve each s390 + * option individually using nm_setting_wired_get_s390_option(). + * + * Returns: the number of s390-specific device options + **/ guint32 -nm_setting_wired_get_s390_port_number (NMSettingWired *setting) +nm_setting_wired_get_num_s390_options (NMSettingWired *setting) { g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), 0); - return NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_port_number; + return g_hash_table_size (NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_options); } -guint32 -nm_setting_wired_get_s390_qeth_layer (NMSettingWired *setting) +/** + * nm_setting_wired_get_s390_option: + * @setting: the #NMSettingWired + * @idx: index of the desired option, from 0 to + * nm_setting_wired_get_num_s390_options() - 1 + * @out_key: on return, the key name of the s390 specific option; this value is + * owned by the setting and should not be modified + * @out_value: on return, the value of the key of the s390 specific option; this + * value is owned by the setting and should not be modified + * + * Given an index, return the value of the s390 option at that index. indexes + * are *not* guaranteed to be static across modifications to options done by + * nm_setting_wired_add_s390_option() and nm_setting_wired_remove_s390_option(), + * and should not be used to refer to options except for short periods of time + * such as during option iteration. + * + * Returns: %TRUE on success if the index was valid and an option was found, + * %FALSE if the index was invalid (ie, greater than the number of options + * currently held by the setting) + **/ +gboolean +nm_setting_wired_get_s390_option (NMSettingWired *setting, + guint32 idx, + const char **out_key, + const char **out_value) { - g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), 2); + NMSettingWiredPrivate *priv; + guint32 num_keys; + GList *keys; + const char *_key = NULL, *_value = NULL; + + g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), FALSE); + + priv = NM_SETTING_WIRED_GET_PRIVATE (setting); - return NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_qeth_layer; + num_keys = nm_setting_wired_get_num_s390_options (setting); + g_return_val_if_fail (idx < num_keys, FALSE); + + keys = g_hash_table_get_keys (priv->s390_options); + _key = g_list_nth_data (keys, idx); + _value = g_hash_table_lookup (priv->s390_options, _key); + + if (out_key) + *out_key = _key; + if (out_value) + *out_value = _value; + return TRUE; } +/** + * nm_setting_wired_get_s390_option_by_key: + * @setting: the #NMSettingWired + * @key: the key for which to retrieve the value + * + * Returns the value associated with the s390-specific option specified by + * @key, if it exists. + * + * Returns: the value, or NULL if the key/value pair was never added to the + * setting; the value is owned by the setting and must not be modified + **/ const char * -nm_setting_wired_get_s390_nettype (NMSettingWired *setting) +nm_setting_wired_get_s390_option_by_key (NMSettingWired *setting, + const char *key) { g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), NULL); + g_return_val_if_fail (key != NULL, NULL); + g_return_val_if_fail (strlen (key), NULL); - return NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_nettype; + return g_hash_table_lookup (NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_options, key); +} + +/** + * nm_setting_wired_add_s390_options: + * @setting: the #NMSettingWired + * @key: key name for the option + * @value: value for the option + * + * Add an option to the table. The option is compared to an internal list + * of allowed options. Key names may contain only alphanumeric characters + * (ie [a-zA-Z0-9]). Adding a new key replaces any existing key/value pair that + * may already exist. + * + * Returns: %TRUE if the option was valid and was added to the internal option + * list, %FALSE if it was not. + **/ +gboolean nm_setting_wired_add_s390_option (NMSettingWired *setting, + const char *key, + const char *value) +{ + size_t value_len; + + g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), FALSE); + g_return_val_if_fail (key != NULL, FALSE); + g_return_val_if_fail (strlen (key), FALSE); + g_return_val_if_fail (_nm_utils_string_in_list (key, valid_s390_opts), FALSE); + g_return_val_if_fail (value != NULL, FALSE); + + value_len = strlen (value); + g_return_val_if_fail (value_len > 0 && value_len < 200, FALSE); + + g_hash_table_insert (NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_options, + g_strdup (key), + g_strdup (value)); + return TRUE; +} + +/** + * nm_setting_wired_remove_s390_options: + * @setting: the #NMSettingWired + * @key: key name for the option to remove + * + * Remove the s390-specific option referenced by @key from the internal option + * list. + * + * Returns: %TRUE if the option was found and removed from the internal option + * list, %FALSE if it was not. + **/ +gboolean +nm_setting_wired_remove_s390_option (NMSettingWired *setting, + const char *key) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), FALSE); + g_return_val_if_fail (key != NULL, FALSE); + g_return_val_if_fail (strlen (key), FALSE); + + return g_hash_table_remove (NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_options, key); } static gboolean @@ -211,6 +361,9 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) NMSettingWiredPrivate *priv = NM_SETTING_WIRED_GET_PRIVATE (setting); const char *valid_ports[] = { "tp", "aui", "bnc", "mii", NULL }; const char *valid_duplex[] = { "half", "full", NULL }; + const char *valid_nettype[] = { "qeth", "lcs", "ctcm", NULL }; + GHashTableIter iter; + const char *key, *value; if (priv->port && !_nm_utils_string_in_list (priv->port, valid_ports)) { g_set_error (error, @@ -236,7 +389,8 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) return FALSE; } - if (priv->s390_subchannels && priv->s390_subchannels->len != 3) { + if ( priv->s390_subchannels + && !(priv->s390_subchannels->len == 3 || priv->s390_subchannels->len == 2)) { g_set_error (error, NM_SETTING_WIRED_ERROR, NM_SETTING_WIRED_ERROR_INVALID_PROPERTY, @@ -244,26 +398,27 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) return FALSE; } - if (priv->s390_nettype) { - if ( strcmp (priv->s390_nettype, "qeth") - && strcmp (priv->s390_nettype, "lcs") - && strcmp (priv->s390_nettype, "ctc")) { + if (priv->s390_nettype && !_nm_utils_string_in_list (priv->s390_nettype, valid_nettype)) { + g_set_error (error, + NM_SETTING_WIRED_ERROR, + NM_SETTING_WIRED_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRED_S390_NETTYPE); + return FALSE; + } + + g_hash_table_iter_init (&iter, priv->s390_options); + while (g_hash_table_iter_next (&iter, (gpointer) &key, (gpointer) &value)) { + if ( !_nm_utils_string_in_list (key, valid_s390_opts) + || !strlen (value) + || (strlen (value) > 200)) { g_set_error (error, NM_SETTING_WIRED_ERROR, NM_SETTING_WIRED_ERROR_INVALID_PROPERTY, - NM_SETTING_WIRED_S390_NETTYPE); + NM_SETTING_WIRED_S390_OPTIONS); return FALSE; } } - if (priv->s390_port_name && strlen (priv->s390_port_name) > 8) { - g_set_error (error, - NM_SETTING_WIRED_ERROR, - NM_SETTING_WIRED_ERROR_INVALID_PROPERTY, - NM_SETTING_WIRED_S390_PORT_NAME); - return FALSE; - } - if (priv->cloned_mac_address && priv->cloned_mac_address->len != ETH_ALEN) { g_set_error (error, NM_SETTING_WIRED_ERROR, @@ -278,7 +433,10 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) static void nm_setting_wired_init (NMSettingWired *setting) { + NMSettingWiredPrivate *priv = NM_SETTING_WIRED_GET_PRIVATE (setting); + g_object_set (setting, NM_SETTING_NAME, NM_SETTING_WIRED_SETTING_NAME, NULL); + priv->s390_options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); } static void @@ -288,9 +446,10 @@ finalize (GObject *object) g_free (priv->port); g_free (priv->duplex); - g_free (priv->s390_port_name); g_free (priv->s390_nettype); + g_hash_table_destroy (priv->s390_options); + if (priv->device_mac_address) g_byte_array_free (priv->device_mac_address, TRUE); @@ -300,11 +459,18 @@ finalize (GObject *object) G_OBJECT_CLASS (nm_setting_wired_parent_class)->finalize (object); } +static void +copy_hash (gpointer key, gpointer value, gpointer user_data) +{ + g_hash_table_insert ((GHashTable *) user_data, g_strdup (key), g_strdup (value)); +} + static void set_property (GObject *object, guint prop_id, - const GValue *value, GParamSpec *pspec) + const GValue *value, GParamSpec *pspec) { NMSettingWiredPrivate *priv = NM_SETTING_WIRED_GET_PRIVATE (object); + GHashTable *new_hash; switch (prop_id) { case PROP_PORT: @@ -341,20 +507,17 @@ set_property (GObject *object, guint prop_id, } priv->s390_subchannels = g_value_dup_boxed (value); break; - case PROP_S390_PORT_NAME: - g_free (priv->s390_port_name); - priv->s390_port_name = g_value_dup_string (value); - break; - case PROP_S390_PORT_NUMBER: - priv->s390_port_number = g_value_get_uint (value); - break; - case PROP_S390_QETH_LAYER: - priv->s390_qeth_layer = g_value_get_uint (value); - break; case PROP_S390_NETTYPE: g_free (priv->s390_nettype); priv->s390_nettype = g_value_dup_string (value); break; + case PROP_S390_OPTIONS: + /* Must make a deep copy of the hash table here... */ + g_hash_table_remove_all (priv->s390_options); + new_hash = g_value_get_boxed (value); + if (new_hash) + g_hash_table_foreach (new_hash, copy_hash, priv->s390_options); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -363,9 +526,10 @@ set_property (GObject *object, guint prop_id, static void get_property (GObject *object, guint prop_id, - GValue *value, GParamSpec *pspec) + GValue *value, GParamSpec *pspec) { NMSettingWired *setting = NM_SETTING_WIRED (object); + NMSettingWiredPrivate *priv = NM_SETTING_WIRED_GET_PRIVATE (setting); switch (prop_id) { case PROP_PORT: @@ -392,18 +556,12 @@ get_property (GObject *object, guint prop_id, case PROP_S390_SUBCHANNELS: g_value_set_boxed (value, nm_setting_wired_get_s390_subchannels (setting)); break; - case PROP_S390_PORT_NAME: - g_value_set_string (value, nm_setting_wired_get_s390_port_name (setting)); - break; - case PROP_S390_PORT_NUMBER: - g_value_set_uint (value, nm_setting_wired_get_s390_port_number (setting)); - break; - case PROP_S390_QETH_LAYER: - g_value_set_uint (value, nm_setting_wired_get_s390_qeth_layer (setting)); - break; case PROP_S390_NETTYPE: g_value_set_string (value, nm_setting_wired_get_s390_nettype (setting)); break; + case PROP_S390_OPTIONS: + g_value_set_boxed (value, priv->s390_options); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -570,48 +728,6 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class) DBUS_TYPE_G_ARRAY_OF_STRING, G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); - /** - * NMSettingWired:s390-port-name: - * - * s390 device port name, if required by your configuration. - **/ - g_object_class_install_property - (object_class, PROP_S390_PORT_NAME, - g_param_spec_string (NM_SETTING_WIRED_S390_PORT_NAME, - "s390 Port Name", - "s390 device port name, if required by your configuration.", - NULL, - G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); - - /** - * NMSettingWired:s390-port-number: - * - * s390 device port number, if required by your configuration. For 'qeth' - * devices, this is the "relative port number". - **/ - g_object_class_install_property - (object_class, PROP_S390_PORT_NUMBER, - g_param_spec_uint (NM_SETTING_WIRED_S390_PORT_NUMBER, - "s390 Port Number", - "s390 device port number, if required by your " - "configuration. For 'qeth' devices, this is the " - "'relative port number'.", - 0, 100, 0, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); - - /** - * NMSettingWired:s390-qeth-layer: - * - * s390 'qeth' device layer, either '2' or '3'. - **/ - g_object_class_install_property - (object_class, PROP_S390_QETH_LAYER, - g_param_spec_uint (NM_SETTING_WIRED_S390_QETH_LAYER, - "s390 'qeth' layer", - "s390 'qeth' device layer, either '2' or '3'.", - 2, 3, 2, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); - /** * NMSettingWired:s390-nettype: * @@ -627,5 +743,24 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class) "network devices available on s390 systems.", NULL, G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingWired:s390-options: + * + * Dictionary of key/value pairs of s390-specific device options. Both keys + * and values must be strings. Allowed keys include 'portno', 'layer2', + * 'portname', 'protocol', among others. Key names must contain only + * alphanumeric characters (ie, [a-zA-Z0-9]). + **/ + g_object_class_install_property + (object_class, PROP_S390_OPTIONS, + _nm_param_spec_specialized (NM_SETTING_WIRED_S390_OPTIONS, + "s390 Options", + "Dictionary of key/value pairs of s390-specific " + "device options. Both keys and values must be " + "strings. Allowed keys include 'portno', " + "'layer2', 'portname', 'protocol', among others.", + DBUS_TYPE_G_MAP_OF_STRING, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); } diff --git a/libnm-util/nm-setting-wired.h b/libnm-util/nm-setting-wired.h index ad89b3b229..32361b4bca 100644 --- a/libnm-util/nm-setting-wired.h +++ b/libnm-util/nm-setting-wired.h @@ -60,10 +60,8 @@ GQuark nm_setting_wired_error_quark (void); #define NM_SETTING_WIRED_CLONED_MAC_ADDRESS "cloned-mac-address" #define NM_SETTING_WIRED_MTU "mtu" #define NM_SETTING_WIRED_S390_SUBCHANNELS "s390-subchannels" -#define NM_SETTING_WIRED_S390_PORT_NAME "s390-port-name" -#define NM_SETTING_WIRED_S390_PORT_NUMBER "s390-port-number" -#define NM_SETTING_WIRED_S390_QETH_LAYER "s390-qeth-layer" #define NM_SETTING_WIRED_S390_NETTYPE "s390-nettype" +#define NM_SETTING_WIRED_S390_OPTIONS "s390-options" typedef struct { NMSetting parent; @@ -89,12 +87,23 @@ gboolean nm_setting_wired_get_auto_negotiate (NMSettingWired *setting const GByteArray *nm_setting_wired_get_mac_address (NMSettingWired *setting); const GByteArray *nm_setting_wired_get_cloned_mac_address (NMSettingWired *setting); guint32 nm_setting_wired_get_mtu (NMSettingWired *setting); + const GPtrArray * nm_setting_wired_get_s390_subchannels (NMSettingWired *setting); -const char * nm_setting_wired_get_s390_port_name (NMSettingWired *setting); -guint32 nm_setting_wired_get_s390_port_number (NMSettingWired *setting); -guint32 nm_setting_wired_get_s390_qeth_layer (NMSettingWired *setting); const char * nm_setting_wired_get_s390_nettype (NMSettingWired *setting); +guint32 nm_setting_wired_get_num_s390_options (NMSettingWired *setting); +gboolean nm_setting_wired_get_s390_option (NMSettingWired *setting, + guint32 idx, + const char **out_key, + const char **out_value); +const char * nm_setting_wired_get_s390_option_by_key (NMSettingWired *setting, + const char *key); +gboolean nm_setting_wired_add_s390_option (NMSettingWired *setting, + const char *key, + const char *item); +gboolean nm_setting_wired_remove_s390_option (NMSettingWired *setting, + const char *key); + G_END_DECLS #endif /* NM_SETTING_WIRED_H */ diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index 57eaae9206..e1b2b98bdc 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -2926,35 +2926,6 @@ wireless_connection_from_ifcfg (const char *file, return connection; } -#define LAYER2_TAG "layer2=" -#define PORTNO_TAG "portno=" - -static gboolean -get_s390_option (const char *tag, - guint32 min, - guint32 max, - const char *value, - int *out_int_val) -{ - g_return_val_if_fail (tag != NULL, FALSE); - g_return_val_if_fail (value != NULL, FALSE); - - if (strncmp (value, tag, strlen (tag))) - return FALSE; - - if (get_int (value + strlen (tag), out_int_val)) { - if (*out_int_val < min || *out_int_val > max) { - PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: invalid s390 %s value '%d'", tag, *out_int_val); - return FALSE; - } - } else { - PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: invalid s390 %s '%s'", tag, value); - return FALSE; - } - - return TRUE; -} - static NMSetting * make_wired_setting (shvarFile *ifcfg, const char *file, @@ -2965,7 +2936,7 @@ make_wired_setting (shvarFile *ifcfg, { NMSettingWired *s_wired; char *value = NULL; - int mtu, portno, layer2; + int mtu; GByteArray *mac = NULL; char *nettype; @@ -3046,8 +3017,9 @@ make_wired_setting (shvarFile *ifcfg, } value = svGetValue (ifcfg, "PORTNAME", FALSE); - if (value && strlen (value)) - g_object_set (s_wired, NM_SETTING_WIRED_S390_PORT_NAME, value, NULL); + if (value && strlen (value)) { + nm_setting_wired_add_s390_option (s_wired, "portname", value); + } g_free (value); nettype = svGetValue (ifcfg, "NETTYPE", FALSE); @@ -3064,17 +3036,15 @@ make_wired_setting (shvarFile *ifcfg, iter = options = g_strsplit_set (value, " ", 0); while (iter && *iter) { - if (get_s390_option (LAYER2_TAG, 0, 1, *iter, &layer2)) { - if (!nettype || strcmp (nettype, "qeth")) { - PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: s390 layer2 set but NETTYPE not 'qeth'"); - } else { - if (layer2 == 0) - g_object_set (s_wired, NM_SETTING_WIRED_S390_QETH_LAYER, 3, NULL); - else if (layer2 == 1) - g_object_set (s_wired, NM_SETTING_WIRED_S390_QETH_LAYER, 2, NULL); - } - } else if (get_s390_option (PORTNO_TAG, 0, 100, *iter, &portno)) - g_object_set (s_wired, NM_SETTING_WIRED_S390_PORT_NUMBER, portno, NULL); + char *equals = strchr (*iter, '='); + gboolean valid = FALSE; + + if (equals) { + *equals = '\0'; + valid = nm_setting_wired_add_s390_option (s_wired, *iter, equals + 1); + } + if (!valid) + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: invalid s390 OPTION '%s'", *iter); iter++; } g_strfreev (options); diff --git a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index 829727d82d..0aafcf9d68 100644 --- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -5368,7 +5368,6 @@ test_read_wired_qeth_static (void) const char *expected_channel1 = "0.0.0601"; const char *expected_channel2 = "0.0.0602"; const GPtrArray *subchannels; - guint32 num; connection = connection_from_file (TEST_IFCFG_WIRED_QETH_STATIC, NULL, @@ -5468,33 +5467,37 @@ test_read_wired_qeth_static (void) NM_SETTING_WIRED_S390_NETTYPE); /* port name */ - tmp = nm_setting_wired_get_s390_port_name (s_wired); + tmp = nm_setting_wired_get_s390_option_by_key (s_wired, "portname"); ASSERT (tmp != NULL, - "wired-qeth-static-verify-wired", "failed to verify %s: missing %s / %s key", + "wired-qeth-static-verify-wired", "failed to verify %s: missing %s s390 option 'portname'", TEST_IFCFG_WIRED_QETH_STATIC, - NM_SETTING_WIRED_SETTING_NAME, - NM_SETTING_WIRED_S390_PORT_NAME); + NM_SETTING_WIRED_SETTING_NAME); ASSERT (strcmp (tmp, "OSAPORT") == 0, - "wired-qeth-static-verify-wired", "failed to verify %s: unexpected %s / %s key value", + "wired-qeth-static-verify-wired", "failed to verify %s: unexpected %s s390 option 'portname' value", TEST_IFCFG_WIRED_QETH_STATIC, - NM_SETTING_WIRED_SETTING_NAME, - NM_SETTING_WIRED_S390_PORT_NAME); + NM_SETTING_WIRED_SETTING_NAME); /* port number */ - num = nm_setting_wired_get_s390_port_number (s_wired); - ASSERT (num == 0, - "wired-qeth-static-verify-wired", "failed to verify %s: unexpected %s / %s key value", + tmp = nm_setting_wired_get_s390_option_by_key (s_wired, "portno"); + ASSERT (tmp != NULL, + "wired-qeth-static-verify-wired", "failed to verify %s: missing %s s390 option 'portno'", TEST_IFCFG_WIRED_QETH_STATIC, - NM_SETTING_WIRED_SETTING_NAME, - NM_SETTING_WIRED_S390_PORT_NUMBER); + NM_SETTING_WIRED_SETTING_NAME); + ASSERT (strcmp (tmp, "0") == 0, + "wired-qeth-static-verify-wired", "failed to verify %s: unexpected %s s390 option 'portno' value", + TEST_IFCFG_WIRED_QETH_STATIC, + NM_SETTING_WIRED_SETTING_NAME); /* layer */ - num = nm_setting_wired_get_s390_qeth_layer (s_wired); - ASSERT (num == 2, - "wired-qeth-static-verify-wired", "failed to verify %s: unexpected %s / %s key value", + tmp = nm_setting_wired_get_s390_option_by_key (s_wired, "layer2"); + ASSERT (tmp != NULL, + "wired-qeth-static-verify-wired", "failed to verify %s: missing %s s390 option 'layer2'", TEST_IFCFG_WIRED_QETH_STATIC, - NM_SETTING_WIRED_SETTING_NAME, - NM_SETTING_WIRED_S390_QETH_LAYER); + NM_SETTING_WIRED_SETTING_NAME); + ASSERT (strcmp (tmp, "1") == 0, + "wired-qeth-static-verify-wired", "failed to verify %s: unexpected %s s390 option 'layer2' value", + TEST_IFCFG_WIRED_QETH_STATIC, + NM_SETTING_WIRED_SETTING_NAME); /* ===== IPv4 SETTING ===== */ @@ -8937,12 +8940,14 @@ test_write_wired_qeth_dhcp (void) g_object_set (s_wired, NM_SETTING_WIRED_S390_SUBCHANNELS, subchans, NM_SETTING_WIRED_S390_NETTYPE, "qeth", - NM_SETTING_WIRED_S390_PORT_NAME, "OSAPORT", - NM_SETTING_WIRED_S390_PORT_NUMBER, 5, - NM_SETTING_WIRED_S390_QETH_LAYER, 3, NULL); g_ptr_array_free (subchans, TRUE); + nm_setting_wired_add_s390_option (s_wired, "portname", "FOOBAR"); + nm_setting_wired_add_s390_option (s_wired, "portno", "1"); + nm_setting_wired_add_s390_option (s_wired, "layer2", "0"); + nm_setting_wired_add_s390_option (s_wired, "protocol", "blahbalh"); + /* IP4 setting */ s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); ASSERT (s_ip4 != NULL, diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c index 7a64700ab2..cc7577860d 100644 --- a/system-settings/plugins/ifcfg-rh/writer.c +++ b/system-settings/plugins/ifcfg-rh/writer.c @@ -842,8 +842,8 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) NMSettingWired *s_wired; const GByteArray *device_mac, *cloned_mac; char *tmp; - const char *nettype, *portname; - guint32 mtu, layer, portno; + const char *nettype, *portname, *s390_key, *s390_val; + guint32 mtu, num_opts, i; const GPtrArray *s390_subchannels; GString *str; @@ -904,21 +904,27 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) svSetValue (ifcfg, "NETTYPE", nettype, FALSE); svSetValue (ifcfg, "PORTNAME", NULL, FALSE); - portname = nm_setting_wired_get_s390_port_name (s_wired); + portname = nm_setting_wired_get_s390_option_by_key (s_wired, "portname"); if (portname) svSetValue (ifcfg, "PORTNAME", portname, FALSE); svSetValue (ifcfg, "OPTIONS", NULL, FALSE); - if (s390_subchannels && nettype) { - str = g_string_sized_new (20); - if (!strcmp (nettype, "qeth")) { - layer = nm_setting_wired_get_s390_qeth_layer (s_wired); - g_string_append_printf (str, "layer2=%d ", layer == 2 ? 1 : 0); + num_opts = nm_setting_wired_get_num_s390_options (s_wired); + if (s390_subchannels && num_opts) { + str = g_string_sized_new (30); + for (i = 0; i < num_opts; i++) { + nm_setting_wired_get_s390_option (s_wired, i, &s390_key, &s390_val); + + /* portname is handled separately */ + if (!strcmp (s390_key, "portname")) + continue; + + if (str->len) + g_string_append_c (str, ' '); + g_string_append_printf (str, "%s=%s", s390_key, s390_val); } - portno = nm_setting_wired_get_s390_port_number (s_wired); - g_string_append_printf (str, "portno=%d", portno); - - svSetValue (ifcfg, "OPTIONS", str->str, FALSE); + if (str->len) + svSetValue (ifcfg, "OPTIONS", str->str, FALSE); g_string_free (str, TRUE); } -- cgit v1.2.1 From 2412792cfdd4e7c64a1c8518989ed96237d6d2aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Tue, 29 Jun 2010 18:36:22 +0200 Subject: cli: print IPv6 stuff for 'nmcli dev list' --- cli/src/devices.c | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 105 insertions(+), 7 deletions(-) diff --git a/cli/src/devices.c b/cli/src/devices.c index 7811e2aeda..e2ce91e358 100644 --- a/cli/src/devices.c +++ b/cli/src/devices.c @@ -41,6 +41,7 @@ //#include #include #include +#include #include #include #include @@ -75,10 +76,12 @@ static NmcOutputField nmc_fields_dev_list_sections[] = { {"WIRED-PROPERTIES", N_("WIRED-PROPERTIES"), 0, NULL, 0}, /* 4 */ {"IP4-SETTINGS", N_("IP4-SETTINGS"), 0, NULL, 0}, /* 5 */ {"IP4-DNS", N_("IP4-DNS"), 0, NULL, 0}, /* 6 */ + {"IP6-SETTINGS", N_("IP6-SETTINGS"), 0, NULL, 0}, /* 7 */ + {"IP6-DNS", N_("IP6-DNS"), 0, NULL, 0}, /* 8 */ {NULL, NULL, 0, NULL, 0} }; -#define NMC_FIELDS_DEV_LIST_SECTIONS_ALL "GENERAL,CAPABILITIES,WIFI-PROPERTIES,AP,WIRED-PROPERTIES,IP4-SETTINGS,IP4-DNS" -#define NMC_FIELDS_DEV_LIST_SECTIONS_COMMON "GENERAL,CAPABILITIES,WIFI-PROPERTIES,AP,WIRED-PROPERTIES,IP4-SETTINGS,IP4-DNS" +#define NMC_FIELDS_DEV_LIST_SECTIONS_ALL "GENERAL,CAPABILITIES,WIFI-PROPERTIES,AP,WIRED-PROPERTIES,IP4-SETTINGS,IP4-DNS,IP6-SETTINGS,IP6-DNS" +#define NMC_FIELDS_DEV_LIST_SECTIONS_COMMON "GENERAL,CAPABILITIES,WIFI-PROPERTIES,AP,WIRED-PROPERTIES,IP4-SETTINGS,IP4-DNS,IP6-SETTINGS,IP6-DNS" /* Available fields for 'dev list' - GENERAL part */ static NmcOutputField nmc_fields_dev_list_general[] = { @@ -137,6 +140,17 @@ static NmcOutputField nmc_fields_dev_list_ip4_settings[] = { #define NMC_FIELDS_DEV_LIST_IP4_SETTINGS_ALL "NAME,ADDRESS,PREFIX,GATEWAY" #define NMC_FIELDS_DEV_LIST_IP4_SETTINGS_COMMON "NAME,ADDRESS,PREFIX,GATEWAY" +/* Available fields for 'dev list' - IPv6 settings part */ +static NmcOutputField nmc_fields_dev_list_ip6_settings[] = { + {"NAME", N_("NAME"), 15, NULL, 0}, /* 0 */ + {"ADDRESS", N_("ADDRESS"), 15, NULL, 0}, /* 1 */ + {"PREFIX", N_("PREFIX"), 20, NULL, 0}, /* 2 */ + {"GATEWAY", N_("GATEWAY"), 20, NULL, 0}, /* 3 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_DEV_LIST_IP6_SETTINGS_ALL "NAME,ADDRESS,PREFIX,GATEWAY" +#define NMC_FIELDS_DEV_LIST_IP6_SETTINGS_COMMON "NAME,ADDRESS,PREFIX,GATEWAY" + /* Available fields for 'dev list' - IPv4 settings DNS part */ static NmcOutputField nmc_fields_dev_list_ip4_dns[] = { {"NAME", N_("NAME"), 15, NULL, 0}, /* 0 */ @@ -146,6 +160,14 @@ static NmcOutputField nmc_fields_dev_list_ip4_dns[] = { #define NMC_FIELDS_DEV_LIST_IP4_DNS_ALL "NAME,DNS" #define NMC_FIELDS_DEV_LIST_IP4_DNS_COMMON "NAME,DNS" +/* Available fields for 'dev list' - IPv6 settings DNS part */ +static NmcOutputField nmc_fields_dev_list_ip6_dns[] = { + {"NAME", N_("NAME"), 15, NULL, 0}, /* 0 */ + {"DNS", N_("DNS"), 17, NULL, 0}, /* 1 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_DEV_LIST_IP6_DNS_ALL "NAME,DNS" +#define NMC_FIELDS_DEV_LIST_IP6_DNS_COMMON "NAME,DNS" /* Available fields for 'dev wifi list' */ static NmcOutputField nmc_fields_dev_wifi_list[] = { @@ -305,6 +327,28 @@ ip4_address_as_string (guint32 ip) } } +static gchar * +ip6_address_as_string (const struct in6_addr *ip) +{ + char buf[INET6_ADDRSTRLEN]; + + memset (&buf, '\0', sizeof (buf)); + + if (inet_ntop (AF_INET6, ip, buf, INET6_ADDRSTRLEN)) { + return g_strdup (buf); + } else { + int j; + GString *ip6_str = g_string_new (NULL); + g_string_append_printf (ip6_str, "%02X", ip->s6_addr[0]); + for (j = 1; j < 16; j++) + g_string_append_printf (ip6_str, " %02X", ip->s6_addr[j]); + nm_warning ("%s: error converting IP6 address %s", + __func__, ip6_str->str); + g_string_free (ip6_str, TRUE); + return NULL; + } +} + typedef struct { NmCli *nmc; int index; @@ -590,17 +634,18 @@ show_device_info (gpointer data, gpointer user_data) /* IP Setup info */ if (state == NM_DEVICE_STATE_ACTIVATED) { - NMIP4Config *cfg = nm_device_get_ip4_config (device); + NMIP4Config *cfg4 = nm_device_get_ip4_config (device); + NMIP6Config *cfg6 = nm_device_get_ip6_config (device); GSList *iter; /* IP4-SETTINGS */ - if (!strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[5].name)) { + if (cfg4 && !strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[5].name)) { nmc->allowed_fields = nmc_fields_dev_list_ip4_settings; nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_IP4_SETTINGS_ALL, nmc->allowed_fields, NULL); print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ - for (iter = (GSList *) nm_ip4_config_get_addresses (cfg); iter; iter = g_slist_next (iter)) { + for (iter = (GSList *) nm_ip4_config_get_addresses (cfg4); iter; iter = g_slist_next (iter)) { NMIP4Address *addr = (NMIP4Address *) iter->data; guint32 prefix = nm_ip4_address_get_prefix (addr); char *tmp2; @@ -628,8 +673,8 @@ show_device_info (gpointer data, gpointer user_data) was_output = TRUE; } /* IP4-DNS */ - if (!strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[6].name)) { - array = nm_ip4_config_get_nameservers (cfg); + if (cfg4 && !strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[6].name)) { + array = nm_ip4_config_get_nameservers (cfg4); if (array) { int i; @@ -652,6 +697,59 @@ show_device_info (gpointer data, gpointer user_data) } was_output = TRUE; } + + /* IP6-SETTINGS */ + if (cfg6 && !strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[7].name)) { + nmc->allowed_fields = nmc_fields_dev_list_ip6_settings; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_IP6_SETTINGS_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + + for (iter = (GSList *) nm_ip6_config_get_addresses (cfg6); iter; iter = g_slist_next (iter)) { + NMIP6Address *addr = (NMIP6Address *) iter->data; + guint32 prefix = nm_ip6_address_get_prefix (addr); + char *addr_str, *prefix_str, *gateway_str; + + addr_str = ip6_address_as_string (nm_ip6_address_get_address (addr)); + + prefix_str = g_strdup_printf ("%d", prefix); + gateway_str = ip6_address_as_string (nm_ip6_address_get_gateway (addr)); + + nmc->allowed_fields[0].value = nmc_fields_dev_list_sections[7].name; /* "IP6-SETTINGS" */ + nmc->allowed_fields[1].value = addr_str; + nmc->allowed_fields[2].value = prefix_str; + nmc->allowed_fields[3].value = gateway_str; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + g_free (addr_str); + g_free (prefix_str); + g_free (gateway_str); + } + was_output = TRUE; + } + /* IP6-DNS */ + if (cfg6 && !strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[8].name)) { + int i = 1; + nmc->allowed_fields = nmc_fields_dev_list_ip6_dns; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_IP6_DNS_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + + for (iter = (GSList *) nm_ip6_config_get_nameservers (cfg6); iter; iter = g_slist_next (iter)) { + char *dns_name = g_strdup_printf ("%s%d", nmc_fields_dev_list_sections[8].name, i++); + + tmp = ip6_address_as_string (iter->data); + nmc->allowed_fields[0].value = dns_name; /* "IP6-DNS" */ + nmc->allowed_fields[1].value = tmp; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + g_free (tmp); + g_free (dns_name); + } + was_output = TRUE; + } } } -- cgit v1.2.1 From 4eea398b068b91ec4fb2aff377064d5edd8699cf Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 30 Jun 2010 11:51:40 -0700 Subject: libnm-glib: fix invalid memory access during property notification If an NMObject listened to property change notifications from other NMObjects and then in response to that queued up other property changes of it's own, those would get added to the property change list that was being iterated through already. Each name in the change list is freed after being notified, but the change list itself is actually freed when all properties have been notified. So an object that queues up another change notification ends up in _nm_object_queue_notify() which iterates the change list where half of the data elements are already freed... --- libnm-glib/nm-object.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/libnm-glib/nm-object.c b/libnm-glib/nm-object.c index 94bda26e56..72ea05005e 100644 --- a/libnm-glib/nm-object.c +++ b/libnm-glib/nm-object.c @@ -47,7 +47,7 @@ typedef struct { NMObject *parent; GSList *notify_props; - gulong notify_id; + guint32 notify_id; gboolean disposed; } NMObjectPrivate; @@ -255,18 +255,23 @@ deferred_notify_cb (gpointer data) { NMObject *object = NM_OBJECT (data); NMObjectPrivate *priv = NM_OBJECT_GET_PRIVATE (object); - GSList *iter; + GSList *props, *iter; priv->notify_id = 0; - priv->notify_props = g_slist_reverse (priv->notify_props); - for (iter = priv->notify_props; iter; iter = g_slist_next (iter)) { + /* Clear priv->notify_props early so that an NMObject subclass that + * listens to property changes can queue up other property changes + * during the g_object_notify() call separately from the property + * list we're iterating. + */ + props = g_slist_reverse (priv->notify_props); + priv->notify_props = NULL; + + for (iter = props; iter; iter = g_slist_next (iter)) { g_object_notify (G_OBJECT (object), (const char *) iter->data); g_free (iter->data); } - g_slist_free (priv->notify_props); - priv->notify_props = NULL; - + g_slist_free (props); return FALSE; } -- cgit v1.2.1 From c38d1c28ff83f0930b3830d557ce45d80eda193a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 30 Jun 2010 13:37:34 -0700 Subject: core: fix potential use-after-free resetting IPv6 accept_ra value --- src/nm-device.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/nm-device.c b/src/nm-device.c index fd46ee33e2..df14a47a4b 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -3332,13 +3332,6 @@ dispose (GObject *object) addrconf6_cleanup (self); dnsmasq_cleanup (self); - /* reset the saved RA value */ - if (priv->ip6_accept_ra_path) { - nm_utils_do_sysctl (priv->ip6_accept_ra_path, - priv->ip6_accept_ra_save ? "1\n" : "0\n"); - } - g_free (priv->ip6_accept_ra_path); - /* Take the device itself down and clear its IPv4 configuration */ if (priv->managed && take_down) { NMDeviceStateReason ignored = NM_DEVICE_STATE_REASON_NONE; @@ -3347,6 +3340,13 @@ dispose (GObject *object) nm_device_set_ip4_config (self, NULL, FALSE, &ignored); } + /* reset the saved RA value */ + if (priv->ip6_accept_ra_path) { + nm_utils_do_sysctl (priv->ip6_accept_ra_path, + priv->ip6_accept_ra_save ? "1\n" : "0\n"); + } + g_free (priv->ip6_accept_ra_path); + activation_source_clear (self, TRUE, AF_INET); activation_source_clear (self, TRUE, AF_INET6); -- cgit v1.2.1 From 62d03cf33e76d18362b7c15ccde7bc1b21beafac Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 1 Jul 2010 10:32:11 -0700 Subject: core: better missing firmware handling when firmware appears (rh #609587) Monitor the kernel firmware directory (set at configure-time with --with-kernel-firmware-dir=) for changes, and if there are any, try bringing up devices that are missing firmware. --- configure.ac | 10 ++++++ src/nm-device-private.h | 4 +++ src/nm-device-wifi.c | 13 ++++--- src/nm-device.c | 34 ++++++++++++------ src/nm-manager.c | 94 +++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 141 insertions(+), 14 deletions(-) diff --git a/configure.ac b/configure.ac index 1c54f6088f..b5147c5991 100644 --- a/configure.ac +++ b/configure.ac @@ -423,6 +423,16 @@ fi AC_DEFINE_UNQUOTED(SYSTEM_CA_PATH, "$SYSTEM_CA_PATH", [Define to path to system CA certificates]) AC_SUBST(SYSTEM_CA_PATH) +AC_ARG_WITH(kernel-firmware-dir, AS_HELP_STRING([--with-kernel-firmware-dir=DIR], [where kernel firmware directory is (default is /lib/firmware)])) + +if test -n "$with_kernel_firmware_dir" ; then + KERNEL_FIRMWARE_DIR="$with_kernel_firmware_dir" +else + KERNEL_FIRMWARE_DIR="/lib/firmware" +fi +AC_DEFINE_UNQUOTED(KERNEL_FIRMWARE_DIR, "$KERNEL_FIRMWARE_DIR", [Define to path of the kernel firmware directory]) +AC_SUBST(KERNEL_FIRMWARE_DIR) + NM_COMPILER_WARNINGS GTK_DOC_CHECK(1.0) diff --git a/src/nm-device-private.h b/src/nm-device-private.h index 371f17f10d..f4f968a949 100644 --- a/src/nm-device-private.h +++ b/src/nm-device-private.h @@ -42,4 +42,8 @@ void nm_device_handle_autoip4_event (NMDevice *self, gboolean nm_device_ip_config_should_fail (NMDevice *self, gboolean ip6); +gboolean nm_device_get_firmware_missing (NMDevice *self); + +void nm_device_set_firmware_missing (NMDevice *self, gboolean missing); + #endif /* NM_DEVICE_PRIVATE_H */ diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index aecb035255..dc76dc29db 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -2609,7 +2609,8 @@ supplicant_mgr_state_cb_handler (gpointer user_data) dev_state = nm_device_get_state (dev); if ( priv->enabled && !priv->supplicant.iface - && (dev_state >= NM_DEVICE_STATE_UNAVAILABLE)) { + && (dev_state >= NM_DEVICE_STATE_UNAVAILABLE) + && (nm_device_get_firmware_missing (NM_DEVICE (self)) == FALSE)) { /* request a supplicant interface from the supplicant manager */ supplicant_interface_acquire (self); @@ -3599,7 +3600,7 @@ device_state_changed (NMDevice *device, * acquire a supplicant interface and transition to DISCONNECTED because * the device is now ready to use. */ - if (priv->enabled) { + if (priv->enabled && (nm_device_get_firmware_missing (device) == FALSE)) { gboolean success; struct iw_range range; @@ -3692,8 +3693,12 @@ real_set_enabled (NMDeviceInterface *device, gboolean enabled) nm_log_dbg (LOGD_WIFI, "(%s): enable blocked by failure to bring device up", nm_device_get_iface (NM_DEVICE (device))); - /* The device sucks, or HAL was lying to us about the killswitch state */ - priv->enabled = FALSE; + if (no_firmware) + nm_device_set_firmware_missing (NM_DEVICE (device), TRUE); + else { + /* The device sucks, or the kernel was lying to us about the killswitch state */ + priv->enabled = FALSE; + } return; } diff --git a/src/nm-device.c b/src/nm-device.c index df14a47a4b..84eb97730a 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -3655,17 +3655,27 @@ unavailable_to_disconnected (gpointer user_data) return FALSE; } -static void -set_firmware_missing (NMDevice *self, gboolean new_missing) +void +nm_device_set_firmware_missing (NMDevice *self, gboolean new_missing) { - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + NMDevicePrivate *priv; + + g_return_if_fail (self != NULL); + g_return_if_fail (NM_IS_DEVICE (self)); + priv = NM_DEVICE_GET_PRIVATE (self); if (priv->firmware_missing != new_missing) { priv->firmware_missing = new_missing; g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_FIRMWARE_MISSING); } } +gboolean +nm_device_get_firmware_missing (NMDevice *self) +{ + return NM_DEVICE_GET_PRIVATE (self)->firmware_missing; +} + void nm_device_state_changed (NMDevice *device, NMDeviceState state, @@ -3678,7 +3688,12 @@ nm_device_state_changed (NMDevice *device, g_return_if_fail (NM_IS_DEVICE (device)); - if (priv->state == state) + /* Do nothing if state isn't changing, but as a special case allow + * re-setting UNAVAILABLE if the device is missing firmware so that we + * can retry device initialization. + */ + if ( (priv->state == state) + && !(state == NM_DEVICE_STATE_UNAVAILABLE && priv->firmware_missing)) return; old_state = priv->state; @@ -3698,16 +3713,15 @@ nm_device_state_changed (NMDevice *device, */ switch (state) { case NM_DEVICE_STATE_UNMANAGED: - set_firmware_missing (device, FALSE); + nm_device_set_firmware_missing (device, FALSE); if (old_state > NM_DEVICE_STATE_UNMANAGED) nm_device_take_down (device, TRUE, reason); break; case NM_DEVICE_STATE_UNAVAILABLE: - if (old_state == NM_DEVICE_STATE_UNMANAGED) { - if (!nm_device_bring_up (device, TRUE, &no_firmware) && no_firmware) { - nm_log_warn (LOGD_HW, "%s: firmware may be missing.", nm_device_get_iface (device)); - set_firmware_missing (device, TRUE); - } + if (old_state == NM_DEVICE_STATE_UNMANAGED || priv->firmware_missing) { + if (!nm_device_bring_up (device, TRUE, &no_firmware) && no_firmware) + nm_log_warn (LOGD_HW, "(%s): firmware may be missing.", nm_device_get_iface (device)); + nm_device_set_firmware_missing (device, no_firmware ? TRUE : FALSE); } /* Ensure the device gets deactivated in response to stuff like * carrier changes or rfkill. But don't deactivate devices that are diff --git a/src/nm-manager.c b/src/nm-manager.c index 1e94f01285..b52c6ce17e 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -221,6 +221,11 @@ typedef struct { guint auth_changed_id; GSList *auth_chains; + /* Firmware dir monitor */ + GFileMonitor *fw_monitor; + guint fw_monitor_id; + guint fw_changed_id; + gboolean disposed; } NMManagerPrivate; @@ -3884,6 +3889,65 @@ nm_manager_start (NMManager *self) bluez_manager_resync_devices (self); } +static gboolean +handle_firmware_changed (gpointer user_data) +{ + NMManager *self = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + GSList *iter; + + priv->fw_changed_id = 0; + + if (manager_sleeping (self)) + return FALSE; + + /* Try to re-enable devices with missing firmware */ + for (iter = priv->devices; iter; iter = iter->next) { + NMDevice *candidate = NM_DEVICE (iter->data); + NMDeviceState state = nm_device_get_state (candidate); + + if ( nm_device_get_firmware_missing (candidate) + && (state == NM_DEVICE_STATE_UNAVAILABLE)) { + nm_log_info (LOGD_CORE, "(%s): firmware may now be available", + nm_device_get_iface (candidate)); + + /* Re-set unavailable state to try bringing the device up again */ + nm_device_state_changed (candidate, + NM_DEVICE_STATE_UNAVAILABLE, + NM_DEVICE_STATE_REASON_NONE); + } + } + + return FALSE; +} + +static void +firmware_dir_changed (GFileMonitor *monitor, + GFile *file, + GFile *other_file, + GFileMonitorEvent event_type, + gpointer user_data) +{ + NMManager *self = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + + switch (event_type) { + case G_FILE_MONITOR_EVENT_CREATED: + case G_FILE_MONITOR_EVENT_CHANGED: + case G_FILE_MONITOR_EVENT_MOVED: + case G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED: + case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: + if (!priv->fw_changed_id) { + priv->fw_changed_id = g_timeout_add_seconds (4, handle_firmware_changed, self); + nm_log_info (LOGD_CORE, "kernel firmware directory '%s' changed", + KERNEL_FIRMWARE_DIR); + } + break; + default: + break; + } +} + NMManager * nm_manager_get (const char *config_file, const char *plugins, @@ -4039,6 +4103,17 @@ dispose (GObject *object) if (priv->bluez_mgr) g_object_unref (priv->bluez_mgr); + if (priv->fw_monitor) { + if (priv->fw_monitor_id) + g_signal_handler_disconnect (priv->fw_monitor, priv->fw_monitor_id); + + if (priv->fw_changed_id) + g_source_remove (priv->fw_changed_id); + + g_file_monitor_cancel (priv->fw_monitor); + g_object_unref (priv->fw_monitor); + } + G_OBJECT_CLASS (nm_manager_parent_class)->dispose (object); } @@ -4118,6 +4193,7 @@ nm_manager_init (NMManager *manager) NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); DBusGConnection *g_connection; guint id, i; + GFile *file; /* Initialize rfkill structures and states */ memset (priv->radio_states, 0, sizeof (priv->radio_states)); @@ -4208,6 +4284,24 @@ nm_manager_init (NMManager *manager) manager); } else nm_log_warn (LOGD_CORE, "failed to create PolicyKit authority."); + + /* Monitor the firmware directory */ + if (strlen (KERNEL_FIRMWARE_DIR)) { + file = g_file_new_for_path (KERNEL_FIRMWARE_DIR "/"); + priv->fw_monitor = g_file_monitor_directory (file, G_FILE_MONITOR_NONE, NULL, NULL); + g_object_unref (file); + } + + if (priv->fw_monitor) { + priv->fw_monitor_id = g_signal_connect (priv->fw_monitor, "changed", + G_CALLBACK (firmware_dir_changed), + manager); + nm_log_info (LOGD_CORE, "monitoring kernel firmware directory '%s'.", + KERNEL_FIRMWARE_DIR); + } else { + nm_log_warn (LOGD_CORE, "failed to monitor kernel firmware directory '%s'.", + KERNEL_FIRMWARE_DIR); + } } static void -- cgit v1.2.1 From 8a1fe31b317bd1a12ff77ce3e674977c7ee02bdd Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 2 Jul 2010 10:42:32 -0700 Subject: core: fix compilation on glib < 2.23.4 Where G_FILE_MONITOR_EVENT_MOVED isn't defined yet. --- include/NetworkManager.h | 1 + introspection/nm-settings.xml | 49 +++++++++++++++++ libnm-glib/libnm-glib.ver | 1 + libnm-glib/nm-settings-interface.c | 42 +++++++++++++++ libnm-glib/nm-settings-interface.h | 23 +++++++- libnm-glib/nm-settings-service.c | 50 ++++++++++++++++++ libnm-glib/nm-settings-service.h | 10 +++- src/nm-manager.c | 105 ++++++++++++++++++++++++++++++++----- 8 files changed, 266 insertions(+), 15 deletions(-) diff --git a/include/NetworkManager.h b/include/NetworkManager.h index 9df444f27c..d374b96ae2 100644 --- a/include/NetworkManager.h +++ b/include/NetworkManager.h @@ -48,6 +48,7 @@ #define NM_DBUS_SERVICE_USER_SETTINGS "org.freedesktop.NetworkManagerUserSettings" #define NM_DBUS_SERVICE_SYSTEM_SETTINGS "org.freedesktop.NetworkManagerSystemSettings" #define NM_DBUS_IFACE_SETTINGS "org.freedesktop.NetworkManagerSettings" +#define NM_DBUS_IFACE_SETTINGS_SECRETS "org.freedesktop.NetworkManagerSettings.Secrets" #define NM_DBUS_IFACE_SETTINGS_SYSTEM "org.freedesktop.NetworkManagerSettings.System" #define NM_DBUS_PATH_SETTINGS "/org/freedesktop/NetworkManagerSettings" diff --git a/introspection/nm-settings.xml b/introspection/nm-settings.xml index b252c00d59..f198badfe9 100644 --- a/introspection/nm-settings.xml +++ b/introspection/nm-settings.xml @@ -43,5 +43,54 @@ + + + + Secrets have a separate interface so that they can be locked down via + D-Bus policy configuration. + + + + + Get the secrets for the requested connection. If the connection is + provided by the settings service, it should save the updated secrets + if they are changed by the user. If the connection is not provided + by the settings service, the new secrets will be saved by the settings + service that provides the connection. + + + + + + The D-Bus service name of the settings service that provides this connection. + + + + + Object path of the connection. + + + + + Name of the setting for which secrets are requested. + + + + + Array of strings of key names in the Setting for which NM thinks + a secrets may be required. + + + + + + Nested settings maps containing secrets. Each setting MUST contain at + least the 'name' field, containing the name of the setting, and one or + more secrets. + + + + + diff --git a/libnm-glib/libnm-glib.ver b/libnm-glib/libnm-glib.ver index 1596afaad9..74640eff97 100644 --- a/libnm-glib/libnm-glib.ver +++ b/libnm-glib/libnm-glib.ver @@ -139,6 +139,7 @@ global: nm_settings_interface_error_get_type; nm_settings_interface_error_quark; nm_settings_interface_get_connection_by_path; + nm_settings_interface_get_secrets_for_connection; nm_settings_interface_get_type; nm_settings_interface_list_connections; nm_settings_service_export; diff --git a/libnm-glib/nm-settings-interface.c b/libnm-glib/nm-settings-interface.c index a1d548ed15..c03f3493fc 100644 --- a/libnm-glib/nm-settings-interface.c +++ b/libnm-glib/nm-settings-interface.c @@ -143,6 +143,48 @@ nm_settings_interface_add_connection (NMSettingsInterface *settings, return FALSE; } +/** + * nm_settings_interface_get_secrets_for_connection: + * @settings: a object implementing %NMSettingsInterface + * @settings_service: name of the settings service providing this connection + * @connection_path: object path of the connection provided by @settings_service + * @setting_name: the name of the setting for which to get secrets + * @hints: a list of hints + * @callback: function to call when the operation is complete + * @user_data: context-specific data passed to @callback + * + * Requests that the settings service get the secrets for the requested connection. + * + * Returns: TRUE if the request was successful, FALSE if it failed + **/ +gboolean +nm_settings_interface_get_secrets_for_connection (NMSettingsInterface *settings, + const char *settings_service, + const char *connection_path, + const char *setting_name, + const char **hints, + NMSettingsGetSecretsForConnectionFunc callback, + gpointer user_data) +{ + g_return_val_if_fail (settings != NULL, FALSE); + g_return_val_if_fail (NM_IS_SETTINGS_INTERFACE (settings), FALSE); + g_return_val_if_fail (connection_path != NULL, FALSE); + g_return_val_if_fail (setting_name != NULL, FALSE); + g_return_val_if_fail (hints != NULL, FALSE); + g_return_val_if_fail (callback != NULL, FALSE); + + if (NM_SETTINGS_INTERFACE_GET_INTERFACE (settings)->get_secrets_for_connection) { + return NM_SETTINGS_INTERFACE_GET_INTERFACE (settings)->get_secrets_for_connection (settings, + settings_service, + connection_path, + setting_name, + hints, + callback, + user_data); + } + return FALSE; +} + /*****************************************************************/ static void diff --git a/libnm-glib/nm-settings-interface.h b/libnm-glib/nm-settings-interface.h index dc7bd0eb82..47ca3f73bf 100644 --- a/libnm-glib/nm-settings-interface.h +++ b/libnm-glib/nm-settings-interface.h @@ -60,6 +60,11 @@ typedef void (*NMSettingsAddConnectionFunc) (NMSettingsInterface *settings, GError *error, gpointer user_data); +typedef void (*NMSettingsGetSecretsForConnectionFunc) (NMSettingsInterface *settings, + GHashTable *secrets, + GError *error, + gpointer user_data); + struct _NMSettingsInterface { GTypeInterface g_iface; @@ -81,13 +86,21 @@ struct _NMSettingsInterface { void (*connections_read) (NMSettingsInterface *settings); + /* Function */ + gboolean (*get_secrets_for_connection) (NMSettingsInterface *self, + const char *settings_service, + const char *connection_path, + const char *setting_name, + const char **hints, + NMSettingsGetSecretsForConnectionFunc callback, + gpointer user_data); + /* Padding for future expansion */ void (*_reserved1) (void); void (*_reserved2) (void); void (*_reserved3) (void); void (*_reserved4) (void); void (*_reserved5) (void); - void (*_reserved6) (void); }; GType nm_settings_interface_get_type (void); @@ -103,6 +116,14 @@ gboolean nm_settings_interface_add_connection (NMSettingsInterface *settings, NMSettingsAddConnectionFunc callback, gpointer user_data); +gboolean nm_settings_interface_get_secrets_for_connection (NMSettingsInterface *settings, + const char *settings_service, + const char *connection_path, + const char *setting_name, + const char **hints, + NMSettingsGetSecretsForConnectionFunc callback, + gpointer user_data); + G_END_DECLS #endif /* NM_SETTINGS_INTERFACE_H */ diff --git a/libnm-glib/nm-settings-service.c b/libnm-glib/nm-settings-service.c index 6266d10dac..58f678dfef 100644 --- a/libnm-glib/nm-settings-service.c +++ b/libnm-glib/nm-settings-service.c @@ -36,6 +36,13 @@ static void impl_settings_add_connection (NMSettingsService *self, GHashTable *settings, DBusGMethodInvocation *context); +static void impl_settings_get_secrets_for_connection (NMSettingsService *self, + const char *settings_service, + const char *connection_path, + const char *setting_name, + const char **hints, + DBusGMethodInvocation *context); + #include "nm-settings-glue.h" static void settings_interface_init (NMSettingsInterface *class); @@ -219,6 +226,49 @@ impl_settings_add_connection (NMSettingsService *self, g_object_unref (tmp); } +static void +dbus_get_secrets_cb (NMSettingsInterface *settings, + GHashTable *secrets, + GError *error, + gpointer user_data) +{ + DBusGMethodInvocation *context = user_data; + + if (error) + dbus_g_method_return_error (context, error); + else + dbus_g_method_return (context, secrets); +} + +static void +impl_settings_get_secrets_for_connection (NMSettingsService *self, + const char *settings_service, + const char *connection_path, + const char *setting_name, + const char **hints, + DBusGMethodInvocation *context) +{ + GError *error = NULL; + + if (NM_SETTINGS_SERVICE_GET_CLASS (self)->get_secrets_for_connection) + NM_SETTINGS_SERVICE_GET_CLASS (self)->get_secrets_for_connection (self, + settings_service, + connection_path, + setting_name, + hints, + context, + dbus_get_secrets_cb, + context); + else { + error = g_error_new (NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, + "%s: %s:%d get_secrets_for_connection() not implemented", + __func__, __FILE__, __LINE__); + dbus_g_method_return_error (context, error); + g_error_free (error); + } +} + void nm_settings_service_export_connection (NMSettingsService *self, NMSettingsConnectionInterface *connection) diff --git a/libnm-glib/nm-settings-service.h b/libnm-glib/nm-settings-service.h index 9f4b95fcc5..e59b07463c 100644 --- a/libnm-glib/nm-settings-service.h +++ b/libnm-glib/nm-settings-service.h @@ -58,13 +58,21 @@ typedef struct { NMSettingsAddConnectionFunc callback, gpointer user_data); + void (*get_secrets_for_connection) (NMSettingsService *self, + const char *settings_service, + const char *connection_path, + const char *setting_name, + const char **hints, + DBusGMethodInvocation *context, + NMSettingsGetSecretsForConnectionFunc callback, + gpointer user_data); + /* Padding for future expansion */ void (*_reserved1) (void); void (*_reserved2) (void); void (*_reserved3) (void); void (*_reserved4) (void); void (*_reserved5) (void); - void (*_reserved6) (void); } NMSettingsServiceClass; GType nm_settings_service_get_type (void); diff --git a/src/nm-manager.c b/src/nm-manager.c index b52c6ce17e..f70063b221 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -2447,7 +2447,7 @@ typedef struct GetSecretsInfo { guint32 idle_id; char *hint1; char *hint2; - char *connection_path; + NMConnection *connection; } GetSecretsInfo; static void @@ -2472,7 +2472,7 @@ free_get_secrets_info (gpointer data) g_free (info->hint1); g_free (info->hint2); g_free (info->setting_name); - g_free (info->connection_path); + g_object_unref (info->connection); memset (info, 0, sizeof (GetSecretsInfo)); g_free (info); } @@ -2493,6 +2493,16 @@ provider_cancel_secrets (NMSecretsProviderInterface *provider, gpointer user_dat } } +static void +system_connection_update_cb (NMSettingsConnectionInterface *connection, + GError *error, + gpointer user_data) +{ + if (error != NULL) { + nm_log_warn (LOGD_SYS_SET, "could not update system connection: %s", error->message); + } +} + static void user_get_secrets_cb (DBusGProxy *proxy, DBusGProxyCall *call, @@ -2517,6 +2527,14 @@ user_get_secrets_cb (DBusGProxy *proxy, info->caller, settings, NULL); + + /* If this connection is a system one, we need to update it on our end */ + if (nm_connection_get_scope (info->connection) == NM_CONNECTION_SCOPE_SYSTEM) { + nm_settings_connection_interface_update (NM_SETTINGS_CONNECTION_INTERFACE (info->connection), + system_connection_update_cb, + NULL); + } + g_hash_table_destroy (settings); } else { nm_secrets_provider_interface_get_secrets_result (info->provider, @@ -2607,6 +2625,50 @@ system_get_secrets_reply_cb (NMSettingsConnectionInterface *connection, g_object_unref (provider); } +static gboolean +system_get_secrets_from_user (GetSecretsInfo *info) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (info->manager); + DBusGConnection *g_connection; + GPtrArray *hints = NULL; + + /* Only user settings services that are allowed to control the network + * are allowed to provide new secrets for system connections. + */ + if (priv->user_net_perm != NM_AUTH_CALL_RESULT_YES) + return FALSE; + + g_connection = nm_dbus_manager_get_connection (priv->dbus_mgr); + info->proxy = dbus_g_proxy_new_for_name (g_connection, + NM_DBUS_SERVICE_USER_SETTINGS, + NM_DBUS_PATH_SETTINGS, + NM_DBUS_IFACE_SETTINGS_SECRETS); + if (!info->proxy) { + nm_log_warn (LOGD_SYS_SET, "could not create user settings secrets proxy"); + system_get_secrets_reply_cb (NULL, NULL, NULL, info); // FIXME pass error + return FALSE; + } + + hints = g_ptr_array_sized_new (2); + if (info->hint1) + g_ptr_array_add (hints, (char *) info->hint1); + if (info->hint2) + g_ptr_array_add (hints, (char *) info->hint2); + + info->call = dbus_g_proxy_begin_call_with_timeout (info->proxy, "GetSecretsForConnection", + user_get_secrets_cb, + info, + NULL, + G_MAXINT32, + G_TYPE_STRING, NM_DBUS_SERVICE_SYSTEM_SETTINGS, + DBUS_TYPE_G_OBJECT_PATH, nm_connection_get_path (info->connection), + G_TYPE_STRING, info->setting_name, + DBUS_TYPE_G_ARRAY_OF_STRING, hints, + G_TYPE_INVALID); + g_ptr_array_free (hints, TRUE); + return TRUE; +} + static gboolean system_get_secrets_idle_cb (gpointer user_data) { @@ -2614,12 +2676,12 @@ system_get_secrets_idle_cb (gpointer user_data) NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (info->manager); NMSettingsConnectionInterface *connection; GError *error = NULL; - const char *hints[3] = { NULL, NULL, NULL }; + gboolean success = FALSE; info->idle_id = 0; connection = nm_settings_interface_get_connection_by_path (NM_SETTINGS_INTERFACE (priv->sys_settings), - info->connection_path); + nm_connection_get_path (info->connection)); if (!connection) { error = g_error_new_literal (NM_MANAGER_ERROR, NM_MANAGER_ERROR_UNKNOWN_CONNECTION, @@ -2634,14 +2696,29 @@ system_get_secrets_idle_cb (gpointer user_data) return FALSE; } - hints[0] = info->hint1; - hints[1] = info->hint2; - nm_settings_connection_interface_get_secrets (connection, - info->setting_name, - hints, - info->request_new, - system_get_secrets_reply_cb, - info); + /* If new secrets are requested, try asking the user settings service for + * them since the system settings service can't interact with anything + * to get new secrets. + */ + if (info->request_new) + success = system_get_secrets_from_user (info); + + /* If the user wasn't authorized, or we should retry using existing + * secrets, just ask the system settings service. + */ + if (!success) { + const char *hints[3] = { NULL, NULL, NULL }; + + hints[0] = info->hint1; + hints[1] = info->hint2; + nm_settings_connection_interface_get_secrets (connection, + info->setting_name, + hints, + info->request_new, + system_get_secrets_reply_cb, + info); + } + return FALSE; } @@ -2664,7 +2741,7 @@ system_get_secrets (NMManager *self, info->setting_name = g_strdup (setting_name); info->hint1 = hint1 ? g_strdup (hint1) : NULL; info->hint2 = hint2 ? g_strdup (hint2) : NULL; - info->connection_path = g_strdup (nm_connection_get_path (connection)); + info->connection = g_object_ref (connection); info->request_new = request_new; g_object_weak_ref (G_OBJECT (provider), (GWeakNotify) free_get_secrets_info, info); @@ -3934,7 +4011,9 @@ firmware_dir_changed (GFileMonitor *monitor, switch (event_type) { case G_FILE_MONITOR_EVENT_CREATED: case G_FILE_MONITOR_EVENT_CHANGED: +#if GLIB_CHECK_VERSION(2,23,4) case G_FILE_MONITOR_EVENT_MOVED: +#endif case G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED: case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: if (!priv->fw_changed_id) { -- cgit v1.2.1 From c8c161780a202ef9bdce0e43640a8582f5b45fe0 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Fri, 9 Jul 2010 11:33:27 -0700 Subject: dhcp: use ISC DHCPv4 paths now that v4 is nominally required --- src/dhcp-manager/nm-dhcp-dhclient.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c index 7529a57f13..cae7df22c3 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.c +++ b/src/dhcp-manager/nm-dhcp-dhclient.c @@ -44,9 +44,7 @@ G_DEFINE_TYPE (NMDHCPDhclient, nm_dhcp_dhclient, NM_TYPE_DHCP_CLIENT) #define NM_DHCP_DHCLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP_DHCLIENT, NMDHCPDhclientPrivate)) -#if defined(TARGET_DEBIAN) -#define NM_DHCLIENT_LEASE_DIR LOCALSTATEDIR "/lib/dhcp3" -#elif defined(TARGET_SUSE) || defined(TARGET_MANDRIVA) +#if defined(TARGET_DEBIAN) || defined(TARGET_SUSE) || defined(TARGET_MANDRIVA) #define NM_DHCLIENT_LEASE_DIR LOCALSTATEDIR "/lib/dhcp" #else #define NM_DHCLIENT_LEASE_DIR LOCALSTATEDIR "/lib/dhclient" @@ -438,9 +436,7 @@ create_dhclient_config (const char *iface, #if defined(TARGET_SUSE) orig = g_strdup (SYSCONFDIR "/dhclient.conf"); -#elif defined(TARGET_DEBIAN) - orig = g_strdup (SYSCONFDIR "/dhcp3/dhclient.conf"); -#elif defined(TARGET_GENTOO) +#elif defined(TARGET_DEBIAN) || defined(TARGET_GENTOO) orig = g_strdup (SYSCONFDIR "/dhcp/dhclient.conf"); #else orig = g_strdup_printf (SYSCONFDIR "/dhclient-%s.conf", iface); -- cgit v1.2.1 From 5f647becd6bb5a60a4f0cfcfb9b3158f20a74097 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 12 Jul 2010 12:46:19 -0700 Subject: po: update Spanish translation (bgo #624090) --- po/es.po | 266 +++++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 167 insertions(+), 99 deletions(-) diff --git a/po/es.po b/po/es.po index f751c27ada..313d2a0b46 100644 --- a/po/es.po +++ b/po/es.po @@ -7,16 +7,18 @@ # Antonio Ognio , 2004. # Francisco Javier F. Serrador , 2004, 2005, 2006. # Lucas Vieites Fariña , 2005, 2006. -# Jorge González , 2007, 2008, 2010. # Gladys Guerrero , 2010. +# Jorge González , 2007, 2008, 2010. +# msgid "" msgstr "" -"Project-Id-Version: es\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-05-06 14:31+0530\n" -"PO-Revision-Date: 2010-05-07 14:32+1000\n" -"Last-Translator: Gladys Guerrero \n" -"Language-Team: Spanish \n" +"Project-Id-Version: NetworkManager.HEAD\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-06-28 08:52+0000\n" +"PO-Revision-Date: 2010-07-11 10:42+0200\n" +"Last-Translator: Jorge González \n" +"Language-Team: Español \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -146,19 +148,19 @@ msgstr "nunca" #: ../cli/src/connections.c:602 ../cli/src/connections.c:605 #: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 #: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 -#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 -#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 -#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 -#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 -#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 -#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 -#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 -#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 -#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 -#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 -#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 -#: ../cli/src/settings.c:1210 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:551 ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 msgid "yes" msgstr "sí" @@ -166,19 +168,19 @@ msgstr "sí" #: ../cli/src/connections.c:602 ../cli/src/connections.c:605 #: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 #: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 -#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 -#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 -#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 -#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 -#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 -#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 -#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 -#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 -#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 -#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 -#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 -#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:510 ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 ../cli/src/settings.c:1224 msgid "no" msgstr "no" @@ -267,7 +269,7 @@ msgstr "activada" #: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 #: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 #: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 -#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:473 msgid "unknown" msgstr "desconocido" @@ -1066,78 +1068,79 @@ msgstr "Error: No se pudo conectar al NetworkManager." msgid "Success" msgstr "Éxito" -#: ../cli/src/settings.c:407 +#: ../cli/src/settings.c:411 #, c-format msgid "%d (hex-ascii-key)" msgstr "%d (clave-hex-ascii)" -#: ../cli/src/settings.c:409 +#: ../cli/src/settings.c:413 #, c-format msgid "%d (104/128-bit passphrase)" msgstr "%d (frase de acceso 104/128-bits)" -#: ../cli/src/settings.c:412 +#: ../cli/src/settings.c:416 #, c-format msgid "%d (unknown)" msgstr "%d (desconocido)" -#: ../cli/src/settings.c:438 +#: ../cli/src/settings.c:442 msgid "0 (unknown)" msgstr "0 (desconocido)" -#: ../cli/src/settings.c:444 +#: ../cli/src/settings.c:448 msgid "any, " msgstr "cualquiera," -#: ../cli/src/settings.c:446 +#: ../cli/src/settings.c:450 msgid "900 MHz, " msgstr "900 MHz, " -#: ../cli/src/settings.c:448 +#: ../cli/src/settings.c:452 msgid "1800 MHz, " msgstr "1800 MHz, " -#: ../cli/src/settings.c:450 +#: ../cli/src/settings.c:454 msgid "1900 MHz, " msgstr "1900 MHz, " -#: ../cli/src/settings.c:452 +#: ../cli/src/settings.c:456 msgid "850 MHz, " msgstr "850 MHz, " -#: ../cli/src/settings.c:454 +#: ../cli/src/settings.c:458 msgid "WCDMA 3GPP UMTS 2100 MHz, " msgstr "WCDMA 3GPP UMTS 2100 MHz, " -#: ../cli/src/settings.c:456 +#: ../cli/src/settings.c:460 msgid "WCDMA 3GPP UMTS 1800 MHz, " msgstr "WCDMA 3GPP UMTS 1800 MHz, " -#: ../cli/src/settings.c:458 +#: ../cli/src/settings.c:462 msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " -#: ../cli/src/settings.c:460 +#: ../cli/src/settings.c:464 msgid "WCDMA 3GPP UMTS 800 MHz, " msgstr "WCDMA 3GPP UMTS 800 MHz, " -#: ../cli/src/settings.c:462 +#: ../cli/src/settings.c:466 msgid "WCDMA 3GPP UMTS 850 MHz, " msgstr "WCDMA 3GPP UMTS 850 MHz, " -#: ../cli/src/settings.c:464 +#: ../cli/src/settings.c:468 msgid "WCDMA 3GPP UMTS 900 MHz, " msgstr "WCDMA 3GPP UMTS 900 MHz, " -#: ../cli/src/settings.c:466 +#: ../cli/src/settings.c:470 msgid "WCDMA 3GPP UMTS 1700 MHz, " msgstr "WCDMA 3GPP UMTS 1700 MHz, " -#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +#: ../cli/src/settings.c:554 ../cli/src/settings.c:721 msgid "auto" msgstr "auto" -#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 msgid "not set" msgstr "no establecido" @@ -1199,7 +1202,8 @@ msgstr "Archivo PEM mal formado: no se encontró IV en la etiqueta DEK-Info." #: ../libnm-util/crypto.c:190 #, c-format msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." -msgstr "Archivo PEM mal formado: formato de IV no válido en la etiqueta DEK-Info." +msgstr "" +"Archivo PEM mal formado: formato de IV no válido en la etiqueta DEK-Info." #: ../libnm-util/crypto.c:203 #, c-format @@ -1495,13 +1499,114 @@ msgstr "No pudo asignar memoria para escribir IV al archivo PEM." #: ../libnm-util/nm-utils.c:2059 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." -msgstr "No se pudo asignar memoria para escribir llave encriptada al archivo PEM." +msgstr "" +"No se pudo asignar memoria para escribir llave encriptada al archivo PEM." #: ../libnm-util/nm-utils.c:2078 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "No se pudo reservar memoria para el archivo de datos PEM." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Compartir conexión a través de una red WIFI protegida" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Compartir conexión a través de una red WIFI abierta" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Modificar nombre de host de sistema persistente" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Modificar conexiones de sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Política de sistema evita modificación de configuración de sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "" +"Política de sistema evita modificación de nombre de host de sistema " +"persistente" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"Política de sistema evita compartir conexiones a través de una red WIFI " +"protegida" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"Política de sistema evita compartir conexiones a través de una red WIFI " +"abierta" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "Permitir controlar las conexiones de red" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "Permitir el uso de conexiones específicas de usuario" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "Activar o desactivar los dispositivos inalámbricos" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "Activar o desactivar los dispositivos de banda ancha móvil" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "Activar o desactivar la red del sistema" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 +msgid "" +"Put NetworkManager to sleep or wake it up (should only be used by system " +"power management)" +msgstr "" +"Poner NetworkManager a dormir o despertarlo (sólo lo debería usar el gestor " +"de energía del sistema)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents control of network connections" +msgstr "La política de sistema evita el control de las conexiones de red" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +#| msgid "System policy prevents sharing connections via an open WiFi network" +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "" +"La política de sistema evita activar o desactivar los dispositivos " +"inalámbricos" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "" +"La política del sistema evita activar o desactivar los dispositivos de banda " +"ancha móvil" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents enabling or disabling system networking" +msgstr "La política del sistema evita activar o desactivar la red del sistema" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "" +"La política del sistema evita poner a NetworkManager a dormir o despertarlo" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents use of user-specific connections" +msgstr "" +"La política del sistema evita el uso de conexiones específicas de usuario" + #: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 #: ../src/nm-netlink-monitor.c:653 #, c-format @@ -1515,7 +1620,8 @@ msgstr "ha ocurrido un error mientras esperaban datos en un socket" #: ../src/nm-netlink-monitor.c:254 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" -msgstr "no se puede conectar con netlink para monitorizar el estado del enlace: %s" +msgstr "" +"no se puede conectar con netlink para monitorizar el estado del enlace: %s" #: ../src/nm-netlink-monitor.c:265 #, c-format @@ -1549,9 +1655,10 @@ msgstr "error al actualizar el enlace caché: %s" #: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" -msgstr "Opción no válida. Use --help para ver una lista de las opciones válidas.\n" +msgstr "" +"Opción no válida. Use --help para ver una lista de las opciones válidas.\n" -#: ../src/main.c:562 +#: ../src/main.c:568 #, c-format msgid "%s. Please use --help to see a list of valid options.\n" msgstr "%s. Por favor use --help para ver la lista de opciones válidas.\n" @@ -1596,13 +1703,13 @@ msgstr "Nivel de registro desconocido '%s'" msgid "Unknown log domain '%s'" msgstr "Dominio de registro desconocido '%s'" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/named-manager/nm-named-manager.c:350 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "NOTA: el 'resolver' de nombres de libc puede que no soporte más de 3 " "servidores de nombres." -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/named-manager/nm-named-manager.c:352 msgid "The nameservers listed below may not be recognized." msgstr "Puede que los servidores de nombres listados abajo no se reconozcan." @@ -1611,45 +1718,6 @@ msgstr "Puede que los servidores de nombres listados abajo no se reconozcan." msgid "Auto %s" msgstr "Auto %ss" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3275 msgid "System" msgstr "Sistema" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 -msgid "Connection sharing via a protected WiFi network" -msgstr "Compartir conexión a través de una red WIFI protegida" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 -msgid "Connection sharing via an open WiFi network" -msgstr "Compartir conexión a través de una red WIFI abierta" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 -msgid "Modify persistent system hostname" -msgstr "Modificar nombre de host de sistema persistente" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 -msgid "Modify system connections" -msgstr "Modificar conexiones de sistema" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 -msgid "System policy prevents modification of system settings" -msgstr "Política de sistema evita modificación de configuración de sistema" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 -msgid "System policy prevents modification of the persistent system hostname" -msgstr "" -"Política de sistema evita modificación de nombre de host de sistema " -"persistente" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 -msgid "System policy prevents sharing connections via a protected WiFi network" -msgstr "" -"Política de sistema evita compartir conexiones a través de una red WIFI " -"protegida" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 -msgid "System policy prevents sharing connections via an open WiFi network" -msgstr "" -"Política de sistema evita compartir conexiones a través de una red WIFI " -"abierta" - -- cgit v1.2.1 From 664ccd446445ff89bf0ff08c84ba829ba0647539 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 12 Jul 2010 18:20:09 -0700 Subject: Revert "core: fix compilation on glib < 2.23.4" This reverts commit 8a1fe31b317bd1a12ff77ce3e674977c7ee02bdd. This commit was not intended to be pushed, as it's not ready yet and isn't even my commit (thus attribution is wrong). --- include/NetworkManager.h | 1 - introspection/nm-settings.xml | 49 ----------------- libnm-glib/libnm-glib.ver | 1 - libnm-glib/nm-settings-interface.c | 42 --------------- libnm-glib/nm-settings-interface.h | 23 +------- libnm-glib/nm-settings-service.c | 50 ------------------ libnm-glib/nm-settings-service.h | 10 +--- src/nm-manager.c | 105 +++++-------------------------------- 8 files changed, 15 insertions(+), 266 deletions(-) diff --git a/include/NetworkManager.h b/include/NetworkManager.h index d374b96ae2..9df444f27c 100644 --- a/include/NetworkManager.h +++ b/include/NetworkManager.h @@ -48,7 +48,6 @@ #define NM_DBUS_SERVICE_USER_SETTINGS "org.freedesktop.NetworkManagerUserSettings" #define NM_DBUS_SERVICE_SYSTEM_SETTINGS "org.freedesktop.NetworkManagerSystemSettings" #define NM_DBUS_IFACE_SETTINGS "org.freedesktop.NetworkManagerSettings" -#define NM_DBUS_IFACE_SETTINGS_SECRETS "org.freedesktop.NetworkManagerSettings.Secrets" #define NM_DBUS_IFACE_SETTINGS_SYSTEM "org.freedesktop.NetworkManagerSettings.System" #define NM_DBUS_PATH_SETTINGS "/org/freedesktop/NetworkManagerSettings" diff --git a/introspection/nm-settings.xml b/introspection/nm-settings.xml index f198badfe9..b252c00d59 100644 --- a/introspection/nm-settings.xml +++ b/introspection/nm-settings.xml @@ -43,54 +43,5 @@ - - - - Secrets have a separate interface so that they can be locked down via - D-Bus policy configuration. - - - - - Get the secrets for the requested connection. If the connection is - provided by the settings service, it should save the updated secrets - if they are changed by the user. If the connection is not provided - by the settings service, the new secrets will be saved by the settings - service that provides the connection. - - - - - - The D-Bus service name of the settings service that provides this connection. - - - - - Object path of the connection. - - - - - Name of the setting for which secrets are requested. - - - - - Array of strings of key names in the Setting for which NM thinks - a secrets may be required. - - - - - - Nested settings maps containing secrets. Each setting MUST contain at - least the 'name' field, containing the name of the setting, and one or - more secrets. - - - - - diff --git a/libnm-glib/libnm-glib.ver b/libnm-glib/libnm-glib.ver index 74640eff97..1596afaad9 100644 --- a/libnm-glib/libnm-glib.ver +++ b/libnm-glib/libnm-glib.ver @@ -139,7 +139,6 @@ global: nm_settings_interface_error_get_type; nm_settings_interface_error_quark; nm_settings_interface_get_connection_by_path; - nm_settings_interface_get_secrets_for_connection; nm_settings_interface_get_type; nm_settings_interface_list_connections; nm_settings_service_export; diff --git a/libnm-glib/nm-settings-interface.c b/libnm-glib/nm-settings-interface.c index c03f3493fc..a1d548ed15 100644 --- a/libnm-glib/nm-settings-interface.c +++ b/libnm-glib/nm-settings-interface.c @@ -143,48 +143,6 @@ nm_settings_interface_add_connection (NMSettingsInterface *settings, return FALSE; } -/** - * nm_settings_interface_get_secrets_for_connection: - * @settings: a object implementing %NMSettingsInterface - * @settings_service: name of the settings service providing this connection - * @connection_path: object path of the connection provided by @settings_service - * @setting_name: the name of the setting for which to get secrets - * @hints: a list of hints - * @callback: function to call when the operation is complete - * @user_data: context-specific data passed to @callback - * - * Requests that the settings service get the secrets for the requested connection. - * - * Returns: TRUE if the request was successful, FALSE if it failed - **/ -gboolean -nm_settings_interface_get_secrets_for_connection (NMSettingsInterface *settings, - const char *settings_service, - const char *connection_path, - const char *setting_name, - const char **hints, - NMSettingsGetSecretsForConnectionFunc callback, - gpointer user_data) -{ - g_return_val_if_fail (settings != NULL, FALSE); - g_return_val_if_fail (NM_IS_SETTINGS_INTERFACE (settings), FALSE); - g_return_val_if_fail (connection_path != NULL, FALSE); - g_return_val_if_fail (setting_name != NULL, FALSE); - g_return_val_if_fail (hints != NULL, FALSE); - g_return_val_if_fail (callback != NULL, FALSE); - - if (NM_SETTINGS_INTERFACE_GET_INTERFACE (settings)->get_secrets_for_connection) { - return NM_SETTINGS_INTERFACE_GET_INTERFACE (settings)->get_secrets_for_connection (settings, - settings_service, - connection_path, - setting_name, - hints, - callback, - user_data); - } - return FALSE; -} - /*****************************************************************/ static void diff --git a/libnm-glib/nm-settings-interface.h b/libnm-glib/nm-settings-interface.h index 47ca3f73bf..dc7bd0eb82 100644 --- a/libnm-glib/nm-settings-interface.h +++ b/libnm-glib/nm-settings-interface.h @@ -60,11 +60,6 @@ typedef void (*NMSettingsAddConnectionFunc) (NMSettingsInterface *settings, GError *error, gpointer user_data); -typedef void (*NMSettingsGetSecretsForConnectionFunc) (NMSettingsInterface *settings, - GHashTable *secrets, - GError *error, - gpointer user_data); - struct _NMSettingsInterface { GTypeInterface g_iface; @@ -86,21 +81,13 @@ struct _NMSettingsInterface { void (*connections_read) (NMSettingsInterface *settings); - /* Function */ - gboolean (*get_secrets_for_connection) (NMSettingsInterface *self, - const char *settings_service, - const char *connection_path, - const char *setting_name, - const char **hints, - NMSettingsGetSecretsForConnectionFunc callback, - gpointer user_data); - /* Padding for future expansion */ void (*_reserved1) (void); void (*_reserved2) (void); void (*_reserved3) (void); void (*_reserved4) (void); void (*_reserved5) (void); + void (*_reserved6) (void); }; GType nm_settings_interface_get_type (void); @@ -116,14 +103,6 @@ gboolean nm_settings_interface_add_connection (NMSettingsInterface *settings, NMSettingsAddConnectionFunc callback, gpointer user_data); -gboolean nm_settings_interface_get_secrets_for_connection (NMSettingsInterface *settings, - const char *settings_service, - const char *connection_path, - const char *setting_name, - const char **hints, - NMSettingsGetSecretsForConnectionFunc callback, - gpointer user_data); - G_END_DECLS #endif /* NM_SETTINGS_INTERFACE_H */ diff --git a/libnm-glib/nm-settings-service.c b/libnm-glib/nm-settings-service.c index 58f678dfef..6266d10dac 100644 --- a/libnm-glib/nm-settings-service.c +++ b/libnm-glib/nm-settings-service.c @@ -36,13 +36,6 @@ static void impl_settings_add_connection (NMSettingsService *self, GHashTable *settings, DBusGMethodInvocation *context); -static void impl_settings_get_secrets_for_connection (NMSettingsService *self, - const char *settings_service, - const char *connection_path, - const char *setting_name, - const char **hints, - DBusGMethodInvocation *context); - #include "nm-settings-glue.h" static void settings_interface_init (NMSettingsInterface *class); @@ -226,49 +219,6 @@ impl_settings_add_connection (NMSettingsService *self, g_object_unref (tmp); } -static void -dbus_get_secrets_cb (NMSettingsInterface *settings, - GHashTable *secrets, - GError *error, - gpointer user_data) -{ - DBusGMethodInvocation *context = user_data; - - if (error) - dbus_g_method_return_error (context, error); - else - dbus_g_method_return (context, secrets); -} - -static void -impl_settings_get_secrets_for_connection (NMSettingsService *self, - const char *settings_service, - const char *connection_path, - const char *setting_name, - const char **hints, - DBusGMethodInvocation *context) -{ - GError *error = NULL; - - if (NM_SETTINGS_SERVICE_GET_CLASS (self)->get_secrets_for_connection) - NM_SETTINGS_SERVICE_GET_CLASS (self)->get_secrets_for_connection (self, - settings_service, - connection_path, - setting_name, - hints, - context, - dbus_get_secrets_cb, - context); - else { - error = g_error_new (NM_SETTINGS_INTERFACE_ERROR, - NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, - "%s: %s:%d get_secrets_for_connection() not implemented", - __func__, __FILE__, __LINE__); - dbus_g_method_return_error (context, error); - g_error_free (error); - } -} - void nm_settings_service_export_connection (NMSettingsService *self, NMSettingsConnectionInterface *connection) diff --git a/libnm-glib/nm-settings-service.h b/libnm-glib/nm-settings-service.h index e59b07463c..9f4b95fcc5 100644 --- a/libnm-glib/nm-settings-service.h +++ b/libnm-glib/nm-settings-service.h @@ -58,21 +58,13 @@ typedef struct { NMSettingsAddConnectionFunc callback, gpointer user_data); - void (*get_secrets_for_connection) (NMSettingsService *self, - const char *settings_service, - const char *connection_path, - const char *setting_name, - const char **hints, - DBusGMethodInvocation *context, - NMSettingsGetSecretsForConnectionFunc callback, - gpointer user_data); - /* Padding for future expansion */ void (*_reserved1) (void); void (*_reserved2) (void); void (*_reserved3) (void); void (*_reserved4) (void); void (*_reserved5) (void); + void (*_reserved6) (void); } NMSettingsServiceClass; GType nm_settings_service_get_type (void); diff --git a/src/nm-manager.c b/src/nm-manager.c index f70063b221..b52c6ce17e 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -2447,7 +2447,7 @@ typedef struct GetSecretsInfo { guint32 idle_id; char *hint1; char *hint2; - NMConnection *connection; + char *connection_path; } GetSecretsInfo; static void @@ -2472,7 +2472,7 @@ free_get_secrets_info (gpointer data) g_free (info->hint1); g_free (info->hint2); g_free (info->setting_name); - g_object_unref (info->connection); + g_free (info->connection_path); memset (info, 0, sizeof (GetSecretsInfo)); g_free (info); } @@ -2493,16 +2493,6 @@ provider_cancel_secrets (NMSecretsProviderInterface *provider, gpointer user_dat } } -static void -system_connection_update_cb (NMSettingsConnectionInterface *connection, - GError *error, - gpointer user_data) -{ - if (error != NULL) { - nm_log_warn (LOGD_SYS_SET, "could not update system connection: %s", error->message); - } -} - static void user_get_secrets_cb (DBusGProxy *proxy, DBusGProxyCall *call, @@ -2527,14 +2517,6 @@ user_get_secrets_cb (DBusGProxy *proxy, info->caller, settings, NULL); - - /* If this connection is a system one, we need to update it on our end */ - if (nm_connection_get_scope (info->connection) == NM_CONNECTION_SCOPE_SYSTEM) { - nm_settings_connection_interface_update (NM_SETTINGS_CONNECTION_INTERFACE (info->connection), - system_connection_update_cb, - NULL); - } - g_hash_table_destroy (settings); } else { nm_secrets_provider_interface_get_secrets_result (info->provider, @@ -2625,50 +2607,6 @@ system_get_secrets_reply_cb (NMSettingsConnectionInterface *connection, g_object_unref (provider); } -static gboolean -system_get_secrets_from_user (GetSecretsInfo *info) -{ - NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (info->manager); - DBusGConnection *g_connection; - GPtrArray *hints = NULL; - - /* Only user settings services that are allowed to control the network - * are allowed to provide new secrets for system connections. - */ - if (priv->user_net_perm != NM_AUTH_CALL_RESULT_YES) - return FALSE; - - g_connection = nm_dbus_manager_get_connection (priv->dbus_mgr); - info->proxy = dbus_g_proxy_new_for_name (g_connection, - NM_DBUS_SERVICE_USER_SETTINGS, - NM_DBUS_PATH_SETTINGS, - NM_DBUS_IFACE_SETTINGS_SECRETS); - if (!info->proxy) { - nm_log_warn (LOGD_SYS_SET, "could not create user settings secrets proxy"); - system_get_secrets_reply_cb (NULL, NULL, NULL, info); // FIXME pass error - return FALSE; - } - - hints = g_ptr_array_sized_new (2); - if (info->hint1) - g_ptr_array_add (hints, (char *) info->hint1); - if (info->hint2) - g_ptr_array_add (hints, (char *) info->hint2); - - info->call = dbus_g_proxy_begin_call_with_timeout (info->proxy, "GetSecretsForConnection", - user_get_secrets_cb, - info, - NULL, - G_MAXINT32, - G_TYPE_STRING, NM_DBUS_SERVICE_SYSTEM_SETTINGS, - DBUS_TYPE_G_OBJECT_PATH, nm_connection_get_path (info->connection), - G_TYPE_STRING, info->setting_name, - DBUS_TYPE_G_ARRAY_OF_STRING, hints, - G_TYPE_INVALID); - g_ptr_array_free (hints, TRUE); - return TRUE; -} - static gboolean system_get_secrets_idle_cb (gpointer user_data) { @@ -2676,12 +2614,12 @@ system_get_secrets_idle_cb (gpointer user_data) NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (info->manager); NMSettingsConnectionInterface *connection; GError *error = NULL; - gboolean success = FALSE; + const char *hints[3] = { NULL, NULL, NULL }; info->idle_id = 0; connection = nm_settings_interface_get_connection_by_path (NM_SETTINGS_INTERFACE (priv->sys_settings), - nm_connection_get_path (info->connection)); + info->connection_path); if (!connection) { error = g_error_new_literal (NM_MANAGER_ERROR, NM_MANAGER_ERROR_UNKNOWN_CONNECTION, @@ -2696,29 +2634,14 @@ system_get_secrets_idle_cb (gpointer user_data) return FALSE; } - /* If new secrets are requested, try asking the user settings service for - * them since the system settings service can't interact with anything - * to get new secrets. - */ - if (info->request_new) - success = system_get_secrets_from_user (info); - - /* If the user wasn't authorized, or we should retry using existing - * secrets, just ask the system settings service. - */ - if (!success) { - const char *hints[3] = { NULL, NULL, NULL }; - - hints[0] = info->hint1; - hints[1] = info->hint2; - nm_settings_connection_interface_get_secrets (connection, - info->setting_name, - hints, - info->request_new, - system_get_secrets_reply_cb, - info); - } - + hints[0] = info->hint1; + hints[1] = info->hint2; + nm_settings_connection_interface_get_secrets (connection, + info->setting_name, + hints, + info->request_new, + system_get_secrets_reply_cb, + info); return FALSE; } @@ -2741,7 +2664,7 @@ system_get_secrets (NMManager *self, info->setting_name = g_strdup (setting_name); info->hint1 = hint1 ? g_strdup (hint1) : NULL; info->hint2 = hint2 ? g_strdup (hint2) : NULL; - info->connection = g_object_ref (connection); + info->connection_path = g_strdup (nm_connection_get_path (connection)); info->request_new = request_new; g_object_weak_ref (G_OBJECT (provider), (GWeakNotify) free_get_secrets_info, info); @@ -4011,9 +3934,7 @@ firmware_dir_changed (GFileMonitor *monitor, switch (event_type) { case G_FILE_MONITOR_EVENT_CREATED: case G_FILE_MONITOR_EVENT_CHANGED: -#if GLIB_CHECK_VERSION(2,23,4) case G_FILE_MONITOR_EVENT_MOVED: -#endif case G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED: case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: if (!priv->fw_changed_id) { -- cgit v1.2.1 From a1174a683e7b37f01a9ffb8562176d7f3efc1833 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 12 Jul 2010 18:21:27 -0700 Subject: core: fix compilation on glib < 2.23.4 Where G_FILE_MONITOR_EVENT_MOVED isn't defined yet. --- src/nm-manager.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nm-manager.c b/src/nm-manager.c index b52c6ce17e..8c31197996 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -3934,7 +3934,9 @@ firmware_dir_changed (GFileMonitor *monitor, switch (event_type) { case G_FILE_MONITOR_EVENT_CREATED: case G_FILE_MONITOR_EVENT_CHANGED: +#if GLIB_CHECK_VERSION(2,23,4) case G_FILE_MONITOR_EVENT_MOVED: +#endif case G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED: case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: if (!priv->fw_changed_id) { -- cgit v1.2.1 From 37d6184312c9d4cdf9ae134c6408da6a88520c39 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 14 Jul 2010 15:46:20 -0700 Subject: policy: don't tear down user connections on VT switch (rh #614556) PK's "allow_inactive" actually means "allow inactive *local* users", so we do want to allow inactive local users to provide user connections. We don't want to allow non-local inactive users to provide user connections. So make the use-user-connections privilege match for both active and inactive so we get the behavior we want. --- policy/org.freedesktop.NetworkManager.policy.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/policy/org.freedesktop.NetworkManager.policy.in b/policy/org.freedesktop.NetworkManager.policy.in index e6540655d4..3e7db0588e 100644 --- a/policy/org.freedesktop.NetworkManager.policy.in +++ b/policy/org.freedesktop.NetworkManager.policy.in @@ -49,7 +49,7 @@ <_description>Allow use of user-specific connections <_message>System policy prevents use of user-specific connections - no + yes yes -- cgit v1.2.1 From 72399bfa2cab6de881518b4b473c5b2a76f058b8 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 14 Jul 2010 17:49:20 -0700 Subject: examples: add device disconnect example --- examples/python/Makefile.am | 3 +- examples/python/disconnect-device.py | 62 ++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100755 examples/python/disconnect-device.py diff --git a/examples/python/Makefile.am b/examples/python/Makefile.am index 179e2f3c9a..dec8b571f7 100644 --- a/examples/python/Makefile.am +++ b/examples/python/Makefile.am @@ -3,6 +3,7 @@ EXTRA_DIST = \ add-system-connection.py \ vpn.py \ list-connections.py \ - show-bssids.py + show-bssids.py \ + disconnect-device.py diff --git a/examples/python/disconnect-device.py b/examples/python/disconnect-device.py new file mode 100755 index 0000000000..f885495140 --- /dev/null +++ b/examples/python/disconnect-device.py @@ -0,0 +1,62 @@ +#!/bin/env python +# -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright (C) 2010 Red Hat, Inc. +# + +import dbus, sys + +# This example takes a device interface name as a parameter and tells +# NetworkManager to disconnect that device, closing down any network +# connection it may have + +if len(sys.argv) != 2: + raise Exception("Usage: %s " % sys.argv[0]) + +bus = dbus.SystemBus() + +# Get a proxy for the base NetworkManager object +proxy = bus.get_object("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager") +manager = dbus.Interface(proxy, "org.freedesktop.NetworkManager") + +dpath = None + +# Find the device the user wants to disconnect +devices = manager.GetDevices() +for d in devices: + dev_proxy = bus.get_object("org.freedesktop.NetworkManager", d) + prop_iface = dbus.Interface(dev_proxy, "org.freedesktop.DBus.Properties") + iface = prop_iface.Get("org.freedesktop.NetworkManager.Device", "Interface") + if iface == sys.argv[1]: + dpath = d + break + +if not dpath or not len(dpath): + raise Exception("NetworkManager knows nothing about %s" % sys.argv[1]) + +dev_proxy = bus.get_object("org.freedesktop.NetworkManager", dpath) +dev_iface = dbus.Interface(dev_proxy, "org.freedesktop.NetworkManager.Device") +prop_iface = dbus.Interface(dev_proxy, "org.freedesktop.DBus.Properties") + +# Make sure the device is connected before we try to disconnect it +state = prop_iface.Get("org.freedesktop.NetworkManager.Device", "State") +if state <= 3: + raise Exception("Device %s isn't connected" % sys.argv[1]) + +# Tell NM to disconnect it +dev_iface.Disconnect() + -- cgit v1.2.1 From 4880cc68b2e1a6580f30318c660c2f669b8f5708 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 15 Jul 2010 00:00:42 -0700 Subject: wifi: work around wl.o frequency reporting for active AP matching Some proprietary drivers (wl.o) report tuned frequency (like when scanning) instead of the associated AP's frequency. This is a great example of how WEXT is underspecified. We use frequency to find the active AP in the scan list because some configurations use the same SSID/BSSID on the 2GHz and 5GHz bands simultaneously, and we need to make sure we get the right AP in the right band. This configuration is uncommon though, and the frequency check penalizes closed drivers we can't fix. Because we're not total dicks, ignore the frequency condition if the associated BSSID/SSID exists only in one band since that's most likely the AP we want. --- src/nm-device-wifi.c | 48 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index dc76dc29db..895d4d1765 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -829,6 +829,11 @@ get_active_ap (NMDeviceWifi *self, const GByteArray *ssid; GSList *iter; int i = 0; + NMAccessPoint *match_nofreq = NULL; + gboolean found_a_band = FALSE; + gboolean found_bg_band = FALSE; + NM80211Mode devmode; + guint32 devfreq; nm_device_wifi_get_bssid (self, &bssid); nm_log_dbg (LOGD_WIFI, "(%s): active BSSID: %02x:%02x:%02x:%02x:%02x:%02x", @@ -847,6 +852,9 @@ get_active_ap (NMDeviceWifi *self, ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : "(none)", ssid ? "'" : ""); + devmode = nm_device_wifi_get_mode (self); + devfreq = nm_device_wifi_get_frequency (self); + /* When matching hidden APs, do a second pass that ignores the SSID check, * because NM might not yet know the SSID of the hidden AP in the scan list * and therefore it won't get matched the first time around. @@ -859,8 +867,8 @@ get_active_ap (NMDeviceWifi *self, NMAccessPoint *ap = NM_AP (iter->data); const struct ether_addr *ap_bssid = nm_ap_get_address (ap); const GByteArray *ap_ssid = nm_ap_get_ssid (ap); - NM80211Mode devmode, apmode; - guint32 devfreq, apfreq; + NM80211Mode apmode; + guint32 apfreq; nm_log_dbg (LOGD_WIFI, " AP: %s%s%s %02x:%02x:%02x:%02x:%02x:%02x", ap_ssid ? "'" : "", @@ -885,7 +893,6 @@ get_active_ap (NMDeviceWifi *self, continue; } - devmode = nm_device_wifi_get_mode (self); apmode = nm_ap_get_mode (ap); if (devmode != apmode) { nm_log_dbg (LOGD_WIFI, " mode mismatch (device %d, ap %d)", @@ -893,11 +900,18 @@ get_active_ap (NMDeviceWifi *self, continue; } - devfreq = nm_device_wifi_get_frequency (self); apfreq = nm_ap_get_freq (ap); if (devfreq != apfreq) { nm_log_dbg (LOGD_WIFI, " frequency mismatch (device %u, ap %u)", devfreq, apfreq); + + if (match_nofreq == NULL) + match_nofreq = ap; + + if (apfreq > 4000) + found_a_band = TRUE; + else if (apfreq > 2000) + found_bg_band = TRUE; continue; } @@ -907,6 +921,32 @@ get_active_ap (NMDeviceWifi *self, } } + /* Some proprietary drivers (wl.o) report tuned frequency (like when + * scanning) instead of the associated AP's frequency. This is a great + * example of how WEXT is underspecified. We use frequency to find the + * active AP in the scan list because some configurations use the same + * SSID/BSSID on the 2GHz and 5GHz bands simultaneously, and we need to + * make sure we get the right AP in the right band. This configuration + * is uncommon though, and the frequency check penalizes closed drivers we + * can't fix. Because we're not total dicks, ignore the frequency condition + * if the associated BSSID/SSID exists only in one band since that's most + * likely the AP we want. + */ + if (match_nofreq && (found_a_band != found_bg_band)) { + const struct ether_addr *ap_bssid = nm_ap_get_address (match_nofreq); + const GByteArray *ap_ssid = nm_ap_get_ssid (match_nofreq); + + nm_log_dbg (LOGD_WIFI, " matched %s%s%s %02x:%02x:%02x:%02x:%02x:%02x", + ap_ssid ? "'" : "", + ap_ssid ? nm_utils_escape_ssid (ap_ssid->data, ap_ssid->len) : "(none)", + ap_ssid ? "'" : "", + ap_bssid->ether_addr_octet[0], ap_bssid->ether_addr_octet[1], + ap_bssid->ether_addr_octet[2], ap_bssid->ether_addr_octet[3], + ap_bssid->ether_addr_octet[4], ap_bssid->ether_addr_octet[5]); + + return match_nofreq; + } + nm_log_dbg (LOGD_WIFI, " No matching AP found."); return NULL; } -- cgit v1.2.1 From e780145a8f58a97114642b24d65bc39185181c2e Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 16 Jul 2010 11:28:39 -0700 Subject: dhcp4: handle NIS servers and domains --- src/dhcp-manager/nm-dhcp-client.c | 21 +++++++++++ src/nm-ip4-config.c | 79 +++++++++++++++++++++++++++++++++++++++ src/nm-ip4-config.h | 11 ++++++ 3 files changed, 111 insertions(+) diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c index 1ed62ab9df..1d50d4221b 100644 --- a/src/dhcp-manager/nm-dhcp-client.c +++ b/src/dhcp-manager/nm-dhcp-client.c @@ -893,6 +893,27 @@ ip4_options_to_config (NMDHCPClient *self) nm_ip4_config_set_mtu (ip4_config, int_mtu); } + str = g_hash_table_lookup (priv->options, "new_nis_domain"); + if (str) { + nm_log_info (LOGD_DHCP4, " NIS domain '%s'", str); + nm_ip4_config_set_nis_domain (ip4_config, str); + } + + str = g_hash_table_lookup (priv->options, "new_nis_servers"); + if (str) { + char **searches = g_strsplit (str, " ", 0); + char **s; + + for (s = searches; *s; s++) { + if (inet_pton (AF_INET, *s, &tmp_addr) > 0) { + nm_ip4_config_add_nis_server (ip4_config, tmp_addr.s_addr); + nm_log_info (LOGD_DHCP4, " nis '%s'", *s); + } else + nm_log_warn (LOGD_DHCP4, "ignoring invalid NIS server '%s'", *s); + } + g_strfreev (searches); + } + return ip4_config; error: diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c index 6dcc2dbcfe..0ae3d1bee4 100644 --- a/src/nm-ip4-config.c +++ b/src/nm-ip4-config.c @@ -56,6 +56,9 @@ typedef struct { GArray *wins; + GArray *nis; + char * nis_domain; + GSList *routes; gboolean never_default; @@ -488,6 +491,70 @@ nm_ip4_config_set_never_default (NMIP4Config *config, gboolean never_default) NM_IP4_CONFIG_GET_PRIVATE (config)->never_default = never_default; } +void nm_ip4_config_add_nis_server (NMIP4Config *config, guint32 nis) +{ + NMIP4ConfigPrivate *priv; + int i; + + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + g_return_if_fail (nis > 0); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + for (i = 0; i < priv->nis->len; i++) { + guint32 s = g_array_index (priv->nis, guint32, i); + + /* No dupes */ + g_return_if_fail (nis != s); + } + + g_array_append_val (priv->nis, nis); +} + +guint32 nm_ip4_config_get_nis_server (NMIP4Config *config, guint i) +{ + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), 0); + + return g_array_index (NM_IP4_CONFIG_GET_PRIVATE (config)->nis, guint32, i); +} + +guint32 nm_ip4_config_get_num_nis_servers (NMIP4Config *config) +{ + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), 0); + + return NM_IP4_CONFIG_GET_PRIVATE (config)->nis->len; +} + +void nm_ip4_config_reset_nis_servers (NMIP4Config *config) +{ + NMIP4ConfigPrivate *priv; + + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + if (priv->nis->len) + g_array_remove_range (priv->nis, 0, priv->nis->len); +} + +void +nm_ip4_config_set_nis_domain (NMIP4Config *config, const char *domain) +{ + NMIP4ConfigPrivate *priv; + + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + g_free (priv->nis_domain); + priv->nis_domain = g_strdup (domain); +} + +const char * +nm_ip4_config_get_nis_domain (NMIP4Config *config) +{ + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), 0); + + return NM_IP4_CONFIG_GET_PRIVATE (config)->nis_domain; +} + /* libnl convenience/conversion functions */ static int ip4_addr_to_rtnl_local (guint32 ip4_address, struct rtnl_addr *addr) @@ -700,6 +767,15 @@ nm_ip4_config_diff (NMIP4Config *a, NMIP4Config *b) || !addr_array_compare (b_priv->wins, a_priv->wins)) flags |= NM_IP4_COMPARE_FLAG_WINS_SERVERS; + if ( (a_priv->nis->len != b_priv->nis->len) + || !addr_array_compare (a_priv->nis, b_priv->nis) + || !addr_array_compare (b_priv->nis, a_priv->nis)) + flags |= NM_IP4_COMPARE_FLAG_NIS_SERVERS; + + if ( (a_priv->nis_domain || b_priv->nis_domain) + && (g_strcmp0 (a_priv->nis_domain, b_priv->nis_domain) != 0)) + flags |= NM_IP4_COMPARE_FLAG_NIS_DOMAIN; + if ( !route_slist_compare (a_priv->routes, b_priv->routes) || !route_slist_compare (b_priv->routes, a_priv->routes)) flags |= NM_IP4_COMPARE_FLAG_ROUTES; @@ -732,6 +808,7 @@ nm_ip4_config_init (NMIP4Config *config) priv->wins = g_array_new (FALSE, TRUE, sizeof (guint32)); priv->domains = g_ptr_array_sized_new (3); priv->searches = g_ptr_array_sized_new (3); + priv->nis = g_array_new (FALSE, TRUE, sizeof (guint32)); } static void @@ -745,6 +822,8 @@ finalize (GObject *object) g_array_free (priv->nameservers, TRUE); g_ptr_array_free (priv->domains, TRUE); g_ptr_array_free (priv->searches, TRUE); + g_array_free (priv->nis, TRUE); + g_free (priv->nis_domain); G_OBJECT_CLASS (nm_ip4_config_parent_class)->finalize (object); } diff --git a/src/nm-ip4-config.h b/src/nm-ip4-config.h index 04999f8779..2d27acff03 100644 --- a/src/nm-ip4-config.h +++ b/src/nm-ip4-config.h @@ -99,6 +99,15 @@ void nm_ip4_config_set_mss (NMIP4Config *config, guint32 ms gboolean nm_ip4_config_get_never_default (NMIP4Config *config); void nm_ip4_config_set_never_default (NMIP4Config *config, gboolean never_default); +void nm_ip4_config_add_nis_server (NMIP4Config *config, guint32 nis); +guint32 nm_ip4_config_get_nis_server (NMIP4Config *config, guint i); +guint32 nm_ip4_config_get_num_nis_servers (NMIP4Config *config); +void nm_ip4_config_reset_nis_servers (NMIP4Config *config); + +void nm_ip4_config_set_nis_domain (NMIP4Config *config, const char *domain); +const char * nm_ip4_config_get_nis_domain (NMIP4Config *config); + + /* Flags for nm_ip4_config_to_rtnl_addr() */ #define NM_RTNL_ADDR_NONE 0x0000 #define NM_RTNL_ADDR_ADDR 0x0001 @@ -122,6 +131,8 @@ typedef enum { NM_IP4_COMPARE_FLAG_MTU = 0x00000040, NM_IP4_COMPARE_FLAG_MSS = 0x00000080, NM_IP4_COMPARE_FLAG_WINS_SERVERS= 0x00000100, + NM_IP4_COMPARE_FLAG_NIS_SERVERS = 0x00000200, + NM_IP4_COMPARE_FLAG_NIS_DOMAIN = 0x00000400, NM_IP4_COMPARE_FLAG_ALL = 0xFFFFFFFF /* match everything */ } NMIP4ConfigCompareFlags; -- cgit v1.2.1 From 786ac623ab4b40e7a71fb384785e5091a101ba9f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 16 Jul 2010 12:44:50 -0700 Subject: dns: send NIS servers and domain to SUSE's netconfig --- src/named-manager/nm-named-manager.c | 50 ++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/src/named-manager/nm-named-manager.c b/src/named-manager/nm-named-manager.c index dc1a6c1db6..44a056f3c4 100644 --- a/src/named-manager/nm-named-manager.c +++ b/src/named-manager/nm-named-manager.c @@ -105,6 +105,8 @@ typedef struct { GPtrArray *nameservers; const char *domain; GPtrArray *searches; + const char *nis_domain; + GPtrArray *nis_servers; } NMResolvConfData; static void @@ -155,6 +157,23 @@ merge_one_ip4_config (NMResolvConfData *rc, NMIP4Config *src) num = nm_ip4_config_get_num_searches (src); for (i = 0; i < num; i++) add_string_item (rc->searches, nm_ip4_config_get_search (src, i)); + + /* NIS stuff */ + num = nm_ip4_config_get_num_nis_servers (src); + for (i = 0; i < num; i++) { + struct in_addr addr; + char buf[INET_ADDRSTRLEN]; + + addr.s_addr = nm_ip4_config_get_nis_server (src, i); + if (inet_ntop (AF_INET, &addr, buf, INET_ADDRSTRLEN) > 0) + add_string_item (rc->nis_servers, buf); + } + + if (nm_ip4_config_get_nis_domain (src)) { + /* FIXME: handle multiple domains */ + if (!rc->nis_domain) + rc->nis_domain = nm_ip4_config_get_nis_domain (src); + } } static void @@ -246,6 +265,8 @@ static gboolean dispatch_netconfig (const char *domain, char **searches, char **nameservers, + const char *nis_domain, + char **nis_servers, const char *iface, GError **error) { @@ -290,6 +311,15 @@ dispatch_netconfig (const char *domain, g_free (str); } + if (nis_domain) + write_to_netconfig (fd, "NISDOMAIN", nis_domain); + + if (nis_servers) { + str = g_strjoinv (" ", nis_servers); + write_to_netconfig (fd, "NISSERVERS", str); + g_free (str); + } + close (fd); /* Wait until the process exits */ @@ -509,8 +539,10 @@ rewrite_resolv_conf (NMNamedManager *mgr, const char *iface, GError **error) NMResolvConfData rc; GSList *iter; const char *domain = NULL; + const char *nis_domain = NULL; char **searches = NULL; char **nameservers = NULL; + char **nis_servers = NULL; int num, i, len; gboolean success = FALSE; @@ -527,6 +559,7 @@ rewrite_resolv_conf (NMNamedManager *mgr, const char *iface, GError **error) rc.nameservers = g_ptr_array_new (); rc.domain = NULL; rc.searches = g_ptr_array_new (); + rc.nis_servers = g_ptr_array_new (); if (priv->ip4_vpn_config) merge_one_ip4_config (&rc, priv->ip4_vpn_config); @@ -595,13 +628,24 @@ rewrite_resolv_conf (NMNamedManager *mgr, const char *iface, GError **error) } else g_ptr_array_free (rc.nameservers, TRUE); + if (rc.nis_servers->len) { + g_ptr_array_add (rc.nis_servers, NULL); + nis_servers = (char **) g_ptr_array_free (rc.nis_servers, FALSE); + } else + g_ptr_array_free (rc.nis_servers, TRUE); + + nis_domain = rc.nis_domain; + #ifdef RESOLVCONF_PATH success = dispatch_resolvconf (domain, searches, nameservers, iface, error); #endif #ifdef TARGET_SUSE - if (success == FALSE) - success = dispatch_netconfig (domain, searches, nameservers, iface, error); + if (success == FALSE) { + success = dispatch_netconfig (domain, searches, nameservers, + nis_domain, nis_servers, + iface, error); + } #endif if (success == FALSE) @@ -614,6 +658,8 @@ rewrite_resolv_conf (NMNamedManager *mgr, const char *iface, GError **error) g_strfreev (searches); if (nameservers) g_strfreev (nameservers); + if (nis_servers) + g_strfreev (nis_servers); return success; } -- cgit v1.2.1 From ce7d37ad808e78931dd9e12642a9c31fac3c1c05 Mon Sep 17 00:00:00 2001 From: Bin Li Date: Fri, 16 Jul 2010 12:54:39 -0700 Subject: dns: fix race waiting for netconfig --- src/named-manager/nm-named-manager.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/named-manager/nm-named-manager.c b/src/named-manager/nm-named-manager.c index 44a056f3c4..aea23b4e3b 100644 --- a/src/named-manager/nm-named-manager.c +++ b/src/named-manager/nm-named-manager.c @@ -329,6 +329,10 @@ dispatch_netconfig (const char *domain, ret = waitpid (pid, NULL, 0); if (ret < 0 && errno == EINTR) goto again; + else if (ret < 0 && errno == ECHILD) { + /* When the netconfig exist, the errno is ECHILD, it should return TRUE */ + return TRUE; + } return ret > 0; } -- cgit v1.2.1 From 5ac451a8d9673e962e0ca06fa719e82f85f5e36c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDygimantas=20Beru=C4=8Dka?= Date: Fri, 16 Jul 2010 15:08:03 -0700 Subject: po: updated Lithuanian translation (bgo #624439) --- po/lt.po | 1423 ++++++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 968 insertions(+), 455 deletions(-) diff --git a/po/lt.po b/po/lt.po index 3ef27117ff..70212c828f 100644 --- a/po/lt.po +++ b/po/lt.po @@ -6,19 +6,90 @@ msgid "" msgstr "" "Project-Id-Version: NetworkManager HEAD\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" -"product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-04-30 03:24+0000\n" -"PO-Revision-Date: 2010-06-25 18:30+0300\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=Networ" +"kManager&component=general\n" +"POT-Creation-Date: 2010-06-28 08:52+0000\n" +"PO-Revision-Date: 2010-07-15 14:09+0300\n" "Last-Translator: Aurimas Černius \n" -"Language-Team: Lietuvių \n" +"Language-Team: Lithuanian \n" +"Language: lt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: UTF-8\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%" "100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Virtaal 0.6.1\n" -#: ../cli/src/connections.c:86 +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "PAVADINIMAS" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "ĮRENGINIAI" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SRITIS" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "NUMATYTASIS" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-TARNYBA" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECTAS" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TIPAS" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "LAIKO-ŽYMA" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "LAIKO-ŽYMA-TIKROJI" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOPRISIJUNGIMAS" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "TIKSKAITOMA" + +#: ../cli/src/connections.c:157 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -39,310 +110,514 @@ msgstr "" "]\n" " down id | uuid \n" -#: ../cli/src/connections.c:158 -msgid "Connections" -msgstr "Ryšiai" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/devices.c:298 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "Type" -msgstr "Tipas" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "UUID" -msgstr "UUID" +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Klaida: „con list“: %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Klaida: „con list“: %s; leidžiami laukai: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "Ryšio informacija" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "sisteminis" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "naudotojo" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "niekada" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:551 ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 +msgid "yes" +msgstr "taip" -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Name" -msgstr "Pavadinimas" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:510 ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 ../cli/src/settings.c:1224 +msgid "no" +msgstr "ne" -#: ../cli/src/connections.c:163 -#, c-format -msgid "System connections:\n" -msgstr "Sistemos ryšiai:\n" +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "Sistemos ryšiai" -#: ../cli/src/connections.c:167 -#, c-format -msgid "User connections:\n" -msgstr "Naudotojo ryšiai:\n" +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "Naudotojo ryšiai" -#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 -#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 -#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 -#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 -#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 #, c-format msgid "Error: %s argument is missing." msgstr "Klaida: trūksta argumento %s." -#: ../cli/src/connections.c:189 +#: ../cli/src/connections.c:487 #, c-format msgid "Error: %s - no such connection." msgstr "Klaida: ryšio %s nėra." -#: ../cli/src/connections.c:196 -msgid "System-wide connections" -msgstr "Sistemos ryšiai" - -#: ../cli/src/connections.c:205 -msgid "User connections" -msgstr "Naudotojo ryšiai" - -#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 -#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 -#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 -#: ../cli/src/devices.c:798 +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 #, c-format msgid "Unknown parameter: %s\n" msgstr "Nežinomas parametras: %s\n" -#: ../cli/src/connections.c:221 +#: ../cli/src/connections.c:528 #, c-format msgid "Error: no valid parameter specified." msgstr "Klaida: nenurodyta tinkamų parametrų." -#. FIXME: Fix the output -#: ../cli/src/connections.c:268 ../cli/src/devices.c:302 -#: ../cli/src/devices.c:321 ../cli/src/devices.c:353 ../cli/src/devices.c:355 -#: ../cli/src/devices.c:357 ../cli/src/devices.c:359 ../cli/src/devices.c:361 -msgid "yes" -msgstr "taip" +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "Klaida: %s" -#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 -msgid "no" -msgstr "ne" +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Klaida: „con status“: %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Klaida: „con status“: %s; leidžiami laukai: %s" -#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:658 msgid "Active connections" msgstr "Aktyvūs ryšiai" -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 -msgid "Default" -msgstr "Numatyta" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Service" -msgstr "Tarnyba" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Devices" -msgstr "Įrenginiai" - -#: ../cli/src/connections.c:659 +#: ../cli/src/connections.c:1026 #, c-format msgid "no active connection on device '%s'" msgstr "nėra aktyvaus ryšio įrenginyje „%s“" -#: ../cli/src/connections.c:667 +#: ../cli/src/connections.c:1034 #, c-format msgid "no active connection or device" msgstr "nėra aktyvaus ryšio įrenginyje" -#: ../cli/src/connections.c:730 +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "įrenginys „%s“ nesuderinamas su ryšiu „%s“" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "nerastas įrenginys ryšiui „%s“" + +#: ../cli/src/connections.c:1097 msgid "activating" msgstr "aktyvuojama" -#: ../cli/src/connections.c:732 +#: ../cli/src/connections.c:1099 msgid "activated" msgstr "aktyvuota" -#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 -#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 -#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:473 msgid "unknown" msgstr "nežinoma" -#: ../cli/src/connections.c:744 +#: ../cli/src/connections.c:1111 msgid "VPN connecting (prepare)" msgstr "VPN jungiamasi (ruošiama)" -#: ../cli/src/connections.c:746 +#: ../cli/src/connections.c:1113 msgid "VPN connecting (need authentication)" msgstr "VPN jungiamasi (reikia nustatyti tapatybę)" -#: ../cli/src/connections.c:748 +#: ../cli/src/connections.c:1115 msgid "VPN connecting" msgstr "VPN jungiamasi" -#: ../cli/src/connections.c:750 +#: ../cli/src/connections.c:1117 msgid "VPN connecting (getting IP configuration)" msgstr "VPN jungiamasi (gaunama IP konfigūracija)" -#: ../cli/src/connections.c:752 +#: ../cli/src/connections.c:1119 msgid "VPN connected" msgstr "VPN prisijungta" -#: ../cli/src/connections.c:754 +#: ../cli/src/connections.c:1121 msgid "VPN connection failed" msgstr "VPN prisijungti nepavyko" -#: ../cli/src/connections.c:756 +#: ../cli/src/connections.c:1123 msgid "VPN disconnected" msgstr "VPN atsijungta" -#: ../cli/src/connections.c:767 +#: ../cli/src/connections.c:1134 msgid "unknown reason" msgstr "nežinoma priežastis" -#: ../cli/src/connections.c:769 +#: ../cli/src/connections.c:1136 msgid "none" msgstr "jokia" -#: ../cli/src/connections.c:771 +#: ../cli/src/connections.c:1138 msgid "the user was disconnected" msgstr "naudotojas buvo atjungtas" -#: ../cli/src/connections.c:773 +#: ../cli/src/connections.c:1140 msgid "the base network connection was interrupted" msgstr "bazinis tinklo ryšys buvo pertrauktas" -#: ../cli/src/connections.c:775 +#: ../cli/src/connections.c:1142 msgid "the VPN service stopped unexpectedly" msgstr "VPN tarnyba netikėtai sustojo" -#: ../cli/src/connections.c:777 +#: ../cli/src/connections.c:1144 msgid "the VPN service returned invalid configuration" msgstr "VPN tarnyba grąžino netinkamą konfigūraciją" -#: ../cli/src/connections.c:779 +#: ../cli/src/connections.c:1146 msgid "the connection attempt timed out" msgstr "bandymo jungtis laikas baigėsi" -#: ../cli/src/connections.c:781 +#: ../cli/src/connections.c:1148 msgid "the VPN service did not start in time" msgstr "VPN tarnyba nebuvo paleista laiku" -#: ../cli/src/connections.c:783 +#: ../cli/src/connections.c:1150 msgid "the VPN service failed to start" msgstr "nepavyko paleisti VPN tarnybos" -#: ../cli/src/connections.c:785 +#: ../cli/src/connections.c:1152 msgid "no valid VPN secrets" msgstr "nėra tinkamų VPN paslapčių" -#: ../cli/src/connections.c:787 +#: ../cli/src/connections.c:1154 msgid "invalid VPN secrets" msgstr "netinkamos VPN paslaptys" -#: ../cli/src/connections.c:789 +#: ../cli/src/connections.c:1156 msgid "the connection was removed" msgstr "ryšys buvo pašalintas" -#: ../cli/src/connections.c:803 +#: ../cli/src/connections.c:1170 #, c-format msgid "state: %s\n" msgstr "būsena: %s\n" -#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 #, c-format msgid "Connection activated\n" msgstr "Ryšys aktyvuotas\n" -#: ../cli/src/connections.c:809 +#: ../cli/src/connections.c:1176 #, c-format msgid "Error: Connection activation failed." msgstr "Klaida: nepavyko aktyvuoti ryšio." -#: ../cli/src/connections.c:828 +#: ../cli/src/connections.c:1195 #, c-format msgid "state: %s (%d)\n" msgstr "būsena: %s (%d)\n" -#: ../cli/src/connections.c:838 +#: ../cli/src/connections.c:1205 #, c-format msgid "Error: Connection activation failed: %s." msgstr "Klaida: nepavyko aktyvuoti ryšio: %s." -#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 #, c-format msgid "Error: Timeout %d sec expired." msgstr "Klaida: baigėsi %d sek. laikas." -#: ../cli/src/connections.c:898 +#: ../cli/src/connections.c:1265 #, c-format msgid "Error: Connection activation failed: %s" msgstr "Klaida: nepavyko aktyvuoti ryšio: %s" -#: ../cli/src/connections.c:912 +#: ../cli/src/connections.c:1279 #, c-format msgid "Error: Obtaining active connection for '%s' failed." msgstr "Klaida: nepavyko „%s“ gauti aktyvaus ryšio." -#: ../cli/src/connections.c:921 +#: ../cli/src/connections.c:1288 #, c-format msgid "Active connection state: %s\n" msgstr "Aktyvaus ryšio būsena: %s\n" -#: ../cli/src/connections.c:922 +#: ../cli/src/connections.c:1289 #, c-format msgid "Active connection path: %s\n" msgstr "Aktyvaus ryšio kelias: %s\n" -#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 #, c-format msgid "Error: Unknown connection: %s." msgstr "Klaida: nežinomas ryšys: %s" -#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 #, c-format msgid "Error: timeout value '%s' is not valid." msgstr "Klaida: netinkama laukimo laiko reikšmė „%s“." -#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 #, c-format msgid "Error: id or uuid has to be specified." msgstr "Klaida: id arba uuid turi būti nurodytas." -#: ../cli/src/connections.c:1044 +#: ../cli/src/connections.c:1411 #, c-format msgid "Error: No suitable device found: %s." msgstr "Klaida: nerastas tinkamas įrenginys: %s." -#: ../cli/src/connections.c:1046 +#: ../cli/src/connections.c:1413 #, c-format msgid "Error: No suitable device found." msgstr "Klaida: nerastas tinkamas įrenginys." -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1505 #, c-format msgid "Warning: Connection not active\n" msgstr "Įspėjimas: ryšys neaktyvus\n" -#: ../cli/src/connections.c:1189 +#: ../cli/src/connections.c:1561 #, c-format msgid "Error: 'con' command '%s' is not valid." msgstr "Klaida: netinkama „con“ komanda „%s“." -#: ../cli/src/connections.c:1216 +#: ../cli/src/connections.c:1597 #, c-format msgid "Error: could not connect to D-Bus." msgstr "Klaida: nepavyko prisijungti prie D-Bus." -#: ../cli/src/connections.c:1223 +#: ../cli/src/connections.c:1604 #, c-format msgid "Error: Could not get system settings." msgstr "Klaida: nepavyko gauti sistemos nustatymų." -#: ../cli/src/connections.c:1231 +#: ../cli/src/connections.c:1612 #, c-format msgid "Error: Could not get user settings." msgstr "Klaida: nepavyko gauti naudotojo nustatymų." -#: ../cli/src/connections.c:1241 +#: ../cli/src/connections.c:1622 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "Klaida: nepavyko gauti ryšių: nustatymų tarnybos neveikia." +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "ĮRENGINYS" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "BŪSENA" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "BENDRA" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "GEBOS" + +#. 1 #: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-SAVYBĖS" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "LAIDINIO-TINKLO-SAVYBĖS" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-PARAMETRAI" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "TVARKYKLĖ" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "APARATINIS-ADRESAS" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "NEŠLIO-APTIKIMAS" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPARTA" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "NEŠLYS" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADRESAS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PRIEŠDĖLIS" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "ŠLIUZAS" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "VEIKSENA" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "DAŽNIS" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "DAŽNUMAS" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNALAS" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SAUGA" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-ŽYMOS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-ŽYMOS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "AKTYVUS" + +#: ../cli/src/devices.c:186 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -352,7 +627,7 @@ msgid "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" msgstr "" "Naudojimas: nmcli dev { KOMANDA | help }\n" @@ -362,349 +637,236 @@ msgstr "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" -#: ../cli/src/devices.c:93 +#: ../cli/src/devices.c:206 msgid "unmanaged" msgstr "nevaldomas" -#: ../cli/src/devices.c:95 +#: ../cli/src/devices.c:208 msgid "unavailable" msgstr "neprieinamas" -#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 msgid "disconnected" msgstr "atjungtas" -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:212 msgid "connecting (prepare)" msgstr "jungiamasi (ruošiama)" -#: ../cli/src/devices.c:101 +#: ../cli/src/devices.c:214 msgid "connecting (configuring)" msgstr "jungiamasi (konfigūruojama)" -#: ../cli/src/devices.c:103 +#: ../cli/src/devices.c:216 msgid "connecting (need authentication)" msgstr "jungiamasi (reikia nustatyti tapatybę)" -#: ../cli/src/devices.c:105 +#: ../cli/src/devices.c:218 msgid "connecting (getting IP configuration)" msgstr "jungiamasi (gaunama IP konfigūracija)" -#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 msgid "connected" msgstr "prisijungta" -#: ../cli/src/devices.c:109 +#: ../cli/src/devices.c:222 msgid "connection failed" msgstr "prisijungti nepavyko" -#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 msgid "Unknown" msgstr "Nežinoma" -#. print them -#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 -#: ../cli/src/devices.c:879 +#: ../cli/src/devices.c:277 msgid "(none)" msgstr "(jokios)" -#: ../cli/src/devices.c:209 +#: ../cli/src/devices.c:302 #, c-format msgid "%s: error converting IP4 address 0x%X" msgstr "%s: klaida konvertuojant IP4 adresą 0x%X" -#: ../cli/src/devices.c:238 +#: ../cli/src/devices.c:349 #, c-format -msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" -msgstr "%s, %s, dažnis %d MHz, sparta %d Mb/s, stiprumas %d" - -#: ../cli/src/devices.c:239 -msgid "Ad-Hoc" -msgstr "Ad-Hoc" - -#: ../cli/src/devices.c:248 -msgid ", Encrypted: " -msgstr ", šifruota: " - -#: ../cli/src/devices.c:253 -msgid " WEP" -msgstr " WEP" - -#: ../cli/src/devices.c:255 -msgid " WPA" -msgstr " WPA" - -#: ../cli/src/devices.c:257 -msgid " WPA2" -msgstr " WPA2" +msgid "%u MHz" +msgstr "%u MHz" -#: ../cli/src/devices.c:260 -msgid " Enterprise" -msgstr " Kompanija" +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" -#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "Device" -msgstr "Įrenginys" +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "Šifruota: " -#: ../cli/src/devices.c:299 -msgid "Driver" -msgstr "Tvarkyklė" +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP" -#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 -msgid "(unknown)" -msgstr "(nežinoma)" +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA" -#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "State" -msgstr "Būsena" +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2" -#: ../cli/src/devices.c:313 -msgid "HW Address" -msgstr "Aparatinis adresas" +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "Kompanija " -#: ../cli/src/devices.c:319 -#, c-format -msgid "" -"\n" -" Capabilities:\n" -msgstr "" -"\n" -"Galimybės:\n" +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" -#: ../cli/src/devices.c:321 -msgid "Carrier Detect" -msgstr "Perdavimo aptikimas" +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "Infrastruktūra" -#: ../cli/src/devices.c:336 +#: ../cli/src/devices.c:442 #, c-format -msgid "%u Mb/s" -msgstr "%u Mb/s" +msgid "Error: 'dev list': %s" +msgstr "Klaida: „dev list“: %s" -#: ../cli/src/devices.c:337 -msgid "Speed" -msgstr "Sparta" - -#: ../cli/src/devices.c:348 +#: ../cli/src/devices.c:444 #, c-format -msgid "" -"\n" -" Wireless Properties\n" -msgstr "" -"\n" -" Belaidžio ryšio savybės\n" - -#: ../cli/src/devices.c:353 -msgid "WEP Encryption" -msgstr "WEP šifravimas" - -#: ../cli/src/devices.c:355 -msgid "WPA Encryption" -msgstr "WPA šifravimas" +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Klaida: „dev list“: %s; leidžiami laukai: %s" -#: ../cli/src/devices.c:357 -msgid "WPA2 Encryption" -msgstr "WPA2 šifravimas" +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "Įrenginio informacija" -#: ../cli/src/devices.c:359 -msgid "TKIP cipher" -msgstr "TKIP šifras" - -#: ../cli/src/devices.c:361 -msgid "CCMP cipher" -msgstr "CCMP šifras" - -#: ../cli/src/devices.c:368 -#, c-format -msgid "" -"\n" -" Wireless Access Points %s\n" -msgstr "" -"\n" -" Belaidžiai prieigos taškai %s\n" +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(nežinoma)" -#: ../cli/src/devices.c:368 -msgid "(* = current AP)" -msgstr "(* = dabartinis prieigos taškas)" +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "nežinoma)" -#: ../cli/src/devices.c:374 +#: ../cli/src/devices.c:510 #, c-format -msgid "" -"\n" -" Wired Properties\n" -msgstr "" -"\n" -"Laidinio ryšio savybės\n" - -#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 -msgid "Carrier" -msgstr "Perdavimas" +msgid "%u Mb/s" +msgstr "%u Mb/s" -#: ../cli/src/devices.c:377 +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 msgid "on" msgstr "įjungta" -#: ../cli/src/devices.c:379 +#: ../cli/src/devices.c:583 msgid "off" msgstr "išjungta" -#: ../cli/src/devices.c:387 +#: ../cli/src/devices.c:710 #, c-format -msgid "" -"\n" -" IPv4 Settings:\n" -msgstr "" -"\n" -" IPv4 nustatymai:\n" - -#: ../cli/src/devices.c:395 -msgid "Address" -msgstr "Adresas" - -#: ../cli/src/devices.c:401 -msgid "Prefix" -msgstr "Priešdėlis" +msgid "Error: 'dev status': %s" +msgstr "Klaida: „dev status“: %s" -#: ../cli/src/devices.c:405 -msgid "Gateway" -msgstr "Šliuzas" - -#: ../cli/src/devices.c:416 -msgid "DNS" -msgstr "DNS" +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Klaida: „dev status“: %s; leidžiami laukai: %s" -#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:719 msgid "Status of devices" msgstr "Įrenginių būsena" -#: ../cli/src/devices.c:487 +#: ../cli/src/devices.c:747 #, c-format msgid "Error: '%s' argument is missing." msgstr "Klaida: trūksta argumento „%s“." -#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 #, c-format msgid "Error: Device '%s' not found." msgstr "Klaida: nerastas įrenginys „%s“." -#: ../cli/src/devices.c:539 +#: ../cli/src/devices.c:799 #, c-format msgid "Success: Device '%s' successfully disconnected." msgstr "Pavyko: sėkmingai atjungtas įrenginys „%s“." -#: ../cli/src/devices.c:564 +#: ../cli/src/devices.c:824 #, c-format msgid "Error: Device '%s' (%s) disconnecting failed: %s" msgstr "Klaida: įrenginio „%s“ (%s) atjungti nepavyko: %s" -#: ../cli/src/devices.c:572 +#: ../cli/src/devices.c:832 #, c-format msgid "Device state: %d (%s)\n" msgstr "Įrenginio būsena: %d (%s)\n" -#: ../cli/src/devices.c:636 +#: ../cli/src/devices.c:896 #, c-format msgid "Error: iface has to be specified." msgstr "Klaida: turi būti nurodytas iface." -#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 -msgid "WiFi scan list" -msgstr "WiFi skenavimo sąrašas" - -#: ../cli/src/devices.c:740 +#: ../cli/src/devices.c:1011 #, c-format -msgid "Error: Device '%s' is not a WiFi device." -msgstr "Klaida: „%s“ nėra WiFi įrenginys " - -#: ../cli/src/devices.c:754 -msgid "Device:" -msgstr "Įrenginys:" +msgid "Error: 'dev wifi': %s" +msgstr "Klaida: „dev wifi“: %s" -#: ../cli/src/devices.c:806 +#: ../cli/src/devices.c:1013 #, c-format -msgid "Error: hwaddr has to be specified." -msgstr "Klaida: turi būti nurodytas hwaddr." +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Klaida: „dev wifi“: %s; leidžiami laukai: %s" -#: ../cli/src/devices.c:844 +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi skenavimo sąrašas" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 #, c-format msgid "Error: Access point with hwaddr '%s' not found." msgstr "Klaida: nerastas prieigos taškas su hwaddr „%s“." -#: ../cli/src/devices.c:862 -#, c-format -msgid "%u MHz" -msgstr "%u MHz" - -#: ../cli/src/devices.c:863 +#: ../cli/src/devices.c:1072 #, c-format -msgid "%u MB/s" -msgstr "%u MB/s" - -#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 -msgid "AP parameters" -msgstr "Prieigos taško parametrai" - -#: ../cli/src/devices.c:873 -msgid "SSID:" -msgstr "SSID:" - -#: ../cli/src/devices.c:874 -msgid "BSSID:" -msgstr "BSSID:" - -#: ../cli/src/devices.c:875 -msgid "Frequency:" -msgstr "Dažnis:" - -#: ../cli/src/devices.c:876 -msgid "Mode:" -msgstr "Veiksena:" - -#: ../cli/src/devices.c:876 -msgid "Ad-hoc" -msgstr "Ad-hoc" - -#: ../cli/src/devices.c:876 -msgid "Infrastructure" -msgstr "Infrastruktūra" - -#: ../cli/src/devices.c:877 -msgid "Maximal bitrate:" -msgstr "Didžiausias galimas bitų dažnis:" - -#: ../cli/src/devices.c:878 -msgid "Strength:" -msgstr "Stiprumas:" - -#: ../cli/src/devices.c:879 -msgid "Flags:" -msgstr "Požymiai:" - -#: ../cli/src/devices.c:879 -msgid "privacy" -msgstr "privatumas" - -#: ../cli/src/devices.c:880 -msgid "WPA flags:" -msgstr "WPA požymiai:" - -#: ../cli/src/devices.c:881 -msgid "RSN flags:" -msgstr "RSN požymiai:" +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Klaida: „%s“ nėra WiFi įrenginys " -#: ../cli/src/devices.c:907 +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: 'dev wifi' command '%s' is not valid." msgstr "Klaida: netinkama „dev wifi“ komanda „%s“." -#: ../cli/src/devices.c:943 +#: ../cli/src/devices.c:1183 #, c-format msgid "Error: 'dev' command '%s' is not valid." msgstr "Klaida: netinkama „dev“ komanda „%s“." -#: ../cli/src/network-manager.c:46 +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "VEIKIA" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-APARATINĖ-ĮRANGA" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-APARATINĖ-ĮRANGA" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 #, c-format msgid "" "Usage: nmcli nm { COMMAND | help }\n" @@ -729,89 +891,91 @@ msgstr "" " wwan [on|off]\n" "\n" -#: ../cli/src/network-manager.c:67 +#: ../cli/src/network-manager.c:83 msgid "asleep" msgstr "miegantis" -#: ../cli/src/network-manager.c:69 +#: ../cli/src/network-manager.c:85 msgid "connecting" msgstr "jungiamasi" -#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 -#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 -#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 -msgid "enabled" -msgstr "įjungta" +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Klaida: „nm status“: %s" -#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 -#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 -#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 -msgid "disabled" -msgstr "išjungta" +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Klaida: „nm status“: %s; leidžiami laukai: %s" -#: ../cli/src/network-manager.c:102 +#: ../cli/src/network-manager.c:134 msgid "NetworkManager status" msgstr "NetworkManager būsena" -#: ../cli/src/network-manager.c:104 -msgid "NM running:" -msgstr "NM veikimas:" +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "įjungta" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "išjungta" -#: ../cli/src/network-manager.c:104 +#: ../cli/src/network-manager.c:148 msgid "running" msgstr "veikia" -#: ../cli/src/network-manager.c:104 +#: ../cli/src/network-manager.c:148 msgid "not running" msgstr "neveikia" -#: ../cli/src/network-manager.c:105 -msgid "NM state:" -msgstr "NM būsena" - -#: ../cli/src/network-manager.c:106 -msgid "NM wireless hardware:" -msgstr "NM belaidė įranga:" - -#. no argument, show current state -#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 -msgid "NM wireless:" -msgstr "NM belaidis:" - -#: ../cli/src/network-manager.c:108 -msgid "NM WWAN hardware:" -msgstr "NM WWAN įranga:" +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Klaida: „--fields“ reikšmė „%s“ čia netinkama; leidžiami laukai: %s" -#. no argument, show current state -#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 -msgid "NM WWAN:" -msgstr "NM WWAN:" +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi įjungtas" -#: ../cli/src/network-manager.c:150 +#: ../cli/src/network-manager.c:220 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." msgstr "Klaida: netinkamas „wifi“ parametras: „%s“." -#: ../cli/src/network-manager.c:167 +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN įjungta" + +#: ../cli/src/network-manager.c:252 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." msgstr "Klaida: netinkamas „wwan“ parametras: „%s“." -#: ../cli/src/network-manager.c:178 +#: ../cli/src/network-manager.c:263 #, c-format msgid "Error: 'nm' command '%s' is not valid." msgstr "Klaida: netinkama „nm“ komanda „%s“." -#: ../cli/src/nmcli.c:65 +#: ../cli/src/nmcli.c:69 #, c-format msgid "" "Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" "\n" "OPTIONS\n" -" -t[erse] terse output\n" -" -p[retty] pretty output\n" -" -v[ersion] show program version\n" -" -h[elp] print this help\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" "\n" "OBJECT\n" " nm NetworkManager status\n" @@ -822,10 +986,14 @@ msgstr "" "Naudojimas: %s [PARINKTYS] OBJEKTAS { KOMANDA | help }\n" "\n" "PARINKTYS\n" -" -t[erse] trumpa išvestis\n" -" -p[retty] graži išvestis\n" -" -v[ersion] rodyti programos versiją\n" -" -h[elp] išvesti šią pagalbą\n" +" -t[erse] trumpa išvestis\n" +" -p[retty] graži išvestis\n" +" -m[ode] tabular|multiline išvedimo veiksena\n" +" -f[fields] |all|common nurodyti išvedamus laukus\n" +" -e[scape] yes|no atlikti stulpelių skirtukų " +"kaitą\n" +" -v[ersion] rodyti programos versiją\n" +" -h[elp] išvesti šią pagalbą\n" "\n" "OBJEKTAS\n" " nm NetworkManager būsena\n" @@ -833,35 +1001,168 @@ msgstr "" " dev NetworkManager valdomi įrenginiai\n" "\n" -#: ../cli/src/nmcli.c:106 +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Klaida: nežinomas objektas „%s“, bandykite „nmcli help“." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Klaida: parinktis „--terse“ nurodyta antrą kartą." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Klaida: parinktis „--terse“ yra tarpusavyje nesuderinama su „--pretty“." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Klaida: parinktis „--pretty“ nurodyta antrą kartą." + +#: ../cli/src/nmcli.c:161 #, c-format -msgid "Object '%s' is unknown, try 'nmcli help'." -msgstr "Nežinomas objektas „%s“, bandykite „nmcli help“." +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Klaida: parinktis „--pretty“ yra tarpusavyje nesuderinama su „--terse“." -#: ../cli/src/nmcli.c:139 +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Klaida: trūksta argumento parinkčiai „%s“." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Klaida: „%s“ yra netinkamas argumentas parinkčiai „%s“." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Klaida: trūksta laukų parinktims „%s“." + +#: ../cli/src/nmcli.c:209 #, c-format msgid "nmcli tool, version %s\n" msgstr "nmcli įrankis, versija %s\n" -#: ../cli/src/nmcli.c:145 +#: ../cli/src/nmcli.c:215 #, c-format -msgid "Option '%s' is unknown, try 'nmcli -help'." -msgstr "Nežinoma parinktis „%s“, bandykite „nmcli help“." +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Klaida: nežinoma parinktis „%s“, bandykite „nmcli -help“." -#: ../cli/src/nmcli.c:164 +#: ../cli/src/nmcli.c:234 #, c-format msgid "Caught signal %d, shutting down..." msgstr "Gautas signalas %d, išjungiama..." -#: ../cli/src/nmcli.c:189 +#: ../cli/src/nmcli.c:259 #, c-format msgid "Error: Could not connect to NetworkManager." msgstr "Klaida: nepavyko prisijungti prie NetworkManager." -#: ../cli/src/nmcli.c:205 +#: ../cli/src/nmcli.c:275 msgid "Success" msgstr "Pavyko" +#: ../cli/src/settings.c:411 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (šešioliktainis ascii raktas)" + +#: ../cli/src/settings.c:413 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128 bitų slaptažodis)" + +#: ../cli/src/settings.c:416 +#, c-format +msgid "%d (unknown)" +msgstr "%d (nežinoma)" + +#: ../cli/src/settings.c:442 +msgid "0 (unknown)" +msgstr "0 (nežinoma)" + +#: ../cli/src/settings.c:448 +msgid "any, " +msgstr "bet koks, " + +#: ../cli/src/settings.c:450 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:454 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:456 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:468 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:470 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:554 ../cli/src/settings.c:721 +msgid "auto" +msgstr "automatinis" + +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 +msgid "not set" +msgstr "nenustatyta" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "laukas „%s“ turi būti vienintelis" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "netinkamas laukas „%s“" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Parinktis „--terse“ reikalauja nurodyti „--fields“" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "" +"Parinktis „--terse“ reikalauja konkrečių parinkties „--fields“ reikšmių, ne " +"„%s“" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." @@ -1179,30 +1480,120 @@ msgstr "Nepavyko patvirtinti PKCS#12 failo: %d" msgid "Could not generate random data." msgstr "Nepavyko sugeneruoti atsitiktinių duomenų." -#: ../libnm-util/nm-utils.c:1924 +#: ../libnm-util/nm-utils.c:1925 #, c-format msgid "Not enough memory to make encryption key." msgstr "Nepakanka atminties šifravimo raktui sukurti." -#: ../libnm-util/nm-utils.c:2034 +#: ../libnm-util/nm-utils.c:2035 msgid "Could not allocate memory for PEM file creation." msgstr "Nepakanka atminties PEM failui sukurti." -#: ../libnm-util/nm-utils.c:2046 +#: ../libnm-util/nm-utils.c:2047 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "Nepakanka atminties IV įrašyti į PEM failą." -#: ../libnm-util/nm-utils.c:2058 +#: ../libnm-util/nm-utils.c:2059 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "Nepakanka atminties šifruotam raktui įrašyti į PEM failą." -#: ../libnm-util/nm-utils.c:2077 +#: ../libnm-util/nm-utils.c:2078 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "Nepakanka atminties PEM failo duomenims." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Dalijimasis ryšiu naudojant apsaugotą WiFi tinklą" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Dalijimasis ryšiu naudojant atvirą WiFi tinklą" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Keisti pastovų sistemos vardą" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Keisti sistemos ryšius" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Sistemos politika neleidžia keisti sistemos nustatymų" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "Sistemos politika neleidžia keisti įsiminto sistemos vardo" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"Sistemos politika nelaidžia dalytis ryšiais naudojant apsaugotą WiFi tinklą" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"Sistemos politika neleidžia dalytis ryšiais naudojant atvirą WiFi tinklą" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "Leisti valdyti tinklo ryšius" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "Leisti naudoti pasirinktinius naudotojo ryšius" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "Įjungti arba išjungti WiFi įrenginius" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "Įjungti arba išjungti mobiliojo plačiajuosčio ryšio įrenginius" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "Įjungti arba išjungti sistemos prieigą prie tinklo" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 +msgid "" +"Put NetworkManager to sleep or wake it up (should only be used by system " +"power management)" +msgstr "" +"Užmigdyti arba pažadinti NetworkManager (tai turėtų naudoti tik sistemos " +"energijos valdymo posistemė)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +msgid "System policy prevents control of network connections" +msgstr "Sistemos politika neleidžia valdyti tinklo ryšių" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "Sistemos politika neleidžia įjungti arba išjungti WiFi įrenginių" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "" +"Sistemos politika neleidžia įjungti arba išjungti mobiliojo plačiajuosčio " +"ryšio įrenginių" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +msgid "System policy prevents enabling or disabling system networking" +msgstr "" +"Sistemos politika neleidžia įjungti arba išjungti sistemos prieigos prie " +"tinklo" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "Sistemos politika neleidžia užmigdyti arba pažadinti NetworkManager" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +msgid "System policy prevents use of user-specific connections" +msgstr "Sistemos politika neleidžia naudoti pasirinktinių naudotojo ryšių" + #: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 #: ../src/nm-netlink-monitor.c:653 #, c-format @@ -1250,7 +1641,7 @@ msgstr "" "Netinkama parinktis. Galimų parinkčių sąrašą galite pamatyti naudodami " "parametrą --help.\n" -#: ../src/main.c:562 +#: ../src/main.c:568 #, c-format msgid "%s. Please use --help to see a list of valid options.\n" msgstr "%s. Naudokite --help, galimų parinkčių sąrašui gauti.\n" @@ -1293,14 +1684,15 @@ msgstr "Nežinomas žurnalo vedimo lygis „%s“" #: ../src/logging/nm-logging.c:171 #, c-format msgid "Unknown log domain '%s'" -msgstr "Nežinomas žurnalo domenas „%s“" +msgstr "Nežinoma žurnalo sritis „%s“" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/named-manager/nm-named-manager.c:350 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" -"PASTABA: libc sprendiklis gali nepalaikyti daugiau nei 3 vardų serverių." +"PASTABA: libc adresų nustatymo funkcija gali nepalaikyti daugiau nei 3 vardų " +"serverių." -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/named-manager/nm-named-manager.c:352 msgid "The nameservers listed below may not be recognized." msgstr "Žemiau pateikti vardų serveriai gali būti neatpažinti." @@ -1309,40 +1701,161 @@ msgstr "Žemiau pateikti vardų serveriai gali būti neatpažinti." msgid "Auto %s" msgstr "Automatinis %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3254 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3275 msgid "System" msgstr "Sistema" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 -msgid "Connection sharing via a protected WiFi network" -msgstr "Dalijimasis ryšiu naudojant apsaugotą WiFi tinklą" +#~ msgid "Type" +#~ msgstr "Tipas" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 -msgid "Connection sharing via an open WiFi network" -msgstr "Dalijimasis ryšiu naudojant atvirą WiFi tinklą" +#~ msgid "Name" +#~ msgstr "Pavadinimas" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 -msgid "Modify persistent system hostname" -msgstr "Keisti pastovų sistemos vardą" +#~ msgid "User connections:\n" +#~ msgstr "Naudotojo ryšiai:\n" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 -msgid "Modify system connections" -msgstr "Keisti sistemos ryšius" +#~ msgid "System-wide connections" +#~ msgstr "Sistemos ryšiai" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 -msgid "System policy prevents modification of system settings" -msgstr "Sistemos politika neleidžia keisti sistemos nustatymų" +#~ msgid "Default" +#~ msgstr "Numatyta" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 -msgid "System policy prevents modification of the persistent system hostname" -msgstr "Sistemos politika neleidžia keisti įsiminto sistemos vardo" +#~ msgid "Service" +#~ msgstr "Tarnyba" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 -msgid "System policy prevents sharing connections via a protected WiFi network" -msgstr "" -"Sistemos politika nelaidžia dalytis ryšiais naudojant apsaugotą WiFi tinklą" +#~ msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +#~ msgstr "%s, %s, dažnis %d MHz, sparta %d Mb/s, stiprumas %d" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 -msgid "System policy prevents sharing connections via an open WiFi network" -msgstr "" -"Sistemos politika neleidžia dalytis ryšiais naudojant atvirą WiFi tinklą" +#~ msgid "Device" +#~ msgstr "Įrenginys" + +#~ msgid "Driver" +#~ msgstr "Tvarkyklė" + +#~ msgid "State" +#~ msgstr "Būsena" + +#~ msgid "HW Address" +#~ msgstr "Aparatinis adresas" + +#~ msgid "" +#~ "\n" +#~ " Capabilities:\n" +#~ msgstr "" +#~ "\n" +#~ "Galimybės:\n" + +#~ msgid "Carrier Detect" +#~ msgstr "Perdavimo aptikimas" + +#~ msgid "Speed" +#~ msgstr "Sparta" + +#~ msgid "" +#~ "\n" +#~ " Wireless Properties\n" +#~ msgstr "" +#~ "\n" +#~ " Belaidžio ryšio savybės\n" + +#~ msgid "WEP Encryption" +#~ msgstr "WEP šifravimas" + +#~ msgid "WPA Encryption" +#~ msgstr "WPA šifravimas" + +#~ msgid "WPA2 Encryption" +#~ msgstr "WPA2 šifravimas" + +#~ msgid "TKIP cipher" +#~ msgstr "TKIP šifras" + +#~ msgid "CCMP cipher" +#~ msgstr "CCMP šifras" + +#~ msgid "" +#~ "\n" +#~ " Wireless Access Points %s\n" +#~ msgstr "" +#~ "\n" +#~ " Belaidžiai prieigos taškai %s\n" + +#~ msgid "(* = current AP)" +#~ msgstr "(* = dabartinis prieigos taškas)" + +#~ msgid "" +#~ "\n" +#~ " Wired Properties\n" +#~ msgstr "" +#~ "\n" +#~ "Laidinio ryšio savybės\n" + +#~ msgid "Carrier" +#~ msgstr "Perdavimas" + +#~ msgid "" +#~ "\n" +#~ " IPv4 Settings:\n" +#~ msgstr "" +#~ "\n" +#~ " IPv4 nustatymai:\n" + +#~ msgid "Address" +#~ msgstr "Adresas" + +#~ msgid "Prefix" +#~ msgstr "Priešdėlis" + +#~ msgid "Gateway" +#~ msgstr "Šliuzas" + +#~ msgid "Device:" +#~ msgstr "Įrenginys:" + +#~ msgid "Error: hwaddr has to be specified." +#~ msgstr "Klaida: turi būti nurodytas hwaddr." + +#~ msgid "AP parameters" +#~ msgstr "Prieigos taško parametrai" + +#~ msgid "Frequency:" +#~ msgstr "Dažnis:" + +#~ msgid "Mode:" +#~ msgstr "Veiksena:" + +#~ msgid "Ad-hoc" +#~ msgstr "Ad-hoc" + +#~ msgid "Maximal bitrate:" +#~ msgstr "Didžiausias galimas bitų dažnis:" + +#~ msgid "Strength:" +#~ msgstr "Stiprumas:" + +#~ msgid "Flags:" +#~ msgstr "Požymiai:" + +#~ msgid "privacy" +#~ msgstr "privatumas" + +#~ msgid "WPA flags:" +#~ msgstr "WPA požymiai:" + +#~ msgid "RSN flags:" +#~ msgstr "RSN požymiai:" + +#~ msgid "NM running:" +#~ msgstr "NM veikimas:" + +#~ msgid "NM state:" +#~ msgstr "NM būsena" + +#~ msgid "NM wireless hardware:" +#~ msgstr "NM belaidė įranga:" + +#~ msgid "NM wireless:" +#~ msgstr "NM belaidis:" + +#~ msgid "NM WWAN hardware:" +#~ msgstr "NM WWAN įranga:" -- cgit v1.2.1 From 1ba6dcacbf794b678f32838471400aca0b14e8ed Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 21 Jul 2010 15:37:00 -0700 Subject: settings: add InvalidSetting error To be used when the requested setting (for secrets, etc) doesn't exist in the connection. --- libnm-glib/nm-settings-interface.c | 4 +++- libnm-glib/nm-settings-interface.h | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libnm-glib/nm-settings-interface.c b/libnm-glib/nm-settings-interface.c index a1d548ed15..3bd4037a1e 100644 --- a/libnm-glib/nm-settings-interface.c +++ b/libnm-glib/nm-settings-interface.c @@ -17,7 +17,7 @@ * Boston, MA 02110-1301 USA. * * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2008 Red Hat, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. */ #include "nm-settings-interface.h" @@ -62,6 +62,8 @@ nm_settings_interface_error_get_type (void) ENUM_ENTRY (NM_SETTINGS_INTERFACE_ERROR_SECRETS_REQUEST_CANCELED, "SecretsRequestCanceled"), /* The request could not be completed because permission was denied. */ ENUM_ENTRY (NM_SETTINGS_INTERFACE_ERROR_PERMISSION_DENIED, "PermissionDenied"), + /* The requested setting does not existing in this connection. */ + ENUM_ENTRY (NM_SETTINGS_INTERFACE_ERROR_INVALID_SETTING, "InvalidSetting"), { 0, 0, 0 }, }; etype = g_enum_register_static ("NMSettingsInterfaceError", values); diff --git a/libnm-glib/nm-settings-interface.h b/libnm-glib/nm-settings-interface.h index dc7bd0eb82..5920bd8255 100644 --- a/libnm-glib/nm-settings-interface.h +++ b/libnm-glib/nm-settings-interface.h @@ -17,7 +17,7 @@ * Boston, MA 02110-1301 USA. * * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2009 Red Hat, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. */ #ifndef NM_SETTINGS_INTERFACE_H @@ -36,7 +36,8 @@ typedef enum { NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, NM_SETTINGS_INTERFACE_ERROR_SECRETS_UNAVAILABLE, NM_SETTINGS_INTERFACE_ERROR_SECRETS_REQUEST_CANCELED, - NM_SETTINGS_INTERFACE_ERROR_PERMISSION_DENIED + NM_SETTINGS_INTERFACE_ERROR_PERMISSION_DENIED, + NM_SETTINGS_INTERFACE_ERROR_INVALID_SETTING, } NMSettingsInterfaceError; #define NM_SETTINGS_INTERFACE_ERROR (nm_settings_interface_error_quark ()) -- cgit v1.2.1 From fe869a35e6c8481c20b26ca3eb5ae913a7d0f9c1 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 21 Jul 2010 15:37:53 -0700 Subject: libnm-glib: ensure invalids secrets hash isn't used on error condition Apparently dbus-glib just sends through a random address for the hash table even if 'error' is set. Make sure we don't pass that down to subclasses. --- libnm-glib/nm-remote-connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnm-glib/nm-remote-connection.c b/libnm-glib/nm-remote-connection.c index 5d104d0680..1039a7d188 100644 --- a/libnm-glib/nm-remote-connection.c +++ b/libnm-glib/nm-remote-connection.c @@ -164,7 +164,7 @@ get_secrets_cb (DBusGProxy *proxy, GHashTable *secrets, GError *error, gpointer RemoteCall *call = user_data; NMSettingsConnectionInterfaceGetSecretsFunc func = (NMSettingsConnectionInterfaceGetSecretsFunc) call->callback; - (*func)(NM_SETTINGS_CONNECTION_INTERFACE (call->self), secrets, error, call->user_data); + (*func)(NM_SETTINGS_CONNECTION_INTERFACE (call->self), error ? NULL : secrets, error, call->user_data); remote_call_complete (call->self, call); } -- cgit v1.2.1 From d533c807e6387fc4439af860ed5e52ce7a52a425 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 21 Jul 2010 15:54:44 -0700 Subject: system-settings: return InvalidSetting when secrets setting doesn't exist (bgo #623744) So that clients can handle the error intelligently; it's not really a fatal error. --- src/system-settings/nm-sysconfig-connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system-settings/nm-sysconfig-connection.c b/src/system-settings/nm-sysconfig-connection.c index 09cec4000f..f46895accc 100644 --- a/src/system-settings/nm-sysconfig-connection.c +++ b/src/system-settings/nm-sysconfig-connection.c @@ -209,7 +209,7 @@ get_secrets (NMSettingsConnectionInterface *connection, setting = nm_connection_get_setting_by_name (priv->secrets, setting_name); if (!setting) { error = g_error_new (NM_SETTINGS_INTERFACE_ERROR, - NM_SETTINGS_INTERFACE_ERROR_INVALID_CONNECTION, + NM_SETTINGS_INTERFACE_ERROR_INVALID_SETTING, "%s.%d - Connection didn't have requested setting '%s'.", __FILE__, __LINE__, setting_name); (*callback) (connection, NULL, error, user_data); -- cgit v1.2.1 From 81f030fe5b8a4362d2274b4799d50238a16a26bb Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 21 Jul 2010 15:55:33 -0700 Subject: core: don't require PPP setting for PPPoE connections (bgo #623744) The PPP setting will usually be all defaults anyway, so lets just created it when needed if it doesn't yet exist. Fixes an error where the connection editor couldn't edit system DSL connections because it tried to request secrets for the PPP setting that didn't actually exist in the connection because the 'keyfile' plugin wouldn't save all-default settings, thus that setting wouldn't exist when read back in. --- libnm-util/nm-setting-pppoe.c | 19 +------------------ src/ppp-manager/nm-ppp-manager.c | 32 +++++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 27 deletions(-) diff --git a/libnm-util/nm-setting-pppoe.c b/libnm-util/nm-setting-pppoe.c index 6b0241b475..d1aba43d30 100644 --- a/libnm-util/nm-setting-pppoe.c +++ b/libnm-util/nm-setting-pppoe.c @@ -19,7 +19,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2010 Red Hat, Inc. * (C) Copyright 2007 - 2008 Novell, Inc. */ @@ -112,15 +112,6 @@ nm_setting_pppoe_get_password (NMSettingPPPOE *setting) return NM_SETTING_PPPOE_GET_PRIVATE (setting)->password; } -static gint -find_setting_by_name (gconstpointer a, gconstpointer b) -{ - NMSetting *setting = NM_SETTING (a); - const char *str = (const char *) b; - - return strcmp (nm_setting_get_name (setting), str); -} - static gboolean verify (NMSetting *setting, GSList *all_settings, GError **error) { @@ -148,14 +139,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) return FALSE; } - if (!g_slist_find_custom (all_settings, NM_SETTING_PPP_SETTING_NAME, find_setting_by_name)) { - g_set_error (error, - NM_SETTING_PPPOE_ERROR, - NM_SETTING_PPPOE_ERROR_MISSING_PPP_SETTING, - NULL); - return FALSE; - } - return TRUE; } diff --git a/src/ppp-manager/nm-ppp-manager.c b/src/ppp-manager/nm-ppp-manager.c index de905b49db..148ad2cf63 100644 --- a/src/ppp-manager/nm-ppp-manager.c +++ b/src/ppp-manager/nm-ppp-manager.c @@ -16,7 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Copyright (C) 2008 Novell, Inc. - * Copyright (C) 2008 Red Hat, Inc. + * Copyright (C) 2008 - 2010 Red Hat, Inc. */ #include @@ -883,7 +883,8 @@ nm_ppp_manager_start (NMPPPManager *manager, { NMPPPManagerPrivate *priv; NMConnection *connection; - NMSettingPPP *ppp_setting; + NMSettingPPP *s_ppp; + gboolean s_ppp_created = FALSE; NMSettingPPPOE *pppoe_setting; NMCmdLine *ppp_cmd; char *cmd_str; @@ -893,26 +894,36 @@ nm_ppp_manager_start (NMPPPManager *manager, g_return_val_if_fail (NM_IS_PPP_MANAGER (manager), FALSE); g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE); + priv = NM_PPP_MANAGER_GET_PRIVATE (manager); + + priv->pid = 0; + /* Make sure /dev/ppp exists (bgo #533064) */ if (stat ("/dev/ppp", &st) || !S_ISCHR (st.st_mode)) ignored = system ("/sbin/modprobe ppp_generic"); connection = nm_act_request_get_connection (req); - ppp_setting = NM_SETTING_PPP (nm_connection_get_setting (connection, NM_TYPE_SETTING_PPP)); - g_return_val_if_fail (ppp_setting != NULL, FALSE); + g_assert (connection); + + s_ppp = (NMSettingPPP *) nm_connection_get_setting (connection, NM_TYPE_SETTING_PPP); + if (!s_ppp) { + /* If the PPP settings are all default we may not have a PPP setting yet, + * so just make a default one here. + */ + s_ppp = NM_SETTING_PPP (nm_setting_ppp_new ()); + s_ppp_created = TRUE; + } pppoe_setting = (NMSettingPPPOE *) nm_connection_get_setting (connection, NM_TYPE_SETTING_PPPOE); if (pppoe_setting) - pppoe_fill_defaults (ppp_setting); + pppoe_fill_defaults (s_ppp); - ppp_cmd = create_pppd_cmd_line (manager, ppp_setting, pppoe_setting, ppp_name, err); + ppp_cmd = create_pppd_cmd_line (manager, s_ppp, pppoe_setting, ppp_name, err); if (!ppp_cmd) - return FALSE; + goto out; g_ptr_array_add (ppp_cmd->array, NULL); - priv = NM_PPP_MANAGER_GET_PRIVATE (manager); - nm_log_info (LOGD_PPP, "starting PPP connection"); cmd_str = nm_cmd_line_to_str (ppp_cmd); @@ -934,6 +945,9 @@ nm_ppp_manager_start (NMPPPManager *manager, priv->act_req = g_object_ref (req); out: + if (s_ppp_created) + g_object_unref (s_ppp); + if (ppp_cmd) nm_cmd_line_destroy (ppp_cmd); -- cgit v1.2.1 From 0a700de04727855c2f5c0b122ad817f6430d8e09 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 21 Jul 2010 16:47:31 -0700 Subject: core: read nm-system-settings.conf first (rh #606160) Even though we prefer NetworkManager.conf, we need to check the old nm-system-settings.conf first to preserve compat with older setups. In package managed systems dropping a NetworkManager.conf onto the system would make NM use it instead of nm-system-settings.conf, changing behavior during an upgrade. We don't want that. --- src/main.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/main.c b/src/main.c index f76cea9473..c2fb58be77 100644 --- a/src/main.c +++ b/src/main.c @@ -528,9 +528,16 @@ main (int argc, char *argv[]) } else { gboolean parsed = FALSE; - /* Try NetworkManager.conf first */ - if (g_file_test (NM_DEFAULT_SYSTEM_CONF_FILE, G_FILE_TEST_EXISTS)) { - config = g_strdup (NM_DEFAULT_SYSTEM_CONF_FILE); + /* Even though we prefer NetworkManager.conf, we need to check the + * old nm-system-settings.conf first to preserve compat with older + * setups. In package managed systems dropping a NetworkManager.conf + * onto the system would make NM use it instead of nm-system-settings.conf, + * changing behavior during an upgrade. We don't want that. + */ + + /* Try deprecated nm-system-settings.conf first */ + if (g_file_test (NM_OLD_SYSTEM_CONF_FILE, G_FILE_TEST_EXISTS)) { + config = g_strdup (NM_OLD_SYSTEM_CONF_FILE); parsed = parse_config_file (config, &conf_plugins, &dhcp, &cfg_log_level, &cfg_log_domains, &error); if (!parsed) { fprintf (stderr, "Default config file %s invalid: (%d) %s\n", @@ -540,14 +547,14 @@ main (int argc, char *argv[]) g_free (config); config = NULL; g_clear_error (&error); - /* Not a hard failure */ } } - /* Try old nm-system-settings.conf next */ - if (!parsed) { - config = g_strdup (NM_OLD_SYSTEM_CONF_FILE); - if (!parse_config_file (config, &conf_plugins, &dhcp, &cfg_log_level, &cfg_log_domains, &error)) { + /* Try the preferred NetworkManager.conf last */ + if (!parsed && g_file_test (NM_DEFAULT_SYSTEM_CONF_FILE, G_FILE_TEST_EXISTS)) { + config = g_strdup (NM_DEFAULT_SYSTEM_CONF_FILE); + parsed = parse_config_file (config, &conf_plugins, &dhcp, &cfg_log_level, &cfg_log_domains, &error); + if (!parsed) { fprintf (stderr, "Default config file %s invalid: (%d) %s\n", config, error ? error->code : -1, @@ -555,11 +562,9 @@ main (int argc, char *argv[]) g_free (config); config = NULL; g_clear_error (&error); - /* Not a hard failure */ } } } - /* Logging setup */ if (!nm_logging_setup (log_level ? log_level : cfg_log_level, log_domains ? log_domains : cfg_log_domains, @@ -629,6 +634,9 @@ main (int argc, char *argv[]) nm_log_info (LOGD_CORE, "NetworkManager (version " NM_DIST_VERSION ") is starting..."); success = FALSE; + if (config) + nm_log_info (LOGD_CORE, "Read config file %s", config); + main_loop = g_main_loop_new (NULL, FALSE); /* Create watch functions that monitor cards for link status. */ -- cgit v1.2.1 From fbdb963f04068de1fe1a61558ed8793cc57b4661 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 22 Jul 2010 16:26:34 -0700 Subject: ifcfg-rh: fix testcase format string From Andrey Borzenkov --- system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index 6e873fe82b..1271928d9f 100644 --- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -6435,7 +6435,7 @@ test_write_wifi_open (void) ASSERT (tmp != NULL, "wifi-open-write-reread", "failed to read ESSID key from %s", testfile); - g_message (tmp); + g_message ("%s", tmp); ASSERT (strncmp (tmp, "\"\"", 2) != 0, "wifi-open-write-reread", "unexpected ESSID double-quote in %s", testfile); -- cgit v1.2.1 From ead5ed849a61ebf4fe98632d92289b245b5a7d20 Mon Sep 17 00:00:00 2001 From: Sandeep Shedmake Date: Tue, 27 Jul 2010 14:44:24 -0700 Subject: po: update Marathi translation (bgo #625312) --- po/mr.po | 221 +++++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 137 insertions(+), 84 deletions(-) diff --git a/po/mr.po b/po/mr.po index d2bc41c869..c608ace4b3 100644 --- a/po/mr.po +++ b/po/mr.po @@ -7,9 +7,9 @@ msgid "" msgstr "" "Project-Id-Version: mr\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-05-06 14:31+0530\n" -"PO-Revision-Date: 2010-05-10 10:40+0530\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-06-28 08:52+0000\n" +"PO-Revision-Date: 2010-07-26 18:24+0530\n" "Last-Translator: Sandeep Shedmake \n" "Language-Team: Marathi \n" "MIME-Version: 1.0\n" @@ -141,19 +141,19 @@ msgstr "कधिच नाही" #: ../cli/src/connections.c:602 ../cli/src/connections.c:605 #: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 #: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 -#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 -#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 -#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 -#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 -#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 -#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 -#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 -#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 -#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 -#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 -#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 -#: ../cli/src/settings.c:1210 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:551 ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 msgid "yes" msgstr "होय" @@ -161,19 +161,19 @@ msgstr "होय" #: ../cli/src/connections.c:602 ../cli/src/connections.c:605 #: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 #: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 -#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 -#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 -#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 -#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 -#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 -#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 -#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 -#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 -#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 -#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 -#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 -#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:510 ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 ../cli/src/settings.c:1224 msgid "no" msgstr "नाही" @@ -262,7 +262,7 @@ msgstr "सक्रिय केले" #: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 #: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 #: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 -#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:473 msgid "unknown" msgstr "अपरिचीत" @@ -1063,78 +1063,79 @@ msgstr "त्रुटी: NetworkManager सह जोडणी करण् msgid "Success" msgstr "यश" -#: ../cli/src/settings.c:407 +#: ../cli/src/settings.c:411 #, c-format msgid "%d (hex-ascii-key)" msgstr "%d (hex-ascii-key)" -#: ../cli/src/settings.c:409 +#: ../cli/src/settings.c:413 #, c-format msgid "%d (104/128-bit passphrase)" msgstr "%d (104/128-बीट पासफ्रेज)" -#: ../cli/src/settings.c:412 +#: ../cli/src/settings.c:416 #, c-format msgid "%d (unknown)" msgstr "%d (अपरिचीत)" -#: ../cli/src/settings.c:438 +#: ../cli/src/settings.c:442 msgid "0 (unknown)" msgstr "0 (अपरिचीत)" -#: ../cli/src/settings.c:444 +#: ../cli/src/settings.c:448 msgid "any, " msgstr "कुठलेही, " -#: ../cli/src/settings.c:446 +#: ../cli/src/settings.c:450 msgid "900 MHz, " msgstr "900 MHz, " -#: ../cli/src/settings.c:448 +#: ../cli/src/settings.c:452 msgid "1800 MHz, " msgstr "1800 MHz, " -#: ../cli/src/settings.c:450 +#: ../cli/src/settings.c:454 msgid "1900 MHz, " msgstr "1900 MHz, " -#: ../cli/src/settings.c:452 +#: ../cli/src/settings.c:456 msgid "850 MHz, " msgstr "850 MHz, " -#: ../cli/src/settings.c:454 +#: ../cli/src/settings.c:458 msgid "WCDMA 3GPP UMTS 2100 MHz, " msgstr "WCDMA 3GPP UMTS 2100 MHz, " -#: ../cli/src/settings.c:456 +#: ../cli/src/settings.c:460 msgid "WCDMA 3GPP UMTS 1800 MHz, " msgstr "WCDMA 3GPP UMTS 1800 MHz, " -#: ../cli/src/settings.c:458 +#: ../cli/src/settings.c:462 msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " -#: ../cli/src/settings.c:460 +#: ../cli/src/settings.c:464 msgid "WCDMA 3GPP UMTS 800 MHz, " msgstr "WCDMA 3GPP UMTS 800 MHz, " -#: ../cli/src/settings.c:462 +#: ../cli/src/settings.c:466 msgid "WCDMA 3GPP UMTS 850 MHz, " msgstr "WCDMA 3GPP UMTS 850 MHz, " -#: ../cli/src/settings.c:464 +#: ../cli/src/settings.c:468 msgid "WCDMA 3GPP UMTS 900 MHz, " msgstr "WCDMA 3GPP UMTS 900 MHz, " -#: ../cli/src/settings.c:466 +#: ../cli/src/settings.c:470 msgid "WCDMA 3GPP UMTS 1700 MHz, " msgstr "WCDMA 3GPP UMTS 1700 MHz, " -#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +#: ../cli/src/settings.c:554 ../cli/src/settings.c:721 msgid "auto" msgstr "स्वयं" -#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 msgid "not set" msgstr "सेट केले नाही" @@ -1497,6 +1498,90 @@ msgstr "एनक्रिप्टेड किला PEM फाइलवर msgid "Could not allocate memory for PEM file data." msgstr "PEM फाइल डाटाकरीता मेमरीचे वाटप करणे अशक्य." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "सुरक्षीत WiFi नेटवर्क द्वारे जोडणीचे शेअरींग करा" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "ओपन WiFi नेटवर्क द्वारे कनेक्शन शेअरींग करा" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "पर्सिस्टंट प्रणाली यजमाननाव संपादीत करा" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "प्रणाली जुळवणी संपादीत करा" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "प्रणाली करार, प्रणाली संयोजना संपादीत करण्यापासून रोखतो" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "प्रणाली करार पर्सिस्टंट प्रणाली यजमाननावाचे संपादन रोखत आहे" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "प्रणाली करार सुरक्षीत WiFi नेटवर्क द्वारे जोडणीचे शेअरींग रोखत आहे" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "प्रणाली करार ओपन WiFi नेटवर्क द्वारे जोडणीचे शेअरींग रोखत आहे" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "नेटवर्क जोडणींचे नियंत्रण स्वीकारा" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "वापरकर्ता-निर्देशीत जोडणींचा वापर स्वीकारा" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "WiFi साधने सुरू किंवा बंद करा" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "मोबाईल ब्रॉडबँड साधने सुरू किंवा बंद करा" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "प्रणाली नेटवर्किंग सुरू किंवा बंद करा" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 +msgid "" +"Put NetworkManager to sleep or wake it up (should only be used by system " +"power management)" +msgstr "" +"NetworkManager ला स्लीप किंवा वेकअप स्तरात न्या (फक्त प्रणाली पावर मॅनेजमेंटनेच याचा " +"वापर करावा)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +msgid "System policy prevents control of network connections" +msgstr "प्रणाली करार नेटवर्क जोडणीचे नियंत्रण रोखते" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "प्रणाली करार WiFi साधणांना सुरू किंवा बंद होण्यापासून रोखते" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "प्रणाली करार मोबाईल ब्रॉडबँड साधणांना सुरू किंवा बंद होण्यापासून रोखते" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +msgid "System policy prevents enabling or disabling system networking" +msgstr "प्रणाली करार प्रणाली नेटवर्किंगसा सुरू किंवा बंद होण्यापासून रोखते" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "प्रणाली करार NetworkManager ला स्लीप किंवा वेकअप मध्ये जाण्यापासून रोखते" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +msgid "System policy prevents use of user-specific connections" +msgstr "प्रणाली करार वापरकर्ता-निर्देशीत जोडणींचे वापर रोखते" + #: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 #: ../src/nm-netlink-monitor.c:653 #, c-format @@ -1542,7 +1627,7 @@ msgstr "दुवा कॅशे अद्ययावत करतेवेळ msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "अवैध पर्याय. वैध पर्यायची यादी पहाण्याकरीता कृपया --help वापरा.\n" -#: ../src/main.c:562 +#: ../src/main.c:568 #, c-format msgid "%s. Please use --help to see a list of valid options.\n" msgstr "%s. वैध पर्यायची सूची पहाण्याकरीता कृपया --help वापरा.\n" @@ -1587,11 +1672,11 @@ msgstr "अपरिचीत लॉग स्तर '%s'" msgid "Unknown log domain '%s'" msgstr "अपरिचीत लॉग डोमेन '%s'" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/named-manager/nm-named-manager.c:350 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "NOTE: libc रिजॉलव्हर 3 पेक्षा जास्त नेमसर्व्हर्स् करीता समर्थन पुरवू शकणार नाही." -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/named-manager/nm-named-manager.c:352 msgid "The nameservers listed below may not be recognized." msgstr "खालिल यादीतील नेमसर्व्हर्स् अनोळखी राहतील." @@ -1600,39 +1685,7 @@ msgstr "खालिल यादीतील नेमसर्व्हर् msgid "Auto %s" msgstr "स्वयं %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3275 msgid "System" msgstr "प्रणाली" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 -msgid "Connection sharing via a protected WiFi network" -msgstr "सुरक्षीत WiFi नेटवर्क द्वारे जोडणीचे शेअरींग करा" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 -msgid "Connection sharing via an open WiFi network" -msgstr "ओपन WiFi नेटवर्क द्वारे कनेक्शन शेअरींग करा" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 -msgid "Modify persistent system hostname" -msgstr "पर्सिस्टंट प्रणाली यजमाननाव संपादीत करा" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 -msgid "Modify system connections" -msgstr "प्रणाली जुळवणी संपादीत करा" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 -msgid "System policy prevents modification of system settings" -msgstr "प्रणाली करार, प्रणाली संयोजना संपादीत करण्यापासून रोखतो" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 -msgid "System policy prevents modification of the persistent system hostname" -msgstr "प्रणाली करार पर्सिस्टंट प्रणाली यजमाननावाचे संपादन रोखत आहे" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 -msgid "System policy prevents sharing connections via a protected WiFi network" -msgstr "प्रणाली करार सुरक्षीत WiFi नेटवर्क द्वारे जोडणीचे शेअरींग रोखत आहे" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 -msgid "System policy prevents sharing connections via an open WiFi network" -msgstr "प्रणाली करार ओपन WiFi नेटवर्क द्वारे जोडणीचे शेअरींग रोखत आहे" - -- cgit v1.2.1 From ba3dcc2b0872566f89133a940bab237d18cb8402 Mon Sep 17 00:00:00 2001 From: shankar Date: Tue, 27 Jul 2010 15:25:56 -0700 Subject: po: update Kannada translation (bgo #625283) --- po/kn.po | 235 ++++++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 148 insertions(+), 87 deletions(-) diff --git a/po/kn.po b/po/kn.po index be51ba0dec..fcdec5dd0e 100644 --- a/po/kn.po +++ b/po/kn.po @@ -7,11 +7,12 @@ msgid "" msgstr "" "Project-Id-Version: NetworkManager.po.master.kn\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-05-06 14:31+0530\n" -"PO-Revision-Date: 2010-05-07 10:54+0530\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug." +"cgi?product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-06-28 08:52+0000\n" +"PO-Revision-Date: 2010-07-26 12:55+0530\n" "Last-Translator: Shankar Prasad \n" -"Language-Team: kn-IN <>\n" +"Language-Team: kn_IN \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -141,19 +142,19 @@ msgstr "ಎಂದಿಗೂ ಬೇಡ" #: ../cli/src/connections.c:602 ../cli/src/connections.c:605 #: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 #: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 -#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 -#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 -#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 -#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 -#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 -#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 -#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 -#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 -#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 -#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 -#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 -#: ../cli/src/settings.c:1210 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:551 ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 msgid "yes" msgstr "ಹೌದು" @@ -161,19 +162,19 @@ msgstr "ಹೌದು" #: ../cli/src/connections.c:602 ../cli/src/connections.c:605 #: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 #: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 -#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 -#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 -#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 -#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 -#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 -#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 -#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 -#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 -#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 -#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 -#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 -#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:510 ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 ../cli/src/settings.c:1224 msgid "no" msgstr "ಇಲ್ಲ" @@ -262,7 +263,7 @@ msgstr "ಸಕ್ರಿಯಗೊಂಡಿದೆ" #: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 #: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 #: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 -#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:473 msgid "unknown" msgstr "ಗೊತ್ತಿಲ್ಲದ" @@ -1063,78 +1064,79 @@ msgstr "ದೋಷ: NetworkManager ನೊಂದಿಗೆ ಸಂಪರ್ಕಸಾ msgid "Success" msgstr "ಯಶಸ್ವಿಯಾಗಿದೆ" -#: ../cli/src/settings.c:407 +#: ../cli/src/settings.c:411 #, c-format msgid "%d (hex-ascii-key)" msgstr "%d (hex-ascii-key)" -#: ../cli/src/settings.c:409 +#: ../cli/src/settings.c:413 #, c-format msgid "%d (104/128-bit passphrase)" msgstr "%d (104/128-ಬಿಟ್‌ ಗುಪ್ತವಾಕ್ಯಾಂಶ)" -#: ../cli/src/settings.c:412 +#: ../cli/src/settings.c:416 #, c-format msgid "%d (unknown)" msgstr "%d (ಅಜ್ಞಾತ)" -#: ../cli/src/settings.c:438 +#: ../cli/src/settings.c:442 msgid "0 (unknown)" msgstr "0 (ಗೊತ್ತಿರದ)" -#: ../cli/src/settings.c:444 +#: ../cli/src/settings.c:448 msgid "any, " msgstr "ಯಾವುದಾದರೂ, " -#: ../cli/src/settings.c:446 +#: ../cli/src/settings.c:450 msgid "900 MHz, " msgstr "900 MHz, " -#: ../cli/src/settings.c:448 +#: ../cli/src/settings.c:452 msgid "1800 MHz, " msgstr "1800 MHz, " -#: ../cli/src/settings.c:450 +#: ../cli/src/settings.c:454 msgid "1900 MHz, " msgstr "1900 MHz, " -#: ../cli/src/settings.c:452 +#: ../cli/src/settings.c:456 msgid "850 MHz, " msgstr "850 MHz, " -#: ../cli/src/settings.c:454 +#: ../cli/src/settings.c:458 msgid "WCDMA 3GPP UMTS 2100 MHz, " msgstr "WCDMA 3GPP UMTS 2100 MHz, " -#: ../cli/src/settings.c:456 +#: ../cli/src/settings.c:460 msgid "WCDMA 3GPP UMTS 1800 MHz, " msgstr "WCDMA 3GPP UMTS 1800 MHz, " -#: ../cli/src/settings.c:458 +#: ../cli/src/settings.c:462 msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " -#: ../cli/src/settings.c:460 +#: ../cli/src/settings.c:464 msgid "WCDMA 3GPP UMTS 800 MHz, " msgstr "WCDMA 3GPP UMTS 800 MHz, " -#: ../cli/src/settings.c:462 +#: ../cli/src/settings.c:466 msgid "WCDMA 3GPP UMTS 850 MHz, " msgstr "WCDMA 3GPP UMTS 850 MHz, " -#: ../cli/src/settings.c:464 +#: ../cli/src/settings.c:468 msgid "WCDMA 3GPP UMTS 900 MHz, " msgstr "WCDMA 3GPP UMTS 900 MHz, " -#: ../cli/src/settings.c:466 +#: ../cli/src/settings.c:470 msgid "WCDMA 3GPP UMTS 1700 MHz, " msgstr "WCDMA 3GPP UMTS 1700 MHz, " -#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +#: ../cli/src/settings.c:554 ../cli/src/settings.c:721 msgid "auto" msgstr "ಸ್ವಯಂಚಾಲಿತ" -#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 msgid "not set" msgstr "ಹೊಂದಿಸಲಾಗಿಲ್ಲ" @@ -1157,8 +1159,8 @@ msgstr "'--terse' ಎಂಬ ಆಯ್ಕೆಗೆ '--fields' ಅನ್ನು ಸ #, c-format msgid "Option '--terse' requires specific '--fields' option values , not '%s'" msgstr "" -"'--terse' ಎಂಬ ಆಯ್ಕೆಗೆ ನಿಶ್ಚಿತವಾದ '--fields' ಆಯ್ಕೆಯ ಮೌಲ್ಯದ ಅಗತ್ಯವಿರುತ್ತದೆಯೆ ಹೊರತು, '%s' " -"ಎಂಬುದಲ್ಲ" +"'--terse' ಎಂಬ ಆಯ್ಕೆಗೆ ನಿಶ್ಚಿತವಾದ '--fields' ಆಯ್ಕೆಯ ಮೌಲ್ಯದ ಅಗತ್ಯವಿರುತ್ತದೆಯೆ ಹೊರತು, '%" +"s' ಎಂಬುದಲ್ಲ" #: ../libnm-util/crypto.c:120 #, c-format @@ -1501,6 +1503,97 @@ msgstr "ಗೂಢಲಿಪೀಕರಿಸಲಾದ ಕೀಲಿಯನ್ನು P msgid "Could not allocate memory for PEM file data." msgstr "PEM ಕಡತ ದತ್ತಾಂಶಕ್ಕಾಗಿ ಮೆಮೊರಿಯನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "ಒಂದು ಸಂರಕ್ಷಿತವಾದ WiFi ಜಾಲಬಂಧದ ಮೂಲಕ ಸಂಪರ್ಕ ಸಾಧಿಸುವಿಕೆ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "ಒಂದು ಮುಕ್ತವಾದ WiFi ಜಾಲಬಂಧದ ಮೂಲಕ ಸಂಪರ್ಕ ಸಾಧಿಸುವಿಕೆ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "ಸ್ಥಿರ ವ್ಯವಸ್ಥೆಯ ಆತಿಥೇಯ ಹೆಸರನ್ನು ಮಾರ್ಪಡಿಸಿ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "ವ್ಯವಸ್ಥೆಯ ಸಂಪರ್ಕಗಳನ್ನು ಮಾರ್ಪಡಿಸು" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "ವ್ಯವಸ್ಥೆಯ ಸಂಪರ್ಕಗಳನ್ನು ಮಾರ್ಪಡಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತಿವೆ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "ಸ್ಥಿರ ವ್ಯವಸ್ಥೆಯ ಆತಿಥೇಯ ಹೆಸರನ್ನು ಮಾರ್ಪಡಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತವೆ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "ಒಂದು ಸಂರಕ್ಷಿತವಾದ WiFi ಜಾಲಬಂಧದ ಮೂಲಕ ಸಂಪರ್ಕ ಸಾಧಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತವೆ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "ಒಂದು ಮುಕ್ತವಾದ WiFi ಜಾಲಬಂಧದ ಮೂಲಕ ಸಂಪರ್ಕ ಸಾಧಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತವೆ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "ಜಾಲಬಂಧ ಸಂಪರ್ಕಗಳನ್ನು ನಿಯಂತ್ರಿಸುವುದನ್ನು ಅನುಮತಿಸಿ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "ಬಳಕೆದಾರ-ನಿಶ್ಚಿತ ಸಂಪರ್ಕಗಳನ್ನು ಬಳಸುವುದನ್ನು ಅನುಮತಿಸು" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "WiFi ಸಾಧನಗಳನ್ನು ಶಕ್ತಗೊಳಿಸಿ ಅಥವ ಅಶಕ್ತಗೊಳಿಸಿ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "ಮೊಬೈಲ್ ಬ್ರಾಡ್‌ಬ್ಯಾಂಡ್ ಸಾಧನಗಳನ್ನು ಶಕ್ತಗೊಳಿಸಿ ಅಥವ ಅಶಕ್ತಗೊಳಿಸಿ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "ವ್ಯವಸ್ಥೆಯ ಜಾಲಬಂಧವನ್ನು ಶಕ್ತಗೊಳಿಸಿ ಅಥವ ಅಶಕ್ತಗೊಳಿಸಿ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 +msgid "" +"Put NetworkManager to sleep or wake it up (should only be used by system " +"power management)" +msgstr "" +"NetworkManager ಅನ್ನು ನಿದ್ರಾಸ್ಥಿತಿಗೆ ಅಥವ ಎಚ್ಚರಸ್ಥಿತಿಗೆ ಕಳುಹಿಸಿ (ಇದನ್ನು ಕೇವಲ ವ್ಯವಸ್ಥೆಯ " +"ವಿದ್ಯುಚ್ಛಕ್ತಿ ನಿರ್ವಹಣೆಯಿಂದ ಮಾತ್ರ ಬಳಸಬೇಕು)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents control of network connections" +msgstr "ಜಾಲಬಂಧ ಸಂಪರ್ಕಗಳನ್ನು ನಿಯಂತ್ರಿಸುವುದನ್ನು ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತಿವೆ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +#| msgid "System policy prevents sharing connections via an open WiFi network" +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "WiFi ಸಾಧನವನ್ನು ಶಕ್ತ ಅಥವ ಅಶಕ್ತಗೊಳಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತಿವೆ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "" +"ಮೊಬೈಲ್ ಬ್ರಾಡ್‌ಬ್ಯಾಂಡ್ ಸಾಧನಗಳನ್ನು ಶಕ್ತ ಅಥವ ಅಶಕ್ತಗೊಳಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತಿವೆ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents enabling or disabling system networking" +msgstr "ವ್ಯವಸ್ಥೆಯ ಜಾಲಬಂಧವನ್ನು ಶಕ್ತ ಅಥವ ಅಶಕ್ತಗೊಳಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ಪಾಲಿಸಿಯು ತಡೆಯುತ್ತಿದೆ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "" +"NetworkManager ಅನ್ನು ನಿದ್ರಾಸ್ಥಿತಿಗೆ ಅಥವ ಎಚ್ಚರಸ್ಥಿತಿಗೆ ಕಳುಹಿಸುವುದನ್ನು ವ್ಯವಸ್ಥೆಯ ನಿಯಮವು " +"ತಡೆಯುತ್ತಿದೆ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents use of user-specific connections" +msgstr "ಬಳಕೆದಾರ-ನಿಶ್ಚಿತ ಸಂಪರ್ಕಗಳನ್ನು ಬಳಸುವುದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮವು ತಡೆಯುತ್ತಿದೆ" + #: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 #: ../src/nm-netlink-monitor.c:653 #, c-format @@ -1552,7 +1645,7 @@ msgstr "ಕೊಂಡಿ ಕ್ಯಾಶೆಯನ್ನು ಅಪ್‌ಡೇಟ msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "ಅಮಾನ್ಯವಾದ ಆಯ್ಕೆ. ಮಾನ್ಯವಾದ ಆಯ್ಕೆಗಳಿಗಾಗಿ ದಯವಿಟ್ಟು --help ಅನ್ನು ನೋಡಿ.\n" -#: ../src/main.c:562 +#: ../src/main.c:568 #, c-format msgid "%s. Please use --help to see a list of valid options.\n" msgstr "%s. ಮಾನ್ಯವಾದ ಆಯ್ಕೆಗಳಿಗಾಗಿ ದಯವಿಟ್ಟು --help ಅನ್ನು ನೋಡಿ.\n" @@ -1597,13 +1690,13 @@ msgstr "ಗೊತ್ತಿರದ ದಾಖಲೆ ಮಟ್ಟ '%s'" msgid "Unknown log domain '%s'" msgstr "ಗೊತ್ತಿರದ ದಾಖಲೆ ಡೊಮೈನ್ '%s'" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/named-manager/nm-named-manager.c:350 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "ಸೂಚನೆ: libc ಪರಿಹಾರಕವು(ರಿಸಾಲ್ವರ್) ೩ ನಾಮಪರಿಚಾರಕಗಳಿಗಿಂತ ಹೆಚ್ಚಿನವುಗಳನ್ನು " "ಬೆಂಬಲಿಸುವುದಿಲ್ಲ." -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/named-manager/nm-named-manager.c:352 msgid "The nameservers listed below may not be recognized." msgstr "ಈ ಕೆಳಗೆ ಸೂಚಿಸಲಾದ ನಾಮಪರಿಚಾರಕಗಳನ್ನು ಗುರುತಿಸಲಾಗಿಲ್ಲ." @@ -1612,42 +1705,10 @@ msgstr "ಈ ಕೆಳಗೆ ಸೂಚಿಸಲಾದ ನಾಮಪರಿಚಾರ msgid "Auto %s" msgstr "ಸ್ವಯಂ %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3275 msgid "System" msgstr "ವ್ಯವಸ್ಥೆ" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 -msgid "Connection sharing via a protected WiFi network" -msgstr "ಒಂದು ಸಂರಕ್ಷಿತವಾದ WiFi ಜಾಲಬಂಧದ ಮೂಲಕ ಸಂಪರ್ಕ ಸಾಧಿಸುವಿಕೆ" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 -msgid "Connection sharing via an open WiFi network" -msgstr "ಒಂದು ಮುಕ್ತವಾದ WiFi ಜಾಲಬಂಧದ ಮೂಲಕ ಸಂಪರ್ಕ ಸಾಧಿಸುವಿಕೆ" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 -msgid "Modify persistent system hostname" -msgstr "ಸ್ಥಿರ ವ್ಯವಸ್ಥೆಯ ಆತಿಥೇಯ ಹೆಸರನ್ನು ಮಾರ್ಪಡಿಸಿ" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 -msgid "Modify system connections" -msgstr "ವ್ಯವಸ್ಥೆಯ ಸಂಪರ್ಕಗಳನ್ನು ಮಾರ್ಪಡಿಸು" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 -msgid "System policy prevents modification of system settings" -msgstr "ವ್ಯವಸ್ಥೆಯ ಸಂಪರ್ಕಗಳನ್ನು ಮಾರ್ಪಡಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತಿವೆ" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 -msgid "System policy prevents modification of the persistent system hostname" -msgstr "ಸ್ಥಿರ ವ್ಯವಸ್ಥೆಯ ಆತಿಥೇಯ ಹೆಸರನ್ನು ಮಾರ್ಪಡಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತವೆ" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 -msgid "System policy prevents sharing connections via a protected WiFi network" -msgstr "ಒಂದು ಸಂರಕ್ಷಿತವಾದ WiFi ಜಾಲಬಂಧದ ಮೂಲಕ ಸಂಪರ್ಕ ಸಾಧಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತವೆ" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 -msgid "System policy prevents sharing connections via an open WiFi network" -msgstr "ಒಂದು ಮುಕ್ತವಾದ WiFi ಜಾಲಬಂಧದ ಮೂಲಕ ಸಂಪರ್ಕ ಸಾಧಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತವೆ" - #~ msgid "Type" #~ msgstr "ಬಗೆ" -- cgit v1.2.1 From af2be00b8cae5e20ffb89f68c86c001a35a0f844 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 27 Jul 2010 20:31:27 -0700 Subject: Revert "core: fail connections if IP configuration expires" (rh #616084) (rh #590874) This reverts commit b172519045e5ea4825f85fca81de8395e92600c1. When something like NTP updates the system clock, that can cause dhclient to expire the lease, and at that point we just want NM to let dhclient re-aquire the lease instead of failing the whole connection. --- src/nm-device.c | 16 ---------------- src/nm-policy.c | 21 ++++----------------- 2 files changed, 4 insertions(+), 33 deletions(-) diff --git a/src/nm-device.c b/src/nm-device.c index 84eb97730a..98be23cd00 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -1439,22 +1439,6 @@ dhcp_state_changed (NMDHCPClient *client, } else if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); break; - case DHC_STOP: - case DHC_STOP6: - case DHC_EXPIRE: - case DHC_EXPIRE6: - if (dev_state == NM_DEVICE_STATE_ACTIVATED) { - if (ipv6) - nm_dhcp6_config_reset (priv->dhcp6_config); - else - nm_dhcp4_config_reset (priv->dhcp4_config); - - /* dhclient quit and can't get/renew a lease; so kill the connection */ - nm_device_state_changed (device, - NM_DEVICE_STATE_FAILED, - NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); - } - break; default: break; } diff --git a/src/nm-policy.c b/src/nm-policy.c index 833a58764c..ddf48ad877 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -892,23 +892,10 @@ device_state_changed (NMDevice *device, /* Mark the connection invalid if it failed during activation so that * it doesn't get automatically chosen over and over and over again. */ - if (connection) { - gboolean fail = FALSE; - - if (IS_ACTIVATING_STATE (old_state)) { - nm_log_info (LOGD_DEVICE, "Marking connection '%s' invalid.", get_connection_id (connection)); - fail = TRUE; - } else if ( (old_state == NM_DEVICE_STATE_ACTIVATED) - && (reason == NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED)) { - nm_log_info (LOGD_DEVICE, "Marking connection '%s' invalid because IP configuration expired.", - get_connection_id (connection)); - fail = TRUE; - } - - if (fail) { - g_object_set_data (G_OBJECT (connection), INVALID_TAG, GUINT_TO_POINTER (TRUE)); - nm_connection_clear_secrets (connection); - } + if (connection && IS_ACTIVATING_STATE (old_state)) { + g_object_set_data (G_OBJECT (connection), INVALID_TAG, GUINT_TO_POINTER (TRUE)); + nm_log_info (LOGD_DEVICE, "Marking connection '%s' invalid.", get_connection_id (connection)); + nm_connection_clear_secrets (connection); } schedule_activate_check (policy, device, 3); break; -- cgit v1.2.1 From bebf8d48b0e9fe57f9961f56214b0d9034614dd7 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 27 Jul 2010 21:43:42 -0700 Subject: Revert "ip6: remove standalone DHCP method since DHCPv6 can't provide gateways" (rh #612445) This reverts commit a729d2f649fefc77fcff7ad250c5c403a4dd59b7. Turns out this is a valid IP config method that some sites use. --- libnm-util/nm-setting-ip6-config.c | 71 +++++++++++++++++-------------- libnm-util/nm-setting-ip6-config.h | 1 + src/nm-device.c | 10 ++++- system-settings/plugins/ifcfg-rh/reader.c | 5 ++- system-settings/plugins/ifcfg-rh/writer.c | 4 ++ 5 files changed, 56 insertions(+), 35 deletions(-) diff --git a/libnm-util/nm-setting-ip6-config.c b/libnm-util/nm-setting-ip6-config.c index 32c3a4a2a2..e8af058041 100644 --- a/libnm-util/nm-setting-ip6-config.c +++ b/libnm-util/nm-setting-ip6-config.c @@ -471,7 +471,8 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) NM_SETTING_IP6_CONFIG_ADDRESSES); return FALSE; } - } else if (!strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) { + } else if ( !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_AUTO) + || !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) { /* nothing to do */ } else { g_set_error (error, @@ -612,30 +613,34 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class) * NMSettingIP6Config:method: * * IPv6 configuration method. If 'auto' is specified then the appropriate - * automatic method (DHCP, PPP, router advertisement, etc) is used for the - * interface and most other properties can be left unset. If 'link-local' - * is specified, then an IPv6 link-local address will be assigned to the - * interface. If 'manual' is specified, static IP addressing is used and - * at least one IP address must be given in the 'addresses' property. If - * 'ignored' is specified, IPv6 configuration is not done. This property - * must be set. NOTE: the 'shared' method are not yet supported. + * automatic method (DHCP, PPP, advertisement, etc) is used for the + * interface and most other properties can be left unset. To force the use + * of DHCP only, specify 'dhcp'; this method is only valid for ethernet- + * based hardware. If 'link-local' is specified, then an IPv6 link-local + * address will be assigned to the interface. If 'manual' is specified, + * static IP addressing is used and at least one IP address must be given + * in the 'addresses' property. If 'ignored' is specified, IPv6 + * configuration is not done. This property must be set. NOTE: the 'shared' + * method are not yet supported. **/ g_object_class_install_property (object_class, PROP_METHOD, g_param_spec_string (NM_SETTING_IP6_CONFIG_METHOD, "Method", "IPv6 configuration method. If 'auto' is specified " - "then the appropriate automatic method (DHCP, PPP, " - "router advertisement, etc) is used for the " - "interface and most other properties can be left " - "unset. If 'link-local' is specified, then an " - "IPv6 link-local address will be assigned to the " - "interface. If 'manual' is specified, static IP " - "addressing is used and at least one IP address " - "must be given in the 'addresses' property. If " - "'ignored' is specified, IPv6 configuration is not " - "done. This property must be set. NOTE: the " - "'shared' method are not yet supported.", + "then the appropriate automatic method (PPP, router " + "advertisement, etc) is used for the device and " + "most other properties can be left unset. To force " + "the use of DHCP only, specify 'dhcp'; this method " + "is only valid for ethernet-based hardware. If " + "'link-local' is specified, then an IPv6 link-local " + "address will be assigned to the interface. If " + "'manual' is specified, static IP addressing is " + "used and at least one IP address must be given in " + " the 'addresses' property. If 'ignored' is " + "specified, IPv6 configuration is not done. This " + "property must be set. NOTE: the 'shared' method" + "is not yet supported.", NULL, G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); @@ -761,26 +766,26 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class) /** * NMSettingIP6Config:ignore-auto-routes: * - * When the method is set to 'auto' and this property is set to TRUE, - * automatically configured routes are ignored and only routes specified - * in #NMSettingIP6Config:routes, if any, are used. + * When the method is set to 'auto' or 'dhcp' and this property is set to + * TRUE, automatically configured routes are ignored and only routes + * specified in #NMSettingIP6Config:routes, if any, are used. **/ g_object_class_install_property (object_class, PROP_IGNORE_AUTO_ROUTES, g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES, "Ignore automatic routes", - "When the method is set to 'auto' and this property " - "is set to TRUE, automatically configured routes are " - "ignored and only routes specified in the 'routes' " - "property, if any, are used.", + "When the method is set to 'auto' or 'dhcp' and this " + "property is set to TRUE, automatically configured " + "routes are ignored and only routes specified in the " + "'routes' property, if any, are used.", FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); /** * NMSettingIP6Config:ignore-auto-dns: * - * When the method is set to 'auto' and this property is set to TRUE, - * automatically configured nameservers and search domains are ignored + * When the method is set to 'auto' or 'dhcp' and this property is set to + * TRUE, automatically configured nameservers and search domains are ignored * and only nameservers and search domains specified in * #NMSettingIP6Config:dns and #NMSettingIP6Config:dns-search, if any, are * used. @@ -789,11 +794,11 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class) (object_class, PROP_IGNORE_AUTO_DNS, g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS, "Ignore DHCPv6/RDNSS DNS", - "When the method is set to 'auto' and this property " - "is set to TRUE, automatically configured nameservers " - "and search domains are ignored and only nameservers " - "and search domains specified in 'dns' and 'dns-search' " - "properties, if any, are used.", + "When the method is set to 'auto' or 'dhcp' and this " + "property is set to TRUE, automatically configured " + "nameservers and search domains are ignored and only " + "nameservers and search domains specified in the 'dns' " + "and 'dns-search' properties, if any, are used.", FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); diff --git a/libnm-util/nm-setting-ip6-config.h b/libnm-util/nm-setting-ip6-config.h index 06e5c5c18f..e3e286e684 100644 --- a/libnm-util/nm-setting-ip6-config.h +++ b/libnm-util/nm-setting-ip6-config.h @@ -66,6 +66,7 @@ GQuark nm_setting_ip6_config_error_quark (void); #define NM_SETTING_IP6_CONFIG_METHOD_IGNORE "ignore" #define NM_SETTING_IP6_CONFIG_METHOD_AUTO "auto" +#define NM_SETTING_IP6_CONFIG_METHOD_DHCP "dhcp" #define NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL "link-local" #define NM_SETTING_IP6_CONFIG_METHOD_MANUAL "manual" #define NM_SETTING_IP6_CONFIG_METHOD_SHARED "shared" diff --git a/src/nm-device.c b/src/nm-device.c index 98be23cd00..640ef62e30 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -1656,6 +1656,13 @@ real_act_stage3_ip6_config_start (NMDevice *self, NMDeviceStateReason *reason) } nm_ip6_manager_begin_addrconf (priv->ip6_manager, nm_device_get_ip_ifindex (self)); ret = NM_ACT_STAGE_RETURN_POSTPONE; + } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) { + /* Router advertisements shouldn't be used in pure DHCP mode */ + if (priv->ip6_accept_ra_path) + nm_utils_do_sysctl (priv->ip6_accept_ra_path, "0\n"); + + priv->dhcp6_mode = IP6_DHCP_OPT_MANAGED; + ret = dhcp6_start (self, connection, priv->dhcp6_mode, reason); } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) { /* reset the saved RA value when ipv6 is ignored */ if (priv->ip6_accept_ra_path) { @@ -2109,7 +2116,8 @@ real_act_stage4_get_ip6_config (NMDevice *self, *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; goto out; } - } + } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) + g_assert (priv->dhcp6_client); /* sanity check */ /* Autoconf might have triggered DHCPv6 too */ if (priv->dhcp6_client) { diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index 01ac32d8ae..4787b85a47 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -1389,7 +1389,7 @@ make_ip6_setting (shvarFile *ifcfg, char *value = NULL; char *str_value; char *route6_path = NULL; - gboolean bool_value, ipv6forwarding, ipv6_autoconf; + gboolean bool_value, ipv6forwarding, ipv6_autoconf, dhcp6 = FALSE; char *method = NM_SETTING_IP6_CONFIG_METHOD_MANUAL; guint32 i; shvarFile *network_ifcfg; @@ -1466,9 +1466,12 @@ make_ip6_setting (shvarFile *ifcfg, /* Find out method property */ ipv6forwarding = svTrueValue (ifcfg, "IPV6FORWARDING", FALSE); ipv6_autoconf = svTrueValue (ifcfg, "IPV6_AUTOCONF", !ipv6forwarding); + dhcp6 = svTrueValue (ifcfg, "DHCPV6C", FALSE); if (ipv6_autoconf) method = NM_SETTING_IP6_CONFIG_METHOD_AUTO; + else if (dhcp6) + method = NM_SETTING_IP6_CONFIG_METHOD_DHCP; else { /* IPV6_AUTOCONF=no and no IPv6 address -> method 'link-local' */ str_value = svGetValue (ifcfg, "IPV6ADDR", FALSE); diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c index 52ca518925..1058c71b80 100644 --- a/system-settings/plugins/ifcfg-rh/writer.c +++ b/system-settings/plugins/ifcfg-rh/writer.c @@ -1307,6 +1307,10 @@ write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); svSetValue (ifcfg, "IPV6_AUTOCONF", "yes", FALSE); svSetValue (ifcfg, "DHCPV6C", NULL, FALSE); + } else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) { + svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); + svSetValue (ifcfg, "IPV6_AUTOCONF", "no", FALSE); + svSetValue (ifcfg, "DHCPV6C", "yes", FALSE); } else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); svSetValue (ifcfg, "IPV6_AUTOCONF", "no", FALSE); -- cgit v1.2.1 From 64182e27d7124489524e1a9c9dca23ccd0455f32 Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Wed, 28 Jul 2010 02:08:17 -0700 Subject: wifi: ensure scanning property is updated on supplicant interface state changes The wifi device is considered to be 'scanning' if the supplicant emits the scanning signal or if it's in the scanning state; but the code didn't correctly handle notifications when the supplicant was in the scanning state. --- src/nm-device-wifi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 895d4d1765..3973fe7bc5 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -2593,6 +2593,11 @@ supplicant_iface_connection_state_cb_handler (gpointer user_data) } out: + /* Signal scanning state changes */ + if ( task->new_state == NM_SUPPLICANT_INTERFACE_CON_STATE_SCANNING + || task->old_state == NM_SUPPLICANT_INTERFACE_CON_STATE_SCANNING) + g_object_notify (G_OBJECT (self), "scanning"); + finish_supplicant_task (task, FALSE); return FALSE; } -- cgit v1.2.1 From 2ffa6a830e2e8793d8d39294418c0b6dc20ead54 Mon Sep 17 00:00:00 2001 From: Daniel Gnoutcheff Date: Wed, 28 Jul 2010 02:28:45 -0700 Subject: keyfile: correctly send the 'update' signal For exported connections, nm_settings_connection_interface_update() is supposed to cause the emission of a NM_SETTINGS_CONNECTION_INTERFACE_UPDATED signal. This is usually done by chaining up to the NMExportedConnection implementation of this method, which actually emits the signal. However, the NMKeyfileConnection implementation usually forgot to do this. Rewrite so that we always chain up after successfully saving settings. --- .../plugins/keyfile/nm-keyfile-connection.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/system-settings/plugins/keyfile/nm-keyfile-connection.c b/system-settings/plugins/keyfile/nm-keyfile-connection.c index ed56d69d2e..1c90961bef 100644 --- a/system-settings/plugins/keyfile/nm-keyfile-connection.c +++ b/system-settings/plugins/keyfile/nm-keyfile-connection.c @@ -78,22 +78,21 @@ update (NMSettingsConnectionInterface *connection, NMKeyfileConnectionPrivate *priv = NM_KEYFILE_CONNECTION_GET_PRIVATE (connection); char *filename = NULL; GError *error = NULL; - gboolean success; - success = write_connection (NM_CONNECTION (connection), KEYFILE_DIR, 0, 0, &filename, &error); - if (success && filename && strcmp (priv->filename, filename)) { + if (!write_connection (NM_CONNECTION (connection), KEYFILE_DIR, 0, 0, &filename, &error)) { + callback (connection, error, user_data); + g_clear_error (&error); + return FALSE; + } + + if (g_strcmp0 (priv->filename, filename)) { /* Update the filename if it changed */ g_free (priv->filename); priv->filename = filename; - success = parent_settings_connection_iface->update (connection, callback, user_data); - } else { - callback (connection, error, user_data); - if (error) - g_error_free (error); + } else g_free (filename); - } - return success; + return parent_settings_connection_iface->update (connection, callback, user_data); } static gboolean -- cgit v1.2.1 From f257c98193016b8802107857aeff9298907e6e18 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 28 Jul 2010 10:05:22 -0700 Subject: libnm-util: register transform func for G_TYPE_STRV to GPtrArray Needed for S390 subchannels property of the wired setting. --- libnm-util/nm-utils.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c index 1f587297e0..ce13da3c86 100644 --- a/libnm-util/nm-utils.c +++ b/libnm-util/nm-utils.c @@ -567,6 +567,24 @@ nm_utils_convert_strv_to_slist (const GValue *src_value, GValue *dest_value) g_value_take_boxed (dest_value, g_slist_reverse (list)); } +static void +nm_utils_convert_strv_to_ptrarray (const GValue *src_value, GValue *dest_value) +{ + char **str; + GPtrArray *array = NULL; + guint i = 0; + + g_return_if_fail (g_type_is_a (G_VALUE_TYPE (src_value), G_TYPE_STRV)); + + str = (char **) g_value_get_boxed (src_value); + + array = g_ptr_array_sized_new (3); + while (str && str[i]) + g_ptr_array_add (array, g_strdup (str[i++])); + + g_value_take_boxed (dest_value, array); +} + static void nm_utils_convert_strv_to_string (const GValue *src_value, GValue *dest_value) { @@ -1081,6 +1099,9 @@ _nm_utils_register_value_transformations (void) g_value_register_transform_func (G_TYPE_STRV, DBUS_TYPE_G_LIST_OF_STRING, nm_utils_convert_strv_to_slist); + g_value_register_transform_func (G_TYPE_STRV, + DBUS_TYPE_G_ARRAY_OF_STRING, + nm_utils_convert_strv_to_ptrarray); g_value_register_transform_func (DBUS_TYPE_G_LIST_OF_STRING, G_TYPE_STRING, nm_utils_convert_strv_to_string); -- cgit v1.2.1 From 28d5b67d84fa50401d408e714da254c5784e4648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Thu, 29 Jul 2010 16:16:20 +0200 Subject: cli: wait a bit even when '--nowait' is specified; for permissions check (rh #614866) NetworkManager checks clients' permissions on requests, so nmcli mustn't quit too early to give NM a chance to reach it on D-Bus. --- cli/src/connections.c | 9 +++++++-- cli/src/devices.c | 7 +++++-- cli/src/nmcli.c | 1 + cli/src/nmcli.h | 1 + 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/cli/src/connections.c b/cli/src/connections.c index b0d9883cdd..9a20753391 100644 --- a/cli/src/connections.c +++ b/cli/src/connections.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -1288,7 +1289,7 @@ activate_connection_cb (gpointer user_data, const char *path, GError *error) printf (_("Active connection state: %s\n"), active_connection_state_to_string (state)); printf (_("Active connection path: %s\n"), orig_path); - if (!orig_nmc->should_wait || state == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) { + if (orig_nmc->nowait_flag || state == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) { /* don't want to wait or already activated */ quit (); } else { @@ -1415,7 +1416,10 @@ do_connection_up (NmCli *nmc, int argc, char **argv) goto error; } - nmc->should_wait = wait; + /* Use nowait_flag instead of should_wait because exitting has to be postponed till active_connection_state_cb() + * is called, giving NM time to check our permissions */ + nmc->nowait_flag = !wait; + nmc->should_wait = TRUE; nm_client_activate_connection (nmc->client, is_system ? NM_DBUS_SERVICE_SYSTEM_SETTINGS : NM_DBUS_SERVICE_USER_SETTINGS, con_path, @@ -1504,6 +1508,7 @@ do_connection_down (NmCli *nmc, int argc, char **argv) else { fprintf (stderr, _("Warning: Connection not active\n")); } + sleep (1); /* Don't quit immediatelly and give NM time to check our permissions */ error: nmc->should_wait = FALSE; diff --git a/cli/src/devices.c b/cli/src/devices.c index e2ce91e358..7c9dcc5210 100644 --- a/cli/src/devices.c +++ b/cli/src/devices.c @@ -929,7 +929,7 @@ disconnect_device_cb (NMDevice *device, GError *error, gpointer user_data) state = nm_device_get_state (device); printf (_("Device state: %d (%s)\n"), state, device_state_to_string (state)); - if (!nmc->should_wait || state == NM_DEVICE_STATE_DISCONNECTED) { + if (nmc->nowait_flag || state == NM_DEVICE_STATE_DISCONNECTED) { /* Don't want to wait or device already disconnected */ quit (); } else { @@ -1015,7 +1015,10 @@ do_device_disconnect (NmCli *nmc, int argc, char **argv) goto error; } - nmc->should_wait = wait; + /* Use nowait_flag instead of should_wait because exitting has to be postponed till disconnect_device_cb() + * is called, giving NM time to check our permissions */ + nmc->nowait_flag = !wait; + nmc->should_wait = TRUE; nm_device_disconnect (device, disconnect_device_cb, nmc); error: diff --git a/cli/src/nmcli.c b/cli/src/nmcli.c index 328a6d8ee5..d416952c6c 100644 --- a/cli/src/nmcli.c +++ b/cli/src/nmcli.c @@ -286,6 +286,7 @@ nmc_init (NmCli *nmc) nmc->user_connections = NULL; nmc->should_wait = FALSE; + nmc->nowait_flag = TRUE; nmc->print_output = NMC_PRINT_NORMAL; nmc->multiline_output = FALSE; nmc->mode_specified = FALSE; diff --git a/cli/src/nmcli.h b/cli/src/nmcli.h index b4e4562bfe..9788ef086c 100644 --- a/cli/src/nmcli.h +++ b/cli/src/nmcli.h @@ -102,6 +102,7 @@ typedef struct _NmCli { GSList *user_connections; /* List of user connections */ gboolean should_wait; /* Indication that nmcli should not end yet */ + gboolean nowait_flag; /* '--nowait' option; used for passing to callbacks */ NMCPrintOutput print_output; /* Output mode */ gboolean multiline_output; /* Multiline output instead of default tabular */ gboolean mode_specified; /* Whether tabular/multiline mode was specified via '--mode' option */ -- cgit v1.2.1 From 7f674d462638df5b86cc796accb950c282b60df1 Mon Sep 17 00:00:00 2001 From: Krishna Babu K Date: Mon, 2 Aug 2010 11:16:51 -0700 Subject: po: updated Telugu translation (bgo #625484) --- po/te.po | 231 ++++++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 147 insertions(+), 84 deletions(-) diff --git a/po/te.po b/po/te.po index 54c6fed65e..ec83618fff 100644 --- a/po/te.po +++ b/po/te.po @@ -7,16 +7,20 @@ msgid "" msgstr "" "Project-Id-Version: te\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-05-06 14:31+0530\n" -"PO-Revision-Date: 2010-05-06 19:30+0530\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-06-28 08:52+0000\n" +"PO-Revision-Date: 2010-07-22 17:20+0530\n" "Last-Translator: Krishna Babu K \n" "Language-Team: Telugu \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" -"Plural-Forms: nplurals=2; plural=(n!=1);\n\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n" +"\n" +"\n" +"\n" "\n" "\n" "\n" @@ -145,19 +149,19 @@ msgstr "ఎప్పటికికాదు" #: ../cli/src/connections.c:602 ../cli/src/connections.c:605 #: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 #: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 -#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 -#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 -#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 -#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 -#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 -#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 -#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 -#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 -#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 -#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 -#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 -#: ../cli/src/settings.c:1210 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:551 ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 msgid "yes" msgstr "అవును" @@ -165,19 +169,19 @@ msgstr "అవును" #: ../cli/src/connections.c:602 ../cli/src/connections.c:605 #: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 #: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 -#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 -#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 -#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 -#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 -#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 -#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 -#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 -#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 -#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 -#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 -#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 -#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:510 ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 ../cli/src/settings.c:1224 msgid "no" msgstr "కాదు" @@ -266,7 +270,7 @@ msgstr "క్రియాశీలపరచబడింది" #: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 #: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 #: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 -#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:473 msgid "unknown" msgstr "తెలియని" @@ -1067,78 +1071,79 @@ msgstr "దోషము: నెట్వర్కునిర్వాహిక msgid "Success" msgstr "సఫలంమైంది" -#: ../cli/src/settings.c:407 +#: ../cli/src/settings.c:411 #, c-format msgid "%d (hex-ascii-key)" msgstr "%d (hex-ascii-key)" -#: ../cli/src/settings.c:409 +#: ../cli/src/settings.c:413 #, c-format msgid "%d (104/128-bit passphrase)" msgstr "%d (104/128-bit passphrase)" -#: ../cli/src/settings.c:412 +#: ../cli/src/settings.c:416 #, c-format msgid "%d (unknown)" msgstr "%d (తెలియని)" -#: ../cli/src/settings.c:438 +#: ../cli/src/settings.c:442 msgid "0 (unknown)" msgstr "0 (తెలియని)" -#: ../cli/src/settings.c:444 +#: ../cli/src/settings.c:448 msgid "any, " msgstr "ఏదైనా, " -#: ../cli/src/settings.c:446 +#: ../cli/src/settings.c:450 msgid "900 MHz, " msgstr "900 MHz, " -#: ../cli/src/settings.c:448 +#: ../cli/src/settings.c:452 msgid "1800 MHz, " msgstr "1800 MHz, " -#: ../cli/src/settings.c:450 +#: ../cli/src/settings.c:454 msgid "1900 MHz, " msgstr "1900 MHz, " -#: ../cli/src/settings.c:452 +#: ../cli/src/settings.c:456 msgid "850 MHz, " msgstr "850 MHz, " -#: ../cli/src/settings.c:454 +#: ../cli/src/settings.c:458 msgid "WCDMA 3GPP UMTS 2100 MHz, " msgstr "WCDMA 3GPP UMTS 2100 MHz, " -#: ../cli/src/settings.c:456 +#: ../cli/src/settings.c:460 msgid "WCDMA 3GPP UMTS 1800 MHz, " msgstr "WCDMA 3GPP UMTS 1800 MHz, " -#: ../cli/src/settings.c:458 +#: ../cli/src/settings.c:462 msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " -#: ../cli/src/settings.c:460 +#: ../cli/src/settings.c:464 msgid "WCDMA 3GPP UMTS 800 MHz, " msgstr "WCDMA 3GPP UMTS 800 MHz, " -#: ../cli/src/settings.c:462 +#: ../cli/src/settings.c:466 msgid "WCDMA 3GPP UMTS 850 MHz, " msgstr "WCDMA 3GPP UMTS 850 MHz, " -#: ../cli/src/settings.c:464 +#: ../cli/src/settings.c:468 msgid "WCDMA 3GPP UMTS 900 MHz, " msgstr "WCDMA 3GPP UMTS 900 MHz, " -#: ../cli/src/settings.c:466 +#: ../cli/src/settings.c:470 msgid "WCDMA 3GPP UMTS 1700 MHz, " msgstr "WCDMA 3GPP UMTS 1700 MHz, " -#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +#: ../cli/src/settings.c:554 ../cli/src/settings.c:721 msgid "auto" msgstr "స్వయంచాలక" -#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 msgid "not set" msgstr "అమర్చ లేదు" @@ -1501,6 +1506,91 @@ msgstr "ఎన్క్రిప్టు చేసిన కీను PEM ఫ msgid "Could not allocate memory for PEM file data." msgstr "PEM ఫైలు డాటా కొరకు మెమొరీను కేటాయించలేక పోయింది." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "రక్షిత WiFi నెట్వర్కు ద్వారా అనుసంధానపు భాగస్వామ్యము." + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "ఓపెన్ WiFi నెట్వర్కు ద్వారా అనుసంధానపు భాగస్వామ్యము" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "నిరంతర సిస్టమ్ హోస్టునామము మార్చుము" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "సిస్టమ్ అనుసంధానములను సవరించుము" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "సిస్టమ్ అమరికలు సవరించుటకు సిస్టమ్ పాలసి నిరోధిస్తుంది" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "నిరంతర సిస్టమ్ హోస్టునామమును సవరించుటను సిస్టమ్ విధానము నిరోధించుచున్నది" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "రక్షిత WiFi నెట్వర్కు ద్వారా అనుసంధానములను భాగస్వామ్యపరచుట సిస్టమ్ విధానము నిరోధించుచున్నది" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "ఓపెన్ WiFi నెట్వర్కు ద్వారా అనుసంధానములను భాగస్వామ్యపరచుట సిస్టమ్ విధానము నిరోధించుచున్నది" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "నెట్వర్కు అనుసంధానముల యొక్క నియంత్రణ అనుమతించుము" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "వినియోగదారి-ప్రత్యేక అనుసంధానముల వుపయోగమును అనుమతించుము" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "WiFi పరికరములను చేతనము లేదా అచేతనము చేయుము" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "మొబైల్ బ్రాడ్‌బాండ్ పరికరములను చేతనము లేదా అచేతనము చేయుము" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "సిస్టమ్ నెట్వర్కింగ్‌ను చేతనము లేదా అచేతనము చేయుము" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 +msgid "" +"Put NetworkManager to sleep or wake it up (should only be used by system " +"power management)" +msgstr "" +"నెట్వర్కుమేనేజర్‌ను స్లీప్‌నకు లేదా దానిని మెల్కొలుపుటకు వుంచండి (సిస్టమ్ పవర్ నిర్వహణ చేత మాత్రమే " +"వుపయోగించబడాలి)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +msgid "System policy prevents control of network connections" +msgstr "నెట్వర్కు అనుసంధానముల నియంత్రణను సిస్టమ్ విధానము నిరోధించుచున్నది" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "WiFi పరికరములను చేతనము చేయుటకు లేదా అచేతనము చేయుటకు సిస్టమ్ విధానము నిరోధించుచున్నది" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "" +"మొబైల్ బ్రాడ్‌బాండ్ పరికరములను చేతనముచేయుటకు లేదా అచేతనముచేయుటకు సిస్టమ్ విధానము నిరోధించుచున్నది" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +msgid "System policy prevents enabling or disabling system networking" +msgstr "సిస్టమ్ నెట్వర్కింగ్‌ను చేతనము చేయుటకు లేదా అచేతనము చేయుటకు సిస్టమ్ విధానము నిరోధించుచున్నది" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "నెట్వర్కుమేనేజర్‌ను స్లీప్‌నకు లేదా దానిని మెల్కొలుపుటకు వుంచుటను సిస్టమ్ విధానము నిరోధించుచున్నది" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +msgid "System policy prevents use of user-specific connections" +msgstr "వినియోగదారి-ప్రత్యేక అనుసంధానములను వుపయోగించుటకు సిస్టమ్ విధానము నిరోధించుచున్నది" + #: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 #: ../src/nm-netlink-monitor.c:653 #, c-format @@ -1546,7 +1636,7 @@ msgstr "లింకు క్యాచీని నవీకరించుట msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "చెల్లని ఐచ్చికము. చెల్లునటువంటి ఐచ్చికముల జాబితా కొరకు --help వుపయోగించండి.\n" -#: ../src/main.c:562 +#: ../src/main.c:568 #, c-format msgid "%s. Please use --help to see a list of valid options.\n" msgstr "%s. చెల్లునటువంటి ఐచ్చికముల జాబితా చూచుటకు దయచేసి --help వుపయోగించుము.\n" @@ -1591,11 +1681,11 @@ msgstr "తెలియని లాగ్ స్థాయి '%s'" msgid "Unknown log domain '%s'" msgstr "తెలియని లాగ్ డొమైన్ '%s'" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/named-manager/nm-named-manager.c:350 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "గమనిక: libc రిజాల్వర్ 3 నామపు సేవికలకన్నా యెక్కువ వాటికి మద్దతివ్వలేదు." -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/named-manager/nm-named-manager.c:352 msgid "The nameservers listed below may not be recognized." msgstr "క్రిందన జాబితాచేసివున్న నామపుసేవికలు గుర్తించబడక పోవచ్చును." @@ -1604,39 +1694,12 @@ msgstr "క్రిందన జాబితాచేసివున్న న msgid "Auto %s" msgstr "స్వయంచాలక %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3275 msgid "System" msgstr "సిస్టమ్" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 -msgid "Connection sharing via a protected WiFi network" -msgstr "రక్షిత WiFi నెట్వర్కు ద్వారా అనుసంధానపు భాగస్వామ్యము." - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 -msgid "Connection sharing via an open WiFi network" -msgstr "ఓపెన్ WiFi నెట్వర్కు ద్వారా అనుసంధానపు భాగస్వామ్యము" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 -msgid "Modify persistent system hostname" -msgstr "నిరంతర సిస్టమ్ హోస్టునామము మార్చుము" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 -msgid "Modify system connections" -msgstr "సిస్టమ్ అనుసంధానములను సవరించుము" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 -msgid "System policy prevents modification of system settings" -msgstr "సిస్టమ్ అమరికలు సవరించుటకు సిస్టమ్ పాలసి నిరోధిస్తుంది" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 -msgid "System policy prevents modification of the persistent system hostname" -msgstr "నిరంతర సిస్టమ్ హోస్టునామమును సవరించుటను సిస్టమ్ విధానము నిరోధించుచున్నది" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 -msgid "System policy prevents sharing connections via a protected WiFi network" -msgstr "రక్షిత WiFi నెట్వర్కు ద్వారా అనుసంధానములను భాగస్వామ్యపరచుట సిస్టమ్ విధానము నిరోధించుచున్నది" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 -msgid "System policy prevents sharing connections via an open WiFi network" -msgstr "ఓపెన్ WiFi నెట్వర్కు ద్వారా అనుసంధానములను భాగస్వామ్యపరచుట సిస్టమ్ విధానము నిరోధించుచున్నది" +#~ msgid "IP6-SETTINGS" +#~ msgstr "IP6-SETTINGS" +#~ msgid "IP6-DNS" +#~ msgstr "IP6-DNS" -- cgit v1.2.1 From 7c0c55a2ac9add03ae9a4c76fa9a55261461bb63 Mon Sep 17 00:00:00 2001 From: Manoj Kumar Giri Date: Mon, 2 Aug 2010 11:18:46 -0700 Subject: po: updated Oriya translation (bgo #625565) --- po/or.po | 229 +++++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 143 insertions(+), 86 deletions(-) diff --git a/po/or.po b/po/or.po index d9fa2b7198..38f68a8ad9 100644 --- a/po/or.po +++ b/po/or.po @@ -1,14 +1,14 @@ -# translation of or.po to Oriya +# translation of NetworkManager.master.or.po to Oriya # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Manoj Kumar Giri , 2008, 2010. msgid "" msgstr "" -"Project-Id-Version: or\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-05-06 14:31+0530\n" -"PO-Revision-Date: 2010-05-07 12:43+0530\n" +"Project-Id-Version: NetworkManager.master.or\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-06-28 08:52+0000\n" +"PO-Revision-Date: 2010-07-29 15:38+0530\n" "Last-Translator: Manoj Kumar Giri \n" "Language-Team: Oriya \n" "MIME-Version: 1.0\n" @@ -144,19 +144,19 @@ msgstr "କଦାପି ନୁହଁ" #: ../cli/src/connections.c:602 ../cli/src/connections.c:605 #: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 #: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 -#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 -#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 -#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 -#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 -#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 -#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 -#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 -#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 -#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 -#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 -#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 -#: ../cli/src/settings.c:1210 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:551 ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 msgid "yes" msgstr "ହଁ" @@ -164,19 +164,19 @@ msgstr "ହଁ" #: ../cli/src/connections.c:602 ../cli/src/connections.c:605 #: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 #: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 -#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 -#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 -#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 -#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 -#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 -#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 -#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 -#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 -#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 -#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 -#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 -#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:510 ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 ../cli/src/settings.c:1224 msgid "no" msgstr "ନାଁ" @@ -265,7 +265,7 @@ msgstr "ସକ୍ରିୟ ହୋଇସାରିଛି" #: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 #: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 #: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 -#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:473 msgid "unknown" msgstr "ଅଜଣା" @@ -1066,78 +1066,79 @@ msgstr "ତ୍ରୁଟି: NetworkManager ସହିତ ସଂଯୋଗ ସ୍ msgid "Success" msgstr "ସଫଳତା" -#: ../cli/src/settings.c:407 +#: ../cli/src/settings.c:411 #, c-format msgid "%d (hex-ascii-key)" msgstr "%d (hex-ascii-key)" -#: ../cli/src/settings.c:409 +#: ../cli/src/settings.c:413 #, c-format msgid "%d (104/128-bit passphrase)" msgstr "%d (104/128-ବିଟ ପ୍ରବେଶ ସଂକେତ ବାକ୍ୟାଂଶ)" -#: ../cli/src/settings.c:412 +#: ../cli/src/settings.c:416 #, c-format msgid "%d (unknown)" msgstr "%d (ଅଜଣା)" -#: ../cli/src/settings.c:438 +#: ../cli/src/settings.c:442 msgid "0 (unknown)" msgstr "0 (ଅଜଣା)" -#: ../cli/src/settings.c:444 +#: ../cli/src/settings.c:448 msgid "any, " msgstr "ଯେକୌଣସି, " -#: ../cli/src/settings.c:446 +#: ../cli/src/settings.c:450 msgid "900 MHz, " msgstr "900 MHz, " -#: ../cli/src/settings.c:448 +#: ../cli/src/settings.c:452 msgid "1800 MHz, " msgstr "1800 MHz, " -#: ../cli/src/settings.c:450 +#: ../cli/src/settings.c:454 msgid "1900 MHz, " msgstr "1900 MHz, " -#: ../cli/src/settings.c:452 +#: ../cli/src/settings.c:456 msgid "850 MHz, " msgstr "850 MHz, " -#: ../cli/src/settings.c:454 +#: ../cli/src/settings.c:458 msgid "WCDMA 3GPP UMTS 2100 MHz, " msgstr "WCDMA 3GPP UMTS 2100 MHz, " -#: ../cli/src/settings.c:456 +#: ../cli/src/settings.c:460 msgid "WCDMA 3GPP UMTS 1800 MHz, " msgstr "WCDMA 3GPP UMTS 1800 MHz, " -#: ../cli/src/settings.c:458 +#: ../cli/src/settings.c:462 msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " -#: ../cli/src/settings.c:460 +#: ../cli/src/settings.c:464 msgid "WCDMA 3GPP UMTS 800 MHz, " msgstr "WCDMA 3GPP UMTS 800 MHz, " -#: ../cli/src/settings.c:462 +#: ../cli/src/settings.c:466 msgid "WCDMA 3GPP UMTS 850 MHz, " msgstr "WCDMA 3GPP UMTS 850 MHz, " -#: ../cli/src/settings.c:464 +#: ../cli/src/settings.c:468 msgid "WCDMA 3GPP UMTS 900 MHz, " msgstr "WCDMA 3GPP UMTS 900 MHz, " -#: ../cli/src/settings.c:466 +#: ../cli/src/settings.c:470 msgid "WCDMA 3GPP UMTS 1700 MHz, " msgstr "WCDMA 3GPP UMTS 1700 MHz, " -#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +#: ../cli/src/settings.c:554 ../cli/src/settings.c:721 msgid "auto" msgstr "ସ୍ୱୟଂଚାଳିତ" -#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 msgid "not set" msgstr "ସେଟ ହୋଇନାହିଁ" @@ -1500,6 +1501,94 @@ msgstr "PEM ଫାଇଲରେ ସଂଗୁପ୍ତ କି ଲେଖିବା msgid "Could not allocate memory for PEM file data." msgstr "PEM ଫାଇଲ ତଥ୍ୟକୁ ବଣ୍ଟନ କରିପାରିଲା ନାହିଁ।" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "ଗୋଟିଏ ସୁରକ୍ଷିତ WiFi ନେଟୱର୍କରେ ସଂଯୋଗ ସହଭାଗ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "ଗୋଟିଏ ଖୋଲା WiFi ନେଟୱର୍କରେ ସଂଯୋଗ ସହଭାଗ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "ସ୍ଥାୟୀ ତନ୍ତ୍ର ହୋଷ୍ଟନାମକୁ ପରିବର୍ତ୍ତନ କରନ୍ତୁ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "ତନ୍ତ୍ର ସଂଯୋଗଗୁଡ଼ିକୁ ପରିବର୍ତ୍ତନ କରନ୍ତୁ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "ତନ୍ତ୍ର ନିତୀ ତନ୍ତ୍ର ବିନ୍ୟାସ ପରିବର୍ତ୍ତନକୁ ବାରଣ କରିଥାଏ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "ତନ୍ତ୍ର ନିତୀ ସ୍ଥାୟୀ ତନ୍ତ୍ର ହୋଷ୍ଟନାମର ପରିବର୍ତ୍ତନକୁ ବାରଣ କରିଥାଏ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "ତନ୍ତ୍ର ନିତୀ ଗୋଟିଏ ସୁରକ୍ଷିତ WiFi ନେଟୱର୍କରେ ସଂଯୋଗ ସହଭାଗ କରିବାରେ ବାରଣ କରିଥାଏ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "ତନ୍ତ୍ର ନିତୀ ଗୋଟିଏ ଖୋଲା WiFi ନେଟୱର୍କରେ ସଂଯୋଗ ସହଭାଗ କରିବାରେ ବାରଣ କରିଥାଏ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "ନେଟୱର୍କ ସଂଯୋଗଗୁଡ଼ିକ ପାଇଁ ନିୟନ୍ତ୍ରଣକୁ ଅନୁମତି ଦିଅନ୍ତୁ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "ଚାଳକ-ନିର୍ଦ୍ଦିଷ୍ଟ ସଂଯୋଗଗୁଡ଼ିକର ବ୍ୟବହାରକୁ ଅନୁମତି ଦିଅନ୍ତୁ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "WiFi ଉପକରଣଗୁଡ଼ିକୁ ସକ୍ରିୟ କିମ୍ବା ନିଷ୍କ୍ରିୟ କରନ୍ତୁ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "ମୋବାଇଲ ବ୍ରୋଡବ୍ୟାଣ୍ଡ ଉପକରଣଗୁଡ଼ିକୁ ସକ୍ରିୟ କିମ୍ବା ନିଷ୍କ୍ରିୟ କରନ୍ତୁ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "ତନ୍ତ୍ର ନେଟୱର୍କିଙ୍ଗକୁ ସକ୍ରିୟ କିମ୍ବା ନିଷ୍କ୍ରିୟ କରନ୍ତୁ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 +msgid "" +"Put NetworkManager to sleep or wake it up (should only be used by system " +"power management)" +msgstr "" +"NetworkManager କୁ ସୁପ୍ତ କିମ୍ବା ଜାଗ୍ରତ ରଖନ୍ତୁ (କେବଳ ତନ୍ତ୍ର ଶକ୍ତି ପରିଚାଳନା " +"ଦ୍ୱାରା ବ୍ୟବହାର ହେବା ଉଚିତ)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents control of network connections" +msgstr "ତନ୍ତ୍ର ନିତୀ ନେଟୱର୍କ ସଂଯୋଗଗୁଡ଼ିକର ନିୟନ୍ତ୍ରଣକୁ ବାରଣ କରିଥାଏ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +#| msgid "System policy prevents sharing connections via an open WiFi network" +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "ତନ୍ତ୍ର ନିତୀ WiFi ଉପକରଣଗୁଡ଼ିକୁ ସକ୍ରିୟ କିମ୍ବା ନିଷ୍କ୍ରିୟ ହେବାରୁ ବାରଣ କରିଥାଏ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "ତନ୍ତ୍ର ନିତୀ ମୋବାଇଲ ବ୍ରୋଡବ୍ୟାଣ୍ଡ ଉପକରଣଗୁଡ଼ିକୁ ସକ୍ରିୟ କିମ୍ବା ନିଷ୍କ୍ରିୟ ହେବାରୁ ବାରଣ କରିଥାଏ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents enabling or disabling system networking" +msgstr "ତନ୍ତ୍ର ନିତୀ ତନ୍ତ୍ର ନେଟୱର୍କିଙ୍ଗକୁ ସକ୍ରିୟ କିମ୍ବା ନିଷ୍କ୍ରିୟ ହେବାରୁ ବାରଣ କରିଥାଏ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "ତନ୍ତ୍ର ନିତୀ NetworkManager କୁ ସୁପ୍ତ କିମ୍ବା ଜାଗ୍ରତ ରହିବାରୁ ବାରଣ କରିଥାଏ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents use of user-specific connections" +msgstr "ତନ୍ତ୍ର ନିତୀ ତନ୍ତ୍ର-ନିର୍ଦ୍ଦିଷ୍ଟ ସଂଯୋଗଗୁଡ଼ିକୁ ବାରଣ କରିଥାଏ" + #: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 #: ../src/nm-netlink-monitor.c:653 #, c-format @@ -1545,7 +1634,7 @@ msgstr "ସଂଯୋଗ କ୍ୟାଶେ ଅଦ୍ୟତନ କରିବାର msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "ଅବୈଧ ବିକଳ୍ପ. ବୈଧ ବିକଳ୍ପର ତାଲିକା ଦେଖିବା ପାଇଁ ଦୟାକରି --ସହାୟତା ବ୍ୟବହାର କରନ୍ତୁ.\n" -#: ../src/main.c:562 +#: ../src/main.c:568 #, c-format msgid "%s. Please use --help to see a list of valid options.\n" msgstr "%s. ବୈଧ ବିକଳ୍ପର ତାଲିକା ଦେଖିବା ପାଇଁ ଦୟାକରି --help ବ୍ୟବହାର କରନ୍ତୁ।\n" @@ -1590,11 +1679,11 @@ msgstr "ଅଜ୍ଞାତ ଲଗ ସ୍ତର '%s'" msgid "Unknown log domain '%s'" msgstr "ଅଜ୍ଞାତ ଲଗ ଡମେନ '%s'" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/named-manager/nm-named-manager.c:350 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "ଟିପ୍ପଣୀ: libc resolver 3 ରୁ ଅଧିକ nameserverଗୁଡ଼ିକୁ ସମର୍ଥନ କରିନପାରେ." -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/named-manager/nm-named-manager.c:352 msgid "The nameservers listed below may not be recognized." msgstr "ନିମ୍ନରେ ତାଲିକାଭୁକ୍ତ nameserverଗୁଡ଼ିକୁ ଚିହ୍ନି ହୋଇନପାରେ." @@ -1603,39 +1692,7 @@ msgstr "ନିମ୍ନରେ ତାଲିକାଭୁକ୍ତ nameserverଗୁ msgid "Auto %s" msgstr "ସ୍ୱୟଂ %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3275 msgid "System" msgstr "ତନ୍ତ୍ର" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 -msgid "Connection sharing via a protected WiFi network" -msgstr "ଗୋଟିଏ ସୁରକ୍ଷିତ WiFi ନେଟୱର୍କରେ ସଂଯୋଗ ସହଭାଗ" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 -msgid "Connection sharing via an open WiFi network" -msgstr "ଗୋଟିଏ ଖୋଲା WiFi ନେଟୱର୍କରେ ସଂଯୋଗ ସହଭାଗ" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 -msgid "Modify persistent system hostname" -msgstr "ସ୍ଥାୟୀ ତନ୍ତ୍ର ହୋଷ୍ଟନାମକୁ ପରିବର୍ତ୍ତନ କରନ୍ତୁ" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 -msgid "Modify system connections" -msgstr "ତନ୍ତ୍ର ସଂଯୋଗଗୁଡ଼ିକୁ ପରିବର୍ତ୍ତନ କରନ୍ତୁ" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 -msgid "System policy prevents modification of system settings" -msgstr "ତନ୍ତ୍ର ନିତୀ ତନ୍ତ୍ର ବିନ୍ୟାସ ପରିବର୍ତ୍ତନକୁ ବାରଣ କରିଥାଏ" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 -msgid "System policy prevents modification of the persistent system hostname" -msgstr "ତନ୍ତ୍ର ନିତୀ ସ୍ଥାୟୀ ତନ୍ତ୍ର ହୋଷ୍ଟନାମର ପରିବର୍ତ୍ତନକୁ ବାରଣ କରିଥାଏ" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 -msgid "System policy prevents sharing connections via a protected WiFi network" -msgstr "ତନ୍ତ୍ର ନିତୀ ଗୋଟିଏ ସୁରକ୍ଷିତ WiFi ନେଟୱର୍କରେ ସଂଯୋଗ ସହଭାଗ କରିବାରେ ବାରଣ କରିଥାଏ" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 -msgid "System policy prevents sharing connections via an open WiFi network" -msgstr "ତନ୍ତ୍ର ନିତୀ ଗୋଟିଏ ଖୋଲା WiFi ନେଟୱର୍କରେ ସଂଯୋଗ ସହଭାଗ କରିବାରେ ବାରଣ କରିଥାଏ" - -- cgit v1.2.1 From e0f16e777ad993fadb1ea21b34fde9ca4736f419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Gonz=C3=A1lez?= Date: Mon, 2 Aug 2010 11:21:52 -0700 Subject: po: updated Spanish translation (bgo #625711) --- po/es.po | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/po/es.po b/po/es.po index 313d2a0b46..142cb08cba 100644 --- a/po/es.po +++ b/po/es.po @@ -12,11 +12,11 @@ # msgid "" msgstr "" -"Project-Id-Version: NetworkManager.HEAD\n" +"Project-Id-Version: es\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "product=NetworkManager&component=general\n" "POT-Creation-Date: 2010-06-28 08:52+0000\n" -"PO-Revision-Date: 2010-07-11 10:42+0200\n" +"PO-Revision-Date: 2010-07-31 11:38+0200\n" "Last-Translator: Jorge González \n" "Language-Team: Español \n" "MIME-Version: 1.0\n" @@ -1551,15 +1551,15 @@ msgstr "Permitir controlar las conexiones de red" #: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 msgid "Allow use of user-specific connections" -msgstr "Permitir el uso de conexiones específicas de usuario" +msgstr "Permitir el uso de conexiones específicas de usuario" #: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 msgid "Enable or disable WiFi devices" -msgstr "Activar o desactivar los dispositivos inalámbricos" +msgstr "Activar o desactivar los dispositivos inalámbricos" #: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 msgid "Enable or disable mobile broadband devices" -msgstr "Activar o desactivar los dispositivos de banda ancha móvil" +msgstr "Activar o desactivar los dispositivos de banda ancha móvil" #: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 msgid "Enable or disable system networking" @@ -1570,42 +1570,42 @@ msgid "" "Put NetworkManager to sleep or wake it up (should only be used by system " "power management)" msgstr "" -"Poner NetworkManager a dormir o despertarlo (sólo lo debería usar el gestor " -"de energía del sistema)" +"Poner NetworkManager a dormir o despertarlo (sólo lo debería usar el gestor " +"de energía del sistema)" #: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 #| msgid "System policy prevents modification of system settings" msgid "System policy prevents control of network connections" -msgstr "La política de sistema evita el control de las conexiones de red" +msgstr "La política de sistema evita el control de las conexiones de red" #: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 #| msgid "System policy prevents sharing connections via an open WiFi network" msgid "System policy prevents enabling or disabling WiFi devices" msgstr "" -"La política de sistema evita activar o desactivar los dispositivos " -"inalámbricos" +"La política de sistema evita activar o desactivar los dispositivos " +"inalámbricos" #: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 msgid "System policy prevents enabling or disabling mobile broadband devices" msgstr "" -"La política del sistema evita activar o desactivar los dispositivos de banda " -"ancha móvil" +"La política del sistema evita activar o desactivar los dispositivos de banda " +"ancha móvil" #: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 #| msgid "System policy prevents modification of system settings" msgid "System policy prevents enabling or disabling system networking" -msgstr "La política del sistema evita activar o desactivar la red del sistema" +msgstr "La política de sistema evita activar o desactivar la red del sistema" #: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 msgid "System policy prevents putting NetworkManager to sleep or waking it up" msgstr "" -"La política del sistema evita poner a NetworkManager a dormir o despertarlo" +"La política del sistema evita poner a NetworkManager a dormir o despertarlo" #: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 #| msgid "System policy prevents modification of system settings" msgid "System policy prevents use of user-specific connections" msgstr "" -"La política del sistema evita el uso de conexiones específicas de usuario" +"La política del sistema evita el uso de conexiones específicas de usuario" #: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 #: ../src/nm-netlink-monitor.c:653 -- cgit v1.2.1 From 0a1af03fe08df6f2b3cbe0dddb51d3c9ff89626d Mon Sep 17 00:00:00 2001 From: A S Alam Date: Mon, 2 Aug 2010 11:25:42 -0700 Subject: po: updated Punjabi translation (bgo #625755) --- po/pa.po | 342 +++++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 200 insertions(+), 142 deletions(-) diff --git a/po/pa.po b/po/pa.po index 90b36c5aee..482ddbf894 100644 --- a/po/pa.po +++ b/po/pa.po @@ -4,16 +4,17 @@ # # Amanpreet Singh Alam , 2004. # Amanpreet Singh Alam , 2005. -# A S Alam , 2007. +# A S Alam , 2007, 2010. # Jaswinder Singh , 2010. msgid "" msgstr "" "Project-Id-Version: NetworkManager.HEAD\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-05-06 14:31+0530\n" -"PO-Revision-Date: 2010-05-07 10:40+0530\n" -"Last-Translator: Jaswinder Singh \n" -"Language-Team: Punjabi/Panjabi \n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug." +"cgi?product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-06-28 08:52+0000\n" +"PO-Revision-Date: 2010-08-01 17:05+0530\n" +"Last-Translator: A S Alam \n" +"Language-Team: Punjabi/Panjabi \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -144,19 +145,19 @@ msgstr "ਕਦੇ ਨਹੀਂ" #: ../cli/src/connections.c:602 ../cli/src/connections.c:605 #: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 #: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 -#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 -#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 -#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 -#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 -#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 -#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 -#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 -#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 -#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 -#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 -#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 -#: ../cli/src/settings.c:1210 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:551 ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 msgid "yes" msgstr "ਹਾਂ" @@ -164,19 +165,19 @@ msgstr "ਹਾਂ" #: ../cli/src/connections.c:602 ../cli/src/connections.c:605 #: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 #: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 -#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 -#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 -#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 -#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 -#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 -#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 -#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 -#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 -#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 -#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 -#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 -#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:510 ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 ../cli/src/settings.c:1224 msgid "no" msgstr "ਨਹੀਂ" @@ -218,17 +219,17 @@ msgstr "ਗਲਤੀ: ਕੋਈ ਢੁੱਕਵਾਂ ਪੈਰਾਮੀਟਰ #: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 #, c-format msgid "Error: %s." -msgstr "ਗਲਤੀ: %s." +msgstr "ਗਲਤੀ: %s" #: ../cli/src/connections.c:649 #, c-format msgid "Error: 'con status': %s" -msgstr "Error: 'con status': %s" +msgstr "ਗਲਤੀ: 'con status': %s" #: ../cli/src/connections.c:651 #, c-format msgid "Error: 'con status': %s; allowed fields: %s" -msgstr "Error: 'con status': %s; allowed fields: %s" +msgstr "ਗਲਤੀ: 'con status': %s; allowed fields: %s" #: ../cli/src/connections.c:658 msgid "Active connections" @@ -247,7 +248,7 @@ msgstr "ਕੋਈ ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ ਜਾਂ ਜੰਤਰ #: ../cli/src/connections.c:1084 #, c-format msgid "device '%s' not compatible with connection '%s'" -msgstr "device '%s' not compatible with connection '%s'" +msgstr "ਜੰਤਰ '%s' ਕੁਨੈਕਸ਼ਨ '%s' ਨਾਲ ਅਨੁਕੂਲ ਨਹੀਂ ਹੈ" #: ../cli/src/connections.c:1086 #, c-format @@ -265,7 +266,7 @@ msgstr "ਚਾਲੂ ਕੀਤਾ" #: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 #: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 #: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 -#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:473 msgid "unknown" msgstr "ਅਣਜਾਣ" @@ -358,7 +359,7 @@ msgstr "ਕੁਨੈਕਸ਼ਨ ਚਾਲੂ ਕੀਤਾ\n" #: ../cli/src/connections.c:1176 #, c-format msgid "Error: Connection activation failed." -msgstr "ਗਲਤ: ਕੁਨੈਕਸ਼ਨ ਚਾਲੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ।" +msgstr "ਗਲਤੀ: ਕੁਨੈਕਸ਼ਨ ਚਾਲੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ।" #: ../cli/src/connections.c:1195 #, c-format @@ -454,7 +455,7 @@ msgstr "ਗਲਤੀ: ਕੁਨੈਕਸ਼ਨ ਨਹੀਂ ਲਿਆ ਜਾ ਸ #. 9 #: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 msgid "DEVICE" -msgstr "DEVICE" +msgstr "ਜੰਤਰ" #. 1 #. 4 @@ -462,21 +463,21 @@ msgstr "DEVICE" #: ../cli/src/devices.c:62 ../cli/src/devices.c:90 #: ../cli/src/network-manager.c:36 msgid "STATE" -msgstr "STATE" +msgstr "ਹਾਲਤ" #: ../cli/src/devices.c:71 msgid "GENERAL" -msgstr "GENERAL" +msgstr "ਆਮ" #. 0 #: ../cli/src/devices.c:72 msgid "CAPABILITIES" -msgstr "CAPABILITIES" +msgstr "ਸਮਰੱਥਾ" #. 1 #: ../cli/src/devices.c:73 msgid "WIFI-PROPERTIES" -msgstr "WIFI-PROPERTIES" +msgstr "ਵਾਈਫਾਈ-ਵਿਸ਼ੇਸ਼ਤਾ" #. 2 #: ../cli/src/devices.c:74 @@ -486,12 +487,12 @@ msgstr "AP" #. 3 #: ../cli/src/devices.c:75 msgid "WIRED-PROPERTIES" -msgstr "WIRED-PROPERTIES" +msgstr "ਤਾਰ-ਵਿਸ਼ੇਸ਼ਤਾ" #. 4 #: ../cli/src/devices.c:76 msgid "IP4-SETTINGS" -msgstr "IP4-SETTINGS" +msgstr "IP4-ਸੈਟਿੰਗ" #. 5 #: ../cli/src/devices.c:77 @@ -501,7 +502,7 @@ msgstr "IP4-DNS" #. 2 #: ../cli/src/devices.c:88 msgid "DRIVER" -msgstr "DRIVER" +msgstr "ਡਰਾਇਵਰ" #. 3 #: ../cli/src/devices.c:89 @@ -511,17 +512,17 @@ msgstr "HWADDR" #. 0 #: ../cli/src/devices.c:99 msgid "CARRIER-DETECT" -msgstr "CARRIER-DETECT" +msgstr "ਕੈਰੀਅਰ-ਖੋਜ" #. 1 #: ../cli/src/devices.c:100 msgid "SPEED" -msgstr "SPEED" +msgstr "ਸਪੀਡ" #. 0 #: ../cli/src/devices.c:109 msgid "CARRIER" -msgstr "CARRIER" +msgstr "ਕੈਰੀਅਰ" #. 0 #: ../cli/src/devices.c:119 @@ -551,17 +552,17 @@ msgstr "CCMP" #. 0 #: ../cli/src/devices.c:132 msgid "ADDRESS" -msgstr "ADDRESS" +msgstr "ਐਡਰੈੱਸ" #. 1 #: ../cli/src/devices.c:133 msgid "PREFIX" -msgstr "PREFIX" +msgstr "ਪ੍ਰੀ-ਫਿਕਸ" #. 2 #: ../cli/src/devices.c:134 msgid "GATEWAY" -msgstr "GATEWAY" +msgstr "ਗੇਟਵੇ" #. 0 #: ../cli/src/devices.c:143 @@ -581,27 +582,27 @@ msgstr "BSSID" #. 2 #: ../cli/src/devices.c:155 msgid "MODE" -msgstr "MODE" +msgstr "ਮੋਡ" #. 3 #: ../cli/src/devices.c:156 msgid "FREQ" -msgstr "FREQ" +msgstr "ਫਰੀਕਿਊਂਸੀ" #. 4 #: ../cli/src/devices.c:157 msgid "RATE" -msgstr "RATE" +msgstr "ਰੇਟ" #. 5 #: ../cli/src/devices.c:158 msgid "SIGNAL" -msgstr "SIGNAL" +msgstr "ਸਿਗਨਲ" #. 6 #: ../cli/src/devices.c:159 msgid "SECURITY" -msgstr "SECURITY" +msgstr "ਸੁਰੱਖਿਆ" #. 7 #: ../cli/src/devices.c:160 @@ -616,7 +617,7 @@ msgstr "RSN-FLAGS" #. 10 #: ../cli/src/devices.c:163 msgid "ACTIVE" -msgstr "ACTIVE" +msgstr "ਚਾਲੂ" #: ../cli/src/devices.c:186 #, c-format @@ -647,7 +648,7 @@ msgstr "ਬਿਨ-ਪਰਬੰਧ" #: ../cli/src/devices.c:208 msgid "unavailable" -msgstr "ਅਣ-ਉਪਲੱਬਧ" +msgstr "ਨਾ-ਉਪਲੱਬਧ" #: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 msgid "disconnected" @@ -718,11 +719,11 @@ msgstr "WPA2 " #: ../cli/src/devices.c:371 msgid "Enterprise " -msgstr "Enterprise " +msgstr "ਇੰਟਰਪ੍ਰਾਈਜ਼ " #: ../cli/src/devices.c:380 msgid "Ad-Hoc" -msgstr "Ad-Hoc" +msgstr "ਐਡ-ਹਾਕ" #: ../cli/src/devices.c:380 msgid "Infrastructure" @@ -731,12 +732,12 @@ msgstr "ਇੰਫਰਾਸਟੱਕਚਰ" #: ../cli/src/devices.c:442 #, c-format msgid "Error: 'dev list': %s" -msgstr "Error: 'dev list': %s" +msgstr "ਗਲਤੀ: 'dev list': %s" #: ../cli/src/devices.c:444 #, c-format msgid "Error: 'dev list': %s; allowed fields: %s" -msgstr "Error: 'dev list': %s; allowed fields: %s" +msgstr "ਗਲਤੀ: 'dev list': %s; ਮਨਜ਼ੂਰ ਖੇਤਰ: %s" #: ../cli/src/devices.c:453 msgid "Device details" @@ -768,12 +769,12 @@ msgstr "ਬੰਦ" #: ../cli/src/devices.c:710 #, c-format msgid "Error: 'dev status': %s" -msgstr "Error: 'dev status': %s" +msgstr "ਗਲਤੀ: 'dev status': %s" #: ../cli/src/devices.c:712 #, c-format msgid "Error: 'dev status': %s; allowed fields: %s" -msgstr "Error: 'dev status': %s; allowed fields: %s" +msgstr "ਗਲਤੀ: 'dev status': %s; ਮਨਜ਼ੂਰ ਖੇਤਰ: %s" #: ../cli/src/devices.c:719 msgid "Status of devices" @@ -812,12 +813,12 @@ msgstr "ਗਲਤੀ: iface ਦੇਣ ਲਈ ਫੇਲ੍ਹ ਹੈ।" #: ../cli/src/devices.c:1011 #, c-format msgid "Error: 'dev wifi': %s" -msgstr "Error: 'dev wifi': %s" +msgstr "ਗਲਤੀ: 'dev wifi': %s" #: ../cli/src/devices.c:1013 #, c-format msgid "Error: 'dev wifi': %s; allowed fields: %s" -msgstr "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "ਗਲਤੀ: 'dev wifi': %s; ਮਨਜ਼ੂਰ ਖੇਤਰ: %s" #: ../cli/src/devices.c:1020 msgid "WiFi scan list" @@ -845,22 +846,22 @@ msgstr "ਗਲਤੀ: 'dev' ਕਮਾਂਡ '%s' ਢੁੱਕਵੀਂ ਨਹੀ #: ../cli/src/network-manager.c:35 msgid "RUNNING" -msgstr "RUNNING" +msgstr "ਚੱਲ ਰਿਹਾ ਹੈ" #. 1 #: ../cli/src/network-manager.c:37 msgid "WIFI-HARDWARE" -msgstr "WIFI-HARDWARE" +msgstr "ਵਾਈਫਾਈ ਹਾਰਡਵੇਅਰ" #. 2 #: ../cli/src/network-manager.c:38 msgid "WIFI" -msgstr "WIFI" +msgstr "ਵਾਈਫਾਈ" #. 3 #: ../cli/src/network-manager.c:39 msgid "WWAN-HARDWARE" -msgstr "WWAN-HARDWARE" +msgstr "WWAN-ਹਾਰਡਵੇਅਰ" #. 4 #: ../cli/src/network-manager.c:40 @@ -903,12 +904,12 @@ msgstr "ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ" #: ../cli/src/network-manager.c:125 #, c-format msgid "Error: 'nm status': %s" -msgstr "Error: 'nm status': %s" +msgstr "ਗਲਤੀ: 'nm status': %s" #: ../cli/src/network-manager.c:127 #, c-format msgid "Error: 'nm status': %s; allowed fields: %s" -msgstr "Error: 'nm status': %s; allowed fields: %s" +msgstr "ਗਲਤੀ: 'nm status': %s; ਮਨਜ਼ੂਰ ਖੇਤਰ: %s" #: ../cli/src/network-manager.c:134 msgid "NetworkManager status" @@ -938,11 +939,11 @@ msgstr "ਨਹੀਂ ਚੱਲ ਰਿਹਾ ਹੈ" #: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 #, c-format msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" -msgstr "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "ਗਲਤੀ: '--fields' value '%s' is not valid here; allowed fields: %s" #: ../cli/src/network-manager.c:209 msgid "WiFi enabled" -msgstr "WiFi enabled" +msgstr "ਵਾਈਫਾਈ ਚਾਲੂ ਹੈ" #: ../cli/src/network-manager.c:220 #, c-format @@ -951,7 +952,7 @@ msgstr "ਗਲਤੀ: ਅਢੁੱਕਵਾਂ 'wifi' ਪੈਰਾਮੀਟਰ: #: ../cli/src/network-manager.c:241 msgid "WWAN enabled" -msgstr "WWAN enabled" +msgstr "WWAN ਚਾਲੂ ਹੈ" #: ../cli/src/network-manager.c:252 #, c-format @@ -1005,27 +1006,27 @@ msgstr "" #: ../cli/src/nmcli.c:113 #, c-format msgid "Error: Object '%s' is unknown, try 'nmcli help'." -msgstr "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "ਗਲਤੀ: ਆਬਜੈਕਟ '%s' ਅਣਜਾਣ ਹੈ, 'nmcli help' ਵਰਤੋਂ।" #: ../cli/src/nmcli.c:143 #, c-format msgid "Error: Option '--terse' is specified the second time." -msgstr "Error: Option '--terse' is specified the second time." +msgstr "ਗਲਤੀ: ਚੋਣ '--terse' ਦੂਜੀ ਵਾਰ ਦਿੱਤੀ ਗਈ।" #: ../cli/src/nmcli.c:148 #, c-format msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." -msgstr "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "ਗਲਤੀ: Option '--terse' is mutually exclusive with '--pretty'." #: ../cli/src/nmcli.c:156 #, c-format msgid "Error: Option '--pretty' is specified the second time." -msgstr "Error: Option '--pretty' is specified the second time." +msgstr "ਗਲਤੀ: Option '--pretty' is specified the second time." #: ../cli/src/nmcli.c:161 #, c-format msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." -msgstr "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "ਗਲਤੀ: Option '--pretty' is mutually exclusive with '--terse'." #: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 #, c-format @@ -1035,12 +1036,12 @@ msgstr "ਗਲਤੀ: '%s' ਚੋਣ ਲਈ ਆਰਗੂਮੈਂਟ ਮੌਜ #: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 #, c-format msgid "Error: '%s' is not valid argument for '%s' option." -msgstr "Error: '%s' is not valid argument for '%s' option." +msgstr "ਗਲਤੀ: '%s' is not valid argument for '%s' option." #: ../cli/src/nmcli.c:203 #, c-format msgid "Error: fields for '%s' options are missing." -msgstr "Error: fields for '%s' options are missing." +msgstr "ਗਲਤੀ: fields for '%s' options are missing." #: ../cli/src/nmcli.c:209 #, c-format @@ -1066,78 +1067,79 @@ msgstr "ਗਲਤੀ: ਨੈੱਟਵਰਕਮੈਨੇਜਰ ਨਾਲ ਕੁ msgid "Success" msgstr "ਸਫ਼ਲ" -#: ../cli/src/settings.c:407 +#: ../cli/src/settings.c:411 #, c-format msgid "%d (hex-ascii-key)" msgstr "%d (hex-ascii-key)" -#: ../cli/src/settings.c:409 +#: ../cli/src/settings.c:413 #, c-format msgid "%d (104/128-bit passphrase)" -msgstr "%d (104/128-bit ਗੁਪਤਕੋਡ)" +msgstr "%d (104/128-bit ਗੁਪਤ-ਕੋਡ)" -#: ../cli/src/settings.c:412 +#: ../cli/src/settings.c:416 #, c-format msgid "%d (unknown)" msgstr "%d (ਅਣਜਾਣ)" -#: ../cli/src/settings.c:438 +#: ../cli/src/settings.c:442 msgid "0 (unknown)" msgstr "0 (ਅਣਜਾਣ)" -#: ../cli/src/settings.c:444 +#: ../cli/src/settings.c:448 msgid "any, " msgstr "ਕੋਈ ਵੀ, " -#: ../cli/src/settings.c:446 +#: ../cli/src/settings.c:450 msgid "900 MHz, " msgstr "900 MHz, " -#: ../cli/src/settings.c:448 +#: ../cli/src/settings.c:452 msgid "1800 MHz, " msgstr "1800 MHz, " -#: ../cli/src/settings.c:450 +#: ../cli/src/settings.c:454 msgid "1900 MHz, " msgstr "1900 MHz, " -#: ../cli/src/settings.c:452 +#: ../cli/src/settings.c:456 msgid "850 MHz, " msgstr "850 MHz, " -#: ../cli/src/settings.c:454 +#: ../cli/src/settings.c:458 msgid "WCDMA 3GPP UMTS 2100 MHz, " msgstr "WCDMA 3GPP UMTS 2100 MHz, " -#: ../cli/src/settings.c:456 +#: ../cli/src/settings.c:460 msgid "WCDMA 3GPP UMTS 1800 MHz, " msgstr "WCDMA 3GPP UMTS 1800 MHz, " -#: ../cli/src/settings.c:458 +#: ../cli/src/settings.c:462 msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " -#: ../cli/src/settings.c:460 +#: ../cli/src/settings.c:464 msgid "WCDMA 3GPP UMTS 800 MHz, " msgstr "WCDMA 3GPP UMTS 800 MHz, " -#: ../cli/src/settings.c:462 +#: ../cli/src/settings.c:466 msgid "WCDMA 3GPP UMTS 850 MHz, " msgstr "WCDMA 3GPP UMTS 850 MHz, " -#: ../cli/src/settings.c:464 +#: ../cli/src/settings.c:468 msgid "WCDMA 3GPP UMTS 900 MHz, " msgstr "WCDMA 3GPP UMTS 900 MHz, " -#: ../cli/src/settings.c:466 +#: ../cli/src/settings.c:470 msgid "WCDMA 3GPP UMTS 1700 MHz, " msgstr "WCDMA 3GPP UMTS 1700 MHz, " -#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +#: ../cli/src/settings.c:554 ../cli/src/settings.c:721 msgid "auto" msgstr "ਆਟੋ" -#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 msgid "not set" msgstr "ਸੈੱਟ ਨਹੀਂ ਹੈ" @@ -1440,7 +1442,7 @@ msgstr "ਇੰਕ੍ਰਿਪਸ਼ਨ ਪਰਸੰਗ ਸ਼ੁਰੂ ਕਰਨ #: ../libnm-util/crypto_nss.c:396 #, c-format msgid "Failed to encrypt: %d." -msgstr "ਇੰਕ੍ਰਿਪਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %d." +msgstr "ਇੰਕ੍ਰਿਪਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %d" #: ../libnm-util/crypto_nss.c:404 #, c-format @@ -1500,6 +1502,94 @@ msgstr "PEM ਫਾਇਲ ਵਾਸਤੇ ਇੰਕ੍ਰਿਪਟ ਕੀਤੀ msgid "Could not allocate memory for PEM file data." msgstr "PEM ਫਾਇਲ ਡਾਟੇ ਲਈ ਮੈਮੋਰੀ ਜਾਰੀ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕੀ" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "ਸੁਰੱਖਿਅਤ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਕੁਨੈਕਸ਼ਨ ਸਾਂਝਾ ਕਰੋ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "ਓਪਨ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਕੁਨੈਕਸ਼ਨ ਸਾਂਝਾ ਕਰੋ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "ਸਥਿਰ ਸਿਸਟਮ ਹੋਸਟ-ਨਾਂ ਸੋਧ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "ਸਿਸਟਮ ਕੁਨੈਸ਼ਨ ਸੋਧ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਸਿਸਟਮ ਸੈਟਿੰਗ ਲਈ ਸੋਧ ਤੋਂ ਰੋਕਦੀ ਹੈ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਸਥਿਰ ਸਿਸਟਮ ਹੋਸਟ-ਨਾਂ ਲਈ ਸੋਧਾਂ ਤੋਂ ਰੋਕਦੀ ਹੈ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਕੁਨੈਕਸ਼ਨ ਨੂੰ ਸੁਰੱਖਿਅਤ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਸਾਂਝਾ ਕਰਨ ਤੋਂ ਰੋਕਦੀ ਹੈ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਕੁਨੈਕਸ਼ਨ ਨੂੰ ਓਪਨ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਸਾਂਝਾ ਕਰਨ ਤੋਂ ਰੋਕਦੀ ਹੈ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "ਨੈੱਟਵਰਕ ਕੁਨੈਕਸ਼ਨਾਂ ਲਈ ਕੰਟਰੋਲ ਮਨਜ਼ੂਰ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "ਖਾਸ ਯੂਜ਼ਰ ਕੁਨੈਕਸ਼ਨਾਂ ਦੀ ਵਰਤੋਂ ਮਨਜ਼ੂਰ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "ਵਾਈ-ਫਾਈ ਜੰਤਰ ਚਾਲੂ ਜਾਂ ਬੰਦ ਕਰੋ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "ਮੋਬਾਇਲ ਬਰਾਡਬੈਂਡ ਜੰਤਰ ਚਾਲੂ ਜਾਂ ਬੰਦ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "ਸਿਸਟਮ ਨੈੱਟਵਰਕਿੰਗ ਚਾਲੂ ਜਾਂ ਬੰਦ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 +msgid "" +"Put NetworkManager to sleep or wake it up (should only be used by system " +"power management)" +msgstr "" +"ਨੈੱਟਵਰਕਮੈਨਜੇਰ ਨੂੰ ਸਲੀਪ ਕਰੋ ਜਾਂ ਵੇਕ ਅੱਪ ਕਰੋ (ਕੇਵਲ ਸਿਸਟਮ ਪਾਵਰ ਮੈਨਜੇਮੈਂਟ ਰਾਹੀਂ ਵਰਤਿਆ " +"ਜਾਣਾ ਚਾਹੀਦਾ ਹੈ)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents control of network connections" +msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਨੈੱਟਵਰਕ ਕੁਨੈਕਸ਼ਨ ਕੰਟਰੋਲ ਕਰਨ ਤੋਂ ਸੋਧ ਤੋਂ ਰੋਕਦੀ ਹੈ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +#| msgid "System policy prevents sharing connections via an open WiFi network" +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਵਾਈ-ਫਾਈ ਜੰਤਰ ਚਾਲੂ ਜਾਂ ਬੰਦ ਕਰਨੋਂ ਰੋਕਦੀ ਹੈ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਮੋਬਾਇਲ ਬਰਾਡਬੈਂਡ ਜੰਤਰ ਚਾਲੂ ਜਾਂ ਬੰਦ ਕਰਨ ਤੋਂ ਰੋਕਦੀ ਹੈ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents enabling or disabling system networking" +msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਸਿਸਟਮ ਨੈੱਟਵਰਕਿੰਗ ਚਾਲੂ ਜਾਂ ਬੰਦ ਕਰਨ ਤੋਂ ਰੋਕਦੀ ਹੈ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਨੈੱਟਵਰਕਮੈਨੇਜਰ ਨੂੰ ਸਲੀਪ ਜਾਂ ਵੇਕਅੱਪ ਕਰਨ ਤੋਂ ਰੋਕਦੀ ਹੈ" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents use of user-specific connections" +msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਖਾਸ-ਯੂਜ਼ਰ ਕੁਨੈਕਸ਼ਨ ਵਰਤੋਂ ਤੋਂ ਰੋਕਦੀ ਹੈ" + #: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 #: ../src/nm-netlink-monitor.c:653 #, c-format @@ -1518,7 +1608,7 @@ msgstr "ਲਿੰਕ ਹਾਲਤ ਦੀ ਨਿਗਰਾਨੀ ਲਈ ਨੈੱ #: ../src/nm-netlink-monitor.c:265 #, c-format msgid "unable to enable netlink handle credential passing: %s" -msgstr "netlink ਹੈੱਡਲ ਕਰੀਡੈਂਸ਼ਲ ਪਾਸਿੰਗ ਯੋਯਗ ਕਰਨ ਲਈ ਅਸਮਰੱਥ: %s" +msgstr "netlink ਹੈੱਡਲ ਸਨਦ ਪਾਸ ਕਰਨ ਲਈ ਅਸਮਰੱਥ: %s" #: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 #, c-format @@ -1533,7 +1623,7 @@ msgstr "ਲਿੰਕ ਹਾਲਤ ਦੀ ਨਿਗਰਾਨੀ ਲਈ ਨੈੱ #: ../src/nm-netlink-monitor.c:502 #, c-format msgid "unable to join netlink group: %s" -msgstr "netlink ਗਰੁੱਪ ਜੁਆਇੰਨ ਕਰਨ ਲਈ ਅਣਸਮਰੱਥ:: %s" +msgstr "netlink ਗਰੁੱਪ ਜੁਆਇੰਨ ਕਰਨ ਲਈ ਅਸਮਰੱਥ:: %s" #: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 #, c-format @@ -1545,7 +1635,7 @@ msgstr "ਲਿੰਕ ਕੈਸ਼ ਅੱਪਡੇਟ ਕਰਨ ਦੌਰਾਨ msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "ਗਲਤ ਚੋਣ। ਢੁੱਕਵੀਆਂ ਚੋਣਾਂ ਵੇਖਣ ਲਈ --help ਵਰਤੋਂ ਜੀ।\n" -#: ../src/main.c:562 +#: ../src/main.c:568 #, c-format msgid "%s. Please use --help to see a list of valid options.\n" msgstr "%s। ਢੁੱਕਵੀਆਂ ਚੋਣਾਂ ਦੀ ਲਿਸਟ ਵੇਖਣ ਲਈ --help ਵਰਤੋਂ ਜੀ।\n" @@ -1590,11 +1680,11 @@ msgstr "ਅਣਜਾਣ ਲਾਗ ਲੈਵਲ '%s'" msgid "Unknown log domain '%s'" msgstr "ਅਣਜਾਣ ਲਾਗ ਡੋਮੇਨ '%s'" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/named-manager/nm-named-manager.c:350 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "ਨੋਟ: libc ਰਿਜ਼ੋਲਵਰ ੩ ਤੋਂ ਵੱਧ ਨੇਮ-ਸਰਵਰ ਲਈ ਸਹਾਇਕ ਨਹੀਂ ਹੋ ਸਕਦਾ ਹੈ।" -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/named-manager/nm-named-manager.c:352 msgid "The nameservers listed below may not be recognized." msgstr "ਹੇਠਾਂ ਦਿੱਤੇ ਨੇਮ-ਸਰਵਰ ਪਛਾਣੇ ਨਹੀਂ ਜਾ ਸਕਦੇ।" @@ -1603,41 +1693,9 @@ msgstr "ਹੇਠਾਂ ਦਿੱਤੇ ਨੇਮ-ਸਰਵਰ ਪਛਾਣੇ msgid "Auto %s" msgstr "ਆਟੋ %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3275 msgid "System" -msgstr "IPL ਲੀਨਕਸ (Linux) ਸਿਸਟਮ।" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 -msgid "Connection sharing via a protected WiFi network" -msgstr "ਸੁਰੱਖਿਅਤ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਕੁਨੈਕਸ਼ਨ ਸਾਂਝਾ ਕਰੋ" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 -msgid "Connection sharing via an open WiFi network" -msgstr "ਓਪਨ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਕੁਨੈਕਸ਼ਨ ਸਾਂਝਾ ਕਰੋ" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 -msgid "Modify persistent system hostname" -msgstr "ਸਥਿਰ ਸਿਸਟਮ ਹੋਸਟ-ਨਾਂ ਸੋਧ" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 -msgid "Modify system connections" -msgstr "ਸਿਸਟਮ ਕੁਨੈਸ਼ਨ ਸੋਧ" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 -msgid "System policy prevents modification of system settings" -msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਸਿਸਟਮ ਸੈਟਿੰਗ ਲਈ ਸੋਧ ਤੋਂ ਰੋਕਦੀ ਹੈ" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 -msgid "System policy prevents modification of the persistent system hostname" -msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਸਥਿਰ ਸਿਸਟਮ ਹੋਸਟ-ਨਾਂ ਲਈ ਸੋਧਾਂ ਤੋਂ ਰੋਕਦੀ ਹੈ" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 -msgid "System policy prevents sharing connections via a protected WiFi network" -msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਕੁਨੈਕਸ਼ਨ ਨੂੰ ਸੁਰੱਖਿਅਤ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਸਾਂਝਾ ਕਰਨ ਤੋਂ ਰੋਕਦੀ ਹੈ" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 -msgid "System policy prevents sharing connections via an open WiFi network" -msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਕੁਨੈਕਸ਼ਨ ਨੂੰ ਓਪਨ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਸਾਂਝਾ ਕਰਨ ਤੋਂ ਰੋਕਦੀ ਹੈ" +msgstr "ਸਿਸਟਮ।" #~ msgid "Type" #~ msgstr "ਕਿਸਮ" -- cgit v1.2.1 From b9c14047699aa1f5fd26d927c6b108dea2d271c8 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 3 Aug 2010 11:36:59 -0700 Subject: debian: don't require ifup for enabling loopback (bgo #625427) But use it if it's installed. --- src/backends/NetworkManagerDebian.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/backends/NetworkManagerDebian.c b/src/backends/NetworkManagerDebian.c index ef9475af6d..37eb6457b0 100644 --- a/src/backends/NetworkManagerDebian.c +++ b/src/backends/NetworkManagerDebian.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* NetworkManager -- Network link manager * * Matthew Garrett @@ -44,7 +45,11 @@ */ void nm_system_enable_loopback (void) { - nm_spawn_process ("/sbin/ifup lo"); + /* ifupdown isn't always installed (bgo #625427) */ + if (g_file_test ("/sbin/ifup", G_FILE_TEST_EXISTS)) + nm_spawn_process ("/sbin/ifup lo"); + else + nm_generic_enable_loopback (); } /* -- cgit v1.2.1 From ce5c0d5ac6b17da337c416189276b8a81feeb6f4 Mon Sep 17 00:00:00 2001 From: Pablo Castellano Date: Tue, 3 Aug 2010 12:58:46 -0700 Subject: build: enable AM_SILENT_RULES (bgo #625263) --- callouts/Makefile.am | 2 +- configure.ac | 1 + libnm-glib/Makefile.am | 36 ++++++++++++++-------------- src/Makefile.am | 28 +++++++++++----------- src/modem-manager/Makefile.am | 2 +- src/ppp-manager/Makefile.am | 2 +- src/system-settings/Makefile.am | 2 +- src/vpn-manager/Makefile.am | 4 ++-- system-settings/plugins/ifcfg-rh/Makefile.am | 2 +- 9 files changed, 40 insertions(+), 39 deletions(-) diff --git a/callouts/Makefile.am b/callouts/Makefile.am index 6f28f5a7b2..9fcdd6c7c0 100644 --- a/callouts/Makefile.am +++ b/callouts/Makefile.am @@ -60,7 +60,7 @@ nm_dispatcher_action_LDADD = \ $(GLIB_LIBS) nm-dispatcher-glue.h: nm-dispatcher.xml - dbus-binding-tool --prefix=nm_dispatcher --mode=glib-server --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_dispatcher --mode=glib-server --output=$@ $< udevrulesdir = $(UDEV_BASE_DIR)/rules.d udevrules_DATA = 77-nm-olpc-mesh.rules diff --git a/configure.ac b/configure.ac index b5147c5991..9c260fb2de 100644 --- a/configure.ac +++ b/configure.ac @@ -2,6 +2,7 @@ AC_PREREQ(2.52) AC_INIT(NetworkManager, 0.8.1, dcbw@redhat.com, NetworkManager) AM_INIT_AUTOMAKE([1.9 subdir-objects tar-ustar no-dist-gzip dist-bzip2]) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])]) AM_MAINTAINER_MODE AC_CONFIG_MACRO_DIR([m4]) diff --git a/libnm-glib/Makefile.am b/libnm-glib/Makefile.am index 66b72c5416..008cc6df16 100644 --- a/libnm-glib/Makefile.am +++ b/libnm-glib/Makefile.am @@ -149,58 +149,58 @@ libnm_glib_vpn_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-glib-vpn.ver \ nm-client-bindings.h: $(top_srcdir)/introspection/nm-manager-client.xml - dbus-binding-tool --prefix=nm_client --mode=glib-client --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_client --mode=glib-client --output=$@ $< nm-device-bindings.h: $(top_srcdir)/introspection/nm-device.xml - dbus-binding-tool --prefix=nm_device --mode=glib-client --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_device --mode=glib-client --output=$@ $< nm-device-ethernet-bindings.h: $(top_srcdir)/introspection/nm-device-ethernet.xml - dbus-binding-tool --prefix=nm_device_ethernet --mode=glib-client --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_device_ethernet --mode=glib-client --output=$@ $< nm-device-wifi-bindings.h: $(top_srcdir)/introspection/nm-device-wifi.xml - dbus-binding-tool --prefix=nm_device_wifi --mode=glib-client --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_device_wifi --mode=glib-client --output=$@ $< nm-device-bt-bindings.h: $(top_srcdir)/introspection/nm-device-bt.xml - dbus-binding-tool --prefix=nm_device_bt --mode=glib-client --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_device_bt --mode=glib-client --output=$@ $< nm-access-point-bindings.h: $(top_srcdir)/introspection/nm-access-point.xml - dbus-binding-tool --prefix=nm_access_point --mode=glib-client --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_access_point --mode=glib-client --output=$@ $< nm-settings-glue.h: $(top_srcdir)/introspection/nm-settings.xml - dbus-binding-tool --prefix=nm_settings --mode=glib-server --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_settings --mode=glib-server --output=$@ $< nm-settings-bindings.h: $(top_srcdir)/introspection/nm-settings.xml - dbus-binding-tool --prefix=nm_settings --mode=glib-client --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_settings --mode=glib-client --output=$@ $< nm-settings-system-bindings.h: $(top_srcdir)/introspection/nm-settings-system.xml - dbus-binding-tool --prefix=nm_settings_system --mode=glib-client --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_settings_system --mode=glib-client --output=$@ $< nm-exported-connection-glue.h: $(top_srcdir)/introspection/nm-exported-connection.xml - dbus-binding-tool --prefix=nm_exported_connection --mode=glib-server --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_exported_connection --mode=glib-server --output=$@ $< nm-exported-connection-bindings.h: $(top_srcdir)/introspection/nm-exported-connection.xml - dbus-binding-tool --prefix=nm_exported_connection --mode=glib-client --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_exported_connection --mode=glib-client --output=$@ $< nm-vpn-connection-bindings.h: $(top_srcdir)/introspection/nm-vpn-connection.xml - dbus-binding-tool --prefix=nm_vpn_connection --mode=glib-client --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_vpn_connection --mode=glib-client --output=$@ $< nm-vpn-plugin-glue.h: $(top_srcdir)/introspection/nm-vpn-plugin.xml - dbus-binding-tool --prefix=nm_vpn_plugin --mode=glib-server --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_vpn_plugin --mode=glib-server --output=$@ $< nm-active-connection-bindings.h: $(top_srcdir)/introspection/nm-active-connection.xml - dbus-binding-tool --prefix=nm_active_connection --mode=glib-client --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_active_connection --mode=glib-client --output=$@ $< nm-ip4-config-bindings.h: $(top_srcdir)/introspection/nm-ip4-config.xml - dbus-binding-tool --prefix=nm_ip4_config --mode=glib-client --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_ip4_config --mode=glib-client --output=$@ $< nm-dhcp4-config-bindings.h: $(top_srcdir)/introspection/nm-dhcp4-config.xml - dbus-binding-tool --prefix=nm_dhcp4_config --mode=glib-client --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_dhcp4_config --mode=glib-client --output=$@ $< nm-ip6-config-bindings.h: $(top_srcdir)/introspection/nm-ip6-config.xml - dbus-binding-tool --prefix=nm_ip6_config --mode=glib-client --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_ip6_config --mode=glib-client --output=$@ $< nm-dhcp6-config-bindings.h: $(top_srcdir)/introspection/nm-dhcp6-config.xml - dbus-binding-tool --prefix=nm_dhcp6_config --mode=glib-client --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_dhcp6_config --mode=glib-client --output=$@ $< pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libnm-glib.pc libnm-glib-vpn.pc diff --git a/src/Makefile.am b/src/Makefile.am index 9a28751a30..72b23d083e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -150,46 +150,46 @@ NetworkManager_SOURCES = \ nm-rfkill.h nm-access-point-glue.h: $(top_srcdir)/introspection/nm-access-point.xml - dbus-binding-tool --prefix=nm_access_point --mode=glib-server --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_access_point --mode=glib-server --output=$@ $< nm-manager-glue.h: $(top_srcdir)/introspection/nm-manager.xml - dbus-binding-tool --prefix=nm_manager --mode=glib-server --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_manager --mode=glib-server --output=$@ $< nm-device-interface-glue.h: $(top_srcdir)/introspection/nm-device.xml - dbus-binding-tool --prefix=nm_device_interface --mode=glib-server --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_device_interface --mode=glib-server --output=$@ $< nm-device-ethernet-glue.h: $(top_srcdir)/introspection/nm-device-ethernet.xml - dbus-binding-tool --prefix=nm_device_ethernet --mode=glib-server --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_device_ethernet --mode=glib-server --output=$@ $< nm-device-wifi-glue.h: $(top_srcdir)/introspection/nm-device-wifi.xml - dbus-binding-tool --prefix=nm_device_wifi --mode=glib-server --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_device_wifi --mode=glib-server --output=$@ $< nm-device-bt-glue.h: $(top_srcdir)/introspection/nm-device-bt.xml - dbus-binding-tool --prefix=nm_device_bt --mode=glib-server --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_device_bt --mode=glib-server --output=$@ $< nm-device-olpc-mesh-glue.h: $(top_srcdir)/introspection/nm-device-olpc-mesh.xml - dbus-binding-tool --prefix=nm_device_olpc_mesh --mode=glib-server --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_device_olpc_mesh --mode=glib-server --output=$@ $< nm-ip4-config-glue.h: $(top_srcdir)/introspection/nm-ip4-config.xml - dbus-binding-tool --prefix=nm_ip4_config --mode=glib-server --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_ip4_config --mode=glib-server --output=$@ $< nm-ip6-config-glue.h: $(top_srcdir)/introspection/nm-ip6-config.xml - dbus-binding-tool --prefix=nm_ip6_config --mode=glib-server --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_ip6_config --mode=glib-server --output=$@ $< nm-active-connection-glue.h: $(top_srcdir)/introspection/nm-active-connection.xml - dbus-binding-tool --prefix=nm_active_connection --mode=glib-server --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_active_connection --mode=glib-server --output=$@ $< nm-dhcp4-config-glue.h: $(top_srcdir)/introspection/nm-dhcp4-config.xml - dbus-binding-tool --prefix=nm_dhcp4_config --mode=glib-server --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_dhcp4_config --mode=glib-server --output=$@ $< nm-dhcp6-config-glue.h: $(top_srcdir)/introspection/nm-dhcp6-config.xml - dbus-binding-tool --prefix=nm_dhcp6_config --mode=glib-server --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_dhcp6_config --mode=glib-server --output=$@ $< nm-device-cdma-glue.h: $(top_srcdir)/introspection/nm-device-cdma.xml - dbus-binding-tool --prefix=nm_device_cdma --mode=glib-server --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_device_cdma --mode=glib-server --output=$@ $< nm-device-gsm-glue.h: $(top_srcdir)/introspection/nm-device-gsm.xml - dbus-binding-tool --prefix=nm_device_gsm --mode=glib-server --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_device_gsm --mode=glib-server --output=$@ $< BUILT_SOURCES = \ nm-access-point-glue.h \ diff --git a/src/modem-manager/Makefile.am b/src/modem-manager/Makefile.am index a0f65c1bae..22ed809fe8 100644 --- a/src/modem-manager/Makefile.am +++ b/src/modem-manager/Makefile.am @@ -27,7 +27,7 @@ libmodem_manager_la_LIBADD = \ $(DBUS_LIBS) nm-serial-device-glue.h: $(top_srcdir)/introspection/nm-device-serial.xml - dbus-binding-tool --prefix=nm_serial_device --mode=glib-server --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_serial_device --mode=glib-server --output=$@ $< BUILT_SOURCES = \ nm-serial-device-glue.h diff --git a/src/ppp-manager/Makefile.am b/src/ppp-manager/Makefile.am index 2dc7ad94c6..f213dd2ecf 100644 --- a/src/ppp-manager/Makefile.am +++ b/src/ppp-manager/Makefile.am @@ -14,7 +14,7 @@ libppp_manager_la_SOURCES = \ nm-ppp-status.h nm-ppp-manager-glue.h: $(top_srcdir)/introspection/nm-ppp-manager.xml - dbus-binding-tool --prefix=nm_ppp_manager --mode=glib-server --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_ppp_manager --mode=glib-server --output=$@ $< built_sources = nm-ppp-manager-glue.h diff --git a/src/system-settings/Makefile.am b/src/system-settings/Makefile.am index 3b616b9084..0b92228f57 100644 --- a/src/system-settings/Makefile.am +++ b/src/system-settings/Makefile.am @@ -54,7 +54,7 @@ libsystem_settings_la_LIBADD = \ libsystem_settings_la_LDFLAGS = -rdynamic nm-settings-system-glue.h: $(top_srcdir)/introspection/nm-settings-system.xml - dbus-binding-tool --prefix=nm_settings_system --mode=glib-server --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_settings_system --mode=glib-server --output=$@ $< CLEANFILES = \ $(BUILT_SOURCES) diff --git a/src/vpn-manager/Makefile.am b/src/vpn-manager/Makefile.am index 56e4a4ced3..2d755128da 100644 --- a/src/vpn-manager/Makefile.am +++ b/src/vpn-manager/Makefile.am @@ -32,10 +32,10 @@ libvpn_manager_la_LIBADD = \ $(GLIB_LIBS) nm-vpn-connection-glue.h: $(top_srcdir)/introspection/nm-vpn-connection.xml - dbus-binding-tool --prefix=nm_vpn_connection --mode=glib-server --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_vpn_connection --mode=glib-server --output=$@ $< nm-vpn-plugin-bindings.h: $(top_srcdir)/introspection/nm-vpn-plugin.xml - dbus-binding-tool --prefix=nm_vpn_plugin --mode=glib-client --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_vpn_plugin --mode=glib-client --output=$@ $< BUILT_SOURCES = \ diff --git a/system-settings/plugins/ifcfg-rh/Makefile.am b/system-settings/plugins/ifcfg-rh/Makefile.am index 3f0bf222fd..54d686bb48 100644 --- a/system-settings/plugins/ifcfg-rh/Makefile.am +++ b/system-settings/plugins/ifcfg-rh/Makefile.am @@ -1,7 +1,7 @@ SUBDIRS=. tests nm-ifcfg-rh-glue.h: nm-ifcfg-rh.xml - dbus-binding-tool --prefix=nm_ifcfg_rh --mode=glib-server --output=$@ $< + $(AM_V_GEN) dbus-binding-tool --prefix=nm_ifcfg_rh --mode=glib-server --output=$@ $< BUILT_SOURCES = \ nm-ifcfg-rh-glue.h -- cgit v1.2.1 From ec6d18ca66228cd4e1c9dfe87d8f5d8f7341bf27 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 3 Aug 2010 15:55:31 -0700 Subject: libnm-util: bump soname for s390 updates --- libnm-util/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am index 327693e4de..f43fb60242 100644 --- a/libnm-util/Makefile.am +++ b/libnm-util/Makefile.am @@ -59,7 +59,7 @@ libnm_util_la_SOURCES= \ libnm_util_la_LIBADD = $(GLIB_LIBS) $(DBUS_LIBS) $(UUID_LIBS) libnm_util_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-util.ver \ - -version-info "6:0:5" + -version-info "7:0:6" if WITH_GNUTLS libnm_util_la_SOURCES += crypto_gnutls.c -- cgit v1.2.1 From 43c6800b35d293b523ac787a82486f01c9f7c96f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 3 Aug 2010 16:17:45 -0700 Subject: ifcfg-rh: ignore BRIDGE and VLAN configs until we support them (rh #619863) --- system-settings/plugins/ifcfg-rh/common.h | 1 + system-settings/plugins/ifcfg-rh/reader.c | 25 ++++++- .../ifcfg-rh/tests/network-scripts/Makefile.am | 5 +- .../network-scripts/ifcfg-test-bridge-component | 5 ++ .../tests/network-scripts/ifcfg-test-bridge-main | 7 ++ .../network-scripts/ifcfg-test-vlan-interface | 7 ++ .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 84 ++++++++++++++++++++++ 7 files changed, 131 insertions(+), 3 deletions(-) create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bridge-component create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bridge-main create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-interface diff --git a/system-settings/plugins/ifcfg-rh/common.h b/system-settings/plugins/ifcfg-rh/common.h index f5ab1c896d..9c578db092 100644 --- a/system-settings/plugins/ifcfg-rh/common.h +++ b/system-settings/plugins/ifcfg-rh/common.h @@ -41,6 +41,7 @@ #define TYPE_ETHERNET "Ethernet" #define TYPE_WIRELESS "Wireless" +#define TYPE_BRIDGE "Bridge" GQuark ifcfg_plugin_error_quark (void); diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index a5d6c37db7..51a2075a17 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -3197,7 +3197,7 @@ connection_from_file (const char *filename, { NMConnection *connection = NULL; shvarFile *parsed; - char *type, *nmc = NULL, *bootproto; + char *type, *nmc = NULL, *bootproto, *tmp; NMSetting *s_ip4, *s_ip6; const char *ifcfg_name = NULL; gboolean nm_controlled = TRUE; @@ -3285,11 +3285,32 @@ connection_from_file (const char *filename, g_free (lower); } + /* Ignore BRIDGE= and VLAN= connections for now too (rh #619863) */ + tmp = svGetValue (parsed, "BRIDGE", FALSE); + if (tmp) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Bridge component connections are not yet supported"); + g_free (tmp); + goto done; + } + + tmp = svGetValue (parsed, "VLAN", FALSE); + if (tmp) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "VLAN connections are not yet supported"); + g_free (tmp); + goto done; + } + + /* Construct the connection */ if (!strcasecmp (type, TYPE_ETHERNET)) connection = wired_connection_from_ifcfg (filename, parsed, nm_controlled, unmanaged, error); else if (!strcasecmp (type, TYPE_WIRELESS)) connection = wireless_connection_from_ifcfg (filename, parsed, nm_controlled, unmanaged, error); - else { + else if (!strcasecmp (type, TYPE_BRIDGE)) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Bridge connections are not yet supported"); + } else { g_set_error (error, ifcfg_plugin_error_quark (), 0, "Unknown connection type '%s'", type); } diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am b/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am index fd2629173a..6ca6b6b320 100644 --- a/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am @@ -65,7 +65,10 @@ EXTRA_DIST = \ keys-test-wifi-wep-40-ascii \ ifcfg-test-wifi-wep-104-ascii \ keys-test-wifi-wep-104-ascii \ - ifcfg-test-wired-qeth-static + ifcfg-test-wired-qeth-static \ + ifcfg-test-bridge-main \ + ifcfg-test-bridge-component \ + ifcfg-test-vlan-interface check-local: @for f in $(EXTRA_DIST); do \ diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bridge-component b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bridge-component new file mode 100644 index 0000000000..f586637ec3 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bridge-component @@ -0,0 +1,5 @@ +DEVICE=eth0 +HWADDR=00:22:15:59:62:97 +ONBOOT=no +BRIDGE=br0 + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bridge-main b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bridge-main new file mode 100644 index 0000000000..c5caf3fc9b --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bridge-main @@ -0,0 +1,7 @@ +DEVICE=br0 +ONBOOT=no +TYPE=Bridge +BOOTPROTO=dhcp +STP=on +DELAY=0 + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-interface b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-interface new file mode 100644 index 0000000000..6c841855ed --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-interface @@ -0,0 +1,7 @@ +DEVICE=eth1.43 +VLAN=yes +ONBOOT=yes +BOOTPROTO=none +IPADDR=192.168.43.149 +NETMASK=255.255.255.0 + diff --git a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index 70b58d424c..e19acb1311 100644 --- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -9282,6 +9282,87 @@ test_write_mobile_broadband (gboolean gsm) g_object_unref (connection); } +#define TEST_IFCFG_BRIDGE_MAIN TEST_IFCFG_DIR"/network-scripts/ifcfg-test-bridge-main" + +static void +test_read_bridge_main (void) +{ + NMConnection *connection; + char *unmanaged = NULL; + char *keyfile = NULL; + char *routefile = NULL; + char *route6file = NULL; + gboolean ignore_error = FALSE; + GError *error = NULL; + + connection = connection_from_file (TEST_IFCFG_BRIDGE_MAIN, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection == NULL, + "bridge-main-read", "unexpected success reading %s", TEST_IFCFG_BRIDGE_MAIN); +} + +#define TEST_IFCFG_BRIDGE_COMPONENT TEST_IFCFG_DIR"/network-scripts/ifcfg-test-bridge-component" + +static void +test_read_bridge_component (void) +{ + NMConnection *connection; + char *unmanaged = NULL; + char *keyfile = NULL; + char *routefile = NULL; + char *route6file = NULL; + gboolean ignore_error = FALSE; + GError *error = NULL; + + connection = connection_from_file (TEST_IFCFG_BRIDGE_COMPONENT, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection == NULL, + "bridge-component-read", "unexpected success reading %s", TEST_IFCFG_BRIDGE_COMPONENT); +} + +#define TEST_IFCFG_VLAN_INTERFACE TEST_IFCFG_DIR"/network-scripts/ifcfg-test-vlan-interface" + +static void +test_read_vlan_interface (void) +{ + NMConnection *connection; + char *unmanaged = NULL; + char *keyfile = NULL; + char *routefile = NULL; + char *route6file = NULL; + gboolean ignore_error = FALSE; + GError *error = NULL; + + connection = connection_from_file (TEST_IFCFG_VLAN_INTERFACE, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection == NULL, + "vlan-interface-read", "unexpected success reading %s", TEST_IFCFG_VLAN_INTERFACE); +} + #define TEST_IFCFG_WIFI_OPEN_SSID_BAD_HEX TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-open-ssid-bad-hex" #define TEST_IFCFG_WIFI_OPEN_SSID_LONG_QUOTED TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-open-ssid-long-quoted" #define TEST_IFCFG_WIFI_OPEN_SSID_LONG_HEX TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-open-ssid-long-hex" @@ -9411,6 +9492,9 @@ int main (int argc, char **argv) test_write_vpn (); test_write_mobile_broadband (TRUE); test_write_mobile_broadband (FALSE); + test_read_bridge_main (); + test_read_bridge_component (); + test_read_vlan_interface (); base = g_path_get_basename (argv[0]); fprintf (stdout, "%s: SUCCESS\n", base); -- cgit v1.2.1 From 863a757012117344bd9bc9c854c5190fd424a9bf Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 3 Aug 2010 16:26:07 -0700 Subject: nm-tool: silence annoying settings service warning User settings service isn't always running. --- test/nm-tool.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/nm-tool.c b/test/nm-tool.c index 700e1c430d..b1178eaf0e 100644 --- a/test/nm-tool.c +++ b/test/nm-tool.c @@ -643,8 +643,7 @@ get_connections_for_service (DBusGConnection *bus, G_TYPE_INVALID, DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH, &paths, G_TYPE_INVALID)) { - g_warning ("error: failed to read connections from %s:\n %s", - service, error ? error->message : "(unknown)"); + /* No connections or settings service may not be running */ g_clear_error (&error); goto out; } -- cgit v1.2.1 From 8053f42731442adf01a2c8013f795c0e27d7af11 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 3 Aug 2010 16:39:37 -0700 Subject: libnm-glib: fix retrieval of DHCP4 and DHCP6 options (rh #611141) Busted since 2008 apparently. Oops. --- libnm-glib/nm-dhcp4-config.c | 8 ++++---- libnm-glib/nm-dhcp6-config.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libnm-glib/nm-dhcp4-config.c b/libnm-glib/nm-dhcp4-config.c index c87feedf4f..442d19d192 100644 --- a/libnm-glib/nm-dhcp4-config.c +++ b/libnm-glib/nm-dhcp4-config.c @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2008 Red Hat, Inc. + * Copyright (C) 2008 - 2010 Red Hat, Inc. * Copyright (C) 2008 Novell, Inc. */ @@ -216,9 +216,9 @@ nm_dhcp4_config_get_options (NMDHCP4Config *config) return priv->options; if (!_nm_object_get_property (NM_OBJECT (config), - "org.freedesktop.DBus.Properties", - "Options", - &value)) + NM_DBUS_INTERFACE_DHCP4_CONFIG, + "Options", + &value)) goto out; demarshal_dhcp4_options (NM_OBJECT (config), NULL, &value, &priv->options); diff --git a/libnm-glib/nm-dhcp6-config.c b/libnm-glib/nm-dhcp6-config.c index 49eeda39ec..3792867207 100644 --- a/libnm-glib/nm-dhcp6-config.c +++ b/libnm-glib/nm-dhcp6-config.c @@ -216,9 +216,9 @@ nm_dhcp6_config_get_options (NMDHCP6Config *config) return priv->options; if (!_nm_object_get_property (NM_OBJECT (config), - "org.freedesktop.DBus.Properties", - "Options", - &value)) + NM_DBUS_INTERFACE_DHCP6_CONFIG, + "Options", + &value)) goto out; demarshal_dhcp6_options (NM_OBJECT (config), NULL, &value, &priv->options); -- cgit v1.2.1 From 2afcd8691b16a5eee27f553e73960eaaa67f22d5 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 3 Aug 2010 16:49:53 -0700 Subject: libnm-glib: fix retrieval of IPv6 addresses --- libnm-glib/nm-ip6-config.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libnm-glib/nm-ip6-config.c b/libnm-glib/nm-ip6-config.c index 1f2d13beff..fe71c1b8d3 100644 --- a/libnm-glib/nm-ip6-config.c +++ b/libnm-glib/nm-ip6-config.c @@ -162,9 +162,9 @@ nm_ip6_config_get_addresses (NMIP6Config *config) return priv->addresses; if (!_nm_object_get_property (NM_OBJECT (config), - "org.freedesktop.DBus.Properties", - "Addresses", - &value)) { + NM_DBUS_INTERFACE_IP6_CONFIG, + "Addresses", + &value)) { return NULL; } -- cgit v1.2.1 From 4e1eb09fed68eb6695cd774f0a8e655d3c65804b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 3 Aug 2010 17:07:38 -0700 Subject: core: quiet annoying libnl error about route deletion (rh #612991) --- src/nm-system.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nm-system.c b/src/nm-system.c index 3e490933f3..87e83a571b 100644 --- a/src/nm-system.c +++ b/src/nm-system.c @@ -1265,10 +1265,10 @@ check_one_route (struct nl_object *object, void *user_data) } err = rtnl_route_del (nm_netlink_get_default_handle (), route, 0); - if (err < 0) { + if (err < 0 && (err != -ERANGE)) { nm_log_err (LOGD_DEVICE, "(%s): error %d returned from rtnl_route_del(): %s", - data->iface, err, nl_geterror()); + data->iface, err, nl_geterror ()); } } -- cgit v1.2.1 From 75822319bd150a65d376a80723b9a814ec500735 Mon Sep 17 00:00:00 2001 From: Daniel Gnoutcheff Date: Wed, 4 Aug 2010 01:54:10 -0500 Subject: ifupdown: fix connection class inheritance NMIfupdownConnection really is a subclass of NMSysconfigConnection (as declared via the G_DEFINE_TYPE macro in nm-ifconfig-connection.c), but the header incorrectly used NMExportedConnection* in the class and instance structs. We got away with it because NMSysconfigConnection* didn't contain anything other than the stuff inherited from NMExportedConnection*, but it would have caused much trouble if we did add something. --- system-settings/plugins/ifupdown/nm-ifupdown-connection.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system-settings/plugins/ifupdown/nm-ifupdown-connection.h b/system-settings/plugins/ifupdown/nm-ifupdown-connection.h index 4eb20e5032..2aa74df6b7 100644 --- a/system-settings/plugins/ifupdown/nm-ifupdown-connection.h +++ b/system-settings/plugins/ifupdown/nm-ifupdown-connection.h @@ -39,11 +39,11 @@ G_BEGIN_DECLS #define NM_IFUPDOWN_CONNECTION_IFBLOCK "ifblock" typedef struct { - NMExportedConnection parent; + NMSysconfigConnection parent; } NMIfupdownConnection; typedef struct { - NMExportedConnectionClass parent; + NMSysconfigConnectionClass parent; } NMIfupdownConnectionClass; GType nm_ifupdown_connection_get_type (void); -- cgit v1.2.1 From b66d5dd3e665971e5498c89b795c04cad21bdd8d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 4 Aug 2010 16:01:01 -0500 Subject: ifcfg-rh: treat BRIDGE and VLAN connections as unmanaged (rh #619863) Treat them as unmanaged for now so that they dont' need NM_CONTROLLEd=no which would require further configuration when NM does start to support these configs. --- system-settings/plugins/ifcfg-rh/plugin.c | 2 +- system-settings/plugins/ifcfg-rh/reader.c | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/plugin.c b/system-settings/plugins/ifcfg-rh/plugin.c index 47ce0075f8..8a831228c2 100644 --- a/system-settings/plugins/ifcfg-rh/plugin.c +++ b/system-settings/plugins/ifcfg-rh/plugin.c @@ -146,7 +146,7 @@ read_one_connection (SCPluginIfcfg *plugin, const char *filename) if (nm_ifcfg_connection_get_unmanaged_spec (connection)) { PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "Ignoring connection '%s' and its " - "device because NM_CONTROLLED was false.", cid); + "device due to NM_CONTROLLED/BRIDGE/VLAN.", cid); g_signal_emit_by_name (plugin, NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED); } else { /* Wait for the connection to become unmanaged once it knows the diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index 51a2075a17..c016c124f5 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -3288,18 +3288,16 @@ connection_from_file (const char *filename, /* Ignore BRIDGE= and VLAN= connections for now too (rh #619863) */ tmp = svGetValue (parsed, "BRIDGE", FALSE); if (tmp) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, - "Bridge component connections are not yet supported"); g_free (tmp); - goto done; + nm_controlled = FALSE; } - tmp = svGetValue (parsed, "VLAN", FALSE); - if (tmp) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, - "VLAN connections are not yet supported"); - g_free (tmp); - goto done; + if (nm_controlled) { + tmp = svGetValue (parsed, "VLAN", FALSE); + if (tmp) { + g_free (tmp); + nm_controlled = FALSE; + } } /* Construct the connection */ -- cgit v1.2.1 From 49103db9791dd5580b61b6861345327600a6b3f1 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 4 Aug 2010 16:23:18 -0500 Subject: ifcfg-rh: require fewer parameters to connection_from_file() --- system-settings/plugins/ifcfg-rh/reader.c | 36 ++++++++++++++++++------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index c016c124f5..26a306661c 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -3192,7 +3192,7 @@ connection_from_file (const char *filename, char **keyfile, char **routefile, char **route6file, - GError **error, + GError **out_error, gboolean *ignore_error) { NMConnection *connection = NULL; @@ -3202,6 +3202,7 @@ connection_from_file (const char *filename, const char *ifcfg_name = NULL; gboolean nm_controlled = TRUE; gboolean ip6_used = FALSE; + GError *error = NULL; g_return_val_if_fail (filename != NULL, NULL); g_return_val_if_fail (unmanaged != NULL, NULL); @@ -3222,14 +3223,14 @@ connection_from_file (const char *filename, ifcfg_name = utils_get_ifcfg_name (filename, TRUE); if (!ifcfg_name) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (out_error, ifcfg_plugin_error_quark (), 0, "Ignoring connection '%s' because it's not an ifcfg file.", filename); return NULL; } parsed = svNewFile (filename); if (!parsed) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (out_error, ifcfg_plugin_error_quark (), 0, "Couldn't parse file '%s'", filename); return NULL; } @@ -3243,14 +3244,15 @@ connection_from_file (const char *filename, */ device = svGetValue (parsed, "DEVICE", FALSE); if (!device) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (&error, ifcfg_plugin_error_quark (), 0, "File '%s' had neither TYPE nor DEVICE keys.", filename); goto done; } if (!strcmp (device, "lo")) { - *ignore_error = TRUE; - g_set_error (error, ifcfg_plugin_error_quark (), 0, + if (ignore_error) + *ignore_error = TRUE; + g_set_error (&error, ifcfg_plugin_error_quark (), 0, "Ignoring loopback device config."); g_free (device); goto done; @@ -3302,14 +3304,14 @@ connection_from_file (const char *filename, /* Construct the connection */ if (!strcasecmp (type, TYPE_ETHERNET)) - connection = wired_connection_from_ifcfg (filename, parsed, nm_controlled, unmanaged, error); + connection = wired_connection_from_ifcfg (filename, parsed, nm_controlled, unmanaged, &error); else if (!strcasecmp (type, TYPE_WIRELESS)) - connection = wireless_connection_from_ifcfg (filename, parsed, nm_controlled, unmanaged, error); + connection = wireless_connection_from_ifcfg (filename, parsed, nm_controlled, unmanaged, &error); else if (!strcasecmp (type, TYPE_BRIDGE)) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (&error, ifcfg_plugin_error_quark (), 0, "Bridge connections are not yet supported"); } else { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (&error, ifcfg_plugin_error_quark (), 0, "Unknown connection type '%s'", type); } @@ -3324,8 +3326,8 @@ connection_from_file (const char *filename, if (!connection || *unmanaged) goto done; - s_ip6 = make_ip6_setting (parsed, network_file, iscsiadm_path, error); - if (*error) { + s_ip6 = make_ip6_setting (parsed, network_file, iscsiadm_path, &error); + if (error) { g_object_unref (connection); connection = NULL; goto done; @@ -3338,8 +3340,8 @@ connection_from_file (const char *filename, ip6_used = TRUE; } - s_ip4 = make_ip4_setting (parsed, network_file, iscsiadm_path, ip6_used, error); - if (*error) { + s_ip4 = make_ip4_setting (parsed, network_file, iscsiadm_path, ip6_used, &error); + if (error) { g_object_unref (connection); connection = NULL; goto done; @@ -3361,7 +3363,7 @@ connection_from_file (const char *filename, g_object_set (G_OBJECT (s_con), NM_SETTING_CONNECTION_READ_ONLY, TRUE, NULL); } - if (!nm_connection_verify (connection, error)) { + if (!nm_connection_verify (connection, &error)) { g_object_unref (connection); connection = NULL; } @@ -3372,6 +3374,10 @@ connection_from_file (const char *filename, done: svCloseFile (parsed); + if (error && out_error) + *out_error = error; + else + g_clear_error (&error); return connection; } -- cgit v1.2.1 From b103cd34fa4bba9c89a6d236d8ee17968a865716 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 4 Aug 2010 16:23:36 -0500 Subject: ifcfg-rh: be more careful about rewriting ifcfg files Kind of a hack for now, would be better to push down a flag about whether the update request came in from D-Bus, internally, or from inotify, but that's a lot more invasive. --- .../plugins/ifcfg-rh/nm-ifcfg-connection.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c b/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c index b54bc8af21..52ce6e152d 100644 --- a/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c +++ b/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c @@ -178,6 +178,25 @@ update (NMSettingsConnectionInterface *connection, { NMIfcfgConnectionPrivate *priv = NM_IFCFG_CONNECTION_GET_PRIVATE (connection); GError *error = NULL; + NMConnection *reread; + char *unmanaged = NULL, *keyfile = NULL, *routefile = NULL, *route6file = NULL; + + /* To ensure we don't rewrite files that are only changed from other + * processes on-disk, read the existing connection back in and only rewrite + * it if it's really changed. + */ + reread = connection_from_file (priv->filename, NULL, NULL, NULL, + &unmanaged, &keyfile, &routefile, &route6file, + NULL, NULL); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); + + if (reread && nm_connection_compare (NM_CONNECTION (connection), + reread, + NM_SETTING_COMPARE_FLAG_EXACT)) + goto out; if (!writer_update_connection (NM_CONNECTION (connection), IFCFG_DIR, @@ -189,6 +208,9 @@ update (NMSettingsConnectionInterface *connection, return FALSE; } +out: + if (reread) + g_object_unref (reread); return parent_settings_connection_iface->update (connection, callback, user_data); } -- cgit v1.2.1 From 5e88c459255c6962dae25dc8d72710a087b1bf95 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 4 Aug 2010 16:27:34 -0500 Subject: ifcfg-rh: use IFCFG_PLUGIN_ERROR instead of ifcfg_plugin_error_quark () Trivial cleanup. --- system-settings/plugins/ifcfg-rh/common.h | 1 + system-settings/plugins/ifcfg-rh/reader.c | 158 +++++++++++++++--------------- system-settings/plugins/ifcfg-rh/writer.c | 52 +++++----- 3 files changed, 106 insertions(+), 105 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/common.h b/system-settings/plugins/ifcfg-rh/common.h index 9c578db092..921f7f73df 100644 --- a/system-settings/plugins/ifcfg-rh/common.h +++ b/system-settings/plugins/ifcfg-rh/common.h @@ -43,6 +43,7 @@ #define TYPE_WIRELESS "Wireless" #define TYPE_BRIDGE "Bridge" +#define IFCFG_PLUGIN_ERROR (ifcfg_plugin_error_quark ()) GQuark ifcfg_plugin_error_quark (void); diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index 26a306661c..1e5797a537 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -205,7 +205,7 @@ read_mac_address (shvarFile *ifcfg, const char *key, GByteArray **array, GError mac = ether_aton (value); if (!mac) { g_free (value); - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "%s: the MAC address '%s' was invalid.", key, value); return FALSE; } @@ -282,13 +282,13 @@ fill_ip4_setting_from_ibft (shvarFile *ifcfg, return FALSE; if (!WIFEXITED (status)) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "%s exited abnormally.", iscsiadm_path); goto done; } if (WEXITSTATUS (status) != 0) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "%s exited with error %d. Message: '%s'", iscsiadm_path, WEXITSTATUS (status), err ? err : "(none)"); goto done; @@ -298,7 +298,7 @@ fill_ip4_setting_from_ibft (shvarFile *ifcfg, goto done; /* Ensure we got a MAC */ if (!ifcfg_mac) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing device MAC address (no HWADDR tag present)."); goto done; } @@ -488,7 +488,7 @@ read_ip4_address (shvarFile *ifcfg, *out_addr = ip4_addr.s_addr; success = TRUE; } else { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid %s IP4 address '%s'", tag, value); } g_free (value); @@ -514,7 +514,7 @@ parse_ip6_address (const char *value, *out_addr = ip6_addr; success = TRUE; } else { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid IP6 address '%s'", value); } return success; @@ -588,7 +588,7 @@ read_full_ip4_address (shvarFile *ifcfg, errno = 0; prefix = strtol (value, NULL, 10); if (errno || prefix <= 0 || prefix > 32) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid IP4 prefix '%s'", value); g_free (value); goto error; @@ -619,7 +619,7 @@ read_full_ip4_address (shvarFile *ifcfg, /* Validate the prefix */ if (nm_ip4_address_get_prefix (addr) > 32) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing or invalid IP4 prefix '%d'", nm_ip4_address_get_prefix (addr)); goto error; @@ -683,7 +683,7 @@ read_one_ip4_route (shvarFile *ifcfg, if (!read_ip4_address (ifcfg, gw_tag, &tmp, error)) goto out; if (!tmp) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing or invalid IP4 gateway address '%d'", tmp); goto out; @@ -698,7 +698,7 @@ read_one_ip4_route (shvarFile *ifcfg, /* Validate the prefix */ if ( !nm_ip4_route_get_prefix (route) || nm_ip4_route_get_prefix (route) > 32) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing or invalid IP4 prefix '%d'", nm_ip4_route_get_prefix (route)); goto out; @@ -712,7 +712,7 @@ read_one_ip4_route (shvarFile *ifcfg, errno = 0; metric = strtol (value, NULL, 10); if (errno || metric < 0) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid IP4 route metric '%s'", value); g_free (value); goto out; @@ -796,7 +796,7 @@ read_route_file_legacy (const char *filename, NMSettingIP4Config *s_ip4, GError g_regex_match (regex_to2, *iter, 0, &match_info); if (!g_match_info_matches (match_info)) { g_match_info_free (match_info); - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing IP4 route destination address in record: '%s'", *iter); goto error; } @@ -806,7 +806,7 @@ read_route_file_legacy (const char *filename, NMSettingIP4Config *s_ip4, GError if (!strcmp (dest, "default")) strcpy (dest, "0.0.0.0"); if (inet_pton (AF_INET, dest, &ip4_addr) != 1) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid IP4 route destination address '%s'", dest); g_free (dest); goto error; @@ -821,7 +821,7 @@ read_route_file_legacy (const char *filename, NMSettingIP4Config *s_ip4, GError errno = 0; prefix_int = strtol (prefix, NULL, 10); if (errno || prefix_int < 0 || prefix_int > 32) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid IP4 route destination prefix '%s'", prefix); g_free (prefix); goto error; @@ -835,14 +835,14 @@ read_route_file_legacy (const char *filename, NMSettingIP4Config *s_ip4, GError g_regex_match (regex_via, *iter, 0, &match_info); if (!g_match_info_matches (match_info)) { g_match_info_free (match_info); - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing IP4 route gateway address in record: '%s'", *iter); goto error; } next_hop = g_match_info_fetch (match_info, 1); g_match_info_free (match_info); if (inet_pton (AF_INET, next_hop, &ip4_addr) != 1) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid IP4 route gateway address '%s'", next_hop); g_free (next_hop); goto error; @@ -859,7 +859,7 @@ read_route_file_legacy (const char *filename, NMSettingIP4Config *s_ip4, GError metric_int = strtol (metric, NULL, 10); if (errno || metric_int < 0) { g_match_info_free (match_info); - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid IP4 route metric '%s'", metric); g_free (metric); goto error; @@ -905,7 +905,7 @@ parse_full_ip6_address (const char *addr_str, GError **error) /* Split the adddress and prefix */ list = g_strsplit_set (addr_str, "/", 2); if (g_strv_length (list) < 1) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid IP6 address '%s'", addr_str); goto error; } @@ -929,7 +929,7 @@ parse_full_ip6_address (const char *addr_str, GError **error) errno = 0; prefix = strtol (prefix_tag, NULL, 10); if (errno || prefix <= 0 || prefix > 128) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid IP6 prefix '%s'", prefix_tag); goto error; } @@ -1018,7 +1018,7 @@ read_route6_file (const char *filename, NMSettingIP6Config *s_ip6, GError **erro g_regex_match (regex_to2, *iter, 0, &match_info); if (!g_match_info_matches (match_info)) { g_match_info_free (match_info); - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing IP6 route destination address in record: '%s'", *iter); goto error; } @@ -1028,7 +1028,7 @@ read_route6_file (const char *filename, NMSettingIP6Config *s_ip6, GError **erro if (!strcmp (dest, "default")) strcpy (dest, "::"); if (inet_pton (AF_INET6, dest, &ip6_addr) != 1) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid IP6 route destination address '%s'", dest); g_free (dest); goto error; @@ -1043,7 +1043,7 @@ read_route6_file (const char *filename, NMSettingIP6Config *s_ip6, GError **erro errno = 0; prefix_int = strtol (prefix, NULL, 10); if (errno || prefix_int < 0 || prefix_int > 128) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid IP6 route destination prefix '%s'", prefix); g_free (prefix); goto error; @@ -1057,14 +1057,14 @@ read_route6_file (const char *filename, NMSettingIP6Config *s_ip6, GError **erro g_regex_match (regex_via, *iter, 0, &match_info); if (!g_match_info_matches (match_info)) { g_match_info_free (match_info); - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing IP6 route gateway address in record: '%s'", *iter); goto error; } next_hop = g_match_info_fetch (match_info, 1); g_match_info_free (match_info); if (inet_pton (AF_INET6, next_hop, &ip6_addr) != 1) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid IP6 route gateway address '%s'", next_hop); g_free (next_hop); goto error; @@ -1081,7 +1081,7 @@ read_route6_file (const char *filename, NMSettingIP6Config *s_ip6, GError **erro metric_int = strtol (metric, NULL, 10); if (errno || metric_int < 0 || metric_int > G_MAXUINT32) { g_match_info_free (match_info); - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid IP6 route metric '%s'", metric); g_free (metric); goto error; @@ -1129,7 +1129,7 @@ make_ip4_setting (shvarFile *ifcfg, s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); if (!s_ip4) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Could not allocate IP4 setting"); return NULL; } @@ -1190,7 +1190,7 @@ make_ip4_setting (shvarFile *ifcfg, } else if (!g_ascii_strcasecmp (value, "none") || !g_ascii_strcasecmp (value, "static")) { /* Static IP */ } else if (strlen (value)) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Unknown BOOTPROTO '%s'", value); g_free (value); goto done; @@ -1317,7 +1317,7 @@ make_ip4_setting (shvarFile *ifcfg, /* Static routes - route- file */ route_path = utils_get_route_path (ifcfg->fileName); if (!route_path) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Could not get route file path for '%s'", ifcfg->fileName); goto done; } @@ -1397,7 +1397,7 @@ make_ip6_setting (shvarFile *ifcfg, s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); if (!s_ip6) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Could not allocate IP6 setting"); return NULL; } @@ -1562,7 +1562,7 @@ make_ip6_setting (shvarFile *ifcfg, /* Read static routes from route6- file */ route6_path = utils_get_route6_path (ifcfg->fileName); if (!route6_path) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Could not get route6 file path for '%s'", ifcfg->fileName); goto error; } @@ -1618,7 +1618,7 @@ add_one_wep_key (shvarFile *ifcfg, while (*p) { if (!g_ascii_isxdigit (*p)) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid hexadecimal WEP key."); goto out; } @@ -1632,7 +1632,7 @@ add_one_wep_key (shvarFile *ifcfg, while (*p) { if (!isascii ((int) (*p))) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid ASCII WEP key."); goto out; } @@ -1653,7 +1653,7 @@ add_one_wep_key (shvarFile *ifcfg, nm_setting_wireless_security_set_wep_key (s_wsec, key_idx, key); success = TRUE; } else - g_set_error (error, ifcfg_plugin_error_quark (), 0, "Invalid WEP key length."); + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid WEP key length."); out: g_free (value); @@ -1713,7 +1713,7 @@ make_wep_setting (shvarFile *ifcfg, default_key_idx--; /* convert to [0...3] */ g_object_set (s_wireless_sec, NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX, default_key_idx, NULL); } else { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid default WEP key '%s'", value); g_free (value); goto error; @@ -1738,15 +1738,15 @@ make_wep_setting (shvarFile *ifcfg, /* If there's a default key, ensure that key exists */ if ((default_key_idx == 1) && !nm_setting_wireless_security_get_wep_key (s_wireless_sec, 1)) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Default WEP key index was 2, but no valid KEY2 exists."); goto error; } else if ((default_key_idx == 2) && !nm_setting_wireless_security_get_wep_key (s_wireless_sec, 2)) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Default WEP key index was 3, but no valid KEY3 exists."); goto error; } else if ((default_key_idx == 3) && !nm_setting_wireless_security_get_wep_key (s_wireless_sec, 3)) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Default WEP key index was 4, but no valid KEY4 exists."); goto error; } @@ -1763,7 +1763,7 @@ make_wep_setting (shvarFile *ifcfg, } else if (!strcmp (lcase, "restricted")) { g_object_set (s_wireless_sec, NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "shared", NULL); } else { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid WEP authentication algorithm '%s'", lcase); g_free (lcase); @@ -1781,7 +1781,7 @@ make_wep_setting (shvarFile *ifcfg, auth_alg = nm_setting_wireless_security_get_auth_alg (s_wireless_sec); if (auth_alg && !strcmp (auth_alg, "shared")) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "WEP Shared Key authentication is invalid for " "unencrypted connections."); goto error; @@ -1895,7 +1895,7 @@ parse_wpa_psk (shvarFile *ifcfg, psk = svGetValue (ifcfg, "WPA_PSK", TRUE); if (!psk) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing WPA_PSK for WPA-PSK key management"); return NULL; } @@ -1909,7 +1909,7 @@ parse_wpa_psk (shvarFile *ifcfg, /* Verify the hex PSK; 64 digits */ while (*p) { if (!isxdigit (*p++)) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid WPA_PSK (contains non-hexadecimal characters)"); goto out; } @@ -1930,7 +1930,7 @@ parse_wpa_psk (shvarFile *ifcfg, /* Length check */ if (strlen (p) < 8 || strlen (p) > 63) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid WPA_PSK (passphrases must be between " "8 and 63 characters long (inclusive))"); goto out; @@ -1940,7 +1940,7 @@ parse_wpa_psk (shvarFile *ifcfg, } if (!hashed) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid WPA_PSK (doesn't look like a passphrase or hex key)"); goto out; } @@ -1986,7 +1986,7 @@ eap_simple_reader (const char *eap_method, value = svGetValue (ifcfg, "IEEE_8021X_IDENTITY", FALSE); if (!value) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing IEEE_8021X_IDENTITY for EAP method '%s'.", eap_method); return FALSE; @@ -2001,7 +2001,7 @@ eap_simple_reader (const char *eap_method, } if (!value) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing IEEE_8021X_PASSWORD for EAP method '%s'.", eap_method); return FALSE; @@ -2054,7 +2054,7 @@ eap_tls_reader (const char *eap_method, value = svGetValue (ifcfg, "IEEE_8021X_IDENTITY", FALSE); if (!value) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing IEEE_8021X_IDENTITY for EAP method '%s'.", eap_method); return FALSE; @@ -2101,7 +2101,7 @@ eap_tls_reader (const char *eap_method, } if (!privkey_password) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing %s for EAP method '%s'.", phase2 ? "IEEE_8021X_INNER_PRIVATE_KEY_PASSWORD" : "IEEE_8021X_PRIVATE_KEY_PASSWORD", eap_method); @@ -2113,7 +2113,7 @@ eap_tls_reader (const char *eap_method, phase2 ? "IEEE_8021X_INNER_PRIVATE_KEY" : "IEEE_8021X_PRIVATE_KEY", FALSE); if (!privkey) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing %s for EAP method '%s'.", phase2 ? "IEEE_8021X_INNER_PRIVATE_KEY" : "IEEE_8021X_PRIVATE_KEY", eap_method); @@ -2151,7 +2151,7 @@ eap_tls_reader (const char *eap_method, phase2 ? "IEEE_8021X_INNER_CLIENT_CERT" : "IEEE_8021X_CLIENT_CERT", FALSE); if (!client_cert) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing %s for EAP method '%s'.", phase2 ? "IEEE_8021X_INNER_CLIENT_CERT" : "IEEE_8021X_CLIENT_CERT", eap_method); @@ -2227,7 +2227,7 @@ eap_peap_reader (const char *eap_method, else if (!strcmp (peapver, "1")) g_object_set (s_8021x, NM_SETTING_802_1X_PHASE1_PEAPVER, "1", NULL); else { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Unknown IEEE_8021X_PEAP_VERSION value '%s'", peapver); goto done; @@ -2239,7 +2239,7 @@ eap_peap_reader (const char *eap_method, inner_auth = svGetValue (ifcfg, "IEEE_8021X_INNER_AUTH_METHODS", FALSE); if (!inner_auth) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing IEEE_8021X_INNER_AUTH_METHODS."); goto done; } @@ -2259,7 +2259,7 @@ eap_peap_reader (const char *eap_method, if (!eap_tls_reader (*iter, ifcfg, keys, s_8021x, TRUE, error)) goto done; } else { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Unknown IEEE_8021X_INNER_AUTH_METHOD '%s'.", *iter); goto done; @@ -2272,7 +2272,7 @@ eap_peap_reader (const char *eap_method, } if (!nm_setting_802_1x_get_phase2_auth (s_8021x)) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "No valid IEEE_8021X_INNER_AUTH_METHODS found."); goto done; } @@ -2327,7 +2327,7 @@ eap_ttls_reader (const char *eap_method, tmp = svGetValue (ifcfg, "IEEE_8021X_INNER_AUTH_METHODS", FALSE); if (!tmp) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing IEEE_8021X_INNER_AUTH_METHODS."); goto done; } @@ -2357,7 +2357,7 @@ eap_ttls_reader (const char *eap_method, goto done; g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTHEAP, (*iter + strlen ("eap-")), NULL); } else { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Unknown IEEE_8021X_INNER_AUTH_METHOD '%s'.", *iter); goto done; @@ -2391,7 +2391,7 @@ fill_8021x (shvarFile *ifcfg, value = svGetValue (ifcfg, "IEEE_8021X_EAP_METHODS", FALSE); if (!value) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing IEEE_8021X_EAP_METHODS for key management '%s'", key_mgmt); return NULL; @@ -2449,7 +2449,7 @@ fill_8021x (shvarFile *ifcfg, g_strfreev (list); if (nm_setting_802_1x_get_num_eap_methods (s_8021x) == 0) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "No valid EAP methods found in IEEE_8021X_EAP_METHODS."); goto error; } @@ -2527,7 +2527,7 @@ make_wpa_setting (shvarFile *ifcfg, } else if (!strcmp (value, "WPA-EAP") || !strcmp (value, "IEEE8021X")) { /* Adhoc mode is mutually exclusive with any 802.1x-based authentication */ if (adhoc) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Ad-Hoc mode cannot be used with KEY_MGMT type '%s'", value); goto error; } @@ -2540,7 +2540,7 @@ make_wpa_setting (shvarFile *ifcfg, g_object_set (wsec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, lower, NULL); g_free (lower); } else { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Unknown wireless KEY_MGMT type '%s'", value); goto error; } @@ -2592,7 +2592,7 @@ make_leap_setting (shvarFile *ifcfg, value = svGetValue (ifcfg, "IEEE_8021X_IDENTITY", FALSE); if (!value || !strlen (value)) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing LEAP identity"); goto error; } @@ -2707,7 +2707,7 @@ make_wireless_setting (shvarFile *ifcfg, } else if ((value_len > 2) && (strncmp (value, "0x", 2) == 0)) { /* Hex representation */ if (value_len % 2) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid SSID '%s' size (looks like hex but length not multiple of 2)", value); g_free (value); @@ -2717,7 +2717,7 @@ make_wireless_setting (shvarFile *ifcfg, p = value + 2; while (*p) { if (!isxdigit (*p)) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid SSID '%s' character (looks like hex SSID but '%c' isn't a hex digit)", value, *p); g_free (value); @@ -2733,7 +2733,7 @@ make_wireless_setting (shvarFile *ifcfg, } if (ssid_len > 32 || ssid_len == 0) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid SSID '%s' (size %zu not between 1 and 32 inclusive)", value, ssid_len); g_free (value); @@ -2748,7 +2748,7 @@ make_wireless_setting (shvarFile *ifcfg, } else { /* Only fail on lack of SSID if device is managed */ if (nm_controlled) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, "Missing SSID"); + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing SSID"); goto error; } } @@ -2769,7 +2769,7 @@ make_wireless_setting (shvarFile *ifcfg, } else if (!strcmp (lcase, "managed") || !strcmp (lcase, "auto")) { mode = "infrastructure"; } else { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid mode '%s' (not 'Ad-Hoc', 'Managed', or 'Auto')", lcase); g_free (lcase); @@ -2787,7 +2787,7 @@ make_wireless_setting (shvarFile *ifcfg, eth = ether_aton (value); if (!eth) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid BSSID '%s'", value); goto error; } @@ -2805,7 +2805,7 @@ make_wireless_setting (shvarFile *ifcfg, errno = 0; chan = strtol (value, NULL, 10); if (errno || chan <= 0 || chan > 196) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid wireless channel '%s'", value); g_free (value); goto error; @@ -2824,7 +2824,7 @@ make_wireless_setting (shvarFile *ifcfg, errno = 0; mtu = strtol (value, NULL, 10); if (errno || mtu < 0 || mtu > 50000) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid wireless MTU '%s'", value); g_free (value); goto error; @@ -2865,7 +2865,7 @@ wireless_connection_from_ifcfg (const char *file, connection = nm_connection_new (); if (!connection) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Failed to allocate new connection for %s.", file); return NULL; } @@ -2911,7 +2911,7 @@ wireless_connection_from_ifcfg (const char *file, printable_ssid); g_free (printable_ssid); if (!con_setting) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Failed to create connection setting."); g_object_unref (connection); return NULL; @@ -3078,7 +3078,7 @@ make_wired_setting (shvarFile *ifcfg, if (!*s_8021x) goto error; } else { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Unknown wired KEY_MGMT type '%s'", value); goto error; } @@ -3110,14 +3110,14 @@ wired_connection_from_ifcfg (const char *file, connection = nm_connection_new (); if (!connection) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Failed to allocate new connection for %s.", file); return NULL; } con_setting = make_connection_setting (file, ifcfg, NM_SETTING_WIRED_SETTING_NAME, NULL); if (!con_setting) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Failed to create connection setting."); g_object_unref (connection); return NULL; @@ -3223,14 +3223,14 @@ connection_from_file (const char *filename, ifcfg_name = utils_get_ifcfg_name (filename, TRUE); if (!ifcfg_name) { - g_set_error (out_error, ifcfg_plugin_error_quark (), 0, + g_set_error (out_error, IFCFG_PLUGIN_ERROR, 0, "Ignoring connection '%s' because it's not an ifcfg file.", filename); return NULL; } parsed = svNewFile (filename); if (!parsed) { - g_set_error (out_error, ifcfg_plugin_error_quark (), 0, + g_set_error (out_error, IFCFG_PLUGIN_ERROR, 0, "Couldn't parse file '%s'", filename); return NULL; } @@ -3244,7 +3244,7 @@ connection_from_file (const char *filename, */ device = svGetValue (parsed, "DEVICE", FALSE); if (!device) { - g_set_error (&error, ifcfg_plugin_error_quark (), 0, + g_set_error (&error, IFCFG_PLUGIN_ERROR, 0, "File '%s' had neither TYPE nor DEVICE keys.", filename); goto done; } @@ -3252,7 +3252,7 @@ connection_from_file (const char *filename, if (!strcmp (device, "lo")) { if (ignore_error) *ignore_error = TRUE; - g_set_error (&error, ifcfg_plugin_error_quark (), 0, + g_set_error (&error, IFCFG_PLUGIN_ERROR, 0, "Ignoring loopback device config."); g_free (device); goto done; @@ -3308,10 +3308,10 @@ connection_from_file (const char *filename, else if (!strcasecmp (type, TYPE_WIRELESS)) connection = wireless_connection_from_ifcfg (filename, parsed, nm_controlled, unmanaged, &error); else if (!strcasecmp (type, TYPE_BRIDGE)) { - g_set_error (&error, ifcfg_plugin_error_quark (), 0, + g_set_error (&error, IFCFG_PLUGIN_ERROR, 0, "Bridge connections are not yet supported"); } else { - g_set_error (&error, ifcfg_plugin_error_quark (), 0, + g_set_error (&error, IFCFG_PLUGIN_ERROR, 0, "Unknown connection type '%s'", type); } diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c index 8f1f74b57e..75fbca69e8 100644 --- a/system-settings/plugins/ifcfg-rh/writer.c +++ b/system-settings/plugins/ifcfg-rh/writer.c @@ -90,7 +90,7 @@ write_secret_file (const char *path, tmppath = g_malloc0 (strlen (path) + 10); if (!tmppath) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Could not allocate memory for temporary file for '%s'", path); return FALSE; @@ -102,7 +102,7 @@ write_secret_file (const char *path, errno = 0; fd = mkstemp (tmppath); if (fd < 0) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Could not create temporary file for '%s': %d", path, errno); goto out; @@ -113,7 +113,7 @@ write_secret_file (const char *path, if (fchmod (fd, S_IRUSR | S_IWUSR)) { close (fd); unlink (tmppath); - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Could not set permissions for temporary file '%s': %d", path, errno); goto out; @@ -124,7 +124,7 @@ write_secret_file (const char *path, if (written != len) { close (fd); unlink (tmppath); - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Could not write temporary file for '%s': %d", path, errno); goto out; @@ -135,7 +135,7 @@ write_secret_file (const char *path, errno = 0; if (rename (tmppath, path)) { unlink (tmppath); - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Could not rename temporary file to '%s': %d", path, errno); goto out; @@ -302,7 +302,7 @@ write_object (NMSetting8021x *s_8021x, new_file = utils_cert_path (ifcfg->fileName, objtype->suffix); if (!new_file) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Could not create file path for %s / %s", NM_SETTING_802_1X_SETTING_NAME, objtype->setting_key); return FALSE; @@ -317,7 +317,7 @@ write_object (NMSetting8021x *s_8021x, svSetValue (ifcfg, objtype->ifcfg_key, new_file, FALSE); return TRUE; } else { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Could not write certificate/key for %s / %s: %s", NM_SETTING_802_1X_SETTING_NAME, objtype->setting_key, (write_error && write_error->message) ? write_error->message : "(unknown)"); @@ -535,7 +535,7 @@ write_wireless_security_setting (NMConnection *connection, s_wsec = (NMSettingWirelessSecurity *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY); if (!s_wsec) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing '%s' setting", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); return FALSE; } @@ -712,7 +712,7 @@ write_wireless_setting (NMConnection *connection, s_wireless = (NMSettingWireless *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS); if (!s_wireless) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing '%s' setting", NM_SETTING_WIRELESS_SETTING_NAME); return FALSE; } @@ -747,12 +747,12 @@ write_wireless_setting (NMConnection *connection, ssid = nm_setting_wireless_get_ssid (s_wireless); if (!ssid) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing SSID in '%s' setting", NM_SETTING_WIRELESS_SETTING_NAME); return FALSE; } if (!ssid->len || ssid->len > 32) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid SSID in '%s' setting", NM_SETTING_WIRELESS_SETTING_NAME); return FALSE; } @@ -802,7 +802,7 @@ write_wireless_setting (NMConnection *connection, svSetValue (ifcfg, "MODE", "Ad-Hoc", FALSE); adhoc = TRUE; } else { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Invalid mode '%s' in '%s' setting", mode, NM_SETTING_WIRELESS_SETTING_NAME); return FALSE; @@ -849,7 +849,7 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) s_wired = (NMSettingWired *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED); if (!s_wired) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing '%s' setting", NM_SETTING_WIRED_SETTING_NAME); return FALSE; } @@ -998,7 +998,7 @@ write_route_file_legacy (const char *filename, NMSettingIP4Config *s_ip4, GError g_strfreev (route_items); if (!g_file_set_contents (filename, route_contents, -1, NULL)) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Writing route file '%s' failed", filename); goto error; } @@ -1181,7 +1181,7 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) /* Static routes - route- file */ route_path = utils_get_route_path (ifcfg->fileName); if (!route_path) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Could not get route file path for '%s'", ifcfg->fileName); goto out; } @@ -1192,7 +1192,7 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) g_free (route_path); routefile = utils_get_route_ifcfg (ifcfg->fileName, TRUE); if (!routefile) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Could not create route file '%s'", routefile->fileName); goto out; } @@ -1248,7 +1248,7 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) g_free (metric_key); } if (svWriteFile (routefile, 0644)) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Could not update route file '%s'", routefile->fileName); svCloseFile (routefile); goto out; @@ -1314,7 +1314,7 @@ write_route6_file (const char *filename, NMSettingIP6Config *s_ip6, GError **err g_strfreev (route_items); if (!g_file_set_contents (filename, route_contents, -1, NULL)) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Writing route6 file '%s' failed", filename); goto error; } @@ -1343,7 +1343,7 @@ write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); if (!s_ip6) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing '%s' setting", NM_SETTING_IP6_CONFIG_SETTING_NAME); return FALSE; } @@ -1471,7 +1471,7 @@ write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) /* Static routes go to route6- file */ route6_path = utils_get_route6_path (ifcfg->fileName); if (!route6_path) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Could not get route6 file path for '%s'", ifcfg->fileName); goto error; } @@ -1525,7 +1525,7 @@ write_connection (NMConnection *connection, s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); if (!s_con) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing '%s' setting", NM_SETTING_CONNECTION_SETTING_NAME); return FALSE; } @@ -1544,14 +1544,14 @@ write_connection (NMConnection *connection, } if (!ifcfg) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Failed to open/create ifcfg file '%s'", ifcfg_name); goto out; } type = nm_setting_connection_get_connection_type (s_con); if (!type) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Missing connection type!"); goto out; } @@ -1559,7 +1559,7 @@ write_connection (NMConnection *connection, if (!strcmp (type, NM_SETTING_WIRED_SETTING_NAME)) { // FIXME: can't write PPPoE at this time if (nm_connection_get_setting (connection, NM_TYPE_SETTING_PPPOE)) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Can't write connection type '%s'", NM_SETTING_PPPOE_SETTING_NAME); goto out; @@ -1572,7 +1572,7 @@ write_connection (NMConnection *connection, if (!write_wireless_setting (connection, ifcfg, &no_8021x, error)) goto out; } else { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Can't write connection type '%s'", type); goto out; } @@ -1594,7 +1594,7 @@ write_connection (NMConnection *connection, write_connection_setting (s_con, ifcfg); if (svWriteFile (ifcfg, 0644)) { - g_set_error (error, ifcfg_plugin_error_quark (), 0, + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Can't write connection '%s'", ifcfg->fileName); goto out; } -- cgit v1.2.1 From 007e134594fc3129d001f370dd40d8d8356690fc Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 4 Aug 2010 16:42:13 -0500 Subject: ifcfg-rh: testcases for unmanaged BRIDGE and VLAN --- .../tests/network-scripts/ifcfg-test-vlan-interface | 1 + system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-interface b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-interface index 6c841855ed..6af42768bc 100644 --- a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-interface +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-interface @@ -1,4 +1,5 @@ DEVICE=eth1.43 +HWADDR=00:22:15:59:62:97 VLAN=yes ONBOOT=yes BOOTPROTO=none diff --git a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index e19acb1311..e4a42f77bf 100644 --- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -9332,8 +9332,12 @@ test_read_bridge_component (void) &route6file, &error, &ignore_error); - ASSERT (connection == NULL, - "bridge-component-read", "unexpected success reading %s", TEST_IFCFG_BRIDGE_COMPONENT); + ASSERT (connection != NULL, + "bridge-component-read", "unexpected failure reading %s", TEST_IFCFG_BRIDGE_COMPONENT); + ASSERT (unmanaged != NULL, + "bridge-component-read", "unexpected managed device reading %s", TEST_IFCFG_BRIDGE_COMPONENT); + ASSERT (strcmp (unmanaged, "mac:00:22:15:59:62:97") == 0, + "bridge-component-read", "expected unmanaged device reading %s", TEST_IFCFG_BRIDGE_COMPONENT); } #define TEST_IFCFG_VLAN_INTERFACE TEST_IFCFG_DIR"/network-scripts/ifcfg-test-vlan-interface" @@ -9359,8 +9363,14 @@ test_read_vlan_interface (void) &route6file, &error, &ignore_error); - ASSERT (connection == NULL, - "vlan-interface-read", "unexpected success reading %s", TEST_IFCFG_VLAN_INTERFACE); + ASSERT (connection != NULL, + "vlan-interface-read", "unexpected failure reading %s", TEST_IFCFG_VLAN_INTERFACE); + ASSERT (unmanaged != NULL, + "vlan-interface-read", "unexpected managed device reading %s", TEST_IFCFG_VLAN_INTERFACE); + ASSERT (strcmp (unmanaged, "mac:00:22:15:59:62:97") == 0, + "vlan-interface-read", "expected unmanaged device reading %s", TEST_IFCFG_VLAN_INTERFACE); + + g_object_unref (connection); } #define TEST_IFCFG_WIFI_OPEN_SSID_BAD_HEX TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-open-ssid-bad-hex" -- cgit v1.2.1 From 4cdf7468d38cda6276c9a2e9a467d72867c5505c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 4 Aug 2010 16:55:07 -0500 Subject: ifcfg-rh: ensure BRIDGE and VLAN connections get completely ignored Unlike NM_CONTROLLED=no connections we don't even want to both with these when their devices aren't supposed to be managed. --- system-settings/plugins/ifcfg-rh/reader.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index 1e5797a537..91462cd3ea 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -3203,6 +3203,7 @@ connection_from_file (const char *filename, gboolean nm_controlled = TRUE; gboolean ip6_used = FALSE; GError *error = NULL; + gboolean ignore_connection = FALSE; g_return_val_if_fail (filename != NULL, NULL); g_return_val_if_fail (unmanaged != NULL, NULL); @@ -3292,6 +3293,7 @@ connection_from_file (const char *filename, if (tmp) { g_free (tmp); nm_controlled = FALSE; + ignore_connection = TRUE; } if (nm_controlled) { @@ -3299,6 +3301,7 @@ connection_from_file (const char *filename, if (tmp) { g_free (tmp); nm_controlled = FALSE; + ignore_connection = TRUE; } } @@ -3323,8 +3326,13 @@ connection_from_file (const char *filename, g_free (type); /* Don't bother reading the connection fully if it's unmanaged */ - if (!connection || *unmanaged) + if (!connection || *unmanaged || ignore_connection) { + if (connection && ignore_connection) { + g_object_unref (connection); + connection = NULL; + } goto done; + } s_ip6 = make_ip6_setting (parsed, network_file, iscsiadm_path, &error); if (error) { -- cgit v1.2.1 From 0ebeaaf1cbc90e4da792b93e66780ea73917d202 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 4 Aug 2010 16:58:56 -0500 Subject: ifcfg-rh: clarify comment about unmanaged connections --- system-settings/plugins/ifcfg-rh/reader.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index 91462cd3ea..a8ce149467 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -3325,7 +3325,10 @@ connection_from_file (const char *filename, g_free (type); - /* Don't bother reading the connection fully if it's unmanaged */ + /* Don't bother reading the connection fully if it's unmanaged. As a + * special-case, BRIDGE= and VLAN= connections are completely ignored so + * that ifup gets an error when it tries to ask NM about them. + */ if (!connection || *unmanaged || ignore_connection) { if (connection && ignore_connection) { g_object_unref (connection); -- cgit v1.2.1 From 91e90d9d5412223e0252ccff0e3732afae201af6 Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Thu, 5 Aug 2010 15:25:12 -0500 Subject: build: fix dhcpcd client detection --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 9c260fb2de..b1d16f252e 100644 --- a/configure.ac +++ b/configure.ac @@ -344,10 +344,10 @@ case "${with_dhcpcd}" in AC_MSG_CHECKING(for dhcpcd) # We fully work with upstream dhcpcd-4 for path in /sbin /usr/sbin /usr/pkg/sbin /usr/local/sbin; do - test -x "${path}/dhclient" || continue + test -x "${path}/dhcpcd" || continue case `"$path/dhcpcd" --version 2>/dev/null` in "dhcpcd "[123]*);; - "dhcpcd "*) DHCP_CLIENT_PATH="$path/dhcpcd"; break;; + "dhcpcd "*) DHCPCD_PATH="$path/dhcpcd"; break;; esac done if test -n "${DHCPCD_PATH}"; then @@ -364,7 +364,7 @@ if test -z "$DHCPCD_PATH" -a -z "$DHCLIENT_PATH"; then # in most distros, so use it. AC_MSG_WARN([Could not find a suitable DHCP client]) DHCLIENT_PATH=/sbin/dhclient - AC_MSG_WARN([Falling back to ISC dhclient, ${DHCP_CLIENT_PATH}]) + AC_MSG_WARN([Falling back to ISC dhclient, ${DHCLIENT_PATH}]) fi AC_SUBST(DHCLIENT_PATH) AC_SUBST(DHCPCD_PATH) -- cgit v1.2.1 From c050e036c3d748970945195ed0fe6c914c439481 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 5 Aug 2010 15:25:42 -0500 Subject: dhcp: make sure disabled DHCP clients aren't used (gentoo #330319) If the client was disabled with --with-dhclient=no or --with-dhcpcd=no, then it's corresponding _PATH will be an empty string. In that case we want to ignore that client completely since it was disabled at build time. --- src/dhcp-manager/nm-dhcp-manager.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c index bde874fb7b..a1e3e5e24d 100644 --- a/src/dhcp-manager/nm-dhcp-manager.c +++ b/src/dhcp-manager/nm-dhcp-manager.c @@ -265,8 +265,13 @@ get_client_type (const char *client, GError **error) const char *dhclient_path = NULL; const char *dhcpcd_path = NULL; - dhclient_path = nm_dhcp_dhclient_get_path (DHCLIENT_PATH); - dhcpcd_path = nm_dhcp_dhcpcd_get_path (DHCPCD_PATH); + /* If a client was disabled at build-time, its *_PATH define will be + * an empty string. + */ + if (DHCLIENT_PATH && strlen (DHCLIENT_PATH)) + dhclient_path = nm_dhcp_dhclient_get_path (DHCLIENT_PATH); + if (DHCPCD_PATH && strlen (DHCPCD_PATH)) + dhcpcd_path = nm_dhcp_dhcpcd_get_path (DHCPCD_PATH); if (!client) { if (dhclient_path) -- cgit v1.2.1 From 707e2c84a3964650739a95c04cc05f7c0764eb62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Fri, 6 Aug 2010 11:36:11 +0200 Subject: doc: trivial fix in documentation of 's390-subchannels' property --- libnm-util/nm-setting-wired.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libnm-util/nm-setting-wired.c b/libnm-util/nm-setting-wired.c index b18f691f21..ad47ac943c 100644 --- a/libnm-util/nm-setting-wired.c +++ b/libnm-util/nm-setting-wired.c @@ -709,7 +709,7 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class) * communcation with z/VM or s390 host. Like #NMSettingWired:mac-address * for non-z/VM devices, this property can be used to ensure this connection * only applies to the network device that uses these subchannels. The - * list should contain exactly 3 strings, and each string may only only be + * list should contain exactly 3 strings, and each string may only be * composed of hexadecimal characters and the period (.) character. **/ g_object_class_install_property @@ -723,7 +723,7 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class) "to ensure this connection only applies to the " "network device that uses these subchannels. The " "list should contain exactly 3 strings, and each " - "string may only only be composed of hexadecimal " + "string may only be composed of hexadecimal " "characters and the period (.) character.", DBUS_TYPE_G_ARRAY_OF_STRING, G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); -- cgit v1.2.1 From 759ad39c8c2e440a1306a46f6ae73e193df97269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Fri, 6 Aug 2010 13:51:41 +0200 Subject: man: add a manpage for nm-online --- configure.ac | 1 + man/Makefile.am | 2 ++ man/nm-online.1.in | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 man/nm-online.1.in diff --git a/configure.ac b/configure.ac index b1d16f252e..e1b93471a3 100644 --- a/configure.ac +++ b/configure.ac @@ -518,6 +518,7 @@ man/NetworkManager.8 man/NetworkManager.conf.5 man/nm-system-settings.conf.5 man/nm-tool.1 +man/nm-online.1 man/nmcli.1 po/Makefile.in policy/Makefile diff --git a/man/Makefile.am b/man/Makefile.am index 097fdc6bea..973ef2c250 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -3,6 +3,7 @@ man_MANS = \ NetworkManager.conf.5 \ nm-system-settings.conf.5 \ nm-tool.1 \ + nm-online.1 \ nmcli.1 EXTRA_DIST = \ @@ -11,6 +12,7 @@ EXTRA_DIST = \ NetworkManager.conf.5.in \ nm-system-settings.conf.5.in \ nm-tool.1.in \ + nm-online.1.in \ nmcli.1.in CLEANFILES = $(man_MANS) diff --git a/man/nm-online.1.in b/man/nm-online.1.in new file mode 100644 index 0000000000..2c8c9e9afc --- /dev/null +++ b/man/nm-online.1.in @@ -0,0 +1,64 @@ +.\" nm-online (1) manual page +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.\" +.\" Copyright (C) 2010 Red Hat, Inc. +.\" +.TH NM-ONLINE "1" "6 August 2010" + +.SH NAME +nm-online \- ask NetworkManager whether the network is connected +.SH SYNOPSIS +.B nm-online +.RI " [ " OPTIONS " ] + +.SH DESCRIPTION +.B nm-online +is a utility to find out whether we are online. It is done by asking +NetworkManager about its status. When run, \fInm\-online\fP waits until +NetworkManager reports an active connection, or specified timeout expires. On +exit, the returned status code should be checked (see the return codes bellow). + +.SH OPTIONS +.TP +.B \-t, \-\-timeout +Time to wait for a connection, in seconds. If not specified, the default is 30 +seconds. +.TP +.B \-x, \-\-exit +Exit immediately if NetworkManager is not running or connecting. +.TP +.B \-q, \-\-quiet +Don't print anything. + +.SH EXIT STATUS + +.IP "0" 4 +Success - already online or connection established within given timeout +.IP "1" 4 +Offline or not online within given timeout +.IP "2" 4 +Unspecified error + +.SH SEE ALSO +.BR nm\-tool (1), +.BR nmcli (1), +.BR NetworkManager(8). -- cgit v1.2.1 From b9a919784ed65bb956c46ee926c1269145d129b9 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 8 Aug 2010 01:36:08 -0500 Subject: logging: add accessor for log level --- src/logging/nm-logging.c | 6 ++++++ src/logging/nm-logging.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/logging/nm-logging.c b/src/logging/nm-logging.c index 9d1905da08..5b5622fd70 100644 --- a/src/logging/nm-logging.c +++ b/src/logging/nm-logging.c @@ -209,6 +209,12 @@ nm_logging_domains_to_string (void) return g_string_free (str, FALSE); } +gboolean +nm_logging_level_enabled (guint32 level) +{ + return !!(log_level & level); +} + void _nm_log (const char *loc, const char *func, guint32 domain, diff --git a/src/logging/nm-logging.h b/src/logging/nm-logging.h index 2eedf5ff14..e4abcf75ca 100644 --- a/src/logging/nm-logging.h +++ b/src/logging/nm-logging.h @@ -90,6 +90,7 @@ void _nm_log (const char *loc, const char *func, const char *nm_logging_level_to_string (void); char *nm_logging_domains_to_string (void); +gboolean nm_logging_level_enabled (guint32 level); /* Undefine the nm-utils.h logging stuff to ensure errors */ #undef nm_print_backtrace -- cgit v1.2.1 From 47e859fb660c286c6a6b2156b909ee86392ccad4 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 8 Aug 2010 01:36:35 -0500 Subject: core: better debugging for IPv4LL and avahi-autoipd --- src/nm-device.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/nm-device.c b/src/nm-device.c index 640ef62e30..e291c2f33c 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -1237,7 +1237,7 @@ static gboolean aipd_exec (NMDevice *self, GError **error) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); - char *argv[5]; + char *argv[6], *cmdline; gboolean success = FALSE; const char **aipd_binary = NULL; static const char *aipd_paths[] = { @@ -1245,6 +1245,7 @@ aipd_exec (NMDevice *self, GError **error) "/usr/local/sbin/avahi-autoipd", NULL }; + int i = 0; aipd_cleanup (self); @@ -1261,11 +1262,17 @@ aipd_exec (NMDevice *self, GError **error) return FALSE; } - argv[0] = (char *) (*aipd_binary); - argv[1] = "--script"; - argv[2] = LIBEXECDIR "/nm-avahi-autoipd.action"; - argv[3] = (char *) nm_device_get_ip_iface (self); - argv[4] = NULL; + argv[i++] = (char *) (*aipd_binary); + argv[i++] = "--script"; + argv[i++] = LIBEXECDIR "/nm-avahi-autoipd.action"; + if (nm_logging_level_enabled (LOGL_DEBUG)) + argv[i++] = "--debug"; + argv[i++] = (char *) nm_device_get_ip_iface (self); + argv[i++] = NULL; + + cmdline = g_strjoinv (" ", argv); + nm_log_dbg(LOGD_AUTOIP4, "running: %s", cmdline); + g_free (cmdline); success = g_spawn_async ("/", argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, &aipd_child_setup, NULL, &(priv->aipd_pid), error); -- cgit v1.2.1 From 97199ae3e3c0be3f4a86bdb146c1ba8f23d06c7b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 9 Aug 2010 12:05:57 -0500 Subject: ifcfg-rh: ignore .augnew and .augtmp files used by netcf --- system-settings/plugins/ifcfg-rh/common.h | 2 ++ system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c | 2 ++ system-settings/plugins/ifcfg-rh/utils.c | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/system-settings/plugins/ifcfg-rh/common.h b/system-settings/plugins/ifcfg-rh/common.h index 921f7f73df..e7cd93e908 100644 --- a/system-settings/plugins/ifcfg-rh/common.h +++ b/system-settings/plugins/ifcfg-rh/common.h @@ -33,6 +33,8 @@ #define ORIG_TAG ".orig" #define REJ_TAG ".rej" #define RPMNEW_TAG ".rpmnew" +#define AUGNEW_TAG ".augnew" +#define AUGTMP_TAG ".augtmp" #define IFCFG_DIR SYSCONFDIR"/sysconfig/network-scripts" diff --git a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c index cf2a7c03de..a6c54fd3d8 100644 --- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c @@ -153,6 +153,8 @@ int main (int argc, char **argv) test_ignored ("ignored-orig", "ifcfg-FooBar" ORIG_TAG, TRUE); test_ignored ("ignored-rej", "ifcfg-FooBar" REJ_TAG, TRUE); test_ignored ("ignored-rpmnew", "ifcfg-FooBar" RPMNEW_TAG, TRUE); + test_ignored ("ignored-augnew", "ifcfg-FooBar" AUGNEW_TAG, TRUE); + test_ignored ("ignored-augtmp", "ifcfg-FooBar" AUGTMP_TAG, TRUE); base = g_path_get_basename (argv[0]); fprintf (stdout, "%s: SUCCESS\n", base); diff --git a/system-settings/plugins/ifcfg-rh/utils.c b/system-settings/plugins/ifcfg-rh/utils.c index 211458bec8..9e79ce0b42 100644 --- a/system-settings/plugins/ifcfg-rh/utils.c +++ b/system-settings/plugins/ifcfg-rh/utils.c @@ -160,7 +160,9 @@ utils_should_ignore_file (const char *filename, gboolean only_ifcfg) && !check_suffix (base, TILDE_TAG) && !check_suffix (base, ORIG_TAG) && !check_suffix (base, REJ_TAG) - && !check_suffix (base, RPMNEW_TAG)) + && !check_suffix (base, RPMNEW_TAG) + && !check_suffix (base, AUGNEW_TAG) + && !check_suffix (base, AUGTMP_TAG)) ignore = FALSE; g_free (base); -- cgit v1.2.1 From c009759f9b9b00047f620b7a9adde119fcd88960 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 9 Aug 2010 13:13:02 -0500 Subject: ifcfg-rh: emit the right message when ignored connections are deleted Previously the code would assume that if the ifcfg file had no backing connection that we should try to read it in regardless of what the inotify event was. But if the event was DELETED, there's no point in trying to read a deleted file in; it's gone. Don't print bogus warnings about failure to read the long-gone ifcfg file. --- system-settings/plugins/ifcfg-rh/plugin.c | 36 +++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/plugin.c b/system-settings/plugins/ifcfg-rh/plugin.c index 8a831228c2..acde396ac7 100644 --- a/system-settings/plugins/ifcfg-rh/plugin.c +++ b/system-settings/plugins/ifcfg-rh/plugin.c @@ -164,7 +164,7 @@ read_one_connection (SCPluginIfcfg *plugin, const char *filename) PLUGIN_PRINT (IFCFG_PLUGIN_NAME, " error: %s", (error && error->message) ? error->message : "(unknown)"); } - g_error_free (error); + g_clear_error (&error); } return connection; @@ -334,25 +334,25 @@ dir_changed (GFileMonitor *monitor, g_free (path); connection = g_hash_table_lookup (priv->connections, name); - if (!connection) { - do_new = TRUE; - } else { - switch (event_type) { - case G_FILE_MONITOR_EVENT_DELETED: - PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "removed %s.", name); - do_remove = TRUE; - break; - case G_FILE_MONITOR_EVENT_CREATED: - case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: - /* Update */ + switch (event_type) { + case G_FILE_MONITOR_EVENT_DELETED: + PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "removed %s.", name); + if (connection) + handle_connection_remove_or_new (plugin, name, connection, TRUE, FALSE); + break; + case G_FILE_MONITOR_EVENT_CREATED: + case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: + /* Update */ + if (!connection) + do_new = TRUE; + else connection_changed_handler (plugin, name, connection, &do_remove, &do_new); - break; - default: - break; - } - } - handle_connection_remove_or_new (plugin, name, connection, do_remove, do_new); + handle_connection_remove_or_new (plugin, name, connection, do_remove, do_new); + break; + default: + break; + } g_free (name); } -- cgit v1.2.1 From 3e48229208a645779e6811cdc1af905938f2fca9 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 9 Aug 2010 13:15:17 -0500 Subject: ifcfg-rh: correct handling of BRIDGE and VLAN unmanaged connections (rh #619863) For those ifcfg files that do have HWADDR and thus can have their device be unmanaged, we want to read in a much of the connection as possible since unmanaged devices are tracked via internal NMIfcfgConnection objects. For BRIDGE/VLAN ifcfg files that don't have HWADDR, we do want to ignore them completely, but also return a useful error message. --- system-settings/plugins/ifcfg-rh/reader.c | 36 +++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index a8ce149467..f1bf540e0b 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -3183,6 +3183,12 @@ is_wireless_device (const char *iface) return is_wireless; } +enum { + IGNORE_REASON_NONE = 0x00, + IGNORE_REASON_BRIDGE = 0x01, + IGNORE_REASON_VLAN = 0x02, +}; + NMConnection * connection_from_file (const char *filename, const char *network_file, /* for unit tests only */ @@ -3203,7 +3209,7 @@ connection_from_file (const char *filename, gboolean nm_controlled = TRUE; gboolean ip6_used = FALSE; GError *error = NULL; - gboolean ignore_connection = FALSE; + guint32 ignore_reason = IGNORE_REASON_NONE; g_return_val_if_fail (filename != NULL, NULL); g_return_val_if_fail (unmanaged != NULL, NULL); @@ -3293,7 +3299,7 @@ connection_from_file (const char *filename, if (tmp) { g_free (tmp); nm_controlled = FALSE; - ignore_connection = TRUE; + ignore_reason = IGNORE_REASON_BRIDGE; } if (nm_controlled) { @@ -3301,7 +3307,7 @@ connection_from_file (const char *filename, if (tmp) { g_free (tmp); nm_controlled = FALSE; - ignore_connection = TRUE; + ignore_reason = IGNORE_REASON_VLAN; } } @@ -3325,14 +3331,22 @@ connection_from_file (const char *filename, g_free (type); - /* Don't bother reading the connection fully if it's unmanaged. As a - * special-case, BRIDGE= and VLAN= connections are completely ignored so - * that ifup gets an error when it tries to ask NM about them. - */ - if (!connection || *unmanaged || ignore_connection) { - if (connection && ignore_connection) { - g_object_unref (connection); - connection = NULL; + /* Don't bother reading the connection fully if it's unmanaged or ignored */ + if (!connection || *unmanaged || ignore_reason) { + if (connection && !*unmanaged) { + /* However,BRIDGE and VLAN connections that don't have HWADDR won't + * be unmanaged because the unmanaged state is keyed off HWADDR. + * They willl still be tagged 'ignore' from code that checks BRIDGE + * and VLAN above. Since they aren't marked unmanaged, kill them + * completely. + */ + if (ignore_reason) { + g_object_unref (connection); + connection = NULL; + g_set_error (&error, IFCFG_PLUGIN_ERROR, 0, + "%s connections are not yet supported", + ignore_reason == IGNORE_REASON_BRIDGE ? "Bridge" : "VLAN"); + } } goto done; } -- cgit v1.2.1 From a4a554a51b60f464bc3771a12bc4e19b1bacec7e Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 9 Aug 2010 13:47:52 -0500 Subject: Revert "ifcfg-rh: testcases for unmanaged BRIDGE and VLAN" This reverts commit 007e134594fc3129d001f370dd40d8d8356690fc. --- .../tests/network-scripts/ifcfg-test-vlan-interface | 1 - system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 18 ++++-------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-interface b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-interface index 6af42768bc..6c841855ed 100644 --- a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-interface +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-interface @@ -1,5 +1,4 @@ DEVICE=eth1.43 -HWADDR=00:22:15:59:62:97 VLAN=yes ONBOOT=yes BOOTPROTO=none diff --git a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index e4a42f77bf..e19acb1311 100644 --- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -9332,12 +9332,8 @@ test_read_bridge_component (void) &route6file, &error, &ignore_error); - ASSERT (connection != NULL, - "bridge-component-read", "unexpected failure reading %s", TEST_IFCFG_BRIDGE_COMPONENT); - ASSERT (unmanaged != NULL, - "bridge-component-read", "unexpected managed device reading %s", TEST_IFCFG_BRIDGE_COMPONENT); - ASSERT (strcmp (unmanaged, "mac:00:22:15:59:62:97") == 0, - "bridge-component-read", "expected unmanaged device reading %s", TEST_IFCFG_BRIDGE_COMPONENT); + ASSERT (connection == NULL, + "bridge-component-read", "unexpected success reading %s", TEST_IFCFG_BRIDGE_COMPONENT); } #define TEST_IFCFG_VLAN_INTERFACE TEST_IFCFG_DIR"/network-scripts/ifcfg-test-vlan-interface" @@ -9363,14 +9359,8 @@ test_read_vlan_interface (void) &route6file, &error, &ignore_error); - ASSERT (connection != NULL, - "vlan-interface-read", "unexpected failure reading %s", TEST_IFCFG_VLAN_INTERFACE); - ASSERT (unmanaged != NULL, - "vlan-interface-read", "unexpected managed device reading %s", TEST_IFCFG_VLAN_INTERFACE); - ASSERT (strcmp (unmanaged, "mac:00:22:15:59:62:97") == 0, - "vlan-interface-read", "expected unmanaged device reading %s", TEST_IFCFG_VLAN_INTERFACE); - - g_object_unref (connection); + ASSERT (connection == NULL, + "vlan-interface-read", "unexpected success reading %s", TEST_IFCFG_VLAN_INTERFACE); } #define TEST_IFCFG_WIFI_OPEN_SSID_BAD_HEX TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-open-ssid-bad-hex" -- cgit v1.2.1 From 7ed22185dd3f4065aae25d733f0feeb1c97f1333 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 9 Aug 2010 13:41:37 -0500 Subject: ifcfg-rh: bridge components are now expected to provide a valid connection They aren't ignored if they have HWADDR due to commit 46696c22ca32999ec09d1ac395e8f043522fdf2d (ifcfg-rh: correct handling of BRIDGE and VLAN unmanaged connections (rh #619863)) --- system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index e19acb1311..ea96ec5cc1 100644 --- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -9332,8 +9332,17 @@ test_read_bridge_component (void) &route6file, &error, &ignore_error); - ASSERT (connection == NULL, - "bridge-component-read", "unexpected success reading %s", TEST_IFCFG_BRIDGE_COMPONENT); + ASSERT (connection != NULL, + "bridge-component-read", "unexpected failure reading %s", TEST_IFCFG_BRIDGE_COMPONENT); + + ASSERT (unmanaged != NULL, + "bridge-component-read", "missing unmanaged spec from %s", TEST_IFCFG_BRIDGE_COMPONENT); + + ASSERT (g_strcmp0 (unmanaged, "mac:00:22:15:59:62:97") == 0, + "bridge-component-read", "unexpected unmanaged spec from %s", TEST_IFCFG_BRIDGE_COMPONENT); + + g_object_unref (connection); + g_free (unmanaged); } #define TEST_IFCFG_VLAN_INTERFACE TEST_IFCFG_DIR"/network-scripts/ifcfg-test-vlan-interface" -- cgit v1.2.1 From c72fbd6b87fde2d55c0edab66a190efcb3f9083d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 9 Aug 2010 14:36:16 -0500 Subject: policy: add short hostname to /etc/hosts too (rh #621910) If your hostname is 'foo.bar.baz' and your DNS server doesn't actually reply to queries for 'foo.bar.baz' you can't just 'ping foo' currently. While that may be somewhat of a misconfigured setup, since we're already adding the domain part of the hostname to /etc/resolv.conf we might as well add the short hostname to /etc/hosts too so that ping works. --- src/nm-policy-hosts.c | 62 ++++++++++++++++++++---- src/tests/test-policy-hosts.c | 106 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 158 insertions(+), 10 deletions(-) diff --git a/src/nm-policy-hosts.c b/src/nm-policy-hosts.c index 138b0fecd3..0403b03725 100644 --- a/src/nm-policy-hosts.c +++ b/src/nm-policy-hosts.c @@ -133,6 +133,7 @@ nm_policy_get_etc_hosts (const char **lines, gboolean hostname6_is_fallback; gboolean host4_before = FALSE; gboolean host6_before = FALSE; + char *short_hostname = NULL; g_return_val_if_fail (lines != NULL, FALSE); g_return_val_if_fail (hostname != NULL, FALSE); @@ -206,6 +207,24 @@ nm_policy_get_etc_hosts (const char **lines, return NULL; } + /* Find the short hostname, like 'foo' from 'foo.bar.baz'; we want to + * make sure that the entries we add for this host also include the short + * hostname too so that if the resolver does not answer queries for the + * machine's actual hostname/domain, that stuff like 'ping foo' still works. + */ + if (!hostname4_is_fallback || !hostname6_is_fallback) { + char *dot; + + short_hostname = g_strdup (hostname); + dot = strchr (short_hostname, '.'); + if (dot && *(dot+1)) + *dot = '\0'; + else { + g_free (short_hostname); + short_hostname = NULL; + } + } + /* Construct the new hosts file; replace any 127.0.0.1/::1 entry that is * at the beginning of the file or right after initial comments and contains * the string 'localhost' (for IPv4) or 'localhost6' (for IPv6). If there @@ -229,21 +248,35 @@ nm_policy_get_etc_hosts (const char **lines, */ /* Add the address mappings first so they take precedence */ - if (!hostname4_is_fallback && ip4_addr && !found_user_host4) - g_string_append_printf (contents, "%s\t%s\t%s\n", ip4_addr, hostname, ADDED_TAG); - if (!hostname6_is_fallback && ip6_addr && !found_user_host6) - g_string_append_printf (contents, "%s\t%s\t%s\n", ip6_addr, hostname, ADDED_TAG); + if (!hostname4_is_fallback && ip4_addr && !found_user_host4) { + g_string_append_printf (contents, "%s\t%s", ip4_addr, hostname); + if (short_hostname) + g_string_append_printf (contents, "\t%s", short_hostname); + g_string_append_printf (contents, "\t%s\n", ADDED_TAG); + } + if (!hostname6_is_fallback && ip6_addr && !found_user_host6) { + g_string_append_printf (contents, "%s\t%s", ip6_addr, hostname); + if (short_hostname) + g_string_append_printf (contents, "\t%s", short_hostname); + g_string_append_printf (contents, "\t%s\n", ADDED_TAG); + } /* IPv4 localhost line */ g_string_append (contents, "127.0.0.1"); - if (!hostname4_is_fallback && !ip4_addr && !found_user_host4) + if (!hostname4_is_fallback && !ip4_addr && !found_user_host4) { g_string_append_printf (contents, "\t%s", hostname); + if (short_hostname) + g_string_append_printf (contents, "\t%s", short_hostname); + } g_string_append_printf (contents, "\t%s\tlocalhost\n", fallback_hostname4); /* IPv6 localhost line */ g_string_append (contents, "::1"); - if (!hostname6_is_fallback && !hostname4_is_fallback && !ip6_addr && !found_user_host6) + if (!hostname6_is_fallback && !hostname4_is_fallback && !ip6_addr && !found_user_host6) { g_string_append_printf (contents, "\t%s", hostname); + if (short_hostname) + g_string_append_printf (contents, "\t%s", short_hostname); + } g_string_append_printf (contents, "\t%s\tlocalhost6\n", fallback_hostname6); added = TRUE; @@ -277,15 +310,24 @@ nm_policy_get_etc_hosts (const char **lines, g_string_append (contents, "# that require network functionality will fail.\n"); /* Add the address mappings first so they take precedence */ - if (!hostname4_is_fallback && ip4_addr) - g_string_append_printf (contents, "%s\t%s\t%s\n", ip4_addr, hostname, ADDED_TAG); - if (!hostname6_is_fallback && ip6_addr) - g_string_append_printf (contents, "%s\t%s\t%s\n", ip6_addr, hostname, ADDED_TAG); + if (!hostname4_is_fallback && ip4_addr) { + g_string_append_printf (contents, "%s\t%s", ip4_addr, hostname); + if (short_hostname) + g_string_append_printf (contents, "\t%s", short_hostname); + g_string_append_printf (contents, "\t%s\n", ADDED_TAG); + } + if (!hostname6_is_fallback && ip6_addr) { + g_string_append_printf (contents, "%s\t%s", ip6_addr, hostname); + if (short_hostname) + g_string_append_printf (contents, "\t%s", short_hostname); + g_string_append_printf (contents, "\t%s\n", ADDED_TAG); + } g_string_append_printf (contents, "127.0.0.1\t%s\tlocalhost\n", fallback_hostname4); g_string_append_printf (contents, "::1\t%s\tlocalhost6\n", fallback_hostname6); } + g_free (short_hostname); return contents; } diff --git a/src/tests/test-policy-hosts.c b/src/tests/test-policy-hosts.c index e3401fe6b4..682c996f75 100644 --- a/src/tests/test-policy-hosts.c +++ b/src/tests/test-policy-hosts.c @@ -375,6 +375,24 @@ test_hosts_named46_non127 (void) /*******************************************/ +static const char *named46_non127_long_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "192.168.1.2 comet.space comet\n" + "3001:abba::3234 comet.space comet\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_named46_non127_long (void) +{ + test_generic (named46_non127_long_before, NULL, "comet.space", "192.168.1.2", "3001:abba::3234", FALSE); +} + +/*******************************************/ + static const char *named46_non127_other4_before = \ "# Do not remove the following line, or various programs\n" "# that require network functionality will fail.\n" @@ -404,6 +422,35 @@ test_hosts_named46_non127_other4 (void) /*******************************************/ +static const char *named46_non127_other4_long_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "192.168.1.3 comet.space\n" + "3001:abba::3234 comet.space\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static const char *named46_non127_other4_long_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "192.168.1.2 comet.space comet # Added by NetworkManager\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "192.168.1.3 comet.space\n" + "3001:abba::3234 comet.space\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_named46_non127_other4_long (void) +{ + test_generic (named46_non127_other4_long_before, named46_non127_other4_long_after, "comet.space", "192.168.1.2", "3001:abba::3234", FALSE); +} + +/*******************************************/ + static const char *named46_non127_other6_before = \ "# Do not remove the following line, or various programs\n" "# that require network functionality will fail.\n" @@ -433,6 +480,35 @@ test_hosts_named46_non127_other6 (void) /*******************************************/ +static const char *named46_non127_other6_long_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "192.168.1.2 comet.space\n" + "3001:abba::9675 comet.space\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static const char *named46_non127_other6_long_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "3001:abba::3234 comet.space comet # Added by NetworkManager\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "192.168.1.2 comet.space\n" + "3001:abba::9675 comet.space\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_named46_non127_other6_long (void) +{ + test_generic (named46_non127_other6_long_before, named46_non127_other6_long_after, "comet.space", "192.168.1.2", "3001:abba::3234", FALSE); +} + +/*******************************************/ + static const char *unnamed46_non127_before = \ "# Do not remove the following line, or various programs\n" "# that require network functionality will fail.\n" @@ -459,6 +535,32 @@ test_hosts_unnamed46_non127 (void) /*******************************************/ +static const char *unnamed46_non127_long_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static const char *unnamed46_non127_long_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "192.168.1.2 comet.space comet # Added by NetworkManager\n" + "3001:abba::3234 comet.space comet # Added by NetworkManager\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_unnamed46_non127_long (void) +{ + test_generic (unnamed46_non127_long_before, unnamed46_non127_long_after, "comet.space", "192.168.1.2", "3001:abba::3234", FALSE); +} + +/*******************************************/ + static const char *named46_non127_wrong_before = \ "# Do not remove the following line, or various programs\n" "# that require network functionality will fail.\n" @@ -592,10 +694,14 @@ int main (int argc, char **argv) g_test_suite_add (suite, TESTCASE (test_hosts_named4_non127_more, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_named6_non127_more, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127_long, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127_other4, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127_other4_long, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127_other6, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127_other6_long, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127_wrong, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_unnamed46_non127, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_unnamed46_non127_long, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_named_no_localhost, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_no_localhost, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_named_last, NULL)); -- cgit v1.2.1 From 9bed26b8566c9026cddce33dd967f9a546d3b4a3 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 9 Aug 2010 16:59:11 -0500 Subject: ifcfg-rh: unmanaged connections should be invisible to ifup too (rh #619863) The plugin does not expose them to NM, and it shouldn't expose them to ifup either. The world should be consistent :) --- system-settings/plugins/ifcfg-rh/plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-settings/plugins/ifcfg-rh/plugin.c b/system-settings/plugins/ifcfg-rh/plugin.c index acde396ac7..e6dfa5bcea 100644 --- a/system-settings/plugins/ifcfg-rh/plugin.c +++ b/system-settings/plugins/ifcfg-rh/plugin.c @@ -544,7 +544,7 @@ impl_ifcfgrh_get_ifcfg_details (SCPluginIfcfg *plugin, } connection = g_hash_table_lookup (priv->connections, in_ifcfg); - if (!connection) { + if (!connection || nm_ifcfg_connection_get_unmanaged_spec (connection)) { g_set_error (error, NM_SETTINGS_INTERFACE_ERROR, NM_SETTINGS_INTERFACE_ERROR_INVALID_CONNECTION, -- cgit v1.2.1 From 1a3381df3e8fac85796eb03f7e5f944b82d723af Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 9 Aug 2010 17:49:43 -0500 Subject: core: ensure we recheck autoactivation on new system connections Otherwise the policy could miss the fact that a new usable system connection showed up and might fail to activate it. --- src/nm-manager.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nm-manager.c b/src/nm-manager.c index 8c31197996..7a781c26ae 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -1399,6 +1399,7 @@ system_internal_new_connection (NMManager *manager, path = nm_connection_get_path (NM_CONNECTION (connection)); g_hash_table_insert (priv->system_connections, g_strdup (path), g_object_ref (connection)); + g_signal_emit (manager, signals[CONNECTION_ADDED], 0, connection, NM_CONNECTION_SCOPE_SYSTEM); } static void -- cgit v1.2.1 From 11ed2f737f4da3ca8bc39a6c91f56a6a8d72efa4 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 9 Aug 2010 17:53:01 -0500 Subject: core: don't select s390 subchannel-locked connections on non-s390 devices The autoactivation code wasn't excluding subchannel-locked connections when matching for devices that don't have subchannels. This only produced a warning message though as the connection activation would be failed by the check_connection_compatible hook. --- src/nm-device-ethernet.c | 74 +++++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index b851ea12d5..393b921c65 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -785,6 +785,39 @@ real_is_available (NMDevice *dev) return TRUE; } +static gboolean +match_subchans (NMDeviceEthernet *self, NMSettingWired *s_wired, gboolean *try_mac) +{ + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + const GPtrArray *subchans; + int i; + + *try_mac = TRUE; + + subchans = nm_setting_wired_get_s390_subchannels (s_wired); + if (!subchans) + return TRUE; + + /* connection requires subchannels but the device has none */ + if (!priv->subchannels) + return FALSE; + + /* Make sure each subchannel in the connection is a subchannel of this device */ + for (i = 0; i < subchans->len; i++) { + const char *candidate = g_ptr_array_index (subchans, i); + + if ( (priv->subchan1 && !strcmp (priv->subchan1, candidate)) + || (priv->subchan2 && !strcmp (priv->subchan2, candidate)) + || (priv->subchan3 && !strcmp (priv->subchan3, candidate))) + continue; + + return FALSE; /* a subchannel was not found */ + } + + *try_mac = FALSE; + return TRUE; +} + static NMConnection * real_get_best_auto_connection (NMDevice *dev, GSList *connections, @@ -820,9 +853,13 @@ real_get_best_auto_connection (NMDevice *dev, if (s_wired) { const GByteArray *mac; + gboolean try_mac = TRUE; + + if (!match_subchans (self, s_wired, &try_mac)) + continue; mac = nm_setting_wired_get_mac_address (s_wired); - if (mac && memcmp (mac->data, &priv->perm_hw_addr, ETH_ALEN)) + if (try_mac && mac && memcmp (mac->data, &priv->perm_hw_addr, ETH_ALEN)) continue; } @@ -1702,41 +1739,6 @@ real_deactivate_quickly (NMDevice *device) _set_hw_addr (self, priv->perm_hw_addr, "reset"); } -static gboolean -match_subchans (NMDeviceEthernet *self, NMSettingWired *s_wired, gboolean *try_mac) -{ - NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); - const GPtrArray *subchans; - int i; - - *try_mac = TRUE; - - subchans = nm_setting_wired_get_s390_subchannels (s_wired); - if (!subchans) - return TRUE; - - /* connection requires subchannels but the device has none */ - if (!priv->subchannels) - return FALSE; - - /* Make sure each subchannel in the connection is a subchannel of this device */ - for (i = 0; i < subchans->len; i++) { - const char *candidate = g_ptr_array_index (subchans, i); - gboolean found = FALSE; - - if ( (priv->subchan1 && !strcmp (priv->subchan1, candidate)) - || (priv->subchan2 && !strcmp (priv->subchan2, candidate)) - || (priv->subchan3 && !strcmp (priv->subchan3, candidate))) - found = TRUE; - - if (!found) - return FALSE; - } - - *try_mac = FALSE; - return TRUE; -} - static gboolean real_check_connection_compatible (NMDevice *device, NMConnection *connection, -- cgit v1.2.1 From d3b26a9c57e81b1021d30bbaf94757d337cfc4fa Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 9 Aug 2010 17:54:40 -0500 Subject: libnm-glib: get permissions synchronously at startup Many clients using libnm-glib (often command-line ones like nm-tool or nmcli) aren't long-lived enough for NM to get their UID from the bus daemon and validate their permissions via PolicyKit. So when the NMClient object is created, get the permissions synchronously (with a very low timeout to prevent unecessary blocking) to ensure that the client is still on the bus when NM asks for it's credentials. Avoids a ton of messages like: NetworkManager[10274]: error requesting auth for org.freedesktop.NetworkManager.enable-disable-wwan: (6) Remote Exception invoking org.freedesktop.PolicyKit1.Authority.CheckAuthorization() on /org/freedesktop/PolicyKit1/Authority at name org.freedesktop.PolicyKit1: org.freedesktop.DBus.Error.NameHasNoOwner: Remote Exception invoking org.freedesktop.DBus.GetConnectionUnixUser() on / at name org.freedesktop.DBus: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get UID of name ':1.95': no such name --- libnm-glib/nm-client.c | 48 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c index a1f986f493..88fe15b550 100644 --- a/libnm-glib/nm-client.c +++ b/libnm-glib/nm-client.c @@ -322,12 +322,8 @@ nm_permission_result_to_client (const char *nm) } static void -get_permissions_reply (DBusGProxy *proxy, - GHashTable *permissions, - GError *error, - gpointer user_data) +update_permissions (NMClient *self, GHashTable *permissions) { - NMClient *self = NM_CLIENT (user_data); NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (self); GHashTableIter iter; gpointer key, value; @@ -335,13 +331,11 @@ get_permissions_reply (DBusGProxy *proxy, NMClientPermissionResult perm_result; GList *keys, *keys_iter; - priv->perm_call = NULL; - /* get list of old permissions for change notification */ keys = g_hash_table_get_keys (priv->permissions); g_hash_table_remove_all (priv->permissions); - if (!error) { + if (permissions) { /* Process new permissions */ g_hash_table_iter_init (&iter, permissions); while (g_hash_table_iter_next (&iter, &key, &value)) { @@ -380,12 +374,31 @@ get_permissions_reply (DBusGProxy *proxy, g_list_free (keys); } -static DBusGProxyCall * -get_permissions (NMClient *self) +static void +get_permissions_sync (NMClient *self) +{ + gboolean success; + GHashTable *permissions = NULL; + + success = dbus_g_proxy_call_with_timeout (NM_CLIENT_GET_PRIVATE (self)->client_proxy, + "GetPermissions", 3000, NULL, + G_TYPE_INVALID, + DBUS_TYPE_G_MAP_OF_STRING, &permissions, G_TYPE_INVALID); + update_permissions (self, success ? permissions : NULL); + if (permissions) + g_hash_table_destroy (permissions); +} + +static void +get_permissions_reply (DBusGProxy *proxy, + GHashTable *permissions, + GError *error, + gpointer user_data) { - return org_freedesktop_NetworkManager_get_permissions_async (NM_CLIENT_GET_PRIVATE (self)->client_proxy, - get_permissions_reply, - self); + NMClient *self = NM_CLIENT (user_data); + + NM_CLIENT_GET_PRIVATE (self)->perm_call = NULL; + update_permissions (NM_CLIENT (user_data), error ? NULL : permissions); } static void @@ -394,8 +407,11 @@ client_recheck_permissions (DBusGProxy *proxy, gpointer user_data) NMClient *self = NM_CLIENT (user_data); NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (self); - if (!priv->perm_call) - priv->perm_call = get_permissions (self); + if (!priv->perm_call) { + priv->perm_call = org_freedesktop_NetworkManager_get_permissions_async (NM_CLIENT_GET_PRIVATE (self)->client_proxy, + get_permissions_reply, + self); + } } static GObject* @@ -445,7 +461,7 @@ constructor (GType type, G_CALLBACK (client_recheck_permissions), object, NULL); - priv->perm_call = get_permissions (NM_CLIENT (object)); + get_permissions_sync (NM_CLIENT (object)); priv->bus_proxy = dbus_g_proxy_new_for_name (connection, "org.freedesktop.DBus", -- cgit v1.2.1 From 726b365d4eac42efec3d1056b9aaaaa578d4e6f2 Mon Sep 17 00:00:00 2001 From: Manoj Kumar Giri Date: Tue, 10 Aug 2010 13:00:27 -0500 Subject: po: updated Oriya translation (bgo #618962) --- po/or.po | 411 ++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 210 insertions(+), 201 deletions(-) diff --git a/po/or.po b/po/or.po index 38f68a8ad9..dbae3e0290 100644 --- a/po/or.po +++ b/po/or.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: NetworkManager.master.or\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-06-28 08:52+0000\n" -"PO-Revision-Date: 2010-07-29 15:38+0530\n" +"POT-Creation-Date: 2010-08-10 03:25+0000\n" +"PO-Revision-Date: 2010-08-10 12:47+0530\n" "Last-Translator: Manoj Kumar Giri \n" "Language-Team: Oriya \n" "MIME-Version: 1.0\n" @@ -21,76 +21,76 @@ msgstr "" "\n" "\n" -#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 -#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 -#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 -#: ../cli/src/devices.c:152 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/devices.c:88 ../cli/src/devices.c:101 ../cli/src/devices.c:111 +#: ../cli/src/devices.c:121 ../cli/src/devices.c:134 ../cli/src/devices.c:145 +#: ../cli/src/devices.c:156 ../cli/src/devices.c:165 ../cli/src/devices.c:174 msgid "NAME" msgstr "NAME" #. 0 -#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/connections.c:61 ../cli/src/connections.c:76 msgid "UUID" msgstr "UUID" #. 1 -#: ../cli/src/connections.c:61 +#: ../cli/src/connections.c:62 msgid "DEVICES" msgstr "DEVICES" #. 2 -#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +#: ../cli/src/connections.c:63 ../cli/src/connections.c:78 msgid "SCOPE" msgstr "SCOPE" #. 3 -#: ../cli/src/connections.c:63 +#: ../cli/src/connections.c:64 msgid "DEFAULT" msgstr "DEFAULT" #. 4 -#: ../cli/src/connections.c:64 +#: ../cli/src/connections.c:65 msgid "DBUS-SERVICE" msgstr "DBUS-SERVICE" #. 5 -#: ../cli/src/connections.c:65 +#: ../cli/src/connections.c:66 msgid "SPEC-OBJECT" msgstr "SPEC-OBJECT" #. 6 -#: ../cli/src/connections.c:66 +#: ../cli/src/connections.c:67 msgid "VPN" msgstr "VPN" #. 1 #. 0 #. 1 -#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +#: ../cli/src/connections.c:77 ../cli/src/devices.c:62 ../cli/src/devices.c:90 msgid "TYPE" msgstr "TYPE" #. 3 -#: ../cli/src/connections.c:78 +#: ../cli/src/connections.c:79 msgid "TIMESTAMP" msgstr "TIMESTAMP" #. 4 -#: ../cli/src/connections.c:79 +#: ../cli/src/connections.c:80 msgid "TIMESTAMP-REAL" msgstr "TIMESTAMP-REAL" #. 5 -#: ../cli/src/connections.c:80 +#: ../cli/src/connections.c:81 msgid "AUTOCONNECT" msgstr "AUTOCONNECT" #. 6 -#: ../cli/src/connections.c:81 +#: ../cli/src/connections.c:82 msgid "READONLY" msgstr "READONLY" -#: ../cli/src/connections.c:157 +#: ../cli/src/connections.c:158 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -111,40 +111,40 @@ msgstr "" "]\n" " down id | uuid \n" -#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#: ../cli/src/connections.c:198 ../cli/src/connections.c:537 #, c-format msgid "Error: 'con list': %s" msgstr "ତ୍ରୁଟି: 'con list': %s" -#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#: ../cli/src/connections.c:200 ../cli/src/connections.c:539 #, c-format msgid "Error: 'con list': %s; allowed fields: %s" msgstr "ତ୍ରୁଟି: 'con list': %s; ଅନୁମତିପ୍ରାପ୍ତ କ୍ଷେତ୍ର: %s" -#: ../cli/src/connections.c:207 +#: ../cli/src/connections.c:208 msgid "Connection details" msgstr "ସଂଯୋଗ ବିବରଣୀ" -#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 msgid "system" msgstr "ତନ୍ତ୍ର" -#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 msgid "user" msgstr "ଚାଳକ" -#: ../cli/src/connections.c:383 +#: ../cli/src/connections.c:384 msgid "never" msgstr "କଦାପି ନୁହଁ" #. "CAPABILITIES" #. Print header #. "WIFI-PROPERTIES" -#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 -#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 -#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 -#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 #: ../cli/src/settings.c:551 ../cli/src/settings.c:652 #: ../cli/src/settings.c:926 ../cli/src/settings.c:927 #: ../cli/src/settings.c:929 ../cli/src/settings.c:931 @@ -160,11 +160,11 @@ msgstr "କଦାପି ନୁହଁ" msgid "yes" msgstr "ହଁ" -#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 -#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 -#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 -#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 #: ../cli/src/settings.c:510 ../cli/src/settings.c:551 #: ../cli/src/settings.c:652 ../cli/src/settings.c:926 #: ../cli/src/settings.c:927 ../cli/src/settings.c:929 @@ -180,445 +180,457 @@ msgstr "ହଁ" msgid "no" msgstr "ନାଁ" -#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +#: ../cli/src/connections.c:458 ../cli/src/connections.c:501 msgid "System connections" msgstr "ତନ୍ତ୍ର ସଂଯୋଗଗୁଡ଼ିକ" -#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +#: ../cli/src/connections.c:463 ../cli/src/connections.c:514 msgid "User connections" msgstr "ଚାଳକ ସଂଯୋଗଗୁଡ଼ିକ" -#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 -#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 -#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 -#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 -#: ../cli/src/devices.c:980 +#: ../cli/src/connections.c:475 ../cli/src/connections.c:1335 +#: ../cli/src/connections.c:1351 ../cli/src/connections.c:1360 +#: ../cli/src/connections.c:1371 ../cli/src/connections.c:1456 +#: ../cli/src/devices.c:962 ../cli/src/devices.c:972 ../cli/src/devices.c:1074 +#: ../cli/src/devices.c:1081 #, c-format msgid "Error: %s argument is missing." msgstr "ତ୍ରୁଟି: %s ସ୍ୱତନ୍ତ୍ରଚର ଅନୁପସ୍ଥିତ ଅଛି।" -#: ../cli/src/connections.c:487 +#: ../cli/src/connections.c:488 #, c-format msgid "Error: %s - no such connection." msgstr "ତ୍ରୁଟି: %s - ଏପରି କୌଣସି ସଂଯୋଗ ନାହିଁ।" -#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 -#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 -#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#: ../cli/src/connections.c:520 ../cli/src/connections.c:1384 +#: ../cli/src/connections.c:1474 ../cli/src/devices.c:785 +#: ../cli/src/devices.c:852 ../cli/src/devices.c:986 ../cli/src/devices.c:1087 #, c-format msgid "Unknown parameter: %s\n" msgstr "ଅଜଣା ପ୍ରାଚଳ: %s\n" -#: ../cli/src/connections.c:528 +#: ../cli/src/connections.c:529 #, c-format msgid "Error: no valid parameter specified." msgstr "ତ୍ରୁଟି: କୌଣସି ବୈଧ ପ୍ରାଚଳ ଉଲ୍ଲେଖ ହୋଇନାହିଁ।" -#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 -#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#: ../cli/src/connections.c:544 ../cli/src/connections.c:1577 +#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:274 #, c-format msgid "Error: %s." msgstr "ତ୍ରୁଟି: %s." -#: ../cli/src/connections.c:649 +#: ../cli/src/connections.c:650 #, c-format msgid "Error: 'con status': %s" msgstr "ତ୍ରୁଟି: 'con status': %s" -#: ../cli/src/connections.c:651 +#: ../cli/src/connections.c:652 #, c-format msgid "Error: 'con status': %s; allowed fields: %s" msgstr "ତ୍ରୁଟି: 'con status': %s; ଅନୁମତିପ୍ରାପ୍ତ କ୍ଷେତ୍ର: %s" -#: ../cli/src/connections.c:658 +#: ../cli/src/connections.c:659 msgid "Active connections" msgstr "ସକ୍ରିୟ ସଂଯୋଗଗୁଡ଼ିକ" -#: ../cli/src/connections.c:1026 +#: ../cli/src/connections.c:1027 #, c-format msgid "no active connection on device '%s'" msgstr "ଉପକରଣ '%s' ରେ କୌଣସି ସକ୍ରିୟ ସଂଯୋଗ ନାହିଁ" -#: ../cli/src/connections.c:1034 +#: ../cli/src/connections.c:1035 #, c-format msgid "no active connection or device" msgstr "କୌଣସି ସକ୍ରିୟ ସଂଯୋଗ କିମ୍ବା ଉପକରଣ ନାହିଁ" -#: ../cli/src/connections.c:1084 +#: ../cli/src/connections.c:1085 #, c-format msgid "device '%s' not compatible with connection '%s'" msgstr "ଉପକରଣ '%s' ସଂଯୋଗ '%s' ସହିତ ସୁସଙ୍ଗତ ନୁହଁ" -#: ../cli/src/connections.c:1086 +#: ../cli/src/connections.c:1087 #, c-format msgid "no device found for connection '%s'" msgstr "ସଂଯୋଗ '%s' ପାଇଁ କୌଣସି ଉପକରଣ ମିଳିଲା ନାହିଁ" -#: ../cli/src/connections.c:1097 +#: ../cli/src/connections.c:1098 msgid "activating" msgstr "ସକ୍ରିୟ କରୁଅଛି" -#: ../cli/src/connections.c:1099 +#: ../cli/src/connections.c:1100 msgid "activated" msgstr "ସକ୍ରିୟ ହୋଇସାରିଛି" -#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 -#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 -#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/connections.c:1103 ../cli/src/connections.c:1126 +#: ../cli/src/connections.c:1159 ../cli/src/devices.c:246 +#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:92 #: ../cli/src/network-manager.c:145 ../cli/src/settings.c:473 msgid "unknown" msgstr "ଅଜଣା" -#: ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:1112 msgid "VPN connecting (prepare)" msgstr "VPN ସଂଯୋଗ କରୁଅଛି (ପ୍ରସ୍ତୁତ)" -#: ../cli/src/connections.c:1113 +#: ../cli/src/connections.c:1114 msgid "VPN connecting (need authentication)" msgstr "VPN ସଂଯୋଗ କରୁଅଛି (ବୈଧିକରଣ ଆବଶ୍ୟକ)" -#: ../cli/src/connections.c:1115 +#: ../cli/src/connections.c:1116 msgid "VPN connecting" msgstr "VPN ସଂଯୋଗ କରୁଅଛି" -#: ../cli/src/connections.c:1117 +#: ../cli/src/connections.c:1118 msgid "VPN connecting (getting IP configuration)" msgstr "VPN ସଂଯୋଗ କରୁଅଛି (IP ସଂରଚନା ଗ୍ରହଣ କରୁଅଛି)" -#: ../cli/src/connections.c:1119 +#: ../cli/src/connections.c:1120 msgid "VPN connected" msgstr "VPN ସଂଯୁକ୍ତ ହୋଇଛି" -#: ../cli/src/connections.c:1121 +#: ../cli/src/connections.c:1122 msgid "VPN connection failed" msgstr "VPN ସଂଯୋଗ ବିଫଳ ହୋଇଛି" -#: ../cli/src/connections.c:1123 +#: ../cli/src/connections.c:1124 msgid "VPN disconnected" msgstr "VPN ସଂଯୋଗ ବିଚ୍ଛିନ୍ନ ହୋଇଛି" -#: ../cli/src/connections.c:1134 +#: ../cli/src/connections.c:1135 msgid "unknown reason" msgstr "ଅଜଣା କାରଣ" -#: ../cli/src/connections.c:1136 +#: ../cli/src/connections.c:1137 msgid "none" msgstr "କିଛି ନୁହେଁ" -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1139 msgid "the user was disconnected" msgstr "ଚାଳକଟି ସଂଯୋଗ ବିଚ୍ଛିନ୍ନ ହୋଇଥିଲା" -#: ../cli/src/connections.c:1140 +#: ../cli/src/connections.c:1141 msgid "the base network connection was interrupted" msgstr "ମୂଳ ନେଟୱର୍କ ସଂଯୋଗଟି ବାଧାପ୍ରାପ୍ତ ହୋଇଥିଲା" -#: ../cli/src/connections.c:1142 +#: ../cli/src/connections.c:1143 msgid "the VPN service stopped unexpectedly" msgstr "VPN ସର୍ଭିସ ଅପ୍ରତ୍ୟାଶିତ ଭାବରେ ବନ୍ଦ ହୋଇଯାଇଛି" -#: ../cli/src/connections.c:1144 +#: ../cli/src/connections.c:1145 msgid "the VPN service returned invalid configuration" msgstr "VPN ସର୍ଭିସ ଅବୈଧ ସଂରଚନା ଫେରାଇଛି" -#: ../cli/src/connections.c:1146 +#: ../cli/src/connections.c:1147 msgid "the connection attempt timed out" msgstr "ସଂଯୋଗ ସମୟ ସମାପ୍ତ ପାଇଁ ଚେଷ୍ଟାକରିଛି" -#: ../cli/src/connections.c:1148 +#: ../cli/src/connections.c:1149 msgid "the VPN service did not start in time" msgstr "VPN ସର୍ଭିସ ଠିକ ସମୟରେ ଆରମ୍ଭ ହୋଇନଥିଲା" -#: ../cli/src/connections.c:1150 +#: ../cli/src/connections.c:1151 msgid "the VPN service failed to start" msgstr "VPN ସର୍ଭିସ ଆରମ୍ଭ ହେବାରେ ବିଫଳ ହୋଇଛି" -#: ../cli/src/connections.c:1152 +#: ../cli/src/connections.c:1153 msgid "no valid VPN secrets" msgstr "କୌଣସି ବୈଧ VPN ଗୁପ୍ତ ତଥ୍ୟ ନାହିଁ" -#: ../cli/src/connections.c:1154 +#: ../cli/src/connections.c:1155 msgid "invalid VPN secrets" msgstr "ଅବୈଧ VPN ଗୁପ୍ତ ତଥ୍ୟଗୁଡ଼ିକ" -#: ../cli/src/connections.c:1156 +#: ../cli/src/connections.c:1157 msgid "the connection was removed" msgstr "ସଂଯୋଗକୁ କଢ଼ାଯାଇଛି" -#: ../cli/src/connections.c:1170 +#: ../cli/src/connections.c:1171 #, c-format msgid "state: %s\n" msgstr "ଅବସ୍ଥା: %s\n" -#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#: ../cli/src/connections.c:1174 ../cli/src/connections.c:1200 #, c-format msgid "Connection activated\n" msgstr "ସଂଯୋଗ ସକ୍ରିୟ ହୋଇଛି\n" -#: ../cli/src/connections.c:1176 +#: ../cli/src/connections.c:1177 #, c-format msgid "Error: Connection activation failed." msgstr "ତ୍ରୁଟି: ସଂଯୋଗ ସକ୍ରିୟଣ ବିଫଳ ହୋଇଛି।" -#: ../cli/src/connections.c:1195 +#: ../cli/src/connections.c:1196 #, c-format msgid "state: %s (%d)\n" msgstr "ଅବସ୍ଥା: %s (%d)\n" -#: ../cli/src/connections.c:1205 +#: ../cli/src/connections.c:1206 #, c-format msgid "Error: Connection activation failed: %s." msgstr "ତ୍ରୁଟି: ସଂଯୋଗ ସକ୍ରିୟଣ ବିଫଳ ହୋଇଛି: %s." -#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#: ../cli/src/connections.c:1223 ../cli/src/devices.c:909 #, c-format msgid "Error: Timeout %d sec expired." msgstr "ତ୍ରୁଟି: ସମୟ ସମାପ୍ତ %d ସେକଣ୍ଡ ବିତିଯାଇଛି।" -#: ../cli/src/connections.c:1265 +#: ../cli/src/connections.c:1266 #, c-format msgid "Error: Connection activation failed: %s" msgstr "ତ୍ରୁଟି: ସଂଯୋଗ ସକ୍ରିୟଣ ବିଫଳ ହୋଇଛି: %s" -#: ../cli/src/connections.c:1279 +#: ../cli/src/connections.c:1280 #, c-format msgid "Error: Obtaining active connection for '%s' failed." msgstr "ତ୍ରୁଟି: '%s' ପାଇଁ ସକ୍ରିୟ ସଂଯୋଗ ଧାରଣ କରିବାରେ ବିଫଳ ହୋଇଛି।" -#: ../cli/src/connections.c:1288 +#: ../cli/src/connections.c:1289 #, c-format msgid "Active connection state: %s\n" msgstr "ସକ୍ରିୟ ସଂଯୋଗ ଅବସ୍ଥା: %s\n" -#: ../cli/src/connections.c:1289 +#: ../cli/src/connections.c:1290 #, c-format msgid "Active connection path: %s\n" msgstr "ସକ୍ରିୟ ସଂଯୋଗ ପଥ: %s\n" -#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#: ../cli/src/connections.c:1344 ../cli/src/connections.c:1465 #, c-format msgid "Error: Unknown connection: %s." msgstr "ତ୍ରୁଟି: ଅଜଣା ସଂଯୋଗ: %s." -#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#: ../cli/src/connections.c:1379 ../cli/src/devices.c:980 #, c-format msgid "Error: timeout value '%s' is not valid." msgstr "ତ୍ରୁଟି: ସମୟ ସମାପ୍ତ ମୂଲ୍ୟ '%s' ଟି ବୈଧ ନୁହଁ।" -#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#: ../cli/src/connections.c:1392 ../cli/src/connections.c:1482 #, c-format msgid "Error: id or uuid has to be specified." msgstr "ତ୍ରୁଟି: id କିମ୍ବା uuid କୁ ଉଲ୍ଲେଖ କରିବା ଉଚିତ।" -#: ../cli/src/connections.c:1411 +#: ../cli/src/connections.c:1412 #, c-format msgid "Error: No suitable device found: %s." msgstr "ତ୍ରୁଟି: କୌଣସି ଉପଯୁକ୍ତ ଉପକରଣ ମିଳିଲାନାହିଁ: %s." -#: ../cli/src/connections.c:1413 +#: ../cli/src/connections.c:1414 #, c-format msgid "Error: No suitable device found." msgstr "ତ୍ରୁଟି: କୌଣସି ଉପଯୁକ୍ତ ଉପକରଣ ମିଳିଲାନାହିଁ।" -#: ../cli/src/connections.c:1505 +#: ../cli/src/connections.c:1509 #, c-format msgid "Warning: Connection not active\n" msgstr "ଚେତାବନୀ: ସଂଯୋଗ ସକ୍ରିୟ ନୁହଁ\n" -#: ../cli/src/connections.c:1561 +#: ../cli/src/connections.c:1566 #, c-format msgid "Error: 'con' command '%s' is not valid." msgstr "ତ୍ରୁଟି: 'con' ନିର୍ଦ୍ଦେଶ '%s' ଟି ବୈଧ ନୁହଁ।" -#: ../cli/src/connections.c:1597 +#: ../cli/src/connections.c:1602 #, c-format msgid "Error: could not connect to D-Bus." msgstr "ତ୍ରୁଟି: D-Bus ସହିତ ସଂଯୁକ୍ତ ହୋଇପାରିଲା ନାହିଁ।" -#: ../cli/src/connections.c:1604 +#: ../cli/src/connections.c:1609 #, c-format msgid "Error: Could not get system settings." msgstr "ତ୍ରୁଟି: ତନ୍ତ୍ର ସଂରଚନା ପାଇଲା ନାହିଁ।" -#: ../cli/src/connections.c:1612 +#: ../cli/src/connections.c:1617 #, c-format msgid "Error: Could not get user settings." msgstr "ତ୍ରୁଟି: ଚାଳକ ସଂରଚନା ପାଇଲା ନାହିଁ।" -#: ../cli/src/connections.c:1622 +#: ../cli/src/connections.c:1627 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "ତ୍ରୁଟି: ସଂଯୋଗ ଧାରଣ କରିପାରିବେ ନାହିଁ: ବିନ୍ୟାସ ସର୍ଭିସଗୁଡ଼ିକ ଚାଲୁନାହିଁ।" #. 0 #. 9 -#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +#: ../cli/src/devices.c:61 ../cli/src/devices.c:89 ../cli/src/devices.c:184 msgid "DEVICE" msgstr "DEVICE" #. 1 #. 4 #. 0 -#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/devices.c:63 ../cli/src/devices.c:93 #: ../cli/src/network-manager.c:36 msgid "STATE" msgstr "STATE" -#: ../cli/src/devices.c:71 +#: ../cli/src/devices.c:72 msgid "GENERAL" msgstr "GENERAL" #. 0 -#: ../cli/src/devices.c:72 +#: ../cli/src/devices.c:73 msgid "CAPABILITIES" msgstr "CAPABILITIES" #. 1 -#: ../cli/src/devices.c:73 +#: ../cli/src/devices.c:74 msgid "WIFI-PROPERTIES" msgstr "WIFI-PROPERTIES" #. 2 -#: ../cli/src/devices.c:74 +#: ../cli/src/devices.c:75 msgid "AP" msgstr "AP" #. 3 -#: ../cli/src/devices.c:75 +#: ../cli/src/devices.c:76 msgid "WIRED-PROPERTIES" msgstr "WIRED-PROPERTIES" #. 4 -#: ../cli/src/devices.c:76 +#: ../cli/src/devices.c:77 msgid "IP4-SETTINGS" msgstr "IP4-SETTINGS" #. 5 -#: ../cli/src/devices.c:77 +#: ../cli/src/devices.c:78 msgid "IP4-DNS" msgstr "IP4-DNS" +#. 6 +#: ../cli/src/devices.c:79 +#| msgid "IP4-SETTINGS" +msgid "IP6-SETTINGS" +msgstr "IP6-SETTINGS" + +#. 7 +#: ../cli/src/devices.c:80 +#| msgid "IP4-DNS" +msgid "IP6-DNS" +msgstr "IP6-DNS" + #. 2 -#: ../cli/src/devices.c:88 +#: ../cli/src/devices.c:91 msgid "DRIVER" msgstr "DRIVER" #. 3 -#: ../cli/src/devices.c:89 +#: ../cli/src/devices.c:92 msgid "HWADDR" msgstr "HWADDR" #. 0 -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:102 msgid "CARRIER-DETECT" msgstr "CARRIER-DETECT" #. 1 -#: ../cli/src/devices.c:100 +#: ../cli/src/devices.c:103 msgid "SPEED" msgstr "SPEED" #. 0 -#: ../cli/src/devices.c:109 +#: ../cli/src/devices.c:112 msgid "CARRIER" msgstr "CARRIER" #. 0 -#: ../cli/src/devices.c:119 +#: ../cli/src/devices.c:122 msgid "WEP" msgstr "WEP" #. 1 -#: ../cli/src/devices.c:120 +#: ../cli/src/devices.c:123 msgid "WPA" msgstr "WPA" #. 2 -#: ../cli/src/devices.c:121 +#: ../cli/src/devices.c:124 msgid "WPA2" msgstr "WPA2" #. 3 -#: ../cli/src/devices.c:122 +#: ../cli/src/devices.c:125 msgid "TKIP" msgstr "TKIP" #. 4 -#: ../cli/src/devices.c:123 +#: ../cli/src/devices.c:126 msgid "CCMP" msgstr "CCMP" #. 0 -#: ../cli/src/devices.c:132 +#: ../cli/src/devices.c:135 ../cli/src/devices.c:146 msgid "ADDRESS" msgstr "ADDRESS" #. 1 -#: ../cli/src/devices.c:133 +#: ../cli/src/devices.c:136 ../cli/src/devices.c:147 msgid "PREFIX" msgstr "PREFIX" #. 2 -#: ../cli/src/devices.c:134 +#: ../cli/src/devices.c:137 ../cli/src/devices.c:148 msgid "GATEWAY" msgstr "GATEWAY" #. 0 -#: ../cli/src/devices.c:143 +#: ../cli/src/devices.c:157 ../cli/src/devices.c:166 msgid "DNS" msgstr "DNS" #. 0 -#: ../cli/src/devices.c:153 +#: ../cli/src/devices.c:175 msgid "SSID" msgstr "SSID" #. 1 -#: ../cli/src/devices.c:154 +#: ../cli/src/devices.c:176 msgid "BSSID" msgstr "BSSID" #. 2 -#: ../cli/src/devices.c:155 +#: ../cli/src/devices.c:177 msgid "MODE" msgstr "MODE" #. 3 -#: ../cli/src/devices.c:156 +#: ../cli/src/devices.c:178 msgid "FREQ" msgstr "FREQ" #. 4 -#: ../cli/src/devices.c:157 +#: ../cli/src/devices.c:179 msgid "RATE" msgstr "RATE" #. 5 -#: ../cli/src/devices.c:158 +#: ../cli/src/devices.c:180 msgid "SIGNAL" msgstr "SIGNAL" #. 6 -#: ../cli/src/devices.c:159 +#: ../cli/src/devices.c:181 msgid "SECURITY" msgstr "SECURITY" #. 7 -#: ../cli/src/devices.c:160 +#: ../cli/src/devices.c:182 msgid "WPA-FLAGS" msgstr "WPA-FLAGS" #. 8 -#: ../cli/src/devices.c:161 +#: ../cli/src/devices.c:183 msgid "RSN-FLAGS" msgstr "RSN-FLAGS" #. 10 -#: ../cli/src/devices.c:163 +#: ../cli/src/devices.c:185 msgid "ACTIVE" msgstr "ACTIVE" -#: ../cli/src/devices.c:186 +#: ../cli/src/devices.c:208 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -641,204 +653,205 @@ msgstr "" " wifi [list [iface ] [hwaddr ]]\n" "\n" -#: ../cli/src/devices.c:206 +#: ../cli/src/devices.c:228 msgid "unmanaged" msgstr "ଅପରିଚାଳିତ" -#: ../cli/src/devices.c:208 +#: ../cli/src/devices.c:230 msgid "unavailable" msgstr "ଅନୁପଲବ୍ଧ" -#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:89 msgid "disconnected" msgstr "ସଂଯୋଗ ବିଚ୍ଛିନ୍ନ ହୋଇଛି" -#: ../cli/src/devices.c:212 +#: ../cli/src/devices.c:234 msgid "connecting (prepare)" msgstr "ସଂଯୋଗ କରୁଅଛି (ପ୍ରସ୍ତୁତ)" -#: ../cli/src/devices.c:214 +#: ../cli/src/devices.c:236 msgid "connecting (configuring)" msgstr "ସଂଯୋଗ କରୁଅଛି (ବିନ୍ୟାସ କରୁଅଛି)" -#: ../cli/src/devices.c:216 +#: ../cli/src/devices.c:238 msgid "connecting (need authentication)" msgstr "ସଂଯୋଗ କରୁଅଛି (ବୈଧିକରଣ ଆବଶ୍ୟକ)" -#: ../cli/src/devices.c:218 +#: ../cli/src/devices.c:240 msgid "connecting (getting IP configuration)" msgstr "ସଂଯୋଗ କରୁଅଛି (IP ସଂରଚନା ଗ୍ରହଣ କରୁଅଛି)" -#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:87 msgid "connected" msgstr "ସଂଯୋଗ ସ୍ଥାପିତ ହେଲା" -#: ../cli/src/devices.c:222 +#: ../cli/src/devices.c:244 msgid "connection failed" msgstr "ସଂଯୋଗ ବିଫଳ ହୋଇଛି" -#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +#: ../cli/src/devices.c:267 ../cli/src/devices.c:424 msgid "Unknown" msgstr "ଅଜଣା" -#: ../cli/src/devices.c:277 +#: ../cli/src/devices.c:299 msgid "(none)" msgstr "(କିଛି ନାହିଁ)" -#: ../cli/src/devices.c:302 +#: ../cli/src/devices.c:324 #, c-format msgid "%s: error converting IP4 address 0x%X" msgstr "%s: IP4 ଠିକଣା 0x%X କୁ ପରିବର୍ତ୍ତନ କରିବାରେ ତ୍ରୁଟି" -#: ../cli/src/devices.c:349 +#: ../cli/src/devices.c:393 #, c-format msgid "%u MHz" msgstr "%u MHz" -#: ../cli/src/devices.c:350 +#: ../cli/src/devices.c:394 #, c-format msgid "%u MB/s" msgstr "%u MB/s" -#: ../cli/src/devices.c:359 +#: ../cli/src/devices.c:403 msgid "Encrypted: " msgstr "ସଂଗୁପ୍ତ: " -#: ../cli/src/devices.c:364 +#: ../cli/src/devices.c:408 msgid "WEP " msgstr "WEP " -#: ../cli/src/devices.c:366 +#: ../cli/src/devices.c:410 msgid "WPA " msgstr "WPA " -#: ../cli/src/devices.c:368 +#: ../cli/src/devices.c:412 msgid "WPA2 " msgstr "WPA2 " -#: ../cli/src/devices.c:371 +#: ../cli/src/devices.c:415 msgid "Enterprise " msgstr "ବାଣିଜ୍ୟିକ" -#: ../cli/src/devices.c:380 +#: ../cli/src/devices.c:424 msgid "Ad-Hoc" msgstr "ଏଡ-ହୋକ" -#: ../cli/src/devices.c:380 +#: ../cli/src/devices.c:424 msgid "Infrastructure" msgstr "ଅବସଂରଚନା" -#: ../cli/src/devices.c:442 +#: ../cli/src/devices.c:486 #, c-format msgid "Error: 'dev list': %s" msgstr "ତ୍ରୁଟି: 'dev list': %s" -#: ../cli/src/devices.c:444 +#: ../cli/src/devices.c:488 #, c-format msgid "Error: 'dev list': %s; allowed fields: %s" msgstr "ତ୍ରୁଟି: 'dev list': %s; ଅନୁମତିପ୍ରାପ୍ତ କ୍ଷେତ୍ରଗୁଡ଼ିକ: %s" -#: ../cli/src/devices.c:453 +#: ../cli/src/devices.c:497 msgid "Device details" msgstr "ଉପକରଣ ବିବରଣୀ" -#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +#: ../cli/src/devices.c:527 ../cli/src/devices.c:925 msgid "(unknown)" msgstr "(ଅଜଣା)" -#: ../cli/src/devices.c:484 +#: ../cli/src/devices.c:528 msgid "unknown)" msgstr "ଅଜଣା)" -#: ../cli/src/devices.c:510 +#: ../cli/src/devices.c:554 #, c-format msgid "%u Mb/s" msgstr "%u Mb/s" #. Print header #. "WIRED-PROPERTIES" -#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:627 msgid "on" msgstr "ଚାଲୁ" -#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:627 msgid "off" msgstr "ବନ୍ଦ" -#: ../cli/src/devices.c:710 +#: ../cli/src/devices.c:808 #, c-format msgid "Error: 'dev status': %s" msgstr "ତ୍ରୁଟି: 'dev status': %s" -#: ../cli/src/devices.c:712 +#: ../cli/src/devices.c:810 #, c-format msgid "Error: 'dev status': %s; allowed fields: %s" msgstr "ତ୍ରୁଟି: 'dev status': %s; ଅନୁମତିପ୍ରାପ୍ତ କ୍ଷେତ୍ରଗୁଡ଼ିକ: %s" -#: ../cli/src/devices.c:719 +#: ../cli/src/devices.c:817 msgid "Status of devices" msgstr "ଉପକରଣର ସ୍ଥିତି" -#: ../cli/src/devices.c:747 +#: ../cli/src/devices.c:845 #, c-format msgid "Error: '%s' argument is missing." msgstr "ତ୍ରୁଟି: '%s' ସ୍ୱତନ୍ତ୍ରଚର ଅନୁପସ୍ଥିତ।" -#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#: ../cli/src/devices.c:874 ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: Device '%s' not found." msgstr "ତ୍ରୁଟି: ଉପକରଣ '%s' ମିଳିଲା ନାହିଁ।" -#: ../cli/src/devices.c:799 +#: ../cli/src/devices.c:897 #, c-format msgid "Success: Device '%s' successfully disconnected." msgstr "ସଫଳ: ଉପକରଣ '%s' ସଫଳତାର ସହିତ ସଂଯୋଗ ବିଚ୍ଛିନ୍ନ ହୋଇଛି।" -#: ../cli/src/devices.c:824 +#: ../cli/src/devices.c:922 #, c-format msgid "Error: Device '%s' (%s) disconnecting failed: %s" msgstr "ତ୍ରୁଟି: ଉପକରଣ '%s' (%s) ସଂଯୋଗ ବିଚ୍ଛିନ୍ନ ବିଫଳ ହୋଇଛି: %s" -#: ../cli/src/devices.c:832 +#: ../cli/src/devices.c:930 #, c-format msgid "Device state: %d (%s)\n" msgstr "ଉପକରଣ ସ୍ଥିତି: %d (%s)\n" -#: ../cli/src/devices.c:896 +#: ../cli/src/devices.c:994 #, c-format msgid "Error: iface has to be specified." msgstr "ତ୍ରୁଟି: iface କୁ ଉଲ୍ଲେଖ କରାଯିବା ଉଚିତ।" -#: ../cli/src/devices.c:1011 +#: ../cli/src/devices.c:1112 #, c-format msgid "Error: 'dev wifi': %s" msgstr "ତ୍ରୁଟି: 'dev wifi': %s" -#: ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1114 #, c-format msgid "Error: 'dev wifi': %s; allowed fields: %s" msgstr "ତ୍ରୁଟି: 'dev wifi': %s; ଅନୁମତିପ୍ରାପ୍ତ କ୍ଷେତ୍ରଗୁଡ଼ିକ: %s" -#: ../cli/src/devices.c:1020 +#: ../cli/src/devices.c:1121 msgid "WiFi scan list" msgstr "WiFi କ୍ରମବୀକ୍ଷଣ ତାଲିକା" -#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#: ../cli/src/devices.c:1156 ../cli/src/devices.c:1210 #, c-format msgid "Error: Access point with hwaddr '%s' not found." msgstr "ତ୍ରୁଟି: hwaddr '%s' ସହିତ ଅଭିଗମ୍ୟତା ବିନ୍ଦୁ ମିଳିଲା ନାହିଁ।" -#: ../cli/src/devices.c:1072 +#: ../cli/src/devices.c:1173 #, c-format msgid "Error: Device '%s' is not a WiFi device." msgstr "ତ୍ରୁଟି: ଉପକରଣ '%s' ଟି ଗୋଟିଏ WiFi ଉପକରଣ ନୁହଁ।" -#: ../cli/src/devices.c:1136 +#: ../cli/src/devices.c:1237 #, c-format msgid "Error: 'dev wifi' command '%s' is not valid." msgstr "ତ୍ରୁଟି: 'dev wifi' ନିର୍ଦ୍ଦେଶ '%s' ଟି ବୈଧ ନୁହଁ।" -#: ../cli/src/devices.c:1183 +#: ../cli/src/devices.c:1284 #, c-format msgid "Error: 'dev' command '%s' is not valid." msgstr "ତ୍ରୁଟି: 'dev' ନିର୍ଦ୍ଦେଶ '%s' ଟି ବୈଧ ନୁହଁ।" @@ -1477,26 +1490,26 @@ msgstr "PKCS#12 ଫାଇଲକୁ ଯାଞ୍ଚ କରିହେଲାନା msgid "Could not generate random data." msgstr "ମନଇଚ୍ଛା ତଥ୍ୟକୁ ଅବସଂକେତ କରିହେଲା ନାହିଁ।" -#: ../libnm-util/nm-utils.c:1925 +#: ../libnm-util/nm-utils.c:1975 #, c-format msgid "Not enough memory to make encryption key." msgstr "ବିକୋଡ଼ନ କି କୁ ନିର୍ମାଣ କରିବା ପାଇଁ ଯଥେଷ୍ଟ ସ୍ମୃତି ସ୍ଥାନ ନାହିଁ।" -#: ../libnm-util/nm-utils.c:2035 +#: ../libnm-util/nm-utils.c:2085 msgid "Could not allocate memory for PEM file creation." msgstr "PEM ଫାଇଲ ନିର୍ମାଣ ପାଇଁ ସ୍ମୃତି ସ୍ଥାନ ବଣ୍ଟନ କରିପାରିଲା ନାହିଁ।" -#: ../libnm-util/nm-utils.c:2047 +#: ../libnm-util/nm-utils.c:2097 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "PEM ଫାଇଲରେ IV ଲେଖିବା ପାଇଁ ସ୍ମୃତି ସ୍ଥାନ ବଣ୍ଟନ କରିପାରିଲା ନାହିଁ।" -#: ../libnm-util/nm-utils.c:2059 +#: ../libnm-util/nm-utils.c:2109 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "PEM ଫାଇଲରେ ସଂଗୁପ୍ତ କି ଲେଖିବା ପାଇଁ ସ୍ମୃତି ସ୍ଥାନ ବଣ୍ଟନ କରିପାରିଲା ନାହିଁ।" -#: ../libnm-util/nm-utils.c:2078 +#: ../libnm-util/nm-utils.c:2128 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "PEM ଫାଇଲ ତଥ୍ୟକୁ ବଣ୍ଟନ କରିପାରିଲା ନାହିଁ।" @@ -1558,16 +1571,14 @@ msgid "" "Put NetworkManager to sleep or wake it up (should only be used by system " "power management)" msgstr "" -"NetworkManager କୁ ସୁପ୍ତ କିମ୍ବା ଜାଗ୍ରତ ରଖନ୍ତୁ (କେବଳ ତନ୍ତ୍ର ଶକ୍ତି ପରିଚାଳନା " -"ଦ୍ୱାରା ବ୍ୟବହାର ହେବା ଉଚିତ)" +"NetworkManager କୁ ସୁପ୍ତ କିମ୍ବା ଜାଗ୍ରତ ରଖନ୍ତୁ (କେବଳ ତନ୍ତ୍ର ଶକ୍ତି ପରିଚାଳନା ଦ୍ୱାରା ବ୍ୟବହାର " +"ହେବା ଉଚିତ)" #: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 -#| msgid "System policy prevents modification of system settings" msgid "System policy prevents control of network connections" msgstr "ତନ୍ତ୍ର ନିତୀ ନେଟୱର୍କ ସଂଯୋଗଗୁଡ଼ିକର ନିୟନ୍ତ୍ରଣକୁ ବାରଣ କରିଥାଏ" #: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 -#| msgid "System policy prevents sharing connections via an open WiFi network" msgid "System policy prevents enabling or disabling WiFi devices" msgstr "ତନ୍ତ୍ର ନିତୀ WiFi ଉପକରଣଗୁଡ଼ିକୁ ସକ୍ରିୟ କିମ୍ବା ନିଷ୍କ୍ରିୟ ହେବାରୁ ବାରଣ କରିଥାଏ" @@ -1576,7 +1587,6 @@ msgid "System policy prevents enabling or disabling mobile broadband devices" msgstr "ତନ୍ତ୍ର ନିତୀ ମୋବାଇଲ ବ୍ରୋଡବ୍ୟାଣ୍ଡ ଉପକରଣଗୁଡ଼ିକୁ ସକ୍ରିୟ କିମ୍ବା ନିଷ୍କ୍ରିୟ ହେବାରୁ ବାରଣ କରିଥାଏ" #: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 -#| msgid "System policy prevents modification of system settings" msgid "System policy prevents enabling or disabling system networking" msgstr "ତନ୍ତ୍ର ନିତୀ ତନ୍ତ୍ର ନେଟୱର୍କିଙ୍ଗକୁ ସକ୍ରିୟ କିମ୍ବା ନିଷ୍କ୍ରିୟ ହେବାରୁ ବାରଣ କରିଥାଏ" @@ -1585,7 +1595,6 @@ msgid "System policy prevents putting NetworkManager to sleep or waking it up" msgstr "ତନ୍ତ୍ର ନିତୀ NetworkManager କୁ ସୁପ୍ତ କିମ୍ବା ଜାଗ୍ରତ ରହିବାରୁ ବାରଣ କରିଥାଏ" #: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 -#| msgid "System policy prevents modification of system settings" msgid "System policy prevents use of user-specific connections" msgstr "ତନ୍ତ୍ର ନିତୀ ତନ୍ତ୍ର-ନିର୍ଦ୍ଦିଷ୍ଟ ସଂଯୋଗଗୁଡ଼ିକୁ ବାରଣ କରିଥାଏ" @@ -1634,16 +1643,16 @@ msgstr "ସଂଯୋଗ କ୍ୟାଶେ ଅଦ୍ୟତନ କରିବାର msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "ଅବୈଧ ବିକଳ୍ପ. ବୈଧ ବିକଳ୍ପର ତାଲିକା ଦେଖିବା ପାଇଁ ଦୟାକରି --ସହାୟତା ବ୍ୟବହାର କରନ୍ତୁ.\n" -#: ../src/main.c:568 +#: ../src/main.c:573 #, c-format msgid "%s. Please use --help to see a list of valid options.\n" msgstr "%s. ବୈଧ ବିକଳ୍ପର ତାଲିକା ଦେଖିବା ପାଇଁ ଦୟାକରି --help ବ୍ୟବହାର କରନ୍ତୁ।\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:324 msgid "# Created by NetworkManager\n" msgstr "# NetworkManager ଦ୍ୱାରା ନିର୍ମିତ\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:340 #, c-format msgid "" "# Merged from %s\n" @@ -1652,19 +1661,19 @@ msgstr "" "# %s ରୁ ମିଶ୍ରିତ\n" "\n" -#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 msgid "no usable DHCP client could be found." msgstr "କୌଣସି ଉପଯୋଗୀ DHCP କ୍ଲାଏଣ୍ଟ ମିଳିଲା ନାହିଁ।" -#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 msgid "'dhclient' could be found." msgstr "'dhclient' ମିଳି ପାରିଲା।" -#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 msgid "'dhcpcd' could be found." msgstr "'dhcpcd' ମିଳିପାରିଲା।" -#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 #, c-format msgid "unsupported DHCP client '%s'" msgstr "ଅସମର୍ଥିତ DHCP କ୍ଲାଏଣ୍ଟ '%s'" @@ -1679,11 +1688,11 @@ msgstr "ଅଜ୍ଞାତ ଲଗ ସ୍ତର '%s'" msgid "Unknown log domain '%s'" msgstr "ଅଜ୍ଞାତ ଲଗ ଡମେନ '%s'" -#: ../src/named-manager/nm-named-manager.c:350 +#: ../src/named-manager/nm-named-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "ଟିପ୍ପଣୀ: libc resolver 3 ରୁ ଅଧିକ nameserverଗୁଡ଼ିକୁ ସମର୍ଥନ କରିନପାରେ." -#: ../src/named-manager/nm-named-manager.c:352 +#: ../src/named-manager/nm-named-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "ନିମ୍ନରେ ତାଲିକାଭୁକ୍ତ nameserverଗୁଡ଼ିକୁ ଚିହ୍ନି ହୋଇନପାରେ." @@ -1692,7 +1701,7 @@ msgstr "ନିମ୍ନରେ ତାଲିକାଭୁକ୍ତ nameserverଗୁ msgid "Auto %s" msgstr "ସ୍ୱୟଂ %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3275 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3412 msgid "System" msgstr "ତନ୍ତ୍ର" -- cgit v1.2.1 From 373ca906003694ee1cf50dee9b22c959fe4802d7 Mon Sep 17 00:00:00 2001 From: Andika Triwidada Date: Tue, 10 Aug 2010 13:02:14 -0500 Subject: po: updated Indonesian translation (bgo #626510) --- po/id.po | 2175 ++++++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 1464 insertions(+), 711 deletions(-) diff --git a/po/id.po b/po/id.po index 82d1f2348b..74f4c66418 100644 --- a/po/id.po +++ b/po/id.po @@ -1,963 +1,1716 @@ # Indonesian translation for network-manager -# Copyright (c) 2007 Rosetta Contributors and Canonical Ltd 2007 +# Copyright (C) 2010 THE network-manager'S COPYRIGHT HOLDER # This file is distributed under the same license as the network-manager package. -# Andika Triwidada , 2007. +# Andika Triwidada , 2010. # msgid "" msgstr "" -"Project-Id-Version: network-manager\n" -"POT-Creation-Date: 2007-04-13 11:43+0000\n" -"PO-Revision-Date: 2007-04-21 11:10+0000\n" +"Project-Id-Version: network-manager master\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-08-10 03:25+0000\n" +"PO-Revision-Date: 2010-08-10 16:04+0700\n" "Last-Translator: Andika Triwidada \n" -"Language-Team: Indonesian \n" +"Language-Team: GNOME Indonesian Translation Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=(0);\n" -"X-Rosetta-Export-Date: 2007-05-01 15:50:07+0000\n" +"X-Poedit-Language: Indonesian\n" +"X-Poedit-Country: Indonesia\n" + +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/devices.c:88 ../cli/src/devices.c:101 ../cli/src/devices.c:111 +#: ../cli/src/devices.c:121 ../cli/src/devices.c:134 ../cli/src/devices.c:145 +#: ../cli/src/devices.c:156 ../cli/src/devices.c:165 ../cli/src/devices.c:174 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:61 ../cli/src/connections.c:76 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:62 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:63 ../cli/src/connections.c:78 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:64 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:65 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:66 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:67 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:77 ../cli/src/devices.c:62 ../cli/src/devices.c:90 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:80 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:81 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:82 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:158 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Cara pakai: nmcli con { PERINTAH | help }\n" +" PERINTAH := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" -#: ../gnome/applet/applet-compat.c:171 ../gnome/applet/applet-dbus-info.c:915 +#: ../cli/src/connections.c:198 ../cli/src/connections.c:537 #, c-format -msgid "Passphrase for wireless network %s" -msgstr "Frasa-kunci untuk jaringan nirkabel %s" +msgid "Error: 'con list': %s" +msgstr "Galat: 'con list': %s" -#: ../gnome/applet/applet-dbus.c:265 +#: ../cli/src/connections.c:200 ../cli/src/connections.c:539 #, c-format -msgid "Connection to the wireless network '%s' failed." -msgstr "Koneksi ke jaringan nirkabel '%s' gagal." +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Galat: 'con list': %s; ruas yang diijinkan: %s" + +#: ../cli/src/connections.c:208 +msgid "Connection details" +msgstr "Rincian koneksi" + +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 +msgid "system" +msgstr "system" + +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 +msgid "user" +msgstr "user" + +#: ../cli/src/connections.c:384 +msgid "never" +msgstr "never" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:551 ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 +msgid "yes" +msgstr "ya" + +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:510 ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 ../cli/src/settings.c:1224 +msgid "no" +msgstr "tidak" + +#: ../cli/src/connections.c:458 ../cli/src/connections.c:501 +msgid "System connections" +msgstr "Koneksi sistem" + +#: ../cli/src/connections.c:463 ../cli/src/connections.c:514 +msgid "User connections" +msgstr "Koneksi pengguna" + +#: ../cli/src/connections.c:475 ../cli/src/connections.c:1335 +#: ../cli/src/connections.c:1351 ../cli/src/connections.c:1360 +#: ../cli/src/connections.c:1371 ../cli/src/connections.c:1456 +#: ../cli/src/devices.c:962 ../cli/src/devices.c:972 ../cli/src/devices.c:1074 +#: ../cli/src/devices.c:1081 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Galat: argumen %s hilang." -#: ../gnome/applet/applet-dbus.c:270 -msgid "Connection to the wired network failed." -msgstr "Koneksi ke jaringan berkabel gagal." +#: ../cli/src/connections.c:488 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Galat: %s - koneksi tak ada." -#: ../gnome/applet/applet.c:184 -msgid "Error displaying connection information:" -msgstr "Kesalahan menampilkan informasi sambungan:" +#: ../cli/src/connections.c:520 ../cli/src/connections.c:1384 +#: ../cli/src/connections.c:1474 ../cli/src/devices.c:785 +#: ../cli/src/devices.c:852 ../cli/src/devices.c:986 ../cli/src/devices.c:1087 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Parameter tak dikenal: %s\n" -#: ../gnome/applet/applet.c:202 -msgid "Could not find some required resources (the glade file)!" -msgstr "" -"Tidak dapat menemukan beberapa sumberdaya yang diperlukan (berkas glade)!" +#: ../cli/src/connections.c:529 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Galat: tak ada parameter valid yang dinyatakan." -#: ../gnome/applet/applet.c:213 -msgid "No active connections!" -msgstr "Tidak ada koneksi aktif!" +#: ../cli/src/connections.c:544 ../cli/src/connections.c:1577 +#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "Galat: %s." -#: ../gnome/applet/applet.c:234 +#: ../cli/src/connections.c:650 #, c-format -msgid "Wired Ethernet (%s)" -msgstr "Ethernet Berkabel (%s)" +msgid "Error: 'con status': %s" +msgstr "Galat: 'con status': %s" -#: ../gnome/applet/applet.c:236 +#: ../cli/src/connections.c:652 #, c-format -msgid "Wireless Ethernet (%s)" -msgstr "Ethernet Nirkabel (%s)" +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Galat: 'con status': %s; ruas yang diijinkan: %s" -#: ../gnome/applet/applet.c:332 ../gnome/applet/applet.c:358 -msgid "NetworkManager Applet" -msgstr "Applet NetworkManager" +#: ../cli/src/connections.c:659 +msgid "Active connections" +msgstr "Koneksi aktif" -#: ../gnome/applet/applet.c:334 -msgid "" -"Copyright © 2004-2006 Red Hat, Inc.\n" -"Copyright © 2005-2006 Novell, Inc." -msgstr "" -"Hak Cipta © 2004-2006 Red Hat, Inc.\n" -"Hak Cipta © 2005-2006 Novell, Inc." +#: ../cli/src/connections.c:1027 +#, c-format +msgid "no active connection on device '%s'" +msgstr "tak ada koneksi aktif pada perangkat '%s'" -#: ../gnome/applet/applet.c:336 ../gnome/applet/applet.c:362 -msgid "" -"Notification area applet for managing your network devices and connections." -msgstr "" -"Applet wilayah notifikasi untuk mengelola perangkat dan koneksi jaringan." +#: ../cli/src/connections.c:1035 +#, c-format +msgid "no active connection or device" +msgstr "tak ada koneksi atau perangkat aktif " + +#: ../cli/src/connections.c:1085 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "perangkat '%s' tak kompatibel dengan koneksi '%s'" -#: ../gnome/applet/applet.c:339 ../gnome/applet/applet.c:366 -msgid "translator-credits" -msgstr "Andika Triwidada , 2007." +#: ../cli/src/connections.c:1087 +#, c-format +msgid "no device found for connection '%s'" +msgstr "tak ditemukan perangkat bagi koneksi '%s'" -#: ../gnome/applet/applet.c:360 -msgid "" -"Copyright © 2004-2005 Red Hat, Inc.\n" -"Copyright © 2005-2006 Novell, Inc." -msgstr "" -"Hak Cipta © 2004-2005 Red Hat, Inc.\n" -"Hak Cipta © 2005-2006 Novell, Inc." +#: ../cli/src/connections.c:1098 +msgid "activating" +msgstr "mengaktifkan" + +#: ../cli/src/connections.c:1100 +msgid "activated" +msgstr "diaktifkan" + +#: ../cli/src/connections.c:1103 ../cli/src/connections.c:1126 +#: ../cli/src/connections.c:1159 ../cli/src/devices.c:246 +#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:473 +msgid "unknown" +msgstr "tak diketahui" + +#: ../cli/src/connections.c:1112 +msgid "VPN connecting (prepare)" +msgstr "VPN sedang menyiapkan" + +#: ../cli/src/connections.c:1114 +msgid "VPN connecting (need authentication)" +msgstr "VPN sedang menyambung (perlu otentikasi)" + +#: ../cli/src/connections.c:1116 +msgid "VPN connecting" +msgstr "VPN sedang menyambung" + +#: ../cli/src/connections.c:1118 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN sedang menyambung (sedang mengambil konfigurasi IP)" + +#: ../cli/src/connections.c:1120 +msgid "VPN connected" +msgstr "VPN terhubung" + +#: ../cli/src/connections.c:1122 +msgid "VPN connection failed" +msgstr "Sambungan VPN gagal" + +#: ../cli/src/connections.c:1124 +msgid "VPN disconnected" +msgstr "VPN diputus" + +#: ../cli/src/connections.c:1135 +msgid "unknown reason" +msgstr "alasan tidak diketahui" + +#: ../cli/src/connections.c:1137 +msgid "none" +msgstr "tidak ada" + +#: ../cli/src/connections.c:1139 +msgid "the user was disconnected" +msgstr "pengguna diputus" -#: ../gnome/applet/applet.c:422 -msgid "VPN Login Failure" -msgstr "Kegagalan Login VPN" +#: ../cli/src/connections.c:1141 +msgid "the base network connection was interrupted" +msgstr "koneksi jaringan dasar terputus" -#: ../gnome/applet/applet.c:423 +#: ../cli/src/connections.c:1143 +msgid "the VPN service stopped unexpectedly" +msgstr "layanan VPN berhenti secara tak terduga" + +#: ../cli/src/connections.c:1145 +msgid "the VPN service returned invalid configuration" +msgstr "layanan VPN mengembalikan konfigurasi yang tak valid" + +#: ../cli/src/connections.c:1147 +msgid "the connection attempt timed out" +msgstr "usaha koneksi kehabisan waktu" + +#: ../cli/src/connections.c:1149 +msgid "the VPN service did not start in time" +msgstr "layanan VPN tak mulai pada waktunya" + +#: ../cli/src/connections.c:1151 +msgid "the VPN service failed to start" +msgstr "layanan VPN gagal dimulai" + +#: ../cli/src/connections.c:1153 +msgid "no valid VPN secrets" +msgstr "tak ada rahasia VPN yang valid" + +#: ../cli/src/connections.c:1155 +msgid "invalid VPN secrets" +msgstr "rahasia VPN tak valid" + +#: ../cli/src/connections.c:1157 +msgid "the connection was removed" +msgstr "koneksi dihapus" + +#: ../cli/src/connections.c:1171 #, c-format -msgid "Could not start the VPN connection '%s' due to a login failure." -msgstr "Tidak dapat memulai koneksi VPN '%s' karena sebuah kegagalan login." +msgid "state: %s\n" +msgstr "keadaan: %s\n" -#: ../gnome/applet/applet.c:427 -msgid "VPN Start Failure" -msgstr "Kegagalan Memulai VPN" +#: ../cli/src/connections.c:1174 ../cli/src/connections.c:1200 +#, c-format +msgid "Connection activated\n" +msgstr "Koneksi diaktifkan\n" -#: ../gnome/applet/applet.c:428 +#: ../cli/src/connections.c:1177 #, c-format -msgid "" -"Could not start the VPN connection '%s' due to a failure launching the VPN " -"program." -msgstr "" -"Tidak dapat memulai koneksi VPN '%s' karena kegagalan menjalankan program " -"VPN." +msgid "Error: Connection activation failed." +msgstr "Galat: Aktivasi koneksi gagal." -#: ../gnome/applet/applet.c:432 ../gnome/applet/applet.c:442 -msgid "VPN Connect Failure" -msgstr "Kegagalan Koneksi VPN" +#: ../cli/src/connections.c:1196 +#, c-format +msgid "state: %s (%d)\n" +msgstr "keadaan: %s (%d)\n" -#: ../gnome/applet/applet.c:433 +#: ../cli/src/connections.c:1206 #, c-format -msgid "Could not start the VPN connection '%s' due to a connection error." -msgstr "Tidak dapat memulai koneksi VPN '%s' karena kesalahan sambungan." +msgid "Error: Connection activation failed: %s." +msgstr "Galat: Aktivasi koneksi gagal: %s." -#: ../gnome/applet/applet.c:437 -msgid "VPN Configuration Error" -msgstr "Kesalahan Konfigurasi VPN" +#: ../cli/src/connections.c:1223 ../cli/src/devices.c:909 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Galat: Timeout %d detik telah berlalu." -#: ../gnome/applet/applet.c:438 +#: ../cli/src/connections.c:1266 #, c-format -msgid "The VPN connection '%s' was not correctly configured." -msgstr "Koneksi VPN '%s' tidak dikonfigurasi dengan benar." +msgid "Error: Connection activation failed: %s" +msgstr "Galat: Aktivasi koneksi gagal: %s" -#: ../gnome/applet/applet.c:443 +#: ../cli/src/connections.c:1280 #, c-format -msgid "" -"Could not start the VPN connection '%s' because the VPN server did not " -"return an adequate network configuration." -msgstr "" -"Tidak dapat memulai koneksi VPN '%s' karena server VPN tidak mengembalikan " -"konfigurasi jaringan yang cukup." +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Galat: Memperoleh koneksi aktif bagi '%s' gagal." -#: ../gnome/applet/applet.c:513 -msgid "VPN Login Message" -msgstr "Pesan Login VPN" +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Keadaan koneksi aktif: %s\n" -#: ../gnome/applet/applet.c:737 ../gnome/applet/applet.c:2549 -#: ../gnome/applet/other-network-dialog.c:453 -#: ../gnome/applet/passphrase-dialog.c:228 -msgid "" -"The NetworkManager Applet could not find some required resources (the glade " -"file was not found)." -msgstr "" -"Applet NetworkManager tidak dapat menemukan beberapa sumberdaya yang " -"diperlukan (berkas glade tidak ditemukan)." +#: ../cli/src/connections.c:1290 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Path koneksi aktif: %s\n" -#: ../gnome/applet/applet.c:749 +#: ../cli/src/connections.c:1344 ../cli/src/connections.c:1465 #, c-format -msgid "The network device \"%s (%s)\" does not support wireless scanning." -msgstr "Perangkat jaringan \"%s (%s)\" tidak mendukung pelarikan nirkabel." +msgid "Error: Unknown connection: %s." +msgstr "Galat: Koneksi tak dikenal: %s." -#: ../gnome/applet/applet.c:757 +#: ../cli/src/connections.c:1379 ../cli/src/devices.c:980 #, c-format -msgid "The network device \"%s (%s)\" does not support link detection." -msgstr "Perangkat jaringan \"%s (%s)\" tidak mendukung deteksi link." +msgid "Error: timeout value '%s' is not valid." +msgstr "Galat: nilai timeout '%s' tak valid." -#: ../gnome/applet/applet.c:903 +#: ../cli/src/connections.c:1392 ../cli/src/connections.c:1482 #, c-format -msgid "Preparing device %s for the wired network..." -msgstr "Sedang menyiapkan perangkat %s untuk jaringan berkabel..." +msgid "Error: id or uuid has to be specified." +msgstr "Galat: id atau uuid mesti dinyatakan." -#: ../gnome/applet/applet.c:905 +#: ../cli/src/connections.c:1412 #, c-format -msgid "Preparing device %s for the wireless network '%s'..." -msgstr "Menyiapkan perangkat %s untuk jaringan nirkabel '%s'..." +msgid "Error: No suitable device found: %s." +msgstr "Galat: tak ditemukan perangkat yang cocok: %s." -#: ../gnome/applet/applet.c:913 +#: ../cli/src/connections.c:1414 #, c-format -msgid "Configuring device %s for the wired network..." -msgstr "Mengkonfigur perangkat %s untuk jaringan berkabel..." +msgid "Error: No suitable device found." +msgstr "Galat: tak ditemukan perangkat yang cocok." -#: ../gnome/applet/applet.c:915 +#: ../cli/src/connections.c:1509 #, c-format -msgid "Attempting to join the wireless network '%s'..." -msgstr "Sedang berupaya bergabung ke jaringan nirkabel '%s'..." +msgid "Warning: Connection not active\n" +msgstr "Peringatan: Sambungan tak aktif\n" -#: ../gnome/applet/applet.c:923 +#: ../cli/src/connections.c:1566 #, c-format -msgid "Waiting for Network Key for the wireless network '%s'..." -msgstr "Menunggu Kunci Jaringan untuk jaringan nirkabel '%s'..." +msgid "Error: 'con' command '%s' is not valid." +msgstr "Galat: 'con' perintah '%s' tak valid." -#: ../gnome/applet/applet.c:931 ../gnome/applet/applet.c:941 -msgid "Requesting a network address from the wired network..." -msgstr "Meminta alamat jaringan dari jaringan berkabel..." +#: ../cli/src/connections.c:1602 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Galat: tak bisa menyambung ke D-Bus." -#: ../gnome/applet/applet.c:933 ../gnome/applet/applet.c:943 +#: ../cli/src/connections.c:1609 #, c-format -msgid "Requesting a network address from the wireless network '%s'..." -msgstr "Meminta sebuah alamat jaringan dari jaringan nirkabel '%s'..." +msgid "Error: Could not get system settings." +msgstr "Galat: Tak bisa memperoleh tatanan sistem." -#: ../gnome/applet/applet.c:951 -msgid "Finishing connection to the wired network..." -msgstr "Menyelesaikan koneksi ke jaringan berkabel..." +#: ../cli/src/connections.c:1617 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Galat: Tak bisa memperoleh tatanan pengguna." -#: ../gnome/applet/applet.c:953 +#: ../cli/src/connections.c:1627 #, c-format -msgid "Finishing connection to the wireless network '%s'..." -msgstr "Mengakhiri koneksi ke jaringan nirkabel '%s'..." +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "Galat: Tak bisa mendapat koneksi: layanan penataan tak berjalan." + +#. 0 +#. 9 +#: ../cli/src/devices.c:61 ../cli/src/devices.c:89 ../cli/src/devices.c:184 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:63 ../cli/src/devices.c:93 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:72 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:73 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 +#: ../cli/src/devices.c:74 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:75 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:76 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:77 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:78 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 6 +#: ../cli/src/devices.c:79 +msgid "IP6-SETTINGS" +msgstr "IP6-SETTINGS" + +#. 7 +#: ../cli/src/devices.c:80 +msgid "IP6-DNS" +msgstr "IP6-DNS" + +#. 2 +#: ../cli/src/devices.c:91 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:92 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:102 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:103 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:112 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:122 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:123 +msgid "WPA" +msgstr " WPA" + +#. 2 +#: ../cli/src/devices.c:124 +msgid "WPA2" +msgstr " WPA2" + +#. 3 +#: ../cli/src/devices.c:125 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:126 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:135 ../cli/src/devices.c:146 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:136 ../cli/src/devices.c:147 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:137 ../cli/src/devices.c:148 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:157 ../cli/src/devices.c:166 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:175 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:176 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:177 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:178 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:179 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:180 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:181 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:182 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:183 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:185 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:208 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"Cara pakai: nmcli dev { PERINTAH | help }\n" +"\n" +" PERINTAH := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:228 +msgid "unmanaged" +msgstr "tak dikelola" + +#: ../cli/src/devices.c:230 +msgid "unavailable" +msgstr "tak tersedia" -#: ../gnome/applet/applet.c:1070 -msgid "NetworkManager is not running" -msgstr "NetworkManager tidak sedang jalan" +#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "terputus" -#: ../gnome/applet/applet.c:1078 ../gnome/applet/applet.c:1864 -msgid "Networking disabled" -msgstr "Fungsi jaringan dimatikan" +#: ../cli/src/devices.c:234 +msgid "connecting (prepare)" +msgstr "sedang menyambung (bersiap)" -#: ../gnome/applet/applet.c:1083 -msgid "No network connection" -msgstr "Tidak ada koneksi jaringan" +#: ../cli/src/devices.c:236 +msgid "connecting (configuring)" +msgstr "sedang menyambung (sedang menata)" -#: ../gnome/applet/applet.c:1088 -msgid "Manual network configuration" -msgstr "Konfigurasi jaringan manual" +#: ../cli/src/devices.c:238 +msgid "connecting (need authentication)" +msgstr "sedang menyambung (perlu otentikasi)" -#: ../gnome/applet/applet.c:1090 -msgid "Wired network connection" -msgstr "Koneksi jaringan berkabel" +#: ../cli/src/devices.c:240 +msgid "connecting (getting IP configuration)" +msgstr "sedang menyambung (sedang mengambil konfigurasi IP)" -#: ../gnome/applet/applet.c:1094 -msgid "Connected to an Ad-Hoc wireless network" -msgstr "Telah tersambung ke jaringan nirkabel Ad-Hoc" +#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "terhubung" -#: ../gnome/applet/applet.c:1096 +#: ../cli/src/devices.c:244 +msgid "connection failed" +msgstr "koneksi gagal" + +#: ../cli/src/devices.c:267 ../cli/src/devices.c:424 +msgid "Unknown" +msgstr "Tak dikenal" + +#: ../cli/src/devices.c:299 +msgid "(none)" +msgstr "(tidak ada)" + +#: ../cli/src/devices.c:324 #, c-format -msgid "Wireless network connection to '%s' (%d%%)" -msgstr "Koneksi jaringan nirkabel ke '%s' (%d%%)" +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: galat mengubah alamat IP4 0x%X" -#: ../gnome/applet/applet.c:1117 +#: ../cli/src/devices.c:393 #, c-format -msgid "VPN connection to '%s'" -msgstr "Koneksi VPN ke '%s'" +msgid "%u MHz" +msgstr "%u MHz" -#: ../gnome/applet/applet.c:1125 +#: ../cli/src/devices.c:394 #, c-format -msgid "VPN connecting to '%s'" -msgstr "Sedang menyambung VPN ke '%s\"" +msgid "%u MB/s" +msgstr "%u MB/s" -#: ../gnome/applet/applet.c:1555 -msgid "_Connect to Other Wireless Network..." -msgstr "Sambung ke Jaringan Nirkabel Lain..." +#: ../cli/src/devices.c:403 +msgid "Encrypted: " +msgstr "Terenkripsi:" -#: ../gnome/applet/applet.c:1576 -msgid "Create _New Wireless Network..." -msgstr "Buat Jaringan Nirkabel Baru" +#: ../cli/src/devices.c:408 +msgid "WEP " +msgstr "WEP " -#: ../gnome/applet/applet.c:1695 -msgid "_Manual configuration..." -msgstr "Konfigurasi manual..." +#: ../cli/src/devices.c:410 +msgid "WPA " +msgstr "WPA " -#: ../gnome/applet/applet.c:1718 -msgid "_VPN Connections" -msgstr "Sambungan VPN" +#: ../cli/src/devices.c:412 +msgid "WPA2 " +msgstr "WPA2 " -#: ../gnome/applet/applet.c:1763 -msgid "_Configure VPN..." -msgstr "Mengkonfigur VPN..." +#: ../cli/src/devices.c:415 +msgid "Enterprise " +msgstr "Enterprise " -#: ../gnome/applet/applet.c:1767 -msgid "_Disconnect VPN..." -msgstr "Memutus VPN..." +#: ../cli/src/devices.c:424 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" -#: ../gnome/applet/applet.c:1789 -msgid "_Dial Up Connections" -msgstr "Koneksi Dial Up" +#: ../cli/src/devices.c:424 +msgid "Infrastructure" +msgstr "Infrastruktur" -#: ../gnome/applet/applet.c:1800 +#: ../cli/src/devices.c:486 #, c-format -msgid "Connect to %s..." -msgstr "Menyambung ke %s..." +msgid "Error: 'dev list': %s" +msgstr "Galat: 'dev list': %s" -#: ../gnome/applet/applet.c:1806 +#: ../cli/src/devices.c:488 #, c-format -msgid "Disconnect from %s..." -msgstr "Memutus dari %s..." +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Galat: 'dev list': %s; ruas yang diijinkan: %s" -#: ../gnome/applet/applet.c:1856 -msgid "No network devices have been found" -msgstr "Tidak menemukan perangkat jaringan" +#: ../cli/src/devices.c:497 +msgid "Device details" +msgstr "Rincian perangkat" -#: ../gnome/applet/applet.c:2051 -msgid "NetworkManager is not running..." -msgstr "NetworkManager tidak sedang jalan..." +#: ../cli/src/devices.c:527 ../cli/src/devices.c:925 +msgid "(unknown)" +msgstr "(tak diketahui)" -#: ../gnome/applet/applet.c:2208 -msgid "Enable _Networking" -msgstr "Fungsikan Jaringan" +#: ../cli/src/devices.c:528 +msgid "unknown)" +msgstr "tak diketahui)" -#: ../gnome/applet/applet.c:2214 -msgid "Enable _Wireless" -msgstr "Fungsikan Nirkabel" +#: ../cli/src/devices.c:554 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" -#: ../gnome/applet/applet.c:2220 -msgid "Connection _Information" -msgstr "Informasi Koneksi" +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:627 +msgid "on" +msgstr "nyala" -#: ../gnome/applet/applet.c:2231 -msgid "_Help" -msgstr "Bantuan" +#: ../cli/src/devices.c:627 +msgid "off" +msgstr "mati" -#: ../gnome/applet/applet.c:2240 -msgid "_About" -msgstr "_Ihwal" +#: ../cli/src/devices.c:808 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "Galat: 'dev status': %s" -#: ../gnome/applet/applet.c:2708 -msgid "" -"The NetworkManager applet could not find some required resources. It cannot " -"continue.\n" -msgstr "" -"Applet NetworkManager tidak dapat menemukan beberapa sumberdaya yang " -"diperlukan. Tidak dapat melanjutkan.\n" +#: ../cli/src/devices.c:810 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Galat: 'dev status': %s; ruas yang diijinkan: %s" -#: ../gnome/applet/wireless-security-option.c:157 -msgid "Open System" -msgstr "Sistem Terbuka" +#: ../cli/src/devices.c:817 +msgid "Status of devices" +msgstr "Status perangkat" -#: ../gnome/applet/wireless-security-option.c:160 -msgid "Shared Key" -msgstr "Kunci Bersama" +#: ../cli/src/devices.c:845 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Galat: argumen '%s' hilang." -#: ../gnome/applet/wireless-security-option.c:208 -msgid "Automatic (Default)" -msgstr "Otomatis (Default)" +#: ../cli/src/devices.c:874 ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Galat: Perangkat '%s' tak ditemukan." -#: ../gnome/applet/wireless-security-option.c:215 -msgid "AES-CCMP" -msgstr "AES-CCMP" +#: ../cli/src/devices.c:897 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Sukses: Perangkat '%s' diputus dengan sukses." -#: ../gnome/applet/wireless-security-option.c:223 -msgid "TKIP" -msgstr "TKIP" +#: ../cli/src/devices.c:922 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Galat: Pemutusan perangkat '%s' (%s) gagal: %s " -#: ../gnome/applet/wireless-security-option.c:231 -msgid "Dynamic WEP" -msgstr "WEP Dinamis" +#: ../cli/src/devices.c:930 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Keadaan perangkat: %d (%s)\n" -#: ../gnome/applet/wso-none.c:53 -msgid "None" -msgstr "Tak Ada" +#: ../cli/src/devices.c:994 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Galat: iface mesti dinyatakan." -#: ../gnome/applet/wso-wep-ascii.c:138 -msgid "WEP 64/128-bit ASCII" -msgstr "WEP ASCII 64/128-bit" +#: ../cli/src/devices.c:1112 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "Galat: 'dev wifi': %s" -#: ../gnome/applet/wso-wep-hex.c:135 -msgid "WEP 64/128-bit Hex" -msgstr "WEP Hex 64/128-bit" +#: ../cli/src/devices.c:1114 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Galat: 'dev wifi': %s; ruas yang diijinkan: %s" -#: ../gnome/applet/wso-wep-passphrase.c:135 -msgid "WEP 128-bit Passphrase" -msgstr "Frasa-kunci WEP 128-bit" +#: ../cli/src/devices.c:1121 +msgid "WiFi scan list" +msgstr "Daftar pindai WiFi" -#: ../gnome/applet/wso-wpa-eap.c:237 -msgid "PEAP" -msgstr "PEAP" +#: ../cli/src/devices.c:1156 ../cli/src/devices.c:1210 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Galat: Access point dengan hwaddr '%s' tak ditemukan." -#: ../gnome/applet/wso-wpa-eap.c:238 -msgid "TLS" -msgstr "TLS" +#: ../cli/src/devices.c:1173 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Galat: Perangkat '%s' bukan perangkat WiFi." -#: ../gnome/applet/wso-wpa-eap.c:239 -msgid "TTLS" -msgstr "TTLS" +#: ../cli/src/devices.c:1237 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Galat: 'dev wifi' perintah '%s' tak valid." -#: ../gnome/applet/wso-wpa-eap.c:247 ../src/nm-ap-security-wpa-eap.c:93 -#: ../src/nm-ap-security-wpa-eap.c:117 -msgid "WPA2 Enterprise" -msgstr "WPA2 Enterprise" +#: ../cli/src/devices.c:1284 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Galat: 'dev' perintah '%s' tak valid." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "RUNNING" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Cara pakai: nmcli nm { PERINTAH | help }\n" +"\n" +" PERINTAH := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" -#: ../gnome/applet/wso-wpa-eap.c:249 ../src/nm-ap-security-wpa-eap.c:95 -#: ../src/nm-ap-security-wpa-eap.c:122 -msgid "WPA Enterprise" -msgstr "WPA Enterprise" +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "mengantuk" -#: ../gnome/applet/wso-wpa-psk.c:178 -msgid "WPA2 Personal" -msgstr "WPA2 Personal" +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "menyambung" -#: ../gnome/applet/wso-wpa-psk.c:180 -msgid "WPA Personal" -msgstr "WPA Personal" +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Galat: 'nm status': %s" -#: ../gnome/applet/eggtrayicon.c:134 -msgid "Orientation" -msgstr "Orientasi" +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Galat: 'nm status': %s; ruas yang diijinkan: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "Status NetworkManager" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "diaktifkan" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "dimatikan" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "berjalan" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "tak berjalan" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Galat: nilai '--fields' '%s' tak valid disini; ruas yang diijinkan: %s" -#: ../gnome/applet/eggtrayicon.c:135 -msgid "The orientation of the tray." -msgstr "Orientasi dari tray" +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi diaktifkan" -#: ../gnome/applet/menu-items.c:88 +#: ../cli/src/network-manager.c:220 #, c-format -msgid "Wired Network (%s)" -msgstr "Jaringan Berkabel (%s)" +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Galat: parameter 'wifi' tak valid: '%s'." -#: ../gnome/applet/menu-items.c:91 -msgid "_Wired Network" -msgstr "Jaringan Berkabel" +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN diaktifkan" -#: ../gnome/applet/menu-items.c:162 +#: ../cli/src/network-manager.c:252 #, c-format -msgid "Wireless Network (%s)" -msgid_plural "Wireless Networks (%s)" -msgstr[0] "Jaringan Nirkabel (%s)" +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Galat: parameter 'wwan' tak valid: '%s'." -#: ../gnome/applet/menu-items.c:164 -msgid "Wireless Network" -msgid_plural "Wireless Networks" -msgstr[0] "Jaringan Nirkabel" - -#: ../gnome/applet/menu-items.c:343 -msgid " (invalid Unicode)" -msgstr " (Unicode yang salah)" +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Galat: 'nm' perintah '%s' tak valid." -#: ../gnome/applet/other-network-dialog.c:352 +#: ../cli/src/nmcli.c:69 #, c-format msgid "" -"By default, the wireless network's name is set to your computer's name, %s, " -"with no encryption enabled" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" msgstr "" -"Secara default, nama jaringan nirkabel disamakan dengan nama komputer anda, " -"%s, tanpa enkripsi" +"Cara pakai: %s [OPSI] OBJEK { PERINTAH | help }\n" +"\n" +"OPSI\n" +" -t[erse] keluaran terinci\n" +" -p[retty] keluaran rapi\n" +" -m[ode] tabular|multiline mode keluaran\n" +" -f[ields] |all|common nyatakan ruas yang ditampilkan\n" +" -e[scape] yes|no pemisah kolom escape di nilai\n" +" -v[ersion] tampilkan versi program\n" +" -h[elp] cetak bantuan ini\n" +"\n" +"OBJEK\n" +" nm status NetworkManager\n" +" con sambungan NetworkManager\n" +" dev perangkat yang dikelola oleh NetworkManager\n" +"\n" -#: ../gnome/applet/other-network-dialog.c:358 -msgid "Create new wireless network" -msgstr "Buat jaringan nirkabel baru" +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Galat: Objek '%s' tak dikenal, coba 'nmcli help'." -#: ../gnome/applet/other-network-dialog.c:359 -msgid "" -"Enter the name and security settings of the wireless network you wish to " -"create." -msgstr "" -"Masukkan nama dan pengaturan keamanan dari jaringan nirkabel yang akan anda " -"buat." +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Galat: Opsi '--terse' dinyatakan kedua kali." -#: ../gnome/applet/other-network-dialog.c:363 -msgid "Create New Wireless Network" -msgstr "Buat Jaringan Nirkabel Baru" +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Galat: Opsi '--terse' eksklusif mutual dengan '--pretty'." -#: ../gnome/applet/other-network-dialog.c:368 -msgid "Existing wireless network" -msgstr "Jaringan nirkabel yang telah ada" +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Galat: Opsi '--pretty' dinyatakan kedua kali." -#: ../gnome/applet/other-network-dialog.c:369 -msgid "Enter the name of the wireless network to which you wish to connect." -msgstr "Masukkan nama jaringan nirkabel yang ingin anda hubungi." +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Galat: Opsi '--pretty' eksklusif mutual dengan '--terse'." -#: ../gnome/applet/other-network-dialog.c:371 -msgid "Connect to Other Wireless Network" -msgstr "Menyambung ke Jaringan Nirkabel Lain" +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Galat: argumen hilang bagi opsi '%s'." -#: ../gnome/applet/passphrase-dialog.c:215 -msgid "Error connecting to wireless network" -msgstr "Kesalahan menyambung ke jaringan nirkabel" +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Galat: '%s' bukan argumen yang valid bagi opsi '%s'." -#: ../gnome/applet/passphrase-dialog.c:216 -msgid "" -"The requested wireless network requires security capabilities unsupported by " -"your hardware." -msgstr "" -"Jaringan nirkabel yang diminta memerlukan kapabilitas keamanan yang tidak " -"didukung oleh perangkat keras anda." +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Galat: ruas bagi opsi '%s' hilang." -#: ../gnome/applet/vpn-password-dialog.c:151 -#: ../gnome/applet/vpn-password-dialog.c:188 +#: ../cli/src/nmcli.c:209 #, c-format -msgid "Cannot start VPN connection '%s'" -msgstr "Tidak dapat memulai sambungan VPN '%s'" +msgid "nmcli tool, version %s\n" +msgstr "alat nmcli, versi %s\n" -#: ../gnome/applet/vpn-password-dialog.c:154 +#: ../cli/src/nmcli.c:215 #, c-format -msgid "" -"Could not find the authentication dialog for VPN connection type '%s'. " -"Contact your system administrator." -msgstr "" -"Tidak dapat menemukan dialog autentikasi untuk koneksi VPN tipe '%s'. " -"Hubungi administrator sistem anda." +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Galat: Opsi '%s' tak dikenal, coba 'nmcli -help'." -#: ../gnome/applet/vpn-password-dialog.c:191 +#: ../cli/src/nmcli.c:234 #, c-format -msgid "" -"There was a problem launching the authentication dialog for VPN connection " -"type '%s'. Contact your system administrator." -msgstr "" -"Ada masalah ketika menjalankan dialog autentikasi untuk koneksi VPN tipe " -"'%s'. Hubungi administrator sistem anda." +msgid "Caught signal %d, shutting down..." +msgstr "Menangkap sinyal %d, sedang mematikan..." -#: ../gnome/applet/applet.glade.h:1 -msgid " " -msgstr " " +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Galat: Tak bisa menyambung ke NetworkManager." -#: ../gnome/applet/applet.glade.h:2 -msgid "" -"Active Connection Information" -msgstr "" -"Informasi Sambungan Aktif" +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "Sukses" -#: ../gnome/applet/applet.glade.h:4 -#, no-c-format -msgid "" -"Passphrase Required by Wireless " -"Network\n" -"\n" -"A passphrase or encryption key is required to access the wireless network " -"'%s'." -msgstr "" -"Frasa-kunci Diperlukan oleh Jaringan " -"Nirkabel" +#: ../cli/src/settings.c:411 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (kunci-hex-ascii)" -#: ../gnome/applet/applet.glade.h:8 -#, no-c-format -msgid "" -"Reduced Network Functionality\n" -"\n" -"%s It will not be completely functional." -msgstr "" -"Fungsionalitas Jaringan yang " -"Dikurangi\n" -"\n" -"%s Ini tidak akan fungsional secara lengkap." +#: ../cli/src/settings.c:413 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-bit frasa sandi)" -#: ../gnome/applet/applet.glade.h:12 -#, no-c-format -msgid "" -"Wireless Network Login " -"Confirmation\n" -"\n" -"You have chosen to log in to the wireless network '%s'. If you are sure " -"that this wireless network is secure, click the checkbox below and " -"NetworkManager will not require confirmation on subsequent log ins." -msgstr "" -"Konfirmasi Login Jaringan " -"Nirkabel\n" -"\n" -"Anda telah memilih untuk login ke jaringan nirkabel '%s'. Bila anda yakin " -"bahwa jaringan nirkabel ini aman, klik checkbox di bawah dan NetworkManager " -"akan tidak meminta konfirmasi pada login berikutnya." +#: ../cli/src/settings.c:416 +#, c-format +msgid "%d (unknown)" +msgstr "%d (tak dikenal)" -#: ../gnome/applet/applet.glade.h:15 -msgid "Anonymous Identity:" -msgstr "Identitas Anonim:" +#: ../cli/src/settings.c:442 +msgid "0 (unknown)" +msgstr "0 (tak dikenal)" -#: ../gnome/applet/applet.glade.h:16 -msgid "Authentication:" -msgstr "Autentikasi:" +#: ../cli/src/settings.c:448 +msgid "any, " +msgstr "sebarang, " -#: ../gnome/applet/applet.glade.h:17 -msgid "Broadcast Address:" -msgstr "Alamat Broadcast:" +#: ../cli/src/settings.c:450 +msgid "900 MHz, " +msgstr "900 MHz, " -#: ../gnome/applet/applet.glade.h:18 -msgid "CA Certificate File:" -msgstr "Berkas Sertifikat CA:" +#: ../cli/src/settings.c:452 +msgid "1800 MHz, " +msgstr "1800 MHz, " -#: ../gnome/applet/applet.glade.h:19 -msgid "C_onnect" -msgstr "Sambung" +#: ../cli/src/settings.c:454 +msgid "1900 MHz, " +msgstr "1900 MHz, " -#: ../gnome/applet/applet.glade.h:20 -msgid "Client Certificate File:" -msgstr "Berkas Sertifikat Klien:" +#: ../cli/src/settings.c:456 +msgid "850 MHz, " +msgstr "850 MHz, " -#: ../gnome/applet/applet.glade.h:21 -msgid "Connection Information" -msgstr "Informasi Koneksi" +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " -#: ../gnome/applet/applet.glade.h:22 -msgid "Default Route:" -msgstr "Route Default:" +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " -#: ../gnome/applet/applet.glade.h:23 -msgid "Destination Address:" -msgstr "Alamat Tujuan:" +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " -#: ../gnome/applet/applet.glade.h:24 -msgid "Driver:" -msgstr "Driver:" +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " -#: ../gnome/applet/applet.glade.h:25 -msgid "EAP Method:" -msgstr "Metoda EAP:" +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " -#: ../gnome/applet/applet.glade.h:26 -msgid "Hardware Address:" -msgstr "Alamat Perangkat Keras:" +#: ../cli/src/settings.c:468 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " -#: ../gnome/applet/applet.glade.h:27 -msgid "IP Address:" -msgstr "Alamat IP:" +#: ../cli/src/settings.c:470 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " -#: ../gnome/applet/applet.glade.h:28 -msgid "Identity:" -msgstr "Identitas:" +#: ../cli/src/settings.c:554 ../cli/src/settings.c:721 +msgid "auto" +msgstr "otomatis" -#: ../gnome/applet/applet.glade.h:29 -msgid "Interface:" -msgstr "Antarmuka:" +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 +msgid "not set" +msgstr "tak ditata" -#: ../gnome/applet/applet.glade.h:30 -msgid "Key Type:" -msgstr "Tipe Kunci:" +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "ruas '%s' mesti sendiri" -#: ../gnome/applet/applet.glade.h:31 -msgid "Key:" -msgstr "Kunci:" +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "ruas tak valid '%s'" -#: ../gnome/applet/applet.glade.h:32 -msgid "" -"None\n" -"WEP 128-bit Passphrase\n" -"WEP 64/128-bit Hex\n" -"WEP 64/128-bit ASCII\n" -msgstr "" -"Tidak ada\n" -"Frasa-kunci WEP 128-bit\n" -"WEP Hex 64/128-bit\n" -"WEP ASCII 64/128-bit\n" +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Opsi '--terse' memerlukan penyataan '--fields'" -#: ../gnome/applet/applet.glade.h:37 -msgid "" -"Open System\n" -"Shared Key" -msgstr "" -"Sistem Terbuka\n" -"Kunci Bersama" +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "Opsi '--terse' memerlukan nilai opsi '--fields' spesifik, bukan '%s'" -#: ../gnome/applet/applet.glade.h:39 -msgid "Other Wireless Network..." -msgstr "Jaringan Nirkabel Lain..." +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "Berkas kunci PEM tak memiliki tag akhir '%s'." -#: ../gnome/applet/applet.glade.h:40 -msgid "Passphrase:" -msgstr "Frasa-kunci:" +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Tak seperti sebuah berkas kunci privat PEM." -#: ../gnome/applet/applet.glade.h:41 -msgid "Password:" -msgstr "Kata sandi:" +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Tak cukup memori untuk menyimpan data berkas PEM." -#: ../gnome/applet/applet.glade.h:42 -msgid "Primary DNS:" -msgstr "DNS Utama:" +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Berkas PEM rusak: Proc-Type bukan tag pertama." -#: ../gnome/applet/applet.glade.h:43 -msgid "Private Key File:" -msgstr "Berkas Kunci Privat:" +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Berkas PEM rusak: tag Proc-Type tak dikenal '%s'." -#: ../gnome/applet/applet.glade.h:44 -msgid "Private Key Password:" -msgstr "Kata sandi Kunci Privat:" +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Berkas PEM rusak: DEK-Info bukan tag kedua." -#: ../gnome/applet/applet.glade.h:45 -msgid "Secondary DNS:" -msgstr "DNS Sekunder" +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Berkas PEM rusak: tak ditemukan IV di tag DEK-Info." -#: ../gnome/applet/applet.glade.h:46 -msgid "Select the CA Certificate File" -msgstr "Pilih Berkas Sertifikat CA" +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "Berkas PEM rusak: bentuk IV tak valid di tag DEK-Info." -#: ../gnome/applet/applet.glade.h:47 -msgid "Select the Client Certificate File" -msgstr "Pilih Berkas Sertifikat Klien" +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Berkas PEM rusak: cipher kunci privat '%s' tak dikenal." -#: ../gnome/applet/applet.glade.h:48 -msgid "Select the Private Key File" -msgstr "Pilih Berkas Kunci Privat" +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "Tak bisa mengawa kode (decode) kunci privat." -#: ../gnome/applet/applet.glade.h:49 -msgid "Show key" -msgstr "Tampilkan Kunci" +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "Sertifikat PEM '%s' tak memiliki tag akhir '%s'." -#: ../gnome/applet/applet.glade.h:50 -msgid "Show passphrase" -msgstr "Tampilkan frasa-kunci" +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "Gagal mengawa kode (decode) sertifikat." -#: ../gnome/applet/applet.glade.h:51 -msgid "Show password" -msgstr "Tampilkan kata sandi" +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Tak cukup memori untuk menyimpan data sertifikat." -#: ../gnome/applet/applet.glade.h:52 -msgid "Show passwords" -msgstr "Tampilkan kata sandi" +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "Tak cukup memori untuk menyimpan data berkas." -#: ../gnome/applet/applet.glade.h:53 -msgid "Speed:" -msgstr "Kecepatan:" +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "Panjang IV dalam byte mesti merupakan bilangan genap." -#: ../gnome/applet/applet.glade.h:54 -msgid "Subnet Mask:" -msgstr "Mask Subnet:" +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Tak cukup memori untuk menyimpan IV." -#: ../gnome/applet/applet.glade.h:55 -msgid "Type:" -msgstr "Tipe:" +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV memuat digit bukan heksadesimal." -#: ../gnome/applet/applet.glade.h:56 -msgid "User Name:" -msgstr "Nama Pemakai:" +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Cipher kunci privat '%s' tak dikenal." -#: ../gnome/applet/applet.glade.h:57 -msgid "Wireless Network Key Required" -msgstr "Kunci Jaringan Nirkabel Dibutuhkan" +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "Tak cukup memori untuk mengawa sandi (decrypt) kunci privat." -#: ../gnome/applet/applet.glade.h:58 -msgid "Wireless _adapter:" -msgstr "Adaptor Nirkabel:" +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "Tak bisa menentukan jenis kunci privat." -#: ../gnome/applet/applet.glade.h:59 -msgid "_Always Trust this Wireless Network" -msgstr "Selalu Percayai Jaringan Nirkabel ini" +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "" +"Tak cukup memori untuk menyimpan kunci privat terawa sandi (decrypted)." -#: ../gnome/applet/applet.glade.h:60 -msgid "_Don't remind me again" -msgstr "Jangan mengingatkan saya lagi" +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "Gagal menginisialisasi mesin kripto." -#: ../gnome/applet/applet.glade.h:61 -msgid "_Login to Network" -msgstr "_Login ke Jaringan" +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Gagal menginisialisasi mesin MD5: %s / %s." -#: ../gnome/applet/applet.glade.h:62 -msgid "_Network Name:" -msgstr "_Nama Jarigan:" +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Panjang IV tak valid (mesti paling tidak %zd)." -#: ../gnome/applet/applet.glade.h:63 -msgid "_Wireless Security:" -msgstr "Keamanan Nirkabel:" +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Tak cukup memori untuk penyangga kunci terawa sandi (decrypted)." -#: ../gnome/vpn-properties/nm-vpn-properties.c:383 -msgid "Cannot add VPN connection" -msgstr "Tidak dapat menambah koneksi VPN" +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "" +"Gagal menginisialisasi konteks cipher pengawasandian (decryption): %s / %s." -#: ../gnome/vpn-properties/nm-vpn-properties.c:385 -msgid "" -"No suitable VPN software was found on your system. Contact your system " -"administrator." +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." msgstr "" -"Tidak ada perangkat lunak VPN yang sesuai yang dapat ditemukan di sistem " -"anda. Hubungi administrator sistem anda." +"Gagal menata kunci simetrik untuk pengawasandian (decryption): %s / %s." -#: ../gnome/vpn-properties/nm-vpn-properties.c:437 -msgid "Cannot import VPN connection" -msgstr "Tidak dapat meng-impor koneksi VPN" +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Gagal menata IV untuk pengawasandian (decryption): %s / %s." -#: ../gnome/vpn-properties/nm-vpn-properties.c:439 +#: ../libnm-util/crypto_gnutls.c:200 #, c-format -msgid "" -"Cannot find suitable software for VPN connection type '%s' to import the " -"file '%s'. Contact your system administrator." +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Gagal mengawa sandi (decrypt) kunci privat: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." msgstr "" -"Tidak dapat menemukan perangkat lunak untuk koneksi VPN tipe '%s' untuk meng-" -"impor berkas '%s'. Hubungi administrator sistem anda." +"Gagal mengawa sandi (decrypt) kunci privat: panjang padding tak diharapkan." -#: ../gnome/vpn-properties/nm-vpn-properties.c:579 +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 #, c-format -msgid "Error retrieving VPN connection '%s'" -msgstr "Kesalahan dalam mengambil koneksi VPN '%s'" +msgid "Failed to decrypt the private key." +msgstr "Gagal mengawa sandi (decrypt) kunci privat." -#: ../gnome/vpn-properties/nm-vpn-properties.c:582 +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 #, c-format -msgid "" -"Could not find the UI files for VPN connection type '%s'. Contact your " -"system administrator." -msgstr "" -"Tidak dapat menemukan berkas UI untuk koneksi VPN tipe '%s'. Hubungi " -"administrator sistem anda." +msgid "Could not allocate memory for encrypting." +msgstr "Tak bisa mengalokasikan memori untuk menyandi." -#: ../gnome/vpn-properties/nm-vpn-properties.c:739 +#: ../libnm-util/crypto_gnutls.c:294 #, c-format -msgid "Delete VPN connection \"%s\"?" -msgstr "Hapus koneksi VPN \"%s\"?" +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Gagal menginisialisasi konteks cipher penyandian: %s / %s." -#: ../gnome/vpn-properties/nm-vpn-properties.c:742 +#: ../libnm-util/crypto_gnutls.c:303 #, c-format -msgid "" -"All information about the VPN connection \"%s\" will be lost and you may " -"need your system administrator to provide information to create a new " -"connection." +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Gagal menata kunci simetrik untuk penyandian: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Gagal menata IV untuk penyandian: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Gagal menyandi data: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Gagal menginisialisasi data sertifikat: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Tak bisa mengawa kode (decode) sertifikat: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "Tak bisa menginisialisasi pengawa kode (decoder) PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Tak bisa mengawa kode (decode) berkas PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "Tak bisa memeriksa berkas PKCS#12: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Gagal menginisialisasi mesin kripto: %d" + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Gagal menginisialisasi konteks MD5: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Panjang IV tak valid (mesti paling tidak %d)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Gagal menginisialisasi slot cipher pengawasandian (decryption)." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Gagal menata kunci simetrik untuk pengawasandian (decryption)." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Gagal menata IV untuk pengawasandian (decryption)." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Gagal menginisialisasi konteks pengawasandian (decryption)." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Gagal mengawa sandi (decrypt) kunci privat: %d" + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." msgstr "" -"Semua informasi tentang koneksi VPN \"%s\" akan hilang dan anda mungkin " -"memerlukan administrator sistem anda untuk mendapatkan informasi untuk " -"membuat koneksi baru." +"Gagal mengawa sandi (decrypt) kunci privat: data terawa sandi terlalu besar." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Gagal memfinalisasi pengawasandian (decryption) kunci privat: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "Gagal menginisialisasi slot cipher penyandian." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "Gagal menata kunci simetrik untuk penyandian." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Gagal menata IV untuk penyandian." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "Gagal menginisialisasi konteks penyandian." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Gagal mengawasandi: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Banyaknya data tak terduga setelah penyandian." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Tak bisa mengawa kode (decode) sertifikat: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Tak bisa mengubah kata sandi ke UCS2: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Tak bisa menginisialisasi pengawa kode (decoder) PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Tak bisa mengawa kode (decode) berkas PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Tak bisa memeriksa berkas PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "Tak bisa menjangkitkan data acak." + +#: ../libnm-util/nm-utils.c:1975 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Tak cukup memori untuk membuat kunci penyandian." + +#: ../libnm-util/nm-utils.c:2085 +msgid "Could not allocate memory for PEM file creation." +msgstr "Tak bisa mengalokasikan memori bagi pembuatan berkas PEM." -#: ../gnome/vpn-properties/nm-vpn-properties.c:959 -msgid "Unable to load" -msgstr "Tidak dapat memuat" +#: ../libnm-util/nm-utils.c:2097 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Tak bisa mengalokasikan memori untuk menulis IV ke berkas PEM." -#: ../gnome/vpn-properties/nm-vpn-properties.c:961 -msgid "Cannot find some needed resources (the glade file)!" +#: ../libnm-util/nm-utils.c:2109 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "" -"Tidak dapat menemukan beberapa sumberdaya yang diperlukan (berkas glade)!" +"Tak bisa mengalokasikan memori untuk menulis kunci tersandi ke berkas PEM." -#: ../gnome/vpn-properties/nm-vpn-properties.c:1071 -msgid "Edit VPN Connection" -msgstr "Sunting Koneksi VPN" +#: ../libnm-util/nm-utils.c:2128 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Tak bisa mengalokasikan memori bagi data berkas PEM." -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:1 -msgid "Add a new VPN connection" -msgstr "Tambah koneksi VPN baru" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Berbagi koneksi melalui jaringan WiFi terlindung." -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:2 -msgid "Choose which type of VPN connection you wish to create." -msgstr "Pilih tipe koneksi VPN yang ingin anda buat" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Berbagi koneksi melalui jaringan WiFi terbuka" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:3 -msgid "Connect to:" -msgstr "Menyambung ke:" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Ubah nama host sistem yang persisten" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:4 -msgid "Create VPN Connection" -msgstr "Buat Koneksi VPN" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Ubah koneksi sistem" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:5 -msgid "Create VPN Connection - 1 of 2" -msgstr "Buat Koneksi VPN - 1 dari 2" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Kebijakan sistem mencegah pengubahan tatanan sistem" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:6 -msgid "Create VPN Connection - 2 of 2" -msgstr "Buat Koneksi VPN - 2 dari 2" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "Kebijakan sistem mencegah pengubahan nama host yang persisten" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:7 -msgid "Delete the selected VPN connection" -msgstr "Hapus koneksi VPN yang dipilih" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"Kebijakan sistem mencegah berbagi sambungan melalui jaringan WiFi terlindung" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:8 -msgid "E_xport" -msgstr "Ekspor" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"Kebijakan sistem mencegah berbagi sambungan melalui jaringan WiFi terbuka" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:9 -msgid "Edit the selected VPN connection" -msgstr "Sunting koneksi VPN yang dipilih" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "Ijinkan pengendalian sambungan jaringan" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:10 -msgid "Export the VPN settings to a file" -msgstr "Ekspor pengaturan VPN ke sebuah berkas" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "Ijinkan penggunaan sambungan spesifik-pengguna" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:11 -msgid "Export the selected VPN connection to a file" -msgstr "Ekspor koneksi VPN yang dipilih ke sebuah berkas" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "Aktifkan atau matikan perangkat WiFi" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:12 -msgid "Finish Creating VPN Connection" -msgstr "Mengakhiri Pembuatan Koneksi VPN" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "Aktifkan atau matikan perangkat broadband bergerak" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:13 -msgid "Manage Virtual Private Network Connections" -msgstr "Kelola Koneksi Virtual Private Network" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "Aktifkan atau matikan jejaring sistem" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:14 +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 msgid "" -"This assistant will guide you through the creation of a connection to a " -"Virtual Private Network (VPN).\n" -"\n" -"It will require some information, such as IP addresses and secrets. Please " -"see your system administrator to obtain this information." +"Put NetworkManager to sleep or wake it up (should only be used by system " +"power management)" msgstr "" -"Pemandu ini akan membantu anda dalam pembuatan koneksi ke sebuah Virtual " -"Private Network (VPN).\n" -"Dia akan memerlukan beberapa informasi, seperti misalnya alamat IP dan " -"rahasia-rahasia. Silahkan menemui administrator sistem untuk memperoleh " -"informasi ini." +"Tidurkan NetworkManager atau bangunkan (mestinya hanya dipakai oleh " +"manajemen daya sistem)" -#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:17 -msgid "VPN Connections" -msgstr "Koneksi VPN" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +msgid "System policy prevents control of network connections" +msgstr "Kebijakan sistem mencegah pengendalian sambungan jaringan" -#: ../src/nm-ap-security-wep.c:52 -msgid "40-bit WEP" -msgstr "WEP 40-bit" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "Kebijakan sistem mencegah mengaktifkan atau mematikan perangkat WiFi" -#: ../src/nm-ap-security-wep.c:54 -msgid "104-bit WEP" -msgstr "WEP 104-bit" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "" +"Kebijakan sistem mencegah mengaktifkan atau mematikan perangkat broadband " +"bergerak" -#: ../src/nm-ap-security-wpa-psk.c:50 -msgid "WPA TKIP" -msgstr "WPA TKIP" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +msgid "System policy prevents enabling or disabling system networking" +msgstr "Kebijakan sistem mencegah mengaktifkan atau mematikan jejaring sistem" -#: ../src/nm-ap-security-wpa-psk.c:52 -msgid "WPA CCMP" -msgstr "WPA CCMP" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "" +"Kebijakan sistem mencegah menidurkan NetworkManager atau membangunkannya" -#: ../src/nm-ap-security-wpa-psk.c:54 -msgid "WPA Automatic" -msgstr "WPA Otomatis" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +msgid "System policy prevents use of user-specific connections" +msgstr "Kebijakan sistem mencegah penggunaan sambungan spesifik-pengguna" -#: ../src/nm-ap-security-wpa-psk.c:59 -msgid "WPA2 TKIP" -msgstr "WPA2 TKIP" +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "galat memroses pesan netlink: %s" -#: ../src/nm-ap-security-wpa-psk.c:61 -msgid "WPA2 CCMP" -msgstr "WPA2 CCMP" +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "galat terjadi ketika menunggu data pada soket" -#: ../src/nm-ap-security-wpa-psk.c:63 -msgid "WPA2 Automatic" -msgstr "WPA2 Otomatis" +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "tak bisa menyambung ke netlink untuk pemantauan status sambungan: %s" -#: ../src/nm-ap-security.c:321 -msgid "none" -msgstr "tidak ada" +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "tak bisa mengaktifkan penyampaian kredensial handle netlink: %s" -#: ../src/nm-netlink-monitor.c:163 +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 #, c-format -msgid "" -"unable to create netlink socket for monitoring wired ethernet devices - %s" +msgid "unable to allocate netlink handle for monitoring link status: %s" msgstr "" -"tidak dapat membuat soket netlink untuk mengamati perangkat ethernet - %s" +"tak bisa mengalokasikan handle netlink untuk pemantauan status sambungan: %s" -#: ../src/nm-netlink-monitor.c:181 +#: ../src/nm-netlink-monitor.c:376 #, c-format -msgid "" -"unable to bind to netlink socket for monitoring wired ethernet devices - %s" +msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "" -"tidak dapat mem-bind ke soket netlink untuk mengamati perangkat ethernet - %s" +"tak bisa mengalokasikan singgahan sambungan netlink untuk pemantauan status " +"sambungan: %s" -#: ../src/nm-netlink-monitor.c:414 -msgid "operation took too long" -msgstr "operasi memakan waktu terlalu lama" +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "tak bisa bergabung dengan grup netlink: %s" -#: ../src/nm-netlink-monitor.c:511 -msgid "received data from wrong type of sender" -msgstr "menerima data dari pengirim bertipe salah" +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "galat memperbarui singgahan sambungan: %s" -#: ../src/nm-netlink-monitor.c:524 -msgid "received data from unexpected sender" -msgstr "menerima data dari pengirim yang tak diharapkan" +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"Opsi tak valid. Silakan pakai --help untuk melihat daftar opsi yang valid.\n" -#: ../src/nm-netlink-monitor.c:655 -msgid "too much data was sent over socket and some of it was lost" +#: ../src/main.c:573 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. Silakan pakai --help untuk melihat daftar opsi yang valid.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:324 +msgid "# Created by NetworkManager\n" +msgstr "# Dibuat oleh NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:340 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" msgstr "" -"terlalu banyak data yang telah dikirim lewat soket dan sebagian diantaranya " -"hilang" +"# Digabung dari %s\n" +"\n" -#: ../src/nm-netlink-monitor.c:744 -msgid "error occurred while waiting for data on socket" -msgstr "kesalahan terjadi ketika menunggu data pada soket" +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 +msgid "no usable DHCP client could be found." +msgstr "tak menemukan klien DHCP yang dapat dipakai." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 +msgid "'dhclient' could be found." +msgstr "'dhclient' dapat ditemukan." -#: ../gnome/applet/applet-dbus-devices.c:898 +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 +msgid "'dhcpcd' could be found." +msgstr "'dhcpd' dapat ditemukan." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "Klien DHCP '%s' yang tak didukung" + +#: ../src/logging/nm-logging.c:146 #, c-format -msgid "You are now connected to the Ad-Hoc wireless network '%s'." -msgstr "Anda sekarang terhubung ke jaringan nirkabel Ad-Hoc `%s'." +msgid "Unknown log level '%s'" +msgstr "Aras log tak dikenal '%s'" -#: ../gnome/applet/applet-dbus-devices.c:903 +#: ../src/logging/nm-logging.c:171 #, c-format -msgid "You are now connected to the wireless network '%s'." -msgstr "Anda sekarang terhubung ke jaringan nirkabel '%s'." +msgid "Unknown log domain '%s'" +msgstr "Ranah log tak dikenal '%s'" -#: ../gnome/applet/applet-dbus-devices.c:910 -msgid "You are now connected to the wired network." -msgstr "Anda sekarang tersambung ke jaringan berkabel." +#: ../src/named-manager/nm-named-manager.c:384 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "CATATAN: resolver libc mungkin tak mendukung lebih dari 3 nameserver." -#: ../gnome/applet/applet-dbus-devices.c:916 -msgid "Connection Established" -msgstr "Sambungan Terjalin" +#: ../src/named-manager/nm-named-manager.c:386 +msgid "The nameservers listed below may not be recognized." +msgstr "Nameserver yang terdaftar di bawah mungkin tak dikenali." -#: ../gnome/applet/applet-dbus-devices.c:959 -msgid "Disconnected" -msgstr "Terputus" +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "Otomatis %s" -#: ../gnome/applet/applet-dbus-devices.c:960 -msgid "The network connection has been disconnected." -msgstr "Koneksi jaringan telah diputus." +#: ../system-settings/plugins/ifcfg-rh/reader.c:3412 +msgid "System" +msgstr "Sistem" -- cgit v1.2.1 From 41804010d622dfb7c90c477076608790840149c7 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 10 Aug 2010 13:46:18 -0500 Subject: build: fix compilation with glib >= 2.25.12 WOrk around glib API breakage. --- src/tests/test-policy-hosts.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tests/test-policy-hosts.c b/src/tests/test-policy-hosts.c index 682c996f75..e6775f35e8 100644 --- a/src/tests/test-policy-hosts.c +++ b/src/tests/test-policy-hosts.c @@ -671,7 +671,11 @@ test_find_token (void) } } +#if GLIB_CHECK_VERSION(2,25,12) +typedef GTestFixtureFunc TCFunc; +#else typedef void (*TCFunc)(void); +#endif #define TESTCASE(t, d) g_test_create_case (#t, 0, d, NULL, (TCFunc) t, NULL) -- cgit v1.2.1 From 98bd78c93b51fde343681fd6090a49c1dd0b6dc1 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 10 Aug 2010 15:46:33 -0500 Subject: libnm-glib: better handling of missing user settings service If it's not running or we can't spawn it (it's not supposed to be autospawned anyway) we should just ignore the error and poke clients that we've tried and failed to get user settings instead of warning with an annoying message. --- libnm-glib/nm-remote-settings.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/libnm-glib/nm-remote-settings.c b/libnm-glib/nm-remote-settings.c index 92814a15ce..6a9a1d71e9 100644 --- a/libnm-glib/nm-remote-settings.c +++ b/libnm-glib/nm-remote-settings.c @@ -166,12 +166,26 @@ fetch_connections_done (DBusGProxy *proxy, int i; if (error) { - g_warning ("%s: error fetching %s connections: (%d) %s.", - __func__, - priv->scope == NM_CONNECTION_SCOPE_USER ? "user" : "system", - error->code, - error->message ? error->message : "(unknown)"); + gboolean is_spawn_error = FALSE; + + /* Don't warn if the user settings service wasn't running since that's + * just annoying when running headless. + */ + if ( g_error_matches (error, DBUS_GERROR, DBUS_GERROR_SERVICE_UNKNOWN) + || g_error_matches (error, DBUS_GERROR, DBUS_GERROR_NAME_HAS_NO_OWNER)) + is_spawn_error = TRUE; + + if (!is_spawn_error || priv->scope == NM_CONNECTION_SCOPE_SYSTEM) { + g_warning ("%s: error fetching %s connections: (%d) %s.", + __func__, + priv->scope == NM_CONNECTION_SCOPE_USER ? "user" : "system", + error->code, + error->message ? error->message : "(unknown)"); + } g_clear_error (&error); + + /* We tried to read connections and failed */ + g_signal_emit_by_name (self, NM_SETTINGS_INTERFACE_CONNECTIONS_READ); return; } -- cgit v1.2.1 From d500eaa33b81ce30980330f475e7520980b81e8c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 10 Aug 2010 16:35:19 -0500 Subject: ifcfg-rh: add testcase for DHCPv6 only mode --- .../ifcfg-rh/tests/network-scripts/Makefile.am | 1 + .../network-scripts/ifcfg-test-wired-dhcp6-only | 11 +++ .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 106 +++++++++++++++++++++ 3 files changed, 118 insertions(+) create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-dhcp6-only diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am b/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am index 6ca6b6b320..28cfb98f3f 100644 --- a/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am @@ -4,6 +4,7 @@ EXTRA_DIST = \ ifcfg-test-wired-static \ ifcfg-test-wired-static-bootproto \ ifcfg-test-wired-dhcp \ + ifcfg-test-wired-dhcp6-only \ ifcfg-test-wired-global-gateway \ network-test-wired-global-gateway \ ifcfg-test-wired-never-default \ diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-dhcp6-only b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-dhcp6-only new file mode 100644 index 0000000000..de03e04480 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-dhcp6-only @@ -0,0 +1,11 @@ +DEVICE="eth0" +ONBOOT=no +TYPE=Ethernet +DEFROUTE=yes +PEERDNS=yes +PEERROUTES=yes +IPV6INIT=yes +IPV6_AUTOCONF=no +DHCPV6C=yes +HWADDR=00:13:20:F5:F5:E4 + diff --git a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index ea96ec5cc1..bca9af123d 100644 --- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -2319,6 +2319,111 @@ test_read_wired_ipv6_only (void) g_object_unref (connection); } +#define TEST_IFCFG_WIRED_DHCP6_ONLY TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-dhcp6-only" + +static void +test_read_wired_dhcp6_only (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; + char *unmanaged = NULL; + char *keyfile = NULL; + char *routefile = NULL; + char *route6file = NULL; + gboolean ignore_error = FALSE; + GError *error = NULL; + const char *tmp; + const char *expected_id = "System test-wired-dhcp6-only"; + const char *method; + + connection = connection_from_file (TEST_IFCFG_WIRED_DHCP6_ONLY, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wired-dhcp6-only-read", "failed to read %s: %s", TEST_IFCFG_WIRED_DHCP6_ONLY, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wired-dhcp6-only-verify", "failed to verify %s: %s", TEST_IFCFG_WIRED_DHCP6_ONLY, error->message); + + ASSERT (unmanaged == FALSE, + "wired-dhcp6-only-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIRED_DHCP6_ONLY); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wired-dhcp6-only-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_DHCP6_ONLY, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wired-dhcp6-only-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_DHCP6_ONLY, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wired-dhcp6-only-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_DHCP6_ONLY, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "wired-dhcp6-only-verify-wired", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_DHCP6_ONLY, + NM_SETTING_WIRED_SETTING_NAME); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wired-dhcp6-only-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_DHCP6_ONLY, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + method = nm_setting_ip4_config_get_method (s_ip4); + ASSERT (strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED) == 0, + "wired-dhcp6-only-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_DHCP6_ONLY, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_METHOD); + + /* ===== IPv6 SETTING ===== */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG)); + ASSERT (s_ip6 != NULL, + "wired-dhcp6-only-verify-ip6", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_DHCP6_ONLY, + NM_SETTING_IP6_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip6_config_get_method (s_ip6); + ASSERT (strcmp (tmp, NM_SETTING_IP6_CONFIG_METHOD_DHCP) == 0, + "wired-dhcp6-only-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_DHCP6_ONLY, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_METHOD); + + g_free (keyfile); + g_free (routefile); + g_free (route6file); + g_object_unref (connection); +} + #define TEST_IFCFG_ONBOOT_NO TEST_IFCFG_DIR"/network-scripts/ifcfg-test-onboot-no" static void @@ -9411,6 +9516,7 @@ int main (int argc, char **argv) test_read_wired_static_routes_legacy (); test_read_wired_ipv6_manual (); test_read_wired_ipv6_only (); + test_read_wired_dhcp6_only (); test_read_onboot_no (); test_read_wired_8021x_peap_mschapv2 (); test_read_wifi_open (); -- cgit v1.2.1 From 17f630d433e20746226a53c08afedafa9596816a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 10 Aug 2010 21:32:20 -0500 Subject: ip6: handle DHCPv6 initial routing better DHCPv6 doesn't really use broadcast; instead clients use reserved multicast addresses to talk to the server. ff02::1:2 (link scope) and ff05::1:3 (site scope) are used. This means the routing table has to have a route that can handle outgoing traffic to these addresses, which is ff00::/8. The kernel sometimes adds one for us, so we need to (a) make sure we don't tear that route down, and (b) that if it's not there before we start DHCPv6, that we add it. Otherwise dhclient complains about not being able to send outgoing traffic from it's send_packet6() function with "no route to host". It will then use an expired lease, which causes NM to assign that leases IP address to the interface, whcih causes the kernel to assign the required ff00::/8 route, and then dhclient performs a renew (since the expired lease has expired of course) and then everything works out in the end. But the latency sucks. So make DHCPv6 faster by ensuring that dhclient has the routes it needs before we start the DHCP session. --- src/nm-device.c | 14 ++++++ src/nm-system.c | 145 +++++++++++++++++++++++++++++++++++++++++++------------- src/nm-system.h | 10 ++++ 3 files changed, 135 insertions(+), 34 deletions(-) diff --git a/src/nm-device.c b/src/nm-device.c index e291c2f33c..dbbd3266c7 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -1579,6 +1579,8 @@ dhcp6_start (NMDevice *self, NMSettingConnection *s_con; const char *uuid; const char *ip_iface; + const struct in6_addr dest = { { { 0xFF,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }; + int err; if (!connection) { NMActRequest *req; @@ -1599,6 +1601,18 @@ dhcp6_start (NMDevice *self, g_object_unref (priv->dhcp6_config); priv->dhcp6_config = nm_dhcp6_config_new (); + /* DHCPv6 communicates with the DHCPv6 server via two multicast addresses, + * ff02::1:2 (link-scope) and ff05::1:3 (site-scope). Make sure we have + * a multicast route (ff00::/8) for client <-> server communication. + */ + err = nm_system_set_ip6_route (priv->ip_iface ? priv->ip_ifindex : priv->ifindex, + &dest, 8, NULL, 256, 0, RTPROT_BOOT, RT_TABLE_LOCAL, NULL); + if (err) { + nm_log_err (LOGD_DEVICE | LOGD_IP6, + "(%s): failed to add IPv6 multicast route: %s", + priv->ip_iface ? priv->ip_iface : priv->iface, nl_geterror ()); + } + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); g_assert (s_con); uuid = nm_setting_connection_get_uuid (s_con); diff --git a/src/nm-system.c b/src/nm-system.c index 87e83a571b..24c31c2772 100644 --- a/src/nm-system.c +++ b/src/nm-system.c @@ -481,32 +481,34 @@ nm_system_apply_ip4_config (const char *iface, return TRUE; } -static struct rtnl_route * -nm_system_device_set_ip6_route (const char *iface, - const struct in6_addr *ip6_dest, - guint32 ip6_prefix, - const struct in6_addr *ip6_gateway, - guint32 metric, - int mss) +int +nm_system_set_ip6_route (int ifindex, + const struct in6_addr *ip6_dest, + guint32 ip6_prefix, + const struct in6_addr *ip6_gateway, + guint32 metric, + int mss, + int protocol, + int table, + struct rtnl_route **out_route) { struct nl_handle *nlh; struct rtnl_route *route; struct nl_addr *dest_addr; struct nl_addr *gw_addr = NULL; - int err, iface_idx; + int err = 0; - nlh = nm_netlink_get_default_handle (); - g_return_val_if_fail (nlh != NULL, NULL); + g_return_val_if_fail (ifindex >= 0, -1); - iface_idx = nm_netlink_iface_to_index (iface); - g_return_val_if_fail (iface_idx >= 0, NULL); + nlh = nm_netlink_get_default_handle (); + g_return_val_if_fail (nlh != NULL, -1); - route = create_route (iface_idx, mss); - g_return_val_if_fail (route != NULL, NULL); + route = create_route (ifindex, mss); + g_return_val_if_fail (route != NULL, -1); /* Destination */ dest_addr = nl_addr_build (AF_INET6, (struct in6_addr *) ip6_dest, sizeof (*ip6_dest)); - g_return_val_if_fail (dest_addr != NULL, NULL); + g_return_val_if_fail (dest_addr != NULL, -1); nl_addr_set_prefixlen (dest_addr, (int) ip6_prefix); rtnl_route_set_dst (route, dest_addr); @@ -521,7 +523,7 @@ nm_system_device_set_ip6_route (const char *iface, } else { nm_log_warn (LOGD_DEVICE | LOGD_IP6, "Invalid gateway"); rtnl_route_put (route); - return NULL; + return -1; } } @@ -529,13 +531,19 @@ nm_system_device_set_ip6_route (const char *iface, if (metric) rtnl_route_set_prio (route, metric); + if (protocol) + rtnl_route_set_protocol (route, protocol); + + if (table) + rtnl_route_set_table (route, table); + /* Add the route */ err = rtnl_route_add (nlh, route, 0); if (err == -ESRCH && ip6_gateway) { /* Gateway might be over a bridge; try adding a route to gateway first */ struct rtnl_route *route2; - route2 = create_route (iface_idx, mss); + route2 = create_route (ifindex, mss); if (route2) { /* Add route to gateway over bridge */ rtnl_route_set_dst (route2, gw_addr); @@ -553,15 +561,12 @@ nm_system_device_set_ip6_route (const char *iface, if (gw_addr) nl_addr_put (gw_addr); - if (err) { - nm_log_err (LOGD_DEVICE | LOGD_IP6, - "(%s): failed to set IPv6 route: %s", - iface, nl_geterror ()); + if (out_route) + *out_route = route; + else rtnl_route_put (route); - route = NULL; - } - return route; + return err; } static gboolean @@ -618,24 +623,33 @@ nm_system_apply_ip6_config (const char *iface, } if (flags & NM_IP6_COMPARE_FLAG_ROUTES) { + int ifindex = nm_netlink_iface_to_index (iface); + for (i = 0; i < nm_ip6_config_get_num_routes (config); i++) { NMIP6Route *route = nm_ip6_config_get_route (config, i); - struct rtnl_route *tmp; + int err; /* Don't add the route if it doesn't have a gateway and the connection * is never supposed to be the default connection. */ if ( nm_ip6_config_get_never_default (config) - && IN6_IS_ADDR_UNSPECIFIED(nm_ip6_route_get_dest (route))) + && IN6_IS_ADDR_UNSPECIFIED (nm_ip6_route_get_dest (route))) continue; - tmp = nm_system_device_set_ip6_route (iface, - nm_ip6_route_get_dest (route), - nm_ip6_route_get_prefix (route), - nm_ip6_route_get_next_hop (route), - nm_ip6_route_get_metric (route), - nm_ip6_config_get_mss (config)); - rtnl_route_put (tmp); + err = nm_system_set_ip6_route (ifindex, + nm_ip6_route_get_dest (route), + nm_ip6_route_get_prefix (route), + nm_ip6_route_get_next_hop (route), + nm_ip6_route_get_metric (route), + nm_ip6_config_get_mss (config), + RTPROT_UNSPEC, + RT_TABLE_UNSPEC, + NULL); + if (err) { + nm_log_err (LOGD_DEVICE | LOGD_IP6, + "(%s): failed to set IPv6 route: %s", + iface, nl_geterror ()); + } } } @@ -1225,6 +1239,45 @@ foreach_route (void (*callback)(struct nl_object *, gpointer), nl_cache_free (route_cache); } +static void +dump_route (struct rtnl_route *route) +{ + char buf6[INET6_ADDRSTRLEN]; + char buf4[INET_ADDRSTRLEN]; + struct nl_addr *nl; + struct in6_addr *addr6 = NULL; + struct in_addr *addr4 = NULL; + int prefixlen = 0; + const char *sf = "UNSPEC"; + int family = rtnl_route_get_family (route); + + memset (buf6, 0, sizeof (buf6)); + memset (buf4, 0, sizeof (buf4)); + nl = rtnl_route_get_dst (route); + if (nl) { + if (rtnl_route_get_family (route) == AF_INET) { + addr4 = nl_addr_get_binary_addr (nl); + if (addr4) + inet_ntop (AF_INET, addr4, &buf4[0], sizeof (buf4)); + } else if (rtnl_route_get_family (route) == AF_INET6) { + addr6 = nl_addr_get_binary_addr (nl); + if (addr6) + inet_ntop (AF_INET6, addr6, &buf6[0], sizeof (buf6)); + } + prefixlen = nl_addr_get_prefixlen (nl); + } + + if (family == AF_INET) + sf = "INET"; + else if (family == AF_INET6) + sf = "INET6"; + + nm_log_dbg (LOGD_IP4 | LOGD_IP6, " route idx %d family %s (%d) addr %s/%d", + rtnl_route_get_oif (route), + sf, family, + strlen (buf4) ? buf4 : (strlen (buf6) ? buf6 : ""), + prefixlen); +} typedef struct { const char *iface; @@ -1238,6 +1291,10 @@ check_one_route (struct nl_object *object, void *user_data) RouteCheckData *data = (RouteCheckData *) user_data; struct rtnl_route *route = (struct rtnl_route *) object; int err; + guint32 log_level = LOGD_IP4 | LOGD_IP6; + + if (nm_logging_level_enabled (LOGL_DEBUG)) + dump_route (route); /* Delete all routes from this interface */ if (rtnl_route_get_oif (route) != data->iface_idx) @@ -1259,11 +1316,19 @@ check_one_route (struct nl_object *object, void *user_data) addr = nl_addr_get_binary_addr (nl); if (addr) { - if (IN6_IS_ADDR_LINKLOCAL (addr) || IN6_IS_ADDR_MC_LINKLOCAL (addr)) + if ( IN6_IS_ADDR_LINKLOCAL (addr) + || IN6_IS_ADDR_MC_LINKLOCAL (addr) + || (IN6_IS_ADDR_MULTICAST (addr) && (nl_addr_get_prefixlen (nl) == 8))) return; } } + if (data->family == AF_INET) + log_level = LOGD_IP4; + else if (data->family == AF_INET6) + log_level = LOGD_IP6; + nm_log_dbg (log_level, " deleting route"); + err = rtnl_route_del (nm_netlink_get_default_handle (), route, 0); if (err < 0 && (err != -ERANGE)) { nm_log_err (LOGD_DEVICE, @@ -1275,6 +1340,8 @@ check_one_route (struct nl_object *object, void *user_data) static void flush_routes (int ifindex, const char *iface, int family) { RouteCheckData check_data; + guint32 log_level = LOGD_IP4 | LOGD_IP6; + const char *sf = "UNSPEC"; g_return_if_fail (iface != NULL); @@ -1286,6 +1353,16 @@ static void flush_routes (int ifindex, const char *iface, int family) } } + if (family == AF_INET) { + log_level = LOGD_IP4; + sf = "INET"; + } else if (family == AF_INET6) { + log_level = LOGD_IP6; + sf = "INET6"; + } + nm_log_dbg (log_level, "(%s): flushing routes ifindex %d family %s (%d)", + iface, ifindex, sf, family); + memset (&check_data, 0, sizeof (check_data)); check_data.iface = iface; check_data.iface_idx = ifindex; diff --git a/src/nm-system.h b/src/nm-system.h index 29455cb4bf..8cb22d747a 100644 --- a/src/nm-system.h +++ b/src/nm-system.h @@ -66,6 +66,16 @@ gboolean nm_system_apply_ip4_config (const char *iface, int priority, NMIP4ConfigCompareFlags flags); +int nm_system_set_ip6_route (int ifindex, + const struct in6_addr *ip6_dest, + guint32 ip6_prefix, + const struct in6_addr *ip6_gateway, + guint32 metric, + int mss, + int protocol, + int table, + struct rtnl_route **out_route); + gboolean nm_system_apply_ip6_config (const char *iface, NMIP6Config *config, int priority, -- cgit v1.2.1 From a4e6519d117706cb0efa036bca7f7d1bc42e8aec Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Wed, 11 Aug 2010 12:50:46 -0500 Subject: po: updated Simplified Chinese translation (bgo #626628) --- po/zh_CN.po | 716 +++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 390 insertions(+), 326 deletions(-) diff --git a/po/zh_CN.po b/po/zh_CN.po index d1e17ae850..ccd64cd937 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -4,92 +4,94 @@ # This file is distributed under the same license as the NetworkManager package. # # Funda Wang , 2004. -# Aron Xu , 2009. # Leah Liu , 2010. +# Aron Xu , 2009, 2010. +# msgid "" msgstr "" -"Project-Id-Version: zh_CN\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-05-06 14:31+0530\n" -"PO-Revision-Date: 2010-05-10 19:25+1000\n" -"Last-Translator: Leah Liu \n" -"Language-Team: Wei Liu\n" +"Project-Id-Version: NetworkManager master\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-08-11 03:24+0000\n" +"PO-Revision-Date: 2010-08-11 21:16+0800\n" +"Last-Translator: Aron Xu \n" +"Language-Team: Chinese (simplified) \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: KBabel 1.11.4\n" -#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 -#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 -#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 -#: ../cli/src/devices.c:152 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/devices.c:88 ../cli/src/devices.c:101 ../cli/src/devices.c:111 +#: ../cli/src/devices.c:121 ../cli/src/devices.c:134 ../cli/src/devices.c:145 +#: ../cli/src/devices.c:156 ../cli/src/devices.c:165 ../cli/src/devices.c:174 msgid "NAME" msgstr "名称" #. 0 -#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/connections.c:61 ../cli/src/connections.c:76 msgid "UUID" msgstr "UUID" #. 1 -#: ../cli/src/connections.c:61 +#: ../cli/src/connections.c:62 msgid "DEVICES" msgstr "设备" #. 2 -#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +#: ../cli/src/connections.c:63 ../cli/src/connections.c:78 msgid "SCOPE" msgstr "范围" #. 3 -#: ../cli/src/connections.c:63 +#: ../cli/src/connections.c:64 msgid "DEFAULT" msgstr "默认" #. 4 -#: ../cli/src/connections.c:64 +#: ../cli/src/connections.c:65 msgid "DBUS-SERVICE" msgstr "DBUS 服务" #. 5 -#: ../cli/src/connections.c:65 +#: ../cli/src/connections.c:66 msgid "SPEC-OBJECT" msgstr "SPEC 对象" #. 6 -#: ../cli/src/connections.c:66 +#: ../cli/src/connections.c:67 msgid "VPN" msgstr "VPN" #. 1 #. 0 #. 1 -#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +#: ../cli/src/connections.c:77 ../cli/src/devices.c:62 ../cli/src/devices.c:90 msgid "TYPE" msgstr "类型" #. 3 -#: ../cli/src/connections.c:78 +#: ../cli/src/connections.c:79 msgid "TIMESTAMP" msgstr "时间戳" #. 4 -#: ../cli/src/connections.c:79 +#: ../cli/src/connections.c:80 msgid "TIMESTAMP-REAL" msgstr "真实时间戳" #. 5 -#: ../cli/src/connections.c:80 +#: ../cli/src/connections.c:81 msgid "AUTOCONNECT" msgstr "自动连接" #. 6 -#: ../cli/src/connections.c:81 +#: ../cli/src/connections.c:82 msgid "READONLY" msgstr "只读" -#: ../cli/src/connections.c:157 +#: ../cli/src/connections.c:158 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -101,8 +103,8 @@ msgid "" "]\n" " down id | uuid \n" msgstr "" -"用法:nmcli con { COMMAND | help }\n" -" COMMAND := { list | status | up | down }\n" +"用法:nmcli con { 命令 | help }\n" +" 命令 := { list | status | up | down }\n" "\n" " list [id | uuid | system | user]\n" " status\n" @@ -110,514 +112,524 @@ msgstr "" "]\n" " down id | uuid \n" -#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#: ../cli/src/connections.c:198 ../cli/src/connections.c:537 #, c-format msgid "Error: 'con list': %s" msgstr "错误:'con list': %s" -#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#: ../cli/src/connections.c:200 ../cli/src/connections.c:539 #, c-format msgid "Error: 'con list': %s; allowed fields: %s" msgstr "错误:'con list': %s;允许的字段:%s" -#: ../cli/src/connections.c:207 +#: ../cli/src/connections.c:208 msgid "Connection details" msgstr "连接详情" -#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 msgid "system" msgstr "系统" -#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 msgid "user" msgstr "用户" -#: ../cli/src/connections.c:383 +#: ../cli/src/connections.c:384 msgid "never" msgstr "从不" #. "CAPABILITIES" #. Print header #. "WIFI-PROPERTIES" -#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 -#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 -#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 -#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 -#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 -#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 -#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 -#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 -#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 -#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 -#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 -#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 -#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 -#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 -#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 -#: ../cli/src/settings.c:1210 +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:551 ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 msgid "yes" msgstr "是" -#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 -#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 -#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 -#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 -#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 -#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 -#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 -#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 -#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 -#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 -#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 -#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 -#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 -#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 -#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 -#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:510 ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 ../cli/src/settings.c:1224 msgid "no" msgstr "否" -#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +#: ../cli/src/connections.c:458 ../cli/src/connections.c:501 msgid "System connections" msgstr "系统连接" -#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +#: ../cli/src/connections.c:463 ../cli/src/connections.c:514 msgid "User connections" msgstr "用户连接" -#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 -#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 -#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 -#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 -#: ../cli/src/devices.c:980 +#: ../cli/src/connections.c:475 ../cli/src/connections.c:1335 +#: ../cli/src/connections.c:1351 ../cli/src/connections.c:1360 +#: ../cli/src/connections.c:1371 ../cli/src/connections.c:1456 +#: ../cli/src/devices.c:962 ../cli/src/devices.c:972 ../cli/src/devices.c:1074 +#: ../cli/src/devices.c:1081 #, c-format msgid "Error: %s argument is missing." msgstr "错误:缺少 %s 参数。" -#: ../cli/src/connections.c:487 +#: ../cli/src/connections.c:488 #, c-format msgid "Error: %s - no such connection." msgstr "错误:%s - 没有这个连接。" -#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 -#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 -#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#: ../cli/src/connections.c:520 ../cli/src/connections.c:1384 +#: ../cli/src/connections.c:1474 ../cli/src/devices.c:785 +#: ../cli/src/devices.c:852 ../cli/src/devices.c:986 ../cli/src/devices.c:1087 #, c-format msgid "Unknown parameter: %s\n" msgstr "未知参数:%s\n" -#: ../cli/src/connections.c:528 +#: ../cli/src/connections.c:529 #, c-format msgid "Error: no valid parameter specified." msgstr "错误:没有指定有效参数。" -#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 -#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#: ../cli/src/connections.c:544 ../cli/src/connections.c:1577 +#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:274 #, c-format msgid "Error: %s." msgstr "错误:%s。" -#: ../cli/src/connections.c:649 +#: ../cli/src/connections.c:650 #, c-format msgid "Error: 'con status': %s" msgstr "错误:'con status': %s" -#: ../cli/src/connections.c:651 +#: ../cli/src/connections.c:652 #, c-format msgid "Error: 'con status': %s; allowed fields: %s" msgstr "错误:'con status': %s;允许的字段:%s" -#: ../cli/src/connections.c:658 +#: ../cli/src/connections.c:659 msgid "Active connections" msgstr "活跃连接" -#: ../cli/src/connections.c:1026 +#: ../cli/src/connections.c:1027 #, c-format msgid "no active connection on device '%s'" msgstr "设备 '%s' 中没有活跃连接" -#: ../cli/src/connections.c:1034 +#: ../cli/src/connections.c:1035 #, c-format msgid "no active connection or device" msgstr "没有活跃连接或者设备" -#: ../cli/src/connections.c:1084 +#: ../cli/src/connections.c:1085 #, c-format msgid "device '%s' not compatible with connection '%s'" msgstr "设备 '%s' 不兼容连接 '%s'" -#: ../cli/src/connections.c:1086 +#: ../cli/src/connections.c:1087 #, c-format msgid "no device found for connection '%s'" msgstr "没有找到可用于连接 '%s' 的设备" -#: ../cli/src/connections.c:1097 +#: ../cli/src/connections.c:1098 msgid "activating" msgstr "激活中" -#: ../cli/src/connections.c:1099 +#: ../cli/src/connections.c:1100 msgid "activated" -msgstr "激活的" +msgstr "已激活" -#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 -#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 -#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 -#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +#: ../cli/src/connections.c:1103 ../cli/src/connections.c:1126 +#: ../cli/src/connections.c:1159 ../cli/src/devices.c:246 +#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:473 msgid "unknown" msgstr "未知" -#: ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:1112 msgid "VPN connecting (prepare)" -msgstr "VPN 连接(准备)" +msgstr "VPN 连接(准备)" -#: ../cli/src/connections.c:1113 +#: ../cli/src/connections.c:1114 msgid "VPN connecting (need authentication)" -msgstr "VPN 连接中(需要验证)" +msgstr "VPN 连接中(需要验证)" -#: ../cli/src/connections.c:1115 +#: ../cli/src/connections.c:1116 msgid "VPN connecting" msgstr "VPN 连接中" -#: ../cli/src/connections.c:1117 +#: ../cli/src/connections.c:1118 msgid "VPN connecting (getting IP configuration)" -msgstr "VPN 连接中(获取 IP 配置)" +msgstr "VPN 连接中(获取 IP 配置)" -#: ../cli/src/connections.c:1119 +#: ../cli/src/connections.c:1120 msgid "VPN connected" -msgstr "VNP 连接" +msgstr "VPN 连接" -#: ../cli/src/connections.c:1121 +#: ../cli/src/connections.c:1122 msgid "VPN connection failed" msgstr "VPN 连接失败" -#: ../cli/src/connections.c:1123 +#: ../cli/src/connections.c:1124 msgid "VPN disconnected" msgstr "断开 VPN 连接" -#: ../cli/src/connections.c:1134 +#: ../cli/src/connections.c:1135 msgid "unknown reason" msgstr "未知原因" -#: ../cli/src/connections.c:1136 +#: ../cli/src/connections.c:1137 msgid "none" msgstr "无" -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1139 msgid "the user was disconnected" -msgstr "断开连接的用户" +msgstr "用户已断开连接" -#: ../cli/src/connections.c:1140 +#: ../cli/src/connections.c:1141 msgid "the base network connection was interrupted" msgstr "基点网络连接中断" -#: ../cli/src/connections.c:1142 +#: ../cli/src/connections.c:1143 msgid "the VPN service stopped unexpectedly" msgstr "VPN 服务意外停止" -#: ../cli/src/connections.c:1144 +#: ../cli/src/connections.c:1145 msgid "the VPN service returned invalid configuration" msgstr "VPN 服务返回无效配置" -#: ../cli/src/connections.c:1146 +#: ../cli/src/connections.c:1147 msgid "the connection attempt timed out" msgstr "连接尝试超时" -#: ../cli/src/connections.c:1148 +#: ../cli/src/connections.c:1149 msgid "the VPN service did not start in time" msgstr "VPN 连接没有按时启动" -#: ../cli/src/connections.c:1150 +#: ../cli/src/connections.c:1151 msgid "the VPN service failed to start" msgstr "VPN 服务启动失败" -#: ../cli/src/connections.c:1152 +#: ../cli/src/connections.c:1153 msgid "no valid VPN secrets" -msgstr "没有有效 VPN secret" +msgstr "没有有效的 VPN 加密" -#: ../cli/src/connections.c:1154 +#: ../cli/src/connections.c:1155 msgid "invalid VPN secrets" -msgstr "无效 VPN secret" +msgstr "无效 VPN 加密" -#: ../cli/src/connections.c:1156 +#: ../cli/src/connections.c:1157 msgid "the connection was removed" msgstr "连接被删除" -#: ../cli/src/connections.c:1170 +#: ../cli/src/connections.c:1171 #, c-format msgid "state: %s\n" msgstr "状态:%s\n" -#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#: ../cli/src/connections.c:1174 ../cli/src/connections.c:1200 #, c-format msgid "Connection activated\n" -msgstr "连接被激活\n" +msgstr "连接已激活\n" -#: ../cli/src/connections.c:1176 +#: ../cli/src/connections.c:1177 #, c-format msgid "Error: Connection activation failed." msgstr "错误:激活连接失败。" -#: ../cli/src/connections.c:1195 +#: ../cli/src/connections.c:1196 #, c-format msgid "state: %s (%d)\n" msgstr "状态:%s (%d)\n" -#: ../cli/src/connections.c:1205 +#: ../cli/src/connections.c:1206 #, c-format msgid "Error: Connection activation failed: %s." msgstr "错误:激活连接失败:%s。" -#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#: ../cli/src/connections.c:1223 ../cli/src/devices.c:909 #, c-format msgid "Error: Timeout %d sec expired." msgstr "错误:超时 %d 秒过期。" -#: ../cli/src/connections.c:1265 +#: ../cli/src/connections.c:1266 #, c-format msgid "Error: Connection activation failed: %s" msgstr "错误:激活连接失败:%s" -#: ../cli/src/connections.c:1279 +#: ../cli/src/connections.c:1280 #, c-format msgid "Error: Obtaining active connection for '%s' failed." msgstr "错误:获取 '%s' 的活跃连接失败。" -#: ../cli/src/connections.c:1288 +#: ../cli/src/connections.c:1289 #, c-format msgid "Active connection state: %s\n" msgstr "活跃连接状态:%s\n" -#: ../cli/src/connections.c:1289 +#: ../cli/src/connections.c:1290 #, c-format msgid "Active connection path: %s\n" msgstr "活跃连接路径:%s\n" -#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#: ../cli/src/connections.c:1344 ../cli/src/connections.c:1465 #, c-format msgid "Error: Unknown connection: %s." msgstr "错误:未知连接:%s" -#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#: ../cli/src/connections.c:1379 ../cli/src/devices.c:980 #, c-format msgid "Error: timeout value '%s' is not valid." msgstr "错误:超时值 '%s' 无效。" -#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#: ../cli/src/connections.c:1392 ../cli/src/connections.c:1482 #, c-format msgid "Error: id or uuid has to be specified." -msgstr "错误:必须指定 id 或者 uuid。" +msgstr "错误:必须指定 ID 或者 UUID。" -#: ../cli/src/connections.c:1411 +#: ../cli/src/connections.c:1412 #, c-format msgid "Error: No suitable device found: %s." msgstr "错误:没有找到合适的设备:%s。" -#: ../cli/src/connections.c:1413 +#: ../cli/src/connections.c:1414 #, c-format msgid "Error: No suitable device found." msgstr "错误:没有找到合适的设备。" -#: ../cli/src/connections.c:1505 +#: ../cli/src/connections.c:1509 #, c-format msgid "Warning: Connection not active\n" msgstr "警告:连接没有激活\n" -#: ../cli/src/connections.c:1561 +#: ../cli/src/connections.c:1566 #, c-format msgid "Error: 'con' command '%s' is not valid." msgstr "错误:'con' 命令 '%s' 无效。" -#: ../cli/src/connections.c:1597 +#: ../cli/src/connections.c:1602 #, c-format msgid "Error: could not connect to D-Bus." msgstr "错误:无法连接到 D-Bus。" -#: ../cli/src/connections.c:1604 +#: ../cli/src/connections.c:1609 #, c-format msgid "Error: Could not get system settings." msgstr "错误:无法获得系统设置。" -#: ../cli/src/connections.c:1612 +#: ../cli/src/connections.c:1617 #, c-format msgid "Error: Could not get user settings." msgstr "错误:无法获得用户设置。" -#: ../cli/src/connections.c:1622 +#: ../cli/src/connections.c:1627 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "错误:无法获得连接:设定服务没有运行。" #. 0 #. 9 -#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +#: ../cli/src/devices.c:61 ../cli/src/devices.c:89 ../cli/src/devices.c:184 msgid "DEVICE" msgstr "设备" #. 1 #. 4 #. 0 -#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/devices.c:63 ../cli/src/devices.c:93 #: ../cli/src/network-manager.c:36 msgid "STATE" msgstr "状态" -#: ../cli/src/devices.c:71 +#: ../cli/src/devices.c:72 msgid "GENERAL" msgstr "常规" #. 0 -#: ../cli/src/devices.c:72 +#: ../cli/src/devices.c:73 msgid "CAPABILITIES" msgstr "功能" #. 1 -#: ../cli/src/devices.c:73 +#: ../cli/src/devices.c:74 msgid "WIFI-PROPERTIES" msgstr "WIFI 属性" #. 2 -#: ../cli/src/devices.c:74 +#: ../cli/src/devices.c:75 msgid "AP" msgstr "AP" #. 3 -#: ../cli/src/devices.c:75 +#: ../cli/src/devices.c:76 msgid "WIRED-PROPERTIES" msgstr "有线连接属性" #. 4 -#: ../cli/src/devices.c:76 +#: ../cli/src/devices.c:77 msgid "IP4-SETTINGS" msgstr "IP4 设置" #. 5 -#: ../cli/src/devices.c:77 +#: ../cli/src/devices.c:78 msgid "IP4-DNS" msgstr "IP4-DNS" +#. 6 +#: ../cli/src/devices.c:79 +msgid "IP6-SETTINGS" +msgstr "IP6 设置" + +#. 7 +#: ../cli/src/devices.c:80 +msgid "IP6-DNS" +msgstr "IP6-DNS" + #. 2 -#: ../cli/src/devices.c:88 +#: ../cli/src/devices.c:91 msgid "DRIVER" msgstr "驱动程序" #. 3 -#: ../cli/src/devices.c:89 +#: ../cli/src/devices.c:92 msgid "HWADDR" msgstr "硬盘" #. 0 -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:102 msgid "CARRIER-DETECT" msgstr "容器探测" #. 1 -#: ../cli/src/devices.c:100 +#: ../cli/src/devices.c:103 msgid "SPEED" msgstr "速度" #. 0 -#: ../cli/src/devices.c:109 +#: ../cli/src/devices.c:112 msgid "CARRIER" msgstr "容器" #. 0 -#: ../cli/src/devices.c:119 +#: ../cli/src/devices.c:122 msgid "WEP" msgstr "WEP" #. 1 -#: ../cli/src/devices.c:120 +#: ../cli/src/devices.c:123 msgid "WPA" msgstr "WPA" #. 2 -#: ../cli/src/devices.c:121 +#: ../cli/src/devices.c:124 msgid "WPA2" msgstr "WPA2" #. 3 -#: ../cli/src/devices.c:122 +#: ../cli/src/devices.c:125 msgid "TKIP" msgstr "TKIP" #. 4 -#: ../cli/src/devices.c:123 +#: ../cli/src/devices.c:126 msgid "CCMP" msgstr "CCMP" #. 0 -#: ../cli/src/devices.c:132 +#: ../cli/src/devices.c:135 ../cli/src/devices.c:146 msgid "ADDRESS" msgstr "地址" #. 1 -#: ../cli/src/devices.c:133 +#: ../cli/src/devices.c:136 ../cli/src/devices.c:147 msgid "PREFIX" msgstr "前缀" #. 2 -#: ../cli/src/devices.c:134 +#: ../cli/src/devices.c:137 ../cli/src/devices.c:148 msgid "GATEWAY" msgstr "网关" #. 0 -#: ../cli/src/devices.c:143 +#: ../cli/src/devices.c:157 ../cli/src/devices.c:166 msgid "DNS" msgstr "DNS" #. 0 -#: ../cli/src/devices.c:153 +#: ../cli/src/devices.c:175 msgid "SSID" msgstr "SSID" #. 1 -#: ../cli/src/devices.c:154 +#: ../cli/src/devices.c:176 msgid "BSSID" msgstr "BSSID" #. 2 -#: ../cli/src/devices.c:155 +#: ../cli/src/devices.c:177 msgid "MODE" msgstr "型号" #. 3 -#: ../cli/src/devices.c:156 +#: ../cli/src/devices.c:178 msgid "FREQ" msgstr "FREQ" #. 4 -#: ../cli/src/devices.c:157 +#: ../cli/src/devices.c:179 msgid "RATE" msgstr "频率" #. 5 -#: ../cli/src/devices.c:158 +#: ../cli/src/devices.c:180 msgid "SIGNAL" msgstr "信号" #. 6 -#: ../cli/src/devices.c:159 +#: ../cli/src/devices.c:181 msgid "SECURITY" msgstr "安全性" #. 7 -#: ../cli/src/devices.c:160 +#: ../cli/src/devices.c:182 msgid "WPA-FLAGS" msgstr "WPA-标志" #. 8 -#: ../cli/src/devices.c:161 +#: ../cli/src/devices.c:183 msgid "RSN-FLAGS" msgstr "RSN-标志" #. 10 -#: ../cli/src/devices.c:163 +#: ../cli/src/devices.c:185 msgid "ACTIVE" msgstr "活跃" -#: ../cli/src/devices.c:186 +#: ../cli/src/devices.c:208 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -640,204 +652,205 @@ msgstr "" " wifi [list [iface ] | apinfo iface hwaddr ]\n" "\n" -#: ../cli/src/devices.c:206 +#: ../cli/src/devices.c:228 msgid "unmanaged" -msgstr "未管理的" +msgstr "未管理" -#: ../cli/src/devices.c:208 +#: ../cli/src/devices.c:230 msgid "unavailable" -msgstr "不可用的" +msgstr "不可用" -#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:89 msgid "disconnected" -msgstr "断开连接" +msgstr "已断开" -#: ../cli/src/devices.c:212 +#: ../cli/src/devices.c:234 msgid "connecting (prepare)" -msgstr "连接中(准备)" +msgstr "连接中(准备)" -#: ../cli/src/devices.c:214 +#: ../cli/src/devices.c:236 msgid "connecting (configuring)" -msgstr "连接中(配置中)" +msgstr "连接中(配置)" -#: ../cli/src/devices.c:216 +#: ../cli/src/devices.c:238 msgid "connecting (need authentication)" -msgstr "连接中(需要验证)" +msgstr "连接中(需要验证)" -#: ../cli/src/devices.c:218 +#: ../cli/src/devices.c:240 msgid "connecting (getting IP configuration)" -msgstr "连接中(获得 IP 配置)" +msgstr "连接中(获得 IP 配置)" -#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:87 msgid "connected" msgstr "连接的" -#: ../cli/src/devices.c:222 +#: ../cli/src/devices.c:244 msgid "connection failed" msgstr "连接失败" -#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +#: ../cli/src/devices.c:267 ../cli/src/devices.c:424 msgid "Unknown" msgstr "未知" -#: ../cli/src/devices.c:277 +#: ../cli/src/devices.c:299 msgid "(none)" -msgstr "(无)" +msgstr "(无)" -#: ../cli/src/devices.c:302 +#: ../cli/src/devices.c:324 #, c-format msgid "%s: error converting IP4 address 0x%X" msgstr "%s:转换 IP4 地址 0x%X 出错" -#: ../cli/src/devices.c:349 +#: ../cli/src/devices.c:393 #, c-format msgid "%u MHz" msgstr "%u MHz" -#: ../cli/src/devices.c:350 +#: ../cli/src/devices.c:394 #, c-format msgid "%u MB/s" msgstr "%u MB/s" -#: ../cli/src/devices.c:359 +#: ../cli/src/devices.c:403 msgid "Encrypted: " -msgstr "加密的:" +msgstr "加密:" -#: ../cli/src/devices.c:364 +#: ../cli/src/devices.c:408 msgid "WEP " msgstr "WEP" -#: ../cli/src/devices.c:366 +#: ../cli/src/devices.c:410 msgid "WPA " msgstr "WPA" -#: ../cli/src/devices.c:368 +#: ../cli/src/devices.c:412 msgid "WPA2 " msgstr "WPA2" -#: ../cli/src/devices.c:371 +#: ../cli/src/devices.c:415 msgid "Enterprise " msgstr "企业级" -#: ../cli/src/devices.c:380 +#: ../cli/src/devices.c:424 msgid "Ad-Hoc" msgstr "Ad-Hoc" -#: ../cli/src/devices.c:380 +#: ../cli/src/devices.c:424 msgid "Infrastructure" msgstr "基础构架" -#: ../cli/src/devices.c:442 +#: ../cli/src/devices.c:486 #, c-format msgid "Error: 'dev list': %s" msgstr "错误:'dev list': %s" -#: ../cli/src/devices.c:444 +#: ../cli/src/devices.c:488 #, c-format msgid "Error: 'dev list': %s; allowed fields: %s" msgstr "错误:'dev list': %s;允许的字段:%s" -#: ../cli/src/devices.c:453 +#: ../cli/src/devices.c:497 msgid "Device details" msgstr "设备详情" -#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +#: ../cli/src/devices.c:527 ../cli/src/devices.c:925 msgid "(unknown)" -msgstr "(未知)" +msgstr "(未知)" -#: ../cli/src/devices.c:484 +#: ../cli/src/devices.c:528 msgid "unknown)" -msgstr "未知)" +msgstr "未知)" -#: ../cli/src/devices.c:510 +#: ../cli/src/devices.c:554 #, c-format msgid "%u Mb/s" msgstr "%u Mb/s" #. Print header #. "WIRED-PROPERTIES" -#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:627 msgid "on" msgstr "开" -#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:627 msgid "off" msgstr "关" -#: ../cli/src/devices.c:710 +#: ../cli/src/devices.c:808 #, c-format msgid "Error: 'dev status': %s" msgstr "错误:'dev status': %s" -#: ../cli/src/devices.c:712 +#: ../cli/src/devices.c:810 #, c-format msgid "Error: 'dev status': %s; allowed fields: %s" msgstr "错误:'dev status': %s;允许的字段:%s" -#: ../cli/src/devices.c:719 +#: ../cli/src/devices.c:817 msgid "Status of devices" msgstr "设备状态" -#: ../cli/src/devices.c:747 +#: ../cli/src/devices.c:845 #, c-format msgid "Error: '%s' argument is missing." msgstr "错误:缺少 '%s' 参数。" -#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#: ../cli/src/devices.c:874 ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: Device '%s' not found." msgstr "错误:没有找到设备 '%s'。" -#: ../cli/src/devices.c:799 +#: ../cli/src/devices.c:897 #, c-format msgid "Success: Device '%s' successfully disconnected." msgstr "成功:成功断开设备 '%s'。" -#: ../cli/src/devices.c:824 +#: ../cli/src/devices.c:922 #, c-format msgid "Error: Device '%s' (%s) disconnecting failed: %s" -msgstr "错误:断开设备 '%s'(%s)失败:%s" +msgstr "错误:断开设备 '%s'(%s)失败:%s" -#: ../cli/src/devices.c:832 +#: ../cli/src/devices.c:930 #, c-format msgid "Device state: %d (%s)\n" msgstr "设备状态:%d (%s)\n" -#: ../cli/src/devices.c:896 +#: ../cli/src/devices.c:994 #, c-format msgid "Error: iface has to be specified." msgstr "错误:没有指定 iface。" -#: ../cli/src/devices.c:1011 +#: ../cli/src/devices.c:1112 #, c-format msgid "Error: 'dev wifi': %s" msgstr "错误:'dev wifi':%s" -#: ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1114 #, c-format msgid "Error: 'dev wifi': %s; allowed fields: %s" msgstr "错误:'dev wifi': %s;允许的字段:%s" -#: ../cli/src/devices.c:1020 +#: ../cli/src/devices.c:1121 msgid "WiFi scan list" msgstr "WiFi 扫描列表" -#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#: ../cli/src/devices.c:1156 ../cli/src/devices.c:1210 #, c-format msgid "Error: Access point with hwaddr '%s' not found." -msgstr "错误:没有找到使用 hwaddr '%s' 的访问点。" +msgstr "错误:没有找到使用硬件地址 '%s' 的访问点。" -#: ../cli/src/devices.c:1072 +#: ../cli/src/devices.c:1173 #, c-format msgid "Error: Device '%s' is not a WiFi device." msgstr "错误:设备 '%s' 不是 WiFi 设备。" -#: ../cli/src/devices.c:1136 +#: ../cli/src/devices.c:1237 #, c-format msgid "Error: 'dev wifi' command '%s' is not valid." msgstr "错误:'dev wifi' 命令 '%s' 无效。" -#: ../cli/src/devices.c:1183 +#: ../cli/src/devices.c:1284 #, c-format msgid "Error: 'dev' command '%s' is not valid." msgstr "错误:'dev' 命令 '%s' 无效。" @@ -893,7 +906,7 @@ msgstr "" #: ../cli/src/network-manager.c:83 msgid "asleep" -msgstr "asleep" +msgstr "睡眠" #: ../cli/src/network-manager.c:85 msgid "connecting" @@ -918,13 +931,13 @@ msgstr "网络管理器状态" #: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 #: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 msgid "enabled" -msgstr "启用的" +msgstr "已启用" #: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 #: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 #: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 msgid "disabled" -msgstr "禁用的" +msgstr "已禁用" #: ../cli/src/network-manager.c:148 msgid "running" @@ -932,7 +945,7 @@ msgstr "运行中" #: ../cli/src/network-manager.c:148 msgid "not running" -msgstr "没有运行" +msgstr "未运行" #: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 #, c-format @@ -941,7 +954,7 @@ msgstr "错误:'--fields' 值 '%s' 在此无效;允许的字段:%s" #: ../cli/src/network-manager.c:209 msgid "WiFi enabled" -msgstr "启用 WiFi" +msgstr "已启用 WiFi" #: ../cli/src/network-manager.c:220 #, c-format @@ -950,7 +963,7 @@ msgstr "错误:无效 'wifi' 参数:'%s'。" #: ../cli/src/network-manager.c:241 msgid "WWAN enabled" -msgstr "启用 WWAN" +msgstr "已启用 WWAN" #: ../cli/src/network-manager.c:252 #, c-format @@ -983,18 +996,18 @@ msgid "" " dev devices managed by NetworkManager\n" "\n" msgstr "" -"用法:%s [OPTIONS] OBJECT { COMMAND | help }\n" +"用法:%s [选项] 对象 { 命令 | help }\n" "\n" -"OPTIONS\n" -" -t[erse] terse output\n" -" -p[retty] pretty output\n" -" -v[ersion] show program version\n" -" -h[elp] print this help\n" +"选项\n" +" -t[erse] 简洁输出\n" +" -p[retty] 美观输出\n" +" -v[ersion] 显示程序版本\n" +" -h[elp] 显示此帮助\n" "\n" -"OBJECT\n" -" nm NetworkManager status\n" -" con NetworkManager connections\n" -" dev devices managed by NetworkManager\n" +"对象\n" +" nm NetworkManager 状态\n" +" con NetworkManager 连接\n" +" dev NetworkManager 管理的设备\n" "\n" #: ../cli/src/nmcli.c:113 @@ -1005,7 +1018,7 @@ msgstr "错误:对象 '%s' 未知,尝试 'nmcli help'。" #: ../cli/src/nmcli.c:143 #, c-format msgid "Error: Option '--terse' is specified the second time." -msgstr "错误:第二此指定选项 '--terse'。" +msgstr "错误:第二次指定选项 '--terse'。" #: ../cli/src/nmcli.c:148 #, c-format @@ -1050,7 +1063,7 @@ msgstr "错误:选项 '%s' 未知,尝试 'nmcli -help'。" #: ../cli/src/nmcli.c:234 #, c-format msgid "Caught signal %d, shutting down..." -msgstr "捕获信号 %d,关闭中......" +msgstr "捕获信号 %d,关闭..." #: ../cli/src/nmcli.c:259 #, c-format @@ -1061,78 +1074,79 @@ msgstr "错误:无法连接到网络管理器。" msgid "Success" msgstr "成功" -#: ../cli/src/settings.c:407 +#: ../cli/src/settings.c:411 #, c-format msgid "%d (hex-ascii-key)" msgstr "%d (hex-ascii-key)" -#: ../cli/src/settings.c:409 +#: ../cli/src/settings.c:413 #, c-format msgid "%d (104/128-bit passphrase)" -msgstr "%d(104/128 位密码短语)" +msgstr "%d (104/128 位密码短语)" -#: ../cli/src/settings.c:412 +#: ../cli/src/settings.c:416 #, c-format msgid "%d (unknown)" -msgstr "%d(未知)" +msgstr "%d (未知)" -#: ../cli/src/settings.c:438 +#: ../cli/src/settings.c:442 msgid "0 (unknown)" -msgstr "0(未知)" +msgstr "0 (未知)" -#: ../cli/src/settings.c:444 +#: ../cli/src/settings.c:448 msgid "any, " msgstr "任意," -#: ../cli/src/settings.c:446 +#: ../cli/src/settings.c:450 msgid "900 MHz, " msgstr "900 MHz," -#: ../cli/src/settings.c:448 +#: ../cli/src/settings.c:452 msgid "1800 MHz, " msgstr "1800 MHz," -#: ../cli/src/settings.c:450 +#: ../cli/src/settings.c:454 msgid "1900 MHz, " msgstr "1900 MHz," -#: ../cli/src/settings.c:452 +#: ../cli/src/settings.c:456 msgid "850 MHz, " msgstr "850 MHz," -#: ../cli/src/settings.c:454 +#: ../cli/src/settings.c:458 msgid "WCDMA 3GPP UMTS 2100 MHz, " msgstr "WCDMA 3GPP UMTS 2100 MHz," -#: ../cli/src/settings.c:456 +#: ../cli/src/settings.c:460 msgid "WCDMA 3GPP UMTS 1800 MHz, " msgstr "WCDMA 3GPP UMTS 1800 MHz," -#: ../cli/src/settings.c:458 +#: ../cli/src/settings.c:462 msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " msgstr "WCDMA 3GPP UMTS 1700/2100 MHz," -#: ../cli/src/settings.c:460 +#: ../cli/src/settings.c:464 msgid "WCDMA 3GPP UMTS 800 MHz, " msgstr "WCDMA 3GPP UMTS 800 MHz," -#: ../cli/src/settings.c:462 +#: ../cli/src/settings.c:466 msgid "WCDMA 3GPP UMTS 850 MHz, " msgstr "WCDMA 3GPP UMTS 850 MHz," -#: ../cli/src/settings.c:464 +#: ../cli/src/settings.c:468 msgid "WCDMA 3GPP UMTS 900 MHz, " msgstr "WCDMA 3GPP UMTS 900 MHz," -#: ../cli/src/settings.c:466 +#: ../cli/src/settings.c:470 msgid "WCDMA 3GPP UMTS 1700 MHz, " msgstr "WCDMA 3GPP UMTS 1700 MHz," -#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +#: ../cli/src/settings.c:554 ../cli/src/settings.c:721 msgid "auto" msgstr "自动" -#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 msgid "not set" msgstr "未设置" @@ -1229,7 +1243,7 @@ msgstr "没有足够的空间储存文件数据。" #: ../libnm-util/crypto.c:324 #, c-format msgid "IV must be an even number of bytes in length." -msgstr "IV 长度必须是偶数字节。" +msgstr "初始向量长度必须是偶数字节。" #: ../libnm-util/crypto.c:333 #, c-format @@ -1275,7 +1289,7 @@ msgstr "初始化 MD5 引擎失败:%s / %s。" #: ../libnm-util/crypto_gnutls.c:156 #, c-format msgid "Invalid IV length (must be at least %zd)." -msgstr "无效 IV 长度(必须至少为 %zd)。" +msgstr "无效初始向量长度(至少为为 %zd)。" #: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format @@ -1330,7 +1344,7 @@ msgstr "为加密设置对称密钥失败:%s / %s。" #: ../libnm-util/crypto_gnutls.c:313 #, c-format msgid "Failed to set IV for encryption: %s / %s." -msgstr "为加密设置 IV 失败:%s / %s。" +msgstr "为加密设置初始向量失败:%s / %s。" #: ../libnm-util/crypto_gnutls.c:322 #, c-format @@ -1375,7 +1389,7 @@ msgstr "初始化 MD5 环境失败:%d。" #: ../libnm-util/crypto_nss.c:179 #, c-format msgid "Invalid IV length (must be at least %d)." -msgstr "无效 IV 长度(必须至少 %d)。" +msgstr "无效的初始向量长度(至少为 %d)。" #: ../libnm-util/crypto_nss.c:196 #, c-format @@ -1471,30 +1485,113 @@ msgstr "无法校验 PKCS#12 文件:%d" msgid "Could not generate random data." msgstr "无法生成随机数据。" -#: ../libnm-util/nm-utils.c:1925 +#: ../libnm-util/nm-utils.c:1975 #, c-format msgid "Not enough memory to make encryption key." msgstr "没有足够的空间生成加密密钥。" -#: ../libnm-util/nm-utils.c:2035 +#: ../libnm-util/nm-utils.c:2085 msgid "Could not allocate memory for PEM file creation." msgstr "无法为创建 PEM 文件分配内存。" -#: ../libnm-util/nm-utils.c:2047 +#: ../libnm-util/nm-utils.c:2097 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "无法为在 PEM 文件中写入 IV 分配内存。" -#: ../libnm-util/nm-utils.c:2059 +#: ../libnm-util/nm-utils.c:2109 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "无法为在 PEM 文件中写入加密密钥分配内存。" -#: ../libnm-util/nm-utils.c:2078 +#: ../libnm-util/nm-utils.c:2128 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "无法为 PEM 文件数据分配内存。" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "通过受保护的 WiFi 网络共享连接" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "通过公开 WiFi 网络共享连接" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "更改系统固有主机名" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "更改系统连接" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "系统策略阻止更改系统设置" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "系统策略阻止更改系统固有主机名" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "系统策略阻止使用受保护的 WiFi 网络共享连接" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "系统策略阻止使用公开 WiFi 网络共享连接" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "允许控制网络连接" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "允许用户连接" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "启用或禁用 WiFi 设备" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "启用或禁用移动宽带设备" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "启用或禁用系统网络" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 +msgid "" +"Put NetworkManager to sleep or wake it up (should only be used by system " +"power management)" +msgstr "" +"挂起或唤醒 NetworkManager (应仅用于系统电源管理)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +msgid "System policy prevents control of network connections" +msgstr "系统策略阻止更改网络连接" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "系统策略阻止启用或禁用 WiFi 设备" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "系统策略阻止启用或禁用移动宽带设备" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +msgid "System policy prevents enabling or disabling system networking" +msgstr "系统策略阻止启用或禁用系统网络" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "系统策略阻止挂起或唤醒 NetworkManager" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +msgid "System policy prevents use of user-specific connections" +msgstr "系统策略阻止使用用户连接" + #: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 #: ../src/nm-netlink-monitor.c:653 #, c-format @@ -1540,16 +1637,16 @@ msgstr "更新链接缓存出错:%s" msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "无效选项。请使用 --help 查看有效选项列表。\n" -#: ../src/main.c:562 +#: ../src/main.c:573 #, c-format msgid "%s. Please use --help to see a list of valid options.\n" msgstr "%s。请使用 --help 查看有效选项列表。\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:324 msgid "# Created by NetworkManager\n" msgstr "# 由 NetworkManger 创建\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:340 #, c-format msgid "" "# Merged from %s\n" @@ -1558,19 +1655,19 @@ msgstr "" "# 合并自 %s\n" "\n" -#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 msgid "no usable DHCP client could be found." msgstr "找到无法使用的 DHCP 客户端。" -#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 msgid "'dhclient' could be found." msgstr "找到 'dhclient'。" -#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 msgid "'dhcpcd' could be found." msgstr "找到 'dhcpcd'。" -#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 #, c-format msgid "unsupported DHCP client '%s'" msgstr "不支持的 DHCP 客户端 '%s'" @@ -1585,11 +1682,11 @@ msgstr "未知日志等级 '%s'" msgid "Unknown log domain '%s'" msgstr "未知日志域 '%s'" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/named-manager/nm-named-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "注意:libc 解析器可能不支持超过三个名字服务器。" -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/named-manager/nm-named-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "以下列出的名字服务器可能无法被识别。" @@ -1598,39 +1695,6 @@ msgstr "以下列出的名字服务器可能无法被识别。" msgid "Auto %s" msgstr "自动 %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3412 msgid "System" msgstr "系统" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 -msgid "Connection sharing via a protected WiFi network" -msgstr "通过受保护的 WiFi 网络共享连接" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 -msgid "Connection sharing via an open WiFi network" -msgstr "通过公开 WiFi 网络共享连接" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 -msgid "Modify persistent system hostname" -msgstr "更改系统固有主机名" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 -msgid "Modify system connections" -msgstr "更改系统连接" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 -msgid "System policy prevents modification of system settings" -msgstr "系统策略阻止更改系统设置" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 -msgid "System policy prevents modification of the persistent system hostname" -msgstr "系统策略阻止更改系统固有主机名" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 -msgid "System policy prevents sharing connections via a protected WiFi network" -msgstr "系统策略阻止使用受保护的 WiFi 网络共享连接" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 -msgid "System policy prevents sharing connections via an open WiFi network" -msgstr "系统策略组织使用公开 WiFi 网络共享连接" - -- cgit v1.2.1 From 96a9ce41fbb7d8e0d6d3fe6940809334afb480ff Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 11 Aug 2010 13:09:33 -0500 Subject: core: ensure dhcp_manager exists before trying to unref it (bgo #626610) If a new device wasn't supported, it gets destroyed by the NMDevice constructor() method. But in the constructor paths the DHCP manager isn't created yet, and so we attempt to unref a non-existent DHCP manager. Usually just a harmless warning, but apparently a crash sometimes. --- src/nm-device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nm-device.c b/src/nm-device.c index dbbd3266c7..ba004cb7c1 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -3375,7 +3375,8 @@ finalize (GObject *object) NMDevice *self = NM_DEVICE (object); NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); - g_object_unref (priv->dhcp_manager); + if (priv->dhcp_manager) + g_object_unref (priv->dhcp_manager); g_free (priv->udi); g_free (priv->iface); -- cgit v1.2.1 From 92babdb658109cab5cdf9fc0280264ef0715f37d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 11 Aug 2010 15:40:25 -0500 Subject: core: work around dbus-glib property access bug (CVE-2010-1172) (rh #585394) More info: https://bugzilla.redhat.com/show_bug.cgi?id=585394 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-1172 dbus-glib was not properly enforcing the 'access' permissions on object properties exported using its API. There were 2 specific bugs: 1) dbus-glib did not enforce the introspection read/write property permissions, so if the GObject property definition allowed write access (which is sometimes desirable), D-Bus clients could modify that value even if the introspection said it was read-only 2) dbus-glib was not filtering out GObject properties that were not listed in the introspection XML. Thus, if the GObject defined more properties than were listed in the introspection XML (which is also often useful, and NM uses this quite a bit) those properties would also be exposed to D-Bus clients. To fix this completely, you need to: 1) get dbus-glib master when the patch is commited, OR grab the patch from https://bugzilla.redhat.com/show_bug.cgi?id=585394 and build a new dbus-glib 2) rebuild NetworkManager against the new dbus-glib --- configure.ac | 6 ++++++ src/main.c | 16 ++++++++++++---- src/nm-wifi-ap.c | 20 +++++++++++--------- 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/configure.ac b/configure.ac index e1b93471a3..3217734dcc 100644 --- a/configure.ac +++ b/configure.ac @@ -203,6 +203,12 @@ dnl AC_CHECK_LIB([dl], [dladdr], LIBDL="-ldl", LIBDL="") AC_SUBST(LIBDL) +dnl +dnl Checks for new dbus-glib property access function +dnl +AC_CHECK_LIB([dbus-glib-1], [dbus_glib_global_set_disable_legacy_property_access], ac_have_dg_prop="1", ac_have_dg_prop="0") +AC_DEFINE_UNQUOTED(HAVE_DBUS_GLIB_DISABLE_LEGACY_PROP_ACCESS, $ac_have_dg_prop, [Define if you have a dbus-glib with dbus_glib_global_set_disable_legacy_property_access()]) + PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.1 dbus-glib-1 >= 0.75) AC_SUBST(DBUS_CFLAGS) AC_SUBST(DBUS_LIBS) diff --git a/src/main.c b/src/main.c index c2fb58be77..aea2eef233 100644 --- a/src/main.c +++ b/src/main.c @@ -19,10 +19,7 @@ * Copyright (C) 2005 - 2008 Novell, Inc. */ -#ifdef HAVE_CONFIG_H -# include -#endif - +#include #include #include #include @@ -627,6 +624,17 @@ main (int argc, char *argv[]) g_thread_init (NULL); dbus_g_thread_init (); +#ifndef HAVE_DBUS_GLIB_DISABLE_LEGACY_PROP_ACCESS +#error HAVE_DBUS_GLIB_DISABLE_LEGACY_PROP_ACCESS not defined +#endif + +#if HAVE_DBUS_GLIB_DISABLE_LEGACY_PROP_ACCESS + /* Ensure that non-exported properties don't leak out, and that the + * introspection 'access' permissions are respected. + */ + dbus_glib_global_set_disable_legacy_property_access (); +#endif + setup_signals (); nm_logging_start (become_daemon); diff --git a/src/nm-wifi-ap.c b/src/nm-wifi-ap.c index 8a7e4e84d1..7770b8bc42 100644 --- a/src/nm-wifi-ap.c +++ b/src/nm-wifi-ap.c @@ -153,6 +153,8 @@ set_property (GObject *object, guint prop_id, case PROP_STRENGTH: nm_ap_set_strength (ap, g_value_get_char (value)); break; + case PROP_HW_ADDRESS: + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -242,7 +244,7 @@ nm_ap_class_init (NMAccessPointClass *ap_class) NM_802_11_AP_FLAGS_NONE, NM_802_11_AP_FLAGS_PRIVACY, NM_802_11_AP_FLAGS_NONE, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_WPA_FLAGS, @@ -252,7 +254,7 @@ nm_ap_class_init (NMAccessPointClass *ap_class) NM_802_11_AP_SEC_NONE, all_sec_flags, NM_802_11_AP_SEC_NONE, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_RSN_FLAGS, @@ -262,7 +264,7 @@ nm_ap_class_init (NMAccessPointClass *ap_class) NM_802_11_AP_SEC_NONE, all_sec_flags, NM_802_11_AP_SEC_NONE, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_SSID, @@ -270,7 +272,7 @@ nm_ap_class_init (NMAccessPointClass *ap_class) "SSID", "SSID", DBUS_TYPE_G_UCHAR_ARRAY, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_FREQUENCY, @@ -278,7 +280,7 @@ nm_ap_class_init (NMAccessPointClass *ap_class) "Frequency", "Frequency", 0, 10000, 0, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_HW_ADDRESS, @@ -286,7 +288,7 @@ nm_ap_class_init (NMAccessPointClass *ap_class) "MAC Address", "Hardware MAC address", NULL, - G_PARAM_READABLE)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_MODE, @@ -294,7 +296,7 @@ nm_ap_class_init (NMAccessPointClass *ap_class) "Mode", "Mode", NM_802_11_MODE_ADHOC, NM_802_11_MODE_INFRA, NM_802_11_MODE_INFRA, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_MAX_BITRATE, @@ -302,7 +304,7 @@ nm_ap_class_init (NMAccessPointClass *ap_class) "Max Bitrate", "Max Bitrate", 0, G_MAXUINT16, 0, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_STRENGTH, @@ -310,7 +312,7 @@ nm_ap_class_init (NMAccessPointClass *ap_class) "Strength", "Strength", G_MININT8, G_MAXINT8, 0, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); /* Signals */ signals[PROPERTIES_CHANGED] = -- cgit v1.2.1 From 37c578a2a25a232321f3a541304a11983ef7fcec Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 11 Aug 2010 17:26:33 -0500 Subject: core: fix unmanaging of devices when quitting When NM quits, we don't want to unmanage a device that has an active connection and can take that connection over again when NM starts back up. This makes '/etc/init.d/NetworkManager restart' work seamlessly. All other devices get unmanaged so their connection (and any dependent VPN connections or wpa_supplicant processes) get terminated. This bug caused active VPN connections over wifi to be left running even when they didn't have IP connectivity. There were two bugs: 1) the NMDevice class implemented connection_match_config() for all device subclasses, but only Ethernet devices can assume connections at startup. Thus the quit-time check passed for active wifi devices too, and they weren't properly cleaned up 2) The logic for figuring out which devices to clean up after when quitting was somewhat flawed; we want to default to unmanaging devices and then skip that step for ones that meet specific criteria. Instead the code defaulted to leaving all devices active at shutdown. --- src/nm-device-interface.c | 6 ++++-- src/nm-device-interface.h | 4 +++- src/nm-device.c | 12 +++++++++++- src/nm-manager.c | 39 +++++++++++++++++++-------------------- 4 files changed, 37 insertions(+), 24 deletions(-) diff --git a/src/nm-device-interface.c b/src/nm-device-interface.c index a0b9877bcc..eb0e009e20 100644 --- a/src/nm-device-interface.c +++ b/src/nm-device-interface.c @@ -398,11 +398,13 @@ nm_device_interface_connection_match_config (NMDeviceInterface *device, } gboolean -nm_device_interface_can_assume_connection (NMDeviceInterface *device) +nm_device_interface_can_assume_connections (NMDeviceInterface *device) { g_return_val_if_fail (NM_IS_DEVICE_INTERFACE (device), FALSE); - return !!NM_DEVICE_INTERFACE_GET_INTERFACE (device)->connection_match_config; + if (NM_DEVICE_INTERFACE_GET_INTERFACE (device)->can_assume_connections) + return NM_DEVICE_INTERFACE_GET_INTERFACE (device)->can_assume_connections (device); + return FALSE; } void diff --git a/src/nm-device-interface.h b/src/nm-device-interface.h index 0d8772dfce..f39e8459db 100644 --- a/src/nm-device-interface.h +++ b/src/nm-device-interface.h @@ -109,6 +109,8 @@ struct _NMDeviceInterface { NMConnection * (*connection_match_config) (NMDeviceInterface *device, const GSList *specs); + gboolean (*can_assume_connections) (NMDeviceInterface *device); + void (*set_enabled) (NMDeviceInterface *device, gboolean enabled); gboolean (*get_enabled) (NMDeviceInterface *device); @@ -145,7 +147,7 @@ gboolean nm_device_interface_spec_match_list (NMDeviceInterface *device, NMConnection * nm_device_interface_connection_match_config (NMDeviceInterface *device, const GSList *connections); -gboolean nm_device_interface_can_assume_connection (NMDeviceInterface *device); +gboolean nm_device_interface_can_assume_connections (NMDeviceInterface *device); gboolean nm_device_interface_get_enabled (NMDeviceInterface *device); diff --git a/src/nm-device.c b/src/nm-device.c index ba004cb7c1..d7c57fced2 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -159,6 +159,7 @@ static void nm_device_deactivate (NMDeviceInterface *device, NMDeviceStateReason static gboolean device_disconnect (NMDeviceInterface *device, GError **error); static gboolean spec_match_list (NMDeviceInterface *device, const GSList *specs); static NMConnection *connection_match_config (NMDeviceInterface *device, const GSList *connections); +static gboolean can_assume_connections (NMDeviceInterface *device); static void nm_device_activate_schedule_stage5_ip_config_commit (NMDevice *self, int family); @@ -196,6 +197,7 @@ device_interface_init (NMDeviceInterface *device_interface_class) device_interface_class->disconnect = device_disconnect; device_interface_class->spec_match_list = spec_match_list; device_interface_class->connection_match_config = connection_match_config; + device_interface_class->can_assume_connections = can_assume_connections; } @@ -3310,7 +3312,7 @@ dispose (GObject *object) /* Don't down can-assume-connection capable devices that are activated with * a connection that can be assumed. */ - if ( nm_device_interface_can_assume_connection (NM_DEVICE_INTERFACE (self)) + if ( nm_device_interface_can_assume_connections (NM_DEVICE_INTERFACE (self)) && (nm_device_get_state (self) == NM_DEVICE_STATE_ACTIVATED)) { NMConnection *connection; NMSettingIP4Config *s_ip4; @@ -3868,6 +3870,14 @@ connection_match_config (NMDeviceInterface *device, const GSList *connections) return NULL; } +static gboolean +can_assume_connections (NMDeviceInterface *device) +{ + g_return_val_if_fail (device != NULL, FALSE); + + return !!NM_DEVICE_GET_CLASS (device)->connection_match_config; +} + void nm_device_set_dhcp_timeout (NMDevice *device, guint32 timeout) { diff --git a/src/nm-manager.c b/src/nm-manager.c index 7a781c26ae..524b0becfa 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -139,8 +139,7 @@ static NMDevice *find_device_by_iface (NMManager *self, const gchar *iface); static GSList * remove_one_device (NMManager *manager, GSList *list, NMDevice *device, - gboolean quitting, - gboolean force_unmanage); + gboolean quitting); static NMDevice *nm_manager_get_device_by_udi (NMManager *manager, const char *udi); @@ -371,8 +370,7 @@ modem_added (NMModemManager *modem_manager, priv->devices = remove_one_device (NM_MANAGER (user_data), priv->devices, replace_device, - FALSE, - TRUE); + FALSE); } /* Give Bluetooth DUN devices first chance to claim the modem */ @@ -471,20 +469,22 @@ static GSList * remove_one_device (NMManager *manager, GSList *list, NMDevice *device, - gboolean quitting, - gboolean force_unmanage) + gboolean quitting) { NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); if (nm_device_get_managed (device)) { - gboolean unmanage = !quitting; - - /* Don't unmanage active assume-connection-capable devices at shutdown */ - if ( nm_device_interface_can_assume_connection (NM_DEVICE_INTERFACE (device)) - && nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) - unmanage = FALSE; + /* When quitting, we want to leave up interfaces & connections + * that can be taken over again (ie, "assumed") when NM restarts + * so that '/etc/init.d/NetworkManager restart' will not distrupt + * networking for interfaces that support connection assumption. + * All other devices get unmanaged when NM quits so that their + * connections get torn down and the interface is deactivated. + */ - if (unmanage || force_unmanage) + if ( !nm_device_interface_can_assume_connections (NM_DEVICE_INTERFACE (device)) + || (nm_device_get_state (device) != NM_DEVICE_STATE_ACTIVATED) + || !quitting) nm_device_set_managed (device, FALSE, NM_DEVICE_STATE_REASON_REMOVED); } @@ -518,7 +518,7 @@ modem_removed (NMModemManager *modem_manager, /* Otherwise remove the standalone modem */ found = nm_manager_get_device_by_udi (self, nm_modem_get_path (modem)); if (found) - priv->devices = remove_one_device (self, priv->devices, found, FALSE, TRUE); + priv->devices = remove_one_device (self, priv->devices, found, FALSE); } static void @@ -2069,7 +2069,7 @@ add_device (NMManager *self, NMDevice *device) /* Check if we should assume the device's active connection by matching its * config with an existing system connection. */ - if (nm_device_interface_can_assume_connection (NM_DEVICE_INTERFACE (device))) { + if (nm_device_interface_can_assume_connections (NM_DEVICE_INTERFACE (device))) { GSList *connections = NULL; g_hash_table_iter_init (&iter, priv->system_connections); @@ -2229,7 +2229,7 @@ bluez_manager_resync_devices (NMManager *self) priv->devices = keep; while (g_slist_length (gone)) - gone = remove_one_device (self, gone, NM_DEVICE (gone->data), FALSE, TRUE); + gone = remove_one_device (self, gone, NM_DEVICE (gone->data), FALSE); } else { g_slist_free (keep); g_slist_free (gone); @@ -2298,7 +2298,7 @@ bluez_manager_bdaddr_removed_cb (NMBluezManager *bluez_mgr, NMDevice *device = NM_DEVICE (iter->data); if (!strcmp (nm_device_get_udi (device), object_path)) { - priv->devices = remove_one_device (self, priv->devices, device, FALSE, TRUE); + priv->devices = remove_one_device (self, priv->devices, device, FALSE); break; } } @@ -2367,7 +2367,7 @@ udev_device_removed_cb (NMUdevManager *manager, ifindex = g_udev_device_get_property_as_int (udev_device, "IFINDEX"); device = find_device_by_ifindex (self, ifindex); if (device) - priv->devices = remove_one_device (self, priv->devices, device, FALSE, TRUE); + priv->devices = remove_one_device (self, priv->devices, device, FALSE); } static void @@ -4065,8 +4065,7 @@ dispose (GObject *object) priv->devices = remove_one_device (manager, priv->devices, NM_DEVICE (priv->devices->data), - TRUE, - FALSE); + TRUE); } user_proxy_cleanup (manager, FALSE); -- cgit v1.2.1 From 4b44a2bd540eaef0860d8c76fc3c620847efcad7 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 12 Aug 2010 11:15:26 -0500 Subject: core: add systemd unit support --- .gitignore | 3 +++ Makefile.am | 7 ++++++- configure.ac | 15 +++++++++++++++ data/Makefile.am | 26 ++++++++++++++++++++++++++ data/NetworkManager.service.in | 12 ++++++++++++ data/org.freedesktop.NetworkManager.service.in | 11 +++++++++++ 6 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 data/Makefile.am create mode 100644 data/NetworkManager.service.in create mode 100644 data/org.freedesktop.NetworkManager.service.in diff --git a/.gitignore b/.gitignore index 22f990911d..2fee0804a2 100644 --- a/.gitignore +++ b/.gitignore @@ -108,4 +108,7 @@ m4/lt*.m4 policy/org.freedesktop.network-manager-settings.system.policy policy/org.freedesktop.NetworkManager.policy +data/NetworkManager.service +data/org.freedesktop.NetworkManager.service + cli/src/nmcli diff --git a/Makefile.am b/Makefile.am index 7e34571218..64be5c8526 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,6 +10,7 @@ SUBDIRS = \ cli \ tools \ policy \ + data \ initscript \ test \ po \ @@ -24,7 +25,11 @@ EXTRA_DIST = \ intltool-merge.in \ intltool-update.in -DISTCHECK_CONFIGURE_FLAGS = --with-tests=yes --with-docs=yes --with-udev-dir=$$dc_install_base/lib/udev +DISTCHECK_CONFIGURE_FLAGS = \ + --with-tests=yes \ + --with-docs=yes \ + --with-udev-dir=$$dc_install_base/lib/udev \ + --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) DISTCLEANFILES = intltool-extract intltool-merge intltool-update diff --git a/configure.ac b/configure.ac index 3217734dcc..cfc2122b08 100644 --- a/configure.ac +++ b/configure.ac @@ -237,6 +237,14 @@ else fi AC_SUBST(UDEV_BASE_DIR) +# systemd +AC_ARG_WITH([systemdsystemunitdir], + AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), + [], + [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) +AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) +AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir"]) + PKG_CHECK_MODULES(LIBNL, libnl-1 >= 1.0-pre8) AC_SUBST(LIBNL_CFLAGS) AC_SUBST(LIBNL_LIBS) @@ -528,6 +536,7 @@ man/nm-online.1 man/nmcli.1 po/Makefile.in policy/Makefile +data/Makefile docs/Makefile docs/libnm-glib/Makefile docs/libnm-util/Makefile @@ -555,6 +564,12 @@ else echo dhcpcd support: no fi +if test -n "${with_systemdsystemunitdir}"; then + echo systemd support: ${with_systemdsystemunitdir} +else + echo systemd support: no +fi + echo echo Building documentation: ${with_docs} echo Building tests: ${with_tests} diff --git a/data/Makefile.am b/data/Makefile.am new file mode 100644 index 0000000000..f91d3a8255 --- /dev/null +++ b/data/Makefile.am @@ -0,0 +1,26 @@ + +if HAVE_SYSTEMD +systemdsystemunit_DATA = NetworkManager.service + +NetworkManager.service: NetworkManager.service.in + $(edit) $< >$@ + +servicedir = $(datadir)/dbus-1/system-services +service_in_files = org.freedesktop.NetworkManager.service.in +service_DATA = $(service_in_files:.service.in=.service) + +$(service_DATA): $(service_in_files) Makefile + $(edit) $< >$@ +endif + +edit = sed \ + -e 's|@sbindir[@]|$(sbindir)|g' \ + -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ + -e 's|@localstatedir[@]|$(localstatedir)|g' + +EXTRA_DIST = \ + NetworkManager.service.in \ + org.freedesktop.NetworkManager.service.in + +CLEANFILES = NetworkManager.service org.freedesktop.NetworkManager.service + diff --git a/data/NetworkManager.service.in b/data/NetworkManager.service.in new file mode 100644 index 0000000000..c2741fcc19 --- /dev/null +++ b/data/NetworkManager.service.in @@ -0,0 +1,12 @@ +[Unit] +Description=Network Manager +After=syslog.target + +[Service] +Type=dbus +BusName=org.freedesktop.NetworkManager +ExecStart=@sbindir@/NetworkManager --no-daemon + +[Install] +WantedBy=network.target multi-user.target +Alias=NetworkManager-by-dbus diff --git a/data/org.freedesktop.NetworkManager.service.in b/data/org.freedesktop.NetworkManager.service.in new file mode 100644 index 0000000000..7434903bad --- /dev/null +++ b/data/org.freedesktop.NetworkManager.service.in @@ -0,0 +1,11 @@ +# This D-Bus service activation file is only for systemd support since +# an auto-activated NetworkManager would be quite surprising for those people +# who have NM installed but turned off. Thus the Exec path available to +# D-Bus is /bin/false, but systemd knows the real Exec path due to the NM +# systemd .service file. + +[D-BUS Service] +Name=org.freedesktop.NetworkManager +Exec=/bin/false +User=root +SystemdService=NetworkManager-by-dbus.service -- cgit v1.2.1 From 73e5b74c6cb149c5c0935eeaf63d71d22b9dec40 Mon Sep 17 00:00:00 2001 From: Daniel Nylander Date: Thu, 12 Aug 2010 16:22:37 -0500 Subject: po: updated Swedish translation (bgo #626693) --- po/sv.po | 1791 ++++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 1031 insertions(+), 760 deletions(-) diff --git a/po/sv.po b/po/sv.po index d9d9147a5c..42b5e884ad 100644 --- a/po/sv.po +++ b/po/sv.po @@ -9,8 +9,8 @@ msgid "" msgstr "" "Project-Id-Version: NetworkManager\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-02-26 03:24+0000\n" -"PO-Revision-Date: 2010-03-02 22:05+0100\n" +"POT-Creation-Date: 2010-08-10 03:25+0000\n" +"PO-Revision-Date: 2010-08-12 01:57+0100\n" "Last-Translator: Daniel Nylander \n" "Language-Team: Swedish \n" "MIME-Version: 1.0\n" @@ -18,7 +18,87 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../cli/src/connections.c:86 +#: ../cli/src/connections.c:60 +#: ../cli/src/connections.c:75 +#: ../cli/src/devices.c:88 +#: ../cli/src/devices.c:101 +#: ../cli/src/devices.c:111 +#: ../cli/src/devices.c:121 +#: ../cli/src/devices.c:134 +#: ../cli/src/devices.c:145 +#: ../cli/src/devices.c:156 +#: ../cli/src/devices.c:165 +#: ../cli/src/devices.c:174 +msgid "NAME" +msgstr "NAMN" + +#. 0 +#: ../cli/src/connections.c:61 +#: ../cli/src/connections.c:76 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:62 +msgid "DEVICES" +msgstr "ENHETER" + +#. 2 +#: ../cli/src/connections.c:63 +#: ../cli/src/connections.c:78 +msgid "SCOPE" +msgstr "OMFÅNG" + +#. 3 +#: ../cli/src/connections.c:64 +msgid "DEFAULT" +msgstr "STANDARD" + +#. 4 +#: ../cli/src/connections.c:65 +msgid "DBUS-SERVICE" +msgstr "DBUS-TJÄNST" + +#. 5 +#: ../cli/src/connections.c:66 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:67 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:77 +#: ../cli/src/devices.c:62 +#: ../cli/src/devices.c:90 +msgid "TYPE" +msgstr "TYP" + +#. 3 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP" +msgstr "TIDSSTÄMPEL" + +#. 4 +#: ../cli/src/connections.c:80 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:81 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:82 +msgid "READONLY" +msgstr "SKRIVSKYDDAD" + +#: ../cli/src/connections.c:158 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -37,371 +117,618 @@ msgstr "" " up id | uuid [iface ] [ap ] [--nowait] [--timeout ]\n" " down id | uuid \n" -#: ../cli/src/connections.c:158 -#| msgid "_VPN Connections" -msgid "Connections" -msgstr "Anslutningar" - -#: ../cli/src/connections.c:158 -#: ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 #: ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 -#: ../cli/src/connections.c:207 -#: ../cli/src/devices.c:298 -#: ../cli/src/devices.c:458 -#: ../cli/src/devices.c:460 -msgid "Type" -msgstr "Typ" +#: ../cli/src/connections.c:537 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Fel: \"con list\": %s" + +#: ../cli/src/connections.c:200 +#: ../cli/src/connections.c:539 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Fel: \"con list\": %s; tillåtna fält: %s" + +#: ../cli/src/connections.c:208 +#| msgid "Connections" +msgid "Connection details" +msgstr "Anslutningsdetaljer" + +#: ../cli/src/connections.c:382 +#: ../cli/src/connections.c:602 +#| msgid "System" +msgid "system" +msgstr "system" + +#: ../cli/src/connections.c:382 +#: ../cli/src/connections.c:602 +msgid "user" +msgstr "användare" + +#: ../cli/src/connections.c:384 +msgid "never" +msgstr "aldrig" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:385 +#: ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 +#: ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 +#: ../cli/src/devices.c:557 +#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 +#: ../cli/src/devices.c:585 +#: ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 +#: ../cli/src/settings.c:508 +#: ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 +msgid "yes" +msgstr "ja" -#: ../cli/src/connections.c:158 -#: ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 -#: ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 -#: ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 -#: ../cli/src/connections.c:299 -msgid "UUID" -msgstr "UUID" +#: ../cli/src/connections.c:385 +#: ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 +#: ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 +#: ../cli/src/devices.c:557 +#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 +#: ../cli/src/devices.c:585 +#: ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 +#: ../cli/src/settings.c:508 +#: ../cli/src/settings.c:510 +#: ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 +msgid "no" +msgstr "nej" -#: ../cli/src/connections.c:158 -#: ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 -#: ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 -#: ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 -#: ../cli/src/connections.c:299 -msgid "Name" -msgstr "Namn" - -#: ../cli/src/connections.c:163 -#, c-format -#| msgid "Modify system connections" -msgid "System connections:\n" -msgstr "Systemanslutningar:\n" - -#: ../cli/src/connections.c:167 -#, c-format -#| msgid "No network connection" -msgid "User connections:\n" -msgstr "Användaranslutningar:\n" - -#: ../cli/src/connections.c:178 -#: ../cli/src/connections.c:967 -#: ../cli/src/connections.c:983 -#: ../cli/src/connections.c:992 -#: ../cli/src/connections.c:1003 -#: ../cli/src/connections.c:1085 -#: ../cli/src/devices.c:604 -#: ../cli/src/devices.c:614 -#: ../cli/src/devices.c:699 -#: ../cli/src/devices.c:785 -#: ../cli/src/devices.c:792 +#: ../cli/src/connections.c:458 +#: ../cli/src/connections.c:501 +#| msgid "System connections:\n" +msgid "System connections" +msgstr "systemanslutningar" + +#: ../cli/src/connections.c:463 +#: ../cli/src/connections.c:514 +msgid "User connections" +msgstr "Användaranslutningar" + +#: ../cli/src/connections.c:475 +#: ../cli/src/connections.c:1335 +#: ../cli/src/connections.c:1351 +#: ../cli/src/connections.c:1360 +#: ../cli/src/connections.c:1371 +#: ../cli/src/connections.c:1456 +#: ../cli/src/devices.c:962 +#: ../cli/src/devices.c:972 +#: ../cli/src/devices.c:1074 +#: ../cli/src/devices.c:1081 #, c-format msgid "Error: %s argument is missing." msgstr "Fel: %s-argument saknas." -#: ../cli/src/connections.c:189 +#: ../cli/src/connections.c:488 #, c-format msgid "Error: %s - no such connection." msgstr "Fel: %s - ingen sådan anslutning." -#: ../cli/src/connections.c:196 -#| msgid "Modify system connections" -msgid "System-wide connections" -msgstr "Systemanslutningar" - -#: ../cli/src/connections.c:205 -#| msgid "No network connection" -msgid "User connections" -msgstr "Användaranslutningar" - -#: ../cli/src/connections.c:212 -#: ../cli/src/connections.c:1016 -#: ../cli/src/connections.c:1103 -#: ../cli/src/devices.c:446 -#: ../cli/src/devices.c:494 -#: ../cli/src/devices.c:628 -#: ../cli/src/devices.c:706 -#: ../cli/src/devices.c:798 +#: ../cli/src/connections.c:520 +#: ../cli/src/connections.c:1384 +#: ../cli/src/connections.c:1474 +#: ../cli/src/devices.c:785 +#: ../cli/src/devices.c:852 +#: ../cli/src/devices.c:986 +#: ../cli/src/devices.c:1087 #, c-format msgid "Unknown parameter: %s\n" msgstr "Okänd parameter: %s\n" -#: ../cli/src/connections.c:221 +#: ../cli/src/connections.c:529 #, c-format msgid "Error: no valid parameter specified." msgstr "Fel: ingen giltig parameter angiven." -#. FIXME: Fix the output -#: ../cli/src/connections.c:268 -#: ../cli/src/devices.c:302 -#: ../cli/src/devices.c:321 -#: ../cli/src/devices.c:353 -#: ../cli/src/devices.c:355 -#: ../cli/src/devices.c:357 -#: ../cli/src/devices.c:359 -#: ../cli/src/devices.c:361 -msgid "yes" -msgstr "ja" +#: ../cli/src/connections.c:544 +#: ../cli/src/connections.c:1577 +#: ../cli/src/devices.c:1293 +#: ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "Fel: %s." -#: ../cli/src/connections.c:268 -#: ../cli/src/devices.c:304 -msgid "no" -msgstr "nej" +#: ../cli/src/connections.c:650 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Fel: \"con status\": %s" + +#: ../cli/src/connections.c:652 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Fel: \"con status\": %s; tillåtna fält: %s" -#: ../cli/src/connections.c:297 -#| msgid "Modify system connections" +#: ../cli/src/connections.c:659 msgid "Active connections" msgstr "Aktiva anslutningar" -#: ../cli/src/connections.c:297 -#: ../cli/src/connections.c:299 -#: ../cli/src/devices.c:302 -#: ../cli/src/devices.c:304 -msgid "Default" -msgstr "Standard" - -#: ../cli/src/connections.c:297 -#: ../cli/src/connections.c:299 -msgid "Service" -msgstr "Tjänst" - -#: ../cli/src/connections.c:297 -#: ../cli/src/connections.c:299 -msgid "Devices" -msgstr "Enheter" - -#: ../cli/src/connections.c:659 +#: ../cli/src/connections.c:1027 #, c-format -#| msgid "VPN connection to '%s'" msgid "no active connection on device '%s'" msgstr "ingen aktiv anslutning på enheten \"%s\"" -#: ../cli/src/connections.c:667 +#: ../cli/src/connections.c:1035 #, c-format msgid "no active connection or device" msgstr "ingen aktiv anslutning eller enhet" -#: ../cli/src/connections.c:730 +#: ../cli/src/connections.c:1085 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "enheten \"%s\" är inte kompatibel med anslutningen \"%s\"" + +#: ../cli/src/connections.c:1087 +#, c-format +#| msgid "no active connection on device '%s'" +msgid "no device found for connection '%s'" +msgstr "ingen enhet hittades för anslutningen \"%s\"" + +#: ../cli/src/connections.c:1098 msgid "activating" msgstr "aktiverar" -#: ../cli/src/connections.c:732 +#: ../cli/src/connections.c:1100 msgid "activated" msgstr "aktiverad" -#: ../cli/src/connections.c:735 -#: ../cli/src/connections.c:758 -#: ../cli/src/connections.c:791 -#: ../cli/src/devices.c:111 -#: ../cli/src/network-manager.c:76 -#: ../cli/src/network-manager.c:98 -#| msgid "(unknown)" +#: ../cli/src/connections.c:1103 +#: ../cli/src/connections.c:1126 +#: ../cli/src/connections.c:1159 +#: ../cli/src/devices.c:246 +#: ../cli/src/devices.c:558 +#: ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 +#: ../cli/src/settings.c:473 msgid "unknown" msgstr "okänt" -#: ../cli/src/connections.c:744 -#| msgid "VPN connecting to '%s'" +#: ../cli/src/connections.c:1112 msgid "VPN connecting (prepare)" msgstr "VPN ansluter (förbereder)" -#: ../cli/src/connections.c:746 +#: ../cli/src/connections.c:1114 msgid "VPN connecting (need authentication)" msgstr "VPN ansluter (behöver autentisering)" -#: ../cli/src/connections.c:748 -#| msgid "_VPN Connections" +#: ../cli/src/connections.c:1116 msgid "VPN connecting" msgstr "VPN ansluter" -#: ../cli/src/connections.c:750 +#: ../cli/src/connections.c:1118 msgid "VPN connecting (getting IP configuration)" msgstr "VPN ansluter (hämtar IP-konfiguration)" -#: ../cli/src/connections.c:752 -#| msgid "_VPN Connections" +#: ../cli/src/connections.c:1120 msgid "VPN connected" msgstr "VPN ansluten" -#: ../cli/src/connections.c:754 -#| msgid "VPN Connect Failure" +#: ../cli/src/connections.c:1122 msgid "VPN connection failed" msgstr "VPN-anslutning misslyckades" -#: ../cli/src/connections.c:756 -#| msgid "VPN Connect Failure" +#: ../cli/src/connections.c:1124 msgid "VPN disconnected" msgstr "VPN frånkopplad" -#: ../cli/src/connections.c:767 -#| msgid "(unknown)" +#: ../cli/src/connections.c:1135 msgid "unknown reason" msgstr "okänd anledning" -#: ../cli/src/connections.c:769 -#| msgid "None" +#: ../cli/src/connections.c:1137 msgid "none" msgstr "ingen" -#: ../cli/src/connections.c:771 +#: ../cli/src/connections.c:1139 msgid "the user was disconnected" msgstr "användaren kopplades från" -#: ../cli/src/connections.c:773 +#: ../cli/src/connections.c:1141 msgid "the base network connection was interrupted" msgstr "basnätverksanslutningen avbröts" -#: ../cli/src/connections.c:775 +#: ../cli/src/connections.c:1143 msgid "the VPN service stopped unexpectedly" msgstr "VPN-tjänsten stoppades oväntat" -#: ../cli/src/connections.c:777 +#: ../cli/src/connections.c:1145 msgid "the VPN service returned invalid configuration" msgstr "VPN-tjänsten returnerade en ogiltig konfiguration" -#: ../cli/src/connections.c:779 +#: ../cli/src/connections.c:1147 msgid "the connection attempt timed out" msgstr "anslutningsförsöket översteg tidsgränsen" -#: ../cli/src/connections.c:781 +#: ../cli/src/connections.c:1149 msgid "the VPN service did not start in time" msgstr "VPN-tjänsten startade inte i tid" -#: ../cli/src/connections.c:783 +#: ../cli/src/connections.c:1151 msgid "the VPN service failed to start" msgstr "VPN-tjänsten misslyckades med att starta" -#: ../cli/src/connections.c:785 +#: ../cli/src/connections.c:1153 msgid "no valid VPN secrets" msgstr "inga giltiga VPN-hemligheter" -#: ../cli/src/connections.c:787 +#: ../cli/src/connections.c:1155 msgid "invalid VPN secrets" msgstr "ogiltiga VPN-hemligheter" -#: ../cli/src/connections.c:789 +#: ../cli/src/connections.c:1157 msgid "the connection was removed" msgstr "anslutningen togs bort" -#: ../cli/src/connections.c:803 +#: ../cli/src/connections.c:1171 #, c-format msgid "state: %s\n" msgstr "tillstånd: %s\n" -#: ../cli/src/connections.c:806 -#: ../cli/src/connections.c:832 +#: ../cli/src/connections.c:1174 +#: ../cli/src/connections.c:1200 #, c-format -#| msgid "Connection _Information" msgid "Connection activated\n" msgstr "Anslutning aktiverad\n" -#: ../cli/src/connections.c:809 +#: ../cli/src/connections.c:1177 #, c-format -#| msgid "Connection to the wired network failed." msgid "Error: Connection activation failed." msgstr "Fel: Aktivering av anslutning misslyckades." -#: ../cli/src/connections.c:828 +#: ../cli/src/connections.c:1196 #, c-format msgid "state: %s (%d)\n" msgstr "tillstånd: %s (%d)\n" -#: ../cli/src/connections.c:838 +#: ../cli/src/connections.c:1206 #, c-format msgid "Error: Connection activation failed: %s." msgstr "Fel: Aktivering av anslutning misslyckades: %s." -#: ../cli/src/connections.c:855 -#: ../cli/src/devices.c:551 +#: ../cli/src/connections.c:1223 +#: ../cli/src/devices.c:909 #, c-format msgid "Error: Timeout %d sec expired." msgstr "Fel: Tidsgränsen %d sekunder gick ut." -#: ../cli/src/connections.c:898 +#: ../cli/src/connections.c:1266 #, c-format msgid "Error: Connection activation failed: %s" msgstr "Fel: Aktivering av anslutning misslyckades: %s" -#: ../cli/src/connections.c:912 +#: ../cli/src/connections.c:1280 #, c-format msgid "Error: Obtaining active connection for '%s' failed." msgstr "Fel: Hämtning av aktiv anslutning för \"%s\" misslyckades." -#: ../cli/src/connections.c:921 +#: ../cli/src/connections.c:1289 #, c-format -#| msgid "VPN connection to '%s'" msgid "Active connection state: %s\n" msgstr "Tillstånd för aktiv anslutning: %s\n" -#: ../cli/src/connections.c:922 +#: ../cli/src/connections.c:1290 #, c-format -#| msgid "VPN connection to '%s'" msgid "Active connection path: %s\n" msgstr "Sökväg för aktiv anslutning: %s\n" -#: ../cli/src/connections.c:976 -#: ../cli/src/connections.c:1094 +#: ../cli/src/connections.c:1344 +#: ../cli/src/connections.c:1465 #, c-format msgid "Error: Unknown connection: %s." msgstr "Fel: Okänd anslutning: %s." -#: ../cli/src/connections.c:1011 -#: ../cli/src/devices.c:622 +#: ../cli/src/connections.c:1379 +#: ../cli/src/devices.c:980 #, c-format msgid "Error: timeout value '%s' is not valid." msgstr "Fel: värdet \"%s\" för tidsgränsen är inte giltigt." -#: ../cli/src/connections.c:1024 -#: ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:1392 +#: ../cli/src/connections.c:1482 #, c-format msgid "Error: id or uuid has to be specified." msgstr "Fel: id eller uuid måste anges." -#: ../cli/src/connections.c:1044 +#: ../cli/src/connections.c:1412 #, c-format msgid "Error: No suitable device found: %s." msgstr "Fel: Ingen lämplig enhet hittades: %s." -#: ../cli/src/connections.c:1046 +#: ../cli/src/connections.c:1414 #, c-format msgid "Error: No suitable device found." msgstr "Fel: Ingen lämplig enhet hittades." -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1509 #, c-format msgid "Warning: Connection not active\n" msgstr "Varning: Anslutningen är inte aktiv\n" -#: ../cli/src/connections.c:1189 +#: ../cli/src/connections.c:1566 #, c-format msgid "Error: 'con' command '%s' is not valid." msgstr "Fel: \"con\"-kommandot \"%s\" är inte giltigt." -#: ../cli/src/connections.c:1216 +#: ../cli/src/connections.c:1602 #, c-format msgid "Error: could not connect to D-Bus." msgstr "Fel: kunde inte ansluta till D-Bus." -#: ../cli/src/connections.c:1223 +#: ../cli/src/connections.c:1609 #, c-format msgid "Error: Could not get system settings." msgstr "Fel: Kunde inte få systeminställningar." -#: ../cli/src/connections.c:1231 +#: ../cli/src/connections.c:1617 #, c-format msgid "Error: Could not get user settings." msgstr "Fel: Kunde inte få användarinställningar." -#: ../cli/src/connections.c:1241 +#: ../cli/src/connections.c:1627 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "Fel: Kan inte få anslutningar: inställningstjänster är inte igång." +#. 0 +#. 9 +#: ../cli/src/devices.c:61 +#: ../cli/src/devices.c:89 +#: ../cli/src/devices.c:184 +msgid "DEVICE" +msgstr "ENHET" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:63 +#: ../cli/src/devices.c:93 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "TILLSTÅND" + +#: ../cli/src/devices.c:72 +msgid "GENERAL" +msgstr "ALLMÄNT" + +#. 0 #: ../cli/src/devices.c:73 -#, c-format +msgid "CAPABILITIES" +msgstr "FÖRMÅGOR" + +#. 1 +#: ../cli/src/devices.c:74 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-EGENSKAPER" + +#. 2 +#: ../cli/src/devices.c:75 +#| msgid "PEAP" +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:76 +msgid "WIRED-PROPERTIES" +msgstr "TRÅDADE-EGENSKAPER" + +#. 4 +#: ../cli/src/devices.c:77 +msgid "IP4-SETTINGS" +msgstr "IP4-INSTÄLLNINGAR" + +#. 5 +#: ../cli/src/devices.c:78 +#| msgid "DNS" +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 6 +#: ../cli/src/devices.c:79 +msgid "IP6-SETTINGS" +msgstr "IP6-INSTÄLLNINGAR" + +#. 7 +#: ../cli/src/devices.c:80 +#| msgid "DNS" +msgid "IP6-DNS" +msgstr "IP6-DNS" + +#. 2 +#: ../cli/src/devices.c:91 +msgid "DRIVER" +msgstr "DRIVRUTIN" + +#. 3 +#: ../cli/src/devices.c:92 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:102 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:103 +msgid "SPEED" +msgstr "HASTIGHET" + +#. 0 +#: ../cli/src/devices.c:112 +msgid "CARRIER" +msgstr "BÄRARE" + +#. 0 +#: ../cli/src/devices.c:122 +#| msgid " WEP" +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:123 +#| msgid " WPA" +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:124 +#| msgid " WPA2" +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:125 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:126 +#| msgid "AES-CCMP" +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:135 +#: ../cli/src/devices.c:146 +msgid "ADDRESS" +msgstr "ADRESS" + +#. 1 +#: ../cli/src/devices.c:136 +#: ../cli/src/devices.c:147 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:137 +#: ../cli/src/devices.c:148 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:157 +#: ../cli/src/devices.c:166 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:175 +#| msgid "SSID:" +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:176 +#| msgid "BSSID:" +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:177 +msgid "MODE" +msgstr "LÄGE" + +#. 3 +#: ../cli/src/devices.c:178 +msgid "FREQ" +msgstr "FREK" + +#. 4 +#: ../cli/src/devices.c:179 +msgid "RATE" +msgstr "FREKVENS" + +#. 5 +#: ../cli/src/devices.c:180 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:181 +msgid "SECURITY" +msgstr "SÄKERHET" + +#. 7 +#: ../cli/src/devices.c:182 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGGOR" + +#. 8 +#: ../cli/src/devices.c:183 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGGOR" + +#. 10 +#: ../cli/src/devices.c:185 +msgid "ACTIVE" +msgstr "AKTIV" + +#: ../cli/src/devices.c:208 +#, c-format +#| msgid "" +#| "Usage: nmcli dev { COMMAND | help }\n" +#| "\n" +#| " COMMAND := { status | list | disconnect | wifi }\n" +#| "\n" +#| " status\n" +#| " list [iface ]\n" +#| " disconnect iface [--nowait] [--timeout ]\n" +#| " wifi [list [iface ] | apinfo iface hwaddr ]\n" +#| "\n" msgid "" "Usage: nmcli dev { COMMAND | help }\n" "\n" @@ -410,7 +737,7 @@ msgid "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" msgstr "" "Användning: nmcli dev { KOMMANDO | help }\n" @@ -420,371 +747,253 @@ msgstr "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" -#: ../cli/src/devices.c:93 +#: ../cli/src/devices.c:228 msgid "unmanaged" msgstr "ohanterad" -#: ../cli/src/devices.c:95 +#: ../cli/src/devices.c:230 msgid "unavailable" msgstr "otillgänglig" -#: ../cli/src/devices.c:97 -#: ../cli/src/network-manager.c:73 -#| msgid "_Disconnect VPN..." +#: ../cli/src/devices.c:232 +#: ../cli/src/network-manager.c:89 msgid "disconnected" msgstr "frånkopplad" -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:234 msgid "connecting (prepare)" msgstr "ansluter (förbereder)" -#: ../cli/src/devices.c:101 +#: ../cli/src/devices.c:236 msgid "connecting (configuring)" msgstr "ansluter (konfigurerar)" -#: ../cli/src/devices.c:103 +#: ../cli/src/devices.c:238 msgid "connecting (need authentication)" msgstr "ansluter (behöver autentisering)" -#: ../cli/src/devices.c:105 -#| msgid "Connection _Information" +#: ../cli/src/devices.c:240 msgid "connecting (getting IP configuration)" msgstr "ansluter (hämtar IP-konfiguration)" -#: ../cli/src/devices.c:107 -#: ../cli/src/network-manager.c:71 +#: ../cli/src/devices.c:242 +#: ../cli/src/network-manager.c:87 msgid "connected" msgstr "ansluten" -#: ../cli/src/devices.c:109 -#| msgid "Connection _Information" +#: ../cli/src/devices.c:244 msgid "connection failed" msgstr "anslutningen misslyckades" -#: ../cli/src/devices.c:132 -#: ../cli/src/devices.c:876 +#: ../cli/src/devices.c:267 +#: ../cli/src/devices.c:424 msgid "Unknown" msgstr "Okänt" -#. print them -#: ../cli/src/devices.c:164 -#: ../cli/src/devices.c:266 -#: ../cli/src/devices.c:861 -#: ../cli/src/devices.c:879 -#| msgid "(unknown)" +#: ../cli/src/devices.c:299 msgid "(none)" msgstr "(ingen)" -#: ../cli/src/devices.c:209 +#: ../cli/src/devices.c:324 #, c-format msgid "%s: error converting IP4 address 0x%X" msgstr "%s: fel vid konvertering av IP4-adress 0x%X" -#: ../cli/src/devices.c:238 +#: ../cli/src/devices.c:393 #, c-format -msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" -msgstr "%s, %s, Frekv %d MHz, Hast %d Mb/s, Styrka %d" - -#: ../cli/src/devices.c:239 -msgid "Ad-Hoc" -msgstr "Ad-Hoc" - -#: ../cli/src/devices.c:248 -msgid ", Encrypted: " -msgstr ", Krypterad: " - -#: ../cli/src/devices.c:253 -msgid " WEP" -msgstr " WEP" - -#: ../cli/src/devices.c:255 -msgid " WPA" -msgstr " WPA" - -#: ../cli/src/devices.c:257 -msgid " WPA2" -msgstr " WPA2" +msgid "%u MHz" +msgstr "%u MHz" -#: ../cli/src/devices.c:260 -msgid " Enterprise" -msgstr " Enterprise" +#: ../cli/src/devices.c:394 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" -#: ../cli/src/devices.c:294 -#: ../cli/src/devices.c:458 -#: ../cli/src/devices.c:460 -msgid "Device" -msgstr "Enhet" +#: ../cli/src/devices.c:403 +#| msgid ", Encrypted: " +msgid "Encrypted: " +msgstr "Krypterad: " -#: ../cli/src/devices.c:299 -msgid "Driver" -msgstr "Drivrutin" +#: ../cli/src/devices.c:408 +#| msgid " WEP" +msgid "WEP " +msgstr "WEP " -#: ../cli/src/devices.c:299 -#: ../cli/src/devices.c:567 -msgid "(unknown)" -msgstr "(okänt)" +#: ../cli/src/devices.c:410 +#| msgid " WPA" +msgid "WPA " +msgstr "WPA " -#: ../cli/src/devices.c:300 -#: ../cli/src/devices.c:458 -#: ../cli/src/devices.c:460 -msgid "State" -msgstr "Tillstånd" +#: ../cli/src/devices.c:412 +#| msgid " WPA2" +msgid "WPA2 " +msgstr "WPA2 " -#: ../cli/src/devices.c:313 -msgid "HW Address" -msgstr "Hårdvaruadress" +#: ../cli/src/devices.c:415 +#| msgid " Enterprise" +msgid "Enterprise " +msgstr "Företag" -#: ../cli/src/devices.c:319 -#, c-format -msgid "" -"\n" -" Capabilities:\n" -msgstr "" -"\n" -" Förmågor:\n" +#: ../cli/src/devices.c:424 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" -#: ../cli/src/devices.c:321 -msgid "Carrier Detect" -msgstr "Bärardetektering" +#: ../cli/src/devices.c:424 +msgid "Infrastructure" +msgstr "Infrastruktur" -#: ../cli/src/devices.c:336 +#: ../cli/src/devices.c:486 #, c-format -#| msgid "%d Mb/s" -msgid "%u Mb/s" -msgstr "%u Mb/s" - -#: ../cli/src/devices.c:337 -msgid "Speed" -msgstr "Hastighet" +msgid "Error: 'dev list': %s" +msgstr "Fel: \"dev list\": %s" -#: ../cli/src/devices.c:348 +#: ../cli/src/devices.c:488 #, c-format -msgid "" -"\n" -" Wireless Properties\n" -msgstr "" -"\n" -" Trådlösa egenskaper\n" - -#: ../cli/src/devices.c:353 -msgid "WEP Encryption" -msgstr "WEP-kryptering" +#| msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Fel: \"dev list\": %s; tillåtna fält: %s" -#: ../cli/src/devices.c:355 -msgid "WPA Encryption" -msgstr "WPA-kryptering" +#: ../cli/src/devices.c:497 +#| msgid "Devices" +msgid "Device details" +msgstr "Enhetsdetaljer" -#: ../cli/src/devices.c:357 -msgid "WPA2 Encryption" -msgstr "WPA2-kryptering" - -#: ../cli/src/devices.c:359 -msgid "TKIP cipher" -msgstr "TKIP-chiffer" - -#: ../cli/src/devices.c:361 -msgid "CCMP cipher" -msgstr "CCMP-chiffer" - -#: ../cli/src/devices.c:368 -#, c-format -msgid "" -"\n" -" Wireless Access Points %s\n" -msgstr "" -"\n" -" Trådlösa accesspunkter %s\n" +#: ../cli/src/devices.c:527 +#: ../cli/src/devices.c:925 +msgid "(unknown)" +msgstr "(okänt)" -#: ../cli/src/devices.c:368 -msgid "(* = current AP)" -msgstr "(* = aktuell AP)" +#: ../cli/src/devices.c:528 +#| msgid "(unknown)" +msgid "unknown)" +msgstr "okänt)" -#: ../cli/src/devices.c:374 +#: ../cli/src/devices.c:554 #, c-format -msgid "" -"\n" -" Wired Properties\n" -msgstr "" -"\n" -" Trådbundna egenskaper\n" - -#: ../cli/src/devices.c:377 -#: ../cli/src/devices.c:379 -msgid "Carrier" -msgstr "Bärare" +msgid "%u Mb/s" +msgstr "%u Mb/s" -#: ../cli/src/devices.c:377 -#| msgid "None" +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:627 msgid "on" msgstr "på" -#: ../cli/src/devices.c:379 +#: ../cli/src/devices.c:627 msgid "off" msgstr "av" -#: ../cli/src/devices.c:387 +#: ../cli/src/devices.c:808 #, c-format -msgid "" -"\n" -" IPv4 Settings:\n" -msgstr "" -"\n" -" IPv4-inställningar:\n" - -#: ../cli/src/devices.c:395 -msgid "Address" -msgstr "Adress" - -#: ../cli/src/devices.c:401 -msgid "Prefix" -msgstr "Prefix" +msgid "Error: 'dev status': %s" +msgstr "Fel: \"dev status\": %s" -#: ../cli/src/devices.c:405 -msgid "Gateway" -msgstr "Gateway" - -#: ../cli/src/devices.c:416 -msgid "DNS" -msgstr "DNS" +#: ../cli/src/devices.c:810 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Fel: \"dev status\": %s; tillåtna fält: %s" -#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:817 msgid "Status of devices" msgstr "Status för enheter" -#: ../cli/src/devices.c:487 +#: ../cli/src/devices.c:845 #, c-format msgid "Error: '%s' argument is missing." msgstr "Fel: \"%s\"-argument saknas." -#: ../cli/src/devices.c:516 -#: ../cli/src/devices.c:655 -#: ../cli/src/devices.c:729 +#: ../cli/src/devices.c:874 +#: ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: Device '%s' not found." msgstr "Fel: Enheten \"%s\" hittades inte." -#: ../cli/src/devices.c:539 +#: ../cli/src/devices.c:897 #, c-format msgid "Success: Device '%s' successfully disconnected." msgstr "Lyckades: Enheten \"%s\" kopplades från." -#: ../cli/src/devices.c:564 +#: ../cli/src/devices.c:922 #, c-format msgid "Error: Device '%s' (%s) disconnecting failed: %s" msgstr "Fel: Frånkoppling av enheten \"%s\" (%s) misslyckades: %s" -#: ../cli/src/devices.c:572 +#: ../cli/src/devices.c:930 #, c-format msgid "Device state: %d (%s)\n" msgstr "Enhetstillstånd: %d (%s)\n" -#: ../cli/src/devices.c:636 +#: ../cli/src/devices.c:994 #, c-format msgid "Error: iface has to be specified." msgstr "Fel: gränssnitt (iface) måste anges." -#: ../cli/src/devices.c:736 -#: ../cli/src/devices.c:746 -msgid "WiFi scan list" -msgstr "WiFi-avsökningslista" - -#: ../cli/src/devices.c:740 +#: ../cli/src/devices.c:1112 #, c-format -msgid "Error: Device '%s' is not a WiFi device." -msgstr "Fel: Enheten \"%s\" är inte en WiFi-enhet." - -#: ../cli/src/devices.c:754 -msgid "Device:" -msgstr "Enhet:" +#| msgid "Error: 'dev wifi' command '%s' is not valid." +msgid "Error: 'dev wifi': %s" +msgstr "Fel: \"dev wifi\": %s" -#: ../cli/src/devices.c:806 +#: ../cli/src/devices.c:1114 #, c-format -msgid "Error: hwaddr has to be specified." -msgstr "Fel: hwaddr måste anges." +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Fel: \"dev wifi\": %s; tillåtna fält: %s" + +#: ../cli/src/devices.c:1121 +msgid "WiFi scan list" +msgstr "WiFi-avsökningslista" -#: ../cli/src/devices.c:844 +#: ../cli/src/devices.c:1156 +#: ../cli/src/devices.c:1210 #, c-format msgid "Error: Access point with hwaddr '%s' not found." msgstr "Fel: Accesspunkt med hwaddr \"%s\" hittades inte." -#: ../cli/src/devices.c:862 -#, c-format -msgid "%u MHz" -msgstr "%u MHz" - -#: ../cli/src/devices.c:863 +#: ../cli/src/devices.c:1173 #, c-format -#| msgid "%d Mb/s" -msgid "%u MB/s" -msgstr "%u MB/s" - -#: ../cli/src/devices.c:869 -#: ../cli/src/devices.c:871 -msgid "AP parameters" -msgstr "AP-parametrar" - -#: ../cli/src/devices.c:873 -msgid "SSID:" -msgstr "SSID:" - -#: ../cli/src/devices.c:874 -msgid "BSSID:" -msgstr "BSSID:" - -#: ../cli/src/devices.c:875 -msgid "Frequency:" -msgstr "Frekvens:" - -#: ../cli/src/devices.c:876 -msgid "Mode:" -msgstr "Läge:" - -#: ../cli/src/devices.c:876 -msgid "Ad-hoc" -msgstr "Ad-hoc" - -#: ../cli/src/devices.c:876 -msgid "Infrastructure" -msgstr "Infrastruktur" - -#: ../cli/src/devices.c:877 -msgid "Maximal bitrate:" -msgstr "Maximal bitfrekvens:" - -#: ../cli/src/devices.c:878 -msgid "Strength:" -msgstr "Styrka:" - -#: ../cli/src/devices.c:879 -msgid "Flags:" -msgstr "Flaggor:" - -#: ../cli/src/devices.c:879 -msgid "privacy" -msgstr "integritet" - -#: ../cli/src/devices.c:880 -msgid "WPA flags:" -msgstr "WPA-flaggor:" - -#: ../cli/src/devices.c:881 -msgid "RSN flags:" -msgstr "RSN-flaggor:" +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Fel: Enheten \"%s\" är inte en WiFi-enhet." -#: ../cli/src/devices.c:907 +#: ../cli/src/devices.c:1237 #, c-format msgid "Error: 'dev wifi' command '%s' is not valid." msgstr "Fel: \"dev wifi\"-kommandot \"%s\" är inte giltigt." -#: ../cli/src/devices.c:943 +#: ../cli/src/devices.c:1284 #, c-format msgid "Error: 'dev' command '%s' is not valid." msgstr "Fel: \"dev\"-kommandot \"%s\" är inte giltigt." -#: ../cli/src/network-manager.c:46 +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "KÖR" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-MASKINVARA" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-MASKINVARA" + +#. 4 +#: ../cli/src/network-manager.c:40 +#| msgid "NM WWAN:" +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 #, c-format msgid "" "Usage: nmcli nm { COMMAND | help }\n" @@ -809,99 +1018,114 @@ msgstr "" " wwan [on|off]\n" "\n" -#: ../cli/src/network-manager.c:67 +#: ../cli/src/network-manager.c:83 msgid "asleep" msgstr "sover" -#: ../cli/src/network-manager.c:69 -#| msgid "VPN connecting to '%s'" +#: ../cli/src/network-manager.c:85 msgid "connecting" msgstr "ansluter" -#: ../cli/src/network-manager.c:93 -#: ../cli/src/network-manager.c:94 -#: ../cli/src/network-manager.c:95 -#: ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Fel: \"nm status\": %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Fel: \"nm status\": %s; tillåtna fält: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "Status för Nätverkshanterare" + +#. Print header +#: ../cli/src/network-manager.c:140 +#: ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 #: ../cli/src/network-manager.c:143 -#: ../cli/src/network-manager.c:160 +#: ../cli/src/network-manager.c:211 +#: ../cli/src/network-manager.c:243 msgid "enabled" msgstr "aktiverad" -#: ../cli/src/network-manager.c:93 -#: ../cli/src/network-manager.c:94 -#: ../cli/src/network-manager.c:95 -#: ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:140 +#: ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 #: ../cli/src/network-manager.c:143 -#: ../cli/src/network-manager.c:160 +#: ../cli/src/network-manager.c:211 +#: ../cli/src/network-manager.c:243 msgid "disabled" msgstr "inaktiverad" -#: ../cli/src/network-manager.c:102 -#| msgid "NetworkManager Applet" -msgid "NetworkManager status" -msgstr "Status för Nätverkshanterare" - -#: ../cli/src/network-manager.c:104 -msgid "NM running:" -msgstr "NM kör:" - -#: ../cli/src/network-manager.c:104 +#: ../cli/src/network-manager.c:148 msgid "running" msgstr "kör" -#: ../cli/src/network-manager.c:104 +#: ../cli/src/network-manager.c:148 msgid "not running" msgstr "kör inte" -#: ../cli/src/network-manager.c:105 -msgid "NM state:" -msgstr "NM tillstånd:" - -#: ../cli/src/network-manager.c:106 -msgid "NM wireless hardware:" -msgstr "NM trådlös hårdvara:" - -#. no argument, show current state -#: ../cli/src/network-manager.c:107 -#: ../cli/src/network-manager.c:143 -msgid "NM wireless:" -msgstr "NM trådlös:" - -#: ../cli/src/network-manager.c:108 -msgid "NM WWAN hardware:" -msgstr "NM WWAN hårdvara:" +#: ../cli/src/network-manager.c:201 +#: ../cli/src/network-manager.c:233 +#, c-format +#| msgid "Error: timeout value '%s' is not valid." +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Fel: värdet \"%s\" för \"--fields\" är inte giltigt här; tillåtna fält: %s" -#. no argument, show current state -#: ../cli/src/network-manager.c:109 -#: ../cli/src/network-manager.c:160 -msgid "NM WWAN:" -msgstr "NM WWAN:" +#: ../cli/src/network-manager.c:209 +#| msgid "enabled" +msgid "WiFi enabled" +msgstr "WiFi aktiverat" -#: ../cli/src/network-manager.c:150 +#: ../cli/src/network-manager.c:220 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." msgstr "Fel: ogiltig \"wifi\"-parameter: \"%s\"." -#: ../cli/src/network-manager.c:167 +#: ../cli/src/network-manager.c:241 +#| msgid "enabled" +msgid "WWAN enabled" +msgstr "WWAN aktiverat" + +#: ../cli/src/network-manager.c:252 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." msgstr "Fel: ogiltig \"wwan\"-parameter: \"%s\"." -#: ../cli/src/network-manager.c:178 +#: ../cli/src/network-manager.c:263 #, c-format msgid "Error: 'nm' command '%s' is not valid." msgstr "Fel: \"nm\"-kommandot \"%s\" är inte giltigt." -#: ../cli/src/nmcli.c:65 -#, c-format +#: ../cli/src/nmcli.c:69 +#, c-format +#| msgid "" +#| "Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +#| "\n" +#| "OPTIONS\n" +#| " -t[erse] terse output\n" +#| " -p[retty] pretty output\n" +#| " -v[ersion] show program version\n" +#| " -h[elp] print this help\n" +#| "\n" +#| "OBJECT\n" +#| " nm NetworkManager status\n" +#| " con NetworkManager connections\n" +#| " dev devices managed by NetworkManager\n" +#| "\n" msgid "" "Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" "\n" "OPTIONS\n" -" -t[erse] terse output\n" -" -p[retty] pretty output\n" -" -v[ersion] show program version\n" -" -h[elp] print this help\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" "\n" "OBJECT\n" " nm NetworkManager status\n" @@ -912,10 +1136,13 @@ msgstr "" "Användning: %s [FLAGGOR] OBJEKT { KOMMANDO | help }\n" "\n" "FLAGGOR\n" -" -t[erse] kort utdata\n" -" -p[retty] vackert utdata\n" -" -v[ersion] visa programversion\n" -" -h[elp] skriv ut denna hjälp\n" +" -t[erse] kort utdata\n" +" -p[retty] vackert utdata\n" +" -m[ode] tabular|multiline utdataläge\n" +" -f[ields] |all|common ange fält för utdata\n" +" -e[scape] yes|no escape för kolumnavgränsare i värden\n" +" -v[ersion] visa programversion\n" +" -h[elp] skriv ut denna hjälp\n" "\n" "OBJEKT\n" " nm status för Nätverkshanterare\n" @@ -923,35 +1150,179 @@ msgstr "" " dev enheter hanterade av Nätverkshanterare\n" "\n" -#: ../cli/src/nmcli.c:106 +#: ../cli/src/nmcli.c:113 +#, c-format +#| msgid "Object '%s' is unknown, try 'nmcli help'." +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Fel: Objektet \"%s\" är okänt, prova \"nmcli help\"." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Fel: Flaggan \"--terse\" har angivits en andra gång." + +#: ../cli/src/nmcli.c:148 #, c-format -msgid "Object '%s' is unknown, try 'nmcli help'." -msgstr "Objektet \"%s\" är okänt, prova \"nmcli help\"." +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Fel: Flaggan \"--terse\" är ömsesidigt uteslutande med \"--pretty\"." -#: ../cli/src/nmcli.c:139 +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Fel: Flaggan \"--pretty\" har angivits en andra gång." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Fel: Flaggan \"--pretty\" är ömsesidigt uteslutande med \"--terse\"." + +#: ../cli/src/nmcli.c:171 +#: ../cli/src/nmcli.c:187 +#, c-format +#| msgid "Error: %s argument is missing." +msgid "Error: missing argument for '%s' option." +msgstr "Fel: argument för flaggan \"%s\" saknas." + +#: ../cli/src/nmcli.c:180 +#: ../cli/src/nmcli.c:196 +#, c-format +#| msgid "Error: '%s' argument is missing." +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Fel: \"%s\" är inte ett giltigt argument för flaggan \"%s\"." + +#: ../cli/src/nmcli.c:203 +#, c-format +#| msgid "Error: '%s' argument is missing." +msgid "Error: fields for '%s' options are missing." +msgstr "Fel: fält för \"%s\"-flaggor saknas." + +#: ../cli/src/nmcli.c:209 #, c-format msgid "nmcli tool, version %s\n" msgstr "nmcli-verktyg, version %s\n" -#: ../cli/src/nmcli.c:145 +#: ../cli/src/nmcli.c:215 #, c-format -msgid "Option '%s' is unknown, try 'nmcli -help'." -msgstr "Flagan \"%s\" är okänd, prova \"nmcli -help\"." +#| msgid "Option '%s' is unknown, try 'nmcli -help'." +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Fel: Flaggan \"%s\" är okänd, prova \"nmcli -help\"." -#: ../cli/src/nmcli.c:164 +#: ../cli/src/nmcli.c:234 #, c-format msgid "Caught signal %d, shutting down..." msgstr "Fångade signal %d, stänger av..." -#: ../cli/src/nmcli.c:189 +#: ../cli/src/nmcli.c:259 #, c-format msgid "Error: Could not connect to NetworkManager." msgstr "Fel: Kunde inte ansluta till Nätverkshanterare." -#: ../cli/src/nmcli.c:205 +#: ../cli/src/nmcli.c:275 msgid "Success" msgstr "Lyckades" +#: ../cli/src/settings.c:411 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-nyckel)" + +#: ../cli/src/settings.c:413 +#, c-format +#| msgid "WEP 128-bit Passphrase" +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-bitars lösenfras)" + +#: ../cli/src/settings.c:416 +#, c-format +#| msgid "(unknown)" +msgid "%d (unknown)" +msgstr "%d (okänt)" + +#: ../cli/src/settings.c:442 +#| msgid "(unknown)" +msgid "0 (unknown)" +msgstr "0 (okänt)" + +#: ../cli/src/settings.c:448 +msgid "any, " +msgstr "valfri, " + +#: ../cli/src/settings.c:450 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:454 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:456 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:468 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:470 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:554 +#: ../cli/src/settings.c:721 +msgid "auto" +msgstr "auto" + +#: ../cli/src/settings.c:716 +#: ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 +#: ../cli/src/utils.c:172 +msgid "not set" +msgstr "inte inställd" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "fältet \"%s\" måste vara ensamt" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "ogiltigt fält \"%s\"" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Flaggan \"--terse\" kräver att \"--fields\" anges" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "Flaggan \"--terse\" kräver specifika värden för \"--fields\"-flagga , inte \"%s\"" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." @@ -1104,7 +1475,6 @@ msgstr "Misslyckades med att dekryptera den privata nyckeln: %s / %s." #: ../libnm-util/crypto_gnutls.c:210 #: ../libnm-util/crypto_nss.c:267 #, c-format -#| msgid "Failed to decrypt the private key: %d." msgid "Failed to decrypt the private key: unexpected padding length." msgstr "Misslyckades med att dekryptera privata nyckeln: oväntad utfyllningslängd." @@ -1122,25 +1492,21 @@ msgstr "Kunde inte allokera minne för kryptering." #: ../libnm-util/crypto_gnutls.c:294 #, c-format -#| msgid "Failed to initialize the decryption cipher context: %s / %s." msgid "Failed to initialize the encryption cipher context: %s / %s." msgstr "Misslyckades med att initiera chifferkontexten för kryptering: %s / %s." #: ../libnm-util/crypto_gnutls.c:303 #, c-format -#| msgid "Failed to set symmetric key for decryption: %s / %s." msgid "Failed to set symmetric key for encryption: %s / %s." msgstr "Misslyckades med att ställa in symmetrisk nyckel för kryptering: %s / %s." #: ../libnm-util/crypto_gnutls.c:313 #, c-format -#| msgid "Failed to set IV for decryption: %s / %s." msgid "Failed to set IV for encryption: %s / %s." msgstr "Misslyckades med att ställa in IV för kryptering: %s / %s." #: ../libnm-util/crypto_gnutls.c:322 #, c-format -#| msgid "Failed to decrypt the private key: %s / %s." msgid "Failed to encrypt the data: %s / %s." msgstr "Misslyckades med att kryptera datat: %s / %s." @@ -1211,7 +1577,6 @@ msgstr "Misslyckades med att dekryptera privata nyckeln: %d." #: ../libnm-util/crypto_nss.c:245 #, c-format -#| msgid "Failed to decrypt the private key: %d." msgid "Failed to decrypt the private key: decrypted data too large." msgstr "Misslyckades med att dekryptera privata nyckeln: dekrypterat data är för stort." @@ -1222,31 +1587,26 @@ msgstr "Misslyckades med att färdigställa dekryptering av den privata nyckeln: #: ../libnm-util/crypto_nss.c:364 #, c-format -#| msgid "Failed to initialize the decryption cipher slot." msgid "Failed to initialize the encryption cipher slot." msgstr "Misslyckades med att initiera krypteringschifferplatsen." #: ../libnm-util/crypto_nss.c:372 #, c-format -#| msgid "Failed to set symmetric key for decryption." msgid "Failed to set symmetric key for encryption." msgstr "Misslyckades med att ställa in symmetrisk nyckel för kryptering." #: ../libnm-util/crypto_nss.c:380 #, c-format -#| msgid "Failed to set IV for decryption." msgid "Failed to set IV for encryption." msgstr "Misslyckades med att ställa in IV för kryptering." #: ../libnm-util/crypto_nss.c:388 #, c-format -#| msgid "Failed to initialize the decryption context." msgid "Failed to initialize the encryption context." msgstr "Misslyckades med att initiera krypteringskontexten." #: ../libnm-util/crypto_nss.c:396 #, c-format -#| msgid "Failed to decrypt the private key: %d." msgid "Failed to encrypt: %d." msgstr "Misslyckades med att kryptera: %d." @@ -1281,86 +1641,179 @@ msgid "Couldn't verify PKCS#12 file: %d" msgstr "Kunde inte verifiera PKCS#12-fil: %d" #: ../libnm-util/crypto_nss.c:557 -#| msgid "Could not decode private key." msgid "Could not generate random data." msgstr "Kunde inte generera slumpmässigt data." -#: ../libnm-util/nm-utils.c:1545 +#: ../libnm-util/nm-utils.c:1975 #, c-format -#| msgid "Not enough memory to create private key decryption key." msgid "Not enough memory to make encryption key." msgstr "Inte tillräckligt mycket minne för att skapa krypteringsnyckel." -#: ../libnm-util/nm-utils.c:1655 -#| msgid "Not enough memory to store PEM file data." +#: ../libnm-util/nm-utils.c:2085 msgid "Could not allocate memory for PEM file creation." msgstr "Kunde inte allokera minne för att skapa PEM-fil." -#: ../libnm-util/nm-utils.c:1667 +#: ../libnm-util/nm-utils.c:2097 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "Kunde inte allokera minne för skrivning av IV till PEM-fil." -#: ../libnm-util/nm-utils.c:1679 +#: ../libnm-util/nm-utils.c:2109 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "Kunde inte allokera minne för skrivning av krypterad nyckel till PEM-fil." -#: ../libnm-util/nm-utils.c:1698 +#: ../libnm-util/nm-utils.c:2128 #, c-format -#| msgid "Not enough memory to store PEM file data." msgid "Could not allocate memory for PEM file data." msgstr "Kunde inte allokera minne för PEM-fildata." -#: ../src/nm-netlink-monitor.c:194 -#: ../src/nm-netlink-monitor.c:464 -#: ../src/nm-netlink-monitor.c:582 -#: ../src/ip6-manager/nm-netlink-listener.c:352 +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Anslutningsdelning via ett skyddat trådlöst nätverk" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Anslutningsdelning via ett öppet trådlöst nätverk" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Ändra bestående värdnamn för systemet" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Ändra systemanslutningar" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Systemets policy förhindrar ändring av systeminställningar" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "Systemets policy förhindrar ändring av bestående värdnamn för systemet" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "Systemets policy förhindrar delning av anslutningar via ett skyddat trådlöst nätverk" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "Systemets policy förhindrar delning av anslutningar via ett öppet trådlöst nätverk" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +#| msgid "Wired network connection" +msgid "Allow control of network connections" +msgstr "Tillåt kontroll av nätverksanslutningar" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "Tillåt användning av användarspecifika anslutningar" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "Aktivera eller inaktivera WiFi-enheter" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "Aktivera eller inaktivera mobila bredbandsenheter" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +#| msgid "Enable _Networking" +msgid "Enable or disable system networking" +msgstr "Aktivera eller inaktivera systemnätverk" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 +msgid "Put NetworkManager to sleep or wake it up (should only be used by system power management)" +msgstr "Försätt Nätverkshanterare i vänteläge eller återställ efter det (bör endast användas av systemets strömhantering)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents control of network connections" +msgstr "Systemets policy förhindrar kontroll av nätverksanslutningar" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +#| msgid "System policy prevents sharing connections via an open WiFi network" +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "Systemets policy förhindrar aktivering eller inaktivering av WiFi-enheter" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "Systemets policy förhindrar aktivering eller inaktivering av mobila bredbandsenheter" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents enabling or disabling system networking" +msgstr "Systemets policy förhindrar aktivering eller inaktivering av systemnätverk" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "Systemets policy förhindrar att Nätverkshanterare försätts i vänteläge eller återställs efter det" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents use of user-specific connections" +msgstr "Systemets policy förhindrar användning av användarspecifika anslutningar" + +#: ../src/nm-netlink-monitor.c:100 +#: ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format msgid "error processing netlink message: %s" msgstr "fel vid behandling av netlink-meddelande: %s" -#: ../src/nm-netlink-monitor.c:260 -#, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "kan inte allokera netlink-handtag för övervakning av länkstatus: %s" +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "fel inträffade vid väntan på data i uttaget" -#: ../src/nm-netlink-monitor.c:270 +#: ../src/nm-netlink-monitor.c:254 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "kan inte ansluta till netlink för övervakning av länkstatus: %s" -#: ../src/nm-netlink-monitor.c:278 +#: ../src/nm-netlink-monitor.c:265 +#, c-format +#| msgid "unable to allocate netlink handle: %s" +msgid "unable to enable netlink handle credential passing: %s" +msgstr "kunde inte aktivera behörighetshantering för netlink-handtag: %s" + +#: ../src/nm-netlink-monitor.c:291 +#: ../src/nm-netlink-monitor.c:353 #, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "kan inte gå med i netlink-grupp för övervakning av länkstatus: %s" +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "kan inte allokera netlink-handtag för övervakning av länkstatus: %s" -#: ../src/nm-netlink-monitor.c:286 +#: ../src/nm-netlink-monitor.c:376 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "kan inte allokera netlink-länkcache för övervakning av länkstatus: %s" -#: ../src/nm-netlink-monitor.c:494 -#: ../src/ip6-manager/nm-netlink-listener.c:382 -msgid "error occurred while waiting for data on socket" -msgstr "fel inträffade vid väntan på data i uttaget" +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "kan inte gå med i netlink-grupp: %s" -#: ../src/nm-netlink-monitor.c:558 -#: ../src/nm-netlink-monitor.c:571 +#: ../src/nm-netlink-monitor.c:629 +#: ../src/nm-netlink-monitor.c:642 #, c-format msgid "error updating link cache: %s" msgstr "fel vid uppdatering av länkcache: %s" -#: ../src/NetworkManager.c:494 +#: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "Ogiltig flagga. Använd --help för att se en lista över giltiga flaggor.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:300 +#: ../src/main.c:573 +#, c-format +#| msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. Använd --help för att se en lista över giltiga flaggor.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:324 msgid "# Created by NetworkManager\n" msgstr "# Skapad av Nätverkshanterare\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:316 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:340 #, c-format msgid "" "# Merged from %s\n" @@ -1369,29 +1822,38 @@ msgstr "" "# Sammanfogad från %s\n" "\n" -#: ../src/ip6-manager/nm-netlink-listener.c:200 +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 +msgid "no usable DHCP client could be found." +msgstr "ingen användbar DHCP-klient hittades." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 +msgid "'dhclient' could be found." +msgstr "\"dhclient\" kunde inte hittas." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 +msgid "'dhcpcd' could be found." +msgstr "\"dhcpcd\" kunde inte hittas." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 #, c-format -#| msgid "unable to allocate netlink handle for monitoring link status: %s" -msgid "unable to allocate netlink handle: %s" -msgstr "kan inte allokera netlink-handtag: %s" +msgid "unsupported DHCP client '%s'" +msgstr "DHCP-klienten \"%s\" stöds inte" -#: ../src/ip6-manager/nm-netlink-listener.c:210 +#: ../src/logging/nm-logging.c:146 #, c-format -#| msgid "unable to connect to netlink for monitoring link status: %s" -msgid "unable to connect to netlink: %s" -msgstr "kan inte ansluta till netlink: %s" +msgid "Unknown log level '%s'" +msgstr "Okänd loggnivå \"%s\"" -#: ../src/ip6-manager/nm-netlink-listener.c:307 +#: ../src/logging/nm-logging.c:171 #, c-format -#| msgid "unable to join netlink group for monitoring link status: %s" -msgid "unable to join netlink group: %s" -msgstr "kan inte gå med i netlink-grupp: %s" +msgid "Unknown log domain '%s'" +msgstr "Okänd loggdomän \"%s\"" -#: ../src/named-manager/nm-named-manager.c:315 +#: ../src/named-manager/nm-named-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "OBSERVERA: uppslag via glibc kanske inte har stöd för fler än 3 namnservrar." -#: ../src/named-manager/nm-named-manager.c:317 +#: ../src/named-manager/nm-named-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "Namnservrarna listade nedan kanske inte kommer att kännas igen." @@ -1400,203 +1862,12 @@ msgstr "Namnservrarna listade nedan kanske inte kommer att kännas igen." msgid "Auto %s" msgstr "Automatisk %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3213 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3412 msgid "System" msgstr "System" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 -msgid "Connection sharing via a protected WiFi network" -msgstr "Anslutningsdelning via ett skyddat trådlöst nätverk" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 -msgid "Connection sharing via an open WiFi network" -msgstr "Anslutningsdelning via ett öppet trådlöst nätverk" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 -msgid "Modify persistent system hostname" -msgstr "Ändra bestående värdnamn för systemet" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 -msgid "Modify system connections" -msgstr "Ändra systemanslutningar" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 -msgid "System policy prevents modification of system settings" -msgstr "Systemets policy förhindrar ändring av systeminställningar" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 -msgid "System policy prevents modification of the persistent system hostname" -msgstr "Systemets policy förhindrar ändring av bestående värdnamn för systemet" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 -msgid "System policy prevents sharing connections via a protected WiFi network" -msgstr "Systemets policy förhindrar delning av anslutningar via ett skyddat trådlöst nätverk" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 -msgid "System policy prevents sharing connections via an open WiFi network" -msgstr "Systemets policy förhindrar delning av anslutningar via ett öppet trådlöst nätverk" - -#~ msgid "operation took too long" -#~ msgstr "åtgärden tog för lång tid" -#~ msgid "received data from wrong type of sender" -#~ msgstr "tog emot data från fel typ av avsändare" -#~ msgid "received data from unexpected sender" -#~ msgstr "tog emot data från oväntad avsändare" -#~ msgid "too much data was sent over socket and some of it was lost" -#~ msgstr "för mycket data skickades över uttaget och en del gick förlorat" -#~ msgid "Passphrase for wireless network %s" -#~ msgstr "Lösenfras för det trådlösa nätverket %s" -#~ msgid "Connection to the wireless network '%s' failed." -#~ msgstr "Anslutning till det trådlösa nätverket \"%s\" misslyckades." -#~ msgid "Error displaying connection information:" -#~ msgstr "Fel vid visning av anslutningsinformation:" -#~ msgid "Could not find some required resources (the glade file)!" -#~ msgstr "Kunde inte hitta en del nödvändiga resurser (glade-filen)!" -#~ msgid "Wired Ethernet (%s)" -#~ msgstr "Trådbundet Ethernet (%s)" -#~ msgid "Wireless Ethernet (%s)" -#~ msgstr "Trådlöst Ethernet (%s)" -#~ msgid "" -#~ "Copyright © 2004-2006 Red Hat, Inc.\n" -#~ "Copyright © 2005-2006 Novell, Inc." -#~ msgstr "" -#~ "Copyright © 2004-2006 Red Hat, Inc.\n" -#~ "Copyright © 2005-2006 Novell, Inc." -#~ msgid "" -#~ "Notification area applet for managing your network devices and " -#~ "connections." -#~ msgstr "" -#~ "Panelprogram i notifieringsytan för hantering av dina nätverksenheter och " -#~ "nätverksanslutningar." -#~ msgid "translator-credits" -#~ msgstr "" -#~ "Daniel Nylander\n" -#~ "Christian Rose\n" -#~ "\n" -#~ "Skicka synpunkter på översättningen till\n" -#~ "tp-sv@listor.tp-sv.se" -#~ msgid "" -#~ "Copyright © 2004-2005 Red Hat, Inc.\n" -#~ "Copyright © 2005-2006 Novell, Inc." -#~ msgstr "" -#~ "Copyright © 2004-2005 Red Hat, Inc.\n" -#~ "Copyright © 2005-2006 Novell, Inc." -#~ msgid "VPN Login Failure" -#~ msgstr "VPN-inloggningsfel" -#~ msgid "Could not start the VPN connection '%s' due to a login failure." -#~ msgstr "" -#~ "Kunde inte starta VPN-anslutningen \"%s\" på grund av ett inloggningfel." -#~ msgid "VPN Start Failure" -#~ msgstr "VPN-startfel" -#~ msgid "" -#~ "Could not start the VPN connection '%s' due to a failure launching the " -#~ "VPN program." -#~ msgstr "" -#~ "Kunde inte starta VPN-anslutningen \"%s\" på grund av ett fel vid start " -#~ "av VPN-programmet." -#~ msgid "Could not start the VPN connection '%s' due to a connection error." -#~ msgstr "" -#~ "Kunde inte starta VPN-anslutningen \"%s\" på grund av ett anslutningsfel." -#~ msgid "VPN Configuration Error" -#~ msgstr "VPN-konfigurationsfel" -#~ msgid "The VPN connection '%s' was not correctly configured." -#~ msgstr "VPN-anslutningen \"%s\" konfigurerades inte korrekt." -#~ msgid "" -#~ "Could not start the VPN connection '%s' because the VPN server did not " -#~ "return an adequate network configuration." -#~ msgstr "" -#~ "Kunde inte starta VPN-anslutningen \"%s\" eftersom VPN-servern inte " -#~ "returnerade en lämplig nätverkskonfiguration." -#~ msgid "VPN Login Message" -#~ msgstr "VPN-inloggningsmeddelande" -#~ msgid "" -#~ "The NetworkManager Applet could not find some required resources (the " -#~ "glade file was not found)." -#~ msgstr "" -#~ "Panelprogrammet för nätverkshantering kunde inte hitta en del nödvändiga " -#~ "resurser (glade-filen hittades inte)." -#~ msgid "The network device \"%s (%s)\" does not support wireless scanning." -#~ msgstr "Nätverksenheten \"%s (%s)\" stöder inte trådlös genomsökning." -#~ msgid "The network device \"%s (%s)\" does not support link detection." -#~ msgstr "Nätverksenheten \"%s (%s)\" stöder inte länkdetektering." -#~ msgid "Preparing device %s for the wired network..." -#~ msgstr "Förbereder enheten %s för det trådbundna nätverket..." -#~ msgid "Preparing device %s for the wireless network '%s'..." -#~ msgstr "Förbereder enheten %s för det trådlösa nätverket \"%s\"..." -#~ msgid "Configuring device %s for the wired network..." -#~ msgstr "Konfigurerar enheten %s för det trådbundna nätverket..." -#~ msgid "Attempting to join the wireless network '%s'..." -#~ msgstr "Försöker ansluta till det trådlösa nätverket \"%s\"..." -#~ msgid "Waiting for Network Key for the wireless network '%s'..." -#~ msgstr "Väntar på nätverksnyckel för det trådlösa nätverket \"%s\"..." -#~ msgid "Requesting a network address from the wired network..." -#~ msgstr "Begär en nätverksadress från det trådbundna nätverket..." -#~ msgid "Requesting a network address from the wireless network '%s'..." -#~ msgstr "Begär en nätverksadress från det trådlösa nätverket \"%s\"..." -#~ msgid "Finishing connection to the wired network..." -#~ msgstr "Slutför anslutning till det trådbundna nätverket..." -#~ msgid "Finishing connection to the wireless network '%s'..." -#~ msgstr "Slutför anslutning till det trådlösa nätverket \"%s\"..." -#~ msgid "NetworkManager is not running" -#~ msgstr "Nätverkshanteraren är inte igång" -#~ msgid "Networking disabled" -#~ msgstr "Nätverk inaktiverat" -#~ msgid "Wired network connection" -#~ msgstr "Trådbunden nätverksanslutning" -#~ msgid "Connected to an Ad-Hoc wireless network" -#~ msgstr "Ansluten till ett trådlöst ad hoc-nätverk" -#~ msgid "Wireless network connection to '%s' (%d%%)" -#~ msgstr "Trådlös nätverksanslutning till \"%s\" (%d%%)" -#~ msgid "_Connect to Other Wireless Network..." -#~ msgstr "_Anslut till annat trådlöst nätverk..." -#~ msgid "Create _New Wireless Network..." -#~ msgstr "Skapa _nytt trådlöst nätverk..." -#~ msgid "_Configure VPN..." -#~ msgstr "_Konfigurera VPN..." -#~ msgid "_Dial Up Connections" -#~ msgstr "_Uppringda anslutningar" -#~ msgid "Connect to %s..." -#~ msgstr "Anslut till %s..." -#~ msgid "Disconnect from %s..." -#~ msgstr "Koppla från %s..." -#~ msgid "No network devices have been found" -#~ msgstr "Inga nätverksenheter har hittats" -#~ msgid "NetworkManager is not running..." -#~ msgstr "Nätverkshanteraren är inte igång..." -#~ msgid "Enable _Networking" -#~ msgstr "Aktivera _nätverk" -#~ msgid "Enable _Wireless" -#~ msgstr "Aktivera _trådlöst" -#~ msgid "_Help" -#~ msgstr "_Hjälp" -#~ msgid "_About" -#~ msgstr "_Om" -#~ msgid "" -#~ "The NetworkManager applet could not find some required resources. It " -#~ "cannot continue.\n" -#~ msgstr "" -#~ "Panelprogrammet för nätverkshantering kunde inte hitta en del nödvändiga " -#~ "resurser. Det kan inte fortsätta.\n" -#~ msgid "Shared Key" -#~ msgstr "Delad nyckel" -#~ msgid "Automatic (Default)" -#~ msgstr "Automatiskt (standard)" -#~ msgid "AES-CCMP" -#~ msgstr "AES-CCMP" -#~ msgid "TKIP" -#~ msgstr "TKIP" -#~ msgid "Dynamic WEP" -#~ msgstr "Dynamisk WEP" -#~ msgid "WEP 64/128-bit ASCII" -#~ msgstr "WEP 64/128-bitars ASCII" -#~ msgid "WEP 64/128-bit Hex" -#~ msgstr "WEP 64/128-bitars hexadecimal" -#~ msgid "WEP 128-bit Passphrase" -#~ msgstr "WEP 128-bitars lösenfras" -#~ msgid "PEAP" -#~ msgstr "PEAP" -#~ msgid "TLS" -#~ msgstr "TLS" -#~ msgid "TTLS" -#~ msgstr "TTLS" +#~ msgid "Type" +#~ msgstr "Typ" +#~ msgid "Name" +#~ msgstr "Namn" -- cgit v1.2.1 From d39fda772235d967266a25159b877596d636c048 Mon Sep 17 00:00:00 2001 From: Mathieu Trudel-Lapierre Date: Thu, 12 Aug 2010 17:52:20 -0500 Subject: dhcp: don't fail with dhclient v3 --- configure.ac | 18 ++++++++++++++---- src/dhcp-manager/Makefile.am | 1 + src/dhcp-manager/nm-dhcp-dhclient.c | 21 +++++++++++++++++++-- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index cfc2122b08..efdef27c9a 100644 --- a/configure.ac +++ b/configure.ac @@ -319,21 +319,30 @@ AC_SUBST(PPPD_PLUGIN_DIR) AC_ARG_WITH([dhclient], AS_HELP_STRING([--with-dhclient=yes|no|path], [Enable dhclient 4.x support])) # If a full path is given, use that and do not test if it works or not. case "${with_dhclient}" in + # NM only works with ISC dhclient - other derivatives don't have + # the same userland. dhclient 4.x is required for IPv6 support; + # with older versions NM won't be able to use DHCPv6. + /*) DHCLIENT_PATH="${with_dhclient}" + DHCLIENT_VERSION=4 + if test -x "${with_dhclient}"; then + case `"${with_dhclient}" --version 2>&1` in + "isc-dhclient-4"*) DHCLIENT_VERSION=4; break;; + "isc-dhclient-V3"*) DHCLIENT_VERSION=3; break;; + esac + fi AC_MSG_NOTICE(using dhclient at ${DHCLIENT_PATH}) ;; no) AC_MSG_NOTICE(dhclient support disabled) ;; *) AC_MSG_CHECKING(for dhclient) - # NM only works with ISC dhclient - other derivatives don't have - # the same userland. NM also requires dhclient 4.x since older - # versions do not have IPv6 support. for path in /sbin /usr/sbin /usr/pkg/sbin /usr/local/sbin; do test -x "${path}/dhclient" || continue case `"$path/dhclient" --version 2>&1` in - "isc-dhclient-4"*) DHCLIENT_PATH="$path/dhclient"; break;; + "isc-dhclient-4"*) DHCLIENT_PATH="$path/dhclient"; DHCLIENT_VERSION=4; break;; + "isc-dhclient-V3"*) DHCLIENT_PATH="$path/dhclient"; DHCLIENT_VERSION=3; break;; esac done if test -n "${DHCLIENT_PATH}"; then @@ -554,6 +563,7 @@ echo if test -n "${DHCLIENT_PATH}"; then echo ISC dhclient support: ${DHCLIENT_PATH} + echo ISC dhclient version: ${DHCLIENT_VERSION} else echo ISC dhclient support: no fi diff --git a/src/dhcp-manager/Makefile.am b/src/dhcp-manager/Makefile.am index f75e6b3d07..4c5408701e 100644 --- a/src/dhcp-manager/Makefile.am +++ b/src/dhcp-manager/Makefile.am @@ -29,6 +29,7 @@ libdhcp_manager_la_CPPFLAGS = \ -DLIBEXECDIR=\"$(libexecdir)\" \ -DLOCALSTATEDIR=\"$(localstatedir)\" \ -DDHCLIENT_PATH=\"$(DHCLIENT_PATH)\" \ + -DDHCLIENT_V$(DHCLIENT_VERSION) \ -DDHCPCD_PATH=\"$(DHCPCD_PATH)\" libdhcp_manager_la_LIBADD = \ diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c index cae7df22c3..13caa028f9 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.c +++ b/src/dhcp-manager/nm-dhcp-dhclient.c @@ -45,7 +45,11 @@ G_DEFINE_TYPE (NMDHCPDhclient, nm_dhcp_dhclient, NM_TYPE_DHCP_CLIENT) #define NM_DHCP_DHCLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP_DHCLIENT, NMDHCPDhclientPrivate)) #if defined(TARGET_DEBIAN) || defined(TARGET_SUSE) || defined(TARGET_MANDRIVA) +#if defined(DHCLIENT_V3) +#define NM_DHCLIENT_LEASE_DIR LOCALSTATEDIR "/lib/dhcp3" +#else #define NM_DHCLIENT_LEASE_DIR LOCALSTATEDIR "/lib/dhcp" +#endif #else #define NM_DHCLIENT_LEASE_DIR LOCALSTATEDIR "/lib/dhclient" #endif @@ -437,7 +441,11 @@ create_dhclient_config (const char *iface, #if defined(TARGET_SUSE) orig = g_strdup (SYSCONFDIR "/dhclient.conf"); #elif defined(TARGET_DEBIAN) || defined(TARGET_GENTOO) +#if defined(DHCLIENT_V3) + orig = g_strdup (SYSCONFDIR "/dhcp3/dhclient.conf"); +#else orig = g_strdup (SYSCONFDIR "/dhcp/dhclient.conf"); +#endif #else orig = g_strdup_printf (SYSCONFDIR "/dhclient-%s.conf", iface); #endif @@ -499,12 +507,20 @@ dhclient_start (NMDHCPClient *client, guint log_domain; g_return_val_if_fail (priv->pid_file == NULL, -1); - g_return_val_if_fail (ip_opt != NULL, -1); iface = nm_dhcp_client_get_iface (client); uuid = nm_dhcp_client_get_uuid (client); ipv6 = nm_dhcp_client_get_ipv6 (client); +#if defined(DHCLIENT_V3) + if (ipv6) { + nm_log_warn (log_domain, "(%s): ISC dhcp3 does not support IPv6", iface); + return -1; + } +#else + g_return_val_if_fail (ip_opt != NULL, -1); +#endif + log_domain = ipv6 ? LOGD_DHCP6 : LOGD_DHCP4; priv->pid_file = g_strdup_printf (LOCALSTATEDIR "/run/dhclient%s-%s.pid", @@ -536,10 +552,11 @@ dhclient_start (NMDHCPClient *client, g_ptr_array_add (argv, (gpointer) "-d"); +#if !defined(DHCLIENT_V3) g_ptr_array_add (argv, (gpointer) ip_opt); - if (mode_opt) g_ptr_array_add (argv, (gpointer) mode_opt); +#endif g_ptr_array_add (argv, (gpointer) "-sf"); /* Set script file */ g_ptr_array_add (argv, (gpointer) ACTION_SCRIPT_PATH ); -- cgit v1.2.1 From e3865481320622e0cfdf8cb18ece92a88adcbc81 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 12 Aug 2010 18:15:21 -0500 Subject: ifupdown: split parsers into convenience library for easier testcase creation --- system-settings/plugins/ifupdown/Makefile.am | 24 ++++++++++++++++++---- .../plugins/ifupdown/interface_parser.c | 10 ++++----- .../plugins/ifupdown/interface_parser.h | 4 +--- system-settings/plugins/ifupdown/plugin.c | 4 +++- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/system-settings/plugins/ifupdown/Makefile.am b/system-settings/plugins/ifupdown/Makefile.am index ec50311554..f99724d629 100644 --- a/system-settings/plugins/ifupdown/Makefile.am +++ b/system-settings/plugins/ifupdown/Makefile.am @@ -5,15 +5,30 @@ INCLUDES = \ -I$(top_srcdir)/libnm-glib \ -I$(top_srcdir)/libnm-util -pkglib_LTLIBRARIES = libnm-settings-plugin-ifupdown.la +noinst_LTLIBRARIES = libifupdown-io.la -libnm_settings_plugin_ifupdown_la_SOURCES = \ +libifupdown_io_la_SOURCES = \ interface_parser.c \ interface_parser.h \ + parser.c \ + parser.h + +libifupdown_io_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DSYSCONFDIR=\"$(sysconfdir)\" + +libifupdown_io_la_LIBADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(GLIB_LIBS) \ + $(GMODULE_LIBS) + +pkglib_LTLIBRARIES = libnm-settings-plugin-ifupdown.la + +libnm_settings_plugin_ifupdown_la_SOURCES = \ nm-ifupdown-connection.c \ nm-ifupdown-connection.h \ - parser.c \ - parser.h \ plugin.c \ plugin.h @@ -28,6 +43,7 @@ libnm_settings_plugin_ifupdown_la_CPPFLAGS = \ libnm_settings_plugin_ifupdown_la_LDFLAGS = -module -avoid-version libnm_settings_plugin_ifupdown_la_LIBADD = \ $(top_builddir)/libnm-util/libnm-util.la \ + libifupdown-io.la \ $(GLIB_LIBS) \ $(GMODULE_LIBS) \ $(GUDEV_LIBS) diff --git a/system-settings/plugins/ifupdown/interface_parser.c b/system-settings/plugins/ifupdown/interface_parser.c index f28cf7cab1..374fafb58e 100644 --- a/system-settings/plugins/ifupdown/interface_parser.c +++ b/system-settings/plugins/ifupdown/interface_parser.c @@ -75,19 +75,19 @@ void add_data(const char *key,const char *data) #define SPACE_OR_TAB(string,ret) {ret = strchr(string,' ');ret=(ret == NULL?strchr(string,'\t'):ret);} -void ifparser_init(void) +void ifparser_init (const char *eni_file) { - FILE *inp = fopen(ENI_INTERFACES_FILE, "r"); + FILE *inp = fopen (eni_file, "r"); int ret = 0; char *line; char *space; char rline[255]; - if (inp == NULL) - { - nm_warning ("Error: Can't open %s\n", ENI_INTERFACES_FILE); + if (inp == NULL) { + nm_warning ("Error: Can't open %s\n", eni_file); return; } + first = last = NULL; while(1) { diff --git a/system-settings/plugins/ifupdown/interface_parser.h b/system-settings/plugins/ifupdown/interface_parser.h index 52b98d04c4..262b2172ab 100644 --- a/system-settings/plugins/ifupdown/interface_parser.h +++ b/system-settings/plugins/ifupdown/interface_parser.h @@ -26,8 +26,6 @@ #include "config.h" -#define ENI_INTERFACES_FILE "/etc/network/interfaces" - typedef struct _if_data { char *key; @@ -43,7 +41,7 @@ typedef struct _if_block struct _if_block *next; } if_block; -void ifparser_init(void); +void ifparser_init(const char *eni_file); void ifparser_destroy(void); if_block *ifparser_getif(const char* iface); diff --git a/system-settings/plugins/ifupdown/plugin.c b/system-settings/plugins/ifupdown/plugin.c index e2358b9f51..879cf9b0cb 100644 --- a/system-settings/plugins/ifupdown/plugin.c +++ b/system-settings/plugins/ifupdown/plugin.c @@ -55,6 +55,8 @@ #define G_UDEV_API_IS_SUBJECT_TO_CHANGE #include +#define ENI_INTERFACES_FILE "/etc/network/interfaces" + #define IFUPDOWN_PLUGIN_NAME "ifupdown" #define IFUPDOWN_PLUGIN_INFO "(C) 2008 Canonical Ltd. To report bugs please use the NetworkManager mailing list." #define IFUPDOWN_SYSTEM_HOSTNAME_FILE "/etc/hostname" @@ -355,7 +357,7 @@ SCPluginIfupdown_init (NMSystemConfigInterface *config) update_system_hostname (inotify_helper, NULL, NULL, config); /* Read in all the interfaces */ - ifparser_init (); + ifparser_init (ENI_INTERFACES_FILE); block = ifparser_getfirst (); while (block) { if(!strcmp ("auto", block->type) || !strcmp ("allow-hotplug", block->type)) -- cgit v1.2.1 From 4397f4463a9316bb6a6dc9c7a8dda9b4ddf64225 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 12 Aug 2010 22:35:13 -0500 Subject: ifupdown: add ifparser testcases ENI snippets from Peter Marschall --- configure.ac | 1 + system-settings/plugins/ifupdown/Makefile.am | 1 + .../plugins/ifupdown/interface_parser.c | 24 + .../plugins/ifupdown/interface_parser.h | 2 + system-settings/plugins/ifupdown/tests/Makefile.am | 32 ++ .../plugins/ifupdown/tests/test-ifupdown.c | 496 +++++++++++++++++++++ system-settings/plugins/ifupdown/tests/test1 | 6 + system-settings/plugins/ifupdown/tests/test11 | 5 + system-settings/plugins/ifupdown/tests/test12 | 5 + system-settings/plugins/ifupdown/tests/test13 | 3 + system-settings/plugins/ifupdown/tests/test14 | 5 + system-settings/plugins/ifupdown/tests/test15 | 3 + system-settings/plugins/ifupdown/tests/test16 | 2 + system-settings/plugins/ifupdown/tests/test2 | 4 + system-settings/plugins/ifupdown/tests/test3 | 5 + system-settings/plugins/ifupdown/tests/test4 | 3 + system-settings/plugins/ifupdown/tests/test5 | 3 + system-settings/plugins/ifupdown/tests/test6 | 3 + system-settings/plugins/ifupdown/tests/test7 | 3 + system-settings/plugins/ifupdown/tests/test8 | 5 + system-settings/plugins/ifupdown/tests/test9 | 10 + 21 files changed, 621 insertions(+) create mode 100644 system-settings/plugins/ifupdown/tests/Makefile.am create mode 100644 system-settings/plugins/ifupdown/tests/test-ifupdown.c create mode 100644 system-settings/plugins/ifupdown/tests/test1 create mode 100644 system-settings/plugins/ifupdown/tests/test11 create mode 100644 system-settings/plugins/ifupdown/tests/test12 create mode 100644 system-settings/plugins/ifupdown/tests/test13 create mode 100644 system-settings/plugins/ifupdown/tests/test14 create mode 100644 system-settings/plugins/ifupdown/tests/test15 create mode 100644 system-settings/plugins/ifupdown/tests/test16 create mode 100644 system-settings/plugins/ifupdown/tests/test2 create mode 100644 system-settings/plugins/ifupdown/tests/test3 create mode 100644 system-settings/plugins/ifupdown/tests/test4 create mode 100644 system-settings/plugins/ifupdown/tests/test5 create mode 100644 system-settings/plugins/ifupdown/tests/test6 create mode 100644 system-settings/plugins/ifupdown/tests/test7 create mode 100644 system-settings/plugins/ifupdown/tests/test8 create mode 100644 system-settings/plugins/ifupdown/tests/test9 diff --git a/configure.ac b/configure.ac index efdef27c9a..aecfa88883 100644 --- a/configure.ac +++ b/configure.ac @@ -507,6 +507,7 @@ tools/Makefile system-settings/Makefile system-settings/plugins/Makefile system-settings/plugins/ifupdown/Makefile +system-settings/plugins/ifupdown/tests/Makefile system-settings/plugins/ifcfg-rh/Makefile system-settings/plugins/ifcfg-rh/tests/Makefile system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile diff --git a/system-settings/plugins/ifupdown/Makefile.am b/system-settings/plugins/ifupdown/Makefile.am index f99724d629..652e545fce 100644 --- a/system-settings/plugins/ifupdown/Makefile.am +++ b/system-settings/plugins/ifupdown/Makefile.am @@ -1,3 +1,4 @@ +SUBDIRS=. tests INCLUDES = \ -I$(top_srcdir)/src/system-settings \ diff --git a/system-settings/plugins/ifupdown/interface_parser.c b/system-settings/plugins/ifupdown/interface_parser.c index 374fafb58e..ec9c4144a8 100644 --- a/system-settings/plugins/ifupdown/interface_parser.c +++ b/system-settings/plugins/ifupdown/interface_parser.c @@ -190,6 +190,18 @@ if_block *ifparser_getfirst(void) return first; } +int ifparser_get_num_blocks(void) +{ + int i = 0; + if_block *iter = first; + + while (iter) { + i++; + iter = iter->next; + } + return i; +} + if_block *ifparser_getif(const char* iface) { if_block *curr = first; @@ -213,3 +225,15 @@ const char *ifparser_getkey(if_block* iface, const char *key) } return NULL; } + +int ifparser_get_num_info(if_block* iface) +{ + int i = 0; + if_data *iter = iface->info; + + while (iter) { + i++; + iter = iter->next; + } + return i; +} diff --git a/system-settings/plugins/ifupdown/interface_parser.h b/system-settings/plugins/ifupdown/interface_parser.h index 262b2172ab..78799d88ce 100644 --- a/system-settings/plugins/ifupdown/interface_parser.h +++ b/system-settings/plugins/ifupdown/interface_parser.h @@ -47,6 +47,8 @@ void ifparser_destroy(void); if_block *ifparser_getif(const char* iface); if_block *ifparser_getfirst(void); const char *ifparser_getkey(if_block* iface, const char *key); +int ifparser_get_num_blocks(void); +int ifparser_get_num_info(if_block* iface); void add_block(const char *type, const char* name); void add_data(const char *key,const char *data); diff --git a/system-settings/plugins/ifupdown/tests/Makefile.am b/system-settings/plugins/ifupdown/tests/Makefile.am new file mode 100644 index 0000000000..b5dbd13d63 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/Makefile.am @@ -0,0 +1,32 @@ +INCLUDES = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util \ + -I$(top_srcdir)/libnm-glib \ + -I$(top_srcdir)/system-settings/plugins/ifupdown + +noinst_PROGRAMS = test-ifupdown + +test_ifupdown_SOURCES = \ + test-ifupdown.c + +test_ifupdown_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) \ + -DTEST_ENI_DIR=\"$(abs_srcdir)\" + +test_ifupdown_LDADD = \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/system-settings/plugins/ifupdown/libifupdown-io.la \ + $(DBUS_LIBS) + +if WITH_TESTS + +check-local: test-ifupdown + $(abs_builddir)/test-ifupdown + +endif + +EXTRA_DIST = \ + test1 test2 test3 test4 test5 test6 test7 test8 test9 test11 test12 \ + test13 test14 test15 test16 diff --git a/system-settings/plugins/ifupdown/tests/test-ifupdown.c b/system-settings/plugins/ifupdown/tests/test-ifupdown.c new file mode 100644 index 0000000000..ad04a949fb --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test-ifupdown.c @@ -0,0 +1,496 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2010 Red Hat, Inc. + * + */ + +#include +#include + +#include "interface_parser.h" +#include "parser.h" + +typedef struct { + char *key; + char *data; +} ExpectedKey; + +typedef struct { + char *type; + char *name; + GSList *keys; +} ExpectedBlock; + +typedef struct { + GSList *blocks; +} Expected; + +static ExpectedKey * +expected_key_new (const char *key, const char *data) +{ + ExpectedKey *k; + + k = g_malloc0 (sizeof (ExpectedKey)); + g_assert (k); + k->key = g_strdup (key); + g_assert (k->key); + k->data = g_strdup (data); + g_assert (k->data); + return k; +} + +static void +expected_key_free (ExpectedKey *k) +{ + g_assert (k); + g_free (k->key); + g_free (k->data); + memset (k, 0, sizeof (ExpectedKey)); + g_free (k); +} + +static ExpectedBlock * +expected_block_new (const char *type, const char *name) +{ + ExpectedBlock *b; + + g_assert (type); + g_assert (name); + b = g_malloc0 (sizeof (ExpectedBlock)); + g_assert (b); + b->type = g_strdup (type); + b->name = g_strdup (name); + return b; +} + +static void +expected_block_free (ExpectedBlock *b) +{ + g_assert (b); + g_slist_foreach (b->keys, (GFunc) expected_key_free, NULL); + g_slist_free (b->keys); + g_free (b->type); + g_free (b->name); + memset (b, 0, sizeof (ExpectedBlock)); + g_free (b); +} + +static void +expected_block_add_key (ExpectedBlock *b, ExpectedKey *k) +{ + g_assert (b); + g_assert (k); + b->keys = g_slist_append (b->keys, k); +} + +static Expected * +expected_new (void) +{ + Expected *e; + + e = g_malloc0 (sizeof (Expected)); + g_assert (e); + return e; +} + +static void +expected_add_block (Expected *e, ExpectedBlock *b) +{ + g_assert (e); + g_assert (b); + e->blocks = g_slist_append (e->blocks, b); +} + +static void +expected_free (Expected *e) +{ + g_assert (e); + g_slist_foreach (e->blocks, (GFunc) expected_block_free, NULL); + g_slist_free (e->blocks); + memset (e, 0, sizeof (Expected)); + g_free (e); +} + +static void +compare_expected_to_ifparser (Expected *e) +{ + if_block *n; + GSList *biter, *kiter; + + g_assert_cmpint (g_slist_length (e->blocks), ==, ifparser_get_num_blocks ()); + + for (n = ifparser_getfirst (), biter = e->blocks; + n && biter; + n = n->next, biter = g_slist_next (biter)) { + if_data *m; + ExpectedBlock *b = biter->data; + + g_assert (b->type && n->type); + g_assert_cmpstr (b->type, ==, n->type); + g_assert (b->name && n->name); + g_assert_cmpstr (b->name, ==, n->name); + + g_assert_cmpint (g_slist_length (b->keys), ==, ifparser_get_num_info (n)); + + for (m = n->info, kiter = b->keys; + m && kiter; + m = m->next, kiter = g_slist_next (kiter)) { + ExpectedKey *k = kiter->data; + + g_assert (k->key && m->key); + g_assert_cmpstr (k->key, ==, m->key); + g_assert (k->data && m->data); + g_assert_cmpstr (k->data, ==, m->data); + } + } +} + +static void +dump_blocks (void) +{ + if_block *n; + + g_message ("\n***************************************************"); + for (n = ifparser_getfirst (); n != NULL; n = n->next) { + if_data *m; + + // each block start with its type & name + // (single quotes used to show typ & name baoundaries) + g_print("'%s' '%s'\n", n->type, n->name); + + // each key-value pair within a block is indented & separated by a tab + // (single quotes used to show typ & name baoundaries) + for (m = n->info; m != NULL; m = m->next) + g_print("\t'%s'\t'%s'\n", m->key, m->data); + + // blocks are separated by an empty line + g_print("\n"); + } + g_message ("##################################################\n"); +} + +static void +init_ifparser_with_file (const char *path, const char *file) +{ + char *tmp; + + tmp = g_strdup_printf ("%s/%s", path, file); + ifparser_init (tmp); + g_free (tmp); +} + +static void +test1_ignore_line_before_first_block (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("auto", "eth0"); + expected_add_block (e, b); + b = expected_block_new ("iface", "eth0"); + expected_add_block (e, b); + expected_block_add_key (b, expected_key_new ("inet", "dhcp")); + + init_ifparser_with_file (path, "test1"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test2_wrapped_line (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("auto", "lo"); + expected_add_block (e, b); + + init_ifparser_with_file (path, "test2"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test3_wrapped_multiline_multiarg (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("allow-hotplug", "eth0"); + expected_add_block (e, b); + b = expected_block_new ("allow-hotplug", "wlan0"); + expected_add_block (e, b); + b = expected_block_new ("allow-hotplug", "bnep0"); + expected_add_block (e, b); + + init_ifparser_with_file (path, "test3"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test4_allow_auto_is_auto (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("auto", "eth0"); + expected_add_block (e, b); + + init_ifparser_with_file (path, "test4"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test5_allow_auto_multiarg (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("allow-hotplug", "eth0"); + expected_add_block (e, b); + b = expected_block_new ("allow-hotplug", "wlan0"); + expected_add_block (e, b); + + init_ifparser_with_file (path, "test5"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test6_mixed_whitespace (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("iface", "lo"); + expected_block_add_key (b, expected_key_new ("inet", "loopback")); + expected_add_block (e, b); + + init_ifparser_with_file (path, "test6"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test7_long_line (const char *path) +{ + init_ifparser_with_file (path, "test7"); + g_assert_cmpint (ifparser_get_num_blocks (), ==, 0); + ifparser_destroy (); +} + +static void +test8_long_line_wrapped (const char *path) +{ + init_ifparser_with_file (path, "test8"); + g_assert_cmpint (ifparser_get_num_blocks (), ==, 0); + ifparser_destroy (); +} + +static void +test9_wrapped_lines_in_block (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("iface", "eth0"); + expected_add_block (e, b); + expected_block_add_key (b, expected_key_new ("inet", "static")); + expected_block_add_key (b, expected_key_new ("address", "10.250.2.3")); + expected_block_add_key (b, expected_key_new ("netmask", "255.255.255.192")); + expected_block_add_key (b, expected_key_new ("broadcast", "10.250.2.63")); + expected_block_add_key (b, expected_key_new ("gateway", "10.250.2.50")); + + init_ifparser_with_file (path, "test9"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test11_complex_wrap (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("iface", "pppoe"); + expected_add_block (e, b); + expected_block_add_key (b, expected_key_new ("inet", "manual")); + expected_block_add_key (b, expected_key_new ("pre-up", "/sbin/ifconfig eth0 up")); + + init_ifparser_with_file (path, "test11"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test12_complex_wrap_split_word (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("iface", "pppoe"); + expected_add_block (e, b); + expected_block_add_key (b, expected_key_new ("inet", "manual")); + expected_block_add_key (b, expected_key_new ("up", "ifup ppp0=dsl")); + + init_ifparser_with_file (path, "test12"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test13_more_mixed_whitespace (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("iface", "dsl"); + expected_block_add_key (b, expected_key_new ("inet", "ppp")); + expected_add_block (e, b); + + init_ifparser_with_file (path, "test13"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test14_mixed_whitespace_block_start (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("iface", "wlan0"); + expected_block_add_key (b, expected_key_new ("inet", "manual")); + expected_add_block (e, b); + b = expected_block_new ("iface", "wlan-adpm"); + expected_block_add_key (b, expected_key_new ("inet", "dhcp")); + expected_add_block (e, b); + b = expected_block_new ("iface", "wlan-default"); + expected_block_add_key (b, expected_key_new ("inet", "dhcp")); + expected_add_block (e, b); + + init_ifparser_with_file (path, "test14"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test15_trailing_space (const char *path) +{ + Expected *e; + ExpectedBlock *b; + + e = expected_new (); + b = expected_block_new ("iface", "bnep0"); + expected_block_add_key (b, expected_key_new ("inet", "static")); + expected_add_block (e, b); + + init_ifparser_with_file (path, "test15"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +static void +test16_missing_newline (const char *path) +{ + Expected *e; + + e = expected_new (); + expected_add_block (e, expected_block_new ("mapping", "eth0")); + + init_ifparser_with_file (path, "test16"); + compare_expected_to_ifparser (e); + + ifparser_destroy (); + expected_free (e); +} + +#if GLIB_CHECK_VERSION(2,25,12) +typedef GTestFixtureFunc TCFunc; +#else +typedef void (*TCFunc)(void); +#endif + +#define TESTCASE(t, d) g_test_create_case (#t, 0, d, NULL, (TCFunc) t, NULL) + +int main (int argc, char **argv) +{ + GTestSuite *suite; + + g_test_init (&argc, &argv, NULL); + + suite = g_test_get_root (); + + if (0) + dump_blocks (); + + g_test_suite_add (suite, TESTCASE (test1_ignore_line_before_first_block, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test2_wrapped_line, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test3_wrapped_multiline_multiarg, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test4_allow_auto_is_auto, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test5_allow_auto_multiarg, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test6_mixed_whitespace, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test7_long_line, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test8_long_line_wrapped, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test9_wrapped_lines_in_block, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test11_complex_wrap, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test12_complex_wrap_split_word, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test13_more_mixed_whitespace, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test14_mixed_whitespace_block_start, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test15_trailing_space, TEST_ENI_DIR)); + g_test_suite_add (suite, TESTCASE (test16_missing_newline, TEST_ENI_DIR)); + + return g_test_run (); +} + diff --git a/system-settings/plugins/ifupdown/tests/test1 b/system-settings/plugins/ifupdown/tests/test1 new file mode 100644 index 0000000000..74c23b457d --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test1 @@ -0,0 +1,6 @@ +# case 1: line before 1st block (must be ignored) +address 10.250.2.3 + +auto eth0 +iface eth0 inet dhcp + diff --git a/system-settings/plugins/ifupdown/tests/test11 b/system-settings/plugins/ifupdown/tests/test11 new file mode 100644 index 0000000000..89561dd7df --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test11 @@ -0,0 +1,5 @@ +iface pppoe inet manual +# case 11: wrapped line (without leading space on the wrapped part, wrap within a multi-word value) + pre-up /sbin/ifconfig \ +eth0 up + diff --git a/system-settings/plugins/ifupdown/tests/test12 b/system-settings/plugins/ifupdown/tests/test12 new file mode 100644 index 0000000000..6096842e1e --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test12 @@ -0,0 +1,5 @@ +iface pppoe inet manual +# case 12: wrapped line, splitting a word (must be joined again) + up ifup ppp0\ +=dsl + diff --git a/system-settings/plugins/ifupdown/tests/test13 b/system-settings/plugins/ifupdown/tests/test13 new file mode 100644 index 0000000000..c001f7ef1b --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test13 @@ -0,0 +1,3 @@ +# case 13: variations of tabs & spaces +iface dsl inet ppp + diff --git a/system-settings/plugins/ifupdown/tests/test14 b/system-settings/plugins/ifupdown/tests/test14 new file mode 100644 index 0000000000..4a153ab3b5 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test14 @@ -0,0 +1,5 @@ +# case 14: variations of tabs and spaces (all must be recognized as lines starting an iface block) +iface wlan0 inet manual + iface wlan-adpm inet dhcp +iface wlan-default inet dhcp + diff --git a/system-settings/plugins/ifupdown/tests/test15 b/system-settings/plugins/ifupdown/tests/test15 new file mode 100644 index 0000000000..c3ceca2409 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test15 @@ -0,0 +1,3 @@ +# case 15: trailing space (must be ignored) +iface bnep0 inet static + diff --git a/system-settings/plugins/ifupdown/tests/test16 b/system-settings/plugins/ifupdown/tests/test16 new file mode 100644 index 0000000000..f4f74fb5a1 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test16 @@ -0,0 +1,2 @@ +# case 16: last line that is not followed by LF (added with 'echo -n "mapping eth0" >> /e/n/i') +mapping eth0 \ No newline at end of file diff --git a/system-settings/plugins/ifupdown/tests/test2 b/system-settings/plugins/ifupdown/tests/test2 new file mode 100644 index 0000000000..7462b35268 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test2 @@ -0,0 +1,4 @@ +# case 2: wrapped line +auto \ +lo + diff --git a/system-settings/plugins/ifupdown/tests/test3 b/system-settings/plugins/ifupdown/tests/test3 new file mode 100644 index 0000000000..f6293bbdc6 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test3 @@ -0,0 +1,5 @@ +# case 3: line wrapped over multiple lines & multi-argument allow-* +allow-hotplug eth0 \ + wlan0 \ + bnep0 + diff --git a/system-settings/plugins/ifupdown/tests/test4 b/system-settings/plugins/ifupdown/tests/test4 new file mode 100644 index 0000000000..46a40bc9c2 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test4 @@ -0,0 +1,3 @@ +# case 4: 'allow-auto' is synonymous to 'auto' +allow-auto eth0 + diff --git a/system-settings/plugins/ifupdown/tests/test5 b/system-settings/plugins/ifupdown/tests/test5 new file mode 100644 index 0000000000..b69fc42bd0 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test5 @@ -0,0 +1,3 @@ +# case 5: multi-argument allow-* (even worse: trailing space) +allow-hotplug eth0 wlan0 + diff --git a/system-settings/plugins/ifupdown/tests/test6 b/system-settings/plugins/ifupdown/tests/test6 new file mode 100644 index 0000000000..50ac69bd98 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test6 @@ -0,0 +1,3 @@ +# case 6: mix between tabs and spaces + iface lo inet loopback + diff --git a/system-settings/plugins/ifupdown/tests/test7 b/system-settings/plugins/ifupdown/tests/test7 new file mode 100644 index 0000000000..03cb131a98 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test7 @@ -0,0 +1,3 @@ +# case 7: over-long line (must be ignored completely) +123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 + diff --git a/system-settings/plugins/ifupdown/tests/test8 b/system-settings/plugins/ifupdown/tests/test8 new file mode 100644 index 0000000000..311f7e15a4 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test8 @@ -0,0 +1,5 @@ +# case 8: over-long line that wraps to consecutive lines (must be ignored completely) +123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 \ +allow-test eth0 \ +eth0 + diff --git a/system-settings/plugins/ifupdown/tests/test9 b/system-settings/plugins/ifupdown/tests/test9 new file mode 100644 index 0000000000..7d94563af9 --- /dev/null +++ b/system-settings/plugins/ifupdown/tests/test9 @@ -0,0 +1,10 @@ +iface eth0 inet static +# case 9: wrapped lines inside a block (to be on the safe side) + address \ + 10.250.2.3 + netmask \ + 255.255.255.192 + + broadcast 10.250.2.63 + gateway 10.250.2.50 + -- cgit v1.2.1 From a5b77939fbedc7f1c8b0734dc677c30f62a635f7 Mon Sep 17 00:00:00 2001 From: Peter Marschall Date: Thu, 12 Aug 2010 22:41:05 -0500 Subject: ifupdown: make parser for /etc/network/interfaces more robust The previous implementation of the parser for /etc/network/interfaces had quite a few drawbacks: - it expected the lines to be terminated with "\n", even the last line - it ignored line wraps with "\\" followed by "\n" - it expected over-long lines to be shorter than 510 characters - it ignored line wraps on over-long lines - it treated spaces and tabs differently - it did not make sure to really tokenize on word boundaries - it treated the equivalent stanzas "auto" and "allow-auto" differently - it ignored the fact that the "allow-*" stanzas can take multiple arguments that need to be separated to be recognized NetworkManager's processing later - it allowed "non-block" stanzas to appear before a block This patch is a rewrite of the parser to fix the issues mentioned: - it accepts the last line even if it is not terminated by "\n" - it skips over-long lines, emits a warning and even takes into account that over-long lines may be wrapped to next lines - it un-wraps wrapped lines - it uses spaces and tabs equivalently to tokenize the input - it treats "allow-auto" as a synonym to "auto" - it splits multi-argument "auto"/"allow-*" into multiple single-argument stanzas of the same type - it warns on data stanzas before the first block stanza --- .../plugins/ifupdown/interface_parser.c | 161 ++++++++++++++------- 1 file changed, 107 insertions(+), 54 deletions(-) diff --git a/system-settings/plugins/ifupdown/interface_parser.c b/system-settings/plugins/ifupdown/interface_parser.c index ec9c4144a8..bb00314be6 100644 --- a/system-settings/plugins/ifupdown/interface_parser.c +++ b/system-settings/plugins/ifupdown/interface_parser.c @@ -73,15 +73,30 @@ void add_data(const char *key,const char *data) //printf("added data '%s' with key '%s'\n",data,key); } -#define SPACE_OR_TAB(string,ret) {ret = strchr(string,' ');ret=(ret == NULL?strchr(string,'\t'):ret);} +// join values in src with spaces into dst; dst needs to be large enough +static char *join_values_with_spaces(char *dst, char **src) +{ + if (dst != NULL) { + *dst = '\0'; + if (src != NULL && *src != NULL) { + strcat(dst, *src); + + for (src++; *src != NULL; src++) { + strcat(dst, " "); + strcat(dst, *src); + } + } + } + return(dst); +} void ifparser_init (const char *eni_file) { FILE *inp = fopen (eni_file, "r"); - int ret = 0; - char *line; - char *space; - char rline[255]; + char line[255]; + int skip_to_block = 1; + int skip_long_line = 0; + int offs = 0; if (inp == NULL) { nm_warning ("Error: Can't open %s\n", eni_file); @@ -89,69 +104,107 @@ void ifparser_init (const char *eni_file) } first = last = NULL; - while(1) + while (!feof(inp)) { - line = space = NULL; - ret = fscanf(inp,"%255[^\n]\n",rline); - if (ret == EOF) + char *token[128]; // 255 chars can only be split into 127 tokens + char value[255]; // large enough to join previously split tokens + char *safeptr; + int toknum; + int len = 0; + + char *ptr = fgets(line+offs, 255-offs, inp); + if (ptr == NULL) break; - // If the line did not match, skip it - if (ret == 0) { - char *ignored; - ignored = fgets(rline, 255, inp); + len = strlen(line); + // skip over-long lines + if (!feof(inp) && len > 0 && line[len-1] != '\n') { + if (!skip_long_line) + g_message ("Error: Skipping over-long-line '%s...'\n", line); + skip_long_line = 1; continue; } - line = rline; - while(line[0] == ' ') - line++; - if (line[0]=='#' || line[0]=='\0') + // trailing '\n' found: remove it & reset offset to 0 + if (len > 0 && line[len-1] == '\n') { + line[--len] = '\0'; + offs = 0; + } + + // if we're in long_line_skip mode, terminate it for real next line + if (skip_long_line) { + if (len == 0 || line[len-1] != '\\') + skip_long_line = 0; continue; + } - SPACE_OR_TAB(line,space) - if (space == NULL) - { - nm_warning ("Error: Can't parse interface line '%s'\n",line); - continue; - } - space[0] = '\0'; + // unwrap wrapped lines + if (len > 0 && line[len-1] == '\\') { + offs = len - 1; + continue; + } + + //printf(">>%s<<\n", line); + +#define SPACES " \t" + // tokenize input; + for (toknum = 0, token[toknum] = strtok_r(line, SPACES, &safeptr); + token[toknum] != NULL; + toknum++, token[toknum] = strtok_r(NULL, SPACES, &safeptr)) + ; + + // ignore comments and empty lines + if (toknum == 0 || *token[0]=='#') + continue; + + if (toknum < 2) { + g_message ("Error: Can't parse interface line '%s'\n", + join_values_with_spaces(value, token)); + skip_to_block = 1; + continue; + } // There are four different stanzas: // iface, mapping, auto and allow-*. Create a block for each of them. - if (strcmp(line,"iface")==0) - { - char *space2 = strchr(space+1,' '); - if (space2 == NULL) - { - nm_warning ("Error: Can't parse iface line '%s'\n",space+1); + + // iface stanza takes at least 3 parameters + if (strcmp(token[0], "iface") == 0) { + if (toknum < 4) { + g_message ("Error: Can't parse iface line '%s'\n", + join_values_with_spaces(value, token)); continue; } - space2[0]='\0'; - add_block(line,space+1); - - if (space2[1]!='\0') - { - space = strchr(space2+1,' '); - if (space == NULL) - { - nm_warning ("Error: Can't parse data '%s'\n",space2+1); - continue; - } - space[0] = '\0'; - add_data(space2+1,space+1); - } + add_block(token[0], token[1]); + skip_to_block = 0; + add_data(token[2], join_values_with_spaces(value, token + 3)); + } + // auto and allow-auto stanzas are equivalent, + // both can take multiple interfaces as parameters: add one block for each + else if (strcmp(token[0], "auto") == 0 || + strcmp(token[0], "allow-auto") == 0) { + int i; + for (i = 1; i < toknum; i++) + add_block("auto", token[i]); + skip_to_block = 0; + } + else if (strcmp(token[0], "mapping") == 0) { + add_block(token[0], join_values_with_spaces(value, token + 1)); + skip_to_block = 0; + } + // allow-* can take multiple interfaces as parameters: add one block for each + else if (strncmp(token[0],"allow-",6) == 0) { + int i; + for (i = 1; i < toknum; i++) + add_block(token[0], token[i]); + skip_to_block = 0; + } + else { + if (skip_to_block) + g_message ("Error: ignoring out-of-block data '%s'\n", + join_values_with_spaces(value, token)); + else + add_data(token[0], join_values_with_spaces(value, token + 1)); } - else if (strcmp(line,"auto")==0) - add_block(line,space+1); - else if (strcmp(line,"mapping")==0) - add_block(line,space+1); - else if (strncmp(line,"allow-",6)==0) - add_block(line,space+1); - else - add_data(line,space+1); - - //printf("line: '%s' ret=%d\n",rline,ret); } fclose(inp); } -- cgit v1.2.1 From ba355b6a7e941fe754aa70d7b8c8d5f107eb7927 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 12 Aug 2010 22:44:07 -0500 Subject: ifupdown: make testcase parsing quiet Removes messages about invalid ENI formatting when running the testcases. --- .../plugins/ifupdown/interface_parser.c | 33 ++++++++++++++-------- .../plugins/ifupdown/interface_parser.h | 2 +- system-settings/plugins/ifupdown/plugin.c | 2 +- .../plugins/ifupdown/tests/test-ifupdown.c | 2 +- 4 files changed, 24 insertions(+), 15 deletions(-) diff --git a/system-settings/plugins/ifupdown/interface_parser.c b/system-settings/plugins/ifupdown/interface_parser.c index bb00314be6..4635db2ca1 100644 --- a/system-settings/plugins/ifupdown/interface_parser.c +++ b/system-settings/plugins/ifupdown/interface_parser.c @@ -90,7 +90,7 @@ static char *join_values_with_spaces(char *dst, char **src) return(dst); } -void ifparser_init (const char *eni_file) +void ifparser_init (const char *eni_file, int quiet) { FILE *inp = fopen (eni_file, "r"); char line[255]; @@ -99,7 +99,8 @@ void ifparser_init (const char *eni_file) int offs = 0; if (inp == NULL) { - nm_warning ("Error: Can't open %s\n", eni_file); + if (!quiet) + g_warning ("Error: Can't open %s\n", eni_file); return; } @@ -119,8 +120,10 @@ void ifparser_init (const char *eni_file) len = strlen(line); // skip over-long lines if (!feof(inp) && len > 0 && line[len-1] != '\n') { - if (!skip_long_line) - g_message ("Error: Skipping over-long-line '%s...'\n", line); + if (!skip_long_line) { + if (!quiet) + g_message ("Error: Skipping over-long-line '%s...'\n", line); + } skip_long_line = 1; continue; } @@ -158,8 +161,10 @@ void ifparser_init (const char *eni_file) continue; if (toknum < 2) { - g_message ("Error: Can't parse interface line '%s'\n", - join_values_with_spaces(value, token)); + if (!quiet) { + g_message ("Error: Can't parse interface line '%s'\n", + join_values_with_spaces(value, token)); + } skip_to_block = 1; continue; } @@ -170,8 +175,10 @@ void ifparser_init (const char *eni_file) // iface stanza takes at least 3 parameters if (strcmp(token[0], "iface") == 0) { if (toknum < 4) { - g_message ("Error: Can't parse iface line '%s'\n", - join_values_with_spaces(value, token)); + if (!quiet) { + g_message ("Error: Can't parse iface line '%s'\n", + join_values_with_spaces(value, token)); + } continue; } add_block(token[0], token[1]); @@ -199,10 +206,12 @@ void ifparser_init (const char *eni_file) skip_to_block = 0; } else { - if (skip_to_block) - g_message ("Error: ignoring out-of-block data '%s'\n", - join_values_with_spaces(value, token)); - else + if (skip_to_block) { + if (!quiet) { + g_message ("Error: ignoring out-of-block data '%s'\n", + join_values_with_spaces(value, token)); + } + } else add_data(token[0], join_values_with_spaces(value, token + 1)); } } diff --git a/system-settings/plugins/ifupdown/interface_parser.h b/system-settings/plugins/ifupdown/interface_parser.h index 78799d88ce..ea991c32d1 100644 --- a/system-settings/plugins/ifupdown/interface_parser.h +++ b/system-settings/plugins/ifupdown/interface_parser.h @@ -41,7 +41,7 @@ typedef struct _if_block struct _if_block *next; } if_block; -void ifparser_init(const char *eni_file); +void ifparser_init(const char *eni_file, int quiet); void ifparser_destroy(void); if_block *ifparser_getif(const char* iface); diff --git a/system-settings/plugins/ifupdown/plugin.c b/system-settings/plugins/ifupdown/plugin.c index 879cf9b0cb..5ccdcc8d4a 100644 --- a/system-settings/plugins/ifupdown/plugin.c +++ b/system-settings/plugins/ifupdown/plugin.c @@ -357,7 +357,7 @@ SCPluginIfupdown_init (NMSystemConfigInterface *config) update_system_hostname (inotify_helper, NULL, NULL, config); /* Read in all the interfaces */ - ifparser_init (ENI_INTERFACES_FILE); + ifparser_init (ENI_INTERFACES_FILE, 0); block = ifparser_getfirst (); while (block) { if(!strcmp ("auto", block->type) || !strcmp ("allow-hotplug", block->type)) diff --git a/system-settings/plugins/ifupdown/tests/test-ifupdown.c b/system-settings/plugins/ifupdown/tests/test-ifupdown.c index ad04a949fb..1646536452 100644 --- a/system-settings/plugins/ifupdown/tests/test-ifupdown.c +++ b/system-settings/plugins/ifupdown/tests/test-ifupdown.c @@ -189,7 +189,7 @@ init_ifparser_with_file (const char *path, const char *file) char *tmp; tmp = g_strdup_printf ("%s/%s", path, file); - ifparser_init (tmp); + ifparser_init (tmp, 1); g_free (tmp); } -- cgit v1.2.1 From d5468c85278a0f981a442f1a31791e413f839f76 Mon Sep 17 00:00:00 2001 From: "Zephaniah E. Loss-Cutler-Hull" Date: Thu, 12 Aug 2010 23:52:17 -0500 Subject: vpn: let plugins forbid VPN connections from getting the default route (bgo #621698) Minor fixes and cleanups by dcbw. --- include/NetworkManagerVPN.h | 3 +++ src/nm-policy.c | 11 +++++++++-- src/vpn-manager/nm-vpn-connection.c | 7 +++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/include/NetworkManagerVPN.h b/include/NetworkManagerVPN.h index d792847d6a..f4ef93d3d4 100644 --- a/include/NetworkManagerVPN.h +++ b/include/NetworkManagerVPN.h @@ -166,6 +166,9 @@ typedef enum { */ #define NM_VPN_PLUGIN_IP4_CONFIG_ROUTES "routes" +/* boolean: prevent this VPN connection from ever getting the default route */ +#define NM_VPN_PLUGIN_IP4_CONFIG_NEVER_DEFAULT "never-default" + /* Deprecated */ #define NM_VPN_PLUGIN_IP4_CONFIG_GATEWAY NM_VPN_PLUGIN_IP4_CONFIG_EXT_GATEWAY diff --git a/src/nm-policy.c b/src/nm-policy.c index ddf48ad877..a9b0eeaabb 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -138,7 +138,8 @@ get_best_ip4_device (NMManager *manager, NMActRequest **out_req) continue; /* 'never-default' devices can't ever be the default */ - if (s_ip4 && nm_setting_ip4_config_get_never_default (s_ip4)) + if ( (s_ip4 && nm_setting_ip4_config_get_never_default (s_ip4)) + || nm_ip4_config_get_never_default (ip4_config)) continue; prio = nm_device_get_priority (dev); @@ -482,6 +483,13 @@ update_ip4_routing_and_dns (NMPolicy *policy, gboolean force_update) /* If it's marked 'never-default', don't make it default */ vpn_connection = nm_vpn_connection_get_connection (candidate); g_assert (vpn_connection); + + /* Check the active IP4 config from the VPN service daemon */ + ip4_config = nm_vpn_connection_get_ip4_config (candidate); + if (ip4_config && nm_ip4_config_get_never_default (ip4_config)) + can_default = FALSE; + + /* Check the user's preference from the NMConnection */ s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (vpn_connection, NM_TYPE_SETTING_IP4_CONFIG); if (s_ip4 && nm_setting_ip4_config_get_never_default (s_ip4)) can_default = FALSE; @@ -493,7 +501,6 @@ update_ip4_routing_and_dns (NMPolicy *policy, gboolean force_update) ip_iface = nm_vpn_connection_get_ip_iface (candidate); connection = nm_vpn_connection_get_connection (candidate); - ip4_config = nm_vpn_connection_get_ip4_config (candidate); addr = nm_ip4_config_get_address (ip4_config, 0); parent = nm_vpn_connection_get_parent_device (candidate); diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c index 16fa64d007..227932adc5 100644 --- a/src/vpn-manager/nm-vpn-connection.c +++ b/src/vpn-manager/nm-vpn-connection.c @@ -382,6 +382,9 @@ print_vpn_config (NMIP4Config *config, ip_address_to_string (nm_ip4_route_get_next_hop (route))); } + nm_log_info (LOGD_VPN, "Forbid Default Route: %s", + nm_ip4_config_get_never_default (config) ? "yes" : "no"); + num = nm_ip4_config_get_num_nameservers (config); for (i = 0; i < num; i++) { nm_log_info (LOGD_VPN, "Internal IP4 DNS: %s", @@ -527,6 +530,10 @@ nm_vpn_connection_ip4_config_get (DBusGProxy *proxy, g_slist_free (routes); } + val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_NEVER_DEFAULT); + if (val && G_VALUE_HOLDS_BOOLEAN (val)) + nm_ip4_config_set_never_default (config, g_value_get_boolean (val)); + print_vpn_config (config, priv->ip4_internal_gw, priv->ip_iface, priv->banner); /* Merge in user overrides from the NMConnection's IPv4 setting */ -- cgit v1.2.1 From f0e8055cf95df36b41ee4f0412eef49ce634e93b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 13 Aug 2010 13:18:58 -0500 Subject: core: fix builds with polkit >= 0.97 polkit_authority_get() is deprecated, should use polkit_authority_get_sync() instead. --- configure.ac | 5 ++++- src/nm-manager.c | 9 ++++++++- src/system-settings/nm-polkit-helpers.h | 8 +++++++- src/system-settings/nm-sysconfig-connection.c | 2 +- src/system-settings/nm-sysconfig-settings.c | 2 +- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index aecfa88883..511359cdfa 100644 --- a/configure.ac +++ b/configure.ac @@ -255,9 +255,12 @@ AC_SUBST(UUID_CFLAGS) AC_SUBST(UUID_LIBS) PKG_CHECK_MODULES(POLKIT, polkit-gobject-1) - AC_SUBST(POLKIT_CFLAGS) +# Check for polkit_authority_get_sync() +AC_CHECK_LIB([polkit-1], [polkit_authority_get_sync], ac_have_pk_auth_get_sync="1", ac_have_pk_auth_get_sync="0") +AC_DEFINE_UNQUOTED(HAVE_POLKIT_AUTHORITY_GET_SYNC, $ac_have_pk_auth_get_sync, [Define if you have a polkit with polkit_authority_get_sync()]) + AC_ARG_WITH(crypto, AS_HELP_STRING([--with-crypto=nss | gnutls], [Cryptography library to use for certificate and key operations]),ac_crypto=$withval, ac_crypto=nss) with_nss=no diff --git a/src/nm-manager.c b/src/nm-manager.c index 524b0becfa..647991b21c 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -19,6 +19,8 @@ * Copyright (C) 2007 - 2010 Red Hat, Inc. */ +#include + #include #include #include @@ -56,6 +58,11 @@ #include "nm-settings-system-interface.h" #include "nm-manager-auth.h" +/* Fix for polkit 0.97 and later */ +#if !HAVE_POLKIT_AUTHORITY_GET_SYNC +#define polkit_authority_get_sync polkit_authority_get +#endif + #define NM_AUTOIP_DBUS_SERVICE "org.freedesktop.nm_avahi_autoipd" #define NM_AUTOIP_DBUS_IFACE "org.freedesktop.nm_avahi_autoipd" @@ -4278,7 +4285,7 @@ nm_manager_init (NMManager *manager) } else nm_log_warn (LOGD_AUTOIP4, "could not initialize avahi-autoipd D-Bus proxy"); - priv->authority = polkit_authority_get (); + priv->authority = polkit_authority_get_sync (); if (priv->authority) { priv->auth_changed_id = g_signal_connect (priv->authority, "changed", diff --git a/src/system-settings/nm-polkit-helpers.h b/src/system-settings/nm-polkit-helpers.h index c26fcc2c9b..c4f3de2f3b 100644 --- a/src/system-settings/nm-polkit-helpers.h +++ b/src/system-settings/nm-polkit-helpers.h @@ -16,14 +16,20 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * (C) Copyright 2008 Novell, Inc. - * (C) Copyright 2008 Red Hat, Inc. + * (C) Copyright 2008 - 2010 Red Hat, Inc. */ #ifndef NM_POLKIT_HELPERS_H #define NM_POLKIT_HELPERS_H +#include #include +/* Fix for polkit 0.97 and later */ +#if !HAVE_POLKIT_AUTHORITY_GET_SYNC +#define polkit_authority_get_sync polkit_authority_get +#endif + #define NM_SYSCONFIG_POLICY_ACTION_CONNECTION_MODIFY "org.freedesktop.network-manager-settings.system.modify" #define NM_SYSCONFIG_POLICY_ACTION_WIFI_SHARE_PROTECTED "org.freedesktop.network-manager-settings.system.wifi.share.protected" #define NM_SYSCONFIG_POLICY_ACTION_WIFI_SHARE_OPEN "org.freedesktop.network-manager-settings.system.wifi.share.open" diff --git a/src/system-settings/nm-sysconfig-connection.c b/src/system-settings/nm-sysconfig-connection.c index f46895accc..adb9897b94 100644 --- a/src/system-settings/nm-sysconfig-connection.c +++ b/src/system-settings/nm-sysconfig-connection.c @@ -613,7 +613,7 @@ nm_sysconfig_connection_init (NMSysconfigConnection *self) { NMSysconfigConnectionPrivate *priv = NM_SYSCONFIG_CONNECTION_GET_PRIVATE (self); - priv->authority = polkit_authority_get (); + priv->authority = polkit_authority_get_sync (); if (!priv->authority) { nm_log_err (LOGD_SYS_SET, "%s: error creating PolicyKit authority"); } diff --git a/src/system-settings/nm-sysconfig-settings.c b/src/system-settings/nm-sysconfig-settings.c index 4bcfb04bc7..3ab387d54b 100644 --- a/src/system-settings/nm-sysconfig-settings.c +++ b/src/system-settings/nm-sysconfig-settings.c @@ -1508,7 +1508,7 @@ nm_sysconfig_settings_init (NMSysconfigSettings *self) priv->connections = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, NULL); - priv->authority = polkit_authority_get (); + priv->authority = polkit_authority_get_sync (); if (priv->authority) { priv->auth_changed_id = g_signal_connect (priv->authority, "changed", -- cgit v1.2.1 From 31d5d82cb0fa0aaa170d17b709b2a14405e79cb2 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 13 Aug 2010 19:12:02 -0500 Subject: core: really fix the polkit >= 0.97 build issue The function we're looking for is in libpolkit-gobject-1, not libpolkit-1. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 511359cdfa..652cca6b68 100644 --- a/configure.ac +++ b/configure.ac @@ -258,7 +258,7 @@ PKG_CHECK_MODULES(POLKIT, polkit-gobject-1) AC_SUBST(POLKIT_CFLAGS) # Check for polkit_authority_get_sync() -AC_CHECK_LIB([polkit-1], [polkit_authority_get_sync], ac_have_pk_auth_get_sync="1", ac_have_pk_auth_get_sync="0") +AC_CHECK_LIB([polkit-gobject-1], [polkit_authority_get_sync], ac_have_pk_auth_get_sync="1", ac_have_pk_auth_get_sync="0") AC_DEFINE_UNQUOTED(HAVE_POLKIT_AUTHORITY_GET_SYNC, $ac_have_pk_auth_get_sync, [Define if you have a polkit with polkit_authority_get_sync()]) AC_ARG_WITH(crypto, AS_HELP_STRING([--with-crypto=nss | gnutls], [Cryptography library to use for certificate and key operations]),ac_crypto=$withval, ac_crypto=nss) -- cgit v1.2.1 From 6e7f9b4670c48a45af0ad9ae9309a019ac594a3c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 17 Aug 2010 09:35:41 -0500 Subject: core: really fix polkit >= 0.97 this time --- src/nm-manager.c | 30 ++++++++++++++++++++------- src/system-settings/nm-polkit-helpers.h | 19 ++++++++++++----- src/system-settings/nm-sysconfig-connection.c | 10 ++++++--- src/system-settings/nm-sysconfig-settings.c | 11 +++++++--- 4 files changed, 51 insertions(+), 19 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 647991b21c..9f8ce92afc 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -58,11 +58,6 @@ #include "nm-settings-system-interface.h" #include "nm-manager-auth.h" -/* Fix for polkit 0.97 and later */ -#if !HAVE_POLKIT_AUTHORITY_GET_SYNC -#define polkit_authority_get_sync polkit_authority_get -#endif - #define NM_AUTOIP_DBUS_SERVICE "org.freedesktop.nm_avahi_autoipd" #define NM_AUTOIP_DBUS_IFACE "org.freedesktop.nm_avahi_autoipd" @@ -150,6 +145,20 @@ static GSList * remove_one_device (NMManager *manager, static NMDevice *nm_manager_get_device_by_udi (NMManager *manager, const char *udi); +/* Fix for polkit 0.97 and later */ +#if !HAVE_POLKIT_AUTHORITY_GET_SYNC +static inline PolkitAuthority * +polkit_authority_get_sync (GCancellable *cancellable, GError **error) +{ + PolkitAuthority *authority; + + authority = polkit_authority_get (); + if (!authority) + g_set_error (error, 0, 0, "failed to get the PolicyKit authority"); + return authority; +} +#endif + #define SSD_POKE_INTERVAL 120 #define ORIGDEV_TAG "originating-device" @@ -4203,6 +4212,7 @@ nm_manager_init (NMManager *manager) DBusGConnection *g_connection; guint id, i; GFile *file; + GError *error = NULL; /* Initialize rfkill structures and states */ memset (priv->radio_states, 0, sizeof (priv->radio_states)); @@ -4285,14 +4295,18 @@ nm_manager_init (NMManager *manager) } else nm_log_warn (LOGD_AUTOIP4, "could not initialize avahi-autoipd D-Bus proxy"); - priv->authority = polkit_authority_get_sync (); + priv->authority = polkit_authority_get_sync (NULL, &error); if (priv->authority) { priv->auth_changed_id = g_signal_connect (priv->authority, "changed", G_CALLBACK (pk_authority_changed_cb), manager); - } else - nm_log_warn (LOGD_CORE, "failed to create PolicyKit authority."); + } else { + nm_log_warn (LOGD_CORE, "failed to create PolicyKit authority: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); + } /* Monitor the firmware directory */ if (strlen (KERNEL_FIRMWARE_DIR)) { diff --git a/src/system-settings/nm-polkit-helpers.h b/src/system-settings/nm-polkit-helpers.h index c4f3de2f3b..a37c2eebaa 100644 --- a/src/system-settings/nm-polkit-helpers.h +++ b/src/system-settings/nm-polkit-helpers.h @@ -25,14 +25,23 @@ #include #include -/* Fix for polkit 0.97 and later */ -#if !HAVE_POLKIT_AUTHORITY_GET_SYNC -#define polkit_authority_get_sync polkit_authority_get -#endif - #define NM_SYSCONFIG_POLICY_ACTION_CONNECTION_MODIFY "org.freedesktop.network-manager-settings.system.modify" #define NM_SYSCONFIG_POLICY_ACTION_WIFI_SHARE_PROTECTED "org.freedesktop.network-manager-settings.system.wifi.share.protected" #define NM_SYSCONFIG_POLICY_ACTION_WIFI_SHARE_OPEN "org.freedesktop.network-manager-settings.system.wifi.share.open" #define NM_SYSCONFIG_POLICY_ACTION_HOSTNAME_MODIFY "org.freedesktop.network-manager-settings.system.hostname.modify" +/* Fix for polkit 0.97 and later */ +#if !HAVE_POLKIT_AUTHORITY_GET_SYNC +static inline PolkitAuthority * +polkit_authority_get_sync (GCancellable *cancellable, GError **error) +{ + PolkitAuthority *authority; + + authority = polkit_authority_get (); + if (!authority) + g_set_error (error, 0, 0, "failed to get the PolicyKit authority"); + return authority; +} +#endif + #endif /* NM_POLKIT_HELPERS_H */ diff --git a/src/system-settings/nm-sysconfig-connection.c b/src/system-settings/nm-sysconfig-connection.c index adb9897b94..73906d20a7 100644 --- a/src/system-settings/nm-sysconfig-connection.c +++ b/src/system-settings/nm-sysconfig-connection.c @@ -16,7 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * (C) Copyright 2008 Novell, Inc. - * (C) Copyright 2008 - 2009 Red Hat, Inc. + * (C) Copyright 2008 - 2010 Red Hat, Inc. */ #include @@ -612,10 +612,14 @@ static void nm_sysconfig_connection_init (NMSysconfigConnection *self) { NMSysconfigConnectionPrivate *priv = NM_SYSCONFIG_CONNECTION_GET_PRIVATE (self); + GError *error = NULL; - priv->authority = polkit_authority_get_sync (); + priv->authority = polkit_authority_get_sync (NULL, NULL); if (!priv->authority) { - nm_log_err (LOGD_SYS_SET, "%s: error creating PolicyKit authority"); + nm_log_warn (LOGD_SYS_SET, "failed to create PolicyKit authority: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); } } diff --git a/src/system-settings/nm-sysconfig-settings.c b/src/system-settings/nm-sysconfig-settings.c index 3ab387d54b..a9bae14b1e 100644 --- a/src/system-settings/nm-sysconfig-settings.c +++ b/src/system-settings/nm-sysconfig-settings.c @@ -1505,16 +1505,21 @@ static void nm_sysconfig_settings_init (NMSysconfigSettings *self) { NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + GError *error = NULL; priv->connections = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, NULL); - priv->authority = polkit_authority_get_sync (); + priv->authority = polkit_authority_get_sync (NULL, &error); if (priv->authority) { priv->auth_changed_id = g_signal_connect (priv->authority, "changed", G_CALLBACK (pk_authority_changed_cb), self); - } else - nm_log_warn (LOGD_SYS_SET, "failed to create PolicyKit authority."); + } else { + nm_log_warn (LOGD_SYS_SET, "failed to create PolicyKit authority: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); + } } -- cgit v1.2.1 From a5c15a2ca3c328421072762fe93011838ff80c76 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 17 Aug 2010 14:04:47 -0500 Subject: vpn: don't try to do stuff with a VPN connection that may not exist If the activation of the VPN connection failed (like if its service was not installed), it'll be NULL here. Don't try to use it. --- src/nm-manager.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 9f8ce92afc..e581a63327 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -2810,7 +2810,7 @@ nm_manager_activate_connection (NMManager *manager, NMDevice *device = NULL; NMSettingConnection *s_con; NMVPNConnection *vpn_connection; - const char *path; + const char *path = NULL; g_return_val_if_fail (manager != NULL, NULL); g_return_val_if_fail (connection != NULL, NULL); @@ -2867,11 +2867,13 @@ nm_manager_activate_connection (NMManager *manager, req, device, error); - g_signal_connect (vpn_connection, "manager-get-secrets", - G_CALLBACK (provider_get_secrets), manager); - g_signal_connect (vpn_connection, "manager-cancel-secrets", - G_CALLBACK (provider_cancel_secrets), manager); - path = nm_vpn_connection_get_active_connection_path (vpn_connection); + if (vpn_connection) { + g_signal_connect (vpn_connection, "manager-get-secrets", + G_CALLBACK (provider_get_secrets), manager); + g_signal_connect (vpn_connection, "manager-cancel-secrets", + G_CALLBACK (provider_cancel_secrets), manager); + path = nm_vpn_connection_get_active_connection_path (vpn_connection); + } g_object_unref (vpn_manager); } else { NMDeviceState state; -- cgit v1.2.1 From c4db66c7edc6589d96885387a2952706a1096e80 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 17 Aug 2010 14:05:31 -0500 Subject: vpn: fix refcounting of the VPN manager --- src/nm-policy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nm-policy.c b/src/nm-policy.c index a9b0eeaabb..410a9bfc3d 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -1220,6 +1220,7 @@ nm_policy_destroy (NMPolicy *policy) g_signal_handler_disconnect (policy->vpn_manager, policy->vpn_activated_id); g_signal_handler_disconnect (policy->vpn_manager, policy->vpn_deactivated_id); + g_object_unref (policy->vpn_manager); for (iter = policy->signal_ids; iter; iter = g_slist_next (iter)) g_signal_handler_disconnect (policy->manager, (gulong) iter->data); -- cgit v1.2.1 From 46afadc02c127031badf0682e850dabb1e236882 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 17 Aug 2010 15:03:21 -0500 Subject: vpn: handle VPN service installation/removal dynamically (rh #489114) (lp:458595) Use inotify to watch /etc/NetworkManager/VPN for new .name files and handle their installation and removal on-the-fly instead of just at startup. --- src/vpn-manager/nm-vpn-manager.c | 335 +++++++++++++++++++++++++++------------ src/vpn-manager/nm-vpn-service.c | 307 +++++++++++++++++------------------ src/vpn-manager/nm-vpn-service.h | 14 +- 3 files changed, 396 insertions(+), 260 deletions(-) diff --git a/src/vpn-manager/nm-vpn-manager.c b/src/vpn-manager/nm-vpn-manager.c index 309331aede..4b58be0d48 100644 --- a/src/vpn-manager/nm-vpn-manager.c +++ b/src/vpn-manager/nm-vpn-manager.c @@ -15,11 +15,12 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2005 - 2008 Red Hat, Inc. + * Copyright (C) 2005 - 2010 Red Hat, Inc. * Copyright (C) 2006 - 2008 Novell, Inc. */ #include +#include #include "nm-vpn-manager.h" #include "nm-vpn-service.h" @@ -28,13 +29,18 @@ #include "nm-dbus-manager.h" #include "NetworkManagerVPN.h" #include "nm-marshal.h" +#include "nm-logging.h" G_DEFINE_TYPE (NMVPNManager, nm_vpn_manager, G_TYPE_OBJECT) #define NM_VPN_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_VPN_MANAGER, NMVPNManagerPrivate)) typedef struct { - GSList *services; + gboolean disposed; + + GHashTable *services; + GFileMonitor *monitor; + guint monitor_id; } NMVPNManagerPrivate; enum { @@ -81,53 +87,42 @@ nm_vpn_manager_error_get_type (void) } - static NMVPNService * -nm_vpn_manager_get_service (NMVPNManager *manager, const char *service_name) +get_service_by_namefile (NMVPNManager *self, const char *namefile) { - GSList *iter; + NMVPNManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE (self); + GHashTableIter iter; + gpointer data; - for (iter = NM_VPN_MANAGER_GET_PRIVATE (manager)->services; iter; iter = iter->next) { - NMVPNService *service = NM_VPN_SERVICE (iter->data); + g_return_val_if_fail (namefile, NULL); + g_return_val_if_fail (g_path_is_absolute (namefile), NULL); - if (!strcmp (service_name, nm_vpn_service_get_name (service))) - return g_object_ref (service); - } + g_hash_table_iter_init (&iter, priv->services); + while (g_hash_table_iter_next (&iter, NULL, &data)) { + NMVPNService *candidate = NM_VPN_SERVICE (data); + const char *service_namefile; + service_namefile = nm_vpn_service_get_name_file (candidate); + if (!strcmp (namefile, service_namefile)) + return candidate; + } return NULL; } -static void -remove_service (gpointer data, GObject *service) -{ - NMVPNManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE (data); - - priv->services = g_slist_remove (priv->services, service); -} - -static void -nm_vpn_manager_add_service (NMVPNManager *manager, NMVPNService *service) -{ - NMVPNManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE (manager); - - priv->services = g_slist_prepend (priv->services, service); - g_object_weak_ref (G_OBJECT (service), remove_service, manager); -} - static NMVPNConnection * -find_active_vpn_connection_by_connection (NMVPNManager *manager, NMConnection *connection) +find_active_vpn_connection_by_connection (NMVPNManager *self, NMConnection *connection) { - NMVPNManagerPrivate *priv; - GSList *iter; + NMVPNManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE (self); + GHashTableIter iter; + gpointer data; + GSList *connections, *elt; - g_return_val_if_fail (NM_IS_VPN_MANAGER (manager), NULL); + g_return_val_if_fail (connection, NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); - priv = NM_VPN_MANAGER_GET_PRIVATE (manager); - for (iter = priv->services; iter; iter = g_slist_next (iter)) { - GSList *connections, *elt; - - connections = nm_vpn_service_get_active_connections (NM_VPN_SERVICE (iter->data)); + g_hash_table_iter_init (&iter, priv->services); + while (g_hash_table_iter_next (&iter, NULL, &data)) { + connections = nm_vpn_service_get_active_connections (NM_VPN_SERVICE (data)); for (elt = connections; elt; elt = g_slist_next (elt)) { NMVPNConnection *vpn = NM_VPN_CONNECTION (elt->data); @@ -169,7 +164,7 @@ nm_vpn_manager_activate_connection (NMVPNManager *manager, NMSettingVPN *vpn_setting; NMVPNService *service; NMVPNConnection *vpn = NULL; - const char *service_type; + const char *service_name; g_return_val_if_fail (NM_IS_VPN_MANAGER (manager), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); @@ -199,78 +194,78 @@ nm_vpn_manager_activate_connection (NMVPNManager *manager, vpn = NULL; } - service_type = nm_setting_vpn_get_service_type (vpn_setting); - service = nm_vpn_manager_get_service (manager, service_type); + service_name = nm_setting_vpn_get_service_type (vpn_setting); + g_assert (service_name); + service = g_hash_table_lookup (NM_VPN_MANAGER_GET_PRIVATE (manager)->services, service_name); if (!service) { - service = nm_vpn_service_new (service_type); - if (service) - nm_vpn_manager_add_service (manager, service); - } - - if (service) { - vpn = nm_vpn_service_activate (service, connection, act_request, device, error); - if (vpn) { - g_signal_connect (vpn, "vpn-state-changed", - G_CALLBACK (connection_vpn_state_changed), - manager); - } - } else { g_set_error (error, NM_VPN_MANAGER_ERROR, NM_VPN_MANAGER_ERROR_SERVICE_INVALID, - "%s", "The VPN service was invalid."); + "The VPN service '%s' was not installed.", + service_name); + return NULL; + } + + vpn = nm_vpn_service_activate (service, connection, act_request, device, error); + if (vpn) { + g_signal_connect (vpn, "vpn-state-changed", + G_CALLBACK (connection_vpn_state_changed), + manager); } return vpn; } gboolean -nm_vpn_manager_deactivate_connection (NMVPNManager *manager, +nm_vpn_manager_deactivate_connection (NMVPNManager *self, const char *path, NMVPNConnectionStateReason reason) { NMVPNManagerPrivate *priv; - GSList *iter; - gboolean found = FALSE; + GHashTableIter iter; + gpointer data; + GSList *active, *elt; - g_return_val_if_fail (NM_IS_VPN_MANAGER (manager), FALSE); + g_return_val_if_fail (self, FALSE); + g_return_val_if_fail (NM_IS_VPN_MANAGER (self), FALSE); g_return_val_if_fail (path != NULL, FALSE); - priv = NM_VPN_MANAGER_GET_PRIVATE (manager); - for (iter = priv->services; iter; iter = g_slist_next (iter)) { - GSList *connections, *elt; - - connections = nm_vpn_service_get_active_connections (NM_VPN_SERVICE (iter->data)); - for (elt = connections; elt; elt = g_slist_next (elt)) { + priv = NM_VPN_MANAGER_GET_PRIVATE (self); + g_hash_table_iter_init (&iter, priv->services); + while (g_hash_table_iter_next (&iter, NULL, &data)) { + active = nm_vpn_service_get_active_connections (NM_VPN_SERVICE (data)); + for (elt = active; elt; elt = g_slist_next (elt)) { NMVPNConnection *vpn = NM_VPN_CONNECTION (elt->data); const char *vpn_path; vpn_path = nm_vpn_connection_get_active_connection_path (vpn); if (!strcmp (path, vpn_path)) { nm_vpn_connection_disconnect (vpn, reason); - found = TRUE; + return TRUE; } } } - return found ? TRUE : FALSE; + return FALSE; } void -nm_vpn_manager_add_active_connections (NMVPNManager *manager, +nm_vpn_manager_add_active_connections (NMVPNManager *self, NMConnection *filter, GPtrArray *array) { NMVPNManagerPrivate *priv; - GSList *iter; + GHashTableIter iter; + gpointer data; + GSList *active, *elt; - g_return_if_fail (NM_IS_VPN_MANAGER (manager)); + g_return_if_fail (self); + g_return_if_fail (NM_IS_VPN_MANAGER (self)); g_return_if_fail (array != NULL); - priv = NM_VPN_MANAGER_GET_PRIVATE (manager); - for (iter = priv->services; iter; iter = g_slist_next (iter)) { - GSList *active, *elt; - - active = nm_vpn_service_get_active_connections (NM_VPN_SERVICE (iter->data)); + priv = NM_VPN_MANAGER_GET_PRIVATE (self); + g_hash_table_iter_init (&iter, priv->services); + while (g_hash_table_iter_next (&iter, NULL, &data)) { + active = nm_vpn_service_get_active_connections (NM_VPN_SERVICE (data)); for (elt = active; elt; elt = g_slist_next (elt)) { NMVPNConnection *vpn = NM_VPN_CONNECTION (elt->data); const char *path; @@ -284,23 +279,23 @@ nm_vpn_manager_add_active_connections (NMVPNManager *manager, } GSList * -nm_vpn_manager_get_active_connections (NMVPNManager *manager) +nm_vpn_manager_get_active_connections (NMVPNManager *self) { NMVPNManagerPrivate *priv; - GSList *iter; - GSList *list = NULL; + GHashTableIter iter; + gpointer data; + GSList *list = NULL, *active, *elt; - g_return_val_if_fail (NM_IS_VPN_MANAGER (manager), NULL); - - priv = NM_VPN_MANAGER_GET_PRIVATE (manager); - for (iter = priv->services; iter; iter = g_slist_next (iter)) { - GSList *active, *elt; + g_return_val_if_fail (self, NULL); + g_return_val_if_fail (NM_IS_VPN_MANAGER (self), NULL); - active = nm_vpn_service_get_active_connections (NM_VPN_SERVICE (iter->data)); + priv = NM_VPN_MANAGER_GET_PRIVATE (self); + g_hash_table_iter_init (&iter, priv->services); + while (g_hash_table_iter_next (&iter, NULL, &data)) { + active = nm_vpn_service_get_active_connections (NM_VPN_SERVICE (data)); for (elt = active; elt; elt = g_slist_next (elt)) - list = g_slist_append (list, g_object_ref (NM_VPN_CONNECTION (elt->data))); + list = g_slist_append (list, g_object_ref (G_OBJECT (elt->data))); } - return list; } @@ -309,28 +304,130 @@ nm_vpn_manager_get_connection_for_active (NMVPNManager *manager, const char *active_path) { NMVPNManagerPrivate *priv; - GSList *iter; + GHashTableIter iter; + gpointer data; + GSList *active, *elt; g_return_val_if_fail (NM_IS_VPN_MANAGER (manager), NULL); priv = NM_VPN_MANAGER_GET_PRIVATE (manager); - for (iter = priv->services; iter; iter = g_slist_next (iter)) { - GSList *active, *elt; - - active = nm_vpn_service_get_active_connections (NM_VPN_SERVICE (iter->data)); + g_hash_table_iter_init (&iter, priv->services); + while (g_hash_table_iter_next (&iter, NULL, &data)) { + active = nm_vpn_service_get_active_connections (NM_VPN_SERVICE (data)); for (elt = active; elt; elt = g_slist_next (elt)) { - NMVPNConnection *candidate = NM_VPN_CONNECTION (elt->data); + NMVPNConnection *vpn = NM_VPN_CONNECTION (elt->data); const char *ac_path; - ac_path = nm_vpn_connection_get_active_connection_path (candidate); + ac_path = nm_vpn_connection_get_active_connection_path (vpn); if (ac_path && !strcmp (ac_path, active_path)) - return nm_vpn_connection_get_connection (candidate); + return nm_vpn_connection_get_connection (vpn); } } return NULL; } +static char * +service_name_from_file (const char *path) +{ + GKeyFile *kf = NULL; + char *service_name = NULL; + + g_return_val_if_fail (g_path_is_absolute (path), NULL); + + if (!g_str_has_suffix (path, ".name")) + return NULL; + + kf = g_key_file_new (); + if (g_key_file_load_from_file (kf, path, G_KEY_FILE_NONE, NULL)) + service_name = g_key_file_get_string (kf, VPN_CONNECTION_GROUP, "service", NULL); + + g_key_file_free (kf); + return service_name; +} + +static void +try_add_service (NMVPNManager *self, const char *namefile) +{ + NMVPNManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE (self); + NMVPNService *service = NULL; + GError *error = NULL; + const char *service_name; + char *tmp; + + g_return_if_fail (g_path_is_absolute (namefile)); + + /* Make sure we don't add dupes */ + tmp = service_name_from_file (namefile); + if (tmp) + service = g_hash_table_lookup (priv->services, tmp); + g_free (tmp); + if (service) + return; + + /* New service, add it */ + service = nm_vpn_service_new (namefile, &error); + if (!service) { + nm_log_warn (LOGD_VPN, "failed to load VPN service file %s: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); + return; + } + + service_name = nm_vpn_service_get_dbus_service (service); + g_hash_table_insert (priv->services, (char *) service_name, service); + nm_log_info (LOGD_VPN, "VPN: loaded %s", service_name, service); +} + +static void +vpn_dir_changed (GFileMonitor *monitor, + GFile *file, + GFile *other_file, + GFileMonitorEvent event_type, + gpointer user_data) +{ + NMVPNManager *self = NM_VPN_MANAGER (user_data); + NMVPNManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE (self); + NMVPNService *service; + char *path; + + path = g_file_get_path (file); + if (!g_str_has_suffix (path, ".name")) { + g_free (path); + return; + } + + switch (event_type) { + case G_FILE_MONITOR_EVENT_DELETED: + nm_log_dbg (LOGD_VPN, "service file %s deleted", path); + + service = get_service_by_namefile (self, path); + if (service) { + const char *service_name = nm_vpn_service_get_dbus_service (service); + + /* Stop active VPN connections and destroy the service */ + nm_vpn_service_connections_stop (service, TRUE, + NM_VPN_CONNECTION_STATE_REASON_SERVICE_STOPPED); + nm_log_info (LOGD_VPN, "VPN: unloaded %s", service_name, service); + g_hash_table_remove (priv->services, service_name); + } + break; + case G_FILE_MONITOR_EVENT_CREATED: + case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: + nm_log_dbg (LOGD_VPN, "service file %s created or modified", path); + try_add_service (self, path); + break; + default: + nm_log_dbg (LOGD_VPN, "service file %s change event %d", path, event_type); + break; + } + + g_free (path); +} + +/******************************************************************************/ + NMVPNManager * nm_vpn_manager_get (void) { @@ -345,21 +442,61 @@ nm_vpn_manager_get (void) return singleton; } -/******************************************************************************/ - static void -nm_vpn_manager_init (NMVPNManager *manager) +nm_vpn_manager_init (NMVPNManager *self) { + NMVPNManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE (self); + GFile *file; + GDir *dir; + const char *fn; + char *path; + + priv->services = g_hash_table_new_full (g_str_hash, g_str_equal, + NULL, g_object_unref); + + /* Watch the VPN directory for changes */ + file = g_file_new_for_path (VPN_NAME_FILES_DIR "/"); + priv->monitor = g_file_monitor_directory (file, G_FILE_MONITOR_NONE, NULL, NULL); + g_object_unref (file); + if (priv->monitor) { + priv->monitor_id = g_signal_connect (priv->monitor, "changed", + G_CALLBACK (vpn_dir_changed), self); + } + + /* Load VPN service files */ + dir = g_dir_open (VPN_NAME_FILES_DIR, 0, NULL); + if (dir) { + while ((fn = g_dir_read_name (dir))) { + /* only parse filenames that end with .name */ + if (g_str_has_suffix (fn, ".name")) { + path = g_build_filename (VPN_NAME_FILES_DIR, fn, NULL); + try_add_service (self, path); + g_free (path); + } + } + g_dir_close (dir); + } } static void -finalize (GObject *object) +dispose (GObject *object) { NMVPNManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE (object); - g_slist_foreach (priv->services, (GFunc) g_object_unref, NULL); + if (!priv->disposed) { + priv->disposed = TRUE; + + if (priv->monitor) { + if (priv->monitor_id) + g_signal_handler_disconnect (priv->monitor, priv->monitor_id); + g_file_monitor_cancel (priv->monitor); + g_object_unref (priv->monitor); + } + + g_hash_table_destroy (priv->services); + } - G_OBJECT_CLASS (nm_vpn_manager_parent_class)->finalize (object); + G_OBJECT_CLASS (nm_vpn_manager_parent_class)->dispose (object); } static void @@ -370,7 +507,7 @@ nm_vpn_manager_class_init (NMVPNManagerClass *manager_class) g_type_class_add_private (manager_class, sizeof (NMVPNManagerPrivate)); /* virtual methods */ - object_class->finalize = finalize; + object_class->dispose = dispose; /* signals */ signals[CONNECTION_ACTIVATED] = diff --git a/src/vpn-manager/nm-vpn-service.c b/src/vpn-manager/nm-vpn-service.c index bdbb3774a0..37bd75d4eb 100644 --- a/src/vpn-manager/nm-vpn-service.c +++ b/src/vpn-manager/nm-vpn-service.c @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2005 - 2008 Red Hat, Inc. + * Copyright (C) 2005 - 2010 Red Hat, Inc. * Copyright (C) 2005 - 2008 Novell, Inc. */ @@ -36,125 +36,94 @@ G_DEFINE_TYPE (NMVPNService, nm_vpn_service, G_TYPE_OBJECT) typedef struct { + gboolean disposed; + NMDBusManager *dbus_mgr; char *name; char *dbus_service; char *program; + char *namefile; GPid pid; GSList *connections; - guint service_start_timeout; - guint service_child_watch; + guint start_timeout; + guint quit_timeout; + guint child_watch; gulong name_owner_id; } NMVPNServicePrivate; #define NM_VPN_SERVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_VPN_SERVICE, NMVPNServicePrivate)) -#define VPN_CONNECTION_GROUP "VPN Connection" - -static GKeyFile * -find_service_file (const char *name) -{ - GDir *dir; - const char *fn; - GKeyFile *key_file = NULL; - - dir = g_dir_open (VPN_NAME_FILES_DIR, 0, NULL); - if (!dir) - return NULL; - - while ((fn = g_dir_read_name (dir))) { - char *path; - gboolean found = FALSE; - - /* only parse filenames that end with .name */ - if (!g_str_has_suffix (fn, ".name")) - continue; - - key_file = g_key_file_new (); - path = g_build_filename (VPN_NAME_FILES_DIR, fn, NULL); - - if (g_key_file_load_from_file (key_file, path, G_KEY_FILE_NONE, NULL)) { - gchar *val; - - val = g_key_file_get_string (key_file, VPN_CONNECTION_GROUP, "service", NULL); - if (val) { - if (!strcmp (val, name)) - found = TRUE; - g_free (val); - } - } - - g_free (path); - - if (found) - break; - - g_key_file_free (key_file); - key_file = NULL; - } - - g_dir_close (dir); - - return key_file; -} - NMVPNService * -nm_vpn_service_new (const char *name) +nm_vpn_service_new (const char *namefile, GError **error) { - GKeyFile *key_file; - NMVPNService *service = NULL; - NMVPNServicePrivate *priv; - char *dbus_service = NULL; - char *program = NULL; - gboolean success = FALSE; + NMVPNService *self = NULL; + GKeyFile *kf; + char *dbus_service = NULL, *program = NULL, *name = NULL; - g_return_val_if_fail (name != NULL, NULL); + g_return_val_if_fail (namefile != NULL, NULL); + g_return_val_if_fail (g_path_is_absolute (namefile), NULL); - key_file = find_service_file (name); - if (!key_file) + kf = g_key_file_new (); + if (!g_key_file_load_from_file (kf, namefile, G_KEY_FILE_NONE, error)) { + g_key_file_free (kf); return NULL; + } - dbus_service = g_key_file_get_string (key_file, VPN_CONNECTION_GROUP, "service", NULL); - if (!dbus_service) + dbus_service = g_key_file_get_string (kf, VPN_CONNECTION_GROUP, "service", NULL); + if (!dbus_service) { + g_set_error (error, 0, 0, "VPN service file %s had no 'service' key", namefile); goto out; + } - program = g_key_file_get_string (key_file, VPN_CONNECTION_GROUP, "program", NULL); - if (!program) + program = g_key_file_get_string (kf, VPN_CONNECTION_GROUP, "program", NULL); + if (!program) { + g_set_error (error, 0, 0, "VPN service file %s had no 'program' key", namefile); goto out; + } - service = (NMVPNService *) g_object_new (NM_TYPE_VPN_SERVICE, NULL); - if (!service) + name = g_key_file_get_string (kf, VPN_CONNECTION_GROUP, "name", NULL); + if (!name) { + g_set_error (error, 0, 0, "VPN service file %s had no 'name' key", namefile); goto out; + } - priv = NM_VPN_SERVICE_GET_PRIVATE (service); - - priv->name = g_strdup (name); - priv->dbus_service = dbus_service; - priv->program = program; + self = (NMVPNService *) g_object_new (NM_TYPE_VPN_SERVICE, NULL); + if (!self) { + g_set_error (error, 0, 0, "out of memory creating VPN service object"); + goto out; + } - success = TRUE; + NM_VPN_SERVICE_GET_PRIVATE (self)->name = g_strdup (name); + NM_VPN_SERVICE_GET_PRIVATE (self)->dbus_service = g_strdup (dbus_service); + NM_VPN_SERVICE_GET_PRIVATE (self)->program = g_strdup (program); + NM_VPN_SERVICE_GET_PRIVATE (self)->namefile = g_strdup (namefile); out: - g_key_file_free (key_file); + g_key_file_free (kf); + g_free (dbus_service); + g_free (program); + g_free (name); + return self; +} - if (!success) { - g_free (dbus_service); - g_free (program); - } +const char * +nm_vpn_service_get_dbus_service (NMVPNService *service) +{ + g_return_val_if_fail (NM_IS_VPN_SERVICE (service), NULL); - return service; + return NM_VPN_SERVICE_GET_PRIVATE (service)->dbus_service; } const char * -nm_vpn_service_get_name (NMVPNService *service) +nm_vpn_service_get_name_file (NMVPNService *service) { g_return_val_if_fail (NM_IS_VPN_SERVICE (service), NULL); - return NM_VPN_SERVICE_GET_PRIVATE (service)->name; + return NM_VPN_SERVICE_GET_PRIVATE (service)->namefile; } -static void +void nm_vpn_service_connections_stop (NMVPNService *service, gboolean fail, NMVPNConnectionStateReason reason) @@ -175,6 +144,17 @@ nm_vpn_service_connections_stop (NMVPNService *service, g_slist_free (copy); } +static void +clear_quit_timeout (NMVPNService *self) +{ + NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (self); + + if (priv->quit_timeout) { + g_source_remove (priv->quit_timeout); + priv->quit_timeout = 0; + } +} + /* * nm_vpn_service_child_setup * @@ -200,21 +180,22 @@ vpn_service_watch_cb (GPid pid, gint status, gpointer user_data) if (err != 0) { nm_log_warn (LOGD_VPN, "VPN service '%s' exited with error: %d", - nm_vpn_service_get_name (service), WSTOPSIG (status)); + priv->name, WSTOPSIG (status)); } } else if (WIFSTOPPED (status)) { nm_log_warn (LOGD_VPN, "VPN service '%s' stopped unexpectedly with signal %d", - nm_vpn_service_get_name (service), WSTOPSIG (status)); + priv->name, WSTOPSIG (status)); } else if (WIFSIGNALED (status)) { nm_log_warn (LOGD_VPN, "VPN service '%s' died with signal %d", - nm_vpn_service_get_name (service), WTERMSIG (status)); + priv->name, WTERMSIG (status)); } else { nm_log_warn (LOGD_VPN, "VPN service '%s' died from an unknown cause", - nm_vpn_service_get_name (service)); + priv->name); } priv->pid = 0; - priv->service_child_watch = 0; + priv->child_watch = 0; + clear_quit_timeout (service); nm_vpn_service_connections_stop (service, TRUE, NM_VPN_CONNECTION_STATE_REASON_SERVICE_STOPPED); } @@ -222,14 +203,12 @@ vpn_service_watch_cb (GPid pid, gint status, gpointer user_data) static gboolean nm_vpn_service_timeout (gpointer data) { - NMVPNService *service = NM_VPN_SERVICE (data); - - nm_log_warn (LOGD_VPN, "VPN service '%s' did not start in time, cancelling connections", - nm_vpn_service_get_name (service)); - - NM_VPN_SERVICE_GET_PRIVATE (service)->service_start_timeout = 0; - nm_vpn_service_connections_stop (service, TRUE, NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_TIMEOUT); + NMVPNService *self = NM_VPN_SERVICE (data); + NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (self); + nm_log_warn (LOGD_VPN, "VPN service '%s' start timed out", priv->name); + priv->start_timeout = 0; + nm_vpn_service_connections_stop (self, TRUE, NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_TIMEOUT); return FALSE; } @@ -253,13 +232,15 @@ nm_vpn_service_daemon_exec (NMVPNService *service, GError **error) &spawn_error); if (success) { nm_log_info (LOGD_VPN, "VPN service '%s' started (%s), PID %d", - nm_vpn_service_get_name (service), priv->dbus_service, priv->pid); + priv->name, priv->dbus_service, priv->pid); - priv->service_child_watch = g_child_watch_add (priv->pid, vpn_service_watch_cb, service); - priv->service_start_timeout = g_timeout_add_seconds (5, nm_vpn_service_timeout, service); + priv->child_watch = g_child_watch_add (priv->pid, vpn_service_watch_cb, service); + priv->start_timeout = g_timeout_add_seconds (5, nm_vpn_service_timeout, service); } else { nm_log_warn (LOGD_VPN, "VPN service '%s': could not launch the VPN service. error: (%d) %s.", - nm_vpn_service_get_name (service), spawn_error->code, spawn_error->message); + priv->name, + spawn_error ? spawn_error->code : -1, + spawn_error && spawn_error->message ? spawn_error->message : "(unknown)"); g_set_error (error, NM_VPN_MANAGER_ERROR, NM_VPN_MANAGER_ERROR_SERVICE_START_FAILED, @@ -274,9 +255,40 @@ nm_vpn_service_daemon_exec (NMVPNService *service, GError **error) } static gboolean -destroy_service (gpointer data) +ensure_killed (gpointer data) +{ + int pid = GPOINTER_TO_INT (data); + + if (kill (pid, 0) == 0) + kill (pid, SIGKILL); + + /* ensure the child is reaped */ + nm_log_dbg (LOGD_VPN, "waiting for VPN service pid %d to exit", pid); + waitpid (pid, NULL, 0); + nm_log_dbg (LOGD_VPN, "VPN service pid %d cleaned up", pid); + + return FALSE; +} + +static gboolean +service_quit (gpointer user_data) { - g_object_unref (data); + NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (user_data); + + if (priv->pid) { + if (kill (priv->pid, SIGTERM) == 0) + g_timeout_add_seconds (2, ensure_killed, GINT_TO_POINTER (priv->pid)); + else { + kill (priv->pid, SIGKILL); + + /* ensure the child is reaped */ + nm_log_dbg (LOGD_VPN, "waiting for VPN service pid %d to exit", priv->pid); + waitpid (priv->pid, NULL, 0); + nm_log_dbg (LOGD_VPN, "VPN service pid %d cleaned up", priv->pid); + } + priv->pid = 0; + } + priv->quit_timeout = 0; return FALSE; } @@ -297,8 +309,9 @@ connection_vpn_state_changed (NMVPNConnection *connection, g_object_unref (connection); if (priv->connections == NULL) { - /* schedule a timeout (10 seconds) to destroy the service */ - g_timeout_add_seconds (10, destroy_service, user_data); + /* Tell the service to quit in a few seconds */ + if (!priv->quit_timeout) + priv->quit_timeout = g_timeout_add_seconds (5, service_quit, user_data); } break; default: @@ -325,6 +338,8 @@ nm_vpn_service_activate (NMVPNService *service, priv = NM_VPN_SERVICE_GET_PRIVATE (service); + clear_quit_timeout (service); + vpn = nm_vpn_connection_new (connection, act_request, device); g_signal_connect (vpn, "vpn-state-changed", G_CALLBACK (connection_vpn_state_changed), @@ -335,9 +350,8 @@ nm_vpn_service_activate (NMVPNService *service, if (nm_dbus_manager_name_has_owner (priv->dbus_mgr, priv->dbus_service)) { // FIXME: fill in error when errors happen nm_vpn_connection_activate (vpn); - } else if (priv->service_start_timeout == 0) { - nm_log_info (LOGD_VPN, "Starting VPN service '%s'...", - nm_vpn_service_get_name (service)); + } else if (priv->start_timeout == 0) { + nm_log_info (LOGD_VPN, "Starting VPN service '%s'...", priv->name); if (!nm_vpn_service_daemon_exec (service, error)) vpn = NULL; } @@ -364,14 +378,15 @@ nm_vpn_service_name_owner_changed (NMDBusManager *mgr, NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (service); gboolean old_owner_good; gboolean new_owner_good; + GSList *iter; if (strcmp (name, priv->dbus_service)) return; /* Service changed, no need to wait for the timeout any longer */ - if (priv->service_start_timeout) { - g_source_remove (priv->service_start_timeout); - priv->service_start_timeout = 0; + if (priv->start_timeout) { + g_source_remove (priv->start_timeout); + priv->start_timeout = 0; } old_owner_good = (old && (strlen (old) > 0)); @@ -379,18 +394,14 @@ nm_vpn_service_name_owner_changed (NMDBusManager *mgr, if (!old_owner_good && new_owner_good) { /* service just appeared */ - GSList *iter; - - nm_log_info (LOGD_VPN, "VPN service '%s' appeared, activating connections", - nm_vpn_service_get_name (service)); + nm_log_info (LOGD_VPN, "VPN service '%s' appeared; activating connections", priv->name); + clear_quit_timeout (service); for (iter = priv->connections; iter; iter = iter->next) nm_vpn_connection_activate (NM_VPN_CONNECTION (iter->data)); - } else if (old_owner_good && !new_owner_good) { /* service went away */ - nm_log_info (LOGD_VPN, "VPN service '%s' disappeared, cancelling connections", - nm_vpn_service_get_name (service)); + nm_log_info (LOGD_VPN, "VPN service '%s' disappeared", priv->name); nm_vpn_service_connections_stop (service, TRUE, NM_VPN_CONNECTION_STATE_REASON_SERVICE_STOPPED); } } @@ -398,40 +409,28 @@ nm_vpn_service_name_owner_changed (NMDBusManager *mgr, /******************************************************************************/ static void -nm_vpn_service_init (NMVPNService *service) +nm_vpn_service_init (NMVPNService *self) { - NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (service); + NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (self); priv->dbus_mgr = nm_dbus_manager_get (); - priv->name_owner_id = g_signal_connect (priv->dbus_mgr, "name-owner-changed", - G_CALLBACK (nm_vpn_service_name_owner_changed), - service); -} - -static gboolean -ensure_killed (gpointer data) -{ - int pid = GPOINTER_TO_INT (data); - - if (kill (pid, 0) == 0) - kill (pid, SIGKILL); - - /* ensure the child is reaped */ - nm_log_dbg (LOGD_VPN, "waiting for VPN service pid %d to exit", pid); - waitpid (pid, NULL, 0); - nm_log_dbg (LOGD_VPN, "VPN service pid %d cleaned up", pid); - - return FALSE; + G_CALLBACK (nm_vpn_service_name_owner_changed), + self); } static void -finalize (GObject *object) +dispose (GObject *object) { - NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (object); + NMVPNService *self = NM_VPN_SERVICE (object); + NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (self); - if (priv->service_start_timeout) - g_source_remove (priv->service_start_timeout); + if (priv->disposed) + goto out; + priv->disposed = TRUE; + + if (priv->start_timeout) + g_source_remove (priv->start_timeout); nm_vpn_service_connections_stop (NM_VPN_SERVICE (object), FALSE, @@ -439,31 +438,21 @@ finalize (GObject *object) g_signal_handler_disconnect (priv->dbus_mgr, priv->name_owner_id); - if (priv->service_child_watch) - g_source_remove (priv->service_child_watch); + if (priv->child_watch) + g_source_remove (priv->child_watch); - if (priv->pid) { - if (kill (priv->pid, SIGTERM) == 0) - g_timeout_add_seconds (2, ensure_killed, GINT_TO_POINTER (priv->pid)); - else { - kill (priv->pid, SIGKILL); - - /* ensure the child is reaped */ - nm_log_dbg (LOGD_VPN, "waiting for VPN service pid %d to exit", priv->pid); - waitpid (priv->pid, NULL, 0); - nm_log_dbg (LOGD_VPN, "VPN service pid %d cleaned up", priv->pid); - } - - priv->pid = 0; - } + clear_quit_timeout (self); + service_quit (self); g_object_unref (priv->dbus_mgr); g_free (priv->name); g_free (priv->dbus_service); g_free (priv->program); + g_free (priv->namefile); - G_OBJECT_CLASS (nm_vpn_service_parent_class)->finalize (object); +out: + G_OBJECT_CLASS (nm_vpn_service_parent_class)->dispose (object); } static void @@ -474,5 +463,5 @@ nm_vpn_service_class_init (NMVPNServiceClass *service_class) g_type_class_add_private (service_class, sizeof (NMVPNServicePrivate)); /* virtual methods */ - object_class->finalize = finalize; + object_class->dispose = dispose; } diff --git a/src/vpn-manager/nm-vpn-service.h b/src/vpn-manager/nm-vpn-service.h index 9c5e0eefc9..c7c1b0366a 100644 --- a/src/vpn-manager/nm-vpn-service.h +++ b/src/vpn-manager/nm-vpn-service.h @@ -35,6 +35,8 @@ #define NM_IS_VPN_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_VPN_SERVICE)) #define NM_VPN_SERVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_VPN_SERVICE, NMVPNServiceClass)) +#define VPN_CONNECTION_GROUP "VPN Connection" + typedef struct { GObject parent; } NMVPNService; @@ -45,9 +47,13 @@ typedef struct { GType nm_vpn_service_get_type (void); -NMVPNService * nm_vpn_service_new (const char *service_name); +NMVPNService * nm_vpn_service_new (const char *namefile, GError **error); + +/* Returns the VPN service's D-Bus service name */ +const char *nm_vpn_service_get_dbus_service (NMVPNService *service); -const char * nm_vpn_service_get_name (NMVPNService *service); +/* Returns the path of the VPN service's .name file */ +const char *nm_vpn_service_get_name_file (NMVPNService *service); NMVPNConnection * nm_vpn_service_activate (NMVPNService *service, NMConnection *connection, @@ -57,4 +63,8 @@ NMVPNConnection * nm_vpn_service_activate (NMVPNService *service, GSList * nm_vpn_service_get_active_connections (NMVPNService *service); +void nm_vpn_service_connections_stop (NMVPNService *service, + gboolean fail, + NMVPNConnectionStateReason reason); + #endif /* NM_VPN_VPN_SERVICE_H */ -- cgit v1.2.1 From d3fc2a16cefd500b04924ba24a72ecee81b355da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Gonz=C3=A1lez?= Date: Wed, 18 Aug 2010 12:06:26 -0500 Subject: po: updated Spanish translation (bgo #627080) --- po/es.po | 407 ++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 208 insertions(+), 199 deletions(-) diff --git a/po/es.po b/po/es.po index 142cb08cba..3bc6ef7b7f 100644 --- a/po/es.po +++ b/po/es.po @@ -15,8 +15,8 @@ msgstr "" "Project-Id-Version: es\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-06-28 08:52+0000\n" -"PO-Revision-Date: 2010-07-31 11:38+0200\n" +"POT-Creation-Date: 2010-08-10 03:25+0000\n" +"PO-Revision-Date: 2010-08-16 21:27+0200\n" "Last-Translator: Jorge González \n" "Language-Team: Español \n" "MIME-Version: 1.0\n" @@ -25,76 +25,76 @@ msgstr "" "X-Generator: KBabel 1.11.4\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 -#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 -#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 -#: ../cli/src/devices.c:152 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/devices.c:88 ../cli/src/devices.c:101 ../cli/src/devices.c:111 +#: ../cli/src/devices.c:121 ../cli/src/devices.c:134 ../cli/src/devices.c:145 +#: ../cli/src/devices.c:156 ../cli/src/devices.c:165 ../cli/src/devices.c:174 msgid "NAME" msgstr "NOMBRE" #. 0 -#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/connections.c:61 ../cli/src/connections.c:76 msgid "UUID" msgstr "UUID" #. 1 -#: ../cli/src/connections.c:61 +#: ../cli/src/connections.c:62 msgid "DEVICES" msgstr "DISPOSITIVOS" #. 2 -#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +#: ../cli/src/connections.c:63 ../cli/src/connections.c:78 msgid "SCOPE" msgstr "ALCANCE" #. 3 -#: ../cli/src/connections.c:63 +#: ../cli/src/connections.c:64 msgid "DEFAULT" msgstr "PREDETERMINADO" #. 4 -#: ../cli/src/connections.c:64 +#: ../cli/src/connections.c:65 msgid "DBUS-SERVICE" msgstr "SERVICIO DBUS" #. 5 -#: ../cli/src/connections.c:65 +#: ../cli/src/connections.c:66 msgid "SPEC-OBJECT" msgstr "OBJETO SPEC" #. 6 -#: ../cli/src/connections.c:66 +#: ../cli/src/connections.c:67 msgid "VPN" msgstr "VPN" #. 1 #. 0 #. 1 -#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +#: ../cli/src/connections.c:77 ../cli/src/devices.c:62 ../cli/src/devices.c:90 msgid "TYPE" msgstr "TIPO" #. 3 -#: ../cli/src/connections.c:78 +#: ../cli/src/connections.c:79 msgid "TIMESTAMP" msgstr "MARCA DE TIEMPO" #. 4 -#: ../cli/src/connections.c:79 +#: ../cli/src/connections.c:80 msgid "TIMESTAMP-REAL" msgstr "MARCA DE TIEMPO-REAL" #. 5 -#: ../cli/src/connections.c:80 +#: ../cli/src/connections.c:81 msgid "AUTOCONNECT" msgstr "AUTOCONECTAR" #. 6 -#: ../cli/src/connections.c:81 +#: ../cli/src/connections.c:82 msgid "READONLY" msgstr "SÓLOLECTURA" -#: ../cli/src/connections.c:157 +#: ../cli/src/connections.c:158 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -115,40 +115,40 @@ msgstr "" "]\n" " down id | uuid \n" -#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#: ../cli/src/connections.c:198 ../cli/src/connections.c:537 #, c-format msgid "Error: 'con list': %s" msgstr "Error: 'con list': %s" -#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#: ../cli/src/connections.c:200 ../cli/src/connections.c:539 #, c-format msgid "Error: 'con list': %s; allowed fields: %s" msgstr "Error: 'con list': %s; campos permitidos: %s" -#: ../cli/src/connections.c:207 +#: ../cli/src/connections.c:208 msgid "Connection details" msgstr "Detalles de conexiones" -#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 msgid "system" msgstr "sistema" -#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 msgid "user" msgstr "usuario" -#: ../cli/src/connections.c:383 +#: ../cli/src/connections.c:384 msgid "never" msgstr "nunca" #. "CAPABILITIES" #. Print header #. "WIFI-PROPERTIES" -#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 -#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 -#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 -#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 #: ../cli/src/settings.c:551 ../cli/src/settings.c:652 #: ../cli/src/settings.c:926 ../cli/src/settings.c:927 #: ../cli/src/settings.c:929 ../cli/src/settings.c:931 @@ -164,11 +164,11 @@ msgstr "nunca" msgid "yes" msgstr "sí" -#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 -#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 -#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 -#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 #: ../cli/src/settings.c:510 ../cli/src/settings.c:551 #: ../cli/src/settings.c:652 ../cli/src/settings.c:926 #: ../cli/src/settings.c:927 ../cli/src/settings.c:929 @@ -184,272 +184,272 @@ msgstr "sí" msgid "no" msgstr "no" -#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +#: ../cli/src/connections.c:458 ../cli/src/connections.c:501 msgid "System connections" msgstr "Conexiones de sistema" -#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +#: ../cli/src/connections.c:463 ../cli/src/connections.c:514 msgid "User connections" msgstr "Conexiones de usuario" -#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 -#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 -#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 -#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 -#: ../cli/src/devices.c:980 +#: ../cli/src/connections.c:475 ../cli/src/connections.c:1335 +#: ../cli/src/connections.c:1351 ../cli/src/connections.c:1360 +#: ../cli/src/connections.c:1371 ../cli/src/connections.c:1456 +#: ../cli/src/devices.c:962 ../cli/src/devices.c:972 ../cli/src/devices.c:1074 +#: ../cli/src/devices.c:1081 #, c-format msgid "Error: %s argument is missing." msgstr "Error: falta el argumento %s." -#: ../cli/src/connections.c:487 +#: ../cli/src/connections.c:488 #, c-format msgid "Error: %s - no such connection." msgstr "Error: %s - no hay tal conexión." -#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 -#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 -#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#: ../cli/src/connections.c:520 ../cli/src/connections.c:1384 +#: ../cli/src/connections.c:1474 ../cli/src/devices.c:785 +#: ../cli/src/devices.c:852 ../cli/src/devices.c:986 ../cli/src/devices.c:1087 #, c-format msgid "Unknown parameter: %s\n" msgstr "Parámetro desconocido: %s\n" -#: ../cli/src/connections.c:528 +#: ../cli/src/connections.c:529 #, c-format msgid "Error: no valid parameter specified." msgstr "Error: no se especificó un parámetro válido." -#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 -#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#: ../cli/src/connections.c:544 ../cli/src/connections.c:1577 +#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:274 #, c-format msgid "Error: %s." msgstr "Error: %s." -#: ../cli/src/connections.c:649 +#: ../cli/src/connections.c:650 #, c-format msgid "Error: 'con status': %s" msgstr "Error: 'con status': %s" -#: ../cli/src/connections.c:651 +#: ../cli/src/connections.c:652 #, c-format msgid "Error: 'con status': %s; allowed fields: %s" msgstr "Error: 'con status': %s; campos permitidos: %s" -#: ../cli/src/connections.c:658 +#: ../cli/src/connections.c:659 msgid "Active connections" msgstr "Conexiones activas" -#: ../cli/src/connections.c:1026 +#: ../cli/src/connections.c:1027 #, c-format msgid "no active connection on device '%s'" msgstr "conexión no activa en dispositivo '%s'" -#: ../cli/src/connections.c:1034 +#: ../cli/src/connections.c:1035 #, c-format msgid "no active connection or device" msgstr "conexión o dispositivo no activos" -#: ../cli/src/connections.c:1084 +#: ../cli/src/connections.c:1085 #, c-format msgid "device '%s' not compatible with connection '%s'" msgstr "dispositivo '%s' incompatible con conexión '%s'" -#: ../cli/src/connections.c:1086 +#: ../cli/src/connections.c:1087 #, c-format msgid "no device found for connection '%s'" msgstr "no se encontró dispositivo para conexión '%s'" -#: ../cli/src/connections.c:1097 +#: ../cli/src/connections.c:1098 msgid "activating" msgstr "activando" -#: ../cli/src/connections.c:1099 +#: ../cli/src/connections.c:1100 msgid "activated" msgstr "activada" -#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 -#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 -#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/connections.c:1103 ../cli/src/connections.c:1126 +#: ../cli/src/connections.c:1159 ../cli/src/devices.c:246 +#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:92 #: ../cli/src/network-manager.c:145 ../cli/src/settings.c:473 msgid "unknown" msgstr "desconocido" -#: ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:1112 msgid "VPN connecting (prepare)" msgstr "Conectando VPN (preparar)" -#: ../cli/src/connections.c:1113 +#: ../cli/src/connections.c:1114 msgid "VPN connecting (need authentication)" msgstr "Conectando VPN (necesita autenticación)" -#: ../cli/src/connections.c:1115 +#: ../cli/src/connections.c:1116 msgid "VPN connecting" msgstr "Conectando VPN" -#: ../cli/src/connections.c:1117 +#: ../cli/src/connections.c:1118 msgid "VPN connecting (getting IP configuration)" msgstr "Conectando VPN (Obteniendo configuración IP)" -#: ../cli/src/connections.c:1119 +#: ../cli/src/connections.c:1120 msgid "VPN connected" msgstr "VPN conectada" -#: ../cli/src/connections.c:1121 +#: ../cli/src/connections.c:1122 msgid "VPN connection failed" msgstr "Conexión VPN falló" -#: ../cli/src/connections.c:1123 +#: ../cli/src/connections.c:1124 msgid "VPN disconnected" msgstr "VPN desconectada" -#: ../cli/src/connections.c:1134 +#: ../cli/src/connections.c:1135 msgid "unknown reason" msgstr "razón desconocida" -#: ../cli/src/connections.c:1136 +#: ../cli/src/connections.c:1137 msgid "none" msgstr "ninguna" -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1139 msgid "the user was disconnected" msgstr "el usuario estaba desconectado" -#: ../cli/src/connections.c:1140 +#: ../cli/src/connections.c:1141 msgid "the base network connection was interrupted" msgstr "la conexión de red de base fue interrumpida" -#: ../cli/src/connections.c:1142 +#: ../cli/src/connections.c:1143 msgid "the VPN service stopped unexpectedly" msgstr "El servicio VPN se detuvo inesperadamente" -#: ../cli/src/connections.c:1144 +#: ../cli/src/connections.c:1145 msgid "the VPN service returned invalid configuration" msgstr "El servicio VPN retornó configuración inválida" -#: ../cli/src/connections.c:1146 +#: ../cli/src/connections.c:1147 msgid "the connection attempt timed out" msgstr "El intento de conexión se agotó" -#: ../cli/src/connections.c:1148 +#: ../cli/src/connections.c:1149 msgid "the VPN service did not start in time" msgstr "el servicio VPN no inició a tiempo" -#: ../cli/src/connections.c:1150 +#: ../cli/src/connections.c:1151 msgid "the VPN service failed to start" msgstr "el servicio VPN falló en el inicio" -#: ../cli/src/connections.c:1152 +#: ../cli/src/connections.c:1153 msgid "no valid VPN secrets" msgstr "secretos VPN inválidos" -#: ../cli/src/connections.c:1154 +#: ../cli/src/connections.c:1155 msgid "invalid VPN secrets" msgstr "secretos VPN válidos" -#: ../cli/src/connections.c:1156 +#: ../cli/src/connections.c:1157 msgid "the connection was removed" msgstr "la conexión fue eliminada" -#: ../cli/src/connections.c:1170 +#: ../cli/src/connections.c:1171 #, c-format msgid "state: %s\n" msgstr "estado: %s\n" -#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#: ../cli/src/connections.c:1174 ../cli/src/connections.c:1200 #, c-format msgid "Connection activated\n" msgstr "Conexión activada\n" -#: ../cli/src/connections.c:1176 +#: ../cli/src/connections.c:1177 #, c-format msgid "Error: Connection activation failed." msgstr "Error: Activación de conexión falló." -#: ../cli/src/connections.c:1195 +#: ../cli/src/connections.c:1196 #, c-format msgid "state: %s (%d)\n" msgstr "estado: %s (%d)\n" -#: ../cli/src/connections.c:1205 +#: ../cli/src/connections.c:1206 #, c-format msgid "Error: Connection activation failed: %s." msgstr "Error: Activación de conexión falló: %s." -#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#: ../cli/src/connections.c:1223 ../cli/src/devices.c:909 #, c-format msgid "Error: Timeout %d sec expired." msgstr "Error: Pausa de %d segundos expiró." -#: ../cli/src/connections.c:1265 +#: ../cli/src/connections.c:1266 #, c-format msgid "Error: Connection activation failed: %s" msgstr "Error: Activación de conexión falló: %s" -#: ../cli/src/connections.c:1279 +#: ../cli/src/connections.c:1280 #, c-format msgid "Error: Obtaining active connection for '%s' failed." msgstr "Error: Obtención de conexión activa para '%s' falló." -#: ../cli/src/connections.c:1288 +#: ../cli/src/connections.c:1289 #, c-format msgid "Active connection state: %s\n" msgstr "Estado de conexión activa: %s\n" -#: ../cli/src/connections.c:1289 +#: ../cli/src/connections.c:1290 #, c-format msgid "Active connection path: %s\n" msgstr "Ruta de conexión activa: %s\n" -#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#: ../cli/src/connections.c:1344 ../cli/src/connections.c:1465 #, c-format msgid "Error: Unknown connection: %s." msgstr "Error: Conexión desconocida: %s." -#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#: ../cli/src/connections.c:1379 ../cli/src/devices.c:980 #, c-format msgid "Error: timeout value '%s' is not valid." msgstr "Error: valor de pausa '%s' inválido." -#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#: ../cli/src/connections.c:1392 ../cli/src/connections.c:1482 #, c-format msgid "Error: id or uuid has to be specified." msgstr "Error: id o uuid ha sido especificado." -#: ../cli/src/connections.c:1411 +#: ../cli/src/connections.c:1412 #, c-format msgid "Error: No suitable device found: %s." msgstr "Error: Dispositivo inapropiado: %s." -#: ../cli/src/connections.c:1413 +#: ../cli/src/connections.c:1414 #, c-format msgid "Error: No suitable device found." msgstr "Error: Dispositivo no apropiado." -#: ../cli/src/connections.c:1505 +#: ../cli/src/connections.c:1509 #, c-format msgid "Warning: Connection not active\n" msgstr "Advertencia: Conexión inactiva\n" -#: ../cli/src/connections.c:1561 +#: ../cli/src/connections.c:1566 #, c-format msgid "Error: 'con' command '%s' is not valid." msgstr "Error: comando 'con' '%s' es inválido." -#: ../cli/src/connections.c:1597 +#: ../cli/src/connections.c:1602 #, c-format msgid "Error: could not connect to D-Bus." msgstr "Error: no se pudo conectar a D-Bus." -#: ../cli/src/connections.c:1604 +#: ../cli/src/connections.c:1609 #, c-format msgid "Error: Could not get system settings." msgstr "Error: no se pudo obtener configuración de sistema." -#: ../cli/src/connections.c:1612 +#: ../cli/src/connections.c:1617 #, c-format msgid "Error: Could not get user settings." msgstr "Error: No se pudo obtener configuración de usuario." -#: ../cli/src/connections.c:1622 +#: ../cli/src/connections.c:1627 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "" @@ -458,173 +458,185 @@ msgstr "" #. 0 #. 9 -#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +#: ../cli/src/devices.c:61 ../cli/src/devices.c:89 ../cli/src/devices.c:184 msgid "DEVICE" msgstr "DISPOSITIVO" #. 1 #. 4 #. 0 -#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/devices.c:63 ../cli/src/devices.c:93 #: ../cli/src/network-manager.c:36 msgid "STATE" msgstr "ESTADO" -#: ../cli/src/devices.c:71 +#: ../cli/src/devices.c:72 msgid "GENERAL" msgstr "GENERAL" #. 0 -#: ../cli/src/devices.c:72 +#: ../cli/src/devices.c:73 msgid "CAPABILITIES" msgstr "FUNCIONALIDADES" #. 1 -#: ../cli/src/devices.c:73 +#: ../cli/src/devices.c:74 msgid "WIFI-PROPERTIES" msgstr "PROPIEDADES-WIFI" #. 2 -#: ../cli/src/devices.c:74 +#: ../cli/src/devices.c:75 msgid "AP" msgstr "AP" #. 3 -#: ../cli/src/devices.c:75 +#: ../cli/src/devices.c:76 msgid "WIRED-PROPERTIES" msgstr "PROPIEDADES ALÁMBRICAS" #. 4 -#: ../cli/src/devices.c:76 +#: ../cli/src/devices.c:77 msgid "IP4-SETTINGS" msgstr "CONFIGURACIONES IP4" #. 5 -#: ../cli/src/devices.c:77 +#: ../cli/src/devices.c:78 msgid "IP4-DNS" msgstr "DNS IP4" +#. 6 +#: ../cli/src/devices.c:79 +#| msgid "IP4-SETTINGS" +msgid "IP6-SETTINGS" +msgstr "CONFIGURACIONES IP6" + +#. 7 +#: ../cli/src/devices.c:80 +#| msgid "IP4-DNS" +msgid "IP6-DNS" +msgstr "DNS IP6" + #. 2 -#: ../cli/src/devices.c:88 +#: ../cli/src/devices.c:91 msgid "DRIVER" msgstr "CONTROLADOR" #. 3 -#: ../cli/src/devices.c:89 +#: ../cli/src/devices.c:92 msgid "HWADDR" msgstr "HWADDR" #. 0 -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:102 msgid "CARRIER-DETECT" msgstr "DETECTAR-PORTADOR" #. 1 -#: ../cli/src/devices.c:100 +#: ../cli/src/devices.c:103 msgid "SPEED" msgstr "VELOCIDAD" #. 0 -#: ../cli/src/devices.c:109 +#: ../cli/src/devices.c:112 msgid "CARRIER" msgstr "PORTADOR" #. 0 -#: ../cli/src/devices.c:119 +#: ../cli/src/devices.c:122 msgid "WEP" msgstr "WEP" #. 1 -#: ../cli/src/devices.c:120 +#: ../cli/src/devices.c:123 msgid "WPA" msgstr "WPA" #. 2 -#: ../cli/src/devices.c:121 +#: ../cli/src/devices.c:124 msgid "WPA2" msgstr "WPA2" #. 3 -#: ../cli/src/devices.c:122 +#: ../cli/src/devices.c:125 msgid "TKIP" msgstr "TKIP" #. 4 -#: ../cli/src/devices.c:123 +#: ../cli/src/devices.c:126 msgid "CCMP" msgstr "CCMP" #. 0 -#: ../cli/src/devices.c:132 +#: ../cli/src/devices.c:135 ../cli/src/devices.c:146 msgid "ADDRESS" msgstr "DIRECCIÓN" #. 1 -#: ../cli/src/devices.c:133 +#: ../cli/src/devices.c:136 ../cli/src/devices.c:147 msgid "PREFIX" msgstr "PREFIJO" #. 2 -#: ../cli/src/devices.c:134 +#: ../cli/src/devices.c:137 ../cli/src/devices.c:148 msgid "GATEWAY" msgstr "PUERTA DE ENLACE" #. 0 -#: ../cli/src/devices.c:143 +#: ../cli/src/devices.c:157 ../cli/src/devices.c:166 msgid "DNS" msgstr "DNS" #. 0 -#: ../cli/src/devices.c:153 +#: ../cli/src/devices.c:175 msgid "SSID" msgstr "SSID" #. 1 -#: ../cli/src/devices.c:154 +#: ../cli/src/devices.c:176 msgid "BSSID" msgstr "BSSID" #. 2 -#: ../cli/src/devices.c:155 +#: ../cli/src/devices.c:177 msgid "MODE" msgstr "MODO" #. 3 -#: ../cli/src/devices.c:156 +#: ../cli/src/devices.c:178 msgid "FREQ" msgstr "FREC" #. 4 -#: ../cli/src/devices.c:157 +#: ../cli/src/devices.c:179 msgid "RATE" msgstr "TASA" #. 5 -#: ../cli/src/devices.c:158 +#: ../cli/src/devices.c:180 msgid "SIGNAL" msgstr "SEÑAL" #. 6 -#: ../cli/src/devices.c:159 +#: ../cli/src/devices.c:181 msgid "SECURITY" msgstr "SEGURIDAD" #. 7 -#: ../cli/src/devices.c:160 +#: ../cli/src/devices.c:182 msgid "WPA-FLAGS" msgstr "INDICADORES-WPA" #. 8 -#: ../cli/src/devices.c:161 +#: ../cli/src/devices.c:183 msgid "RSN-FLAGS" msgstr "INDICADORES-RSN" #. 10 -#: ../cli/src/devices.c:163 +#: ../cli/src/devices.c:185 msgid "ACTIVE" msgstr "ACTIVO" -#: ../cli/src/devices.c:186 +#: ../cli/src/devices.c:208 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -647,204 +659,205 @@ msgstr "" " wifi [list [iface ] [hwaddr ]]\n" "\n" -#: ../cli/src/devices.c:206 +#: ../cli/src/devices.c:228 msgid "unmanaged" msgstr "sin gestión" -#: ../cli/src/devices.c:208 +#: ../cli/src/devices.c:230 msgid "unavailable" msgstr "no disponible" -#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:89 msgid "disconnected" msgstr "desconectado" -#: ../cli/src/devices.c:212 +#: ../cli/src/devices.c:234 msgid "connecting (prepare)" msgstr "conectando (preparar)" -#: ../cli/src/devices.c:214 +#: ../cli/src/devices.c:236 msgid "connecting (configuring)" msgstr "conectando (configurando)" -#: ../cli/src/devices.c:216 +#: ../cli/src/devices.c:238 msgid "connecting (need authentication)" msgstr "conectando (necesita autenticación)" -#: ../cli/src/devices.c:218 +#: ../cli/src/devices.c:240 msgid "connecting (getting IP configuration)" msgstr "conectando (obteniendo configuración IP)" -#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:87 msgid "connected" msgstr "conectado" -#: ../cli/src/devices.c:222 +#: ../cli/src/devices.c:244 msgid "connection failed" msgstr "conexión falló" -#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +#: ../cli/src/devices.c:267 ../cli/src/devices.c:424 msgid "Unknown" msgstr "desconocido" -#: ../cli/src/devices.c:277 +#: ../cli/src/devices.c:299 msgid "(none)" msgstr "(ninguno)" -#: ../cli/src/devices.c:302 +#: ../cli/src/devices.c:324 #, c-format msgid "%s: error converting IP4 address 0x%X" msgstr "%s: error convirtiendo dirección IP4 0x%X" -#: ../cli/src/devices.c:349 +#: ../cli/src/devices.c:393 #, c-format msgid "%u MHz" msgstr "%u MHz" -#: ../cli/src/devices.c:350 +#: ../cli/src/devices.c:394 #, c-format msgid "%u MB/s" msgstr "%u MB/s" -#: ../cli/src/devices.c:359 +#: ../cli/src/devices.c:403 msgid "Encrypted: " msgstr "Encriptado: " -#: ../cli/src/devices.c:364 +#: ../cli/src/devices.c:408 msgid "WEP " msgstr "WEP" -#: ../cli/src/devices.c:366 +#: ../cli/src/devices.c:410 msgid "WPA " msgstr "WPA" -#: ../cli/src/devices.c:368 +#: ../cli/src/devices.c:412 msgid "WPA2 " msgstr "WPA2" -#: ../cli/src/devices.c:371 +#: ../cli/src/devices.c:415 msgid "Enterprise " msgstr "Empresa" -#: ../cli/src/devices.c:380 +#: ../cli/src/devices.c:424 msgid "Ad-Hoc" msgstr "Ad-Hoc" -#: ../cli/src/devices.c:380 +#: ../cli/src/devices.c:424 msgid "Infrastructure" msgstr "Infraestructura" -#: ../cli/src/devices.c:442 +#: ../cli/src/devices.c:486 #, c-format msgid "Error: 'dev list': %s" msgstr "Error: 'dev list': %s" -#: ../cli/src/devices.c:444 +#: ../cli/src/devices.c:488 #, c-format msgid "Error: 'dev list': %s; allowed fields: %s" msgstr "Error: 'dev list': %s; campos permitidos: %s" -#: ../cli/src/devices.c:453 +#: ../cli/src/devices.c:497 msgid "Device details" msgstr "Detalles de dispositivos" -#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +#: ../cli/src/devices.c:527 ../cli/src/devices.c:925 msgid "(unknown)" msgstr "(desconocido)" -#: ../cli/src/devices.c:484 +#: ../cli/src/devices.c:528 msgid "unknown)" msgstr "desconocido" -#: ../cli/src/devices.c:510 +#: ../cli/src/devices.c:554 #, c-format msgid "%u Mb/s" msgstr "%u Mb/s" #. Print header #. "WIRED-PROPERTIES" -#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:627 msgid "on" msgstr "encendido" -#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:627 msgid "off" msgstr "apagado" -#: ../cli/src/devices.c:710 +#: ../cli/src/devices.c:808 #, c-format msgid "Error: 'dev status': %s" msgstr "Error: 'dev status': %s" -#: ../cli/src/devices.c:712 +#: ../cli/src/devices.c:810 #, c-format msgid "Error: 'dev status': %s; allowed fields: %s" msgstr "Error: 'dev status': %s; campos permitidos: %s" -#: ../cli/src/devices.c:719 +#: ../cli/src/devices.c:817 msgid "Status of devices" msgstr "Estado de dispositivos" -#: ../cli/src/devices.c:747 +#: ../cli/src/devices.c:845 #, c-format msgid "Error: '%s' argument is missing." msgstr "Error: '%s' falta argumento." -#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#: ../cli/src/devices.c:874 ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: Device '%s' not found." msgstr "Error: Dispositivo '%s' no encontrado." -#: ../cli/src/devices.c:799 +#: ../cli/src/devices.c:897 #, c-format msgid "Success: Device '%s' successfully disconnected." msgstr "Éxito: Dispositivo '%s' desconectado correctamente." -#: ../cli/src/devices.c:824 +#: ../cli/src/devices.c:922 #, c-format msgid "Error: Device '%s' (%s) disconnecting failed: %s" msgstr "Error: Desconexión de dispositivo '%s' (%s) falló: %s" -#: ../cli/src/devices.c:832 +#: ../cli/src/devices.c:930 #, c-format msgid "Device state: %d (%s)\n" msgstr "Estado de dispositivo: %d (%s)\n" -#: ../cli/src/devices.c:896 +#: ../cli/src/devices.c:994 #, c-format msgid "Error: iface has to be specified." msgstr "Error: iface tiene que especificarse." -#: ../cli/src/devices.c:1011 +#: ../cli/src/devices.c:1112 #, c-format msgid "Error: 'dev wifi': %s" msgstr "Error: 'dev wifi' '%s'" -#: ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1114 #, c-format msgid "Error: 'dev wifi': %s; allowed fields: %s" msgstr "Error: 'dev wifi': %s; campos permitidos: %s" -#: ../cli/src/devices.c:1020 +#: ../cli/src/devices.c:1121 msgid "WiFi scan list" msgstr "lista de scan WiFi" -#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#: ../cli/src/devices.c:1156 ../cli/src/devices.c:1210 #, c-format msgid "Error: Access point with hwaddr '%s' not found." msgstr "Error: Punto de acceso con hwaddr '%s' no se encontró." -#: ../cli/src/devices.c:1072 +#: ../cli/src/devices.c:1173 #, c-format msgid "Error: Device '%s' is not a WiFi device." msgstr "Error: Dispositivo '%s' no es un dispositivo WiFi." -#: ../cli/src/devices.c:1136 +#: ../cli/src/devices.c:1237 #, c-format msgid "Error: 'dev wifi' command '%s' is not valid." msgstr "Error: comando 'dev wifi' '%s' inválido." -#: ../cli/src/devices.c:1183 +#: ../cli/src/devices.c:1284 #, c-format msgid "Error: 'dev' command '%s' is not valid." msgstr "Error: comando 'dev' '%s' inválido." @@ -1482,27 +1495,27 @@ msgstr "No se pudo verificar el archivo PKCS#12: %d" msgid "Could not generate random data." msgstr "No se pudo generar datos aleatorios." -#: ../libnm-util/nm-utils.c:1925 +#: ../libnm-util/nm-utils.c:1975 #, c-format msgid "Not enough memory to make encryption key." msgstr "No hay memoria suficiente para crear la clave privada de cifrado." -#: ../libnm-util/nm-utils.c:2035 +#: ../libnm-util/nm-utils.c:2085 msgid "Could not allocate memory for PEM file creation." msgstr "No se pudo reservar memoria para crear el archivo PEM." -#: ../libnm-util/nm-utils.c:2047 +#: ../libnm-util/nm-utils.c:2097 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "No pudo asignar memoria para escribir IV al archivo PEM." -#: ../libnm-util/nm-utils.c:2059 +#: ../libnm-util/nm-utils.c:2109 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "" "No se pudo asignar memoria para escribir llave encriptada al archivo PEM." -#: ../libnm-util/nm-utils.c:2078 +#: ../libnm-util/nm-utils.c:2128 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "No se pudo reservar memoria para el archivo de datos PEM." @@ -1574,12 +1587,10 @@ msgstr "" "de energía del sistema)" #: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 -#| msgid "System policy prevents modification of system settings" msgid "System policy prevents control of network connections" msgstr "La política de sistema evita el control de las conexiones de red" #: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 -#| msgid "System policy prevents sharing connections via an open WiFi network" msgid "System policy prevents enabling or disabling WiFi devices" msgstr "" "La política de sistema evita activar o desactivar los dispositivos " @@ -1592,7 +1603,6 @@ msgstr "" "ancha móvil" #: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 -#| msgid "System policy prevents modification of system settings" msgid "System policy prevents enabling or disabling system networking" msgstr "La política de sistema evita activar o desactivar la red del sistema" @@ -1602,7 +1612,6 @@ msgstr "" "La política del sistema evita poner a NetworkManager a dormir o despertarlo" #: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 -#| msgid "System policy prevents modification of system settings" msgid "System policy prevents use of user-specific connections" msgstr "" "La política del sistema evita el uso de conexiones específicas de usuario" @@ -1658,16 +1667,16 @@ msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "" "Opción no válida. Use --help para ver una lista de las opciones válidas.\n" -#: ../src/main.c:568 +#: ../src/main.c:573 #, c-format msgid "%s. Please use --help to see a list of valid options.\n" msgstr "%s. Por favor use --help para ver la lista de opciones válidas.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:324 msgid "# Created by NetworkManager\n" msgstr "# Creado por NetworkManager\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:340 #, c-format msgid "" "# Merged from %s\n" @@ -1676,19 +1685,19 @@ msgstr "" "# Mezclado de %s\n" "\n" -#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 msgid "no usable DHCP client could be found." msgstr "cliente DHCP inútil pudo ser hallado." -#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 msgid "'dhclient' could be found." msgstr "'dhclient' pudo ser hallado." -#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 msgid "'dhcpcd' could be found." msgstr "'dhcpcd' pudo ser hallado." -#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 #, c-format msgid "unsupported DHCP client '%s'" msgstr "'%s' Cliente DHCP sin soporte " @@ -1703,13 +1712,13 @@ msgstr "Nivel de registro desconocido '%s'" msgid "Unknown log domain '%s'" msgstr "Dominio de registro desconocido '%s'" -#: ../src/named-manager/nm-named-manager.c:350 +#: ../src/named-manager/nm-named-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "NOTA: el 'resolver' de nombres de libc puede que no soporte más de 3 " "servidores de nombres." -#: ../src/named-manager/nm-named-manager.c:352 +#: ../src/named-manager/nm-named-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "Puede que los servidores de nombres listados abajo no se reconozcan." @@ -1718,6 +1727,6 @@ msgstr "Puede que los servidores de nombres listados abajo no se reconozcan." msgid "Auto %s" msgstr "Auto %ss" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3275 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3412 msgid "System" msgstr "Sistema" -- cgit v1.2.1 From 6f2cd9e959fa2af276dcc16dc9a2b31cd4a0ec0d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 18 Aug 2010 17:01:26 -0500 Subject: core: more systemd service file fixes --- data/NetworkManager.service.in | 2 +- data/org.freedesktop.NetworkManager.service.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/NetworkManager.service.in b/data/NetworkManager.service.in index c2741fcc19..d93fc6709d 100644 --- a/data/NetworkManager.service.in +++ b/data/NetworkManager.service.in @@ -9,4 +9,4 @@ ExecStart=@sbindir@/NetworkManager --no-daemon [Install] WantedBy=network.target multi-user.target -Alias=NetworkManager-by-dbus +Alias=dbus-org.freedesktop.NetworkManager.service diff --git a/data/org.freedesktop.NetworkManager.service.in b/data/org.freedesktop.NetworkManager.service.in index 7434903bad..5bd091b4d3 100644 --- a/data/org.freedesktop.NetworkManager.service.in +++ b/data/org.freedesktop.NetworkManager.service.in @@ -8,4 +8,4 @@ Name=org.freedesktop.NetworkManager Exec=/bin/false User=root -SystemdService=NetworkManager-by-dbus.service +SystemdService=dbus-org.freedesktop.NetworkManager.service -- cgit v1.2.1 From 78a827813e36b7933a4a92cfa63d3635fdc8e0a6 Mon Sep 17 00:00:00 2001 From: Mathieu Trudel-Lapierre Date: Tue, 24 Aug 2010 10:13:22 -0500 Subject: dhcp: fix dhclient version handling (gentoo #332157) (gentoo #331547) --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index 652cca6b68..70b829c79f 100644 --- a/configure.ac +++ b/configure.ac @@ -393,6 +393,7 @@ if test -z "$DHCPCD_PATH" -a -z "$DHCLIENT_PATH"; then AC_MSG_WARN([Falling back to ISC dhclient, ${DHCLIENT_PATH}]) fi AC_SUBST(DHCLIENT_PATH) +AC_SUBST(DHCLIENT_VERSION) AC_SUBST(DHCPCD_PATH) # resolvconf support -- cgit v1.2.1 From 3f2e933f244df404e732b3b7b15f70c68a98d3ae Mon Sep 17 00:00:00 2001 From: Rajesh Ranjan Date: Tue, 24 Aug 2010 10:23:37 -0500 Subject: po: updated Hindi translation (rh #589230) --- po/hi.po | 134 +++++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 97 insertions(+), 37 deletions(-) diff --git a/po/hi.po b/po/hi.po index 9b6c3f1707..ec0b512ae7 100644 --- a/po/hi.po +++ b/po/hi.po @@ -5,12 +5,12 @@ # Rajesh Ranjan , 2010. msgid "" msgstr "" -"Project-Id-Version: NetworkManager.master\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-05-06 14:31+0530\n" -"PO-Revision-Date: 2010-05-07 15:23+0530\n" +"Project-Id-Version: hi\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-07-20 12:39+0530\n" +"PO-Revision-Date: 2010-07-26 13:05+0530\n" "Last-Translator: Rajesh Ranjan \n" -"Language-Team: Hindi \n" +"Language-Team: Hindi \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -499,6 +499,16 @@ msgstr "IP4-SETTINGS" msgid "IP4-DNS" msgstr "IP4-DNS" +#. 6 +#: ../cli/src/devices.c:79 +msgid "IP6-SETTINGS" +msgstr "IP6-SETTINGS" + +#. 7 +#: ../cli/src/devices.c:80 +msgid "IP6-DNS" +msgstr "IP6-DNS" + #. 2 #: ../cli/src/devices.c:88 msgid "DRIVER" @@ -1501,6 +1511,88 @@ msgstr "गोपित कुंजी को PEM फाइल में लि msgid "Could not allocate memory for PEM file data." msgstr "PEM फाइल आँकड़ा के लिए स्मृति नहीं आबंटित कर सका." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "किसी संरक्षित WiFi संजाल के द्वारा कनेक्शन साझा" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "किसी खुले WiFi संजाल के द्वारा कनेक्शन साझा" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "स्थिर सिस्टम होस्टनेम को सुधारें" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "सिस्टम कनेक्शन सुधारें" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "सिस्टम नीति सिस्टम सेटिंग के रूपांतरण को रोकता है." + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "सिस्टम नीति स्थिर सिस्टम होस्टनेम के रूपांतरण को रोकता है." + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "किसी संरक्षित WiFi संजाल के द्वारा साझा कनेक्शन को सिस्टम नीति रोकता है" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "किसी खुले WiFi संजाल के द्वारा साझा कनेक्शन को सिस्टम नीति रोकता है" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "संजाल कनेक्शन के नियंत्रण स्वीकार करें" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "उपयोक्ता विशिष्ट कनेक्शन के उपयोग की स्वीकृति दें" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "WiFi युक्तियाँ सक्रिय या निष्क्रिय करें" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "मोबाइल ब्राडबैंड युक्तियाँ सक्रिय या निष्क्रिय करें" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "तंत्र संजालन सक्रिय या निष्क्रिय करें" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 +msgid "" +"Put NetworkManager to sleep or wake it up (should only be used by system " +"power management)" +msgstr " NetworkManager को स्लीप स्थिति या वेकअप स्थिति में रखें (केवल सिस्टम पावर मैनेजमेंट के द्वारा प्रयोग किया जाएगा)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +msgid "System policy prevents control of network connections" +msgstr "सिस्टम कनेक्शन के नियंत्रण को सिस्टम नीति रोकता है" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "WiFi युक्ति के सक्रियण या निष्क्रियण को तंत्र नीति रोकता है" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "मोबाइल ब्रॉडबैंड युक्ति के सक्रियण या निष्क्रियण को तंत्र नीति रोकता है" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +msgid "System policy prevents enabling or disabling system networking" +msgstr "तंत्र संजालन के युक्ति के सक्रियण या निष्क्रियण को तंत्र नीति रोकता है" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "NetworkManager को स्लीप या वेकअप स्थिति में लाने के लिए नेटवर्कमैनेजर रोकता है" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +msgid "System policy prevents use of user-specific connections" +msgstr "सिस्टम नीति उपयोक्ता विशेष कनेक्शन के उपयोग को रोकता है" + #: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 #: ../src/nm-netlink-monitor.c:653 #, c-format @@ -1608,35 +1700,3 @@ msgstr "स्वतः %s" msgid "System" msgstr "तंत्र" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 -msgid "Connection sharing via a protected WiFi network" -msgstr "किसी संरक्षित WiFi संजाल के द्वारा कनेक्शन साझा" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 -msgid "Connection sharing via an open WiFi network" -msgstr "किसी खुले WiFi संजाल के द्वारा कनेक्शन साझा" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 -msgid "Modify persistent system hostname" -msgstr "स्थिर सिस्टम होस्टनेम को सुधारें" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 -msgid "Modify system connections" -msgstr "सिस्टम कनेक्शन सुधारें" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 -msgid "System policy prevents modification of system settings" -msgstr "सिस्टम नीति सिस्टम सेटिंग के रूपांतरण को रोकता है." - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 -msgid "System policy prevents modification of the persistent system hostname" -msgstr "सिस्टम नीति स्थिर सिस्टम होस्टनेम के रूपांतरण को रोकता है." - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 -msgid "System policy prevents sharing connections via a protected WiFi network" -msgstr "किसी संरक्षित WiFi संजाल के द्वारा साझा कनेक्शन को सिस्टम नीति रोकता है" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 -msgid "System policy prevents sharing connections via an open WiFi network" -msgstr "किसी खुले WiFi संजाल के द्वारा साझा कनेक्शन को सिस्टम नीति रोकता है" - -- cgit v1.2.1 From 81099a35a7552f35903466c2adc3c1d2d6524ced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=20Di=C3=A9guez?= Date: Tue, 24 Aug 2010 10:42:18 -0500 Subject: po: update Galician translation (bgo #627682) --- po/gl.po | 1562 +++++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 990 insertions(+), 572 deletions(-) diff --git a/po/gl.po b/po/gl.po index 50cfafafb7..ce3f609abe 100644 --- a/po/gl.po +++ b/po/gl.po @@ -7,18 +7,88 @@ msgid "" msgstr "" "Project-Id-Version: gl\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" -"product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-04-27 15:25+0000\n" -"PO-Revision-Date: 2010-02-25 11:06+0100\n" -"Last-Translator: Miguel Anxo Bouzada \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-08-11 21:19+0000\n" +"PO-Revision-Date: 2010-08-23 00:53+0000\n" +"Last-Translator: Francisco Diéguez \n" "Language-Team: Galego \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Launchpad-Export-Date: 2010-08-23 01:00+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/devices.c:88 ../cli/src/devices.c:101 ../cli/src/devices.c:111 +#: ../cli/src/devices.c:121 ../cli/src/devices.c:134 ../cli/src/devices.c:145 +#: ../cli/src/devices.c:156 ../cli/src/devices.c:165 ../cli/src/devices.c:174 +msgid "NAME" +msgstr "NOME" + +#. 0 +#: ../cli/src/connections.c:61 ../cli/src/connections.c:76 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:62 +msgid "DEVICES" +msgstr "DISPOSITIVOS" + +#. 2 +#: ../cli/src/connections.c:63 ../cli/src/connections.c:78 +msgid "SCOPE" +msgstr "AMBITO" + +#. 3 +#: ../cli/src/connections.c:64 +msgid "DEFAULT" +msgstr "PREDEFINIDO" + +#. 4 +#: ../cli/src/connections.c:65 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:66 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBXECTO" + +#. 6 +#: ../cli/src/connections.c:67 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:77 ../cli/src/devices.c:62 ../cli/src/devices.c:90 +msgid "TYPE" +msgstr "TIPO" + +#. 3 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP" +msgstr "MARCADETEMPO" + +#. 4 +#: ../cli/src/connections.c:80 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:81 +msgid "AUTOCONNECT" +msgstr "AUTOCONECTAR" + +#. 6 +#: ../cli/src/connections.c:82 +msgid "READONLY" +msgstr "SO-LECTURA" -#: ../cli/src/connections.c:86 +#: ../cli/src/connections.c:158 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -30,319 +100,535 @@ msgid "" "]\n" " down id | uuid \n" msgstr "" +"Uso: nmcli con { ORDE | help }\n" +" ORDE := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--" +"timeout ]\n" +" down id | uuid \n" -#: ../cli/src/connections.c:158 -msgid "Connections" -msgstr "" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/devices.c:298 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "Type" -msgstr "" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "UUID" -msgstr "" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Name" -msgstr "" +#: ../cli/src/connections.c:198 ../cli/src/connections.c:537 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Erro: 'con list': %s" + +#: ../cli/src/connections.c:200 ../cli/src/connections.c:539 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Erro: 'con list': %s; campos permitidos: %s" + +#: ../cli/src/connections.c:208 +msgid "Connection details" +msgstr "Detalles da conexión" + +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 +msgid "system" +msgstr "sistema" + +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 +msgid "user" +msgstr "usuario" + +#: ../cli/src/connections.c:384 +msgid "never" +msgstr "nunca" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:551 ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 +msgid "yes" +msgstr "si" + +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:510 ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 ../cli/src/settings.c:1224 +msgid "no" +msgstr "non" -#: ../cli/src/connections.c:163 -#, fuzzy, c-format -#| msgid "Modify system connections" -msgid "System connections:\n" -msgstr "Modificar as conexións do sistema" +#: ../cli/src/connections.c:458 ../cli/src/connections.c:501 +msgid "System connections" +msgstr "Conexións do sistema" -#: ../cli/src/connections.c:167 -#, fuzzy, c-format -#| msgid "Modify system connections" -msgid "User connections:\n" -msgstr "Modificar as conexións do sistema" +#: ../cli/src/connections.c:463 ../cli/src/connections.c:514 +msgid "User connections" +msgstr "Conexións do usuario" -#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 -#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 -#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 -#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 -#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 +#: ../cli/src/connections.c:475 ../cli/src/connections.c:1335 +#: ../cli/src/connections.c:1351 ../cli/src/connections.c:1360 +#: ../cli/src/connections.c:1371 ../cli/src/connections.c:1456 +#: ../cli/src/devices.c:962 ../cli/src/devices.c:972 ../cli/src/devices.c:1074 +#: ../cli/src/devices.c:1081 #, c-format msgid "Error: %s argument is missing." -msgstr "" +msgstr "Erro: falta o argumento %s" -#: ../cli/src/connections.c:189 +#: ../cli/src/connections.c:488 #, c-format msgid "Error: %s - no such connection." -msgstr "" - -#: ../cli/src/connections.c:196 -#, fuzzy -#| msgid "Modify system connections" -msgid "System-wide connections" -msgstr "Modificar as conexións do sistema" +msgstr "Erro: %s - non existe dita conexión." -#: ../cli/src/connections.c:205 -#, fuzzy -#| msgid "Modify system connections" -msgid "User connections" -msgstr "Modificar as conexións do sistema" - -#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 -#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 -#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 -#: ../cli/src/devices.c:798 +#: ../cli/src/connections.c:520 ../cli/src/connections.c:1384 +#: ../cli/src/connections.c:1474 ../cli/src/devices.c:785 +#: ../cli/src/devices.c:852 ../cli/src/devices.c:986 ../cli/src/devices.c:1087 #, c-format msgid "Unknown parameter: %s\n" -msgstr "" +msgstr "Parámetros descoñecidos: %s\n" -#: ../cli/src/connections.c:221 +#: ../cli/src/connections.c:529 #, c-format msgid "Error: no valid parameter specified." -msgstr "" - -#. FIXME: Fix the output -#: ../cli/src/connections.c:268 ../cli/src/devices.c:302 -#: ../cli/src/devices.c:321 ../cli/src/devices.c:353 ../cli/src/devices.c:355 -#: ../cli/src/devices.c:357 ../cli/src/devices.c:359 ../cli/src/devices.c:361 -msgid "yes" -msgstr "" - -#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 -msgid "no" -msgstr "" +msgstr "Erro: non se especificou un parámetro válido" -#: ../cli/src/connections.c:297 -#, fuzzy -#| msgid "Modify system connections" -msgid "Active connections" -msgstr "Modificar as conexións do sistema" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 -msgid "Default" -msgstr "" +#: ../cli/src/connections.c:544 ../cli/src/connections.c:1577 +#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "Erro: %s." -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Service" -msgstr "" +#: ../cli/src/connections.c:650 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Erro: «con status»: %s" -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Devices" -msgstr "" +#: ../cli/src/connections.c:652 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Erro: «con status»: %s; campos permitidos: %s" #: ../cli/src/connections.c:659 +msgid "Active connections" +msgstr "Conexións activas" + +#: ../cli/src/connections.c:1027 #, c-format msgid "no active connection on device '%s'" -msgstr "" +msgstr "non hai conexións activas no dispositivo «%s»" -#: ../cli/src/connections.c:667 +#: ../cli/src/connections.c:1035 #, c-format msgid "no active connection or device" -msgstr "" +msgstr "non hai conexións activas ou dispositivo" + +#: ../cli/src/connections.c:1085 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "o dispositivo «%s» non é compatíbel coa conexión «%s»" + +#: ../cli/src/connections.c:1087 +#, c-format +msgid "no device found for connection '%s'" +msgstr "non foi posíbel encontrar un dispositivo para a conexión «%s»" -#: ../cli/src/connections.c:730 +#: ../cli/src/connections.c:1098 msgid "activating" -msgstr "" +msgstr "activando" -#: ../cli/src/connections.c:732 +#: ../cli/src/connections.c:1100 msgid "activated" -msgstr "" +msgstr "activada" -#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 -#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 -#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 +#: ../cli/src/connections.c:1103 ../cli/src/connections.c:1126 +#: ../cli/src/connections.c:1159 ../cli/src/devices.c:246 +#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:473 msgid "unknown" -msgstr "" +msgstr "descoñecido" -#: ../cli/src/connections.c:744 +#: ../cli/src/connections.c:1112 msgid "VPN connecting (prepare)" -msgstr "" +msgstr "Conectándose á VPN (preparando)" -#: ../cli/src/connections.c:746 +#: ../cli/src/connections.c:1114 msgid "VPN connecting (need authentication)" -msgstr "" +msgstr "Conexión VPN (requírese autenticación)" -#: ../cli/src/connections.c:748 +#: ../cli/src/connections.c:1116 msgid "VPN connecting" -msgstr "" +msgstr "Conexión VPN" -#: ../cli/src/connections.c:750 +#: ../cli/src/connections.c:1118 msgid "VPN connecting (getting IP configuration)" -msgstr "" +msgstr "Conectándose á VPN (obtendo a configuración de IP)" -#: ../cli/src/connections.c:752 +#: ../cli/src/connections.c:1120 msgid "VPN connected" -msgstr "" +msgstr "Conectado á VPN" -#: ../cli/src/connections.c:754 +#: ../cli/src/connections.c:1122 msgid "VPN connection failed" -msgstr "" +msgstr "Produciuse un fallo ao conectarse á VPN" -#: ../cli/src/connections.c:756 +#: ../cli/src/connections.c:1124 msgid "VPN disconnected" -msgstr "" +msgstr "Desconectado á VPN" -#: ../cli/src/connections.c:767 +#: ../cli/src/connections.c:1135 msgid "unknown reason" -msgstr "" +msgstr "razón descoñecida" -#: ../cli/src/connections.c:769 +#: ../cli/src/connections.c:1137 msgid "none" -msgstr "" +msgstr "ninguna" -#: ../cli/src/connections.c:771 +#: ../cli/src/connections.c:1139 msgid "the user was disconnected" -msgstr "" +msgstr "o usuario desconectouse" -#: ../cli/src/connections.c:773 +#: ../cli/src/connections.c:1141 msgid "the base network connection was interrupted" -msgstr "" +msgstr "a conexión de rede base foi interrompida" -#: ../cli/src/connections.c:775 +#: ../cli/src/connections.c:1143 msgid "the VPN service stopped unexpectedly" -msgstr "" +msgstr "o servizo de VPN deteuse de forma inesperada" -#: ../cli/src/connections.c:777 +#: ../cli/src/connections.c:1145 msgid "the VPN service returned invalid configuration" -msgstr "" +msgstr "o servizo de VPN devolveu unha configuración non válida" -#: ../cli/src/connections.c:779 +#: ../cli/src/connections.c:1147 msgid "the connection attempt timed out" -msgstr "" +msgstr "o intento de conexión superou o tempo de espera máximo" -#: ../cli/src/connections.c:781 +#: ../cli/src/connections.c:1149 msgid "the VPN service did not start in time" -msgstr "" +msgstr "o servizo de VPN non se iniciou a tempo" -#: ../cli/src/connections.c:783 +#: ../cli/src/connections.c:1151 msgid "the VPN service failed to start" -msgstr "" +msgstr "o servizo de VPN fallou ao iniciarse" -#: ../cli/src/connections.c:785 +#: ../cli/src/connections.c:1153 msgid "no valid VPN secrets" -msgstr "" +msgstr "non hai segredos VPN válidos" -#: ../cli/src/connections.c:787 +#: ../cli/src/connections.c:1155 msgid "invalid VPN secrets" -msgstr "" +msgstr "segredos VPN non válidos" -#: ../cli/src/connections.c:789 +#: ../cli/src/connections.c:1157 msgid "the connection was removed" -msgstr "" +msgstr "eliminouse a conexión" -#: ../cli/src/connections.c:803 +#: ../cli/src/connections.c:1171 #, c-format msgid "state: %s\n" -msgstr "" +msgstr "estado: %s\n" -#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#: ../cli/src/connections.c:1174 ../cli/src/connections.c:1200 #, c-format msgid "Connection activated\n" -msgstr "" +msgstr "Conexión activada\n" -#: ../cli/src/connections.c:809 +#: ../cli/src/connections.c:1177 #, c-format msgid "Error: Connection activation failed." -msgstr "" +msgstr "Erro: A activación da conexión fallou." -#: ../cli/src/connections.c:828 +#: ../cli/src/connections.c:1196 #, c-format msgid "state: %s (%d)\n" -msgstr "" +msgstr "estado: %s (%d)\n" -#: ../cli/src/connections.c:838 +#: ../cli/src/connections.c:1206 #, c-format msgid "Error: Connection activation failed: %s." -msgstr "" +msgstr "Erro: A activación da conexión fallou: %s." -#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#: ../cli/src/connections.c:1223 ../cli/src/devices.c:909 #, c-format msgid "Error: Timeout %d sec expired." -msgstr "" +msgstr "Erro: Alcanzouse o tempo de espera de %d segundos." -#: ../cli/src/connections.c:898 +#: ../cli/src/connections.c:1266 #, c-format msgid "Error: Connection activation failed: %s" -msgstr "" +msgstr "Erro: Produciuse un fallo ao activar a conexión: %s" -#: ../cli/src/connections.c:912 +#: ../cli/src/connections.c:1280 #, c-format msgid "Error: Obtaining active connection for '%s' failed." -msgstr "" +msgstr "Erro: Produciuse un fallo ao obter a conexión activa para «%s»." -#: ../cli/src/connections.c:921 +#: ../cli/src/connections.c:1289 #, c-format msgid "Active connection state: %s\n" -msgstr "" +msgstr "Estado da conexión activa: %s\n" -#: ../cli/src/connections.c:922 +#: ../cli/src/connections.c:1290 #, c-format msgid "Active connection path: %s\n" -msgstr "" +msgstr "Camiño da conexión activa: %s\n" -#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#: ../cli/src/connections.c:1344 ../cli/src/connections.c:1465 #, c-format msgid "Error: Unknown connection: %s." -msgstr "" +msgstr "Erro: Conexión descoñecida: %s." -#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#: ../cli/src/connections.c:1379 ../cli/src/devices.c:980 #, c-format msgid "Error: timeout value '%s' is not valid." -msgstr "" +msgstr "Erro: O valor do tempo de espera máximo «%s» non é válido." -#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:1392 ../cli/src/connections.c:1482 #, c-format msgid "Error: id or uuid has to be specified." -msgstr "" +msgstr "Erro: debe especificar o id ou o uuid." -#: ../cli/src/connections.c:1044 +#: ../cli/src/connections.c:1412 #, c-format msgid "Error: No suitable device found: %s." -msgstr "" +msgstr "Erro: Non se encontrou un dispositivo axeitado: %s." -#: ../cli/src/connections.c:1046 +#: ../cli/src/connections.c:1414 #, c-format msgid "Error: No suitable device found." -msgstr "" +msgstr "Erro: Non se encontrou o dispositivo axeitado." -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1509 #, c-format msgid "Warning: Connection not active\n" -msgstr "" +msgstr "Aviso: A conexión non está activa.\n" -#: ../cli/src/connections.c:1189 +#: ../cli/src/connections.c:1566 #, c-format msgid "Error: 'con' command '%s' is not valid." -msgstr "" +msgstr "Erro: «con» a orde «%s» non é válida" -#: ../cli/src/connections.c:1216 +#: ../cli/src/connections.c:1602 #, c-format msgid "Error: could not connect to D-Bus." -msgstr "" +msgstr "Erro: non é posíbel conectarse a D-Bus." -#: ../cli/src/connections.c:1223 +#: ../cli/src/connections.c:1609 #, c-format msgid "Error: Could not get system settings." -msgstr "" +msgstr "Erro: Non é posíbel obter as opcións do sistema." -#: ../cli/src/connections.c:1231 +#: ../cli/src/connections.c:1617 #, c-format msgid "Error: Could not get user settings." -msgstr "" +msgstr "Erro: Non é posíbel obter as opcións do usuario." -#: ../cli/src/connections.c:1241 +#: ../cli/src/connections.c:1627 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "" +"Erro: Non é posíbel obter as conexións: os servizos de opcións non están " +"executándose." + +#. 0 +#. 9 +#: ../cli/src/devices.c:61 ../cli/src/devices.c:89 ../cli/src/devices.c:184 +msgid "DEVICE" +msgstr "DISPOSITIVO" +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:63 ../cli/src/devices.c:93 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "ESTADO" + +#: ../cli/src/devices.c:72 +msgid "GENERAL" +msgstr "XERAL" + +#. 0 #: ../cli/src/devices.c:73 +msgid "CAPABILITIES" +msgstr "CAPACIDADES" + +#. 1 +#: ../cli/src/devices.c:74 +msgid "WIFI-PROPERTIES" +msgstr "PROPIEDADES-WIFI" + +#. 2 +#: ../cli/src/devices.c:75 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:76 +msgid "WIRED-PROPERTIES" +msgstr "PROPIEDADES-CONCABLES" + +#. 4 +#: ../cli/src/devices.c:77 +msgid "IP4-SETTINGS" +msgstr "CONFIGURACIONS-IP4" + +#. 5 +#: ../cli/src/devices.c:78 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 6 +#: ../cli/src/devices.c:79 +msgid "IP6-SETTINGS" +msgstr "IP4-CONFIGURACIONS" + +#. 7 +#: ../cli/src/devices.c:80 +msgid "IP6-DNS" +msgstr "IP6-DNS" + +#. 2 +#: ../cli/src/devices.c:91 +msgid "DRIVER" +msgstr "CONTROLADOR" + +#. 3 +#: ../cli/src/devices.c:92 +msgid "HWADDR" +msgstr "ENDEREZO-HARDWARE" + +#. 0 +#: ../cli/src/devices.c:102 +msgid "CARRIER-DETECT" +msgstr "DETECTAR-CARRIERV" + +#. 1 +#: ../cli/src/devices.c:103 +msgid "SPEED" +msgstr "VELOCIDADE" + +#. 0 +#: ../cli/src/devices.c:112 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:122 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:123 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:124 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:125 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:126 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:135 ../cli/src/devices.c:146 +msgid "ADDRESS" +msgstr "ENDEREZO" + +#. 1 +#: ../cli/src/devices.c:136 ../cli/src/devices.c:147 +msgid "PREFIX" +msgstr "PREFIXO" + +#. 2 +#: ../cli/src/devices.c:137 ../cli/src/devices.c:148 +msgid "GATEWAY" +msgstr "PASARELA" + +#. 0 +#: ../cli/src/devices.c:157 ../cli/src/devices.c:166 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:175 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:176 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:177 +msgid "MODE" +msgstr "MODO" + +#. 3 +#: ../cli/src/devices.c:178 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:179 +msgid "RATE" +msgstr "TAXA" + +#. 5 +#: ../cli/src/devices.c:180 +msgid "SIGNAL" +msgstr "SINAL" + +#. 6 +#: ../cli/src/devices.c:181 +msgid "SECURITY" +msgstr "SEGURIDADE" + +#. 7 +#: ../cli/src/devices.c:182 +msgid "WPA-FLAGS" +msgstr "OPCIONS-WPA" + +#. 8 +#: ../cli/src/devices.c:183 +msgid "RSN-FLAGS" +msgstr "OPCIONS-RSN" + +#. 10 +#: ../cli/src/devices.c:185 +msgid "ACTIVE" +msgstr "ACTIVA" + +#: ../cli/src/devices.c:208 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -352,340 +638,247 @@ msgid "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" msgstr "" +"Uso: nmcli dev { ORDE | help }\n" +"\n" +" ORDE := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" -#: ../cli/src/devices.c:93 +#: ../cli/src/devices.c:228 msgid "unmanaged" -msgstr "" +msgstr "non xestionada" -#: ../cli/src/devices.c:95 +#: ../cli/src/devices.c:230 msgid "unavailable" -msgstr "" +msgstr "non dispoñíbel" -#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:89 msgid "disconnected" -msgstr "" +msgstr "desconectado" -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:234 msgid "connecting (prepare)" -msgstr "" +msgstr "conectando (preparando)" -#: ../cli/src/devices.c:101 +#: ../cli/src/devices.c:236 msgid "connecting (configuring)" -msgstr "" +msgstr "conectando (configurando)" -#: ../cli/src/devices.c:103 +#: ../cli/src/devices.c:238 msgid "connecting (need authentication)" -msgstr "" +msgstr "conectando (precisa autenticación)" -#: ../cli/src/devices.c:105 +#: ../cli/src/devices.c:240 msgid "connecting (getting IP configuration)" -msgstr "" +msgstr "conectando (obtendo a configuración IP)" -#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:87 msgid "connected" -msgstr "" +msgstr "conectado" -#: ../cli/src/devices.c:109 +#: ../cli/src/devices.c:244 msgid "connection failed" -msgstr "" +msgstr "produciuse un fallo na conexión" -#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +#: ../cli/src/devices.c:267 ../cli/src/devices.c:424 msgid "Unknown" -msgstr "" +msgstr "Descoñecido" -#. print them -#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 -#: ../cli/src/devices.c:879 +#: ../cli/src/devices.c:299 msgid "(none)" -msgstr "" +msgstr "(ningún)" -#: ../cli/src/devices.c:209 +#: ../cli/src/devices.c:324 #, c-format msgid "%s: error converting IP4 address 0x%X" -msgstr "" +msgstr "%s: produciuse un erro ao converter o enderezo IP4 0x%X" -#: ../cli/src/devices.c:238 +#: ../cli/src/devices.c:393 #, c-format -msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" -msgstr "" - -#: ../cli/src/devices.c:239 -msgid "Ad-Hoc" -msgstr "" - -#: ../cli/src/devices.c:248 -msgid ", Encrypted: " -msgstr "" - -#: ../cli/src/devices.c:253 -msgid " WEP" -msgstr "" - -#: ../cli/src/devices.c:255 -msgid " WPA" -msgstr "" - -#: ../cli/src/devices.c:257 -msgid " WPA2" -msgstr "" +msgid "%u MHz" +msgstr "%u MHz" -#: ../cli/src/devices.c:260 -msgid " Enterprise" -msgstr "" +#: ../cli/src/devices.c:394 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" -#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "Device" -msgstr "" +#: ../cli/src/devices.c:403 +msgid "Encrypted: " +msgstr "Cifrado: " -#: ../cli/src/devices.c:299 -msgid "Driver" -msgstr "" +#: ../cli/src/devices.c:408 +msgid "WEP " +msgstr "WEP " -#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 -msgid "(unknown)" -msgstr "" +#: ../cli/src/devices.c:410 +msgid "WPA " +msgstr "WPA " -#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "State" -msgstr "" +#: ../cli/src/devices.c:412 +msgid "WPA2 " +msgstr "WPA2 " -#: ../cli/src/devices.c:313 -msgid "HW Address" -msgstr "" +#: ../cli/src/devices.c:415 +msgid "Enterprise " +msgstr "Empresa " -#: ../cli/src/devices.c:319 -#, c-format -msgid "" -"\n" -" Capabilities:\n" -msgstr "" +#: ../cli/src/devices.c:424 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" -#: ../cli/src/devices.c:321 -msgid "Carrier Detect" -msgstr "" +#: ../cli/src/devices.c:424 +msgid "Infrastructure" +msgstr "Infraestrutura" -#: ../cli/src/devices.c:336 +#: ../cli/src/devices.c:486 #, c-format -msgid "%u Mb/s" -msgstr "" +msgid "Error: 'dev list': %s" +msgstr "Erro: «dev list»: %s" -#: ../cli/src/devices.c:337 -msgid "Speed" -msgstr "" - -#: ../cli/src/devices.c:348 +#: ../cli/src/devices.c:488 #, c-format -msgid "" -"\n" -" Wireless Properties\n" -msgstr "" - -#: ../cli/src/devices.c:353 -msgid "WEP Encryption" -msgstr "" - -#: ../cli/src/devices.c:355 -msgid "WPA Encryption" -msgstr "" - -#: ../cli/src/devices.c:357 -msgid "WPA2 Encryption" -msgstr "" - -#: ../cli/src/devices.c:359 -msgid "TKIP cipher" -msgstr "" +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Erro: «dev list»: %s campos permitidos: %s" -#: ../cli/src/devices.c:361 -msgid "CCMP cipher" -msgstr "" +#: ../cli/src/devices.c:497 +msgid "Device details" +msgstr "Detalles do dispositivo" -#: ../cli/src/devices.c:368 -#, c-format -msgid "" -"\n" -" Wireless Access Points %s\n" -msgstr "" +#: ../cli/src/devices.c:527 ../cli/src/devices.c:925 +msgid "(unknown)" +msgstr "(descoñecido)" -#: ../cli/src/devices.c:368 -msgid "(* = current AP)" -msgstr "" +#: ../cli/src/devices.c:528 +msgid "unknown)" +msgstr "descoñecido)" -#: ../cli/src/devices.c:374 +#: ../cli/src/devices.c:554 #, c-format -msgid "" -"\n" -" Wired Properties\n" -msgstr "" - -#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 -msgid "Carrier" -msgstr "" +msgid "%u Mb/s" +msgstr "%u Mb/s" -#: ../cli/src/devices.c:377 +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:627 msgid "on" -msgstr "" +msgstr "activado" -#: ../cli/src/devices.c:379 +#: ../cli/src/devices.c:627 msgid "off" -msgstr "" +msgstr "desactivado" -#: ../cli/src/devices.c:387 +#: ../cli/src/devices.c:808 #, c-format -msgid "" -"\n" -" IPv4 Settings:\n" -msgstr "" +msgid "Error: 'dev status': %s" +msgstr "Erro: «dev status»: %s" -#: ../cli/src/devices.c:395 -msgid "Address" -msgstr "" - -#: ../cli/src/devices.c:401 -msgid "Prefix" -msgstr "" - -#: ../cli/src/devices.c:405 -msgid "Gateway" -msgstr "" - -#: ../cli/src/devices.c:416 -msgid "DNS" -msgstr "" +#: ../cli/src/devices.c:810 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Erro: «dev status»: %s campos permitidos: %s" -#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:817 msgid "Status of devices" -msgstr "" +msgstr "Estado dos dispositivos" -#: ../cli/src/devices.c:487 +#: ../cli/src/devices.c:845 #, c-format msgid "Error: '%s' argument is missing." -msgstr "" +msgstr "Erro: falta o argumento «%s»." -#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#: ../cli/src/devices.c:874 ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: Device '%s' not found." -msgstr "" +msgstr "Erro: Non é posíbel encontrar o dispositivo %s." -#: ../cli/src/devices.c:539 +#: ../cli/src/devices.c:897 #, c-format msgid "Success: Device '%s' successfully disconnected." -msgstr "" +msgstr "Éxito: O dispositivo «%s» desconectouse correctamente." -#: ../cli/src/devices.c:564 +#: ../cli/src/devices.c:922 #, c-format msgid "Error: Device '%s' (%s) disconnecting failed: %s" -msgstr "" +msgstr "Erro: Fallou a desconexión do dispositivo «%s» (%s): %s" -#: ../cli/src/devices.c:572 +#: ../cli/src/devices.c:930 #, c-format msgid "Device state: %d (%s)\n" -msgstr "" +msgstr "Estado do dispositivo: %d (%s)\n" -#: ../cli/src/devices.c:636 +#: ../cli/src/devices.c:994 #, c-format msgid "Error: iface has to be specified." -msgstr "" +msgstr "Erro: non se especificou a interface." -#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 -msgid "WiFi scan list" -msgstr "" - -#: ../cli/src/devices.c:740 +#: ../cli/src/devices.c:1112 #, c-format -msgid "Error: Device '%s' is not a WiFi device." -msgstr "" +msgid "Error: 'dev wifi': %s" +msgstr "Erro: «dev wifi»: %s" -#: ../cli/src/devices.c:754 -msgid "Device:" -msgstr "" - -#: ../cli/src/devices.c:806 +#: ../cli/src/devices.c:1114 #, c-format -msgid "Error: hwaddr has to be specified." -msgstr "" +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Erro: «dev wiki»: %s; campos permitidos: %s" -#: ../cli/src/devices.c:844 +#: ../cli/src/devices.c:1121 +msgid "WiFi scan list" +msgstr "Lista de escaneo WiFi" + +#: ../cli/src/devices.c:1156 ../cli/src/devices.c:1210 #, c-format msgid "Error: Access point with hwaddr '%s' not found." -msgstr "" +msgstr "Erro: Non se encontrou o punto de acces co enderezo hardware «%s»." -#: ../cli/src/devices.c:862 +#: ../cli/src/devices.c:1173 #, c-format -msgid "%u MHz" -msgstr "" +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Erro: O dispositivo «%s» non é un dispositivo WiFi." -#: ../cli/src/devices.c:863 +#: ../cli/src/devices.c:1237 #, c-format -msgid "%u MB/s" -msgstr "" - -#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 -msgid "AP parameters" -msgstr "" - -#: ../cli/src/devices.c:873 -msgid "SSID:" -msgstr "" - -#: ../cli/src/devices.c:874 -msgid "BSSID:" -msgstr "" - -#: ../cli/src/devices.c:875 -msgid "Frequency:" -msgstr "" - -#: ../cli/src/devices.c:876 -msgid "Mode:" -msgstr "" - -#: ../cli/src/devices.c:876 -msgid "Ad-hoc" -msgstr "" - -#: ../cli/src/devices.c:876 -msgid "Infrastructure" -msgstr "" - -#: ../cli/src/devices.c:877 -msgid "Maximal bitrate:" -msgstr "" - -#: ../cli/src/devices.c:878 -msgid "Strength:" -msgstr "" +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Erro: «dev wifi» a orde «%s» non é válida." -#: ../cli/src/devices.c:879 -msgid "Flags:" -msgstr "" +#: ../cli/src/devices.c:1284 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Erro: «dev» a orde «%s» non é válida." -#: ../cli/src/devices.c:879 -msgid "privacy" -msgstr "" +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "EXECUTANDO" -#: ../cli/src/devices.c:880 -msgid "WPA flags:" -msgstr "" +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" -#: ../cli/src/devices.c:881 -msgid "RSN flags:" -msgstr "" +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" -#: ../cli/src/devices.c:907 -#, c-format -msgid "Error: 'dev wifi' command '%s' is not valid." -msgstr "" +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" -#: ../cli/src/devices.c:943 -#, c-format -msgid "Error: 'dev' command '%s' is not valid." -msgstr "" +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" -#: ../cli/src/network-manager.c:46 +#: ../cli/src/network-manager.c:62 #, c-format msgid "" "Usage: nmcli nm { COMMAND | help }\n" @@ -699,90 +892,102 @@ msgid "" " wwan [on|off]\n" "\n" msgstr "" +"Usage: nmcli nm { ORDE | help }\n" +"\n" +" ORDE := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" -#: ../cli/src/network-manager.c:67 +#: ../cli/src/network-manager.c:83 msgid "asleep" -msgstr "" +msgstr "dormido" -#: ../cli/src/network-manager.c:69 +#: ../cli/src/network-manager.c:85 msgid "connecting" -msgstr "" +msgstr "conectando" -#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 -#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 -#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 -msgid "enabled" -msgstr "" +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Erro:«'nm status»: %s" -#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 -#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 -#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 -msgid "disabled" -msgstr "" +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Erro: 'nm status': %s; campos permitidos: %s" -#: ../cli/src/network-manager.c:102 +#: ../cli/src/network-manager.c:134 msgid "NetworkManager status" -msgstr "" +msgstr "Estado de NetworkManager" -#: ../cli/src/network-manager.c:104 -msgid "NM running:" -msgstr "" +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "activado" -#: ../cli/src/network-manager.c:104 +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "desactivado" + +#: ../cli/src/network-manager.c:148 msgid "running" -msgstr "" +msgstr "en execución" -#: ../cli/src/network-manager.c:104 +#: ../cli/src/network-manager.c:148 msgid "not running" -msgstr "" - -#: ../cli/src/network-manager.c:105 -msgid "NM state:" -msgstr "" - -#: ../cli/src/network-manager.c:106 -msgid "NM wireless hardware:" -msgstr "" - -#. no argument, show current state -#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 -msgid "NM wireless:" -msgstr "" +msgstr "non está a executarse" -#: ../cli/src/network-manager.c:108 -msgid "NM WWAN hardware:" -msgstr "" +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Erro: '--fields' valor '%s' non é válido aquí; campos permitidos: %s" -#. no argument, show current state -#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 -msgid "NM WWAN:" -msgstr "" +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi activada" -#: ../cli/src/network-manager.c:150 +#: ../cli/src/network-manager.c:220 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." -msgstr "" +msgstr "Erro: parámetro «wifi» non válido: «%s»." -#: ../cli/src/network-manager.c:167 +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN activada" + +#: ../cli/src/network-manager.c:252 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." -msgstr "" +msgstr "Erro: parámetro «wwan» non válido: «%s»." -#: ../cli/src/network-manager.c:178 +#: ../cli/src/network-manager.c:263 #, c-format msgid "Error: 'nm' command '%s' is not valid." -msgstr "" +msgstr "Erro: «nm» a orde «%s» non é válida." -#: ../cli/src/nmcli.c:65 +#: ../cli/src/nmcli.c:69 #, c-format msgid "" "Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" "\n" "OPTIONS\n" -" -t[erse] terse output\n" -" -p[retty] pretty output\n" -" -v[ersion] show program version\n" -" -h[elp] print this help\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" "\n" "OBJECT\n" " nm NetworkManager status\n" @@ -790,35 +995,182 @@ msgid "" " dev devices managed by NetworkManager\n" "\n" msgstr "" +"Uso: %s [OPCIÓNS] OBXECTO { ORDE | ayuda }\n" +"\n" +"OPCIÓNS\n" +" -t[erse] saída terse \n" +" -p[retty] saída pretty\n" +" -v[ersion] mostrar a versión do programa\n" +" -h[elp] imprimir esta axuda\n" +"\n" +"OBXECTO\n" +" nm estado do NetworkManager\n" +" con conexións do NetworkManager\n" +" dev dispositivos administrados por NetworkManager\n" +"\n" -#: ../cli/src/nmcli.c:106 +#: ../cli/src/nmcli.c:113 #, c-format -msgid "Object '%s' is unknown, try 'nmcli help'." -msgstr "" +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Erro: O obxecto «%s» é descoñecido, tente a executar «nmcli help»." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Erro: A opción «--terse» especifícase en segundo lugar." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Erro: A opción «--terse» é mutuamente exclusiva con «--pretty»." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Erro: A opción «--pretty» especifícase en segundo lugar." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Erro: A opción «--pretty» é mutuamente exclusiva con «--terse»." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Erro: falta o argumento para a opción «%s»." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Erro: «%s» non é un argumento válido para a opción «%s»." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Erro: faltan os campos para «%s»." -#: ../cli/src/nmcli.c:139 +#: ../cli/src/nmcli.c:209 #, c-format msgid "nmcli tool, version %s\n" -msgstr "" +msgstr "ferramenta nmcli, versión %s\n" -#: ../cli/src/nmcli.c:145 +#: ../cli/src/nmcli.c:215 #, c-format -msgid "Option '%s' is unknown, try 'nmcli -help'." -msgstr "" +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Erro: A opción «%s» é descoñecida, tente «nmcli --help»" -#: ../cli/src/nmcli.c:164 +#: ../cli/src/nmcli.c:234 #, c-format msgid "Caught signal %d, shutting down..." -msgstr "" +msgstr "Sinal %d capturada, apagando..." -#: ../cli/src/nmcli.c:189 +#: ../cli/src/nmcli.c:259 #, c-format msgid "Error: Could not connect to NetworkManager." -msgstr "" +msgstr "Erro: non foi posíbel conectarse a NetworkManager" -#: ../cli/src/nmcli.c:205 +#: ../cli/src/nmcli.c:275 msgid "Success" +msgstr "Éxito" + +#: ../cli/src/settings.c:411 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:413 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (frase de paso 104/128-bit)" + +#: ../cli/src/settings.c:416 +#, c-format +msgid "%d (unknown)" +msgstr "%d (descoñecido)" + +#: ../cli/src/settings.c:442 +msgid "0 (unknown)" +msgstr "0 (descoñecido)" + +#: ../cli/src/settings.c:448 +msgid "any, " +msgstr "calquera, " + +#: ../cli/src/settings.c:450 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:454 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:456 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:468 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:470 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:554 ../cli/src/settings.c:721 +msgid "auto" +msgstr "automático" + +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 +msgid "not set" +msgstr "non definido" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "o campo «%s» ten que estar só" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "campo «%s» non válido" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "A opcións «--terse» require que especifique «--fields»" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "" +"Option '--terse' requires specific '--fields' option values , not '%s'" msgstr "" +"A opción «--terse» require que especifique os valores da opción «--fields», " +"non «%s»" #: ../libnm-util/crypto.c:120 #, c-format @@ -853,17 +1205,20 @@ msgstr "Ficheiro PEM malformado: Proc-Type non é a segunda etiqueta." #: ../libnm-util/crypto.c:183 #, c-format msgid "Malformed PEM file: no IV found in DEK-Info tag." -msgstr "Ficheiro PEM malformado: non se atopou ningún IV na etiqueta DEK-Info" +msgstr "" +"Ficheiro PEM malformado: non se atopou ningún IV na etiqueta DEK-Info" #: ../libnm-util/crypto.c:190 #, c-format msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." -msgstr "Ficheiro PEM malformado: formato de IV incorrecto na etiqueta DEK-Info" +msgstr "" +"Ficheiro PEM malformado: formato de IV incorrecto na etiqueta DEK-Info" #: ../libnm-util/crypto.c:203 #, c-format msgid "Malformed PEM file: unknown private key cipher '%s'." -msgstr "Ficheiro PEM malformado: o cifrado da chave privada «%s» é descoñecido" +msgstr "" +"Ficheiro PEM malformado: o cifrado da chave privada «%s» é descoñecido" #: ../libnm-util/crypto.c:222 #, c-format @@ -950,15 +1305,15 @@ msgstr "Non hai memoria abondo para o búfer da chave descifrada." #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." msgstr "" -"Produciuse un erro ao inicializar o contexto de cifrado para o descifrado: %" -"s / %s." +"Produciuse un erro ao inicializar o contexto de cifrado para o descifrado: " +"%s / %s." #: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." msgstr "" -"Produciuse un erro ao establecer a chave simétrica para o descifrado: %s / %" -"s." +"Produciuse un erro ao establecer a chave simétrica para o descifrado: %s / " +"%s." #: ../libnm-util/crypto_gnutls.c:191 #, c-format @@ -1057,7 +1412,8 @@ msgstr "Produciuse un erro ao iniciar a rañura de cifrado para o descifrado" #: ../libnm-util/crypto_nss.c:206 #, c-format msgid "Failed to set symmetric key for decryption." -msgstr "Produciuse un erro ao establecer a chave simétrica para o descifrado." +msgstr "" +"Produciuse un erro ao establecer a chave simétrica para o descifrado." #: ../libnm-util/crypto_nss.c:216 #, c-format @@ -1145,32 +1501,132 @@ msgstr "Non foi posíbel verficar o ficheiro PKCS#12: %d" msgid "Could not generate random data." msgstr "Non foi posíbel xerar datos aleatorios." -#: ../libnm-util/nm-utils.c:1924 +#: ../libnm-util/nm-utils.c:1975 #, c-format msgid "Not enough memory to make encryption key." msgstr "Sen memoria abondo para crear a chave de cifrado." -#: ../libnm-util/nm-utils.c:2034 +#: ../libnm-util/nm-utils.c:2085 msgid "Could not allocate memory for PEM file creation." msgstr "Non foi posíbel asignar memoria para a creación do ficheiro PEM," -#: ../libnm-util/nm-utils.c:2046 +#: ../libnm-util/nm-utils.c:2097 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "Non foi posíbel asignar memoria para escribir IV no ficheiro PEM." -#: ../libnm-util/nm-utils.c:2058 +#: ../libnm-util/nm-utils.c:2109 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "" "Non foi posíbel asignar memoria para escribir a chave cifrada no ficheiro " "PEM." -#: ../libnm-util/nm-utils.c:2077 +#: ../libnm-util/nm-utils.c:2128 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "Non foi posíbel asignar memoria para os datos do ficheiro PEM." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Conexión compartida a través dunha rede WiFi protexida" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Conexión compartida a través dunha rede WiFi aberta" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Modificar o nome persistente do anfitrión do sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Modificar as conexións do sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "" +"A política do sistema impide a modificación da configuración do sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "" +"A política do sistema impide a modificación do nome do anfitrión do sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "" +"System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"A política do sistema impide compartir conexións a través dunha rede WiFi " +"protexida" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"A política do sistema impide compartir conexións a través dunha rede WiFi " +"aberta" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "Permitir o control das conexións de rede" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "Permitir o uso de conexións específicas do usuario" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "Activar ou desactivar os dispositivos WiFi" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "Activar ou desactivar os dispositivos de banda ancha móbiles" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "Activar ou desactivar a rede do sistema" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 +msgid "" +"Put NetworkManager to sleep or wake it up (should only be used by system " +"power management)" +msgstr "" +"Poñer o NetworkManager en suspensión e espertalo (só debe ser usado polo " +"sistema de xestión de rede)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +msgid "System policy prevents control of network connections" +msgstr "A normativa do sistema evita o control das conexións de rede" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "" +"A normativa do sistema evita a activación e desactivación dos dispositivos " +"WiFi" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "" +"A normativa do sistema evita a activación ou desactivación dos dispositivos " +"de banda ancha." + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +msgid "System policy prevents enabling or disabling system networking" +msgstr "" +"A normativa do sistema evita a activación ou desactivación da rede do sistema" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "" +"System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "" +"A normativa do sistema evita poñer o NetworkManager en suspensión ou " +"espertalo" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +msgid "System policy prevents use of user-specific connections" +msgstr "" +"A normativa do sistema evita o uso de conexións específicas do usuario" + #: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 #: ../src/nm-netlink-monitor.c:653 #, c-format @@ -1188,10 +1644,11 @@ msgstr "" "non é posíbel conectar ao netlink para monitorizar o estado da lingazón: %s" #: ../src/nm-netlink-monitor.c:265 -#, fuzzy, c-format -#| msgid "unable to allocate netlink handle: %s" +#, c-format msgid "unable to enable netlink handle credential passing: %s" -msgstr "non é posíbel asignar un manexador para a ligazon de rede: %s" +msgstr "" +"non é posíbel activar a ligazón de rede para xestionar o paso de " +"creadenciais: %s" #: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 #, c-format @@ -1217,22 +1674,21 @@ msgstr "non é posíbel unir ao grupo da ligazón de rede: %s" msgid "error updating link cache: %s" msgstr "produciuse un erro ao actualizar a caché de ligazóns: %s" -#: ../src/main.c:502 +#: ../src/main.c:498 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "Opción incorrecta. Use --help para ver a lista de opcións válidas.\n" -#: ../src/main.c:562 -#, fuzzy, c-format -#| msgid "Invalid option. Please use --help to see a list of valid options.\n" +#: ../src/main.c:569 +#, c-format msgid "%s. Please use --help to see a list of valid options.\n" -msgstr "Opción incorrecta. Use --help para ver a lista de opcións válidas.\n" +msgstr "%s. Use --help para ver a lista das opcións válidas.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:328 msgid "# Created by NetworkManager\n" msgstr "# Creado por NetworkManager\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:344 #, c-format msgid "" "# Merged from %s\n" @@ -1241,38 +1697,38 @@ msgstr "" "# Fusionado desde %s\n" "\n" -#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 msgid "no usable DHCP client could be found." -msgstr "" +msgstr "non se encontrou un cliente de DHCP usábel." -#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 msgid "'dhclient' could be found." -msgstr "" +msgstr "Non foi posíbel encontrar «dhclient»." -#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 msgid "'dhcpcd' could be found." -msgstr "" +msgstr "Non foi posíbel encontrar «dhcpcd»." -#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 #, c-format msgid "unsupported DHCP client '%s'" -msgstr "" +msgstr "cliente DHCP «%s» non compatíbel" #: ../src/logging/nm-logging.c:146 #, c-format msgid "Unknown log level '%s'" -msgstr "" +msgstr "Nivel de rexistro «%s» descoñecido" #: ../src/logging/nm-logging.c:171 #, c-format msgid "Unknown log domain '%s'" -msgstr "" +msgstr "Dominio de rexistro «%s» descoñecido" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/named-manager/nm-named-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "NOTE: o importador libc non permite máis de 3 nomes de servidores." -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/named-manager/nm-named-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "Os nomes de servidores listados a seguir poden non ser recoñecidos" @@ -1281,53 +1737,15 @@ msgstr "Os nomes de servidores listados a seguir poden non ser recoñecidos" msgid "Auto %s" msgstr "Auto %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3254 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3412 msgid "System" msgstr "Sistema" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 -msgid "Connection sharing via a protected WiFi network" -msgstr "Conexión compartida a través dunha rede WiFi protexida" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 -msgid "Connection sharing via an open WiFi network" -msgstr "Conexión compartida a través dunha rede WiFi aberta" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 -msgid "Modify persistent system hostname" -msgstr "Modificar o nome persistente do anfitrión do sistema" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 -msgid "Modify system connections" -msgstr "Modificar as conexións do sistema" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 -msgid "System policy prevents modification of system settings" -msgstr "" -"A política do sistema impide a modificación da configuración do sistema" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 -msgid "System policy prevents modification of the persistent system hostname" -msgstr "" -"A política do sistema impide a modificación do nome do anfitrión do sistema" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 -msgid "System policy prevents sharing connections via a protected WiFi network" -msgstr "" -"A política do sistema impide compartir conexións a través dunha rede WiFi " -"protexida" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 -msgid "System policy prevents sharing connections via an open WiFi network" -msgstr "" -"A política do sistema impide compartir conexións a través dunha rede WiFi " -"aberta" - +#, c-format #~ msgid "unable to join netlink group for monitoring link status: %s" #~ msgstr "" -#~ "non é posíbel unir ao grupo netlink para monitorizar o estado da ligazón: " -#~ "%s" +#~ "non é posíbel unir ao grupo netlink para monitorizar o estado da ligazón: %s" -#~| msgid "unable to connect to netlink for monitoring link status: %s" +#, c-format #~ msgid "unable to connect to netlink: %s" #~ msgstr "non é posíbel conectar coa ligazón de rede: %s" -- cgit v1.2.1 From 3f2d741b0dfb79d3b45d6faeb4b6e9b3169d76bb Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 24 Aug 2010 12:04:42 -0500 Subject: trivial: gitignore update --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2fee0804a2..033eaada1e 100644 --- a/.gitignore +++ b/.gitignore @@ -99,6 +99,7 @@ system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils system-settings/plugins/ifcfg-rh/tests/network-scripts/Test_Write_* system-settings/plugins/ifcfg-rh/tests/network-scripts/*-Test_Write_* +system-settings/plugins/ifupdown/tests/test-ifupdown m4/gtk-doc.m4 m4/intltool.m4 -- cgit v1.2.1 From 38f3e5ca61cf8f66385ee45a442ff41a01f3885a Mon Sep 17 00:00:00 2001 From: Mu Qiao Date: Tue, 24 Aug 2010 12:09:30 -0500 Subject: ifnet: add Gentoo system settings plugin --- configure.ac | 2 + po/POTFILES.in | 1 + system-settings/plugins/Makefile.am | 4 + system-settings/plugins/ifnet/Makefile.am | 61 + system-settings/plugins/ifnet/connection_parser.c | 2997 ++++++++++++++++++++ system-settings/plugins/ifnet/connection_parser.h | 43 + system-settings/plugins/ifnet/net_parser.c | 635 +++++ system-settings/plugins/ifnet/net_parser.h | 46 + system-settings/plugins/ifnet/net_utils.c | 931 ++++++ system-settings/plugins/ifnet/net_utils.h | 80 + .../plugins/ifnet/nm-ifnet-connection.c | 251 ++ .../plugins/ifnet/nm-ifnet-connection.h | 49 + system-settings/plugins/ifnet/plugin.c | 585 ++++ system-settings/plugins/ifnet/plugin.h | 47 + system-settings/plugins/ifnet/tests/Makefile.am | 14 + system-settings/plugins/ifnet/tests/hostname | 2 + system-settings/plugins/ifnet/tests/net | 147 + system-settings/plugins/ifnet/tests/net.all | 864 ++++++ .../plugins/ifnet/tests/nm-system-settings.conf | 5 + system-settings/plugins/ifnet/tests/test_all.c | 379 +++ .../plugins/ifnet/tests/wpa_supplicant.conf | 876 ++++++ system-settings/plugins/ifnet/wpa_parser.c | 558 ++++ system-settings/plugins/ifnet/wpa_parser.h | 40 + 23 files changed, 8617 insertions(+) create mode 100644 system-settings/plugins/ifnet/Makefile.am create mode 100644 system-settings/plugins/ifnet/connection_parser.c create mode 100644 system-settings/plugins/ifnet/connection_parser.h create mode 100644 system-settings/plugins/ifnet/net_parser.c create mode 100644 system-settings/plugins/ifnet/net_parser.h create mode 100644 system-settings/plugins/ifnet/net_utils.c create mode 100644 system-settings/plugins/ifnet/net_utils.h create mode 100644 system-settings/plugins/ifnet/nm-ifnet-connection.c create mode 100644 system-settings/plugins/ifnet/nm-ifnet-connection.h create mode 100644 system-settings/plugins/ifnet/plugin.c create mode 100644 system-settings/plugins/ifnet/plugin.h create mode 100644 system-settings/plugins/ifnet/tests/Makefile.am create mode 100644 system-settings/plugins/ifnet/tests/hostname create mode 100644 system-settings/plugins/ifnet/tests/net create mode 100644 system-settings/plugins/ifnet/tests/net.all create mode 100644 system-settings/plugins/ifnet/tests/nm-system-settings.conf create mode 100644 system-settings/plugins/ifnet/tests/test_all.c create mode 100644 system-settings/plugins/ifnet/tests/wpa_supplicant.conf create mode 100644 system-settings/plugins/ifnet/wpa_parser.c create mode 100644 system-settings/plugins/ifnet/wpa_parser.h diff --git a/configure.ac b/configure.ac index 70b829c79f..5b1fbd64ba 100644 --- a/configure.ac +++ b/configure.ac @@ -512,6 +512,8 @@ system-settings/Makefile system-settings/plugins/Makefile system-settings/plugins/ifupdown/Makefile system-settings/plugins/ifupdown/tests/Makefile +system-settings/plugins/ifnet/Makefile +system-settings/plugins/ifnet/tests/Makefile system-settings/plugins/ifcfg-rh/Makefile system-settings/plugins/ifcfg-rh/tests/Makefile system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile diff --git a/po/POTFILES.in b/po/POTFILES.in index 22e8cf3822..db1fbdfecf 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -21,4 +21,5 @@ src/logging/nm-logging.c src/named-manager/nm-named-manager.c src/system-settings/nm-default-wired-connection.c system-settings/plugins/ifcfg-rh/reader.c +system-settings/plugins/ifnet/connection_parser.c diff --git a/system-settings/plugins/Makefile.am b/system-settings/plugins/Makefile.am index 94f75600d1..5df57d5ea7 100644 --- a/system-settings/plugins/Makefile.am +++ b/system-settings/plugins/Makefile.am @@ -15,3 +15,7 @@ endif if TARGET_DEBIAN SUBDIRS+=ifupdown endif + +if TARGET_GENTOO +SUBDIRS+=ifnet +endif diff --git a/system-settings/plugins/ifnet/Makefile.am b/system-settings/plugins/ifnet/Makefile.am new file mode 100644 index 0000000000..f63f8ca710 --- /dev/null +++ b/system-settings/plugins/ifnet/Makefile.am @@ -0,0 +1,61 @@ +SUBDIRS = . tests +INCLUDES = \ + -I$(top_srcdir)/src/system-settings \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-glib \ + -I$(top_srcdir)/libnm-util + +pkglib_LTLIBRARIES = libnm-settings-plugin-ifnet.la + +noinst_LTLIBRARIES = lib-ifnet-io.la + +libnm_settings_plugin_ifnet_la_SOURCES = \ + nm-ifnet-connection.c \ + nm-ifnet-connection.h \ + plugin.c \ + plugin.h + +libnm_settings_plugin_ifnet_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(GMODULE_CFLAGS) \ + $(DBUS_CFLAGS) \ + $(GUDEV_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DSYSCONFDIR=\"$(sysconfdir)\"\ + -g + + +libnm_settings_plugin_ifnet_la_LDFLAGS = -module -avoid-version +libnm_settings_plugin_ifnet_la_LIBADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + lib-ifnet-io.la\ + $(GLIB_LIBS) \ + $(GMODULE_LIBS) \ + $(GUDEV_LIBS) \ + $(GIO_LIBS) + +lib_ifnet_io_la_SOURCES = \ + net_parser.c\ + net_parser.h\ + connection_parser.c \ + connection_parser.h \ + net_utils.h\ + net_utils.c\ + wpa_parser.h\ + wpa_parser.c + +lib_ifnet_io_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DSBINDIR=\"$(sbindir)\"\ + -g + +lib_ifnet_io_la_LIBADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(GLIB_LIBS)\ + $(GIO_LIBS) + + diff --git a/system-settings/plugins/ifnet/connection_parser.c b/system-settings/plugins/ifnet/connection_parser.c new file mode 100644 index 0000000000..f9fae51f35 --- /dev/null +++ b/system-settings/plugins/ifnet/connection_parser.c @@ -0,0 +1,2997 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Mu Qiao + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 1999-2010 Gentoo Foundation, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "net_utils.h" +#include "wpa_parser.h" +#include "connection_parser.h" +#include "nm-ifnet-connection.h" + +static const char * +get_prefix (void) +{ + return _("System"); +} + +static void +update_connection_id (NMConnection * connection, gchar * conn_name) +{ + gchar *idstr = NULL; + gchar *uuid_base = NULL; + gchar *uuid = NULL; + NMSettingConnection *setting; + + idstr = g_strdup_printf ("%s (%s)", get_prefix (), conn_name); + uuid_base = idstr; + uuid = nm_utils_uuid_generate_from_string (uuid_base); + setting = + (NMSettingConnection *) nm_connection_get_setting (connection, + NM_TYPE_SETTING_CONNECTION); + g_object_set (setting, NM_SETTING_CONNECTION_ID, idstr, + NM_SETTING_CONNECTION_UUID, uuid, NULL); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "update_connection_setting_from_config_block: name:%s, id:%s, uuid: %s", + conn_name, idstr, uuid); + + g_free (uuid); + g_free (idstr); +} + +static gboolean +eap_simple_reader (const char *eap_method, + gchar * ssid, + NMSetting8021x * s_8021x, gboolean phase2, GError ** error); +static gboolean eap_tls_reader (const char *eap_method, + gchar * ssid, + NMSetting8021x * s_8021x, + gboolean phase2, GError ** error); + +static gboolean eap_peap_reader (const char *eap_method, + gchar * ssid, + NMSetting8021x * s_8021x, + gboolean phase2, GError ** error); + +static gboolean eap_ttls_reader (const char *eap_method, + gchar * ssid, + NMSetting8021x * s_8021x, + gboolean phase2, GError ** error); + +typedef struct { + const char *method; + gboolean (*reader) (const char *eap_method, gchar * ssid, + NMSetting8021x * s_8021x, + gboolean phase2, GError ** error); + gboolean wifi_phase2_only; +} EAPReader; + +static EAPReader eap_readers[] = { + {"md5", eap_simple_reader, TRUE}, + {"pap", eap_simple_reader, TRUE}, + {"chap", eap_simple_reader, TRUE}, + {"mschap", eap_simple_reader, TRUE}, + {"mschapv2", eap_simple_reader, TRUE}, + {"leap", eap_simple_reader, TRUE}, + {"tls", eap_tls_reader, FALSE}, + {"peap", eap_peap_reader, FALSE}, + {"ttls", eap_ttls_reader, FALSE}, + {NULL, NULL} +}; + +/* reading identity and password */ +static gboolean +eap_simple_reader (const char *eap_method, + gchar * ssid, + NMSetting8021x * s_8021x, gboolean phase2, GError ** error) +{ + char *value; + + /* identity */ + value = wpa_get_value (ssid, "identity"); + if (!value) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing IEEE_8021X_IDENTITY for EAP method '%s'.", + eap_method); + return FALSE; + } + g_object_set (s_8021x, NM_SETTING_802_1X_IDENTITY, value, NULL); + + /* password */ + value = wpa_get_value (ssid, "password"); + if (!value) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing IEEE_8021X_PASSWORD for EAP method '%s'.", + eap_method); + return FALSE; + } + + g_object_set (s_8021x, NM_SETTING_802_1X_PASSWORD, value, NULL); + + return TRUE; +} + +static gboolean +eap_tls_reader (const char *eap_method, + gchar * ssid, + NMSetting8021x * s_8021x, gboolean phase2, GError ** error) +{ + char *value; + char *ca_cert = NULL; + char *client_cert = NULL; + char *privkey = NULL; + char *privkey_password = NULL; + gboolean success = FALSE; + NMSetting8021xCKFormat privkey_format = + NM_SETTING_802_1X_CK_FORMAT_UNKNOWN; + + /* identity */ + value = wpa_get_value (ssid, "identity"); + if (!value) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing IEEE_8021X_IDENTITY for EAP method '%s'.", + eap_method); + return FALSE; + } + g_object_set (s_8021x, NM_SETTING_802_1X_IDENTITY, value, NULL); + + /* ca cert */ + ca_cert = wpa_get_value (ssid, phase2 ? "ca_cert2" : "ca_cert"); + if (ca_cert) { + if (phase2) { + if (!nm_setting_802_1x_set_phase2_ca_cert (s_8021x, + ca_cert, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, error)) + goto done; + } else { + if (!nm_setting_802_1x_set_ca_cert (s_8021x, + ca_cert, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, error)) + goto done; + } + } else { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + " warning: missing %s for EAP" + " method '%s'; this is insecure!", + phase2 ? "IEEE_8021X_INNER_CA_CERT" : + "IEEE_8021X_CA_CERT", eap_method); + } + + /* Private key password */ + privkey_password = wpa_get_value (ssid, + phase2 ? "private_key_passwd2" : + "private_key_passwd"); + + if (!privkey_password) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing %s for EAP method '%s'.", + phase2 ? "IEEE_8021X_INNER_PRIVATE_KEY_PASSWORD" : + "IEEE_8021X_PRIVATE_KEY_PASSWORD", eap_method); + goto done; + } + + /* The private key itself */ + privkey = wpa_get_value (ssid, phase2 ? "private_key2" : "private_key"); + if (!privkey) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing %s for EAP method '%s'.", + phase2 ? "IEEE_8021X_INNER_PRIVATE_KEY" : + "IEEE_8021X_PRIVATE_KEY", eap_method); + goto done; + } + + if (phase2) { + if (!nm_setting_802_1x_set_phase2_private_key (s_8021x, + privkey, + privkey_password, + NM_SETTING_802_1X_CK_SCHEME_PATH, + &privkey_format, + error)) + goto done; + } else { + if (!nm_setting_802_1x_set_private_key (s_8021x, + privkey, + privkey_password, + NM_SETTING_802_1X_CK_SCHEME_PATH, + &privkey_format, error)) + goto done; + } + + /* Only set the client certificate if the private key is not PKCS#12 format, + * as NM (due to supplicant restrictions) requires. If the key was PKCS#12, + * then nm_setting_802_1x_set_private_key() already set the client certificate + * to the same value as the private key. + */ + if (privkey_format == NM_SETTING_802_1X_CK_FORMAT_RAW_KEY + || privkey_format == NM_SETTING_802_1X_CK_FORMAT_X509) { + client_cert = wpa_get_value (ssid, + phase2 ? "client_cert2" : + "client_cert"); + if (!client_cert) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing %s for EAP method '%s'.", + phase2 ? "IEEE_8021X_INNER_CLIENT_CERT" : + "IEEE_8021X_CLIENT_CERT", eap_method); + goto done; + } + + if (phase2) { + if (!nm_setting_802_1x_set_phase2_client_cert (s_8021x, + client_cert, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, + error)) + goto done; + } else { + if (!nm_setting_802_1x_set_client_cert (s_8021x, + client_cert, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, error)) + goto done; + } + } + + success = TRUE; + + done: + return success; +} + +static gboolean +eap_peap_reader (const char *eap_method, + gchar * ssid, + NMSetting8021x * s_8021x, gboolean phase2, GError ** error) +{ + char *ca_cert = NULL; + char *inner_auth = NULL; + char *peapver = NULL; + char *lower; + char **list = NULL, **iter; + gboolean success = FALSE; + + ca_cert = wpa_get_value (ssid, "ca_cert"); + if (ca_cert) { + if (!nm_setting_802_1x_set_ca_cert (s_8021x, + ca_cert, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, error)) + goto done; + } else { + PLUGIN_WARN (IFNET_PLUGIN_NAME, " warning: missing " + "IEEE_8021X_CA_CERT for EAP method '%s'; this is" + " insecure!", eap_method); + } + + peapver = wpa_get_value (ssid, "phase1"); + /* peap version, default is automatic */ + if (peapver && strstr (peapver, "peapver")) { + if (strstr (peapver, "peapver=0")) + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE1_PEAPVER, + "0", NULL); + else if (strstr (peapver, "peapver=1")) + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE1_PEAPVER, + "1", NULL); + else { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Unknown IEEE_8021X_PEAP_VERSION value '%s'", + peapver); + goto done; + } + } + + /* peaplabel */ + if (peapver && strstr (peapver, "peaplabel=1")) + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE1_PEAPLABEL, "1", + NULL); + + inner_auth = wpa_get_value (ssid, "phase2"); + if (!inner_auth) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing IEEE_8021X_INNER_AUTH_METHODS."); + goto done; + } + /* Handle options for the inner auth method */ + list = g_strsplit (inner_auth, " ", 0); + for (iter = list; iter && *iter; iter++) { + gchar *pos = NULL; + + if (!strlen (*iter)) + continue; + + if (!(pos = strstr (*iter, "MSCHAPV2")) + || !(pos = strstr (*iter, "MD5")) + || !(pos = strstr (*iter, "GTC"))) { + if (!eap_simple_reader + (pos, ssid, s_8021x, TRUE, error)) + goto done; + } else if (!(pos = strstr (*iter, "TLS"))) { + if (!eap_tls_reader (pos, ssid, s_8021x, TRUE, error)) + goto done; + } else { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Unknown IEEE_8021X_INNER_AUTH_METHOD '%s'.", + *iter); + goto done; + } + + pos = strchr (*iter, '='); + pos++; + lower = g_ascii_strdown (pos, -1); + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTH, lower, + NULL); + g_free (lower); + break; + } + + if (!nm_setting_802_1x_get_phase2_auth (s_8021x)) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "No valid IEEE_8021X_INNER_AUTH_METHODS found."); + goto done; + } + + success = TRUE; + + done: + if (list) + g_strfreev (list); + return success; +} + +static gboolean +eap_ttls_reader (const char *eap_method, + gchar * ssid, + NMSetting8021x * s_8021x, gboolean phase2, GError ** error) +{ + gboolean success = FALSE; + char *anon_ident = NULL; + char *ca_cert = NULL; + char *tmp; + char **list = NULL, **iter; + char *inner_auth = NULL; + + /* ca cert */ + ca_cert = wpa_get_value (ssid, "ca_cert"); + if (ca_cert) { + if (!nm_setting_802_1x_set_ca_cert (s_8021x, + ca_cert, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, error)) + goto done; + } else { + PLUGIN_WARN (IFNET_PLUGIN_NAME, " warning: missing " + "IEEE_8021X_CA_CERT for EAP method '%s'; this is" + " insecure!", eap_method); + } + + /* anonymous indentity for tls */ + anon_ident = wpa_get_value (ssid, "anonymous_identity"); + if (anon_ident && strlen (anon_ident)) + g_object_set (s_8021x, NM_SETTING_802_1X_ANONYMOUS_IDENTITY, + anon_ident, NULL); + + tmp = wpa_get_value (ssid, "phase2"); + if (!tmp) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing IEEE_8021X_INNER_AUTH_METHODS."); + goto done; + } + + /* Handle options for the inner auth method */ + inner_auth = g_ascii_strdown (tmp, -1); + list = g_strsplit (inner_auth, " ", 0); + for (iter = list; iter && *iter; iter++) { + gchar *pos = NULL; + + if (!strlen (*iter)) + continue; + if ((pos = strstr (*iter, "mschapv2")) != NULL + || (pos = strstr (*iter, "mschap")) != NULL + || (pos = strstr (*iter, "pap")) != NULL + || (pos = strstr (*iter, "chap")) != NULL) { + if (!eap_simple_reader + (pos, ssid, s_8021x, TRUE, error)) + goto done; + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTH, + pos, NULL); + } else if ((pos = strstr (*iter, "tls")) != NULL) { + if (!eap_tls_reader (pos, ssid, s_8021x, TRUE, error)) + goto done; + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTHEAP, + "tls", NULL); + } else if ((pos = strstr (*iter, "mschapv2")) != NULL + || (pos = strstr (*iter, "md5")) != NULL) { + if (!eap_simple_reader + (pos, ssid, s_8021x, TRUE, error)) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, "SIMPLE ERROR"); + goto done; + } + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTHEAP, + pos, NULL); + } else { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Unknown IEEE_8021X_INNER_AUTH_METHOD '%s'.", + *iter); + goto done; + } + break; + } + + success = TRUE; + done: + if (list) + g_strfreev (list); + if (inner_auth) + g_free (inner_auth); + return success; +} + +/* type is already decided by net_parser, this function is just used to + * doing tansformation*/ +static const gchar * +guess_connection_type (gchar * conn_name) +{ + const gchar *type = ifnet_get_data (conn_name, "type"); + const gchar *name = conn_name; + const gchar *ret_type = NULL; + + if (name && !strcmp ("ppp", type)) + ret_type = NM_SETTING_PPPOE_SETTING_NAME; + + if (name && !strcmp ("wireless", type)) + ret_type = NM_SETTING_WIRELESS_SETTING_NAME; + + if (!ret_type) + ret_type = NM_SETTING_WIRED_SETTING_NAME; + + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "guessed connection type (%s) = %s", name, ret_type); + return ret_type; +} + +/* Reading mac address for setting connection option. + * Unmanaged device mac address is required by NetworkManager*/ +static gboolean +read_mac_address (gchar * conn_name, GByteArray ** array, GError ** error) +{ + gchar *value = ifnet_get_data (conn_name, "mac"); + struct ether_addr *mac; + + if (!value || !strlen (value)) { + return TRUE; + } + + mac = ether_aton (value); + if (!mac) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "The MAC address '%s' was invalid.", value); + return FALSE; + } + + *array = g_byte_array_sized_new (ETH_ALEN); + g_byte_array_append (*array, (guint8 *) mac->ether_addr_octet, + ETH_ALEN); + return TRUE; +} + +static void +make_wired_connection_setting (NMConnection * connection, gchar * conn_name, + GError ** error) +{ + GByteArray *mac = NULL; + NMSettingWired *s_wired = NULL; + gchar *value = NULL; + + s_wired = NM_SETTING_WIRED (nm_setting_wired_new ()); + + /* mtu_xxx */ + value = ifnet_get_data (conn_name, "mtu"); + if (value) { + long int mtu; + + errno = 0; + mtu = strtol (value, NULL, 10); + if (errno || mtu < 0 || mtu > 65535) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + " warning: invalid MTU '%s' for %s", + value, conn_name); + } else + g_object_set (s_wired, NM_SETTING_WIRED_MTU, + (guint32) mtu, NULL); + } + + if (read_mac_address (conn_name, &mac, error)) { + if (mac) { + g_object_set (s_wired, NM_SETTING_WIRED_MAC_ADDRESS, + mac, NULL); + g_byte_array_free (mac, TRUE); + } + } else { + g_object_unref (s_wired); + s_wired = NULL; + } + if (s_wired) + nm_connection_add_setting (connection, NM_SETTING (s_wired)); +} + +/* add NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, + * NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID in future*/ +static void +make_ip4_setting (NMConnection * connection, gchar * conn_name, GError ** error) +{ + + NMSettingIP4Config *ip4_setting = + NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ()); + gchar *value; + gboolean is_static_block = is_static_ip4 (conn_name); + ip_block *iblock = NULL; + + /* set dhcp options (dhcp_xxx) */ + value = ifnet_get_data (conn_name, "dhcp"); + g_object_set (ip4_setting, NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS, value + && strstr (value, "nodns") ? TRUE : FALSE, + NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES, value + && strstr (value, "nogateway") ? TRUE : FALSE, NULL); + + if (!is_static_block) { + g_object_set (ip4_setting, + NM_SETTING_IP4_CONFIG_METHOD, + NM_SETTING_IP4_CONFIG_METHOD_AUTO, + NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, FALSE, NULL); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Using DHCP for %s", + conn_name); + } else { + iblock = convert_ip4_config_block (conn_name); + if (!iblock) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Ifnet plugin: can't aquire ip configuration for %s", + conn_name); + g_object_unref (ip4_setting); + return; + } + /************** add all ip settings to the connection**********/ + while (iblock) { + ip_block *current_iblock; + NMIP4Address *ip4_addr = nm_ip4_address_new (); + + nm_ip4_address_set_address (ip4_addr, iblock->ip); + nm_ip4_address_set_prefix (ip4_addr, + nm_utils_ip4_netmask_to_prefix + (iblock->netmask)); + /* currently all the IPs has the same gateway */ + nm_ip4_address_set_gateway (ip4_addr, iblock->gateway); + if (iblock->gateway) + g_object_set (ip4_setting, + NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES, + TRUE, NULL); + if (nm_setting_ip4_config_add_address + (ip4_setting, ip4_addr)) { + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "new address: %d", iblock->ip); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "ipv4 addresses count: %d", + nm_setting_ip4_config_get_num_addresses + (ip4_setting)); + } else { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "ignoring duplicate IP4 address"); + } + nm_ip4_address_unref (ip4_addr); + current_iblock = iblock; + iblock = iblock->next; + destroy_ip_block (current_iblock); + + } + g_object_set (ip4_setting, + NM_SETTING_IP4_CONFIG_METHOD, + NM_SETTING_IP4_CONFIG_METHOD_MANUAL, + NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, + !has_default_ip4_route (conn_name), NULL); + } + + /* add dhcp hostname and client id */ + if (!is_static_block) { + gchar *dhcp_hostname, *client_id; + + get_dhcp_hostname_and_client_id (&dhcp_hostname, &client_id); + if (dhcp_hostname) { + g_object_set (ip4_setting, + NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, + dhcp_hostname, NULL); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "DHCP hostname: %s", + dhcp_hostname); + g_free (dhcp_hostname); + } + if (client_id) { + g_object_set (ip4_setting, + NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, + client_id, NULL); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "DHCP client id: %s", + client_id); + g_free (client_id); + } + } + + /* add all IPv4 dns servers, IPv6 servers will be ignored */ + set_ip4_dns_servers (ip4_setting, conn_name); + + /* DNS searches */ + value = (gchar *) ifnet_get_data (conn_name, "dns_search"); + if (value) { + char **searches = NULL; + + strip_string (value, '"'); + + searches = g_strsplit (value, " ", 0); + if (searches) { + char **item; + + for (item = searches; *item; item++) { + if (strlen (*item)) { + if (!nm_setting_ip4_config_add_dns_search (ip4_setting, *item)) + PLUGIN_WARN + (IFNET_PLUGIN_NAME, + " warning: duplicate DNS domain '%s'", + *item); + } + } + g_strfreev (searches); + } + } + + /* static routes */ + iblock = convert_ip4_routes_block (conn_name); + while (iblock) { + ip_block *current_iblock = iblock; + gchar *metric_str; + long int metric; + NMIP4Route *route = nm_ip4_route_new (); + + nm_ip4_route_set_dest (route, iblock->ip); + nm_ip4_route_set_next_hop (route, iblock->gateway); + nm_ip4_route_set_prefix (route, + nm_utils_ip4_netmask_to_prefix + (iblock->netmask)); + if ((metric_str = ifnet_get_data (conn_name, "metric")) != NULL) { + metric = strtol (metric_str, NULL, 10); + nm_ip4_route_set_metric (route, (guint32) metric); + } else { + metric_str = ifnet_get_global_data ("metric"); + if (metric_str) { + metric = strtol (metric_str, NULL, 10); + nm_ip4_route_set_metric (route, + (guint32) metric); + g_free (metric_str); + } + } + + if (!nm_setting_ip4_config_add_route (ip4_setting, route)) + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "warning: duplicate IP4 route"); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "new IP4 route:%d\n", iblock->ip); + + nm_ip4_route_unref (route); + + current_iblock = iblock; + iblock = iblock->next; + destroy_ip_block (current_iblock); + } + + /* Finally add setting to connection */ + nm_connection_add_setting (connection, NM_SETTING (ip4_setting)); +} + +static void +make_ip6_setting (NMConnection * connection, gchar * conn_name, GError ** error) +{ + NMSettingIP6Config *s_ip6 = NULL; + gboolean is_static_block = is_static_ip6 (conn_name); + + // used to disable IPv6 + gboolean ipv6_enabled = FALSE; + gchar *method = NM_SETTING_IP6_CONFIG_METHOD_MANUAL; + gchar *value; + ip6_block *iblock; + gboolean never_default = !has_default_ip6_route (conn_name); + + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + if (!s_ip6) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Could not allocate IP6 setting"); + return; + } + + value = ifnet_get_data (conn_name, "enable_ipv6"); + if (value && is_true (value)) + ipv6_enabled = TRUE; + + //FIXME Handle other methods that NM supports in future + // Currently only Manual and DHCP are supported + if (!ipv6_enabled) { + g_object_set (s_ip6, + NM_SETTING_IP6_CONFIG_METHOD, + NM_SETTING_IP6_CONFIG_METHOD_IGNORE, NULL); + goto done; + } else if (!is_static_block) { + // config_eth* contains "dhcp6" + method = NM_SETTING_IP6_CONFIG_METHOD_AUTO; + never_default = FALSE; + } + // else if (!has_ip6_address(conn_name)) + // doesn't have "dhcp6" && doesn't have any ipv6 address + // method = NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL; + else + // doesn't have "dhcp6" && has at least one ipv6 address + method = NM_SETTING_IP6_CONFIG_METHOD_MANUAL; + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "IPv6 for %s enabled, using %s", + conn_name, method); + + g_object_set (s_ip6, + NM_SETTING_IP6_CONFIG_METHOD, method, + NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS, FALSE, + NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES, FALSE, + NM_SETTING_IP6_CONFIG_NEVER_DEFAULT, never_default, NULL); + + /* Make manual settings */ + if (!strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { + ip6_block *current_iblock; + + iblock = convert_ip6_config_block (conn_name); + if (!iblock) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Ifnet plugin: can't aquire ip6 configuration for %s", + conn_name); + goto error; + } + /* add all IPv6 addresses */ + while (iblock) { + NMIP6Address *ip6_addr = nm_ip6_address_new (); + + nm_ip6_address_set_address (ip6_addr, iblock->ip); + nm_ip6_address_set_prefix (ip6_addr, iblock->prefix); + if (nm_setting_ip6_config_add_address (s_ip6, ip6_addr)) { + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "ipv6 addresses count: %d", + nm_setting_ip6_config_get_num_addresses + (s_ip6)); + } else { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "ignoring duplicate IP4 address"); + } + nm_ip6_address_unref (ip6_addr); + current_iblock = iblock; + iblock = iblock->next; + destroy_ip6_block (current_iblock); + } + + } else if (!strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) { + /* - autoconf or DHCPv6 stuff goes here */ + } + // DNS Servers, set NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS TRUE here + set_ip6_dns_servers (s_ip6, conn_name); + + /* DNS searches ('DOMAIN' key) are read by make_ip4_setting() and included in NMSettingIP4Config */ + + // Add routes + iblock = convert_ip6_routes_block (conn_name); + if (iblock) + g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES, + TRUE, NULL); + /* Add all IPv6 routes */ + while (iblock) { + ip6_block *current_iblock = iblock; + gchar *metric_str; + long int metric = 1; + NMIP6Route *route = nm_ip6_route_new (); + + nm_ip6_route_set_dest (route, iblock->ip); + nm_ip6_route_set_next_hop (route, iblock->next_hop); + nm_ip6_route_set_prefix (route, iblock->prefix); + /* metric is not per routes configuration right now + * global metric is also supported (metric="x") */ + if ((metric_str = ifnet_get_data (conn_name, "metric")) != NULL) { + metric = strtol (metric_str, NULL, 10); + nm_ip6_route_set_metric (route, (guint32) metric); + } else { + metric_str = ifnet_get_global_data ("metric"); + if (metric_str) { + metric = strtol (metric_str, NULL, 10); + nm_ip6_route_set_metric (route, + (guint32) metric); + g_free (metric_str); + } else + nm_ip6_route_set_metric (route, (guint32) 1); + } + + if (!nm_setting_ip6_config_add_route (s_ip6, route)) + PLUGIN_WARN (IFNET_PLUGIN_NAME, + " warning: duplicate IP6 route"); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, " info: new IP6 route"); + nm_ip6_route_unref (route); + + current_iblock = iblock; + iblock = iblock->next; + destroy_ip6_block (current_iblock); + } + + done: + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + return; + + error: + g_object_unref (s_ip6); + PLUGIN_WARN (IFNET_PLUGIN_NAME, " warning: Ignore IPv6 for %s", + conn_name); + return; +} + +static NMSetting * +make_wireless_connection_setting (gchar * conn_name, + NMSetting8021x ** s_8021x, GError ** error) +{ + GByteArray *array, *mac = NULL; + NMSettingWireless *wireless_setting = NULL; + gboolean adhoc = FALSE; + gchar *value; + gchar *type; + + /* PPP over WIFI is not supported */ + g_return_val_if_fail (conn_name != NULL + && strcmp (ifnet_get_data (conn_name, "type"), + "ppp") != 0, NULL); + type = ifnet_get_data (conn_name, "type"); + if (strcmp (type, "ppp") == 0) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "PPP over WIFI is not supported yet"); + return NULL; + } + + wireless_setting = NM_SETTING_WIRELESS (nm_setting_wireless_new ()); + if (read_mac_address (conn_name, &mac, error)) { + if (mac) { + g_object_set (wireless_setting, + NM_SETTING_WIRELESS_MAC_ADDRESS, mac, + NULL); + g_byte_array_free (mac, TRUE); + + } + } else { + g_object_unref (wireless_setting); + return NULL; + } + + /* handle ssid (hex and ascii) */ + if (conn_name) { + gsize ssid_len = 0, value_len = strlen (conn_name); + char *p = conn_name, *tmp; + char buf[33]; + + ssid_len = value_len; + if ((value_len > 2) && (g_str_has_prefix (conn_name, "0x"))) { + /* Hex representation */ + if (value_len % 2) { + g_set_error (error, ifnet_plugin_error_quark (), + 0, + "Invalid SSID '%s' size (looks like hex but length not multiple of 2)", + conn_name); + goto error; + } + // ignore "0x" + p = conn_name + 2; + if (!is_hex (p)) { + g_set_error (error, + ifnet_plugin_error_quark (), + 0, + "Invalid SSID '%s' character (looks like hex SSID but '%c' isn't a hex digit)", + conn_name, *p); + goto error; + + } + tmp = utils_hexstr2bin (conn_name + 2, value_len - 2); + ssid_len = (value_len - 2) / 2; + memcpy (buf, tmp, ssid_len); + g_free (tmp); + p = &buf[0]; + } + + if (ssid_len > 32 || ssid_len == 0) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Invalid SSID '%s' (size %zu not between 1 and 32 inclusive)", + conn_name, ssid_len); + goto error; + } + array = g_byte_array_sized_new (ssid_len); + g_byte_array_append (array, (const guint8 *) p, ssid_len); + g_object_set (wireless_setting, NM_SETTING_WIRELESS_SSID, array, + NULL); + g_byte_array_free (array, TRUE); + } else { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing SSID"); + goto error; + } + + /* mode=0: infrastructure + * mode=1: adhoc */ + value = wpa_get_value (conn_name, "mode"); + if (value) + adhoc = strcmp (value, "1") == 0 ? TRUE : FALSE; + + if (exist_ssid (conn_name)) { + const char *mode = adhoc ? "adhoc" : "infrastructure"; + + g_object_set (wireless_setting, NM_SETTING_WIRELESS_MODE, mode, + NULL); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Using mode: %s", mode); + } + + /* BSSID setting */ + value = wpa_get_value (conn_name, "bssid"); + if (value) { + struct ether_addr *eth; + GByteArray *bssid; + + eth = ether_aton (value); + if (!eth) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Invalid BSSID '%s'", value); + goto error; + } + + bssid = g_byte_array_sized_new (ETH_ALEN); + g_byte_array_append (bssid, eth->ether_addr_octet, ETH_ALEN); + g_object_set (wireless_setting, NM_SETTING_WIRELESS_BSSID, + bssid, NULL); + g_byte_array_free (bssid, TRUE); + + } + + /* mtu_ssid="xx" */ + value = ifnet_get_data (conn_name, "mtu"); + if (value) { + long int mtu; + + errno = 0; + mtu = strtol (value, NULL, 10); + if (errno || mtu < 0 || mtu > 50000) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + " warning: invalid MTU '%s' for %s", + value, conn_name); + } else + g_object_set (wireless_setting, NM_SETTING_WIRELESS_MTU, + (guint32) mtu, NULL); + + } + + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "wireless_setting added for %s", + conn_name); + return NM_SETTING (wireless_setting); + error: + if (wireless_setting) + g_object_unref (wireless_setting); + return NULL; + +} + +static NMSettingWirelessSecurity * +make_leap_setting (gchar * ssid, GError ** error) +{ + NMSettingWirelessSecurity *wsec; + char *value; + + wsec = + NM_SETTING_WIRELESS_SECURITY (nm_setting_wireless_security_new ()); + + value = wpa_get_value (ssid, "key_mgmt"); + if (!value || strcmp (value, "IEEE8021X")) + goto error; /* Not LEAP */ + + value = wpa_get_value (ssid, "eap"); + if (!value || strcasecmp (value, "LEAP")) + goto error; /* Not LEAP */ + + value = wpa_get_value (ssid, "password"); + if (value && strlen (value)) + g_object_set (wsec, NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD, + value, NULL); + + value = wpa_get_value (ssid, "identity"); + if (!value || !strlen (value)) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing LEAP identity"); + goto error; + } + g_object_set (wsec, NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME, value, + NULL); + + g_object_set (wsec, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "ieee8021x", + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "leap", NULL); + + return wsec; + error: + if (wsec) + g_object_unref (wsec); + return NULL; +} + +static gboolean +add_one_wep_key (gchar * ssid, gchar * key, int key_idx, + NMSettingWirelessSecurity * s_wsec, GError ** error) +{ + gchar *value; + gboolean success = FALSE; + + g_return_val_if_fail (ssid != NULL, FALSE); + g_return_val_if_fail (key != NULL, FALSE); + g_return_val_if_fail (key_idx >= 0 && key_idx <= 3, FALSE); + g_return_val_if_fail (s_wsec != NULL, FALSE); + value = wpa_get_value (ssid, key); + if (!value) + return TRUE; + key = NULL; + /* Validate keys */ + if (strlen (value) == 10 || strlen (value) == 26) { + /* Hexadecimal WEP key */ + char *p = value; + + if (!is_hex (p)) { + g_set_error (error, ifnet_plugin_error_quark (), + 0, "Invalid hexadecimal WEP key."); + goto out; + } + key = g_strdup (value); + } else if (value[0] == '"' + && (strlen (value) == 7 || strlen (value) == 15)) { + /* ASCII passphrase */ + char *tmp = g_strdup (value); + char *p = strip_string (tmp, '"'); + + if (!is_ascii (p)) { + g_set_error (error, ifnet_plugin_error_quark (), + 0, "Invalid ASCII WEP passphrase."); + g_free (tmp); + goto out; + + } + + key = utils_bin2hexstr (tmp, strlen (tmp), strlen (tmp) * 2); + g_free (tmp); + } else { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Invalid WEP key length. Key: %s", value); + goto out; + } + + if (key) { + nm_setting_wireless_security_set_wep_key (s_wsec, key_idx, key); + g_free (key); + success = TRUE; + } + + out: + return success; + +} + +static gboolean +add_wep_keys (gchar * ssid, NMSettingWirelessSecurity * s_wsec, GError ** error) +{ + if (!add_one_wep_key (ssid, "wep_key0", 0, s_wsec, error)) + return FALSE; + if (!add_one_wep_key (ssid, "wep_key1", 1, s_wsec, error)) + return FALSE; + if (!add_one_wep_key (ssid, "wep_key2", 2, s_wsec, error)) + return FALSE; + if (!add_one_wep_key (ssid, "wep_key3", 3, s_wsec, error)) + return FALSE; + return TRUE; + +} + +static NMSettingWirelessSecurity * +make_wep_setting (gchar * ssid, GError ** error) +{ + gchar *auth_alg; + int default_key_idx = 0; + gchar *value; + NMSettingWirelessSecurity *s_wireless_sec; + + s_wireless_sec = + NM_SETTING_WIRELESS_SECURITY (nm_setting_wireless_security_new ()); + g_object_set (s_wireless_sec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, + "none", NULL); + + /* default key index */ + value = wpa_get_value (ssid, "wep_tx_keyidx"); + if (value) { + default_key_idx = atoi (value); + if (default_key_idx >= 0 && default_key_idx <= 3) { + g_object_set (s_wireless_sec, + NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX, + default_key_idx, NULL); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "Default key index: %d", default_key_idx); + } else { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Invalid default WEP key '%s'", value); + goto error; + } + } + + if (!add_wep_keys (ssid, s_wireless_sec, error)) + goto error; + + /* If there's a default key, ensure that key exists */ + if ((default_key_idx == 1) + && !nm_setting_wireless_security_get_wep_key (s_wireless_sec, 1)) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Default WEP key index was 2, but no valid KEY2 exists."); + goto error; + } else if ((default_key_idx == 2) + && !nm_setting_wireless_security_get_wep_key (s_wireless_sec, + 2)) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Default WEP key index was 3, but no valid KEY3 exists."); + goto error; + } else if ((default_key_idx == 3) + && !nm_setting_wireless_security_get_wep_key (s_wireless_sec, + 3)) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Default WEP key index was 4, but no valid KEY4 exists."); + goto error; + } + + /* authentication algorithms */ + auth_alg = wpa_get_value (ssid, "auth_alg"); + if (auth_alg) { + if (strcmp (auth_alg, "OPEN") == 0) { + g_object_set (s_wireless_sec, + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, + "open", NULL); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "WEP: Use open system authentication"); + } else if (strcmp (auth_alg, "SHARED") == 0) { + g_object_set (s_wireless_sec, + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, + "shared", NULL); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "WEP: Use shared system authentication"); + } else { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Invalid WEP authentication algorithm '%s'", + auth_alg); + goto error; + } + + } + + if (!nm_setting_wireless_security_get_wep_key (s_wireless_sec, 0) + && !nm_setting_wireless_security_get_wep_key (s_wireless_sec, 1) + && !nm_setting_wireless_security_get_wep_key (s_wireless_sec, 2) + && !nm_setting_wireless_security_get_wep_key (s_wireless_sec, 3) + && !nm_setting_wireless_security_get_wep_tx_keyidx (s_wireless_sec)) { + if (auth_alg && !strcmp (auth_alg, "shared")) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "WEP Shared Key authentication is invalid for " + "unencrypted connections."); + goto error; + } + /* Unencrypted */ + g_object_unref (s_wireless_sec); + s_wireless_sec = NULL; + } + return s_wireless_sec; + + error: + if (s_wireless_sec) + g_object_unref (s_wireless_sec); + return NULL; +} + +static char * +parse_wpa_psk (gchar * psk, GError ** error) +{ + gchar *p, *hashed = NULL; + gboolean quoted = FALSE; + + if (!psk) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing WPA_PSK for WPA-PSK key management"); + return NULL; + } + + /* Passphrase must be between 10 and 66 characters in length becuase WPA + * hex keys are exactly 64 characters (no quoting), and WPA passphrases + * are between 8 and 63 characters (inclusive), plus optional quoting if + * the passphrase contains spaces. + */ + + p = psk; + if (p[0] == '"' && psk[strlen (psk) - 1] == '"') + quoted = TRUE; + if (!quoted && (strlen (psk) == 64)) { + /* Verify the hex PSK; 64 digits */ + if (!is_hex (p)) { + g_set_error (error, ifnet_plugin_error_quark (), + 0, + "Invalid WPA_PSK (contains non-hexadecimal characters)"); + goto out; + } + hashed = g_strdup (psk); + } else { + strip_string (p, '"'); + + /* Length check */ + if (strlen (p) < 8 || strlen (p) > 63) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Invalid WPA_PSK (passphrases must be between " + "8 and 63 characters long (inclusive))"); + goto out; + } + + hashed = g_strdup (p); + } + + if (!hashed) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Invalid WPA_PSK (doesn't look like a passphrase or hex key)"); + goto out; + } + + out: + return hashed; +} + +static gboolean +fill_wpa_ciphers (gchar * ssid, + NMSettingWirelessSecurity * wsec, + gboolean group, gboolean adhoc) +{ + char *value = NULL, *p; + char **list = NULL, **iter; + int i = 0; + + p = value = wpa_get_value (ssid, group ? "group" : "pairwise"); + if (!value) + return TRUE; + + list = g_strsplit_set (p, " ", 0); + for (iter = list; iter && *iter; iter++, i++) { + /* Ad-Hoc configurations cannot have pairwise ciphers, and can only + * have one group cipher. Ignore any additional group ciphers and + * any pairwise ciphers specified. + */ + if (adhoc) { + if (group && (i > 0)) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + " warning: ignoring group cipher '%s' (only one group cipher allowed in Ad-Hoc mode)", + *iter); + continue; + } else if (!group) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + " warning: ignoring pairwise cipher '%s' (pairwise not used in Ad-Hoc mode)", + *iter); + continue; + } + } + + if (!strcmp (*iter, "CCMP")) { + if (group) + nm_setting_wireless_security_add_group (wsec, + "ccmp"); + else + nm_setting_wireless_security_add_pairwise (wsec, + "ccmp"); + } else if (!strcmp (*iter, "TKIP")) { + if (group) + nm_setting_wireless_security_add_group (wsec, + "tkip"); + else + nm_setting_wireless_security_add_pairwise (wsec, + "tkip"); + } else if (group && !strcmp (*iter, "WEP104")) + nm_setting_wireless_security_add_group (wsec, "wep104"); + else if (group && !strcmp (*iter, "WEP40")) + nm_setting_wireless_security_add_group (wsec, "wep40"); + else { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + " warning: ignoring invalid %s cipher '%s'", + group ? "CIPHER_GROUP" : "CIPHER_PAIRWISE", + *iter); + } + } + + if (list) + g_strfreev (list); + return TRUE; +} + +static NMSetting8021x * +fill_8021x (gchar * ssid, gchar * key_mgmt, gboolean wifi, GError ** error) +{ + NMSetting8021x *s_8021x; + char *value; + char **list, **iter; + + value = wpa_get_value (ssid, "eap"); + if (!value) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing IEEE_8021X_EAP_METHODS for key management '%s'", + key_mgmt); + return NULL; + } + + list = g_strsplit (value, " ", 0); + + s_8021x = (NMSetting8021x *) nm_setting_802_1x_new (); + /* Validate and handle each EAP method */ + for (iter = list; iter && *iter; iter++) { + EAPReader *eap = &eap_readers[0]; + gboolean found = FALSE; + char *lower = NULL; + + lower = g_ascii_strdown (*iter, -1); + while (eap->method && !found) { + if (strcmp (eap->method, lower)) + goto next; + + /* Some EAP methods don't provide keying material, thus they + * cannot be used with WiFi unless they are an inner method + * used with TTLS or PEAP or whatever. + */ + if (wifi && eap->wifi_phase2_only) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + " warning: ignored invalid " + "IEEE_8021X_EAP_METHOD '%s'; not allowed for wifi.", + lower); + goto next; + } + + /* Parse EAP method specific options */ + if (!(*eap->reader) + (lower, ssid, s_8021x, FALSE, error)) { + g_free (lower); + goto error; + } + nm_setting_802_1x_add_eap_method (s_8021x, lower); + found = TRUE; + + next: + eap++; + } + + if (!found) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + " warning: ignored unknown" + "IEEE_8021X_EAP_METHOD '%s'.", lower); + } + g_free (lower); + } + g_strfreev (list); + + if (nm_setting_802_1x_get_num_eap_methods (s_8021x) == 0) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "No valid EAP methods found in IEEE_8021X_EAP_METHODS."); + goto error; + } + + return s_8021x; + + error: + g_object_unref (s_8021x); + return NULL; +} + +static NMSettingWirelessSecurity * +make_wpa_setting (gchar * ssid, NMSetting8021x ** s_8021x, GError ** error) +{ + NMSettingWirelessSecurity *wsec; + char *value, *lower; + gboolean adhoc = FALSE; + + if (!exist_ssid (ssid)) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "No security info found for ssid: %s", ssid); + return NULL; + } + + wsec = + NM_SETTING_WIRELESS_SECURITY (nm_setting_wireless_security_new ()); + + /* mode=1: adhoc + * mode=0: infrastructure */ + value = wpa_get_value (ssid, "mode"); + if (value) + adhoc = strcmp (value, "1") == 0 ? TRUE : FALSE; + + value = wpa_get_value (ssid, "key_mgmt"); + /* Not WPA or Dynamic WEP */ + if (!value) + goto error; + if (strcmp (value, "WPA-PSK") && strcmp (value, "WPA-EAP")) + goto error; + /* Pairwise and Group ciphers */ + fill_wpa_ciphers (ssid, wsec, FALSE, adhoc); + fill_wpa_ciphers (ssid, wsec, TRUE, adhoc); + + /* WPA and/or RSN */ + if (adhoc) { + /* Ad-Hoc mode only supports WPA proto for now */ + nm_setting_wireless_security_add_proto (wsec, "wpa"); + } else { + nm_setting_wireless_security_add_proto (wsec, "wpa"); + nm_setting_wireless_security_add_proto (wsec, "rsn"); + + } + + if (!strcmp (value, "WPA-PSK")) { + gchar *psk = parse_wpa_psk (wpa_get_value (ssid, "psk"), error); + + if (!psk) + goto error; + g_object_set (wsec, NM_SETTING_WIRELESS_SECURITY_PSK, psk, + NULL); + g_free (psk); + + if (adhoc) + g_object_set (wsec, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, + "wpa-none", NULL); + else + g_object_set (wsec, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, + "wpa-psk", NULL); + } else if (!strcmp (value, "WPA-EAP") || !strcmp (value, "IEEE8021X")) { + if (adhoc) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Ad-Hoc mode cannot be used with KEY_MGMT type '%s'", + value); + goto error; + } + *s_8021x = fill_8021x (ssid, value, TRUE, error); + if (!*s_8021x) + goto error; + + lower = g_ascii_strdown (value, -1); + g_object_set (wsec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, + lower, NULL); + g_free (lower); + } else { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Unknown wireless KEY_MGMT type '%s'", value); + goto error; + } + return wsec; + error: + if (wsec) + g_object_unref (wsec); + return NULL; +} + +static NMSettingWirelessSecurity * +make_wireless_security_setting (gchar * + conn_name, + NMSetting8021x ** s_8021x, GError ** error) +{ + NMSettingWirelessSecurity *wsec = NULL; + gchar *ssid; + gboolean adhoc = FALSE; + gchar *value; + + g_return_val_if_fail (conn_name != NULL + && strcmp (ifnet_get_data (conn_name, "type"), + "ppp") != 0, NULL); + if (!wpa_get_value (conn_name, "ssid")) + return NULL; + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "updating wireless security settings (%s).", conn_name); + + ssid = conn_name; + value = wpa_get_value (ssid, "mode"); + if (value) + adhoc = strcmp (value, "1") == 0 ? TRUE : FALSE; + + if (!adhoc) { + wsec = make_leap_setting (ssid, error); + if (error && *error) + goto error; + } + if (!wsec) { + wsec = make_wpa_setting (ssid, s_8021x, error); + if (error && *error) + goto error; + } + if (!wsec) { + wsec = make_wep_setting (ssid, error); + if (error && *error) + goto error; + } + + if (!wsec) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Can't handle security information for ssid: %s", + conn_name); + } + + return wsec; + error: + return NULL; +} + +/* Currently only support username and password */ +static void +make_pppoe_connection_setting (NMConnection * connection, + gchar * conn_name, GError ** error) +{ + NMSettingPPPOE *s_pppoe; + NMSettingPPP *s_ppp; + gchar *value; + + s_pppoe = NM_SETTING_PPPOE (nm_setting_pppoe_new ()); + + /* username */ + value = ifnet_get_data (conn_name, "username"); + if (!value) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "ppp requires at lease a username"); + return; + } + g_object_set (s_pppoe, NM_SETTING_PPPOE_USERNAME, value, NULL); + + /* password */ + value = ifnet_get_data (conn_name, "password"); + if (!value) { + value = ""; + } + + g_object_set (s_pppoe, NM_SETTING_PPPOE_PASSWORD, value, NULL); + nm_connection_add_setting (connection, NM_SETTING (s_pppoe)); + + /* PPP setting */ + s_ppp = (NMSettingPPP *) nm_setting_ppp_new (); + nm_connection_add_setting (connection, NM_SETTING (s_ppp)); +} + +NMConnection * +ifnet_update_connection_from_config_block (gchar * conn_name, GError ** error) +{ + const gchar *type = NULL; + NMConnection *connection = NULL; + NMSettingConnection *setting = NULL; + NMSetting8021x *s_8021x = NULL; + NMSettingWirelessSecurity *wsec = NULL; + gboolean auto_conn = TRUE; + gchar *value = NULL; + gboolean success = FALSE; + + connection = nm_connection_new (); + if (!connection) + return NULL; + setting = + (NMSettingConnection *) nm_connection_get_setting (connection, + NM_TYPE_SETTING_CONNECTION); + if (!setting) { + setting = NM_SETTING_CONNECTION (nm_setting_connection_new ()); + g_assert (setting); + nm_connection_add_setting (connection, NM_SETTING (setting)); + } + + type = guess_connection_type (conn_name); + value = ifnet_get_data (conn_name, "auto"); + if (value && !strcmp (value, "false")) + auto_conn = FALSE; + update_connection_id (connection, conn_name); + g_object_set (setting, NM_SETTING_CONNECTION_TYPE, type, + NM_SETTING_CONNECTION_READ_ONLY, FALSE, + NM_SETTING_CONNECTION_AUTOCONNECT, auto_conn, NULL); + + if (!strcmp (NM_SETTING_WIRED_SETTING_NAME, type) + || !strcmp (NM_SETTING_PPPOE_SETTING_NAME, type)) { + /* wired setting */ + make_wired_connection_setting (connection, conn_name, error); + if (error && *error) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Found error: %s", (*error)->message); + goto error; + } + /* pppoe setting */ + if (!strcmp (NM_SETTING_PPPOE_SETTING_NAME, type)) + make_pppoe_connection_setting (connection, conn_name, + error); + if (error && *error) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Found error: %s", (*error)->message); + goto error; + } + } else if (!strcmp (NM_SETTING_WIRELESS_SETTING_NAME, type)) { + /* wireless setting */ + NMSetting *wireless_setting = + make_wireless_connection_setting (conn_name, + &s_8021x, + error); + + if (!wireless_setting) { + goto error; + } + nm_connection_add_setting (connection, wireless_setting); + + if (error && *error) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Found error: %s", (*error)->message); + goto error; + } + + /* wireless security setting */ + wsec = + make_wireless_security_setting (conn_name, &s_8021x, error); + if (wsec) { + nm_connection_add_setting (connection, + NM_SETTING (wsec)); + if (s_8021x) + nm_connection_add_setting (connection, + NM_SETTING + (s_8021x)); + g_object_set (wireless_setting, NM_SETTING_WIRELESS_SEC, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NULL); + } + + if (error && *error) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Found error: %s", (*error)->message); + goto error; + } + + } else + goto error; + + /* IPv4 setting */ + make_ip4_setting (connection, conn_name, error); + if (error && *error) + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Found error: %s", (*error)->message); + + /* IPv6 setting */ + make_ip6_setting (connection, conn_name, error); + if (error && *error) + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Found error: %s", (*error)->message); + + success = nm_connection_verify (connection, error); + if (error && *error) + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Found error: %s", (*error)->message); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Connection verified %s:%d", conn_name, + success); + if (!success) + goto error; + return connection; + error: + g_object_unref (setting); + g_object_unref (connection); + return NULL; +} + +typedef NMSetting8021xCKScheme (*SchemeFunc) (NMSetting8021x * setting); +typedef const char *(*PathFunc) (NMSetting8021x * setting); +typedef const GByteArray *(*BlobFunc) (NMSetting8021x * setting); + +typedef struct ObjectType { + const char *setting_key; + SchemeFunc scheme_func; + PathFunc path_func; + BlobFunc blob_func; + const char *conn_name_key; + const char *suffix; +} ObjectType; + +static const ObjectType ca_type = { + NM_SETTING_802_1X_CA_CERT, + nm_setting_802_1x_get_ca_cert_scheme, + nm_setting_802_1x_get_ca_cert_path, + nm_setting_802_1x_get_ca_cert_blob, + "ca_cert", + "ca-cert.der" +}; + +static const ObjectType phase2_ca_type = { + NM_SETTING_802_1X_PHASE2_CA_CERT, + nm_setting_802_1x_get_phase2_ca_cert_scheme, + nm_setting_802_1x_get_phase2_ca_cert_path, + nm_setting_802_1x_get_phase2_ca_cert_blob, + "ca_cert2", + "inner-ca-cert.der" +}; + +static const ObjectType client_type = { + NM_SETTING_802_1X_CLIENT_CERT, + nm_setting_802_1x_get_client_cert_scheme, + nm_setting_802_1x_get_client_cert_path, + nm_setting_802_1x_get_client_cert_blob, + "client_cert", + "client-cert.der" +}; + +static const ObjectType phase2_client_type = { + NM_SETTING_802_1X_PHASE2_CLIENT_CERT, + nm_setting_802_1x_get_phase2_client_cert_scheme, + nm_setting_802_1x_get_phase2_client_cert_path, + nm_setting_802_1x_get_phase2_client_cert_blob, + "client_cert2", + "inner-client-cert.der" +}; + +static const ObjectType pk_type = { + NM_SETTING_802_1X_PRIVATE_KEY, + nm_setting_802_1x_get_private_key_scheme, + nm_setting_802_1x_get_private_key_path, + nm_setting_802_1x_get_private_key_blob, + "private_key", + "private-key.pem" +}; + +static const ObjectType phase2_pk_type = { + NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, + nm_setting_802_1x_get_phase2_private_key_scheme, + nm_setting_802_1x_get_phase2_private_key_path, + nm_setting_802_1x_get_phase2_private_key_blob, + "private_key2", + "inner-private-key.pem" +}; + +static const ObjectType p12_type = { + NM_SETTING_802_1X_PRIVATE_KEY, + nm_setting_802_1x_get_private_key_scheme, + nm_setting_802_1x_get_private_key_path, + nm_setting_802_1x_get_private_key_blob, + "private_key", + "private-key.p12" +}; + +static const ObjectType phase2_p12_type = { + NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, + nm_setting_802_1x_get_phase2_private_key_scheme, + nm_setting_802_1x_get_phase2_private_key_path, + nm_setting_802_1x_get_phase2_private_key_blob, + "private_key2", + "inner-private-key.p12" +}; + +static gboolean +write_object (NMSetting8021x * s_8021x, + gchar * conn_name, + const GByteArray * override_data, + const ObjectType * objtype, GError ** error) +{ + NMSetting8021xCKScheme scheme; + const char *path = NULL; + const GByteArray *blob = NULL; + + g_return_val_if_fail (conn_name != NULL, FALSE); + g_return_val_if_fail (objtype != NULL, FALSE); + if (override_data) + /* if given explicit data to save, always use that instead of asking + * the setting what to do. + */ + blob = override_data; + else { + scheme = (*(objtype->scheme_func)) (s_8021x); + switch (scheme) { + case NM_SETTING_802_1X_CK_SCHEME_BLOB: + blob = (*(objtype->blob_func)) (s_8021x); + break; + case NM_SETTING_802_1X_CK_SCHEME_PATH: + path = (*(objtype->path_func)) (s_8021x); + break; + default: + break; + } + } + + /* If the object path was specified, prefer that over any raw cert data that + * may have been sent. + */ + if (path) { + wpa_set_data (conn_name, (gchar *) objtype->conn_name_key, + (gchar *) path); + return TRUE; + } + + /* does not support writing encryption data now */ + if (blob) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + " warning: Currently we do not support certs writing."); + } + + return TRUE; +} + +static gboolean +write_8021x_certs (NMSetting8021x * s_8021x, + gboolean phase2, gchar * conn_name, GError ** error) +{ + char *password = NULL; + const ObjectType *otype = NULL; + gboolean is_pkcs12 = FALSE, success = FALSE; + const GByteArray *blob = NULL; + GByteArray *enc_key = NULL; + gchar *generated_pw = NULL; + + /* CA certificate */ + if (phase2) + otype = &phase2_ca_type; + else + otype = &ca_type; + + if (!write_object (s_8021x, conn_name, NULL, otype, error)) + return FALSE; + + /* Private key */ + if (phase2) { + if (nm_setting_802_1x_get_phase2_private_key_scheme (s_8021x) != + NM_SETTING_802_1X_CK_SCHEME_UNKNOWN) { + if (nm_setting_802_1x_get_phase2_private_key_format + (s_8021x) == NM_SETTING_802_1X_CK_FORMAT_PKCS12) + is_pkcs12 = TRUE; + } + password = (char *) + nm_setting_802_1x_get_phase2_private_key_password (s_8021x); + } else { + if (nm_setting_802_1x_get_private_key_scheme (s_8021x) != + NM_SETTING_802_1X_CK_SCHEME_UNKNOWN) { + if (nm_setting_802_1x_get_private_key_format (s_8021x) + == NM_SETTING_802_1X_CK_FORMAT_PKCS12) + is_pkcs12 = TRUE; + } + password = (char *) + nm_setting_802_1x_get_private_key_password (s_8021x); + } + + if (is_pkcs12) + otype = phase2 ? &phase2_p12_type : &p12_type; + else + otype = phase2 ? &phase2_pk_type : &pk_type; + + if ((*(otype->scheme_func)) (s_8021x) == + NM_SETTING_802_1X_CK_SCHEME_BLOB) + blob = (*(otype->blob_func)) (s_8021x); + + /* Only do the private key re-encrypt dance if we got the raw key data, which + * by definition will be unencrypted. If we're given a direct path to the + * private key file, it'll be encrypted, so we don't need to re-encrypt. + */ + if (blob && !is_pkcs12) { + /* Encrypt the unencrypted private key with the fake password */ + enc_key = + nm_utils_rsa_key_encrypt (blob, password, &generated_pw, + error); + if (!enc_key) + goto out; + + if (generated_pw) + password = generated_pw; + } + + /* Save the private key */ + if (!write_object + (s_8021x, conn_name, enc_key ? enc_key : blob, otype, error)) + goto out; + + if (phase2) + wpa_set_data (conn_name, "private_key_passwd2", password); + else + wpa_set_data (conn_name, "private_key_passwd", password); + + /* Client certificate */ + if (is_pkcs12) { + wpa_set_data (conn_name, + phase2 ? "client_cert2" : "client_cert", NULL); + } else { + if (phase2) + otype = &phase2_client_type; + else + otype = &client_type; + + /* Save the client certificate */ + if (!write_object (s_8021x, conn_name, NULL, otype, error)) + goto out; + } + + success = TRUE; + out: + if (generated_pw) { + memset (generated_pw, 0, strlen (generated_pw)); + g_free (generated_pw); + } + if (enc_key) { + memset (enc_key->data, 0, enc_key->len); + g_byte_array_free (enc_key, TRUE); + } + return success; +} + +static gboolean +write_8021x_setting (NMConnection * connection, + gchar * conn_name, gboolean wired, GError ** error) +{ + NMSetting8021x *s_8021x; + const char *value; + char *tmp = NULL; + gboolean success = FALSE; + GString *phase2_auth; + GString *phase1; + + s_8021x = + (NMSetting8021x *) nm_connection_get_setting (connection, + NM_TYPE_SETTING_802_1X); + + if (!s_8021x) { + return TRUE; + } + + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Adding 8021x setting for %s", + conn_name); + + /* If wired, write KEY_MGMT */ + if (wired) + wpa_set_data (conn_name, "key_mgmt", "IEEE8021X"); + + /* EAP method */ + if (nm_setting_802_1x_get_num_eap_methods (s_8021x)) { + value = nm_setting_802_1x_get_eap_method (s_8021x, 0); + if (value) + tmp = g_ascii_strup (value, -1); + } + wpa_set_data (conn_name, "eap", tmp ? tmp : NULL); + g_free (tmp); + + wpa_set_data (conn_name, "identity", + (gchar *) nm_setting_802_1x_get_identity (s_8021x)); + + wpa_set_data (conn_name, "anonymous_identity", (gchar *) + nm_setting_802_1x_get_anonymous_identity (s_8021x)); + + wpa_set_data (conn_name, "password", + (gchar *) nm_setting_802_1x_get_password (s_8021x)); + + phase1 = g_string_new (NULL); + + /* PEAP version */ + wpa_set_data (conn_name, "phase1", NULL); + value = nm_setting_802_1x_get_phase1_peapver (s_8021x); + if (value && (!strcmp (value, "0") || !strcmp (value, "1"))) + g_string_append_printf (phase1, "peapver=%s ", value); + + /* PEAP label */ + value = nm_setting_802_1x_get_phase1_peaplabel (s_8021x); + if (value && !strcmp (value, "1")) + g_string_append_printf (phase1, "peaplabel=%s ", value); + if (phase1->len) { + tmp = g_strstrip (g_strdup (phase1->str)); + wpa_set_data (conn_name, "phase1", tmp); + g_free (tmp); + } + + /* Phase2 auth methods */ + wpa_set_data (conn_name, "phase2", NULL); + phase2_auth = g_string_new (NULL); + + value = nm_setting_802_1x_get_phase2_auth (s_8021x); + if (value) { + tmp = g_ascii_strup (value, -1); + g_string_append_printf (phase2_auth, "auth=%s ", tmp); + g_free (tmp); + } + + /* Phase2 auth heap */ + value = nm_setting_802_1x_get_phase2_autheap (s_8021x); + if (value) { + tmp = g_ascii_strup (value, -1); + g_string_append_printf (phase2_auth, "autheap=%s ", tmp); + g_free (tmp); + } + tmp = g_strstrip (g_strdup (phase2_auth->str)); + wpa_set_data (conn_name, "phase2", phase2_auth->len ? tmp : NULL); + g_free (tmp); + + g_string_free (phase2_auth, TRUE); + g_string_free (phase1, TRUE); + + success = write_8021x_certs (s_8021x, FALSE, conn_name, error); + if (success) { + /* phase2/inner certs */ + success = write_8021x_certs (s_8021x, TRUE, conn_name, error); + } + + return success; +} + +static gboolean +write_wireless_security_setting (NMConnection * connection, + gchar * conn_name, + gboolean adhoc, + gboolean * no_8021x, GError ** error) +{ + NMSettingWirelessSecurity *s_wsec; + const char *key_mgmt, *auth_alg, *key, *cipher, *psk; + gboolean wep = FALSE, wpa = FALSE; + char *tmp; + guint32 i, num; + GString *str; + + s_wsec = + (NMSettingWirelessSecurity *) nm_connection_get_setting (connection, + NM_TYPE_SETTING_WIRELESS_SECURITY); + if (!s_wsec) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing '%s' setting", + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + return FALSE; + } + + key_mgmt = nm_setting_wireless_security_get_key_mgmt (s_wsec); + g_assert (key_mgmt); + + auth_alg = nm_setting_wireless_security_get_auth_alg (s_wsec); + + if (!strcmp (key_mgmt, "none")) { + wpa_set_data (conn_name, "key_mgmt", "NONE"); + wep = TRUE; + *no_8021x = TRUE; + } else if (!strcmp (key_mgmt, "wpa-none") + || !strcmp (key_mgmt, "wpa-psk")) { + wpa_set_data (conn_name, "key_mgmt", "WPA-PSK"); + wpa = TRUE; + *no_8021x = TRUE; + } else if (!strcmp (key_mgmt, "ieee8021x")) { + wpa_set_data (conn_name, "key_mgmt", "IEEE8021X"); + } else if (!strcmp (key_mgmt, "wpa-eap")) { + wpa_set_data (conn_name, "key_mgmt", "WPA-EAP"); + wpa = TRUE; + } + + if (auth_alg) { + if (!strcmp (auth_alg, "shared")) + wpa_set_data (conn_name, "auth_alg", "SHARED"); + else if (!strcmp (auth_alg, "open")) + wpa_set_data (conn_name, "auth_alg", "OPEN"); + else if (!strcmp (auth_alg, "leap")) { + wpa_set_data (conn_name, "auth_alg", "LEAP"); + wpa_set_data (conn_name, "eap", "LEAP"); + wpa_set_data (conn_name, "identity", (gchar *) + nm_setting_wireless_security_get_leap_username + (s_wsec)); + wpa_set_data (conn_name, "password", (gchar *) + nm_setting_wireless_security_get_leap_password + (s_wsec)); + *no_8021x = TRUE; + } + } else + wpa_set_data (conn_name, "auth_alg", NULL); + + /* Default WEP TX key index */ + wpa_set_data (conn_name, "wep_tx_keyidx", NULL); + if (wep) { + tmp = + g_strdup_printf ("%d", + nm_setting_wireless_security_get_wep_tx_keyidx + (s_wsec)); + wpa_set_data (conn_name, "wep_tx_keyidx", tmp); + g_free (tmp); + } + + /* WEP keys */ + for (i = 0; i < 4; i++) { + int length; + + key = nm_setting_wireless_security_get_wep_key (s_wsec, i); + if (!key) + continue; + tmp = g_strdup_printf ("wep_key%d", i); + length = strlen (key); + if (length == 10 || length == 26 || length == 58) + wpa_set_data (conn_name, tmp, (gchar *) key); + else { + gchar *tmp_key = g_strdup_printf ("\"%s\"", key); + + wpa_set_data (conn_name, tmp, tmp_key); + g_free (tmp_key); + } + g_free (tmp); + } + + /* WPA Pairwise ciphers */ + wpa_set_data (conn_name, "pairwise", NULL); + str = g_string_new (NULL); + num = nm_setting_wireless_security_get_num_pairwise (s_wsec); + for (i = 0; i < num; i++) { + if (i > 0) + g_string_append_c (str, ' '); + cipher = nm_setting_wireless_security_get_pairwise (s_wsec, i); + tmp = g_ascii_strup (cipher, -1); + g_string_append (str, tmp); + g_free (tmp); + } + if (strlen (str->str)) + wpa_set_data (conn_name, "pairwise", str->str); + g_string_free (str, TRUE); + + /* WPA Group ciphers */ + wpa_set_data (conn_name, "group", NULL); + str = g_string_new (NULL); + num = nm_setting_wireless_security_get_num_groups (s_wsec); + for (i = 0; i < num; i++) { + if (i > 0) + g_string_append_c (str, ' '); + cipher = nm_setting_wireless_security_get_group (s_wsec, i); + tmp = g_ascii_strup (cipher, -1); + g_string_append (str, tmp); + g_free (tmp); + } + if (strlen (str->str)) + wpa_set_data (conn_name, "group", str->str); + g_string_free (str, TRUE); + + /* WPA Passphrase */ + if (wpa) { + GString *quoted = NULL; + + psk = nm_setting_wireless_security_get_psk (s_wsec); + if (psk && (strlen (psk) != 64)) { + quoted = g_string_sized_new (strlen (psk) + 2); + g_string_append_c (quoted, '"'); + g_string_append (quoted, psk); + g_string_append_c (quoted, '"'); + } + wpa_set_data (conn_name, "psk", + quoted ? quoted->str : (gchar *) psk); + if (quoted) + g_string_free (quoted, TRUE); + } else + wpa_set_data (conn_name, "psk", NULL); + + return TRUE; +} + +/* remove old ssid and add new one*/ +static void +update_wireless_ssid (NMConnection * connection, gchar * conn_name, + gchar * ssid, gboolean hex) +{ + ifnet_delete_network (conn_name); + ifnet_add_connection (ssid, "wireless"); + + wpa_delete_security (conn_name); + wpa_add_security (ssid); +} + +static gboolean +write_wireless_setting (NMConnection * connection, + gchar ** conn_name_ptr, gboolean * no_8021x, + GError ** error) +{ + NMSettingWireless *s_wireless; + const GByteArray *ssid, *mac, *bssid; + const char *mode; + char buf[33]; + guint32 mtu, i; + gboolean adhoc = FALSE, hex_ssid = FALSE; + gchar *ssid_str, *tmp; + gchar *conn_name = *conn_name_ptr; + + s_wireless = + (NMSettingWireless *) nm_connection_get_setting (connection, + NM_TYPE_SETTING_WIRELESS); + if (!s_wireless) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing '%s' setting", + NM_SETTING_WIRELESS_SETTING_NAME); + return FALSE; + } + + ssid = nm_setting_wireless_get_ssid (s_wireless); + if (!ssid) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing SSID in '%s' setting", + NM_SETTING_WIRELESS_SETTING_NAME); + return FALSE; + } + if (!ssid->len || ssid->len > 32) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Invalid SSID in '%s' setting", + NM_SETTING_WIRELESS_SETTING_NAME); + return FALSE; + } + + /* If the SSID contains any non-printable characters, we need to use the + * hex notation of the SSID instead. + */ + for (i = 0; i < ssid->len; i++) { + if (!isprint (ssid->data[i])) { + hex_ssid = TRUE; + break; + } + } + + if (hex_ssid) { + GString *str; + + /* Hex SSIDs don't get quoted */ + str = g_string_sized_new (ssid->len * 2 + 3); + g_string_append (str, "0x"); + for (i = 0; i < ssid->len; i++) + g_string_append_printf (str, "%02X", ssid->data[i]); + update_wireless_ssid (connection, conn_name, str->str, + hex_ssid); + ssid_str = g_strdup (str->str); + g_string_free (str, TRUE); + } else { + /* Printable SSIDs get quoted */ + memset (buf, 0, sizeof (buf)); + memcpy (buf, ssid->data, ssid->len); + g_strstrip (buf); + update_wireless_ssid (connection, conn_name, buf, hex_ssid); + ssid_str = g_strdup (buf); + } + + ifnet_set_data (ssid_str, "mac", NULL); + mac = nm_setting_wireless_get_mac_address (s_wireless); + if (mac) { + tmp = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", + mac->data[0], mac->data[1], mac->data[2], + mac->data[3], mac->data[4], + mac->data[5]); + ifnet_set_data (ssid_str, "mac", tmp); + g_free (tmp); + } + + ifnet_set_data (ssid_str, "mtu", NULL); + mtu = nm_setting_wireless_get_mtu (s_wireless); + if (mtu) { + tmp = g_strdup_printf ("%u", mtu); + ifnet_set_data (ssid_str, "mtu", tmp); + g_free (tmp); + } + + ifnet_set_data (ssid_str, "mode", NULL); + mode = nm_setting_wireless_get_mode (s_wireless); + if (!mode || !strcmp (mode, "infrastructure")) { + wpa_set_data (ssid_str, "mode", "0"); + } else if (!strcmp (mode, "adhoc")) { + wpa_set_data (ssid_str, "mode", "1"); + adhoc = TRUE; + } else { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Invalid mode '%s' in '%s' setting", + mode, NM_SETTING_WIRELESS_SETTING_NAME); + return FALSE; + } + + wpa_set_data (ssid_str, "bssid", NULL); + bssid = nm_setting_wireless_get_bssid (s_wireless); + if (bssid) { + tmp = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", + bssid->data[0], bssid->data[1], + bssid->data[2], bssid->data[3], + bssid->data[4], bssid->data[5]); + wpa_set_data (ssid_str, "bssid", tmp); + g_free (tmp); + } + + if (nm_setting_wireless_get_security (s_wireless)) { + if (!write_wireless_security_setting + (connection, ssid_str, adhoc, no_8021x, error)) + return FALSE; + } else + wpa_delete_security (ssid_str); + *conn_name_ptr = ifnet_get_data (ssid_str, "name"); + g_free (ssid_str); + return TRUE; +} + +static gboolean +write_wired_setting (NMConnection * connection, gchar * conn_name, + GError ** error) +{ + NMSettingWired *s_wired; + const GByteArray *mac; + char *tmp; + guint32 mtu; + + s_wired = + (NMSettingWired *) nm_connection_get_setting (connection, + NM_TYPE_SETTING_WIRED); + if (!s_wired) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing '%s' setting", + NM_SETTING_WIRED_SETTING_NAME); + return FALSE; + } + + ifnet_set_data (conn_name, "mac", NULL); + mac = nm_setting_wired_get_mac_address (s_wired); + if (mac) { + tmp = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", + mac->data[0], mac->data[1], mac->data[2], + mac->data[3], mac->data[4], + mac->data[5]); + ifnet_set_data (conn_name, "mac", tmp); + g_free (tmp); + } + + ifnet_set_data (conn_name, "mtu", NULL); + mtu = nm_setting_wired_get_mtu (s_wired); + if (mtu) { + tmp = g_strdup_printf ("%u", mtu); + ifnet_set_data (conn_name, "mtu", tmp); + g_free (tmp); + } + //FIXME may add connection type in future + //ifnet_set_data (conn_name, "TYPE", TYPE_ETHERNET); + + return TRUE; +} + +static void +write_connection_setting (NMSettingConnection * s_con, gchar * conn_name) +{ + ifnet_set_data (conn_name, "auto", + nm_setting_connection_get_autoconnect (s_con) ? "true" : + "false"); +} + +static gboolean +write_ip4_setting (NMConnection * connection, gchar * conn_name, + GError ** error) +{ + NMSettingIP4Config *s_ip4; + const char *value; + char *tmp; + guint32 i, num; + GString *searches; + GString *ips; + GString *routes; + GString *dns; + gboolean has_def_route = FALSE; + gboolean success = FALSE; + + s_ip4 = + (NMSettingIP4Config *) nm_connection_get_setting (connection, + NM_TYPE_SETTING_IP4_CONFIG); + if (!s_ip4) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing '%s' setting", + NM_SETTING_IP4_CONFIG_SETTING_NAME); + return FALSE; + } + routes = g_string_new (NULL); + + value = nm_setting_ip4_config_get_method (s_ip4); + g_assert (value); + if (!strcmp (value, NM_SETTING_IP4_CONFIG_METHOD_MANUAL)) { + + num = nm_setting_ip4_config_get_num_addresses (s_ip4); + ips = g_string_new (NULL); + /* IPv4 addresses */ + for (i = 0; i < num; i++) { + char buf[INET_ADDRSTRLEN + 1]; + NMIP4Address *addr; + guint32 ip; + + addr = nm_setting_ip4_config_get_address (s_ip4, i); + + memset (buf, 0, sizeof (buf)); + ip = nm_ip4_address_get_address (addr); + inet_ntop (AF_INET, (const void *) &ip, &buf[0], + sizeof (buf)); + g_string_append_printf (ips, "\"%s", &buf[0]); + + tmp = + g_strdup_printf ("%u", + nm_ip4_address_get_prefix (addr)); + g_string_append_printf (ips, "/%s\" ", tmp); + g_free (tmp); + + /* only the first gateway will be written */ + if (!has_def_route && nm_ip4_address_get_gateway (addr)) { + memset (buf, 0, sizeof (buf)); + ip = nm_ip4_address_get_gateway (addr); + inet_ntop (AF_INET, (const void *) &ip, &buf[0], + sizeof (buf)); + g_string_append_printf (routes, + "\"default via %s\" ", + &buf[0]); + has_def_route = TRUE; + } + } + ifnet_set_data (conn_name, "config", ips->str); + g_string_free (ips, TRUE); + } else + ifnet_set_data (conn_name, "config", "dhcp"); + + /* DNS Servers */ + ifnet_set_data (conn_name, "dns_servers", NULL); + num = nm_setting_ip4_config_get_num_dns (s_ip4); + if (num > 0) { + dns = g_string_new (NULL); + for (i = 0; i < num; i++) { + char buf[INET_ADDRSTRLEN + 1]; + guint32 ip; + + ip = nm_setting_ip4_config_get_dns (s_ip4, i); + + memset (buf, 0, sizeof (buf)); + inet_ntop (AF_INET, (const void *) &ip, &buf[0], + sizeof (buf)); + g_string_append_printf (dns, " %s", buf); + } + ifnet_set_data (conn_name, "dns_servers", dns->str); + g_string_free (dns, TRUE); + } else + ifnet_set_data (conn_name, "dns_servers", NULL); + + /* DNS Searches */ + num = nm_setting_ip4_config_get_num_dns_searches (s_ip4); + if (num > 0) { + searches = g_string_new (NULL); + for (i = 0; i < num; i++) { + if (i > 0) + g_string_append_c (searches, ' '); + g_string_append (searches, + nm_setting_ip4_config_get_dns_search + (s_ip4, i)); + } + ifnet_set_data (conn_name, "dns_search", searches->str); + g_string_free (searches, TRUE); + } else + ifnet_set_data (conn_name, "dns_search", NULL); + /* FIXME Will be implemented when configuration supports it + if (!strcmp(value, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) { + value = nm_setting_ip4_config_get_dhcp_hostname(s_ip4); + if (value) + ifnet_set_data(conn_name, "DHCP_HOSTNAME", value, + FALSE); + + value = nm_setting_ip4_config_get_dhcp_client_id(s_ip4); + if (value) + ifnet_set_data(conn_name, "DHCP_CLIENT_ID", value, + FALSE); + } + */ + + /* Static routes */ + num = nm_setting_ip4_config_get_num_routes (s_ip4); + if (num > 0) { + for (i = 0; i < num; i++) { + char buf[INET_ADDRSTRLEN + 1]; + NMIP4Route *route; + guint32 ip; + + route = nm_setting_ip4_config_get_route (s_ip4, i); + + memset (buf, 0, sizeof (buf)); + ip = nm_ip4_route_get_dest (route); + inet_ntop (AF_INET, (const void *) &ip, &buf[0], + sizeof (buf)); + g_string_append_printf (routes, "\"%s", buf); + + tmp = + g_strdup_printf ("%u", + nm_ip4_route_get_prefix (route)); + g_string_append_printf (routes, "/%s via ", tmp); + g_free (tmp); + + memset (buf, 0, sizeof (buf)); + ip = nm_ip4_route_get_next_hop (route); + inet_ntop (AF_INET, (const void *) &ip, &buf[0], + sizeof (buf)); + g_string_append_printf (routes, "%s\" ", buf); + } + } + if (routes->len > 0) + ifnet_set_data (conn_name, "routes", routes->str); + else + ifnet_set_data (conn_name, "routes", NULL); + g_string_free (routes, TRUE); + + success = TRUE; + + return success; +} + +static gboolean +write_route6_file (NMSettingIP6Config * s_ip6, gchar * conn_name, + GError ** error) +{ + char dest[INET6_ADDRSTRLEN + 1]; + char next_hop[INET6_ADDRSTRLEN + 1]; + NMIP6Route *route; + const struct in6_addr *ip; + guint32 prefix; + guint32 i, num; + GString *routes_string; + gchar *old_routes; + + g_return_val_if_fail (s_ip6 != NULL, FALSE); + num = nm_setting_ip6_config_get_num_routes (s_ip6); + if (num == 0) { + return TRUE; + } + + old_routes = ifnet_get_data (conn_name, "routes"); + routes_string = g_string_new (old_routes); + if (old_routes) + g_string_append (routes_string, "\" "); + for (i = 0; i < num; i++) { + route = nm_setting_ip6_config_get_route (s_ip6, i); + + memset (dest, 0, sizeof (dest)); + ip = nm_ip6_route_get_dest (route); + inet_ntop (AF_INET6, (const void *) ip, &dest[0], + sizeof (dest)); + + prefix = nm_ip6_route_get_prefix (route); + + memset (next_hop, 0, sizeof (next_hop)); + ip = nm_ip6_route_get_next_hop (route); + inet_ntop (AF_INET6, (const void *) ip, &next_hop[0], + sizeof (next_hop)); + + g_string_append_printf (routes_string, "\"%s/%u via %s\" ", + dest, prefix, next_hop); + } + if (num > 0) + ifnet_set_data (conn_name, "routes", routes_string->str); + g_string_free (routes_string, TRUE); + + return TRUE; +} + +static gboolean +write_ip6_setting (NMConnection * connection, gchar * conn_name, + GError ** error) +{ + NMSettingIP6Config *s_ip6; + const char *value; + char *prefix; + guint32 i, num; + GString *searches; + char buf[INET6_ADDRSTRLEN + 1]; + NMIP6Address *addr; + const struct in6_addr *ip; + + s_ip6 = + (NMSettingIP6Config *) nm_connection_get_setting (connection, + NM_TYPE_SETTING_IP6_CONFIG); + if (!s_ip6) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing '%s' setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + return FALSE; + } + + value = nm_setting_ip6_config_get_method (s_ip6); + g_assert (value); + if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) { + ifnet_set_data (conn_name, "enable_ipv6", "false"); + return TRUE; + } else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { + /* nothing to do now */ + } else { + // if (!strcmp(value, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) { + gchar *config = ifnet_get_data (conn_name, "config"); + gchar *tmp; + + if (!config) + tmp = g_strdup_printf ("dhcp6"); + else + tmp = g_strdup_printf ("%s\" \"dhcp6\"", config); + ifnet_set_data (conn_name, "config", tmp); + g_free (tmp); + } + /* else if (!strcmp(value, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { + } else if (!strcmp(value, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)) { + } else if (!strcmp(value, NM_SETTING_IP6_CONFIG_METHOD_SHARED)) { + } */ + + /* Remember to set IPv6 enabled */ + ifnet_set_data (conn_name, "enable_ipv6", "true"); + + if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { + gchar *config = ifnet_get_data (conn_name, "config"); + gchar *tmp; + GString *ip_str; + + if (!config) + config = ""; + num = nm_setting_ip6_config_get_num_addresses (s_ip6); + + /* IPv6 addresses */ + ip_str = g_string_new (NULL); + for (i = 0; i < num; i++) { + addr = nm_setting_ip6_config_get_address (s_ip6, i); + ip = nm_ip6_address_get_address (addr); + prefix = + g_strdup_printf ("%u", + nm_ip6_address_get_prefix (addr)); + memset (buf, 0, sizeof (buf)); + inet_ntop (AF_INET6, (const void *) ip, buf, + sizeof (buf)); + g_string_append_printf (ip_str, "\"%s/", buf); + g_string_append_printf (ip_str, "%s\" ", prefix); + g_free (prefix); + } + tmp = g_strdup_printf ("%s\" %s", config, ip_str->str); + ifnet_set_data (conn_name, "config", tmp); + g_free (tmp); + g_string_free (ip_str, TRUE); + } + + /* DNS Servers */ + num = nm_setting_ip6_config_get_num_dns (s_ip6); + if (num > 0) { + gchar *dns_servers = ifnet_get_data (conn_name, "dns_servers"); + gchar *tmp; + GString *dns_string = g_string_new (NULL); + + if (!dns_servers) + dns_servers = ""; + for (i = 0; i < num; i++) { + ip = nm_setting_ip6_config_get_dns (s_ip6, i); + + memset (buf, 0, sizeof (buf)); + inet_ntop (AF_INET6, (const void *) ip, buf, + sizeof (buf)); + if (!strstr (dns_servers, buf)) + g_string_append_printf (dns_string, "%s ", buf); + } + tmp = g_strdup_printf ("%s %s", dns_servers, dns_string->str); + ifnet_set_data (conn_name, "dns_servers", tmp); + g_free (tmp); + g_string_free (dns_string, TRUE); + + } else + /* DNS Searches */ + num = nm_setting_ip6_config_get_num_dns_searches (s_ip6); + if (num > 0) { + char *ip4_domains; + + ip4_domains = ifnet_get_data (conn_name, "dns_search"); + if (!ip4_domains) + ip4_domains = ""; + searches = g_string_new (ip4_domains); + for (i = 0; i < num; i++) { + const gchar *search = NULL; + + search = + nm_setting_ip6_config_get_dns_search (s_ip6, i); + if (search && !strstr (searches->str, search)) { + if (searches->len > 0) + g_string_append_c (searches, ' '); + g_string_append (searches, search); + } + } + ifnet_set_data (conn_name, "dns_search", searches->str); + g_string_free (searches, TRUE); + } + + write_route6_file (s_ip6, conn_name, error); + if (error && *error) + return FALSE; + return TRUE; +} + +static gboolean +write_pppoe_setting (gchar * conn_name, NMSettingPPPOE * s_pppoe) +{ + const gchar *value; + + value = nm_setting_pppoe_get_username (s_pppoe); + if (!value) { + return FALSE; + } + ifnet_set_data (conn_name, "username", (gchar *) value); + + value = nm_setting_pppoe_get_password (s_pppoe); + /* password could be NULL here */ + if (value) { + ifnet_set_data (conn_name, "password", (gchar *) value); + } + return TRUE; +} + +gboolean +ifnet_update_parsers_by_connection (NMConnection * connection, + gchar * conn_name, + gchar ** nm_conn_name, + gchar * config_file, + gchar * wpa_file, GError ** error) +{ + NMSettingConnection *s_con; + NMSettingIP6Config *s_ip6; + gboolean success = FALSE; + const char *type; + gboolean no_8021x = FALSE; + gboolean wired = FALSE, pppoe = TRUE; + + s_con = + NM_SETTING_CONNECTION (nm_connection_get_setting + (connection, NM_TYPE_SETTING_CONNECTION)); + if (!s_con) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing '%s' setting", + NM_SETTING_CONNECTION_SETTING_NAME); + return FALSE; + } + + type = nm_setting_connection_get_connection_type (s_con); + if (!type) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing connection type!"); + goto out; + } + + if (!strcmp (type, NM_SETTING_WIRED_SETTING_NAME)) { + /* Writing wired setting */ + if (!write_wired_setting (connection, conn_name, error)) + goto out; + wired = TRUE; + no_8021x = TRUE; + } else if (!strcmp (type, NM_SETTING_WIRELESS_SETTING_NAME)) { + /* Writing wireless setting */ + if (!write_wireless_setting + (connection, &conn_name, &no_8021x, error)) + goto out; + } else if (!strcmp (type, NM_SETTING_PPPOE_SETTING_NAME)) { + /* Writing pppoe setting */ + if (! + (write_pppoe_setting + (conn_name, + NM_SETTING_PPPOE (nm_connection_get_setting + (connection, NM_TYPE_SETTING_PPPOE))))) + goto out; + pppoe = TRUE; + wired = TRUE; + no_8021x = TRUE; + } else { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Can't write connection type '%s'", type); + goto out; + } + + //FIXME wired connection doesn't support 8021x now + if (!no_8021x) { + if (!write_8021x_setting (connection, conn_name, wired, error)) + goto out; + } + + /* IPv4 Setting */ + if (!write_ip4_setting (connection, conn_name, error)) + goto out; + + s_ip6 = + (NMSettingIP6Config *) nm_connection_get_setting (connection, + NM_TYPE_SETTING_IP6_CONFIG); + if (s_ip6) { + /* IPv6 Setting */ + if (!write_ip6_setting (connection, conn_name, error)) + goto out; + } + + /* Connection Setting */ + write_connection_setting (s_con, conn_name); + + /* connection id will be displayed in nm-applet */ + update_connection_id (connection, conn_name); + + if (nm_conn_name) + *nm_conn_name = g_strdup (conn_name); + success = ifnet_flush_to_file (config_file); + if (success) + wpa_flush_to_file (wpa_file); + + out: + return success; +} + +gboolean +ifnet_delete_connection_in_parsers (gchar * conn_name, + gchar * config_file, gchar * wpa_file) +{ + gboolean result = FALSE; + + ifnet_delete_network (conn_name); + result = ifnet_flush_to_file (config_file); + if (result) { + /* connection may not have security information + * so simply ignore the return value*/ + wpa_delete_security (conn_name); + wpa_flush_to_file (wpa_file); + } + + return result; +} + +/* get the available wired name(eth*). */ +static gchar * +get_wired_name () +{ + int i = 0; + + for (; i < 256; i++) { + gchar *conn_name = g_strdup_printf ("eth%d", i); + + if (!ifnet_has_connection (conn_name)) { + return conn_name; + } else + g_free (conn_name); + } + return NULL; +} + +/* get the available pppoe name(ppp*). */ +static gchar * +get_ppp_name () +{ + int i = 0; + + for (; i < 256; i++) { + gchar *conn_name = g_strdup_printf ("ppp%d", i); + + if (!ifnet_has_connection (conn_name)) { + return conn_name; + } else + g_free (conn_name); + } + return NULL; +} + +/* get wireless ssid */ +static gchar * +get_wireless_name (NMConnection * connection) +{ + NMSettingWireless *s_wireless; + const GByteArray *ssid; + gboolean hex_ssid = FALSE; + gchar *result = NULL; + char buf[33]; + int i = 0; + + s_wireless = + (NMSettingWireless *) nm_connection_get_setting (connection, + NM_TYPE_SETTING_WIRELESS); + if (!s_wireless) + return NULL; + + ssid = nm_setting_wireless_get_ssid (s_wireless); + if (!ssid->len || ssid->len > 32) { + return NULL; + } + + for (i = 0; i < ssid->len; i++) { + if (!isprint (ssid->data[i])) { + hex_ssid = TRUE; + break; + } + } + + if (hex_ssid) { + GString *str; + + str = g_string_sized_new (ssid->len * 2 + 3); + g_string_append (str, "0x"); + for (i = 0; i < ssid->len; i++) + g_string_append_printf (str, "%02X", ssid->data[i]); + result = g_strdup (str->str); + g_string_free (str, TRUE); + } else { + memset (buf, 0, sizeof (buf)); + memcpy (buf, ssid->data, ssid->len); + result = g_strdup_printf ("%s", buf); + g_strstrip (result); + } + + return result; +} + +gboolean +ifnet_add_new_connection (NMConnection * connection, + gchar * config_file, gchar * wpa_file, + GError ** error) +{ + NMSettingConnection *s_con; + gboolean success = FALSE; + const char *type; + gchar *new_type, *new_name = NULL; + + s_con = + NM_SETTING_CONNECTION (nm_connection_get_setting + (connection, NM_TYPE_SETTING_CONNECTION)); + if (!s_con) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing '%s' setting", + NM_SETTING_CONNECTION_SETTING_NAME); + return FALSE; + } + + type = nm_setting_connection_get_connection_type (s_con); + if (!type) { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Missing connection type!"); + goto out; + } + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Adding %s connection", type); + + /* get name and type + * Wireless type: wireless + * Wired type: wired + * PPPoE type: ppp*/ + if (!strcmp (type, NM_SETTING_WIRED_SETTING_NAME)) { + new_name = get_wired_name (); + if (!new_name) + goto out; + new_type = "wired"; + } else if (!strcmp (type, NM_SETTING_WIRELESS_SETTING_NAME)) { + new_name = get_wireless_name (connection); + new_type = "wireless"; + } else if (!strcmp (type, NM_SETTING_PPPOE_SETTING_NAME)) { + new_name = get_ppp_name (); + if (!new_name) + goto out; + new_type = "ppp"; + } else { + g_set_error (error, ifnet_plugin_error_quark (), 0, + "Can't write connection type '%s'", type); + goto out; + } + + if (ifnet_add_connection (new_name, new_type)) + success = + ifnet_update_parsers_by_connection (connection, new_name, + NULL, config_file, + wpa_file, error); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Added new connection: %s, result: %s", + new_name, success ? "success" : "fail"); + + out: + if (new_name) + g_free (new_name); + return success; +} diff --git a/system-settings/plugins/ifnet/connection_parser.h b/system-settings/plugins/ifnet/connection_parser.h new file mode 100644 index 0000000000..b006954cc8 --- /dev/null +++ b/system-settings/plugins/ifnet/connection_parser.h @@ -0,0 +1,43 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Mu Qiao + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 1999-2010 Gentoo Foundation, Inc. + */ + +#ifndef _CONNECTION_PARSER_H +#define _CONNECTION_PARSER_H +#include +#include "net_parser.h" + +NMConnection *ifnet_update_connection_from_config_block (gchar * conn_name, + GError ** error); + +/* nm_conn_name is used to update nm_ifnet_connection's priv data */ +gboolean ifnet_update_parsers_by_connection (NMConnection * connection, + gchar * conn_name, + gchar ** nm_conn_name, + gchar * config_file, + gchar * wpa_file, GError ** error); + +gboolean ifnet_delete_connection_in_parsers (gchar * conn_name, + gchar * config_file, + gchar * wpa_file); +gboolean ifnet_add_new_connection (NMConnection * connection, + gchar * config_file, gchar * wpa_file, + GError ** error); +#endif diff --git a/system-settings/plugins/ifnet/net_parser.c b/system-settings/plugins/ifnet/net_parser.c new file mode 100644 index 0000000000..b4a381dee8 --- /dev/null +++ b/system-settings/plugins/ifnet/net_parser.c @@ -0,0 +1,635 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Mu Qiao + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 1999-2010 Gentoo Foundation, Inc. + */ + +#include +#include +#include +#include "net_parser.h" +#include "net_utils.h" + +/* Save all the connection information */ +static GHashTable *conn_table; + +/* Save global settings which are used for writing*/ +static GHashTable *global_settings_table; + +/* Save functions */ +static GList *functions_list; + +/* Used to decide whether to write changes to file*/ +static gboolean net_parser_data_changed = FALSE; + +static GHashTable * +add_new_connection_config (const gchar * type, const gchar * name) +{ + GHashTable *new_conn; + gchar *new_name; + + if (!name) + return NULL; + + /* Return existing connection */ + if ((new_conn = g_hash_table_lookup (conn_table, name)) != NULL) + return new_conn; + new_conn = g_hash_table_new (g_str_hash, g_str_equal); + new_name = g_strdup (name); + g_hash_table_insert (new_conn, g_strdup ("name"), new_name); + g_hash_table_insert (new_conn, g_strdup ("type"), g_strdup (type)); + g_hash_table_insert (conn_table, new_name, new_conn); + return new_conn; +} + +gboolean +ifnet_add_connection (gchar * name, gchar * type) +{ + if (add_new_connection_config (type, name)) { + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Adding network for %s", name); + net_parser_data_changed = TRUE; + return TRUE; + } else + return FALSE; +} + +gboolean +ifnet_has_connection (gchar * conn_name) +{ + return g_hash_table_lookup (conn_table, conn_name) != NULL; +} + +static GHashTable * +get_connection_config (gchar * name) +{ + return g_hash_table_lookup (conn_table, name); +} + +/* Ignored name won't be treated as wireless ssid */ +static gchar *ignore_name[] = { + "vlan", "bond", "atm", "ath", "ippp", "vpn", "tap", "tun", "1", + "br", "nas", "6to4", "timeout", "kvm", "force", NULL +}; + +static gboolean +ignore_connection_name (gchar * name) +{ + gboolean result = FALSE; + guint i = 0; + + /* check ignore_name list */ + while (ignore_name[i] != NULL) { + if (g_ascii_strncasecmp + (name, ignore_name[i], strlen (ignore_name[i])) == 0) { + return TRUE; + } + i++; + } + /* Ignore mac address based configuration */ + if (strlen (name) == 12 && is_hex (name)) + result = TRUE; + return result; + +} + +static gboolean +is_global_setting (char *key) +{ + static gchar *global_settings[] = { "wpa_supplicant_", NULL }; + int i; + + for (i = 0; global_settings[i] != NULL; i++) { + if (strstr (key, global_settings[i])) + return 1; + } + return 0; +} + +/* Parse a complete line */ +/* Connection type is determined here */ +static void +init_block_by_line (gchar * buf) +{ + gchar **key_value; + gchar *pos; + gchar *data; + gchar *tmp; + GHashTable *conn; + + key_value = g_strsplit (buf, "=", 2); + if (g_strv_length (key_value) != 2) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, "Can't handle this line: %s\n", + buf); + g_strfreev (key_value); + return; + } + pos = g_strrstr (key_value[0], "_"); + if (pos == NULL || is_global_setting (key_value[0])) { + /* global data */ + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "global:%s-%s\n", key_value[0], + key_value[1]); + g_hash_table_insert (global_settings_table, + g_strdup (key_value[0]), + g_strdup (key_value[1])); + g_strfreev (key_value); + return; + } + *pos++ = '\0'; + if ((conn = get_connection_config (pos)) == NULL) { + if (g_ascii_strncasecmp (pos, "eth", 3) == 0 + && strlen (pos) == 4) + /* wired connection */ + conn = add_new_connection_config ("wired", pos); + else if (g_ascii_strncasecmp (pos, "ppp", 3) == 0 + && strlen (pos) == 4) + /* pppoe connection */ + conn = add_new_connection_config ("ppp", pos); + else if (ignore_connection_name (pos)) { + /* ignored connection */ + conn = add_new_connection_config ("ignore", pos); + } else + /* wireless connection */ + conn = add_new_connection_config ("wireless", pos); + } + data = g_strdup (key_value[1]); + tmp = strip_string (data, '('); + tmp = strip_string (tmp, ')'); + strip_string (tmp, '"'); + strip_string (tmp, '\''); + if (conn) + g_hash_table_insert (conn, g_strdup (key_value[0]), + g_strdup (tmp)); + g_free (data); + g_strfreev (key_value); +} + +static void +destroy_connection_config (GHashTable * conn) +{ + gpointer key, value; + GHashTableIter iter; + + g_hash_table_iter_init (&iter, conn); + while (g_hash_table_iter_next (&iter, &key, &value)) { + g_free (key); + g_free (value); + } + + g_hash_table_destroy (conn); +} + +// read settings from /etc/NetworkManager/nm-system-settings.conf +gchar * +ifnet_get_global_setting (gchar * group, gchar * key) +{ + GError *error = NULL; + GKeyFile *keyfile = g_key_file_new (); + gchar *result = NULL; + + if (!g_key_file_load_from_file (keyfile, + IFNET_SYSTEM_SETTINGS_KEY_FILE, + G_KEY_FILE_NONE, &error)) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "loading system config file (%s) caused error: (%d) %s", + IFNET_SYSTEM_SETTINGS_KEY_FILE, + error ? error->code : -1, error + && error->message ? error->message : "(unknown)"); + } else { + result = g_key_file_get_string (keyfile, group, key, &error); + } + g_key_file_free (keyfile); + return result; +} + +static void +strip_function (GIOChannel * channel, gchar * line) +{ + + int counter = 0; + gchar *p, *tmp; + gboolean begin = FALSE; + GString *function_str = g_string_new (line); + + g_string_append (function_str, "\n"); + while (1) { + p = line; + while (*p != '\0') { + if (*p == '{') { + counter++; + begin = TRUE; + } else if (*p == '}') + counter--; + p++; + } + if (begin && counter == 0) { + g_free (line); + goto done; + } + while (1) { + g_free (line); + if (g_io_channel_read_line + (channel, &line, NULL, NULL, + NULL) == G_IO_STATUS_EOF) + goto done; + g_string_append (function_str, line); + tmp = g_strdup (line); + g_strstrip (tmp); + if (tmp[0] != '#' && tmp[0] != '\0') { + g_free (tmp); + break; + } else + g_free (tmp); + } + } + done: + functions_list = + g_list_append (functions_list, g_strdup (function_str->str)); + g_string_free (function_str, TRUE); +} + +static gboolean +is_function (gchar * line) +{ + static gchar *func_names[] = + { "preup", "predown", "postup", "postdown", "failup", "faildown", + NULL, + }; + int i; + + for (i = 0; func_names[i]; i++) { + if (g_str_has_prefix (line, func_names[i])) { + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "Ignoring function: %s", func_names[i]); + return TRUE; + } + } + return FALSE; +} + +gboolean +ifnet_init (gchar * config_file) +{ + GIOChannel *channel = NULL; + gchar *line; + + /* Handle multiple lines with brackets */ + gboolean complete = TRUE; + + /* line buffer */ + GString *buf; + + net_parser_data_changed = FALSE; + + conn_table = g_hash_table_new (g_str_hash, g_str_equal); + global_settings_table = g_hash_table_new (g_str_hash, g_str_equal); + functions_list = NULL; + + if (g_file_test (config_file, G_FILE_TEST_IS_REGULAR)) + channel = g_io_channel_new_file (config_file, "r", NULL); + if (channel == NULL) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Error: Can't open %s\n", config_file); + return FALSE; + } + + buf = g_string_new (NULL); + while (g_io_channel_read_line + (channel, &line, NULL, NULL, NULL) != G_IO_STATUS_EOF) { + g_strstrip (line); + /* convert multiple lines to a complete line and + * pass it to init_block_by_line() */ + if (is_function (line)) { + strip_function (channel, line); + continue; + } + if (line[0] != '#' && line[0] != '\0') { + gchar *pos = NULL; + + if (!complete) { + complete = + g_strrstr (line, + ")") == NULL ? FALSE : TRUE; + if ((pos = strchr (line, '#')) != NULL) + *pos = '\0'; + g_strstrip (line); + if (line[0] != '\0') { + g_string_append_printf (buf, + " %s", line); + } + g_free (line); + if (!complete) + continue; + } else { + complete = + (g_strrstr (line, "(") != NULL + && g_strrstr (line, ")") != NULL) + || g_strrstr (line, "(") == NULL; + if ((pos = strchr (line, '#')) != NULL) + *pos = '\0'; + g_strstrip (line); + if (line[0] != '\0') + g_string_append (buf, line); + g_free (line); + if (!complete) + continue; + } + init_block_by_line (buf->str); + g_string_free (buf, TRUE); + buf = g_string_new (NULL); + } else + /* Blank line or comment line */ + g_free (line); + } + + g_string_free (buf, TRUE); + g_io_channel_shutdown (channel, FALSE, NULL); + g_io_channel_unref (channel); + return TRUE; +} + +gchar * +ifnet_get_data (gchar * conn_name, const gchar * key) +{ + GHashTable *conn = g_hash_table_lookup (conn_table, conn_name); + + if (conn) + return g_hash_table_lookup (conn, key); + return NULL; +} + +void +ifnet_set_data (gchar * conn_name, gchar * key, gchar * value) +{ + gpointer orin_key = NULL, orin_value = NULL; + GHashTable *conn = g_hash_table_lookup (conn_table, conn_name); + + if (!conn) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "%s does not exsit!", conn_name); + return; + } + /* Remove existing key value pair */ + if (g_hash_table_lookup_extended (conn, key, &orin_key, &orin_value)) { + g_hash_table_remove (conn, orin_key); + g_free (orin_key); + g_free (orin_value); + } + if (value) + g_hash_table_insert (conn, g_strdup (key), + strip_string (g_strdup (value), '"')); + net_parser_data_changed = TRUE; +} + +// Remember to free return value +gchar * +ifnet_get_global_data (const gchar * key) +{ + gchar *result = g_hash_table_lookup (global_settings_table, key); + + if (result) + result = g_strdup (result); + else + return NULL; + strip_string (result, '"'); + return result; +} + +// Return names of legal connections +GList * +ifnet_get_connection_names () +{ + GList *names = g_hash_table_get_keys (conn_table); + GList *result = NULL; + + while (names) { + if (!ignore_connection_name (names->data)) + result = g_list_append (result, names->data); + names = names->next; + } + return result; +} + +/* format IP and route for writing */ +static void +format_ips (gchar * value, gchar ** out_line, gchar * key, gchar * name) +{ + gchar **ipset; + guint length, i; + GString *formated_string = g_string_new (NULL); + + strip_string (value, '"'); + ipset = g_strsplit (value, "\" \"", 0); + length = g_strv_length (ipset); + + //only one line + if (length < 2) { + *out_line = + g_strdup_printf ("%s_%s=( \"%s\" )\n", key, name, value); + goto done; + } + // Multiple lines + g_string_append_printf (formated_string, "%s_%s=(\n", key, name); + for (i = 0; i < length; i++) + g_string_append_printf (formated_string, + "\t\"%s\"\n", ipset[i]); + g_string_append (formated_string, ")\n"); + *out_line = g_strdup (formated_string->str); + done: + g_string_free (formated_string, TRUE); + g_strfreev (ipset); +} + +gboolean +ifnet_flush_to_file (gchar * config_file) +{ + GIOChannel *channel; + GError **error = NULL; + gpointer key, value, name, network; + GHashTableIter iter, iter_network; + GList *list_iter; + gchar *out_line; + gsize bytes_written; + gboolean result = FALSE; + + if (!net_parser_data_changed) + return FALSE; + if (!conn_table || !global_settings_table) + return FALSE; + + channel = g_io_channel_new_file (config_file, "w", NULL); + if (!channel) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Can't open file %s for writing", config_file); + return FALSE; + } + g_hash_table_iter_init (&iter, global_settings_table); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Writing to %s", config_file); + g_io_channel_write_chars (channel, + "#Generated by NetworkManager\n" + "###### Global Configuration ######\n", + -1, &bytes_written, error); + /* Writing global data */ + while (g_hash_table_iter_next (&iter, &key, &value)) { + out_line = + g_strdup_printf ("%s=%s\n", (gchar *) key, (gchar *) value); + g_io_channel_write_chars (channel, out_line, -1, + &bytes_written, error); + if (bytes_written == 0 || (error && *error)) + break; + g_free (out_line); + } + if (error && *error) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Found error: %s", (*error)->message); + goto done; + } + + /* Writing connection data */ + g_io_channel_write_chars (channel, + "\n###### Connection Configuration ######\n", + -1, &bytes_written, error); + g_hash_table_iter_init (&iter, conn_table); + while (g_hash_table_iter_next (&iter, &name, &network)) { + g_hash_table_iter_init (&iter_network, (GHashTable *) network); + g_io_channel_write_chars (channel, + "#----------------------------------\n", + -1, &bytes_written, error); + + while (g_hash_table_iter_next (&iter_network, &key, &value)) { + if (!g_str_has_prefix ((gchar *) key, "name") + && !g_str_has_prefix ((gchar *) key, "type")) { + /* These keys contain brackets */ + if (strcmp + ((gchar *) key, + "config") == 0 + || strcmp ((gchar *) key, + "routes") == 0 + || strcmp ((gchar *) key, + "pppd") == 0 + || strcmp ((gchar *) key, "chat") == 0) + format_ips (value, &out_line, (gchar *) + key, (gchar *) + name); + else + out_line = + g_strdup_printf + ("%s_%s=\"%s\"\n", + (gchar *) key, + (gchar *) name, (gchar *) value); + g_io_channel_write_chars + (channel, out_line, -1, + &bytes_written, error); + if (bytes_written == 0 || (error && *error)) + break; + g_free (out_line); + } + } + } + if (error && *error) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Found error: %s", (*error)->message); + goto done; + } + + /* Writing reserved functions */ + if (functions_list) { + g_io_channel_write_chars (channel, + "\n###### Reserved Functions ######\n", + -1, &bytes_written, error); + /* Writing functions */ + for (list_iter = functions_list; list_iter; + list_iter = g_list_next (list_iter)) { + out_line = + g_strdup_printf ("%s\n", (gchar *) list_iter->data); + g_io_channel_write_chars (channel, out_line, -1, + &bytes_written, error); + if (bytes_written == 0 || (error && *error)) + break; + g_free (out_line); + } + if (error && *error) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Found error: %s", (*error)->message); + goto done; + } + } + + g_io_channel_flush (channel, error); + if (error && *error) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Found error: %s", (*error)->message); + goto done; + } + result = TRUE; + net_parser_data_changed = FALSE; + done: + g_io_channel_shutdown (channel, FALSE, NULL); + g_io_channel_unref (channel); + return result; +} + +gboolean +ifnet_delete_network (gchar * conn_name) +{ + GHashTable *network = NULL; + + g_return_val_if_fail (conn_table != NULL && conn_name != NULL, FALSE); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Deleting network for %s", conn_name); + network = g_hash_table_lookup (conn_table, conn_name); + if (!network) + return FALSE; + g_hash_table_remove (conn_table, conn_name); + destroy_connection_config (network); + net_parser_data_changed = TRUE; + return TRUE; +} + +void +ifnet_destroy (void) +{ + GHashTableIter iter; + gpointer key; + gpointer value; + GList *list_iter; + + /* Destroy connection setting */ + if (conn_table) { + g_hash_table_iter_init (&iter, conn_table); + while (g_hash_table_iter_next (&iter, &key, &value)) { + destroy_connection_config ((GHashTable *) + value); + } + g_hash_table_destroy (conn_table); + conn_table = NULL; + } + + /* Destroy global data */ + if (global_settings_table) { + g_hash_table_iter_init (&iter, global_settings_table); + while (g_hash_table_iter_next (&iter, &key, &value)) { + g_free (key); + g_free (value); + } + g_hash_table_destroy (global_settings_table); + global_settings_table = NULL; + } + for (list_iter = functions_list; list_iter; + list_iter = g_list_next (list_iter)) + g_free (list_iter->data); + g_list_free (functions_list); +} diff --git a/system-settings/plugins/ifnet/net_parser.h b/system-settings/plugins/ifnet/net_parser.h new file mode 100644 index 0000000000..73a44c857d --- /dev/null +++ b/system-settings/plugins/ifnet/net_parser.h @@ -0,0 +1,46 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Mu Qiao + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 1999-2010 Gentoo Foundation, Inc. + */ + +#ifndef _NET_PARSER_H +#define _NET_PARSER_H + +#include + +#define CONF_NET_FILE "/etc/conf.d/net" +#define IFNET_SYSTEM_SETTINGS_KEY_FILE "/etc/NetworkManager/nm-system-settings.conf" +#define IFNET_KEY_FILE_GROUP "ifnet" + +gboolean ifnet_init (gchar * config_file); +void ifnet_destroy (void); + +/* Reader functions */ +GList *ifnet_get_connection_names (void); +gchar *ifnet_get_data (gchar * conn_name, const gchar * key); +gchar *ifnet_get_global_data (const gchar * key); +gchar *ifnet_get_global_setting (gchar * group, gchar * key); +gboolean ifnet_has_connection (gchar * conn_name); + +/* Writer functions */ +gboolean ifnet_flush_to_file (gchar * config_file); +void ifnet_set_data (gchar * conn_name, gchar * key, gchar * value); +gboolean ifnet_add_connection (gchar * name, gchar * type); +gboolean ifnet_delete_network (gchar * conn_name); +#endif diff --git a/system-settings/plugins/ifnet/net_utils.c b/system-settings/plugins/ifnet/net_utils.c new file mode 100644 index 0000000000..8f1b81b0b3 --- /dev/null +++ b/system-settings/plugins/ifnet/net_utils.c @@ -0,0 +1,931 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Mu Qiao + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 1999-2010 Gentoo Foundation, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include "net_utils.h" +#include "wpa_parser.h" +#include "net_parser.h" + +/* emit heading and tailing blank space, tab, character t */ +gchar * +strip_string (gchar * str, gchar t) +{ + gchar *ret = str; + gint length = 0; + guint i = 0; + + while (ret[i] != '\0' + && (ret[i] == '\t' || ret[i] == ' ' || ret[i] == t)) { + length++; + i++; + } + i = 0; + while (ret[i + length] != '\0') { + ret[i] = ret[i + length]; + i++; + } + ret[i] = '\0'; + length = strlen (ret); + while ((length - 1) >= 0 + && (ret[length - 1] == ' ' || ret[length - 1] == '\n' + || ret[length - 1] == '\t' || ret[length - 1] == t)) + length--; + ret[length] = '\0'; + return ret; +} + +gboolean +is_hex (gchar * value) +{ + gchar *p; + + if (!value) + return FALSE; + p = value; + while (*p) { + if (!isxdigit (*p)) { + return FALSE; + } + p++; + } + return TRUE; +} + +gboolean +is_ascii (gchar * value) +{ + gchar *p; + + p = value; + while (*p) { + if (!isascii (*p)) { + return FALSE; + } + p++; + } + return TRUE; + +} + +gboolean +is_true (char *str) +{ + if (!g_ascii_strcasecmp (str, "yes") + || !g_ascii_strcasecmp (str, "true")) + return TRUE; + return FALSE; +} + +static int +hex2num (char c) +{ + if (c >= '0' && c <= '9') + return c - '0'; + if (c >= 'a' && c <= 'f') + return c - 'a' + 10; + if (c >= 'A' && c <= 'F') + return c - 'A' + 10; + return -1; +} + +static int +hex2byte (const char *hex) +{ + int a, b; + + a = hex2num (*hex++); + if (a < 0) + return -1; + b = hex2num (*hex++); + if (b < 0) + return -1; + return (a << 4) | b; +} + +/* free return value by caller */ +gchar * +utils_hexstr2bin (const gchar * hex, size_t len) +{ + size_t i; + int a; + const gchar *ipos = hex; + gchar *buf = NULL; + gchar *opos; + + /* Length must be a multiple of 2 */ + if ((len % 2) != 0) + return NULL; + + opos = buf = g_malloc0 ((len / 2) + 1); + for (i = 0; i < len; i += 2) { + a = hex2byte (ipos); + if (a < 0) { + g_free (buf); + return NULL; + } + *opos++ = a; + ipos += 2; + } + return buf; +} + +/* free return value by caller */ +gchar * +utils_bin2hexstr (const gchar * bytes, int len, int final_len) +{ + static gchar hex_digits[] = "0123456789abcdef"; + gchar *result; + int i; + gsize buflen = (len * 2) + 1; + + g_return_val_if_fail (bytes != NULL, NULL); + g_return_val_if_fail (len > 0, NULL); + g_return_val_if_fail (len < 4096, NULL); /* Arbitrary limit */ + if (final_len > -1) + g_return_val_if_fail (final_len < buflen, NULL); + + result = g_malloc0 (buflen); + for (i = 0; i < len; i++) { + result[2 * i] = hex_digits[(bytes[i] >> 4) & 0xf]; + result[2 * i + 1] = hex_digits[bytes[i] & 0xf]; + } + /* Cut converted key off at the correct length for this cipher type */ + if (final_len > -1) + result[final_len] = '\0'; + else + result[buflen - 1] = '\0'; + + return result; +} + +GQuark +ifnet_plugin_error_quark (void) +{ + static GQuark error_quark = 0; + + if (G_UNLIKELY (error_quark == 0)) + error_quark = + g_quark_from_static_string ("ifnet-plugin-error-quark"); + return error_quark; +} + +gboolean +reload_parsers () +{ + ifnet_destroy (); + wpa_parser_destroy (); + if (!ifnet_init (CONF_NET_FILE)) + return FALSE; + wpa_parser_init (WPA_SUPPLICANT_CONF); + return TRUE; +} + +gchar * +read_hostname (gchar * path) +{ + gchar *contents = NULL, *result = NULL, *tmp; + gchar **all_lines = NULL; + guint line_num, i; + + if (!g_file_get_contents (path, &contents, NULL, NULL)) + return NULL; + all_lines = g_strsplit (contents, "\n", 0); + line_num = g_strv_length (all_lines); + for (i = 0; i < line_num; i++) { + g_strstrip (all_lines[i]); + if (all_lines[i][0] == '#' || all_lines[i][0] == '\0') + continue; + if (g_str_has_prefix (all_lines[i], "hostname")) { + tmp = strstr (all_lines[i], "="); + tmp++; + tmp = strip_string (tmp, '"'); + result = g_strdup (tmp); + break; + } + + } + g_strfreev (all_lines); + g_free (contents); + return result; +} + +gboolean +write_hostname (const gchar * hostname, gchar * path) +{ + gchar *contents = g_strdup_printf ("#Generated by NetworkManager\n" + "hostname=\"%s\"\n", hostname); + gboolean result = g_file_set_contents (path, contents, -1, NULL); + + g_free (contents); + return result; +} + +gboolean +is_static_ip4 (gchar * conn_name) +{ + gchar *data = ifnet_get_data (conn_name, "config"); + gchar *dhcp6; + + if (!data) + return FALSE; + dhcp6 = strstr (data, "dhcp6"); + if (dhcp6) { + gchar *dhcp4; + + if (strstr (data, "dhcp ")) + return FALSE; + dhcp4 = strstr (data, "dhcp"); + if (!dhcp4) + return TRUE; + if (dhcp4[4] == '\0') + return FALSE; + return TRUE; + } + return strstr (data, "dhcp") == NULL ? TRUE : FALSE; +} + +gboolean +is_static_ip6 (gchar * conn_name) +{ + gchar *data = ifnet_get_data (conn_name, "config"); + + if (!data) + return TRUE; + return strstr (data, "dhcp6") == NULL ? TRUE : FALSE; +} + +gboolean +is_ip4_address (gchar * in_address) +{ + gchar *pattern = + "\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.((\\{\\d{1,3}\\.\\.\\d{1,3}\\})|\\d{1,3})$"; + gchar *address = g_strdup (in_address); + gboolean result = FALSE; + gchar *tmp; + GRegex *regex = g_regex_new (pattern, 0, 0, NULL); + GMatchInfo *match_info; + + if (!address) + goto done; + g_strstrip (address); + if ((tmp = strstr (address, "/")) != NULL) + *tmp = '\0'; + if ((tmp = strstr (address, " ")) != NULL) + *tmp = '\0'; + g_regex_match (regex, address, 0, &match_info); + result = g_match_info_matches (match_info); + done: + if (match_info) + g_match_info_free (match_info); + g_regex_unref (regex); + g_free (address); + return result; +} + +gboolean +is_ip6_address (gchar * in_address) +{ + struct in6_addr tmp_ip6_addr; + gchar *tmp; + gchar *address = g_strdup (in_address); + gboolean result = FALSE; + + if (!address) { + g_free (address); + return FALSE; + } + g_strstrip (address); + if ((tmp = strchr (address, '/')) != NULL) + *tmp = '\0'; + if (inet_pton (AF_INET6, address, &tmp_ip6_addr)) + result = TRUE; + g_free (address); + return result; + +} + +gboolean +has_ip6_address (gchar * conn_name) +{ + gchar **ipset; + guint length; + guint i; + + g_return_val_if_fail (conn_name != NULL, FALSE); + ipset = g_strsplit (ifnet_get_data (conn_name, "config"), "\" \"", 0); + length = g_strv_length (ipset); + for (i = 0; i < length; i++) { + if (!is_ip6_address (ipset[i])) + continue; + else { + g_strfreev (ipset); + return TRUE; + } + + } + g_strfreev (ipset); + return FALSE; +} + +gboolean +has_default_route (gchar * conn_name, gboolean (*check_fn) (gchar *)) +{ + gchar *routes = NULL, *tmp, *end; + + g_return_val_if_fail (conn_name != NULL, FALSE); + tmp = ifnet_get_data (conn_name, "routes"); + if (!tmp) + return FALSE; + routes = g_strdup (tmp); + tmp = strstr (routes, "default via "); + if (!tmp) { + goto error; + } + tmp += strlen ("default via "); + g_strstrip (tmp); + if ((end = strstr (tmp, "\"")) != NULL) + *end = '\0'; + if (check_fn (tmp)) { + g_free (routes); + return TRUE; + } + error: + g_free (routes); + return FALSE; +} + +static ip_block * +create_ip4_block (gchar * ip) +{ + ip_block *iblock = g_slice_new0 (ip_block); + struct in_addr tmp_ip4_addr; + int i; + guint length; + gchar **ip_mask; + + /* prefix format */ + if (strstr (ip, "/")) { + gchar *prefix; + + ip_mask = g_strsplit (ip, "/", 0); + length = g_strv_length (ip_mask); + if (!inet_pton (AF_INET, ip_mask[0], &tmp_ip4_addr)) + goto error; + iblock->ip = tmp_ip4_addr.s_addr; + prefix = ip_mask[1]; + i = 0; + while (i < length && isdigit (prefix[i])) + i++; + prefix[i] = '\0'; + iblock->netmask = nm_utils_ip4_prefix_to_netmask ((guint32) + atoi (ip_mask + [1])); + } else if (strstr (ip, "netmask")) { + ip_mask = g_strsplit (ip, " ", 0); + length = g_strv_length (ip_mask); + if (!inet_pton (AF_INET, ip_mask[0], &tmp_ip4_addr)) + goto error; + iblock->ip = tmp_ip4_addr.s_addr; + i = 0; + while (i < length && !strstr (ip_mask[++i], "netmask")) ; + while (i < length && ip_mask[++i][0] == '\0') ; + if (i >= length) + goto error; + if (!inet_pton (AF_INET, ip_mask[i], &tmp_ip4_addr)) + goto error; + iblock->netmask = tmp_ip4_addr.s_addr; + } else { + g_slice_free (ip_block, iblock); + if (!is_ip6_address (ip) && !strstr (ip, "dhcp")) + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Can't handle ipv4 address: %s, missing netmask or prefix", + ip); + return NULL; + } + g_strfreev (ip_mask); + return iblock; + error: + if (!is_ip6_address (ip)) + PLUGIN_WARN (IFNET_PLUGIN_NAME, "Can't handle IPv4 address: %s", + ip); + g_strfreev (ip_mask); + g_slice_free (ip_block, iblock); + return NULL; +} + +static ip6_block * +create_ip6_block (gchar * ip) +{ + ip6_block *iblock = g_slice_new0 (ip6_block); + gchar *dup_ip = g_strdup (ip); + struct in6_addr *tmp_ip6_addr = g_slice_new0 (struct in6_addr); + gchar *prefix = NULL; + + if ((prefix = strstr (dup_ip, "/")) != NULL) { + *prefix = '\0'; + prefix++; + } + if (!inet_pton (AF_INET6, dup_ip, tmp_ip6_addr)) { + goto error; + } + iblock->ip = tmp_ip6_addr; + if (prefix) { + errno = 0; + iblock->prefix = strtol (prefix, NULL, 10); + if (errno || iblock->prefix <= 0 || iblock->prefix > 128) { + goto error; + } + } else + iblock->prefix = 64; + g_free (dup_ip); + return iblock; + error: + if (!is_ip4_address (ip)) + PLUGIN_WARN (IFNET_PLUGIN_NAME, "Can't handle IPv6 address: %s", + ip); + g_slice_free (ip6_block, iblock); + g_slice_free (struct in6_addr, tmp_ip6_addr); + + g_free (dup_ip); + return NULL; +} + +static guint32 +get_ip4_gateway (gchar * gateway) +{ + gchar *tmp, *split; + struct in_addr tmp_ip4_addr; + + if (!gateway) + return 0; + tmp = strstr (gateway, "via "); + tmp = g_strdup (tmp + strlen ("via ")); + strip_string (tmp, ' '); + strip_string (tmp, '"'); + if ((split = strstr (tmp, "\"")) != NULL) + *split = '\0'; + if (!inet_pton (AF_INET, tmp, &tmp_ip4_addr)) + goto error; + g_free (tmp); + return tmp_ip4_addr.s_addr; + error: + if (!is_ip6_address (tmp)) + PLUGIN_WARN (IFNET_PLUGIN_NAME, "Can't handle IPv4 gateway: %s", + tmp); + g_free (tmp); + return 0; +} + +static struct in6_addr * +get_ip6_next_hop (gchar * next_hop) +{ + gchar *tmp; + struct in6_addr *tmp_ip6_addr = g_slice_new0 (struct in6_addr); + + if (!next_hop) + return 0; + tmp = strstr (next_hop, "via "); + tmp = g_strdup (tmp + strlen ("via ")); + strip_string (tmp, ' '); + strip_string (tmp, '"'); + g_strstrip (tmp); + if (!inet_pton (AF_INET6, tmp, tmp_ip6_addr)) + goto error; + g_free (tmp); + return tmp_ip6_addr; + error: + if (!is_ip4_address (tmp)) + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Can't handle IPv6 next_hop: %s", tmp); + g_free (tmp); + g_slice_free (struct in6_addr, tmp_ip6_addr); + + return NULL; +} + +ip_block * +convert_ip4_config_block (gchar * conn_name) +{ + gchar **ipset; + guint length; + guint i; + gchar *ip; + guint32 def_gateway; + gchar *routes; + gchar *pos; + ip_block *start = NULL, *current = NULL, *iblock = NULL; + gchar *pattern = + "((\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.)\\{(\\d{1,3})\\.\\.(\\d{1,3})\\}(/\\d{1,2}))"; + GRegex *regex = g_regex_new (pattern, 0, 0, NULL); + + g_return_val_if_fail (conn_name != NULL, NULL); + ipset = g_strsplit (ifnet_get_data (conn_name, "config"), "\" \"", 0); + length = g_strv_length (ipset); + routes = ifnet_get_data (conn_name, "routes"); + if (routes) + def_gateway = get_ip4_gateway (strstr (routes, "default")); + else + def_gateway = 0; + for (i = 0; i < length; i++) { + ip = ipset[i]; + ip = strip_string (ip, '"'); + //Handle ip like 192.168.4.{1..3} + if ((pos = strchr (ip, '{')) != NULL) { + gchar *ip_start, *ip_prefix; + gchar *begin_str, *end_str; + int begin, end, j; + GMatchInfo *match_info; + + g_regex_match (regex, ip, 0, &match_info); + if (!g_match_info_matches (match_info)) { + g_match_info_free (match_info); + continue; + } + begin_str = g_match_info_fetch (match_info, 3); + end_str = g_match_info_fetch (match_info, 4); + begin = atoi (begin_str); + end = atoi (end_str); + ip_start = g_match_info_fetch (match_info, 2); + ip_prefix = g_match_info_fetch (match_info, 5); + if (end < begin || begin < 1 || end > 254) { + g_match_info_free (match_info); + continue; + } + + for (j = begin; j <= end; j++) { + char suf[4]; + gchar *newip; + + sprintf (suf, "%d", j); + newip = + g_strconcat (ip_start, suf, ip_prefix, + NULL); + iblock = create_ip4_block (newip); + if (iblock == NULL) { + g_free (newip); + continue; + } + if (!iblock->gateway && def_gateway != 0) + iblock->gateway = def_gateway; + if (start == NULL) + start = current = iblock; + else { + current->next = iblock; + current = iblock; + } + g_free (newip); + } + g_free (begin_str); + g_free (end_str); + g_free (ip_start); + g_free (ip_prefix); + g_match_info_free (match_info); + } else { + iblock = create_ip4_block (ip); + if (iblock == NULL) + continue; + if (!iblock->gateway && def_gateway != 0) + iblock->gateway = def_gateway; + if (start == NULL) + start = current = iblock; + else { + current->next = iblock; + current = iblock; + } + } + } + g_strfreev (ipset); + g_regex_unref (regex); + return start; +} + +ip6_block * +convert_ip6_config_block (gchar * conn_name) +{ + gchar **ipset; + guint length; + guint i; + gchar *ip; + ip6_block *start = NULL, *current = NULL, *iblock = NULL; + + g_return_val_if_fail (conn_name != NULL, NULL); + ipset = g_strsplit (ifnet_get_data (conn_name, "config"), "\" \"", 0); + length = g_strv_length (ipset); + for (i = 0; i < length; i++) { + ip = ipset[i]; + ip = strip_string (ip, '"'); + iblock = create_ip6_block (ip); + if (iblock == NULL) + continue; + if (start == NULL) + start = current = iblock; + else { + current->next = iblock; + current = iblock; + } + } + g_strfreev (ipset); + return start; +} + +ip_block * +convert_ip4_routes_block (gchar * conn_name) +{ + gchar **ipset; + guint length; + guint i; + gchar *ip; + gchar *routes; + ip_block *start = NULL, *current = NULL, *iblock = NULL; + + g_return_val_if_fail (conn_name != NULL, NULL); + routes = ifnet_get_data (conn_name, "routes"); + if (!routes) + return NULL; + ipset = g_strsplit (routes, "\" \"", 0); + length = g_strv_length (ipset); + for (i = 0; i < length; i++) { + ip = ipset[i]; + if (strstr (ip, "default via ") || strstr (ip, "::") + || !strstr (ip, "via")) + continue; + ip = strip_string (ip, '"'); + iblock = create_ip4_block (ip); + if (iblock == NULL) + continue; + iblock->gateway = get_ip4_gateway (ip); + if (start == NULL) + start = current = iblock; + else { + current->next = iblock; + current = iblock; + } + } + g_strfreev (ipset); + return start; +} + +ip6_block * +convert_ip6_routes_block (gchar * conn_name) +{ + gchar **ipset; + guint length; + guint i; + gchar *ip, *tmp_addr; + gchar *routes; + ip6_block *start = NULL, *current = NULL, *iblock = NULL; + struct in6_addr *tmp_ip6_addr; + + g_return_val_if_fail (conn_name != NULL, NULL); + routes = ifnet_get_data (conn_name, "routes"); + if (!routes) + return NULL; + ipset = g_strsplit (routes, "\" \"", 0); + length = g_strv_length (ipset); + for (i = 0; i < length; i++) { + ip = ipset[i]; + ip = strip_string (ip, '"'); + if (ip[0] == '\0') + continue; + printf ("ip:%s\n", ip); + if ((tmp_addr = strstr (ip, "default via ")) != NULL) { + tmp_addr += strlen ("default via "); + if (!is_ip6_address (tmp_addr)) + continue; + else { + tmp_ip6_addr = g_slice_new0 (struct in6_addr); + + if (inet_pton (AF_INET6, "::", tmp_ip6_addr)) { + iblock = g_slice_new0 (ip6_block); + iblock->ip = tmp_ip6_addr; + iblock->prefix = 128; + } else { + g_slice_free (struct in6_addr, + tmp_ip6_addr); + continue; + } + } + } else + iblock = create_ip6_block (ip); + if (iblock == NULL) + continue; + iblock->next_hop = get_ip6_next_hop (ip); + if (iblock->next_hop == NULL) { + destroy_ip6_block (iblock); + continue; + } + if (start == NULL) + start = current = iblock; + else { + current->next = iblock; + current = iblock; + } + } + g_strfreev (ipset); + return start; +} + +void +destroy_ip_block (ip_block * iblock) +{ + g_slice_free (ip_block, iblock); +} + +void +destroy_ip6_block (ip6_block * iblock) +{ + g_slice_free (struct in6_addr, iblock->ip); + g_slice_free (struct in6_addr, iblock->next_hop); + + g_slice_free (ip6_block, iblock); +} + +void +set_ip4_dns_servers (NMSettingIP4Config * s_ip4, gchar * conn_name) +{ + gchar *dns_servers = ifnet_get_data (conn_name, "dns_servers"); + gchar **server_list; + guint length, i; + struct in_addr tmp_ip4_addr; + guint32 new_dns; + + if (!dns_servers) + return; + strip_string (dns_servers, '"'); + server_list = g_strsplit (dns_servers, " ", 0); + length = g_strv_length (server_list); + if (length) + g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS, + TRUE, NULL); + for (i = 0; i < length; i++) { + g_strstrip (server_list[i]); + if (server_list[i][0] == '\0') + continue; + if (!inet_pton (AF_INET, server_list[i], &tmp_ip4_addr)) { + if (!is_ip6_address (server_list[i])) + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "ignored dns: %s\n", + server_list[i]); + continue; + } + new_dns = tmp_ip4_addr.s_addr; + if (new_dns && !nm_setting_ip4_config_add_dns (s_ip4, new_dns)) + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "warning: duplicate DNS server %s", + server_list[i]); + } + g_strfreev (server_list); +} + +void +set_ip6_dns_servers (NMSettingIP6Config * s_ip6, gchar * conn_name) +{ + gchar *dns_servers = ifnet_get_data (conn_name, "dns_servers"); + gchar **server_list; + guint length, i; + struct in6_addr tmp_ip6_addr; + + if (!dns_servers) + return; + strip_string (dns_servers, '"'); + server_list = g_strsplit (dns_servers, " ", 0); + length = g_strv_length (server_list); + if (length) + g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS, + TRUE, NULL); + for (i = 0; i < length; i++) { + g_strstrip (server_list[i]); + if (server_list[i][0] == '\0') + continue; + if (!inet_pton (AF_INET6, server_list[i], &tmp_ip6_addr)) { + if (is_ip6_address (server_list[i])) + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "ignored dns: %s\n", + server_list[i]); + continue; + } + if (!IN6_IS_ADDR_UNSPECIFIED (&tmp_ip6_addr) + && !nm_setting_ip6_config_add_dns (s_ip6, &tmp_ip6_addr)) + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "warning: duplicate DNS server %s", + server_list[i]); + } + g_strfreev (server_list); +} + +gboolean +is_managed (gchar * conn_name) +{ + gchar *config; + + g_return_val_if_fail (conn_name != NULL, FALSE); + config = (gchar *) ifnet_get_data (conn_name, "managed"); + if (!config) + return TRUE; + if (strcmp (config, "false") == 0) + return FALSE; + return TRUE; +} + +void +get_dhcp_hostname_and_client_id (char **hostname, char **client_id) +{ + gchar *dhcp_client = ifnet_get_global_setting ("main", "dhcp"); + const gchar *dhcpcd_conf = "/etc/dhcpcd.conf"; + const gchar *dhclient_conf = "/etc/dhcp/dhclient.conf"; + gchar *line = NULL, *tmp = NULL, *contents = NULL; + gchar **all_lines; + guint line_num, i; + + *hostname = NULL; + *client_id = NULL; + if (dhcp_client) { + if (!strcmp (dhcp_client, "dhclient")) + g_file_get_contents (dhclient_conf, &contents, NULL, + NULL); + else if (!strcmp (dhcp_client, "dhcpcd")) + g_file_get_contents (dhcpcd_conf, &contents, NULL, + NULL); + } else { + if (g_file_test (dhclient_conf, G_FILE_TEST_IS_REGULAR)) + g_file_get_contents (dhclient_conf, &contents, NULL, + NULL); + else if (g_file_test (dhcpcd_conf, G_FILE_TEST_IS_REGULAR)) + g_file_get_contents (dhcpcd_conf, &contents, NULL, + NULL); + } + if (!contents) + return; + all_lines = g_strsplit (contents, "\n", 0); + line_num = g_strv_length (all_lines); + for (i = 0; i < line_num; i++) { + line = all_lines[i]; + // dhcpcd.conf + g_strstrip (line); + if (g_str_has_prefix (line, "hostname")) { + tmp = line + strlen ("hostname"); + g_strstrip (tmp); + if (tmp[0] != '\0') + *hostname = g_strdup (tmp); + else + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "dhcpcd hostname not defined, ignoring"); + } else if (g_str_has_prefix (line, "clientid")) { + tmp = line + strlen ("clientid"); + g_strstrip (tmp); + if (tmp[0] != '\0') + *client_id = g_strdup (tmp); + else + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "dhcpcd clientid not defined, ignoring"); + } + // dhclient.conf + else if ((tmp = strstr (line, "send host-name")) != NULL) { + tmp += strlen ("send host-name"); + g_strstrip (tmp); + strip_string (tmp, '"'); + strip_string (tmp, ';'); + if (tmp[0] != '\0') + *hostname = g_strdup (tmp); + else + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "dhclient hostname not defined, ignoring"); + } else if ((tmp = strstr (line, "send dhcp-client-identifier")) + != NULL) { + tmp += strlen ("send dhcp-client-identifier"); + g_strstrip (tmp); + strip_string (tmp, ';'); + if (tmp[0] != '\0') + *client_id = g_strdup (tmp); + else + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "dhclient clientid not defined, ignoring"); + } + } + g_strfreev (all_lines); + g_free (contents); +} diff --git a/system-settings/plugins/ifnet/net_utils.h b/system-settings/plugins/ifnet/net_utils.h new file mode 100644 index 0000000000..ba7af39c27 --- /dev/null +++ b/system-settings/plugins/ifnet/net_utils.h @@ -0,0 +1,80 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Mu Qiao + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 1999-2010 Gentoo Foundation, Inc. + */ + +#ifndef _IFNET_UTILS_H +#define _IFNET_UTILS_H +#define IFNET_PLUGIN_NAME "SCPlugin-Ifnet" +#include +#include +#include +#include +#include "net_parser.h" +#define has_default_ip4_route(conn_name) has_default_route((conn_name),&is_ip4_address) +#define has_default_ip6_route(conn_name) has_default_route((conn_name),&is_ip6_address) + +typedef struct _ip_block { + guint32 ip; + guint32 netmask; + guint32 gateway; + struct _ip_block *next; +} ip_block; + +typedef struct _ip6_block { + struct in6_addr *ip; + long int prefix; + struct in6_addr *next_hop; + struct _ip6_block *next; +} ip6_block; + +gchar *read_hostname (gchar * path); +gboolean write_hostname (const gchar * hostname, gchar * path); +gboolean is_static_ip4 (gchar * conn_name); +gboolean is_static_ip6 (gchar * conn_name); +gboolean is_ip4_address (gchar * in_address); +gboolean is_ip6_address (gchar * in_address); +gboolean has_ip6_address (gchar * conn_name); +gboolean has_default_route (gchar * conn_name, gboolean (*check_fn) (gchar *)); +gboolean reload_parsers (void); + +ip_block *convert_ip4_config_block (gchar * conn_name); +ip6_block *convert_ip6_config_block (gchar * conn_name); +ip_block *convert_ip4_routes_block (gchar * conn_name); +ip6_block *convert_ip6_routes_block (gchar * conn_name); +void destroy_ip_block (ip_block * iblock); +void destroy_ip6_block (ip6_block * iblock); + +void set_ip4_dns_servers (NMSettingIP4Config * s_ip4, gchar * conn_name); +void set_ip6_dns_servers (NMSettingIP6Config * s_ip6, gchar * conn_name); + +gchar *strip_string (gchar * str, gchar t); +gboolean is_managed (gchar * conn_name); + +GQuark ifnet_plugin_error_quark (void); +gchar *utils_hexstr2bin (const gchar * hex, size_t len); +gchar *utils_bin2hexstr (const gchar * bytes, int len, int final_len); + +gboolean is_hex (gchar * value); +gboolean is_ascii (gchar * value); +gboolean is_true (gchar * str); + +void get_dhcp_hostname_and_client_id (char **hostname, char **client_id); + +#endif diff --git a/system-settings/plugins/ifnet/nm-ifnet-connection.c b/system-settings/plugins/ifnet/nm-ifnet-connection.c new file mode 100644 index 0000000000..e47495cfbe --- /dev/null +++ b/system-settings/plugins/ifnet/nm-ifnet-connection.c @@ -0,0 +1,251 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Mu Qiao + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 1999-2010 Gentoo Foundation, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "nm-ifnet-connection.h" +#include "connection_parser.h" +#include "net_parser.h" +#include "net_utils.h" +#include "wpa_parser.h" +#include "plugin.h" + +static NMSettingsConnectionInterface *parent_settings_connection_iface; + +static void settings_connection_interface_init (NMSettingsConnectionInterface * + klass); + +G_DEFINE_TYPE_EXTENDED (NMIfnetConnection, nm_ifnet_connection, + NM_TYPE_SYSCONFIG_CONNECTION, 0, + G_IMPLEMENT_INTERFACE + (NM_TYPE_SETTINGS_CONNECTION_INTERFACE, + settings_connection_interface_init)) +// G_DEFINE_TYPE(NMIfnetConnection, nm_ifnet_connection, +// NM_TYPE_SYSCONFIG_CONNECTION) +#define NM_IFNET_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_IFNET_CONNECTION, NMIfnetConnectionPrivate)) +enum { + PROP_ZERO, + PROP_CONN_NAME, + _PROP_END, +}; + +enum { + IFNET_SETUP_MONITORS, + IFNET_CANCEL_MONITORS, + IFNET_LAST_SIGNAL +}; + +static guint signals[IFNET_LAST_SIGNAL] = { 0 }; + +typedef struct { + gchar *conn_name; + NMSystemConfigInterface *config; +} NMIfnetConnectionPrivate; + +NMIfnetConnection * +nm_ifnet_connection_new (gchar * conn_name) +{ + NMConnection *tmp; + GObject *object; + GError **error = NULL; + + g_return_val_if_fail (conn_name != NULL, NULL); + tmp = ifnet_update_connection_from_config_block (conn_name, error); + if (!tmp) + return NULL; + object = (GObject *) g_object_new (NM_TYPE_IFNET_CONNECTION, + NM_IFNET_CONNECTION_CONN_NAME, + conn_name, NULL); + if (!object) { + g_object_unref (tmp); + return NULL; + } + nm_sysconfig_connection_update (NM_SYSCONFIG_CONNECTION (object), tmp, + FALSE, NULL); + g_object_unref (tmp); + return NM_IFNET_CONNECTION (object); +} + +static void +nm_ifnet_connection_init (NMIfnetConnection * connection) +{ +} + +static gboolean +update (NMSettingsConnectionInterface * connection, + NMSettingsConnectionInterfaceUpdateFunc callback, gpointer user_data) +{ + GError *error = NULL; + gchar *new_conn_name = NULL; + gboolean result; + NMIfnetConnectionPrivate *priv = + NM_IFNET_CONNECTION_GET_PRIVATE (connection); + g_signal_emit (connection, signals[IFNET_CANCEL_MONITORS], 0); + if (!ifnet_update_parsers_by_connection + (NM_CONNECTION (connection), priv->conn_name, &new_conn_name, + CONF_NET_FILE, WPA_SUPPLICANT_CONF, &error)) { + if (new_conn_name) + g_free (new_conn_name); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Failed to update %s", + priv->conn_name); + reload_parsers (); + callback (connection, error, user_data); + g_error_free (error); + g_signal_emit (connection, signals[IFNET_SETUP_MONITORS], 0); + return FALSE; + } + + g_free (priv->conn_name); + priv->conn_name = new_conn_name; + result = + parent_settings_connection_iface->update (connection, callback, + user_data); + if (result) + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Successfully updated %s", + priv->conn_name); + g_signal_emit (connection, signals[IFNET_SETUP_MONITORS], 0); + return result; +} + +static gboolean +do_delete (NMSettingsConnectionInterface * connection, + NMSettingsConnectionInterfaceDeleteFunc callback, gpointer user_data) +{ + GError *error = NULL; + gboolean result; + NMIfnetConnectionPrivate *priv = + NM_IFNET_CONNECTION_GET_PRIVATE (connection); + g_signal_emit (connection, signals[IFNET_CANCEL_MONITORS], 0); + if (!ifnet_delete_connection_in_parsers + (priv->conn_name, CONF_NET_FILE, WPA_SUPPLICANT_CONF)) { + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Failed to delete %s", + priv->conn_name); + reload_parsers (); + callback (connection, error, user_data); + g_error_free (error); + g_signal_emit (connection, signals[IFNET_SETUP_MONITORS], 0); + return FALSE; + } + result = + parent_settings_connection_iface->delete (connection, callback, + user_data); + if (result) + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Successfully deleted %s", + priv->conn_name); + g_signal_emit (connection, signals[IFNET_SETUP_MONITORS], 0); + return result; +} + +static void +settings_connection_interface_init (NMSettingsConnectionInterface * iface) +{ + parent_settings_connection_iface = g_type_interface_peek_parent (iface); + iface->update = update; + iface->delete = do_delete; +} + +static void +set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) +{ + NMIfnetConnectionPrivate *priv = + NM_IFNET_CONNECTION_GET_PRIVATE (object); + g_return_if_fail (priv); + + switch (prop_id) { + case PROP_CONN_NAME: + if (priv->conn_name) + g_free (priv->conn_name); + priv->conn_name = g_strdup (g_value_get_pointer (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec) +{ + NMIfnetConnectionPrivate *priv = + NM_IFNET_CONNECTION_GET_PRIVATE (object); + g_return_if_fail (priv); + + switch (prop_id) { + case PROP_CONN_NAME: + g_value_set_pointer (value, priv->conn_name); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +finalize (GObject * object) +{ + NMIfnetConnectionPrivate *priv = + NM_IFNET_CONNECTION_GET_PRIVATE (object); + g_return_if_fail (priv); + + if (priv->conn_name) + g_free (priv->conn_name); + G_OBJECT_CLASS (nm_ifnet_connection_parent_class)->finalize (object); +} + +static void +nm_ifnet_connection_class_init (NMIfnetConnectionClass * ifnet_connection_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (ifnet_connection_class); + + g_type_class_add_private (ifnet_connection_class, + sizeof (NMIfnetConnectionPrivate)); + + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->finalize = finalize; + + /* Properties */ + g_object_class_install_property + (object_class, PROP_CONN_NAME, + g_param_spec_pointer (NM_IFNET_CONNECTION_CONN_NAME, + "config_block", + "", + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + signals[IFNET_SETUP_MONITORS] = + g_signal_new ("ifnet_setup_monitors", + G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, + 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + signals[IFNET_CANCEL_MONITORS] = + g_signal_new ("ifnet_cancel_monitors", + G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, + 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + +} diff --git a/system-settings/plugins/ifnet/nm-ifnet-connection.h b/system-settings/plugins/ifnet/nm-ifnet-connection.h new file mode 100644 index 0000000000..8b3d495f0b --- /dev/null +++ b/system-settings/plugins/ifnet/nm-ifnet-connection.h @@ -0,0 +1,49 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Mu Qiao + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 1999-2010 Gentoo Foundation, Inc. + */ + +#ifndef NM_IFNET_CONNECTION_H +#define NM_IFNET_CONNECTION_H + +#include +#include "net_parser.h" + +G_BEGIN_DECLS +#define NM_TYPE_IFNET_CONNECTION (nm_ifnet_connection_get_type ()) +#define NM_IFNET_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_IFNET_CONNECTION, NMIfnetConnection)) +#define NM_IFNET_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_IFNET_CONNECTION, NMIfnetConnectionClass)) +#define NM_IS_IFNET_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_IFNET_CONNECTION)) +#define NM_IS_IFNET_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_IFNET_CONNECTION)) +#define NM_IFNET_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_IFNET_CONNECTION, NMIfnetConnectionClass)) +#define NM_IFNET_CONNECTION_CONN_NAME "connection_name" + typedef struct { + NMSysconfigConnection parent; +} NMIfnetConnection; + +typedef struct { + NMSysconfigConnectionClass parent; +} NMIfnetConnectionClass; + +GType nm_ifnet_connection_get_type (void); + +NMIfnetConnection *nm_ifnet_connection_new (gchar * conn_name); + +G_END_DECLS +#endif /* NM_IFNET_CONNECTION_H */ diff --git a/system-settings/plugins/ifnet/plugin.c b/system-settings/plugins/ifnet/plugin.c new file mode 100644 index 0000000000..51d560246d --- /dev/null +++ b/system-settings/plugins/ifnet/plugin.c @@ -0,0 +1,585 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service (ifnet) + * + * Mu Qiao + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 1999-2010 Gentoo Foundation, Inc. + */ + +#include + +#include +#include +#include + +#include +#include + +#include "NetworkManager.h" +#include "nm-system-config-interface.h" +#include "nm-ifnet-connection.h" + +#include "plugin.h" +#include "net_utils.h" +#include "net_parser.h" +#include "wpa_parser.h" +#include "connection_parser.h" + +#define IFNET_PLUGIN_NAME_PRINT "ifnet" +#define IFNET_PLUGIN_INFO "(C) 1999-2010 Gentoo Foundation, Inc. To report bugs please use bugs.gentoo.org with [networkmanager] or [dagger] prefix." +#define IFNET_SYSTEM_HOSTNAME_FILE "/etc/conf.d/hostname" +#define IFNET_MANAGE_WELL_KNOWN_DEFAULT TRUE +#define IFNET_KEY_FILE_KEY_MANAGED "managed" + +typedef struct { + GHashTable *config_connections; + gchar *hostname; + gboolean unmanaged_well_known; + + GFileMonitor *hostname_monitor; + GFileMonitor *net_monitor; + GFileMonitor *wpa_monitor; + +} SCPluginIfnetPrivate; + +typedef void (*FileChangedFn) (gpointer user_data); + +typedef struct { + FileChangedFn callback; + gpointer user_data; +} FileMonitorInfo; + +static void system_config_interface_init (NMSystemConfigInterface * + system_config_interface_class); + +static void + reload_connections (gpointer config); + +G_DEFINE_TYPE_EXTENDED (SCPluginIfnet, sc_plugin_ifnet, G_TYPE_OBJECT, 0, + G_IMPLEMENT_INTERFACE (NM_TYPE_SYSTEM_CONFIG_INTERFACE, + system_config_interface_init)) +#define SC_PLUGIN_IFNET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SC_TYPE_PLUGIN_IFNET, SCPluginIfnetPrivate)) +/* +static void +ignore_cb(NMSettingsConnectionInterface * connection, + GError * error, gpointer user_data) +{ +} +*/ +static const char * +get_hostname (NMSystemConfigInterface * config) +{ + return SC_PLUGIN_IFNET_GET_PRIVATE (config)->hostname; +} + +static void +update_system_hostname (gpointer config) +{ + SCPluginIfnetPrivate *priv = SC_PLUGIN_IFNET_GET_PRIVATE (config); + + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Updating hostname"); + + if (priv->hostname) + g_free (priv->hostname); + priv->hostname = read_hostname (IFNET_SYSTEM_HOSTNAME_FILE); + + g_object_notify (G_OBJECT (config), + NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Hostname updated to: %s", + priv->hostname); +} + +static void +write_system_hostname (NMSystemConfigInterface * config, + const gchar * newhostname) +{ + SCPluginIfnetPrivate *priv = SC_PLUGIN_IFNET_GET_PRIVATE (config); + + g_return_if_fail (newhostname); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Write system hostname: %s", + newhostname); + if (write_hostname (newhostname, IFNET_SYSTEM_HOSTNAME_FILE)) { + if (priv->hostname) + g_free (priv->hostname); + priv->hostname = g_strdup (newhostname); + g_object_notify (G_OBJECT (config), + NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME); + } else + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Write system hostname: %s failed", newhostname); +} + +static gboolean +is_managed_plugin () +{ + gchar *result = NULL; + + result = + ifnet_get_global_setting (IFNET_KEY_FILE_GROUP, + IFNET_KEY_FILE_KEY_MANAGED); + if (result) { + if (is_true (result)) { + g_free (result); + return TRUE; + } else { + g_free (result); + return FALSE; + } + } + return IFNET_MANAGE_WELL_KNOWN_DEFAULT; +} + +static void +file_changed (GFileMonitor * monitor, + GFile * file, + GFile * other_file, + GFileMonitorEvent event_type, gpointer user_data) +{ + FileMonitorInfo *info; + + switch (event_type) { + case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: + info = (FileMonitorInfo *) user_data; + info->callback (info->user_data); + break; + default: + break; + } +} + +static GFileMonitor * +monitor_file_changes (const char *filename, + FileChangedFn callback, gpointer user_data) +{ + GFile *file; + GFileMonitor *monitor; + FileMonitorInfo *info; + GError **error = NULL; + + if (!g_file_test (filename, G_FILE_TEST_IS_REGULAR)) + return NULL; + file = g_file_new_for_path (filename); + monitor = g_file_monitor_file (file, G_FILE_MONITOR_NONE, NULL, error); + g_object_unref (file); + + if (monitor) { + info = g_new0 (FileMonitorInfo, 1); + info->callback = callback; + info->user_data = user_data; + g_object_weak_ref (G_OBJECT (monitor), (GWeakNotify) g_free, + info); + g_signal_connect (monitor, "changed", G_CALLBACK (file_changed), + info); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Monitoring %s", filename); + + } else + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Monitoring %s failed, error: %s", filename, + error == NULL ? "nothing" : (*error)->message); + + return monitor; +} + +static void +update_old_connection (gchar * conn_name, + NMIfnetConnection * old_conn, + NMIfnetConnection * new_conn, + SCPluginIfnetPrivate * priv) +{ + GError **error = NULL; + + if (!nm_sysconfig_connection_update (NM_SYSCONFIG_CONNECTION (old_conn), + NM_CONNECTION (new_conn), TRUE, + error)) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, "error updating: %s", + (error + && (*error)) ? (*error)->message : "(unknown)"); + } else + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Connection %s updated", + conn_name); + g_object_unref (new_conn); +} + +static void +setup_monitors (NMIfnetConnection * connection, gpointer user_data) +{ + SCPluginIfnet *self = SC_PLUGIN_IFNET (user_data); + SCPluginIfnetPrivate *priv = SC_PLUGIN_IFNET_GET_PRIVATE (self); + + priv->hostname_monitor = + monitor_file_changes (IFNET_SYSTEM_HOSTNAME_FILE, + update_system_hostname, user_data); + priv->net_monitor = + monitor_file_changes (CONF_NET_FILE, reload_connections, user_data); + priv->wpa_monitor = + monitor_file_changes (WPA_SUPPLICANT_CONF, reload_connections, + user_data); +} + +static void +cancel_monitors (NMIfnetConnection * connection, gpointer user_data) +{ + SCPluginIfnet *self = SC_PLUGIN_IFNET (user_data); + SCPluginIfnetPrivate *priv = SC_PLUGIN_IFNET_GET_PRIVATE (self); + + if (priv->hostname_monitor) { + g_file_monitor_cancel (priv->hostname_monitor); + g_object_unref (priv->hostname_monitor); + } + if (priv->net_monitor) { + g_file_monitor_cancel (priv->net_monitor); + g_object_unref (priv->net_monitor); + } + if (priv->wpa_monitor) { + g_file_monitor_cancel (priv->wpa_monitor); + g_object_unref (priv->wpa_monitor); + } +} + +static void +reload_connections (gpointer config) +{ + SCPluginIfnet *self = SC_PLUGIN_IFNET (config); + SCPluginIfnetPrivate *priv = SC_PLUGIN_IFNET_GET_PRIVATE (self); + GList *conn_names = NULL, *n_iter = NULL; + + /* save names for removing unused connections */ + GHashTable *new_conn_names = NULL; + GHashTableIter iter; + gpointer key; + gpointer value; + + if (priv->unmanaged_well_known) + return; + + if (!reload_parsers ()) + return; + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Loading connections"); + conn_names = ifnet_get_connection_names (); + new_conn_names = + g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + for (n_iter = conn_names; n_iter; n_iter = g_list_next (n_iter)) { + NMIfnetConnection *exported; + NMIfnetConnection *old; + gchar *conn_name = g_strdup (n_iter->data); + + /* add the new connection */ + exported = nm_ifnet_connection_new (conn_name); + if (!exported) { + g_free (conn_name); + continue; + } + g_signal_connect (G_OBJECT (exported), "ifnet_setup_monitors", + G_CALLBACK (setup_monitors), config); + g_signal_connect (G_OBJECT (exported), "ifnet_cancel_monitors", + G_CALLBACK (cancel_monitors), config); + old = g_hash_table_lookup (priv->config_connections, conn_name); + if (old && exported) { + gchar *auto_refresh = + ifnet_get_global_setting (IFNET_KEY_FILE_GROUP, + "auto_refresh"); + + if (auto_refresh && is_true (auto_refresh)) { + if (!nm_connection_compare (NM_CONNECTION (old), + NM_CONNECTION + (exported), + NM_SETTING_COMPARE_FLAG_EXACT)) + { + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "Auto refreshing %s", + conn_name); + g_signal_emit_by_name (old, + NM_SETTINGS_CONNECTION_INTERFACE_REMOVED); + g_hash_table_remove + (priv->config_connections, + conn_name); + g_hash_table_insert + (priv->config_connections, + g_strdup (conn_name), exported); + if (is_managed (conn_name)) + g_signal_emit_by_name (self, + NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, + exported); + } + } else + update_old_connection (conn_name, old, + exported, priv); + g_signal_emit_by_name (self, + NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED); + } else if (exported) { + g_hash_table_insert (priv->config_connections, + g_strdup (conn_name), exported); + if (is_managed (conn_name)) + g_signal_emit_by_name (self, + NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, + exported); + } + g_hash_table_insert (new_conn_names, conn_name, conn_name); + } + /* remove unused connections */ + g_hash_table_iter_init (&iter, priv->config_connections); + while (g_hash_table_iter_next (&iter, &key, &value)) { + if (!g_hash_table_lookup (new_conn_names, key)) { + g_signal_emit_by_name (value, + NM_SETTINGS_CONNECTION_INTERFACE_REMOVED); + g_hash_table_remove (priv->config_connections, key); + } + } + g_hash_table_remove_all (new_conn_names); + g_hash_table_destroy (new_conn_names); + g_list_free (conn_names); +} + +static gboolean +add_connection (NMSystemConfigInterface * config, + NMConnection * connection, GError ** error) +{ + gboolean result; + + result = ifnet_add_new_connection (connection, CONF_NET_FILE, + WPA_SUPPLICANT_CONF, error); + reload_connections (config); + return result; +} + +static void +check_unmanaged (gpointer key, gpointer data, gpointer user_data) +{ + GSList **list = (GSList **) user_data; + gchar *conn_name = (gchar *) key; + const char *unmanaged_spec; + GSList *iter; + + if (is_managed (conn_name)) + return; + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Checking unmanaged: %s", conn_name); + unmanaged_spec = ifnet_get_data (conn_name, "mac"); + if (!unmanaged_spec) + return; + + /* Just return if the unmanaged spec is already in the list */ + for (iter = *list; iter; iter = g_slist_next (iter)) { + if (!strcmp ((char *) iter->data, unmanaged_spec)) + return; + } + + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Add unmanaged: %s", unmanaged_spec); + *list = + g_slist_prepend (*list, g_strdup_printf ("mac:%s", unmanaged_spec)); +} + +static GSList * +get_unmanaged_specs (NMSystemConfigInterface * config) +{ + SCPluginIfnetPrivate *priv = SC_PLUGIN_IFNET_GET_PRIVATE (config); + GSList *list = NULL; + + g_return_val_if_fail (priv->config_connections != NULL, NULL); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "getting unmanaged specs..."); + g_hash_table_foreach (priv->config_connections, check_unmanaged, &list); + return list; +} + +static void +SCPluginIfnet_init (NMSystemConfigInterface * config) +{ + SCPluginIfnet *self = SC_PLUGIN_IFNET (config); + SCPluginIfnetPrivate *priv = SC_PLUGIN_IFNET_GET_PRIVATE (self); + + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Initializing!"); + if (!priv->config_connections) + priv->config_connections = + g_hash_table_new_full (g_str_hash, g_str_equal, g_free, + g_object_unref); + priv->unmanaged_well_known = !is_managed_plugin (); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "management mode: %s", + priv->unmanaged_well_known ? "unmanaged" : "managed"); + // GFileMonitor setup + setup_monitors (NULL, config); + reload_connections (config); + /* Now if we're running in managed mode, let NM know there are new connections */ + if (!priv->unmanaged_well_known) { + GHashTableIter iter; + gpointer key; + gpointer value; + + g_hash_table_iter_init (&iter, priv->config_connections); + while (g_hash_table_iter_next (&iter, &key, &value)) { + if (is_managed ((gchar *) key)) + g_signal_emit_by_name + (self, + NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, + NM_EXPORTED_CONNECTION (value)); + } + } + /* Read hostname */ + update_system_hostname (self); + + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Initialzation complete!"); +} + +static GSList * +SCPluginIfnet_get_connections (NMSystemConfigInterface * config) +{ + SCPluginIfnetPrivate *priv = SC_PLUGIN_IFNET_GET_PRIVATE (config); + GSList *connections = NULL; + GHashTableIter iter; + gpointer key, value; + + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "(%d) ... get_connections.", + GPOINTER_TO_UINT (config)); + if (priv->unmanaged_well_known) { + PLUGIN_PRINT (IFNET_PLUGIN_NAME, + "(%d) ... get_connections (managed=false): return empty list.", + GPOINTER_TO_UINT (config)); + return NULL; + } + + g_hash_table_iter_init (&iter, priv->config_connections); + while (g_hash_table_iter_next (&iter, &key, &value)) + if (is_managed ((gchar *) key)) + connections = g_slist_prepend (connections, value); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "(%d) connections count: %d", + GPOINTER_TO_UINT (config), g_slist_length (connections)); + return connections; +} + +static void +system_config_interface_init (NMSystemConfigInterface * + system_config_interface_class) +{ + system_config_interface_class->init = SCPluginIfnet_init; + system_config_interface_class->get_connections = + SCPluginIfnet_get_connections; + system_config_interface_class->get_unmanaged_specs = + get_unmanaged_specs; + system_config_interface_class->add_connection = add_connection; +} + +static void +sc_plugin_ifnet_init (SCPluginIfnet * plugin) +{ +} + +static void +get_property (GObject * object, guint prop_id, GValue * value, + GParamSpec * pspec) +{ + NMSystemConfigInterface *self = NM_SYSTEM_CONFIG_INTERFACE (object); + + switch (prop_id) { + case NM_SYSTEM_CONFIG_INTERFACE_PROP_NAME: + g_value_set_string (value, IFNET_PLUGIN_NAME_PRINT); + break; + case NM_SYSTEM_CONFIG_INTERFACE_PROP_INFO: + g_value_set_string (value, IFNET_PLUGIN_INFO); + break; + case NM_SYSTEM_CONFIG_INTERFACE_PROP_CAPABILITIES: + g_value_set_uint (value, + NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_CONNECTIONS + | + NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_HOSTNAME); + break; + case NM_SYSTEM_CONFIG_INTERFACE_PROP_HOSTNAME: + g_value_set_string (value, get_hostname (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +set_property (GObject * object, guint prop_id, const GValue * value, + GParamSpec * pspec) +{ + switch (prop_id) { + case NM_SYSTEM_CONFIG_INTERFACE_PROP_HOSTNAME:{ + const gchar *hostname = g_value_get_string (value); + + if (hostname && strlen (hostname) < 1) + hostname = NULL; + write_system_hostname (NM_SYSTEM_CONFIG_INTERFACE + (object), hostname); + break; + } + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +dispose (GObject * object) +{ + SCPluginIfnet *plugin = SC_PLUGIN_IFNET (object); + SCPluginIfnetPrivate *priv = SC_PLUGIN_IFNET_GET_PRIVATE (plugin); + + cancel_monitors (NULL, object); + if (priv->config_connections) { + g_hash_table_remove_all (priv->config_connections); + g_hash_table_destroy (priv->config_connections); + } + + if (priv->hostname) + g_free (priv->hostname); + ifnet_destroy (); + wpa_parser_destroy (); + G_OBJECT_CLASS (sc_plugin_ifnet_parent_class)->dispose (object); +} + +static void +sc_plugin_ifnet_class_init (SCPluginIfnetClass * req_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (req_class); + + g_type_class_add_private (req_class, sizeof (SCPluginIfnetPrivate)); + + object_class->dispose = dispose; + object_class->get_property = get_property; + object_class->set_property = set_property; + + g_object_class_override_property (object_class, + NM_SYSTEM_CONFIG_INTERFACE_PROP_NAME, + NM_SYSTEM_CONFIG_INTERFACE_NAME); + + g_object_class_override_property (object_class, + NM_SYSTEM_CONFIG_INTERFACE_PROP_INFO, + NM_SYSTEM_CONFIG_INTERFACE_INFO); + + g_object_class_override_property (object_class, + NM_SYSTEM_CONFIG_INTERFACE_PROP_CAPABILITIES, + NM_SYSTEM_CONFIG_INTERFACE_CAPABILITIES); + + g_object_class_override_property (object_class, + NM_SYSTEM_CONFIG_INTERFACE_PROP_HOSTNAME, + NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME); +} + +G_MODULE_EXPORT GObject * +nm_system_config_factory (void) +{ + static SCPluginIfnet *singleton = NULL; + + if (!singleton) + singleton + = + SC_PLUGIN_IFNET (g_object_new (SC_TYPE_PLUGIN_IFNET, NULL)); + else + g_object_ref (singleton); + return G_OBJECT (singleton); +} diff --git a/system-settings/plugins/ifnet/plugin.h b/system-settings/plugins/ifnet/plugin.h new file mode 100644 index 0000000000..83099b63a0 --- /dev/null +++ b/system-settings/plugins/ifnet/plugin.h @@ -0,0 +1,47 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service (ifnet) + * + * Mu Qiao + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 1999-2010 Gentoo Foundation, Inc. + */ + +#ifndef _PLUGIN_H_ +#define _PLUGIN_H_ + +#include + +#define SC_TYPE_PLUGIN_IFNET (sc_plugin_ifnet_get_type ()) +#define SC_PLUGIN_IFNET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SC_TYPE_PLUGIN_IFNET, SCPluginIfnet)) +#define SC_PLUGIN_IFNET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SC_TYPE_PLUGIN_IFNET, SCPluginIfnetClass)) +#define SC_IS_PLUGIN_IFNET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SC_TYPE_PLUGIN_IFNET)) +#define SC_IS_PLUGIN_IFNET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SC_TYPE_PLUGIN_IFNET)) +#define SC_PLUGIN_IFNET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SC_TYPE_PLUGIN_IFNET, SCPluginIfnetClass)) + +typedef struct _SCPluginIfnet SCPluginIfnet; +typedef struct _SCPluginIfnetClass SCPluginIfnetClass; + +struct _SCPluginIfnet { + GObject parent; +}; + +struct _SCPluginIfnetClass { + GObjectClass parent; +}; + +GType sc_plugin_ifnet_get_type (void); +#endif diff --git a/system-settings/plugins/ifnet/tests/Makefile.am b/system-settings/plugins/ifnet/tests/Makefile.am new file mode 100644 index 0000000000..ead3f1fc4f --- /dev/null +++ b/system-settings/plugins/ifnet/tests/Makefile.am @@ -0,0 +1,14 @@ +INCLUDES=-I$(top_srcdir)/system-settings/plugins/ifnet\ + -I$(top_srcdir)/libnm-glib \ + -I$(top_srcdir)/libnm-util \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/src/system-settings +TESTS = check_ifnet +check_PROGRAMS = check_ifnet +check_ifnet_SOURCES = test_all.c +check_ifnet_LDFLAGS = -g +check_ifnet_CPPFLAGS = $(CHECK_CFLAGS) $(GLIB_CFLAGS) -g +check_ifnet_LDADD = $(top_srcdir)/libnm-util/libnm-util.la\ + $(top_srcdir)/system-settings/plugins/ifnet/lib-ifnet-io.la\ + $(CHECK_LIBS)\ + $(GLIB_LIBS) diff --git a/system-settings/plugins/ifnet/tests/hostname b/system-settings/plugins/ifnet/tests/hostname new file mode 100644 index 0000000000..25c761655a --- /dev/null +++ b/system-settings/plugins/ifnet/tests/hostname @@ -0,0 +1,2 @@ +#Generated by NetworkManager +hostname="gentoo" diff --git a/system-settings/plugins/ifnet/tests/net b/system-settings/plugins/ifnet/tests/net new file mode 100644 index 0000000000..e755000238 --- /dev/null +++ b/system-settings/plugins/ifnet/tests/net @@ -0,0 +1,147 @@ +# This blank configuration will automatically use DHCP for any net.* +# scripts in /etc/init.d. To create a more complete configuration, +# please review /etc/conf.d/net.example and save your configuration +# in /etc/conf.d/net (this file :]!). + +config_eth0=( +"202.117.16.121 netmask 255.255.255.0 brd 202.117.16.255" +"192.168.4.121/24" +"dhcp6" +) +routes_eth0=( "default via 202.117.16.1" + "192.168.4.0/24 via 192.168.4.1") +dns_servers_eth0="202.117.0.20 202.117.0.21" +dns_search_eth0="p12.edu.cn p13.edu.cn" + +config_eth1=( + "dhcp" +) +enable_ipv6_eth1="true" +routes_eth1=( "default via 202.117.16.1" ) +dns_servers_eth1="202.117.0.20 202.117.0.21" +config_eth2=( +"202.117.16.1211 netmask 255.255.255.0 brd 202.117.16.255" +"192.168.4.121/24" +"4321:0:1:2:3:4:567:89ab/64" +) +routes_eth2=("default via 4321:0:1:2:3:4:567:89ab") +enable_ipv6_eth2="true" +config_eth3=("nufjlsjlll") +managed_eth4=("false") +routes_eth4=("default via 4321:0:1:2:3:4:567:89ab") +config_eth5=("dhcp") +config_eth6=("192.168.4.{1..101}/24") + +config_eth7=( "dhcp" ) +auto_eth7="true" + + +config_myxjtu2=("202.117.16.121/24 brd 202.117.16.255") +routes_myxjtu2=("default via 202.117.16.1") +dns_servers_myxjtu2="202.117.0.20 202.117.0.21" +#key_myxjtu2="[1] s:xjtud key [1] enc restricted" +#key_eth6="[1] aaaa-4444-3d [2] s:xjtudlc key [1] enc open" + + +username_ppp0='user' +password_ppp0='password' + +config_qiaomuf=("dhcp") + +config_1xtest=("dhcp") + +config_0xab3ace=("dhcp") + +modules=( "iproute2" ) + config_kvm0=( "null" ) + config_kvm1=( "null" ) + + tuntap_kvm0="tap" + tuntap_kvm1="tap" + tunctl_kvm0="-u user" + tunctl_kvm1="-u user" + +bridge_br0="eth0 kvm0 kvm1" +config_br0=( "192.168.1.10/24" ) + brctl_br0=( "setfd 0") + dhcp_eth1="nosendhost nontp -I" + +predown() { + # The default in the script is to test for NFS root and disallow + # downing interfaces in that case. Note that if you specify a + # predown() function you will override that logic. Here it is, in + # case you still want it... + if is_net_fs /; then + eerror "root filesystem is network mounted -- can't stop ${IFACE}" + return 1 + fi + + # Remember to return 0 on success + return 0 +} + +postup() { + # This function could be used, for example, to register with a + # dynamic DNS service. Another possibility would be to + # send/receive mail once the interface is brought up. + + # Here is an example that allows the use of iproute rules + # which have been configured using the rules_eth0 variable. + #rules_eth0=" \ + # 'from 24.80.102.112/32 to 192.168.1.0/24 table localnet priority 100' \ + # 'from 216.113.223.51/32 to 192.168.1.0/24 table localnet priority 100' \ + #" + eval set -- \$rules_${IFVAR} + if [ $# != 0 ]; then + einfo "Adding IP policy routing rules" + eindent + # Ensure that the kernel supports policy routing + if ! ip rule list | grep -q "^"; then + eerror "You need to enable IP Policy Routing (CONFIG_IP_MULTIPLE_TABLES)" + eerror "in your kernel to use ip rules" + else + for x; do + ebegin "${x}" + ip rule add ${x} + eend $? + done + fi + eoutdent + # Flush the cache + ip route flush cache dev "${IFACE}" + fi + +} + +postdown() { + # Enable Wake-On-LAN for every interface except for lo + # Probably a good idea to set ifdown="no" in /etc/conf.d/net + # as well ;) + [ "${IFACE}" != "lo" ] && ethtool -s "${IFACE}" wol g + + Automatically erase any ip rules created in the example postup above + if interface_exists "${IFACE}"; then + # Remove any rules for this interface + local rule + ip rule list | grep " iif ${IFACE}[ ]*" | { + while read rule; do + rule="${rule#*:}" + ip rule del ${rule} + done + } + # Flush the route cache + ip route flush cache dev "${IFACE}" + fi + + # Return 0 always + return 0 +} + +failup() { + # This function is mostly here for completeness... I haven't + # thought of anything nifty to do with it yet ;-) +} + +faildown() +{} + diff --git a/system-settings/plugins/ifnet/tests/net.all b/system-settings/plugins/ifnet/tests/net.all new file mode 100644 index 0000000000..a30a1b95e6 --- /dev/null +++ b/system-settings/plugins/ifnet/tests/net.all @@ -0,0 +1,864 @@ +############################################################################## +# QUICK-START +# +# The quickest start is if you want to use DHCP. +# In that case, everything should work out of the box, no configuration +# necessary, though the startup script will warn you that you haven't +# specified anything. + +# WARNING :- some examples have a mixture of IPv4 (ie 192.168.0.1) and IPv6 +# (ie 4321:0:1:2:3:4:567:89ab) internet addresses. They only work if you have +# the relevant kernel option enabled. So if you don't have an IPv6 enabled +# kernel then remove the IPv6 address from your config. + +# If you want to use a static address or use DHCP explicitly, jump +# down to the section labelled INTERFACE HANDLERS. +# +# If you want to do anything more fancy, you should take the time to +# read through the rest of this file. + +############################################################################## +# MODULES +# +# We now support modular networking scripts which means we can easily +# add support for new interface types and modules while keeping +# compatability with existing ones. +# +# Modules load by default if the package they need is installed. If +# you specify a module here that doesn't have it's package installed +# then you get an error stating which package you need to install. +# Ideally, you only use the modules setting when you have two or more +# packages installed that supply the same service. +# +# In other words, you probably should DO NOTHING HERE... + +# Prefer ifconfig over iproute2 +modules=( "ifconfig" ) + +# You can also specify other modules for an interface +# In this case we prefer udhcpc over dhcpcd +modules_eth0=( "udhcpc" ) + +# You can also specify which modules not to use - for example you may be +# using a supplicant or linux-wlan-ng to control wireless configuration but +# you still want to configure network settings per ESSID associated with. +modules=( "!iwconfig" "!wpa_supplicant" ) +# IMPORTANT: If you need the above, please disable modules in that order + + +############################################################################## +# INTERFACE HANDLERS +# +# We provide two interface handlers presently: ifconfig and iproute2. +# You need one of these to do any kind of network configuration. +# For ifconfig support, emerge sys-apps/net-tools +# For iproute2 support, emerge sys-apps/iproute2 + +# If you don't specify an interface then we prefer iproute2 if it's installed +# To prefer ifconfig over iproute2 +modules=( "ifconfig" ) + +# For a static configuration, use something like this +# (They all do exactly the same thing btw) +config_eth0=( "192.168.0.2/24" ) +config_eth0=( "192.168.0.2 netmask 255.255.255.0" ) + +# We can also specify a broadcast +config_eth0=( "192.168.0.2/24 brd 192.168.0.255" ) +config_eth0=( "192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" ) + +# If you need more than one address, you can use something like this +# NOTE: ifconfig creates an aliased device for each extra IPv4 address +# (eth0:1, eth0:2, etc) +# iproute2 does not do this as there is no need to +config_eth0=( + "192.168.0.2/24" + "192.168.0.3/24" + "192.168.0.4/24" +) +# Or you can use sequence expressions +config_eth0=( "192.168.0.{2..4}/24" ) +# which does the same as above. Be careful though as if you use this and +# fallbacks, you have to ensure that both end up with the same number of +# values otherwise your fallback won't work correctly. + +# You can also use IPv6 addresses +# (you should always specify a prefix length with IPv6 here) +config_eth0=( + "192.168.0.2/24" + "4321:0:1:2:3:4:567:89ab/64" + "4321:0:1:2:3:4:567:89ac/64" +) + +# If you wish to keep existing addresses + routing and the interface is up, +# you can specify a noop (no operation). If the interface is down or there +# are no addresses assigned, then we move onto the next step (default dhcp) +# This is useful when configuring your interface with a kernel command line +# or similar +config_eth0=( "noop" "192.168.0.2/24" ) + +# If you don't want ANY address (only useful when calling for advanced stuff) +config_eth0=( "null" ) + +# Here's how to do routing if you need it +routes_eth0=( + "default via 192.168.0.1" # IPv4 default route + "10.0.0.0/8 via 192.168.0.1" # IPv4 subnet route + "::/0" # IPv6 unicast +) + +# If a specified module fails (like dhcp - see below), you can specify a +# fallback like so +fallback_eth0=( "192.168.0.2 netmask 255.255.255.0" ) +fallback_route_eth0=( "default via 192.168.0.1" ) + +# NOTE: fallback entry must match the entry location in config_eth0 +# As such you can only have one fallback route. + +# Some users may need to alter the MTU - here's how +mtu_eth0="1500" + +# Each module described below can set a default base metric, lower is +# preferred over higher. This is so we can prefer a wired route over a +# wireless route automaticaly. You can override this by setting +metric_eth0="100" +# or on a global basis +metric="100" +# The only downside of the global setting is that you have to ensure that +# there are no conflicting routes yourself. For users with large routing +# tables you may have to set a global metric as the due to a simple read of +# the routing table taking over a minute at a time. + +############################################################################## +# OPTIONAL MODULES + +# INTERFACE RENAMING +# There is no consistent device renaming scheme for Linux. +# The preferred way of naming devices is via the kernel module directly or +# by using udev (http://www.reactivated.net/udevrules.php) + +# If you are unable to write udev rules, then we do provide a way of renaming +# the interface based on it's MAC address, but it is not optimal. +# Here is how to rename an interface whose MAC address is 00:11:22:33:44:55 +# to foo1 +rename_001122334455="foo1" + +# You can also do this based on current device name - although this is not +# recommended. Here we rename eth1 to foo2. +rename_eth1="foo2" + +#----------------------------------------------------------------------------- +# WIRELESS (802.11 support) +# Wireless can be provided by iwconfig or wpa_supplicant + +# iwconfig +# emerge net-wireless/wireless-tools +# Wireless options are held in /etc/conf.d/wireless - but could be here too +# Consult the sample file /etc/conf.d/wireless.example for instructions +# iwconfig is the default + +# wpa_supplicant +# emerge net-wireless/wpa-supplicant +# Wireless options are held in /etc/wpa_supplicant.conf +# Consult the sample file /etc/wpa_supplicant.conf.example for instructions +# To choose wpa_supplicant over iwconfig +modules=( "wpa_supplicant" ) +# To configure wpa_supplicant +wpa_supplicant_eth0="-Dwext" # For generic wireless +wpa_supplicant_ath0="-Dmadwifi" # For Atheros based cards +# Consult wpa_supplicant for more drivers +# By default don't wait for wpa_suppliant to associate and authenticate. +# If you would like to, so can specify how long in seconds +associate_timeout_eth0=60 +# A value of 0 means wait forever. + +# GENERIC WIRELESS OPTIONS +# PLEASE READ THE INSTRUCTIONS IN /etc/conf.d/wireless.example FOR +# HOW TO USE THIS ESSID VARIABLE +# You can also override any settings found here per ESSID - which is very +# handy if you use different networks a lot +config_ESSID=( "dhcp" ) +dhcpcd_ESSID="-t 5" + +# Setting name/domain server causes /etc/resolv.conf to be overwritten +# Note that if DHCP is used, and you want this to take precedence then + set dhcp_ESSID="nodns" +dns_servers_ESSID=( "192.168.0.1" "192.168.0.2" ) +dns_domain_ESSID="some.domain" +dns_search_ESSID="search.this.domain search.that.domain" +# Please check the man page for resolv.conf for more information +# as domain and search are mutually exclusive. + +# You can also override any settings found here per MAC address of the AP +# in case you use Access Points with the same ESSID but need different +# networking configs. Below is an example - of course you use the same +# method with other variables +mac_config_001122334455=( "dhcp" ) +mac_dhcpcd_001122334455="-t 10" +mac_dns_servers_001122334455=( "192.168.0.1" "192.168.0.2" ) + +# When an interface has been associated with an Access Point, a global +# variable called ESSID is set to the Access Point's ESSID for use in the +# pre/post user functions below (although it's not available in preup as you +# won't have associated then) + +# If you're using anything else to configure wireless on your interface AND +# you have installed any of the above packages, you need to disable them +modules=( "!iwconfig" "!wpa_supplicant" ) + +#----------------------------------------------------------------------------- +# DHCP +# DHCP can be provided by dhclient, dhcpcd, pump or udhcpc. +# +# dhclient: emerge net-misc/dhcp +# dhcpcd: emerge net-misc/dhcpcd +# pump: emerge net-misc/pump +# udhcpc: emerge net-misc/udhcp + +# If you have more than one DHCP client installed, you need to specify which +# one to use - otherwise we default to dhcpcd if available. +modules=( "dhclient" ) # to select dhclient over dhcpcd +# +# Notes: +# - All clients send the current hostname to the DHCP server by default +# - dhcpcd does not daemonize when the lease time is infinite +# - udhcp-0.9.3-r3 and earlier do not support getting NTP servers +# - pump does not support getting NIS servers +# - DHCP tends to erase any existing device information - so add +# static addresses after dhcp if you need them +# - dhclient and udhcpc can set other resolv.conf options such as "option" +# and "sortlist"- see the System module for more details + +# Regardless of which DHCP client you prefer, you configure them the +# same way using one of following depending on which interface modules +# you're using. +config_eth0=( "dhcp" ) + +# For passing custom options to dhcpcd use something like the following. This +# example reduces the timeout for retrieving an address from 60 seconds (the +# default) to 10 seconds. +dhcpcd_eth0="-t 10" + +# dhclient, udhcpc and pump don't have many runtime options +# You can pass options to them in a similar manner to dhcpcd though +dhclient_eth0="..." +udhcpc_eth0="..." +pump_eth0="..." + +# GENERIC DHCP OPTIONS +# Set generic DHCP options like so +dhcp_eth0="release nodns nontp nonis nogateway nosendhost" + +# This tells the dhcp client to release it's lease when it stops, not to +# overwrite dns, ntp and nis settings, not to set a default route and not to +# send the current hostname to the dhcp server and when it starts. +# You can use any combination of the above options - the default is not to +# use any of them. + +#----------------------------------------------------------------------------- +# For APIPA support, emerge net-misc/iputils or net-analyzer/arping + +# APIPA is a module that tries to find a free address in the range +# 169.254.0.0-169.254.255.255 by arping a random address in that range on the +# interface. If no reply is found then we assign that address to the interface + +# This is only useful for LANs where there is no DHCP server and you don't +# connect directly to the internet. +config_eth0=( "dhcp" ) +fallback_eth0=( "apipa" ) + +#----------------------------------------------------------------------------- +# ARPING Gateway configuration +# and +# Automatic Private IP Addressing (APIPA) +# For arpingnet / apipa support, emerge net-misc/iputils or net-analyzer/arping +# +# This is a module that tries to find a gateway IP. If it exists then we use +# that gateways configuration for our own. For the configuration variables +# simply ensure that each octet is zero padded and the dots are removed. +# Below is an example. +# +gateways_eth0="192.168.0.1 10.0.0.1" +config_192168000001=( "192.168.0.2/24" ) +routes_192168000001=( "default via 192.168.0.1" ) +dns_servers_192168000001=( "192.168.0.1" ) +config_010000000001=( "10.0.0.254/8" ) +routes_010000000001=( "default via 10.0.0.1" ) +dns_servers_010000000001=( "10.0.0.1" ) + +# We can also specify a specific MAC address for each gateway if different +# networks have the same gateway. +gateways_eth0="192.168.0.1,00:11:22:AA:BB:CC 10.0.0.1,33:44:55:DD:EE:FF" +config_192168000001_001122AABBCC=( "192.168.0.2/24" ) +routes_192168000001_001122AABBCC=( "default via 192.168.0.1" ) +dns_servers_192168000001_001122AABBCC=( "192.168.0.1" ) +config_010000000001_334455DDEEFF=( "10.0.0.254/8" ) +routes_010000000001_334455DDEEFF=( "default via 10.0.0.1" ) +dns_servers_010000000001_334455DDEEFF=( "10.0.0.1" ) + +# If we don't find any gateways (or there are none configured) then we try and +# use APIPA to find a free address in the range 169.254.0.0-169.254.255.255 +# by arping a random address in that range on the interface. If no reply is +# found then we assign that address to the interface. + +# This is only useful for LANs where there is no DHCP server. +config_eth0=( "arping" ) + +# or if no DHCP server can be found +config_eth0=( "dhcp" ) +fallback_eth0=( "arping" ) + +# NOTE: We default to sleeping for 1 second the first time we attempt an +# arping to give the interface time to settle on the LAN. This appears to +# be a good default for most instances, but if not you can alter it here. +arping_sleep=5 +arping_sleep_lan=7 + +# NOTE: We default to waiting 3 seconds to get an arping response. You can +# change the default wait like so. +arping_wait=3 +arping_wait_lan=2 + +#----------------------------------------------------------------------------- +# VLAN (802.1q support) +# For VLAN support, emerge net-misc/vconfig + +# Specify the VLAN numbers for the interface like so +# Please ensure your VLAN IDs are NOT zero-padded +vlans_eth0="1 2" + +# You may not want to assign an IP the the physical interface, but we still +# need it up. +config_eth0=( "null" ) + +# You can also configure the VLAN - see for vconfig man page for more details +vconfig_eth0=( "set_name_type VLAN_PLUS_VID_NO_PAD" ) +vconfig_vlan1=( "set_flag 1" "set_egress_map 2 6" ) +config_vlan1=( "172.16.3.1 netmask 255.255.254.0" ) +config_vlan2=( "172.16.2.1 netmask 255.255.254.0" ) + +# NOTE: Vlans can be configured with a . in their interface names +# When configuring vlans with this name type, you need to replace . with a _ +config_eth0.1=( "dhcp" ) - does not work +config_eth0_1=( "dhcp" ) - does work + +# NOTE: Vlans are controlled by their physical interface and not per vlan +# This means you do not need to create init scripts in /etc/init.d for each +# vlan, you must need to create one for the physical interface. +# If you wish to control the configuration of each vlan through a separate +# script, or wish to rename the vlan interface to something that vconfig +# cannot then you need to do this. +vlan_start_eth0="no" + +# If you do the above then you may want to depend on eth0 like so + RC_NEED_vlan1="net.eth0" +# NOTE: depend functions only work in /etc/conf.d/net +# and not in profile configs such as /etc/conf.d/net.foo + +#----------------------------------------------------------------------------- +# Bonding +# For link bonding/trunking emerge net-misc/ifenslave + +# To bond interfaces together +slaves_bond0="eth0 eth1 eth2" +config_bond0=( "null" ) # You may not want to assign an IP the the bond + +# If any of the slaves require extra configuration - for example wireless or +# ppp devices - we need to depend function on the bonded interfaces +RC_NEED_bond0="net.eth0 net.eth1" + + +#----------------------------------------------------------------------------- +# Classical IP over ATM +# For CLIP support emerge net-dialup/linux-atm + +# Ensure that you have /etc/atmsigd.conf setup correctly +# Now setup each clip interface like so +clip_atm0=( "peer_ip [if.]vpi.vci [opts]" ... ) +# where "peer_ip" is the IP address of a PVC peer (in case of an ATM connection +# with your ISP, your only peer is usually the ISP gateway closest to you), +# "if" is the number of the ATM interface which will carry the PVC, "vpi.vci" +# is the ATM VC address, and "opts" may optionally specify VC parameters like +# qos, pcr, and the like (see "atmarp -s" for further reference). Please also +# note quoting: it is meant to distinguish the VCs you want to create. You may, +# in example, create an atm0 interface to more peers, like this: +clip_atm0=( "1.1.1.254 0.8.35" "1.1.1.253 1.8.35" ) + +# By default, the PVC will use the LLC/SNAP encapsulation. If you rather need a +# null encapsulation (aka "VC mode"), please add the keyword "null" to opts. + + +#----------------------------------------------------------------------------- +# PPP +# For PPP support, emerge net-dialup/ppp +# PPP is used for most dialup connections, including ADSL. +# The older ADSL module is documented below, but you are encouraged to try +# this module first. +# +# You need to create the PPP net script yourself. Make it like so +#ln -s net.lo /etc/init.d/net.ppp0 +# +# We have to instruct ppp0 to actually use ppp +config_ppp0=( "ppp" ) +# +# Each PPP interface requires an interface to use as a "Link" +link_ppp0="/dev/ttyS0" # Most PPP links will use a serial port +link_ppp0="eth0" # PPPoE requires an ethernet interface +link_ppp0="[itf.]vpi.vci" # PPPoA requires the ATM VC's address +link_ppp0="/dev/null" # ISDN links should have this +link_ppp0="pty 'your_link_command'" # PPP links over ssh, rsh, etc +# +# Here you should specify what pppd plugins you want to use +# Available plugins are: pppoe, pppoa, capi, dhcpc, minconn, radius, +# radattr, radrealms and winbind +plugins_ppp0=( + "pppoe" # Required plugin for PPPoE + "pppoa vc-encaps" # Required plugin for PPPoA with an option + "capi" # Required plugin for ISDN +) +# +# PPP requires at least a username. You can optionally set a password here too +# If you don't, then it will use the password specified in /etc/ppp/*-secrets +# against the specified username +username_ppp0='user' +password_ppp0='password' +# NOTE: You can set a blank password like so +password_ppp0= +# +# The PPP daemon has many options you can specify - although there are many +# and may seem daunting, it is recommended that you read the pppd man page +# before enabling any of them +pppd_ppp0=( + "maxfail 0" # WARNING: It's not recommended you use this + # if you don't specify maxfail then we assume 0 + "updetach" # If not set, "/etc/init.d/net.ppp0 start" will return + # immediately, without waiting the link to come up + # for the first time. + # Do not use it for dial-on-demand links! + "debug" # Enables syslog debugging + "noauth" # Do not require the peer to authenticate itself + "defaultroute" # Make this PPP interface the default route + "usepeerdns" # Use the DNS settings provided by PPP + +# On demand options + "demand" # Enable dial on demand + "idle 30" # Link goes down after 30 seconds of inactivity + "10.112.112.112:10.112.112.113" # Phony IP addresses + "ipcp-accept-remote" # Accept the peers idea of remote address + "ipcp-accept-local" # Accept the peers idea of local address + "holdoff 3" # Wait 3 seconds after link dies before re-starting + +# Dead peer detection + "lcp-echo-interval 15" # Send a LCP echo every 15 seconds + "lcp-echo-failure 3" # Make peer dead after 3 consective + # echo-requests + +# Compression options - use these to completely disable compression +# noaccomp noccp nobsdcomp nodeflate nopcomp novj novjccomp + +# Dial-up settings + "lock" # Lock serial port + "115200" # Set the serial port baud rate + "modem crtscts" # Enable hardware flow control + "192.168.0.1:192.168.0.2" # Local and remote IP addresses +) +# +# Dial-up PPP users need to specify at least one telephone number +phone_number_ppp0=( "12345689" ) # Maximum 2 phone numbers are supported +# They will also need a chat script - here's a good one +chat_ppp0=( +# 'ABORT' 'BUSY' +# 'ABORT' 'ERROR' +# 'ABORT' 'NO ANSWER' +# 'ABORT' 'NO CARRIER' +# 'ABORT' 'NO DIALTONE' +# 'ABORT' 'Invalid Login' +# 'ABORT' 'Login incorrect' +# 'TIMEOUT' '5' +# '' 'ATZ' +# 'OK' 'AT' # Put your modem initialization string here +# 'OK' 'ATDT\T' +# 'TIMEOUT' '60' +# 'CONNECT' '' +# 'TIMEOUT' '5' +# '~--' '' +) + +# If the link require extra configuration - for example wireless or +# RFC 268 bridge - we need to depend on the bridge so they get +# configured correctly. +RC_NEED_ppp0="net.nas0" + +#WARNING: if MTU of the PPP interface is less than 1500 and you use this +#machine as a router, you should add the following rule to your firewall +# +#iptables -I FORWARD 1 -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu + +#----------------------------------------------------------------------------- +# ADSL +# For ADSL support, emerge net-dialup/rp-pppoe +# WARNING: This ADSL module is being deprecated in favour of the PPP module +# above. +# You should make the following settings and also put your +# username/password information in /etc/ppp/pap-secrets + +# Configure the interface to use ADSL +config_eth0=( "adsl" ) + +# You probably won't need to edit /etc/ppp/pppoe.conf if you set this +adsl_user_eth0="my-adsl-username" + +#----------------------------------------------------------------------------- +# ISDN +# For ISDN support, emerge net-dialup/isdn4k-utils +# You should make the following settings and also put your +# username/password information in /etc/ppp/pap-secrets + +# Configure the interface to use ISDN +config_ippp0=( "dhcp" ) +# It's important to specify dhcp if you need it! +config_ippp0=( "192.168.0.1/24" ) +# Otherwise, you can use a static IP + +# NOTE: The interface name must be either ippp or isdn followed by a number + +# You may need this option to set the default route +ipppd_eth0="defaultroute" + +#----------------------------------------------------------------------------- +# MAC changer +# To set a specific MAC address +mac_eth0="00:11:22:33:44:55" + +# For changing MAC addresses using the below, emerge net-analyzer/macchanger +# - to randomize the last 3 bytes only +mac_eth0="random-ending" +# - to randomize between the same physical type of connection (e.g. fibre, +# copper, wireless) , all vendors +mac_eth0="random-samekind" +# - to randomize between any physical type of connection (e.g. fibre, copper, +# wireless) , all vendors +mac_eth0="random-anykind" +# - full randomization - WARNING: some MAC addresses generated by this may NOT +# act as expected +mac_eth0="random-full" +# custom - passes all parameters directly to net-analyzer/macchanger +mac_eth0="some custom set of parameters" + +# You can also set other options based on the MAC address of your network card +# Handy if you use different docking stations with laptops +config_001122334455=( "dhcp" ) + +#----------------------------------------------------------------------------- +# TUN/TAP +# For TUN/TAP support emerge net-misc/openvpn or sys-apps/usermode-utilities +# +# You must specify if we're a tun or tap device. Then you can give it any +# name you like - such as vpn +tuntap_vpn="tun" +config_vpn=( "192.168.0.1/24") + +# Or stick wit the generic names - like tap0 +tuntap_tap0="tap" +config_tap0=( "192.168.0.1/24") + +# For passing custom options to tunctl use something like the following. This +# example sets the owner to adm +tunctl_tun1="-u adm" +# When using openvpn, there are no options + +#----------------------------------------------------------------------------- +# Bridging (802.1d) +# For bridging support emerge net-misc/bridge-utils + +# To add ports to bridge br0 +bridge_br0="eth0 eth1" +# or dynamically add them when the interface comes up +bridge_add_eth0="br0" +bridge_add_eth1="br0" + +# You need to configure the ports to null values so dhcp does not get started +config_eth0=( "null" ) +config_eth1=( "null" ) + +# Finally give the bridge an address - dhcp or a static IP +config_br0=( "dhcp" ) # may not work when adding ports dynamically +config_br0=( "192.168.0.1/24" ) + +# If any of the ports require extra configuration - for example wireless or +# ppp devices - we need to depend on them like so. +RC_NEED_br0="net.eth0 net.eth1" + +# Below is an example of configuring the bridge +# Consult "man brctl" for more details +brctl_br0=( "setfd 0" "sethello 0" "stp off" ) + +#----------------------------------------------------------------------------- +# RFC 2684 Bridge Support +# For RFC 2684 bridge support emerge net-misc/br2684ctl + +# Interface names have to be of the form nas0, nas1, nas2, etc. +# You have to specify a VPI and VCI for the interface like so +br2684ctl_nas0="-a 0.38" # UK VPI and VCI + +# You may want to configure the encapsulation method as well by adding the -e +# option to the command above (may need to be before the -a command) +# -e 0 # LLC (default) +# -e 1 # VC mux + +# Then you can configure the interface as normal +config_nas0=( "192.168.0.1/24" ) + +#----------------------------------------------------------------------------- +# Tunnelling +# WARNING: For tunnelling it is highly recommended that you +# emerge sys-apps/iproute2 +# +# For GRE tunnels +iptunnel_vpn0="mode gre remote 207.170.82.1 key 0xffffffff ttl 255" + +# For IPIP tunnels +iptunnel_vpn0="mode ipip remote 207.170.82.2 ttl 255" + +# To configure the interface +config_vpn0=( "192.168.0.2 pointopoint 192.168.1.2" ) # ifconfig style +config_vpn0=( "192.168.0.2 peer 192.168.1.1" ) # iproute2 style + +# 6to4 Tunnels allow IPv6 to work over IPv4 addresses, provided you +# have a non-private address configured on an interface. + link_6to4="eth0" # Interface to base it's addresses on + config_6to4=( "ip6to4" ) +# You may want to depend on eth0 like so +RC_NEED_6to4="net.eth0" +# To ensure that eth0 is configured before 6to4. Of course, the tunnel could be +# any name and this also works for any configured interface. +# NOTE: If you're not using iproute2 then your 6to4 tunnel has to be called +# sit0 - otherwise use a different name like 6to4 in the example above. + + +#----------------------------------------------------------------------------- +# System +# For configuring system specifics such as domain, dns, ntp and nis servers +# It's rare that you would need todo this, but you can anyway. +# This is most benefit to wireless users who don't use DHCP so they can change +# their configs based on ESSID. See wireless.example for more details + +# To use dns settings such as these, dns_servers_eth0 must be set! +# If you omit the _eth0 suffix, then it applies to all interfaces unless +# overridden by the interface suffix. +dns_domain_eth0="your.domain" +dns_servers_eth0="192.168.0.2 192.168.0.3" +dns_search_eth0="this.domain that.domain" +dns_options_eth0=( "timeout 1" "rotate" ) +dns_sortlist_eth0="130.155.160.0/255.255.240.0 130.155.0.0" +# See the man page for resolv.conf for details about the options and sortlist +# directives + +ntp_servers_eth0="192.168.0.2 192.168.0.3" + +nis_domain_eth0="domain" +nis_servers_eth0="192.168.0.2 192.168.0.3" + +# NOTE: Setting any of these will stamp on the files in question. So if you +# don't specify dns_servers but you do specify dns_domain then no nameservers +# will be listed in /etc/resolv.conf even if there were any there to start +# with. +# If this is an issue for you then maybe you should look into a resolv.conf +# manager like resolvconf-gentoo to manage this file for you. All packages +# that baselayout supports use resolvconf-gentoo if installed. + +#----------------------------------------------------------------------------- +# Cable in/out detection +# Sometimes the cable is in, others it's out. Obviously you don't want to +# restart net.eth0 every time when you plug it in either. +# +# netplug is a package that detects this and requires no extra configuration +# on your part. +# emerge sys-apps/netplug +# or +# emerge sys-apps/ifplugd +# and you're done :) + +# By default we don't wait for netplug/ifplugd to configure the interface. +# If you would like it to wait so that other services now that network is up +# then you can specify a timeout here. +plug_timeout="10" +# A value of 0 means wait forever. + +# If you don't want to use netplug on a specific interface but you have it +# installed, you can disable it for that interface via the modules statement +modules_eth0=( "!netplug" ) +# You can do the same for ifplugd +# +# You can disable them both with the generic plug +modules_eth0=( "!plug" ) + +# To use specific ifplugd options, fex specifying wireless mode +ifplugd_eth0="--api-mode=wlan" +# man ifplugd for more options + +############################################################################## +# ADVANCED CONFIGURATION +# +# Four functions can be defined which will be called surrounding the +# start/stop operations. The functions are called with the interface +# name first so that one function can control multiple adapters. An extra two +# functions can be defined when an interface fails to start or stop. +# +# The return values for the preup and predown functions should be 0 +# (success) to indicate that configuration or deconfiguration of the +# interface can continue. If preup returns a non-zero value, then +# interface configuration will be aborted. If predown returns a +# non-zero value, then the interface will not be allowed to continue +# deconfiguration. +# +# The return values for the postup, postdown, failup and faildown functions are +# ignored since there's nothing to do if they indicate failure. +# +# ${IFACE} is set to the interface being brought up/down +# ${IFVAR} is ${IFACE} converted to variable name bash allows + +#preup() { +# # Test for link on the interface prior to bringing it up. This +# # only works on some network adapters and requires the mii-diag +# # package to be installed. +# if mii-tool "${IFACE}" 2> /dev/null | grep -q 'no link'; then +# ewarn "No link on ${IFACE}, aborting configuration" +# return 1 +# fi +# +# # Test for link on the interface prior to bringing it up. This +# # only works on some network adapters and requires the ethtool +# # package to be installed. +# if ethtool "${IFACE}" | grep -q 'Link detected: no'; then +# ewarn "No link on ${IFACE}, aborting configuration" +# return 1 +# fi +# +# +# # Remember to return 0 on success +# return 0 +#} + +#predown() { +# # The default in the script is to test for NFS root and disallow +# # downing interfaces in that case. Note that if you specify a +# # predown() function you will override that logic. Here it is, in +# # case you still want it... +# if is_net_fs /; then +# eerror "root filesystem is network mounted -- can't stop ${IFACE}" +# return 1 +# fi +# +# # Remember to return 0 on success +# return 0 +#} + +#postup() { +# # This function could be used, for example, to register with a +# # dynamic DNS service. Another possibility would be to +# # send/receive mail once the interface is brought up. + +# # Here is an example that allows the use of iproute rules +# # which have been configured using the rules_eth0 variable. +# #rules_eth0=( +# # "from 24.80.102.112/32 to 192.168.1.0/24 table localnet priority 100" +# # "from 216.113.223.51/32 to 192.168.1.0/24 table localnet priority 100" +# #) +# local x="rules_${IFVAR}[@]" +# local -a rules=( "${!x}" ) +# if [[ -n ${rules} ]] ; then +# einfo "Adding IP policy routing rules" +# eindent +# # Ensure that the kernel supports policy routing +# if ! ip rule list | grep -q "^" ; then +# eerror "You need to enable IP Policy Routing (CONFIG_IP_MULTIPLE_TABLES)" +# eerror "in your kernel to use ip rules" +# else +# for x in "${rules[@]}" ; do +# ebegin "${x}" +# ip rule add ${x} dev "${IFACE}" +# eend $? +# done +# fi +# eoutdent +# # Flush the cache +# ip route flush cache dev "${IFACE}" +# fi + +#} + +#postdown() { +# # Enable Wake-On-LAN for every interface except for lo +# # Probably a good idea to set RC_DOWN_INTERFACE="no" in /etc/conf.d/rc +# # as well ;) +# [[ ${IFACE} != "lo" ]] && ethtool -s "${IFACE}" wol g + +# Automatically erase any ip rules created in the example postup above +# if interface_exists "${IFACE}" ; then +# # Remove any rules for this interface +# local rule +# ip rule list | grep " iif ${IFACE}[ ]*" | { +# while read rule ; do +# rule="${rule#*:}" +# ip rule del ${rule} +# done +# } +# # Flush the route cache +# ip route flush cache dev "${IFACE}" +# fi + +# # Return 0 always +# return 0 +#} + +#failup() { +# # This function is mostly here for completeness... I haven't +# # thought of anything nifty to do with it yet ;-) +#} + +#faildown() { +# # This function is mostly here for completeness... I haven't +# # thought of anything nifty to do with it yet ;-) +#} + +############################################################################## +# FORCING MODULES +# The Big Fat Warning :- If you use module forcing do not complain to us or +# file bugs about it not working! +# +# Loading modules is a slow affair - we have to check each one for the following +# 1) Code sanity +# 2) Has the required package been emerged? +# 3) Has it modified anything? +# 4) Have all the dependant modules been loaded? + +# Then we have to strip out the conflicting modules based on user preference +# and default configuration and sort them into the correct order. +# Finally we check the end result for dependencies. + +# This, of course, takes valuable CPU time so we provide module forcing as a +# means to speed things up. We still do *some* checking but not much. + +# It is essential that you force modules in the correct order and supply all +# the modules you need. You must always supply an interface module - we +# supply ifconfig or iproute2. + +# The Big Fat Warning :- If you use module forcing do not complain to us or +# file bugs about it not working! + +# Now that we've warned you twice, here's how to do it +modules_force=( "ifconfig" ) +modules_force=( "iproute2" "dhcpcd" ) + +# We can also apply this to a specific interface +modules_force_eth1=( "iproute2" ) + +# The below will not work +modules_force=( "dhcpcd" ) +# No interface (ifconfig/iproute2) +modules_force=( "ifconfig" "essidnet" "iwconfig" ) +# Although it will not crash, essidnet will not work as it has to come after +# iwconfig +modules_force=( "iproute2" "ifconfig" ) +# The interface will be setup twice which will cause problems diff --git a/system-settings/plugins/ifnet/tests/nm-system-settings.conf b/system-settings/plugins/ifnet/tests/nm-system-settings.conf new file mode 100644 index 0000000000..39bc87b8be --- /dev/null +++ b/system-settings/plugins/ifnet/tests/nm-system-settings.conf @@ -0,0 +1,5 @@ +[main] +plugins=ifnet,keyfile + +[ifnet] +managed=false diff --git a/system-settings/plugins/ifnet/tests/test_all.c b/system-settings/plugins/ifnet/tests/test_all.c new file mode 100644 index 0000000000..ba98397616 --- /dev/null +++ b/system-settings/plugins/ifnet/tests/test_all.c @@ -0,0 +1,379 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service (ifnet) + * + * Mu Qiao + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 1999-2010 Gentoo Foundation, Inc. + */ + +#include +#include +#include +#include +#include +#include + +#include "net_parser.h" +#include "nm-test-helpers.h" +#include "net_utils.h" +#include "wpa_parser.h" +#include "connection_parser.h" + +static void +test_getdata () +{ + ASSERT (ifnet_get_data ("eth1", "config") + && strcmp (ifnet_get_data ("eth1", "config"), "dhcp") == 0, + "get data", "config_eth1 is not correct"); + ASSERT (ifnet_get_data ("ppp0", "username") + && strcmp (ifnet_get_data ("ppp0", "username"), "user") == 0, + "get data", "config_ppp0 username is not correctly read"); + ASSERT (ifnet_get_data ("ppp0", "password") + && strcmp (ifnet_get_data ("ppp0", "password"), + "password") == 0, "get data", + "config_ppp0 password is not correctly read"); +} + +static void +test_read_hostname () +{ + gchar *hostname = read_hostname ("hostname"); + + ASSERT (hostname != NULL, "get hostname", "hostname is NULL"); + ASSERT (strcmp ("gentoo", hostname) == 0, + "get hostname", + "hostname is not correctly read, read:%s, expected: gentoo", + hostname); +} + +static void +test_write_hostname () +{ + gchar *hostname = read_hostname ("hostname"); + + write_hostname ("gentoo-nm", "hostname"); + ASSERT (strcmp (read_hostname ("hostname"), "gentoo-nm") == 0, + "write hostname", "write hostname error"); + write_hostname (hostname, "hostname"); +} + +static void +test_is_static () +{ + ASSERT (is_static_ip4 ("eth1") == FALSE, "is static", + "a dhcp interface is recognized as static"); + ASSERT (is_static_ip4 ("eth0") == TRUE, "is static", + "a static interface is recognized as dhcp"); + ASSERT (!is_static_ip6 ("eth0") == TRUE, "is static", + "a static interface is recognized as dhcp"); +} + +static void +test_has_default_route () +{ + ASSERT (has_default_ip4_route ("eth0"), "has default route", + "eth0 should have a default ipv4 route"); + ASSERT (has_default_ip6_route ("eth4"), "has default route", + "eth4 should have a default ipv6 route"); + + ASSERT (!has_default_ip4_route ("eth5") + && !has_default_ip6_route ("eth5"), "has default route", + "eth5 shouldn't have a default route"); +} + +static void +test_has_ip6_address () +{ + ASSERT (has_ip6_address ("eth2"), "has ip6 address", + "eth2 should have a ipv6 address"); + ASSERT (!has_ip6_address ("eth0"), "has ip6 address", + "eth0 shouldn't have a ipv6 address") + +} + +static void +test_is_ip4_address () +{ + gchar *address1 = "192.168.4.232/24"; + gchar *address2 = "192.168.100.{1..254}/24"; + gchar *address3 = "192.168.4.2555/24"; + + ASSERT (is_ip4_address (address1), "is ip4 address", + "%s should be a valid address", address1); + ASSERT (is_ip4_address (address2), "is ip4 address", + "%s should be a valid address", address2); + ASSERT (!is_ip4_address (address3), "is ip4 address", + "%s should be an invalid address", address3); +} + +static void +test_is_ip6_address () +{ + gchar *address1 = "4321:0:1:2:3:4:567:89ac/24"; + + ASSERT (is_ip6_address (address1), "is ip6 address", + "%s should be a valid address", address1); +} + +static void +check_ip_block (ip_block * iblock, gchar * ip, gchar * netmask, gchar * gateway) +{ + char *str; + struct in_addr tmp_ip4_addr; + + str = malloc (INET_ADDRSTRLEN); + tmp_ip4_addr.s_addr = iblock->ip; + inet_ntop (AF_INET, &tmp_ip4_addr, str, INET_ADDRSTRLEN); + ASSERT (strcmp (ip, str) == 0, "check ip", "ip expected:%s, find:%s", + ip, str); + tmp_ip4_addr.s_addr = iblock->netmask; + inet_ntop (AF_INET, &tmp_ip4_addr, str, INET_ADDRSTRLEN); + ASSERT (strcmp (netmask, str) == 0, "check netmask", + "netmask expected:%s, find:%s", netmask, str); + tmp_ip4_addr.s_addr = iblock->gateway; + inet_ntop (AF_INET, &tmp_ip4_addr, str, INET_ADDRSTRLEN); + ASSERT (strcmp (gateway, str) == 0, "check gateway", + "gateway expected:%s, find:%s", gateway, str); + free (str); +} + +static void +test_convert_ipv4_config_block () +{ + ip_block *iblock = convert_ip4_config_block ("eth0"); + ip_block *tmp = iblock; + + ASSERT (iblock != NULL, "convert ipv4 block", + "block eth0 should not be NULL"); + check_ip_block (iblock, "202.117.16.121", "255.255.255.0", + "202.117.16.1"); + iblock = iblock->next; + destroy_ip_block (tmp); + ASSERT (iblock != NULL, "convert ipv4 block", + "block eth0 should have a second IP address"); + check_ip_block (iblock, "192.168.4.121", "255.255.255.0", + "202.117.16.1"); + destroy_ip_block (iblock); + iblock = convert_ip4_config_block ("eth2"); + ASSERT (iblock != NULL + && iblock->next == NULL, "convert error IPv4 address", + "should only get one address"); + check_ip_block (iblock, "192.168.4.121", "255.255.255.0", "0.0.0.0"); + destroy_ip_block (iblock); + iblock = convert_ip4_config_block ("eth3"); + ASSERT (iblock == NULL, "convert config_block", + "convert error configuration"); + destroy_ip_block (iblock); + iblock = convert_ip4_config_block ("eth6"); + ASSERT (iblock != NULL, "convert config_block", + "convert error configuration"); + destroy_ip_block (iblock); + +} + +static void +test_convert_ipv4_routes_block () +{ + ip_block *iblock = convert_ip4_routes_block ("eth0"); + ip_block *tmp = iblock; + + ASSERT (iblock != NULL, "convert ip4 routes", "should get one route"); + check_ip_block (iblock, "192.168.4.0", "255.255.255.0", "192.168.4.1"); + iblock = iblock->next; + destroy_ip_block (tmp); + ASSERT (iblock == NULL, "convert ip4 routes", + "should only get one route"); +} + +static void +test_wpa_parser () +{ + gchar *value; + + ASSERT (exist_ssid ("example"), "get wsec", + "ssid myxjtu2 is not found"); + ASSERT (exist_ssid ("static-wep-test"), "exist_ssid", + "ssid static-wep-test is not found"); + value = wpa_get_value ("static-wep-test", "key_mgmt"); + ASSERT (value && strcmp (value, "NONE") == 0, "get wpa data", + "key_mgmt of static-wep-test should be NONE, find %s", value); + value = wpa_get_value ("static-wep-test", "wep_key0"); + ASSERT (value && strcmp (value, "\"abcde\"") == 0, "get wpa data", + "wep_key0 of static-wep-test should be abcde, find %s", value); + ASSERT (exist_ssid ("leap-example"), "get wsec", + "ssid leap-example is not found"); +} + +static void +test_strip_string () +{ + gchar *str = "( \"default via 202.117.16.1\" )"; + gchar *result = g_strdup (str); + gchar *result_b = result; + + result = strip_string (result, '('); + result = strip_string (result, ')'); + result = strip_string (result, '"'); + ASSERT (strcmp (result, "default via 202.117.16.1") == 0, + "strip_string", "string isn't stripped, result is: %s", result); + g_free (result_b); +} + +static void +test_is_unmanaged () +{ + ASSERT (is_managed ("eth0"), "test_is_unmanaged", + "eth0 should be managed"); + ASSERT (!is_managed ("eth4"), "test_is_unmanaged", + "eth4 should be unmanaged"); +} + +static void +test_new_connection () +{ + GError **error = NULL; + NMConnection *connection; + + connection = ifnet_update_connection_from_config_block ("eth2", error); + ASSERT (connection != NULL, "new connection", + "new connection failed: %s", + error == NULL ? "None" : (*error)->message); + g_object_unref (connection); + connection = + ifnet_update_connection_from_config_block ("qiaomuf", error); + ASSERT (connection != NULL, "new connection", + "new connection failed: %s", error + && (*error) ? (*error)->message : "NONE"); + g_object_unref (connection); + connection = + ifnet_update_connection_from_config_block ("myxjtu2", error); + ASSERT (connection != NULL, "new connection", + "new connection failed: %s", error + && (*error) ? (*error)->message : "NONE"); + g_object_unref (connection); + +} + +static void +test_update_connection () +{ + GError **error = NULL; + NMConnection *connection; + + connection = ifnet_update_connection_from_config_block ("eth0", error); + ASSERT (connection != NULL, "get connection", + "get connection failed: %s", + error == NULL ? "None" : (*error)->message); + ASSERT (ifnet_update_parsers_by_connection + (connection, "eth0", NULL, "net.generate", + "wpa_supplicant.conf.generate", error), "update connection", + "update connection failed %s", "eth0"); + connection = + ifnet_update_connection_from_config_block ("0xab3ace", error); + ASSERT (connection != NULL, "get connection", + "get connection failed: %s", + error == NULL ? "None" : (*error)->message); + ASSERT (ifnet_update_parsers_by_connection + (connection, "0xab3ace", NULL, "net.generate", + "wpa_supplicant.conf.generate", error), "update connection", + "update connection failed %s", "0xab3ace"); +} + +static void +test_add_connection () +{ + GError **error = NULL; + NMConnection *connection; + + connection = ifnet_update_connection_from_config_block ("eth0", error); + ASSERT (ifnet_add_new_connection + (connection, "net.generate", "wpa_supplicant.conf.generate", + error), "add connection", "add connection failed: %s", "eth0"); + connection = + ifnet_update_connection_from_config_block ("myxjtu2", error); + ASSERT (ifnet_add_new_connection + (connection, "net.generate", "wpa_supplicant.conf.generate", + error), "add connection", "add connection failed: %s", + "myxjtu2"); +} + +static void +test_delete_connection () +{ + GError **error = NULL; + NMConnection *connection; + + connection = ifnet_update_connection_from_config_block ("eth7", error); + ASSERT (connection != NULL, "get connection", + "get connection failed: %s", + error == NULL ? "None" : (*error)->message); + ASSERT (ifnet_delete_connection_in_parsers + ("eth7", "net.generate", "wpa_supplicant.conf.generate"), + "delete connection", "delete connection failed: %s", "eth7"); + connection = + ifnet_update_connection_from_config_block ("qiaomuf", error); + ASSERT (connection != NULL, "get connection", + "get connection failed: %s", + error == NULL ? "None" : (*error)->message); + ASSERT (ifnet_delete_connection_in_parsers + ("qiaomuf", "net.generate", "wpa_supplicant.conf.generate"), + "delete connection", "delete connection failed: %s", "qiaomuf"); +} + +static void +run_all (gboolean run) +{ + if (run) { + test_strip_string (); + test_is_static (); + test_has_ip6_address (); + test_has_default_route (); + test_getdata (); + test_read_hostname (); + test_write_hostname (); + test_is_ip4_address (); + test_is_ip6_address (); + test_convert_ipv4_config_block (); + test_convert_ipv4_routes_block (); + test_is_unmanaged (); + test_wpa_parser (); + test_convert_ipv4_routes_block (); + test_new_connection (); + test_update_connection (); + test_add_connection (); + test_delete_connection (); + } +} + +int +main (void) +{ +// g_mem_set_vtable(glib_mem_profiler_table); +// g_atexit(g_mem_profile); + g_type_init (); + ifnet_destroy (); + wpa_parser_destroy (); + ifnet_init ("net"); + wpa_parser_init ("wpa_supplicant.conf"); + printf("Initialization complete\n"); + + run_all (TRUE); + + ifnet_destroy (); + wpa_parser_destroy (); + return 0; +} diff --git a/system-settings/plugins/ifnet/tests/wpa_supplicant.conf b/system-settings/plugins/ifnet/tests/wpa_supplicant.conf new file mode 100644 index 0000000000..7763d2155f --- /dev/null +++ b/system-settings/plugins/ifnet/tests/wpa_supplicant.conf @@ -0,0 +1,876 @@ +##### Example wpa_supplicant configuration file ############################### +# +# This file describes configuration file format and lists all available option. +# Please also take a look at simpler configuration examples in 'examples' +# subdirectory. +# +# Empty lines and lines starting with # are ignored + +# NOTE! This file may contain password information and should probably be made +# readable only by root user on multiuser systems. + +# Note: All file paths in this configuration file should use full (absolute, +# not relative to working directory) path in order to allow working directory +# to be changed. This can happen if wpa_supplicant is run in the background. + +# Whether to allow wpa_supplicant to update (overwrite) configuration +# +# This option can be used to allow wpa_supplicant to overwrite configuration +# file whenever configuration is changed (e.g., new network block is added with +# wpa_cli or wpa_gui, or a password is changed). This is required for +# wpa_cli/wpa_gui to be able to store the configuration changes permanently. +# Please note that overwriting configuration file will remove the comments from +# it. +#update_config=1 + +# global configuration (shared by all network blocks) +# +# Parameters for the control interface. If this is specified, wpa_supplicant +# will open a control interface that is available for external programs to +# manage wpa_supplicant. The meaning of this string depends on which control +# interface mechanism is used. For all cases, the existance of this parameter +# in configuration is used to determine whether the control interface is +# enabled. +# +# For UNIX domain sockets (default on Linux and BSD): This is a directory that +# will be created for UNIX domain sockets for listening to requests from +# external programs (CLI/GUI, etc.) for status information and configuration. +# The socket file will be named based on the interface name, so multiple +# wpa_supplicant processes can be run at the same time if more than one +# interface is used. +# /var/run/wpa_supplicant is the recommended directory for sockets and by +# default, wpa_cli will use it when trying to connect with wpa_supplicant. +# +# Access control for the control interface can be configured by setting the +# directory to allow only members of a group to use sockets. This way, it is +# possible to run wpa_supplicant as root (since it needs to change network +# configuration and open raw sockets) and still allow GUI/CLI components to be +# run as non-root users. However, since the control interface can be used to +# change the network configuration, this access needs to be protected in many +# cases. By default, wpa_supplicant is configured to use gid 0 (root). If you +# want to allow non-root users to use the control interface, add a new group +# and change this value to match with that group. Add users that should have +# control interface access to this group. If this variable is commented out or +# not included in the configuration file, group will not be changed from the +# value it got by default when the directory or socket was created. +# +# When configuring both the directory and group, use following format: +# DIR=/var/run/wpa_supplicant GROUP=wheel +# DIR=/var/run/wpa_supplicant GROUP=0 +# (group can be either group name or gid) +# +# For UDP connections (default on Windows): The value will be ignored. This +# variable is just used to select that the control interface is to be created. +# The value can be set to, e.g., udp (ctrl_interface=udp) +# +# For Windows Named Pipe: This value can be used to set the security descriptor +# for controlling access to the control interface. Security descriptor can be +# set using Security Descriptor String Format (see http://msdn.microsoft.com/ +# library/default.asp?url=/library/en-us/secauthz/security/ +# security_descriptor_string_format.asp). The descriptor string needs to be +# prefixed with SDDL=. For example, ctrl_interface=SDDL=D: would set an empty +# DACL (which will reject all connections). See README-Windows.txt for more +# information about SDDL string format. +# +ctrl_interface=/var/run/wpa_supplicant + +# IEEE 802.1X/EAPOL version +# wpa_supplicant is implemented based on IEEE Std 802.1X-2004 which defines +# EAPOL version 2. However, there are many APs that do not handle the new +# version number correctly (they seem to drop the frames completely). In order +# to make wpa_supplicant interoperate with these APs, the version number is set +# to 1 by default. This configuration value can be used to set it to the new +# version (2). +eapol_version=1 + +# AP scanning/selection +# By default, wpa_supplicant requests driver to perform AP scanning and then +# uses the scan results to select a suitable AP. Another alternative is to +# allow the driver to take care of AP scanning and selection and use +# wpa_supplicant just to process EAPOL frames based on IEEE 802.11 association +# information from the driver. +# 1: wpa_supplicant initiates scanning and AP selection +# 0: driver takes care of scanning, AP selection, and IEEE 802.11 association +# parameters (e.g., WPA IE generation); this mode can also be used with +# non-WPA drivers when using IEEE 802.1X mode; do not try to associate with +# APs (i.e., external program needs to control association). This mode must +# also be used when using wired Ethernet drivers. +# 2: like 0, but associate with APs using security policy and SSID (but not +# BSSID); this can be used, e.g., with ndiswrapper and NDIS drivers to +# enable operation with hidden SSIDs and optimized roaming; in this mode, +# the network blocks in the configuration file are tried one by one until +# the driver reports successful association; each network block should have +# explicit security policy (i.e., only one option in the lists) for +# key_mgmt, pairwise, group, proto variables +ap_scan=1 + +# EAP fast re-authentication +# By default, fast re-authentication is enabled for all EAP methods that +# support it. This variable can be used to disable fast re-authentication. +# Normally, there is no need to disable this. +fast_reauth=1 + +# OpenSSL Engine support +# These options can be used to load OpenSSL engines. +# The two engines that are supported currently are shown below: +# They are both from the opensc project (http://www.opensc.org/) +# By default no engines are loaded. +# make the opensc engine available +#opensc_engine_path=/usr/lib64/engine_opensc.so +# make the pkcs11 engine available +#pkcs11_engine_path=/usr/lib64/engine_pkcs11.so +# configure the path to the pkcs11 module required by the pkcs11 engine +#pkcs11_module_path=/usr/lib64/opensc-pkcs11.so + +# Dynamic EAP methods +# If EAP methods were built dynamically as shared object files, they need to be +# loaded here before being used in the network blocks. By default, EAP methods +# are included statically in the build, so these lines are not needed +#load_dynamic_eap=/usr/lib/wpa_supplicant/eap_tls.so +#load_dynamic_eap=/usr/lib/wpa_supplicant/eap_md5.so + +# Driver interface parameters +# This field can be used to configure arbitrary driver interace parameters. The +# format is specific to the selected driver interface. This field is not used +# in most cases. +#driver_param="field=value" + +# Country code +# The ISO/IEC alpha2 country code for the country in which this device is +# currently operating. +#country=US + +# Maximum lifetime for PMKSA in seconds; default 43200 +#dot11RSNAConfigPMKLifetime=43200 +# Threshold for reauthentication (percentage of PMK lifetime); default 70 +#dot11RSNAConfigPMKReauthThreshold=70 +# Timeout for security association negotiation in seconds; default 60 +#dot11RSNAConfigSATimeout=60 + +# Wi-Fi Protected Setup (WPS) parameters + +# Universally Unique IDentifier (UUID; see RFC 4122) of the device +# If not configured, UUID will be generated based on the local MAC address. +#uuid=12345678-9abc-def0-1234-56789abcdef0 + +# Device Name +# User-friendly description of device; up to 32 octets encoded in UTF-8 +#device_name=Wireless Client + +# Manufacturer +# The manufacturer of the device (up to 64 ASCII characters) +#manufacturer=Company + +# Model Name +# Model of the device (up to 32 ASCII characters) +#model_name=cmodel + +# Model Number +# Additional device description (up to 32 ASCII characters) +#model_number=123 + +# Serial Number +# Serial number of the device (up to 32 characters) +#serial_number=12345 + +# Primary Device Type +# Used format: -- +# categ = Category as an integer value +# OUI = OUI and type octet as a 4-octet hex-encoded value; 0050F204 for +# default WPS OUI +# subcateg = OUI-specific Sub Category as an integer value +# Examples: +# 1-0050F204-1 (Computer / PC) +# 1-0050F204-2 (Computer / Server) +# 5-0050F204-1 (Storage / NAS) +# 6-0050F204-1 (Network Infrastructure / AP) +#device_type=1-0050F204-1 + +# OS Version +# 4-octet operating system version number (hex string) +#os_version=01020300 + +# Credential processing +# 0 = process received credentials internally (default) +# 1 = do not process received credentials; just pass them over ctrl_iface to +# external program(s) +# 2 = process received credentials internally and pass them over ctrl_iface +# to external program(s) +#wps_cred_processing=0 + +# network block +# +# Each network (usually AP's sharing the same SSID) is configured as a separate +# block in this configuration file. The network blocks are in preference order +# (the first match is used). +# +# network block fields: +# +# disabled: +# 0 = this network can be used (default) +# 1 = this network block is disabled (can be enabled through ctrl_iface, +# e.g., with wpa_cli or wpa_gui) +# +# id_str: Network identifier string for external scripts. This value is passed +# to external action script through wpa_cli as WPA_ID_STR environment +# variable to make it easier to do network specific configuration. +# +# ssid: SSID (mandatory); either as an ASCII string with double quotation or +# as hex string; network name +# +# scan_ssid: +# 0 = do not scan this SSID with specific Probe Request frames (default) +# 1 = scan with SSID-specific Probe Request frames (this can be used to +# find APs that do not accept broadcast SSID or use multiple SSIDs; +# this will add latency to scanning, so enable this only when needed) +# +# bssid: BSSID (optional); if set, this network block is used only when +# associating with the AP using the configured BSSID +# +# priority: priority group (integer) +# By default, all networks will get same priority group (0). If some of the +# networks are more desirable, this field can be used to change the order in +# which wpa_supplicant goes through the networks when selecting a BSS. The +# priority groups will be iterated in decreasing priority (i.e., the larger the +# priority value, the sooner the network is matched against the scan results). +# Within each priority group, networks will be selected based on security +# policy, signal strength, etc. +# Please note that AP scanning with scan_ssid=1 and ap_scan=2 mode are not +# using this priority to select the order for scanning. Instead, they try the +# networks in the order that used in the configuration file. +# +# mode: IEEE 802.11 operation mode +# 0 = infrastructure (Managed) mode, i.e., associate with an AP (default) +# 1 = IBSS (ad-hoc, peer-to-peer) +# Note: IBSS can only be used with key_mgmt NONE (plaintext and static WEP) +# and key_mgmt=WPA-NONE (fixed group key TKIP/CCMP). In addition, ap_scan has +# to be set to 2 for IBSS. WPA-None requires following network block options: +# proto=WPA, key_mgmt=WPA-NONE, pairwise=NONE, group=TKIP (or CCMP, but not +# both), and psk must also be set. +# +# frequency: Channel frequency in megahertz (MHz) for IBSS, e.g., +# 2412 = IEEE 802.11b/g channel 1. This value is used to configure the initial +# channel for IBSS (adhoc) networks. It is ignored in the infrastructure mode. +# In addition, this value is only used by the station that creates the IBSS. If +# an IBSS network with the configured SSID is already present, the frequency of +# the network will be used instead of this configured value. +# +# proto: list of accepted protocols +# WPA = WPA/IEEE 802.11i/D3.0 +# RSN = WPA2/IEEE 802.11i (also WPA2 can be used as an alias for RSN) +# If not set, this defaults to: WPA RSN +# +# key_mgmt: list of accepted authenticated key management protocols +# WPA-PSK = WPA pre-shared key (this requires 'psk' field) +# WPA-EAP = WPA using EAP authentication +# IEEE8021X = IEEE 802.1X using EAP authentication and (optionally) dynamically +# generated WEP keys +# NONE = WPA is not used; plaintext or static WEP could be used +# WPA-PSK-SHA256 = Like WPA-PSK but using stronger SHA256-based algorithms +# WPA-EAP-SHA256 = Like WPA-EAP but using stronger SHA256-based algorithms +# If not set, this defaults to: WPA-PSK WPA-EAP +# +# auth_alg: list of allowed IEEE 802.11 authentication algorithms +# OPEN = Open System authentication (required for WPA/WPA2) +# SHARED = Shared Key authentication (requires static WEP keys) +# LEAP = LEAP/Network EAP (only used with LEAP) +# If not set, automatic selection is used (Open System with LEAP enabled if +# LEAP is allowed as one of the EAP methods). +# +# pairwise: list of accepted pairwise (unicast) ciphers for WPA +# CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0] +# TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0] +# NONE = Use only Group Keys (deprecated, should not be included if APs support +# pairwise keys) +# If not set, this defaults to: CCMP TKIP +# +# group: list of accepted group (broadcast/multicast) ciphers for WPA +# CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0] +# TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0] +# WEP104 = WEP (Wired Equivalent Privacy) with 104-bit key +# WEP40 = WEP (Wired Equivalent Privacy) with 40-bit key [IEEE 802.11] +# If not set, this defaults to: CCMP TKIP WEP104 WEP40 +# +# psk: WPA preshared key; 256-bit pre-shared key +# The key used in WPA-PSK mode can be entered either as 64 hex-digits, i.e., +# 32 bytes or as an ASCII passphrase (in which case, the real PSK will be +# generated using the passphrase and SSID). ASCII passphrase must be between +# 8 and 63 characters (inclusive). +# This field is not needed, if WPA-EAP is used. +# Note: Separate tool, wpa_passphrase, can be used to generate 256-bit keys +# from ASCII passphrase. This process uses lot of CPU and wpa_supplicant +# startup and reconfiguration time can be optimized by generating the PSK only +# only when the passphrase or SSID has actually changed. +# +# eapol_flags: IEEE 802.1X/EAPOL options (bit field) +# Dynamic WEP key required for non-WPA mode +# bit0 (1): require dynamically generated unicast WEP key +# bit1 (2): require dynamically generated broadcast WEP key +# (3 = require both keys; default) +# Note: When using wired authentication, eapol_flags must be set to 0 for the +# authentication to be completed successfully. +# +# mixed_cell: This option can be used to configure whether so called mixed +# cells, i.e., networks that use both plaintext and encryption in the same +# SSID, are allowed when selecting a BSS form scan results. +# 0 = disabled (default) +# 1 = enabled +# +# proactive_key_caching: +# Enable/disable opportunistic PMKSA caching for WPA2. +# 0 = disabled (default) +# 1 = enabled +# +# wep_key0..3: Static WEP key (ASCII in double quotation, e.g. "abcde" or +# hex without quotation, e.g., 0102030405) +# wep_tx_keyidx: Default WEP key index (TX) (0..3) +# +# peerkey: Whether PeerKey negotiation for direct links (IEEE 802.11e DLS) is +# allowed. This is only used with RSN/WPA2. +# 0 = disabled (default) +# 1 = enabled +#peerkey=1 +# +# wpa_ptk_rekey: Maximum lifetime for PTK in seconds. This can be used to +# enforce rekeying of PTK to mitigate some attacks against TKIP deficiencies. +# +# Following fields are only used with internal EAP implementation. +# eap: space-separated list of accepted EAP methods +# MD5 = EAP-MD5 (unsecure and does not generate keying material -> +# cannot be used with WPA; to be used as a Phase 2 method +# with EAP-PEAP or EAP-TTLS) +# MSCHAPV2 = EAP-MSCHAPv2 (cannot be used separately with WPA; to be used +# as a Phase 2 method with EAP-PEAP or EAP-TTLS) +# OTP = EAP-OTP (cannot be used separately with WPA; to be used +# as a Phase 2 method with EAP-PEAP or EAP-TTLS) +# GTC = EAP-GTC (cannot be used separately with WPA; to be used +# as a Phase 2 method with EAP-PEAP or EAP-TTLS) +# TLS = EAP-TLS (client and server certificate) +# PEAP = EAP-PEAP (with tunnelled EAP authentication) +# TTLS = EAP-TTLS (with tunnelled EAP or PAP/CHAP/MSCHAP/MSCHAPV2 +# authentication) +# If not set, all compiled in methods are allowed. +# +# identity: Identity string for EAP +# This field is also used to configure user NAI for +# EAP-PSK/PAX/SAKE/GPSK. +# anonymous_identity: Anonymous identity string for EAP (to be used as the +# unencrypted identity with EAP types that support different tunnelled +# identity, e.g., EAP-TTLS) +# password: Password string for EAP. This field can include either the +# plaintext password (using ASCII or hex string) or a NtPasswordHash +# (16-byte MD4 hash of password) in hash:<32 hex digits> format. +# NtPasswordHash can only be used when the password is for MSCHAPv2 or +# MSCHAP (EAP-MSCHAPv2, EAP-TTLS/MSCHAPv2, EAP-TTLS/MSCHAP, LEAP). +# EAP-PSK (128-bit PSK), EAP-PAX (128-bit PSK), and EAP-SAKE (256-bit +# PSK) is also configured using this field. For EAP-GPSK, this is a +# variable length PSK. +# ca_cert: File path to CA certificate file (PEM/DER). This file can have one +# or more trusted CA certificates. If ca_cert and ca_path are not +# included, server certificate will not be verified. This is insecure and +# a trusted CA certificate should always be configured when using +# EAP-TLS/TTLS/PEAP. Full path should be used since working directory may +# change when wpa_supplicant is run in the background. +# On Windows, trusted CA certificates can be loaded from the system +# certificate store by setting this to cert_store://, e.g., +# ca_cert="cert_store://CA" or ca_cert="cert_store://ROOT". +# Note that when running wpa_supplicant as an application, the user +# certificate store (My user account) is used, whereas computer store +# (Computer account) is used when running wpasvc as a service. +# ca_path: Directory path for CA certificate files (PEM). This path may +# contain multiple CA certificates in OpenSSL format. Common use for this +# is to point to system trusted CA list which is often installed into +# directory like /etc/ssl/certs. If configured, these certificates are +# added to the list of trusted CAs. ca_cert may also be included in that +# case, but it is not required. +# client_cert: File path to client certificate file (PEM/DER) +# Full path should be used since working directory may change when +# wpa_supplicant is run in the background. +# Alternatively, a named configuration blob can be used by setting this +# to blob://. +# private_key: File path to client private key file (PEM/DER/PFX) +# When PKCS#12/PFX file (.p12/.pfx) is used, client_cert should be +# commented out. Both the private key and certificate will be read from +# the PKCS#12 file in this case. Full path should be used since working +# directory may change when wpa_supplicant is run in the background. +# Windows certificate store can be used by leaving client_cert out and +# configuring private_key in one of the following formats: +# cert://substring_to_match +# hash://certificate_thumbprint_in_hex +# for example: private_key="hash://63093aa9c47f56ae88334c7b65a4" +# Note that when running wpa_supplicant as an application, the user +# certificate store (My user account) is used, whereas computer store +# (Computer account) is used when running wpasvc as a service. +# Alternatively, a named configuration blob can be used by setting this +# to blob://. +# private_key_passwd: Password for private key file (if left out, this will be +# asked through control interface) +# dh_file: File path to DH/DSA parameters file (in PEM format) +# This is an optional configuration file for setting parameters for an +# ephemeral DH key exchange. In most cases, the default RSA +# authentication does not use this configuration. However, it is possible +# setup RSA to use ephemeral DH key exchange. In addition, ciphers with +# DSA keys always use ephemeral DH keys. This can be used to achieve +# forward secrecy. If the file is in DSA parameters format, it will be +# automatically converted into DH params. +# subject_match: Substring to be matched against the subject of the +# authentication server certificate. If this string is set, the server +# sertificate is only accepted if it contains this string in the subject. +# The subject string is in following format: +# /C=US/ST=CA/L=San Francisco/CN=Test AS/emailAddress=as@example.com +# altsubject_match: Semicolon separated string of entries to be matched against +# the alternative subject name of the authentication server certificate. +# If this string is set, the server sertificate is only accepted if it +# contains one of the entries in an alternative subject name extension. +# altSubjectName string is in following format: TYPE:VALUE +# Example: EMAIL:server@example.com +# Example: DNS:server.example.com;DNS:server2.example.com +# Following types are supported: EMAIL, DNS, URI +# phase1: Phase1 (outer authentication, i.e., TLS tunnel) parameters +# (string with field-value pairs, e.g., "peapver=0" or +# "peapver=1 peaplabel=1") +# 'peapver' can be used to force which PEAP version (0 or 1) is used. +# 'peaplabel=1' can be used to force new label, "client PEAP encryption", +# to be used during key derivation when PEAPv1 or newer. Most existing +# PEAPv1 implementation seem to be using the old label, "client EAP +# encryption", and wpa_supplicant is now using that as the default value. +# Some servers, e.g., Radiator, may require peaplabel=1 configuration to +# interoperate with PEAPv1; see eap_testing.txt for more details. +# 'peap_outer_success=0' can be used to terminate PEAP authentication on +# tunneled EAP-Success. This is required with some RADIUS servers that +# implement draft-josefsson-pppext-eap-tls-eap-05.txt (e.g., +# Lucent NavisRadius v4.4.0 with PEAP in "IETF Draft 5" mode) +# include_tls_length=1 can be used to force wpa_supplicant to include +# TLS Message Length field in all TLS messages even if they are not +# fragmented. +# sim_min_num_chal=3 can be used to configure EAP-SIM to require three +# challenges (by default, it accepts 2 or 3) +# result_ind=1 can be used to enable EAP-SIM and EAP-AKA to use +# protected result indication. +# 'crypto_binding' option can be used to control PEAPv0 cryptobinding +# behavior: +# * 0 = do not use cryptobinding (default) +# * 1 = use cryptobinding if server supports it +# * 2 = require cryptobinding +# EAP-WSC (WPS) uses following options: pin= or +# pbc=1. +# phase2: Phase2 (inner authentication with TLS tunnel) parameters +# (string with field-value pairs, e.g., "auth=MSCHAPV2" for EAP-PEAP or +# "autheap=MSCHAPV2 autheap=MD5" for EAP-TTLS) +# Following certificate/private key fields are used in inner Phase2 +# authentication when using EAP-TTLS or EAP-PEAP. +# ca_cert2: File path to CA certificate file. This file can have one or more +# trusted CA certificates. If ca_cert2 and ca_path2 are not included, +# server certificate will not be verified. This is insecure and a trusted +# CA certificate should always be configured. +# ca_path2: Directory path for CA certificate files (PEM) +# client_cert2: File path to client certificate file +# private_key2: File path to client private key file +# private_key2_passwd: Password for private key file +# dh_file2: File path to DH/DSA parameters file (in PEM format) +# subject_match2: Substring to be matched against the subject of the +# authentication server certificate. +# altsubject_match2: Substring to be matched against the alternative subject +# name of the authentication server certificate. +# +# fragment_size: Maximum EAP fragment size in bytes (default 1398). +# This value limits the fragment size for EAP methods that support +# fragmentation (e.g., EAP-TLS and EAP-PEAP). This value should be set +# small enough to make the EAP messages fit in MTU of the network +# interface used for EAPOL. The default value is suitable for most +# cases. +# +# EAP-FAST variables: +# pac_file: File path for the PAC entries. wpa_supplicant will need to be able +# to create this file and write updates to it when PAC is being +# provisioned or refreshed. Full path to the file should be used since +# working directory may change when wpa_supplicant is run in the +# background. Alternatively, a named configuration blob can be used by +# setting this to blob:// +# phase1: fast_provisioning option can be used to enable in-line provisioning +# of EAP-FAST credentials (PAC): +# 0 = disabled, +# 1 = allow unauthenticated provisioning, +# 2 = allow authenticated provisioning, +# 3 = allow both unauthenticated and authenticated provisioning +# fast_max_pac_list_len= option can be used to set the maximum +# number of PAC entries to store in a PAC list (default: 10) +# fast_pac_format=binary option can be used to select binary format for +# storing PAC entries in order to save some space (the default +# text format uses about 2.5 times the size of minimal binary +# format) +# +# wpa_supplicant supports number of "EAP workarounds" to work around +# interoperability issues with incorrectly behaving authentication servers. +# These are enabled by default because some of the issues are present in large +# number of authentication servers. Strict EAP conformance mode can be +# configured by disabling workarounds with eap_workaround=0. + +# Example blocks: + +# Simple case: WPA-PSK, PSK as an ASCII passphrase, allow all valid ciphers +network={ + ssid="simple" + psk="very secret passphrase" + priority=5 +} + +# Same as previous, but request SSID-specific scanning (for APs that reject +# broadcast SSID) +network={ + ssid="second ssid" + scan_ssid=1 + psk="very secret passphrase" + priority=2 +} + +# Only WPA-PSK is used. Any valid cipher combination is accepted. +network={ + ssid="example" + proto=WPA + key_mgmt=WPA-PSK + pairwise=CCMP TKIP + group=CCMP TKIP WEP104 WEP40 + psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb + priority=2 +} + +# WPA-Personal(PSK) with TKIP and enforcement for frequent PTK rekeying +network={ + ssid="example" + proto=WPA + key_mgmt=WPA-PSK + pairwise=TKIP + group=TKIP + psk="not so secure passphrase" + wpa_ptk_rekey=600 +} + +# Only WPA-EAP is used. Both CCMP and TKIP is accepted. An AP that used WEP104 +# or WEP40 as the group cipher will not be accepted. +network={ + ssid="example" + proto=RSN + key_mgmt=WPA-EAP + pairwise=CCMP TKIP + group=CCMP TKIP + eap=TLS + identity="user@example.com" + ca_cert="/etc/cert/ca.pem" + client_cert="/etc/cert/user.pem" + private_key="/etc/cert/user.prv" + private_key_passwd="password" + priority=1 +} + +# EAP-PEAP/MSCHAPv2 configuration for RADIUS servers that use the new peaplabel +# (e.g., Radiator) +network={ + ssid="example" + key_mgmt=WPA-EAP + eap=PEAP + identity="user@example.com" + password="foobar" + ca_cert="/etc/cert/ca.pem" + phase1="peaplabel=1" + phase2="auth=MSCHAPV2" + priority=10 +} + +# EAP-TTLS/EAP-MD5-Challenge configuration with anonymous identity for the +# unencrypted use. Real identity is sent only within an encrypted TLS tunnel. +network={ + ssid="example" + key_mgmt=WPA-EAP + eap=TTLS + identity="user@example.com" + anonymous_identity="anonymous@example.com" + password="foobar" + ca_cert="/etc/cert/ca.pem" + priority=2 +} + +# EAP-TTLS/MSCHAPv2 configuration with anonymous identity for the unencrypted +# use. Real identity is sent only within an encrypted TLS tunnel. +network={ + ssid="example" + key_mgmt=WPA-EAP + eap=TTLS + identity="user@example.com" + anonymous_identity="anonymous@example.com" + password="foobar" + ca_cert="/etc/cert/ca.pem" + phase2="auth=MSCHAPV2" +} + +# WPA-EAP, EAP-TTLS with different CA certificate used for outer and inner +# authentication. +network={ + ssid="example" + key_mgmt=WPA-EAP + eap=TTLS + # Phase1 / outer authentication + anonymous_identity="anonymous@example.com" + ca_cert="/etc/cert/ca.pem" + # Phase 2 / inner authentication + phase2="autheap=TLS" + ca_cert2="/etc/cert/ca2.pem" + client_cert2="/etc/cer/user.pem" + private_key2="/etc/cer/user.prv" + private_key2_passwd="password" + priority=2 +} + +# Both WPA-PSK and WPA-EAP is accepted. Only CCMP is accepted as pairwise and +# group cipher. +network={ + ssid="example" + bssid=00:11:22:33:44:55 + proto=WPA RSN + key_mgmt=WPA-PSK WPA-EAP + pairwise=CCMP + group=CCMP + psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb +} + +# Special characters in SSID, so use hex string. Default to WPA-PSK, WPA-EAP +# and all valid ciphers. +network={ + ssid=00010203 + psk=000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f +} + + +# EAP-SIM with a GSM SIM or USIM +network={ + ssid="eap-sim-test" + key_mgmt=WPA-EAP + eap=SIM + pin="1234" + pcsc="" +} + + +# EAP-PSK +network={ + ssid="eap-psk-test" + key_mgmt=WPA-EAP + eap=PSK + anonymous_identity="eap_psk_user" + password=06b4be19da289f475aa46a33cb793029 + identity="eap_psk_user@example.com" +} + + +# IEEE 802.1X/EAPOL with dynamically generated WEP keys (i.e., no WPA) using +# EAP-TLS for authentication and key generation; require both unicast and +# broadcast WEP keys. +network={ + ssid="1xtest" + key_mgmt=IEEE8021X + eap=TLS + identity="user@example.com" + ca_cert="/etc/cert/ca.pem" + client_cert="/etc/cert/user.pem" + private_key="/etc/cert/user.prv" + private_key_passwd="password" + eapol_flags=3 +} + + +# LEAP with dynamic WEP keys +network={ + ssid="leap-example" + key_mgmt=IEEE8021X + eap=LEAP + identity="user" + password="foobar" +} + +# EAP-IKEv2 using shared secrets for both server and peer authentication +network={ + ssid="ikev2-example" + key_mgmt=WPA-EAP + eap=IKEV2 + identity="user" + password="foobar" +} + +# EAP-FAST with WPA (WPA or WPA2) +network={ + ssid="eap-fast-test" + key_mgmt=WPA-EAP + eap=FAST + anonymous_identity="FAST-000102030405" + identity="username" + password="password" + phase1="fast_provisioning=1" + pac_file="/etc/wpa_supplicant.eap-fast-pac" +} + +network={ + ssid="eap-fast-test" + key_mgmt=WPA-EAP + eap=FAST + anonymous_identity="FAST-000102030405" + identity="username" + password="password" + phase1="fast_provisioning=1" + pac_file="blob://eap-fast-pac" +} + +# Plaintext connection (no WPA, no IEEE 802.1X) +network={ + ssid="plaintext-test" + key_mgmt=NONE +} + + +# Shared WEP key connection (no WPA, no IEEE 802.1X) +network={ + ssid="static-wep-test" + key_mgmt=NONE + wep_key0="abcde" + wep_key1=0102030405 + wep_key2="1234567890123" + wep_tx_keyidx=0 + priority=5 +} + + +# Shared WEP key connection (no WPA, no IEEE 802.1X) using Shared Key +# IEEE 802.11 authentication +network={ + ssid="static-wep-test2" + key_mgmt=NONE + wep_key0="abcde" + wep_key1=0102030405 + wep_key2="1234567890123" + wep_tx_keyidx=0 + priority=5 + auth_alg=SHARED +} + + +# IBSS/ad-hoc network with WPA-None/TKIP. +network={ + ssid="test adhoc" + mode=1 + frequency=2412 + proto=WPA + key_mgmt=WPA-NONE + pairwise=NONE + group=TKIP + psk="secret passphrase" +} + + +# Catch all example that allows more or less all configuration modes +network={ + ssid="example" + scan_ssid=1 + key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE + pairwise=CCMP TKIP + group=CCMP TKIP WEP104 WEP40 + psk="very secret passphrase" + eap=TTLS PEAP TLS + identity="user@example.com" + password="foobar" + ca_cert="/etc/cert/ca.pem" + client_cert="/etc/cert/user.pem" + private_key="/etc/cert/user.prv" + private_key_passwd="password" + phase1="peaplabel=0" +} + +# Example of EAP-TLS with smartcard (openssl engine) +network={ + ssid="example" + key_mgmt=WPA-EAP + eap=TLS + proto=RSN + pairwise=CCMP TKIP + group=CCMP TKIP + identity="user@example.com" + ca_cert="/etc/cert/ca.pem" + client_cert="/etc/cert/user.pem" + + engine=1 + + # The engine configured here must be available. Look at + # OpenSSL engine support in the global section. + # The key available through the engine must be the private key + # matching the client certificate configured above. + + # use the opensc engine + #engine_id="opensc" + #key_id="45" + + # use the pkcs11 engine + engine_id="pkcs11" + key_id="id_45" + + # Optional PIN configuration; this can be left out and PIN will be + # asked through the control interface + pin="1234" +} + +# Example configuration showing how to use an inlined blob as a CA certificate +# data instead of using external file +network={ + ssid="example" + key_mgmt=WPA-EAP + eap=TTLS + identity="user@example.com" + anonymous_identity="anonymous@example.com" + password="foobar" + ca_cert="blob://exampleblob" + priority=20 +} + +blob-base64-exampleblob={ +SGVsbG8gV29ybGQhCg== +} + + +# Wildcard match for SSID (plaintext APs only). This example select any +# open AP regardless of its SSID. +network={ + key_mgmt=NONE +} +network={ + ssid="qiaomuf" + key_mgmt=WPA-EAP + eap=TLS + identity="user@example.com" + ca_cert="/home/gentoo/temp/ca.pem" + client_cert="/home/gentoo/temp/client.pem" + private_key="/home/gentoo/temp/client.p12" + private_key_passwd="whatever" +# phase2="auth=MSCHAPV2" + priority=10 +} +network={ + ssid="myxjtu2" + scan_ssid=1 + key_mgmt=WPA-PSK + psk="xjtudlc3731" + disabled=0 + key_mgmt=NONE + wep_key0="12345" + wep_key1=1234567890 + wep_key2="zxcvb" + wep_tx_keyidx=1 + auth_alg=OPEN + mode=1 +} +network={ + ssid=ab3ace + key_mgmt=WPA-EAP + eap=TTLS + identity="user@example.com" + anonymous_identity="anonymous@example.com" + password="foobar" + ca_cert="blob://exampleblob" + priority=20 +} diff --git a/system-settings/plugins/ifnet/wpa_parser.c b/system-settings/plugins/ifnet/wpa_parser.c new file mode 100644 index 0000000000..5e94108e98 --- /dev/null +++ b/system-settings/plugins/ifnet/wpa_parser.c @@ -0,0 +1,558 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Mu Qiao + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 1999-2010 Gentoo Foundation, Inc. + */ + +#include +#include +#include +#include "wpa_parser.h" +#include "net_parser.h" +#include "net_utils.h" + +/* Security information */ +static GHashTable *wsec_table = NULL; + +/* Global information used for writing */ +static GHashTable *wsec_global_table = NULL; + +static gboolean wpa_parser_data_changed = FALSE; + +static long +wpa_get_long (GHashTable * table, gchar * key) +{ + return atol (g_hash_table_lookup (table, key)); +} + +static void +destroy_security (GHashTable * network) +{ + gpointer key, value; + GHashTableIter iter; + + g_return_if_fail (network); + g_hash_table_iter_init (&iter, network); + while (g_hash_table_iter_next (&iter, &key, &value)) { + g_free (key); + g_free (value); + } + + g_hash_table_destroy (network); +} + +static GHashTable * +add_security (GHashTable * security) +{ + GHashTable *oldsecurity; + gchar *ssid = g_hash_table_lookup (security, "ssid"), *ssid_key; + gchar *value; + gboolean is_hex_ssid; + + /* Every security information should have a ssid */ + if (!ssid) { + destroy_security (security); + return NULL; + } + + /* Hex format begins with " */ + is_hex_ssid = (ssid[0] != '"'); + if ((value = g_hash_table_lookup (security, "disabled")) != NULL) { + if (strcmp (value, "1") == 0) + return NULL; + } + + /* Default priority is 1 */ + if (g_hash_table_lookup (security, "priority") == NULL) + g_hash_table_insert (security, g_strdup ("priority"), + g_strdup ("1")); + + oldsecurity = g_hash_table_lookup (wsec_table, ssid); + /* Security with lower priority will be ignored */ + if (oldsecurity != NULL) { + if (wpa_get_long (oldsecurity, "priority") >= + wpa_get_long (security, "priority")) { + destroy_security (security); + return NULL; + } else { + g_hash_table_remove (wsec_table, ssid); + destroy_security (oldsecurity); + } + } + + /* format ssid */ + ssid_key = + is_hex_ssid ? g_strdup_printf ("0x%s", + ssid) : + strip_string (g_strdup (ssid), '"'); + g_hash_table_insert (wsec_table, ssid_key, security); + return security; +} + +static void +add_key_value (GHashTable * network, gchar * line) +{ + gchar **key_value; + + if (g_str_has_prefix (line, "network={")) + line += 9; + strip_string (line, '{'); + strip_string (line, '}'); + if (line[0] == '\0') + return; + key_value = g_strsplit (line, "=", 2); + if (g_strv_length (key_value) != 2) { + g_strfreev (key_value); + return; + } + g_strstrip (key_value[0]); + g_strstrip (key_value[1]); + + /* Reserve quotes for psk, wep_key, ssid + * Quotes will determine whether they are hex format */ + if (strcmp (key_value[0], "psk") != 0 + && !g_str_has_prefix (key_value[0], "wep_key") + && strcmp (key_value[0], "ssid") != 0) + strip_string (key_value[1], '"'); + g_hash_table_insert (network, g_strdup (key_value[0]), + g_strdup (key_value[1])); + g_strfreev (key_value); +} + +static void +add_one_wep_key (GHashTable * table, int key_num, gchar * one_wep_key) +{ + if (one_wep_key[0] == 's') { + //asc key + g_hash_table_insert (table, + g_strdup_printf ("wep_key%d", key_num - 1), + g_strdup_printf ("\"%s\"", + one_wep_key + 2)); + } else { + gchar buf[30]; + int i = 0, j = 0; + + //hex key + while (one_wep_key[i] != '\0') { + if (one_wep_key[i] != '-') + buf[j++] = one_wep_key[i]; + i++; + } + buf[j] = '\0'; + g_hash_table_insert (table, + g_strdup_printf ("wep_key%d", key_num - 1), + g_strdup (buf)); + + } +} + +/* Reading wep security information from /etc/conf.d/net. + * This should not be used in futre, use wpa_supplicant instead. */ +static void +add_keys_from_net () +{ + GList *names = ifnet_get_connection_names (); + GList *iter = names; + gchar *wep_keys = "(\\[([1-4])\\]\\s+(s:\\w{5}|s:\\w{13}|" + "([\\da-fA-F]{4}\\-){2}[\\da-fA-F]{2}|" + "([\\da-fA-F]{4}\\-){6}[\\da-fA-F]{2})\\s+)"; + gchar *key_method = + "\\s+key\\s+\\[([1-4])\\]\\s+enc\\s+(open|restricted)"; + GRegex *regex_keys = g_regex_new (wep_keys, 0, 0, NULL); + GRegex *regex_method = g_regex_new (key_method, 0, 0, NULL); + GMatchInfo *keys_info; + GMatchInfo *method_info; + + while (iter) { + gchar *conn_name = iter->data; + GHashTable *table; + gchar *key_str; + + if ((key_str = ifnet_get_data (conn_name, "key")) == NULL) { + iter = g_list_next (iter); + continue; + } + + wpa_add_security (conn_name); + table = _get_hash_table (conn_name); + /* Give lowest priority */ + wpa_set_data (conn_name, "priority", "0"); + g_regex_match (regex_keys, key_str, 0, &keys_info); + /* add wep keys */ + while (g_match_info_matches (keys_info)) { + gchar *key_num = g_match_info_fetch (keys_info, 2); + gchar *one_wep_key = g_match_info_fetch (keys_info, 3); + + add_one_wep_key (table, atoi (key_num), one_wep_key); + g_free (key_num); + g_free (one_wep_key); + g_match_info_next (keys_info, NULL); + } + g_match_info_free (keys_info); + + g_regex_match (regex_method, key_str, 0, &method_info); + /* set default key index and auth alg */ + if (g_match_info_matches (method_info)) { + gchar *default_idx = + g_match_info_fetch (method_info, 1); + gchar *method = g_match_info_fetch (method_info, 2); + + default_idx[0]--; + g_hash_table_insert (table, g_strdup ("wep_tx_keyidx"), + default_idx); + g_hash_table_insert (table, g_strdup ("auth_alg"), + g_ascii_strup (method, -1)); + } + g_match_info_free (method_info); + add_security (table); + iter = g_list_next (iter); + } + g_list_free (names); + g_regex_unref (regex_keys); + g_regex_unref (regex_method); +} + +static void +add_global_data (gchar * line) +{ + gchar **key_value; + + g_strstrip (line); + key_value = g_strsplit (line, "=", 2); + if (g_strv_length (key_value) != 2) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, "Can't handle this line: %s\n", + line); + g_strfreev (key_value); + return; + } + g_hash_table_insert (wsec_global_table, + g_strdup (g_strstrip (key_value[0])), + g_strdup (g_strstrip (key_value[1]))); + g_strfreev (key_value); +} + +void +wpa_parser_init (gchar * wpa_supplicant_conf) +{ + GIOChannel *channel = NULL; + gchar *line; + gboolean complete = FALSE; + + wpa_parser_data_changed = FALSE; + wsec_table = g_hash_table_new (g_str_hash, g_str_equal); + wsec_global_table = g_hash_table_new (g_str_hash, g_str_equal); + + if (g_file_test (wpa_supplicant_conf, G_FILE_TEST_IS_REGULAR)) + channel = + g_io_channel_new_file (wpa_supplicant_conf, "r", NULL); + if (channel == NULL) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Can't open %s for wireless security", + wpa_supplicant_conf); + return; + } + + while (g_io_channel_read_line (channel, &line, NULL, NULL, NULL) + != G_IO_STATUS_EOF) { + g_strstrip (line); + if (line[0] != '#' && line[0] != '\0') { + if (strstr (line, "network={") == NULL) { + add_global_data (line); + g_free (line); + continue; + } else { + GHashTable *network = + g_hash_table_new (g_str_hash, g_str_equal); + gchar *tmp; + + do { + if (line[0] == '#' || line[0] == '\0') { + g_free (line); + continue; + } + /* ignore inline comments */ + if ((tmp = strchr (line, '#')) != NULL) + *tmp = '\0'; + if (strstr (line, "}") != NULL) + complete = TRUE; + add_key_value (network, line); + g_free (line); + } while (complete == FALSE + && + g_io_channel_read_line + (channel, &line, NULL, + NULL, NULL) != G_IO_STATUS_EOF); + add_security (network); + //EOF in inner loop + if (complete == FALSE) { + g_free (line); + break; + } + complete = FALSE; + } + } else + g_free (line); + } + + g_io_channel_shutdown (channel, FALSE, NULL); + g_io_channel_unref (channel); + + add_keys_from_net (); +} + +gchar * +wpa_get_value (gchar * ssid, gchar * key) +{ + GHashTable *target = g_hash_table_lookup (wsec_table, ssid); + + if (target) + return g_hash_table_lookup (target, key); + return NULL; +} + +gboolean +exist_ssid (gchar * ssid) +{ + return g_hash_table_lookup (wsec_table, ssid) != NULL; +} + +GHashTable * +_get_hash_table (gchar * ssid) +{ + return g_hash_table_lookup (wsec_table, ssid); +} + +static gchar *quoted_keys[] = + { "identity", "cert", "private", "phase", "password", NULL }; + +/* tell whether the key needs quotes when writing is performed */ +static gboolean +need_quote (gchar * key) +{ + int i = 0; + + while (quoted_keys[i] != NULL) { + if (strstr (key, quoted_keys[i])) + return TRUE; + i++; + } + return FALSE; +} + +gboolean +wpa_flush_to_file (gchar * config_file) +{ + GIOChannel *channel; + GError **error = NULL; + gpointer key, value, ssid, security; + GHashTableIter iter, iter_security; + gchar *out_line; + gsize bytes_written; + gboolean result = FALSE; + + if (!wpa_parser_data_changed) + return FALSE; + if (!wsec_table || !wsec_global_table) + return FALSE; + + channel = g_io_channel_new_file (config_file, "w", NULL); + if (!channel) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Can't open file %s for writing", config_file); + return FALSE; + } + g_hash_table_iter_init (&iter, wsec_global_table); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Writing to %s", config_file); + g_io_channel_write_chars (channel, + "#Generated by NetworkManager\n" + "###### Global Configuration ######\n", + -1, &bytes_written, error); + + /* Writing global information */ + while (g_hash_table_iter_next (&iter, &key, &value)) { + out_line = + g_strdup_printf ("%s=%s\n", (gchar *) key, (gchar *) value); + g_io_channel_write_chars (channel, out_line, -1, &bytes_written, + error); + if (bytes_written == 0 || (error && *error)) + break; + g_free (out_line); + } + if (error && *error) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, "Found error: %s", + (*error)->message); + goto done; + } + g_io_channel_write_chars (channel, + "\n###### Security Configuration ######\n", + -1, &bytes_written, error); + + g_hash_table_iter_init (&iter, wsec_table); + /* Writing security */ + while (g_hash_table_iter_next (&iter, &ssid, &security)) { + g_hash_table_iter_init (&iter_security, + (GHashTable *) security); + g_io_channel_write_chars (channel, "network={\n", -1, + &bytes_written, error); + while (g_hash_table_iter_next (&iter_security, &key, &value)) { + out_line = + g_strdup_printf (need_quote ((gchar *) key) ? + "\t%s=\"%s\"\n" : "\t%s=%s\n", + (gchar *) key, (gchar *) value); + g_io_channel_write_chars (channel, out_line, -1, + &bytes_written, error); + if (bytes_written == 0 || (error && *error)) + break; + g_free (out_line); + } + g_io_channel_write_chars (channel, + "}\n\n", -1, &bytes_written, error); + + } + if (error && *error) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, "Found error: %s", + (*error)->message); + goto done; + } + g_io_channel_flush (channel, error); + + if (error && *error) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, "Found error: %s", + (*error)->message); + goto done; + } + wpa_parser_data_changed = FALSE; + result = TRUE; + done: + g_io_channel_shutdown (channel, FALSE, NULL); + g_io_channel_unref (channel); + return result; +} + +/* If value is NULL, this method will delete old key value pair */ +void +wpa_set_data (gchar * ssid, gchar * key, gchar * value) +{ + gpointer orig_key = NULL, orig_value = NULL; + GHashTable *security = g_hash_table_lookup (wsec_table, ssid); + + g_return_if_fail (security != NULL); + + /* Remove old key value pairs */ + if (g_hash_table_lookup_extended + (security, key, &orig_key, &orig_value)) { + g_hash_table_remove (security, orig_key); + g_free (orig_key); + g_free (orig_value); + } + + /* Add new key value */ + if (value) { + gchar *new_value = g_strdup (value); + + if (strcmp (key, "ssid") != 0 && strcmp (key, "psk") != 0 + && !g_str_has_prefix (key, "wep_key")) + strip_string (new_value, '"'); + g_hash_table_insert (security, g_strdup (key), new_value); + } + wpa_parser_data_changed = TRUE; +} + +gboolean +wpa_has_security (gchar * ssid) +{ + return g_hash_table_lookup (wsec_table, ssid) != NULL; +} + +gboolean +wpa_add_security (gchar * ssid) +{ + if (wpa_has_security (ssid)) + return FALSE; + else { + GHashTable *security = + g_hash_table_new (g_str_hash, g_str_equal); + gchar *ssid_i; + + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Adding security for %s", + ssid); + if (g_str_has_prefix (ssid, "0x")) { + /* hex ssid */ + ssid_i = g_strdup (ssid + 2); + } else { + /* ascii ssid requires quotes */ + ssid_i = g_strdup_printf ("\"%s\"", ssid); + } + g_hash_table_insert (security, strdup ("ssid"), ssid_i); + g_hash_table_insert (security, strdup ("priority"), + strdup ("1")); + g_hash_table_insert (wsec_table, g_strdup (ssid), security); + wpa_parser_data_changed = TRUE; + return TRUE; + } +} + +gboolean +wpa_delete_security (gchar * ssid) +{ + gpointer orig_key, orig_value; + + g_return_val_if_fail (wsec_table != NULL && ssid != NULL, FALSE); + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Deleting security for %s", ssid); + if (!g_hash_table_lookup_extended + (wsec_table, ssid, &orig_key, &orig_value)) + return FALSE; + g_hash_table_remove (wsec_table, orig_key); + g_free (orig_key); + destroy_security ((GHashTable *) orig_value); + wpa_parser_data_changed = TRUE; + return TRUE; + +} + +void +wpa_parser_destroy (void) +{ + GHashTableIter iter; + gpointer key; + gpointer value; + + /* Destroy security */ + if (wsec_table) { + g_hash_table_iter_init (&iter, wsec_table); + while (g_hash_table_iter_next (&iter, &key, &value)) { + destroy_security ((GHashTable *) value); + g_free (key); + } + + g_hash_table_destroy (wsec_table); + wsec_table = NULL; + } + + /* Destroy global data */ + if (wsec_global_table) { + g_hash_table_iter_init (&iter, wsec_global_table); + while (g_hash_table_iter_next (&iter, &key, &value)) { + g_free (key); + g_free (value); + } + + g_hash_table_destroy (wsec_global_table); + wsec_global_table = NULL; + } +} diff --git a/system-settings/plugins/ifnet/wpa_parser.h b/system-settings/plugins/ifnet/wpa_parser.h new file mode 100644 index 0000000000..55b0ec0c60 --- /dev/null +++ b/system-settings/plugins/ifnet/wpa_parser.h @@ -0,0 +1,40 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Mu Qiao + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 1999-2010 Gentoo Foundation, Inc. + */ + +#ifndef _WPA_PARSER_H +#define _WPA_PARSER_H +#define WPA_SUPPLICANT_CONF "/etc/wpa_supplicant/wpa_supplicant.conf" +#include +void wpa_parser_init (gchar * wpa_supplicant_conf); +void wpa_parser_destroy (void); + +/* reader functions */ +gchar *wpa_get_value (gchar * ssid, gchar * key); +gboolean exist_ssid (gchar * ssid); +GHashTable *_get_hash_table (gchar * ssid); +gboolean wpa_has_security (gchar * ssid); + +/* writer functions */ +gboolean wpa_flush_to_file (gchar * config_file); +void wpa_set_data (gchar * ssid, gchar * key, gchar * value); +gboolean wpa_add_security (gchar * ssid); +gboolean wpa_delete_security (gchar * ssid); +#endif -- cgit v1.2.1 From f917852de3f4676f259edd2f272b561c9068435b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 25 Aug 2010 15:12:32 -0500 Subject: core: validate Enable/Disable WiFi and WWAN requests (rh #626337) Since these were properties they are harder to validate the caller as dbus-glib doesn't have any hooks before the property is set. So we install a low-level dbus filter function to catch property Set requests before they get to dbus-glib and handle the property access there. --- src/nm-manager-auth.c | 36 ++++++++--- src/nm-manager-auth.h | 5 ++ src/nm-manager.c | 171 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 205 insertions(+), 7 deletions(-) diff --git a/src/nm-manager-auth.c b/src/nm-manager-auth.c index 5bd480f385..44c82c23e6 100644 --- a/src/nm-manager-auth.c +++ b/src/nm-manager-auth.c @@ -73,16 +73,17 @@ default_call_func (NMAuthChain *chain, nm_auth_chain_set_data (chain, permission, GUINT_TO_POINTER (result), NULL); } -NMAuthChain * -nm_auth_chain_new (PolkitAuthority *authority, - DBusGMethodInvocation *context, - DBusGProxy *proxy, - NMAuthChainResultFunc done_func, - gpointer user_data) +static NMAuthChain * +_auth_chain_new (PolkitAuthority *authority, + DBusGMethodInvocation *context, + DBusGProxy *proxy, + DBusMessage *message, + NMAuthChainResultFunc done_func, + gpointer user_data) { NMAuthChain *self; - g_return_val_if_fail (context || proxy, NULL); + g_return_val_if_fail (context || proxy || message, NULL); self = g_malloc0 (sizeof (NMAuthChain)); self->refcount = 1; @@ -97,6 +98,8 @@ nm_auth_chain_new (PolkitAuthority *authority, self->owner = g_strdup (dbus_g_proxy_get_bus_name (proxy)); else if (context) self->owner = dbus_g_method_get_sender (context); + else if (message) + self->owner = g_strdup (dbus_message_get_sender (message)); if (!self->owner) { /* Need an owner */ @@ -108,6 +111,25 @@ nm_auth_chain_new (PolkitAuthority *authority, return self; } +NMAuthChain * +nm_auth_chain_new (PolkitAuthority *authority, + DBusGMethodInvocation *context, + DBusGProxy *proxy, + NMAuthChainResultFunc done_func, + gpointer user_data) +{ + return _auth_chain_new (authority, context, proxy, NULL, done_func, user_data); +} + +NMAuthChain * +nm_auth_chain_new_raw_message (PolkitAuthority *authority, + DBusMessage *message, + NMAuthChainResultFunc done_func, + gpointer user_data) +{ + return _auth_chain_new (authority, NULL, NULL, message, done_func, user_data); +} + gpointer nm_auth_chain_get_data (NMAuthChain *self, const char *tag) { diff --git a/src/nm-manager-auth.h b/src/nm-manager-auth.h index dab32b0f54..6682f91ca1 100644 --- a/src/nm-manager-auth.h +++ b/src/nm-manager-auth.h @@ -61,6 +61,11 @@ NMAuthChain *nm_auth_chain_new (PolkitAuthority *authority, NMAuthChainResultFunc done_func, gpointer user_data); +NMAuthChain *nm_auth_chain_new_raw_message (PolkitAuthority *authority, + DBusMessage *message, + NMAuthChainResultFunc done_func, + gpointer user_data); + gpointer nm_auth_chain_get_data (NMAuthChain *chain, const char *tag); void nm_auth_chain_set_data (NMAuthChain *chain, diff --git a/src/nm-manager.c b/src/nm-manager.c index e581a63327..6e40cb5eeb 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -3969,6 +3969,159 @@ firmware_dir_changed (GFileMonitor *monitor, } } +#define PERM_DENIED_ERROR "org.freedesktop.NetworkManager.PermissionDenied" + +static void +prop_set_auth_done_cb (NMAuthChain *chain, + GError *error, + DBusGMethodInvocation *context, + gpointer user_data) +{ + NMManager *self = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + DBusGConnection *bus; + DBusConnection *dbus_connection; + NMAuthCallResult result; + DBusMessage *reply, *request; + const char *permission, *prop; + gboolean set_enabled = TRUE; + + priv->auth_chains = g_slist_remove (priv->auth_chains, chain); + + request = nm_auth_chain_get_data (chain, "message"); + permission = nm_auth_chain_get_data (chain, "permission"); + prop = nm_auth_chain_get_data (chain, "prop"); + set_enabled = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, "enabled")); + + if (error) { + reply = dbus_message_new_error (request, PERM_DENIED_ERROR, + "Not authorized to perform this operation"); + } else { + /* Caller has had a chance to obtain authorization, so we only need to + * check for 'yes' here. + */ + result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, permission)); + if (result != NM_AUTH_CALL_RESULT_YES) { + reply = dbus_message_new_error (request, PERM_DENIED_ERROR, + "Not authorized to perform this operation"); + } else { + g_object_set (self, prop, set_enabled, NULL); + reply = dbus_message_new_method_return (request); + } + } + + if (reply) { + bus = nm_dbus_manager_get_connection (priv->dbus_mgr); + g_assert (bus); + dbus_connection = dbus_g_connection_get_connection (bus); + g_assert (dbus_connection); + + dbus_connection_send (dbus_connection, reply, NULL); + dbus_message_unref (reply); + } + nm_auth_chain_unref (chain); +} + +static DBusHandlerResult +prop_filter (DBusConnection *connection, + DBusMessage *message, + void *user_data) +{ + NMManager *self = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + DBusMessageIter iter; + DBusMessageIter sub; + const char *propiface = NULL; + const char *propname = NULL; + const char *sender = NULL; + const char *glib_propname = NULL, *permission = NULL; + DBusError dbus_error; + gulong uid = G_MAXULONG; + DBusMessage *reply = NULL; + gboolean set_enabled = FALSE; + NMAuthChain *chain; + + /* The sole purpose of this function is to validate property accesses + * on the NMManager object since dbus-glib doesn't yet give us this + * functionality. + */ + + if (!dbus_message_is_method_call (message, DBUS_INTERFACE_PROPERTIES, "Set")) + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + + dbus_message_iter_init (message, &iter); + + /* Get the D-Bus interface of the property to set */ + if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_STRING) + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + dbus_message_iter_get_basic (&iter, &propiface); + if (!propiface || strcmp (propiface, NM_DBUS_INTERFACE)) + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + dbus_message_iter_next (&iter); + + /* Get the property name that's going to be set */ + if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_STRING) + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + dbus_message_iter_get_basic (&iter, &propname); + dbus_message_iter_next (&iter); + + if (!strcmp (propname, "WirelessEnabled")) { + glib_propname = NM_MANAGER_WIRELESS_ENABLED; + permission = NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI; + } else if (!strcmp (propname, "WwanEnabled")) { + glib_propname = NM_MANAGER_WWAN_ENABLED; + permission = NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN; + } else + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + + /* Get the new value for the property */ + if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_VARIANT) + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + dbus_message_iter_recurse (&iter, &sub); + if (dbus_message_iter_get_arg_type (&sub) != DBUS_TYPE_BOOLEAN) + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + dbus_message_iter_get_basic (&sub, &set_enabled); + + sender = dbus_message_get_sender (message); + if (!sender) { + reply = dbus_message_new_error (message, PERM_DENIED_ERROR, + "Could not determine D-Bus requestor"); + goto out; + } + + dbus_error_init (&dbus_error); + uid = dbus_bus_get_unix_user (connection, sender, &dbus_error); + if (dbus_error_is_set (&dbus_error)) { + reply = dbus_message_new_error (message, PERM_DENIED_ERROR, + "Could not determine the user ID of the requestor"); + dbus_error_free (&dbus_error); + goto out; + } + + if (uid > 0) { + /* Otherwise validate the user request */ + chain = nm_auth_chain_new_raw_message (priv->authority, message, prop_set_auth_done_cb, self); + g_assert (chain); + priv->auth_chains = g_slist_append (priv->auth_chains, chain); + nm_auth_chain_set_data (chain, "prop", g_strdup (glib_propname), g_free); + nm_auth_chain_set_data (chain, "permission", g_strdup (permission), g_free); + nm_auth_chain_set_data (chain, "enabled", GUINT_TO_POINTER (set_enabled), NULL); + nm_auth_chain_set_data (chain, "message", dbus_message_ref (message), (GDestroyNotify) dbus_message_unref); + nm_auth_chain_add_call (chain, permission, TRUE); + } else { + /* Yay for root */ + g_object_set (self, glib_propname, set_enabled, NULL); + reply = dbus_message_new_method_return (message); + } + +out: + if (reply) { + dbus_connection_send (connection, reply, NULL); + dbus_message_unref (reply); + } + return DBUS_HANDLER_RESULT_HANDLED; +} + NMManager * nm_manager_get (const char *config_file, const char *plugins, @@ -3981,6 +4134,7 @@ nm_manager_get (const char *config_file, static NMManager *singleton = NULL; NMManagerPrivate *priv; DBusGConnection *bus; + DBusConnection *dbus_connection; if (singleton) return g_object_ref (singleton); @@ -3992,6 +4146,14 @@ nm_manager_get (const char *config_file, bus = nm_dbus_manager_get_connection (priv->dbus_mgr); g_assert (bus); + dbus_connection = dbus_g_connection_get_connection (bus); + g_assert (dbus_connection); + + if (!dbus_connection_add_filter (dbus_connection, prop_filter, singleton, NULL)) { + nm_log_err (LOGD_CORE, "failed to register DBus connection filter"); + g_object_unref (singleton); + return NULL; + } priv->sys_settings = nm_sysconfig_settings_new (config_file, plugins, bus, error); if (!priv->sys_settings) { @@ -4060,6 +4222,8 @@ dispose (GObject *object) NMManager *manager = NM_MANAGER (object); NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); GSList *iter; + DBusGConnection *bus; + DBusConnection *dbus_connection; if (priv->disposed) { G_OBJECT_CLASS (nm_manager_parent_class)->dispose (object); @@ -4119,7 +4283,14 @@ dispose (GObject *object) } g_object_unref (priv->modem_manager); + /* Unregister property filter */ + bus = nm_dbus_manager_get_connection (priv->dbus_mgr); + g_assert (bus); + dbus_connection = dbus_g_connection_get_connection (bus); + g_assert (dbus_connection); + dbus_connection_remove_filter (dbus_connection, prop_filter, manager); g_object_unref (priv->dbus_mgr); + if (priv->bluez_mgr) g_object_unref (priv->bluez_mgr); -- cgit v1.2.1 From a093792cd0a3153e174386ebead6cd982db52a9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Thu, 26 Aug 2010 16:11:59 +0200 Subject: man: add "EXIT STATUS" section to nmcli man page --- man/nmcli.1.in | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/man/nmcli.1.in b/man/nmcli.1.in index 056b5bdd40..260d076516 100644 --- a/man/nmcli.1.in +++ b/man/nmcli.1.in @@ -22,7 +22,7 @@ .\" .\" Copyright (C) 2010 Red Hat, Inc. .\" -.TH NMCLI "1" "14 April 2010" +.TH NMCLI "1" "26 August 2010" .SH NAME nmcli \- command-line tool for controlling NetworkManager @@ -312,10 +312,28 @@ No simple reference. .fi .RE +.SH EXIT STATUS +\fInmcli\fP exits with status 0 if it succeeds, a value greater than 0 is returned if errors occur. +.IP "0" 4 +Success - indicates the operation succeeded +.IP "1" 4 +Unknown or unspecified error +.IP "2" 4 +Invalid user input, wrong \fInmcli\fP invocation +.IP "3" 4 +Timeout expired (see commands with \fI\-\-timeout\fP option) +.IP "4" 4 +Connection activation failed +.IP "5" 4 +Connection deactivation failed +.IP "6" 4 +Disconnecting device failed + .SH BUGS There are probably some. If you find a bug, please report to https://bugzilla.gnome.org/ \- product \fINetworkManager\fP. .SH SEE ALSO .BR nm\-tool (1), +.BR nm\-online (1), .BR NetworkManager(8). -- cgit v1.2.1 From 9b54cb1ec617ea8bff86d6d74c06cef5a51e26c9 Mon Sep 17 00:00:00 2001 From: Patrik Martinsson Date: Thu, 26 Aug 2010 17:39:44 -0500 Subject: dispatcher: add dhcp4-change and dhcp6-change events (bgo #563654) New dispatcher events on DHCP lease changes. --- man/NetworkManager.8.in | 4 ++++ src/nm-device.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/man/NetworkManager.8.in b/man/NetworkManager.8.in index a6be073170..4f700e9a38 100644 --- a/man/NetworkManager.8.in +++ b/man/NetworkManager.8.in @@ -52,6 +52,10 @@ A VPN connection has been deactivated. .TP .I "hostname" The system hostname has been updated. Use gethostname(2) to retrieve it. +.I "dhcp4\-change" +The DHCPv4 lease has changed (renewed, rebound, etc). +.I "dhcp6\-change" +The DHCPv6 lease has changed (renewed, rebound, etc). .SH OPTIONS The following options are supported: .TP diff --git a/src/nm-device.c b/src/nm-device.c index d7c57fced2..9e8ccdf296 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -1344,6 +1344,7 @@ handle_dhcp_lease_change (NMDevice *device, gboolean ipv6) nm_dhcp_client_foreach_option (priv->dhcp6_client, dhcp6_add_option_cb, priv->dhcp6_config); + nm_utils_call_dispatcher ("dhcp6-change", connection, device, NULL); } else { nm_log_warn (LOGD_DHCP6, "(%s): failed to update IPv6 config in response to DHCP event.", nm_device_get_ip_iface (device)); @@ -1368,6 +1369,7 @@ handle_dhcp_lease_change (NMDevice *device, gboolean ipv6) nm_dhcp_client_foreach_option (priv->dhcp4_client, dhcp4_add_option_cb, priv->dhcp4_config); + nm_utils_call_dispatcher ("dhcp4-change", connection, device, NULL); } else { nm_log_warn (LOGD_DHCP6, "(%s): failed to update IPv4 config in response to DHCP event.", nm_device_get_ip_iface (device)); -- cgit v1.2.1 From a33843ac3df6abf8705fb12cc90b9505a166abfb Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 31 Aug 2010 15:45:55 -0500 Subject: core: listen to UPower for suspend/resume signals This means you don't need pm-utils anymore, and that gnome-power-manager doesn't need to poke NM explicitly for suspend/resume operations. The old explicit sleep/wake request is still around for pm-utils or gpm to use, but NM will listen for UPower events and act on them regardless of what pm-utils or gpm do. --- src/nm-manager.c | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 6e40cb5eeb..d4a73770a8 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -61,6 +61,8 @@ #define NM_AUTOIP_DBUS_SERVICE "org.freedesktop.nm_avahi_autoipd" #define NM_AUTOIP_DBUS_IFACE "org.freedesktop.nm_avahi_autoipd" +#define UPOWER_DBUS_SERVICE "org.freedesktop.UPower" + static gboolean impl_manager_get_devices (NMManager *manager, GPtrArray **devices, GError **err); static void impl_manager_activate_connection (NMManager *manager, const char *service_name, @@ -231,6 +233,7 @@ typedef struct { guint modem_removed_id; DBusGProxy *aipd_proxy; + DBusGProxy *upower_proxy; PolkitAuthority *authority; guint auth_changed_id; @@ -3354,6 +3357,9 @@ _internal_sleep (NMManager *self, gboolean do_sleep) { NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + if (priv->sleeping == do_sleep) + return; + nm_log_info (LOGD_SUSPEND, "%s requested (sleeping: %s enabled: %s)", do_sleep ? "sleep" : "wake", priv->sleeping ? "yes" : "no", @@ -3382,7 +3388,7 @@ sleep_auth_done_cb (NMAuthChain *chain, result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, NM_AUTH_PERMISSION_SLEEP_WAKE)); if (error) { - nm_log_dbg (LOGD_CORE, "Sleep/wake request failed: %s", error->message); + nm_log_dbg (LOGD_SUSPEND, "Sleep/wake request failed: %s", error->message); ret_error = g_error_new (NM_MANAGER_ERROR, NM_MANAGER_ERROR_PERMISSION_DENIED, "Sleep/wake request failed: %s", @@ -3456,6 +3462,20 @@ impl_manager_sleep (NMManager *self, nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_SLEEP_WAKE, TRUE); } +static void +upower_sleeping_cb (DBusGProxy *proxy, gpointer user_data) +{ + nm_log_dbg (LOGD_SUSPEND, "Received UPower sleeping signal"); + _internal_sleep (NM_MANAGER (user_data), TRUE); +} + +static void +upower_resuming_cb (DBusGProxy *proxy, gpointer user_data) +{ + nm_log_dbg (LOGD_SUSPEND, "Received UPower resuming signal"); + _internal_sleep (NM_MANAGER (user_data), FALSE); +} + static void _internal_enable (NMManager *self, gboolean enable) { @@ -4294,6 +4314,9 @@ dispose (GObject *object) if (priv->bluez_mgr) g_object_unref (priv->bluez_mgr); + if (priv->upower_proxy) + g_object_unref (priv->upower_proxy); + if (priv->fw_monitor) { if (priv->fw_monitor_id) g_signal_handler_disconnect (priv->fw_monitor, priv->fw_monitor_id); @@ -4468,6 +4491,24 @@ nm_manager_init (NMManager *manager) } else nm_log_warn (LOGD_AUTOIP4, "could not initialize avahi-autoipd D-Bus proxy"); + /* upower sleep/wake handling */ + priv->upower_proxy = dbus_g_proxy_new_for_name (g_connection, + UPOWER_DBUS_SERVICE, + "/org/freedesktop/UPower", + "org.freedesktop.UPower"); + if (priv->upower_proxy) { + dbus_g_proxy_add_signal (priv->upower_proxy, "Sleeping", G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->upower_proxy, "Sleeping", + G_CALLBACK (upower_sleeping_cb), + manager, NULL); + + dbus_g_proxy_add_signal (priv->upower_proxy, "Resuming", G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->upower_proxy, "Resuming", + G_CALLBACK (upower_resuming_cb), + manager, NULL); + } else + nm_log_warn (LOGD_SUSPEND, "could not initialize UPower D-Bus proxy"); + priv->authority = polkit_authority_get_sync (NULL, &error); if (priv->authority) { priv->auth_changed_id = g_signal_connect (priv->authority, -- cgit v1.2.1 From d9c2755cfc85839ced4a8192ec5e49a3be1532c9 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 31 Aug 2010 15:47:16 -0500 Subject: core: clean up avahi-autiopd D-Bus proxy on exit --- src/nm-manager.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nm-manager.c b/src/nm-manager.c index d4a73770a8..1e9c3c6133 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -4314,6 +4314,9 @@ dispose (GObject *object) if (priv->bluez_mgr) g_object_unref (priv->bluez_mgr); + if (priv->aipd_proxy) + g_object_unref (priv->aipd_proxy); + if (priv->upower_proxy) g_object_unref (priv->upower_proxy); -- cgit v1.2.1 From e86ef05d84749c5a15d7bcf30f78056ca205489c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 1 Sep 2010 17:08:10 -0500 Subject: wifi: ensure Enabled state is preserved regardless of rfkill (bgo #624479) Previously the "Enable Wireless" state was somewhat tied to rfkill state, in that when NM started up, rfkill state would take precedence over what was listed in the state file, and if you rmmodded your wifi driver and then modprobed it again after disabling wifi from the menu, wifi would magically become re-enabled becuase rfkill state changed. Fix that by creating a third wifi/wwan enable state that tracks the actual user preference instead of just the rfkill state so that when the user disables wifi it stays disabled, regardless of what happens with rfkill. --- src/nm-manager.c | 218 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 123 insertions(+), 95 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 1e9c3c6133..abe30bf688 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -187,7 +187,8 @@ struct PendingActivation { }; typedef struct { - gboolean enabled; + gboolean user_enabled; + gboolean sw_enabled; gboolean hw_enabled; RfKillType rtype; const char *desc; @@ -1584,50 +1585,40 @@ write_value_to_state_file (const char *filename, return ret; } +static gboolean +radio_enabled_for_rstate (RadioState *rstate) +{ + return rstate->user_enabled && rstate->sw_enabled && rstate->hw_enabled; +} + +static gboolean +radio_enabled_for_type (NMManager *self, RfKillType rtype) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + + return radio_enabled_for_rstate (&priv->radio_states[rtype]); +} + static void -manager_set_radio_enabled (NMManager *manager, - RadioState *rstate, - gboolean enabled) +manager_update_radio_enabled (NMManager *self, RadioState *rstate) { - NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); GSList *iter; - GError *error = NULL; /* Do nothing for radio types not yet implemented */ if (!rstate->prop) return; - if (rstate->enabled == enabled) - return; - - /* Can't set wireless enabled if it's disabled in hardware */ - if (!rstate->hw_enabled && enabled) - return; - - rstate->enabled = enabled; - - g_object_notify (G_OBJECT (manager), rstate->prop); - - /* Update enabled key in state file */ - if (priv->state_file) { - if (!write_value_to_state_file (priv->state_file, - "main", rstate->key, - G_TYPE_BOOLEAN, (gpointer) &enabled, - &error)) { - nm_log_warn (LOGD_CORE, "writing to state file %s failed: (%d) %s.", - priv->state_file, - error ? error->code : -1, - (error && error->message) ? error->message : "unknown"); - } - } + g_object_notify (G_OBJECT (self), rstate->prop); /* Don't touch devices if asleep/networking disabled */ - if (manager_sleeping (manager)) + if (manager_sleeping (self)) return; /* enable/disable wireless devices as required */ for (iter = priv->devices; iter; iter = iter->next) { RfKillType devtype = RFKILL_TYPE_UNKNOWN; + gboolean enabled = radio_enabled_for_rstate (rstate); g_object_get (G_OBJECT (iter->data), NM_DEVICE_INTERFACE_RFKILL_TYPE, &devtype, NULL); if (devtype == rstate->rtype) { @@ -1749,6 +1740,21 @@ nm_manager_get_modem_enabled_state (NMManager *self) return wwan_state; } +static void +update_rstate_from_rfkill (RadioState *rstate, RfKillState rfkill) +{ + if (rfkill == RFKILL_UNBLOCKED) { + rstate->sw_enabled = TRUE; + rstate->hw_enabled = TRUE; + } else if (rfkill == RFKILL_SOFT_BLOCKED) { + rstate->sw_enabled = FALSE; + rstate->hw_enabled = TRUE; + } else if (rfkill == RFKILL_HARD_BLOCKED) { + rstate->sw_enabled = FALSE; + rstate->hw_enabled = FALSE; + } +} + static void manager_rfkill_update_one_type (NMManager *self, RadioState *rstate, @@ -1758,7 +1764,12 @@ manager_rfkill_update_one_type (NMManager *self, RfKillState udev_state = RFKILL_UNBLOCKED; RfKillState other_state = RFKILL_UNBLOCKED; RfKillState composite; - gboolean new_e = TRUE, new_he = TRUE; + gboolean old_enabled, new_enabled, old_rfkilled, new_rfkilled; + gboolean old_hwe; + + old_enabled = radio_enabled_for_rstate (rstate); + old_rfkilled = rstate->hw_enabled && rstate->sw_enabled; + old_hwe = rstate->hw_enabled; udev_state = nm_udev_manager_get_rfkill_state (priv->udev_mgr, rtype); @@ -1773,38 +1784,31 @@ manager_rfkill_update_one_type (NMManager *self, else composite = RFKILL_UNBLOCKED; - switch (composite) { - case RFKILL_UNBLOCKED: - new_e = TRUE; - new_he = TRUE; - break; - case RFKILL_SOFT_BLOCKED: - new_e = FALSE; - new_he = TRUE; - break; - case RFKILL_HARD_BLOCKED: - new_e = FALSE; - new_he = FALSE; - break; - default: - break; - } + update_rstate_from_rfkill (rstate, composite); if (rstate->desc) { - nm_log_dbg (LOGD_RFKILL, "%s hw-enabled %d enabled %d", - rstate->desc, new_he, new_e); + nm_log_dbg (LOGD_RFKILL, "%s hw-enabled %d sw-enabled %d", + rstate->desc, rstate->hw_enabled, rstate->sw_enabled); } - if (new_he != rstate->hw_enabled) { + /* Log new killswitch state */ + new_rfkilled = rstate->hw_enabled && rstate->sw_enabled; + if (old_rfkilled != new_rfkilled) { nm_log_info (LOGD_RFKILL, "%s now %s by radio killswitch", rstate->desc, - (new_e && new_he) ? "enabled" : "disabled"); + new_rfkilled ? "enabled" : "disabled"); + } - rstate->hw_enabled = new_he; + /* Send out property changed signal for HW enabled */ + if (rstate->hw_enabled != old_hwe) { if (rstate->hw_prop) g_object_notify (G_OBJECT (self), rstate->hw_prop); } - manager_set_radio_enabled (self, rstate, new_e); + + /* And finally update the actual device radio state itself */ + new_enabled = radio_enabled_for_rstate (rstate); + if (new_enabled != old_enabled) + manager_update_radio_enabled (self, rstate); } static void @@ -2014,7 +2018,7 @@ add_device (NMManager *self, NMDevice *device) NMConnection *existing = NULL; GHashTableIter iter; gpointer value; - gboolean managed = FALSE; + gboolean managed = FALSE, enabled = FALSE; iface = nm_device_get_ip_iface (device); g_assert (iface); @@ -2053,14 +2057,15 @@ add_device (NMManager *self, NMDevice *device) * then set this device's rfkill state based on the global state. */ nm_manager_rfkill_update (self, RFKILL_TYPE_WLAN); - nm_device_interface_set_enabled (NM_DEVICE_INTERFACE (device), - priv->radio_states[RFKILL_TYPE_WLAN].enabled); + enabled = radio_enabled_for_type (self, RFKILL_TYPE_WLAN); + nm_device_interface_set_enabled (NM_DEVICE_INTERFACE (device), enabled); } else if (NM_IS_DEVICE_MODEM (device)) { g_signal_connect (device, NM_DEVICE_MODEM_ENABLE_CHANGED, G_CALLBACK (manager_modem_enabled_changed), self); nm_manager_rfkill_update (self, RFKILL_TYPE_WWAN); + enabled = radio_enabled_for_type (self, RFKILL_TYPE_WWAN); /* Until we start respecting WWAN rfkill switches the modem itself * is the source of the enabled/disabled state, so the manager shouldn't * touch it here. @@ -3305,13 +3310,13 @@ do_sleep_wake (NMManager *self) */ for (i = 0; i < RFKILL_TYPE_MAX; i++) { RadioState *rstate = &priv->radio_states[i]; - gboolean enabled = (rstate->hw_enabled && rstate->enabled); + gboolean enabled = radio_enabled_for_rstate (rstate); RfKillType devtype = RFKILL_TYPE_UNKNOWN; if (rstate->desc) { - nm_log_dbg (LOGD_RFKILL, "%s %s devices (hw_enabled %d, enabled %d)", + nm_log_dbg (LOGD_RFKILL, "%s %s devices (hw_enabled %d, sw_enabled %d, user_enabled %d)", enabled ? "enabling" : "disabling", - rstate->desc, rstate->hw_enabled, rstate->enabled); + rstate->desc, rstate->hw_enabled, rstate->sw_enabled, rstate->user_enabled); } g_object_get (G_OBJECT (device), NM_DEVICE_INTERFACE_RFKILL_TYPE, &devtype, NULL); @@ -3879,34 +3884,21 @@ nm_manager_start (NMManager *self) /* Set initial radio enabled/disabled state */ for (i = 0; i < RFKILL_TYPE_MAX; i++) { RadioState *rstate = &priv->radio_states[i]; - gboolean enabled = TRUE, hw_enabled = TRUE; + RfKillState udev_state; if (!rstate->desc) continue; - switch (nm_udev_manager_get_rfkill_state (priv->udev_mgr, i)) { - case RFKILL_UNBLOCKED: - enabled = TRUE; - hw_enabled = TRUE; - break; - case RFKILL_SOFT_BLOCKED: - enabled = FALSE; - hw_enabled = TRUE; - break; - case RFKILL_HARD_BLOCKED: - enabled = FALSE; - hw_enabled = FALSE; - break; - default: - break; - } + udev_state = nm_udev_manager_get_rfkill_state (priv->udev_mgr, i); + update_rstate_from_rfkill (rstate, udev_state); - rstate->hw_enabled = hw_enabled; - nm_log_info (LOGD_RFKILL, "%s %s by radio killswitch; %s by state file", - rstate->desc, - (rstate->hw_enabled && enabled) ? "enabled" : "disabled", - (rstate->enabled) ? "enabled" : "disabled"); - manager_set_radio_enabled (self, rstate, rstate->enabled && enabled); + if (rstate->desc) { + nm_log_info (LOGD_RFKILL, "%s %s by radio killswitch; %s by state file", + rstate->desc, + (rstate->hw_enabled && rstate->sw_enabled) ? "enabled" : "disabled", + rstate->user_enabled ? "enabled" : "disabled"); + } + manager_update_radio_enabled (self, rstate); } /* Log overall networking status - enabled/disabled */ @@ -4188,8 +4180,8 @@ nm_manager_get (const char *config_file, priv->net_enabled = initial_net_enabled; - priv->radio_states[RFKILL_TYPE_WLAN].enabled = initial_wifi_enabled; - priv->radio_states[RFKILL_TYPE_WWAN].enabled = initial_wwan_enabled; + priv->radio_states[RFKILL_TYPE_WLAN].user_enabled = initial_wifi_enabled; + priv->radio_states[RFKILL_TYPE_WWAN].user_enabled = initial_wwan_enabled; g_signal_connect (priv->sys_settings, "notify::" NM_SYSCONFIG_SETTINGS_UNMANAGED_SPECS, G_CALLBACK (system_unmanaged_devices_changed_cb), singleton); @@ -4334,6 +4326,42 @@ dispose (GObject *object) G_OBJECT_CLASS (nm_manager_parent_class)->dispose (object); } +static void +manager_radio_user_toggled (NMManager *self, + RadioState *rstate, + gboolean enabled) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + GError *error = NULL; + gboolean old_enabled, new_enabled; + + if (rstate->desc) { + nm_log_dbg (LOGD_RFKILL, "(%s): setting radio %s by user", + rstate->desc, + enabled ? "enabled" : "disabled"); + } + + /* Update enabled key in state file */ + if (priv->state_file) { + if (!write_value_to_state_file (priv->state_file, + "main", rstate->key, + G_TYPE_BOOLEAN, (gpointer) &enabled, + &error)) { + nm_log_warn (LOGD_CORE, "writing to state file %s failed: (%d) %s.", + priv->state_file, + error ? error->code : -1, + (error && error->message) ? error->message : "unknown"); + g_clear_error (&error); + } + } + + old_enabled = radio_enabled_for_rstate (rstate); + rstate->user_enabled = enabled; + new_enabled = radio_enabled_for_rstate (rstate); + if (new_enabled != old_enabled) + manager_update_radio_enabled (self, rstate); +} + static void set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) @@ -4347,14 +4375,14 @@ set_property (GObject *object, guint prop_id, priv->net_enabled = g_value_get_boolean (value); break; case PROP_WIRELESS_ENABLED: - manager_set_radio_enabled (NM_MANAGER (object), - &priv->radio_states[RFKILL_TYPE_WLAN], - g_value_get_boolean (value)); + manager_radio_user_toggled (NM_MANAGER (object), + &priv->radio_states[RFKILL_TYPE_WLAN], + g_value_get_boolean (value)); break; case PROP_WWAN_ENABLED: - manager_set_radio_enabled (NM_MANAGER (object), - &priv->radio_states[RFKILL_TYPE_WWAN], - g_value_get_boolean (value)); + manager_radio_user_toggled (NM_MANAGER (object), + &priv->radio_states[RFKILL_TYPE_WWAN], + g_value_get_boolean (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -4378,13 +4406,13 @@ get_property (GObject *object, guint prop_id, g_value_set_boolean (value, priv->net_enabled); break; case PROP_WIRELESS_ENABLED: - g_value_set_boolean (value, priv->radio_states[RFKILL_TYPE_WLAN].enabled); + g_value_set_boolean (value, radio_enabled_for_type (self, RFKILL_TYPE_WLAN)); break; case PROP_WIRELESS_HARDWARE_ENABLED: g_value_set_boolean (value, priv->radio_states[RFKILL_TYPE_WLAN].hw_enabled); break; case PROP_WWAN_ENABLED: - g_value_set_boolean (value, priv->radio_states[RFKILL_TYPE_WWAN].enabled); + g_value_set_boolean (value, radio_enabled_for_type (self, RFKILL_TYPE_WWAN)); break; case PROP_WWAN_HARDWARE_ENABLED: g_value_set_boolean (value, priv->radio_states[RFKILL_TYPE_WWAN].hw_enabled); @@ -4416,7 +4444,7 @@ nm_manager_init (NMManager *manager) /* Initialize rfkill structures and states */ memset (priv->radio_states, 0, sizeof (priv->radio_states)); - priv->radio_states[RFKILL_TYPE_WLAN].enabled = TRUE; + priv->radio_states[RFKILL_TYPE_WLAN].user_enabled = TRUE; priv->radio_states[RFKILL_TYPE_WLAN].key = "WirelessEnabled"; priv->radio_states[RFKILL_TYPE_WLAN].prop = NM_MANAGER_WIRELESS_ENABLED; priv->radio_states[RFKILL_TYPE_WLAN].hw_prop = NM_MANAGER_WIRELESS_HARDWARE_ENABLED; @@ -4424,7 +4452,7 @@ nm_manager_init (NMManager *manager) priv->radio_states[RFKILL_TYPE_WLAN].other_enabled_func = nm_manager_get_ipw_rfkill_state; priv->radio_states[RFKILL_TYPE_WLAN].rtype = RFKILL_TYPE_WLAN; - priv->radio_states[RFKILL_TYPE_WWAN].enabled = TRUE; + priv->radio_states[RFKILL_TYPE_WWAN].user_enabled = TRUE; priv->radio_states[RFKILL_TYPE_WWAN].key = "WWANEnabled"; priv->radio_states[RFKILL_TYPE_WWAN].prop = NM_MANAGER_WWAN_ENABLED; priv->radio_states[RFKILL_TYPE_WWAN].hw_prop = NM_MANAGER_WWAN_HARDWARE_ENABLED; @@ -4432,7 +4460,7 @@ nm_manager_init (NMManager *manager) priv->radio_states[RFKILL_TYPE_WWAN].other_enabled_func = nm_manager_get_modem_enabled_state; priv->radio_states[RFKILL_TYPE_WWAN].rtype = RFKILL_TYPE_WWAN; - priv->radio_states[RFKILL_TYPE_WIMAX].enabled = TRUE; + priv->radio_states[RFKILL_TYPE_WIMAX].user_enabled = TRUE; priv->radio_states[RFKILL_TYPE_WIMAX].key = "WiMAXEnabled"; priv->radio_states[RFKILL_TYPE_WIMAX].prop = NULL; priv->radio_states[RFKILL_TYPE_WIMAX].hw_prop = NULL; -- cgit v1.2.1 From c0b7dc973462736fdf4ff647bde3e68da9525243 Mon Sep 17 00:00:00 2001 From: Michael Kotsarinis Date: Wed, 1 Sep 2010 17:12:34 -0500 Subject: po: update Greek translation (bgo #628541) --- po/el.po | 1596 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 1497 insertions(+), 99 deletions(-) diff --git a/po/el.po b/po/el.po index 7890d9b9ce..b8d1619cdc 100644 --- a/po/el.po +++ b/po/el.po @@ -6,21 +6,1186 @@ # Dimitris Glezos , 2006. # Jennie Petoumenou , 2008, 2009. # Tournaris Pavlos , 2009. +# Simos Xenitellis , 2010. +# msgid "" msgstr "" "Project-Id-Version: NetworkManager.HEAD\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "product=NetworkManager&component=general\n" -"POT-Creation-Date: 2009-08-27 03:24+0000\n" -"PO-Revision-Date: 2009-09-10 11:08+0200\n" -"Last-Translator: Tournaris Pavlos \n" -"Language-Team: Greek \n" +"POT-Creation-Date: 2010-08-10 03:25+0000\n" +"PO-Revision-Date: 2010-09-01 22:08+0300\n" +"Last-Translator: Simos Xenitellis \n" +"Language-Team: Greek \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=2; plural=n>1;\n" "X-Generator: Lokalize 0.3\n" +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/devices.c:88 ../cli/src/devices.c:101 ../cli/src/devices.c:111 +#: ../cli/src/devices.c:121 ../cli/src/devices.c:134 ../cli/src/devices.c:145 +#: ../cli/src/devices.c:156 ../cli/src/devices.c:165 ../cli/src/devices.c:174 +msgid "NAME" +msgstr "ΟΝΟΜΑ" + +#. 0 +#: ../cli/src/connections.c:61 ../cli/src/connections.c:76 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:62 +msgid "DEVICES" +msgstr "ΣΥΣΚΕΥΕΣ" + +#. 2 +#: ../cli/src/connections.c:63 ../cli/src/connections.c:78 +msgid "SCOPE" +msgstr "ΕΥΡΟΣ" + +#. 3 +#: ../cli/src/connections.c:64 +msgid "DEFAULT" +msgstr "ΠΡΟΕΠΙΛΟΓΗ" + +#. 4 +#: ../cli/src/connections.c:65 +msgid "DBUS-SERVICE" +msgstr "ΥΠΗΡΕΣΙΑ DBUS" + +#. 5 +#: ../cli/src/connections.c:66 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:67 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:77 ../cli/src/devices.c:62 ../cli/src/devices.c:90 +msgid "TYPE" +msgstr "ΤΥΠΟΣ" + +#. 3 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:80 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-ΠΡΑΓΜΑΤΙΚΟ" + +#. 5 +#: ../cli/src/connections.c:81 +msgid "AUTOCONNECT" +msgstr "ΑΥΤΟΜΑΤΗ-ΣΥΝΔΕΣΗ" + +#. 6 +#: ../cli/src/connections.c:82 +msgid "READONLY" +msgstr "ΜΟΝΟ-ΓΙΑ-ΑΝΑΓΝΩΣΗ" + +#: ../cli/src/connections.c:158 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Χρήση: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:198 ../cli/src/connections.c:537 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Σφάλμα: 'con list': %s" + +#: ../cli/src/connections.c:200 ../cli/src/connections.c:539 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Σφάλμα: 'con list': %s; επιτρεπόμενα πεδία: %s" + +#: ../cli/src/connections.c:208 +msgid "Connection details" +msgstr "Λεπτομέρειες σύνδεσης" + +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 +#| msgid "System" +msgid "system" +msgstr "σύστημα" + +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 +msgid "user" +msgstr "χρήστης" + +#: ../cli/src/connections.c:384 +msgid "never" +msgstr "ποτέ" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:551 ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 +msgid "yes" +msgstr "ναι" + +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:510 ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 ../cli/src/settings.c:1224 +msgid "no" +msgstr "όχι" + +#: ../cli/src/connections.c:458 ../cli/src/connections.c:501 +#| msgid "Modify system connections" +msgid "System connections" +msgstr "Συνδέσεις συστήματος" + +#: ../cli/src/connections.c:463 ../cli/src/connections.c:514 +#| msgid "Modify system connections" +msgid "User connections" +msgstr "Συνδέσεις χρήστη" + +#: ../cli/src/connections.c:475 ../cli/src/connections.c:1335 +#: ../cli/src/connections.c:1351 ../cli/src/connections.c:1360 +#: ../cli/src/connections.c:1371 ../cli/src/connections.c:1456 +#: ../cli/src/devices.c:962 ../cli/src/devices.c:972 ../cli/src/devices.c:1074 +#: ../cli/src/devices.c:1081 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Σφάλμα: λείπει το όρισμα %s." + +#: ../cli/src/connections.c:488 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Σφάλμα: %s - δεν υπάρχει τέτοια σύνδεση." + +#: ../cli/src/connections.c:520 ../cli/src/connections.c:1384 +#: ../cli/src/connections.c:1474 ../cli/src/devices.c:785 +#: ../cli/src/devices.c:852 ../cli/src/devices.c:986 ../cli/src/devices.c:1087 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Άγνωστη παράμετρος: %s\n" + +#: ../cli/src/connections.c:529 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Σφάλμα: δεν ορίσθηκε έγκυρη παράμετρος." + +#: ../cli/src/connections.c:544 ../cli/src/connections.c:1577 +#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "Σφάλμα: %s." + +#: ../cli/src/connections.c:650 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Σφάλμα: 'con status': %s" + +#: ../cli/src/connections.c:652 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Σφάλμα: 'con status': %s; επιτρεπόμενα πεδία: %s" + +#: ../cli/src/connections.c:659 +#| msgid "Modify system connections" +msgid "Active connections" +msgstr "Ενεργές συνδέσεις" + +#: ../cli/src/connections.c:1027 +#, c-format +msgid "no active connection on device '%s'" +msgstr "δεν υπάρχει ενεργή σύνδεση στη συσκευή '%s'" + +#: ../cli/src/connections.c:1035 +#, c-format +msgid "no active connection or device" +msgstr "δεν πυάρχει ενεργή σύνδεση ή συσκευή" + +#: ../cli/src/connections.c:1085 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "η συσκευή '%s' δεν είναι συμβατή με τη σύνδεση '%s'" + +#: ../cli/src/connections.c:1087 +#, c-format +msgid "no device found for connection '%s'" +msgstr "δεν βρέθηκε συσκευή για τη σύνδεση '%s'" + +#: ../cli/src/connections.c:1098 +msgid "activating" +msgstr "ενεργοποίηση" + +#: ../cli/src/connections.c:1100 +msgid "activated" +msgstr "ενεργοποιήθηκε" + +#: ../cli/src/connections.c:1103 ../cli/src/connections.c:1126 +#: ../cli/src/connections.c:1159 ../cli/src/devices.c:246 +#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:473 +msgid "unknown" +msgstr "άγνωστη" + +#: ../cli/src/connections.c:1112 +msgid "VPN connecting (prepare)" +msgstr "Σύνδεση VPN (προετοιμασία)" + +#: ../cli/src/connections.c:1114 +msgid "VPN connecting (need authentication)" +msgstr "Σύνδεση VPN (απαιτείται πιστοποίηση)" + +#: ../cli/src/connections.c:1116 +msgid "VPN connecting" +msgstr "Σύνδεση VPN" + +#: ../cli/src/connections.c:1118 +msgid "VPN connecting (getting IP configuration)" +msgstr "Σύνδεση VPN (γίνεται λήψη ρυθμίσεων IP)" + +#: ../cli/src/connections.c:1120 +msgid "VPN connected" +msgstr "VPN συνδέθηκε" + +#: ../cli/src/connections.c:1122 +msgid "VPN connection failed" +msgstr "Σύνδεση VPN απέτυχε" + +#: ../cli/src/connections.c:1124 +msgid "VPN disconnected" +msgstr "VPN αποσυνδέθηκε" + +#: ../cli/src/connections.c:1135 +msgid "unknown reason" +msgstr "άγνωστη αιτία" + +#: ../cli/src/connections.c:1137 +msgid "none" +msgstr "κανένα" + +#: ../cli/src/connections.c:1139 +msgid "the user was disconnected" +msgstr "ο χρήστης αποσυνδέθηκε" + +#: ../cli/src/connections.c:1141 +msgid "the base network connection was interrupted" +msgstr "η βασική σύνδεση δικτύου διακόπηκε" + +#: ../cli/src/connections.c:1143 +msgid "the VPN service stopped unexpectedly" +msgstr "η υπηρεσία VPN σταμάτησε απρόσμενα" + +#: ../cli/src/connections.c:1145 +msgid "the VPN service returned invalid configuration" +msgstr "η υπηρεσία VPN επέστρεψε μη έγκυρη διαμόρφωση" + +#: ../cli/src/connections.c:1147 +msgid "the connection attempt timed out" +msgstr "έληξε το χρονικό όριο απόπειρας σύνδεσης" + +#: ../cli/src/connections.c:1149 +msgid "the VPN service did not start in time" +msgstr "η υπηρεσία VPN δεν ξεκίνησε εγκαίρως" + +#: ../cli/src/connections.c:1151 +msgid "the VPN service failed to start" +msgstr "η υπηρεσία VPN απέτυχε να εκκινήσει" + +#: ../cli/src/connections.c:1153 +msgid "no valid VPN secrets" +msgstr "δεν υπάρχουν έγκυρα μυστικά VPN" + +#: ../cli/src/connections.c:1155 +msgid "invalid VPN secrets" +msgstr "μη έγκυρα μυστικά VPN" + +#: ../cli/src/connections.c:1157 +msgid "the connection was removed" +msgstr "η σύνδεση αφαιρέθηκε" + +#: ../cli/src/connections.c:1171 +#, c-format +msgid "state: %s\n" +msgstr "κατάσταση: %s\n" + +#: ../cli/src/connections.c:1174 ../cli/src/connections.c:1200 +#, c-format +msgid "Connection activated\n" +msgstr "Ενεργοποιήθηκε η σύνδεση\n" + +#: ../cli/src/connections.c:1177 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Σφάλμα: Αποτυχία ενεργοποίησης σύνδεσης." + +#: ../cli/src/connections.c:1196 +#, c-format +msgid "state: %s (%d)\n" +msgstr "κατάσταση: %s (%d)\n" + +#: ../cli/src/connections.c:1206 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Σφάλμα: Αποτυχία ενεργοποίησης σύνδεσης: %s." + +#: ../cli/src/connections.c:1223 ../cli/src/devices.c:909 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Σφάλμα: Έληξε το χρονικό όριο %d sec" + +#: ../cli/src/connections.c:1266 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Σφάλμα: Αποτυχία ενεργοποίησης σύνδεσης: %s" + +#: ../cli/src/connections.c:1280 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Σφάλμα: Αποτυχία απόκτησης ενεργής σύνδεσης για '%s'." + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Κατάσταση ενεργής σύνδεσης: %s\n" + +#: ../cli/src/connections.c:1290 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Διαδρομή ενεργής σύνδεσης: %s\n" + +#: ../cli/src/connections.c:1344 ../cli/src/connections.c:1465 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Σφάλμα: Άγνωστη σύνδεση: %s." + +#: ../cli/src/connections.c:1379 ../cli/src/devices.c:980 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Σφάλμα: η τιμή του χορνικού ορίου '%s' δεν είναι έγκυρη." + +#: ../cli/src/connections.c:1392 ../cli/src/connections.c:1482 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Σφάλμα: πρέπει να καθορισθεί id ή uuid " + +#: ../cli/src/connections.c:1412 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Σφάλμα: Δεν βρέθηκε κατάλληλη συσκευή: %s." + +#: ../cli/src/connections.c:1414 +#, c-format +msgid "Error: No suitable device found." +msgstr "Σφάλμα: Δεν βρέθηκε κατάλληλη συσκευή." + +#: ../cli/src/connections.c:1509 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Προειδοποίηση: Η σύνδεση δεν είναι ενεργή\n" + +#: ../cli/src/connections.c:1566 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Σφάλμα: η εντολή 'con' '%s' δεν είναι έγκυρη." + +#: ../cli/src/connections.c:1602 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Σφάλμα: αδυναμία σύνδεσης στο D-Bus." + +#: ../cli/src/connections.c:1609 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Σφάλμα: Αδυναμία λήψης ρυθμίσεων συστήματος." + +#: ../cli/src/connections.c:1617 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Σφάλμα: Αδυναμία λήψης ρυθμίσεων χρήστη." + +#: ../cli/src/connections.c:1627 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "" +"Σφάλμα: Αδυναμία απόκτησης συνδέσεων: οι υπηρεσίες ρυθμίσεων δεν εκτελούνται." + +#. 0 +#. 9 +#: ../cli/src/devices.c:61 ../cli/src/devices.c:89 ../cli/src/devices.c:184 +msgid "DEVICE" +msgstr "ΣΥΣΚΕΥΗ" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:63 ../cli/src/devices.c:93 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "ΚΑΤΑΣΤΑΣΗ" + +#: ../cli/src/devices.c:72 +msgid "GENERAL" +msgstr "ΓΕΝΙΚΑ" + +#. 0 +#: ../cli/src/devices.c:73 +msgid "CAPABILITIES" +msgstr "ΔΥΝΑΤΟΤΗΤΕΣ" + +#. 1 +#: ../cli/src/devices.c:74 +msgid "WIFI-PROPERTIES" +msgstr "ΙΔΙΟΤΗΤΕΣ-WIFI" + +#. 2 +#: ../cli/src/devices.c:75 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:76 +msgid "WIRED-PROPERTIES" +msgstr "ΙΔΙΟΤΗΤΕΣ-ΕΝΣΥΡΜΑΤΗΣ" + +#. 4 +#: ../cli/src/devices.c:77 +msgid "IP4-SETTINGS" +msgstr "ΡΥΘΜΙΣΕΙΣ-IP4" + +#. 5 +#: ../cli/src/devices.c:78 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 6 +#: ../cli/src/devices.c:79 +msgid "IP6-SETTINGS" +msgstr "ΡΥΘΜΙΣΕΙΣ-IP6" + +#. 7 +#: ../cli/src/devices.c:80 +msgid "IP6-DNS" +msgstr "IP6-DNS" + +#. 2 +#: ../cli/src/devices.c:91 +msgid "DRIVER" +msgstr "ΟΔΗΓΟΣ" + +#. 3 +#: ../cli/src/devices.c:92 +msgid "HWADDR" +msgstr "ΔΙΕΥΘΥΝΣΗ-ΥΛΙΚΟΥ" + +#. 0 +#: ../cli/src/devices.c:102 +msgid "CARRIER-DETECT" +msgstr "ΑΝΙΧΝΕΥΣΗ-ΣΗΜΑΤΟΣ-ΓΡΑΜΜΗΣ" + +#. 1 +#: ../cli/src/devices.c:103 +msgid "SPEED" +msgstr "ΤΑΧΥΤΗΤΑ" + +#. 0 +#: ../cli/src/devices.c:112 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:122 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:123 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:124 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:125 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:126 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:135 ../cli/src/devices.c:146 +msgid "ADDRESS" +msgstr "ΔΙΕΥΘΥΝΣΗ" + +#. 1 +#: ../cli/src/devices.c:136 ../cli/src/devices.c:147 +msgid "PREFIX" +msgstr "ΠΡΟΘΕΜΑ" + +#. 2 +#: ../cli/src/devices.c:137 ../cli/src/devices.c:148 +msgid "GATEWAY" +msgstr "ΠΥΛΗ" + +#. 0 +#: ../cli/src/devices.c:157 ../cli/src/devices.c:166 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:175 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:176 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:177 +msgid "MODE" +msgstr "ΛΕΙΤΟΥΡΓΙΑ" + +#. 3 +#: ../cli/src/devices.c:178 +msgid "FREQ" +msgstr "ΣΥΧΝΟΤΗΤΑ" + +#. 4 +#: ../cli/src/devices.c:179 +msgid "RATE" +msgstr "ΡΥΘΜΟΣ" + +#. 5 +#: ../cli/src/devices.c:180 +msgid "SIGNAL" +msgstr "ΣΗΜΑ" + +#. 6 +#: ../cli/src/devices.c:181 +msgid "SECURITY" +msgstr "ΑΣΦΑΛΕΙΑ" + +#. 7 +#: ../cli/src/devices.c:182 +msgid "WPA-FLAGS" +msgstr "ΕΠΙΛΟΓΕΣ-WPA" + +#. 8 +#: ../cli/src/devices.c:183 +msgid "RSN-FLAGS" +msgstr "ΕΠΙΛΟΓΕΣ-RSN" + +#. 10 +#: ../cli/src/devices.c:185 +msgid "ACTIVE" +msgstr "ΕΝΕΡΓΗ" + +#: ../cli/src/devices.c:208 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"Χρήση: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:228 +msgid "unmanaged" +msgstr "χωρίς διαχείριση" + +#: ../cli/src/devices.c:230 +msgid "unavailable" +msgstr "μη διαθέσιμη" + +#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "αποσυνδέθηκε" + +#: ../cli/src/devices.c:234 +msgid "connecting (prepare)" +msgstr "σύνδεση (προετοιμασία)" + +#: ../cli/src/devices.c:236 +msgid "connecting (configuring)" +msgstr "σύνδεση (διαμόρφωση)" + +#: ../cli/src/devices.c:238 +msgid "connecting (need authentication)" +msgstr "σύνδεση (απαιτείται πιστοποίηση)" + +#: ../cli/src/devices.c:240 +msgid "connecting (getting IP configuration)" +msgstr "σύνδεση (γίνεται λήψη ρυθμίσεων IP)" + +#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "συνδέθηκε" + +#: ../cli/src/devices.c:244 +msgid "connection failed" +msgstr "αποτυχία σύνδεσης" + +#: ../cli/src/devices.c:267 ../cli/src/devices.c:424 +msgid "Unknown" +msgstr "Άγνωστο" + +#: ../cli/src/devices.c:299 +msgid "(none)" +msgstr "(κανένα)" + +#: ../cli/src/devices.c:324 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: σφάλμα κατά τη μετατροπή της διεύθυνσης IP4 0x%X" + +#: ../cli/src/devices.c:393 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:394 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:403 +msgid "Encrypted: " +msgstr "Κρυπτογραφημένη:" + +#: ../cli/src/devices.c:408 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:410 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:412 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:415 +msgid "Enterprise " +msgstr "Επιχείρηση " + +#: ../cli/src/devices.c:424 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:424 +msgid "Infrastructure" +msgstr "Υποδομή" + +#: ../cli/src/devices.c:486 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "Σφάλμα: 'dev list': %s" + +#: ../cli/src/devices.c:488 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Σφάλμα: 'dev list': %s, επιτρεπόμενα πεδία: %s" + +#: ../cli/src/devices.c:497 +msgid "Device details" +msgstr "Λεπτομέρειες συσκευής" + +#: ../cli/src/devices.c:527 ../cli/src/devices.c:925 +msgid "(unknown)" +msgstr "(άγνωστο)" + +#: ../cli/src/devices.c:528 +msgid "unknown)" +msgstr "άγνωστο)" + +#: ../cli/src/devices.c:554 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:627 +msgid "on" +msgstr "on" + +#: ../cli/src/devices.c:627 +msgid "off" +msgstr "off" + +#: ../cli/src/devices.c:808 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "Σφάλμα: 'dev status': %s" + +#: ../cli/src/devices.c:810 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Σφάλμα: 'dev status': %s, επιτρεπόμενα πεδία: %s" + +#: ../cli/src/devices.c:817 +msgid "Status of devices" +msgstr "Κατάσταση συσκευών" + +#: ../cli/src/devices.c:845 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Σφάλμα: Λείπει το όρισμα '%s' ." + +#: ../cli/src/devices.c:874 ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Σφάλμα: Δεν βρέθηκε η συσκευή '%s'." + +#: ../cli/src/devices.c:897 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Επιτυχία: Η συσκευή '%s' αποσυνδέθηκε επιτυχώς." + +#: ../cli/src/devices.c:922 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Σφάλμα: Αποτυχία αποσύνδεσης συσκευής '%s' (%s): %s" + +#: ../cli/src/devices.c:930 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Κατάσταση συσκευής: %d (%s)\n" + +#: ../cli/src/devices.c:994 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Σφάλμα: πρέπει να καθορισθεί το iface." + +#: ../cli/src/devices.c:1112 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "Σφάλμα: 'dev wifi': %s" + +#: ../cli/src/devices.c:1114 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Σφάλμα: 'dev wifi': %s, επιτρεπόμενα πεδία: %s" + +#: ../cli/src/devices.c:1121 +msgid "WiFi scan list" +msgstr "Λίστα σάρωσης WiFi" + +#: ../cli/src/devices.c:1156 ../cli/src/devices.c:1210 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Σφάλμα: δεν βρέθηκε σημείο πρόσβασης με hwaddr '%s'." + +#: ../cli/src/devices.c:1173 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Σφάλμα: Η συσκευή '%s' δεν είναι συσκευή WiFi." + +#: ../cli/src/devices.c:1237 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Σφάλμα: η εντολή 'dev wifi' '%s' δεν είναι έγκυρη." + +#: ../cli/src/devices.c:1284 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Σφάλμα: η εντολή 'dev' '%s' δεν είναι έγκυρη." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "ΕΚΤΕΛΕΙΤΑΙ" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "ΥΛΙΚΟ WIFI" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "ΥΛΙΚΟ WWAN" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Χρήση: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "ύπνωση" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "σύνδεση" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Σφάλμα: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Σφάλμα: 'nm status': %s, επιτρεπόμενα πεδία: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "Κατάσταση της Διαχείρισης Δικτύου" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "ενεργοποιημένη" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "απενεργοποιημένη" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "εκτελείται" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "δεν εκτελείται" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "" +"Σφάλμα: η τιμή '%s' του ορίσματος '--fields' δεν είναι έγκυρη εδώ. " +"Επιτρεπόμενα πεδία: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "Ασύρματο (WiFi) ενεργοποιημένο" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Σφάλμα: μη έγκυρη παράμετρος 'wifi': '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN ενεργοποιημένο" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Σφάλμα: μη έγκυρη παράμετρος 'wwan': '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Σφάλμα: η 'nm' εντολή '%s' δεν είναι έγκυρη." + +#: ../cli/src/nmcli.c:69 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Χρήση: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] λιτή έξοδος\n" +" -p[retty] όμορφη έξοδος\n" +" -m[ode] tabular|multiline τρόπος εξόδου\n" +" -f[ields] |all|common καθορισμός πεδίων για έξοδο\n" +" -e[scape] yes|no escape διαχωριστικά στηλών στις " +"τιμές\n" +" -v[ersion] εμφάνιση έκδοσης ποργράμματος\n" +" -h[elp] εκτύπωση βοήθειας\n" +"\n" +"OBJECT\n" +" nm Κατάσταση του NetworkManager\n" +" con Συνδέσεις του NetworkManager\n" +" dev συσκευές που διαχειρίζεται ο NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Σφάλμα: το αντικείμενο '%s' είναι άγνωστο, δοκιμάστε την 'nmcli help'." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Σφάλμα: η επιλογή '--terse' καθορίζεται τη δεύτερη φορά." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "" +"Σφάλμα: η επιλογή '--terse' είναι αμοιβαία αποκλειόμενη με την '--pretty'." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Σφάλμα: η επιλογή '--pretty' καθορίζεται τη δεύτερη φορά." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "" +"Σφάλμα: η επιλογή '--pretty' είναι αμοιβαία αποκλειόμενη με την '--terse'." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Σφάλμα: απουσίας ορίσματος για τηνη επιλογή '%s'." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Σφάλμα: το '%s' δεν είναι έγκυρο όρισμα για την επιλογή '%s'." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Σφάλμα: λείπουν πεδία για τις επιλογές '%s'." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "Εργαλείο nmcli, έκδοση %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Σφάλμα: Η επιλογή '%s' είναι άγνωστη, δοκιμάστε 'nmcli -help'." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "Ελήφθη σήμα %d, τερματισμός…" + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Σφάλμα: Αδυναμία σύνδεσης στη Διαχείριση Δικτύου." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "Επιτυχία" + +#: ../cli/src/settings.c:411 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:413 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-bit φράση κλειδί)" + +#: ../cli/src/settings.c:416 +#, c-format +msgid "%d (unknown)" +msgstr "%d (άγνωστο)" + +#: ../cli/src/settings.c:442 +msgid "0 (unknown)" +msgstr "0 (άγνωστο)" + +#: ../cli/src/settings.c:448 +msgid "any, " +msgstr "οποιοδήποτε," + +#: ../cli/src/settings.c:450 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:454 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:456 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:468 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:470 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:554 ../cli/src/settings.c:721 +msgid "auto" +msgstr "αυτόματα" + +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 +msgid "not set" +msgstr "δεν ορίσθηκε" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "το πεδίο '%s' πρέπει να είναι μόνο του" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "μη έγκυρο πεδίο '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Η επιλογή '--terse' απαιτεί να καθορισθούν '--fields'" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "" +"Η επιλογή '--terse' απαιτεί να καθορισθούν συγκεκριμένες τιμές της επιλογής " +"'--fields', όχι '%s'" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." @@ -109,8 +1274,9 @@ msgstr "Δεν επαρκεί η μνήμη για την αποθήκευση msgid "IV contains non-hexadecimal digits." msgstr "Το IV περιέχει μη δεκαεξαδικά ψηφία." -#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:143 -#: ../libnm-util/crypto_nss.c:169 +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "Άγνωστος ο κρυπτογραφικός αλγόριθμος '%s' του ιδιωτικού κλειδιού." @@ -132,75 +1298,116 @@ msgstr "" "Δεν επαρκεί η μνήμη για την αποθήκευση του αποκρυπτογραφημένου ιδιωτικού " "κλειδιού." -#: ../libnm-util/crypto_gnutls.c:46 +#: ../libnm-util/crypto_gnutls.c:49 msgid "Failed to initialize the crypto engine." msgstr "Απέτυχε η αρχικοποίηση της μηχανής κρυπτογραφίας." -#: ../libnm-util/crypto_gnutls.c:90 +#: ../libnm-util/crypto_gnutls.c:93 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." msgstr "Απέτυχε η αρχικοποίηση της μηχανής MD5 : %s / %s." -#: ../libnm-util/crypto_gnutls.c:152 ../libnm-util/crypto_nss.c:178 +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Μη έγκυρο μήκος IV (πρέπει να είναι τουλάχιστον %zd)" + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format msgid "Not enough memory for decrypted key buffer." msgstr "" "Η μνήμη δεν επαρκεί για τις ανάγκες της ενδιάμεσης μνήμης του " "αποκρυπτογραφημένου κλειδιού." -#: ../libnm-util/crypto_gnutls.c:160 +#: ../libnm-util/crypto_gnutls.c:173 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." msgstr "Απέτυχε η αρχικοποίηση του αλγορίθμου αποκρυπτογράφησης: %s / %s." -#: ../libnm-util/crypto_gnutls.c:169 +#: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." msgstr "" "Απέτυχε ο ορισμός συμμετρικού κλειδιού για την αποκρυπτογράφηση: %s / %s." -#: ../libnm-util/crypto_gnutls.c:178 +#: ../libnm-util/crypto_gnutls.c:191 #, c-format msgid "Failed to set IV for decryption: %s / %s." msgstr "Απέτυχε ο ορισμός IV για την αποκρυπτογράφηση: %s / %s." -#: ../libnm-util/crypto_gnutls.c:187 +#: ../libnm-util/crypto_gnutls.c:200 #, c-format msgid "Failed to decrypt the private key: %s / %s." msgstr "Απέτυχε η αποκρυπτογράφηση του ιδιωτικού κλειδιού: %s / %s." -#: ../libnm-util/crypto_gnutls.c:200 +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "" +"Απέτυχε η αποκρυπτογράφηση του ιδιωτικού κλειδιού: μη αναμενόμενο μήκος " +"συμπλήρωσης." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 #, c-format msgid "Failed to decrypt the private key." msgstr "Απέτυχε η αποκρυπτογράφηση του ιδιωτικού κλειδιού." -#: ../libnm-util/crypto_gnutls.c:235 +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Αδυναμία διάθεσης μνήμης για κρυπτογράφηση." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +#| msgid "Failed to initialize the decryption cipher context: %s / %s." +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Απέτυχε η αρχικοποίηση του αλγορίθμου κρυπτογράφησης: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +#| msgid "Failed to set symmetric key for decryption: %s / %s." +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Απέτυχε ο ορισμός συμμετρικού κλειδιού για την κρυπτογράφηση: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +#| msgid "Failed to set IV for decryption: %s / %s." +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Απέτυχε να ορισθεί το IV για την κρυπτογράφηση: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +#| msgid "Failed to decrypt the private key: %s / %s." +msgid "Failed to encrypt the data: %s / %s." +msgstr "Απέτυχε η κρυπτογράφηση των δεδομένων: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 #, c-format msgid "Error initializing certificate data: %s" msgstr "Σφάλμα κατά την αρχικοποίηση των δεδομένων του πιστοποιητικού: %s" -#: ../libnm-util/crypto_gnutls.c:257 +#: ../libnm-util/crypto_gnutls.c:384 #, c-format msgid "Couldn't decode certificate: %s" msgstr "Αδύνατη η αποκωδικοποίηση του πιστοποιητικού: %s" -#: ../libnm-util/crypto_gnutls.c:281 +#: ../libnm-util/crypto_gnutls.c:408 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %s" msgstr "Αδύνατη η αρχικοποίηση του αποκωδικοποιητή PKCS#12: %s" -#: ../libnm-util/crypto_gnutls.c:294 +#: ../libnm-util/crypto_gnutls.c:421 #, c-format msgid "Couldn't decode PKCS#12 file: %s" msgstr "Αδύνατη η αποκωδικοποίηση του αρχείου PKCS#12: %s" -#: ../libnm-util/crypto_gnutls.c:306 +#: ../libnm-util/crypto_gnutls.c:433 #, c-format msgid "Couldn't verify PKCS#12 file: %s" msgstr "Αδύνατη η διαπίστωση του αρχείου PKCS#12: %s" -#: ../libnm-util/crypto_nss.c:57 -#: ../system-settings/plugins/ifcfg-rh/crypto.c:52 +#: ../libnm-util/crypto_nss.c:56 #, c-format msgid "Failed to initialize the crypto engine: %d." msgstr "Απέτυχε η αρχικοποίηση της μηχανής κρυπτογραφίας: %d." @@ -210,110 +1417,317 @@ msgstr "Απέτυχε η αρχικοποίηση της μηχανής κρυ msgid "Failed to initialize the MD5 context: %d." msgstr "Απέτυχε η αρχικοποίηση του MD5 : %d." -#: ../libnm-util/crypto_nss.c:186 +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Μη έγκυρο μήκος IV (πρέπει να είναι τουλάχιστον %d)" + +#: ../libnm-util/crypto_nss.c:196 #, c-format msgid "Failed to initialize the decryption cipher slot." msgstr "Απέτυχε η αρχικοποίηση του αλγορίθμου αποκρυπτογράφησης." -#: ../libnm-util/crypto_nss.c:196 +#: ../libnm-util/crypto_nss.c:206 #, c-format msgid "Failed to set symmetric key for decryption." msgstr "Απέτυχε ο ορισμός συμμετρικού κλειδιού για την αποκρυπτογράφηση." -#: ../libnm-util/crypto_nss.c:206 +#: ../libnm-util/crypto_nss.c:216 #, c-format msgid "Failed to set IV for decryption." msgstr "Απέτυχε ο ορισμός IV για την αποκρυπτογράφηση." -#: ../libnm-util/crypto_nss.c:214 +#: ../libnm-util/crypto_nss.c:224 #, c-format msgid "Failed to initialize the decryption context." msgstr "Απέτυχε η αρχικοποίηση της αποκρυπτογράφησης." -#: ../libnm-util/crypto_nss.c:227 +#: ../libnm-util/crypto_nss.c:237 #, c-format msgid "Failed to decrypt the private key: %d." msgstr "Απέτυχε η αποκρυπτογράφηση του ιδιωτικού κλειδιού: %d." -#: ../libnm-util/crypto_nss.c:239 +#: ../libnm-util/crypto_nss.c:245 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "" +"Απέτυχε η αποκρυπτογράφηση του ιδιωτικού κλειδιού: τα αποκρυπτογραφημένα " +"δεδομένα είναι πάρα πολλά." + +#: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." msgstr "Απέτυχε η ολοκλήρωση της αποκρυπτογράφησης του ιδιωτικού κλειδιού: %d." -#: ../libnm-util/crypto_nss.c:284 +#: ../libnm-util/crypto_nss.c:364 +#, c-format +#| msgid "Failed to initialize the decryption cipher slot." +msgid "Failed to initialize the encryption cipher slot." +msgstr "Απέτυχε η αρχικοποίηση του αλγορίθμου κρυπτογράφησης." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +#| msgid "Failed to set symmetric key for decryption." +msgid "Failed to set symmetric key for encryption." +msgstr "Απέτυχε ο ορισμός συμμετρικού κλειδιού για την κρυπτογράφηση." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +#| msgid "Failed to set IV for decryption." +msgid "Failed to set IV for encryption." +msgstr "Απέτυχε ο ορισμός IV για την κρυπτογράφηση." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +#| msgid "Failed to initialize the decryption context." +msgid "Failed to initialize the encryption context." +msgstr "Απέτυχε η αρχικοποίηση του πλαισίου της κρυπτογράφησης." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to encrypt: %d." +msgstr "Αποτυχία κρυπτογράφησης: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Μη αναμενόμενη ποσότητα δεδομένων μετά την κρυπτογράφηση." + +#: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" msgstr "Αδύνατη η αποκωδικοποίηση του πιστοποιητικού: %d" -#: ../libnm-util/crypto_nss.c:319 +#: ../libnm-util/crypto_nss.c:482 #, c-format msgid "Couldn't convert password to UCS2: %d" msgstr "Αδύνατη η μετατροπή του συνθηματικού σε UCS2: %d" -#: ../libnm-util/crypto_nss.c:347 +#: ../libnm-util/crypto_nss.c:510 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" msgstr "Αδύνατη η αρχικοποίηση του αποκωδικοποιητή PKCS#12: %d" -#: ../libnm-util/crypto_nss.c:356 +#: ../libnm-util/crypto_nss.c:519 #, c-format msgid "Couldn't decode PKCS#12 file: %d" msgstr "Αδύνατη η αποκωδικοποίηση του αρχείου PKCS#12: %d" -#: ../libnm-util/crypto_nss.c:365 +#: ../libnm-util/crypto_nss.c:528 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "Αδύνατη η διαπίστωση του αρχείου PKCS#12: %d" -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 +#: ../libnm-util/crypto_nss.c:557 +#| msgid "Could not decode private key." +msgid "Could not generate random data." +msgstr "Αδύνατη η δημιουργία τυχαίων δεδομένων." + +#: ../libnm-util/nm-utils.c:1975 #, c-format -msgid "error processing netlink message: %s" -msgstr "σφάλμα κατά την επεξεργασία μηνύματος netlink: %s" +#| msgid "Not enough memory to decrypt private key." +msgid "Not enough memory to make encryption key." +msgstr "Δεν επαρκεί η μνήμη για την δημιουργία κλειδιού κρυπτογράφησης." + +#: ../libnm-util/nm-utils.c:2085 +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file creation." +msgstr "Δεν επαρκεί η μνήμη για την δημιουργία αρχείου PEM." -#: ../src/nm-netlink-monitor.c:260 +#: ../libnm-util/nm-utils.c:2097 #, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Αδυναμία διάθεσης μνήμης για εγγραφή του IV στο αρχείο PEM." + +#: ../libnm-util/nm-utils.c:2109 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "" -"αδύνατη η δέσμευση χειριστή netlink για την παρακολούθηση της κατάστασης της " -"σύνδεσης: %s" +"Αδυναμία διάθεσης μνήμης για εγγραφή του κρυπτογραφημένου κλειδού στο αρχείο " +"PEM." + +#: ../libnm-util/nm-utils.c:2128 +#, c-format +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file data." +msgstr "Δεν επαρκεί η μνήμη για τα δεδομένα του αρχείου PEM." + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Κοινή χρήση σύνδεσης μέσω προστατευμένου ασύρματου δικτύου" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Κοινή χρήση σύνδεσης μέσω ανοιχτού ασύρματου δικτύου" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Αλλαγή πάγιου ονόματος συστήματος" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Τροποποίηση συνδέσεων συστήματος" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "" +"Η πολιτική συστήματος δεν επιτρέπει τροποποίηση των ρυθμίσεων συστήματος" -#: ../src/nm-netlink-monitor.c:270 +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "" +"Η πολιτική συστήματος δεν επιτρέπει τροποποίηση του πάγιου ονόματος " +"συστήματος" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"Η πολιτική συστήματος δεν επιτρέπει κοινή χρήση συνδέσεων μέσω " +"προστατευμένου ασύρματου δικτύου" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"Η πολιτική συστήματος δεν επιτρέπει κοινή χρήση συνδέσεων μέσω ανοιχτού " +"ασύρματου δικτύου" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "Να επιτρέπεται ο έλεγχος των συνδέσεων δικτύου" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "Να επιτρέπεται η χρήση συνδέσεων συγκεκριμένων για το χρήστη" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "Ενεργοποίηση ή απενεργοποίηση συσκευών ασύρματης δικτύωσης (WiFi)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "" +"Ενεργοποίηση ή απενεργοποίηση συσκευών ευρυζωνικότητας κινητής τηλεφωνίας" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "Ενεργοποίηση ή απενεργοποίηση δικτύωσης συστήματος" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 +msgid "" +"Put NetworkManager to sleep or wake it up (should only be used by system " +"power management)" +msgstr "" +"Θέση της Διαχείρισης δικτύου σε αδράνεια ή ενεργοποίησή της (πρέπει να " +"χρησιμοποιείται μόνο από τη διαχείριση ενέργειας του συστήματος)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents control of network connections" +msgstr "Η πολιτική συστήματος δεν επιτρέπει τον έλεγχο των συνδέσεων δικτύου" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +#| msgid "System policy prevents sharing connections via an open WiFi network" +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "" +"Η πολιτική συστήματος δεν επιτρέπει ενεργοποίηση ή απενεργοποίηση συσκευών " +"ανοιχτού ασύρματου δικτύου (WiFi)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "" +"Η πολιτική του συστήματος δεν επιτρέπει την ενεργοποίηση ή απενεργοποίηση " +"συσκευών ευρυζωνικότητας κινητής τηλεφωνίας" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents enabling or disabling system networking" +msgstr "" +"Η πολιτική συστήματος δεν επιτρέπει ενεργοποίηση ή απενεργοποίηση της " +"δικτύωσης του συστήματος" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "" +"Η πολιτική του συστήματος δεν επιτρέπει να τίθεται η διαχείριση δικτύου σε " +"αδράνεια ή να ενεργοποιείται." + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents use of user-specific connections" +msgstr "" +"Η πολιτική συστήματος δεν επιτρέπει τη χρήση συνδέσεων συγκεκριμένων για " +"κάθε χρήστη" + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "σφάλμα κατά την επεξεργασία μηνύματος netlink: %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "σφάλμα κατά την αναμονή για δεδομένα στην υποδοχή" + +#: ../src/nm-netlink-monitor.c:254 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "" "αδύνατη η σύνδεση με το netlink για την παρακολούθηση της κατάστασης της " "σύνδεσης: %s" -#: ../src/nm-netlink-monitor.c:278 +#: ../src/nm-netlink-monitor.c:265 +#, c-format +#| msgid "unable to allocate netlink handle for monitoring link status: %s" +msgid "unable to enable netlink handle credential passing: %s" +msgstr "unable to enable netlink handle credential passing: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 #, c-format -msgid "unable to join netlink group for monitoring link status: %s" +msgid "unable to allocate netlink handle for monitoring link status: %s" msgstr "" -"αδύνατη η ένταξη στην ομάδα του netlink για την παρακολούθηση της κατάστασης " -"της σύνδεσης: %s" +"αδύνατη η δέσμευση χειριστή netlink για την παρακολούθηση της κατάστασης της " +"σύνδεσης: %s" -#: ../src/nm-netlink-monitor.c:286 +#: ../src/nm-netlink-monitor.c:376 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "" "αδύνατη η εκχώρηση λανθάνουσας μνήμης στη σύνδεση netlink για την " "παρακολούθηση της κατάστασης της σύνδεσης δικτύου: %s" -#: ../src/nm-netlink-monitor.c:494 -msgid "error occurred while waiting for data on socket" -msgstr "σφάλμα κατά την αναμονή για δεδομένα στην υποδοχή" +#: ../src/nm-netlink-monitor.c:502 +#, c-format +#| msgid "unable to join netlink group for monitoring link status: %s" +msgid "unable to join netlink group: %s" +msgstr "αδύνατη η σύνδεση στην ομάδα του netlink: %s" -#: ../src/NetworkManager.c:330 +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "σφάλμα κατά την ενημέρωση της λανθάνουσας μνήμης της σύνδεσης: %s" + +#: ../src/main.c:502 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "" "Άκυρη επιλογή. Παρακαλώ χρησιμοποιήστε --help για να δείτε τη λίστα των " "έγκυρων επιλογών.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 +#: ../src/main.c:573 +#, c-format +#| msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "" +"%s. Παρακαλώ χρησιμοποιήστε την επιλογή --help για να δείτε τη λίστα των " +"έγκυρων επιλογών.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:324 msgid "# Created by NetworkManager\n" msgstr "# Δημιουργήθηκε από το NetworkManager\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:340 #, c-format msgid "" "# Merged from %s\n" @@ -322,64 +1736,48 @@ msgstr "" "# Συγχωνεύθηκαν από το %s\n" "\n" -#: ../src/named-manager/nm-named-manager.c:315 +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 +msgid "no usable DHCP client could be found." +msgstr "αδυναμία εύρεσης πελάτη DHCP που να μπορεί να χρησιμοποιηθεί." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 +msgid "'dhclient' could be found." +msgstr "Εύρεση 'dhclient'." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 +msgid "'dhcpcd' could be found." +msgstr "Εύρεση 'dhcpcd'." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "μη υποστηριζόμενος πελάτης DHCP '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "Άγνωστο επίπεδο καταγραφής '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "Άγνωστος τομέας καταγραφής '%s'" + +#: ../src/named-manager/nm-named-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "ΣΗΜΕΙΩΣΗ: Ο libc resolver μπορεί να μην υποστηρίζει περισσότερους από 3 " "εξυπηρετητές ονομάτων." -#: ../src/named-manager/nm-named-manager.c:317 +#: ../src/named-manager/nm-named-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "Οι κάτωθι εξυπηρετητές ονομάτων ίσως να μην αναγνωρίζονται." -#: ../src/system-settings/nm-default-wired-connection.c:194 +#: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" msgstr "Αυτόματο %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:2446 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3412 msgid "System" msgstr "Σύστημα" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 -msgid "Connection sharing via a protected WiFi network" -msgstr "Κοινή χρήση σύνδεσης μέσω προστατευμένου ασύρματου δικτύου" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 -msgid "Connection sharing via an open WiFi network" -msgstr "Κοινή χρήση σύνδεσης μέσω ανοιχτού ασύρματου δικτύου" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 -msgid "Modify persistent system hostname" -msgstr "Αλλαγή πάγιου ονόματος συστήματος" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 -msgid "Modify system connections" -msgstr "Τροποποίηση συνδέσεων συστήματος" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 -msgid "System policy prevents modification of system settings" -msgstr "" -"Η πολιτική συστήματος δεν επιτρέπει τροποποίηση των ρυθμίσεων συστήματος" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 -#| msgid "System policy prevents modification of system settings" -msgid "System policy prevents modification of the persistent system hostname" -msgstr "" -"Η πολιτική συστήματος δεν επιτρέπει τροποποίηση του πάγιου ονόματος " -"συστήματος" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 -msgid "System policy prevents sharing connections via a protected WiFi network" -msgstr "" -"Η πολιτική συστήματος δεν επιτρέπει κοινή χρήση συνδέσεων μέσω " -"προστατευμένου ασύρματου δικτύου" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 -msgid "System policy prevents sharing connections via an open WiFi network" -msgstr "" -"Η πολιτική συστήματος δεν επιτρέπει κοινή χρήση συνδέσεων μέσω ανοιχτού " -"ασύρματου δικτύου" - -#~ msgid "error updating link cache: %s" -#~ msgstr "σφάλμα κατά την ενημέρωση της λανθάνουσας μνήμης της σύνδεσης: %s" -- cgit v1.2.1 From 623f09c586d35790799f2c312ba71570e20a639e Mon Sep 17 00:00:00 2001 From: "Wulf C. Krueger" Date: Wed, 1 Sep 2010 17:25:03 -0500 Subject: build: don't install systemd files with --without-systemdsystemunitdir (bgo #628439) --- configure.ac | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 5b1fbd64ba..a7465da80a 100644 --- a/configure.ac +++ b/configure.ac @@ -242,8 +242,10 @@ AC_ARG_WITH([systemdsystemunitdir], AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) -AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) -AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir"]) +if test "x$with_systemdsystemunitdir" != xno; then + AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) +fi +AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ]) PKG_CHECK_MODULES(LIBNL, libnl-1 >= 1.0-pre8) AC_SUBST(LIBNL_CFLAGS) -- cgit v1.2.1 From b60a70217e666e15615d2db62acd7f0ef4932190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Fri, 3 Sep 2010 14:15:41 +0200 Subject: trivial: fix cut&paste error in a comment --- include/NetworkManager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/NetworkManager.h b/include/NetworkManager.h index 9df444f27c..f58b84bcdd 100644 --- a/include/NetworkManager.h +++ b/include/NetworkManager.h @@ -16,7 +16,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * (C) Copyright 2004 - 2008 Red Hat, Inc. + * (C) Copyright 2004 - 2010 Red Hat, Inc. */ #ifndef NETWORK_MANAGER_H @@ -246,7 +246,7 @@ typedef enum { /* Device is now managed */ NM_DEVICE_STATE_REASON_NOW_MANAGED = 2, - /* Device is now managed unmanaged */ + /* Device is now unmanaged */ NM_DEVICE_STATE_REASON_NOW_UNMANAGED = 3, /* The device could not be readied for configuration */ -- cgit v1.2.1 From 52d312da57b504e6cbe6a5283cea6ef3d11895a6 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 7 Sep 2010 18:17:10 -0500 Subject: trivial: remove long-obsolete NMLoadModules script --- test/NMLoadModules | 61 ------------------------------------------------------ 1 file changed, 61 deletions(-) delete mode 100755 test/NMLoadModules diff --git a/test/NMLoadModules b/test/NMLoadModules deleted file mode 100755 index 0dc6a486cc..0000000000 --- a/test/NMLoadModules +++ /dev/null @@ -1,61 +0,0 @@ -#! /bin/bash -# Load kernel modules for all network devices - -CWD=`pwd` -cd /etc/sysconfig/network-scripts - -# find all the interfaces besides loopback. -# ignore aliases, alternative configurations, and editor backup files -interfaces=`ls ifcfg* | LANG=C egrep -v '(ifcfg-lo|:|rpmsave|rpmorig|rpmnew)' | \ - LANG=C egrep -v '(~|\.bak)$' | \ - LANG=C egrep 'ifcfg-[A-Za-z0-9\._-]+$' | \ - sed 's/^ifcfg-//g' | - sed 's/[0-9]/ &/' | LANG=C sort -k 1,1 -k 2n | sed 's/ //'` - -# bring up all other interfaces configured to come up at boot time -for i in $interfaces; do - eval $(LANG=C fgrep "DEVICE=" ifcfg-$i) - eval $(LANG=C fgrep "TYPE=" ifcfg-$i) - eval $(LANG=C fgrep "SLAVE=" ifcfg-$i) - eval $(LANG=C fgrep "BRIDGE=" ifcfg-$i) - - if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi - - if [ "${DEVICE##cipcb}" != "$DEVICE" ] ; then - unset DEVICE TYPE SLAVE BRIDGE - continue - fi - - if [ "$TYPE" = "xDSL" ]; then - unset DEVICE TYPE SLAVE BRIDGE - continue - fi - - if [ -n "$BRIDGE" ]; then - unset DEVICE TYPE SLAVE BRIDGE - continue - fi - - if [ "${DEVICE%%.*}" != "$DEVICE" ] ; then - unset DEVICE TYPE SLAVE BRIDGE - continue - fi - - if [ "$SLAVE" = "yes" ]; then - unset DEVICE TYPE SLAVE BRIDGE - continue - fi - unset DEVICE TYPE SLAVE BRIDGE - - # Load the module - LC_ALL= LANG= /sbin/ip -o link | grep -q $i - if [ "$?" = "1" ]; then - alias=`modprobe -c | awk "/^(alias|install)[[:space:]]+$i[[:space:]]/ { print \\$3 }"` - if [ -n "$alias" -a "$alias" != "off" -a "$alias" != "/bin/true" ]; then - modprobe $alias > /dev/null 2>&1 - fi - fi - continue -done - -exit 0 -- cgit v1.2.1 From 9b2b809aaeb7843514d0a23b6d9cb6931c0546fa Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 7 Sep 2010 21:50:20 -0500 Subject: core: rename NMNamedManager -> NMDnsManager --- configure.ac | 2 +- po/POTFILES.in | 2 +- po/ar.po | 4 +- po/as.po | 4 +- po/be@latin.po | 4 +- po/bg.po | 4 +- po/bn_IN.po | 4 +- po/ca.po | 4 +- po/cs.po | 4 +- po/de.po | 4 +- po/el.po | 4 +- po/en_GB.po | 4 +- po/es.po | 4 +- po/et.po | 4 +- po/eu.po | 4 +- po/fi.po | 4 +- po/fr.po | 4 +- po/gl.po | 4 +- po/gu.po | 4 +- po/hi.po | 4 +- po/hu.po | 4 +- po/id.po | 4 +- po/it.po | 4 +- po/ja.po | 4 +- po/kn.po | 4 +- po/ko.po | 4 +- po/lt.po | 4 +- po/ml.po | 4 +- po/mr.po | 4 +- po/nb.po | 4 +- po/nl.po | 4 +- po/oc.po | 4 +- po/or.po | 4 +- po/pa.po | 4 +- po/pl.po | 4 +- po/pt_BR.po | 4 +- po/ru.po | 4 +- po/sl.po | 4 +- po/sv.po | 4 +- po/ta.po | 4 +- po/te.po | 4 +- po/vi.po | 4 +- po/zh_CN.po | 4 +- po/zh_HK.po | 4 +- po/zh_TW.po | 4 +- src/Makefile.am | 6 +- src/backends/Makefile.am | 2 - src/dhcp-manager/Makefile.am | 3 +- src/dns-manager/Makefile.am | 21 + src/dns-manager/nm-dns-manager.c | 883 +++++++++++++++++++++++++++++++++++ src/dns-manager/nm-dns-manager.h | 95 ++++ src/ip6-manager/Makefile.am | 3 +- src/main.c | 14 +- src/named-manager/Makefile.am | 21 - src/named-manager/nm-named-manager.c | 883 ----------------------------------- src/named-manager/nm-named-manager.h | 95 ---- src/nm-device.c | 30 +- src/nm-policy.c | 38 +- src/nm-system.c | 1 - src/supplicant-manager/Makefile.am | 3 +- src/vpn-manager/Makefile.am | 2 +- src/vpn-manager/nm-vpn-connection.c | 18 +- 62 files changed, 1144 insertions(+), 1150 deletions(-) create mode 100644 src/dns-manager/Makefile.am create mode 100644 src/dns-manager/nm-dns-manager.c create mode 100644 src/dns-manager/nm-dns-manager.h delete mode 100644 src/named-manager/Makefile.am delete mode 100644 src/named-manager/nm-named-manager.c delete mode 100644 src/named-manager/nm-named-manager.h diff --git a/configure.ac b/configure.ac index a7465da80a..ac391c6037 100644 --- a/configure.ac +++ b/configure.ac @@ -489,7 +489,7 @@ src/Makefile src/tests/Makefile marshallers/Makefile src/logging/Makefile -src/named-manager/Makefile +src/dns-manager/Makefile src/vpn-manager/Makefile src/dhcp-manager/Makefile src/ip6-manager/Makefile diff --git a/po/POTFILES.in b/po/POTFILES.in index db1fbdfecf..f3421b4a60 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -18,7 +18,7 @@ src/main.c src/dhcp-manager/nm-dhcp-dhclient.c src/dhcp-manager/nm-dhcp-manager.c src/logging/nm-logging.c -src/named-manager/nm-named-manager.c +src/dns-manager/nm-dns-manager.c src/system-settings/nm-default-wired-connection.c system-settings/plugins/ifcfg-rh/reader.c system-settings/plugins/ifnet/connection_parser.c diff --git a/po/ar.po b/po/ar.po index 5796a044d7..f02091564b 100644 --- a/po/ar.po +++ b/po/ar.po @@ -67,11 +67,11 @@ msgid "" "\n" msgstr "" -#: ../src/named-manager/nm-named-manager.c:117 +#: ../src/dns-manager/nm-dns-manager.c:117 msgid "NOTE: the glibc resolver does not support more than 3 nameservers." msgstr "" -#: ../src/named-manager/nm-named-manager.c:119 +#: ../src/dns-manager/nm-dns-manager.c:119 msgid "The nameservers listed below may not be recognized." msgstr "" diff --git a/po/as.po b/po/as.po index 2f79166f07..46e41809b6 100644 --- a/po/as.po +++ b/po/as.po @@ -1590,11 +1590,11 @@ msgstr "অজ্ঞাত লগ স্তৰ '%s'" msgid "Unknown log domain '%s'" msgstr "অজ্ঞাত লগ ডোমেইন '%s'" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/dns-manager/nm-dns-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "মন কৰিব: libc resolver ৰ দ্বাৰা ৩ তকৈ অধিক নামৰ সেৱক সমৰ্থিত ন'হ'বও পাৰে ।" -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/dns-manager/nm-dns-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "নিম্নলিখিত নাম-সেৱকসমূহ চিনাক্ত ন'হ'বও পাৰে ।" diff --git a/po/be@latin.po b/po/be@latin.po index ab4d7705b0..8737643d16 100644 --- a/po/be@latin.po +++ b/po/be@latin.po @@ -55,11 +55,11 @@ msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "" "Niapravilnaja opcyja. Kab pahladzieć śpis mahčymych opcyj, užyj --help.\n" -#: ../src/named-manager/nm-named-manager.c:218 +#: ../src/dns-manager/nm-dns-manager.c:218 msgid "NOTE: the glibc resolver does not support more than 3 nameservers." msgstr "UVAHA: resolver glibc nie padtrymlivaje bolš za 3 servery nazvaŭ." -#: ../src/named-manager/nm-named-manager.c:220 +#: ../src/dns-manager/nm-dns-manager.c:220 msgid "The nameservers listed below may not be recognized." msgstr "Niemahčyma paznać nastupnyja servery nazvaŭ." diff --git a/po/bg.po b/po/bg.po index a423af318e..7c8ad028e8 100644 --- a/po/bg.po +++ b/po/bg.po @@ -72,11 +72,11 @@ msgstr "" "# Слят от %s\n" "\n" -#: ../src/named-manager/nm-named-manager.c:117 +#: ../src/dns-manager/nm-dns-manager.c:117 msgid "NOTE: the glibc resolver does not support more than 3 nameservers." msgstr "БЕЛЕЖКА: стандартно glibc поддържа максимум 3 сървъра за имена." -#: ../src/named-manager/nm-named-manager.c:119 +#: ../src/dns-manager/nm-dns-manager.c:119 msgid "The nameservers listed below may not be recognized." msgstr "Сървърите за имена отдолу могат да не бъдат разпознати." diff --git a/po/bn_IN.po b/po/bn_IN.po index f6c295c975..cf275dad69 100644 --- a/po/bn_IN.po +++ b/po/bn_IN.po @@ -1587,13 +1587,13 @@ msgstr "লগের অজানা স্তর '%s'" msgid "Unknown log domain '%s'" msgstr "অজানা লগ ডোমেইন '%s'" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/dns-manager/nm-dns-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "উল্লেখ্য: libc resolver দ্বারা ৩-টির বেশি নেম-সার্ভার সমর্থিত না হওয়ার সম্ভাবনা " "রয়েছে।" -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/dns-manager/nm-dns-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "নিম্নলিখিত নেম-সার্ভারগুলি সনাক্ত না হওয়ার সম্ভাবনা রয়েছে।" diff --git a/po/ca.po b/po/ca.po index d3d9053df7..ebe35d5592 100644 --- a/po/ca.po +++ b/po/ca.po @@ -335,13 +335,13 @@ msgstr "" "# Fusionat des de %s\n" "\n" -#: ../src/named-manager/nm-named-manager.c:256 +#: ../src/dns-manager/nm-dns-manager.c:256 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "NOTA: pot ser que el sistema de resolució de la libc no funcioni amb més de " "3 servidors de noms." -#: ../src/named-manager/nm-named-manager.c:258 +#: ../src/dns-manager/nm-dns-manager.c:258 msgid "The nameservers listed below may not be recognized." msgstr "Pot ser que no es reconeguin els servidors de noms llistats més avall." diff --git a/po/cs.po b/po/cs.po index 1be6b82e1a..4c59825e84 100644 --- a/po/cs.po +++ b/po/cs.po @@ -1335,12 +1335,12 @@ msgstr "Neznámá úroveň evidence „%s“" msgid "Unknown log domain '%s'" msgstr "Neznámá doména evidence „%s“" -#: ../src/named-manager/nm-named-manager.c:314 +#: ../src/dns-manager/nm-dns-manager.c:314 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "Poznámka: překladač adres z libc nemůže podporovat více než 3 jmenné servery." -#: ../src/named-manager/nm-named-manager.c:316 +#: ../src/dns-manager/nm-dns-manager.c:316 msgid "The nameservers listed below may not be recognized." msgstr "Jmenné servery uvedené v následujícím seznamu nelze rozpoznat." diff --git a/po/de.po b/po/de.po index ef04aae232..89490d0d87 100644 --- a/po/de.po +++ b/po/de.po @@ -1341,13 +1341,13 @@ msgstr "Unbekannte Protokollstufe »%s«" msgid "Unknown log domain '%s'" msgstr "Unbekannte Protokolldomäne »%s«" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/dns-manager/nm-dns-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "HINWEIS: Der libc-resolver unterstützt eventuell nicht mehr als drei " "Nameserver." -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/dns-manager/nm-dns-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "Die nachfolgend gelisteten Nameserver werden eventuell nicht erkannt." diff --git a/po/el.po b/po/el.po index b8d1619cdc..cb9fa186b0 100644 --- a/po/el.po +++ b/po/el.po @@ -1763,13 +1763,13 @@ msgstr "Άγνωστο επίπεδο καταγραφής '%s'" msgid "Unknown log domain '%s'" msgstr "Άγνωστος τομέας καταγραφής '%s'" -#: ../src/named-manager/nm-named-manager.c:384 +#: ../src/dns-manager/nm-dns-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "ΣΗΜΕΙΩΣΗ: Ο libc resolver μπορεί να μην υποστηρίζει περισσότερους από 3 " "εξυπηρετητές ονομάτων." -#: ../src/named-manager/nm-named-manager.c:386 +#: ../src/dns-manager/nm-dns-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "Οι κάτωθι εξυπηρετητές ονομάτων ίσως να μην αναγνωρίζονται." diff --git a/po/en_GB.po b/po/en_GB.po index 1e57470a60..ef279f8fab 100644 --- a/po/en_GB.po +++ b/po/en_GB.po @@ -318,11 +318,11 @@ msgstr "unable to connect to netlink: %s" msgid "unable to join netlink group: %s" msgstr "unable to join netlink group: %s" -#: ../src/named-manager/nm-named-manager.c:315 +#: ../src/dns-manager/nm-dns-manager.c:315 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "NOTE: the libc resolver may not support more than 3 nameservers." -#: ../src/named-manager/nm-named-manager.c:317 +#: ../src/dns-manager/nm-dns-manager.c:317 msgid "The nameservers listed below may not be recognized." msgstr "The nameservers listed below may not be recognised." diff --git a/po/es.po b/po/es.po index 3bc6ef7b7f..36b63833b0 100644 --- a/po/es.po +++ b/po/es.po @@ -1712,13 +1712,13 @@ msgstr "Nivel de registro desconocido '%s'" msgid "Unknown log domain '%s'" msgstr "Dominio de registro desconocido '%s'" -#: ../src/named-manager/nm-named-manager.c:384 +#: ../src/dns-manager/nm-dns-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "NOTA: el 'resolver' de nombres de libc puede que no soporte más de 3 " "servidores de nombres." -#: ../src/named-manager/nm-named-manager.c:386 +#: ../src/dns-manager/nm-dns-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "Puede que los servidores de nombres listados abajo no se reconozcan." diff --git a/po/et.po b/po/et.po index 3a57c8d12e..711c744817 100644 --- a/po/et.po +++ b/po/et.po @@ -76,11 +76,11 @@ msgstr "" "# Liidetud allikast %s\n" "\n" -#: ../src/named-manager/nm-named-manager.c:240 +#: ../src/dns-manager/nm-dns-manager.c:240 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "MÄRKUS: libc lahendaja ei pruugi toetada rohkem kui 3 nimeserverit." -#: ../src/named-manager/nm-named-manager.c:242 +#: ../src/dns-manager/nm-dns-manager.c:242 msgid "The nameservers listed below may not be recognized." msgstr "Järgneva nimistu nimeservereid ei tuntud ära." diff --git a/po/eu.po b/po/eu.po index f2e96a504a..5a584ec367 100644 --- a/po/eu.po +++ b/po/eu.po @@ -1300,11 +1300,11 @@ msgstr "ezin da netlink-ekin konektatu: %s" msgid "unable to join netlink group: %s" msgstr "ezin da netlink taldearekin elkartu: %s" -#: ../src/named-manager/nm-named-manager.c:315 +#: ../src/dns-manager/nm-dns-manager.c:315 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "OHARRA: libc-en ebaztaileak ez du 3 izen-zerbitzari baino gehiago onartzen." -#: ../src/named-manager/nm-named-manager.c:317 +#: ../src/dns-manager/nm-dns-manager.c:317 msgid "The nameservers listed below may not be recognized." msgstr "Azpian zerrendatutako izen-zenbitzariak ez dira ezagutuko." diff --git a/po/fi.po b/po/fi.po index 43d3524c56..31187e9fba 100644 --- a/po/fi.po +++ b/po/fi.po @@ -308,11 +308,11 @@ msgstr "" "# Yhdistetty tiedostosta %s\n" "\n" -#: ../src/named-manager/nm-named-manager.c:256 +#: ../src/dns-manager/nm-dns-manager.c:256 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "HUOMAUTUS: libc-nimenselvennys ei ehkä tue kuin kolmea nimipalvelinta." -#: ../src/named-manager/nm-named-manager.c:258 +#: ../src/dns-manager/nm-dns-manager.c:258 msgid "The nameservers listed below may not be recognized." msgstr "Alla olevaa nimipalvelinluetteloa ei voitu tunnistaa." diff --git a/po/fr.po b/po/fr.po index f7cd9a2f76..25b6c76b8b 100644 --- a/po/fr.po +++ b/po/fr.po @@ -1611,13 +1611,13 @@ msgstr "Niveau de journalisation inconnu '%s'" msgid "Unknown log domain '%s'" msgstr "Domaine de journalisation inconnu '%s'" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/dns-manager/nm-dns-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "NOTE : il se peut que le solveur libc ne prenne pas en charge plus de 3 " "serveurs de noms." -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/dns-manager/nm-dns-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "Les serveurs de noms listés ci-dessous peuvent ne pas être reconnus." diff --git a/po/gl.po b/po/gl.po index ce3f609abe..4adefda785 100644 --- a/po/gl.po +++ b/po/gl.po @@ -1724,11 +1724,11 @@ msgstr "Nivel de rexistro «%s» descoñecido" msgid "Unknown log domain '%s'" msgstr "Dominio de rexistro «%s» descoñecido" -#: ../src/named-manager/nm-named-manager.c:384 +#: ../src/dns-manager/nm-dns-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "NOTE: o importador libc non permite máis de 3 nomes de servidores." -#: ../src/named-manager/nm-named-manager.c:386 +#: ../src/dns-manager/nm-dns-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "Os nomes de servidores listados a seguir poden non ser recoñecidos" diff --git a/po/gu.po b/po/gu.po index 83fba507ed..3fa8cf3333 100644 --- a/po/gu.po +++ b/po/gu.po @@ -1588,11 +1588,11 @@ msgstr "અજ્ઞાત લોગ સ્તર '%s'" msgid "Unknown log domain '%s'" msgstr "અજ્ઞાત લોગ ડોમેઇન '%s'" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/dns-manager/nm-dns-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "નોંધ: libc સુધારનાર એ ૩ નામ સર્વરો કરતા વધારે આધારને સમાવી શકતુ નથી." -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/dns-manager/nm-dns-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "નીચે યાદી થયેલ નામસર્વરો એ ઓળખી શકાતા નથી." diff --git a/po/hi.po b/po/hi.po index ec0b512ae7..aab5c03467 100644 --- a/po/hi.po +++ b/po/hi.po @@ -1683,11 +1683,11 @@ msgstr "अज्ञात लॉग स्तर '%s'" msgid "Unknown log domain '%s'" msgstr "अज्ञात लॉग डोमेन '%s'" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/dns-manager/nm-dns-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "नोट: libc समाधानकर्ता 3 नेमसर्वर से अधिक का समर्थन नहीं कर सकता है." -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/dns-manager/nm-dns-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "नीचे सूची में दिया गया नेमसर्वर पहचाना नहीं जा सकता है." diff --git a/po/hu.po b/po/hu.po index 742cdb15b3..f71625495e 100644 --- a/po/hu.po +++ b/po/hu.po @@ -436,11 +436,11 @@ msgstr "nem lehet kapcsolódni a netlinkhez: %s" msgid "unable to join netlink group: %s" msgstr "nem lehet csatlakozni a netlink csoporthoz: %s" -#: ../src/named-manager/nm-named-manager.c:315 +#: ../src/dns-manager/nm-dns-manager.c:315 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "MEGJEGYZÉS: a libc feloldó nem támogat háromnál több névkiszolgálót." -#: ../src/named-manager/nm-named-manager.c:317 +#: ../src/dns-manager/nm-dns-manager.c:317 msgid "The nameservers listed below may not be recognized." msgstr "Az alább felsorolt névkiszolgálók lehet, hogy nem kerülnek felismerésre." diff --git a/po/id.po b/po/id.po index 74f4c66418..b88792905f 100644 --- a/po/id.po +++ b/po/id.po @@ -1698,11 +1698,11 @@ msgstr "Aras log tak dikenal '%s'" msgid "Unknown log domain '%s'" msgstr "Ranah log tak dikenal '%s'" -#: ../src/named-manager/nm-named-manager.c:384 +#: ../src/dns-manager/nm-dns-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "CATATAN: resolver libc mungkin tak mendukung lebih dari 3 nameserver." -#: ../src/named-manager/nm-named-manager.c:386 +#: ../src/dns-manager/nm-dns-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "Nameserver yang terdaftar di bawah mungkin tak dikenali." diff --git a/po/it.po b/po/it.po index 5c61af0ac5..dd24604d56 100644 --- a/po/it.po +++ b/po/it.po @@ -1602,11 +1602,11 @@ msgstr "Livello log '%s' sconosciuto" msgid "Unknown log domain '%s'" msgstr "Dominio log '%s' sconosciuto" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/dns-manager/nm-dns-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "NOTA: il risolutore libc non supporta più di 3 server di nomi." -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/dns-manager/nm-dns-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "I server di nomi elencati sotto non possono essere riconosciuti." diff --git a/po/ja.po b/po/ja.po index dad755239c..4b49f0089c 100644 --- a/po/ja.po +++ b/po/ja.po @@ -1590,11 +1590,11 @@ msgstr "不明なログインレベル '%s'" msgid "Unknown log domain '%s'" msgstr "不明なログドメイン '%s'" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/dns-manager/nm-dns-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "注記: libc リゾルバは 3つ以上のネームサーバーをサポートできません。" -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/dns-manager/nm-dns-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "以下の一覧にあるネームサーバーは認識されないかも知れません。" diff --git a/po/kn.po b/po/kn.po index fcdec5dd0e..54769baa77 100644 --- a/po/kn.po +++ b/po/kn.po @@ -1690,13 +1690,13 @@ msgstr "ಗೊತ್ತಿರದ ದಾಖಲೆ ಮಟ್ಟ '%s'" msgid "Unknown log domain '%s'" msgstr "ಗೊತ್ತಿರದ ದಾಖಲೆ ಡೊಮೈನ್ '%s'" -#: ../src/named-manager/nm-named-manager.c:350 +#: ../src/dns-manager/nm-dns-manager.c:350 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "ಸೂಚನೆ: libc ಪರಿಹಾರಕವು(ರಿಸಾಲ್ವರ್) ೩ ನಾಮಪರಿಚಾರಕಗಳಿಗಿಂತ ಹೆಚ್ಚಿನವುಗಳನ್ನು " "ಬೆಂಬಲಿಸುವುದಿಲ್ಲ." -#: ../src/named-manager/nm-named-manager.c:352 +#: ../src/dns-manager/nm-dns-manager.c:352 msgid "The nameservers listed below may not be recognized." msgstr "ಈ ಕೆಳಗೆ ಸೂಚಿಸಲಾದ ನಾಮಪರಿಚಾರಕಗಳನ್ನು ಗುರುತಿಸಲಾಗಿಲ್ಲ." diff --git a/po/ko.po b/po/ko.po index ad463ab1d2..e2cc426bca 100644 --- a/po/ko.po +++ b/po/ko.po @@ -1590,11 +1590,11 @@ msgstr "알려지지 않은 로그 수준 '%s'" msgid "Unknown log domain '%s'" msgstr "알려지지 않은 로그 영역 '%s'" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/dns-manager/nm-dns-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "주의: libc 주소 검색은 3개를 초과하는 네임서버를 지원하지 않을 수 있습니다." -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/dns-manager/nm-dns-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "아래 열거된 네임서버를 인식하지 못할 수 있습니다." diff --git a/po/lt.po b/po/lt.po index 70212c828f..6c1d170c31 100644 --- a/po/lt.po +++ b/po/lt.po @@ -1686,13 +1686,13 @@ msgstr "Nežinomas žurnalo vedimo lygis „%s“" msgid "Unknown log domain '%s'" msgstr "Nežinoma žurnalo sritis „%s“" -#: ../src/named-manager/nm-named-manager.c:350 +#: ../src/dns-manager/nm-dns-manager.c:350 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "PASTABA: libc adresų nustatymo funkcija gali nepalaikyti daugiau nei 3 vardų " "serverių." -#: ../src/named-manager/nm-named-manager.c:352 +#: ../src/dns-manager/nm-dns-manager.c:352 msgid "The nameservers listed below may not be recognized." msgstr "Žemiau pateikti vardų serveriai gali būti neatpažinti." diff --git a/po/ml.po b/po/ml.po index 6c1e92f7ce..0d9796f9fe 100644 --- a/po/ml.po +++ b/po/ml.po @@ -1586,11 +1586,11 @@ msgstr "അപരിചതമായ ലോഗ് ലവല്‍ '%s'" msgid "Unknown log domain '%s'" msgstr "അപരിചിതമായ ലോഗ് ഡൊമെയിന്‍ '%s'" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/dns-manager/nm-dns-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "കുറിപ്പു്: libc റിസോള്‍വര്‍ 3 നെയിംസര്‍വറുകളില്‍ കൂടതല്‍ പിന്തുണയ്ക്കുന്നതല്ല." -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/dns-manager/nm-dns-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "താഴെ പറഞ്ഞിരിക്കുന്ന നെയിംസര്‍വറുകള്‍ തിരിച്ചറിയപ്പെടുന്നവയല്ല." diff --git a/po/mr.po b/po/mr.po index c608ace4b3..67335ad2e3 100644 --- a/po/mr.po +++ b/po/mr.po @@ -1672,11 +1672,11 @@ msgstr "अपरिचीत लॉग स्तर '%s'" msgid "Unknown log domain '%s'" msgstr "अपरिचीत लॉग डोमेन '%s'" -#: ../src/named-manager/nm-named-manager.c:350 +#: ../src/dns-manager/nm-dns-manager.c:350 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "NOTE: libc रिजॉलव्हर 3 पेक्षा जास्त नेमसर्व्हर्स् करीता समर्थन पुरवू शकणार नाही." -#: ../src/named-manager/nm-named-manager.c:352 +#: ../src/dns-manager/nm-dns-manager.c:352 msgid "The nameservers listed below may not be recognized." msgstr "खालिल यादीतील नेमसर्व्हर्स् अनोळखी राहतील." diff --git a/po/nb.po b/po/nb.po index fece349e5a..fdbcffebd8 100644 --- a/po/nb.po +++ b/po/nb.po @@ -76,11 +76,11 @@ msgstr "" "# Flettet fra %s\n" "\n" -#: ../src/named-manager/nm-named-manager.c:256 +#: ../src/dns-manager/nm-dns-manager.c:256 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "MERK: libc navneoppslag støtter ikke flere enn 3 navnetjenere." -#: ../src/named-manager/nm-named-manager.c:258 +#: ../src/dns-manager/nm-dns-manager.c:258 msgid "The nameservers listed below may not be recognized." msgstr "Navnetjenere listet under vil kanskje ikke bli gjenkjent." diff --git a/po/nl.po b/po/nl.po index 0d9b571ace..758746fcd3 100644 --- a/po/nl.po +++ b/po/nl.po @@ -87,13 +87,13 @@ msgstr "" "# Samengevoegd vanuit %s\n" "\n" -#: ../src/named-manager/nm-named-manager.c:256 +#: ../src/dns-manager/nm-dns-manager.c:256 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "Merk op: de resolver van libc ondersteunt mogelijkerwijs niet meer dan 3 " "nameservers." -#: ../src/named-manager/nm-named-manager.c:258 +#: ../src/dns-manager/nm-dns-manager.c:258 msgid "The nameservers listed below may not be recognized." msgstr "De naamservers hieronder worden mogelijk niet herkend." diff --git a/po/oc.po b/po/oc.po index df55c4a71e..bc7bc4a0d2 100644 --- a/po/oc.po +++ b/po/oc.po @@ -51,11 +51,11 @@ msgstr "" msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "" -#: ../src/named-manager/nm-named-manager.c:117 +#: ../src/dns-manager/nm-dns-manager.c:117 msgid "NOTE: the glibc resolver does not support more than 3 nameservers." msgstr "" -#: ../src/named-manager/nm-named-manager.c:119 +#: ../src/dns-manager/nm-dns-manager.c:119 msgid "The nameservers listed below may not be recognized." msgstr "" diff --git a/po/or.po b/po/or.po index dbae3e0290..bba0d598c7 100644 --- a/po/or.po +++ b/po/or.po @@ -1688,11 +1688,11 @@ msgstr "ଅଜ୍ଞାତ ଲଗ ସ୍ତର '%s'" msgid "Unknown log domain '%s'" msgstr "ଅଜ୍ଞାତ ଲଗ ଡମେନ '%s'" -#: ../src/named-manager/nm-named-manager.c:384 +#: ../src/dns-manager/nm-dns-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "ଟିପ୍ପଣୀ: libc resolver 3 ରୁ ଅଧିକ nameserverଗୁଡ଼ିକୁ ସମର୍ଥନ କରିନପାରେ." -#: ../src/named-manager/nm-named-manager.c:386 +#: ../src/dns-manager/nm-dns-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "ନିମ୍ନରେ ତାଲିକାଭୁକ୍ତ nameserverଗୁଡ଼ିକୁ ଚିହ୍ନି ହୋଇନପାରେ." diff --git a/po/pa.po b/po/pa.po index 482ddbf894..4894383b15 100644 --- a/po/pa.po +++ b/po/pa.po @@ -1680,11 +1680,11 @@ msgstr "ਅਣਜਾਣ ਲਾਗ ਲੈਵਲ '%s'" msgid "Unknown log domain '%s'" msgstr "ਅਣਜਾਣ ਲਾਗ ਡੋਮੇਨ '%s'" -#: ../src/named-manager/nm-named-manager.c:350 +#: ../src/dns-manager/nm-dns-manager.c:350 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "ਨੋਟ: libc ਰਿਜ਼ੋਲਵਰ ੩ ਤੋਂ ਵੱਧ ਨੇਮ-ਸਰਵਰ ਲਈ ਸਹਾਇਕ ਨਹੀਂ ਹੋ ਸਕਦਾ ਹੈ।" -#: ../src/named-manager/nm-named-manager.c:352 +#: ../src/dns-manager/nm-dns-manager.c:352 msgid "The nameservers listed below may not be recognized." msgstr "ਹੇਠਾਂ ਦਿੱਤੇ ਨੇਮ-ਸਰਵਰ ਪਛਾਣੇ ਨਹੀਂ ਜਾ ਸਕਦੇ।" diff --git a/po/pl.po b/po/pl.po index 7ffa179913..cfa994a294 100644 --- a/po/pl.po +++ b/po/pl.po @@ -1563,11 +1563,11 @@ msgstr "nie można połączyć się z netlink: %s" msgid "unable to join netlink group: %s" msgstr "nie można dołączyć do grupy netlink: %s" -#: ../src/named-manager/nm-named-manager.c:315 +#: ../src/dns-manager/nm-dns-manager.c:315 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "UWAGA: obsługa nazw libc nie obsługuje więcej niż 3 serwery nazw." -#: ../src/named-manager/nm-named-manager.c:317 +#: ../src/dns-manager/nm-dns-manager.c:317 msgid "The nameservers listed below may not be recognized." msgstr "Poniższe serwery nazw nie mogą nie zostać rozpoznane." diff --git a/po/pt_BR.po b/po/pt_BR.po index 13c7a27624..40919e8a6b 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -1311,13 +1311,13 @@ msgstr "Nível de registro \"%s\" desconhecido" msgid "Unknown log domain '%s'" msgstr "Domínio de registro \"%s\" desconhecido" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/dns-manager/nm-dns-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "NOTA: o resolvedor da libc não tem suporte a mais do que 3 servidores de " "nomes." -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/dns-manager/nm-dns-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "Os servidores de nomes listados abaixo podem não ser reconhecidos." diff --git a/po/ru.po b/po/ru.po index eaf0b8964c..2595ab3c6b 100644 --- a/po/ru.po +++ b/po/ru.po @@ -1594,13 +1594,13 @@ msgstr "Неизвестный уровень журналирования «%s msgid "Unknown log domain '%s'" msgstr "Неизвестный домен журналирования «%s»" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/dns-manager/nm-dns-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "ВНИМАНИЕ: преобразователь имён glibc не поддерживает более трёх серверов " "имён." -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/dns-manager/nm-dns-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "Нижеперечисленные сервера могут быть пропущены." diff --git a/po/sl.po b/po/sl.po index 425fd752e2..4f9809182c 100644 --- a/po/sl.po +++ b/po/sl.po @@ -446,11 +446,11 @@ msgstr "z netlink se ni mogoče povezati: %s" msgid "unable to join netlink group: %s" msgstr "skupini netlink se ni mogoče pridružiti: %s" -#: ../src/named-manager/nm-named-manager.c:315 +#: ../src/dns-manager/nm-dns-manager.c:315 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "OPOMBA: libc razreševalnik morda ne podpira več kot 3 imenske strežnike." -#: ../src/named-manager/nm-named-manager.c:317 +#: ../src/dns-manager/nm-dns-manager.c:317 msgid "The nameservers listed below may not be recognized." msgstr "Imenski strežniki našteti spodaj morda ne bodo prepoznani." diff --git a/po/sv.po b/po/sv.po index 42b5e884ad..dc9869ed1f 100644 --- a/po/sv.po +++ b/po/sv.po @@ -1849,11 +1849,11 @@ msgstr "Okänd loggnivå \"%s\"" msgid "Unknown log domain '%s'" msgstr "Okänd loggdomän \"%s\"" -#: ../src/named-manager/nm-named-manager.c:384 +#: ../src/dns-manager/nm-dns-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "OBSERVERA: uppslag via glibc kanske inte har stöd för fler än 3 namnservrar." -#: ../src/named-manager/nm-named-manager.c:386 +#: ../src/dns-manager/nm-dns-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "Namnservrarna listade nedan kanske inte kommer att kännas igen." diff --git a/po/ta.po b/po/ta.po index 1642030c33..8ab5caeb63 100644 --- a/po/ta.po +++ b/po/ta.po @@ -1594,11 +1594,11 @@ msgstr "தெரியாத பதிவு நிலை '%s'" msgid "Unknown log domain '%s'" msgstr "தெரியாத பதிவு டொமைன் '%s'" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/dns-manager/nm-dns-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "குறிப்பு: இந்த libc மறுதீர்வாளர் 3 பெயர்சேவையர்களுக்கு மேல் துணைபுரியவதில்லை." -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/dns-manager/nm-dns-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "கீழே பட்டியலிட்டப்படுள்ள பெயர்சேவையகங்கள் கண்டுபிடிக்கப்படவில்லை." diff --git a/po/te.po b/po/te.po index ec83618fff..cf05561417 100644 --- a/po/te.po +++ b/po/te.po @@ -1681,11 +1681,11 @@ msgstr "తెలియని లాగ్ స్థాయి '%s'" msgid "Unknown log domain '%s'" msgstr "తెలియని లాగ్ డొమైన్ '%s'" -#: ../src/named-manager/nm-named-manager.c:350 +#: ../src/dns-manager/nm-dns-manager.c:350 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "గమనిక: libc రిజాల్వర్ 3 నామపు సేవికలకన్నా యెక్కువ వాటికి మద్దతివ్వలేదు." -#: ../src/named-manager/nm-named-manager.c:352 +#: ../src/dns-manager/nm-dns-manager.c:352 msgid "The nameservers listed below may not be recognized." msgstr "క్రిందన జాబితాచేసివున్న నామపుసేవికలు గుర్తించబడక పోవచ్చును." diff --git a/po/vi.po b/po/vi.po index cca7c1bf66..362d2f7a6b 100644 --- a/po/vi.po +++ b/po/vi.po @@ -57,11 +57,11 @@ msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "" "Tùy chọn không hợp lệ. Hãy sử dụng tùy chọn trợ giúp « --help » để xem một danh sách các tùy chọn hợp lệ.\n" -#: ../src/named-manager/nm-named-manager.c:218 +#: ../src/dns-manager/nm-dns-manager.c:218 msgid "NOTE: the glibc resolver does not support more than 3 nameservers." msgstr "GHI CHÚ : hàm giải quyết glibc chỉ hỗ trợ đến 3 máy phục vụ tên." -#: ../src/named-manager/nm-named-manager.c:220 +#: ../src/dns-manager/nm-dns-manager.c:220 msgid "The nameservers listed below may not be recognized." msgstr "Những máy phục vụ tên được liệt kê dưới đây có lẽ không nhận ra được." diff --git a/po/zh_CN.po b/po/zh_CN.po index ccd64cd937..81e2e6b6a2 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -1682,11 +1682,11 @@ msgstr "未知日志等级 '%s'" msgid "Unknown log domain '%s'" msgstr "未知日志域 '%s'" -#: ../src/named-manager/nm-named-manager.c:384 +#: ../src/dns-manager/nm-dns-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "注意:libc 解析器可能不支持超过三个名字服务器。" -#: ../src/named-manager/nm-named-manager.c:386 +#: ../src/dns-manager/nm-dns-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "以下列出的名字服务器可能无法被识别。" diff --git a/po/zh_HK.po b/po/zh_HK.po index c56c2781f9..662cabd985 100644 --- a/po/zh_HK.po +++ b/po/zh_HK.po @@ -44,11 +44,11 @@ msgstr "" "# Merged from %s\n" "\n" -#: ../src/named-manager/nm-named-manager.c:257 +#: ../src/dns-manager/nm-dns-manager.c:257 msgid "NOTE: the glibc resolver does not support more than 3 nameservers." msgstr "注意:glibc 解析器不支援 3 個以上的名稱伺服器。" -#: ../src/named-manager/nm-named-manager.c:259 +#: ../src/dns-manager/nm-dns-manager.c:259 msgid "The nameservers listed below may not be recognized." msgstr "下面列出的名稱伺服器可能不會被辨識。" diff --git a/po/zh_TW.po b/po/zh_TW.po index 4357e26699..25e81bbe1b 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -1591,11 +1591,11 @@ msgstr "不明日誌層級「%s」" msgid "Unknown log domain '%s'" msgstr "不明日誌網域「%s」" -#: ../src/named-manager/nm-named-manager.c:343 +#: ../src/dns-manager/nm-dns-manager.c:343 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "注意:libc 解析器不支援 3 個以上的名稱伺服器。" -#: ../src/named-manager/nm-named-manager.c:345 +#: ../src/dns-manager/nm-dns-manager.c:345 msgid "The nameservers listed below may not be recognized." msgstr "下面列出的名稱伺服器可能不會被辨識。" diff --git a/src/Makefile.am b/src/Makefile.am index 72b23d083e..8c01df0fb4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS= \ logging \ - named-manager \ + dns-manager \ vpn-manager \ dhcp-manager \ ip6-manager \ @@ -18,7 +18,7 @@ INCLUDES = -I${top_srcdir} \ -I${top_srcdir}/include \ -I${top_builddir}/marshallers \ -I${top_srcdir}/src/logging \ - -I${top_srcdir}/src/named-manager \ + -I${top_srcdir}/src/dns-manager \ -I${top_srcdir}/src/vpn-manager \ -I${top_srcdir}/src/dhcp-manager \ -I${top_srcdir}/src/ip6-manager \ @@ -228,7 +228,7 @@ NetworkManager_CPPFLAGS = \ NetworkManager_LDADD = \ $(top_builddir)/marshallers/libmarshallers.la \ ./logging/libnm-logging.la \ - ./named-manager/libnamed-manager.la \ + ./dns-manager/libdns-manager.la \ ./vpn-manager/libvpn-manager.la \ ./dhcp-manager/libdhcp-manager.la \ ./ip6-manager/libip6-manager.la \ diff --git a/src/backends/Makefile.am b/src/backends/Makefile.am index c3485e5f9b..b35fafd72a 100644 --- a/src/backends/Makefile.am +++ b/src/backends/Makefile.am @@ -3,8 +3,6 @@ INCLUDES = \ -I${top_srcdir}/src/logging \ -I${top_srcdir}/include \ -I${top_srcdir}/src \ - -I${top_srcdir}/src/vpn-manager \ - -I${top_srcdir}/src/named-manager \ -I${top_srcdir}/libnm-util noinst_LTLIBRARIES = libnmbackend.la diff --git a/src/dhcp-manager/Makefile.am b/src/dhcp-manager/Makefile.am index 4c5408701e..e29c6718a3 100644 --- a/src/dhcp-manager/Makefile.am +++ b/src/dhcp-manager/Makefile.am @@ -4,8 +4,7 @@ INCLUDES = \ -I${top_builddir}/marshallers \ -I${top_srcdir}/src/logging \ -I${top_srcdir}/libnm-util \ - -I${top_srcdir}/src \ - -I${top_srcdir}/src/named-manager + -I${top_srcdir}/src noinst_LTLIBRARIES = libdhcp-manager.la diff --git a/src/dns-manager/Makefile.am b/src/dns-manager/Makefile.am new file mode 100644 index 0000000000..d1ea5f87e9 --- /dev/null +++ b/src/dns-manager/Makefile.am @@ -0,0 +1,21 @@ +INCLUDES = \ + -I${top_srcdir}/src/logging \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/src \ + -I${top_srcdir}/include + +noinst_LTLIBRARIES = libdns-manager.la + +libdns_manager_la_SOURCES = nm-dns-manager.h nm-dns-manager.c + +libdns_manager_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DNM_PKGDATADIR=\"$(pkgdatadir)\" \ + -DNM_LOCALSTATEDIR=\"$(localstatedir)\" + +libdns_manager_la_LIBADD = \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + diff --git a/src/dns-manager/nm-dns-manager.c b/src/dns-manager/nm-dns-manager.c new file mode 100644 index 0000000000..6b4b67543c --- /dev/null +++ b/src/dns-manager/nm-dns-manager.c @@ -0,0 +1,883 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2004 - 2005 Colin Walters + * Copyright (C) 2004 - 2010 Red Hat, Inc. + * Copyright (C) 2005 - 2008 Novell, Inc. + * and others + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "nm-dns-manager.h" +#include "nm-ip4-config.h" +#include "nm-ip6-config.h" +#include "nm-logging.h" +#include "nm-system.h" +#include "NetworkManagerUtils.h" + +#ifdef HAVE_SELINUX +#include +#endif + +#ifndef RESOLV_CONF +#define RESOLV_CONF "/etc/resolv.conf" +#endif + +#define ADDR_BUF_LEN 50 + +G_DEFINE_TYPE(NMDnsManager, nm_dns_manager, G_TYPE_OBJECT) + +#define NM_DNS_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ + NM_TYPE_DNS_MANAGER, \ + NMDnsManagerPrivate)) + + +struct NMDnsManagerPrivate { + NMIP4Config *ip4_vpn_config; + NMIP4Config *ip4_device_config; + NMIP6Config *ip6_vpn_config; + NMIP6Config *ip6_device_config; + GSList *configs; + char *hostname; + + /* This is a hack because SUSE's netconfig always wants changes + * associated with a network interface, but sometimes a change isn't + * associated with a network interface (like hostnames). + */ + char *last_iface; +}; + + +NMDnsManager * +nm_dns_manager_get (void) +{ + static NMDnsManager * singleton = NULL; + + if (!singleton) + singleton = NM_DNS_MANAGER (g_object_new (NM_TYPE_DNS_MANAGER, NULL)); + else + g_object_ref (singleton); + + g_assert (singleton); + return singleton; +} + + +GQuark +nm_dns_manager_error_quark (void) +{ + static GQuark quark = 0; + if (!quark) + quark = g_quark_from_static_string ("nm_dns_manager_error"); + + return quark; +} + +typedef struct { + GPtrArray *nameservers; + const char *domain; + GPtrArray *searches; + const char *nis_domain; + GPtrArray *nis_servers; +} NMResolvConfData; + +static void +add_string_item (GPtrArray *array, const char *str) +{ + int i; + + g_return_if_fail (array != NULL); + g_return_if_fail (str != NULL); + + /* Check for dupes before adding */ + for (i = 0; i < array->len; i++) { + const char *candidate = g_ptr_array_index (array, i); + + if (candidate && !strcmp (candidate, str)) + return; + } + + /* No dupes, add the new item */ + g_ptr_array_add (array, g_strdup (str)); +} + +static void +merge_one_ip4_config (NMResolvConfData *rc, NMIP4Config *src) +{ + guint32 num, i; + + num = nm_ip4_config_get_num_nameservers (src); + for (i = 0; i < num; i++) { + struct in_addr addr; + char buf[INET_ADDRSTRLEN]; + + addr.s_addr = nm_ip4_config_get_nameserver (src, i); + if (inet_ntop (AF_INET, &addr, buf, INET_ADDRSTRLEN) > 0) + add_string_item (rc->nameservers, buf); + } + + num = nm_ip4_config_get_num_domains (src); + for (i = 0; i < num; i++) { + const char *domain; + + domain = nm_ip4_config_get_domain (src, i); + if (!rc->domain) + rc->domain = domain; + add_string_item (rc->searches, domain); + } + + num = nm_ip4_config_get_num_searches (src); + for (i = 0; i < num; i++) + add_string_item (rc->searches, nm_ip4_config_get_search (src, i)); + + /* NIS stuff */ + num = nm_ip4_config_get_num_nis_servers (src); + for (i = 0; i < num; i++) { + struct in_addr addr; + char buf[INET_ADDRSTRLEN]; + + addr.s_addr = nm_ip4_config_get_nis_server (src, i); + if (inet_ntop (AF_INET, &addr, buf, INET_ADDRSTRLEN) > 0) + add_string_item (rc->nis_servers, buf); + } + + if (nm_ip4_config_get_nis_domain (src)) { + /* FIXME: handle multiple domains */ + if (!rc->nis_domain) + rc->nis_domain = nm_ip4_config_get_nis_domain (src); + } +} + +static void +merge_one_ip6_config (NMResolvConfData *rc, NMIP6Config *src) +{ + guint32 num, i; + + num = nm_ip6_config_get_num_nameservers (src); + for (i = 0; i < num; i++) { + const struct in6_addr *addr; + char buf[INET6_ADDRSTRLEN]; + + addr = nm_ip6_config_get_nameserver (src, i); + + /* inet_ntop is probably supposed to do this for us, but it doesn't */ + if (IN6_IS_ADDR_V4MAPPED (addr)) { + if (inet_ntop (AF_INET, &(addr->s6_addr32[3]), buf, INET_ADDRSTRLEN) > 0) + add_string_item (rc->nameservers, buf); + } else { + if (inet_ntop (AF_INET6, addr, buf, INET6_ADDRSTRLEN) > 0) + add_string_item (rc->nameservers, buf); + } + } + + num = nm_ip6_config_get_num_domains (src); + for (i = 0; i < num; i++) { + const char *domain; + + domain = nm_ip6_config_get_domain (src, i); + if (!rc->domain) + rc->domain = domain; + add_string_item (rc->searches, domain); + } + + num = nm_ip6_config_get_num_searches (src); + for (i = 0; i < num; i++) + add_string_item (rc->searches, nm_ip6_config_get_search (src, i)); +} + + +#if defined(TARGET_SUSE) +/**********************************/ +/* SUSE */ + +static void +netconfig_child_setup (gpointer user_data G_GNUC_UNUSED) +{ + pid_t pid = getpid (); + setpgid (pid, pid); +} + +static GPid +run_netconfig (GError **error, gint *stdin_fd) +{ + char *argv[5]; + char *tmp; + GPid pid = -1; + + argv[0] = "/sbin/netconfig"; + argv[1] = "modify"; + argv[2] = "--service"; + argv[3] = "NetworkManager"; + argv[4] = NULL; + + tmp = g_strjoinv (" ", argv); + nm_log_dbg (LOGD_DNS, "spawning '%s'", tmp); + g_free (tmp); + + if (!g_spawn_async_with_pipes (NULL, argv, NULL, 0, netconfig_child_setup, + NULL, &pid, stdin_fd, NULL, NULL, error)) + return -1; + + return pid; +} + +static void +write_to_netconfig (gint fd, const char *key, const char *value) +{ + char *str; + int x; + + str = g_strdup_printf ("%s='%s'\n", key, value); + nm_log_dbg (LOGD_DNS, "writing to netconfig: %s", str); + x = write (fd, str, strlen (str)); + g_free (str); +} + +static gboolean +dispatch_netconfig (const char *domain, + char **searches, + char **nameservers, + const char *nis_domain, + char **nis_servers, + const char *iface, + GError **error) +{ + char *str; + GPid pid; + gint fd; + int ret; + + pid = run_netconfig (error, &fd); + if (pid < 0) + return FALSE; + + // FIXME: this is wrong. We are not writing out the iface-specific + // resolv.conf data, we are writing out an already-fully-merged + // resolv.conf. Assuming netconfig works in the obvious way, then + // there are various failure modes, such as, eg, bringing up a VPN on + // eth0, then bringing up wlan0, then bringing down the VPN. Because + // NMDnsManager would have claimed that the VPN DNS server was also + // part of the wlan0 config, it will remain in resolv.conf after the + // VPN goes down, even though it is presumably no longer reachable + // at that point. + write_to_netconfig (fd, "INTERFACE", iface); + + if (searches) { + str = g_strjoinv (" ", searches); + + if (domain) { + char *tmp; + + tmp = g_strconcat (domain, " ", str, NULL); + g_free (str); + str = tmp; + } + + write_to_netconfig (fd, "DNSSEARCH", str); + g_free (str); + } + + if (nameservers) { + str = g_strjoinv (" ", nameservers); + write_to_netconfig (fd, "DNSSERVERS", str); + g_free (str); + } + + if (nis_domain) + write_to_netconfig (fd, "NISDOMAIN", nis_domain); + + if (nis_servers) { + str = g_strjoinv (" ", nis_servers); + write_to_netconfig (fd, "NISSERVERS", str); + g_free (str); + } + + close (fd); + + /* Wait until the process exits */ + + again: + + ret = waitpid (pid, NULL, 0); + if (ret < 0 && errno == EINTR) + goto again; + else if (ret < 0 && errno == ECHILD) { + /* When the netconfig exist, the errno is ECHILD, it should return TRUE */ + return TRUE; + } + + return ret > 0; +} +#endif + + +static gboolean +write_resolv_conf (FILE *f, const char *domain, + char **searches, + char **nameservers, + GError **error) +{ + char *domain_str = NULL; + char *searches_str = NULL; + char *nameservers_str = NULL; + int i; + gboolean retval = FALSE; + + if (fprintf (f, "%s","# Generated by NetworkManager\n") < 0) { + g_set_error (error, + NM_DNS_MANAGER_ERROR, + NM_DNS_MANAGER_ERROR_SYSTEM, + "Could not write " RESOLV_CONF ": %s\n", + g_strerror (errno)); + return FALSE; + } + + if (domain) + domain_str = g_strconcat ("domain ", domain, "\n", NULL); + + if (searches) { + char *tmp_str; + + tmp_str = g_strjoinv (" ", searches); + searches_str = g_strconcat ("search ", tmp_str, "\n", NULL); + g_free (tmp_str); + } + + if (nameservers) { + GString *str; + int num; + + str = g_string_new (""); + num = g_strv_length (nameservers); + + for (i = 0; i < num; i++) { + if (i == 3) { + g_string_append (str, "# "); + g_string_append (str, _("NOTE: the libc resolver may not support more than 3 nameservers.")); + g_string_append (str, "\n# "); + g_string_append (str, _("The nameservers listed below may not be recognized.")); + g_string_append_c (str, '\n'); + } + + g_string_append (str, "nameserver "); + g_string_append (str, nameservers[i]); + g_string_append_c (str, '\n'); + } + + nameservers_str = g_string_free (str, FALSE); + } + + if (fprintf (f, "%s%s%s", + domain_str ? domain_str : "", + searches_str ? searches_str : "", + nameservers_str ? nameservers_str : "") != -1) + retval = TRUE; + + g_free (domain_str); + g_free (searches_str); + g_free (nameservers_str); + + return retval; +} + +#ifdef RESOLVCONF_PATH +static gboolean +dispatch_resolvconf (const char *domain, + char **searches, + char **nameservers, + const char *iface, + GError **error) +{ + char *cmd; + FILE *f; + gboolean retval = FALSE; + + if (! g_file_test (RESOLVCONF_PATH, G_FILE_TEST_IS_EXECUTABLE)) + return FALSE; + + if (domain || searches || nameservers) { + cmd = g_strconcat (RESOLVCONF_PATH, " -a ", "NetworkManager", NULL); + nm_log_info (LOGD_DNS, "(%s): writing resolv.conf to %s", iface, RESOLVCONF_PATH); + if ((f = popen (cmd, "w")) == NULL) + g_set_error (error, + NM_DNS_MANAGER_ERROR, + NM_DNS_MANAGER_ERROR_SYSTEM, + "Could not write to %s: %s\n", + RESOLVCONF_PATH, + g_strerror (errno)); + else { + retval = write_resolv_conf (f, domain, searches, nameservers, error); + retval &= (pclose (f) == 0); + } + } else { + cmd = g_strconcat (RESOLVCONF_PATH, " -d ", "NetworkManager", NULL); + nm_log_info (LOGD_DNS, "(%s): removing resolv.conf from %s", iface, RESOLVCONF_PATH); + if (nm_spawn_process (cmd) == 0) + retval = TRUE; + } + + g_free (cmd); + + return retval; +} +#endif + +static gboolean +update_resolv_conf (const char *domain, + char **searches, + char **nameservers, + const char *iface, + GError **error) +{ + char *tmp_resolv_conf; + char *tmp_resolv_conf_realpath; + char *resolv_conf_realpath; + FILE *f; + int do_rename = 1; + int old_errno = 0; + + g_return_val_if_fail (error != NULL, FALSE); + + /* Find the real path of resolv.conf; it could be a symlink to something */ + resolv_conf_realpath = realpath (RESOLV_CONF, NULL); + if (!resolv_conf_realpath) + resolv_conf_realpath = strdup (RESOLV_CONF); + + /* Build up the real path for the temp resolv.conf that we're about to + * write out. + */ + tmp_resolv_conf = g_strdup_printf ("%s.tmp", resolv_conf_realpath); + tmp_resolv_conf_realpath = realpath (tmp_resolv_conf, NULL); + if (!tmp_resolv_conf_realpath) + tmp_resolv_conf_realpath = strdup (tmp_resolv_conf); + g_free (tmp_resolv_conf); + tmp_resolv_conf = NULL; + + if ((f = fopen (tmp_resolv_conf_realpath, "w")) == NULL) { + do_rename = 0; + old_errno = errno; + if ((f = fopen (RESOLV_CONF, "w")) == NULL) { + g_set_error (error, + NM_DNS_MANAGER_ERROR, + NM_DNS_MANAGER_ERROR_SYSTEM, + "Could not open %s: %s\nCould not open %s: %s\n", + tmp_resolv_conf_realpath, + g_strerror (old_errno), + RESOLV_CONF, + g_strerror (errno)); + goto out; + } + /* Update tmp_resolv_conf_realpath so the error message on fclose() + * failure will be correct. + */ + strcpy (tmp_resolv_conf_realpath, RESOLV_CONF); + } + + write_resolv_conf (f, domain, searches, nameservers, error); + + if (fclose (f) < 0) { + if (*error == NULL) { + /* only set an error here if write_resolv_conf() was successful, + * since its error is more important. + */ + g_set_error (error, + NM_DNS_MANAGER_ERROR, + NM_DNS_MANAGER_ERROR_SYSTEM, + "Could not close %s: %s\n", + tmp_resolv_conf_realpath, + g_strerror (errno)); + } + } + + /* Don't rename the tempfile over top of the existing resolv.conf if there + * was an error writing it out. + */ + if (*error == NULL && do_rename) { + if (rename (tmp_resolv_conf_realpath, resolv_conf_realpath) < 0) { + g_set_error (error, + NM_DNS_MANAGER_ERROR, + NM_DNS_MANAGER_ERROR_SYSTEM, + "Could not replace " RESOLV_CONF ": %s\n", + g_strerror (errno)); + } + } + +out: + free (tmp_resolv_conf_realpath); + free (resolv_conf_realpath); + return *error ? FALSE : TRUE; +} + +static gboolean +rewrite_resolv_conf (NMDnsManager *mgr, const char *iface, GError **error) +{ + NMDnsManagerPrivate *priv; + NMResolvConfData rc; + GSList *iter; + const char *domain = NULL; + const char *nis_domain = NULL; + char **searches = NULL; + char **nameservers = NULL; + char **nis_servers = NULL; + int num, i, len; + gboolean success = FALSE; + + g_return_val_if_fail (error != NULL, FALSE); + g_return_val_if_fail (*error == NULL, FALSE); + + priv = NM_DNS_MANAGER_GET_PRIVATE (mgr); + + if (iface) { + g_free (priv->last_iface); + priv->last_iface = g_strdup (iface); + } + + rc.nameservers = g_ptr_array_new (); + rc.domain = NULL; + rc.searches = g_ptr_array_new (); + rc.nis_servers = g_ptr_array_new (); + + if (priv->ip4_vpn_config) + merge_one_ip4_config (&rc, priv->ip4_vpn_config); + if (priv->ip4_device_config) + merge_one_ip4_config (&rc, priv->ip4_device_config); + + if (priv->ip6_vpn_config) + merge_one_ip6_config (&rc, priv->ip6_vpn_config); + if (priv->ip6_device_config) + merge_one_ip6_config (&rc, priv->ip6_device_config); + + for (iter = priv->configs; iter; iter = g_slist_next (iter)) { + if ( (iter->data == priv->ip4_vpn_config) + || (iter->data == priv->ip4_device_config) + || (iter->data == priv->ip6_vpn_config) + || (iter->data == priv->ip6_device_config)) + continue; + + if (NM_IS_IP4_CONFIG (iter->data)) { + NMIP4Config *config = NM_IP4_CONFIG (iter->data); + + merge_one_ip4_config (&rc, config); + } else if (NM_IS_IP6_CONFIG (iter->data)) { + NMIP6Config *config = NM_IP6_CONFIG (iter->data); + + merge_one_ip6_config (&rc, config); + } else + g_assert_not_reached (); + } + + /* Add the current domain name (from the hostname) to the searches list; + * see rh #600407. The bug report is that when the hostname is set to + * something like 'dcbw.foobar.com' (ie an FQDN) that pinging 'dcbw' doesn't + * work because the resolver doesn't have anything to append to 'dcbw' when + * looking it up. + */ + if (priv->hostname) { + const char *hostsearch = strchr (priv->hostname, '.'); + + /* +1 to get rid of the dot */ + if (hostsearch && strlen (hostsearch + 1)) + add_string_item (rc.searches, hostsearch + 1); + } + + domain = rc.domain; + + /* Per 'man resolv.conf', the search list is limited to 6 domains + * totalling 256 characters. + */ + num = MIN (rc.searches->len, 6); + for (i = 0, len = 0; i < num; i++) { + len += strlen (rc.searches->pdata[i]) + 1; /* +1 for spaces */ + if (len > 256) + break; + } + g_ptr_array_set_size (rc.searches, i); + if (rc.searches->len) { + g_ptr_array_add (rc.searches, NULL); + searches = (char **) g_ptr_array_free (rc.searches, FALSE); + } else + g_ptr_array_free (rc.searches, TRUE); + + if (rc.nameservers->len) { + g_ptr_array_add (rc.nameservers, NULL); + nameservers = (char **) g_ptr_array_free (rc.nameservers, FALSE); + } else + g_ptr_array_free (rc.nameservers, TRUE); + + if (rc.nis_servers->len) { + g_ptr_array_add (rc.nis_servers, NULL); + nis_servers = (char **) g_ptr_array_free (rc.nis_servers, FALSE); + } else + g_ptr_array_free (rc.nis_servers, TRUE); + + nis_domain = rc.nis_domain; + +#ifdef RESOLVCONF_PATH + success = dispatch_resolvconf (domain, searches, nameservers, iface, error); +#endif + +#ifdef TARGET_SUSE + if (success == FALSE) { + success = dispatch_netconfig (domain, searches, nameservers, + nis_domain, nis_servers, + iface, error); + } +#endif + + if (success == FALSE) + success = update_resolv_conf (domain, searches, nameservers, iface, error); + + if (success) + nm_system_update_dns (); + + if (searches) + g_strfreev (searches); + if (nameservers) + g_strfreev (nameservers); + if (nis_servers) + g_strfreev (nis_servers); + + return success; +} + +gboolean +nm_dns_manager_add_ip4_config (NMDnsManager *mgr, + const char *iface, + NMIP4Config *config, + NMDnsIPConfigType cfg_type) +{ + NMDnsManagerPrivate *priv; + GError *error = NULL; + + g_return_val_if_fail (mgr != NULL, FALSE); + g_return_val_if_fail (iface != NULL, FALSE); + g_return_val_if_fail (config != NULL, FALSE); + + priv = NM_DNS_MANAGER_GET_PRIVATE (mgr); + + switch (cfg_type) { + case NM_DNS_IP_CONFIG_TYPE_VPN: + priv->ip4_vpn_config = config; + break; + case NM_DNS_IP_CONFIG_TYPE_BEST_DEVICE: + priv->ip4_device_config = config; + break; + default: + break; + } + + /* Don't allow the same zone added twice */ + if (!g_slist_find (priv->configs, config)) + priv->configs = g_slist_append (priv->configs, g_object_ref (config)); + + if (!rewrite_resolv_conf (mgr, iface, &error)) { + nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); + g_error_free (error); + } + + return TRUE; +} + +gboolean +nm_dns_manager_remove_ip4_config (NMDnsManager *mgr, + const char *iface, + NMIP4Config *config) +{ + NMDnsManagerPrivate *priv; + GError *error = NULL; + + g_return_val_if_fail (mgr != NULL, FALSE); + g_return_val_if_fail (iface != NULL, FALSE); + g_return_val_if_fail (config != NULL, FALSE); + + priv = NM_DNS_MANAGER_GET_PRIVATE (mgr); + + /* Can't remove it if it wasn't in the list to begin with */ + if (!g_slist_find (priv->configs, config)) + return FALSE; + + priv->configs = g_slist_remove (priv->configs, config); + + if (config == priv->ip4_vpn_config) + priv->ip4_vpn_config = NULL; + if (config == priv->ip4_device_config) + priv->ip4_device_config = NULL; + + g_object_unref (config); + + if (!rewrite_resolv_conf (mgr, iface, &error)) { + nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); + if (error) + g_error_free (error); + } + + return TRUE; +} + +gboolean +nm_dns_manager_add_ip6_config (NMDnsManager *mgr, + const char *iface, + NMIP6Config *config, + NMDnsIPConfigType cfg_type) +{ + NMDnsManagerPrivate *priv; + GError *error = NULL; + + g_return_val_if_fail (mgr != NULL, FALSE); + g_return_val_if_fail (iface != NULL, FALSE); + g_return_val_if_fail (config != NULL, FALSE); + + priv = NM_DNS_MANAGER_GET_PRIVATE (mgr); + + switch (cfg_type) { + case NM_DNS_IP_CONFIG_TYPE_VPN: + /* FIXME: not quite yet... */ + g_return_val_if_fail (cfg_type != NM_DNS_IP_CONFIG_TYPE_VPN, FALSE); + priv->ip6_vpn_config = config; + break; + case NM_DNS_IP_CONFIG_TYPE_BEST_DEVICE: + priv->ip6_device_config = config; + break; + default: + break; + } + + /* Don't allow the same zone added twice */ + if (!g_slist_find (priv->configs, config)) + priv->configs = g_slist_append (priv->configs, g_object_ref (config)); + + if (!rewrite_resolv_conf (mgr, iface, &error)) { + nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); + g_error_free (error); + } + + return TRUE; +} + +gboolean +nm_dns_manager_remove_ip6_config (NMDnsManager *mgr, + const char *iface, + NMIP6Config *config) +{ + NMDnsManagerPrivate *priv; + GError *error = NULL; + + g_return_val_if_fail (mgr != NULL, FALSE); + g_return_val_if_fail (iface != NULL, FALSE); + g_return_val_if_fail (config != NULL, FALSE); + + priv = NM_DNS_MANAGER_GET_PRIVATE (mgr); + + /* Can't remove it if it wasn't in the list to begin with */ + if (!g_slist_find (priv->configs, config)) + return FALSE; + + priv->configs = g_slist_remove (priv->configs, config); + + if (config == priv->ip6_vpn_config) + priv->ip6_vpn_config = NULL; + if (config == priv->ip6_device_config) + priv->ip6_device_config = NULL; + + g_object_unref (config); + + if (!rewrite_resolv_conf (mgr, iface, &error)) { + nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); + if (error) + g_error_free (error); + } + + return TRUE; +} + +void +nm_dns_manager_set_hostname (NMDnsManager *mgr, + const char *hostname) +{ + NMDnsManagerPrivate *priv = NM_DNS_MANAGER_GET_PRIVATE (mgr); + GError *error = NULL; + const char *filtered = NULL; + + /* Certain hostnames we don't want to include in resolv.conf 'searches' */ + if ( hostname + && strcmp (hostname, "localhost.localdomain") + && strcmp (hostname, "localhost6.localdomain6") + && !strstr (hostname, ".in-addr.arpa") + && strchr (hostname, '.')) { + filtered = hostname; + } + + if ( (!priv->hostname && !filtered) + || (priv->hostname && filtered && !strcmp (priv->hostname, filtered))) + return; + + g_free (priv->hostname); + priv->hostname = g_strdup (filtered); + + /* Passing the last interface here is completely bogus, but SUSE's netconfig + * wants one. But hostname changes are system-wide and *not* tied to a + * specific interface, so netconfig can't really handle this. Fake it. + */ + if (!rewrite_resolv_conf (mgr, priv->last_iface, &error)) { + nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); + g_clear_error (&error); + } +} + + +static void +nm_dns_manager_init (NMDnsManager *mgr) +{ +} + +static void +nm_dns_manager_finalize (GObject *object) +{ + NMDnsManagerPrivate *priv = NM_DNS_MANAGER_GET_PRIVATE (object); + + g_slist_foreach (priv->configs, (GFunc) g_object_unref, NULL); + g_slist_free (priv->configs); + g_free (priv->hostname); + g_free (priv->last_iface); + + G_OBJECT_CLASS (nm_dns_manager_parent_class)->finalize (object); +} + +static void +nm_dns_manager_class_init (NMDnsManagerClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = nm_dns_manager_finalize; + + g_type_class_add_private (object_class, sizeof (NMDnsManagerPrivate)); +} + diff --git a/src/dns-manager/nm-dns-manager.h b/src/dns-manager/nm-dns-manager.h new file mode 100644 index 0000000000..0002d69990 --- /dev/null +++ b/src/dns-manager/nm-dns-manager.h @@ -0,0 +1,95 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2004 - 2005 Colin Walters + * Copyright (C) 2004 - 2010 Red Hat, Inc. + * Copyright (C) 2005 - 2008 Novell, Inc. + * and others + */ + +#ifndef NM_DNS_MANAGER_H +#define NM_DNS_MANAGER_H + +#include "config.h" +#include +#include +#include "nm-ip4-config.h" +#include "nm-ip6-config.h" + +typedef enum { + NM_DNS_MANAGER_ERROR_SYSTEM, + NM_DNS_MANAGER_ERROR_INVALID_NAMESERVER, + NM_DNS_MANAGER_ERROR_INVALID_HOST, + NM_DNS_MANAGER_ERROR_INVALID_ID +} NMDnsManagerError; + +typedef enum { + NM_DNS_IP_CONFIG_TYPE_DEFAULT = 0, + NM_DNS_IP_CONFIG_TYPE_BEST_DEVICE, + NM_DNS_IP_CONFIG_TYPE_VPN +} NMDnsIPConfigType; + +#define NM_DNS_MANAGER_ERROR nm_dns_manager_error_quark () +GQuark nm_dns_manager_error_quark (void); + +G_BEGIN_DECLS + +#define NM_TYPE_DNS_MANAGER (nm_dns_manager_get_type ()) +#define NM_DNS_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NM_TYPE_DNS_MANAGER, NMDnsManager)) +#define NM_DNS_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), NM_TYPE_DNS_MANAGER, NMDnsManagerClass)) +#define NM_IS_DNS_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), NM_TYPE_DNS_MANAGER)) +#define NM_IS_DNS_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), NM_TYPE_DNS_MANAGER)) +#define NM_DNS_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), NM_TYPE_DNS_MANAGER, NMDnsManagerClass)) + +typedef struct NMDnsManagerPrivate NMDnsManagerPrivate; + +typedef struct { + GObject parent; +} NMDnsManager; + +typedef struct { + GObjectClass parent; +} NMDnsManagerClass; + +GType nm_dns_manager_get_type (void); + +NMDnsManager * nm_dns_manager_get (void); + +gboolean nm_dns_manager_add_ip4_config (NMDnsManager *mgr, + const char *iface, + NMIP4Config *config, + NMDnsIPConfigType cfg_type); + +gboolean nm_dns_manager_remove_ip4_config (NMDnsManager *mgr, + const char *iface, + NMIP4Config *config); + +gboolean nm_dns_manager_add_ip6_config (NMDnsManager *mgr, + const char *iface, + NMIP6Config *config, + NMDnsIPConfigType cfg_type); + +gboolean nm_dns_manager_remove_ip6_config (NMDnsManager *mgr, + const char *iface, + NMIP6Config *config); + +void nm_dns_manager_set_hostname (NMDnsManager *mgr, + const char *hostname); + +G_END_DECLS + +#endif /* NM_DNS_MANAGER_H */ diff --git a/src/ip6-manager/Makefile.am b/src/ip6-manager/Makefile.am index c2f5591429..b56b197e75 100644 --- a/src/ip6-manager/Makefile.am +++ b/src/ip6-manager/Makefile.am @@ -4,8 +4,7 @@ INCLUDES = \ -I${top_builddir}/marshallers \ -I${top_srcdir}/libnm-util \ -I${top_srcdir}/src/logging \ - -I${top_srcdir}/src \ - -I${top_srcdir}/src/named-manager + -I${top_srcdir}/src noinst_LTLIBRARIES = libip6-manager.la diff --git a/src/main.c b/src/main.c index aea2eef233..01bca9dc3e 100644 --- a/src/main.c +++ b/src/main.c @@ -41,7 +41,7 @@ #include "nm-manager.h" #include "nm-policy.h" #include "nm-system.h" -#include "nm-named-manager.h" +#include "nm-dns-manager.h" #include "nm-dbus-manager.h" #include "nm-supplicant-manager.h" #include "nm-dhcp-manager.h" @@ -446,7 +446,7 @@ main (int argc, char *argv[]) gboolean success; NMPolicy *policy = NULL; NMVPNManager *vpn_manager = NULL; - NMNamedManager *named_mgr = NULL; + NMDnsManager *dns_mgr = NULL; NMDBusManager *dbus_mgr = NULL; NMSupplicantManager *sup_mgr = NULL; NMDHCPManager *dhcp_mgr = NULL; @@ -663,9 +663,9 @@ main (int argc, char *argv[]) goto done; } - named_mgr = nm_named_manager_get (); - if (!named_mgr) { - nm_log_err (LOGD_CORE, "failed to start the named manager."); + dns_mgr = nm_dns_manager_get (); + if (!dns_mgr) { + nm_log_err (LOGD_CORE, "failed to start the DNS manager."); goto done; } @@ -733,8 +733,8 @@ done: if (vpn_manager) g_object_unref (vpn_manager); - if (named_mgr) - g_object_unref (named_mgr); + if (dns_mgr) + g_object_unref (dns_mgr); if (dhcp_mgr) g_object_unref (dhcp_mgr); diff --git a/src/named-manager/Makefile.am b/src/named-manager/Makefile.am deleted file mode 100644 index a33f7d50a9..0000000000 --- a/src/named-manager/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -INCLUDES = \ - -I${top_srcdir}/src/logging \ - -I${top_srcdir}/libnm-util \ - -I${top_srcdir}/src \ - -I${top_srcdir}/include - -noinst_LTLIBRARIES = libnamed-manager.la - -libnamed_manager_la_SOURCES = nm-named-manager.h nm-named-manager.c - -libnamed_manager_la_CPPFLAGS = \ - $(DBUS_CFLAGS) \ - $(GLIB_CFLAGS) \ - -DNM_PKGDATADIR=\"$(pkgdatadir)\" \ - -DNM_LOCALSTATEDIR=\"$(localstatedir)\" - -libnamed_manager_la_LIBADD = \ - $(top_builddir)/src/logging/libnm-logging.la \ - $(DBUS_LIBS) \ - $(GLIB_LIBS) - diff --git a/src/named-manager/nm-named-manager.c b/src/named-manager/nm-named-manager.c deleted file mode 100644 index aea23b4e3b..0000000000 --- a/src/named-manager/nm-named-manager.c +++ /dev/null @@ -1,883 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* NetworkManager -- Network link manager - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright (C) 2004 - 2005 Colin Walters - * Copyright (C) 2004 - 2010 Red Hat, Inc. - * Copyright (C) 2005 - 2008 Novell, Inc. - * and others - */ - -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "nm-named-manager.h" -#include "nm-ip4-config.h" -#include "nm-ip6-config.h" -#include "nm-logging.h" -#include "nm-system.h" -#include "NetworkManagerUtils.h" - -#ifdef HAVE_SELINUX -#include -#endif - -#ifndef RESOLV_CONF -#define RESOLV_CONF "/etc/resolv.conf" -#endif - -#define ADDR_BUF_LEN 50 - -G_DEFINE_TYPE(NMNamedManager, nm_named_manager, G_TYPE_OBJECT) - -#define NM_NAMED_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ - NM_TYPE_NAMED_MANAGER, \ - NMNamedManagerPrivate)) - - -struct NMNamedManagerPrivate { - NMIP4Config *ip4_vpn_config; - NMIP4Config *ip4_device_config; - NMIP6Config *ip6_vpn_config; - NMIP6Config *ip6_device_config; - GSList *configs; - char *hostname; - - /* This is a hack because SUSE's netconfig always wants changes - * associated with a network interface, but sometimes a change isn't - * associated with a network interface (like hostnames). - */ - char *last_iface; -}; - - -NMNamedManager * -nm_named_manager_get (void) -{ - static NMNamedManager * singleton = NULL; - - if (!singleton) - singleton = NM_NAMED_MANAGER (g_object_new (NM_TYPE_NAMED_MANAGER, NULL)); - else - g_object_ref (singleton); - - g_assert (singleton); - return singleton; -} - - -GQuark -nm_named_manager_error_quark (void) -{ - static GQuark quark = 0; - if (!quark) - quark = g_quark_from_static_string ("nm_named_manager_error"); - - return quark; -} - -typedef struct { - GPtrArray *nameservers; - const char *domain; - GPtrArray *searches; - const char *nis_domain; - GPtrArray *nis_servers; -} NMResolvConfData; - -static void -add_string_item (GPtrArray *array, const char *str) -{ - int i; - - g_return_if_fail (array != NULL); - g_return_if_fail (str != NULL); - - /* Check for dupes before adding */ - for (i = 0; i < array->len; i++) { - const char *candidate = g_ptr_array_index (array, i); - - if (candidate && !strcmp (candidate, str)) - return; - } - - /* No dupes, add the new item */ - g_ptr_array_add (array, g_strdup (str)); -} - -static void -merge_one_ip4_config (NMResolvConfData *rc, NMIP4Config *src) -{ - guint32 num, i; - - num = nm_ip4_config_get_num_nameservers (src); - for (i = 0; i < num; i++) { - struct in_addr addr; - char buf[INET_ADDRSTRLEN]; - - addr.s_addr = nm_ip4_config_get_nameserver (src, i); - if (inet_ntop (AF_INET, &addr, buf, INET_ADDRSTRLEN) > 0) - add_string_item (rc->nameservers, buf); - } - - num = nm_ip4_config_get_num_domains (src); - for (i = 0; i < num; i++) { - const char *domain; - - domain = nm_ip4_config_get_domain (src, i); - if (!rc->domain) - rc->domain = domain; - add_string_item (rc->searches, domain); - } - - num = nm_ip4_config_get_num_searches (src); - for (i = 0; i < num; i++) - add_string_item (rc->searches, nm_ip4_config_get_search (src, i)); - - /* NIS stuff */ - num = nm_ip4_config_get_num_nis_servers (src); - for (i = 0; i < num; i++) { - struct in_addr addr; - char buf[INET_ADDRSTRLEN]; - - addr.s_addr = nm_ip4_config_get_nis_server (src, i); - if (inet_ntop (AF_INET, &addr, buf, INET_ADDRSTRLEN) > 0) - add_string_item (rc->nis_servers, buf); - } - - if (nm_ip4_config_get_nis_domain (src)) { - /* FIXME: handle multiple domains */ - if (!rc->nis_domain) - rc->nis_domain = nm_ip4_config_get_nis_domain (src); - } -} - -static void -merge_one_ip6_config (NMResolvConfData *rc, NMIP6Config *src) -{ - guint32 num, i; - - num = nm_ip6_config_get_num_nameservers (src); - for (i = 0; i < num; i++) { - const struct in6_addr *addr; - char buf[INET6_ADDRSTRLEN]; - - addr = nm_ip6_config_get_nameserver (src, i); - - /* inet_ntop is probably supposed to do this for us, but it doesn't */ - if (IN6_IS_ADDR_V4MAPPED (addr)) { - if (inet_ntop (AF_INET, &(addr->s6_addr32[3]), buf, INET_ADDRSTRLEN) > 0) - add_string_item (rc->nameservers, buf); - } else { - if (inet_ntop (AF_INET6, addr, buf, INET6_ADDRSTRLEN) > 0) - add_string_item (rc->nameservers, buf); - } - } - - num = nm_ip6_config_get_num_domains (src); - for (i = 0; i < num; i++) { - const char *domain; - - domain = nm_ip6_config_get_domain (src, i); - if (!rc->domain) - rc->domain = domain; - add_string_item (rc->searches, domain); - } - - num = nm_ip6_config_get_num_searches (src); - for (i = 0; i < num; i++) - add_string_item (rc->searches, nm_ip6_config_get_search (src, i)); -} - - -#if defined(TARGET_SUSE) -/**********************************/ -/* SUSE */ - -static void -netconfig_child_setup (gpointer user_data G_GNUC_UNUSED) -{ - pid_t pid = getpid (); - setpgid (pid, pid); -} - -static GPid -run_netconfig (GError **error, gint *stdin_fd) -{ - char *argv[5]; - char *tmp; - GPid pid = -1; - - argv[0] = "/sbin/netconfig"; - argv[1] = "modify"; - argv[2] = "--service"; - argv[3] = "NetworkManager"; - argv[4] = NULL; - - tmp = g_strjoinv (" ", argv); - nm_log_dbg (LOGD_DNS, "spawning '%s'", tmp); - g_free (tmp); - - if (!g_spawn_async_with_pipes (NULL, argv, NULL, 0, netconfig_child_setup, - NULL, &pid, stdin_fd, NULL, NULL, error)) - return -1; - - return pid; -} - -static void -write_to_netconfig (gint fd, const char *key, const char *value) -{ - char *str; - int x; - - str = g_strdup_printf ("%s='%s'\n", key, value); - nm_log_dbg (LOGD_DNS, "writing to netconfig: %s", str); - x = write (fd, str, strlen (str)); - g_free (str); -} - -static gboolean -dispatch_netconfig (const char *domain, - char **searches, - char **nameservers, - const char *nis_domain, - char **nis_servers, - const char *iface, - GError **error) -{ - char *str; - GPid pid; - gint fd; - int ret; - - pid = run_netconfig (error, &fd); - if (pid < 0) - return FALSE; - - // FIXME: this is wrong. We are not writing out the iface-specific - // resolv.conf data, we are writing out an already-fully-merged - // resolv.conf. Assuming netconfig works in the obvious way, then - // there are various failure modes, such as, eg, bringing up a VPN on - // eth0, then bringing up wlan0, then bringing down the VPN. Because - // NMNamedManager would have claimed that the VPN DNS server was also - // part of the wlan0 config, it will remain in resolv.conf after the - // VPN goes down, even though it is presumably no longer reachable - // at that point. - write_to_netconfig (fd, "INTERFACE", iface); - - if (searches) { - str = g_strjoinv (" ", searches); - - if (domain) { - char *tmp; - - tmp = g_strconcat (domain, " ", str, NULL); - g_free (str); - str = tmp; - } - - write_to_netconfig (fd, "DNSSEARCH", str); - g_free (str); - } - - if (nameservers) { - str = g_strjoinv (" ", nameservers); - write_to_netconfig (fd, "DNSSERVERS", str); - g_free (str); - } - - if (nis_domain) - write_to_netconfig (fd, "NISDOMAIN", nis_domain); - - if (nis_servers) { - str = g_strjoinv (" ", nis_servers); - write_to_netconfig (fd, "NISSERVERS", str); - g_free (str); - } - - close (fd); - - /* Wait until the process exits */ - - again: - - ret = waitpid (pid, NULL, 0); - if (ret < 0 && errno == EINTR) - goto again; - else if (ret < 0 && errno == ECHILD) { - /* When the netconfig exist, the errno is ECHILD, it should return TRUE */ - return TRUE; - } - - return ret > 0; -} -#endif - - -static gboolean -write_resolv_conf (FILE *f, const char *domain, - char **searches, - char **nameservers, - GError **error) -{ - char *domain_str = NULL; - char *searches_str = NULL; - char *nameservers_str = NULL; - int i; - gboolean retval = FALSE; - - if (fprintf (f, "%s","# Generated by NetworkManager\n") < 0) { - g_set_error (error, - NM_NAMED_MANAGER_ERROR, - NM_NAMED_MANAGER_ERROR_SYSTEM, - "Could not write " RESOLV_CONF ": %s\n", - g_strerror (errno)); - return FALSE; - } - - if (domain) - domain_str = g_strconcat ("domain ", domain, "\n", NULL); - - if (searches) { - char *tmp_str; - - tmp_str = g_strjoinv (" ", searches); - searches_str = g_strconcat ("search ", tmp_str, "\n", NULL); - g_free (tmp_str); - } - - if (nameservers) { - GString *str; - int num; - - str = g_string_new (""); - num = g_strv_length (nameservers); - - for (i = 0; i < num; i++) { - if (i == 3) { - g_string_append (str, "# "); - g_string_append (str, _("NOTE: the libc resolver may not support more than 3 nameservers.")); - g_string_append (str, "\n# "); - g_string_append (str, _("The nameservers listed below may not be recognized.")); - g_string_append_c (str, '\n'); - } - - g_string_append (str, "nameserver "); - g_string_append (str, nameservers[i]); - g_string_append_c (str, '\n'); - } - - nameservers_str = g_string_free (str, FALSE); - } - - if (fprintf (f, "%s%s%s", - domain_str ? domain_str : "", - searches_str ? searches_str : "", - nameservers_str ? nameservers_str : "") != -1) - retval = TRUE; - - g_free (domain_str); - g_free (searches_str); - g_free (nameservers_str); - - return retval; -} - -#ifdef RESOLVCONF_PATH -static gboolean -dispatch_resolvconf (const char *domain, - char **searches, - char **nameservers, - const char *iface, - GError **error) -{ - char *cmd; - FILE *f; - gboolean retval = FALSE; - - if (! g_file_test (RESOLVCONF_PATH, G_FILE_TEST_IS_EXECUTABLE)) - return FALSE; - - if (domain || searches || nameservers) { - cmd = g_strconcat (RESOLVCONF_PATH, " -a ", "NetworkManager", NULL); - nm_log_info (LOGD_DNS, "(%s): writing resolv.conf to %s", iface, RESOLVCONF_PATH); - if ((f = popen (cmd, "w")) == NULL) - g_set_error (error, - NM_NAMED_MANAGER_ERROR, - NM_NAMED_MANAGER_ERROR_SYSTEM, - "Could not write to %s: %s\n", - RESOLVCONF_PATH, - g_strerror (errno)); - else { - retval = write_resolv_conf (f, domain, searches, nameservers, error); - retval &= (pclose (f) == 0); - } - } else { - cmd = g_strconcat (RESOLVCONF_PATH, " -d ", "NetworkManager", NULL); - nm_log_info (LOGD_DNS, "(%s): removing resolv.conf from %s", iface, RESOLVCONF_PATH); - if (nm_spawn_process (cmd) == 0) - retval = TRUE; - } - - g_free (cmd); - - return retval; -} -#endif - -static gboolean -update_resolv_conf (const char *domain, - char **searches, - char **nameservers, - const char *iface, - GError **error) -{ - char *tmp_resolv_conf; - char *tmp_resolv_conf_realpath; - char *resolv_conf_realpath; - FILE *f; - int do_rename = 1; - int old_errno = 0; - - g_return_val_if_fail (error != NULL, FALSE); - - /* Find the real path of resolv.conf; it could be a symlink to something */ - resolv_conf_realpath = realpath (RESOLV_CONF, NULL); - if (!resolv_conf_realpath) - resolv_conf_realpath = strdup (RESOLV_CONF); - - /* Build up the real path for the temp resolv.conf that we're about to - * write out. - */ - tmp_resolv_conf = g_strdup_printf ("%s.tmp", resolv_conf_realpath); - tmp_resolv_conf_realpath = realpath (tmp_resolv_conf, NULL); - if (!tmp_resolv_conf_realpath) - tmp_resolv_conf_realpath = strdup (tmp_resolv_conf); - g_free (tmp_resolv_conf); - tmp_resolv_conf = NULL; - - if ((f = fopen (tmp_resolv_conf_realpath, "w")) == NULL) { - do_rename = 0; - old_errno = errno; - if ((f = fopen (RESOLV_CONF, "w")) == NULL) { - g_set_error (error, - NM_NAMED_MANAGER_ERROR, - NM_NAMED_MANAGER_ERROR_SYSTEM, - "Could not open %s: %s\nCould not open %s: %s\n", - tmp_resolv_conf_realpath, - g_strerror (old_errno), - RESOLV_CONF, - g_strerror (errno)); - goto out; - } - /* Update tmp_resolv_conf_realpath so the error message on fclose() - * failure will be correct. - */ - strcpy (tmp_resolv_conf_realpath, RESOLV_CONF); - } - - write_resolv_conf (f, domain, searches, nameservers, error); - - if (fclose (f) < 0) { - if (*error == NULL) { - /* only set an error here if write_resolv_conf() was successful, - * since its error is more important. - */ - g_set_error (error, - NM_NAMED_MANAGER_ERROR, - NM_NAMED_MANAGER_ERROR_SYSTEM, - "Could not close %s: %s\n", - tmp_resolv_conf_realpath, - g_strerror (errno)); - } - } - - /* Don't rename the tempfile over top of the existing resolv.conf if there - * was an error writing it out. - */ - if (*error == NULL && do_rename) { - if (rename (tmp_resolv_conf_realpath, resolv_conf_realpath) < 0) { - g_set_error (error, - NM_NAMED_MANAGER_ERROR, - NM_NAMED_MANAGER_ERROR_SYSTEM, - "Could not replace " RESOLV_CONF ": %s\n", - g_strerror (errno)); - } - } - -out: - free (tmp_resolv_conf_realpath); - free (resolv_conf_realpath); - return *error ? FALSE : TRUE; -} - -static gboolean -rewrite_resolv_conf (NMNamedManager *mgr, const char *iface, GError **error) -{ - NMNamedManagerPrivate *priv; - NMResolvConfData rc; - GSList *iter; - const char *domain = NULL; - const char *nis_domain = NULL; - char **searches = NULL; - char **nameservers = NULL; - char **nis_servers = NULL; - int num, i, len; - gboolean success = FALSE; - - g_return_val_if_fail (error != NULL, FALSE); - g_return_val_if_fail (*error == NULL, FALSE); - - priv = NM_NAMED_MANAGER_GET_PRIVATE (mgr); - - if (iface) { - g_free (priv->last_iface); - priv->last_iface = g_strdup (iface); - } - - rc.nameservers = g_ptr_array_new (); - rc.domain = NULL; - rc.searches = g_ptr_array_new (); - rc.nis_servers = g_ptr_array_new (); - - if (priv->ip4_vpn_config) - merge_one_ip4_config (&rc, priv->ip4_vpn_config); - if (priv->ip4_device_config) - merge_one_ip4_config (&rc, priv->ip4_device_config); - - if (priv->ip6_vpn_config) - merge_one_ip6_config (&rc, priv->ip6_vpn_config); - if (priv->ip6_device_config) - merge_one_ip6_config (&rc, priv->ip6_device_config); - - for (iter = priv->configs; iter; iter = g_slist_next (iter)) { - if ( (iter->data == priv->ip4_vpn_config) - || (iter->data == priv->ip4_device_config) - || (iter->data == priv->ip6_vpn_config) - || (iter->data == priv->ip6_device_config)) - continue; - - if (NM_IS_IP4_CONFIG (iter->data)) { - NMIP4Config *config = NM_IP4_CONFIG (iter->data); - - merge_one_ip4_config (&rc, config); - } else if (NM_IS_IP6_CONFIG (iter->data)) { - NMIP6Config *config = NM_IP6_CONFIG (iter->data); - - merge_one_ip6_config (&rc, config); - } else - g_assert_not_reached (); - } - - /* Add the current domain name (from the hostname) to the searches list; - * see rh #600407. The bug report is that when the hostname is set to - * something like 'dcbw.foobar.com' (ie an FQDN) that pinging 'dcbw' doesn't - * work because the resolver doesn't have anything to append to 'dcbw' when - * looking it up. - */ - if (priv->hostname) { - const char *hostsearch = strchr (priv->hostname, '.'); - - /* +1 to get rid of the dot */ - if (hostsearch && strlen (hostsearch + 1)) - add_string_item (rc.searches, hostsearch + 1); - } - - domain = rc.domain; - - /* Per 'man resolv.conf', the search list is limited to 6 domains - * totalling 256 characters. - */ - num = MIN (rc.searches->len, 6); - for (i = 0, len = 0; i < num; i++) { - len += strlen (rc.searches->pdata[i]) + 1; /* +1 for spaces */ - if (len > 256) - break; - } - g_ptr_array_set_size (rc.searches, i); - if (rc.searches->len) { - g_ptr_array_add (rc.searches, NULL); - searches = (char **) g_ptr_array_free (rc.searches, FALSE); - } else - g_ptr_array_free (rc.searches, TRUE); - - if (rc.nameservers->len) { - g_ptr_array_add (rc.nameservers, NULL); - nameservers = (char **) g_ptr_array_free (rc.nameservers, FALSE); - } else - g_ptr_array_free (rc.nameservers, TRUE); - - if (rc.nis_servers->len) { - g_ptr_array_add (rc.nis_servers, NULL); - nis_servers = (char **) g_ptr_array_free (rc.nis_servers, FALSE); - } else - g_ptr_array_free (rc.nis_servers, TRUE); - - nis_domain = rc.nis_domain; - -#ifdef RESOLVCONF_PATH - success = dispatch_resolvconf (domain, searches, nameservers, iface, error); -#endif - -#ifdef TARGET_SUSE - if (success == FALSE) { - success = dispatch_netconfig (domain, searches, nameservers, - nis_domain, nis_servers, - iface, error); - } -#endif - - if (success == FALSE) - success = update_resolv_conf (domain, searches, nameservers, iface, error); - - if (success) - nm_system_update_dns (); - - if (searches) - g_strfreev (searches); - if (nameservers) - g_strfreev (nameservers); - if (nis_servers) - g_strfreev (nis_servers); - - return success; -} - -gboolean -nm_named_manager_add_ip4_config (NMNamedManager *mgr, - const char *iface, - NMIP4Config *config, - NMNamedIPConfigType cfg_type) -{ - NMNamedManagerPrivate *priv; - GError *error = NULL; - - g_return_val_if_fail (mgr != NULL, FALSE); - g_return_val_if_fail (iface != NULL, FALSE); - g_return_val_if_fail (config != NULL, FALSE); - - priv = NM_NAMED_MANAGER_GET_PRIVATE (mgr); - - switch (cfg_type) { - case NM_NAMED_IP_CONFIG_TYPE_VPN: - priv->ip4_vpn_config = config; - break; - case NM_NAMED_IP_CONFIG_TYPE_BEST_DEVICE: - priv->ip4_device_config = config; - break; - default: - break; - } - - /* Don't allow the same zone added twice */ - if (!g_slist_find (priv->configs, config)) - priv->configs = g_slist_append (priv->configs, g_object_ref (config)); - - if (!rewrite_resolv_conf (mgr, iface, &error)) { - nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); - g_error_free (error); - } - - return TRUE; -} - -gboolean -nm_named_manager_remove_ip4_config (NMNamedManager *mgr, - const char *iface, - NMIP4Config *config) -{ - NMNamedManagerPrivate *priv; - GError *error = NULL; - - g_return_val_if_fail (mgr != NULL, FALSE); - g_return_val_if_fail (iface != NULL, FALSE); - g_return_val_if_fail (config != NULL, FALSE); - - priv = NM_NAMED_MANAGER_GET_PRIVATE (mgr); - - /* Can't remove it if it wasn't in the list to begin with */ - if (!g_slist_find (priv->configs, config)) - return FALSE; - - priv->configs = g_slist_remove (priv->configs, config); - - if (config == priv->ip4_vpn_config) - priv->ip4_vpn_config = NULL; - if (config == priv->ip4_device_config) - priv->ip4_device_config = NULL; - - g_object_unref (config); - - if (!rewrite_resolv_conf (mgr, iface, &error)) { - nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); - if (error) - g_error_free (error); - } - - return TRUE; -} - -gboolean -nm_named_manager_add_ip6_config (NMNamedManager *mgr, - const char *iface, - NMIP6Config *config, - NMNamedIPConfigType cfg_type) -{ - NMNamedManagerPrivate *priv; - GError *error = NULL; - - g_return_val_if_fail (mgr != NULL, FALSE); - g_return_val_if_fail (iface != NULL, FALSE); - g_return_val_if_fail (config != NULL, FALSE); - - priv = NM_NAMED_MANAGER_GET_PRIVATE (mgr); - - switch (cfg_type) { - case NM_NAMED_IP_CONFIG_TYPE_VPN: - /* FIXME: not quite yet... */ - g_return_val_if_fail (cfg_type != NM_NAMED_IP_CONFIG_TYPE_VPN, FALSE); - priv->ip6_vpn_config = config; - break; - case NM_NAMED_IP_CONFIG_TYPE_BEST_DEVICE: - priv->ip6_device_config = config; - break; - default: - break; - } - - /* Don't allow the same zone added twice */ - if (!g_slist_find (priv->configs, config)) - priv->configs = g_slist_append (priv->configs, g_object_ref (config)); - - if (!rewrite_resolv_conf (mgr, iface, &error)) { - nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); - g_error_free (error); - } - - return TRUE; -} - -gboolean -nm_named_manager_remove_ip6_config (NMNamedManager *mgr, - const char *iface, - NMIP6Config *config) -{ - NMNamedManagerPrivate *priv; - GError *error = NULL; - - g_return_val_if_fail (mgr != NULL, FALSE); - g_return_val_if_fail (iface != NULL, FALSE); - g_return_val_if_fail (config != NULL, FALSE); - - priv = NM_NAMED_MANAGER_GET_PRIVATE (mgr); - - /* Can't remove it if it wasn't in the list to begin with */ - if (!g_slist_find (priv->configs, config)) - return FALSE; - - priv->configs = g_slist_remove (priv->configs, config); - - if (config == priv->ip6_vpn_config) - priv->ip6_vpn_config = NULL; - if (config == priv->ip6_device_config) - priv->ip6_device_config = NULL; - - g_object_unref (config); - - if (!rewrite_resolv_conf (mgr, iface, &error)) { - nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); - if (error) - g_error_free (error); - } - - return TRUE; -} - -void -nm_named_manager_set_hostname (NMNamedManager *mgr, - const char *hostname) -{ - NMNamedManagerPrivate *priv = NM_NAMED_MANAGER_GET_PRIVATE (mgr); - GError *error = NULL; - const char *filtered = NULL; - - /* Certain hostnames we don't want to include in resolv.conf 'searches' */ - if ( hostname - && strcmp (hostname, "localhost.localdomain") - && strcmp (hostname, "localhost6.localdomain6") - && !strstr (hostname, ".in-addr.arpa") - && strchr (hostname, '.')) { - filtered = hostname; - } - - if ( (!priv->hostname && !filtered) - || (priv->hostname && filtered && !strcmp (priv->hostname, filtered))) - return; - - g_free (priv->hostname); - priv->hostname = g_strdup (filtered); - - /* Passing the last interface here is completely bogus, but SUSE's netconfig - * wants one. But hostname changes are system-wide and *not* tied to a - * specific interface, so netconfig can't really handle this. Fake it. - */ - if (!rewrite_resolv_conf (mgr, priv->last_iface, &error)) { - nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); - g_clear_error (&error); - } -} - - -static void -nm_named_manager_init (NMNamedManager *mgr) -{ -} - -static void -nm_named_manager_finalize (GObject *object) -{ - NMNamedManagerPrivate *priv = NM_NAMED_MANAGER_GET_PRIVATE (object); - - g_slist_foreach (priv->configs, (GFunc) g_object_unref, NULL); - g_slist_free (priv->configs); - g_free (priv->hostname); - g_free (priv->last_iface); - - G_OBJECT_CLASS (nm_named_manager_parent_class)->finalize (object); -} - -static void -nm_named_manager_class_init (NMNamedManagerClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - object_class->finalize = nm_named_manager_finalize; - - g_type_class_add_private (object_class, sizeof (NMNamedManagerPrivate)); -} - diff --git a/src/named-manager/nm-named-manager.h b/src/named-manager/nm-named-manager.h deleted file mode 100644 index 27d5bc259d..0000000000 --- a/src/named-manager/nm-named-manager.h +++ /dev/null @@ -1,95 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* NetworkManager -- Network link manager - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright (C) 2004 - 2005 Colin Walters - * Copyright (C) 2004 - 2010 Red Hat, Inc. - * Copyright (C) 2005 - 2008 Novell, Inc. - * and others - */ - -#ifndef __NM_NAMED_MANAGER_H__ -#define __NM_NAMED_MANAGER_H__ - -#include "config.h" -#include -#include -#include "nm-ip4-config.h" -#include "nm-ip6-config.h" - -typedef enum { - NM_NAMED_MANAGER_ERROR_SYSTEM, - NM_NAMED_MANAGER_ERROR_INVALID_NAMESERVER, - NM_NAMED_MANAGER_ERROR_INVALID_HOST, - NM_NAMED_MANAGER_ERROR_INVALID_ID -} NMNamedManagerError; - -typedef enum { - NM_NAMED_IP_CONFIG_TYPE_DEFAULT = 0, - NM_NAMED_IP_CONFIG_TYPE_BEST_DEVICE, - NM_NAMED_IP_CONFIG_TYPE_VPN -} NMNamedIPConfigType; - -#define NM_NAMED_MANAGER_ERROR nm_named_manager_error_quark () -GQuark nm_named_manager_error_quark (void); - -G_BEGIN_DECLS - -#define NM_TYPE_NAMED_MANAGER (nm_named_manager_get_type ()) -#define NM_NAMED_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NM_TYPE_NAMED_MANAGER, NMNamedManager)) -#define NM_NAMED_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), NM_TYPE_NAMED_MANAGER, NMNamedManagerClass)) -#define NM_IS_NAMED_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), NM_TYPE_NAMED_MANAGER)) -#define NM_IS_NAMED_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), NM_TYPE_NAMED_MANAGER)) -#define NM_NAMED_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), NM_TYPE_NAMED_MANAGER, NMNamedManagerClass)) - -typedef struct NMNamedManagerPrivate NMNamedManagerPrivate; - -typedef struct { - GObject parent; -} NMNamedManager; - -typedef struct { - GObjectClass parent; -} NMNamedManagerClass; - -GType nm_named_manager_get_type (void); - -NMNamedManager * nm_named_manager_get (void); - -gboolean nm_named_manager_add_ip4_config (NMNamedManager *mgr, - const char *iface, - NMIP4Config *config, - NMNamedIPConfigType cfg_type); - -gboolean nm_named_manager_remove_ip4_config (NMNamedManager *mgr, - const char *iface, - NMIP4Config *config); - -gboolean nm_named_manager_add_ip6_config (NMNamedManager *mgr, - const char *iface, - NMIP6Config *config, - NMNamedIPConfigType cfg_type); - -gboolean nm_named_manager_remove_ip6_config (NMNamedManager *mgr, - const char *iface, - NMIP6Config *config); - -void nm_named_manager_set_hostname (NMNamedManager *mgr, - const char *hostname); - -G_END_DECLS - -#endif /* __NM_NAMED_MANAGER_H__ */ diff --git a/src/nm-device.c b/src/nm-device.c index 9e8ccdf296..ad1976b03c 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -42,7 +42,7 @@ #include "nm-system.h" #include "nm-dhcp-manager.h" #include "nm-dbus-manager.h" -#include "nm-named-manager.h" +#include "nm-dns-manager.h" #include "nm-utils.h" #include "nm-logging.h" #include "nm-netlink-monitor.h" @@ -3021,7 +3021,7 @@ nm_device_set_ip4_config (NMDevice *self, NMIP4Config *old_config = NULL; gboolean success = TRUE; NMIP4ConfigCompareFlags diff = NM_IP4_COMPARE_FLAG_ALL; - NMNamedManager *named_mgr; + NMDnsManager *dns_mgr; g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); g_return_val_if_fail (reason != NULL, FALSE); @@ -3038,10 +3038,10 @@ nm_device_set_ip4_config (NMDevice *self, if (diff == NM_IP4_COMPARE_FLAG_NONE) return TRUE; - named_mgr = nm_named_manager_get (); + dns_mgr = nm_dns_manager_get (); if (old_config) { - /* Remove any previous IP4 Config from the named manager */ - nm_named_manager_remove_ip4_config (named_mgr, ip_iface, old_config); + /* Remove any previous IP4 Config from the DNS manager */ + nm_dns_manager_remove_ip4_config (dns_mgr, ip_iface, old_config); g_object_unref (old_config); priv->ip4_config = NULL; } @@ -3060,13 +3060,13 @@ nm_device_set_ip4_config (NMDevice *self, if (!nm_ip4_config_get_dbus_path (new_config)) nm_ip4_config_export (new_config); - /* Add the DNS information to the named manager */ - nm_named_manager_add_ip4_config (named_mgr, ip_iface, new_config, NM_NAMED_IP_CONFIG_TYPE_DEFAULT); + /* Add the DNS information to the DNS manager */ + nm_dns_manager_add_ip4_config (dns_mgr, ip_iface, new_config, NM_DNS_IP_CONFIG_TYPE_DEFAULT); nm_device_update_ip4_address (self); } } - g_object_unref (named_mgr); + g_object_unref (dns_mgr); g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_IP4_CONFIG); @@ -3124,7 +3124,7 @@ nm_device_set_ip6_config (NMDevice *self, NMIP6Config *old_config = NULL; gboolean success = TRUE; NMIP6ConfigCompareFlags diff = NM_IP6_COMPARE_FLAG_ALL; - NMNamedManager *named_mgr; + NMDnsManager *dns_mgr; g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); g_return_val_if_fail (reason != NULL, FALSE); @@ -3141,10 +3141,10 @@ nm_device_set_ip6_config (NMDevice *self, if (diff == NM_IP6_COMPARE_FLAG_NONE) return TRUE; - named_mgr = nm_named_manager_get (); + dns_mgr = nm_dns_manager_get (); if (old_config) { - /* Remove any previous IP6 Config from the named manager */ - nm_named_manager_remove_ip6_config (named_mgr, ip_iface, old_config); + /* Remove any previous IP6 Config from the DNS manager */ + nm_dns_manager_remove_ip6_config (dns_mgr, ip_iface, old_config); g_object_unref (old_config); priv->ip6_config = NULL; } @@ -3163,11 +3163,11 @@ nm_device_set_ip6_config (NMDevice *self, if (!nm_ip6_config_get_dbus_path (new_config)) nm_ip6_config_export (new_config); - /* Add the DNS information to the named manager */ - nm_named_manager_add_ip6_config (named_mgr, ip_iface, new_config, NM_NAMED_IP_CONFIG_TYPE_DEFAULT); + /* Add the DNS information to the DNS manager */ + nm_dns_manager_add_ip6_config (dns_mgr, ip_iface, new_config, NM_DNS_IP_CONFIG_TYPE_DEFAULT); } } - g_object_unref (named_mgr); + g_object_unref (dns_mgr); g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_IP6_CONFIG); diff --git a/src/nm-policy.c b/src/nm-policy.c index 410a9bfc3d..28864a8780 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -39,7 +39,7 @@ #include "nm-setting-ip4-config.h" #include "nm-setting-connection.h" #include "nm-system.h" -#include "nm-named-manager.h" +#include "nm-dns-manager.h" #include "nm-vpn-manager.h" #include "nm-policy-hosts.h" #include "nm-policy-hostname.h" @@ -236,14 +236,14 @@ _set_hostname (NMPolicy *policy, char ip6_addr[INET6_ADDRSTRLEN + 1]; if (change_hostname) { - NMNamedManager *named_mgr; + NMDnsManager *dns_mgr; g_free (policy->cur_hostname); policy->cur_hostname = g_strdup (new_hostname); - named_mgr = nm_named_manager_get (); - nm_named_manager_set_hostname (named_mgr, policy->cur_hostname); - g_object_unref (named_mgr); + dns_mgr = nm_dns_manager_get (); + nm_dns_manager_set_hostname (dns_mgr, policy->cur_hostname); + g_object_unref (dns_mgr); } /* Get the default IPv4 and IPv6 addresses so we can assign @@ -453,10 +453,10 @@ update_system_hostname (NMPolicy *policy, NMDevice *best4, NMDevice *best6) static void update_ip4_routing_and_dns (NMPolicy *policy, gboolean force_update) { - NMNamedIPConfigType dns_type = NM_NAMED_IP_CONFIG_TYPE_BEST_DEVICE; + NMDnsIPConfigType dns_type = NM_DNS_IP_CONFIG_TYPE_BEST_DEVICE; NMDevice *best = NULL; NMActRequest *best_req = NULL; - NMNamedManager *named_mgr; + NMDnsManager *dns_mgr; GSList *devices = NULL, *iter, *vpns; NMIP4Config *ip4_config = NULL; NMIP4Address *addr; @@ -513,7 +513,7 @@ update_ip4_routing_and_dns (NMPolicy *policy, gboolean force_update) nm_device_get_ip_iface (parent), nm_ip4_config_get_mss (parent_ip4)); - dns_type = NM_NAMED_IP_CONFIG_TYPE_VPN; + dns_type = NM_DNS_IP_CONFIG_TYPE_VPN; } g_object_unref (candidate); } @@ -529,7 +529,7 @@ update_ip4_routing_and_dns (NMPolicy *policy, gboolean force_update) nm_system_replace_default_ip4_route (ip_iface, nm_ip4_address_get_gateway (addr), nm_ip4_config_get_mss (ip4_config)); - dns_type = NM_NAMED_IP_CONFIG_TYPE_BEST_DEVICE; + dns_type = NM_DNS_IP_CONFIG_TYPE_BEST_DEVICE; } if (!ip_iface || !ip4_config) { @@ -553,9 +553,9 @@ update_ip4_routing_and_dns (NMPolicy *policy, gboolean force_update) nm_act_request_set_default (req, FALSE); } - named_mgr = nm_named_manager_get (); - nm_named_manager_add_ip4_config (named_mgr, ip_iface, ip4_config, dns_type); - g_object_unref (named_mgr); + dns_mgr = nm_dns_manager_get (); + nm_dns_manager_add_ip4_config (dns_mgr, ip_iface, ip4_config, dns_type); + g_object_unref (dns_mgr); /* Now set new default active connection _after_ updating DNS info, so that * if the connection is shared dnsmasq picks up the right stuff. @@ -580,10 +580,10 @@ out: static void update_ip6_routing_and_dns (NMPolicy *policy, gboolean force_update) { - NMNamedIPConfigType dns_type = NM_NAMED_IP_CONFIG_TYPE_BEST_DEVICE; + NMDnsIPConfigType dns_type = NM_DNS_IP_CONFIG_TYPE_BEST_DEVICE; NMDevice *best = NULL; NMActRequest *best_req = NULL; - NMNamedManager *named_mgr; + NMDnsManager *dns_mgr; GSList *devices = NULL, *iter; #if NOT_YET GSList *vpns; @@ -638,7 +638,7 @@ update_ip6_routing_and_dns (NMPolicy *policy, gboolean force_update) nm_device_get_ip_iface (parent), nm_ip6_config_get_mss (parent_ip4)); - dns_type = NM_NAMED_IP_CONFIG_TYPE_VPN; + dns_type = NM_DNS_IP_CONFIG_TYPE_VPN; } g_object_unref (candidate); } @@ -655,7 +655,7 @@ update_ip6_routing_and_dns (NMPolicy *policy, gboolean force_update) nm_system_replace_default_ip6_route (ip_iface, nm_ip6_address_get_gateway (addr)); - dns_type = NM_NAMED_IP_CONFIG_TYPE_BEST_DEVICE; + dns_type = NM_DNS_IP_CONFIG_TYPE_BEST_DEVICE; } if (!ip_iface || !ip6_config) { @@ -679,9 +679,9 @@ update_ip6_routing_and_dns (NMPolicy *policy, gboolean force_update) nm_act_request_set_default6 (req, FALSE); } - named_mgr = nm_named_manager_get (); - nm_named_manager_add_ip6_config (named_mgr, ip_iface, ip6_config, dns_type); - g_object_unref (named_mgr); + dns_mgr = nm_dns_manager_get (); + nm_dns_manager_add_ip6_config (dns_mgr, ip_iface, ip6_config, dns_type); + g_object_unref (dns_mgr); /* Now set new default active connection _after_ updating DNS info, so that * if the connection is shared dnsmasq picks up the right stuff. diff --git a/src/nm-system.c b/src/nm-system.c index 24c31c2772..0911b82182 100644 --- a/src/nm-system.c +++ b/src/nm-system.c @@ -44,7 +44,6 @@ #include "nm-system.h" #include "nm-device.h" -#include "nm-named-manager.h" #include "NetworkManagerUtils.h" #include "nm-utils.h" #include "nm-logging.h" diff --git a/src/supplicant-manager/Makefile.am b/src/supplicant-manager/Makefile.am index e59ae84319..359fc70ae5 100644 --- a/src/supplicant-manager/Makefile.am +++ b/src/supplicant-manager/Makefile.am @@ -5,8 +5,7 @@ INCLUDES = \ -I${top_srcdir}/src/logging \ -I${top_srcdir}/include \ -I${top_srcdir}/libnm-util \ - -I${top_builddir}/marshallers \ - -I${top_srcdir}/src/named-manager + -I${top_builddir}/marshallers noinst_LTLIBRARIES = libsupplicant-manager.la diff --git a/src/vpn-manager/Makefile.am b/src/vpn-manager/Makefile.am index 2d755128da..b0692d70c3 100644 --- a/src/vpn-manager/Makefile.am +++ b/src/vpn-manager/Makefile.am @@ -5,7 +5,7 @@ INCLUDES = \ -I${top_srcdir}/src/logging \ -I${top_srcdir}/src \ -I${top_builddir}/marshallers \ - -I${top_srcdir}/src/named-manager \ + -I${top_srcdir}/src/dns-manager \ -DVPN_NAME_FILES_DIR=\""$(sysconfdir)/NetworkManager/VPN"\" diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c index 227932adc5..d496e48ee3 100644 --- a/src/vpn-manager/nm-vpn-connection.c +++ b/src/vpn-manager/nm-vpn-connection.c @@ -44,7 +44,7 @@ #include "nm-properties-changed-signal.h" #include "nm-dbus-glib-types.h" #include "NetworkManagerUtils.h" -#include "nm-named-manager.h" +#include "nm-dns-manager.h" #include "nm-netlink-monitor.h" #include "nm-glib-compat.h" @@ -543,15 +543,15 @@ nm_vpn_connection_ip4_config_get (DBusGProxy *proxy, nm_system_device_set_up_down_with_iface (priv->ip_iface, TRUE, NULL); if (nm_system_apply_ip4_config (priv->ip_iface, config, 0, NM_IP4_COMPARE_FLAG_ALL)) { - NMNamedManager *named_mgr; + NMDnsManager *dns_mgr; /* Add any explicit route to the VPN gateway through the parent device */ priv->gw_route = nm_system_add_ip4_vpn_gateway_route (priv->parent_dev, config); /* Add the VPN to DNS */ - named_mgr = nm_named_manager_get (); - nm_named_manager_add_ip4_config (named_mgr, priv->ip_iface, config, NM_NAMED_IP_CONFIG_TYPE_VPN); - g_object_unref (named_mgr); + dns_mgr = nm_dns_manager_get (); + nm_dns_manager_add_ip4_config (dns_mgr, priv->ip_iface, config, NM_DNS_IP_CONFIG_TYPE_VPN); + g_object_unref (dns_mgr); priv->ip4_config = config; @@ -899,12 +899,12 @@ vpn_cleanup (NMVPNConnection *connection) if (priv->ip4_config) { NMIP4Config *parent_config; - NMNamedManager *named_mgr; + NMDnsManager *dns_mgr; /* Remove attributes of the VPN's IP4 Config */ - named_mgr = nm_named_manager_get (); - nm_named_manager_remove_ip4_config (named_mgr, priv->ip_iface, priv->ip4_config); - g_object_unref (named_mgr); + dns_mgr = nm_dns_manager_get (); + nm_dns_manager_remove_ip4_config (dns_mgr, priv->ip_iface, priv->ip4_config); + g_object_unref (dns_mgr); /* Remove any previously added VPN gateway host route */ if (priv->gw_route) -- cgit v1.2.1 From e8d294232087fd5486b9b63c1ab0286d8a5baccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Thu, 9 Sep 2010 14:22:34 +0200 Subject: man: nmcli man page update - added ENVIRONMENT VARIABLES section --- man/nmcli.1.in | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/man/nmcli.1.in b/man/nmcli.1.in index 260d076516..2fc99dc87b 100644 --- a/man/nmcli.1.in +++ b/man/nmcli.1.in @@ -22,7 +22,7 @@ .\" .\" Copyright (C) 2010 Red Hat, Inc. .\" -.TH NMCLI "1" "26 August 2010" +.TH NMCLI "1" "9 September 2010" .SH NAME nmcli \- command-line tool for controlling NetworkManager @@ -312,6 +312,32 @@ No simple reference. .fi .RE +.SH ENVIRONMENT VARIABLES +\fInmcli\fP's behavior is affected by the following environment variables. +.IP "LC_ALL" 13 +If set to a non-empty string value, override the values of all the other +internationalization variables. +.IP "LC_MESSAGES" 13 +Determines the locale to be used for internationalised messages. +.IP "LANG" 13 +Provides a default value for the internationalization variables that are unset +or null. + +.RE +Notes about localization: +.br +Be aware that \fInmcli\fP is localized and that's why the output depends on +your environment. It's important to realize that especially when you parse the +output. +.br +Call \fInmcli\fP as \fBLC_ALL=C nmcli\fP to be sure the locale is +set to "C" while executing in a script. + +\fBLC_ALL\fP, \fBLC_MESSAGES\fP, \fBLANG\fP variables specify the LC_MESSAGES +locale category (in that order), which determines the language that \fInmcli\fP +uses for messages. The "C" locale is used if none of these variables are set, +and this locale uses English messages. + .SH EXIT STATUS \fInmcli\fP exits with status 0 if it succeeds, a value greater than 0 is returned if errors occur. .IP "0" 4 -- cgit v1.2.1 From 64b6cd1ebc4d8449b824616d6b25bcb677e9cc18 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 9 Sep 2010 17:14:20 -0500 Subject: core: add DNS plugin config options --- man/NetworkManager.conf.5.in | 34 ++++++++++-- src/dns-manager/nm-dns-manager.c | 108 +++++++++++++++++++++++++++--------- src/dns-manager/nm-dns-manager.h | 2 +- src/main.c | 12 ++-- src/nm-device.c | 4 +- src/nm-policy.c | 6 +- src/vpn-manager/nm-vpn-connection.c | 4 +- 7 files changed, 126 insertions(+), 44 deletions(-) diff --git a/man/NetworkManager.conf.5.in b/man/NetworkManager.conf.5.in index c3af611675..fca2a4dbb4 100644 --- a/man/NetworkManager.conf.5.in +++ b/man/NetworkManager.conf.5.in @@ -44,12 +44,13 @@ Description of sections and available keys follows: This section is the only mandatory section of the configuration file. .TP .B plugins=\fIplugin1\fP,\fIplugin2\fP, ... -List plugin names separated by ','. Plugins are used to read/write system-wide -connection. When more plugins are specified, the connections are read from all -listed plugins. When writing connections, the plugins will be asked to save the -connection in the order listed here. If the first plugin cannot write out that -connection type, or can't write out any connections, the next plugin is tried. -If none of the plugins can save the connection, the error is returned to the user. +List system settings plugin names separated by ','. These plugins are used to +read/write system-wide connection. When more plugins are specified, the +connections are read from all listed plugins. When writing connections, the +plugins will be asked to save the connection in the order listed here. If the +first plugin cannot write out that connection type, or can't write out any +connections, the next plugin is tried. If none of the plugins can save the +connection, the error is returned to the user. .P .RS .B "Available plugins:" @@ -87,6 +88,27 @@ This key sets up what DHCP client NetworkManager will use. Presently \fIdhclient\fP and \fIdhcpcd\fP are supported. The client configured here should be available on your system too. If this key is missing, available DHCP clients are looked for in this order: dhclient, dhcpcd. +.TP +.B dns=\fIplugin1\fP,\fIplugin2\fP, ... +List DNS plugin names separated by ','. DNS plugins are used to provide local +caching nameserver functionality (which speeds up DNS queries) and to push +DNS data to applications that use it. +.P +.RS +.B "Available plugins:" +.br +.TP +.I dnsmasq +this plugin uses dnsmasq to provide local caching nameserver functionality. +.TP +.I bind +this plugin uses the ISC BIND program to provide local caching nameserver +functionality. +.TP +.I chromium +this plugin provides DNS information to the Chromium web browser. It does not +provide local caching nameserver functionality. +.RE .SS [keyfile] This section contains keyfile-specific options and thus only has effect when using \fIkeyfile\fP plugin. .TP diff --git a/src/dns-manager/nm-dns-manager.c b/src/dns-manager/nm-dns-manager.c index 6b4b67543c..c3a0a4ff45 100644 --- a/src/dns-manager/nm-dns-manager.c +++ b/src/dns-manager/nm-dns-manager.c @@ -59,7 +59,6 @@ G_DEFINE_TYPE(NMDnsManager, nm_dns_manager, G_TYPE_OBJECT) NM_TYPE_DNS_MANAGER, \ NMDnsManagerPrivate)) - struct NMDnsManagerPrivate { NMIP4Config *ip4_vpn_config; NMIP4Config *ip4_device_config; @@ -68,6 +67,8 @@ struct NMDnsManagerPrivate { GSList *configs; char *hostname; + GSList *plugins; + /* This is a hack because SUSE's netconfig always wants changes * associated with a network interface, but sometimes a change isn't * associated with a network interface (like hostnames). @@ -76,31 +77,6 @@ struct NMDnsManagerPrivate { }; -NMDnsManager * -nm_dns_manager_get (void) -{ - static NMDnsManager * singleton = NULL; - - if (!singleton) - singleton = NM_DNS_MANAGER (g_object_new (NM_TYPE_DNS_MANAGER, NULL)); - else - g_object_ref (singleton); - - g_assert (singleton); - return singleton; -} - - -GQuark -nm_dns_manager_error_quark (void) -{ - static GQuark quark = 0; - if (!quark) - quark = g_quark_from_static_string ("nm_dns_manager_error"); - - return quark; -} - typedef struct { GPtrArray *nameservers; const char *domain; @@ -852,6 +828,83 @@ nm_dns_manager_set_hostname (NMDnsManager *mgr, } } +static GObject * +nm_dns_dnsmasq_new (void) +{ + return NULL; +} + +static GObject * +nm_dns_bind_new (void) +{ + return NULL; +} + +static GObject * +nm_dns_chromium_new (void) +{ + return NULL; +} + +static void +load_plugins (NMDnsManager *self, const char **plugins) +{ + NMDnsManagerPrivate *priv = NM_DNS_MANAGER_GET_PRIVATE (self); + GObject *plugin; + const char **iter; + + if (plugins && *plugins) { + /* Create each configured plugin */ + for (iter = plugins; iter && *iter; iter++) { + if (!strcasecmp (*iter, "dnsmasq")) + plugin = nm_dns_dnsmasq_new (); + else if (!strcasecmp (*iter, "bind")) + plugin = nm_dns_bind_new (); + else if (!strcasecmp (*iter, "chromium")) + plugin = nm_dns_chromium_new (); + else { + nm_log_warn (LOGD_DNS, "Unknown DNS plugin '%s'", *iter); + } + + if (plugin) + priv->plugins = g_slist_append (priv->plugins, plugin); + } + } else { + /* Create default plugins */ + + /* Chromium support */ + plugin = nm_dns_chromium_new (); + g_assert (plugin); + priv->plugins = g_slist_append (priv->plugins, plugin); + } +} + +/******************************************************************/ + +NMDnsManager * +nm_dns_manager_get (const char **plugins) +{ + static NMDnsManager * singleton = NULL; + + if (!singleton) { + singleton = NM_DNS_MANAGER (g_object_new (NM_TYPE_DNS_MANAGER, NULL)); + g_assert (singleton); + load_plugins (singleton, plugins); + } else + g_object_ref (singleton); + + return singleton; +} + +GQuark +nm_dns_manager_error_quark (void) +{ + static GQuark quark = 0; + if (!quark) + quark = g_quark_from_static_string ("nm_dns_manager_error"); + + return quark; +} static void nm_dns_manager_init (NMDnsManager *mgr) @@ -868,6 +921,9 @@ nm_dns_manager_finalize (GObject *object) g_free (priv->hostname); g_free (priv->last_iface); + g_slist_foreach (priv->plugins, (GFunc) g_object_unref, NULL); + g_slist_free (priv->plugins); + G_OBJECT_CLASS (nm_dns_manager_parent_class)->finalize (object); } diff --git a/src/dns-manager/nm-dns-manager.h b/src/dns-manager/nm-dns-manager.h index 0002d69990..eb1c73a7c2 100644 --- a/src/dns-manager/nm-dns-manager.h +++ b/src/dns-manager/nm-dns-manager.h @@ -67,7 +67,7 @@ typedef struct { GType nm_dns_manager_get_type (void); -NMDnsManager * nm_dns_manager_get (void); +NMDnsManager * nm_dns_manager_get (const char **plugins); gboolean nm_dns_manager_add_ip4_config (NMDnsManager *mgr, const char *iface, diff --git a/src/main.c b/src/main.c index 01bca9dc3e..7e75f05efb 100644 --- a/src/main.c +++ b/src/main.c @@ -300,6 +300,7 @@ static gboolean parse_config_file (const char *filename, char **plugins, char **dhcp_client, + char ***dns_plugins, char **log_level, char **log_domains, GError **error) @@ -322,6 +323,7 @@ parse_config_file (const char *filename, return FALSE; *dhcp_client = g_key_file_get_value (config, "main", "dhcp", NULL); + *dns_plugins = g_key_file_get_string_list (config, "main", "dns", NULL, NULL); *log_level = g_key_file_get_value (config, "logging", "level", NULL); *log_domains = g_key_file_get_value (config, "logging", "domains", NULL); @@ -442,6 +444,7 @@ main (int argc, char *argv[]) char *pidfile = NULL, *state_file = NULL, *dhcp = NULL; char *config = NULL, *plugins = NULL, *conf_plugins = NULL; char *log_level = NULL, *log_domains = NULL; + char **dns = NULL; gboolean wifi_enabled = TRUE, net_enabled = TRUE, wwan_enabled = TRUE; gboolean success; NMPolicy *policy = NULL; @@ -515,7 +518,7 @@ main (int argc, char *argv[]) /* Parse the config file */ if (config) { - if (!parse_config_file (config, &conf_plugins, &dhcp, &cfg_log_level, &cfg_log_domains, &error)) { + if (!parse_config_file (config, &conf_plugins, &dhcp, &dns, &cfg_log_level, &cfg_log_domains, &error)) { fprintf (stderr, "Config file %s invalid: (%d) %s\n", config, error ? error->code : -1, @@ -535,7 +538,7 @@ main (int argc, char *argv[]) /* Try deprecated nm-system-settings.conf first */ if (g_file_test (NM_OLD_SYSTEM_CONF_FILE, G_FILE_TEST_EXISTS)) { config = g_strdup (NM_OLD_SYSTEM_CONF_FILE); - parsed = parse_config_file (config, &conf_plugins, &dhcp, &cfg_log_level, &cfg_log_domains, &error); + parsed = parse_config_file (config, &conf_plugins, &dhcp, &dns, &cfg_log_level, &cfg_log_domains, &error); if (!parsed) { fprintf (stderr, "Default config file %s invalid: (%d) %s\n", config, @@ -550,7 +553,7 @@ main (int argc, char *argv[]) /* Try the preferred NetworkManager.conf last */ if (!parsed && g_file_test (NM_DEFAULT_SYSTEM_CONF_FILE, G_FILE_TEST_EXISTS)) { config = g_strdup (NM_DEFAULT_SYSTEM_CONF_FILE); - parsed = parse_config_file (config, &conf_plugins, &dhcp, &cfg_log_level, &cfg_log_domains, &error); + parsed = parse_config_file (config, &conf_plugins, &dhcp, &dns, &cfg_log_level, &cfg_log_domains, &error); if (!parsed) { fprintf (stderr, "Default config file %s invalid: (%d) %s\n", config, @@ -663,7 +666,7 @@ main (int argc, char *argv[]) goto done; } - dns_mgr = nm_dns_manager_get (); + dns_mgr = nm_dns_manager_get ((const char **) dns); if (!dns_mgr) { nm_log_err (LOGD_CORE, "failed to start the DNS manager."); goto done; @@ -756,6 +759,7 @@ done: g_free (config); g_free (plugins); g_free (dhcp); + g_strfreev (dns); g_free (log_level); g_free (log_domains); g_free (cfg_log_level); diff --git a/src/nm-device.c b/src/nm-device.c index ad1976b03c..abffe1264f 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -3038,7 +3038,7 @@ nm_device_set_ip4_config (NMDevice *self, if (diff == NM_IP4_COMPARE_FLAG_NONE) return TRUE; - dns_mgr = nm_dns_manager_get (); + dns_mgr = nm_dns_manager_get (NULL); if (old_config) { /* Remove any previous IP4 Config from the DNS manager */ nm_dns_manager_remove_ip4_config (dns_mgr, ip_iface, old_config); @@ -3141,7 +3141,7 @@ nm_device_set_ip6_config (NMDevice *self, if (diff == NM_IP6_COMPARE_FLAG_NONE) return TRUE; - dns_mgr = nm_dns_manager_get (); + dns_mgr = nm_dns_manager_get (NULL); if (old_config) { /* Remove any previous IP6 Config from the DNS manager */ nm_dns_manager_remove_ip6_config (dns_mgr, ip_iface, old_config); diff --git a/src/nm-policy.c b/src/nm-policy.c index 28864a8780..3ab4db550c 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -241,7 +241,7 @@ _set_hostname (NMPolicy *policy, g_free (policy->cur_hostname); policy->cur_hostname = g_strdup (new_hostname); - dns_mgr = nm_dns_manager_get (); + dns_mgr = nm_dns_manager_get (NULL); nm_dns_manager_set_hostname (dns_mgr, policy->cur_hostname); g_object_unref (dns_mgr); } @@ -553,7 +553,7 @@ update_ip4_routing_and_dns (NMPolicy *policy, gboolean force_update) nm_act_request_set_default (req, FALSE); } - dns_mgr = nm_dns_manager_get (); + dns_mgr = nm_dns_manager_get (NULL); nm_dns_manager_add_ip4_config (dns_mgr, ip_iface, ip4_config, dns_type); g_object_unref (dns_mgr); @@ -679,7 +679,7 @@ update_ip6_routing_and_dns (NMPolicy *policy, gboolean force_update) nm_act_request_set_default6 (req, FALSE); } - dns_mgr = nm_dns_manager_get (); + dns_mgr = nm_dns_manager_get (NULL); nm_dns_manager_add_ip6_config (dns_mgr, ip_iface, ip6_config, dns_type); g_object_unref (dns_mgr); diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c index d496e48ee3..cf844992c0 100644 --- a/src/vpn-manager/nm-vpn-connection.c +++ b/src/vpn-manager/nm-vpn-connection.c @@ -549,7 +549,7 @@ nm_vpn_connection_ip4_config_get (DBusGProxy *proxy, priv->gw_route = nm_system_add_ip4_vpn_gateway_route (priv->parent_dev, config); /* Add the VPN to DNS */ - dns_mgr = nm_dns_manager_get (); + dns_mgr = nm_dns_manager_get (NULL); nm_dns_manager_add_ip4_config (dns_mgr, priv->ip_iface, config, NM_DNS_IP_CONFIG_TYPE_VPN); g_object_unref (dns_mgr); @@ -902,7 +902,7 @@ vpn_cleanup (NMVPNConnection *connection) NMDnsManager *dns_mgr; /* Remove attributes of the VPN's IP4 Config */ - dns_mgr = nm_dns_manager_get (); + dns_mgr = nm_dns_manager_get (NULL); nm_dns_manager_remove_ip4_config (dns_mgr, priv->ip_iface, priv->ip4_config); g_object_unref (dns_mgr); -- cgit v1.2.1 From 4da443dc69a7aa218dbbeb5b2e4fc9f9076826e7 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 10 Sep 2010 18:02:40 -0500 Subject: dns: first cut of a dnsmasq local caching plugin --- src/dns-manager/Makefile.am | 11 +- src/dns-manager/nm-dns-dnsmasq.c | 391 +++++++++++++++++++++++++++++++++++++++ src/dns-manager/nm-dns-dnsmasq.h | 47 +++++ src/dns-manager/nm-dns-manager.c | 18 +- src/dns-manager/nm-dns-plugin.c | 311 +++++++++++++++++++++++++++++++ src/dns-manager/nm-dns-plugin.h | 107 +++++++++++ 6 files changed, 871 insertions(+), 14 deletions(-) create mode 100644 src/dns-manager/nm-dns-dnsmasq.c create mode 100644 src/dns-manager/nm-dns-dnsmasq.h create mode 100644 src/dns-manager/nm-dns-plugin.c create mode 100644 src/dns-manager/nm-dns-plugin.h diff --git a/src/dns-manager/Makefile.am b/src/dns-manager/Makefile.am index d1ea5f87e9..2a56fb8602 100644 --- a/src/dns-manager/Makefile.am +++ b/src/dns-manager/Makefile.am @@ -6,13 +6,18 @@ INCLUDES = \ noinst_LTLIBRARIES = libdns-manager.la -libdns_manager_la_SOURCES = nm-dns-manager.h nm-dns-manager.c +libdns_manager_la_SOURCES = \ + nm-dns-manager.h \ + nm-dns-manager.c \ + nm-dns-plugin.h \ + nm-dns-plugin.c \ + nm-dns-dnsmasq.h \ + nm-dns-dnsmasq.c libdns_manager_la_CPPFLAGS = \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ - -DNM_PKGDATADIR=\"$(pkgdatadir)\" \ - -DNM_LOCALSTATEDIR=\"$(localstatedir)\" + -DLOCALSTATEDIR=\"$(localstatedir)\" libdns_manager_la_LIBADD = \ $(top_builddir)/src/logging/libnm-logging.la \ diff --git a/src/dns-manager/nm-dns-dnsmasq.c b/src/dns-manager/nm-dns-dnsmasq.c new file mode 100644 index 0000000000..5fd6fe6570 --- /dev/null +++ b/src/dns-manager/nm-dns-dnsmasq.c @@ -0,0 +1,391 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2010 Dan Williams + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "nm-dns-dnsmasq.h" +#include "nm-logging.h" +#include "nm-ip4-config.h" +#include "nm-ip6-config.h" + +G_DEFINE_TYPE (NMDnsDnsmasq, nm_dns_dnsmasq, NM_TYPE_DNS_PLUGIN) + +#define NM_DNS_DNSMASQ_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DNS_DNSMASQ, NMDnsDnsmasqPrivate)) + +#define PIDFILE LOCALSTATEDIR "/run/nm-dns-dnsmasq.pid" +#define CONFFILE LOCALSTATEDIR "/run/nm-dns-dnsmasq.conf" + +typedef struct { + int pid; +} NMDnsDnsmasqPrivate; + +/*******************************************/ + +#if 0 +static NMCmdLine * +create_dm_cmd_line (const char *iface, + const char *pidfile, + GError **error) +{ + const char *dm_binary; + GString *conf; + NMIP4Address *tmp; + struct in_addr addr; + char buf[INET_ADDRSTRLEN + 15]; + char localaddr[INET_ADDRSTRLEN + 1]; + int i; + + dm_binary = nm_find_dnsmasq (); + if (!dm_binary) { + nm_log_warn (LOGD_DNS, "could not find dnsmasq binary."); + return NULL; + } + + /* Create dnsmasq command line */ + cmd = nm_cmd_line_new (); + nm_cmd_line_add_string (cmd, dm_binary); + + if (getenv ("NM_DNSMASQ_DEBUG")) + nm_cmd_line_add_string (cmd, "--log-queries"); + + /* dnsmasq may read from it's default config file location, which if that + * location is a valid config file, it will combine with the options here + * and cause undesirable side-effects. Like sending bogus IP addresses + * as the gateway or whatever. So give dnsmasq a bogus config file + * location to avoid screwing up the configuration we're passing to it. + */ + memset (buf, 0, sizeof (buf)); + strcpy (buf, "/tmp/"); + for (i = 5; i < 15; i++) + buf[i] = (char) (g_random_int_range ((guint32) 'a', (guint32) 'z') & 0xFF); + strcat (buf, ".conf"); + + nm_cmd_line_add_string (cmd, "--conf-file"); + nm_cmd_line_add_string (cmd, buf); + + nm_cmd_line_add_string (cmd, "--no-hosts"); + nm_cmd_line_add_string (cmd, "--keep-in-foreground"); + nm_cmd_line_add_string (cmd, "--bind-interfaces"); + nm_cmd_line_add_string (cmd, "--except-interface=lo"); + nm_cmd_line_add_string (cmd, "--clear-on-reload"); + + /* Use strict order since in the case of VPN connections, the VPN's + * nameservers will be first in resolv.conf, and those need to be tried + * first by dnsmasq to successfully resolve names from the VPN. + */ + nm_cmd_line_add_string (cmd, "--strict-order"); + + s = g_string_new ("--listen-address="); + addr.s_addr = nm_ip4_address_get_address (tmp); + if (!inet_ntop (AF_INET, &addr, &localaddr[0], INET_ADDRSTRLEN)) { + nm_log_warn (LOGD_SHARING, "error converting IP4 address 0x%X", + ntohl (addr.s_addr)); + goto error; + } + g_string_append (s, localaddr); + nm_cmd_line_add_string (cmd, s->str); + g_string_free (s, TRUE); + return cmd; + +error: + nm_cmd_line_destroy (cmd); + return NULL; +} +#endif + +static inline const char * +find_dnsmasq (void) +{ + static const char *paths[] = { + "/usr/local/sbin/dnsmasq", + "/usr/sbin/dnsmasq", + "/sbin/dnsmasq", + NULL + }; + const char **binary = paths; + + while (*binary != NULL) { + if (g_file_test (*binary, G_FILE_TEST_EXISTS)) + return *binary; + binary++; + } + return NULL; +} + +static gboolean +add_ip4_config (GString *str, NMIP4Config *ip4, gboolean split) +{ + char buf[INET_ADDRSTRLEN + 1]; + struct in_addr addr; + int n, i; + + /* FIXME: it appears that dnsmasq can only handle one nameserver + * per domain (at the manpage seems to indicate that) so only use + * the first nameserver here. + */ + addr.s_addr = nm_ip4_config_get_nameserver (ip4, 0); + memset (&buf[0], 0, sizeof (buf)); + if (!inet_ntop (AF_INET, &addr, buf, sizeof (buf))) + return FALSE; + + /* searches are preferred over domains */ + n = nm_ip4_config_get_num_searches (ip4); + for (i = 0; i < n; i++) { + g_string_append_printf (str, "server=%s%s%s%s\n", + split ? "/" : "", + split ? nm_ip4_config_get_search (ip4, i) : "", + split ? "/" : "", + buf); + } + + if (n == 0) { + /* If not searches, use any domains */ + n = nm_ip4_config_get_num_domains (ip4); + for (i = 0; i < n; i++) { + g_string_append_printf (str, "server=%s%s%s%s\n", + split ? "/" : "", + split ? nm_ip4_config_get_domain (ip4, i) : "", + split ? "/" : "", + buf); + } + } + + return TRUE; +} + +static gboolean +add_ip6_config (GString *str, NMIP6Config *ip6, gboolean split) +{ + char buf[INET6_ADDRSTRLEN + 1]; + const struct in6_addr *addr; + int n, i; + + /* FIXME: it appears that dnsmasq can only handle one nameserver + * per domain (at the manpage seems to indicate that) so only use + * the first nameserver here. + */ + addr = nm_ip6_config_get_nameserver (ip6, 0); + memset (&buf[0], 0, sizeof (buf)); + + /* inet_ntop is probably supposed to do this for us, but it doesn't */ + if (IN6_IS_ADDR_V4MAPPED (addr)) { + if (!inet_ntop (AF_INET, &(addr->s6_addr32[3]), buf, sizeof (buf))) + return FALSE; + } else { + if (!inet_ntop (AF_INET6, addr, buf, sizeof (buf))) + return FALSE; + } + + /* searches are preferred over domains */ + n = nm_ip6_config_get_num_searches (ip6); + for (i = 0; i < n; i++) { + g_string_append_printf (str, "server=%s%s%s%s\n", + split ? "/" : "", + split ? nm_ip6_config_get_search (ip6, i) : "", + split ? "/" : "", + buf); + } + + if (n == 0) { + /* If not searches, use any domains */ + n = nm_ip6_config_get_num_domains (ip6); + for (i = 0; i < n; i++) { + g_string_append_printf (str, "server=%s%s%s%s\n", + split ? "/" : "", + split ? nm_ip6_config_get_domain (ip6, i) : "", + split ? "/" : "", + buf); + } + } + + return TRUE; +} + +static gboolean +update (NMDnsPlugin *plugin, + const GSList *vpn_configs, + const GSList *dev_configs, + const GSList *other_configs, + const char *hostname) +{ + NMDnsDnsmasq *self = NM_DNS_DNSMASQ (plugin); + NMDnsDnsmasqPrivate *priv = NM_DNS_DNSMASQ_GET_PRIVATE (self); + GString *conf; + GSList *iter; + const char *argv[10]; + GError *error = NULL; + int ignored; + + /* Build up the new dnsmasq config file */ + conf = g_string_sized_new (150); + + /* Use split DNS for VPN configs */ + for (iter = (GSList *) vpn_configs; iter; iter = g_slist_next (iter)) { + if (NM_IS_IP4_CONFIG (iter->data)) + add_ip4_config (conf, NM_IP4_CONFIG (iter->data), TRUE); + else if (NM_IS_IP6_CONFIG (iter->data)) + add_ip6_config (conf, NM_IP6_CONFIG (iter->data), TRUE); + } + + /* Now add interface configs without split DNS */ + for (iter = (GSList *) dev_configs; iter;iter = g_slist_next (iter)) { + if (NM_IS_IP4_CONFIG (iter->data)) + add_ip4_config (conf, NM_IP4_CONFIG (iter->data), FALSE); + else if (NM_IS_IP6_CONFIG (iter->data)) + add_ip6_config (conf, NM_IP6_CONFIG (iter->data), FALSE); + } + + /* And any other random configs */ + for (iter = (GSList *) other_configs; iter;iter = g_slist_next (iter)) { + if (NM_IS_IP4_CONFIG (iter->data)) + add_ip4_config (conf, NM_IP4_CONFIG (iter->data), FALSE); + else if (NM_IS_IP6_CONFIG (iter->data)) + add_ip6_config (conf, NM_IP6_CONFIG (iter->data), FALSE); + } + + /* Write out the config file */ + if (!g_file_set_contents (CONFFILE, conf->str, -1, &error)) { + nm_log_warn (LOGD_DNS, "Failed to write dnsmasq config file %s: (%d) %s", + CONFFILE, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); + goto out; + } + ignored = chmod (CONFFILE, 0600); + + nm_log_dbg (LOGD_DNS, "dnsmasq local caching DNS configuration:"); + nm_log_dbg (LOGD_DNS, "%s", conf->str); + + argv[0] = find_dnsmasq (); + argv[1] = "--no-resolv"; /* Use only commandline */ + argv[2] = "--keep-in-foreground"; + argv[3] = "--pid-file=" PIDFILE; + argv[4] = "--listen-address=127.0.0.1"; /* Should work for both 4 and 6 */ + argv[5] = "--conf-file=" CONFFILE; + argv[6] = NULL; + + /* And finally spawn dnsmasq */ + priv->pid = nm_dns_plugin_child_spawn (NM_DNS_PLUGIN (self), argv, PIDFILE, "bin/dnsmasq"); + +out: + g_string_free (conf, TRUE); + return priv->pid ? TRUE : FALSE; +} + +/****************************************************************/ + +static const char * +dm_exit_code_to_msg (int status) +{ + if (status == 1) + return "Configuration problem"; + else if (status == 2) + return "Network access problem (address in use; permissions; etc)"; + else if (status == 3) + return "Filesystem problem (missing file/directory; permissions; etc)"; + else if (status == 4) + return "Memory allocation failure"; + else if (status == 5) + return "Other problem"; + else if (status >= 11) + return "Lease-script 'init' process failure"; + return "Unknown error"; +} + +static void +child_quit (NMDnsPlugin *plugin, gint status) +{ + NMDnsDnsmasq *self = NM_DNS_DNSMASQ (plugin); + NMDnsDnsmasqPrivate *priv = NM_DNS_DNSMASQ_GET_PRIVATE (self); + gboolean failed = TRUE; + int err; + + if (WIFEXITED (status)) { + err = WEXITSTATUS (status); + if (err) { + nm_log_warn (LOGD_DNS, "dnsmasq exited with error: %s (%d)", + dm_exit_code_to_msg (err), + err); + } else + failed = FALSE; + } else if (WIFSTOPPED (status)) { + nm_log_warn (LOGD_DNS, "dnsmasq stopped unexpectedly with signal %d", WSTOPSIG (status)); + } else if (WIFSIGNALED (status)) { + nm_log_warn (LOGD_DNS, "dnsmasq died with signal %d", WTERMSIG (status)); + } else { + nm_log_warn (LOGD_DNS, "dnsmasq died from an unknown cause"); + } + + if (failed) + g_signal_emit_by_name (self, NM_DNS_PLUGIN_FAILED); + + priv->pid = 0; + unlink (CONFFILE); +} + +/****************************************************************/ + +static gboolean +init (NMDnsPlugin *plugin) +{ + return TRUE; +} + +static gboolean +is_exclusive (NMDnsPlugin *plugin) +{ + return TRUE; +} + +/****************************************************************/ + +NMDnsDnsmasq * +nm_dns_dnsmasq_new (void) +{ + return (NMDnsDnsmasq *) g_object_new (NM_TYPE_DNS_DNSMASQ, NULL); +} + +static void +nm_dns_dnsmasq_init (NMDnsDnsmasq *self) +{ +} + +static void +nm_dns_dnsmasq_class_init (NMDnsDnsmasqClass *dns_class) +{ + NMDnsPluginClass *plugin_class = NM_DNS_PLUGIN_CLASS (dns_class); + + g_type_class_add_private (dns_class, sizeof (NMDnsDnsmasqPrivate)); + + plugin_class->init = init; + plugin_class->child_quit = child_quit; + plugin_class->is_exclusive = is_exclusive; + plugin_class->update = update; +} + diff --git a/src/dns-manager/nm-dns-dnsmasq.h b/src/dns-manager/nm-dns-dnsmasq.h new file mode 100644 index 0000000000..6491b271ae --- /dev/null +++ b/src/dns-manager/nm-dns-dnsmasq.h @@ -0,0 +1,47 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2010 Red Hat, Inc. + */ + +#ifndef NM_DNS_DNSMASQ_H +#define NM_DNS_DNSMASQ_H + +#include +#include + +#include "nm-dns-plugin.h" + +#define NM_TYPE_DNS_DNSMASQ (nm_dns_dnsmasq_get_type ()) +#define NM_DNS_DNSMASQ(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DNS_DNSMASQ, NMDnsDnsmasq)) +#define NM_DNS_DNSMASQ_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DNS_DNSMASQ, NMDnsDnsmasqClass)) +#define NM_IS_DNS_DNSMASQ(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DNS_DNSMASQ)) +#define NM_IS_DNS_DNSMASQ_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DNS_DNSMASQ)) +#define NM_DNS_DNSMASQ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DNS_DNSMASQ, NMDnsDnsmasqClass)) + +typedef struct { + NMDnsPlugin parent; +} NMDnsDnsmasq; + +typedef struct { + NMDnsPluginClass parent; +} NMDnsDnsmasqClass; + +GType nm_dns_dnsmasq_get_type (void); + +NMDnsDnsmasq *nm_dns_dnsmasq_new (void); + +#endif /* NM_DNS_DNSMASQ_H */ + diff --git a/src/dns-manager/nm-dns-manager.c b/src/dns-manager/nm-dns-manager.c index c3a0a4ff45..615532133c 100644 --- a/src/dns-manager/nm-dns-manager.c +++ b/src/dns-manager/nm-dns-manager.c @@ -43,6 +43,8 @@ #include "nm-system.h" #include "NetworkManagerUtils.h" +#include "nm-dns-dnsmasq.h" + #ifdef HAVE_SELINUX #include #endif @@ -828,12 +830,6 @@ nm_dns_manager_set_hostname (NMDnsManager *mgr, } } -static GObject * -nm_dns_dnsmasq_new (void) -{ - return NULL; -} - static GObject * nm_dns_bind_new (void) { @@ -850,18 +846,18 @@ static void load_plugins (NMDnsManager *self, const char **plugins) { NMDnsManagerPrivate *priv = NM_DNS_MANAGER_GET_PRIVATE (self); - GObject *plugin; + NMDnsPlugin *plugin; const char **iter; if (plugins && *plugins) { /* Create each configured plugin */ for (iter = plugins; iter && *iter; iter++) { if (!strcasecmp (*iter, "dnsmasq")) - plugin = nm_dns_dnsmasq_new (); + plugin = NM_DNS_PLUGIN (nm_dns_dnsmasq_new ()); else if (!strcasecmp (*iter, "bind")) - plugin = nm_dns_bind_new (); + plugin = NM_DNS_PLUGIN (nm_dns_bind_new ()); else if (!strcasecmp (*iter, "chromium")) - plugin = nm_dns_chromium_new (); + plugin = NM_DNS_PLUGIN (nm_dns_chromium_new ()); else { nm_log_warn (LOGD_DNS, "Unknown DNS plugin '%s'", *iter); } @@ -873,7 +869,7 @@ load_plugins (NMDnsManager *self, const char **plugins) /* Create default plugins */ /* Chromium support */ - plugin = nm_dns_chromium_new (); + plugin = NM_DNS_PLUGIN (nm_dns_chromium_new ()); g_assert (plugin); priv->plugins = g_slist_append (priv->plugins, plugin); } diff --git a/src/dns-manager/nm-dns-plugin.c b/src/dns-manager/nm-dns-plugin.c new file mode 100644 index 0000000000..bfa80bd87f --- /dev/null +++ b/src/dns-manager/nm-dns-plugin.c @@ -0,0 +1,311 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2010 Red Hat, Inc. + * + */ + +#include +#include +#include +#include +#include +#include + +#include "nm-dns-plugin.h" +#include "nm-logging.h" + +typedef struct { + gboolean disposed; + + GPid pid; + guint32 watch_id; + char *progname; + char *pidfile; +} NMDnsPluginPrivate; + +#define NM_DNS_PLUGIN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DNS_PLUGIN, NMDnsPluginPrivate)) + +G_DEFINE_TYPE_EXTENDED (NMDnsPlugin, nm_dns_plugin, G_TYPE_OBJECT, G_TYPE_FLAG_ABSTRACT, {}) + +enum { + FAILED, + CHILD_QUIT, + LAST_SIGNAL +}; +static guint signals[LAST_SIGNAL] = { 0 }; + +/********************************************/ + +gboolean +nm_dns_plugin_update (NMDnsPlugin *self, + const GSList *vpn_configs, + const GSList *dev_configs, + const GSList *other_configs, + const char *hostname) +{ + g_return_val_if_fail (NM_DNS_PLUGIN_GET_CLASS (self)->update != NULL, FALSE); + + return NM_DNS_PLUGIN_GET_CLASS (self)->update (self, + vpn_configs, + dev_configs, + other_configs, + hostname); +} + +static gboolean +is_exclusive (NMDnsPlugin *self) +{ + return FALSE; +} + +gboolean +nm_dns_plugin_is_exclusive (NMDnsPlugin *self) +{ + return NM_DNS_PLUGIN_GET_CLASS (self)->is_exclusive (self); +} + +/********************************************/ + +static void +kill_existing (const char *progname, const char *pidfile, const char *kill_match) +{ + char *contents = NULL; + glong pid; + char *proc_path = NULL; + char *cmdline_contents = NULL; + + if (!g_file_get_contents (pidfile, &contents, NULL, NULL)) + return; + + pid = strtol (contents, NULL, 10); + if (pid < 1 || pid > INT_MAX) + goto out; + + proc_path = g_strdup_printf ("/proc/%ld/cmdline", pid); + if (!g_file_get_contents (proc_path, &cmdline_contents, NULL, NULL)) + goto out; + + if (strstr (cmdline_contents, kill_match)) { + if (kill (pid, 0)) { + nm_log_dbg (LOGD_DNS, "Killing stale %s child process %ld", progname, pid); + kill (pid, SIGKILL); + } + unlink (pidfile); + } + +out: + g_free (cmdline_contents); + g_free (proc_path); + g_free (contents); +} + +static void +watch_cb (GPid pid, gint status, gpointer user_data) +{ + NMDnsPlugin *self = NM_DNS_PLUGIN (user_data); + NMDnsPluginPrivate *priv = NM_DNS_PLUGIN_GET_PRIVATE (self); + + priv->pid = 0; + g_free (priv->progname); + priv->progname = NULL; + + g_signal_emit (self, signals[CHILD_QUIT], 0, status); +} + +static void +child_setup (gpointer user_data G_GNUC_UNUSED) +{ + /* We are in the child process at this point */ + pid_t pid = getpid (); + setpgid (pid, pid); +} + +GPid +nm_dns_plugin_child_spawn (NMDnsPlugin *self, + const char **argv, + const char *pidfile, + const char *kill_match) +{ + NMDnsPluginPrivate *priv = NM_DNS_PLUGIN_GET_PRIVATE (self); + GError *error = NULL; + char *cmdline; + + g_return_val_if_fail (argv != NULL, 0); + g_return_val_if_fail (argv[0] != NULL, 0); + + g_warn_if_fail (priv->progname == NULL); + g_free (priv->progname); + priv->progname = g_path_get_basename (argv[0]); + + if (pidfile) { + g_return_val_if_fail (kill_match != NULL, 0); + kill_existing (priv->progname, pidfile, kill_match); + + g_free (priv->pidfile); + priv->pidfile = g_strdup (pidfile); + } + + nm_log_info (LOGD_DNS, "Starting %s...", priv->progname); + cmdline = g_strjoinv (" ", (char **) argv); + nm_log_dbg (LOGD_DNS, "Command line: %s", cmdline); + g_free (cmdline); + + priv->pid = 0; + if (g_spawn_async (NULL, (char **) argv, NULL, + G_SPAWN_DO_NOT_REAP_CHILD, + child_setup, + NULL, &priv->pid, + &error)) { + nm_log_dbg (LOGD_DNS, "%s started with pid %d", priv->progname, priv->pid); + priv->watch_id = g_child_watch_add (priv->pid, (GChildWatchFunc) watch_cb, self); + } else { + nm_log_warn (LOGD_DNS, "Failed to spawn %s: (%d) %s", + priv->progname, error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); + } + + return priv->pid; +} + +typedef struct { + int pid; + char *progname; +} KillInfo; + +static gboolean +ensure_killed (gpointer data) +{ + KillInfo *info = data; + + if (kill (info->pid, 0) == 0) + kill (info->pid, SIGKILL); + + /* ensure the child is reaped */ + nm_log_dbg (LOGD_DNS, "waiting for %s pid %d to exit", info->progname, info->pid); + waitpid (info->pid, NULL, 0); + nm_log_dbg (LOGD_DNS, "dnsmasq pid %d cleaned up", info->progname, info->pid); + + g_free (info->progname); + g_free (info); + return FALSE; +} + +gboolean nm_dns_plugin_child_kill (NMDnsPlugin *self) +{ + NMDnsPluginPrivate *priv = NM_DNS_PLUGIN_GET_PRIVATE (self); + + if (priv->watch_id) { + g_source_remove (priv->watch_id); + priv->watch_id = 0; + } + + if (priv->pid) { + KillInfo *info; + + if (kill (priv->pid, SIGTERM) == 0) { + info = g_malloc0 (sizeof (KillInfo)); + info->pid = priv->pid; + info->progname = g_strdup (priv->progname); + g_timeout_add_seconds (2, ensure_killed, info); + } else { + kill (priv->pid, SIGKILL); + + /* ensure the child is reaped */ + nm_log_dbg (LOGD_DNS, "waiting for %s pid %d to exit", priv->progname, priv->pid); + waitpid (priv->pid, NULL, 0); + nm_log_dbg (LOGD_DNS, "%s pid %d cleaned up", priv->progname, priv->pid); + } + priv->pid = 0; + g_free (priv->progname); + priv->progname = NULL; + } + + if (priv->pidfile) { + unlink (priv->pidfile); + g_free (priv->pidfile); + priv->pidfile = NULL; + } + + return TRUE; +} + +/********************************************/ + +static void +nm_dns_plugin_init (NMDnsPlugin *self) +{ +} + +static void +dispose (GObject *object) +{ + NMDnsPlugin *self = NM_DNS_PLUGIN (object); + NMDnsPluginPrivate *priv = NM_DNS_PLUGIN_GET_PRIVATE (self); + + if (!priv->disposed) { + priv->disposed = TRUE; + + nm_dns_plugin_child_kill (self); + } + + G_OBJECT_CLASS (nm_dns_plugin_parent_class)->dispose (object); +} + +static void +finalize (GObject *object) +{ + NMDnsPlugin *self = NM_DNS_PLUGIN (object); + NMDnsPluginPrivate *priv = NM_DNS_PLUGIN_GET_PRIVATE (self); + + g_free (priv->progname); + g_free (priv->pidfile); + + G_OBJECT_CLASS (nm_dns_plugin_parent_class)->finalize (object); +} + +static void +nm_dns_plugin_class_init (NMDnsPluginClass *plugin_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (plugin_class); + + g_type_class_add_private (plugin_class, sizeof (NMDnsPluginPrivate)); + + /* virtual methods */ + object_class->dispose = dispose; + object_class->finalize = finalize; + plugin_class->is_exclusive = is_exclusive; + + /* signals */ + signals[FAILED] = + g_signal_new (NM_DNS_PLUGIN_FAILED, + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDnsPluginClass, failed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[CHILD_QUIT] = + g_signal_new (NM_DNS_PLUGIN_CHILD_QUIT, + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDnsPluginClass, child_quit), + NULL, NULL, + g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, 1, G_TYPE_INT); +} + diff --git a/src/dns-manager/nm-dns-plugin.h b/src/dns-manager/nm-dns-plugin.h new file mode 100644 index 0000000000..cb8fabe1ff --- /dev/null +++ b/src/dns-manager/nm-dns-plugin.h @@ -0,0 +1,107 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2010 Red Hat, Inc. + */ + +#ifndef NM_DNS_PLUGIN_H +#define NM_DNS_PLUGIN_H + +#include +#include + +#define NM_TYPE_DNS_PLUGIN (nm_dns_plugin_get_type ()) +#define NM_DNS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DNS_PLUGIN, NMDnsPlugin)) +#define NM_DNS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DNS_PLUGIN, NMDnsPluginClass)) +#define NM_IS_DNS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DNS_PLUGIN)) +#define NM_IS_DNS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DNS_PLUGIN)) +#define NM_DNS_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DNS_PLUGIN, NMDnsPluginClass)) + +#define NM_DNS_PLUGIN_FAILED "failed" +#define NM_DNS_PLUGIN_CHILD_QUIT "child-quit" + +typedef struct { + GObject parent; +} NMDnsPlugin; + +typedef struct { + GObjectClass parent; + + /* Methods */ + gboolean (*init) (NMDnsPlugin *self); + + /* Called when DNS information is changed. 'vpn_configs' is a list of + * NMIP4Config or NMIP6Config objects from VPN connections, while + * 'dev_configs' is a list of NMPI4Config or NMIP6Config objects from + * active devices. 'other_configs' represent other IP configuration that + * may be in-use. Configs of the same IP version are sorted in priority + * order. + */ + gboolean (*update) (NMDnsPlugin *self, + const GSList *vpn_configs, + const GSList *dev_configs, + const GSList *other_configs, + const char *hostname); + + /* Subclasses should override and return TRUE if they start a local + * caching nameserver that listens on localhost and would block any + * other local caching nameserver from operating. + */ + gboolean (*is_exclusive) (NMDnsPlugin *self); + + /* Signals */ + + /* Emitted by the plugin and consumed by NMDnsManager when + * some error happens with the nameserver subprocess. Causes NM to fall + * back to writing out a non-local-caching resolv.conf until the next + * DNS update. + */ + void (*failed) (NMDnsPlugin *self); + + /* Emitted by the plugin base class when the nameserver subprocess + * quits. This signal is consumed by the plugin subclasses and not + * by NMDnsManager. If the subclass decides the exit status (as returned + * by waitpid(2)) is fatal it should then emit the 'failed' signal. + */ + void (*child_quit) (NMDnsPlugin *self, gint status); +} NMDnsPluginClass; + +GType nm_dns_plugin_get_type (void); + +gboolean nm_dns_plugin_is_exclusive (NMDnsPlugin *self); + +gboolean nm_dns_plugin_update (NMDnsPlugin *self, + const GSList *vpn_configs, + const GSList *dev_configs, + const GSList *other_configs, + const char *hostname); + +/* For subclasses/plugins */ + +/* Spawn a child process and watch for it to quit. 'argv' is the NULL-terminated + * argument vector to spawn the child with, where argv[0] is the full path to + * the child's executable. If 'pidfile' is given the process owning the PID + * contained in 'pidfile' will be killed if its command line matches 'kill_match' + * and the pidfile will be deleted. + */ +GPid nm_dns_plugin_child_spawn (NMDnsPlugin *self, + const char **argv, + const char *pidfile, + const char *kill_match); + +gboolean nm_dns_plugin_child_kill (NMDnsPlugin *self); + +#endif /* NM_DNS_PLUGIN_H */ + -- cgit v1.2.1 From a2982b5f7b22d9c162d9251229f8955a30aaaf37 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 12 Sep 2010 22:25:30 -0500 Subject: dns: hook plugins into DNS updates and make dnsmasq plugin actually work --- src/dns-manager/nm-dns-dnsmasq.c | 123 ++++++++---------------- src/dns-manager/nm-dns-manager.c | 195 +++++++++++++++++++++++++++++++-------- src/dns-manager/nm-dns-plugin.c | 19 ++-- src/dns-manager/nm-dns-plugin.h | 9 +- 4 files changed, 213 insertions(+), 133 deletions(-) diff --git a/src/dns-manager/nm-dns-dnsmasq.c b/src/dns-manager/nm-dns-dnsmasq.c index 5fd6fe6570..a3bf516429 100644 --- a/src/dns-manager/nm-dns-dnsmasq.c +++ b/src/dns-manager/nm-dns-dnsmasq.c @@ -41,83 +41,11 @@ G_DEFINE_TYPE (NMDnsDnsmasq, nm_dns_dnsmasq, NM_TYPE_DNS_PLUGIN) #define CONFFILE LOCALSTATEDIR "/run/nm-dns-dnsmasq.conf" typedef struct { - int pid; + guint32 foo; } NMDnsDnsmasqPrivate; /*******************************************/ -#if 0 -static NMCmdLine * -create_dm_cmd_line (const char *iface, - const char *pidfile, - GError **error) -{ - const char *dm_binary; - GString *conf; - NMIP4Address *tmp; - struct in_addr addr; - char buf[INET_ADDRSTRLEN + 15]; - char localaddr[INET_ADDRSTRLEN + 1]; - int i; - - dm_binary = nm_find_dnsmasq (); - if (!dm_binary) { - nm_log_warn (LOGD_DNS, "could not find dnsmasq binary."); - return NULL; - } - - /* Create dnsmasq command line */ - cmd = nm_cmd_line_new (); - nm_cmd_line_add_string (cmd, dm_binary); - - if (getenv ("NM_DNSMASQ_DEBUG")) - nm_cmd_line_add_string (cmd, "--log-queries"); - - /* dnsmasq may read from it's default config file location, which if that - * location is a valid config file, it will combine with the options here - * and cause undesirable side-effects. Like sending bogus IP addresses - * as the gateway or whatever. So give dnsmasq a bogus config file - * location to avoid screwing up the configuration we're passing to it. - */ - memset (buf, 0, sizeof (buf)); - strcpy (buf, "/tmp/"); - for (i = 5; i < 15; i++) - buf[i] = (char) (g_random_int_range ((guint32) 'a', (guint32) 'z') & 0xFF); - strcat (buf, ".conf"); - - nm_cmd_line_add_string (cmd, "--conf-file"); - nm_cmd_line_add_string (cmd, buf); - - nm_cmd_line_add_string (cmd, "--no-hosts"); - nm_cmd_line_add_string (cmd, "--keep-in-foreground"); - nm_cmd_line_add_string (cmd, "--bind-interfaces"); - nm_cmd_line_add_string (cmd, "--except-interface=lo"); - nm_cmd_line_add_string (cmd, "--clear-on-reload"); - - /* Use strict order since in the case of VPN connections, the VPN's - * nameservers will be first in resolv.conf, and those need to be tried - * first by dnsmasq to successfully resolve names from the VPN. - */ - nm_cmd_line_add_string (cmd, "--strict-order"); - - s = g_string_new ("--listen-address="); - addr.s_addr = nm_ip4_address_get_address (tmp); - if (!inet_ntop (AF_INET, &addr, &localaddr[0], INET_ADDRSTRLEN)) { - nm_log_warn (LOGD_SHARING, "error converting IP4 address 0x%X", - ntohl (addr.s_addr)); - goto error; - } - g_string_append (s, localaddr); - nm_cmd_line_add_string (cmd, s->str); - g_string_free (s, TRUE); - return cmd; - -error: - nm_cmd_line_destroy (cmd); - return NULL; -} -#endif - static inline const char * find_dnsmasq (void) { @@ -234,12 +162,19 @@ update (NMDnsPlugin *plugin, const char *hostname) { NMDnsDnsmasq *self = NM_DNS_DNSMASQ (plugin); - NMDnsDnsmasqPrivate *priv = NM_DNS_DNSMASQ_GET_PRIVATE (self); GString *conf; GSList *iter; const char *argv[10]; GError *error = NULL; int ignored; + GPid pid = 0; + + /* Kill the old dnsmasq; there doesn't appear to be a way to get dnsmasq + * to reread the config file using SIGHUP or similar. This is a small race + * here when restarting dnsmasq when DNS requests could go to the upstream + * servers instead of to dnsmasq. + */ + nm_dns_plugin_child_kill (plugin); /* Build up the new dnsmasq config file */ conf = g_string_sized_new (150); @@ -285,17 +220,18 @@ update (NMDnsPlugin *plugin, argv[0] = find_dnsmasq (); argv[1] = "--no-resolv"; /* Use only commandline */ argv[2] = "--keep-in-foreground"; - argv[3] = "--pid-file=" PIDFILE; - argv[4] = "--listen-address=127.0.0.1"; /* Should work for both 4 and 6 */ - argv[5] = "--conf-file=" CONFFILE; - argv[6] = NULL; + argv[3] = "--bind-interfaces"; + argv[4] = "--pid-file=" PIDFILE; + argv[5] = "--listen-address=127.0.0.1"; /* Should work for both 4 and 6 */ + argv[6] = "--conf-file=" CONFFILE; + argv[7] = NULL; /* And finally spawn dnsmasq */ - priv->pid = nm_dns_plugin_child_spawn (NM_DNS_PLUGIN (self), argv, PIDFILE, "bin/dnsmasq"); + pid = nm_dns_plugin_child_spawn (NM_DNS_PLUGIN (self), argv, PIDFILE, "bin/dnsmasq"); out: g_string_free (conf, TRUE); - return priv->pid ? TRUE : FALSE; + return pid ? TRUE : FALSE; } /****************************************************************/ @@ -322,7 +258,6 @@ static void child_quit (NMDnsPlugin *plugin, gint status) { NMDnsDnsmasq *self = NM_DNS_DNSMASQ (plugin); - NMDnsDnsmasqPrivate *priv = NM_DNS_DNSMASQ_GET_PRIVATE (self); gboolean failed = TRUE; int err; @@ -341,12 +276,10 @@ child_quit (NMDnsPlugin *plugin, gint status) } else { nm_log_warn (LOGD_DNS, "dnsmasq died from an unknown cause"); } + unlink (CONFFILE); if (failed) g_signal_emit_by_name (self, NM_DNS_PLUGIN_FAILED); - - priv->pid = 0; - unlink (CONFFILE); } /****************************************************************/ @@ -358,11 +291,17 @@ init (NMDnsPlugin *plugin) } static gboolean -is_exclusive (NMDnsPlugin *plugin) +is_caching (NMDnsPlugin *plugin) { return TRUE; } +static const char * +get_name (NMDnsPlugin *plugin) +{ + return "dnsmasq"; +} + /****************************************************************/ NMDnsDnsmasq * @@ -376,16 +315,28 @@ nm_dns_dnsmasq_init (NMDnsDnsmasq *self) { } +static void +dispose (GObject *object) +{ + unlink (CONFFILE); + + G_OBJECT_CLASS (nm_dns_dnsmasq_parent_class)->dispose (object); +} + static void nm_dns_dnsmasq_class_init (NMDnsDnsmasqClass *dns_class) { NMDnsPluginClass *plugin_class = NM_DNS_PLUGIN_CLASS (dns_class); + GObjectClass *object_class = G_OBJECT_CLASS (dns_class); g_type_class_add_private (dns_class, sizeof (NMDnsDnsmasqPrivate)); + object_class->dispose = dispose; + plugin_class->init = init; plugin_class->child_quit = child_quit; - plugin_class->is_exclusive = is_exclusive; + plugin_class->is_caching = is_caching; plugin_class->update = update; + plugin_class->get_name = get_name; } diff --git a/src/dns-manager/nm-dns-manager.c b/src/dns-manager/nm-dns-manager.c index 615532133c..cd39a651e6 100644 --- a/src/dns-manager/nm-dns-manager.c +++ b/src/dns-manager/nm-dns-manager.c @@ -245,10 +245,11 @@ dispatch_netconfig (const char *domain, char **nameservers, const char *nis_domain, char **nis_servers, + gboolean caching, const char *iface, GError **error) { - char *str; + char *str, *tmp; GPid pid; gint fd; int ret; @@ -284,9 +285,14 @@ dispatch_netconfig (const char *domain, } if (nameservers) { - str = g_strjoinv (" ", nameservers); + tmp = g_strjoinv (" ", nameservers); + if (caching) + str = g_strdup_printf ("127.0.0.1 %s", tmp); + else + str = g_strdup (tmp); write_to_netconfig (fd, "DNSSERVERS", str); g_free (str); + g_free (tmp); } if (nis_domain) @@ -321,6 +327,7 @@ static gboolean write_resolv_conf (FILE *f, const char *domain, char **searches, char **nameservers, + gboolean caching, GError **error) { char *domain_str = NULL; @@ -328,6 +335,7 @@ write_resolv_conf (FILE *f, const char *domain, char *nameservers_str = NULL; int i; gboolean retval = FALSE; + GString *str; if (fprintf (f, "%s","# Generated by NetworkManager\n") < 0) { g_set_error (error, @@ -349,15 +357,16 @@ write_resolv_conf (FILE *f, const char *domain, g_free (tmp_str); } - if (nameservers) { - GString *str; - int num; + str = g_string_new (""); + + if (caching) + g_string_append_printf (str, "nameserver 127.0.0.1\n"); - str = g_string_new (""); - num = g_strv_length (nameservers); + if (nameservers) { + int num = g_strv_length (nameservers); for (i = 0; i < num; i++) { - if (i == 3) { + if (i == 3 && !caching) { g_string_append (str, "# "); g_string_append (str, _("NOTE: the libc resolver may not support more than 3 nameservers.")); g_string_append (str, "\n# "); @@ -369,14 +378,14 @@ write_resolv_conf (FILE *f, const char *domain, g_string_append (str, nameservers[i]); g_string_append_c (str, '\n'); } - - nameservers_str = g_string_free (str, FALSE); } + nameservers_str = g_string_free (str, FALSE); + if (fprintf (f, "%s%s%s", domain_str ? domain_str : "", searches_str ? searches_str : "", - nameservers_str ? nameservers_str : "") != -1) + strlen (nameservers_str) ? nameservers_str : "") != -1) retval = TRUE; g_free (domain_str); @@ -391,6 +400,7 @@ static gboolean dispatch_resolvconf (const char *domain, char **searches, char **nameservers, + gboolean caching, const char *iface, GError **error) { @@ -412,7 +422,7 @@ dispatch_resolvconf (const char *domain, RESOLVCONF_PATH, g_strerror (errno)); else { - retval = write_resolv_conf (f, domain, searches, nameservers, error); + retval = write_resolv_conf (f, domain, searches, nameservers, caching, error); retval &= (pclose (f) == 0); } } else { @@ -432,6 +442,7 @@ static gboolean update_resolv_conf (const char *domain, char **searches, char **nameservers, + gboolean caching, const char *iface, GError **error) { @@ -479,7 +490,7 @@ update_resolv_conf (const char *domain, strcpy (tmp_resolv_conf_realpath, RESOLV_CONF); } - write_resolv_conf (f, domain, searches, nameservers, error); + write_resolv_conf (f, domain, searches, nameservers, caching, error); if (fclose (f) < 0) { if (*error == NULL) { @@ -515,23 +526,26 @@ out: } static gboolean -rewrite_resolv_conf (NMDnsManager *mgr, const char *iface, GError **error) +update_dns (NMDnsManager *self, + const char *iface, + gboolean no_caching, + GError **error) { NMDnsManagerPrivate *priv; NMResolvConfData rc; - GSList *iter; + GSList *iter, *vpn_configs = NULL, *dev_configs = NULL, *other_configs = NULL; const char *domain = NULL; const char *nis_domain = NULL; char **searches = NULL; char **nameservers = NULL; char **nis_servers = NULL; int num, i, len; - gboolean success = FALSE; + gboolean success = FALSE, caching = FALSE; g_return_val_if_fail (error != NULL, FALSE); g_return_val_if_fail (*error == NULL, FALSE); - priv = NM_DNS_MANAGER_GET_PRIVATE (mgr); + priv = NM_DNS_MANAGER_GET_PRIVATE (self); if (iface) { g_free (priv->last_iface); @@ -618,20 +632,74 @@ rewrite_resolv_conf (NMDnsManager *mgr, const char *iface, GError **error) nis_domain = rc.nis_domain; + /* Build up config lists for plugins; we use the raw configs here, not the + * merged information that we write to resolv.conf so that the plugins can + * still use the domain information in each config to provide split DNS if + * they want to. + */ + if (priv->ip4_vpn_config) + vpn_configs = g_slist_append (vpn_configs, priv->ip4_vpn_config); + if (priv->ip6_vpn_config) + vpn_configs = g_slist_append (vpn_configs, priv->ip6_vpn_config); + if (priv->ip4_device_config) + dev_configs = g_slist_append (dev_configs, priv->ip4_device_config); + if (priv->ip6_device_config) + dev_configs = g_slist_append (dev_configs, priv->ip6_device_config); + + for (iter = priv->configs; iter; iter = g_slist_next (iter)) { + if ( (iter->data != priv->ip4_vpn_config) + && (iter->data != priv->ip4_device_config) + && (iter->data != priv->ip6_vpn_config) + && (iter->data != priv->ip6_device_config)) + other_configs = g_slist_append (other_configs, iter->data); + } + + /* Let any plugins do their thing first */ + for (iter = priv->plugins; iter; iter = g_slist_next (iter)) { + NMDnsPlugin *plugin = NM_DNS_PLUGIN (iter->data); + const char *plugin_name = nm_dns_plugin_get_name (plugin); + + if (nm_dns_plugin_is_caching (plugin)) { + if (no_caching) { + nm_log_dbg (LOGD_DNS, "DNS: plugin %s ignored (caching disabled)", + plugin_name); + continue; + } + caching = TRUE; + } + + nm_log_dbg (LOGD_DNS, "DNS: updating plugin %s", plugin_name); + if (!nm_dns_plugin_update (plugin, + vpn_configs, + dev_configs, + other_configs, + priv->hostname)) { + nm_log_warn (LOGD_DNS, "DNS: plugin %s update failed", plugin_name); + + /* If the plugin failed to update, we shouldn't write out a local + * caching DNS configuration to resolv.conf. + */ + caching = FALSE; + } + } + g_slist_free (vpn_configs); + g_slist_free (dev_configs); + g_slist_free (other_configs); + #ifdef RESOLVCONF_PATH - success = dispatch_resolvconf (domain, searches, nameservers, iface, error); + success = dispatch_resolvconf (domain, searches, nameservers, caching, iface, error); #endif #ifdef TARGET_SUSE if (success == FALSE) { success = dispatch_netconfig (domain, searches, nameservers, nis_domain, nis_servers, - iface, error); + caching, iface, error); } #endif if (success == FALSE) - success = update_resolv_conf (domain, searches, nameservers, iface, error); + success = update_resolv_conf (domain, searches, nameservers, caching, iface, error); if (success) nm_system_update_dns (); @@ -646,6 +714,26 @@ rewrite_resolv_conf (NMDnsManager *mgr, const char *iface, GError **error) return success; } +static void +plugin_failed (NMDnsPlugin *plugin, gpointer user_data) +{ + NMDnsManager *self = NM_DNS_MANAGER (user_data); + NMDnsManagerPrivate *priv = NM_DNS_MANAGER_GET_PRIVATE (self); + GError *error = NULL; + + /* Errors with non-caching plugins aren't fatal */ + if (!nm_dns_plugin_is_caching (plugin)) + return; + + /* Disable caching until the next DNS update */ + if (!update_dns (self, priv->last_iface, TRUE, &error)) { + nm_log_warn (LOGD_DNS, "could not commit DNS changes: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); + } +} + gboolean nm_dns_manager_add_ip4_config (NMDnsManager *mgr, const char *iface, @@ -676,9 +764,11 @@ nm_dns_manager_add_ip4_config (NMDnsManager *mgr, if (!g_slist_find (priv->configs, config)) priv->configs = g_slist_append (priv->configs, g_object_ref (config)); - if (!rewrite_resolv_conf (mgr, iface, &error)) { - nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); - g_error_free (error); + if (!update_dns (mgr, iface, FALSE, &error)) { + nm_log_warn (LOGD_DNS, "could not commit DNS changes: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); } return TRUE; @@ -711,10 +801,11 @@ nm_dns_manager_remove_ip4_config (NMDnsManager *mgr, g_object_unref (config); - if (!rewrite_resolv_conf (mgr, iface, &error)) { - nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); - if (error) - g_error_free (error); + if (!update_dns (mgr, iface, FALSE, &error)) { + nm_log_warn (LOGD_DNS, "could not commit DNS changes: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); } return TRUE; @@ -752,9 +843,11 @@ nm_dns_manager_add_ip6_config (NMDnsManager *mgr, if (!g_slist_find (priv->configs, config)) priv->configs = g_slist_append (priv->configs, g_object_ref (config)); - if (!rewrite_resolv_conf (mgr, iface, &error)) { - nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); - g_error_free (error); + if (!update_dns (mgr, iface, FALSE, &error)) { + nm_log_warn (LOGD_DNS, "could not commit DNS changes: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); } return TRUE; @@ -787,10 +880,11 @@ nm_dns_manager_remove_ip6_config (NMDnsManager *mgr, g_object_unref (config); - if (!rewrite_resolv_conf (mgr, iface, &error)) { - nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); - if (error) - g_error_free (error); + if (!update_dns (mgr, iface, FALSE, &error)) { + nm_log_warn (LOGD_DNS, "could not commit DNS changes: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); } return TRUE; @@ -824,8 +918,10 @@ nm_dns_manager_set_hostname (NMDnsManager *mgr, * wants one. But hostname changes are system-wide and *not* tied to a * specific interface, so netconfig can't really handle this. Fake it. */ - if (!rewrite_resolv_conf (mgr, priv->last_iface, &error)) { - nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); + if (!update_dns (mgr, priv->last_iface, FALSE, &error)) { + nm_log_warn (LOGD_DNS, "could not commit DNS changes: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); g_clear_error (&error); } } @@ -848,6 +944,7 @@ load_plugins (NMDnsManager *self, const char **plugins) NMDnsManagerPrivate *priv = NM_DNS_MANAGER_GET_PRIVATE (self); NMDnsPlugin *plugin; const char **iter; + gboolean have_caching = FALSE; if (plugins && *plugins) { /* Create each configured plugin */ @@ -859,19 +956,39 @@ load_plugins (NMDnsManager *self, const char **plugins) else if (!strcasecmp (*iter, "chromium")) plugin = NM_DNS_PLUGIN (nm_dns_chromium_new ()); else { - nm_log_warn (LOGD_DNS, "Unknown DNS plugin '%s'", *iter); + nm_log_warn (LOGD_DNS, "Unknown DNS plugin '%s'", *iter);\ + continue; + } + g_assert (plugin); + + /* Only one caching DNS plugin is allowed */ + if (nm_dns_plugin_is_caching (plugin)) { + if (have_caching) { + nm_log_warn (LOGD_DNS, + "Ignoring plugin %s; only one caching DNS " + "plugin is allowed.", + *iter); + g_object_unref (plugin); + continue; + } + have_caching = TRUE; } - if (plugin) - priv->plugins = g_slist_append (priv->plugins, plugin); + nm_log_info (LOGD_DNS, "DNS: loaded plugin %s", nm_dns_plugin_get_name (plugin)); + priv->plugins = g_slist_append (priv->plugins, plugin); + g_signal_connect (plugin, NM_DNS_PLUGIN_FAILED, + G_CALLBACK (plugin_failed), + self); } } else { /* Create default plugins */ /* Chromium support */ +#if 0 plugin = NM_DNS_PLUGIN (nm_dns_chromium_new ()); g_assert (plugin); priv->plugins = g_slist_append (priv->plugins, plugin); +#endif } } diff --git a/src/dns-manager/nm-dns-plugin.c b/src/dns-manager/nm-dns-plugin.c index bfa80bd87f..d47640b1c3 100644 --- a/src/dns-manager/nm-dns-plugin.c +++ b/src/dns-manager/nm-dns-plugin.c @@ -66,15 +66,22 @@ nm_dns_plugin_update (NMDnsPlugin *self, } static gboolean -is_exclusive (NMDnsPlugin *self) +is_caching (NMDnsPlugin *self) { return FALSE; } gboolean -nm_dns_plugin_is_exclusive (NMDnsPlugin *self) +nm_dns_plugin_is_caching (NMDnsPlugin *self) { - return NM_DNS_PLUGIN_GET_CLASS (self)->is_exclusive (self); + return NM_DNS_PLUGIN_GET_CLASS (self)->is_caching (self); +} + +const char * +nm_dns_plugin_get_name (NMDnsPlugin *self) +{ + g_assert (NM_DNS_PLUGIN_GET_CLASS (self)->get_name); + return NM_DNS_PLUGIN_GET_CLASS (self)->get_name (self); } /********************************************/ @@ -158,9 +165,9 @@ nm_dns_plugin_child_spawn (NMDnsPlugin *self, priv->pidfile = g_strdup (pidfile); } - nm_log_info (LOGD_DNS, "Starting %s...", priv->progname); + nm_log_info (LOGD_DNS, "DNS: starting %s...", priv->progname); cmdline = g_strjoinv (" ", (char **) argv); - nm_log_dbg (LOGD_DNS, "Command line: %s", cmdline); + nm_log_dbg (LOGD_DNS, "DNS: command line: %s", cmdline); g_free (cmdline); priv->pid = 0; @@ -287,7 +294,7 @@ nm_dns_plugin_class_init (NMDnsPluginClass *plugin_class) /* virtual methods */ object_class->dispose = dispose; object_class->finalize = finalize; - plugin_class->is_exclusive = is_exclusive; + plugin_class->is_caching = is_caching; /* signals */ signals[FAILED] = diff --git a/src/dns-manager/nm-dns-plugin.h b/src/dns-manager/nm-dns-plugin.h index cb8fabe1ff..d4298b869d 100644 --- a/src/dns-manager/nm-dns-plugin.h +++ b/src/dns-manager/nm-dns-plugin.h @@ -59,7 +59,10 @@ typedef struct { * caching nameserver that listens on localhost and would block any * other local caching nameserver from operating. */ - gboolean (*is_exclusive) (NMDnsPlugin *self); + gboolean (*is_caching) (NMDnsPlugin *self); + + /* Subclasses should override this and return their plugin name */ + const char *(*get_name) (NMDnsPlugin *self); /* Signals */ @@ -80,7 +83,9 @@ typedef struct { GType nm_dns_plugin_get_type (void); -gboolean nm_dns_plugin_is_exclusive (NMDnsPlugin *self); +gboolean nm_dns_plugin_is_caching (NMDnsPlugin *self); + +const char *nm_dns_plugin_get_name (NMDnsPlugin *self); gboolean nm_dns_plugin_update (NMDnsPlugin *self, const GSList *vpn_configs, -- cgit v1.2.1 From 9d0775448ce88feb0bb17aa6b6df85fa671333e1 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 12 Sep 2010 23:16:25 -0500 Subject: dns: use VPN nameservers first even if no domain was given If the VPN client didn't provide a domain we still want to use the VPN nameservers first, we just can't do split DNS. Also use --strict-order to ensure VPN nameservers are always chosen first. --- src/dns-manager/nm-dns-dnsmasq.c | 56 +++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 15 deletions(-) diff --git a/src/dns-manager/nm-dns-dnsmasq.c b/src/dns-manager/nm-dns-dnsmasq.c index a3bf516429..132579dc6c 100644 --- a/src/dns-manager/nm-dns-dnsmasq.c +++ b/src/dns-manager/nm-dns-dnsmasq.c @@ -103,9 +103,32 @@ add_ip4_config (GString *str, NMIP4Config *ip4, gboolean split) } } + /* If no searches or domains, just add the namservers */ + if (n == 0) { + n = nm_ip4_config_get_num_nameservers (ip4); + for (i = 0; i < n; i++) { + memset (&buf[0], 0, sizeof (buf)); + addr.s_addr = nm_ip4_config_get_nameserver (ip4, i); + if (inet_ntop (AF_INET, &addr, buf, sizeof (buf))) + g_string_append_printf (str, "server=%s\n", buf); + } + } + return TRUE; } +static gboolean +ip6_addr_to_string (const struct in6_addr *addr, char *buf, size_t buflen) +{ + memset (buf, 0, buflen); + + /* inet_ntop is probably supposed to do this for us, but it doesn't */ + if (IN6_IS_ADDR_V4MAPPED (addr)) + return !!inet_ntop (AF_INET, &(addr->s6_addr32[3]), buf, buflen); + + return !!inet_ntop (AF_INET6, addr, buf, buflen); +} + static gboolean add_ip6_config (GString *str, NMIP6Config *ip6, gboolean split) { @@ -118,16 +141,8 @@ add_ip6_config (GString *str, NMIP6Config *ip6, gboolean split) * the first nameserver here. */ addr = nm_ip6_config_get_nameserver (ip6, 0); - memset (&buf[0], 0, sizeof (buf)); - - /* inet_ntop is probably supposed to do this for us, but it doesn't */ - if (IN6_IS_ADDR_V4MAPPED (addr)) { - if (!inet_ntop (AF_INET, &(addr->s6_addr32[3]), buf, sizeof (buf))) - return FALSE; - } else { - if (!inet_ntop (AF_INET6, addr, buf, sizeof (buf))) - return FALSE; - } + if (!ip6_addr_to_string (addr, &buf[0], sizeof (buf))) + return FALSE; /* searches are preferred over domains */ n = nm_ip6_config_get_num_searches (ip6); @@ -151,6 +166,16 @@ add_ip6_config (GString *str, NMIP6Config *ip6, gboolean split) } } + /* If no searches or domains, just add the namservers */ + if (n == 0) { + n = nm_ip6_config_get_num_nameservers (ip6); + for (i = 0; i < n; i++) { + addr = nm_ip6_config_get_nameserver (ip6, i); + if (ip6_addr_to_string (addr, &buf[0], sizeof (buf))) + g_string_append_printf (str, "server=%s\n", buf); + } + } + return TRUE; } @@ -220,11 +245,12 @@ update (NMDnsPlugin *plugin, argv[0] = find_dnsmasq (); argv[1] = "--no-resolv"; /* Use only commandline */ argv[2] = "--keep-in-foreground"; - argv[3] = "--bind-interfaces"; - argv[4] = "--pid-file=" PIDFILE; - argv[5] = "--listen-address=127.0.0.1"; /* Should work for both 4 and 6 */ - argv[6] = "--conf-file=" CONFFILE; - argv[7] = NULL; + argv[3] = "--strict-order"; + argv[4] = "--bind-interfaces"; + argv[5] = "--pid-file=" PIDFILE; + argv[6] = "--listen-address=127.0.0.1"; /* Should work for both 4 and 6 */ + argv[7] = "--conf-file=" CONFFILE; + argv[8] = NULL; /* And finally spawn dnsmasq */ pid = nm_dns_plugin_child_spawn (NM_DNS_PLUGIN (self), argv, PIDFILE, "bin/dnsmasq"); -- cgit v1.2.1 From 958024cb684a08103aa2116dca0f627683ebe9ac Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 13 Sep 2010 11:02:26 -0500 Subject: bluetooth: requery default adapter when Bluez actually starts --- src/bluez-manager/nm-bluez-manager.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bluez-manager/nm-bluez-manager.c b/src/bluez-manager/nm-bluez-manager.c index fe027c4ff5..59849d3bd5 100644 --- a/src/bluez-manager/nm-bluez-manager.c +++ b/src/bluez-manager/nm-bluez-manager.c @@ -251,11 +251,13 @@ name_owner_changed_cb (NMDBusManager *dbus_mgr, gboolean old_owner_good = (old_owner && strlen (old_owner)); gboolean new_owner_good = (new_owner && strlen (new_owner)); - /* Can't handle the signal if its not from the supplicant service */ + /* Can't handle the signal if its not from the Bluez */ if (strcmp (BLUEZ_SERVICE, name)) return; - if (old_owner_good && !new_owner_good) + if (!old_owner_good && new_owner_good) + query_default_adapter (self); + else if (old_owner_good && !new_owner_good) remove_all_devices (self, TRUE); } -- cgit v1.2.1 From 57f6feb102ede868b4692e6a2a8177ec7663c04f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 14 Sep 2010 23:41:33 -0500 Subject: dns: only write out new DNS config if it really changed Use a pseudo-hash to quickly check whether the DNS config has really changed or not. This is certainly better than the 500 line patch I did then scrapped in favor of this approach... yay. This helps ensure that we don't kill then respawn caching DNS servers more often than we have to. --- src/dns-manager/nm-dns-manager.c | 74 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 2 deletions(-) diff --git a/src/dns-manager/nm-dns-manager.c b/src/dns-manager/nm-dns-manager.c index cd39a651e6..af71320b2f 100644 --- a/src/dns-manager/nm-dns-manager.c +++ b/src/dns-manager/nm-dns-manager.c @@ -43,6 +43,7 @@ #include "nm-system.h" #include "NetworkManagerUtils.h" +#include "nm-dns-plugin.h" #include "nm-dns-dnsmasq.h" #ifdef HAVE_SELINUX @@ -53,8 +54,6 @@ #define RESOLV_CONF "/etc/resolv.conf" #endif -#define ADDR_BUF_LEN 50 - G_DEFINE_TYPE(NMDnsManager, nm_dns_manager, G_TYPE_OBJECT) #define NM_DNS_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ @@ -69,6 +68,14 @@ struct NMDnsManagerPrivate { GSList *configs; char *hostname; + /* poor man's hash; we assume that the IP4 config object won't change + * after it's given to us, which is (at this time) a fair assumption. So + * we track the order of the currently applied IP configs and if they + * haven't changed we don't need to rewrite resolv.conf. + */ + #define HLEN 6 + gpointer hash[HLEN]; + GSList *plugins; /* This is a hack because SUSE's netconfig always wants changes @@ -525,6 +532,37 @@ out: return *error ? FALSE : TRUE; } +static void +compute_hash (NMDnsManager *self, gpointer *hash) +{ + NMDnsManagerPrivate *priv = NM_DNS_MANAGER_GET_PRIVATE (self); + gpointer check[HLEN]; + GSList *iter; + int i = 0; + + memset (check, 0, sizeof (check)); + + if (priv->ip4_vpn_config) + check[i++] = priv->ip4_vpn_config; + if (priv->ip4_device_config) + check[i++] = priv->ip4_device_config; + + if (priv->ip6_vpn_config) + check[i++] = priv->ip6_vpn_config; + if (priv->ip6_device_config) + check[i++] = priv->ip6_device_config; + + /* Add two more "other" configs if any exist */ + for (iter = priv->configs; iter && i < HLEN; iter = g_slist_next (iter)) { + if ( (iter->data != priv->ip4_vpn_config) + && (iter->data != priv->ip4_device_config) + && (iter->data != priv->ip6_vpn_config) + && (iter->data != priv->ip6_device_config)) + check[i++] = iter->data; + } + memcpy (hash, check, sizeof (check)); +} + static gboolean update_dns (NMDnsManager *self, const char *iface, @@ -552,6 +590,9 @@ update_dns (NMDnsManager *self, priv->last_iface = g_strdup (iface); } + /* Update hash with config we're applying */ + compute_hash (self, priv->hash); + rc.nameservers = g_ptr_array_new (); rc.domain = NULL; rc.searches = g_ptr_array_new (); @@ -734,6 +775,23 @@ plugin_failed (NMDnsPlugin *plugin, gpointer user_data) } } +static gboolean +config_changed (NMDnsManager *self) +{ + NMDnsManagerPrivate *priv = NM_DNS_MANAGER_GET_PRIVATE (self); + gpointer check[HLEN]; + + /* We only store HLEN configs; so if there are actually more than that, + * we have to assume that the config has changed. + */ + if (g_slist_length (priv->configs) > HLEN) + return TRUE; + + /* Otherwise return TRUE if the configuration has changed */ + compute_hash (self, check); + return memcmp (check, priv->hash, sizeof (check)) ? TRUE : FALSE; +} + gboolean nm_dns_manager_add_ip4_config (NMDnsManager *mgr, const char *iface, @@ -764,6 +822,9 @@ nm_dns_manager_add_ip4_config (NMDnsManager *mgr, if (!g_slist_find (priv->configs, config)) priv->configs = g_slist_append (priv->configs, g_object_ref (config)); + if (!config_changed (mgr)) + return TRUE; + if (!update_dns (mgr, iface, FALSE, &error)) { nm_log_warn (LOGD_DNS, "could not commit DNS changes: (%d) %s", error ? error->code : -1, @@ -801,6 +862,9 @@ nm_dns_manager_remove_ip4_config (NMDnsManager *mgr, g_object_unref (config); + if (config_changed (mgr)) + return TRUE; + if (!update_dns (mgr, iface, FALSE, &error)) { nm_log_warn (LOGD_DNS, "could not commit DNS changes: (%d) %s", error ? error->code : -1, @@ -843,6 +907,9 @@ nm_dns_manager_add_ip6_config (NMDnsManager *mgr, if (!g_slist_find (priv->configs, config)) priv->configs = g_slist_append (priv->configs, g_object_ref (config)); + if (config_changed (mgr)) + return TRUE; + if (!update_dns (mgr, iface, FALSE, &error)) { nm_log_warn (LOGD_DNS, "could not commit DNS changes: (%d) %s", error ? error->code : -1, @@ -880,6 +947,9 @@ nm_dns_manager_remove_ip6_config (NMDnsManager *mgr, g_object_unref (config); + if (config_changed (mgr)) + return TRUE; + if (!update_dns (mgr, iface, FALSE, &error)) { nm_log_warn (LOGD_DNS, "could not commit DNS changes: (%d) %s", error ? error->code : -1, -- cgit v1.2.1 From 1da4a11ce55c7bf4ce46adca15c609c61b9d9caf Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 14 Sep 2010 23:55:41 -0500 Subject: dns: (dnsmasq) fix handling of multiple DNS servers in non-split configs --- src/dns-manager/nm-dns-dnsmasq.c | 116 ++++++++++++++++++++------------------- 1 file changed, 59 insertions(+), 57 deletions(-) diff --git a/src/dns-manager/nm-dns-dnsmasq.c b/src/dns-manager/nm-dns-dnsmasq.c index 132579dc6c..254e2ffbb6 100644 --- a/src/dns-manager/nm-dns-dnsmasq.c +++ b/src/dns-manager/nm-dns-dnsmasq.c @@ -71,40 +71,41 @@ add_ip4_config (GString *str, NMIP4Config *ip4, gboolean split) char buf[INET_ADDRSTRLEN + 1]; struct in_addr addr; int n, i; - - /* FIXME: it appears that dnsmasq can only handle one nameserver - * per domain (at the manpage seems to indicate that) so only use - * the first nameserver here. - */ - addr.s_addr = nm_ip4_config_get_nameserver (ip4, 0); - memset (&buf[0], 0, sizeof (buf)); - if (!inet_ntop (AF_INET, &addr, buf, sizeof (buf))) - return FALSE; - - /* searches are preferred over domains */ - n = nm_ip4_config_get_num_searches (ip4); - for (i = 0; i < n; i++) { - g_string_append_printf (str, "server=%s%s%s%s\n", - split ? "/" : "", - split ? nm_ip4_config_get_search (ip4, i) : "", - split ? "/" : "", - buf); - } - - if (n == 0) { - /* If not searches, use any domains */ - n = nm_ip4_config_get_num_domains (ip4); + gboolean added = FALSE; + + if (split) { + /* FIXME: it appears that dnsmasq can only handle one nameserver + * per domain (at the manpage seems to indicate that) so only use + * the first nameserver here. + */ + addr.s_addr = nm_ip4_config_get_nameserver (ip4, 0); + memset (&buf[0], 0, sizeof (buf)); + if (!inet_ntop (AF_INET, &addr, buf, sizeof (buf))) + return FALSE; + + /* searches are preferred over domains */ + n = nm_ip4_config_get_num_searches (ip4); for (i = 0; i < n; i++) { - g_string_append_printf (str, "server=%s%s%s%s\n", - split ? "/" : "", - split ? nm_ip4_config_get_domain (ip4, i) : "", - split ? "/" : "", - buf); + g_string_append_printf (str, "server=/%s/%s\n", + nm_ip4_config_get_search (ip4, i), + buf); + added = TRUE; + } + + if (n == 0) { + /* If not searches, use any domains */ + n = nm_ip4_config_get_num_domains (ip4); + for (i = 0; i < n; i++) { + g_string_append_printf (str, "server=/%s/%s\n", + nm_ip4_config_get_domain (ip4, i), + buf); + added = TRUE; + } } } /* If no searches or domains, just add the namservers */ - if (n == 0) { + if (!added) { n = nm_ip4_config_get_num_nameservers (ip4); for (i = 0; i < n; i++) { memset (&buf[0], 0, sizeof (buf)); @@ -135,39 +136,40 @@ add_ip6_config (GString *str, NMIP6Config *ip6, gboolean split) char buf[INET6_ADDRSTRLEN + 1]; const struct in6_addr *addr; int n, i; - - /* FIXME: it appears that dnsmasq can only handle one nameserver - * per domain (at the manpage seems to indicate that) so only use - * the first nameserver here. - */ - addr = nm_ip6_config_get_nameserver (ip6, 0); - if (!ip6_addr_to_string (addr, &buf[0], sizeof (buf))) - return FALSE; - - /* searches are preferred over domains */ - n = nm_ip6_config_get_num_searches (ip6); - for (i = 0; i < n; i++) { - g_string_append_printf (str, "server=%s%s%s%s\n", - split ? "/" : "", - split ? nm_ip6_config_get_search (ip6, i) : "", - split ? "/" : "", - buf); - } - - if (n == 0) { - /* If not searches, use any domains */ - n = nm_ip6_config_get_num_domains (ip6); + gboolean added = FALSE; + + if (split) { + /* FIXME: it appears that dnsmasq can only handle one nameserver + * per domain (at the manpage seems to indicate that) so only use + * the first nameserver here. + */ + addr = nm_ip6_config_get_nameserver (ip6, 0); + if (!ip6_addr_to_string (addr, &buf[0], sizeof (buf))) + return FALSE; + + /* searches are preferred over domains */ + n = nm_ip6_config_get_num_searches (ip6); for (i = 0; i < n; i++) { - g_string_append_printf (str, "server=%s%s%s%s\n", - split ? "/" : "", - split ? nm_ip6_config_get_domain (ip6, i) : "", - split ? "/" : "", - buf); + g_string_append_printf (str, "server=/%s/%s\n", + nm_ip6_config_get_search (ip6, i), + buf); + added = TRUE; + } + + if (n == 0) { + /* If not searches, use any domains */ + n = nm_ip6_config_get_num_domains (ip6); + for (i = 0; i < n; i++) { + g_string_append_printf (str, "server=/%s/%s\n", + nm_ip6_config_get_domain (ip6, i), + buf); + added = TRUE; + } } } /* If no searches or domains, just add the namservers */ - if (n == 0) { + if (!added) { n = nm_ip6_config_get_num_nameservers (ip6); for (i = 0; i < n; i++) { addr = nm_ip6_config_get_nameserver (ip6, i); -- cgit v1.2.1 From 1e33d1e906968a851747c2a870e53d422c621ed0 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 15 Sep 2010 10:25:11 -0500 Subject: dns: remove unused Chromium bits This was supposed to hook up to the bits Adam Langley did last year for his local-dns-cache DBus service, but I misunderstood the architecture. It was a separate service, not Chromium itself. But it's unclear what happened to his local-dns-cache since the project doesn't seem to have any commits in a year and I'm unsure if it's actually being used. So remove this stuff for now. --- man/NetworkManager.conf.5.in | 4 ---- src/dns-manager/nm-dns-manager.c | 15 --------------- 2 files changed, 19 deletions(-) diff --git a/man/NetworkManager.conf.5.in b/man/NetworkManager.conf.5.in index fca2a4dbb4..bd9b2cc5a8 100644 --- a/man/NetworkManager.conf.5.in +++ b/man/NetworkManager.conf.5.in @@ -104,10 +104,6 @@ this plugin uses dnsmasq to provide local caching nameserver functionality. .I bind this plugin uses the ISC BIND program to provide local caching nameserver functionality. -.TP -.I chromium -this plugin provides DNS information to the Chromium web browser. It does not -provide local caching nameserver functionality. .RE .SS [keyfile] This section contains keyfile-specific options and thus only has effect when using \fIkeyfile\fP plugin. diff --git a/src/dns-manager/nm-dns-manager.c b/src/dns-manager/nm-dns-manager.c index af71320b2f..823517fb78 100644 --- a/src/dns-manager/nm-dns-manager.c +++ b/src/dns-manager/nm-dns-manager.c @@ -1002,12 +1002,6 @@ nm_dns_bind_new (void) return NULL; } -static GObject * -nm_dns_chromium_new (void) -{ - return NULL; -} - static void load_plugins (NMDnsManager *self, const char **plugins) { @@ -1023,8 +1017,6 @@ load_plugins (NMDnsManager *self, const char **plugins) plugin = NM_DNS_PLUGIN (nm_dns_dnsmasq_new ()); else if (!strcasecmp (*iter, "bind")) plugin = NM_DNS_PLUGIN (nm_dns_bind_new ()); - else if (!strcasecmp (*iter, "chromium")) - plugin = NM_DNS_PLUGIN (nm_dns_chromium_new ()); else { nm_log_warn (LOGD_DNS, "Unknown DNS plugin '%s'", *iter);\ continue; @@ -1052,13 +1044,6 @@ load_plugins (NMDnsManager *self, const char **plugins) } } else { /* Create default plugins */ - - /* Chromium support */ -#if 0 - plugin = NM_DNS_PLUGIN (nm_dns_chromium_new ()); - g_assert (plugin); - priv->plugins = g_slist_append (priv->plugins, plugin); -#endif } } -- cgit v1.2.1 From a33c3330bef581e51b2d3095222eba6679427f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Thu, 16 Sep 2010 16:15:32 +0200 Subject: man: document 'no-auto-default' option in NetworkManager.conf.5 --- man/NetworkManager.conf.5.in | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/man/NetworkManager.conf.5.in b/man/NetworkManager.conf.5.in index c3af611675..44d6da1be0 100644 --- a/man/NetworkManager.conf.5.in +++ b/man/NetworkManager.conf.5.in @@ -2,7 +2,7 @@ .\" .\" Copyright (C) 2010 Red Hat, Inc. .\" -.TH "NetworkManager.conf" "5" "1 February 2010" "" +.TH "NetworkManager.conf" "5" "16 September 2010" "" .SH NAME NetworkManager.conf \- NetworkManager configuration file .SH SYNOPSIS @@ -87,6 +87,23 @@ This key sets up what DHCP client NetworkManager will use. Presently \fIdhclient\fP and \fIdhcpcd\fP are supported. The client configured here should be available on your system too. If this key is missing, available DHCP clients are looked for in this order: dhclient, dhcpcd. +.TP +.B no-auto-default=\fI\fP,\fI\fP,... +Set devices for which NetworkManager shouldn't create default wired connection +(Auto eth0). NetworkManager creates a default wired connection for any wired +device that is managed and doesn't have a connection configured. List a device +in this option to inhibit creating the default connection for the device. +.br +When the default wired connection is deleted or saved to a new persistent connection +by a plugin, the MAC address of the wired device is automatically added to this list +to prevent creating the default connection for that device again. +Devices are specified by their MAC addresses, in lowercase. Multiple +entries are separated by commas. +.br +Example: +.nf +no-auto-default=00:22:68:5c:5d:c4,00:1e:65:ff:aa:ee +.fi .SS [keyfile] This section contains keyfile-specific options and thus only has effect when using \fIkeyfile\fP plugin. .TP -- cgit v1.2.1 From e0a2aeaa7c7ac9b7953565ef20a5349b14305502 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 16 Sep 2010 15:31:47 -0500 Subject: dns: add BIND9 local caching nameserver support For some reason split DNS doesn't work yet (all queries are directed to the VPN nameserver if a VPN is active) but it otherwise works. --- src/dns-manager/Makefile.am | 4 +- src/dns-manager/nm-dns-bind.c | 528 +++++++++++++++++++++++++++++++++++++++ src/dns-manager/nm-dns-bind.h | 47 ++++ src/dns-manager/nm-dns-manager.c | 7 +- 4 files changed, 579 insertions(+), 7 deletions(-) create mode 100644 src/dns-manager/nm-dns-bind.c create mode 100644 src/dns-manager/nm-dns-bind.h diff --git a/src/dns-manager/Makefile.am b/src/dns-manager/Makefile.am index 2a56fb8602..1ffe62dcf0 100644 --- a/src/dns-manager/Makefile.am +++ b/src/dns-manager/Makefile.am @@ -12,7 +12,9 @@ libdns_manager_la_SOURCES = \ nm-dns-plugin.h \ nm-dns-plugin.c \ nm-dns-dnsmasq.h \ - nm-dns-dnsmasq.c + nm-dns-dnsmasq.c \ + nm-dns-bind.h \ + nm-dns-bind.c libdns_manager_la_CPPFLAGS = \ $(DBUS_CFLAGS) \ diff --git a/src/dns-manager/nm-dns-bind.c b/src/dns-manager/nm-dns-bind.c new file mode 100644 index 0000000000..c225eb95d2 --- /dev/null +++ b/src/dns-manager/nm-dns-bind.c @@ -0,0 +1,528 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2010 Dan Williams + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "nm-dns-bind.h" +#include "nm-logging.h" +#include "nm-ip4-config.h" +#include "nm-ip6-config.h" + +G_DEFINE_TYPE (NMDnsBind, nm_dns_bind, NM_TYPE_DNS_PLUGIN) + +#define NM_DNS_BIND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DNS_BIND, NMDnsBindPrivate)) + +#define PIDFILE LOCALSTATEDIR "/run/nm-dns-named.pid" +#define CONFFILE LOCALSTATEDIR "/run/nm-dns-named.conf" + +typedef struct { + GPid pid; +} NMDnsBindPrivate; + +/*******************************************/ + +static inline const char * +find_bind (void) +{ + static const char *paths[] = { + "/usr/local/sbin/named", + "/usr/sbin/named", + "/sbin/named", + NULL + }; + const char **binary = paths; + + while (*binary != NULL) { + if (g_file_test (*binary, G_FILE_TEST_EXISTS)) + return *binary; + binary++; + } + return NULL; +} + +static gboolean +start_bind (NMDnsBind *self) +{ + const char *argv[10]; + + argv[0] = find_bind (); + argv[1] = "-f"; /* don't daemonize; stay in foreground */ + argv[2] = "-c"; + argv[3] = CONFFILE; + argv[4] = NULL; + + /* And finally spawn bind */ + return nm_dns_plugin_child_spawn (NM_DNS_PLUGIN (self), argv, PIDFILE, "bin/named"); +} + +/*******************************************/ + +static gboolean +find_address (GPtrArray *array, const char *addr) +{ + int n; + + for (n = 0; n < array->len; n++) { + if (g_strcmp0 ((const char*) g_ptr_array_index (array, n), addr) == 0) + return TRUE; + } + return FALSE; +} + +static void +add_ip4_nameservers (NMIP4Config *ip4, GPtrArray *array) +{ + int i; + + for (i = 0; i < nm_ip4_config_get_num_nameservers (ip4); i++) { + char buf[INET_ADDRSTRLEN + 1]; + struct in_addr addr; + + memset (&buf[0], 0, sizeof (buf)); + addr.s_addr = nm_ip4_config_get_nameserver (ip4, i); + if (inet_ntop (AF_INET, &addr, buf, sizeof (buf))) { + if (!find_address (array, buf)) + g_ptr_array_add (array, g_strdup (buf)); + } + } +} + +static gboolean +ip6_addr_to_string (const struct in6_addr *addr, char *buf, size_t buflen) +{ + /* inet_ntop is probably supposed to do this for us, but it doesn't */ + if (IN6_IS_ADDR_V4MAPPED (addr)) + return !!inet_ntop (AF_INET, &(addr->s6_addr32[3]), buf, buflen); + + return !!inet_ntop (AF_INET6, addr, buf, buflen); +} + +static void +add_ip6_nameservers (NMIP6Config *ip6, GPtrArray *array) +{ + char buf[INET6_ADDRSTRLEN + 1]; + int i; + + for (i = 0; i < nm_ip6_config_get_num_nameservers (ip6); i++) { + memset (buf, 0, sizeof (buf)); + if (ip6_addr_to_string (nm_ip6_config_get_nameserver (ip6, i), buf, sizeof (buf))) { + if (!find_address (array, buf)) + g_ptr_array_add (array, g_strdup (buf)); + } + } +} + +typedef struct { + guint32 dhash; + char *domain; + GPtrArray *servers; +} ZoneInfo; + +static ZoneInfo * +zone_new (const char *domain) +{ + ZoneInfo *info; + + g_return_val_if_fail (domain != NULL, NULL); + + info = g_malloc0 (sizeof (ZoneInfo)); + info->domain = g_strdup (domain); + info->dhash = g_str_hash (domain); + info->servers = g_ptr_array_sized_new (4); + return info; +} + +static void +zone_add_nameserver (ZoneInfo *info, const char *server) +{ + guint32 i; + + g_return_if_fail (info != NULL); + g_return_if_fail (server != NULL); + + for (i = 0; i < info->servers->len; i++) { + if (g_strcmp0 ((char *) g_ptr_array_index (info->servers, i), server) == 0) + return; + } + g_ptr_array_add (info->servers, g_strdup (server)); +} + +static void +zone_free (ZoneInfo *info) +{ + g_return_if_fail (info != NULL); + + g_free (info->domain); + g_ptr_array_foreach (info->servers, (GFunc) g_free, NULL); + g_ptr_array_free (info->servers, TRUE); + memset (info, 0, sizeof (ZoneInfo)); + g_free (info); +} + +static ZoneInfo * +find_zone (GPtrArray *zones, const char *domain) +{ + guint32 dhash, i; + + g_return_val_if_fail (domain != NULL, FALSE); + + dhash = g_str_hash (domain); + for (i = 0; i < zones->len; i++) { + ZoneInfo *zone = g_ptr_array_index (zones, i); + + if (zone->dhash == dhash) + return zone; + } + return NULL; +} + +static void +add_zone (GObject *ip, GPtrArray *zones) +{ + guint32 i, j, ns, nd, nn; + GPtrArray *to_add; + ZoneInfo *z; + + if (NM_IS_IP4_CONFIG (ip)) { + ns = nm_ip4_config_get_num_searches (NM_IP4_CONFIG (ip)); + nd = nm_ip4_config_get_num_domains (NM_IP4_CONFIG (ip)); + nn = nm_ip4_config_get_num_nameservers (NM_IP4_CONFIG (ip)); + } else if (NM_IS_IP6_CONFIG (ip)) { + ns = nm_ip6_config_get_num_searches (NM_IP6_CONFIG (ip)); + nd = nm_ip6_config_get_num_domains (NM_IP6_CONFIG (ip)); + nn = nm_ip6_config_get_num_nameservers (NM_IP6_CONFIG (ip)); + } else + g_assert_not_reached (); + + /* If we don't have any domains or searches, or we don't have any + * nameservers, we can't do split DNS for this config. + */ + if ((!nd && !ns) || !nn) + return; + + to_add = g_ptr_array_sized_new (MAX (ns, nd)); + + /* searches are preferred over domains */ + for (i = 0; i < ns; i++) { + const char *domain = NULL; + + if (NM_IS_IP4_CONFIG (ip)) + domain = nm_ip4_config_get_search (NM_IP4_CONFIG (ip), i); + else if (NM_IS_IP6_CONFIG (ip)) + domain = nm_ip6_config_get_search (NM_IP6_CONFIG (ip), i); + + z = find_zone (zones, domain); + if (!z) { + z = zone_new (domain); + g_ptr_array_add (zones, z); + } + g_ptr_array_add (to_add, z); + } + + if (ns == 0) { + /* If no searches, add any domains */ + for (i = 0; i < nd; i++) { + const char *domain = NULL; + + if (NM_IS_IP4_CONFIG (ip)) + domain = nm_ip4_config_get_domain (NM_IP4_CONFIG (ip), i); + else if (NM_IS_IP6_CONFIG (ip)) + domain = nm_ip6_config_get_domain (NM_IP6_CONFIG (ip), i); + + z = find_zone (zones, domain); + if (!z) { + z = zone_new (domain); + g_ptr_array_add (zones, z); + } + g_ptr_array_add (to_add, z); + } + } + + /* Now add the nameservers to every zone for this config */ + for (i = 0; i < nn; i++) { + char buf[INET6_ADDRSTRLEN + 1]; + struct in_addr addr4; + const struct in6_addr *addr6; + + memset (&buf[0], 0, sizeof (buf)); + + if (NM_IS_IP4_CONFIG (ip)) { + addr4.s_addr = nm_ip4_config_get_nameserver (NM_IP4_CONFIG (ip), i); + if (!inet_ntop (AF_INET, &addr4, buf, sizeof (buf))) + continue; + } else if (NM_IS_IP6_CONFIG (ip)) { + addr6 = nm_ip6_config_get_nameserver (NM_IP6_CONFIG (ip), i); + if (!ip6_addr_to_string (addr6, buf, sizeof (buf))) + continue; + } + + /* Add this nameserver to every zone from this IP config */ + for (j = 0; j < to_add->len; j++) { + z = g_ptr_array_index (to_add, j); + zone_add_nameserver (z, buf); + } + } + + g_ptr_array_free (to_add, TRUE); +} + +static gboolean +update (NMDnsPlugin *plugin, + const GSList *vpn_configs, + const GSList *dev_configs, + const GSList *other_configs, + const char *hostname) +{ + NMDnsBind *self = NM_DNS_BIND (plugin); + NMDnsBindPrivate *priv = NM_DNS_BIND_GET_PRIVATE (self); + GString *conf; + GPtrArray *globals, *zones; + GSList *iter; + GError *error = NULL; + int ignored, i, j; + gboolean success = FALSE; + + /* Build up the new bind config file */ + conf = g_string_sized_new (200); + globals = g_ptr_array_sized_new (6); + + /* If any of the VPN configs *don't* have domains or searches, then we + * dont' have any split DNS configuration for them, and we add them + * first in the global nameserver lists. Otherwise we add them later as + * split DNS zones. + */ + for (iter = (GSList *) vpn_configs; iter;iter = g_slist_next (iter)) { + if (NM_IS_IP4_CONFIG (iter->data)) { + NMIP4Config *ip4 = NM_IP4_CONFIG (iter->data); + + if (!nm_ip4_config_get_num_domains (ip4) && !nm_ip4_config_get_num_searches (ip4)) + add_ip4_nameservers (ip4, globals); + } else if (NM_IS_IP6_CONFIG (iter->data)) { + NMIP6Config *ip6 = NM_IP6_CONFIG (iter->data); + + if (!nm_ip6_config_get_num_domains (ip6) && !nm_ip6_config_get_num_searches (ip6)) + add_ip6_nameservers (ip6, globals); + } + } + + /* Get a list of global upstream servers with dupe checking */ + for (iter = (GSList *) dev_configs; iter;iter = g_slist_next (iter)) { + if (NM_IS_IP4_CONFIG (iter->data)) + add_ip4_nameservers (NM_IP4_CONFIG (iter->data), globals); + else if (NM_IS_IP6_CONFIG (iter->data)) + add_ip6_nameservers (NM_IP6_CONFIG (iter->data), globals); + } + + /* And any other random configs with dupe checking */ + for (iter = (GSList *) other_configs; iter;iter = g_slist_next (iter)) { + if (NM_IS_IP4_CONFIG (iter->data)) + add_ip4_nameservers (NM_IP4_CONFIG (iter->data), globals); + else if (NM_IS_IP6_CONFIG (iter->data)) + add_ip6_nameservers (NM_IP6_CONFIG (iter->data), globals); + } + + g_string_append (conf, + "options {\n" + " directory \"" LOCALSTATEDIR "/named\";\n" + " query-source address * port 53;\n" + " forward only;\n" + " recursion yes;\n" + " listen-on-v6 { ::1; };\n" + " listen-on { 127.0.0.1; };\n" + " forwarders {\n"); + + for (i = 0; i < globals->len; i++) { + char *ns = g_ptr_array_index (globals, i); + + g_string_append_printf (conf, " %s;\n", ns); + g_free (ns); + } + g_ptr_array_free (globals, TRUE); + + g_string_append (conf, + " };\n" + "};\n\n"); + + /* Build up the list of any split DNS zones, avoiding duplicates */ + zones = g_ptr_array_sized_new (4); + for (iter = (GSList *) vpn_configs; iter;iter = g_slist_next (iter)) { + if (NM_IS_IP4_CONFIG (iter->data)) + add_zone (G_OBJECT (iter->data), zones); + else if (NM_IS_IP6_CONFIG (iter->data)) + add_zone (G_OBJECT (iter->data), zones); + } + + /* Add all the zones to the config */ + for (i = 0; i < zones->len; i++) { + ZoneInfo *z = g_ptr_array_index (zones, i); + + g_string_append_printf (conf, + "zone \"%s\" IN {\n" + " type forward;\n" + " forward only;\n" + " forwarders {\n", + z->domain); + + /* Add each nameserver for this zone */ + for (j = 0; j < z->servers->len; j++) { + g_string_append_printf (conf, + " %s;\n", + (const char *) g_ptr_array_index (z->servers, j)); + } + + g_string_append (conf, + " };\n" + "};\n\n"); + + zone_free (z); + } + g_ptr_array_free (zones, TRUE); + + /* Write out the config file */ + if (!g_file_set_contents (CONFFILE, conf->str, -1, &error)) { + nm_log_warn (LOGD_DNS, "Failed to write named config file %s: (%d) %s", + CONFFILE, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); + goto out; + } + ignored = chmod (CONFFILE, 0600); + + nm_log_dbg (LOGD_DNS, "BIND local caching DNS configuration:"); + nm_log_dbg (LOGD_DNS, "%s", conf->str); + + if (priv->pid) { + /* Send it SIGHUP to reload the new configuration */ + if (kill (priv->pid, SIGHUP) == 0) + success = TRUE; + else { + /* Sigh... some error. Kill it and restart */ + nm_dns_plugin_child_kill (NM_DNS_PLUGIN (self)); + priv->pid = 0; + } + } + + if (!success) { + /* Spawn it */ + priv->pid = start_bind (self); + if (priv->pid) + success = TRUE; + } + +out: + g_string_free (conf, TRUE); + return success; +} + +/****************************************************************/ + +static void +child_quit (NMDnsPlugin *plugin, gint status) +{ + NMDnsBind *self = NM_DNS_BIND (plugin); + gboolean failed = TRUE; + int err; + + if (WIFEXITED (status)) { + err = WEXITSTATUS (status); + if (err) { + nm_log_warn (LOGD_DNS, "named exited with error %d", err); + } else + failed = FALSE; + } else if (WIFSTOPPED (status)) { + nm_log_warn (LOGD_DNS, "named stopped unexpectedly with signal %d", WSTOPSIG (status)); + } else if (WIFSIGNALED (status)) { + nm_log_warn (LOGD_DNS, "named died with signal %d", WTERMSIG (status)); + } else { + nm_log_warn (LOGD_DNS, "named died from an unknown cause"); + } + unlink (CONFFILE); + + if (failed) + g_signal_emit_by_name (self, NM_DNS_PLUGIN_FAILED); +} + +/****************************************************************/ + +static gboolean +init (NMDnsPlugin *plugin) +{ + return TRUE; +} + +static gboolean +is_caching (NMDnsPlugin *plugin) +{ + return TRUE; +} + +static const char * +get_name (NMDnsPlugin *plugin) +{ + return "bind"; +} + +/****************************************************************/ + +NMDnsBind * +nm_dns_bind_new (void) +{ + return (NMDnsBind *) g_object_new (NM_TYPE_DNS_BIND, NULL); +} + +static void +nm_dns_bind_init (NMDnsBind *self) +{ +} + +static void +dispose (GObject *object) +{ + unlink (CONFFILE); + + G_OBJECT_CLASS (nm_dns_bind_parent_class)->dispose (object); +} + +static void +nm_dns_bind_class_init (NMDnsBindClass *dns_class) +{ + NMDnsPluginClass *plugin_class = NM_DNS_PLUGIN_CLASS (dns_class); + GObjectClass *object_class = G_OBJECT_CLASS (dns_class); + + g_type_class_add_private (dns_class, sizeof (NMDnsBindPrivate)); + + object_class->dispose = dispose; + + plugin_class->init = init; + plugin_class->child_quit = child_quit; + plugin_class->is_caching = is_caching; + plugin_class->update = update; + plugin_class->get_name = get_name; +} + diff --git a/src/dns-manager/nm-dns-bind.h b/src/dns-manager/nm-dns-bind.h new file mode 100644 index 0000000000..7127265f18 --- /dev/null +++ b/src/dns-manager/nm-dns-bind.h @@ -0,0 +1,47 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2010 Red Hat, Inc. + */ + +#ifndef NM_DNS_BIND_H +#define NM_DNS_BIND_H + +#include +#include + +#include "nm-dns-plugin.h" + +#define NM_TYPE_DNS_BIND (nm_dns_bind_get_type ()) +#define NM_DNS_BIND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DNS_BIND, NMDnsBind)) +#define NM_DNS_BIND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DNS_BIND, NMDnsBindClass)) +#define NM_IS_DNS_BIND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DNS_BIND)) +#define NM_IS_DNS_BIND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DNS_BIND)) +#define NM_DNS_BIND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DNS_BIND, NMDnsBindClass)) + +typedef struct { + NMDnsPlugin parent; +} NMDnsBind; + +typedef struct { + NMDnsPluginClass parent; +} NMDnsBindClass; + +GType nm_dns_bind_get_type (void); + +NMDnsBind *nm_dns_bind_new (void); + +#endif /* NM_DNS_BIND_H */ + diff --git a/src/dns-manager/nm-dns-manager.c b/src/dns-manager/nm-dns-manager.c index 823517fb78..a0c6a6c4ce 100644 --- a/src/dns-manager/nm-dns-manager.c +++ b/src/dns-manager/nm-dns-manager.c @@ -45,6 +45,7 @@ #include "nm-dns-plugin.h" #include "nm-dns-dnsmasq.h" +#include "nm-dns-bind.h" #ifdef HAVE_SELINUX #include @@ -996,12 +997,6 @@ nm_dns_manager_set_hostname (NMDnsManager *mgr, } } -static GObject * -nm_dns_bind_new (void) -{ - return NULL; -} - static void load_plugins (NMDnsManager *self, const char **plugins) { -- cgit v1.2.1 From c40d79ae9727232701abcad94682187cf7122554 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 16 Sep 2010 15:43:22 -0500 Subject: keyfile: be chattier, especially about parsing errors This should help people debug issues with keyfile not recognizing files since it'll actually print out something when it fails to parse stuff. Also logs changes, new connections, and deletions. --- system-settings/plugins/keyfile/Makefile.am | 3 +- system-settings/plugins/keyfile/io/reader.c | 171 ++++++++++++--------- system-settings/plugins/keyfile/io/reader.h | 2 +- .../plugins/keyfile/nm-keyfile-connection.c | 104 ++++++------- .../plugins/keyfile/nm-keyfile-connection.h | 2 +- system-settings/plugins/keyfile/plugin.c | 109 +++++++++---- .../plugins/keyfile/tests/test-keyfile.c | 26 ++-- 7 files changed, 236 insertions(+), 181 deletions(-) diff --git a/system-settings/plugins/keyfile/Makefile.am b/system-settings/plugins/keyfile/Makefile.am index ca4d3cd3f3..a49b51b2c0 100644 --- a/system-settings/plugins/keyfile/Makefile.am +++ b/system-settings/plugins/keyfile/Makefile.am @@ -23,7 +23,8 @@ libnm_settings_plugin_keyfile_la_CPPFLAGS = \ $(DBUS_CFLAGS) \ -DSYSCONFDIR=\"$(sysconfdir)\" \ -DG_DISABLE_DEPRECATED \ - -DKEYFILE_DIR=\""$(keyfiledir)"\" + -DKEYFILE_DIR=\""$(keyfiledir)"\" \ + -DKEYFILE_PLUGIN_NAME=\""keyfile"\" libnm_settings_plugin_keyfile_la_LDFLAGS = -module -avoid-version libnm_settings_plugin_keyfile_la_LIBADD = \ diff --git a/system-settings/plugins/keyfile/io/reader.c b/system-settings/plugins/keyfile/io/reader.c index 50c3efe850..55ef12706c 100644 --- a/system-settings/plugins/keyfile/io/reader.c +++ b/system-settings/plugins/keyfile/io/reader.c @@ -40,6 +40,7 @@ #include #include #include +#include #include "nm-dbus-glib-types.h" #include "reader.h" @@ -986,108 +987,126 @@ read_vpn_secrets (GKeyFile *file, NMSettingVPN *s_vpn) } NMConnection * -connection_from_file (const char *filename) +connection_from_file (const char *filename, GError **error) { GKeyFile *key_file; struct stat statbuf; gboolean bad_owner, bad_permissions; NMConnection *connection = NULL; - GError *err = NULL; - - if (stat (filename, &statbuf) != 0 || !S_ISREG (statbuf.st_mode)) + NMSettingConnection *s_con; + NMSettingBluetooth *s_bt; + NMSetting *setting; + gchar **groups; + gsize length; + int i; + gboolean vpn_secrets = FALSE; + const char *ctype, *tmp; + GError *verify_error = NULL; + + if (stat (filename, &statbuf) != 0 || !S_ISREG (statbuf.st_mode)) { + g_set_error_literal (error, + NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, + "File did not exist or was not a regular file"); return NULL; + } bad_owner = getuid () != statbuf.st_uid; bad_permissions = statbuf.st_mode & 0077; if (bad_owner || bad_permissions) { - g_warning ("Ignoring insecure configuration file '%s'", filename); + g_set_error (error, + NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, + "File permissions (%o) or owner (%d) were insecure", + statbuf.st_mode, statbuf.st_uid); return NULL; } key_file = g_key_file_new (); - if (g_key_file_load_from_file (key_file, filename, G_KEY_FILE_NONE, &err)) { - NMSettingConnection *s_con; - NMSettingBluetooth *s_bt; - NMSetting *setting; - gchar **groups; - gsize length; - int i; - gboolean vpn_secrets = FALSE; - const char *ctype, *tmp; - - connection = nm_connection_new (); + if (!g_key_file_load_from_file (key_file, filename, G_KEY_FILE_NONE, error)) + goto out; - groups = g_key_file_get_groups (key_file, &length); - for (i = 0; i < length; i++) { - /* Only read out secrets when needed */ - if (!strcmp (groups[i], VPN_SECRETS_GROUP)) { - vpn_secrets = TRUE; - continue; - } + connection = nm_connection_new (); - setting = read_setting (key_file, groups[i]); - if (setting) - nm_connection_add_setting (connection, setting); + groups = g_key_file_get_groups (key_file, &length); + for (i = 0; i < length; i++) { + /* Only read out secrets when needed */ + if (!strcmp (groups[i], VPN_SECRETS_GROUP)) { + vpn_secrets = TRUE; + continue; } - /* Make sure that we have the base device type setting even if - * the keyfile didn't include it, which can happen when the base - * device type setting is all default values (like ethernet). - */ - s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); - if (s_con) { - ctype = nm_setting_connection_get_connection_type (s_con); - setting = nm_connection_get_setting_by_name (connection, ctype); - if (ctype) { - gboolean add_serial = FALSE; - NMSetting *new_setting = NULL; - - if (!setting && !strcmp (ctype, NM_SETTING_WIRED_SETTING_NAME)) - new_setting = nm_setting_wired_new (); - else if (!strcmp (ctype, NM_SETTING_BLUETOOTH_SETTING_NAME)) { - s_bt = (NMSettingBluetooth *) nm_connection_get_setting (connection, NM_TYPE_SETTING_BLUETOOTH); - if (s_bt) { - tmp = nm_setting_bluetooth_get_connection_type (s_bt); - if (tmp && !strcmp (tmp, NM_SETTING_BLUETOOTH_TYPE_DUN)) - add_serial = TRUE; - } - } else if (!strcmp (ctype, NM_SETTING_GSM_SETTING_NAME)) - add_serial = TRUE; - else if (!strcmp (ctype, NM_SETTING_CDMA_SETTING_NAME)) - add_serial = TRUE; - - /* Bluetooth DUN, GSM, and CDMA connections require a serial setting */ - if (add_serial && !nm_connection_get_setting (connection, NM_TYPE_SETTING_SERIAL)) - new_setting = nm_setting_serial_new (); - - if (new_setting) - nm_connection_add_setting (connection, new_setting); - } - } + setting = read_setting (key_file, groups[i]); + if (setting) + nm_connection_add_setting (connection, setting); + } - /* Serial connections require a PPP setting too */ - if (nm_connection_get_setting (connection, NM_TYPE_SETTING_SERIAL)) { - if (!nm_connection_get_setting (connection, NM_TYPE_SETTING_PPP)) - nm_connection_add_setting (connection, nm_setting_ppp_new ()); - } + /* Make sure that we have the base device type setting even if + * the keyfile didn't include it, which can happen when the base + * device type setting is all default values (like ethernet). + */ + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + if (s_con) { + ctype = nm_setting_connection_get_connection_type (s_con); + setting = nm_connection_get_setting_by_name (connection, ctype); + if (ctype) { + gboolean add_serial = FALSE; + NMSetting *new_setting = NULL; + + if (!setting && !strcmp (ctype, NM_SETTING_WIRED_SETTING_NAME)) + new_setting = nm_setting_wired_new (); + else if (!strcmp (ctype, NM_SETTING_BLUETOOTH_SETTING_NAME)) { + s_bt = (NMSettingBluetooth *) nm_connection_get_setting (connection, NM_TYPE_SETTING_BLUETOOTH); + if (s_bt) { + tmp = nm_setting_bluetooth_get_connection_type (s_bt); + if (tmp && !strcmp (tmp, NM_SETTING_BLUETOOTH_TYPE_DUN)) + add_serial = TRUE; + } + } else if (!strcmp (ctype, NM_SETTING_GSM_SETTING_NAME)) + add_serial = TRUE; + else if (!strcmp (ctype, NM_SETTING_CDMA_SETTING_NAME)) + add_serial = TRUE; - /* Handle vpn secrets after the 'vpn' setting was read */ - if (vpn_secrets) { - NMSettingVPN *s_vpn; + /* Bluetooth DUN, GSM, and CDMA connections require a serial setting */ + if (add_serial && !nm_connection_get_setting (connection, NM_TYPE_SETTING_SERIAL)) + new_setting = nm_setting_serial_new (); - s_vpn = (NMSettingVPN *) nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN); - if (s_vpn) - read_vpn_secrets (key_file, s_vpn); + if (new_setting) + nm_connection_add_setting (connection, new_setting); } + } - g_strfreev (groups); - } else { - g_warning ("Error parsing file '%s': %s", filename, err->message); - g_error_free (err); + /* Serial connections require a PPP setting too */ + if (nm_connection_get_setting (connection, NM_TYPE_SETTING_SERIAL)) { + if (!nm_connection_get_setting (connection, NM_TYPE_SETTING_PPP)) + nm_connection_add_setting (connection, nm_setting_ppp_new ()); } - g_key_file_free (key_file); + /* Handle vpn secrets after the 'vpn' setting was read */ + if (vpn_secrets) { + NMSettingVPN *s_vpn; + + s_vpn = (NMSettingVPN *) nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN); + if (s_vpn) + read_vpn_secrets (key_file, s_vpn); + } + g_strfreev (groups); + + /* Verify the connection */ + if (!nm_connection_verify (connection, &verify_error)) { + g_set_error (error, + NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, + "invalid or missing connection property '%s'", + (verify_error && verify_error->message) ? verify_error->message : "(unknown)"); + g_clear_error (&verify_error); + g_object_unref (connection); + connection = NULL; + } + +out: + g_key_file_free (key_file); return connection; } diff --git a/system-settings/plugins/keyfile/io/reader.h b/system-settings/plugins/keyfile/io/reader.h index beac866a25..0982c87043 100644 --- a/system-settings/plugins/keyfile/io/reader.h +++ b/system-settings/plugins/keyfile/io/reader.h @@ -27,6 +27,6 @@ #include #include -NMConnection *connection_from_file (const char *filename); +NMConnection *connection_from_file (const char *filename, GError **error); #endif /* _KEYFILE_PLUGIN_READER_H */ diff --git a/system-settings/plugins/keyfile/nm-keyfile-connection.c b/system-settings/plugins/keyfile/nm-keyfile-connection.c index 1c90961bef..2d234fd5dd 100644 --- a/system-settings/plugins/keyfile/nm-keyfile-connection.c +++ b/system-settings/plugins/keyfile/nm-keyfile-connection.c @@ -16,7 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Copyright (C) 2008 Novell, Inc. - * Copyright (C) 2008 Red Hat, Inc. + * Copyright (C) 2008 - 2010 Red Hat, Inc. */ #include @@ -26,6 +26,7 @@ #include #include +#include "nm-system-config-interface.h" #include "nm-dbus-glib-types.h" #include "nm-keyfile-connection.h" #include "reader.h" @@ -53,13 +54,55 @@ enum { }; NMKeyfileConnection * -nm_keyfile_connection_new (const char *filename) +nm_keyfile_connection_new (const char *filename, GError **error) { + GObject *object; + NMKeyfileConnectionPrivate *priv; + NMSettingConnection *s_con; + NMConnection *tmp; + g_return_val_if_fail (filename != NULL, NULL); - return (NMKeyfileConnection *) g_object_new (NM_TYPE_KEYFILE_CONNECTION, - NM_KEYFILE_CONNECTION_FILENAME, filename, - NULL); + tmp = connection_from_file (filename, error); + if (!tmp) + return NULL; + + object = (GObject *) g_object_new (NM_TYPE_KEYFILE_CONNECTION, + NM_KEYFILE_CONNECTION_FILENAME, filename, + NULL); + if (!object) { + g_object_unref (tmp); + return NULL; + } + + priv = NM_KEYFILE_CONNECTION_GET_PRIVATE (object); + g_assert (priv->filename); + + /* Update our settings with what was read from the file */ + nm_sysconfig_connection_update (NM_SYSCONFIG_CONNECTION (object), tmp, FALSE, NULL); + g_object_unref (tmp); + + /* if for some reason the connection didn't have a UUID, add one */ + s_con = (NMSettingConnection *) nm_connection_get_setting (NM_CONNECTION (object), NM_TYPE_SETTING_CONNECTION); + if (s_con && !nm_setting_connection_get_uuid (s_con)) { + GError *write_error = NULL; + char *uuid; + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, NM_SETTING_CONNECTION_UUID, uuid, NULL); + g_free (uuid); + + if (!write_connection (NM_CONNECTION (object), KEYFILE_DIR, 0, 0, NULL, &write_error)) { + PLUGIN_WARN (KEYFILE_PLUGIN_NAME, + "Couldn't update connection %s with a UUID: (%d) %s", + nm_setting_connection_get_id (s_con), + write_error ? write_error->code : -1, + (write_error && write_error->message) ? write_error->message : "(unknown)"); + g_propagate_error (error, write_error); + } + } + + return NM_KEYFILE_CONNECTION (object); } const char * @@ -122,56 +165,6 @@ nm_keyfile_connection_init (NMKeyfileConnection *connection) { } -static GObject * -constructor (GType type, - guint n_construct_params, - GObjectConstructParam *construct_params) -{ - GObject *object; - NMKeyfileConnectionPrivate *priv; - NMSettingConnection *s_con; - NMConnection *tmp; - - object = G_OBJECT_CLASS (nm_keyfile_connection_parent_class)->constructor (type, n_construct_params, construct_params); - - if (!object) - return NULL; - - priv = NM_KEYFILE_CONNECTION_GET_PRIVATE (object); - - g_assert (priv->filename); - - tmp = connection_from_file (priv->filename); - if (!tmp) { - g_object_unref (object); - return NULL; - } - - nm_sysconfig_connection_update (NM_SYSCONFIG_CONNECTION (object), tmp, FALSE, NULL); - g_object_unref (tmp); - - /* if for some reason the connection didn't have a UUID, add one */ - s_con = (NMSettingConnection *) nm_connection_get_setting (NM_CONNECTION (object), NM_TYPE_SETTING_CONNECTION); - if (s_con && !nm_setting_connection_get_uuid (s_con)) { - GError *error = NULL; - char *uuid; - - uuid = nm_utils_uuid_generate (); - g_object_set (s_con, NM_SETTING_CONNECTION_UUID, uuid, NULL); - g_free (uuid); - - if (!write_connection (NM_CONNECTION (object), KEYFILE_DIR, 0, 0, NULL, &error)) { - g_warning ("Couldn't update connection %s with a UUID: (%d) %s", - nm_setting_connection_get_id (s_con), - error ? error->code : 0, - (error && error->message) ? error->message : "unknown"); - g_error_free (error); - } - } - - return object; -} - static void finalize (GObject *object) { @@ -225,7 +218,6 @@ nm_keyfile_connection_class_init (NMKeyfileConnectionClass *keyfile_connection_c g_type_class_add_private (keyfile_connection_class, sizeof (NMKeyfileConnectionPrivate)); /* Virtual methods */ - object_class->constructor = constructor; object_class->set_property = set_property; object_class->get_property = get_property; object_class->finalize = finalize; diff --git a/system-settings/plugins/keyfile/nm-keyfile-connection.h b/system-settings/plugins/keyfile/nm-keyfile-connection.h index 3b4e050c2f..68e795a6ce 100644 --- a/system-settings/plugins/keyfile/nm-keyfile-connection.h +++ b/system-settings/plugins/keyfile/nm-keyfile-connection.h @@ -45,7 +45,7 @@ typedef struct { GType nm_keyfile_connection_get_type (void); -NMKeyfileConnection *nm_keyfile_connection_new (const char *filename); +NMKeyfileConnection *nm_keyfile_connection_new (const char *filename, GError **error); const char *nm_keyfile_connection_get_filename (NMKeyfileConnection *self); diff --git a/system-settings/plugins/keyfile/plugin.c b/system-settings/plugins/keyfile/plugin.c index 36f47ccdc5..f48edbeb4c 100644 --- a/system-settings/plugins/keyfile/plugin.c +++ b/system-settings/plugins/keyfile/plugin.c @@ -16,7 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Copyright (C) 2008 Novell, Inc. - * Copyright (C) 2008 Red Hat, Inc. + * Copyright (C) 2008 - 2010 Red Hat, Inc. */ #include @@ -40,7 +40,7 @@ #include "writer.h" #define KEYFILE_PLUGIN_NAME "keyfile" -#define KEYFILE_PLUGIN_INFO "(c) 2007 - 2008 Red Hat, Inc. To report bugs please use the NetworkManager mailing list." +#define KEYFILE_PLUGIN_INFO "(c) 2007 - 2010 Red Hat, Inc. To report bugs please use the NetworkManager mailing list." #define CONF_FILE SYSCONFDIR "/NetworkManager/NetworkManager.conf" #define OLD_CONF_FILE SYSCONFDIR "/NetworkManager/nm-system-settings.conf" @@ -74,31 +74,49 @@ read_connections (NMSystemConfigInterface *config) { SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (config); GDir *dir; - GError *err = NULL; + GError *error = NULL; + const char *item; + + dir = g_dir_open (KEYFILE_DIR, 0, &error); + if (!dir) { + PLUGIN_WARN (KEYFILE_PLUGIN_NAME, "Cannot read directory '%s': (%d) %s", + KEYFILE_DIR, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); + return; + } + + while ((item = g_dir_read_name (dir))) { + NMKeyfileConnection *connection; + char *full_path; - dir = g_dir_open (KEYFILE_DIR, 0, &err); - if (dir) { - const char *item; + full_path = g_build_filename (KEYFILE_DIR, item, NULL); + PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, "parsing %s ... ", item); + connection = nm_keyfile_connection_new (full_path, &error); + if (connection) { + NMSettingConnection *s_con; + const char *cid; - while ((item = g_dir_read_name (dir))) { - NMKeyfileConnection *connection; - char *full_path; + s_con = (NMSettingConnection *) nm_connection_get_setting (NM_CONNECTION (connection), NM_TYPE_SETTING_CONNECTION); + g_assert (s_con); - full_path = g_build_filename (KEYFILE_DIR, item, NULL); - connection = nm_keyfile_connection_new (full_path); - if (connection) { - g_hash_table_insert (priv->hash, - (gpointer) nm_keyfile_connection_get_filename (connection), - connection); - } - g_free (full_path); - } + cid = nm_setting_connection_get_id (s_con); + g_assert (cid); - g_dir_close (dir); - } else { - g_warning ("Can not read directory '%s': %s", KEYFILE_DIR, err->message); - g_error_free (err); + g_hash_table_insert (priv->hash, + (gpointer) nm_keyfile_connection_get_filename (connection), + connection); + + PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, " read connection '%s'", cid); + } else { + PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, " error: %s", + (error && error->message) ? error->message : "(unknown)"); + g_clear_error (&error); + } + g_free (full_path); } + g_dir_close (dir); } typedef struct { @@ -147,17 +165,33 @@ update_connection_settings (NMKeyfileConnection *orig, /* Monitoring */ +static void +remove_connection (SCPluginKeyfile *self, + NMKeyfileConnection *connection, + const char *name) +{ + g_return_if_fail (connection != NULL); + g_return_if_fail (name != NULL); + + /* Removing from the hash table should drop the last reference */ + g_object_ref (connection); + g_hash_table_remove (SC_PLUGIN_KEYFILE_GET_PRIVATE (self)->hash, name); + g_signal_emit_by_name (connection, "removed"); + g_object_unref (connection); +} + static void dir_changed (GFileMonitor *monitor, - GFile *file, - GFile *other_file, - GFileMonitorEvent event_type, - gpointer user_data) + GFile *file, + GFile *other_file, + GFileMonitorEvent event_type, + gpointer user_data) { NMSystemConfigInterface *config = NM_SYSTEM_CONFIG_INTERFACE (user_data); SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (config); char *name; NMKeyfileConnection *connection; + GError *error = NULL; name = g_file_get_path (file); connection = g_hash_table_lookup (priv->hash, name); @@ -165,27 +199,32 @@ dir_changed (GFileMonitor *monitor, switch (event_type) { case G_FILE_MONITOR_EVENT_DELETED: if (connection) { - /* Removing from the hash table should drop the last reference */ - g_object_ref (connection); - g_hash_table_remove (priv->hash, name); - g_signal_emit_by_name (connection, "removed"); - g_object_unref (connection); + PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, "removed %s.", name); + remove_connection (SC_PLUGIN_KEYFILE (config), connection, name); } break; case G_FILE_MONITOR_EVENT_CREATED: case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: + PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, "updating %s", name); + if (connection) { /* Update */ NMKeyfileConnection *tmp; - tmp = (NMKeyfileConnection *) nm_keyfile_connection_new (name); + tmp = nm_keyfile_connection_new (name, &error); if (tmp) { update_connection_settings (connection, tmp); g_object_unref (tmp); + } else { + /* Error; remove the connection */ + PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, " error: %s", + (error && error->message) ? error->message : "(unknown)"); + g_clear_error (&error); + remove_connection (SC_PLUGIN_KEYFILE (config), connection, name); } } else { /* New */ - connection = nm_keyfile_connection_new (name); + connection = nm_keyfile_connection_new (name, &error); if (connection) { NMSettingConnection *s_con; const char *connection_uuid; @@ -234,6 +273,10 @@ dir_changed (GFileMonitor *monitor, connection); g_signal_emit_by_name (config, NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, connection); } + } else { + PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, " error: %s", + (error && error->message) ? error->message : "(unknown)"); + g_clear_error (&error); } } break; diff --git a/system-settings/plugins/keyfile/tests/test-keyfile.c b/system-settings/plugins/keyfile/tests/test-keyfile.c index 81e17440c9..18daad1974 100644 --- a/system-settings/plugins/keyfile/tests/test-keyfile.c +++ b/system-settings/plugins/keyfile/tests/test-keyfile.c @@ -85,7 +85,7 @@ test_read_valid_wired_connection (void) NMIP6Address *ip6_addr; NMIP6Route *ip6_route; - connection = connection_from_file (TEST_WIRED_FILE); + connection = connection_from_file (TEST_WIRED_FILE, NULL); ASSERT (connection != NULL, "connection-read", "failed to read %s", TEST_WIRED_FILE); @@ -587,7 +587,7 @@ test_write_wired_connection (void) const char *address2_gw = "1.2.1.1"; const char *route1 = "10.10.10.2"; const char *route1_nh = "10.10.10.1"; - const char *route2 = "0.0.0.0"; + const char *route2 = "1.1.1.1"; const char *route2_nh = "1.2.1.1"; const char *dns6_1 = "1::cafe"; const char *dns6_2 = "2::cafe"; @@ -595,7 +595,7 @@ test_write_wired_connection (void) const char *address6_2 = "dcba::beef"; const char *route6_1 = "1:2:3:4:5:6:7:8"; const char *route6_1_nh = "8:7:6:5:4:3:2:1"; - const char *route6_2 = "::"; + const char *route6_2 = "2001::1000"; const char *route6_2_nh = "2001::1111"; guint64 timestamp = 0x12345678L; @@ -704,7 +704,7 @@ test_write_wired_connection (void) "connection-write", "didn't get keyfile name back after writing connection"); /* Read the connection back in and compare it to the one we just wrote out */ - reread = connection_from_file (testfile); + reread = connection_from_file (testfile, NULL); ASSERT (reread != NULL, "connection-write", "failed to re-read test connection"); ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, @@ -737,7 +737,7 @@ test_read_ip6_wired_connection (void) const char *expected6_gw1 = "abcd:1234:ffff::cdd1"; NMIP6Address *ip6_addr; - connection = connection_from_file (TEST_WIRED_IP6_FILE); + connection = connection_from_file (TEST_WIRED_IP6_FILE, NULL); ASSERT (connection != NULL, "connection-read", "failed to read %s", TEST_WIRED_IP6_FILE); @@ -964,7 +964,7 @@ test_write_ip6_wired_connection (void) "connection-write", "didn't get keyfile name back after writing connection"); /* Read the connection back in and compare it to the one we just wrote out */ - reread = connection_from_file (testfile); + reread = connection_from_file (testfile, NULL); ASSERT (reread != NULL, "connection-write", "failed to re-read test connection"); ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, @@ -993,7 +993,7 @@ test_read_wired_mac_case (void) const char *expected_id = "Test Wired Connection MAC Case"; const char *expected_uuid = "4e80a56d-c99f-4aad-a6dd-b449bc398c57"; - connection = connection_from_file (TEST_WIRED_MAC_CASE_FILE); + connection = connection_from_file (TEST_WIRED_MAC_CASE_FILE, NULL); ASSERT (connection != NULL, "connection-read", "failed to read %s", TEST_WIRED_MAC_CASE_FILE); @@ -1079,7 +1079,7 @@ test_read_valid_wireless_connection (void) const guint64 expected_timestamp = 1226604314; guint64 timestamp; - connection = connection_from_file (TEST_WIRELESS_FILE); + connection = connection_from_file (TEST_WIRELESS_FILE, NULL); ASSERT (connection != NULL, "connection-read", "failed to read %s", TEST_WIRELESS_FILE); @@ -1282,7 +1282,7 @@ test_write_wireless_connection (void) "connection-write", "didn't get keyfile name back after writing connection"); /* Read the connection back in and compare it to the one we just wrote out */ - reread = connection_from_file (testfile); + reread = connection_from_file (testfile, NULL); ASSERT (reread != NULL, "connection-write", "failed to re-read test connection"); ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, @@ -1317,7 +1317,7 @@ test_read_bt_dun_connection (void) const char *expected_username = "ISP@CINGULARGPRS.COM"; const char *expected_password = "CINGULAR1"; - connection = connection_from_file (TEST_BT_DUN_FILE); + connection = connection_from_file (TEST_BT_DUN_FILE, NULL); ASSERT (connection != NULL, "connection-read", "failed to read %s", TEST_BT_DUN_FILE); @@ -1567,7 +1567,7 @@ test_write_bt_dun_connection (void) "connection-write", "didn't get keyfile name back after writing connection"); /* Read the connection back in and compare it to the one we just wrote out */ - reread = connection_from_file (testfile); + reread = connection_from_file (testfile, NULL); ASSERT (reread != NULL, "connection-write", "failed to re-read test connection"); ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, @@ -1601,7 +1601,7 @@ test_read_gsm_connection (void) const char *expected_network_id = "24005"; const char *expected_pin = "2345"; - connection = connection_from_file (TEST_GSM_FILE); + connection = connection_from_file (TEST_GSM_FILE, NULL); ASSERT (connection != NULL, "connection-read", "failed to read %s", TEST_GSM_FILE); @@ -1829,7 +1829,7 @@ test_write_gsm_connection (void) "connection-write", "didn't get keyfile name back after writing connection"); /* Read the connection back in and compare it to the one we just wrote out */ - reread = connection_from_file (testfile); + reread = connection_from_file (testfile, NULL); ASSERT (reread != NULL, "connection-write", "failed to re-read test connection"); ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, -- cgit v1.2.1 From 7f4a7a62c4847a012fa716ac80ff8fc34c3fdda8 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 16 Sep 2010 17:39:06 -0500 Subject: keyfile: clean up directory structure The IO library was in io/ because I was too lazy to find autotools' SUBDIRS rules at the time and that you could use '.' for the current directory. Fix that and use its own error defines instead of the system settings service. Clean up a for more things for good measure too (like KEYFILE_DIR, etc). --- configure.ac | 1 - system-settings/plugins/keyfile/Makefile.am | 31 +- system-settings/plugins/keyfile/common.h | 37 + system-settings/plugins/keyfile/errors.c | 35 + system-settings/plugins/keyfile/io/Makefile.am | 20 - system-settings/plugins/keyfile/io/reader.c | 1112 -------------------- system-settings/plugins/keyfile/io/reader.h | 32 - system-settings/plugins/keyfile/io/writer.c | 697 ------------ system-settings/plugins/keyfile/io/writer.h | 38 - .../plugins/keyfile/nm-keyfile-connection.c | 1 + system-settings/plugins/keyfile/plugin.c | 4 +- system-settings/plugins/keyfile/reader.c | 1106 +++++++++++++++++++ system-settings/plugins/keyfile/reader.h | 30 + system-settings/plugins/keyfile/tests/Makefile.am | 4 +- system-settings/plugins/keyfile/writer.c | 692 ++++++++++++ system-settings/plugins/keyfile/writer.h | 38 + 16 files changed, 1964 insertions(+), 1914 deletions(-) create mode 100644 system-settings/plugins/keyfile/common.h create mode 100644 system-settings/plugins/keyfile/errors.c delete mode 100644 system-settings/plugins/keyfile/io/Makefile.am delete mode 100644 system-settings/plugins/keyfile/io/reader.c delete mode 100644 system-settings/plugins/keyfile/io/reader.h delete mode 100644 system-settings/plugins/keyfile/io/writer.c delete mode 100644 system-settings/plugins/keyfile/io/writer.h create mode 100644 system-settings/plugins/keyfile/reader.c create mode 100644 system-settings/plugins/keyfile/reader.h create mode 100644 system-settings/plugins/keyfile/writer.c create mode 100644 system-settings/plugins/keyfile/writer.h diff --git a/configure.ac b/configure.ac index ac391c6037..db28815783 100644 --- a/configure.ac +++ b/configure.ac @@ -521,7 +521,6 @@ system-settings/plugins/ifcfg-rh/tests/Makefile system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile system-settings/plugins/ifcfg-suse/Makefile system-settings/plugins/keyfile/Makefile -system-settings/plugins/keyfile/io/Makefile system-settings/plugins/keyfile/tests/Makefile system-settings/plugins/keyfile/tests/keyfiles/Makefile cli/Makefile diff --git a/system-settings/plugins/keyfile/Makefile.am b/system-settings/plugins/keyfile/Makefile.am index a49b51b2c0..1c1fd4a7de 100644 --- a/system-settings/plugins/keyfile/Makefile.am +++ b/system-settings/plugins/keyfile/Makefile.am @@ -1,36 +1,49 @@ -SUBDIRS=io tests +SUBDIRS=. tests INCLUDES = \ -I$(top_srcdir)/src/system-settings \ -I$(top_srcdir)/include \ -I$(top_srcdir)/libnm-util \ - -I$(top_srcdir)/libnm-glib \ - -I$(top_srcdir)/system-settings/plugins/keyfile/io + -I$(top_srcdir)/libnm-glib pkglib_LTLIBRARIES = libnm-settings-plugin-keyfile.la +noinst_LTLIBRARIES = libkeyfile-io.la + +libkeyfile_io_la_SOURCES = \ + reader.c \ + reader.h \ + writer.c \ + writer.h \ + errors.c \ + common.h + +libkeyfile_io_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DG_DISABLE_DEPRECATED + +libkeyfile_io_la_LIBADD = $(GLIB_LIBS) + libnm_settings_plugin_keyfile_la_SOURCES = \ nm-keyfile-connection.c \ nm-keyfile-connection.h \ plugin.c \ plugin.h -keyfiledir=$(sysconfdir)/NetworkManager/system-connections - libnm_settings_plugin_keyfile_la_CPPFLAGS = \ $(GLIB_CFLAGS) \ $(GMODULE_CFLAGS) \ $(DBUS_CFLAGS) \ -DSYSCONFDIR=\"$(sysconfdir)\" \ - -DG_DISABLE_DEPRECATED \ - -DKEYFILE_DIR=\""$(keyfiledir)"\" \ - -DKEYFILE_PLUGIN_NAME=\""keyfile"\" + -DG_DISABLE_DEPRECATED libnm_settings_plugin_keyfile_la_LDFLAGS = -module -avoid-version libnm_settings_plugin_keyfile_la_LIBADD = \ $(top_builddir)/libnm-util/libnm-util.la \ $(top_builddir)/libnm-glib/libnm-glib.la \ - $(top_builddir)/system-settings/plugins/keyfile/io/libkeyfile-io.la \ + libkeyfile-io.la \ $(GLIB_LIBS) \ $(GMODULE_LIBS) \ $(DBUS_LIBS) \ diff --git a/system-settings/plugins/keyfile/common.h b/system-settings/plugins/keyfile/common.h new file mode 100644 index 0000000000..7d94a7053e --- /dev/null +++ b/system-settings/plugins/keyfile/common.h @@ -0,0 +1,37 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2008 - 2010 Red Hat, Inc. + */ + +#ifndef __COMMON_H__ +#define __COMMON_H__ + +#include + +#define KEYFILE_PLUGIN_NAME "keyfile" +#define KEYFILE_PLUGIN_INFO "(c) 2007 - 2010 Red Hat, Inc. To report bugs please use the NetworkManager mailing list." + +#define KEYFILE_DIR SYSCONFDIR "/NetworkManager/system-connections" + +#define VPN_SECRETS_GROUP "vpn-secrets" + +#define KEYFILE_PLUGIN_ERROR (keyfile_plugin_error_quark ()) +GQuark keyfile_plugin_error_quark (void); + +#endif /* __COMMON_H__ */ + diff --git a/system-settings/plugins/keyfile/errors.c b/system-settings/plugins/keyfile/errors.c new file mode 100644 index 0000000000..e2e97690f1 --- /dev/null +++ b/system-settings/plugins/keyfile/errors.c @@ -0,0 +1,35 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2008 - 2010 Red Hat, Inc. + */ + +#include +#include "common.h" + +GQuark +keyfile_plugin_error_quark (void) +{ + static GQuark error_quark = 0; + + if (G_UNLIKELY (error_quark == 0)) + error_quark = g_quark_from_static_string ("keyfile-plugin-error-quark"); + + return error_quark; +} + + diff --git a/system-settings/plugins/keyfile/io/Makefile.am b/system-settings/plugins/keyfile/io/Makefile.am deleted file mode 100644 index 9333c50976..0000000000 --- a/system-settings/plugins/keyfile/io/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ -INCLUDES = \ - -I$(top_srcdir)/system-settings/src \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/libnm-util \ - -I$(top_srcdir)/libnm-glib - -noinst_LTLIBRARIES = libkeyfile-io.la - -libkeyfile_io_la_SOURCES = \ - reader.h \ - reader.c \ - writer.h \ - writer.c - -libkeyfile_io_la_CPPFLAGS = \ - $(GLIB_CFLAGS) \ - $(DBUS_CFLAGS) - -libkeyfile_io_la_LIBADD = $(GLIB_LIBS) - diff --git a/system-settings/plugins/keyfile/io/reader.c b/system-settings/plugins/keyfile/io/reader.c deleted file mode 100644 index 55ef12706c..0000000000 --- a/system-settings/plugins/keyfile/io/reader.c +++ /dev/null @@ -1,1112 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* NetworkManager system settings service - keyfile plugin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright (C) 2008 - 2009 Novell, Inc. - * Copyright (C) 2008 - 2010 Red Hat, Inc. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "nm-dbus-glib-types.h" -#include "reader.h" - -static gboolean -read_array_of_uint (GKeyFile *file, - NMSetting *setting, - const char *key) -{ - GArray *array = NULL; - gsize length; - int i; - gint *tmp; - - tmp = g_key_file_get_integer_list (file, nm_setting_get_name (setting), key, &length, NULL); - array = g_array_sized_new (FALSE, FALSE, sizeof (guint32), length); - for (i = 0; i < length; i++) - g_array_append_val (array, tmp[i]); - - if (array) { - g_object_set (setting, key, array, NULL); - g_array_free (array, TRUE); - } - - return TRUE; -} - -static gboolean -get_one_int (const char *str, guint32 max_val, const char *key_name, guint32 *out) -{ - long tmp; - - errno = 0; - tmp = strtol (str, NULL, 10); - if (errno || (tmp < 0) || (tmp > max_val)) { - g_warning ("%s: ignoring invalid IP %s item '%s'", __func__, key_name, str); - return FALSE; - } - - *out = (guint32) tmp; - return TRUE; -} - -static void -free_one_ip4_address (gpointer data, gpointer user_data) -{ - g_array_free ((GArray *) data, TRUE); -} - -static GPtrArray * -read_ip4_addresses (GKeyFile *file, - const char *setting_name, - const char *key) -{ - GPtrArray *addresses; - int i = 0; - - addresses = g_ptr_array_sized_new (3); - - /* Look for individual addresses */ - while (i++ < 1000) { - gchar **tmp, **iter; - char *key_name; - gsize length = 0; - int ret; - GArray *address; - guint32 empty = 0; - int j; - - key_name = g_strdup_printf ("%s%d", key, i); - tmp = g_key_file_get_string_list (file, setting_name, key_name, &length, NULL); - g_free (key_name); - - if (!tmp || !length) - break; /* all done */ - - if ((length < 2) || (length > 3)) { - g_warning ("%s: ignoring invalid IPv4 address item '%s'", __func__, key_name); - goto next; - } - - /* convert the string array into IP addresses */ - address = g_array_sized_new (FALSE, TRUE, sizeof (guint32), 3); - for (iter = tmp, j = 0; *iter; iter++, j++) { - struct in_addr addr; - - if (j == 1) { - guint32 prefix = 0; - - /* prefix */ - if (!get_one_int (*iter, 32, key_name, &prefix)) { - g_array_free (address, TRUE); - goto next; - } - - g_array_append_val (address, prefix); - } else { - /* address and gateway */ - ret = inet_pton (AF_INET, *iter, &addr); - if (ret <= 0) { - g_warning ("%s: ignoring invalid IPv4 %s element '%s'", __func__, key_name, *iter); - g_array_free (address, TRUE); - goto next; - } - g_array_append_val (address, addr.s_addr); - } - } - - /* fill in blank gateway if not specified */ - if (address->len == 2) - g_array_append_val (address, empty); - - g_ptr_array_add (addresses, address); - -next: - g_strfreev (tmp); - } - - if (addresses->len < 1) { - g_ptr_array_free (addresses, TRUE); - addresses = NULL; - } - - return addresses; -} - -static void -ip4_addr_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) -{ - GPtrArray *addresses; - const char *setting_name = nm_setting_get_name (setting); - - addresses = read_ip4_addresses (keyfile, setting_name, key); - - /* Work around for previous syntax */ - if (!addresses && !strcmp (key, NM_SETTING_IP4_CONFIG_ADDRESSES)) - addresses = read_ip4_addresses (keyfile, setting_name, "address"); - - if (addresses) { - g_object_set (setting, key, addresses, NULL); - g_ptr_array_foreach (addresses, free_one_ip4_address, NULL); - g_ptr_array_free (addresses, TRUE); - } -} - -static void -free_one_ip4_route (gpointer data, gpointer user_data) -{ - g_array_free ((GArray *) data, TRUE); -} - -static GPtrArray * -read_ip4_routes (GKeyFile *file, - const char *setting_name, - const char *key) -{ - GPtrArray *routes; - int i = 0; - - routes = g_ptr_array_sized_new (3); - - /* Look for individual routes */ - while (i++ < 1000) { - gchar **tmp, **iter; - char *key_name; - gsize length = 0; - int ret; - GArray *route; - int j; - - key_name = g_strdup_printf ("%s%d", key, i); - tmp = g_key_file_get_string_list (file, setting_name, key_name, &length, NULL); - g_free (key_name); - - if (!tmp || !length) - break; /* all done */ - - if (length != 4) { - g_warning ("%s: ignoring invalid IPv4 route item '%s'", __func__, key_name); - goto next; - } - - /* convert the string array into IP addresses */ - route = g_array_sized_new (FALSE, TRUE, sizeof (guint32), 4); - for (iter = tmp, j = 0; *iter; iter++, j++) { - struct in_addr addr; - - if (j == 1) { - guint32 prefix = 0; - - /* prefix */ - if (!get_one_int (*iter, 32, key_name, &prefix)) { - g_array_free (route, TRUE); - goto next; - } - - g_array_append_val (route, prefix); - } else if (j == 3) { - guint32 metric = 0; - - /* metric */ - if (!get_one_int (*iter, G_MAXUINT32, key_name, &metric)) { - g_array_free (route, TRUE); - goto next; - } - - g_array_append_val (route, metric); - } else { - /* address and next hop */ - ret = inet_pton (AF_INET, *iter, &addr); - if (ret <= 0) { - g_warning ("%s: ignoring invalid IPv4 %s element '%s'", __func__, key_name, *iter); - g_array_free (route, TRUE); - goto next; - } - g_array_append_val (route, addr.s_addr); - } - } - g_ptr_array_add (routes, route); - -next: - g_strfreev (tmp); - } - - if (routes->len < 1) { - g_ptr_array_free (routes, TRUE); - routes = NULL; - } - - return routes; -} - -static void -ip4_route_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) -{ - GPtrArray *routes; - const char *setting_name = nm_setting_get_name (setting); - - routes = read_ip4_routes (keyfile, setting_name, key); - if (routes) { - g_object_set (setting, key, routes, NULL); - g_ptr_array_foreach (routes, free_one_ip4_route, NULL); - g_ptr_array_free (routes, TRUE); - } -} - -static void -ip4_dns_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) -{ - const char *setting_name = nm_setting_get_name (setting); - GArray *array = NULL; - gsize length; - char **list, **iter; - int ret; - - list = g_key_file_get_string_list (keyfile, setting_name, key, &length, NULL); - if (!list || !g_strv_length (list)) - return; - - array = g_array_sized_new (FALSE, FALSE, sizeof (guint32), length); - for (iter = list; *iter; iter++) { - struct in_addr addr; - - ret = inet_pton (AF_INET, *iter, &addr); - if (ret <= 0) { - g_warning ("%s: ignoring invalid DNS server address '%s'", __func__, *iter); - continue; - } - - g_array_append_val (array, addr.s_addr); - } - g_strfreev (list); - - if (array) { - g_object_set (setting, key, array, NULL); - g_array_free (array, TRUE); - } -} - -static void -free_one_ip6_address (gpointer data, gpointer user_data) -{ - g_value_array_free ((GValueArray *) data); -} - -static char * -split_prefix (char *addr) -{ - char *slash; - - g_return_val_if_fail (addr != NULL, NULL); - - /* Find the prefix and split the string */ - slash = strchr (addr, '/'); - if (slash && slash > addr) { - slash++; - *(slash - 1) = '\0'; - } - - return slash; -} - -static char * -split_gw (char *str) -{ - char *comma; - - g_return_val_if_fail (str != NULL, NULL); - - /* Find the prefix and split the string */ - comma = strchr (str, ','); - if (comma && comma > str) { - comma++; - *(comma - 1) = '\0'; - return comma; - } - return NULL; -} - -static GPtrArray * -read_ip6_addresses (GKeyFile *file, - const char *setting_name, - const char *key) -{ - GPtrArray *addresses; - struct in6_addr addr, gw; - guint32 prefix; - int i = 0; - - addresses = g_ptr_array_sized_new (3); - - /* Look for individual addresses */ - while (i++ < 1000) { - char *tmp, *key_name, *str_prefix, *str_gw; - int ret; - GValueArray *values; - GByteArray *address; - GByteArray *gateway; - GValue value = { 0 }; - - key_name = g_strdup_printf ("%s%d", key, i); - tmp = g_key_file_get_string (file, setting_name, key_name, NULL); - g_free (key_name); - - if (!tmp) - break; /* all done */ - - /* convert the string array into IPv6 addresses */ - values = g_value_array_new (2); /* NMIP6Address has 2 items */ - - /* Split the address and prefix */ - str_prefix = split_prefix (tmp); - - /* address */ - ret = inet_pton (AF_INET6, tmp, &addr); - if (ret <= 0) { - g_warning ("%s: ignoring invalid IPv6 %s element '%s'", __func__, key_name, tmp); - g_value_array_free (values); - goto next; - } - - address = g_byte_array_new (); - g_byte_array_append (address, (guint8 *) addr.s6_addr, 16); - g_value_init (&value, DBUS_TYPE_G_UCHAR_ARRAY); - g_value_take_boxed (&value, address); - g_value_array_append (values, &value); - g_value_unset (&value); - - /* prefix */ - prefix = 0; - if (str_prefix) { - if (!get_one_int (str_prefix, 128, key_name, &prefix)) { - g_value_array_free (values); - goto next; - } - } else { - /* Missing prefix defaults to /64 */ - prefix = 64; - } - - g_value_init (&value, G_TYPE_UINT); - g_value_set_uint (&value, prefix); - g_value_array_append (values, &value); - g_value_unset (&value); - - /* Gateway (optional) */ - str_gw = split_gw (str_prefix); - if (str_gw) { - ret = inet_pton (AF_INET6, str_gw, &gw); - if (ret <= 0) { - g_warning ("%s: ignoring invalid IPv6 %s gateway '%s'", __func__, key_name, tmp); - g_value_array_free (values); - goto next; - } - - if (!IN6_IS_ADDR_UNSPECIFIED (&gw)) { - gateway = g_byte_array_new (); - g_byte_array_append (gateway, (guint8 *) gw.s6_addr, 16); - g_value_init (&value, DBUS_TYPE_G_UCHAR_ARRAY); - g_value_take_boxed (&value, gateway); - g_value_array_append (values, &value); - g_value_unset (&value); - } - } - - g_ptr_array_add (addresses, values); - -next: - g_free (tmp); - } - - if (addresses->len < 1) { - g_ptr_array_free (addresses, TRUE); - addresses = NULL; - } - - return addresses; -} - -static void -ip6_addr_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) -{ - GPtrArray *addresses; - const char *setting_name = nm_setting_get_name (setting); - - addresses = read_ip6_addresses (keyfile, setting_name, key); - if (addresses) { - g_object_set (setting, key, addresses, NULL); - g_ptr_array_foreach (addresses, free_one_ip6_address, NULL); - g_ptr_array_free (addresses, TRUE); - } -} - -static void -free_one_ip6_route (gpointer data, gpointer user_data) -{ - g_value_array_free ((GValueArray *) data); -} - -static GPtrArray * -read_ip6_routes (GKeyFile *file, - const char *setting_name, - const char *key) -{ - GPtrArray *routes; - struct in6_addr addr; - guint32 prefix, metric; - int i = 0; - - routes = g_ptr_array_sized_new (3); - - /* Look for individual routes */ - while (i++ < 1000) { - gchar **tmp; - char *key_name, *str_prefix; - gsize length = 0; - int ret; - GValueArray *values; - GByteArray *address; - GValue value = { 0 }; - - key_name = g_strdup_printf ("%s%d", key, i); - tmp = g_key_file_get_string_list (file, setting_name, key_name, &length, NULL); - g_free (key_name); - - if (!tmp || !length) - break; /* all done */ - - if (length != 3) { - g_warning ("%s: ignoring invalid IPv6 address item '%s'", __func__, key_name); - goto next; - } - - /* convert the string array into IPv6 routes */ - values = g_value_array_new (4); /* NMIP6Route has 4 items */ - - /* Split the route and prefix */ - str_prefix = split_prefix (tmp[0]); - - /* destination address */ - ret = inet_pton (AF_INET6, tmp[0], &addr); - if (ret <= 0) { - g_warning ("%s: ignoring invalid IPv6 %s element '%s'", __func__, key_name, tmp[0]); - g_value_array_free (values); - goto next; - } - address = g_byte_array_new (); - g_byte_array_append (address, (guint8 *) addr.s6_addr, 16); - g_value_init (&value, DBUS_TYPE_G_UCHAR_ARRAY); - g_value_take_boxed (&value, address); - g_value_array_append (values, &value); - g_value_unset (&value); - - /* prefix */ - prefix = 0; - if (str_prefix) { - if (!get_one_int (str_prefix, 128, key_name, &prefix)) { - g_value_array_free (values); - goto next; - } - } else { - /* default to 64 if unspecified */ - prefix = 64; - } - g_value_init (&value, G_TYPE_UINT); - g_value_set_uint (&value, prefix); - g_value_array_append (values, &value); - g_value_unset (&value); - - /* next hop address */ - ret = inet_pton (AF_INET6, tmp[1], &addr); - if (ret <= 0) { - g_warning ("%s: ignoring invalid IPv6 %s element '%s'", __func__, key_name, tmp[1]); - g_value_array_free (values); - goto next; - } - address = g_byte_array_new (); - g_byte_array_append (address, (guint8 *) addr.s6_addr, 16); - g_value_init (&value, DBUS_TYPE_G_UCHAR_ARRAY); - g_value_take_boxed (&value, address); - g_value_array_append (values, &value); - g_value_unset (&value); - - /* metric */ - metric = 0; - if (!get_one_int (tmp[2], G_MAXUINT32, key_name, &metric)) { - g_value_array_free (values); - goto next; - } - g_value_init (&value, G_TYPE_UINT); - g_value_set_uint (&value, metric); - g_value_array_append (values, &value); - g_value_unset (&value); - - g_ptr_array_add (routes, values); - -next: - g_strfreev (tmp); - } - - if (routes->len < 1) { - g_ptr_array_free (routes, TRUE); - routes = NULL; - } - - return routes; -} - -static void -ip6_route_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) -{ - GPtrArray *routes; - const char *setting_name = nm_setting_get_name (setting); - - routes = read_ip6_routes (keyfile, setting_name, key); - - if (routes) { - g_object_set (setting, key, routes, NULL); - g_ptr_array_foreach (routes, free_one_ip6_route, NULL); - g_ptr_array_free (routes, TRUE); - } -} - -static void -free_one_ip6_dns (gpointer data, gpointer user_data) -{ - g_byte_array_free ((GByteArray *) data, TRUE); -} - -static void -ip6_dns_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) -{ - const char *setting_name = nm_setting_get_name (setting); - GPtrArray *array = NULL; - gsize length; - char **list, **iter; - int ret; - - list = g_key_file_get_string_list (keyfile, setting_name, key, &length, NULL); - if (!list || !g_strv_length (list)) - return; - - array = g_ptr_array_sized_new (length); - for (iter = list; *iter; iter++) { - GByteArray *byte_array; - struct in6_addr addr; - - ret = inet_pton (AF_INET6, *iter, &addr); - if (ret <= 0) { - g_warning ("%s: ignoring invalid DNS server IPv6 address '%s'", __func__, *iter); - continue; - } - byte_array = g_byte_array_new (); - g_byte_array_append (byte_array, (guint8 *) addr.s6_addr, 16); - - g_ptr_array_add (array, byte_array); - } - g_strfreev (list); - - if (array) { - g_object_set (setting, key, array, NULL); - g_ptr_array_foreach (array, free_one_ip6_dns, NULL); - g_ptr_array_free (array, TRUE); - } -} - -static void -mac_address_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) -{ - const char *setting_name = nm_setting_get_name (setting); - struct ether_addr *eth; - char *tmp_string = NULL, *p; - gint *tmp_list; - GByteArray *array = NULL; - gsize length; - int i; - - p = tmp_string = g_key_file_get_string (keyfile, setting_name, key, NULL); - if (tmp_string) { - /* Look for enough ':' characters to signify a MAC address */ - i = 0; - while (*p) { - if (*p == ':') - i++; - p++; - } - if (i == 5) { - /* parse as a MAC address */ - eth = ether_aton (tmp_string); - if (eth) { - g_free (tmp_string); - array = g_byte_array_sized_new (ETH_ALEN); - g_byte_array_append (array, eth->ether_addr_octet, ETH_ALEN); - goto done; - } - } - } - g_free (tmp_string); - - /* Old format; list of ints */ - tmp_list = g_key_file_get_integer_list (keyfile, setting_name, key, &length, NULL); - array = g_byte_array_sized_new (length); - for (i = 0; i < length; i++) { - int val = tmp_list[i]; - unsigned char v = (unsigned char) (val & 0xFF); - - if (val < 0 || val > 255) { - g_warning ("%s: %s / %s ignoring invalid byte element '%d' (not " - " between 0 and 255 inclusive)", __func__, setting_name, - key, val); - } else - g_byte_array_append (array, (const unsigned char *) &v, sizeof (v)); - } - g_free (tmp_list); - -done: - if (array->len == ETH_ALEN) { - g_object_set (setting, key, array, NULL); - } else { - g_warning ("%s: ignoring invalid MAC address for %s / %s", - __func__, setting_name, key); - } - g_byte_array_free (array, TRUE); -} - -static void -read_hash_of_string (GKeyFile *file, NMSetting *setting, const char *key) -{ - char **keys, **iter; - char *value; - const char *setting_name = nm_setting_get_name (setting); - - keys = g_key_file_get_keys (file, setting_name, NULL, NULL); - if (!keys || !*keys) - return; - - for (iter = keys; *iter; iter++) { - value = g_key_file_get_string (file, setting_name, *iter, NULL); - if (!value) - continue; - - if (NM_IS_SETTING_VPN (setting)) { - if (strcmp (*iter, NM_SETTING_VPN_SERVICE_TYPE)) - nm_setting_vpn_add_data_item (NM_SETTING_VPN (setting), *iter, value); - } - g_free (value); - } - g_strfreev (keys); -} - - -typedef struct { - const char *setting_name; - const char *key; - gboolean check_for_key; - void (*parser) (NMSetting *setting, const char *key, GKeyFile *keyfile); -} KeyParser; - -/* A table of keys that require further parsing/conversion becuase they are - * stored in a format that can't be automatically read using the key's type. - * i.e. IPv4 addresses, which are stored in NetworkManager as guint32, but are - * stored in keyfiles as strings, eg "10.1.1.2" or IPv6 addresses stored - * in struct in6_addr internally, but as string in keyfiles. - */ -static KeyParser key_parsers[] = { - { NM_SETTING_IP4_CONFIG_SETTING_NAME, - NM_SETTING_IP4_CONFIG_ADDRESSES, - FALSE, - ip4_addr_parser }, - { NM_SETTING_IP6_CONFIG_SETTING_NAME, - NM_SETTING_IP6_CONFIG_ADDRESSES, - FALSE, - ip6_addr_parser }, - { NM_SETTING_IP4_CONFIG_SETTING_NAME, - NM_SETTING_IP4_CONFIG_ROUTES, - FALSE, - ip4_route_parser }, - { NM_SETTING_IP6_CONFIG_SETTING_NAME, - NM_SETTING_IP6_CONFIG_ROUTES, - FALSE, - ip6_route_parser }, - { NM_SETTING_IP4_CONFIG_SETTING_NAME, - NM_SETTING_IP4_CONFIG_DNS, - FALSE, - ip4_dns_parser }, - { NM_SETTING_IP6_CONFIG_SETTING_NAME, - NM_SETTING_IP6_CONFIG_DNS, - FALSE, - ip6_dns_parser }, - { NM_SETTING_WIRED_SETTING_NAME, - NM_SETTING_WIRED_MAC_ADDRESS, - TRUE, - mac_address_parser }, - { NM_SETTING_WIRED_SETTING_NAME, - NM_SETTING_WIRED_CLONED_MAC_ADDRESS, - TRUE, - mac_address_parser }, - { NM_SETTING_WIRELESS_SETTING_NAME, - NM_SETTING_WIRELESS_MAC_ADDRESS, - TRUE, - mac_address_parser }, - { NM_SETTING_WIRELESS_SETTING_NAME, - NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS, - TRUE, - mac_address_parser }, - { NM_SETTING_WIRELESS_SETTING_NAME, - NM_SETTING_WIRELESS_BSSID, - TRUE, - mac_address_parser }, - { NM_SETTING_BLUETOOTH_SETTING_NAME, - NM_SETTING_BLUETOOTH_BDADDR, - TRUE, - mac_address_parser }, - { NULL, NULL, FALSE } -}; - -static void -read_one_setting_value (NMSetting *setting, - const char *key, - const GValue *value, - GParamFlags flags, - gpointer user_data) -{ - GKeyFile *file = user_data; - const char *setting_name; - GType type; - GError *err = NULL; - gboolean check_for_key = TRUE; - KeyParser *parser = &key_parsers[0]; - - /* Property is not writable */ - if (!(flags & G_PARAM_WRITABLE)) - return; - - /* Setting name gets picked up from the keyfile's section name instead */ - if (!strcmp (key, NM_SETTING_NAME)) - return; - - /* Don't read the NMSettingConnection object's 'read-only' property */ - if ( NM_IS_SETTING_CONNECTION (setting) - && !strcmp (key, NM_SETTING_CONNECTION_READ_ONLY)) - return; - - setting_name = nm_setting_get_name (setting); - - /* Look through the list of handlers for non-standard format key values */ - while (parser->setting_name) { - if (!strcmp (parser->setting_name, setting_name) && !strcmp (parser->key, key)) { - check_for_key = parser->check_for_key; - break; - } - parser++; - } - - /* VPN properties don't have the exact key name */ - if (NM_IS_SETTING_VPN (setting)) - check_for_key = FALSE; - - /* Check for the exact key in the GKeyFile if required. Most setting - * properties map 1:1 to a key in the GKeyFile, but for those properties - * like IP addresses and routes where more than one value is actually - * encoded by the setting property, this won't be true. - */ - if (check_for_key && !g_key_file_has_key (file, setting_name, key, &err)) { - /* Key doesn't exist or an error ocurred, thus nothing to do. */ - if (err) { - g_warning ("Error loading setting '%s' value: %s", setting_name, err->message); - g_error_free (err); - } - return; - } - - /* If there's a custom parser for this key, handle that before the generic - * parsers below. - */ - if (parser && parser->setting_name) { - (*parser->parser) (setting, key, file); - return; - } - - type = G_VALUE_TYPE (value); - - if (type == G_TYPE_STRING) { - char *str_val; - - str_val = g_key_file_get_string (file, setting_name, key, NULL); - g_object_set (setting, key, str_val, NULL); - g_free (str_val); - } else if (type == G_TYPE_UINT) { - int int_val; - - int_val = g_key_file_get_integer (file, setting_name, key, NULL); - if (int_val < 0) - g_warning ("Casting negative value (%i) to uint", int_val); - g_object_set (setting, key, int_val, NULL); - } else if (type == G_TYPE_INT) { - int int_val; - - int_val = g_key_file_get_integer (file, setting_name, key, NULL); - g_object_set (setting, key, int_val, NULL); - } else if (type == G_TYPE_BOOLEAN) { - gboolean bool_val; - - bool_val = g_key_file_get_boolean (file, setting_name, key, NULL); - g_object_set (setting, key, bool_val, NULL); - } else if (type == G_TYPE_CHAR) { - int int_val; - - int_val = g_key_file_get_integer (file, setting_name, key, NULL); - if (int_val < G_MININT8 || int_val > G_MAXINT8) - g_warning ("Casting value (%i) to char", int_val); - - g_object_set (setting, key, int_val, NULL); - } else if (type == G_TYPE_UINT64) { - char *tmp_str; - guint64 uint_val; - - tmp_str = g_key_file_get_value (file, setting_name, key, NULL); - uint_val = g_ascii_strtoull (tmp_str, NULL, 10); - g_free (tmp_str); - g_object_set (setting, key, uint_val, NULL); - } else if (type == DBUS_TYPE_G_UCHAR_ARRAY) { - gint *tmp; - GByteArray *array; - gsize length; - int i; - - tmp = g_key_file_get_integer_list (file, setting_name, key, &length, NULL); - - array = g_byte_array_sized_new (length); - for (i = 0; i < length; i++) { - int val = tmp[i]; - unsigned char v = (unsigned char) (val & 0xFF); - - if (val < 0 || val > 255) { - g_warning ("%s: %s / %s ignoring invalid byte element '%d' (not " - " between 0 and 255 inclusive)", __func__, setting_name, - key, val); - } else - g_byte_array_append (array, (const unsigned char *) &v, sizeof (v)); - } - - g_object_set (setting, key, array, NULL); - g_byte_array_free (array, TRUE); - g_free (tmp); - } else if (type == DBUS_TYPE_G_LIST_OF_STRING) { - gchar **sa; - gsize length; - int i; - GSList *list = NULL; - - sa = g_key_file_get_string_list (file, setting_name, key, &length, NULL); - for (i = 0; i < length; i++) - list = g_slist_prepend (list, sa[i]); - - list = g_slist_reverse (list); - g_object_set (setting, key, list, NULL); - - g_slist_free (list); - g_strfreev (sa); - } else if (type == DBUS_TYPE_G_MAP_OF_STRING) { - read_hash_of_string (file, setting, key); - } else if (type == DBUS_TYPE_G_UINT_ARRAY) { - if (!read_array_of_uint (file, setting, key)) { - g_warning ("Unhandled setting property type (read): '%s/%s' : '%s'", - setting_name, key, G_VALUE_TYPE_NAME (value)); - } - } else { - g_warning ("Unhandled setting property type (read): '%s/%s' : '%s'", - setting_name, key, G_VALUE_TYPE_NAME (value)); - } -} - -static NMSetting * -read_setting (GKeyFile *file, const char *name) -{ - NMSetting *setting; - - setting = nm_connection_create_setting (name); - if (setting) - nm_setting_enumerate_values (setting, read_one_setting_value, (gpointer) file); - else - g_warning ("Invalid setting name '%s'", name); - - return setting; -} - -static void -read_vpn_secrets (GKeyFile *file, NMSettingVPN *s_vpn) -{ - char **keys, **iter; - - keys = g_key_file_get_keys (file, VPN_SECRETS_GROUP, NULL, NULL); - for (iter = keys; *iter; iter++) { - char *secret; - - secret = g_key_file_get_string (file, VPN_SECRETS_GROUP, *iter, NULL); - if (secret) { - nm_setting_vpn_add_secret (s_vpn, *iter, secret); - g_free (secret); - } - } - g_strfreev (keys); -} - -NMConnection * -connection_from_file (const char *filename, GError **error) -{ - GKeyFile *key_file; - struct stat statbuf; - gboolean bad_owner, bad_permissions; - NMConnection *connection = NULL; - NMSettingConnection *s_con; - NMSettingBluetooth *s_bt; - NMSetting *setting; - gchar **groups; - gsize length; - int i; - gboolean vpn_secrets = FALSE; - const char *ctype, *tmp; - GError *verify_error = NULL; - - if (stat (filename, &statbuf) != 0 || !S_ISREG (statbuf.st_mode)) { - g_set_error_literal (error, - NM_SETTINGS_INTERFACE_ERROR, - NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, - "File did not exist or was not a regular file"); - return NULL; - } - - bad_owner = getuid () != statbuf.st_uid; - bad_permissions = statbuf.st_mode & 0077; - - if (bad_owner || bad_permissions) { - g_set_error (error, - NM_SETTINGS_INTERFACE_ERROR, - NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, - "File permissions (%o) or owner (%d) were insecure", - statbuf.st_mode, statbuf.st_uid); - return NULL; - } - - key_file = g_key_file_new (); - if (!g_key_file_load_from_file (key_file, filename, G_KEY_FILE_NONE, error)) - goto out; - - connection = nm_connection_new (); - - groups = g_key_file_get_groups (key_file, &length); - for (i = 0; i < length; i++) { - /* Only read out secrets when needed */ - if (!strcmp (groups[i], VPN_SECRETS_GROUP)) { - vpn_secrets = TRUE; - continue; - } - - setting = read_setting (key_file, groups[i]); - if (setting) - nm_connection_add_setting (connection, setting); - } - - /* Make sure that we have the base device type setting even if - * the keyfile didn't include it, which can happen when the base - * device type setting is all default values (like ethernet). - */ - s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); - if (s_con) { - ctype = nm_setting_connection_get_connection_type (s_con); - setting = nm_connection_get_setting_by_name (connection, ctype); - if (ctype) { - gboolean add_serial = FALSE; - NMSetting *new_setting = NULL; - - if (!setting && !strcmp (ctype, NM_SETTING_WIRED_SETTING_NAME)) - new_setting = nm_setting_wired_new (); - else if (!strcmp (ctype, NM_SETTING_BLUETOOTH_SETTING_NAME)) { - s_bt = (NMSettingBluetooth *) nm_connection_get_setting (connection, NM_TYPE_SETTING_BLUETOOTH); - if (s_bt) { - tmp = nm_setting_bluetooth_get_connection_type (s_bt); - if (tmp && !strcmp (tmp, NM_SETTING_BLUETOOTH_TYPE_DUN)) - add_serial = TRUE; - } - } else if (!strcmp (ctype, NM_SETTING_GSM_SETTING_NAME)) - add_serial = TRUE; - else if (!strcmp (ctype, NM_SETTING_CDMA_SETTING_NAME)) - add_serial = TRUE; - - /* Bluetooth DUN, GSM, and CDMA connections require a serial setting */ - if (add_serial && !nm_connection_get_setting (connection, NM_TYPE_SETTING_SERIAL)) - new_setting = nm_setting_serial_new (); - - if (new_setting) - nm_connection_add_setting (connection, new_setting); - } - } - - /* Serial connections require a PPP setting too */ - if (nm_connection_get_setting (connection, NM_TYPE_SETTING_SERIAL)) { - if (!nm_connection_get_setting (connection, NM_TYPE_SETTING_PPP)) - nm_connection_add_setting (connection, nm_setting_ppp_new ()); - } - - /* Handle vpn secrets after the 'vpn' setting was read */ - if (vpn_secrets) { - NMSettingVPN *s_vpn; - - s_vpn = (NMSettingVPN *) nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN); - if (s_vpn) - read_vpn_secrets (key_file, s_vpn); - } - - g_strfreev (groups); - - /* Verify the connection */ - if (!nm_connection_verify (connection, &verify_error)) { - g_set_error (error, - NM_SETTINGS_INTERFACE_ERROR, - NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, - "invalid or missing connection property '%s'", - (verify_error && verify_error->message) ? verify_error->message : "(unknown)"); - g_clear_error (&verify_error); - g_object_unref (connection); - connection = NULL; - } - -out: - g_key_file_free (key_file); - return connection; -} diff --git a/system-settings/plugins/keyfile/io/reader.h b/system-settings/plugins/keyfile/io/reader.h deleted file mode 100644 index 0982c87043..0000000000 --- a/system-settings/plugins/keyfile/io/reader.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* NetworkManager system settings service - keyfile plugin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright (C) 2008 Novell, Inc. - * Copyright (C) 2008 Red Hat, Inc. - */ - -#ifndef _KEYFILE_PLUGIN_READER_H -#define _KEYFILE_PLUGIN_READER_H - -#define VPN_SECRETS_GROUP "vpn-secrets" - -#include -#include - -NMConnection *connection_from_file (const char *filename, GError **error); - -#endif /* _KEYFILE_PLUGIN_READER_H */ diff --git a/system-settings/plugins/keyfile/io/writer.c b/system-settings/plugins/keyfile/io/writer.c deleted file mode 100644 index 7bba71e685..0000000000 --- a/system-settings/plugins/keyfile/io/writer.c +++ /dev/null @@ -1,697 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* NetworkManager system settings service - keyfile plugin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright (C) 2008 Novell, Inc. - * Copyright (C) 2008 - 2010 Red Hat, Inc. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "nm-dbus-glib-types.h" -#include "writer.h" -#include "reader.h" - -static gboolean -write_array_of_uint (GKeyFile *file, - NMSetting *setting, - const char *key, - const GValue *value) -{ - GArray *array; - int i; - int *tmp_array; - - array = (GArray *) g_value_get_boxed (value); - if (!array || !array->len) - return TRUE; - - tmp_array = g_new (gint, array->len); - for (i = 0; i < array->len; i++) - tmp_array[i] = g_array_index (array, int, i); - - g_key_file_set_integer_list (file, nm_setting_get_name (setting), key, tmp_array, array->len); - g_free (tmp_array); - return TRUE; -} - -static void -ip4_dns_writer (GKeyFile *file, - NMSetting *setting, - const char *key, - const GValue *value) -{ - GArray *array; - char **list; - int i, num = 0; - - g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_UINT_ARRAY)); - - array = (GArray *) g_value_get_boxed (value); - if (!array || !array->len) - return; - - list = g_new0 (char *, array->len + 1); - - for (i = 0; i < array->len; i++) { - char buf[INET_ADDRSTRLEN + 1]; - struct in_addr addr; - - addr.s_addr = g_array_index (array, guint32, i); - if (!inet_ntop (AF_INET, &addr, buf, sizeof (buf))) { - nm_warning ("%s: error converting IP4 address 0x%X", - __func__, ntohl (addr.s_addr)); - } else - list[num++] = g_strdup (buf); - } - - g_key_file_set_string_list (file, nm_setting_get_name (setting), key, (const char **) list, num); - g_strfreev (list); -} - -static void -write_ip4_values (GKeyFile *file, - const char *setting_name, - const char *key, - GPtrArray *array, - guint32 tuple_len, - guint32 addr1_pos, - guint32 addr2_pos) -{ - char **list = NULL; - int i, j; - - list = g_new (char *, tuple_len); - - for (i = 0, j = 0; i < array->len; i++, j++) { - GArray *tuple = g_ptr_array_index (array, i); - gboolean success = TRUE; - char *key_name; - int k; - - memset (list, 0, tuple_len * sizeof (char *)); - - for (k = 0; k < tuple_len; k++) { - if (k == addr1_pos || k == addr2_pos) { - char buf[INET_ADDRSTRLEN + 1]; - struct in_addr addr; - - /* IP addresses */ - addr.s_addr = g_array_index (tuple, guint32, k); - if (!inet_ntop (AF_INET, &addr, buf, sizeof (buf))) { - nm_warning ("%s: error converting IP4 address 0x%X", - __func__, ntohl (addr.s_addr)); - success = FALSE; - break; - } else { - list[k] = g_strdup (buf); - } - } else { - /* prefix, metric */ - list[k] = g_strdup_printf ("%d", g_array_index (tuple, guint32, k)); - } - } - - if (success) { - key_name = g_strdup_printf ("%s%d", key, j + 1); - g_key_file_set_string_list (file, setting_name, key_name, (const char **) list, tuple_len); - g_free (key_name); - } - - for (k = 0; k < tuple_len; k++) - g_free (list[k]); - } - g_free (list); -} - -static void -ip4_addr_writer (GKeyFile *file, - NMSetting *setting, - const char *key, - const GValue *value) -{ - GPtrArray *array; - const char *setting_name = nm_setting_get_name (setting); - - g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT)); - - array = (GPtrArray *) g_value_get_boxed (value); - if (array && array->len) - write_ip4_values (file, setting_name, key, array, 3, 0, 2); -} - -static void -ip4_route_writer (GKeyFile *file, - NMSetting *setting, - const char *key, - const GValue *value) -{ - GPtrArray *array; - const char *setting_name = nm_setting_get_name (setting); - - g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT)); - - array = (GPtrArray *) g_value_get_boxed (value); - if (array && array->len) - write_ip4_values (file, setting_name, key, array, 4, 0, 2); -} - -static void -ip6_dns_writer (GKeyFile *file, - NMSetting *setting, - const char *key, - const GValue *value) -{ - GPtrArray *array; - GByteArray *byte_array; - char **list; - int i, num = 0; - - g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UCHAR)); - - array = (GPtrArray *) g_value_get_boxed (value); - if (!array || !array->len) - return; - - list = g_new0 (char *, array->len + 1); - - for (i = 0; i < array->len; i++) { - char buf[INET6_ADDRSTRLEN]; - - byte_array = g_ptr_array_index (array, i); - if (!inet_ntop (AF_INET6, (struct in6_addr *) byte_array->data, buf, sizeof (buf))) { - int j; - GString *ip6_str = g_string_new (NULL); - g_string_append_printf (ip6_str, "%02X", byte_array->data[0]); - for (j = 1; j < 16; j++) - g_string_append_printf (ip6_str, " %02X", byte_array->data[j]); - nm_warning ("%s: error converting IP6 address %s", - __func__, ip6_str->str); - g_string_free (ip6_str, TRUE); - } else - list[num++] = g_strdup (buf); - } - - g_key_file_set_string_list (file, nm_setting_get_name (setting), key, (const char **) list, num); - g_strfreev (list); -} - -static gboolean -ip6_array_to_addr (GValueArray *values, - guint32 idx, - char *buf, - size_t buflen, - gboolean *out_is_unspec) -{ - GByteArray *byte_array; - GValue *addr_val; - struct in6_addr *addr; - - g_return_val_if_fail (buflen >= INET6_ADDRSTRLEN, FALSE); - - addr_val = g_value_array_get_nth (values, idx); - byte_array = g_value_get_boxed (addr_val); - addr = (struct in6_addr *) byte_array->data; - - if (out_is_unspec && IN6_IS_ADDR_UNSPECIFIED (addr)) - *out_is_unspec = TRUE; - - errno = 0; - if (!inet_ntop (AF_INET6, addr, buf, buflen)) { - GString *ip6_str = g_string_sized_new (INET6_ADDRSTRLEN + 10); - - /* error converting the address */ - g_string_append_printf (ip6_str, "%02X", byte_array->data[0]); - for (idx = 1; idx < 16; idx++) - g_string_append_printf (ip6_str, " %02X", byte_array->data[idx]); - nm_warning ("%s: error %d converting IP6 address %s", - __func__, errno, ip6_str->str); - g_string_free (ip6_str, TRUE); - return FALSE; - } - - return TRUE; -} - -static char * -ip6_array_to_addr_prefix (GValueArray *values) -{ - GValue *prefix_val; - char *ret = NULL; - GString *ip6_str; - char buf[INET6_ADDRSTRLEN + 1]; - gboolean is_unspec = FALSE; - - /* address */ - if (ip6_array_to_addr (values, 0, buf, sizeof (buf), NULL)) { - /* Enough space for the address, '/', and the prefix */ - ip6_str = g_string_sized_new ((INET6_ADDRSTRLEN * 2) + 5); - - /* prefix */ - g_string_append (ip6_str, buf); - prefix_val = g_value_array_get_nth (values, 1); - g_string_append_printf (ip6_str, "/%u", g_value_get_uint (prefix_val)); - - if (ip6_array_to_addr (values, 2, buf, sizeof (buf), &is_unspec)) { - if (!is_unspec) - g_string_append_printf (ip6_str, ",%s", buf); - } - - ret = ip6_str->str; - g_string_free (ip6_str, FALSE); - } - - return ret; -} - -static void -ip6_addr_writer (GKeyFile *file, - NMSetting *setting, - const char *key, - const GValue *value) -{ - GPtrArray *array; - const char *setting_name = nm_setting_get_name (setting); - int i, j; - - g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS)); - - array = (GPtrArray *) g_value_get_boxed (value); - if (!array || !array->len) - return; - - for (i = 0, j = 1; i < array->len; i++) { - GValueArray *values = g_ptr_array_index (array, i); - char *key_name, *ip6_addr; - - if (values->n_values != 3) { - nm_warning ("%s: error writing IP6 address %d (address array length " - "%d is not 3)", - __func__, i, values->n_values); - continue; - } - - ip6_addr = ip6_array_to_addr_prefix (values); - if (ip6_addr) { - /* Write it out */ - key_name = g_strdup_printf ("%s%d", key, j++); - g_key_file_set_string (file, setting_name, key_name, ip6_addr); - g_free (key_name); - g_free (ip6_addr); - } - } -} - -static void -ip6_route_writer (GKeyFile *file, - NMSetting *setting, - const char *key, - const GValue *value) -{ - GPtrArray *array; - const char *setting_name = nm_setting_get_name (setting); - char *list[3]; - int i, j; - - g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE)); - - array = (GPtrArray *) g_value_get_boxed (value); - if (!array || !array->len) - return; - - for (i = 0, j = 1; i < array->len; i++) { - GValueArray *values = g_ptr_array_index (array, i); - char *key_name; - guint32 int_val; - char buf[INET6_ADDRSTRLEN + 1]; - gboolean is_unspec = FALSE; - - memset (list, 0, sizeof (list)); - - /* Address and prefix */ - list[0] = ip6_array_to_addr_prefix (values); - if (!list[0]) - continue; - - /* Next Hop */ - if (!ip6_array_to_addr (values, 2, buf, sizeof (buf), &is_unspec)) - continue; - if (is_unspec) - continue; - list[1] = g_strdup (buf); - - /* Metric */ - value = g_value_array_get_nth (values, 3); - int_val = g_value_get_uint (value); - list[2] = g_strdup_printf ("%d", int_val); - - /* Write it out */ - key_name = g_strdup_printf ("%s%d", key, j++); - g_key_file_set_string_list (file, setting_name, key_name, (const char **) list, 3); - g_free (key_name); - - g_free (list[0]); - g_free (list[1]); - g_free (list[2]); - } -} - - -static void -mac_address_writer (GKeyFile *file, - NMSetting *setting, - const char *key, - const GValue *value) -{ - GByteArray *array; - const char *setting_name = nm_setting_get_name (setting); - char *mac; - struct ether_addr tmp; - - g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_UCHAR_ARRAY)); - - array = (GByteArray *) g_value_get_boxed (value); - if (!array) - return; - - if (array->len != ETH_ALEN) { - nm_warning ("%s: invalid %s / %s MAC address length %d", - __func__, setting_name, key, array->len); - return; - } - - memcpy (tmp.ether_addr_octet, array->data, ETH_ALEN); - mac = ether_ntoa (&tmp); - g_key_file_set_string (file, setting_name, key, mac); -} - -typedef struct { - GKeyFile *file; - const char *setting_name; -} WriteStringHashInfo; - -static void -write_hash_of_string_helper (gpointer key, gpointer data, gpointer user_data) -{ - WriteStringHashInfo *info = (WriteStringHashInfo *) user_data; - const char *property = (const char *) key; - const char *value = (const char *) data; - - g_key_file_set_string (info->file, - info->setting_name, - property, - value); -} - -static void -write_hash_of_string (GKeyFile *file, - NMSetting *setting, - const char *key, - const GValue *value) -{ - GHashTable *hash = g_value_get_boxed (value); - WriteStringHashInfo info; - - info.file = file; - - /* Write VPN secrets out to a different group to keep them separate */ - if ( (G_OBJECT_TYPE (setting) == NM_TYPE_SETTING_VPN) - && !strcmp (key, NM_SETTING_VPN_SECRETS)) { - info.setting_name = VPN_SECRETS_GROUP; - } else - info.setting_name = nm_setting_get_name (setting); - - g_hash_table_foreach (hash, write_hash_of_string_helper, &info); -} - -typedef struct { - const char *setting_name; - const char *key; - void (*writer) (GKeyFile *keyfile, NMSetting *setting, const char *key, const GValue *value); -} KeyWriter; - -/* A table of keys that require further parsing/conversion becuase they are - * stored in a format that can't be automatically read using the key's type. - * i.e. IPv4 addresses, which are stored in NetworkManager as guint32, but are - * stored in keyfiles as strings, eg "10.1.1.2" or IPv6 addresses stored - * in struct in6_addr internally, but as string in keyfiles. - */ -static KeyWriter key_writers[] = { - { NM_SETTING_IP4_CONFIG_SETTING_NAME, - NM_SETTING_IP4_CONFIG_ADDRESSES, - ip4_addr_writer }, - { NM_SETTING_IP6_CONFIG_SETTING_NAME, - NM_SETTING_IP6_CONFIG_ADDRESSES, - ip6_addr_writer }, - { NM_SETTING_IP4_CONFIG_SETTING_NAME, - NM_SETTING_IP4_CONFIG_ROUTES, - ip4_route_writer }, - { NM_SETTING_IP6_CONFIG_SETTING_NAME, - NM_SETTING_IP6_CONFIG_ROUTES, - ip6_route_writer }, - { NM_SETTING_IP4_CONFIG_SETTING_NAME, - NM_SETTING_IP4_CONFIG_DNS, - ip4_dns_writer }, - { NM_SETTING_IP6_CONFIG_SETTING_NAME, - NM_SETTING_IP6_CONFIG_DNS, - ip6_dns_writer }, - { NM_SETTING_WIRED_SETTING_NAME, - NM_SETTING_WIRED_MAC_ADDRESS, - mac_address_writer }, - { NM_SETTING_WIRED_SETTING_NAME, - NM_SETTING_WIRED_CLONED_MAC_ADDRESS, - mac_address_writer }, - { NM_SETTING_WIRELESS_SETTING_NAME, - NM_SETTING_WIRELESS_MAC_ADDRESS, - mac_address_writer }, - { NM_SETTING_WIRELESS_SETTING_NAME, - NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS, - mac_address_writer }, - { NM_SETTING_WIRELESS_SETTING_NAME, - NM_SETTING_WIRELESS_BSSID, - mac_address_writer }, - { NM_SETTING_BLUETOOTH_SETTING_NAME, - NM_SETTING_BLUETOOTH_BDADDR, - mac_address_writer }, - { NULL, NULL, NULL } -}; - -static void -write_setting_value (NMSetting *setting, - const char *key, - const GValue *value, - GParamFlags flag, - gpointer user_data) -{ - GKeyFile *file = (GKeyFile *) user_data; - const char *setting_name; - GType type = G_VALUE_TYPE (value); - KeyWriter *writer = &key_writers[0]; - GParamSpec *pspec; - - /* Setting name gets picked up from the keyfile's section name instead */ - if (!strcmp (key, NM_SETTING_NAME)) - return; - - /* Don't write the NMSettingConnection object's 'read-only' property */ - if ( NM_IS_SETTING_CONNECTION (setting) - && !strcmp (key, NM_SETTING_CONNECTION_READ_ONLY)) - return; - - setting_name = nm_setting_get_name (setting); - - /* If the value is the default value, remove the item from the keyfile */ - pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (setting), key); - if (pspec) { - if (g_param_value_defaults (pspec, (GValue *) value)) { - g_key_file_remove_key (file, setting_name, key, NULL); - return; - } - } - - /* Look through the list of handlers for non-standard format key values */ - while (writer->setting_name) { - if (!strcmp (writer->setting_name, setting_name) && !strcmp (writer->key, key)) { - (*writer->writer) (file, setting, key, value); - return; - } - writer++; - } - - if (type == G_TYPE_STRING) { - const char *str; - - str = g_value_get_string (value); - if (str) - g_key_file_set_string (file, setting_name, key, str); - } else if (type == G_TYPE_UINT) - g_key_file_set_integer (file, setting_name, key, (int) g_value_get_uint (value)); - else if (type == G_TYPE_INT) - g_key_file_set_integer (file, setting_name, key, g_value_get_int (value)); - else if (type == G_TYPE_UINT64) { - char *numstr; - - numstr = g_strdup_printf ("%" G_GUINT64_FORMAT, g_value_get_uint64 (value)); - g_key_file_set_value (file, setting_name, key, numstr); - g_free (numstr); - } else if (type == G_TYPE_BOOLEAN) { - g_key_file_set_boolean (file, setting_name, key, g_value_get_boolean (value)); - } else if (type == G_TYPE_CHAR) { - g_key_file_set_integer (file, setting_name, key, (int) g_value_get_char (value)); - } else if (type == DBUS_TYPE_G_UCHAR_ARRAY) { - GByteArray *array; - - array = (GByteArray *) g_value_get_boxed (value); - if (array && array->len > 0) { - int *tmp_array; - int i; - - tmp_array = g_new (gint, array->len); - for (i = 0; i < array->len; i++) - tmp_array[i] = (int) array->data[i]; - - g_key_file_set_integer_list (file, setting_name, key, tmp_array, array->len); - g_free (tmp_array); - } - } else if (type == DBUS_TYPE_G_LIST_OF_STRING) { - GSList *list; - GSList *iter; - - list = (GSList *) g_value_get_boxed (value); - if (list) { - char **array; - int i = 0; - - array = g_new (char *, g_slist_length (list)); - for (iter = list; iter; iter = iter->next) - array[i++] = iter->data; - - g_key_file_set_string_list (file, setting_name, key, (const gchar **const) array, i); - g_free (array); - } - } else if (type == DBUS_TYPE_G_MAP_OF_STRING) { - write_hash_of_string (file, setting, key, value); - } else if (type == DBUS_TYPE_G_UINT_ARRAY) { - if (!write_array_of_uint (file, setting, key, value)) { - g_warning ("Unhandled setting property type (write) '%s/%s' : '%s'", - setting_name, key, g_type_name (type)); - } - } else { - g_warning ("Unhandled setting property type (write) '%s/%s' : '%s'", - setting_name, key, g_type_name (type)); - } -} - -char * -writer_id_to_filename (const char *id) -{ - char *filename, *f; - const char *i = id; - - f = filename = g_malloc0 (strlen (id) + 1); - - /* Convert '/' to '*' */ - while (*i) { - if (*i == '/') - *f++ = '*'; - else - *f++ = *i; - i++; - } - - return filename; -} - -gboolean -write_connection (NMConnection *connection, - const char *keyfile_dir, - uid_t owner_uid, - pid_t owner_grp, - char **out_path, - GError **error) -{ - NMSettingConnection *s_con; - GKeyFile *key_file; - char *data; - gsize len; - gboolean success = FALSE; - char *filename, *path; - int err; - - if (out_path) - g_return_val_if_fail (*out_path == NULL, FALSE); - - s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); - if (!s_con) - return success; - - key_file = g_key_file_new (); - nm_connection_for_each_setting_value (connection, write_setting_value, key_file); - data = g_key_file_to_data (key_file, &len, error); - if (!data) - goto out; - - filename = writer_id_to_filename (nm_setting_connection_get_id (s_con)); - path = g_build_filename (keyfile_dir, filename, NULL); - g_free (filename); - - g_file_set_contents (path, data, len, error); - if (chown (path, owner_uid, owner_grp) < 0) { - g_set_error (error, - NM_SETTINGS_INTERFACE_ERROR, - NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, - "%s.%d: error chowning '%s': %d", __FILE__, __LINE__, - path, errno); - unlink (path); - } else { - err = chmod (path, S_IRUSR | S_IWUSR); - if (err) { - g_set_error (error, - NM_SETTINGS_INTERFACE_ERROR, - NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, - "%s.%d: error setting permissions on '%s': %d", __FILE__, - __LINE__, path, errno); - unlink (path); - } else { - if (out_path) - *out_path = g_strdup (path); - success = TRUE; - } - } - g_free (path); - -out: - g_free (data); - g_key_file_free (key_file); - return success; -} diff --git a/system-settings/plugins/keyfile/io/writer.h b/system-settings/plugins/keyfile/io/writer.h deleted file mode 100644 index fa04deef98..0000000000 --- a/system-settings/plugins/keyfile/io/writer.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* NetworkManager system settings service - keyfile plugin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright (C) 2008 Novell, Inc. - * Copyright (C) 2008 Red Hat, Inc. - */ - -#ifndef _KEYFILE_PLUGIN_WRITER_H -#define _KEYFILE_PLUGIN_WRITER_H - -#include -#include -#include - -gboolean write_connection (NMConnection *connection, - const char *keyfile_dir, - uid_t owner_uid, - pid_t owner_grp, - char **out_path, - GError **error); - -char *writer_id_to_filename (const char *id); - -#endif /* _KEYFILE_PLUGIN_WRITER_H */ diff --git a/system-settings/plugins/keyfile/nm-keyfile-connection.c b/system-settings/plugins/keyfile/nm-keyfile-connection.c index 2d234fd5dd..3c27a54c79 100644 --- a/system-settings/plugins/keyfile/nm-keyfile-connection.c +++ b/system-settings/plugins/keyfile/nm-keyfile-connection.c @@ -31,6 +31,7 @@ #include "nm-keyfile-connection.h" #include "reader.h" #include "writer.h" +#include "common.h" static NMSettingsConnectionInterface *parent_settings_connection_iface; diff --git a/system-settings/plugins/keyfile/plugin.c b/system-settings/plugins/keyfile/plugin.c index f48edbeb4c..27ae0a06f6 100644 --- a/system-settings/plugins/keyfile/plugin.c +++ b/system-settings/plugins/keyfile/plugin.c @@ -38,9 +38,7 @@ #include "nm-system-config-interface.h" #include "nm-keyfile-connection.h" #include "writer.h" - -#define KEYFILE_PLUGIN_NAME "keyfile" -#define KEYFILE_PLUGIN_INFO "(c) 2007 - 2010 Red Hat, Inc. To report bugs please use the NetworkManager mailing list." +#include "common.h" #define CONF_FILE SYSCONFDIR "/NetworkManager/NetworkManager.conf" #define OLD_CONF_FILE SYSCONFDIR "/NetworkManager/nm-system-settings.conf" diff --git a/system-settings/plugins/keyfile/reader.c b/system-settings/plugins/keyfile/reader.c new file mode 100644 index 0000000000..8a81df0df1 --- /dev/null +++ b/system-settings/plugins/keyfile/reader.c @@ -0,0 +1,1106 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service - keyfile plugin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 - 2009 Novell, Inc. + * Copyright (C) 2008 - 2010 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nm-dbus-glib-types.h" +#include "reader.h" +#include "common.h" + +static gboolean +read_array_of_uint (GKeyFile *file, + NMSetting *setting, + const char *key) +{ + GArray *array = NULL; + gsize length; + int i; + gint *tmp; + + tmp = g_key_file_get_integer_list (file, nm_setting_get_name (setting), key, &length, NULL); + array = g_array_sized_new (FALSE, FALSE, sizeof (guint32), length); + for (i = 0; i < length; i++) + g_array_append_val (array, tmp[i]); + + if (array) { + g_object_set (setting, key, array, NULL); + g_array_free (array, TRUE); + } + + return TRUE; +} + +static gboolean +get_one_int (const char *str, guint32 max_val, const char *key_name, guint32 *out) +{ + long tmp; + + errno = 0; + tmp = strtol (str, NULL, 10); + if (errno || (tmp < 0) || (tmp > max_val)) { + g_warning ("%s: ignoring invalid IP %s item '%s'", __func__, key_name, str); + return FALSE; + } + + *out = (guint32) tmp; + return TRUE; +} + +static void +free_one_ip4_address (gpointer data, gpointer user_data) +{ + g_array_free ((GArray *) data, TRUE); +} + +static GPtrArray * +read_ip4_addresses (GKeyFile *file, + const char *setting_name, + const char *key) +{ + GPtrArray *addresses; + int i = 0; + + addresses = g_ptr_array_sized_new (3); + + /* Look for individual addresses */ + while (i++ < 1000) { + gchar **tmp, **iter; + char *key_name; + gsize length = 0; + int ret; + GArray *address; + guint32 empty = 0; + int j; + + key_name = g_strdup_printf ("%s%d", key, i); + tmp = g_key_file_get_string_list (file, setting_name, key_name, &length, NULL); + g_free (key_name); + + if (!tmp || !length) + break; /* all done */ + + if ((length < 2) || (length > 3)) { + g_warning ("%s: ignoring invalid IPv4 address item '%s'", __func__, key_name); + goto next; + } + + /* convert the string array into IP addresses */ + address = g_array_sized_new (FALSE, TRUE, sizeof (guint32), 3); + for (iter = tmp, j = 0; *iter; iter++, j++) { + struct in_addr addr; + + if (j == 1) { + guint32 prefix = 0; + + /* prefix */ + if (!get_one_int (*iter, 32, key_name, &prefix)) { + g_array_free (address, TRUE); + goto next; + } + + g_array_append_val (address, prefix); + } else { + /* address and gateway */ + ret = inet_pton (AF_INET, *iter, &addr); + if (ret <= 0) { + g_warning ("%s: ignoring invalid IPv4 %s element '%s'", __func__, key_name, *iter); + g_array_free (address, TRUE); + goto next; + } + g_array_append_val (address, addr.s_addr); + } + } + + /* fill in blank gateway if not specified */ + if (address->len == 2) + g_array_append_val (address, empty); + + g_ptr_array_add (addresses, address); + +next: + g_strfreev (tmp); + } + + if (addresses->len < 1) { + g_ptr_array_free (addresses, TRUE); + addresses = NULL; + } + + return addresses; +} + +static void +ip4_addr_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) +{ + GPtrArray *addresses; + const char *setting_name = nm_setting_get_name (setting); + + addresses = read_ip4_addresses (keyfile, setting_name, key); + + /* Work around for previous syntax */ + if (!addresses && !strcmp (key, NM_SETTING_IP4_CONFIG_ADDRESSES)) + addresses = read_ip4_addresses (keyfile, setting_name, "address"); + + if (addresses) { + g_object_set (setting, key, addresses, NULL); + g_ptr_array_foreach (addresses, free_one_ip4_address, NULL); + g_ptr_array_free (addresses, TRUE); + } +} + +static void +free_one_ip4_route (gpointer data, gpointer user_data) +{ + g_array_free ((GArray *) data, TRUE); +} + +static GPtrArray * +read_ip4_routes (GKeyFile *file, + const char *setting_name, + const char *key) +{ + GPtrArray *routes; + int i = 0; + + routes = g_ptr_array_sized_new (3); + + /* Look for individual routes */ + while (i++ < 1000) { + gchar **tmp, **iter; + char *key_name; + gsize length = 0; + int ret; + GArray *route; + int j; + + key_name = g_strdup_printf ("%s%d", key, i); + tmp = g_key_file_get_string_list (file, setting_name, key_name, &length, NULL); + g_free (key_name); + + if (!tmp || !length) + break; /* all done */ + + if (length != 4) { + g_warning ("%s: ignoring invalid IPv4 route item '%s'", __func__, key_name); + goto next; + } + + /* convert the string array into IP addresses */ + route = g_array_sized_new (FALSE, TRUE, sizeof (guint32), 4); + for (iter = tmp, j = 0; *iter; iter++, j++) { + struct in_addr addr; + + if (j == 1) { + guint32 prefix = 0; + + /* prefix */ + if (!get_one_int (*iter, 32, key_name, &prefix)) { + g_array_free (route, TRUE); + goto next; + } + + g_array_append_val (route, prefix); + } else if (j == 3) { + guint32 metric = 0; + + /* metric */ + if (!get_one_int (*iter, G_MAXUINT32, key_name, &metric)) { + g_array_free (route, TRUE); + goto next; + } + + g_array_append_val (route, metric); + } else { + /* address and next hop */ + ret = inet_pton (AF_INET, *iter, &addr); + if (ret <= 0) { + g_warning ("%s: ignoring invalid IPv4 %s element '%s'", __func__, key_name, *iter); + g_array_free (route, TRUE); + goto next; + } + g_array_append_val (route, addr.s_addr); + } + } + g_ptr_array_add (routes, route); + +next: + g_strfreev (tmp); + } + + if (routes->len < 1) { + g_ptr_array_free (routes, TRUE); + routes = NULL; + } + + return routes; +} + +static void +ip4_route_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) +{ + GPtrArray *routes; + const char *setting_name = nm_setting_get_name (setting); + + routes = read_ip4_routes (keyfile, setting_name, key); + if (routes) { + g_object_set (setting, key, routes, NULL); + g_ptr_array_foreach (routes, free_one_ip4_route, NULL); + g_ptr_array_free (routes, TRUE); + } +} + +static void +ip4_dns_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) +{ + const char *setting_name = nm_setting_get_name (setting); + GArray *array = NULL; + gsize length; + char **list, **iter; + int ret; + + list = g_key_file_get_string_list (keyfile, setting_name, key, &length, NULL); + if (!list || !g_strv_length (list)) + return; + + array = g_array_sized_new (FALSE, FALSE, sizeof (guint32), length); + for (iter = list; *iter; iter++) { + struct in_addr addr; + + ret = inet_pton (AF_INET, *iter, &addr); + if (ret <= 0) { + g_warning ("%s: ignoring invalid DNS server address '%s'", __func__, *iter); + continue; + } + + g_array_append_val (array, addr.s_addr); + } + g_strfreev (list); + + if (array) { + g_object_set (setting, key, array, NULL); + g_array_free (array, TRUE); + } +} + +static void +free_one_ip6_address (gpointer data, gpointer user_data) +{ + g_value_array_free ((GValueArray *) data); +} + +static char * +split_prefix (char *addr) +{ + char *slash; + + g_return_val_if_fail (addr != NULL, NULL); + + /* Find the prefix and split the string */ + slash = strchr (addr, '/'); + if (slash && slash > addr) { + slash++; + *(slash - 1) = '\0'; + } + + return slash; +} + +static char * +split_gw (char *str) +{ + char *comma; + + g_return_val_if_fail (str != NULL, NULL); + + /* Find the prefix and split the string */ + comma = strchr (str, ','); + if (comma && comma > str) { + comma++; + *(comma - 1) = '\0'; + return comma; + } + return NULL; +} + +static GPtrArray * +read_ip6_addresses (GKeyFile *file, + const char *setting_name, + const char *key) +{ + GPtrArray *addresses; + struct in6_addr addr, gw; + guint32 prefix; + int i = 0; + + addresses = g_ptr_array_sized_new (3); + + /* Look for individual addresses */ + while (i++ < 1000) { + char *tmp, *key_name, *str_prefix, *str_gw; + int ret; + GValueArray *values; + GByteArray *address; + GByteArray *gateway; + GValue value = { 0 }; + + key_name = g_strdup_printf ("%s%d", key, i); + tmp = g_key_file_get_string (file, setting_name, key_name, NULL); + g_free (key_name); + + if (!tmp) + break; /* all done */ + + /* convert the string array into IPv6 addresses */ + values = g_value_array_new (2); /* NMIP6Address has 2 items */ + + /* Split the address and prefix */ + str_prefix = split_prefix (tmp); + + /* address */ + ret = inet_pton (AF_INET6, tmp, &addr); + if (ret <= 0) { + g_warning ("%s: ignoring invalid IPv6 %s element '%s'", __func__, key_name, tmp); + g_value_array_free (values); + goto next; + } + + address = g_byte_array_new (); + g_byte_array_append (address, (guint8 *) addr.s6_addr, 16); + g_value_init (&value, DBUS_TYPE_G_UCHAR_ARRAY); + g_value_take_boxed (&value, address); + g_value_array_append (values, &value); + g_value_unset (&value); + + /* prefix */ + prefix = 0; + if (str_prefix) { + if (!get_one_int (str_prefix, 128, key_name, &prefix)) { + g_value_array_free (values); + goto next; + } + } else { + /* Missing prefix defaults to /64 */ + prefix = 64; + } + + g_value_init (&value, G_TYPE_UINT); + g_value_set_uint (&value, prefix); + g_value_array_append (values, &value); + g_value_unset (&value); + + /* Gateway (optional) */ + str_gw = split_gw (str_prefix); + if (str_gw) { + ret = inet_pton (AF_INET6, str_gw, &gw); + if (ret <= 0) { + g_warning ("%s: ignoring invalid IPv6 %s gateway '%s'", __func__, key_name, tmp); + g_value_array_free (values); + goto next; + } + + if (!IN6_IS_ADDR_UNSPECIFIED (&gw)) { + gateway = g_byte_array_new (); + g_byte_array_append (gateway, (guint8 *) gw.s6_addr, 16); + g_value_init (&value, DBUS_TYPE_G_UCHAR_ARRAY); + g_value_take_boxed (&value, gateway); + g_value_array_append (values, &value); + g_value_unset (&value); + } + } + + g_ptr_array_add (addresses, values); + +next: + g_free (tmp); + } + + if (addresses->len < 1) { + g_ptr_array_free (addresses, TRUE); + addresses = NULL; + } + + return addresses; +} + +static void +ip6_addr_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) +{ + GPtrArray *addresses; + const char *setting_name = nm_setting_get_name (setting); + + addresses = read_ip6_addresses (keyfile, setting_name, key); + if (addresses) { + g_object_set (setting, key, addresses, NULL); + g_ptr_array_foreach (addresses, free_one_ip6_address, NULL); + g_ptr_array_free (addresses, TRUE); + } +} + +static void +free_one_ip6_route (gpointer data, gpointer user_data) +{ + g_value_array_free ((GValueArray *) data); +} + +static GPtrArray * +read_ip6_routes (GKeyFile *file, + const char *setting_name, + const char *key) +{ + GPtrArray *routes; + struct in6_addr addr; + guint32 prefix, metric; + int i = 0; + + routes = g_ptr_array_sized_new (3); + + /* Look for individual routes */ + while (i++ < 1000) { + gchar **tmp; + char *key_name, *str_prefix; + gsize length = 0; + int ret; + GValueArray *values; + GByteArray *address; + GValue value = { 0 }; + + key_name = g_strdup_printf ("%s%d", key, i); + tmp = g_key_file_get_string_list (file, setting_name, key_name, &length, NULL); + g_free (key_name); + + if (!tmp || !length) + break; /* all done */ + + if (length != 3) { + g_warning ("%s: ignoring invalid IPv6 address item '%s'", __func__, key_name); + goto next; + } + + /* convert the string array into IPv6 routes */ + values = g_value_array_new (4); /* NMIP6Route has 4 items */ + + /* Split the route and prefix */ + str_prefix = split_prefix (tmp[0]); + + /* destination address */ + ret = inet_pton (AF_INET6, tmp[0], &addr); + if (ret <= 0) { + g_warning ("%s: ignoring invalid IPv6 %s element '%s'", __func__, key_name, tmp[0]); + g_value_array_free (values); + goto next; + } + address = g_byte_array_new (); + g_byte_array_append (address, (guint8 *) addr.s6_addr, 16); + g_value_init (&value, DBUS_TYPE_G_UCHAR_ARRAY); + g_value_take_boxed (&value, address); + g_value_array_append (values, &value); + g_value_unset (&value); + + /* prefix */ + prefix = 0; + if (str_prefix) { + if (!get_one_int (str_prefix, 128, key_name, &prefix)) { + g_value_array_free (values); + goto next; + } + } else { + /* default to 64 if unspecified */ + prefix = 64; + } + g_value_init (&value, G_TYPE_UINT); + g_value_set_uint (&value, prefix); + g_value_array_append (values, &value); + g_value_unset (&value); + + /* next hop address */ + ret = inet_pton (AF_INET6, tmp[1], &addr); + if (ret <= 0) { + g_warning ("%s: ignoring invalid IPv6 %s element '%s'", __func__, key_name, tmp[1]); + g_value_array_free (values); + goto next; + } + address = g_byte_array_new (); + g_byte_array_append (address, (guint8 *) addr.s6_addr, 16); + g_value_init (&value, DBUS_TYPE_G_UCHAR_ARRAY); + g_value_take_boxed (&value, address); + g_value_array_append (values, &value); + g_value_unset (&value); + + /* metric */ + metric = 0; + if (!get_one_int (tmp[2], G_MAXUINT32, key_name, &metric)) { + g_value_array_free (values); + goto next; + } + g_value_init (&value, G_TYPE_UINT); + g_value_set_uint (&value, metric); + g_value_array_append (values, &value); + g_value_unset (&value); + + g_ptr_array_add (routes, values); + +next: + g_strfreev (tmp); + } + + if (routes->len < 1) { + g_ptr_array_free (routes, TRUE); + routes = NULL; + } + + return routes; +} + +static void +ip6_route_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) +{ + GPtrArray *routes; + const char *setting_name = nm_setting_get_name (setting); + + routes = read_ip6_routes (keyfile, setting_name, key); + + if (routes) { + g_object_set (setting, key, routes, NULL); + g_ptr_array_foreach (routes, free_one_ip6_route, NULL); + g_ptr_array_free (routes, TRUE); + } +} + +static void +free_one_ip6_dns (gpointer data, gpointer user_data) +{ + g_byte_array_free ((GByteArray *) data, TRUE); +} + +static void +ip6_dns_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) +{ + const char *setting_name = nm_setting_get_name (setting); + GPtrArray *array = NULL; + gsize length; + char **list, **iter; + int ret; + + list = g_key_file_get_string_list (keyfile, setting_name, key, &length, NULL); + if (!list || !g_strv_length (list)) + return; + + array = g_ptr_array_sized_new (length); + for (iter = list; *iter; iter++) { + GByteArray *byte_array; + struct in6_addr addr; + + ret = inet_pton (AF_INET6, *iter, &addr); + if (ret <= 0) { + g_warning ("%s: ignoring invalid DNS server IPv6 address '%s'", __func__, *iter); + continue; + } + byte_array = g_byte_array_new (); + g_byte_array_append (byte_array, (guint8 *) addr.s6_addr, 16); + + g_ptr_array_add (array, byte_array); + } + g_strfreev (list); + + if (array) { + g_object_set (setting, key, array, NULL); + g_ptr_array_foreach (array, free_one_ip6_dns, NULL); + g_ptr_array_free (array, TRUE); + } +} + +static void +mac_address_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) +{ + const char *setting_name = nm_setting_get_name (setting); + struct ether_addr *eth; + char *tmp_string = NULL, *p; + gint *tmp_list; + GByteArray *array = NULL; + gsize length; + int i; + + p = tmp_string = g_key_file_get_string (keyfile, setting_name, key, NULL); + if (tmp_string) { + /* Look for enough ':' characters to signify a MAC address */ + i = 0; + while (*p) { + if (*p == ':') + i++; + p++; + } + if (i == 5) { + /* parse as a MAC address */ + eth = ether_aton (tmp_string); + if (eth) { + g_free (tmp_string); + array = g_byte_array_sized_new (ETH_ALEN); + g_byte_array_append (array, eth->ether_addr_octet, ETH_ALEN); + goto done; + } + } + } + g_free (tmp_string); + + /* Old format; list of ints */ + tmp_list = g_key_file_get_integer_list (keyfile, setting_name, key, &length, NULL); + array = g_byte_array_sized_new (length); + for (i = 0; i < length; i++) { + int val = tmp_list[i]; + unsigned char v = (unsigned char) (val & 0xFF); + + if (val < 0 || val > 255) { + g_warning ("%s: %s / %s ignoring invalid byte element '%d' (not " + " between 0 and 255 inclusive)", __func__, setting_name, + key, val); + } else + g_byte_array_append (array, (const unsigned char *) &v, sizeof (v)); + } + g_free (tmp_list); + +done: + if (array->len == ETH_ALEN) { + g_object_set (setting, key, array, NULL); + } else { + g_warning ("%s: ignoring invalid MAC address for %s / %s", + __func__, setting_name, key); + } + g_byte_array_free (array, TRUE); +} + +static void +read_hash_of_string (GKeyFile *file, NMSetting *setting, const char *key) +{ + char **keys, **iter; + char *value; + const char *setting_name = nm_setting_get_name (setting); + + keys = g_key_file_get_keys (file, setting_name, NULL, NULL); + if (!keys || !*keys) + return; + + for (iter = keys; *iter; iter++) { + value = g_key_file_get_string (file, setting_name, *iter, NULL); + if (!value) + continue; + + if (NM_IS_SETTING_VPN (setting)) { + if (strcmp (*iter, NM_SETTING_VPN_SERVICE_TYPE)) + nm_setting_vpn_add_data_item (NM_SETTING_VPN (setting), *iter, value); + } + g_free (value); + } + g_strfreev (keys); +} + + +typedef struct { + const char *setting_name; + const char *key; + gboolean check_for_key; + void (*parser) (NMSetting *setting, const char *key, GKeyFile *keyfile); +} KeyParser; + +/* A table of keys that require further parsing/conversion becuase they are + * stored in a format that can't be automatically read using the key's type. + * i.e. IPv4 addresses, which are stored in NetworkManager as guint32, but are + * stored in keyfiles as strings, eg "10.1.1.2" or IPv6 addresses stored + * in struct in6_addr internally, but as string in keyfiles. + */ +static KeyParser key_parsers[] = { + { NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES, + FALSE, + ip4_addr_parser }, + { NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES, + FALSE, + ip6_addr_parser }, + { NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ROUTES, + FALSE, + ip4_route_parser }, + { NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ROUTES, + FALSE, + ip6_route_parser }, + { NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS, + FALSE, + ip4_dns_parser }, + { NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS, + FALSE, + ip6_dns_parser }, + { NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS, + TRUE, + mac_address_parser }, + { NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_CLONED_MAC_ADDRESS, + TRUE, + mac_address_parser }, + { NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MAC_ADDRESS, + TRUE, + mac_address_parser }, + { NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS, + TRUE, + mac_address_parser }, + { NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_BSSID, + TRUE, + mac_address_parser }, + { NM_SETTING_BLUETOOTH_SETTING_NAME, + NM_SETTING_BLUETOOTH_BDADDR, + TRUE, + mac_address_parser }, + { NULL, NULL, FALSE } +}; + +static void +read_one_setting_value (NMSetting *setting, + const char *key, + const GValue *value, + GParamFlags flags, + gpointer user_data) +{ + GKeyFile *file = user_data; + const char *setting_name; + GType type; + GError *err = NULL; + gboolean check_for_key = TRUE; + KeyParser *parser = &key_parsers[0]; + + /* Property is not writable */ + if (!(flags & G_PARAM_WRITABLE)) + return; + + /* Setting name gets picked up from the keyfile's section name instead */ + if (!strcmp (key, NM_SETTING_NAME)) + return; + + /* Don't read the NMSettingConnection object's 'read-only' property */ + if ( NM_IS_SETTING_CONNECTION (setting) + && !strcmp (key, NM_SETTING_CONNECTION_READ_ONLY)) + return; + + setting_name = nm_setting_get_name (setting); + + /* Look through the list of handlers for non-standard format key values */ + while (parser->setting_name) { + if (!strcmp (parser->setting_name, setting_name) && !strcmp (parser->key, key)) { + check_for_key = parser->check_for_key; + break; + } + parser++; + } + + /* VPN properties don't have the exact key name */ + if (NM_IS_SETTING_VPN (setting)) + check_for_key = FALSE; + + /* Check for the exact key in the GKeyFile if required. Most setting + * properties map 1:1 to a key in the GKeyFile, but for those properties + * like IP addresses and routes where more than one value is actually + * encoded by the setting property, this won't be true. + */ + if (check_for_key && !g_key_file_has_key (file, setting_name, key, &err)) { + /* Key doesn't exist or an error ocurred, thus nothing to do. */ + if (err) { + g_warning ("Error loading setting '%s' value: %s", setting_name, err->message); + g_error_free (err); + } + return; + } + + /* If there's a custom parser for this key, handle that before the generic + * parsers below. + */ + if (parser && parser->setting_name) { + (*parser->parser) (setting, key, file); + return; + } + + type = G_VALUE_TYPE (value); + + if (type == G_TYPE_STRING) { + char *str_val; + + str_val = g_key_file_get_string (file, setting_name, key, NULL); + g_object_set (setting, key, str_val, NULL); + g_free (str_val); + } else if (type == G_TYPE_UINT) { + int int_val; + + int_val = g_key_file_get_integer (file, setting_name, key, NULL); + if (int_val < 0) + g_warning ("Casting negative value (%i) to uint", int_val); + g_object_set (setting, key, int_val, NULL); + } else if (type == G_TYPE_INT) { + int int_val; + + int_val = g_key_file_get_integer (file, setting_name, key, NULL); + g_object_set (setting, key, int_val, NULL); + } else if (type == G_TYPE_BOOLEAN) { + gboolean bool_val; + + bool_val = g_key_file_get_boolean (file, setting_name, key, NULL); + g_object_set (setting, key, bool_val, NULL); + } else if (type == G_TYPE_CHAR) { + int int_val; + + int_val = g_key_file_get_integer (file, setting_name, key, NULL); + if (int_val < G_MININT8 || int_val > G_MAXINT8) + g_warning ("Casting value (%i) to char", int_val); + + g_object_set (setting, key, int_val, NULL); + } else if (type == G_TYPE_UINT64) { + char *tmp_str; + guint64 uint_val; + + tmp_str = g_key_file_get_value (file, setting_name, key, NULL); + uint_val = g_ascii_strtoull (tmp_str, NULL, 10); + g_free (tmp_str); + g_object_set (setting, key, uint_val, NULL); + } else if (type == DBUS_TYPE_G_UCHAR_ARRAY) { + gint *tmp; + GByteArray *array; + gsize length; + int i; + + tmp = g_key_file_get_integer_list (file, setting_name, key, &length, NULL); + + array = g_byte_array_sized_new (length); + for (i = 0; i < length; i++) { + int val = tmp[i]; + unsigned char v = (unsigned char) (val & 0xFF); + + if (val < 0 || val > 255) { + g_warning ("%s: %s / %s ignoring invalid byte element '%d' (not " + " between 0 and 255 inclusive)", __func__, setting_name, + key, val); + } else + g_byte_array_append (array, (const unsigned char *) &v, sizeof (v)); + } + + g_object_set (setting, key, array, NULL); + g_byte_array_free (array, TRUE); + g_free (tmp); + } else if (type == DBUS_TYPE_G_LIST_OF_STRING) { + gchar **sa; + gsize length; + int i; + GSList *list = NULL; + + sa = g_key_file_get_string_list (file, setting_name, key, &length, NULL); + for (i = 0; i < length; i++) + list = g_slist_prepend (list, sa[i]); + + list = g_slist_reverse (list); + g_object_set (setting, key, list, NULL); + + g_slist_free (list); + g_strfreev (sa); + } else if (type == DBUS_TYPE_G_MAP_OF_STRING) { + read_hash_of_string (file, setting, key); + } else if (type == DBUS_TYPE_G_UINT_ARRAY) { + if (!read_array_of_uint (file, setting, key)) { + g_warning ("Unhandled setting property type (read): '%s/%s' : '%s'", + setting_name, key, G_VALUE_TYPE_NAME (value)); + } + } else { + g_warning ("Unhandled setting property type (read): '%s/%s' : '%s'", + setting_name, key, G_VALUE_TYPE_NAME (value)); + } +} + +static NMSetting * +read_setting (GKeyFile *file, const char *name) +{ + NMSetting *setting; + + setting = nm_connection_create_setting (name); + if (setting) + nm_setting_enumerate_values (setting, read_one_setting_value, (gpointer) file); + else + g_warning ("Invalid setting name '%s'", name); + + return setting; +} + +static void +read_vpn_secrets (GKeyFile *file, NMSettingVPN *s_vpn) +{ + char **keys, **iter; + + keys = g_key_file_get_keys (file, VPN_SECRETS_GROUP, NULL, NULL); + for (iter = keys; *iter; iter++) { + char *secret; + + secret = g_key_file_get_string (file, VPN_SECRETS_GROUP, *iter, NULL); + if (secret) { + nm_setting_vpn_add_secret (s_vpn, *iter, secret); + g_free (secret); + } + } + g_strfreev (keys); +} + +NMConnection * +connection_from_file (const char *filename, GError **error) +{ + GKeyFile *key_file; + struct stat statbuf; + gboolean bad_owner, bad_permissions; + NMConnection *connection = NULL; + NMSettingConnection *s_con; + NMSettingBluetooth *s_bt; + NMSetting *setting; + gchar **groups; + gsize length; + int i; + gboolean vpn_secrets = FALSE; + const char *ctype, *tmp; + GError *verify_error = NULL; + + if (stat (filename, &statbuf) != 0 || !S_ISREG (statbuf.st_mode)) { + g_set_error_literal (error, KEYFILE_PLUGIN_ERROR, 0, + "File did not exist or was not a regular file"); + return NULL; + } + + bad_owner = getuid () != statbuf.st_uid; + bad_permissions = statbuf.st_mode & 0077; + + if (bad_owner || bad_permissions) { + g_set_error (error, KEYFILE_PLUGIN_ERROR, 0, + "File permissions (%o) or owner (%d) were insecure", + statbuf.st_mode, statbuf.st_uid); + return NULL; + } + + key_file = g_key_file_new (); + if (!g_key_file_load_from_file (key_file, filename, G_KEY_FILE_NONE, error)) + goto out; + + connection = nm_connection_new (); + + groups = g_key_file_get_groups (key_file, &length); + for (i = 0; i < length; i++) { + /* Only read out secrets when needed */ + if (!strcmp (groups[i], VPN_SECRETS_GROUP)) { + vpn_secrets = TRUE; + continue; + } + + setting = read_setting (key_file, groups[i]); + if (setting) + nm_connection_add_setting (connection, setting); + } + + /* Make sure that we have the base device type setting even if + * the keyfile didn't include it, which can happen when the base + * device type setting is all default values (like ethernet). + */ + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + if (s_con) { + ctype = nm_setting_connection_get_connection_type (s_con); + setting = nm_connection_get_setting_by_name (connection, ctype); + if (ctype) { + gboolean add_serial = FALSE; + NMSetting *new_setting = NULL; + + if (!setting && !strcmp (ctype, NM_SETTING_WIRED_SETTING_NAME)) + new_setting = nm_setting_wired_new (); + else if (!strcmp (ctype, NM_SETTING_BLUETOOTH_SETTING_NAME)) { + s_bt = (NMSettingBluetooth *) nm_connection_get_setting (connection, NM_TYPE_SETTING_BLUETOOTH); + if (s_bt) { + tmp = nm_setting_bluetooth_get_connection_type (s_bt); + if (tmp && !strcmp (tmp, NM_SETTING_BLUETOOTH_TYPE_DUN)) + add_serial = TRUE; + } + } else if (!strcmp (ctype, NM_SETTING_GSM_SETTING_NAME)) + add_serial = TRUE; + else if (!strcmp (ctype, NM_SETTING_CDMA_SETTING_NAME)) + add_serial = TRUE; + + /* Bluetooth DUN, GSM, and CDMA connections require a serial setting */ + if (add_serial && !nm_connection_get_setting (connection, NM_TYPE_SETTING_SERIAL)) + new_setting = nm_setting_serial_new (); + + if (new_setting) + nm_connection_add_setting (connection, new_setting); + } + } + + /* Serial connections require a PPP setting too */ + if (nm_connection_get_setting (connection, NM_TYPE_SETTING_SERIAL)) { + if (!nm_connection_get_setting (connection, NM_TYPE_SETTING_PPP)) + nm_connection_add_setting (connection, nm_setting_ppp_new ()); + } + + /* Handle vpn secrets after the 'vpn' setting was read */ + if (vpn_secrets) { + NMSettingVPN *s_vpn; + + s_vpn = (NMSettingVPN *) nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN); + if (s_vpn) + read_vpn_secrets (key_file, s_vpn); + } + + g_strfreev (groups); + + /* Verify the connection */ + if (!nm_connection_verify (connection, &verify_error)) { + g_set_error (error, KEYFILE_PLUGIN_ERROR, 0, + "invalid or missing connection property '%s'", + (verify_error && verify_error->message) ? verify_error->message : "(unknown)"); + g_clear_error (&verify_error); + g_object_unref (connection); + connection = NULL; + } + +out: + g_key_file_free (key_file); + return connection; +} diff --git a/system-settings/plugins/keyfile/reader.h b/system-settings/plugins/keyfile/reader.h new file mode 100644 index 0000000000..3572715495 --- /dev/null +++ b/system-settings/plugins/keyfile/reader.h @@ -0,0 +1,30 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service - keyfile plugin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 Novell, Inc. + * Copyright (C) 2008 Red Hat, Inc. + */ + +#ifndef _KEYFILE_PLUGIN_READER_H +#define _KEYFILE_PLUGIN_READER_H + +#include +#include + +NMConnection *connection_from_file (const char *filename, GError **error); + +#endif /* _KEYFILE_PLUGIN_READER_H */ diff --git a/system-settings/plugins/keyfile/tests/Makefile.am b/system-settings/plugins/keyfile/tests/Makefile.am index a0af14b269..af76667867 100644 --- a/system-settings/plugins/keyfile/tests/Makefile.am +++ b/system-settings/plugins/keyfile/tests/Makefile.am @@ -4,7 +4,7 @@ INCLUDES = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/libnm-util \ -I$(top_srcdir)/libnm-glib \ - -I$(top_srcdir)/system-settings/plugins/keyfile/io + -I$(top_srcdir)/system-settings/plugins/keyfile noinst_PROGRAMS = test-keyfile @@ -18,7 +18,7 @@ test_keyfile_CPPFLAGS = \ -DTEST_SCRATCH_DIR=\"$(abs_builddir)/keyfiles\" test_keyfile_LDADD = \ - $(top_builddir)/system-settings/plugins/keyfile/io/libkeyfile-io.la \ + $(top_builddir)/system-settings/plugins/keyfile/libkeyfile-io.la \ $(top_builddir)/libnm-glib/libnm-glib.la \ $(top_builddir)/libnm-util/libnm-util.la \ $(DBUS_LIBS) diff --git a/system-settings/plugins/keyfile/writer.c b/system-settings/plugins/keyfile/writer.c new file mode 100644 index 0000000000..13dfb17936 --- /dev/null +++ b/system-settings/plugins/keyfile/writer.c @@ -0,0 +1,692 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service - keyfile plugin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 Novell, Inc. + * Copyright (C) 2008 - 2010 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nm-dbus-glib-types.h" +#include "writer.h" +#include "common.h" + +static gboolean +write_array_of_uint (GKeyFile *file, + NMSetting *setting, + const char *key, + const GValue *value) +{ + GArray *array; + int i; + int *tmp_array; + + array = (GArray *) g_value_get_boxed (value); + if (!array || !array->len) + return TRUE; + + tmp_array = g_new (gint, array->len); + for (i = 0; i < array->len; i++) + tmp_array[i] = g_array_index (array, int, i); + + g_key_file_set_integer_list (file, nm_setting_get_name (setting), key, tmp_array, array->len); + g_free (tmp_array); + return TRUE; +} + +static void +ip4_dns_writer (GKeyFile *file, + NMSetting *setting, + const char *key, + const GValue *value) +{ + GArray *array; + char **list; + int i, num = 0; + + g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_UINT_ARRAY)); + + array = (GArray *) g_value_get_boxed (value); + if (!array || !array->len) + return; + + list = g_new0 (char *, array->len + 1); + + for (i = 0; i < array->len; i++) { + char buf[INET_ADDRSTRLEN + 1]; + struct in_addr addr; + + addr.s_addr = g_array_index (array, guint32, i); + if (!inet_ntop (AF_INET, &addr, buf, sizeof (buf))) { + nm_warning ("%s: error converting IP4 address 0x%X", + __func__, ntohl (addr.s_addr)); + } else + list[num++] = g_strdup (buf); + } + + g_key_file_set_string_list (file, nm_setting_get_name (setting), key, (const char **) list, num); + g_strfreev (list); +} + +static void +write_ip4_values (GKeyFile *file, + const char *setting_name, + const char *key, + GPtrArray *array, + guint32 tuple_len, + guint32 addr1_pos, + guint32 addr2_pos) +{ + char **list = NULL; + int i, j; + + list = g_new (char *, tuple_len); + + for (i = 0, j = 0; i < array->len; i++, j++) { + GArray *tuple = g_ptr_array_index (array, i); + gboolean success = TRUE; + char *key_name; + int k; + + memset (list, 0, tuple_len * sizeof (char *)); + + for (k = 0; k < tuple_len; k++) { + if (k == addr1_pos || k == addr2_pos) { + char buf[INET_ADDRSTRLEN + 1]; + struct in_addr addr; + + /* IP addresses */ + addr.s_addr = g_array_index (tuple, guint32, k); + if (!inet_ntop (AF_INET, &addr, buf, sizeof (buf))) { + nm_warning ("%s: error converting IP4 address 0x%X", + __func__, ntohl (addr.s_addr)); + success = FALSE; + break; + } else { + list[k] = g_strdup (buf); + } + } else { + /* prefix, metric */ + list[k] = g_strdup_printf ("%d", g_array_index (tuple, guint32, k)); + } + } + + if (success) { + key_name = g_strdup_printf ("%s%d", key, j + 1); + g_key_file_set_string_list (file, setting_name, key_name, (const char **) list, tuple_len); + g_free (key_name); + } + + for (k = 0; k < tuple_len; k++) + g_free (list[k]); + } + g_free (list); +} + +static void +ip4_addr_writer (GKeyFile *file, + NMSetting *setting, + const char *key, + const GValue *value) +{ + GPtrArray *array; + const char *setting_name = nm_setting_get_name (setting); + + g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT)); + + array = (GPtrArray *) g_value_get_boxed (value); + if (array && array->len) + write_ip4_values (file, setting_name, key, array, 3, 0, 2); +} + +static void +ip4_route_writer (GKeyFile *file, + NMSetting *setting, + const char *key, + const GValue *value) +{ + GPtrArray *array; + const char *setting_name = nm_setting_get_name (setting); + + g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT)); + + array = (GPtrArray *) g_value_get_boxed (value); + if (array && array->len) + write_ip4_values (file, setting_name, key, array, 4, 0, 2); +} + +static void +ip6_dns_writer (GKeyFile *file, + NMSetting *setting, + const char *key, + const GValue *value) +{ + GPtrArray *array; + GByteArray *byte_array; + char **list; + int i, num = 0; + + g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UCHAR)); + + array = (GPtrArray *) g_value_get_boxed (value); + if (!array || !array->len) + return; + + list = g_new0 (char *, array->len + 1); + + for (i = 0; i < array->len; i++) { + char buf[INET6_ADDRSTRLEN]; + + byte_array = g_ptr_array_index (array, i); + if (!inet_ntop (AF_INET6, (struct in6_addr *) byte_array->data, buf, sizeof (buf))) { + int j; + GString *ip6_str = g_string_new (NULL); + g_string_append_printf (ip6_str, "%02X", byte_array->data[0]); + for (j = 1; j < 16; j++) + g_string_append_printf (ip6_str, " %02X", byte_array->data[j]); + nm_warning ("%s: error converting IP6 address %s", + __func__, ip6_str->str); + g_string_free (ip6_str, TRUE); + } else + list[num++] = g_strdup (buf); + } + + g_key_file_set_string_list (file, nm_setting_get_name (setting), key, (const char **) list, num); + g_strfreev (list); +} + +static gboolean +ip6_array_to_addr (GValueArray *values, + guint32 idx, + char *buf, + size_t buflen, + gboolean *out_is_unspec) +{ + GByteArray *byte_array; + GValue *addr_val; + struct in6_addr *addr; + + g_return_val_if_fail (buflen >= INET6_ADDRSTRLEN, FALSE); + + addr_val = g_value_array_get_nth (values, idx); + byte_array = g_value_get_boxed (addr_val); + addr = (struct in6_addr *) byte_array->data; + + if (out_is_unspec && IN6_IS_ADDR_UNSPECIFIED (addr)) + *out_is_unspec = TRUE; + + errno = 0; + if (!inet_ntop (AF_INET6, addr, buf, buflen)) { + GString *ip6_str = g_string_sized_new (INET6_ADDRSTRLEN + 10); + + /* error converting the address */ + g_string_append_printf (ip6_str, "%02X", byte_array->data[0]); + for (idx = 1; idx < 16; idx++) + g_string_append_printf (ip6_str, " %02X", byte_array->data[idx]); + nm_warning ("%s: error %d converting IP6 address %s", + __func__, errno, ip6_str->str); + g_string_free (ip6_str, TRUE); + return FALSE; + } + + return TRUE; +} + +static char * +ip6_array_to_addr_prefix (GValueArray *values) +{ + GValue *prefix_val; + char *ret = NULL; + GString *ip6_str; + char buf[INET6_ADDRSTRLEN + 1]; + gboolean is_unspec = FALSE; + + /* address */ + if (ip6_array_to_addr (values, 0, buf, sizeof (buf), NULL)) { + /* Enough space for the address, '/', and the prefix */ + ip6_str = g_string_sized_new ((INET6_ADDRSTRLEN * 2) + 5); + + /* prefix */ + g_string_append (ip6_str, buf); + prefix_val = g_value_array_get_nth (values, 1); + g_string_append_printf (ip6_str, "/%u", g_value_get_uint (prefix_val)); + + if (ip6_array_to_addr (values, 2, buf, sizeof (buf), &is_unspec)) { + if (!is_unspec) + g_string_append_printf (ip6_str, ",%s", buf); + } + + ret = ip6_str->str; + g_string_free (ip6_str, FALSE); + } + + return ret; +} + +static void +ip6_addr_writer (GKeyFile *file, + NMSetting *setting, + const char *key, + const GValue *value) +{ + GPtrArray *array; + const char *setting_name = nm_setting_get_name (setting); + int i, j; + + g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS)); + + array = (GPtrArray *) g_value_get_boxed (value); + if (!array || !array->len) + return; + + for (i = 0, j = 1; i < array->len; i++) { + GValueArray *values = g_ptr_array_index (array, i); + char *key_name, *ip6_addr; + + if (values->n_values != 3) { + nm_warning ("%s: error writing IP6 address %d (address array length " + "%d is not 3)", + __func__, i, values->n_values); + continue; + } + + ip6_addr = ip6_array_to_addr_prefix (values); + if (ip6_addr) { + /* Write it out */ + key_name = g_strdup_printf ("%s%d", key, j++); + g_key_file_set_string (file, setting_name, key_name, ip6_addr); + g_free (key_name); + g_free (ip6_addr); + } + } +} + +static void +ip6_route_writer (GKeyFile *file, + NMSetting *setting, + const char *key, + const GValue *value) +{ + GPtrArray *array; + const char *setting_name = nm_setting_get_name (setting); + char *list[3]; + int i, j; + + g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE)); + + array = (GPtrArray *) g_value_get_boxed (value); + if (!array || !array->len) + return; + + for (i = 0, j = 1; i < array->len; i++) { + GValueArray *values = g_ptr_array_index (array, i); + char *key_name; + guint32 int_val; + char buf[INET6_ADDRSTRLEN + 1]; + gboolean is_unspec = FALSE; + + memset (list, 0, sizeof (list)); + + /* Address and prefix */ + list[0] = ip6_array_to_addr_prefix (values); + if (!list[0]) + continue; + + /* Next Hop */ + if (!ip6_array_to_addr (values, 2, buf, sizeof (buf), &is_unspec)) + continue; + if (is_unspec) + continue; + list[1] = g_strdup (buf); + + /* Metric */ + value = g_value_array_get_nth (values, 3); + int_val = g_value_get_uint (value); + list[2] = g_strdup_printf ("%d", int_val); + + /* Write it out */ + key_name = g_strdup_printf ("%s%d", key, j++); + g_key_file_set_string_list (file, setting_name, key_name, (const char **) list, 3); + g_free (key_name); + + g_free (list[0]); + g_free (list[1]); + g_free (list[2]); + } +} + + +static void +mac_address_writer (GKeyFile *file, + NMSetting *setting, + const char *key, + const GValue *value) +{ + GByteArray *array; + const char *setting_name = nm_setting_get_name (setting); + char *mac; + struct ether_addr tmp; + + g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_UCHAR_ARRAY)); + + array = (GByteArray *) g_value_get_boxed (value); + if (!array) + return; + + if (array->len != ETH_ALEN) { + nm_warning ("%s: invalid %s / %s MAC address length %d", + __func__, setting_name, key, array->len); + return; + } + + memcpy (tmp.ether_addr_octet, array->data, ETH_ALEN); + mac = ether_ntoa (&tmp); + g_key_file_set_string (file, setting_name, key, mac); +} + +typedef struct { + GKeyFile *file; + const char *setting_name; +} WriteStringHashInfo; + +static void +write_hash_of_string_helper (gpointer key, gpointer data, gpointer user_data) +{ + WriteStringHashInfo *info = (WriteStringHashInfo *) user_data; + const char *property = (const char *) key; + const char *value = (const char *) data; + + g_key_file_set_string (info->file, + info->setting_name, + property, + value); +} + +static void +write_hash_of_string (GKeyFile *file, + NMSetting *setting, + const char *key, + const GValue *value) +{ + GHashTable *hash = g_value_get_boxed (value); + WriteStringHashInfo info; + + info.file = file; + + /* Write VPN secrets out to a different group to keep them separate */ + if ( (G_OBJECT_TYPE (setting) == NM_TYPE_SETTING_VPN) + && !strcmp (key, NM_SETTING_VPN_SECRETS)) { + info.setting_name = VPN_SECRETS_GROUP; + } else + info.setting_name = nm_setting_get_name (setting); + + g_hash_table_foreach (hash, write_hash_of_string_helper, &info); +} + +typedef struct { + const char *setting_name; + const char *key; + void (*writer) (GKeyFile *keyfile, NMSetting *setting, const char *key, const GValue *value); +} KeyWriter; + +/* A table of keys that require further parsing/conversion becuase they are + * stored in a format that can't be automatically read using the key's type. + * i.e. IPv4 addresses, which are stored in NetworkManager as guint32, but are + * stored in keyfiles as strings, eg "10.1.1.2" or IPv6 addresses stored + * in struct in6_addr internally, but as string in keyfiles. + */ +static KeyWriter key_writers[] = { + { NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES, + ip4_addr_writer }, + { NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES, + ip6_addr_writer }, + { NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ROUTES, + ip4_route_writer }, + { NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ROUTES, + ip6_route_writer }, + { NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS, + ip4_dns_writer }, + { NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS, + ip6_dns_writer }, + { NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS, + mac_address_writer }, + { NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_CLONED_MAC_ADDRESS, + mac_address_writer }, + { NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MAC_ADDRESS, + mac_address_writer }, + { NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS, + mac_address_writer }, + { NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_BSSID, + mac_address_writer }, + { NM_SETTING_BLUETOOTH_SETTING_NAME, + NM_SETTING_BLUETOOTH_BDADDR, + mac_address_writer }, + { NULL, NULL, NULL } +}; + +static void +write_setting_value (NMSetting *setting, + const char *key, + const GValue *value, + GParamFlags flag, + gpointer user_data) +{ + GKeyFile *file = (GKeyFile *) user_data; + const char *setting_name; + GType type = G_VALUE_TYPE (value); + KeyWriter *writer = &key_writers[0]; + GParamSpec *pspec; + + /* Setting name gets picked up from the keyfile's section name instead */ + if (!strcmp (key, NM_SETTING_NAME)) + return; + + /* Don't write the NMSettingConnection object's 'read-only' property */ + if ( NM_IS_SETTING_CONNECTION (setting) + && !strcmp (key, NM_SETTING_CONNECTION_READ_ONLY)) + return; + + setting_name = nm_setting_get_name (setting); + + /* If the value is the default value, remove the item from the keyfile */ + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (setting), key); + if (pspec) { + if (g_param_value_defaults (pspec, (GValue *) value)) { + g_key_file_remove_key (file, setting_name, key, NULL); + return; + } + } + + /* Look through the list of handlers for non-standard format key values */ + while (writer->setting_name) { + if (!strcmp (writer->setting_name, setting_name) && !strcmp (writer->key, key)) { + (*writer->writer) (file, setting, key, value); + return; + } + writer++; + } + + if (type == G_TYPE_STRING) { + const char *str; + + str = g_value_get_string (value); + if (str) + g_key_file_set_string (file, setting_name, key, str); + } else if (type == G_TYPE_UINT) + g_key_file_set_integer (file, setting_name, key, (int) g_value_get_uint (value)); + else if (type == G_TYPE_INT) + g_key_file_set_integer (file, setting_name, key, g_value_get_int (value)); + else if (type == G_TYPE_UINT64) { + char *numstr; + + numstr = g_strdup_printf ("%" G_GUINT64_FORMAT, g_value_get_uint64 (value)); + g_key_file_set_value (file, setting_name, key, numstr); + g_free (numstr); + } else if (type == G_TYPE_BOOLEAN) { + g_key_file_set_boolean (file, setting_name, key, g_value_get_boolean (value)); + } else if (type == G_TYPE_CHAR) { + g_key_file_set_integer (file, setting_name, key, (int) g_value_get_char (value)); + } else if (type == DBUS_TYPE_G_UCHAR_ARRAY) { + GByteArray *array; + + array = (GByteArray *) g_value_get_boxed (value); + if (array && array->len > 0) { + int *tmp_array; + int i; + + tmp_array = g_new (gint, array->len); + for (i = 0; i < array->len; i++) + tmp_array[i] = (int) array->data[i]; + + g_key_file_set_integer_list (file, setting_name, key, tmp_array, array->len); + g_free (tmp_array); + } + } else if (type == DBUS_TYPE_G_LIST_OF_STRING) { + GSList *list; + GSList *iter; + + list = (GSList *) g_value_get_boxed (value); + if (list) { + char **array; + int i = 0; + + array = g_new (char *, g_slist_length (list)); + for (iter = list; iter; iter = iter->next) + array[i++] = iter->data; + + g_key_file_set_string_list (file, setting_name, key, (const gchar **const) array, i); + g_free (array); + } + } else if (type == DBUS_TYPE_G_MAP_OF_STRING) { + write_hash_of_string (file, setting, key, value); + } else if (type == DBUS_TYPE_G_UINT_ARRAY) { + if (!write_array_of_uint (file, setting, key, value)) { + g_warning ("Unhandled setting property type (write) '%s/%s' : '%s'", + setting_name, key, g_type_name (type)); + } + } else { + g_warning ("Unhandled setting property type (write) '%s/%s' : '%s'", + setting_name, key, g_type_name (type)); + } +} + +char * +writer_id_to_filename (const char *id) +{ + char *filename, *f; + const char *i = id; + + f = filename = g_malloc0 (strlen (id) + 1); + + /* Convert '/' to '*' */ + while (*i) { + if (*i == '/') + *f++ = '*'; + else + *f++ = *i; + i++; + } + + return filename; +} + +gboolean +write_connection (NMConnection *connection, + const char *keyfile_dir, + uid_t owner_uid, + pid_t owner_grp, + char **out_path, + GError **error) +{ + NMSettingConnection *s_con; + GKeyFile *key_file; + char *data; + gsize len; + gboolean success = FALSE; + char *filename, *path; + int err; + + if (out_path) + g_return_val_if_fail (*out_path == NULL, FALSE); + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + if (!s_con) + return success; + + key_file = g_key_file_new (); + nm_connection_for_each_setting_value (connection, write_setting_value, key_file); + data = g_key_file_to_data (key_file, &len, error); + if (!data) + goto out; + + filename = writer_id_to_filename (nm_setting_connection_get_id (s_con)); + path = g_build_filename (keyfile_dir, filename, NULL); + g_free (filename); + + g_file_set_contents (path, data, len, error); + if (chown (path, owner_uid, owner_grp) < 0) { + g_set_error (error, KEYFILE_PLUGIN_ERROR, 0, + "%s.%d: error chowning '%s': %d", __FILE__, __LINE__, + path, errno); + unlink (path); + } else { + err = chmod (path, S_IRUSR | S_IWUSR); + if (err) { + g_set_error (error, KEYFILE_PLUGIN_ERROR, 0, + "%s.%d: error setting permissions on '%s': %d", __FILE__, + __LINE__, path, errno); + unlink (path); + } else { + if (out_path) + *out_path = g_strdup (path); + success = TRUE; + } + } + g_free (path); + +out: + g_free (data); + g_key_file_free (key_file); + return success; +} diff --git a/system-settings/plugins/keyfile/writer.h b/system-settings/plugins/keyfile/writer.h new file mode 100644 index 0000000000..fa04deef98 --- /dev/null +++ b/system-settings/plugins/keyfile/writer.h @@ -0,0 +1,38 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service - keyfile plugin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 Novell, Inc. + * Copyright (C) 2008 Red Hat, Inc. + */ + +#ifndef _KEYFILE_PLUGIN_WRITER_H +#define _KEYFILE_PLUGIN_WRITER_H + +#include +#include +#include + +gboolean write_connection (NMConnection *connection, + const char *keyfile_dir, + uid_t owner_uid, + pid_t owner_grp, + char **out_path, + GError **error); + +char *writer_id_to_filename (const char *id); + +#endif /* _KEYFILE_PLUGIN_WRITER_H */ -- cgit v1.2.1 From da3d920d976a9a6dcd1b4202a5dbd1384c545045 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 16 Sep 2010 18:27:19 -0500 Subject: keyfile: read and write SSIDs as strings by default Keep compat with old format if the SSID includes unprintable characters. But having to type an int list for an SSID is just silly and it's about damn time we fix that. --- system-settings/plugins/keyfile/reader.c | 67 ++++++++++ .../plugins/keyfile/tests/keyfiles/Makefile.am | 3 +- .../keyfile/tests/keyfiles/Test_String_SSID | 11 ++ .../plugins/keyfile/tests/test-keyfile.c | 146 +++++++++++++++++++++ system-settings/plugins/keyfile/writer.c | 47 +++++++ 5 files changed, 273 insertions(+), 1 deletion(-) create mode 100644 system-settings/plugins/keyfile/tests/keyfiles/Test_String_SSID diff --git a/system-settings/plugins/keyfile/reader.c b/system-settings/plugins/keyfile/reader.c index 8a81df0df1..a5b4219c4a 100644 --- a/system-settings/plugins/keyfile/reader.c +++ b/system-settings/plugins/keyfile/reader.c @@ -40,6 +40,7 @@ #include #include #include +#include #include "nm-dbus-glib-types.h" #include "reader.h" @@ -731,6 +732,68 @@ read_hash_of_string (GKeyFile *file, NMSetting *setting, const char *key) g_strfreev (keys); } +static void +ssid_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) +{ + const char *setting_name = nm_setting_get_name (setting); + GByteArray *array = NULL; + char *p, *tmp_string; + gint *tmp_list; + gsize length; + int i; + + /* New format: just a string. We try parsing the new format if there are + * no ';' in the string or it's not just numbers. + */ + p = tmp_string = g_key_file_get_string (keyfile, setting_name, key, NULL); + if (tmp_string) { + gboolean new_format = FALSE; + + if (strchr (p, ';') == NULL) + new_format = TRUE; + else { + new_format = TRUE; + while (p && *p) { + if (!isdigit (*p++)) { + new_format = FALSE; + break; + } + } + } + + if (new_format) { + array = g_byte_array_sized_new (strlen (tmp_string)); + g_byte_array_append (array, (guint8 *) tmp_string, strlen (tmp_string)); + goto done; + } + } + g_free (tmp_string); + + /* Old format; list of ints */ + tmp_list = g_key_file_get_integer_list (keyfile, setting_name, key, &length, NULL); + array = g_byte_array_sized_new (length); + for (i = 0; i < length; i++) { + int val = tmp_list[i]; + unsigned char v = (unsigned char) (val & 0xFF); + + if (val < 0 || val > 255) { + g_warning ("%s: %s / %s ignoring invalid byte element '%d' (not " + " between 0 and 255 inclusive)", __func__, setting_name, + key, val); + } else + g_byte_array_append (array, (const unsigned char *) &v, sizeof (v)); + } + g_free (tmp_list); + +done: + if (array->len) + g_object_set (setting, key, array, NULL); + else { + g_warning ("%s: ignoring invalid SSID for %s / %s", + __func__, setting_name, key); + } + g_byte_array_free (array, TRUE); +} typedef struct { const char *setting_name; @@ -794,6 +857,10 @@ static KeyParser key_parsers[] = { NM_SETTING_BLUETOOTH_BDADDR, TRUE, mac_address_parser }, + { NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID, + TRUE, + ssid_parser }, { NULL, NULL, FALSE } }; diff --git a/system-settings/plugins/keyfile/tests/keyfiles/Makefile.am b/system-settings/plugins/keyfile/tests/keyfiles/Makefile.am index 52252f9a61..d6ee018340 100644 --- a/system-settings/plugins/keyfile/tests/keyfiles/Makefile.am +++ b/system-settings/plugins/keyfile/tests/keyfiles/Makefile.am @@ -5,7 +5,8 @@ EXTRA_DIST = \ Test_Wired_Connection_MAC_Case \ Test_Wired_Connection_IP6 \ ATT_Data_Connect_BT \ - ATT_Data_Connect_Plain + ATT_Data_Connect_Plain \ + Test_String_SSID check-local: @for f in $(EXTRA_DIST); do \ diff --git a/system-settings/plugins/keyfile/tests/keyfiles/Test_String_SSID b/system-settings/plugins/keyfile/tests/keyfiles/Test_String_SSID new file mode 100644 index 0000000000..4a3b56d24f --- /dev/null +++ b/system-settings/plugins/keyfile/tests/keyfiles/Test_String_SSID @@ -0,0 +1,11 @@ +[connection] +id=Test +uuid=2f962388-e5f3-45af-a62c-ac220b8f7baa +type=802-11-wireless + +[802-11-wireless] +ssid=blah blah ssid 1234 + +[ipv4] +method=auto + diff --git a/system-settings/plugins/keyfile/tests/test-keyfile.c b/system-settings/plugins/keyfile/tests/test-keyfile.c index 18daad1974..7bf63ef539 100644 --- a/system-settings/plugins/keyfile/tests/test-keyfile.c +++ b/system-settings/plugins/keyfile/tests/test-keyfile.c @@ -1296,6 +1296,149 @@ test_write_wireless_connection (void) g_object_unref (connection); } +#define TEST_STRING_SSID_FILE TEST_KEYFILES_DIR"/Test_String_SSID" + +static void +test_read_string_ssid (void) +{ + NMConnection *connection; + NMSettingWireless *s_wireless; + GError *error = NULL; + const GByteArray *array; + const char *expected_ssid = "blah blah ssid 1234"; + + connection = connection_from_file (TEST_STRING_SSID_FILE, NULL); + ASSERT (connection != NULL, + "connection-read", "failed to read %s", TEST_STRING_SSID_FILE); + + ASSERT (nm_connection_verify (connection, &error), + "connection-verify", "failed to verify %s: %s", TEST_STRING_SSID_FILE, error->message); + + /* ===== WIRELESS SETTING ===== */ + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + ASSERT (s_wireless != NULL, + "connection-verify-wireless", "failed to verify %s: missing %s setting", + TEST_STRING_SSID_FILE, + NM_SETTING_WIRELESS_SETTING_NAME); + + /* SSID */ + array = nm_setting_wireless_get_ssid (s_wireless); + ASSERT (array != NULL, + "connection-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_STRING_SSID_FILE, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID); + ASSERT (memcmp (array->data, expected_ssid, sizeof (expected_ssid)) == 0, + "connection-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_STRING_SSID_FILE, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID); + + g_object_unref (connection); +} + +static void +test_write_string_ssid (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWireless *s_wireless; + NMSettingIP4Config *s_ip4; + char *uuid, *testfile = NULL, *tmp; + GByteArray *ssid; + unsigned char tmpssid[] = { 65, 49, 50, 51, 32, 46, 92, 46, 36, 37, 126, 93 }; + gboolean success; + NMConnection *reread; + GError *error = NULL; + pid_t owner_grp; + uid_t owner_uid; + GKeyFile *keyfile; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "connection-write", "failed to allocate new connection"); + + /* Connection setting */ + + s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ()); + ASSERT (s_con != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "String SSID Test", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRELESS_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wireless setting */ + + s_wireless = NM_SETTING_WIRELESS (nm_setting_wireless_new ()); + ASSERT (s_wireless != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wireless)); + + ssid = g_byte_array_sized_new (sizeof (tmpssid)); + g_byte_array_append (ssid, &tmpssid[0], sizeof (tmpssid)); + g_object_set (s_wireless, NM_SETTING_WIRELESS_SSID, ssid, NULL); + g_byte_array_free (ssid, TRUE); + + /* IP4 setting */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ()); + ASSERT (s_ip4 != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_IP4_CONFIG_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ip4)); + + g_object_set (s_ip4, + NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, + NULL); + + /* Write out the connection */ + owner_uid = geteuid (); + owner_grp = getegid (); + success = write_connection (connection, TEST_SCRATCH_DIR, owner_uid, owner_grp, &testfile, &error); + ASSERT (success == TRUE, + "connection-write", "failed to allocate write keyfile: %s", + error ? error->message : "(none)"); + + ASSERT (testfile != NULL, + "connection-write", "didn't get keyfile name back after writing connection"); + + /* Ensure the SSID was written out as a string */ + keyfile = g_key_file_new (); + ASSERT (g_key_file_load_from_file (keyfile, testfile, 0, NULL) == TRUE, + "string-ssid-verify", "failed to load keyfile to verify"); + tmp = g_key_file_get_string (keyfile, NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_SSID, NULL); + ASSERT (tmp, "string-ssid-verify", "failed to load 'ssid' key from file"); + ASSERT (strlen (tmp) == sizeof (tmpssid), + "string-ssid-verify", "reread SSID and expected were different sizes"); + ASSERT (memcmp (tmp, tmpssid, sizeof (tmpssid)) == 0, + "string-ssid-verify", "reread SSID and expected were different"); + g_free (tmp); + g_key_file_free (keyfile); + + /* Read the connection back in and compare it to the one we just wrote out */ + reread = connection_from_file (testfile, NULL); + ASSERT (reread != NULL, "connection-write", "failed to re-read test connection"); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "connection-write", "written and re-read connection weren't the same"); + + g_clear_error (&error); + unlink (testfile); + g_free (testfile); + + g_object_unref (reread); + g_object_unref (connection); +} + #define TEST_BT_DUN_FILE TEST_KEYFILES_DIR"/ATT_Data_Connect_BT" static void @@ -1867,6 +2010,9 @@ int main (int argc, char **argv) test_read_valid_wireless_connection (); test_write_wireless_connection (); + test_read_string_ssid (); + test_write_string_ssid (); + test_read_bt_dun_connection (); test_write_bt_dun_connection (); diff --git a/system-settings/plugins/keyfile/writer.c b/system-settings/plugins/keyfile/writer.c index 13dfb17936..fdba70c969 100644 --- a/system-settings/plugins/keyfile/writer.c +++ b/system-settings/plugins/keyfile/writer.c @@ -36,6 +36,7 @@ #include #include #include +#include #include "nm-dbus-glib-types.h" #include "writer.h" @@ -453,6 +454,49 @@ write_hash_of_string (GKeyFile *file, g_hash_table_foreach (hash, write_hash_of_string_helper, &info); } +static void +ssid_writer (GKeyFile *file, + NMSetting *setting, + const char *key, + const GValue *value) +{ + GByteArray *array; + const char *setting_name = nm_setting_get_name (setting); + gboolean new_format = TRUE; + int i, *tmp_array; + char *ssid; + + g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_UCHAR_ARRAY)); + + array = (GByteArray *) g_value_get_boxed (value); + if (!array || !array->len) + return; + + /* Check whether each byte is printable. If not, we have to use an + * integer list, otherwise we can just use a string. + */ + for (i = 0; i < array->len; i++) { + char c = array->data[i] & 0xFF; + if (!isprint (c)) { + new_format = FALSE; + break; + } + } + + if (new_format) { + ssid = g_malloc0 (array->len + 1); + memcpy (ssid, array->data, array->len); + g_key_file_set_string (file, setting_name, key, ssid); + g_free (ssid); + } else { + tmp_array = g_new (gint, array->len); + for (i = 0; i < array->len; i++) + tmp_array[i] = (int) array->data[i]; + g_key_file_set_integer_list (file, setting_name, key, tmp_array, array->len); + g_free (tmp_array); + } +} + typedef struct { const char *setting_name; const char *key; @@ -502,6 +546,9 @@ static KeyWriter key_writers[] = { { NM_SETTING_BLUETOOTH_SETTING_NAME, NM_SETTING_BLUETOOTH_BDADDR, mac_address_writer }, + { NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID, + ssid_writer }, { NULL, NULL, NULL } }; -- cgit v1.2.1 From 979b69142c178d1878a5bd155efc7a3c4992070f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Fri, 17 Sep 2010 14:56:21 +0200 Subject: cli: add 'nmcli nm enable' command 'enable' command queries and sets NetworkingEnabled property. It should be used by users. Previous 'sleep' command that actually did enable/disable, really calls Sleep() now and is not meant for common usage. --- cli/src/network-manager.c | 121 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 103 insertions(+), 18 deletions(-) diff --git a/cli/src/network-manager.c b/cli/src/network-manager.c index b65dfcd7bd..23a2ef11e7 100644 --- a/cli/src/network-manager.c +++ b/cli/src/network-manager.c @@ -34,14 +34,16 @@ static NmcOutputField nmc_fields_nm_status[] = { {"RUNNING", N_("RUNNING"), 15, NULL, 0}, /* 0 */ {"STATE", N_("STATE"), 15, NULL, 0}, /* 1 */ - {"WIFI-HARDWARE", N_("WIFI-HARDWARE"), 15, NULL, 0}, /* 2 */ - {"WIFI", N_("WIFI"), 10, NULL, 0}, /* 3 */ - {"WWAN-HARDWARE", N_("WWAN-HARDWARE"), 15, NULL, 0}, /* 4 */ - {"WWAN", N_("WWAN"), 10, NULL, 0}, /* 5 */ + {"NET-ENABLED", N_("NET-ENABLED"), 13, NULL, 0}, /* 2 */ + {"WIFI-HARDWARE", N_("WIFI-HARDWARE"), 15, NULL, 0}, /* 3 */ + {"WIFI", N_("WIFI"), 10, NULL, 0}, /* 4 */ + {"WWAN-HARDWARE", N_("WWAN-HARDWARE"), 15, NULL, 0}, /* 5 */ + {"WWAN", N_("WWAN"), 10, NULL, 0}, /* 6 */ {NULL, NULL, 0, NULL, 0} }; -#define NMC_FIELDS_NM_STATUS_ALL "RUNNING,STATE,WIFI-HARDWARE,WIFI,WWAN-HARDWARE,WWAN" +#define NMC_FIELDS_NM_STATUS_ALL "RUNNING,STATE,NET-ENABLED,WIFI-HARDWARE,WIFI,WWAN-HARDWARE,WWAN" #define NMC_FIELDS_NM_STATUS_COMMON "RUNNING,STATE,WIFI-HARDWARE,WIFI,WWAN-HARDWARE,WWAN" +#define NMC_FIELDS_NM_NET_ENABLED "NET-ENABLED" #define NMC_FIELDS_NM_WIFI "WIFI" #define NMC_FIELDS_NM_WWAN "WWAN" @@ -60,10 +62,10 @@ usage (void) { fprintf (stderr, _("Usage: nmcli nm { COMMAND | help }\n\n" - " COMMAND := { status | sleep | wakeup | wifi | wwan }\n\n" + " COMMAND := { status | enable | sleep | wifi | wwan }\n\n" " status\n" - " sleep\n" - " wakeup\n" + " enable [true|false]\n" + " sleep [true|false]\n" " wifi [on|off]\n" " wwan [on|off]\n\n")); } @@ -97,6 +99,7 @@ static NMCResultCode show_nm_status (NmCli *nmc) { gboolean nm_running; + gboolean net_enabled; NMState state; const char *wireless_hw_enabled_str, *wireless_enabled_str; const char *wwan_hw_enabled_str, *wwan_enabled_str; @@ -136,6 +139,7 @@ show_nm_status (NmCli *nmc) nm_running = nm_client_get_manager_running (nmc->client); state = nm_client_get_state (nmc->client); + net_enabled = nm_client_networking_get_enabled (nmc->client); if (nm_running) { wireless_hw_enabled_str = nm_client_wireless_hardware_get_enabled (nmc->client) ? _("enabled") : _("disabled"); wireless_enabled_str = nm_client_wireless_get_enabled (nmc->client) ? _("enabled") : _("disabled"); @@ -147,10 +151,11 @@ show_nm_status (NmCli *nmc) nmc->allowed_fields[0].value = nm_running ? _("running") : _("not running"); nmc->allowed_fields[1].value = nm_state_to_string (state); - nmc->allowed_fields[2].value = wireless_hw_enabled_str; - nmc->allowed_fields[3].value = wireless_enabled_str; - nmc->allowed_fields[4].value = wwan_hw_enabled_str; - nmc->allowed_fields[5].value = wwan_enabled_str; + nmc->allowed_fields[2].value = net_enabled ? _("enabled") : _("disabled"); + nmc->allowed_fields[3].value = wireless_hw_enabled_str; + nmc->allowed_fields[4].value = wireless_enabled_str; + nmc->allowed_fields[5].value = wwan_hw_enabled_str; + nmc->allowed_fields[6].value = wwan_enabled_str; nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ @@ -158,12 +163,49 @@ show_nm_status (NmCli *nmc) return NMC_RESULT_SUCCESS; } +/* libnm-glib doesn't provide API fro Sleep method - implement D-Bus call ourselves */ +static void networking_set_sleep (NmCli *nmc, gboolean in_sleep) +{ + DBusGConnection *connection = NULL; + DBusGProxy *proxy = NULL; + GError *err = NULL; + + connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &err); + if (!connection) { + g_string_printf (nmc->return_text, _("Error: Couldn't connect to system bus: %s"), err->message); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + g_error_free (err); + goto gone; + } + + proxy = dbus_g_proxy_new_for_name (connection, + "org.freedesktop.NetworkManager", + "/org/freedesktop/NetworkManager", + "org.freedesktop.NetworkManager"); + if (!proxy) { + g_string_printf (nmc->return_text, _("Error: Couldn't create D-Bus object proxy.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto gone; + } + + if (!dbus_g_proxy_call (proxy, "Sleep", &err, G_TYPE_BOOLEAN, in_sleep, G_TYPE_INVALID, G_TYPE_INVALID)) { + g_string_printf (nmc->return_text, _("Error in sleep: %s"), err->message); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + g_error_free (err); + } + +gone: + if (connection) dbus_g_connection_unref (connection); + if (proxy) g_object_unref (proxy); +} /* entry point function for global network manager related commands 'nmcli nm' */ NMCResultCode do_network_manager (NmCli *nmc, int argc, char **argv) { GError *error = NULL; + gboolean sleep_flag; + gboolean enable_net; gboolean enable_wifi; gboolean enable_wwan; guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; @@ -186,11 +228,54 @@ do_network_manager (NmCli *nmc, int argc, char **argv) goto opt_error; nmc->return_value = show_nm_status (nmc); } - else if (matches (*argv, "sleep") == 0) { - nm_client_sleep (nmc->client, TRUE); + else if (matches (*argv, "enable") == 0) { + if (next_arg (&argc, &argv) != 0) { + /* no argument, show current state of networking */ + if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) + goto opt_error; + if (nmc->required_fields && strcasecmp (nmc->required_fields, "NET-ENABLED")) { + g_string_printf (nmc->return_text, _("Error: '--fields' value '%s' is not valid here; allowed fields: %s"), + nmc->required_fields, NMC_FIELDS_NM_NET_ENABLED); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto end; + } + nmc->allowed_fields = nmc_fields_nm_status; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_NM_NET_ENABLED, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.header_name = _("Networking enabled"); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + nmc->allowed_fields[2].value = nm_client_networking_get_enabled (nmc->client) ? _("enabled") : _("disabled"); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + } else { + if (!strcmp (*argv, "true")) + enable_net = TRUE; + else if (!strcmp (*argv, "false")) + enable_net = FALSE; + else { + g_string_printf (nmc->return_text, _("Error: invalid 'enable' parameter: '%s'; use 'true' or 'false'."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto end; + } + nm_client_networking_set_enabled (nmc->client, enable_net); + } } - else if (matches (*argv, "wakeup") == 0) { - nm_client_sleep (nmc->client, FALSE); + else if (matches (*argv, "sleep") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: Sleeping status is not exported by NetworkManager.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + } else { + if (!strcmp (*argv, "true")) + sleep_flag = TRUE; + else if (!strcmp (*argv, "false")) + sleep_flag = FALSE; + else { + g_string_printf (nmc->return_text, _("Error: invalid 'sleep' parameter: '%s'; use 'true' or 'false'."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto end; + } + networking_set_sleep (nmc, sleep_flag); + } } else if (matches (*argv, "wifi") == 0) { if (next_arg (&argc, &argv) != 0) { @@ -208,7 +293,7 @@ do_network_manager (NmCli *nmc, int argc, char **argv) nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("WiFi enabled"); print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ - nmc->allowed_fields[3].value = nm_client_wireless_get_enabled (nmc->client) ? _("enabled") : _("disabled"); + nmc->allowed_fields[4].value = nm_client_wireless_get_enabled (nmc->client) ? _("enabled") : _("disabled"); nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ } else { @@ -240,7 +325,7 @@ do_network_manager (NmCli *nmc, int argc, char **argv) nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("WWAN enabled"); print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ - nmc->allowed_fields[5].value = nm_client_wwan_get_enabled (nmc->client) ? _("enabled") : _("disabled"); + nmc->allowed_fields[6].value = nm_client_wwan_get_enabled (nmc->client) ? _("enabled") : _("disabled"); nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ } else { -- cgit v1.2.1 From 58a432a6e1a32f829e38397e6d7bcbe478da6a24 Mon Sep 17 00:00:00 2001 From: A S Alam Date: Fri, 17 Sep 2010 10:45:32 -0500 Subject: po: update Punjabi translation (bgo #629063) --- po/pa.po | 414 ++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 212 insertions(+), 202 deletions(-) diff --git a/po/pa.po b/po/pa.po index 4894383b15..3f9624c3fb 100644 --- a/po/pa.po +++ b/po/pa.po @@ -11,8 +11,8 @@ msgstr "" "Project-Id-Version: NetworkManager.HEAD\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug." "cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-06-28 08:52+0000\n" -"PO-Revision-Date: 2010-08-01 17:05+0530\n" +"POT-Creation-Date: 2010-09-08 03:25+0000\n" +"PO-Revision-Date: 2010-09-08 18:45+0530\n" "Last-Translator: A S Alam \n" "Language-Team: Punjabi/Panjabi \n" "MIME-Version: 1.0\n" @@ -22,76 +22,76 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "\n" -#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 -#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 -#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 -#: ../cli/src/devices.c:152 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/devices.c:88 ../cli/src/devices.c:101 ../cli/src/devices.c:111 +#: ../cli/src/devices.c:121 ../cli/src/devices.c:134 ../cli/src/devices.c:145 +#: ../cli/src/devices.c:156 ../cli/src/devices.c:165 ../cli/src/devices.c:174 msgid "NAME" msgstr "NAME" #. 0 -#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/connections.c:61 ../cli/src/connections.c:76 msgid "UUID" msgstr "UUID" #. 1 -#: ../cli/src/connections.c:61 +#: ../cli/src/connections.c:62 msgid "DEVICES" msgstr "DEVICES" #. 2 -#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +#: ../cli/src/connections.c:63 ../cli/src/connections.c:78 msgid "SCOPE" msgstr "SCOPE" #. 3 -#: ../cli/src/connections.c:63 +#: ../cli/src/connections.c:64 msgid "DEFAULT" msgstr "DEFAULT" #. 4 -#: ../cli/src/connections.c:64 +#: ../cli/src/connections.c:65 msgid "DBUS-SERVICE" msgstr "DBUS-SERVICE" #. 5 -#: ../cli/src/connections.c:65 +#: ../cli/src/connections.c:66 msgid "SPEC-OBJECT" msgstr "SPEC-OBJECT" #. 6 -#: ../cli/src/connections.c:66 +#: ../cli/src/connections.c:67 msgid "VPN" msgstr "VPN" #. 1 #. 0 #. 1 -#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +#: ../cli/src/connections.c:77 ../cli/src/devices.c:62 ../cli/src/devices.c:90 msgid "TYPE" msgstr "TYPE" #. 3 -#: ../cli/src/connections.c:78 +#: ../cli/src/connections.c:79 msgid "TIMESTAMP" msgstr "TIMESTAMP" #. 4 -#: ../cli/src/connections.c:79 +#: ../cli/src/connections.c:80 msgid "TIMESTAMP-REAL" msgstr "TIMESTAMP-REAL" #. 5 -#: ../cli/src/connections.c:80 +#: ../cli/src/connections.c:81 msgid "AUTOCONNECT" msgstr "AUTOCONNECT" #. 6 -#: ../cli/src/connections.c:81 +#: ../cli/src/connections.c:82 msgid "READONLY" msgstr "READONLY" -#: ../cli/src/connections.c:157 +#: ../cli/src/connections.c:158 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -112,40 +112,40 @@ msgstr "" "]\n" " down id | uuid \n" -#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#: ../cli/src/connections.c:198 ../cli/src/connections.c:537 #, c-format msgid "Error: 'con list': %s" msgstr "Error: 'con list': %s" -#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#: ../cli/src/connections.c:200 ../cli/src/connections.c:539 #, c-format msgid "Error: 'con list': %s; allowed fields: %s" msgstr "Error: 'con list': %s; allowed fields: %s" -#: ../cli/src/connections.c:207 +#: ../cli/src/connections.c:208 msgid "Connection details" msgstr "ਕੁਨੈਕਸ਼ਨ ਵੇਰਵਾ" -#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 msgid "system" msgstr "ਸਿਸਟਮ" -#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 msgid "user" msgstr "ਯੂਜ਼ਰ" -#: ../cli/src/connections.c:383 +#: ../cli/src/connections.c:384 msgid "never" msgstr "ਕਦੇ ਨਹੀਂ" #. "CAPABILITIES" #. Print header #. "WIFI-PROPERTIES" -#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 -#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 -#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 -#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 #: ../cli/src/settings.c:551 ../cli/src/settings.c:652 #: ../cli/src/settings.c:926 ../cli/src/settings.c:927 #: ../cli/src/settings.c:929 ../cli/src/settings.c:931 @@ -161,11 +161,11 @@ msgstr "ਕਦੇ ਨਹੀਂ" msgid "yes" msgstr "ਹਾਂ" -#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 -#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 -#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 -#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 #: ../cli/src/settings.c:510 ../cli/src/settings.c:551 #: ../cli/src/settings.c:652 ../cli/src/settings.c:926 #: ../cli/src/settings.c:927 ../cli/src/settings.c:929 @@ -181,445 +181,457 @@ msgstr "ਹਾਂ" msgid "no" msgstr "ਨਹੀਂ" -#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +#: ../cli/src/connections.c:458 ../cli/src/connections.c:501 msgid "System connections" msgstr "ਸਿਸਟਮ ਕੁਨੈਕਸ਼ਨ" -#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +#: ../cli/src/connections.c:463 ../cli/src/connections.c:514 msgid "User connections" msgstr "ਯੂਜ਼ਰ ਕੁਨੈਕਸ਼ਨ" -#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 -#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 -#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 -#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 -#: ../cli/src/devices.c:980 +#: ../cli/src/connections.c:475 ../cli/src/connections.c:1335 +#: ../cli/src/connections.c:1351 ../cli/src/connections.c:1360 +#: ../cli/src/connections.c:1371 ../cli/src/connections.c:1456 +#: ../cli/src/devices.c:962 ../cli/src/devices.c:972 ../cli/src/devices.c:1074 +#: ../cli/src/devices.c:1081 #, c-format msgid "Error: %s argument is missing." msgstr "ਗਲਤੀ: %s ਆਰਗੂਮੈਂਟ ਮੌਜੂਦ ਨਹੀਂ ਹੈ।" -#: ../cli/src/connections.c:487 +#: ../cli/src/connections.c:488 #, c-format msgid "Error: %s - no such connection." msgstr "ਗਲਤੀ: %s - ਇੰਝ ਦਾ ਕੋਈ ਕੁਨੈਕਸ਼ਨ ਨਹੀਂ ਹੈ" -#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 -#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 -#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#: ../cli/src/connections.c:520 ../cli/src/connections.c:1384 +#: ../cli/src/connections.c:1474 ../cli/src/devices.c:785 +#: ../cli/src/devices.c:852 ../cli/src/devices.c:986 ../cli/src/devices.c:1087 #, c-format msgid "Unknown parameter: %s\n" msgstr "ਅਣਜਾਣ ਪੈਰਾਮੀਟਰ: %s\n" -#: ../cli/src/connections.c:528 +#: ../cli/src/connections.c:529 #, c-format msgid "Error: no valid parameter specified." msgstr "ਗਲਤੀ: ਕੋਈ ਢੁੱਕਵਾਂ ਪੈਰਾਮੀਟਰ ਨਹੀਂ ਦਿੱਤਾ।" -#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 -#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#: ../cli/src/connections.c:544 ../cli/src/connections.c:1577 +#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:274 #, c-format msgid "Error: %s." msgstr "ਗਲਤੀ: %s" -#: ../cli/src/connections.c:649 +#: ../cli/src/connections.c:650 #, c-format msgid "Error: 'con status': %s" msgstr "ਗਲਤੀ: 'con status': %s" -#: ../cli/src/connections.c:651 +#: ../cli/src/connections.c:652 #, c-format msgid "Error: 'con status': %s; allowed fields: %s" msgstr "ਗਲਤੀ: 'con status': %s; allowed fields: %s" -#: ../cli/src/connections.c:658 +#: ../cli/src/connections.c:659 msgid "Active connections" msgstr "ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ" -#: ../cli/src/connections.c:1026 +#: ../cli/src/connections.c:1027 #, c-format msgid "no active connection on device '%s'" msgstr "ਜੰਤਰ '%s' ਉੱਤੇ ਕੋਈ ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ ਨਹੀਂ ਹੈ" -#: ../cli/src/connections.c:1034 +#: ../cli/src/connections.c:1035 #, c-format msgid "no active connection or device" msgstr "ਕੋਈ ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ ਜਾਂ ਜੰਤਰ ਨਹੀਂ ਹੈ" -#: ../cli/src/connections.c:1084 +#: ../cli/src/connections.c:1085 #, c-format msgid "device '%s' not compatible with connection '%s'" msgstr "ਜੰਤਰ '%s' ਕੁਨੈਕਸ਼ਨ '%s' ਨਾਲ ਅਨੁਕੂਲ ਨਹੀਂ ਹੈ" -#: ../cli/src/connections.c:1086 +#: ../cli/src/connections.c:1087 #, c-format msgid "no device found for connection '%s'" msgstr "ਕੁਨੈਕਸ਼ਨ '%s' ਲਈ ਕੋਈ ਜੰਤਰ ਨਹੀਂ ਲੱਭਿਆ" -#: ../cli/src/connections.c:1097 +#: ../cli/src/connections.c:1098 msgid "activating" msgstr "ਚਾਲੂ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ" -#: ../cli/src/connections.c:1099 +#: ../cli/src/connections.c:1100 msgid "activated" msgstr "ਚਾਲੂ ਕੀਤਾ" -#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 -#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 -#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/connections.c:1103 ../cli/src/connections.c:1126 +#: ../cli/src/connections.c:1159 ../cli/src/devices.c:246 +#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:92 #: ../cli/src/network-manager.c:145 ../cli/src/settings.c:473 msgid "unknown" msgstr "ਅਣਜਾਣ" -#: ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:1112 msgid "VPN connecting (prepare)" msgstr "VPN ਕੁਨੈਕਸ਼ਨ (ਤਿਆਰੀ)" -#: ../cli/src/connections.c:1113 +#: ../cli/src/connections.c:1114 msgid "VPN connecting (need authentication)" msgstr "VPN ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (ਪਰਮਾਣਕਿਤਾ ਦੀ ਲੋੜ ਹੈ)" -#: ../cli/src/connections.c:1115 +#: ../cli/src/connections.c:1116 msgid "VPN connecting" msgstr "VPN ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ" -#: ../cli/src/connections.c:1117 +#: ../cli/src/connections.c:1118 msgid "VPN connecting (getting IP configuration)" msgstr "VPN ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (IP ਸੰਰਚਨਾ ਲਈ ਜਾ ਰਹੀ ਹੈ)" -#: ../cli/src/connections.c:1119 +#: ../cli/src/connections.c:1120 msgid "VPN connected" msgstr "VPN ਕੁਨੈਕਟ ਹੈ" -#: ../cli/src/connections.c:1121 +#: ../cli/src/connections.c:1122 msgid "VPN connection failed" msgstr "VPN ਕੁਨੈਕਸ਼ਨ ਫੇਲ੍ਹ ਹੋਇਆ" -#: ../cli/src/connections.c:1123 +#: ../cli/src/connections.c:1124 msgid "VPN disconnected" msgstr "VPN ਡਿਸ-ਕੁਨੈਕਟ" -#: ../cli/src/connections.c:1134 +#: ../cli/src/connections.c:1135 msgid "unknown reason" msgstr "ਅਣਜਾਣ ਕਾਰਨ" -#: ../cli/src/connections.c:1136 +#: ../cli/src/connections.c:1137 msgid "none" msgstr "ਕੋਈ ਨਹੀਂ" -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1139 msgid "the user was disconnected" msgstr "ਯੂਜ਼ਰ ਡਿਸ-ਕੁਨੈਕਟ ਹੋ ਗਿਆ" -#: ../cli/src/connections.c:1140 +#: ../cli/src/connections.c:1141 msgid "the base network connection was interrupted" msgstr "ਬੇਸ ਨੈੱਟਵਰਕ ਕੁਨੈਕਸ਼ਨ 'ਚ ਰੁਕਾਵਟ" -#: ../cli/src/connections.c:1142 +#: ../cli/src/connections.c:1143 msgid "the VPN service stopped unexpectedly" msgstr "VPN ਸਰਵਿਸ ਅਚਾਨਕ ਰੁਕ ਗਈ" -#: ../cli/src/connections.c:1144 +#: ../cli/src/connections.c:1145 msgid "the VPN service returned invalid configuration" msgstr "VPN ਸਰਵਿਸ ਨੇ ਅਢੁੱਕਵੀਂ ਸੰਰਚਨਾ ਵਾਪਸ ਕੀਤੀ" -#: ../cli/src/connections.c:1146 +#: ../cli/src/connections.c:1147 msgid "the connection attempt timed out" msgstr "ਕੁਨੈਕਸ਼ਨ ਕੋਸ਼ਿਸ਼ ਦੌਰਾਨ ਸਮਾਂ ਸਮਾਪਤ ਹੋ ਗਿਆ" -#: ../cli/src/connections.c:1148 +#: ../cli/src/connections.c:1149 msgid "the VPN service did not start in time" msgstr "VPN ਸਰਵਿਸ ਸਮੇਂ 'ਚ ਸ਼ੁਰੂ ਨਹੀਂ ਹੋਈ" -#: ../cli/src/connections.c:1150 +#: ../cli/src/connections.c:1151 msgid "the VPN service failed to start" msgstr "VPN ਸਰਵਿਸ ਸ਼ੁਰੂ ਹੋਣ ਲਈ ਫੇਲ੍ਹ ਹੋਈ" -#: ../cli/src/connections.c:1152 +#: ../cli/src/connections.c:1153 msgid "no valid VPN secrets" msgstr "ਕੋਈ ਢੁੱਕਵਾਂ VPN ਭੇਦ ਨਹੀਂ" -#: ../cli/src/connections.c:1154 +#: ../cli/src/connections.c:1155 msgid "invalid VPN secrets" msgstr "ਅਢੁੱਕਵਾਂ VPN ਭੇਦ" -#: ../cli/src/connections.c:1156 +#: ../cli/src/connections.c:1157 msgid "the connection was removed" msgstr "ਕੁਨੈਕਸ਼ਨ ਹਟਾਇਆ ਗਿਆ" -#: ../cli/src/connections.c:1170 +#: ../cli/src/connections.c:1171 #, c-format msgid "state: %s\n" msgstr "ਹਾਲਤ: %s\n" -#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#: ../cli/src/connections.c:1174 ../cli/src/connections.c:1200 #, c-format msgid "Connection activated\n" msgstr "ਕੁਨੈਕਸ਼ਨ ਚਾਲੂ ਕੀਤਾ\n" -#: ../cli/src/connections.c:1176 +#: ../cli/src/connections.c:1177 #, c-format msgid "Error: Connection activation failed." msgstr "ਗਲਤੀ: ਕੁਨੈਕਸ਼ਨ ਚਾਲੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ।" -#: ../cli/src/connections.c:1195 +#: ../cli/src/connections.c:1196 #, c-format msgid "state: %s (%d)\n" msgstr "ਹਾਲਤ: %s (%d)\n" -#: ../cli/src/connections.c:1205 +#: ../cli/src/connections.c:1206 #, c-format msgid "Error: Connection activation failed: %s." msgstr "ਗਲਤੀ: ਕੁਨੈਕਸ਼ਨ ਚਾਲੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %s।" -#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#: ../cli/src/connections.c:1223 ../cli/src/devices.c:909 #, c-format msgid "Error: Timeout %d sec expired." msgstr "ਗਲਤੀ: ਸਮਾਂ-ਸਮਾਪਤੀ %d ਸਕਿੰਟ ਖਤਮ ਹੋਏ।" -#: ../cli/src/connections.c:1265 +#: ../cli/src/connections.c:1266 #, c-format msgid "Error: Connection activation failed: %s" msgstr "ਗਲਤੀ: ਕੁਨੈਕਸ਼ਨ ਚਾਲੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %s" -#: ../cli/src/connections.c:1279 +#: ../cli/src/connections.c:1280 #, c-format msgid "Error: Obtaining active connection for '%s' failed." msgstr "ਗਲਤੀ: '%s' ਲਈ ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ ਲੈਣ ਲਈ ਫੇਲ੍ਹ ਹੈ।" -#: ../cli/src/connections.c:1288 +#: ../cli/src/connections.c:1289 #, c-format msgid "Active connection state: %s\n" msgstr "ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ ਹਾਲਤ: %s\n" -#: ../cli/src/connections.c:1289 +#: ../cli/src/connections.c:1290 #, c-format msgid "Active connection path: %s\n" msgstr "ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ ਪਾਥ: %s\n" -#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#: ../cli/src/connections.c:1344 ../cli/src/connections.c:1465 #, c-format msgid "Error: Unknown connection: %s." msgstr "ਗਲਤੀ: ਅਣਜਾਣ ਕੁਨੈਕਸ਼ਨ: %s।" -#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#: ../cli/src/connections.c:1379 ../cli/src/devices.c:980 #, c-format msgid "Error: timeout value '%s' is not valid." msgstr "ਗਲਤੀ: ਸਮਾਂ-ਸਮਾਪਤੀ ਮੁੱਲ '%s' ਢੁੱਕਵਾਂ ਨਹੀਂ ਹੈ।" -#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#: ../cli/src/connections.c:1392 ../cli/src/connections.c:1482 #, c-format msgid "Error: id or uuid has to be specified." msgstr "ਗਲਤੀ: id ਜਾਂ uuid ਨਹੀਂ ਦਿੱਤਾ।" -#: ../cli/src/connections.c:1411 +#: ../cli/src/connections.c:1412 #, c-format msgid "Error: No suitable device found: %s." msgstr "ਗਲਤੀ: ਕੋਈ ਢੁੱਕਵਾਂ ਜੰਤਰ ਨਹੀਂ ਲੱਭਿਆ: %s।" -#: ../cli/src/connections.c:1413 +#: ../cli/src/connections.c:1414 #, c-format msgid "Error: No suitable device found." msgstr "ਗਲਤੀ: ਕੋਈ ਢੁੱਕਵਾਂ ਜੰਤਰ ਨਹੀਂ ਮਿਲਿਆ।" -#: ../cli/src/connections.c:1505 +#: ../cli/src/connections.c:1509 #, c-format msgid "Warning: Connection not active\n" msgstr "ਚੇਤਾਵਨੀ: ਕੁਨੈਕਸ਼ਨ ਚਾਲੂ ਨਹੀਂ ਹੈ\n" -#: ../cli/src/connections.c:1561 +#: ../cli/src/connections.c:1566 #, c-format msgid "Error: 'con' command '%s' is not valid." msgstr "ਗਲਤੀ: 'con' ਕਮਾਂਡ '%s' ਢੁੱਕਵਾਂ ਨਹੀਂ।" -#: ../cli/src/connections.c:1597 +#: ../cli/src/connections.c:1602 #, c-format msgid "Error: could not connect to D-Bus." msgstr "ਗਲਤੀ: ਡੀ-ਬੱਸ ਨਾਲ ਕੁਨੈਕਟ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ।" -#: ../cli/src/connections.c:1604 +#: ../cli/src/connections.c:1609 #, c-format msgid "Error: Could not get system settings." msgstr "ਗਲਤੀ: ਸਿਸਟਮ ਸੈਟਿੰਗ ਨਹੀਂ ਲਈ ਜਾ ਸਕੀ।" -#: ../cli/src/connections.c:1612 +#: ../cli/src/connections.c:1617 #, c-format msgid "Error: Could not get user settings." msgstr "ਗਲਤੀ: ਯੂਜ਼ਰ ਸੈਟਿੰਗ ਨਹੀਂ ਲਈ ਜਾ ਸਕੀ।" -#: ../cli/src/connections.c:1622 +#: ../cli/src/connections.c:1627 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "ਗਲਤੀ: ਕੁਨੈਕਸ਼ਨ ਨਹੀਂ ਲਿਆ ਜਾ ਸਕਦਾ: ਸਿਸਟਮ ਸਰਵਿਸ ਨਹੀਂ ਚੱਲ ਰਹੀ ਹੈ।" #. 0 #. 9 -#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +#: ../cli/src/devices.c:61 ../cli/src/devices.c:89 ../cli/src/devices.c:184 msgid "DEVICE" msgstr "ਜੰਤਰ" #. 1 #. 4 #. 0 -#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/devices.c:63 ../cli/src/devices.c:93 #: ../cli/src/network-manager.c:36 msgid "STATE" msgstr "ਹਾਲਤ" -#: ../cli/src/devices.c:71 +#: ../cli/src/devices.c:72 msgid "GENERAL" msgstr "ਆਮ" #. 0 -#: ../cli/src/devices.c:72 +#: ../cli/src/devices.c:73 msgid "CAPABILITIES" msgstr "ਸਮਰੱਥਾ" #. 1 -#: ../cli/src/devices.c:73 +#: ../cli/src/devices.c:74 msgid "WIFI-PROPERTIES" msgstr "ਵਾਈਫਾਈ-ਵਿਸ਼ੇਸ਼ਤਾ" #. 2 -#: ../cli/src/devices.c:74 +#: ../cli/src/devices.c:75 msgid "AP" msgstr "AP" #. 3 -#: ../cli/src/devices.c:75 +#: ../cli/src/devices.c:76 msgid "WIRED-PROPERTIES" msgstr "ਤਾਰ-ਵਿਸ਼ੇਸ਼ਤਾ" #. 4 -#: ../cli/src/devices.c:76 +#: ../cli/src/devices.c:77 msgid "IP4-SETTINGS" msgstr "IP4-ਸੈਟਿੰਗ" #. 5 -#: ../cli/src/devices.c:77 +#: ../cli/src/devices.c:78 msgid "IP4-DNS" msgstr "IP4-DNS" +#. 6 +#: ../cli/src/devices.c:79 +#| msgid "IP4-SETTINGS" +msgid "IP6-SETTINGS" +msgstr "IP6-ਸੈਟਿੰਗ" + +#. 7 +#: ../cli/src/devices.c:80 +#| msgid "IP4-DNS" +msgid "IP6-DNS" +msgstr "IP6-DNS" + #. 2 -#: ../cli/src/devices.c:88 +#: ../cli/src/devices.c:91 msgid "DRIVER" msgstr "ਡਰਾਇਵਰ" #. 3 -#: ../cli/src/devices.c:89 +#: ../cli/src/devices.c:92 msgid "HWADDR" msgstr "HWADDR" #. 0 -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:102 msgid "CARRIER-DETECT" msgstr "ਕੈਰੀਅਰ-ਖੋਜ" #. 1 -#: ../cli/src/devices.c:100 +#: ../cli/src/devices.c:103 msgid "SPEED" msgstr "ਸਪੀਡ" #. 0 -#: ../cli/src/devices.c:109 +#: ../cli/src/devices.c:112 msgid "CARRIER" msgstr "ਕੈਰੀਅਰ" #. 0 -#: ../cli/src/devices.c:119 +#: ../cli/src/devices.c:122 msgid "WEP" msgstr "WEP" #. 1 -#: ../cli/src/devices.c:120 +#: ../cli/src/devices.c:123 msgid "WPA" msgstr "WPA" #. 2 -#: ../cli/src/devices.c:121 +#: ../cli/src/devices.c:124 msgid "WPA2" msgstr "WPA2" #. 3 -#: ../cli/src/devices.c:122 +#: ../cli/src/devices.c:125 msgid "TKIP" msgstr "TKIP" #. 4 -#: ../cli/src/devices.c:123 +#: ../cli/src/devices.c:126 msgid "CCMP" msgstr "CCMP" #. 0 -#: ../cli/src/devices.c:132 +#: ../cli/src/devices.c:135 ../cli/src/devices.c:146 msgid "ADDRESS" msgstr "ਐਡਰੈੱਸ" #. 1 -#: ../cli/src/devices.c:133 +#: ../cli/src/devices.c:136 ../cli/src/devices.c:147 msgid "PREFIX" msgstr "ਪ੍ਰੀ-ਫਿਕਸ" #. 2 -#: ../cli/src/devices.c:134 +#: ../cli/src/devices.c:137 ../cli/src/devices.c:148 msgid "GATEWAY" msgstr "ਗੇਟਵੇ" #. 0 -#: ../cli/src/devices.c:143 +#: ../cli/src/devices.c:157 ../cli/src/devices.c:166 msgid "DNS" msgstr "DNS" #. 0 -#: ../cli/src/devices.c:153 +#: ../cli/src/devices.c:175 msgid "SSID" msgstr "SSID" #. 1 -#: ../cli/src/devices.c:154 +#: ../cli/src/devices.c:176 msgid "BSSID" msgstr "BSSID" #. 2 -#: ../cli/src/devices.c:155 +#: ../cli/src/devices.c:177 msgid "MODE" msgstr "ਮੋਡ" #. 3 -#: ../cli/src/devices.c:156 +#: ../cli/src/devices.c:178 msgid "FREQ" msgstr "ਫਰੀਕਿਊਂਸੀ" #. 4 -#: ../cli/src/devices.c:157 +#: ../cli/src/devices.c:179 msgid "RATE" msgstr "ਰੇਟ" #. 5 -#: ../cli/src/devices.c:158 +#: ../cli/src/devices.c:180 msgid "SIGNAL" msgstr "ਸਿਗਨਲ" #. 6 -#: ../cli/src/devices.c:159 +#: ../cli/src/devices.c:181 msgid "SECURITY" msgstr "ਸੁਰੱਖਿਆ" #. 7 -#: ../cli/src/devices.c:160 +#: ../cli/src/devices.c:182 msgid "WPA-FLAGS" msgstr "WPA-FLAGS" #. 8 -#: ../cli/src/devices.c:161 +#: ../cli/src/devices.c:183 msgid "RSN-FLAGS" msgstr "RSN-FLAGS" #. 10 -#: ../cli/src/devices.c:163 +#: ../cli/src/devices.c:185 msgid "ACTIVE" msgstr "ਚਾਲੂ" -#: ../cli/src/devices.c:186 +#: ../cli/src/devices.c:208 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -642,204 +654,205 @@ msgstr "" " wifi [list [iface ] [hwaddr ]]\n" "\n" -#: ../cli/src/devices.c:206 +#: ../cli/src/devices.c:228 msgid "unmanaged" msgstr "ਬਿਨ-ਪਰਬੰਧ" -#: ../cli/src/devices.c:208 +#: ../cli/src/devices.c:230 msgid "unavailable" msgstr "ਨਾ-ਉਪਲੱਬਧ" -#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:89 msgid "disconnected" msgstr "ਡਿਸ-ਕੁਨੈਕਟ ਕੀਤਾ" -#: ../cli/src/devices.c:212 +#: ../cli/src/devices.c:234 msgid "connecting (prepare)" msgstr "ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (ਤਿਆਰੀ)" -#: ../cli/src/devices.c:214 +#: ../cli/src/devices.c:236 msgid "connecting (configuring)" msgstr "ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (ਸੰਰਚਨਾ ਜਾਰੀ)" -#: ../cli/src/devices.c:216 +#: ../cli/src/devices.c:238 msgid "connecting (need authentication)" msgstr "ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (ਪਰਮਾਣਕਿਤਾ ਦੀ ਲੋੜ)" -#: ../cli/src/devices.c:218 +#: ../cli/src/devices.c:240 msgid "connecting (getting IP configuration)" msgstr "ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (IP ਸੰਰਚਨਾ ਲਈ ਜਾ ਰਹੀ ਹੈ)" -#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:87 msgid "connected" msgstr "ਕੁਨੈਕਟ ਹੋਇਆ" -#: ../cli/src/devices.c:222 +#: ../cli/src/devices.c:244 msgid "connection failed" msgstr "ਕੁਨੈਕਸ਼ਨ ਫੇਲ੍ਹ ਹੈ" -#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +#: ../cli/src/devices.c:267 ../cli/src/devices.c:424 msgid "Unknown" msgstr "ਅਣਜਾਣ" -#: ../cli/src/devices.c:277 +#: ../cli/src/devices.c:299 msgid "(none)" msgstr "(ਕੋਈ ਨਹੀਂ)" -#: ../cli/src/devices.c:302 +#: ../cli/src/devices.c:324 #, c-format msgid "%s: error converting IP4 address 0x%X" msgstr "%s: IP4 ਐਡਰੈੱਸ 0x%X ਬਦਲਣ ਦੌਰਾਨ ਗਲਤੀ" -#: ../cli/src/devices.c:349 +#: ../cli/src/devices.c:393 #, c-format msgid "%u MHz" msgstr "%u MHz" -#: ../cli/src/devices.c:350 +#: ../cli/src/devices.c:394 #, c-format msgid "%u MB/s" msgstr "%u MB/s" -#: ../cli/src/devices.c:359 +#: ../cli/src/devices.c:403 msgid "Encrypted: " msgstr "ਇੰਕ੍ਰਿਪਟ ਕੀਤਾ: " -#: ../cli/src/devices.c:364 +#: ../cli/src/devices.c:408 msgid "WEP " msgstr "WEP " -#: ../cli/src/devices.c:366 +#: ../cli/src/devices.c:410 msgid "WPA " msgstr "WPA " -#: ../cli/src/devices.c:368 +#: ../cli/src/devices.c:412 msgid "WPA2 " msgstr "WPA2 " -#: ../cli/src/devices.c:371 +#: ../cli/src/devices.c:415 msgid "Enterprise " msgstr "ਇੰਟਰਪ੍ਰਾਈਜ਼ " -#: ../cli/src/devices.c:380 +#: ../cli/src/devices.c:424 msgid "Ad-Hoc" msgstr "ਐਡ-ਹਾਕ" -#: ../cli/src/devices.c:380 +#: ../cli/src/devices.c:424 msgid "Infrastructure" msgstr "ਇੰਫਰਾਸਟੱਕਚਰ" -#: ../cli/src/devices.c:442 +#: ../cli/src/devices.c:486 #, c-format msgid "Error: 'dev list': %s" msgstr "ਗਲਤੀ: 'dev list': %s" -#: ../cli/src/devices.c:444 +#: ../cli/src/devices.c:488 #, c-format msgid "Error: 'dev list': %s; allowed fields: %s" msgstr "ਗਲਤੀ: 'dev list': %s; ਮਨਜ਼ੂਰ ਖੇਤਰ: %s" -#: ../cli/src/devices.c:453 +#: ../cli/src/devices.c:497 msgid "Device details" msgstr "ਜੰਤਰ ਵੇਰਵਾ" -#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +#: ../cli/src/devices.c:527 ../cli/src/devices.c:925 msgid "(unknown)" msgstr "(ਅਣਜਾਣ)" -#: ../cli/src/devices.c:484 +#: ../cli/src/devices.c:528 msgid "unknown)" msgstr "ਅਣਜਾਣ)" -#: ../cli/src/devices.c:510 +#: ../cli/src/devices.c:554 #, c-format msgid "%u Mb/s" msgstr "%u Mb/s" #. Print header #. "WIRED-PROPERTIES" -#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:627 msgid "on" msgstr "ਚਾਲੂ" -#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:627 msgid "off" msgstr "ਬੰਦ" -#: ../cli/src/devices.c:710 +#: ../cli/src/devices.c:808 #, c-format msgid "Error: 'dev status': %s" msgstr "ਗਲਤੀ: 'dev status': %s" -#: ../cli/src/devices.c:712 +#: ../cli/src/devices.c:810 #, c-format msgid "Error: 'dev status': %s; allowed fields: %s" msgstr "ਗਲਤੀ: 'dev status': %s; ਮਨਜ਼ੂਰ ਖੇਤਰ: %s" -#: ../cli/src/devices.c:719 +#: ../cli/src/devices.c:817 msgid "Status of devices" msgstr "ਜੰਤਰਾਂ ਦੀ ਹਾਲਤ" -#: ../cli/src/devices.c:747 +#: ../cli/src/devices.c:845 #, c-format msgid "Error: '%s' argument is missing." msgstr "ਗਲਤੀ: '%s' ਆਰਗੂਮੈਂਟ ਗੁੰਮ ਹੈ।" -#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#: ../cli/src/devices.c:874 ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: Device '%s' not found." msgstr "ਗਲਤੀ: ਜੰਤਰ '%s' ਨਹੀਂ ਲੱਭਿਆ।" -#: ../cli/src/devices.c:799 +#: ../cli/src/devices.c:897 #, c-format msgid "Success: Device '%s' successfully disconnected." msgstr "ਸਫ਼ਲ: ਜੰਤਰ '%s' ਠੀਕ ਤਰ੍ਹਾਂ ਡਿਸ-ਕੁਨੈਕਟ ਹੋ ਗਿਆ।" -#: ../cli/src/devices.c:824 +#: ../cli/src/devices.c:922 #, c-format msgid "Error: Device '%s' (%s) disconnecting failed: %s" msgstr "ਗਲਤੀ: ਜੰਤਰ '%s' (%s) ਡਿਸ-ਕੁਨੈਕਸ਼ਨ ਫੇਲ੍ਹ: %s" -#: ../cli/src/devices.c:832 +#: ../cli/src/devices.c:930 #, c-format msgid "Device state: %d (%s)\n" msgstr "ਜੰਤਰ ਹਾਲਤ: %d (%s)\n" -#: ../cli/src/devices.c:896 +#: ../cli/src/devices.c:994 #, c-format msgid "Error: iface has to be specified." msgstr "ਗਲਤੀ: iface ਦੇਣ ਲਈ ਫੇਲ੍ਹ ਹੈ।" -#: ../cli/src/devices.c:1011 +#: ../cli/src/devices.c:1112 #, c-format msgid "Error: 'dev wifi': %s" msgstr "ਗਲਤੀ: 'dev wifi': %s" -#: ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1114 #, c-format msgid "Error: 'dev wifi': %s; allowed fields: %s" msgstr "ਗਲਤੀ: 'dev wifi': %s; ਮਨਜ਼ੂਰ ਖੇਤਰ: %s" -#: ../cli/src/devices.c:1020 +#: ../cli/src/devices.c:1121 msgid "WiFi scan list" msgstr "ਵਾਈਫਾਈ ਸਕੈਨ ਲਿਸਟ" -#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#: ../cli/src/devices.c:1156 ../cli/src/devices.c:1210 #, c-format msgid "Error: Access point with hwaddr '%s' not found." msgstr "ਗਲਤੀ: hwaddr '%s' ਵਾਲਾ ਅਸੈੱਸ ਪੁਆਇੰਟ ਨਹੀਂ ਲੱਭਿਆ।" -#: ../cli/src/devices.c:1072 +#: ../cli/src/devices.c:1173 #, c-format msgid "Error: Device '%s' is not a WiFi device." msgstr "ਗਲਤੀ: ਜੰਤਰ '%s' ਵਾਈ-ਫਾਈ ਜੰਤਰ ਨਹੀਂ ਹੈ।" -#: ../cli/src/devices.c:1136 +#: ../cli/src/devices.c:1237 #, c-format msgid "Error: 'dev wifi' command '%s' is not valid." msgstr "ਗਲਤੀ: 'dev wifi' ਕਮਾਂਡ '%s' ਢੁੱਕਵੀਂ ਨਹੀਂ ਹੈ।" -#: ../cli/src/devices.c:1183 +#: ../cli/src/devices.c:1284 #, c-format msgid "Error: 'dev' command '%s' is not valid." msgstr "ਗਲਤੀ: 'dev' ਕਮਾਂਡ '%s' ਢੁੱਕਵੀਂ ਨਹੀਂ ਹੈ।" @@ -1478,26 +1491,26 @@ msgstr "PKCS#12 ਫਾਇਲ ਜਾਂਚੀ ਨਹੀਂ ਜਾ ਸਕੀ: %d" msgid "Could not generate random data." msgstr "ਰਲਵਾਂ ਡਾਟਾ ਤਿਆਰ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ।" -#: ../libnm-util/nm-utils.c:1925 +#: ../libnm-util/nm-utils.c:1975 #, c-format msgid "Not enough memory to make encryption key." msgstr "ਇੰਕ੍ਰਿਪਸ਼ਨ ਕੁੰਜੀ ਬਣਾਉਣ ਲਈ ਲੋੜੀਦੀ ਮੈਮੋਰੀ ਨਹੀਂ ਹੈ।" -#: ../libnm-util/nm-utils.c:2035 +#: ../libnm-util/nm-utils.c:2085 msgid "Could not allocate memory for PEM file creation." msgstr "PEM ਫਾਇਲ ਬਣਾਉਣ ਲਈ ਮੈਮੋਰੀ ਜਾਰੀ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕੀ।" -#: ../libnm-util/nm-utils.c:2047 +#: ../libnm-util/nm-utils.c:2097 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "PEM ਫਾਇਲ ਵਾਸਤੇ IV ਲਿਖਣ ਲਈ ਮੈਮੋਰੀ ਦਿੱਤੀ ਨਹੀਂ ਜਾ ਸਕੀ।" -#: ../libnm-util/nm-utils.c:2059 +#: ../libnm-util/nm-utils.c:2109 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "PEM ਫਾਇਲ ਵਾਸਤੇ ਇੰਕ੍ਰਿਪਟ ਕੀਤੀ ਕੁੰਜੀ ਲਿਖਣ ਲਈ ਮੈਮੋਰੀ ਦਿੱਤੀ ਨਹੀਂ ਜਾ ਸਕੀ।" -#: ../libnm-util/nm-utils.c:2078 +#: ../libnm-util/nm-utils.c:2128 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "PEM ਫਾਇਲ ਡਾਟੇ ਲਈ ਮੈਮੋਰੀ ਜਾਰੀ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕੀ" @@ -1559,16 +1572,14 @@ msgid "" "Put NetworkManager to sleep or wake it up (should only be used by system " "power management)" msgstr "" -"ਨੈੱਟਵਰਕਮੈਨਜੇਰ ਨੂੰ ਸਲੀਪ ਕਰੋ ਜਾਂ ਵੇਕ ਅੱਪ ਕਰੋ (ਕੇਵਲ ਸਿਸਟਮ ਪਾਵਰ ਮੈਨਜੇਮੈਂਟ ਰਾਹੀਂ ਵਰਤਿਆ " -"ਜਾਣਾ ਚਾਹੀਦਾ ਹੈ)" +"ਨੈੱਟਵਰਕਮੈਨਜੇਰ ਨੂੰ ਸਲੀਪ ਕਰੋ ਜਾਂ ਵੇਕ ਅੱਪ ਕਰੋ (ਕੇਵਲ ਸਿਸਟਮ ਪਾਵਰ ਮੈਨਜੇਮੈਂਟ ਰਾਹੀਂ ਵਰਤਿਆ ਜਾਣਾ ਚਾਹੀਦਾ " +"ਹੈ)" #: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 -#| msgid "System policy prevents modification of system settings" msgid "System policy prevents control of network connections" msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਨੈੱਟਵਰਕ ਕੁਨੈਕਸ਼ਨ ਕੰਟਰੋਲ ਕਰਨ ਤੋਂ ਸੋਧ ਤੋਂ ਰੋਕਦੀ ਹੈ" #: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 -#| msgid "System policy prevents sharing connections via an open WiFi network" msgid "System policy prevents enabling or disabling WiFi devices" msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਵਾਈ-ਫਾਈ ਜੰਤਰ ਚਾਲੂ ਜਾਂ ਬੰਦ ਕਰਨੋਂ ਰੋਕਦੀ ਹੈ" @@ -1577,7 +1588,6 @@ msgid "System policy prevents enabling or disabling mobile broadband devices" msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਮੋਬਾਇਲ ਬਰਾਡਬੈਂਡ ਜੰਤਰ ਚਾਲੂ ਜਾਂ ਬੰਦ ਕਰਨ ਤੋਂ ਰੋਕਦੀ ਹੈ" #: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 -#| msgid "System policy prevents modification of system settings" msgid "System policy prevents enabling or disabling system networking" msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਸਿਸਟਮ ਨੈੱਟਵਰਕਿੰਗ ਚਾਲੂ ਜਾਂ ਬੰਦ ਕਰਨ ਤੋਂ ਰੋਕਦੀ ਹੈ" @@ -1586,7 +1596,6 @@ msgid "System policy prevents putting NetworkManager to sleep or waking it up" msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਨੈੱਟਵਰਕਮੈਨੇਜਰ ਨੂੰ ਸਲੀਪ ਜਾਂ ਵੇਕਅੱਪ ਕਰਨ ਤੋਂ ਰੋਕਦੀ ਹੈ" #: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 -#| msgid "System policy prevents modification of system settings" msgid "System policy prevents use of user-specific connections" msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਖਾਸ-ਯੂਜ਼ਰ ਕੁਨੈਕਸ਼ਨ ਵਰਤੋਂ ਤੋਂ ਰੋਕਦੀ ਹੈ" @@ -1630,21 +1639,21 @@ msgstr "netlink ਗਰੁੱਪ ਜੁਆਇੰਨ ਕਰਨ ਲਈ ਅਸਮਰ msgid "error updating link cache: %s" msgstr "ਲਿੰਕ ਕੈਸ਼ ਅੱਪਡੇਟ ਕਰਨ ਦੌਰਾਨ ਗਲਤੀ: %s" -#: ../src/main.c:502 +#: ../src/main.c:499 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "ਗਲਤ ਚੋਣ। ਢੁੱਕਵੀਆਂ ਚੋਣਾਂ ਵੇਖਣ ਲਈ --help ਵਰਤੋਂ ਜੀ।\n" -#: ../src/main.c:568 +#: ../src/main.c:570 #, c-format msgid "%s. Please use --help to see a list of valid options.\n" msgstr "%s। ਢੁੱਕਵੀਆਂ ਚੋਣਾਂ ਦੀ ਲਿਸਟ ਵੇਖਣ ਲਈ --help ਵਰਤੋਂ ਜੀ।\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:328 msgid "# Created by NetworkManager\n" msgstr "#ਨੈੱਟਵਰਕ ਮੈਨੇਜਰ ਵਲੋਂ ਬਣਾਈ\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:344 #, c-format msgid "" "# Merged from %s\n" @@ -1653,19 +1662,19 @@ msgstr "" "#%s ਤੋਂ ਮਿਲਾਇਆ\n" "\n" -#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 msgid "no usable DHCP client could be found." msgstr "ਕੋਈ ਵਰਤੋਂਯੋਗ DHCP ਕਲਾਇਟ ਨਹੀਂ ਲੱਭਿਆ ਜਾ ਸਕਿਆ।" -#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 msgid "'dhclient' could be found." msgstr "'dhclient' ਲੱਭਿਆ ਜਾ ਸਕਿਆ।" -#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 msgid "'dhcpcd' could be found." msgstr "'dhcpcd' ਲੱਭਿਆ ਜਾ ਸਕਿਆ।" -#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 #, c-format msgid "unsupported DHCP client '%s'" msgstr "ਗੈਰਸਹਾਇਕ DHCP ਕਲਾਇਟ '%s'" @@ -1680,11 +1689,11 @@ msgstr "ਅਣਜਾਣ ਲਾਗ ਲੈਵਲ '%s'" msgid "Unknown log domain '%s'" msgstr "ਅਣਜਾਣ ਲਾਗ ਡੋਮੇਨ '%s'" -#: ../src/dns-manager/nm-dns-manager.c:350 +#: ../src/dns-manager/nm-dns-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "ਨੋਟ: libc ਰਿਜ਼ੋਲਵਰ ੩ ਤੋਂ ਵੱਧ ਨੇਮ-ਸਰਵਰ ਲਈ ਸਹਾਇਕ ਨਹੀਂ ਹੋ ਸਕਦਾ ਹੈ।" -#: ../src/dns-manager/nm-dns-manager.c:352 +#: ../src/dns-manager/nm-dns-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "ਹੇਠਾਂ ਦਿੱਤੇ ਨੇਮ-ਸਰਵਰ ਪਛਾਣੇ ਨਹੀਂ ਜਾ ਸਕਦੇ।" @@ -1693,7 +1702,8 @@ msgstr "ਹੇਠਾਂ ਦਿੱਤੇ ਨੇਮ-ਸਰਵਰ ਪਛਾਣੇ msgid "Auto %s" msgstr "ਆਟੋ %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3275 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3412 +#: ../system-settings/plugins/ifnet/connection_parser.c:49 msgid "System" msgstr "ਸਿਸਟਮ।" -- cgit v1.2.1 From 694e1bc46b2e29418f2ab74ff1071f864d1ffb5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Urban=C4=8Di=C4=8D?= Date: Fri, 17 Sep 2010 12:42:17 -0500 Subject: po: update Slovenian translation (bgo #629861) --- po/sl.po | 2077 +++++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 1450 insertions(+), 627 deletions(-) diff --git a/po/sl.po b/po/sl.po index 4f9809182c..b80fe49ae5 100644 --- a/po/sl.po +++ b/po/sl.po @@ -1,16 +1,18 @@ -# Slovenian translation of NetworkManager. +# -*- mode:po; coding:utf-8; -*- Slovenian message catalogue for NetworkManager. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the NetworkManager package. +# # Matic Žgur , 2007. -# Andrej Žnidaršič , 2009. +# Andrej Žnidaršič , 2009 - 2010. +# Matej Urbančič , 2010. # msgid "" msgstr "" -"Project-Id-Version: NetworkManager\n" +"Project-Id-Version: NetworkManager master\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2009-09-29 03:25+0000\n" -"PO-Revision-Date: 2009-12-17 07:10+0100\n" -"Last-Translator: Andrej Žnidaršič \n" +"POT-Creation-Date: 2010-09-16 03:25+0000\n" +"PO-Revision-Date: 2010-09-16 18:17+0100\n" +"Last-Translator: Matej Urbančič \n" "Language-Team: Slovenian GNOME Translation Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -20,15 +22,1262 @@ msgstr "" "X-Poedit-Language: Slovenian\n" "X-Poedit-SourceCharset: utf-8\n" +#: ../cli/src/connections.c:60 +#: ../cli/src/connections.c:75 +#: ../cli/src/devices.c:88 +#: ../cli/src/devices.c:101 +#: ../cli/src/devices.c:111 +#: ../cli/src/devices.c:121 +#: ../cli/src/devices.c:134 +#: ../cli/src/devices.c:145 +#: ../cli/src/devices.c:156 +#: ../cli/src/devices.c:165 +#: ../cli/src/devices.c:174 +msgid "NAME" +msgstr "IME" + +#. 0 +#: ../cli/src/connections.c:61 +#: ../cli/src/connections.c:76 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:62 +msgid "DEVICES" +msgstr "NAPRAVE" + +#. 2 +#: ../cli/src/connections.c:63 +#: ../cli/src/connections.c:78 +msgid "SCOPE" +msgstr "OBSEG" + +#. 3 +#: ../cli/src/connections.c:64 +msgid "DEFAULT" +msgstr "PRIVZETO" + +#. 4 +#: ../cli/src/connections.c:65 +msgid "DBUS-SERVICE" +msgstr "STORITEV-DBUS" + +#. 5 +#: ../cli/src/connections.c:66 +msgid "SPEC-OBJECT" +msgstr "SPEC-PREDMET" + +#. 6 +#: ../cli/src/connections.c:67 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:77 +#: ../cli/src/devices.c:62 +#: ../cli/src/devices.c:90 +msgid "TYPE" +msgstr "VRSTA" + +#. 3 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP" +msgstr "ČASOVNI ŽIG" + +#. 4 +#: ../cli/src/connections.c:80 +msgid "TIMESTAMP-REAL" +msgstr "REAL-ČASOVNI ŽIG" + +#. 5 +#: ../cli/src/connections.c:81 +msgid "AUTOCONNECT" +msgstr "SAMODEJNO POVEŽI" + +#. 6 +#: ../cli/src/connections.c:82 +msgid "READONLY" +msgstr "SAMO ZA BRANJE" + +#: ../cli/src/connections.c:158 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout ]\n" +" down id | uuid \n" +msgstr "" +"Uporaba: nmcli con { UKAZ | help }\n" +" UKAZ := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout ]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:198 +#: ../cli/src/connections.c:537 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Napaka: 'con list': %s" + +#: ../cli/src/connections.c:200 +#: ../cli/src/connections.c:539 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Napaka: 'con list': %s; dovoljena so polja: %s" + +#: ../cli/src/connections.c:208 +msgid "Connection details" +msgstr "Podatki o povezavi" + +#: ../cli/src/connections.c:382 +#: ../cli/src/connections.c:602 +msgid "system" +msgstr "sistem" + +#: ../cli/src/connections.c:382 +#: ../cli/src/connections.c:602 +msgid "user" +msgstr "uporabnik" + +#: ../cli/src/connections.c:384 +msgid "never" +msgstr "nikoli" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:385 +#: ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 +#: ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 +#: ../cli/src/devices.c:557 +#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 +#: ../cli/src/devices.c:585 +#: ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 +#: ../cli/src/settings.c:508 +#: ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 +msgid "yes" +msgstr "da" + +#: ../cli/src/connections.c:385 +#: ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 +#: ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 +#: ../cli/src/devices.c:557 +#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 +#: ../cli/src/devices.c:585 +#: ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 +#: ../cli/src/settings.c:508 +#: ../cli/src/settings.c:510 +#: ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 +msgid "no" +msgstr "ne" + +#: ../cli/src/connections.c:458 +#: ../cli/src/connections.c:501 +msgid "System connections" +msgstr "Sistemske povezave" + +#: ../cli/src/connections.c:463 +#: ../cli/src/connections.c:514 +msgid "User connections" +msgstr "Uporabniške povezave" + +#: ../cli/src/connections.c:475 +#: ../cli/src/connections.c:1335 +#: ../cli/src/connections.c:1351 +#: ../cli/src/connections.c:1360 +#: ../cli/src/connections.c:1371 +#: ../cli/src/connections.c:1456 +#: ../cli/src/devices.c:962 +#: ../cli/src/devices.c:972 +#: ../cli/src/devices.c:1074 +#: ../cli/src/devices.c:1081 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Napaka: manjka argument %s." + +#: ../cli/src/connections.c:488 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Napaka: %s - povezava ne obstaja." + +#: ../cli/src/connections.c:520 +#: ../cli/src/connections.c:1384 +#: ../cli/src/connections.c:1474 +#: ../cli/src/devices.c:785 +#: ../cli/src/devices.c:852 +#: ../cli/src/devices.c:986 +#: ../cli/src/devices.c:1087 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Neznan parameter: %s\n" + +#: ../cli/src/connections.c:529 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Napaka: ni podanega veljavnega parametra." + +#: ../cli/src/connections.c:544 +#: ../cli/src/connections.c:1577 +#: ../cli/src/devices.c:1293 +#: ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "Napaka: %s." + +#: ../cli/src/connections.c:650 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Napaka: 'con status': %s" + +#: ../cli/src/connections.c:652 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Napaka: 'con status': %s; dovoljena polja: %s" + +#: ../cli/src/connections.c:659 +msgid "Active connections" +msgstr "Dejavne povezave" + +#: ../cli/src/connections.c:1027 +#, c-format +msgid "no active connection on device '%s'" +msgstr "ni dejavnih povezav na napravi '%s'" + +#: ../cli/src/connections.c:1035 +#, c-format +msgid "no active connection or device" +msgstr "ni dejavne povezave ali naprave" + +#: ../cli/src/connections.c:1085 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "naprava '%s' ni združljiva s povezavo '%s'" + +#: ../cli/src/connections.c:1087 +#, c-format +msgid "no device found for connection '%s'" +msgstr "ni naprave za povezavo '%s'" + +#: ../cli/src/connections.c:1098 +msgid "activating" +msgstr "začenjanje" + +#: ../cli/src/connections.c:1100 +msgid "activated" +msgstr "začeto" + +#: ../cli/src/connections.c:1103 +#: ../cli/src/connections.c:1126 +#: ../cli/src/connections.c:1159 +#: ../cli/src/devices.c:246 +#: ../cli/src/devices.c:558 +#: ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 +#: ../cli/src/settings.c:473 +msgid "unknown" +msgstr "neznano" + +#: ../cli/src/connections.c:1112 +msgid "VPN connecting (prepare)" +msgstr "VPN povezovanje (priprava)" + +#: ../cli/src/connections.c:1114 +msgid "VPN connecting (need authentication)" +msgstr "VPN povezovanje (zahtevana je overitev)" + +#: ../cli/src/connections.c:1116 +msgid "VPN connecting" +msgstr "VPN povezovanje" + +#: ../cli/src/connections.c:1118 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN povezovanje (pridobivanje nastavitev IP)" + +#: ../cli/src/connections.c:1120 +msgid "VPN connected" +msgstr "Povezan v VPN" + +#: ../cli/src/connections.c:1122 +msgid "VPN connection failed" +msgstr "Povezava z VPN je spodletela" + +#: ../cli/src/connections.c:1124 +msgid "VPN disconnected" +msgstr "Povezava z VPN je prekinjena" + +#: ../cli/src/connections.c:1135 +msgid "unknown reason" +msgstr "neznan vzrok" + +#: ../cli/src/connections.c:1137 +msgid "none" +msgstr "brez" + +#: ../cli/src/connections.c:1139 +msgid "the user was disconnected" +msgstr "povezava z uporabnikom je prekinjena" + +#: ../cli/src/connections.c:1141 +msgid "the base network connection was interrupted" +msgstr "osnovna omrežna povezava je bila prekinjena" + +#: ../cli/src/connections.c:1143 +msgid "the VPN service stopped unexpectedly" +msgstr "storitev VPN je nepričakovano zaustavljena" + +#: ../cli/src/connections.c:1145 +msgid "the VPN service returned invalid configuration" +msgstr "storitev VPN je vrnila neveljavne nastavitve" + +#: ../cli/src/connections.c:1147 +msgid "the connection attempt timed out" +msgstr "poskus povezave je časovno potekel" + +#: ../cli/src/connections.c:1149 +msgid "the VPN service did not start in time" +msgstr "storitev VPN se ni pravočasno začela" + +#: ../cli/src/connections.c:1151 +msgid "the VPN service failed to start" +msgstr "storitev VPN ni uspešno začeta" + +#: ../cli/src/connections.c:1153 +msgid "no valid VPN secrets" +msgstr "ni veljavnih VPN skrivnosti" + +#: ../cli/src/connections.c:1155 +msgid "invalid VPN secrets" +msgstr "neveljavne VPN skrivnosti" + +#: ../cli/src/connections.c:1157 +msgid "the connection was removed" +msgstr "povezava je odstranjena" + +#: ../cli/src/connections.c:1171 +#, c-format +msgid "state: %s\n" +msgstr "stanje: %s\n" + +#: ../cli/src/connections.c:1174 +#: ../cli/src/connections.c:1200 +#, c-format +msgid "Connection activated\n" +msgstr "Povezava je omogočena\n" + +#: ../cli/src/connections.c:1177 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Napaka: začenjanje povezave ni uspelo." + +#: ../cli/src/connections.c:1196 +#, c-format +msgid "state: %s (%d)\n" +msgstr "stanje: %s (%d)\n" + +#: ../cli/src/connections.c:1206 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Napaka: začenjanje povezave ni uspelo: %s." + +#: ../cli/src/connections.c:1223 +#: ../cli/src/devices.c:909 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Napaka: časovna omejitev %d sekund je potekla." + +#: ../cli/src/connections.c:1266 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Napaka: začenjanje povezave ni uspelo: %s." + +#: ../cli/src/connections.c:1280 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Napaka: pridobivanje dejavne povezave '%s' je spodletelo." + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Stanje dejavne povezave: %s\n" + +#: ../cli/src/connections.c:1290 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Pot dejavne povezave: %s\n" + +#: ../cli/src/connections.c:1344 +#: ../cli/src/connections.c:1465 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Napaka: neznana povezava: %s." + +#: ../cli/src/connections.c:1379 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Napaka: vrednost časovne omejitve '%s' ni veljavna." + +#: ../cli/src/connections.c:1392 +#: ../cli/src/connections.c:1482 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Napaka: podatek id ali uuid ni naveden." + +#: ../cli/src/connections.c:1412 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Napaka: ni mogoče najti ustrezne naprave: %s." + +#: ../cli/src/connections.c:1414 +#, c-format +msgid "Error: No suitable device found." +msgstr "Napaka: ni mogoče najti ustrezne naprave." + +#: ../cli/src/connections.c:1509 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Opozorilo: povezava ni dejavna\n" + +#: ../cli/src/connections.c:1566 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Napaka: ukaz 'con' '%s' ni veljaven." + +#: ../cli/src/connections.c:1602 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Napaka: povezava z D-Bus ni mogoča." + +#: ../cli/src/connections.c:1609 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Napaka: ni mogoče pridobiti sistemskih nastavitev." + +#: ../cli/src/connections.c:1617 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Napaka: ni mogoče pridobiti uporabniških nastavitev." + +#: ../cli/src/connections.c:1627 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "Napaka: ni mogoče pridobiti povezave: storitve nastavitev niso zagnane." + +#. 0 +#. 9 +#: ../cli/src/devices.c:61 +#: ../cli/src/devices.c:89 +#: ../cli/src/devices.c:184 +msgid "DEVICE" +msgstr "NAPRAVA" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:63 +#: ../cli/src/devices.c:93 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STANJE" + +#: ../cli/src/devices.c:72 +msgid "GENERAL" +msgstr "SPLOŠNO" + +#. 0 +#: ../cli/src/devices.c:73 +msgid "CAPABILITIES" +msgstr "ZMOŽNOSTI" + +#. 1 +#: ../cli/src/devices.c:74 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-LASTNOSTI" + +#. 2 +#: ../cli/src/devices.c:75 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:76 +msgid "WIRED-PROPERTIES" +msgstr "LASTNOSTI ŽIČNE POVEZAVE" + +#. 4 +#: ../cli/src/devices.c:77 +msgid "IP4-SETTINGS" +msgstr "IP4-NASTAVITVE" + +#. 5 +#: ../cli/src/devices.c:78 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 6 +#: ../cli/src/devices.c:79 +msgid "IP6-SETTINGS" +msgstr "IP6-NASTAVITVE" + +#. 7 +#: ../cli/src/devices.c:80 +msgid "IP6-DNS" +msgstr "IP6-DNS" + +#. 2 +#: ../cli/src/devices.c:91 +msgid "DRIVER" +msgstr "GONILNIK" + +#. 3 +#: ../cli/src/devices.c:92 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:102 +msgid "CARRIER-DETECT" +msgstr "ZAZNAVA-OPERATERJA" + +#. 1 +#: ../cli/src/devices.c:103 +msgid "SPEED" +msgstr "HITROST" + +#. 0 +#: ../cli/src/devices.c:112 +msgid "CARRIER" +msgstr "OPERATER" + +#. 0 +#: ../cli/src/devices.c:122 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:123 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:124 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:125 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:126 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:135 +#: ../cli/src/devices.c:146 +msgid "ADDRESS" +msgstr "NASLOV" + +#. 1 +#: ../cli/src/devices.c:136 +#: ../cli/src/devices.c:147 +msgid "PREFIX" +msgstr "PREDPONA" + +#. 2 +#: ../cli/src/devices.c:137 +#: ../cli/src/devices.c:148 +msgid "GATEWAY" +msgstr "PREHOD" + +#. 0 +#: ../cli/src/devices.c:157 +#: ../cli/src/devices.c:166 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:175 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:176 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:177 +msgid "MODE" +msgstr "NAČIN" + +#. 3 +#: ../cli/src/devices.c:178 +msgid "FREQ" +msgstr "FREKVENCA" + +#. 4 +#: ../cli/src/devices.c:179 +msgid "RATE" +msgstr "HITROST" + +#. 5 +#: ../cli/src/devices.c:180 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:181 +msgid "SECURITY" +msgstr "VARNOST" + +#. 7 +#: ../cli/src/devices.c:182 +msgid "WPA-FLAGS" +msgstr "WPA-ZASTAVICE" + +#. 8 +#: ../cli/src/devices.c:183 +msgid "RSN-FLAGS" +msgstr "RSN-ZASTAVICE" + +#. 10 +#: ../cli/src/devices.c:185 +msgid "ACTIVE" +msgstr "DEJAVNO" + +#: ../cli/src/devices.c:208 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"Uporaba: nmcli dev { UKAZ | help }\n" +"\n" +"UKAZ := { status | list | disconnect | wifi }\n" +"\n" +"status\n" +"list [iface ]\n" +"disconnect iface [--nowait] [--timeout ]\n" +"wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:228 +msgid "unmanaged" +msgstr "neupravljano" + +#: ../cli/src/devices.c:230 +msgid "unavailable" +msgstr "ni razpoložljivo" + +#: ../cli/src/devices.c:232 +#: ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "povezava je prekinjena" + +#: ../cli/src/devices.c:234 +msgid "connecting (prepare)" +msgstr "povezovanje (priprava)" + +#: ../cli/src/devices.c:236 +msgid "connecting (configuring)" +msgstr "povezovanje (nastavljanje)" + +#: ../cli/src/devices.c:238 +msgid "connecting (need authentication)" +msgstr "povezovanje (zahteva overitev)" + +#: ../cli/src/devices.c:240 +msgid "connecting (getting IP configuration)" +msgstr "povezovanje (pridobivanje nastavitev IP)" + +#: ../cli/src/devices.c:242 +#: ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "povezano" + +#: ../cli/src/devices.c:244 +msgid "connection failed" +msgstr "povezava je spodletela" + +#: ../cli/src/devices.c:267 +#: ../cli/src/devices.c:424 +msgid "Unknown" +msgstr "Neznano" + +#: ../cli/src/devices.c:299 +msgid "(none)" +msgstr "(brez)" + +#: ../cli/src/devices.c:324 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: napaka med pretvarjanjem naslova IP4 0x%X" + +#: ../cli/src/devices.c:393 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:394 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:403 +msgid "Encrypted: " +msgstr "Šifrirano: " + +#: ../cli/src/devices.c:408 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:410 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:412 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:415 +msgid "Enterprise " +msgstr "Podjetniški " + +#: ../cli/src/devices.c:424 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:424 +msgid "Infrastructure" +msgstr "infrastruktura" + +#: ../cli/src/devices.c:486 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "Napaka: 'dev list': %s" + +#: ../cli/src/devices.c:488 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Napaka: 'dev list': %s; dovoljena polja: %s" + +#: ../cli/src/devices.c:497 +msgid "Device details" +msgstr "Podrobnosti naprave" + +#: ../cli/src/devices.c:527 +#: ../cli/src/devices.c:925 +msgid "(unknown)" +msgstr "(neznano)" + +#: ../cli/src/devices.c:528 +msgid "unknown)" +msgstr "neznano)" + +#: ../cli/src/devices.c:554 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:627 +msgid "on" +msgstr "omogočeno" + +#: ../cli/src/devices.c:627 +msgid "off" +msgstr "onemogočeno" + +#: ../cli/src/devices.c:808 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "Napaka: 'dev status': %s" + +#: ../cli/src/devices.c:810 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Napaka: 'dev status': %s; dovoljena polja: %s" + +#: ../cli/src/devices.c:817 +msgid "Status of devices" +msgstr "Stanje naprav" + +#: ../cli/src/devices.c:845 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Napaka: manjka argument '%s'" + +#: ../cli/src/devices.c:874 +#: ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Napaka: naprave '%s' ni mogoče najti" + +#: ../cli/src/devices.c:897 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Obvestilo: povezava naprave '%s' je uspešno prekinjena." + +#: ../cli/src/devices.c:922 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Napaka: prišlo je do napake med prekinjanjem naprave '%s' (%s): %s" + +#: ../cli/src/devices.c:930 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Stanje naprave: %d (%s)\n" + +#: ../cli/src/devices.c:994 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Napaka: iface nastavitev mora določena." + +#: ../cli/src/devices.c:1112 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "Napaka: 'dev wifi': %s" + +#: ../cli/src/devices.c:1114 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Napaka: 'dev wifi': %s; dovoljena polja: %s" + +#: ../cli/src/devices.c:1121 +msgid "WiFi scan list" +msgstr "WiFi seznam preiskovanja" + +#: ../cli/src/devices.c:1156 +#: ../cli/src/devices.c:1210 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Napaka: dostopne točke s strojnim naslovom '%s' ni mogoče najti." + +#: ../cli/src/devices.c:1173 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Napaka: naprava '%s' ni veljavna WiFi naprava." + +#: ../cli/src/devices.c:1237 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Napaka: 'dev wifi' ukaz '%s' ni veljaven." + +#: ../cli/src/devices.c:1284 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Napaka: 'dev' ukaz '%s' ni veljaven." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "V TEKU" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-STROJNA OPREMA" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-STROJNA OPREMA" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Uporaba: nmcli nm { UKAZ | help }\n" +"\n" +"UKAZ := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +"status\n" +"sleep\n" +"wakeup\n" +"wifi [on|off]\n" +"wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "v mirovanju" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "povezovanje" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Napaka: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Napaka: 'nm status': %s; dovoljena polja: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "Stanje NetworkManager" + +#. Print header +#: ../cli/src/network-manager.c:140 +#: ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 +#: ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 +#: ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "omogočeno" + +#: ../cli/src/network-manager.c:140 +#: ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 +#: ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 +#: ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "onemogočeno" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "v teku" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "ni v teku" + +#: ../cli/src/network-manager.c:201 +#: ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Napaka: vrednost '--fields' '%s' ni veljavna, dovoljena polja: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi je omogočen" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Napaka: neveljaven 'wifi' parameter: '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN je omogočen" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Napaka: neveljaven 'wwan' parameter: '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Napaka: ukaz 'nm' '%s' ni veljaven" + +#: ../cli/src/nmcli.c:69 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Uporaba: %s [MOŽNOSTI] PREDMET { UKAZ| help }\n" +"\n" +"MOŽNOSTI\n" +"-t[erse] zgoščen odvod\n" +"-p[retty] olepšan odvod\n" +"-m[ode] tabular|multiline način odvoda\n" +"-f[ields] |all|common določilo polj odvoda\n" +"-e[scape] yes|no izpuščanje ločilnikov vrednosti\n" +"-v[ersion] pokaži različico programa\n" +"-h[elp] natisni pomoč\n" +"\n" +"PREDMET\n" +"nm stanje programa NetworkManager\n" +"con povezave programa NetworkManager\n" +"dev naprave upravljane s programom NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Napaka: predmeta '%s' ni mogoče prepoznati, poskusite: 'nmcli help'." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Napaka: možnost '--terse' je podana dvakrat." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Napaka: možnosti \"--terse\" in \"--pretty\" se med seboj izključujeta." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Napaka: možnost '--pretty' je podana dvakrat." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Napaka: možnosti \"--pretty\" in \"--tearse\" se med seboj izključujeta." + +#: ../cli/src/nmcli.c:171 +#: ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Napaka: manjka argument za možnost '%s'." + +#: ../cli/src/nmcli.c:180 +#: ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Napaka: '%s' ni veljaven argument za možnost '%s'." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Napaka: polja za možnosti '%s' manjkajo." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli orodje, različica %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Napaka: možnost '%s' ni prepoznana, poskusite 'nmcli -help'." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "Ujet signal %d, povezava bo izklopljena ..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Napaka: ni se mogoče povezati s programom NetworkManager." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "Uspešno zaključeno" + +#: ../cli/src/settings.c:411 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (šestnajstiški-ascii-ključ)" + +#: ../cli/src/settings.c:413 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-bitno šifrirno geslo)" + +#: ../cli/src/settings.c:416 +#, c-format +msgid "%d (unknown)" +msgstr "%d (neznano)" + +#: ../cli/src/settings.c:442 +msgid "0 (unknown)" +msgstr "0 (neznano)" + +#: ../cli/src/settings.c:448 +msgid "any, " +msgstr "karkoli, " + +#: ../cli/src/settings.c:450 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:454 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:456 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:468 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:470 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:554 +#: ../cli/src/settings.c:721 +msgid "auto" +msgstr "samodejno" + +#: ../cli/src/settings.c:716 +#: ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 +#: ../cli/src/utils.c:172 +msgid "not set" +msgstr "ni nastavljeno" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "polje '%s' mora biti samostojno." + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "neveljavno polje '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Možnost '--terse' zahteva podan argument '--fields'" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "Možnost '--terse' zahteva posebne vrednosti '--polja' in ne '%s'" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." -msgstr "Ključna datoteka PEM nima končne oznake '%s'." +msgstr "Datoteka ključa PEM nima končne oznake '%s'." #: ../libnm-util/crypto.c:130 #, c-format msgid "Doesn't look like a PEM private key file." -msgstr "Ni videti kot PEM zasebna ključna datoteka." +msgstr "Datoteka ni videti kot PEM datoteka zasebnega ključa." #: ../libnm-util/crypto.c:138 #, c-format @@ -68,7 +1317,7 @@ msgstr "Slabo oblikovana datoteka PEM: neznana cifra zasebnega ključa '%s'." #: ../libnm-util/crypto.c:222 #, c-format msgid "Could not decode private key." -msgstr "Zasebnega ključa ni mogoče dekodirati." +msgstr "Zasebnega ključa ni mogoče odkodirati." #: ../libnm-util/crypto.c:267 #, c-format @@ -78,7 +1327,7 @@ msgstr "PEM potrdilo '%s' nima končne oznake '%s'." #: ../libnm-util/crypto.c:277 #, c-format msgid "Failed to decode certificate." -msgstr "Dekodiranje potrdila je spodletelo." +msgstr "Odkodiranje potrdila je spodletelo." #: ../libnm-util/crypto.c:286 #, c-format @@ -109,7 +1358,7 @@ msgstr "IV vsebuje ne-šestnajstiške številke." #: ../libnm-util/crypto_gnutls.c:148 #: ../libnm-util/crypto_gnutls.c:266 #: ../libnm-util/crypto_nss.c:171 -#: ../libnm-util/crypto_nss.c:335 +#: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "Cifra zasebnega ključa '%s' je neznana." @@ -127,16 +1376,16 @@ msgstr "Ni mogoče določiti vrste zasebnega ključa." #: ../libnm-util/crypto.c:530 #, c-format msgid "Not enough memory to store decrypted private key." -msgstr "Ni dovolj pomnilnika za shranjevanje dešifriranega zasebnega ključa." +msgstr "Ni dovolj pomnilnika za shranjevanje odšifriranega zasebnega ključa." #: ../libnm-util/crypto_gnutls.c:49 msgid "Failed to initialize the crypto engine." -msgstr "Zagon motorja šifriranja je spodletel." +msgstr "Začenjanje programnika šifriranja je spodletelo." #: ../libnm-util/crypto_gnutls.c:93 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." -msgstr "Zagon motorja MD5 je spodletel: %s / %s." +msgstr "Začenjanje programnika MD5 je spodletelo: %s / %s." #: ../libnm-util/crypto_gnutls.c:156 #, c-format @@ -147,50 +1396,50 @@ msgstr "Neveljavna dolžina IV (mora biti vsaj %zd)" #: ../libnm-util/crypto_nss.c:188 #, c-format msgid "Not enough memory for decrypted key buffer." -msgstr "Ni dovolj pomnilnika za medpomnilnik ključa dešifriranja." +msgstr "Ni dovolj pomnilnika za medpomnilnik odšifriranega ključa." #: ../libnm-util/crypto_gnutls.c:173 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." -msgstr "Zagon vsebine cifre dešifriranje je spodletel: %s / %s." +msgstr "Začenjanje vsebine odšifrirne cifre je spodletelo: %s / %s." #: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." -msgstr "Nastavljanje simetričnega ključa za dešifriranje je spodletelo: %s / %s. " +msgstr "Nastavljanje simetričnega ključa za odšifriranje je spodletelo: %s / %s." #: ../libnm-util/crypto_gnutls.c:191 #, c-format msgid "Failed to set IV for decryption: %s / %s." -msgstr "Nastavljanje IV za dešifriranje je spodletelo: %s / %s." +msgstr "Nastavljanje IV za odšifriranje je spodletelo: %s / %s." #: ../libnm-util/crypto_gnutls.c:200 #, c-format msgid "Failed to decrypt the private key: %s / %s." -msgstr "Dešifriranje zasebnega ključa je spodletelo: %s / %s." +msgstr "Odšifriranje zasebnega ključa je spodletelo: %s / %s." #: ../libnm-util/crypto_gnutls.c:210 -#: ../libnm-util/crypto_nss.c:266 +#: ../libnm-util/crypto_nss.c:267 #, c-format msgid "Failed to decrypt the private key: unexpected padding length." -msgstr "Dešifriranje zasebnega ključa je spodletelo: nepričakovana dolžina blazinjenja." +msgstr "Odšifriranje zasebnega ključa je spodletelo: nepričakovana dolžina blazinjenja." #: ../libnm-util/crypto_gnutls.c:221 -#: ../libnm-util/crypto_nss.c:277 +#: ../libnm-util/crypto_nss.c:278 #, c-format msgid "Failed to decrypt the private key." -msgstr "Dešifriranje zasebnega ključa je spodletelo." +msgstr "Odšifriranje zasebnega ključa je spodletelo." #: ../libnm-util/crypto_gnutls.c:286 -#: ../libnm-util/crypto_nss.c:355 +#: ../libnm-util/crypto_nss.c:356 #, c-format msgid "Could not allocate memory for encrypting." -msgstr "Pomnilnika za šifriranje ni mogoče dodeliti." +msgstr "Ni mogoče dodeliti pomnilnika za šifriranje." #: ../libnm-util/crypto_gnutls.c:294 #, c-format msgid "Failed to initialize the encryption cipher context: %s / %s." -msgstr "Zagon vsebine šifrirne cifre je spodletel: %s / %s. " +msgstr "Začenjanje vsebine šifrirne cifre je spodletelo: %s / %s." #: ../libnm-util/crypto_gnutls.c:303 #, c-format @@ -215,32 +1464,32 @@ msgstr "Napaka med zaganjanjem podatkov potrdila: %s" #: ../libnm-util/crypto_gnutls.c:384 #, c-format msgid "Couldn't decode certificate: %s" -msgstr "Potrdila ni mogoča dekodirati: %s" +msgstr "Potrdila ni mogoča odkodirati: %s" #: ../libnm-util/crypto_gnutls.c:408 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %s" -msgstr "Dekodirnika PKCS#12 ni mogoče zagnati: %s" +msgstr "Odkodirnika PKCS#12 ni mogoče začeti: %s" #: ../libnm-util/crypto_gnutls.c:421 #, c-format msgid "Couldn't decode PKCS#12 file: %s" -msgstr "Datoteke PKCS#12 ni mogoče dekodirati: %s" +msgstr "Datoteke PKCS#12 ni mogoče odkodirati: %s" #: ../libnm-util/crypto_gnutls.c:433 #, c-format msgid "Couldn't verify PKCS#12 file: %s" msgstr "Datoteke PKCS#12 ni mogoče preveriti: %s" -#: ../libnm-util/crypto_nss.c:57 +#: ../libnm-util/crypto_nss.c:56 #, c-format msgid "Failed to initialize the crypto engine: %d." -msgstr "Zagon motorja šifriranja je spodletel: %d." +msgstr "Začenjanje programnika šifriranja je spodletelo: %d." #: ../libnm-util/crypto_nss.c:111 #, c-format msgid "Failed to initialize the MD5 context: %d." -msgstr "Zagon vsebine MD5 je spodletel: %d." +msgstr "Začenjanje vsebine MD5 je spodletelo: %d." #: ../libnm-util/crypto_nss.c:179 #, c-format @@ -250,7 +1499,7 @@ msgstr "Neveljavna dolžina IV (mora biti vsaj %d)." #: ../libnm-util/crypto_nss.c:196 #, c-format msgid "Failed to initialize the decryption cipher slot." -msgstr "Zagon polja cifre dešifriranja je spodletel." +msgstr "Začenjanje polja cifre odšifriranja je spodletelo." #: ../libnm-util/crypto_nss.c:206 #, c-format @@ -260,127 +1509,204 @@ msgstr "Nastavljanje simetričnega ključa za opis je spodletelo." #: ../libnm-util/crypto_nss.c:216 #, c-format msgid "Failed to set IV for decryption." -msgstr "Nastavljanje IV za dešifriranje je spodletelo." +msgstr "Nastavljanje IV za odšifriranje je spodletelo." #: ../libnm-util/crypto_nss.c:224 #, c-format msgid "Failed to initialize the decryption context." -msgstr "Zagon vsebine dešifriranja je spodletel." +msgstr "Začenjanje vsebine odšifriranja je spodletelo." #: ../libnm-util/crypto_nss.c:237 #, c-format msgid "Failed to decrypt the private key: %d." -msgstr "Dešifriranje zasebnega ključa je spodletelo: %d." +msgstr "Odšifriranje zasebnega ključa je spodletelo: %d." #: ../libnm-util/crypto_nss.c:245 #, c-format msgid "Failed to decrypt the private key: decrypted data too large." -msgstr "Dešifriranje zasebnega ključa je spodletelo: dešifrirani podatki so preveliki." +msgstr "Odšifriranje zasebnega ključa je spodletelo: odšifrirani podatki so preveliki." #: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." -msgstr "Končanje dešifriranja zasebnega ključa je spodletelo: %d." +msgstr "Končanje odšifriranja zasebnega ključa je spodletelo: %d." -#: ../libnm-util/crypto_nss.c:363 +#: ../libnm-util/crypto_nss.c:364 #, c-format msgid "Failed to initialize the encryption cipher slot." -msgstr "Zagon polja cifre šifriranja je spodletel." +msgstr "Začenjanje polja cifre šifriranja je spodletelo." -#: ../libnm-util/crypto_nss.c:371 +#: ../libnm-util/crypto_nss.c:372 #, c-format msgid "Failed to set symmetric key for encryption." msgstr "Nastavljanje simetričnega ključa za šifriranje je spodletelo." -#: ../libnm-util/crypto_nss.c:379 +#: ../libnm-util/crypto_nss.c:380 #, c-format msgid "Failed to set IV for encryption." msgstr "Nastavljanje IV za šifriranje je spodletelo." -#: ../libnm-util/crypto_nss.c:387 +#: ../libnm-util/crypto_nss.c:388 #, c-format msgid "Failed to initialize the encryption context." -msgstr "Zaganjanje vsebine šifriranja je spodletelo." +msgstr "Začenjanje vsebine šifriranja je spodletelo." -#: ../libnm-util/crypto_nss.c:395 +#: ../libnm-util/crypto_nss.c:396 #, c-format msgid "Failed to encrypt: %d." msgstr "Šifriranje je spodletelo: %d." -#: ../libnm-util/crypto_nss.c:403 +#: ../libnm-util/crypto_nss.c:404 #, c-format msgid "Unexpected amount of data after encrypting." msgstr "Nepričakovana količina podatkov po šifriranju." -#: ../libnm-util/crypto_nss.c:446 +#: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" -msgstr "Potrdila ni mogoče dekodirati: %d" +msgstr "Potrdila ni mogoče odkodirati: %d" -#: ../libnm-util/crypto_nss.c:481 +#: ../libnm-util/crypto_nss.c:482 #, c-format msgid "Couldn't convert password to UCS2: %d" msgstr "Gesla ni mogoče pretvoriti v UCS2: %d" -#: ../libnm-util/crypto_nss.c:509 +#: ../libnm-util/crypto_nss.c:510 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" -msgstr "Dekodirnika PKCS#12 ni mogoče zagnati: %d" +msgstr "Dekodirnika PKCS#12 ni mogoče začeti: %d" -#: ../libnm-util/crypto_nss.c:518 +#: ../libnm-util/crypto_nss.c:519 #, c-format msgid "Couldn't decode PKCS#12 file: %d" -msgstr "Datoteke PCKS#12 ni mogoče dekodirati: %d" +msgstr "Datoteke PCKS#12 ni mogoče odkodirati: %d" -#: ../libnm-util/crypto_nss.c:527 +#: ../libnm-util/crypto_nss.c:528 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "Datoteke PCKS#12 ni mogoče preveriti: %d" -#: ../libnm-util/crypto_nss.c:556 +#: ../libnm-util/crypto_nss.c:557 msgid "Could not generate random data." msgstr "Naključnih podatkov ni mogoče ustvariti." -#: ../libnm-util/nm-utils.c:1522 +#: ../libnm-util/nm-utils.c:1975 #, c-format msgid "Not enough memory to make encryption key." msgstr "Ni dovolj pomnilnika za ustvarjanje šifrirnega ključa." -#: ../libnm-util/nm-utils.c:1633 +#: ../libnm-util/nm-utils.c:2085 msgid "Could not allocate memory for PEM file creation." msgstr "Ni mogoče dodeliti pomnilnika za ustvarjanje datoteke PEM." -#: ../libnm-util/nm-utils.c:1645 +#: ../libnm-util/nm-utils.c:2097 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "Ni mogoče dodeliti pomnilnika za zapis IV v datoteko PEM." -#: ../libnm-util/nm-utils.c:1657 +#: ../libnm-util/nm-utils.c:2109 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "Ni mogoče dodeliti pomnilnika za zapis šifriranega ključa v datoteko PEM." -#: ../libnm-util/nm-utils.c:1676 +#: ../libnm-util/nm-utils.c:2128 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "Ni mogoče dodeliti pomnilnika za podatke datoteke PEM." -#: ../src/nm-netlink-monitor.c:194 -#: ../src/nm-netlink-monitor.c:464 -#: ../src/nm-netlink-monitor.c:569 -#: ../src/ip6-manager/nm-netlink-listener.c:352 +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Souporaba povezave preko zaščitenega WiFi omrežja" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Souporaba povezave preko odprtega WiFi omrežja" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Spremeni trajno sistemsko ime gostitelja" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +#| msgid "No active connections!" +msgid "Modify system connections" +msgstr "Spremeni sistemske povezave" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Sistemska določila onemogočajo spreminjanje sistemskih nastavitev" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "Sistemska pravila preprečujejo spremembo imena gostitelja trajnega sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "Sistemska pravila preprečujejo souporabo povezav preko zaščitenega WiFi omrežja" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "Sistemska pravila preprečujejo souporabo povezav preko odprtega WiFi omrežja" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "Dovoli nadzor omrežnih povezav" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "Dovoli uporabo posebnih uporabniških povezav." + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "Omogoči ali onemogoči naprave WiFi" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "Omogoči ali onemogoči naprave mobilnih širokopasovnih storitev" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "Omogoči ali onemogoči sistemske omrežne povezave" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 +msgid "Put NetworkManager to sleep or wake it up (should only be used by system power management)" +msgstr "Postavi program NetworkManager v mirovanje ali iz njega (možnost je namenjena upravljanju napajanja)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +msgid "System policy prevents control of network connections" +msgstr "Sistemska določila preprečujejo nadzor omrežnih povezav" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "Sistemska določila preprečujejo omogočanja ali onemogočanje WiFi naprav" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "Sistemska določila preprečuje omogočanja ali onemogočanje mobilne širokopasovne naprave" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +msgid "System policy prevents enabling or disabling system networking" +msgstr "Sistemska določila preprečujejo omogočanje ali onemogočanje omrežnih povezav." + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "Sistemska določila preprečujejo postavitev programa NetworkManager v mirovanje ali iz njega." + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +msgid "System policy prevents use of user-specific connections" +msgstr "Sistemska določila preprečujejo uporabo uporabniških povezav." + +#: ../src/nm-netlink-monitor.c:100 +#: ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format msgid "error processing netlink message: %s" msgstr "napaka med obdelovanjem sporočila netlink: %s" -#: ../src/nm-netlink-monitor.c:260 -#, c-format -#| msgid "" -#| "unable to create netlink socket for monitoring wired ethernet devices - %s" -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "ni mogoče dodeliti ročice netlink za nadziranje stanja povezave: %s" +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "med čakanjem na podatke na vtiču je prišlo do napake" -#: ../src/nm-netlink-monitor.c:270 +#: ../src/nm-netlink-monitor.c:254 #, c-format #| msgid "" #| "unable to bind to netlink socket for monitoring wired ethernet devices - %" @@ -388,41 +1714,52 @@ msgstr "ni mogoče dodeliti ročice netlink za nadziranje stanja povezave: %s" msgid "unable to connect to netlink for monitoring link status: %s" msgstr "ni se mogoče povezati z netlink za nadziranje stanja povezave: %s" -#: ../src/nm-netlink-monitor.c:278 +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "ni mogoče omogočiti ročnika netlink overjanje:% s" + +#: ../src/nm-netlink-monitor.c:291 +#: ../src/nm-netlink-monitor.c:353 #, c-format #| msgid "" -#| "unable to bind to netlink socket for monitoring wired ethernet devices - %" -#| "s" -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "ni se mogoče povezati s skupino netlink za nadziranje stanja povezave: %s" +#| "unable to create netlink socket for monitoring wired ethernet devices - %s" +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "ni mogoče dodeliti ročice netlink za nadziranje stanja povezave: %s" -#: ../src/nm-netlink-monitor.c:286 +#: ../src/nm-netlink-monitor.c:376 #, c-format #| msgid "" #| "unable to create netlink socket for monitoring wired ethernet devices - %s" msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "ni mogoče dodeliti predpomnilnika netlink povezav za nadziranje stanja povezave: %s" -#: ../src/nm-netlink-monitor.c:494 -#: ../src/ip6-manager/nm-netlink-listener.c:382 -msgid "error occurred while waiting for data on socket" -msgstr "med čakanjem na podatke na vtiču je prišlo do napake" +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "skupini netlink se ni mogoče pridružiti: %s" -#: ../src/nm-netlink-monitor.c:558 +#: ../src/nm-netlink-monitor.c:629 +#: ../src/nm-netlink-monitor.c:642 #, c-format msgid "error updating link cache: %s" msgstr "napaka med posodabljanjem predpomnilnika povezave: %s" -#: ../src/NetworkManager.c:330 +#: ../src/main.c:498 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "Neveljavna možnost. Uporabite --help za seznam veljavnih možnosti.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 +#: ../src/main.c:569 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. Uporabite --help za prikaz seznam veljavnih možnosti.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:328 msgid "# Created by NetworkManager\n" -msgstr "#Ustvaril upravljalnik omrežij\n" +msgstr "#Ustvarjeno z upravljalnikom omrežij\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:344 #, c-format msgid "" "# Merged from %s\n" @@ -431,562 +1768,48 @@ msgstr "" "# Združeno iz %s\n" "\n" -#: ../src/ip6-manager/nm-netlink-listener.c:200 +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 +msgid "no usable DHCP client could be found." +msgstr "ni mogoče najti uporabnega odjemalca DHCP." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 +msgid "'dhclient' could be found." +msgstr "'dhclient' je najden." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' ni mogoče najti." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 #, c-format -msgid "unable to allocate netlink handle: %s" -msgstr "Ročnika netlink ni mogoče dodeliti: %s" +msgid "unsupported DHCP client '%s'" +msgstr "nepodprt odjemalec DHCP '%s'" -#: ../src/ip6-manager/nm-netlink-listener.c:210 +#: ../src/logging/nm-logging.c:146 #, c-format -msgid "unable to connect to netlink: %s" -msgstr "z netlink se ni mogoče povezati: %s" +msgid "Unknown log level '%s'" +msgstr "Neznana raven beleženja '%s'" -#: ../src/ip6-manager/nm-netlink-listener.c:307 +#: ../src/logging/nm-logging.c:171 #, c-format -msgid "unable to join netlink group: %s" -msgstr "skupini netlink se ni mogoče pridružiti: %s" +msgid "Unknown log domain '%s'" +msgstr "Neznana domena beleženja '%s'" -#: ../src/dns-manager/nm-dns-manager.c:315 +#: ../src/named-manager/nm-named-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." -msgstr "OPOMBA: libc razreševalnik morda ne podpira več kot 3 imenske strežnike." +msgstr "OPOMBA: razreševalnik libc morda ne podpira več kot 3 imenskih strežnikov." -#: ../src/dns-manager/nm-dns-manager.c:317 +#: ../src/named-manager/nm-named-manager.c:386 msgid "The nameservers listed below may not be recognized." -msgstr "Imenski strežniki našteti spodaj morda ne bodo prepoznani." +msgstr "Navedeni imenski strežniki morda ne bodo prepoznani." -#: ../src/system-settings/nm-default-wired-connection.c:194 +#: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" msgstr "Samodejno %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:2406 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3412 #| msgid "Open System" msgid "System" msgstr "Sistem" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 -msgid "Connection sharing via a protected WiFi network" -msgstr "Deljene povezave preko zaščitenega WiFi omrežja" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 -msgid "Connection sharing via an open WiFi network" -msgstr "Deljene povezave preko odprtega WiFi omrežja" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 -msgid "Modify persistent system hostname" -msgstr "Spremeni trajno sistemsko ime gostitelja" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 -#| msgid "No active connections!" -msgid "Modify system connections" -msgstr "Spremeni sistemske povezave" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 -msgid "System policy prevents modification of system settings" -msgstr "Sistemska določila onemogočajo spreminjanje sistemskih nastavitev" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 -msgid "System policy prevents modification of the persistent system hostname" -msgstr "Sistemska pravila preprečujejo spremembo imena gostitelja trajnega sistema" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 -msgid "System policy prevents sharing connections via a protected WiFi network" -msgstr "Sistemska pravila preprečujejo deljenje povezav preko zaščitenega WiFi omrežja" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 -msgid "System policy prevents sharing connections via an open WiFi network" -msgstr "Sistemska pravila preprečujejo deljenje povezav preko odprtega WiFi omrežja" - -#~ msgid "Passphrase for wireless network %s" -#~ msgstr "Šifrirna fraza za brezžično omrežje %s" -#~ msgid "Connection to the wireless network '%s' failed." -#~ msgstr "Povezava z brezžičnim omrežjem %s ni uspela" -#~ msgid "Connection to the wired network failed." -#~ msgstr "Povezava z žičnim omrežjem ni uspela." -#~ msgid "Error displaying connection information:" -#~ msgstr "Napaka pri prikazovanju informacij o povezavi:" -#~ msgid "Could not find some required resources (the glade file)!" -#~ msgstr "Ni mogoče najti nekaterih zahtevanih virov (datoteke glade)!" -#~ msgid "%d Mb/s" -#~ msgstr "%d Mb/s" -#~ msgid "Wired Ethernet (%s)" -#~ msgstr "Žični eternet (%s)" -#~ msgid "Wireless Ethernet (%s)" -#~ msgstr "Brezžični eternet (%s)" -#~ msgid "Unknown" -#~ msgstr "Neznano" -#~ msgid "NetworkManager Applet" -#~ msgstr "Programček NetworkManager" -#~ msgid "" -#~ "Copyright © 2004-2006 Red Hat, Inc.\n" -#~ "Copyright © 2005-2006 Novell, Inc." -#~ msgstr "" -#~ "Copyright © 2004-2006 Red Hat, Inc.\n" -#~ "Copyright © 2005-2006 Novell, Inc." -#~ msgid "" -#~ "Notification area applet for managing your network devices and " -#~ "connections." -#~ msgstr "" -#~ "Programček za območje obvestil za upravljanje vaših mrežnih naprav in " -#~ "povezav." -#~ msgid "translator-credits" -#~ msgstr "Matic Žgur " -#~ msgid "" -#~ "Copyright © 2004-2005 Red Hat, Inc.\n" -#~ "Copyright © 2005-2006 Novell, Inc." -#~ msgstr "" -#~ "Copyright © 2004-2005 Red Hat, Inc.\n" -#~ "Copyright © 2005-2006 Novell, Inc." -#~ msgid "VPN Login Failure" -#~ msgstr "Neuspela prijava VPN" -#~ msgid "Could not start the VPN connection '%s' due to a login failure." -#~ msgstr "Ni mogoče začeti povezave VPN '%s' zaradi neuspele prijave." -#~ msgid "VPN Start Failure" -#~ msgstr "Neuspel zagon VPN" -#~ msgid "" -#~ "Could not start the VPN connection '%s' due to a failure launching the " -#~ "VPN program." -#~ msgstr "" -#~ "Ni mogoče začeti povezave VPN '%s' zaradi neuspelega zagona programa VPN." -#~ msgid "VPN Connect Failure" -#~ msgstr "Neuspela povezava VPN" -#~ msgid "Could not start the VPN connection '%s' due to a connection error." -#~ msgstr "Ni mogoče začeti povezave VPN '%s' zaradi napake pri povezavi." -#~ msgid "VPN Configuration Error" -#~ msgstr "Napaka nastavitev VPN" -#~ msgid "The VPN connection '%s' was not correctly configured." -#~ msgstr "Povezava VPN '%s' ni pravilno nastavljena." -#~ msgid "" -#~ "Could not start the VPN connection '%s' because the VPN server did not " -#~ "return an adequate network configuration." -#~ msgstr "" -#~ "Ni mogoče začeti povezave VPN '%s', ker strežnik VPN ni vrnil ustreznih " -#~ "nastavitev." -#~ msgid "VPN Login Message" -#~ msgstr "Prijavno sporočilo VPN" -#~ msgid "" -#~ "The NetworkManager Applet could not find some required resources (the " -#~ "glade file was not found)." -#~ msgstr "" -#~ "Programček NetworkManager ne more najti nekaterih zahtevanih virov " -#~ "(datoteka glade ni bila najdena)." -#~ msgid "The network device \"%s (%s)\" does not support wireless scanning." -#~ msgstr "" -#~ "Omrežna naprava \"%s (%s)\" ne podpira skeniranja brezžičnih omrežij." -#~ msgid "The network device \"%s (%s)\" does not support link detection." -#~ msgstr "Omrežna naprava \"%s (%s)\" ne podpira odkrivanja povezav." -#~ msgid "(unknown)" -#~ msgstr "(neznano)" -#~ msgid "Preparing device %s for the wired network..." -#~ msgstr "Pripravljanje naprave %s na žično omrežje ..." -#~ msgid "Preparing device %s for the wireless network '%s'..." -#~ msgstr "Pripravljanje naprave %s na rezžično omrežje '%s' ..." -#~ msgid "Configuring device %s for the wired network..." -#~ msgstr "Nastavljanje naprave %s za žično omrežje ..." -#~ msgid "Attempting to join the wireless network '%s'..." -#~ msgstr "Poskus pridruževanja brezžičnemu omrežju '%s' ..." -#~ msgid "Waiting for Network Key for the wireless network '%s'..." -#~ msgstr "Čakanje na omrežni ključ za brezžično omrežje '%s' ..." -#~ msgid "Requesting a network address from the wired network..." -#~ msgstr "Zahtevanje omrežnega naslova iz žičnega omrežja ..." -#~ msgid "Requesting a network address from the wireless network '%s'..." -#~ msgstr "Zahtevanje omrežnega naslova iz brezžičnega omrežja '%s' ..." -#~ msgid "Finishing connection to the wired network..." -#~ msgstr "Zaključevanje povezave v žično omrežje ..." -#~ msgid "Finishing connection to the wireless network '%s'..." -#~ msgstr "Zaključevanje povezave v brezžično omrežje '%s' ..." -#~ msgid "NetworkManager is not running" -#~ msgstr "NetworkManager ni zagnan" -#~ msgid "Networking disabled" -#~ msgstr "Omrežje onemogočeno" -#~ msgid "No network connection" -#~ msgstr "Nobene omrežne povezave" -#~ msgid "Wired network connection" -#~ msgstr "Žična omrežna povezava" -#~ msgid "Connected to an Ad-Hoc wireless network" -#~ msgstr "Povezan v ad-hoc brezžično omrežje" -#~ msgid "Wireless network connection to '%s' (%d%%)" -#~ msgstr "Brezžična omrežna povezava z '%s' (%d%%)" -#~ msgid "VPN connection to '%s'" -#~ msgstr "Povezave VPN z '%s'" -#~ msgid "VPN connecting to '%s'" -#~ msgstr "Povezovanje VPN z '%s'" -#~ msgid "_Connect to Other Wireless Network..." -#~ msgstr "Po_veži se v drugo brezžično omrežje ..." -#~ msgid "Create _New Wireless Network..." -#~ msgstr "_Ustvari novo brezžično omrežje ..." -#~ msgid "_VPN Connections" -#~ msgstr "_Povezave VPN" -#~ msgid "_Configure VPN..." -#~ msgstr "_Nastavi VPN ..." -#~ msgid "_Disconnect VPN..." -#~ msgstr "_Prekini povezavo z VPN ..." -#~ msgid "_Dial Up Connections" -#~ msgstr "_Klicna povezava" -#~ msgid "Connect to %s..." -#~ msgstr "Poveži se v %s ..." -#~ msgid "Disconnect from %s..." -#~ msgstr "Prekini povezavo z %s ..." -#~ msgid "No network devices have been found" -#~ msgstr "Najdena ni bila nobena omrežna naprava" -#~ msgid "NetworkManager is not running..." -#~ msgstr "NetworkManager ni zagnan ..." -#~ msgid "Enable _Networking" -#~ msgstr "Omogoči _omrežje" -#~ msgid "Enable _Wireless" -#~ msgstr "Omogoči _brezžično omrežje" -#~ msgid "Connection _Information" -#~ msgstr "_Informacije o povezavi" -#~ msgid "_Help" -#~ msgstr "_Pomoč" -#~ msgid "_About" -#~ msgstr "_O Programu" -#~ msgid "" -#~ "The NetworkManager applet could not find some required resources. It " -#~ "cannot continue.\n" -#~ msgstr "" -#~ "Programček NetworkManager ne more najti nekaterih zahtevanih virov. Ni " -#~ "mogoče nadaljevati.\n" -#~ msgid "Shared Key" -#~ msgstr "Deljeni ključ" -#~ msgid "Automatic (Default)" -#~ msgstr "Samodejno (privzeto)" -#~ msgid "AES-CCMP" -#~ msgstr "AES-CCMP" -#~ msgid "TKIP" -#~ msgstr "TKIP" -#~ msgid "Dynamic WEP" -#~ msgstr "Dinamični WEP" -#~ msgid "None" -#~ msgstr "Brez" -#~ msgid "WEP 64/128-bit ASCII" -#~ msgstr "WEP 64/128-bit ASCII" -#~ msgid "WEP 64/128-bit Hex" -#~ msgstr "WEP 64/128-bit Hex" -#~ msgid "WEP 128-bit Passphrase" -#~ msgstr "WEP 128-bit šifrirna fraza" -#~ msgid "PEAP" -#~ msgstr "PEAP" -#~ msgid "TLS" -#~ msgstr "TLS" -#~ msgid "TTLS" -#~ msgstr "TTLS" -#~ msgid "WPA2 Enterprise" -#~ msgstr "Podjetniški WPA2" -#~ msgid "WPA Enterprise" -#~ msgstr "Podjetniški WPA" -#~ msgid "WPA2 Personal" -#~ msgstr "Osebni WPA2" -#~ msgid "WPA Personal" -#~ msgstr "Osebni WPA" -#~ msgid "Orientation" -#~ msgstr "Usmerjenost" -#~ msgid "The orientation of the tray." -#~ msgstr "Usmeritev pladnja." -#~ msgid "Wired Network (%s)" -#~ msgstr "Žično omrežje (%s)" -#~ msgid "_Wired Network" -#~ msgstr "Ž_ično omrežje" -#~ msgid "Wireless Network (%s)" -#~ msgid_plural "Wireless Networks (%s)" -#~ msgstr[0] "Brezžično omrežje (%s)" -#~ msgstr[1] "Brezžični omrežji (%s)" -#~ msgstr[2] "Brezžična omrežja (%s)" -#~ msgstr[3] "Brezžična omrežja (%s)" -#~ msgid "Wireless Network" -#~ msgid_plural "Wireless Networks" -#~ msgstr[0] "Brezžično omrežje" -#~ msgstr[1] "Brezžični omrežji" -#~ msgstr[2] "Brezžična omrežja" -#~ msgstr[3] "Brezžična omrežja" -#~ msgid " (invalid Unicode)" -#~ msgstr " (neveljaven Unicode)" -#~ msgid "" -#~ "By default, the wireless network's name is set to your computer's name, %" -#~ "s, with no encryption enabled" -#~ msgstr "" -#~ "Privzeto je ime brezžičnega omrežja nastavljeno na ime vašega " -#~ "računalnika, %s, brez omogočenega šifriranja" -#~ msgid "Create new wireless network" -#~ msgstr "Ustvari novo brezžično omrežje" -#~ msgid "" -#~ "Enter the name and security settings of the wireless network you wish to " -#~ "create." -#~ msgstr "" -#~ "Vnesite ime in varnostne nastavitve brezžičnega omrežja, ki ga želite " -#~ "ustvariti." -#~ msgid "Create New Wireless Network" -#~ msgstr "Ustvari novo brezžično omrežje" -#~ msgid "Existing wireless network" -#~ msgstr "Obstoječe brezžično omrežje" -#~ msgid "Enter the name of the wireless network to which you wish to connect." -#~ msgstr "Vnesite ime brezžičnega omrežja, v katerega se želite povezati." -#~ msgid "Connect to Other Wireless Network" -#~ msgstr "Poveži se v drugo brezžično omrežje" -#~ msgid "Error connecting to wireless network" -#~ msgstr "Napaka pri povezovanju z brezžičnim omrežjem" -#~ msgid "" -#~ "The requested wireless network requires security capabilities unsupported " -#~ "by your hardware." -#~ msgstr "" -#~ "Zahtevano brezžično omrežje zahteva varnostne zmožnosti, ki so nepodprte " -#~ "z vašo strojno opremo." -#~ msgid "Cannot start VPN connection '%s'" -#~ msgstr "Ni mogoče začeti povezave VPN '%s'" -#~ msgid "" -#~ "Could not find the authentication dialog for VPN connection type '%s'. " -#~ "Contact your system administrator." -#~ msgstr "" -#~ "Ni mogoče najti pogovornega okna za overitev za povezavo VPN vrste '%s'. " -#~ "Kontaktirajte sistemskega administratorja." -#~ msgid "" -#~ "There was a problem launching the authentication dialog for VPN " -#~ "connection type '%s'. Contact your system administrator." -#~ msgstr "" -#~ "Pri zagonu pogovornega okna za overovitev za povezavo VPN vrste '%s' je " -#~ "prišlo do problema. Kontaktirajte sistemskega administratorja." -#~ msgid " " -#~ msgstr " " -#~ msgid "" -#~ "Active Connection Information" -#~ msgstr "" -#~ "Informacije o aktivni povezavi" -#~ msgid "" -#~ "Passphrase Required by Wireless " -#~ "Network\n" -#~ "\n" -#~ "A passphrase or encryption key is required to access the wireless network " -#~ "'%s'." -#~ msgstr "" -#~ "Šifrirna fraza, ki jo zahteva " -#~ "brezžično omrežje\n" -#~ "\n" -#~ "Za dostop do brezžičnega omrežja '%s' je zahtevana šifrirna fraza ali " -#~ "šifrirni ključ." -#~ msgid "" -#~ "Reduced Network Functionality\n" -#~ "\n" -#~ "%s It will not be completely functional." -#~ msgstr "" -#~ "Zmanjšana uporabnost omrežja\n" -#~ "\n" -#~ "%s ne bo popolnoma uporaben." -#~ msgid "" -#~ "Wireless Network Login " -#~ "Confirmation\n" -#~ "\n" -#~ "You have chosen to log in to the wireless network '%s'. If you are sure " -#~ "that this wireless network is secure, click the checkbox below and " -#~ "NetworkManager will not require confirmation on subsequent log ins." -#~ msgstr "" -#~ "Potrditev prijave v brezžično " -#~ "omrežje\n" -#~ "\n" -#~ "Izbrali ste prijavo v brezžično omrežje '%s'. Če ste prepričani, da je to " -#~ "brezžično omrežje varno, kliknite potrditveno polje spodaj in " -#~ "NetworkManager ne bo več zahteval potrditve za nadaljnje prijave." -#~ msgid "Anonymous Identity:" -#~ msgstr "Anonimna identiteta:" -#~ msgid "Authentication:" -#~ msgstr "Overovitev:" -#~ msgid "Broadcast Address:" -#~ msgstr "Naslov za razpršeno oddajanje:" -#~ msgid "CA Certificate File:" -#~ msgstr "Datoteka overiteljevega (CA) certifikata:" -#~ msgid "C_onnect" -#~ msgstr "Po_veži se" -#~ msgid "Client Certificate File:" -#~ msgstr "Datoteka odjemalčevega certifikata:" -#~ msgid "Connection Information" -#~ msgstr "Informacije o povezavi" -#~ msgid "Default Route:" -#~ msgstr "Privzeta smer:" -#~ msgid "Destination Address:" -#~ msgstr "Ciljni naslov:" -#~ msgid "Driver:" -#~ msgstr "Gonilnik:" -#~ msgid "EAP Method:" -#~ msgstr "Metoda EAP:" -#~ msgid "Hardware Address:" -#~ msgstr "Naslov strojne opreme:" -#~ msgid "IP Address:" -#~ msgstr "IP naslov:" -#~ msgid "Identity:" -#~ msgstr "Identiteta:" -#~ msgid "Interface:" -#~ msgstr "Vmesnik:" -#~ msgid "Key Type:" -#~ msgstr "Vrsta ključa:" -#~ msgid "Key management:" -#~ msgstr "Upravljanje s ključi:" -#~ msgid "Key:" -#~ msgstr "Ključ:" -#~ msgid "" -#~ "None\n" -#~ "WEP 128-bit Passphrase\n" -#~ "WEP 64/128-bit Hex\n" -#~ "WEP 64/128-bit ASCII\n" -#~ msgstr "" -#~ "Brez\n" -#~ "WEP 128-bit šifrirna fraza\n" -#~ "WEP 64/128-bit Hex\n" -#~ "WEP 64/128-bit ASCII\n" -#~ msgid "" -#~ "Open System\n" -#~ "Shared Key" -#~ msgstr "" -#~ "Odprti sistem\n" -#~ "Deljeni ključ" -#~ msgid "Other Wireless Network..." -#~ msgstr "Drugo brezžično omrežje ..." -#~ msgid "Passphrase:" -#~ msgstr "Šifrirna fraza:" -#~ msgid "Password:" -#~ msgstr "Geslo:" -#~ msgid "Primary DNS:" -#~ msgstr "Primarni DNS;" -#~ msgid "Private Key File:" -#~ msgstr "Datoteka zasebnega ključa:" -#~ msgid "Private Key Password:" -#~ msgstr "Geslo zasebnega ključa:" -#~ msgid "Secondary DNS:" -#~ msgstr "Sekundarni DNS:" -#~ msgid "Select the CA Certificate File" -#~ msgstr "Izberite datoteko overiteljevega (CA) certifikata" -#~ msgid "Select the Client Certificate File" -#~ msgstr "Izberite datoteko odjemalčevega certifikata" -#~ msgid "Select the Private Key File" -#~ msgstr "Izberite datoteko zasebnega ključa" -#~ msgid "Show key" -#~ msgstr "Pokaži ključ" -#~ msgid "Show passphrase" -#~ msgstr "Pokaži šifrirno frazo" -#~ msgid "Show password" -#~ msgstr "Pokaži geslo" -#~ msgid "Show passwords" -#~ msgstr "Pokaži gesla" -#~ msgid "Speed:" -#~ msgstr "Hitrost:" -#~ msgid "Subnet Mask:" -#~ msgstr "Maska podomrežja:" -#~ msgid "Type:" -#~ msgstr "Vrsta:" -#~ msgid "User Name:" -#~ msgstr "Uporabniško ime:" -#~ msgid "Wireless Network Key Required" -#~ msgstr "Zahtevan ključ brezžičnega omrežja" -#~ msgid "Wireless _adapter:" -#~ msgstr "Brezžični _vmesnik:" -#~ msgid "_Always Trust this Wireless Network" -#~ msgstr "Vedno _zaupaj temu brezžičnemu omrežju" -#~ msgid "_Don't remind me again" -#~ msgstr "_Ne spomni me več" -#~ msgid "_Login to Network" -#~ msgstr "_Prijava v omrežje" -#~ msgid "_Network Name:" -#~ msgstr "_Ime omrežja:" -#~ msgid "_Wireless Security:" -#~ msgstr "_Zaščita omrežja:" -#~ msgid "Cannot add VPN connection" -#~ msgstr "Ni mogoče dodati povezave VPN" -#~ msgid "" -#~ "No suitable VPN software was found on your system. Contact your system " -#~ "administrator." -#~ msgstr "" -#~ "Ustrezna programska oprema za VPN ni bila najdena na vašem sistemu. " -#~ "Kontaktirajte vašega sistemskega administratorja." -#~ msgid "Cannot import VPN connection" -#~ msgstr "Ni mogoče uvoziti povezave VPN" -#~ msgid "" -#~ "Cannot find suitable software for VPN connection type '%s' to import the " -#~ "file '%s'. Contact your system administrator." -#~ msgstr "" -#~ "Ni mogoče najti ustrezne programske opreme za povezavo VPN vrste '%s' za " -#~ "uvoz datoteke '%s'. Kontaktirajte vašega sistemskega administratorja." -#~ msgid "Error retrieving VPN connection '%s'" -#~ msgstr "Napaka pri pridobivanju povezave VPN '%s'" -#~ msgid "" -#~ "Could not find the UI files for VPN connection type '%s'. Contact your " -#~ "system administrator." -#~ msgstr "" -#~ "Ni mogoče najti datotek uporabniškega vmesnika za povezavo VPN vrste \"%s" -#~ "\". Kontaktirajte vašega sistemskega administratorja." -#~ msgid "Delete VPN connection \"%s\"?" -#~ msgstr "Ali želite izbrisati povezavo VPN \"%s\"?" -#~ msgid "" -#~ "All information about the VPN connection \"%s\" will be lost and you may " -#~ "need your system administrator to provide information to create a new " -#~ "connection." -#~ msgstr "" -#~ "Vse informacije o povezavi VPN \"%s\" bodo izgubljene in mogoče boste " -#~ "potrebovali vašega sistemskega administratorja, da vam priskrbi " -#~ "informacije za ustvarjanje nove povezave." -#~ msgid "Unable to load" -#~ msgstr "Ni mogoče naložiti" -#~ msgid "Cannot find some needed resources (the glade file)!" -#~ msgstr "Ni mogoče najti nekaterih potrebnih virov (datoteke glade)!" -#~ msgid "Create VPN Connection" -#~ msgstr "Ustvari povezavo VPN" -#~ msgid "Edit VPN Connection" -#~ msgstr "Uredi povezavo VPN" -#~ msgid "Add a new VPN connection" -#~ msgstr "Dodaj novo povezavo VPN" -#~ msgid "Delete the selected VPN connection" -#~ msgstr "Izbriši izbrano povezavo VPN" -#~ msgid "E_xport" -#~ msgstr "I_zvozi" -#~ msgid "Edit the selected VPN connection" -#~ msgstr "Uredi izbrano povezavo VPN" -#~ msgid "Export the VPN settings to a file" -#~ msgstr "Izvozi nastavitve VPN v datoteko" -#~ msgid "Export the selected VPN connection to a file" -#~ msgstr "Izvozi izbrano povezavo VPN v datoteko" -#~ msgid "Manage Virtual Private Network Connections" -#~ msgstr "Upravljanje povezav navideznega zasebnega omrežja (VPN)" -#~ msgid "VPN Connections" -#~ msgstr "Povezave VPN" -#~ msgid "40-bit WEP" -#~ msgstr "40-bitni WEP" -#~ msgid "104-bit WEP" -#~ msgstr "104-bitni WEP" -#~ msgid "WPA TKIP" -#~ msgstr "WPA TKIP" -#~ msgid "WPA CCMP" -#~ msgstr "WPA CCMP" -#~ msgid "WPA Automatic" -#~ msgstr "Samodejni WPA" -#~ msgid "WPA2 TKIP" -#~ msgstr "WPA2 TKIP" -#~ msgid "WPA2 CCMP" -#~ msgstr "WPA2 CCMP" -#~ msgid "WPA2 Automatic" -#~ msgstr "Samodejni WPA2" -#~ msgid "none" -#~ msgstr "brez" -#~ msgid "operation took too long" -#~ msgstr "operacija je trajala predolgo" -#~ msgid "received data from wrong type of sender" -#~ msgstr "prejeti podatki od pošiljatelja napačne vrste" -#~ msgid "received data from unexpected sender" -#~ msgstr "prejeti podatki od nepričakovanega pošiljatelja" -#~ msgid "too much data was sent over socket and some of it was lost" -#~ msgstr "" -#~ "preveč podatkov je bilo poslano preko vtiča in nekaj se jih je izgubilo" -#~ msgid "You are now connected to the Ad-Hoc wireless network '%s'." -#~ msgstr "Zdaj ste povezani v ad-hoc brezžično omrežje '%s'." -#~ msgid "You are now connected to the wireless network '%s'." -#~ msgstr "Zdaj ste povezani z brezžičnim omrežjem '%s'." -#~ msgid "You are now connected to the wired network." -#~ msgstr "Zdaj ste povezani z žičnim omrežjem." -#~ msgid "Connection Established" -#~ msgstr "Povezava vzpostavljena" -#~ msgid "Disconnected" -#~ msgstr "Prekinjena povezava" -#~ msgid "The network connection has been disconnected." -#~ msgstr "Omrežna povezava je bila prekinjena." -#~ msgid "LEAP" -#~ msgstr "LEAP" - -- cgit v1.2.1 From 8b9e13b68507c97781772cab126cd14be5de0435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 20 Sep 2010 15:05:47 +0200 Subject: cli: add D-Bus object path field for connections' list (e.g.: nmcli -f name,dbus-path con list) --- cli/src/connections.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cli/src/connections.c b/cli/src/connections.c index 9a20753391..cd1318eaf7 100644 --- a/cli/src/connections.c +++ b/cli/src/connections.c @@ -80,9 +80,10 @@ static NmcOutputField nmc_fields_con_list[] = { {"TIMESTAMP-REAL", N_("TIMESTAMP-REAL"), 34, NULL, 0}, /* 5 */ {"AUTOCONNECT", N_("AUTOCONNECT"), 13, NULL, 0}, /* 6 */ {"READONLY", N_("READONLY"), 10, NULL, 0}, /* 7 */ + {"DBUS-PATH", N_("DBUS-PATH"), 42, NULL, 0}, /* 8 */ {NULL, NULL, 0, NULL, 0} }; -#define NMC_FIELDS_CON_LIST_ALL "NAME,UUID,TYPE,SCOPE,TIMESTAMP,TIMESTAMP-REAL,AUTOCONNECT,READONLY" +#define NMC_FIELDS_CON_LIST_ALL "NAME,UUID,TYPE,SCOPE,TIMESTAMP,TIMESTAMP-REAL,AUTOCONNECT,READONLY,DBUS-PATH" #define NMC_FIELDS_CON_LIST_COMMON "NAME,UUID,TYPE,SCOPE,TIMESTAMP-REAL" @@ -376,6 +377,7 @@ show_connection (NMConnection *data, gpointer user_data) timestamp = nm_setting_connection_get_timestamp (s_con); timestamp_str = g_strdup_printf ("%" G_GUINT64_FORMAT, timestamp); strftime (timestamp_real_str, sizeof (timestamp_real_str), "%c", localtime ((time_t *) ×tamp)); + nmc->allowed_fields[0].value = nm_setting_connection_get_id (s_con); nmc->allowed_fields[1].value = nm_setting_connection_get_uuid (s_con); nmc->allowed_fields[2].value = nm_setting_connection_get_connection_type (s_con); @@ -384,6 +386,7 @@ show_connection (NMConnection *data, gpointer user_data) nmc->allowed_fields[5].value = timestamp ? timestamp_real_str : _("never"); nmc->allowed_fields[6].value = nm_setting_connection_get_autoconnect (s_con) ? _("yes") : _("no"); nmc->allowed_fields[7].value = nm_setting_connection_get_read_only (s_con) ? _("yes") : _("no"); + nmc->allowed_fields[8].value = nm_connection_get_path (connection); nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER_ADD & ~NMC_PF_FLAG_MAIN_HEADER_ONLY & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ print_fields (nmc->print_fields, nmc->allowed_fields); -- cgit v1.2.1 From 45053868f8fa21a3ac7075a6cc3a5e76c12ca66c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Gonz=C3=A1lez?= Date: Mon, 20 Sep 2010 11:26:50 -0500 Subject: po: update Spanish translation (bgo #629977) --- po/es.po | 316 +++++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 188 insertions(+), 128 deletions(-) diff --git a/po/es.po b/po/es.po index 36b63833b0..d002f77513 100644 --- a/po/es.po +++ b/po/es.po @@ -15,8 +15,8 @@ msgstr "" "Project-Id-Version: es\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-08-10 03:25+0000\n" -"PO-Revision-Date: 2010-08-16 21:27+0200\n" +"POT-Creation-Date: 2010-09-17 15:25+0000\n" +"PO-Revision-Date: 2010-09-18 11:01+0200\n" "Last-Translator: Jorge González \n" "Language-Team: Español \n" "MIME-Version: 1.0\n" @@ -118,12 +118,12 @@ msgstr "" #: ../cli/src/connections.c:198 ../cli/src/connections.c:537 #, c-format msgid "Error: 'con list': %s" -msgstr "Error: 'con list': %s" +msgstr "Error: «con list»: %s" #: ../cli/src/connections.c:200 ../cli/src/connections.c:539 #, c-format msgid "Error: 'con list': %s; allowed fields: %s" -msgstr "Error: 'con list': %s; campos permitidos: %s" +msgstr "Error: «con list»: %s; campos permitidos: %s" #: ../cli/src/connections.c:208 msgid "Connection details" @@ -219,7 +219,7 @@ msgid "Error: no valid parameter specified." msgstr "Error: no se especificó un parámetro válido." #: ../cli/src/connections.c:544 ../cli/src/connections.c:1577 -#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:274 +#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:359 #, c-format msgid "Error: %s." msgstr "Error: %s." @@ -227,12 +227,12 @@ msgstr "Error: %s." #: ../cli/src/connections.c:650 #, c-format msgid "Error: 'con status': %s" -msgstr "Error: 'con status': %s" +msgstr "Error: «con status»: %s" #: ../cli/src/connections.c:652 #, c-format msgid "Error: 'con status': %s; allowed fields: %s" -msgstr "Error: 'con status': %s; campos permitidos: %s" +msgstr "Error: «con status»: %s; campos permitidos: %s" #: ../cli/src/connections.c:659 msgid "Active connections" @@ -241,22 +241,22 @@ msgstr "Conexiones activas" #: ../cli/src/connections.c:1027 #, c-format msgid "no active connection on device '%s'" -msgstr "conexión no activa en dispositivo '%s'" +msgstr "conexión no activa en el dispositivo «%s»" #: ../cli/src/connections.c:1035 #, c-format msgid "no active connection or device" -msgstr "conexión o dispositivo no activos" +msgstr "conexión o dispositivo no activo" #: ../cli/src/connections.c:1085 #, c-format msgid "device '%s' not compatible with connection '%s'" -msgstr "dispositivo '%s' incompatible con conexión '%s'" +msgstr "dispositivo «%s» incompatible con conexión «%s»" #: ../cli/src/connections.c:1087 #, c-format msgid "no device found for connection '%s'" -msgstr "no se encontró dispositivo para conexión '%s'" +msgstr "no se encontró dispositivo para conexión «%s»" #: ../cli/src/connections.c:1098 msgid "activating" @@ -268,8 +268,8 @@ msgstr "activada" #: ../cli/src/connections.c:1103 ../cli/src/connections.c:1126 #: ../cli/src/connections.c:1159 ../cli/src/devices.c:246 -#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:92 -#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:473 +#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:149 ../cli/src/settings.c:473 msgid "unknown" msgstr "desconocido" @@ -287,7 +287,7 @@ msgstr "Conectando VPN" #: ../cli/src/connections.c:1118 msgid "VPN connecting (getting IP configuration)" -msgstr "Conectando VPN (Obteniendo configuración IP)" +msgstr "Conectando VPN (obteniendo configuración IP)" #: ../cli/src/connections.c:1120 msgid "VPN connected" @@ -295,7 +295,7 @@ msgstr "VPN conectada" #: ../cli/src/connections.c:1122 msgid "VPN connection failed" -msgstr "Conexión VPN falló" +msgstr "Falló la conexión VPN" #: ../cli/src/connections.c:1124 msgid "VPN disconnected" @@ -315,19 +315,19 @@ msgstr "el usuario estaba desconectado" #: ../cli/src/connections.c:1141 msgid "the base network connection was interrupted" -msgstr "la conexión de red de base fue interrumpida" +msgstr "se interrumpió la conexión de red de base" #: ../cli/src/connections.c:1143 msgid "the VPN service stopped unexpectedly" -msgstr "El servicio VPN se detuvo inesperadamente" +msgstr "el servicio VPN se detuvo inesperadamente" #: ../cli/src/connections.c:1145 msgid "the VPN service returned invalid configuration" -msgstr "El servicio VPN retornó configuración inválida" +msgstr "el servicio VPN retornó una configuración no válida" #: ../cli/src/connections.c:1147 msgid "the connection attempt timed out" -msgstr "El intento de conexión se agotó" +msgstr "se agotaron los intentos de conexión" #: ../cli/src/connections.c:1149 msgid "the VPN service did not start in time" @@ -347,7 +347,7 @@ msgstr "secretos VPN válidos" #: ../cli/src/connections.c:1157 msgid "the connection was removed" -msgstr "la conexión fue eliminada" +msgstr "se eliminó la conexión" #: ../cli/src/connections.c:1171 #, c-format @@ -362,7 +362,7 @@ msgstr "Conexión activada\n" #: ../cli/src/connections.c:1177 #, c-format msgid "Error: Connection activation failed." -msgstr "Error: Activación de conexión falló." +msgstr "Error: falló la activación de la conexión." #: ../cli/src/connections.c:1196 #, c-format @@ -372,72 +372,72 @@ msgstr "estado: %s (%d)\n" #: ../cli/src/connections.c:1206 #, c-format msgid "Error: Connection activation failed: %s." -msgstr "Error: Activación de conexión falló: %s." +msgstr "Error: falló la activación de la conexión: %s." #: ../cli/src/connections.c:1223 ../cli/src/devices.c:909 #, c-format msgid "Error: Timeout %d sec expired." -msgstr "Error: Pausa de %d segundos expiró." +msgstr "Error: expiró la pausa de %d segundos." #: ../cli/src/connections.c:1266 #, c-format msgid "Error: Connection activation failed: %s" -msgstr "Error: Activación de conexión falló: %s" +msgstr "Error: falló la activación de la conexión: %s" #: ../cli/src/connections.c:1280 #, c-format msgid "Error: Obtaining active connection for '%s' failed." -msgstr "Error: Obtención de conexión activa para '%s' falló." +msgstr "Error: falló la obtención de conexión activa para «%s»." #: ../cli/src/connections.c:1289 #, c-format msgid "Active connection state: %s\n" -msgstr "Estado de conexión activa: %s\n" +msgstr "Estado de la conexión activa: %s\n" #: ../cli/src/connections.c:1290 #, c-format msgid "Active connection path: %s\n" -msgstr "Ruta de conexión activa: %s\n" +msgstr "Ruta de la conexión activa: %s\n" #: ../cli/src/connections.c:1344 ../cli/src/connections.c:1465 #, c-format msgid "Error: Unknown connection: %s." -msgstr "Error: Conexión desconocida: %s." +msgstr "Error: conexión desconocida: %s." #: ../cli/src/connections.c:1379 ../cli/src/devices.c:980 #, c-format msgid "Error: timeout value '%s' is not valid." -msgstr "Error: valor de pausa '%s' inválido." +msgstr "Error: valor de pausa «%s» inválido." #: ../cli/src/connections.c:1392 ../cli/src/connections.c:1482 #, c-format msgid "Error: id or uuid has to be specified." -msgstr "Error: id o uuid ha sido especificado." +msgstr "Error: se debe especificar un id o uuid." #: ../cli/src/connections.c:1412 #, c-format msgid "Error: No suitable device found: %s." -msgstr "Error: Dispositivo inapropiado: %s." +msgstr "Error: no se encontró un dispositivo apropiado: %s." #: ../cli/src/connections.c:1414 #, c-format msgid "Error: No suitable device found." -msgstr "Error: Dispositivo no apropiado." +msgstr "Error: no se encontró un dispositivo apropiado." #: ../cli/src/connections.c:1509 #, c-format msgid "Warning: Connection not active\n" -msgstr "Advertencia: Conexión inactiva\n" +msgstr "Advertencia: conexión inactiva\n" #: ../cli/src/connections.c:1566 #, c-format msgid "Error: 'con' command '%s' is not valid." -msgstr "Error: comando 'con' '%s' es inválido." +msgstr "Error: comando «con» «%s» no es válido." #: ../cli/src/connections.c:1602 #, c-format msgid "Error: could not connect to D-Bus." -msgstr "Error: no se pudo conectar a D-Bus." +msgstr "Error: no se pudo conectar con D-Bus." #: ../cli/src/connections.c:1609 #, c-format @@ -453,7 +453,7 @@ msgstr "Error: No se pudo obtener configuración de usuario." #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "" -"Error: No se pudieron obtener conexiones: servicios de configuración no se " +"Error: no se pudieron obtener conexiones: servicios de configuración no se " "están ejecutando." #. 0 @@ -506,13 +506,11 @@ msgstr "DNS IP4" #. 6 #: ../cli/src/devices.c:79 -#| msgid "IP4-SETTINGS" msgid "IP6-SETTINGS" msgstr "CONFIGURACIONES IP6" #. 7 #: ../cli/src/devices.c:80 -#| msgid "IP4-DNS" msgid "IP6-DNS" msgstr "DNS IP6" @@ -667,7 +665,7 @@ msgstr "sin gestión" msgid "unavailable" msgstr "no disponible" -#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:89 +#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:91 msgid "disconnected" msgstr "desconectado" @@ -687,7 +685,7 @@ msgstr "conectando (necesita autenticación)" msgid "connecting (getting IP configuration)" msgstr "conectando (obteniendo configuración IP)" -#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:87 +#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:89 msgid "connected" msgstr "conectado" @@ -749,16 +747,16 @@ msgstr "Infraestructura" #: ../cli/src/devices.c:486 #, c-format msgid "Error: 'dev list': %s" -msgstr "Error: 'dev list': %s" +msgstr "Error: «dev list»: %s" #: ../cli/src/devices.c:488 #, c-format msgid "Error: 'dev list': %s; allowed fields: %s" -msgstr "Error: 'dev list': %s; campos permitidos: %s" +msgstr "Error: «dev list»: %s; campos permitidos: %s" #: ../cli/src/devices.c:497 msgid "Device details" -msgstr "Detalles de dispositivos" +msgstr "Detalles de los dispositivos" #: ../cli/src/devices.c:527 ../cli/src/devices.c:925 msgid "(unknown)" @@ -786,81 +784,81 @@ msgstr "apagado" #: ../cli/src/devices.c:808 #, c-format msgid "Error: 'dev status': %s" -msgstr "Error: 'dev status': %s" +msgstr "Error: «dev status»: %s" #: ../cli/src/devices.c:810 #, c-format msgid "Error: 'dev status': %s; allowed fields: %s" -msgstr "Error: 'dev status': %s; campos permitidos: %s" +msgstr "Error: «dev status»: %s; campos permitidos: %s" #: ../cli/src/devices.c:817 msgid "Status of devices" -msgstr "Estado de dispositivos" +msgstr "Estado de los dispositivos" #: ../cli/src/devices.c:845 #, c-format msgid "Error: '%s' argument is missing." -msgstr "Error: '%s' falta argumento." +msgstr "Error: falta el argumento «%s»." #: ../cli/src/devices.c:874 ../cli/src/devices.c:1013 #: ../cli/src/devices.c:1136 #, c-format msgid "Error: Device '%s' not found." -msgstr "Error: Dispositivo '%s' no encontrado." +msgstr "Error: no se encontró el dispositivo «%s»." #: ../cli/src/devices.c:897 #, c-format msgid "Success: Device '%s' successfully disconnected." -msgstr "Éxito: Dispositivo '%s' desconectado correctamente." +msgstr "Éxito: dispositivo «%s» desconectado correctamente." #: ../cli/src/devices.c:922 #, c-format msgid "Error: Device '%s' (%s) disconnecting failed: %s" -msgstr "Error: Desconexión de dispositivo '%s' (%s) falló: %s" +msgstr "Error: falló la desconexión del dispositivo «%s» (%s): %s" #: ../cli/src/devices.c:930 #, c-format msgid "Device state: %d (%s)\n" -msgstr "Estado de dispositivo: %d (%s)\n" +msgstr "Estado del dispositivo: %d (%s)\n" #: ../cli/src/devices.c:994 #, c-format msgid "Error: iface has to be specified." -msgstr "Error: iface tiene que especificarse." +msgstr "Error: se debe especificar iface." #: ../cli/src/devices.c:1112 #, c-format msgid "Error: 'dev wifi': %s" -msgstr "Error: 'dev wifi' '%s'" +msgstr "Error: «dev wifi» «%s»" #: ../cli/src/devices.c:1114 #, c-format msgid "Error: 'dev wifi': %s; allowed fields: %s" -msgstr "Error: 'dev wifi': %s; campos permitidos: %s" +msgstr "Error: «dev wifi»: %s; campos permitidos: %s" #: ../cli/src/devices.c:1121 msgid "WiFi scan list" -msgstr "lista de scan WiFi" +msgstr "lista de análisis WiFi" #: ../cli/src/devices.c:1156 ../cli/src/devices.c:1210 #, c-format msgid "Error: Access point with hwaddr '%s' not found." -msgstr "Error: Punto de acceso con hwaddr '%s' no se encontró." +msgstr "Error: no se encontró el punto de acceso con hwaddr «%s»." #: ../cli/src/devices.c:1173 #, c-format msgid "Error: Device '%s' is not a WiFi device." -msgstr "Error: Dispositivo '%s' no es un dispositivo WiFi." +msgstr "Error: el dispositivo «%s» no es un dispositivo WiFi." #: ../cli/src/devices.c:1237 #, c-format msgid "Error: 'dev wifi' command '%s' is not valid." -msgstr "Error: comando 'dev wifi' '%s' inválido." +msgstr "Error: comando «dev wifi» «%s» inválido." #: ../cli/src/devices.c:1284 #, c-format msgid "Error: 'dev' command '%s' is not valid." -msgstr "Error: comando 'dev' '%s' inválido." +msgstr "Error: comando «dev» «%s» no válido." #: ../cli/src/network-manager.c:35 msgid "RUNNING" @@ -868,119 +866,180 @@ msgstr "EJECUTANDO" #. 1 #: ../cli/src/network-manager.c:37 -msgid "WIFI-HARDWARE" -msgstr "HARDWARE-WIFI" +msgid "NET-ENABLED" +msgstr "RED-ACTIVADA" #. 2 #: ../cli/src/network-manager.c:38 -msgid "WIFI" -msgstr "WIFI" +msgid "WIFI-HARDWARE" +msgstr "HARDWARE-WIFI" #. 3 #: ../cli/src/network-manager.c:39 -msgid "WWAN-HARDWARE" -msgstr "HARDWARE-WWAN" +msgid "WIFI" +msgstr "WIFI" #. 4 #: ../cli/src/network-manager.c:40 +msgid "WWAN-HARDWARE" +msgstr "HARDWARE-WWAN" + +#. 5 +#: ../cli/src/network-manager.c:41 msgid "WWAN" msgstr "WWAN" -#: ../cli/src/network-manager.c:62 -#, c-format +#: ../cli/src/network-manager.c:64 +#, c-format +#| msgid "" +#| "Usage: nmcli nm { COMMAND | help }\n" +#| "\n" +#| " COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +#| "\n" +#| " status\n" +#| " sleep\n" +#| " wakeup\n" +#| " wifi [on|off]\n" +#| " wwan [on|off]\n" +#| "\n" msgid "" "Usage: nmcli nm { COMMAND | help }\n" "\n" -" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +" COMMAND := { status | enable | sleep | wifi | wwan }\n" "\n" " status\n" -" sleep\n" -" wakeup\n" +" enable [true|false]\n" +" sleep [true|false]\n" " wifi [on|off]\n" " wwan [on|off]\n" "\n" msgstr "" "Uso: nmcli nm { COMANDO | ayuda }\n" "\n" -" COMANDO := { status | sleep | wakeup | wifi | wwan }\n" +" COMANDO := { status | enable | sleep | wakeup | wifi | wwan }\n" "\n" -" estatus\n" +" estado\n" +" activar [cierto|falso]\n" " dormir\n" " despertar\n" " wifi [encendido|apagado]\n" " wwan [encendido|apagado]\n" "\n" -#: ../cli/src/network-manager.c:83 +#: ../cli/src/network-manager.c:85 msgid "asleep" msgstr "dormido" -#: ../cli/src/network-manager.c:85 +#: ../cli/src/network-manager.c:87 msgid "connecting" msgstr "conectando" -#: ../cli/src/network-manager.c:125 +#: ../cli/src/network-manager.c:128 #, c-format msgid "Error: 'nm status': %s" -msgstr "Error: 'nm status': %s" +msgstr "Error: «nm status»: %s" -#: ../cli/src/network-manager.c:127 +#: ../cli/src/network-manager.c:130 #, c-format msgid "Error: 'nm status': %s; allowed fields: %s" -msgstr "Error: 'nm status': %s; campos permitidos: %s" +msgstr "Error: «nm status»: %s; campos permitidos: %s" -#: ../cli/src/network-manager.c:134 +#: ../cli/src/network-manager.c:137 msgid "NetworkManager status" msgstr "Estado de NetworkManager" #. Print header -#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 -#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 -#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +#: ../cli/src/network-manager.c:144 ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 ../cli/src/network-manager.c:328 msgid "enabled" -msgstr "habilitado" +msgstr "activado" -#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 -#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 -#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +#: ../cli/src/network-manager.c:144 ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 ../cli/src/network-manager.c:328 msgid "disabled" -msgstr "inhabilitado" +msgstr "desactivado" -#: ../cli/src/network-manager.c:148 +#: ../cli/src/network-manager.c:152 msgid "running" msgstr "ejecutando" -#: ../cli/src/network-manager.c:148 +#: ../cli/src/network-manager.c:152 msgid "not running" msgstr "no ejecutando" -#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#: ../cli/src/network-manager.c:175 +#, c-format +#| msgid "Error: could not connect to D-Bus." +msgid "Error: Couldn't connect to system bus: %s" +msgstr "Error: no se pudo conectar con el bus del sistema: %s" + +#: ../cli/src/network-manager.c:186 +#, c-format +#| msgid "Error: could not connect to D-Bus." +msgid "Error: Couldn't create D-Bus object proxy." +msgstr "Error: no se pudo crear un objeto proxy en D-Bus." + +#: ../cli/src/network-manager.c:192 +#, c-format +#| msgid "Error: 'con list': %s" +msgid "Error in sleep: %s" +msgstr "Error al dormir: %s" + +#: ../cli/src/network-manager.c:237 ../cli/src/network-manager.c:286 +#: ../cli/src/network-manager.c:318 #, c-format msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" -msgstr "Error: '--fields' valor '%s' no es válido aquí; campos permitidos: %s" +msgstr "Error: «--fields» valor «%s» no es válido aquí; campos permitidos: %s" + +#: ../cli/src/network-manager.c:245 +#| msgid "WiFi enabled" +msgid "Networking enabled" +msgstr "Red activada" + +#: ../cli/src/network-manager.c:256 +#, c-format +#| msgid "Error: invalid 'wwan' parameter: '%s'." +msgid "Error: invalid 'enable' parameter: '%s'; use 'true' or 'false'." +msgstr "Error: parámetro «enable» inválido: «%s»; use «true» o «false»." + +#: ../cli/src/network-manager.c:265 +#, c-format +#| msgid "Error: Could not connect to NetworkManager." +msgid "Error: Sleeping status is not exported by NetworkManager." +msgstr "Error: NetworkManager no exporta el estado para dormir." + +#: ../cli/src/network-manager.c:273 +#, c-format +#| msgid "Error: invalid 'wifi' parameter: '%s'." +msgid "Error: invalid 'sleep' parameter: '%s'; use 'true' or 'false'." +msgstr "Error: parámetro «wifi» inválido: «%s»." -#: ../cli/src/network-manager.c:209 +#: ../cli/src/network-manager.c:294 msgid "WiFi enabled" -msgstr "WiFi habilitado" +msgstr "WiFi activado" -#: ../cli/src/network-manager.c:220 +#: ../cli/src/network-manager.c:305 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." -msgstr "Error: parámetro 'wifi' inválido: '%s'." +msgstr "Error: parámetro «wifi» inválido: «%s»." -#: ../cli/src/network-manager.c:241 +#: ../cli/src/network-manager.c:326 msgid "WWAN enabled" -msgstr "WWAN habilitado" +msgstr "WWAN activado" -#: ../cli/src/network-manager.c:252 +#: ../cli/src/network-manager.c:337 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." -msgstr "Error: parámetro 'wwan' inválido: '%s'." +msgstr "Error: parámetro «wwan» inválido: «%s»." -#: ../cli/src/network-manager.c:263 +#: ../cli/src/network-manager.c:348 #, c-format msgid "Error: 'nm' command '%s' is not valid." -msgstr "Error: comando 'nm' command '%s' inválido." +msgstr "Error: comando «nm» command «%s» inválido." #: ../cli/src/nmcli.c:69 #, c-format @@ -1020,42 +1079,42 @@ msgstr "" #: ../cli/src/nmcli.c:113 #, c-format msgid "Error: Object '%s' is unknown, try 'nmcli help'." -msgstr "Error: Objeto '%s' desconocido, intente 'nmcli help'." +msgstr "Error: el objeto «%s» desconocido, intente «nmcli help»." #: ../cli/src/nmcli.c:143 #, c-format msgid "Error: Option '--terse' is specified the second time." -msgstr "Error: Opción '--terse' se especifica la segunda vez." +msgstr "Error: la opción «--terse» se especifica la segunda vez." #: ../cli/src/nmcli.c:148 #, c-format msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." -msgstr "Error: Opción '--terse' es mutuamente exclusiva con '--pretty'." +msgstr "Error: la opción «--terse» es mutuamente exclusiva con «--pretty»." #: ../cli/src/nmcli.c:156 #, c-format msgid "Error: Option '--pretty' is specified the second time." -msgstr "Error: Opción '--pretty' se especifica la segunda vez." +msgstr "Error: la opción «--pretty» se especifica la segunda vez." #: ../cli/src/nmcli.c:161 #, c-format msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." -msgstr "Error: Opción '--pretty' es mutuamente exclusiva con '--terse'." +msgstr "Error: la opción «--pretty» es mutuamente exclusiva con «--terse»." #: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 #, c-format msgid "Error: missing argument for '%s' option." -msgstr "Error: falta argumento para opción '%s'." +msgstr "Error: falta argumento para opción «%s»." #: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 #, c-format msgid "Error: '%s' is not valid argument for '%s' option." -msgstr "Error: '%s' no es válido argumento para opción '%s'." +msgstr "Error: «%s» no es válido argumento para opción «%s»." #: ../cli/src/nmcli.c:203 #, c-format msgid "Error: fields for '%s' options are missing." -msgstr "Error: faltan campos para opciones '%s'." +msgstr "Error: faltan campos para opciones «%s»." #: ../cli/src/nmcli.c:209 #, c-format @@ -1065,7 +1124,7 @@ msgstr "herramienta nmcli, versión %s\n" #: ../cli/src/nmcli.c:215 #, c-format msgid "Error: Option '%s' is unknown, try 'nmcli -help'." -msgstr "Error: Opción '%s' desconocida, intente 'nmcli -help'." +msgstr "Error: opción «%s» desconocida, intente «nmcli -help»." #: ../cli/src/nmcli.c:234 #, c-format @@ -1075,7 +1134,7 @@ msgstr "Señal capturada %d, apagando..." #: ../cli/src/nmcli.c:259 #, c-format msgid "Error: Could not connect to NetworkManager." -msgstr "Error: No se pudo conectar al NetworkManager." +msgstr "Error: no se pudo conectar con NetworkManager." #: ../cli/src/nmcli.c:275 msgid "Success" @@ -1160,22 +1219,22 @@ msgstr "no establecido" #: ../cli/src/utils.c:124 #, c-format msgid "field '%s' has to be alone" -msgstr "campo '%s' tiene que estar solo" +msgstr "el campo «%s» tiene que estar solo" #: ../cli/src/utils.c:127 #, c-format msgid "invalid field '%s'" -msgstr "campo inválido '%s'" +msgstr "campo inválido «%s»" #: ../cli/src/utils.c:146 #, c-format msgid "Option '--terse' requires specifying '--fields'" -msgstr "Opción '--terse' requiere especificar '--fields'" +msgstr "Opción «--terse» requiere especificar «--fields»" #: ../cli/src/utils.c:150 #, c-format msgid "Option '--terse' requires specific '--fields' option values , not '%s'" -msgstr "Opción '--terse' requiere valores de '--fields' específicos, no '%s'" +msgstr "Opción «--terse» requiere valores de «--fields» específicos, no «%s»" #: ../libnm-util/crypto.c:120 #, c-format @@ -1635,7 +1694,7 @@ msgstr "" #: ../src/nm-netlink-monitor.c:265 #, c-format msgid "unable to enable netlink handle credential passing: %s" -msgstr "no se puede habilitar el manejador netlink para pasar credenciales: %s" +msgstr "no se puede activar el manejador netlink para pasar credenciales: %s" #: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 #, c-format @@ -1661,22 +1720,22 @@ msgstr "no pudo unirse al grupo netlink: %s" msgid "error updating link cache: %s" msgstr "error al actualizar el enlace caché: %s" -#: ../src/main.c:502 +#: ../src/main.c:499 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "" "Opción no válida. Use --help para ver una lista de las opciones válidas.\n" -#: ../src/main.c:573 +#: ../src/main.c:570 #, c-format msgid "%s. Please use --help to see a list of valid options.\n" -msgstr "%s. Por favor use --help para ver la lista de opciones válidas.\n" +msgstr "%s. Usar --help para ver la lista de opciones válidas.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:324 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:328 msgid "# Created by NetworkManager\n" msgstr "# Creado por NetworkManager\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:340 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:344 #, c-format msgid "" "# Merged from %s\n" @@ -1691,31 +1750,31 @@ msgstr "cliente DHCP inútil pudo ser hallado." #: ../src/dhcp-manager/nm-dhcp-manager.c:293 msgid "'dhclient' could be found." -msgstr "'dhclient' pudo ser hallado." +msgstr "se pudo encontrar «dhclient»." #: ../src/dhcp-manager/nm-dhcp-manager.c:303 msgid "'dhcpcd' could be found." -msgstr "'dhcpcd' pudo ser hallado." +msgstr "se pudo encontrar «dhcpcd»." #: ../src/dhcp-manager/nm-dhcp-manager.c:311 #, c-format msgid "unsupported DHCP client '%s'" -msgstr "'%s' Cliente DHCP sin soporte " +msgstr "«%s» cliente DHCP sin soporte " #: ../src/logging/nm-logging.c:146 #, c-format msgid "Unknown log level '%s'" -msgstr "Nivel de registro desconocido '%s'" +msgstr "Nivel de registro desconocido «%s»" #: ../src/logging/nm-logging.c:171 #, c-format msgid "Unknown log domain '%s'" -msgstr "Dominio de registro desconocido '%s'" +msgstr "Dominio de registro desconocido «%s»" #: ../src/dns-manager/nm-dns-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" -"NOTA: el 'resolver' de nombres de libc puede que no soporte más de 3 " +"NOTA: el resolutor de nombres de libc puede que no soporte más de 3 " "servidores de nombres." #: ../src/dns-manager/nm-dns-manager.c:386 @@ -1725,8 +1784,9 @@ msgstr "Puede que los servidores de nombres listados abajo no se reconozcan." #: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" -msgstr "Auto %ss" +msgstr "Auto %s" #: ../system-settings/plugins/ifcfg-rh/reader.c:3412 +#: ../system-settings/plugins/ifnet/connection_parser.c:49 msgid "System" msgstr "Sistema" -- cgit v1.2.1 From e8c467e26a781779b06d07609fc9d33f6863f605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Urban=C4=8Di=C4=8D?= Date: Mon, 20 Sep 2010 11:52:31 -0500 Subject: po: update Slovenian translation (bgo #630009) --- po/sl.po | 160 ++++++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 98 insertions(+), 62 deletions(-) diff --git a/po/sl.po b/po/sl.po index b80fe49ae5..cb37ee828a 100644 --- a/po/sl.po +++ b/po/sl.po @@ -10,8 +10,8 @@ msgid "" msgstr "" "Project-Id-Version: NetworkManager master\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-09-16 03:25+0000\n" -"PO-Revision-Date: 2010-09-16 18:17+0100\n" +"POT-Creation-Date: 2010-09-18 15:24+0000\n" +"PO-Revision-Date: 2010-09-18 20:27+0100\n" "Last-Translator: Matej Urbančič \n" "Language-Team: Slovenian GNOME Translation Team \n" "MIME-Version: 1.0\n" @@ -279,7 +279,7 @@ msgstr "Napaka: ni podanega veljavnega parametra." #: ../cli/src/connections.c:544 #: ../cli/src/connections.c:1577 #: ../cli/src/devices.c:1293 -#: ../cli/src/network-manager.c:274 +#: ../cli/src/network-manager.c:359 #, c-format msgid "Error: %s." msgstr "Napaka: %s." @@ -331,8 +331,8 @@ msgstr "začeto" #: ../cli/src/connections.c:1159 #: ../cli/src/devices.c:246 #: ../cli/src/devices.c:558 -#: ../cli/src/network-manager.c:92 -#: ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:149 #: ../cli/src/settings.c:473 msgid "unknown" msgstr "neznano" @@ -740,7 +740,7 @@ msgid "unavailable" msgstr "ni razpoložljivo" #: ../cli/src/devices.c:232 -#: ../cli/src/network-manager.c:89 +#: ../cli/src/network-manager.c:91 msgid "disconnected" msgstr "povezava je prekinjena" @@ -761,7 +761,7 @@ msgid "connecting (getting IP configuration)" msgstr "povezovanje (pridobivanje nastavitev IP)" #: ../cli/src/devices.c:242 -#: ../cli/src/network-manager.c:87 +#: ../cli/src/network-manager.c:89 msgid "connected" msgstr "povezano" @@ -946,123 +946,167 @@ msgstr "V TEKU" #. 1 #: ../cli/src/network-manager.c:37 -msgid "WIFI-HARDWARE" -msgstr "WIFI-STROJNA OPREMA" +msgid "NET-ENABLED" +msgstr "NET-OMOGOČENO" #. 2 #: ../cli/src/network-manager.c:38 -msgid "WIFI" -msgstr "WIFI" +msgid "WIFI-HARDWARE" +msgstr "WIFI-STROJNA OPREMA" #. 3 #: ../cli/src/network-manager.c:39 -msgid "WWAN-HARDWARE" -msgstr "WWAN-STROJNA OPREMA" +msgid "WIFI" +msgstr "WIFI" #. 4 #: ../cli/src/network-manager.c:40 +msgid "WWAN-HARDWARE" +msgstr "WWAN-STROJNA OPREMA" + +#. 5 +#: ../cli/src/network-manager.c:41 msgid "WWAN" msgstr "WWAN" -#: ../cli/src/network-manager.c:62 +#: ../cli/src/network-manager.c:64 #, c-format msgid "" "Usage: nmcli nm { COMMAND | help }\n" "\n" -" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +" COMMAND := { status | enable | sleep | wifi | wwan }\n" "\n" " status\n" -" sleep\n" -" wakeup\n" +" enable [true|false]\n" +" sleep [true|false]\n" " wifi [on|off]\n" " wwan [on|off]\n" "\n" msgstr "" "Uporaba: nmcli nm { UKAZ | help }\n" "\n" -"UKAZ := { status | sleep | wakeup | wifi | wwan }\n" +" UKAZ := { status | enable | sleep | wifi | wwan }\n" "\n" -"status\n" -"sleep\n" -"wakeup\n" -"wifi [on|off]\n" -"wwan [on|off]\n" +" status\n" +" enable [true|false]\n" +" sleep [true|false]\n" +" wifi [on|off]\n" +" wwan [on|off]\n" "\n" -#: ../cli/src/network-manager.c:83 +#: ../cli/src/network-manager.c:85 msgid "asleep" msgstr "v mirovanju" -#: ../cli/src/network-manager.c:85 +#: ../cli/src/network-manager.c:87 msgid "connecting" msgstr "povezovanje" -#: ../cli/src/network-manager.c:125 +#: ../cli/src/network-manager.c:128 #, c-format msgid "Error: 'nm status': %s" msgstr "Napaka: 'nm status': %s" -#: ../cli/src/network-manager.c:127 +#: ../cli/src/network-manager.c:130 #, c-format msgid "Error: 'nm status': %s; allowed fields: %s" msgstr "Napaka: 'nm status': %s; dovoljena polja: %s" -#: ../cli/src/network-manager.c:134 +#: ../cli/src/network-manager.c:137 msgid "NetworkManager status" msgstr "Stanje NetworkManager" #. Print header -#: ../cli/src/network-manager.c:140 -#: ../cli/src/network-manager.c:141 -#: ../cli/src/network-manager.c:142 -#: ../cli/src/network-manager.c:143 -#: ../cli/src/network-manager.c:211 -#: ../cli/src/network-manager.c:243 +#: ../cli/src/network-manager.c:144 +#: ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 +#: ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 +#: ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 +#: ../cli/src/network-manager.c:328 msgid "enabled" msgstr "omogočeno" -#: ../cli/src/network-manager.c:140 -#: ../cli/src/network-manager.c:141 -#: ../cli/src/network-manager.c:142 -#: ../cli/src/network-manager.c:143 -#: ../cli/src/network-manager.c:211 -#: ../cli/src/network-manager.c:243 +#: ../cli/src/network-manager.c:144 +#: ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 +#: ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 +#: ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 +#: ../cli/src/network-manager.c:328 msgid "disabled" msgstr "onemogočeno" -#: ../cli/src/network-manager.c:148 +#: ../cli/src/network-manager.c:152 msgid "running" msgstr "v teku" -#: ../cli/src/network-manager.c:148 +#: ../cli/src/network-manager.c:152 msgid "not running" msgstr "ni v teku" -#: ../cli/src/network-manager.c:201 -#: ../cli/src/network-manager.c:233 +#: ../cli/src/network-manager.c:175 +#, c-format +msgid "Error: Couldn't connect to system bus: %s" +msgstr "Napaka: ni se mogoče povezati s sistemskim vodilom: %s" + +#: ../cli/src/network-manager.c:186 +#, c-format +msgid "Error: Couldn't create D-Bus object proxy." +msgstr "Napaka: ni mogoče ustvariti posredniškega predmeta vodila D-Bus." + +#: ../cli/src/network-manager.c:192 +#, c-format +msgid "Error in sleep: %s" +msgstr "Napaka v mirovanju: %s" + +#: ../cli/src/network-manager.c:237 +#: ../cli/src/network-manager.c:286 +#: ../cli/src/network-manager.c:318 #, c-format msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" msgstr "Napaka: vrednost '--fields' '%s' ni veljavna, dovoljena polja: %s" -#: ../cli/src/network-manager.c:209 +#: ../cli/src/network-manager.c:245 +msgid "Networking enabled" +msgstr "Omrežje je omogočeno" + +#: ../cli/src/network-manager.c:256 +#, c-format +msgid "Error: invalid 'enable' parameter: '%s'; use 'true' or 'false'." +msgstr "Napaka: neveljaven parameter 'enable': '%s'; uporabite 'true' ali 'false'." + +#: ../cli/src/network-manager.c:265 +#, c-format +msgid "Error: Sleeping status is not exported by NetworkManager." +msgstr "Napaka: stanje v mirovanju ni izvoženo s programom NetworkManager." + +#: ../cli/src/network-manager.c:273 +#, c-format +msgid "Error: invalid 'sleep' parameter: '%s'; use 'true' or 'false'." +msgstr "Napaka: neveljaven parameter 'sleep': '%s'; uporabite 'true' ali 'false'." + +#: ../cli/src/network-manager.c:294 msgid "WiFi enabled" msgstr "WiFi je omogočen" -#: ../cli/src/network-manager.c:220 +#: ../cli/src/network-manager.c:305 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." msgstr "Napaka: neveljaven 'wifi' parameter: '%s'." -#: ../cli/src/network-manager.c:241 +#: ../cli/src/network-manager.c:326 msgid "WWAN enabled" msgstr "WWAN je omogočen" -#: ../cli/src/network-manager.c:252 +#: ../cli/src/network-manager.c:337 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." msgstr "Napaka: neveljaven 'wwan' parameter: '%s'." -#: ../cli/src/network-manager.c:263 +#: ../cli/src/network-manager.c:348 #, c-format msgid "Error: 'nm' command '%s' is not valid." msgstr "Napaka: ukaz 'nm' '%s' ni veljaven" @@ -1627,7 +1671,6 @@ msgid "Modify persistent system hostname" msgstr "Spremeni trajno sistemsko ime gostitelja" #: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 -#| msgid "No active connections!" msgid "Modify system connections" msgstr "Spremeni sistemske povezave" @@ -1708,9 +1751,6 @@ msgstr "med čakanjem na podatke na vtiču je prišlo do napake" #: ../src/nm-netlink-monitor.c:254 #, c-format -#| msgid "" -#| "unable to bind to netlink socket for monitoring wired ethernet devices - %" -#| "s" msgid "unable to connect to netlink for monitoring link status: %s" msgstr "ni se mogoče povezati z netlink za nadziranje stanja povezave: %s" @@ -1722,15 +1762,11 @@ msgstr "ni mogoče omogočiti ročnika netlink overjanje:% s" #: ../src/nm-netlink-monitor.c:291 #: ../src/nm-netlink-monitor.c:353 #, c-format -#| msgid "" -#| "unable to create netlink socket for monitoring wired ethernet devices - %s" msgid "unable to allocate netlink handle for monitoring link status: %s" msgstr "ni mogoče dodeliti ročice netlink za nadziranje stanja povezave: %s" #: ../src/nm-netlink-monitor.c:376 #, c-format -#| msgid "" -#| "unable to create netlink socket for monitoring wired ethernet devices - %s" msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "ni mogoče dodeliti predpomnilnika netlink povezav za nadziranje stanja povezave: %s" @@ -1745,12 +1781,12 @@ msgstr "skupini netlink se ni mogoče pridružiti: %s" msgid "error updating link cache: %s" msgstr "napaka med posodabljanjem predpomnilnika povezave: %s" -#: ../src/main.c:498 +#: ../src/main.c:499 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "Neveljavna možnost. Uporabite --help za seznam veljavnih možnosti.\n" -#: ../src/main.c:569 +#: ../src/main.c:570 #, c-format msgid "%s. Please use --help to see a list of valid options.\n" msgstr "%s. Uporabite --help za prikaz seznam veljavnih možnosti.\n" @@ -1795,11 +1831,11 @@ msgstr "Neznana raven beleženja '%s'" msgid "Unknown log domain '%s'" msgstr "Neznana domena beleženja '%s'" -#: ../src/named-manager/nm-named-manager.c:384 +#: ../src/dns-manager/nm-dns-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "OPOMBA: razreševalnik libc morda ne podpira več kot 3 imenskih strežnikov." -#: ../src/named-manager/nm-named-manager.c:386 +#: ../src/dns-manager/nm-dns-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "Navedeni imenski strežniki morda ne bodo prepoznani." @@ -1809,7 +1845,7 @@ msgid "Auto %s" msgstr "Samodejno %s" #: ../system-settings/plugins/ifcfg-rh/reader.c:3412 -#| msgid "Open System" +#: ../system-settings/plugins/ifnet/connection_parser.c:49 msgid "System" msgstr "Sistem" -- cgit v1.2.1 From 713ee36f09aae726da340c0dd6a0243195671821 Mon Sep 17 00:00:00 2001 From: A S Alam Date: Mon, 20 Sep 2010 11:54:21 -0500 Subject: po: update Punjabi translation (bgo #630034) --- po/pa.po | 142 ++++++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 100 insertions(+), 42 deletions(-) diff --git a/po/pa.po b/po/pa.po index 3f9624c3fb..cf3777a70b 100644 --- a/po/pa.po +++ b/po/pa.po @@ -11,8 +11,8 @@ msgstr "" "Project-Id-Version: NetworkManager.HEAD\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug." "cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-09-08 03:25+0000\n" -"PO-Revision-Date: 2010-09-08 18:45+0530\n" +"POT-Creation-Date: 2010-09-18 03:25+0000\n" +"PO-Revision-Date: 2010-09-19 08:09+0530\n" "Last-Translator: A S Alam \n" "Language-Team: Punjabi/Panjabi \n" "MIME-Version: 1.0\n" @@ -216,7 +216,7 @@ msgid "Error: no valid parameter specified." msgstr "ਗਲਤੀ: ਕੋਈ ਢੁੱਕਵਾਂ ਪੈਰਾਮੀਟਰ ਨਹੀਂ ਦਿੱਤਾ।" #: ../cli/src/connections.c:544 ../cli/src/connections.c:1577 -#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:274 +#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:359 #, c-format msgid "Error: %s." msgstr "ਗਲਤੀ: %s" @@ -265,8 +265,8 @@ msgstr "ਚਾਲੂ ਕੀਤਾ" #: ../cli/src/connections.c:1103 ../cli/src/connections.c:1126 #: ../cli/src/connections.c:1159 ../cli/src/devices.c:246 -#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:92 -#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:473 +#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:149 ../cli/src/settings.c:473 msgid "unknown" msgstr "ਅਣਜਾਣ" @@ -501,13 +501,11 @@ msgstr "IP4-DNS" #. 6 #: ../cli/src/devices.c:79 -#| msgid "IP4-SETTINGS" msgid "IP6-SETTINGS" msgstr "IP6-ਸੈਟਿੰਗ" #. 7 #: ../cli/src/devices.c:80 -#| msgid "IP4-DNS" msgid "IP6-DNS" msgstr "IP6-DNS" @@ -662,7 +660,7 @@ msgstr "ਬਿਨ-ਪਰਬੰਧ" msgid "unavailable" msgstr "ਨਾ-ਉਪਲੱਬਧ" -#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:89 +#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:91 msgid "disconnected" msgstr "ਡਿਸ-ਕੁਨੈਕਟ ਕੀਤਾ" @@ -682,7 +680,7 @@ msgstr "ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (ਪਰਮਾ msgid "connecting (getting IP configuration)" msgstr "ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (IP ਸੰਰਚਨਾ ਲਈ ਜਾ ਰਹੀ ਹੈ)" -#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:87 +#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:89 msgid "connected" msgstr "ਕੁਨੈਕਟ ਹੋਇਆ" @@ -863,116 +861,176 @@ msgstr "ਚੱਲ ਰਿਹਾ ਹੈ" #. 1 #: ../cli/src/network-manager.c:37 -msgid "WIFI-HARDWARE" -msgstr "ਵਾਈਫਾਈ ਹਾਰਡਵੇਅਰ" +msgid "NET-ENABLED" +msgstr "NET-ENABLED" #. 2 #: ../cli/src/network-manager.c:38 -msgid "WIFI" -msgstr "ਵਾਈਫਾਈ" +msgid "WIFI-HARDWARE" +msgstr "ਵਾਈਫਾਈ ਹਾਰਡਵੇਅਰ" #. 3 #: ../cli/src/network-manager.c:39 -msgid "WWAN-HARDWARE" -msgstr "WWAN-ਹਾਰਡਵੇਅਰ" +msgid "WIFI" +msgstr "ਵਾਈਫਾਈ" #. 4 #: ../cli/src/network-manager.c:40 +msgid "WWAN-HARDWARE" +msgstr "WWAN-ਹਾਰਡਵੇਅਰ" + +#. 5 +#: ../cli/src/network-manager.c:41 msgid "WWAN" msgstr "WWAN" -#: ../cli/src/network-manager.c:62 -#, c-format +#: ../cli/src/network-manager.c:64 +#, c-format +#| msgid "" +#| "Usage: nmcli nm { COMMAND | help }\n" +#| "\n" +#| " COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +#| "\n" +#| " status\n" +#| " sleep\n" +#| " wakeup\n" +#| " wifi [on|off]\n" +#| " wwan [on|off]\n" +#| "\n" msgid "" "Usage: nmcli nm { COMMAND | help }\n" "\n" -" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +" COMMAND := { status | enable | sleep | wifi | wwan }\n" "\n" " status\n" -" sleep\n" -" wakeup\n" +" enable [true|false]\n" +" sleep [true|false]\n" " wifi [on|off]\n" " wwan [on|off]\n" "\n" msgstr "" "ਵਰਤੋਂ: nmcli nm { COMMAND | help }\n" "\n" -" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +" COMMAND := { status | enable | sleep | wifi | wwan }\n" "\n" " status\n" -" sleep\n" -" wakeup\n" +" enable [true|false]\n" +" sleep [true|false]\n" " wifi [on|off]\n" " wwan [on|off]\n" "\n" -#: ../cli/src/network-manager.c:83 +#: ../cli/src/network-manager.c:85 msgid "asleep" msgstr "asleep" -#: ../cli/src/network-manager.c:85 +#: ../cli/src/network-manager.c:87 msgid "connecting" msgstr "ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ" -#: ../cli/src/network-manager.c:125 +#: ../cli/src/network-manager.c:128 #, c-format msgid "Error: 'nm status': %s" msgstr "ਗਲਤੀ: 'nm status': %s" -#: ../cli/src/network-manager.c:127 +#: ../cli/src/network-manager.c:130 #, c-format msgid "Error: 'nm status': %s; allowed fields: %s" msgstr "ਗਲਤੀ: 'nm status': %s; ਮਨਜ਼ੂਰ ਖੇਤਰ: %s" -#: ../cli/src/network-manager.c:134 +#: ../cli/src/network-manager.c:137 msgid "NetworkManager status" msgstr "ਨੈੱਟਵਰਕਮੈਨੇਜਰ ਹਾਲਤ" #. Print header -#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 -#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 -#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +#: ../cli/src/network-manager.c:144 ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 ../cli/src/network-manager.c:328 msgid "enabled" msgstr "ਚਾਲੂ ਹੈ" -#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 -#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 -#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +#: ../cli/src/network-manager.c:144 ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 ../cli/src/network-manager.c:328 msgid "disabled" msgstr "ਬੰਦ ਹੈ" -#: ../cli/src/network-manager.c:148 +#: ../cli/src/network-manager.c:152 msgid "running" msgstr "ਚੱਲ ਰਿਹਾ ਹੈ" -#: ../cli/src/network-manager.c:148 +#: ../cli/src/network-manager.c:152 msgid "not running" msgstr "ਨਹੀਂ ਚੱਲ ਰਿਹਾ ਹੈ" -#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#: ../cli/src/network-manager.c:175 +#, c-format +#| msgid "Error: could not connect to D-Bus." +msgid "Error: Couldn't connect to system bus: %s" +msgstr "ਗਲਤੀ: ਡੀ-ਬੱਸ ਨਾਲ ਕੁਨੈਕਟ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ: %s" + +#: ../cli/src/network-manager.c:186 +#, c-format +#| msgid "Error: could not connect to D-Bus." +msgid "Error: Couldn't create D-Bus object proxy." +msgstr "ਗਲਤੀ: ਡੀ-ਬੱਸ ਆਬਜੈਕਟ ਪਰਾਕਸੀ ਨਹੀਂ ਬਣਾਇਆ ਜਾ ਸਕਿਆ।" + +#: ../cli/src/network-manager.c:192 +#, c-format +#| msgid "Error: 'con list': %s" +msgid "Error in sleep: %s" +msgstr "ਸਲੀਪ 'ਚ ਗਲਤੀ: %s" + +#: ../cli/src/network-manager.c:237 ../cli/src/network-manager.c:286 +#: ../cli/src/network-manager.c:318 #, c-format msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" msgstr "ਗਲਤੀ: '--fields' value '%s' is not valid here; allowed fields: %s" -#: ../cli/src/network-manager.c:209 +#: ../cli/src/network-manager.c:245 +#| msgid "WiFi enabled" +msgid "Networking enabled" +msgstr "ਨੈਟਵਰਕਿੰਗ ਚਾਲੂ ਹੈ" + +#: ../cli/src/network-manager.c:256 +#, c-format +#| msgid "Error: invalid 'wwan' parameter: '%s'." +msgid "Error: invalid 'enable' parameter: '%s'; use 'true' or 'false'." +msgstr "ਗਲਤ: ਗਲਤ 'enable' ਪੈਰਾਮੀਟਰ: '%s'; 'true' ਜਾਂ 'false' ਵਰਤੋਂ।" + +#: ../cli/src/network-manager.c:265 +#, c-format +#| msgid "Error: Could not connect to NetworkManager." +msgid "Error: Sleeping status is not exported by NetworkManager." +msgstr "ਗਲਤੀ: ਨੈੱਟਵਰਕਮੈਨੇਜਰ ਵਲੋਂ ਸਲੀਪ (sleep) ਹਾਲਤ ਐਕਸਪੋਰਟ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕਦੀ।" + +#: ../cli/src/network-manager.c:273 +#, c-format +#| msgid "Error: invalid 'wifi' parameter: '%s'." +msgid "Error: invalid 'sleep' parameter: '%s'; use 'true' or 'false'." +msgstr "ਗਲਤੀ: ਗਲਤ 'sleep' ਪੈਰਾਮੀਟਰ: '%s'; 'true' ਜਾਂ 'false' ਵਰਤੋਂ।" + +#: ../cli/src/network-manager.c:294 msgid "WiFi enabled" msgstr "ਵਾਈਫਾਈ ਚਾਲੂ ਹੈ" -#: ../cli/src/network-manager.c:220 +#: ../cli/src/network-manager.c:305 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." msgstr "ਗਲਤੀ: ਅਢੁੱਕਵਾਂ 'wifi' ਪੈਰਾਮੀਟਰ: '%s'." -#: ../cli/src/network-manager.c:241 +#: ../cli/src/network-manager.c:326 msgid "WWAN enabled" msgstr "WWAN ਚਾਲੂ ਹੈ" -#: ../cli/src/network-manager.c:252 +#: ../cli/src/network-manager.c:337 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." msgstr "ਗਲਤੀ: ਅਢੁੱਕਵਾਂ 'wwan' ਪੈਰਾਮੀਟਰ: '%s'." -#: ../cli/src/network-manager.c:263 +#: ../cli/src/network-manager.c:348 #, c-format msgid "Error: 'nm' command '%s' is not valid." msgstr "ਗਲਤੀ: 'nm' ਕਮਾਂਡ '%s' ਢੁੱਕਵੀਂ ਨਹੀਂ ਹੈ।" -- cgit v1.2.1 From cd5d904928c740977cdb8b9dc7c197e57cee52a1 Mon Sep 17 00:00:00 2001 From: Daniel Schury Date: Mon, 20 Sep 2010 11:56:09 -0500 Subject: po: update German translation (bgo #630049) --- po/de.po | 1507 +++++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 1041 insertions(+), 466 deletions(-) diff --git a/po/de.po b/po/de.po index 89490d0d87..07a6a3b242 100644 --- a/po/de.po +++ b/po/de.po @@ -8,23 +8,92 @@ # Andre Klapper , 2007. # Hauke Mehrtens , 2008. # Christian Kirbach , 2009, 2010. -# Daniel Schury , 2010. +# Daniel Schury , 2010. # msgid "" msgstr "" "Project-Id-Version: NetworkManager HEAD\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-04-30 03:24+0000\n" -"PO-Revision-Date: 2010-05-15 11:50+0200\n" -"Last-Translator: Daniel Schury \n" -"Language-Team: Deutsch \n" +"POT-Creation-Date: 2010-09-18 15:24+0000\n" +"PO-Revision-Date: 2010-09-18 23:56+0200\n" +"Last-Translator: Daniel Schury \n" +"Language-Team: Deutsch \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"Content-Transfer-Encoding: 8-bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" + +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/devices.c:88 ../cli/src/devices.c:101 ../cli/src/devices.c:111 +#: ../cli/src/devices.c:121 ../cli/src/devices.c:134 ../cli/src/devices.c:145 +#: ../cli/src/devices.c:156 ../cli/src/devices.c:165 ../cli/src/devices.c:174 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:61 ../cli/src/connections.c:76 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:62 +msgid "DEVICES" +msgstr "GERÄTE" + +#. 2 +#: ../cli/src/connections.c:63 ../cli/src/connections.c:78 +msgid "SCOPE" +msgstr "BANDBREITE" + +#. 3 +#: ../cli/src/connections.c:64 +msgid "DEFAULT" +msgstr "VORGABE" + +#. 4 +#: ../cli/src/connections.c:65 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:66 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:67 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:77 ../cli/src/devices.c:62 ../cli/src/devices.c:90 +msgid "TYPE" +msgstr "TYP" + +#. 3 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP" +msgstr "ZEITSTEMPEL" + +#. 4 +#: ../cli/src/connections.c:80 +msgid "TIMESTAMP-REAL" +msgstr "ZEITSTEMPEL-ECHT" + +#. 5 +#: ../cli/src/connections.c:81 +msgid "AUTOCONNECT" +msgstr "AUTO-VERBINDEN" + +#. 6 +#: ../cli/src/connections.c:82 +msgid "READONLY" +msgstr "NUR-LESEN" -#: ../cli/src/connections.c:86 +#: ../cli/src/connections.c:158 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -45,312 +114,526 @@ msgstr "" "]\n" " down id | uuid \n" -#: ../cli/src/connections.c:158 -msgid "Connections" -msgstr "Verbindungen" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/devices.c:298 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "Type" -msgstr "Typ" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "UUID" -msgstr "UUID" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Name" -msgstr "Name" - -#: ../cli/src/connections.c:163 +#: ../cli/src/connections.c:198 ../cli/src/connections.c:537 #, c-format -msgid "System connections:\n" -msgstr "Systemverbindungen:\n" +msgid "Error: 'con list': %s" +msgstr "Fehler: »Verb. Liste«: %s" -#: ../cli/src/connections.c:167 +#: ../cli/src/connections.c:200 ../cli/src/connections.c:539 #, c-format -msgid "User connections:\n" -msgstr "Benutzerverbindungen:\n" +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Fehler: »Verb. Liste«: %s; erlaubte Felder: %s" + +#: ../cli/src/connections.c:208 +msgid "Connection details" +msgstr "Verbindungsinformationen" + +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 +msgid "system" +msgstr "System" + +#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 +msgid "user" +msgstr "Benutzer" + +#: ../cli/src/connections.c:384 +msgid "never" +msgstr "nie" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:551 ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 +msgid "yes" +msgstr "ja" + +#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 +#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:510 ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 ../cli/src/settings.c:1224 +msgid "no" +msgstr "nein" + +#: ../cli/src/connections.c:458 ../cli/src/connections.c:501 +msgid "System connections" +msgstr "Systemverbindungen" + +#: ../cli/src/connections.c:463 ../cli/src/connections.c:514 +msgid "User connections" +msgstr "Benutzerverbindungen" -#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 -#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 -#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 -#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 -#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 +#: ../cli/src/connections.c:475 ../cli/src/connections.c:1335 +#: ../cli/src/connections.c:1351 ../cli/src/connections.c:1360 +#: ../cli/src/connections.c:1371 ../cli/src/connections.c:1456 +#: ../cli/src/devices.c:962 ../cli/src/devices.c:972 ../cli/src/devices.c:1074 +#: ../cli/src/devices.c:1081 #, c-format msgid "Error: %s argument is missing." msgstr "Fehler: Argument %s fehlt." -#: ../cli/src/connections.c:189 +#: ../cli/src/connections.c:488 #, c-format msgid "Error: %s - no such connection." msgstr "Fehler: Verbindung %s existiert nicht." -#: ../cli/src/connections.c:196 -msgid "System-wide connections" -msgstr "Systemweite Verbindungen" - -#: ../cli/src/connections.c:205 -msgid "User connections" -msgstr "Benutzerverbindungen" - -#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 -#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 -#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 -#: ../cli/src/devices.c:798 +#: ../cli/src/connections.c:520 ../cli/src/connections.c:1384 +#: ../cli/src/connections.c:1474 ../cli/src/devices.c:785 +#: ../cli/src/devices.c:852 ../cli/src/devices.c:986 ../cli/src/devices.c:1087 #, c-format msgid "Unknown parameter: %s\n" msgstr "Unbekannter Parameter: %s\n" -#: ../cli/src/connections.c:221 +#: ../cli/src/connections.c:529 #, c-format msgid "Error: no valid parameter specified." msgstr "Fehler: Es wurde kein gültiger Parameter angegeben." -#. FIXME: Fix the output -#: ../cli/src/connections.c:268 ../cli/src/devices.c:302 -#: ../cli/src/devices.c:321 ../cli/src/devices.c:353 ../cli/src/devices.c:355 -#: ../cli/src/devices.c:357 ../cli/src/devices.c:359 ../cli/src/devices.c:361 -msgid "yes" -msgstr "ja" +#: ../cli/src/connections.c:544 ../cli/src/connections.c:1577 +#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:359 +#, c-format +msgid "Error: %s." +msgstr "Fehler: %s." -#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 -msgid "no" -msgstr "nein" +#: ../cli/src/connections.c:650 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Fehler: »Verb. Status«: %s" + +#: ../cli/src/connections.c:652 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Fehler: »Verb. Status«: %s; erlaubte Felder: %s" -#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:659 msgid "Active connections" msgstr "Aktive Verbindungen" -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 -msgid "Default" -msgstr "Vorgabe" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Service" -msgstr "Dienst" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Devices" -msgstr "Geräte" - -#: ../cli/src/connections.c:659 +#: ../cli/src/connections.c:1027 #, c-format msgid "no active connection on device '%s'" msgstr "Keine aktive Verbindung auf Gerät »%s«" -#: ../cli/src/connections.c:667 +#: ../cli/src/connections.c:1035 #, c-format msgid "no active connection or device" msgstr "Keine aktive Verbindung oder Gerät" -#: ../cli/src/connections.c:730 +#: ../cli/src/connections.c:1085 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "Gerät »%s« ist nicht mit der Verbindung »%s« kompatibel" + +#: ../cli/src/connections.c:1087 +#, c-format +msgid "no device found for connection '%s'" +msgstr "Für die Verbindung »%s« wurde kein Gerät gefunden" + +#: ../cli/src/connections.c:1098 msgid "activating" msgstr "wird aktiviert" -#: ../cli/src/connections.c:732 +#: ../cli/src/connections.c:1100 msgid "activated" msgstr "aktiviert" -#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 -#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 -#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 +#: ../cli/src/connections.c:1103 ../cli/src/connections.c:1126 +#: ../cli/src/connections.c:1159 ../cli/src/devices.c:246 +#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:149 ../cli/src/settings.c:473 msgid "unknown" msgstr "unbekannt" -#: ../cli/src/connections.c:744 +#: ../cli/src/connections.c:1112 msgid "VPN connecting (prepare)" msgstr "VPN wird verbunden (wird vorbereitet)" -#: ../cli/src/connections.c:746 +#: ../cli/src/connections.c:1114 msgid "VPN connecting (need authentication)" msgstr "VPN wird verbunden (Legitimierung wird benötigt)" -#: ../cli/src/connections.c:748 +#: ../cli/src/connections.c:1116 msgid "VPN connecting" msgstr "VPN wird verbunden" -#: ../cli/src/connections.c:750 +#: ../cli/src/connections.c:1118 msgid "VPN connecting (getting IP configuration)" msgstr "VPN wird verbunden (IP-Einstellungen werden ermittelt)" -#: ../cli/src/connections.c:752 +#: ../cli/src/connections.c:1120 msgid "VPN connected" msgstr "VPN verbunden" -#: ../cli/src/connections.c:754 +#: ../cli/src/connections.c:1122 msgid "VPN connection failed" msgstr "VPN-Verbindung gescheitert" -#: ../cli/src/connections.c:756 +#: ../cli/src/connections.c:1124 msgid "VPN disconnected" msgstr "VPN getrennt" -#: ../cli/src/connections.c:767 +#: ../cli/src/connections.c:1135 msgid "unknown reason" msgstr "unbekannter Grund" -#: ../cli/src/connections.c:769 +#: ../cli/src/connections.c:1137 msgid "none" msgstr "kein" -#: ../cli/src/connections.c:771 +#: ../cli/src/connections.c:1139 msgid "the user was disconnected" msgstr "Der Benutzer wurde getrennt" -#: ../cli/src/connections.c:773 +#: ../cli/src/connections.c:1141 msgid "the base network connection was interrupted" msgstr "Die Basisverbindung wurde unterbrochen" -#: ../cli/src/connections.c:775 +#: ../cli/src/connections.c:1143 msgid "the VPN service stopped unexpectedly" msgstr "Der VPN-Dienst wurde unerwartet gestoppt" -#: ../cli/src/connections.c:777 +#: ../cli/src/connections.c:1145 msgid "the VPN service returned invalid configuration" msgstr "Der VPN-Dienst gab ungültige Einstellungen zurück" -#: ../cli/src/connections.c:779 +#: ../cli/src/connections.c:1147 msgid "the connection attempt timed out" msgstr "Der Verbindungsversuch benötigte zu viel Zeit" -#: ../cli/src/connections.c:781 +#: ../cli/src/connections.c:1149 msgid "the VPN service did not start in time" msgstr "Der VPN-Dienst wurde nicht rechtzeitig gestartet" -#: ../cli/src/connections.c:783 +#: ../cli/src/connections.c:1151 msgid "the VPN service failed to start" msgstr "Der VPN-Dienst konnte nicht gestartet werden" -#: ../cli/src/connections.c:785 +#: ../cli/src/connections.c:1153 msgid "no valid VPN secrets" msgstr "Keine gültigen VPN-Schlüssel" -#: ../cli/src/connections.c:787 +#: ../cli/src/connections.c:1155 msgid "invalid VPN secrets" msgstr "Ungültige VPN-Schlüssel" -#: ../cli/src/connections.c:789 +#: ../cli/src/connections.c:1157 msgid "the connection was removed" msgstr "Die Verbindung wurde entfernt" -#: ../cli/src/connections.c:803 +#: ../cli/src/connections.c:1171 #, c-format msgid "state: %s\n" msgstr "Status: %s\n" -#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#: ../cli/src/connections.c:1174 ../cli/src/connections.c:1200 #, c-format msgid "Connection activated\n" msgstr "Verbindung aktiviert\n" -#: ../cli/src/connections.c:809 +#: ../cli/src/connections.c:1177 #, c-format msgid "Error: Connection activation failed." msgstr "Fehler: Aktivierung der Verbindung ist gescheitert." -#: ../cli/src/connections.c:828 +#: ../cli/src/connections.c:1196 #, c-format msgid "state: %s (%d)\n" msgstr "Status: %s (%d)\n" -#: ../cli/src/connections.c:838 +#: ../cli/src/connections.c:1206 #, c-format msgid "Error: Connection activation failed: %s." msgstr "Fehler: Aktivierung der Verbindung ist gescheitert: %s." -#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#: ../cli/src/connections.c:1223 ../cli/src/devices.c:909 #, c-format msgid "Error: Timeout %d sec expired." msgstr "Fehler: Zeitbeschränkung von %d Sekunden ist abgelaufen." -#: ../cli/src/connections.c:898 +#: ../cli/src/connections.c:1266 #, c-format msgid "Error: Connection activation failed: %s" msgstr "Fehler: Aktivierung der Verbindung ist gescheitert: %s" -#: ../cli/src/connections.c:912 +#: ../cli/src/connections.c:1280 #, c-format msgid "Error: Obtaining active connection for '%s' failed." msgstr "Fehler: Ermittlung der aktiven Verbindung für »%s« ist gescheitert." -#: ../cli/src/connections.c:921 +#: ../cli/src/connections.c:1289 #, c-format msgid "Active connection state: %s\n" msgstr "Status der aktiven Verbindung: %s\n" -#: ../cli/src/connections.c:922 +#: ../cli/src/connections.c:1290 #, c-format msgid "Active connection path: %s\n" msgstr "Pfad der aktiven Verbindung: %s\n" -#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#: ../cli/src/connections.c:1344 ../cli/src/connections.c:1465 #, c-format msgid "Error: Unknown connection: %s." msgstr "Fehler: Unbekannte Verbindung: %s." -#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#: ../cli/src/connections.c:1379 ../cli/src/devices.c:980 #, c-format msgid "Error: timeout value '%s' is not valid." msgstr "Fehler: Der Wert »%s« ist keine gültige Zeitangabe." -#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:1392 ../cli/src/connections.c:1482 #, c-format msgid "Error: id or uuid has to be specified." msgstr "Fehler: id oder uuid müssen angegeben werden." -#: ../cli/src/connections.c:1044 +#: ../cli/src/connections.c:1412 #, c-format msgid "Error: No suitable device found: %s." msgstr "Fehler: Es wurde kein passendes Gerät gefunden: %s." -#: ../cli/src/connections.c:1046 +#: ../cli/src/connections.c:1414 #, c-format msgid "Error: No suitable device found." msgstr "Fehler: Es wurde kein passendes Gerät gefunden." -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1509 #, c-format msgid "Warning: Connection not active\n" msgstr "Warnung: Verbindung ist nicht aktiv\n" -#: ../cli/src/connections.c:1189 +#: ../cli/src/connections.c:1566 #, c-format msgid "Error: 'con' command '%s' is not valid." msgstr "Fehler: Der »con«-Befehl »%s« ist ungültig." -#: ../cli/src/connections.c:1216 +#: ../cli/src/connections.c:1602 #, c-format msgid "Error: could not connect to D-Bus." msgstr "Fehler: Verbindung zu D-Bus konnte nicht hergestellt werden." -#: ../cli/src/connections.c:1223 +#: ../cli/src/connections.c:1609 #, c-format msgid "Error: Could not get system settings." msgstr "Fehler: Systemeinstellungen konnten nicht ermittelt werden." -#: ../cli/src/connections.c:1231 +#: ../cli/src/connections.c:1617 #, c-format msgid "Error: Could not get user settings." msgstr "Fehler: Benutzereinstellungen konnten nicht ermittelt werden." -#: ../cli/src/connections.c:1241 +#: ../cli/src/connections.c:1627 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "" "Fehler: Verbindungen konnten nicht ermittelt werden: Die Einstellungsdienste " "werden nicht ausgeführt." +#. 0 +#. 9 +#: ../cli/src/devices.c:61 ../cli/src/devices.c:89 ../cli/src/devices.c:184 +msgid "DEVICE" +msgstr "GERÄT" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:63 ../cli/src/devices.c:93 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATUS" + +#: ../cli/src/devices.c:72 +msgid "GENERAL" +msgstr "ALLGEMEIN" + +#. 0 #: ../cli/src/devices.c:73 +msgid "CAPABILITIES" +msgstr "RESSOURCEN" + +#. 1 +#: ../cli/src/devices.c:74 +msgid "WIFI-PROPERTIES" +msgstr "WLAN-EIGENSCHAFTEN" + +#. 2 +#: ../cli/src/devices.c:75 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:76 +msgid "WIRED-PROPERTIES" +msgstr "KABEL-EIGENSCHAFTEN" + +#. 4 +#: ../cli/src/devices.c:77 +msgid "IP4-SETTINGS" +msgstr "IP4-EINSTELLUNGEN" + +#. 5 +#: ../cli/src/devices.c:78 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 6 +#: ../cli/src/devices.c:79 +msgid "IP6-SETTINGS" +msgstr "IP6-EINSTELLUNGEN" + +#. 7 +#: ../cli/src/devices.c:80 +msgid "IP6-DNS" +msgstr "IP6-DNS" + +#. 2 +#: ../cli/src/devices.c:91 +msgid "DRIVER" +msgstr "TREIBER" + +#. 3 +#: ../cli/src/devices.c:92 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:102 +msgid "CARRIER-DETECT" +msgstr "TRÄGERFREQUENZERKENNUNG" + +#. 1 +#: ../cli/src/devices.c:103 +msgid "SPEED" +msgstr "GESCHWINDIGKEIT" + +#. 0 +#: ../cli/src/devices.c:112 +msgid "CARRIER" +msgstr "TRÄGERFREQUENZ" + +#. 0 +#: ../cli/src/devices.c:122 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:123 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:124 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:125 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:126 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:135 ../cli/src/devices.c:146 +msgid "ADDRESS" +msgstr "ADRESSE" + +#. 1 +#: ../cli/src/devices.c:136 ../cli/src/devices.c:147 +msgid "PREFIX" +msgstr "PRÄFIX" + +#. 2 +#: ../cli/src/devices.c:137 ../cli/src/devices.c:148 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:157 ../cli/src/devices.c:166 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:175 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:176 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:177 +msgid "MODE" +msgstr "MODUS" + +#. 3 +#: ../cli/src/devices.c:178 +msgid "FREQ" +msgstr "FREQUENZ" + +#. 4 +#: ../cli/src/devices.c:179 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:180 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:181 +msgid "SECURITY" +msgstr "SICHERHEIT" + +#. 7 +#: ../cli/src/devices.c:182 +msgid "WPA-FLAGS" +msgstr "WPA-SCHALTER" + +#. 8 +#: ../cli/src/devices.c:183 +msgid "RSN-FLAGS" +msgstr "RSN-SCHALTER" + +#. 10 +#: ../cli/src/devices.c:185 +msgid "ACTIVE" +msgstr "AKTIV" + +#: ../cli/src/devices.c:208 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -360,7 +643,7 @@ msgid "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" msgstr "" "Aufruf: nmcli dev { BEFEHL | help }\n" @@ -370,458 +653,396 @@ msgstr "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" -#: ../cli/src/devices.c:93 +#: ../cli/src/devices.c:228 msgid "unmanaged" msgstr "nicht verwaltet" -#: ../cli/src/devices.c:95 +#: ../cli/src/devices.c:230 msgid "unavailable" msgstr "nicht verfügbar" -#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:91 msgid "disconnected" msgstr "nicht verbunden" -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:234 msgid "connecting (prepare)" msgstr "wird verbunden (wird vorbereitet)" -#: ../cli/src/devices.c:101 +#: ../cli/src/devices.c:236 msgid "connecting (configuring)" msgstr "wird verbunden (wird eingerichtet)" -#: ../cli/src/devices.c:103 +#: ../cli/src/devices.c:238 msgid "connecting (need authentication)" msgstr "wird verbunden (Legitimierung wird benötigt)" -#: ../cli/src/devices.c:105 +#: ../cli/src/devices.c:240 msgid "connecting (getting IP configuration)" msgstr "wird verbunden (IP-Einstellungen werden ermittelt)" -#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:89 msgid "connected" msgstr "verbunden" -#: ../cli/src/devices.c:109 +#: ../cli/src/devices.c:244 msgid "connection failed" msgstr "Verbindung gescheitert" -#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +#: ../cli/src/devices.c:267 ../cli/src/devices.c:424 msgid "Unknown" msgstr "Unbekannt" -#. print them -#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 -#: ../cli/src/devices.c:879 +#: ../cli/src/devices.c:299 msgid "(none)" msgstr "(keine)" -#: ../cli/src/devices.c:209 +#: ../cli/src/devices.c:324 #, c-format msgid "%s: error converting IP4 address 0x%X" msgstr "%s: Fehler bei Umwandlung der IPv4-Addresse 0x%X" -#: ../cli/src/devices.c:238 +#: ../cli/src/devices.c:393 #, c-format -msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" -msgstr "%s, %s, Frequenz %d MHz, Durchsatz %d Mb/s, Stärke %d" +msgid "%u MHz" +msgstr "%u MHz" -#: ../cli/src/devices.c:239 -msgid "Ad-Hoc" -msgstr "Ad-Hoc" +#: ../cli/src/devices.c:394 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" -#: ../cli/src/devices.c:248 -msgid ", Encrypted: " -msgstr ", Verschlüsselt: " +#: ../cli/src/devices.c:403 +msgid "Encrypted: " +msgstr "Verschlüsselt: " -#: ../cli/src/devices.c:253 -msgid " WEP" -msgstr " WEP" +#: ../cli/src/devices.c:408 +msgid "WEP " +msgstr "WEP" -#: ../cli/src/devices.c:255 -msgid " WPA" -msgstr " WPA" +#: ../cli/src/devices.c:410 +msgid "WPA " +msgstr "WPA" -#: ../cli/src/devices.c:257 -msgid " WPA2" -msgstr " WPA2" +#: ../cli/src/devices.c:412 +msgid "WPA2 " +msgstr "WPA2" # Das ergibt z.B. WPA-Enterprise, klingt komisch mit »Unternehmen« -#: ../cli/src/devices.c:260 -msgid " Enterprise" -msgstr " Enterprise" - -#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "Device" -msgstr "Gerät" - -#: ../cli/src/devices.c:299 -msgid "Driver" -msgstr "Treiber" - -#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 -msgid "(unknown)" -msgstr "(unbekannt)" - -#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "State" -msgstr "Status" - -#: ../cli/src/devices.c:313 -msgid "HW Address" -msgstr "Hardwareadresse" +#: ../cli/src/devices.c:415 +msgid "Enterprise " +msgstr "Enterprise" -#: ../cli/src/devices.c:319 -#, c-format -msgid "" -"\n" -" Capabilities:\n" -msgstr "" -"\n" -" Fähigkeiten:\n" +#: ../cli/src/devices.c:424 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" -#: ../cli/src/devices.c:321 -msgid "Carrier Detect" -msgstr "Trägersignalkennung" +#: ../cli/src/devices.c:424 +msgid "Infrastructure" +msgstr "Infrastuktur" -#: ../cli/src/devices.c:336 +#: ../cli/src/devices.c:486 #, c-format -msgid "%u Mb/s" -msgstr "%u Mb/s" +msgid "Error: 'dev list': %s" +msgstr "Fehler: »Geräteliste«: %s" -#: ../cli/src/devices.c:337 -msgid "Speed" -msgstr "Geschwindigkeit" - -#: ../cli/src/devices.c:348 +#: ../cli/src/devices.c:488 #, c-format -msgid "" -"\n" -" Wireless Properties\n" -msgstr "" -"\n" -" Eigenschaften der Funkverbindung\n" +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Fehler: »Geräteliste«: %s; erlaubte Felder: %s" -#: ../cli/src/devices.c:353 -msgid "WEP Encryption" -msgstr "WEP-Verschlüsselung" +#: ../cli/src/devices.c:497 +msgid "Device details" +msgstr "Geräteinformationen" -#: ../cli/src/devices.c:355 -msgid "WPA Encryption" -msgstr "WPA-Verschlüsselung" - -#: ../cli/src/devices.c:357 -msgid "WPA2 Encryption" -msgstr "WPA2-Verschlüsselung" - -#: ../cli/src/devices.c:359 -msgid "TKIP cipher" -msgstr "TKIP-Chiffre" - -#: ../cli/src/devices.c:361 -msgid "CCMP cipher" -msgstr "CCMP-Chiffre" - -#: ../cli/src/devices.c:368 -#, c-format -msgid "" -"\n" -" Wireless Access Points %s\n" -msgstr "" -"\n" -" Funknetzwerk-Zugangspunkte %s\n" +#: ../cli/src/devices.c:527 ../cli/src/devices.c:925 +msgid "(unknown)" +msgstr "(unbekannt)" -#: ../cli/src/devices.c:368 -msgid "(* = current AP)" -msgstr "(* = momentaner Zugangspunkt)" +#: ../cli/src/devices.c:528 +msgid "unknown)" +msgstr "unbekannt)" -#: ../cli/src/devices.c:374 +#: ../cli/src/devices.c:554 #, c-format -msgid "" -"\n" -" Wired Properties\n" -msgstr "" -"\n" -" Eigenschaften der kabelgebundenen Verbindung\n" - -#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 -msgid "Carrier" -msgstr "Trägersignal" +msgid "%u Mb/s" +msgstr "%u Mb/s" -#: ../cli/src/devices.c:377 +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:627 msgid "on" msgstr "an" -#: ../cli/src/devices.c:379 +#: ../cli/src/devices.c:627 msgid "off" msgstr "aus" -#: ../cli/src/devices.c:387 +#: ../cli/src/devices.c:808 #, c-format -msgid "" -"\n" -" IPv4 Settings:\n" -msgstr "" -"\n" -" IPv4-Einstellungen:\n" +msgid "Error: 'dev status': %s" +msgstr "Fehler: »Gerätestatus«: %s" -#: ../cli/src/devices.c:395 -msgid "Address" -msgstr "Adresse" - -#: ../cli/src/devices.c:401 -msgid "Prefix" -msgstr "Präfix" - -#: ../cli/src/devices.c:405 -msgid "Gateway" -msgstr "Gateway" - -#: ../cli/src/devices.c:416 -msgid "DNS" -msgstr "DNS" +#: ../cli/src/devices.c:810 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Fehler: »Gerätestatus«: %s; erlaubte Felder: %s" -#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:817 msgid "Status of devices" msgstr "Status der Geräte" -#: ../cli/src/devices.c:487 +#: ../cli/src/devices.c:845 #, c-format msgid "Error: '%s' argument is missing." msgstr "Fehler: Argument »%s« fehlt." -#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#: ../cli/src/devices.c:874 ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: Device '%s' not found." msgstr "Fehler: Gerät »%s« wurde nicht gefunden." -#: ../cli/src/devices.c:539 +#: ../cli/src/devices.c:897 #, c-format msgid "Success: Device '%s' successfully disconnected." msgstr "Erfolg: Gerät »%s« wurde erfolgreich getrennt." -#: ../cli/src/devices.c:564 +#: ../cli/src/devices.c:922 #, c-format msgid "Error: Device '%s' (%s) disconnecting failed: %s" msgstr "Fehler: Trennung des Gerätes »%s« (%s) ist gescheitert: %s" -#: ../cli/src/devices.c:572 +#: ../cli/src/devices.c:930 #, c-format msgid "Device state: %d (%s)\n" msgstr "Gerätezustand: %d (%s)\n" -#: ../cli/src/devices.c:636 +#: ../cli/src/devices.c:994 #, c-format msgid "Error: iface has to be specified." msgstr "Fehler: Es muss eine Schnittstelle angegeben werden." -#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 -msgid "WiFi scan list" -msgstr "Suchliste des WLAN" - -#: ../cli/src/devices.c:740 +#: ../cli/src/devices.c:1112 #, c-format -msgid "Error: Device '%s' is not a WiFi device." -msgstr "Fehler: Gerät »%s« ist kein WLAN-Gerät." +msgid "Error: 'dev wifi': %s" +msgstr "Fehler: »Geräte-WLAN«: %s" -#: ../cli/src/devices.c:754 -msgid "Device:" -msgstr "Gerät:" - -#: ../cli/src/devices.c:806 +#: ../cli/src/devices.c:1114 #, c-format -msgid "Error: hwaddr has to be specified." -msgstr "Fehler: Es muss eine Hardwareadresse angegeben werden." +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Fehler: »Geräte-WLAN«: %s; erlaubte Felder: %s" -#: ../cli/src/devices.c:844 +#: ../cli/src/devices.c:1121 +msgid "WiFi scan list" +msgstr "Suchliste des WLAN" + +#: ../cli/src/devices.c:1156 ../cli/src/devices.c:1210 #, c-format msgid "Error: Access point with hwaddr '%s' not found." msgstr "" "Fehler: Der Zugangspunkt mit der Hardware-Adresse »%s« wurde nicht gefunden." -#: ../cli/src/devices.c:862 +#: ../cli/src/devices.c:1173 #, c-format -msgid "%u MHz" -msgstr "%u MHz" +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Fehler: Gerät »%s« ist kein WLAN-Gerät." -#: ../cli/src/devices.c:863 +#: ../cli/src/devices.c:1237 #, c-format -msgid "%u MB/s" -msgstr "%u MB/s" - -#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 -msgid "AP parameters" -msgstr "Parameter des Zugangspunkts" - -#: ../cli/src/devices.c:873 -msgid "SSID:" -msgstr "SSID:" - -#: ../cli/src/devices.c:874 -msgid "BSSID:" -msgstr "BSSID:" - -#: ../cli/src/devices.c:875 -msgid "Frequency:" -msgstr "Frequenz:" - -#: ../cli/src/devices.c:876 -msgid "Mode:" -msgstr "Modus:" - -#: ../cli/src/devices.c:876 -msgid "Ad-hoc" -msgstr "Ad-hoc" - -#: ../cli/src/devices.c:876 -msgid "Infrastructure" -msgstr "Infrastuktur" - -#: ../cli/src/devices.c:877 -msgid "Maximal bitrate:" -msgstr "Maximale Übertragungsgeschwindigkeit:" +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Fehler: Der Befehl »%s« für »dev wifi« ist ungültig." -#: ../cli/src/devices.c:878 -msgid "Strength:" -msgstr "Stärke:" +#: ../cli/src/devices.c:1284 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Fehler: Der Befehl »%s« für »dev« ist ungültig." -#: ../cli/src/devices.c:879 -msgid "Flags:" -msgstr "Flags:" +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "LAUFEND" -#: ../cli/src/devices.c:879 -msgid "privacy" -msgstr "Vertraulichkeit" +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "NET-ENABLED" +msgstr "NETZ-AKTIVIERT" -#: ../cli/src/devices.c:880 -msgid "WPA flags:" -msgstr "WPA-Flags:" +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI-HARDWARE" +msgstr "WLAN-HARDWARE" -#: ../cli/src/devices.c:881 -msgid "RSN flags:" -msgstr "RSN-Flags:" +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WIFI" +msgstr "WLAN" -#: ../cli/src/devices.c:907 -#, c-format -msgid "Error: 'dev wifi' command '%s' is not valid." -msgstr "Fehler: Der Befehl »%s« für »dev wifi« ist ungültig." +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" -#: ../cli/src/devices.c:943 -#, c-format -msgid "Error: 'dev' command '%s' is not valid." -msgstr "Fehler: Der Befehl »%s« für »dev« ist ungültig." +#. 5 +#: ../cli/src/network-manager.c:41 +msgid "WWAN" +msgstr "WWAN" -#: ../cli/src/network-manager.c:46 +#: ../cli/src/network-manager.c:64 #, c-format msgid "" "Usage: nmcli nm { COMMAND | help }\n" "\n" -" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +" COMMAND := { status | enable | sleep | wifi | wwan }\n" "\n" " status\n" -" sleep\n" -" wakeup\n" +" enable [true|false]\n" +" sleep [true|false]\n" " wifi [on|off]\n" " wwan [on|off]\n" "\n" msgstr "" "Aufruf: nmcli nm { BEFEHL | help }\n" "\n" -" BEFEHL := { status | sleep | wakeup | wifi | wwan }\n" +" BEFEHL := { status | enable | sleep | wifi | wwan }\n" "\n" " status\n" -" sleep\n" -" wakeup\n" +" enable [true|false]\n" +" sleep [true|false]\n" " wifi [on|off]\n" " wwan [on|off]\n" "\n" -#: ../cli/src/network-manager.c:67 +#: ../cli/src/network-manager.c:85 msgid "asleep" msgstr "schlafend" -#: ../cli/src/network-manager.c:69 +#: ../cli/src/network-manager.c:87 msgid "connecting" msgstr "wird verbunden" -#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 -#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 -#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 -msgid "enabled" -msgstr "aktiviert" +#: ../cli/src/network-manager.c:128 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Fehler: »NM-Status«: %s" -#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 -#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 -#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 -msgid "disabled" -msgstr "deaktiviert" +#: ../cli/src/network-manager.c:130 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Fehler: »NM-Status«: %s; erlaubte Felder: %s" -#: ../cli/src/network-manager.c:102 +#: ../cli/src/network-manager.c:137 msgid "NetworkManager status" msgstr "Status von NetworkManager" -#: ../cli/src/network-manager.c:104 -msgid "NM running:" -msgstr "NM läuft:" +#. Print header +#: ../cli/src/network-manager.c:144 ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 ../cli/src/network-manager.c:328 +msgid "enabled" +msgstr "aktiviert" + +#: ../cli/src/network-manager.c:144 ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 ../cli/src/network-manager.c:328 +msgid "disabled" +msgstr "deaktiviert" -#: ../cli/src/network-manager.c:104 +#: ../cli/src/network-manager.c:152 msgid "running" msgstr "wird ausgeführt" -#: ../cli/src/network-manager.c:104 +#: ../cli/src/network-manager.c:152 msgid "not running" msgstr "wird nicht ausgeführt" -#: ../cli/src/network-manager.c:105 -msgid "NM state:" -msgstr "Status von NM:" +#: ../cli/src/network-manager.c:175 +#, c-format +msgid "Error: Couldn't connect to system bus: %s" +msgstr "Fehler: Verbindung zum Systembus konnte nicht hergestellt werden: %s" -#: ../cli/src/network-manager.c:106 -msgid "NM wireless hardware:" -msgstr "NM Funknetzwerk-Hardware:" +#: ../cli/src/network-manager.c:186 +#, c-format +msgid "Error: Couldn't create D-Bus object proxy." +msgstr "Fehler: D-Bus-Objektproxy konnte nicht erstellt werden." -#. no argument, show current state -#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 -msgid "NM wireless:" -msgstr "NM Funk:" +#: ../cli/src/network-manager.c:192 +#, c-format +msgid "Error in sleep: %s" +msgstr "Fehler beim schlafen gehen: %s" -#: ../cli/src/network-manager.c:108 -msgid "NM WWAN hardware:" -msgstr "NM WWAN-Hardware:" +#: ../cli/src/network-manager.c:237 ../cli/src/network-manager.c:286 +#: ../cli/src/network-manager.c:318 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "" +"Fehler: Der Wert »%s« für »--fields« ist hier nicht gültig; erlaubte Felder: %s" -#. no argument, show current state -#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 -msgid "NM WWAN:" -msgstr "NM WWAN:" +#: ../cli/src/network-manager.c:245 +msgid "Networking enabled" +msgstr "Netzwerk aktiviert" -#: ../cli/src/network-manager.c:150 +#: ../cli/src/network-manager.c:256 +#, c-format +msgid "Error: invalid 'enable' parameter: '%s'; use 'true' or 'false'." +msgstr "" +"Fehler: Ungültiger »aktiviert«-Parameter: »%s«; Verwenden Sie »true« oder " +"»false«." + +#: ../cli/src/network-manager.c:265 +#, c-format +msgid "Error: Sleeping status is not exported by NetworkManager." +msgstr "" +"Fehler: Der Schlafzustand-Status wurde von NetworkManager nicht exportiert." + +#: ../cli/src/network-manager.c:273 +#, c-format +msgid "Error: invalid 'sleep' parameter: '%s'; use 'true' or 'false'." +msgstr "" +"Fehler: Ungültiger »schlafend«-Parameter: »%s«; Verwenden Sie »true« oder " +"»false«." + +#: ../cli/src/network-manager.c:294 +msgid "WiFi enabled" +msgstr "WLAN aktiviert" + +#: ../cli/src/network-manager.c:305 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." msgstr "Fehler: Ungültiger »wifi«-Parameter: »%s«." -#: ../cli/src/network-manager.c:167 +#: ../cli/src/network-manager.c:326 +msgid "WWAN enabled" +msgstr "WWAN aktiviert" + +#: ../cli/src/network-manager.c:337 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." msgstr "Fehler: Ungültiger »wwan«-Parameter: »%s«." -#: ../cli/src/network-manager.c:178 +#: ../cli/src/network-manager.c:348 #, c-format msgid "Error: 'nm' command '%s' is not valid." msgstr "Fehler: Der Befehl »%s« für »nm« ist ungültig." -#: ../cli/src/nmcli.c:65 +#: ../cli/src/nmcli.c:69 #, c-format msgid "" "Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" "\n" "OPTIONS\n" -" -t[erse] terse output\n" -" -p[retty] pretty output\n" -" -v[ersion] show program version\n" -" -h[elp] print this help\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" "\n" "OBJECT\n" " nm NetworkManager status\n" @@ -833,7 +1054,11 @@ msgstr "" "\n" "OPTIONEN\n" " -t[erse] kurze Ausgabe\n" -" -p[retty] hübsche Ausgabe\n" +" -p[retty] hübsche Ausgabe\n" +" -m[ode] tabular|multiline Ausgabemodue\n" +" -f[ields] |all|common gibt Ausgabefelder an\n" +" -e[scape] yes|no Escape-Spaltenseparator in " +"Werten\n" " -v[ersion] Programmversion anzeigen\n" " -h[elp] diese Hilfe ausgeben\n" "\n" @@ -843,35 +1068,166 @@ msgstr "" " dev von NetworkManager verwaltete Verbindungen\n" "\n" -#: ../cli/src/nmcli.c:106 +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Fehler: Objekt »%s« ist unbekannt, versuchen Sie »nmcli help«." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Fehler: Option »---terse« wurde zweimal gesetzt." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Fehler: Option »--terse« schließt »--pretty« aus." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Fehler: Option »--pretty« wurde zweimal gesetzt." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Fehler: Option »--pretty« schließt »--terse« aus." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Fehler: Fehlendes Argument für die Option »%s«." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 #, c-format -msgid "Object '%s' is unknown, try 'nmcli help'." -msgstr "Objekt »%s« ist unbekannt, versuchen Sie »nmcli help«." +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Fehler: »%s« ist kein gültiges Argument für die Option »%s«." -#: ../cli/src/nmcli.c:139 +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Fehler: Felder für die Option »%s« fehlen." + +#: ../cli/src/nmcli.c:209 #, c-format msgid "nmcli tool, version %s\n" msgstr "nmcli-Werkzeug, Version %s\n" -#: ../cli/src/nmcli.c:145 +#: ../cli/src/nmcli.c:215 #, c-format -msgid "Option '%s' is unknown, try 'nmcli -help'." -msgstr "Option »%s« ist unbekannt, versuchen Sie »nmcli -help«." +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Fehler: Option »%s« ist unbekannt, versuchen Sie »nmcli -help«." -#: ../cli/src/nmcli.c:164 +#: ../cli/src/nmcli.c:234 #, c-format msgid "Caught signal %d, shutting down..." msgstr "Signal %d wurde empfangen, wird beendet …" -#: ../cli/src/nmcli.c:189 +#: ../cli/src/nmcli.c:259 #, c-format msgid "Error: Could not connect to NetworkManager." msgstr "Fehler: Verbindung mit NetworkManager konnte nicht hergestellt werden." -#: ../cli/src/nmcli.c:205 +#: ../cli/src/nmcli.c:275 msgid "Success" msgstr "Erfolg" +#: ../cli/src/settings.c:411 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (HEX-ASCII-Schlüssel)" + +#: ../cli/src/settings.c:413 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-bit-Passphrase)" + +#: ../cli/src/settings.c:416 +#, c-format +msgid "%d (unknown)" +msgstr "%d (unbekannt)" + +#: ../cli/src/settings.c:442 +msgid "0 (unknown)" +msgstr "0 (unbekannt)" + +#: ../cli/src/settings.c:448 +msgid "any, " +msgstr "jede," + +#: ../cli/src/settings.c:450 +msgid "900 MHz, " +msgstr "900 MHz," + +#: ../cli/src/settings.c:452 +msgid "1800 MHz, " +msgstr "1800 MHz," + +#: ../cli/src/settings.c:454 +msgid "1900 MHz, " +msgstr "1900 MHz," + +#: ../cli/src/settings.c:456 +msgid "850 MHz, " +msgstr "850 MHz," + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:468 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:470 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:554 ../cli/src/settings.c:721 +msgid "auto" +msgstr "auto" + +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 +msgid "not set" +msgstr "nicht gesetzt" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "Feld »%s« muss allein stehen" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "ungültiges Feld »%s«" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Optione »--terse« benötigt die Angabe von »--fields«" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "Option »--terse« benötigt bestimmte »--fields«-Werte, nicht »%s«" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." @@ -1206,39 +1562,141 @@ msgstr "PKCS#12-Datei konnte nicht überprüft werden: %d" msgid "Could not generate random data." msgstr "Es konnten keine Zufallsdaten generiert werden." -#: ../libnm-util/nm-utils.c:1924 +#: ../libnm-util/nm-utils.c:1975 #, c-format msgid "Not enough memory to make encryption key." msgstr "" "Nicht genügend freier Speicher zur Erstellung des Verschlüsselungsschlüssels." -#: ../libnm-util/nm-utils.c:2034 +#: ../libnm-util/nm-utils.c:2085 msgid "Could not allocate memory for PEM file creation." msgstr "" "Es konnte nicht genügend freier Speicher zur Erstellung der PEM-Datei " "angefordert werden." -#: ../libnm-util/nm-utils.c:2046 +#: ../libnm-util/nm-utils.c:2097 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "" "Es konnte nicht genügend freier Speicher zum Schreiben des IV in die PEM-" "Datei angefordert werden." -#: ../libnm-util/nm-utils.c:2058 +#: ../libnm-util/nm-utils.c:2109 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "" "Es konnte nicht genügend freier Speicher zum Schreiben des verschlüsselten " "Schlüssels in die PEM-Datei angefordert werden." -#: ../libnm-util/nm-utils.c:2077 +#: ../libnm-util/nm-utils.c:2128 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "" "Es konnte nicht genügend freier Speicher für die PEM-Datei angefordert " "werden." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Verbindungsfreigabe über ein geschütztes WLAN-Netzwerk" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Verbindungsfreigabe über ein offenes WLAN-Netzwerk" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Den ständigen Rechnernamen des Systems bearbeiten" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Systemverbindungen bearbeiten" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "" +"Die Systemrichtlinien verhindern das Bearbeiten von Systemeinstellungen" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "" +"Die Systemrichtlinien verhindern das Bearbeiten des ständigen Rechnernamens " +"des Systems" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"Die Systemrichtlinien verhindern Verbindungsfreigaben über ein geschütztes " +"WLAN-Netzwerk" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"Die Systemrichtlinien verhindern Verbindungsfreigaben über ein offenes WLAN-" +"Netzwerk" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "Die Kontrolle von Netzwerkverbindungen erlauben" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "Die Verwendung von benutzerspezifischen Verbindungen erlauben" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "WLAN-Geräte aktivieren oder deaktivieren" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "Mobile Breitbandgeräte aktivieren oder deaktivieren" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "System-Netzwerke aktivieren oder deaktivieren" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 +msgid "" +"Put NetworkManager to sleep or wake it up (should only be used by system " +"power management)" +msgstr "" +"NetworkManager in den Schlafzustand versetzen oder daraus aufwecken (Sollte " +"nur von der System-Energieverwaltung verwendet werden)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +msgid "System policy prevents control of network connections" +msgstr "" +"Die Systemrichtlinien verhindern die Kontrolle von Netzwerkverbindungen" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "" +"Die Systemrichtlinien verhindern die Aktivierung oder Deaktivierung von WLAN-" +"Geräten" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "" +"Die Systemrichtlinien verhindern die Aktivierung oder Deaktivierung mobiler " +"Breitbandgeräte" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +msgid "System policy prevents enabling or disabling system networking" +msgstr "" +"Die Systemrichtlinien verhindern die Aktivierung oder Deaktivierung von " +"System-Netzwerken" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "" +"Die Systemrichtlinien verhindern das in den Schlaf versetzen oder Aufwecken " +"von NetworkManager" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +msgid "System policy prevents use of user-specific connections" +msgstr "" +"Die Systemrichtlinien verhindern die Verwendung von benutzerspezifischen " +"Verbindungen" + #: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 #: ../src/nm-netlink-monitor.c:653 #, c-format @@ -1287,25 +1745,25 @@ msgstr "Der netlink-Gruppe konnte nicht beigetreten werden: %s" msgid "error updating link cache: %s" msgstr "Die Aktualisierung des Verbindungszwischenspeichers schlug fehl: %s" -#: ../src/main.c:502 +#: ../src/main.c:499 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "" "Ungültige Option. Verwenden Sie --help um eine Liste der verfügbaren " "Optionen zu erhalten.\n" -#: ../src/main.c:562 +#: ../src/main.c:570 #, c-format msgid "%s. Please use --help to see a list of valid options.\n" msgstr "" "%s. Verwenden Sie --help, um eine Liste der verfügbaren Optionen zu " "erhalten.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:328 msgid "# Created by NetworkManager\n" msgstr "# Erstellt von NetworkManager\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:344 #, c-format msgid "" "# Merged from %s\n" @@ -1314,19 +1772,19 @@ msgstr "" "# Zusammengeführt aus %s\n" "\n" -#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 msgid "no usable DHCP client could be found." msgstr "Es konnte kein verwendbarer DHCP-Client gefunden werden." -#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 msgid "'dhclient' could be found." msgstr "»dhclient« konnte nicht gefunden werden." -#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 msgid "'dhcpcd' could be found." msgstr "»dhcpcd« konnte nicht gefunden werden." -#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 #, c-format msgid "unsupported DHCP client '%s'" msgstr "Nicht unterstützter DHCP-Client »%s«" @@ -1341,13 +1799,13 @@ msgstr "Unbekannte Protokollstufe »%s«" msgid "Unknown log domain '%s'" msgstr "Unbekannte Protokolldomäne »%s«" -#: ../src/dns-manager/nm-dns-manager.c:343 +#: ../src/dns-manager/nm-dns-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "HINWEIS: Der libc-resolver unterstützt eventuell nicht mehr als drei " "Nameserver." -#: ../src/dns-manager/nm-dns-manager.c:345 +#: ../src/dns-manager/nm-dns-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "Die nachfolgend gelisteten Nameserver werden eventuell nicht erkannt." @@ -1356,48 +1814,165 @@ msgstr "Die nachfolgend gelisteten Nameserver werden eventuell nicht erkannt." msgid "Auto %s" msgstr "Auto %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3254 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3412 +#: ../system-settings/plugins/ifnet/connection_parser.c:49 msgid "System" msgstr "System" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 -msgid "Connection sharing via a protected WiFi network" -msgstr "Verbindungsfreigabe über ein geschütztes WLAN-Netzwerk" +#~ msgid "Type" +#~ msgstr "Typ" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 -msgid "Connection sharing via an open WiFi network" -msgstr "Verbindungsfreigabe über ein offenes WLAN-Netzwerk" +#~ msgid "Name" +#~ msgstr "Name" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 -msgid "Modify persistent system hostname" -msgstr "Den ständigen Rechnernamen des Systems bearbeiten" +#~ msgid "User connections:\n" +#~ msgstr "Benutzerverbindungen:\n" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 -msgid "Modify system connections" -msgstr "Systemverbindungen bearbeiten" +#~ msgid "System-wide connections" +#~ msgstr "Systemweite Verbindungen" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 -msgid "System policy prevents modification of system settings" -msgstr "" -"Die Systemrichtlinien verhindern das Bearbeiten von Systemeinstellungen" +#~ msgid "Default" +#~ msgstr "Vorgabe" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 -msgid "System policy prevents modification of the persistent system hostname" -msgstr "" -"Die Systemrichtlinien verhindern das Bearbeiten des ständigen Rechnernamens " -"des Systems" +#~ msgid "Service" +#~ msgstr "Dienst" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 -msgid "System policy prevents sharing connections via a protected WiFi network" -msgstr "" -"Die Systemrichtlinien verhindern Verbindungsfreigaben über ein geschütztes " -"WLAN-Netzwerk" +#~ msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +#~ msgstr "%s, %s, Frequenz %d MHz, Durchsatz %d Mb/s, Stärke %d" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 -msgid "System policy prevents sharing connections via an open WiFi network" -msgstr "" -"Die Systemrichtlinien verhindern Verbindungsfreigaben über ein offenes WLAN-" -"Netzwerk" +#~ msgid "Device" +#~ msgstr "Gerät" + +#~ msgid "Driver" +#~ msgstr "Treiber" + +#~ msgid "State" +#~ msgstr "Status" + +#~ msgid "HW Address" +#~ msgstr "Hardwareadresse" + +#~ msgid "" +#~ "\n" +#~ " Capabilities:\n" +#~ msgstr "" +#~ "\n" +#~ " Fähigkeiten:\n" + +#~ msgid "Carrier Detect" +#~ msgstr "Trägersignalkennung" + +#~ msgid "Speed" +#~ msgstr "Geschwindigkeit" + +#~ msgid "" +#~ "\n" +#~ " Wireless Properties\n" +#~ msgstr "" +#~ "\n" +#~ " Eigenschaften der Funkverbindung\n" + +#~ msgid "WEP Encryption" +#~ msgstr "WEP-Verschlüsselung" + +#~ msgid "WPA Encryption" +#~ msgstr "WPA-Verschlüsselung" + +#~ msgid "WPA2 Encryption" +#~ msgstr "WPA2-Verschlüsselung" + +#~ msgid "TKIP cipher" +#~ msgstr "TKIP-Chiffre" + +#~ msgid "CCMP cipher" +#~ msgstr "CCMP-Chiffre" + +#~ msgid "" +#~ "\n" +#~ " Wireless Access Points %s\n" +#~ msgstr "" +#~ "\n" +#~ " Funknetzwerk-Zugangspunkte %s\n" + +#~ msgid "(* = current AP)" +#~ msgstr "(* = momentaner Zugangspunkt)" + +#~ msgid "" +#~ "\n" +#~ " Wired Properties\n" +#~ msgstr "" +#~ "\n" +#~ " Eigenschaften der kabelgebundenen Verbindung\n" + +#~ msgid "Carrier" +#~ msgstr "Trägersignal" + +#~ msgid "" +#~ "\n" +#~ " IPv4 Settings:\n" +#~ msgstr "" +#~ "\n" +#~ " IPv4-Einstellungen:\n" + +#~ msgid "Address" +#~ msgstr "Adresse" + +#~ msgid "Prefix" +#~ msgstr "Präfix" + +#~ msgid "Gateway" +#~ msgstr "Gateway" + +#~ msgid "Device:" +#~ msgstr "Gerät:" + +#~ msgid "Error: hwaddr has to be specified." +#~ msgstr "Fehler: Es muss eine Hardwareadresse angegeben werden." + +#~ msgid "AP parameters" +#~ msgstr "Parameter des Zugangspunkts" + +#~ msgid "Frequency:" +#~ msgstr "Frequenz:" + +#~ msgid "Mode:" +#~ msgstr "Modus:" + +#~ msgid "Ad-hoc" +#~ msgstr "Ad-hoc" + +#~ msgid "Maximal bitrate:" +#~ msgstr "Maximale Übertragungsgeschwindigkeit:" + +#~ msgid "Strength:" +#~ msgstr "Stärke:" + +#~ msgid "Flags:" +#~ msgstr "Flags:" + +#~ msgid "privacy" +#~ msgstr "Vertraulichkeit" + +#~ msgid "WPA flags:" +#~ msgstr "WPA-Flags:" + +#~ msgid "RSN flags:" +#~ msgstr "RSN-Flags:" + +#~ msgid "NM running:" +#~ msgstr "NM läuft:" + +#~ msgid "NM state:" +#~ msgstr "Status von NM:" + +#~ msgid "NM wireless hardware:" +#~ msgstr "NM Funknetzwerk-Hardware:" + +#~ msgid "NM wireless:" +#~ msgstr "NM Funk:" + +#~ msgid "NM WWAN hardware:" +#~ msgstr "NM WWAN-Hardware:" #~ msgid "unable to join netlink group for monitoring link status: %s" #~ msgstr "" -- cgit v1.2.1 From 14a358f604afe0e73130a1c592c83af342d01fac Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 20 Sep 2010 14:27:06 -0500 Subject: core: be more robust to config file syntax issues Clearly we should be stripping spaces off plugin names if that's what the user happened to type. --- src/system-settings/nm-sysconfig-settings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system-settings/nm-sysconfig-settings.c b/src/system-settings/nm-sysconfig-settings.c index a9bae14b1e..7f6a640e72 100644 --- a/src/system-settings/nm-sysconfig-settings.c +++ b/src/system-settings/nm-sysconfig-settings.c @@ -414,7 +414,7 @@ load_plugins (NMSysconfigSettings *self, const char *plugins, GError **error) for (iter = plist; *iter; iter++) { GModule *plugin; char *full_name, *path; - const char *pname = *iter; + const char *pname = g_strstrip (*iter); GObject *obj; GObject * (*factory_func) (void); -- cgit v1.2.1 From 20acb482c53beabb59022be258f167233dd14959 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 21 Sep 2010 00:08:01 -0500 Subject: dns: allow random source ports for BIND caching DNS Despite most guides saying that without restricting to port 53 queries won't get through a firewall, I cannot make it work with this option. DNS queries through a WRT54G just time out even when the WRT54G isn't caching anything itself (ie, explicit upstream nameservers are the forwarders in the bind config). --- src/dns-manager/nm-dns-bind.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/dns-manager/nm-dns-bind.c b/src/dns-manager/nm-dns-bind.c index c225eb95d2..2e1ec67dec 100644 --- a/src/dns-manager/nm-dns-bind.c +++ b/src/dns-manager/nm-dns-bind.c @@ -349,7 +349,6 @@ update (NMDnsPlugin *plugin, g_string_append (conf, "options {\n" " directory \"" LOCALSTATEDIR "/named\";\n" - " query-source address * port 53;\n" " forward only;\n" " recursion yes;\n" " listen-on-v6 { ::1; };\n" -- cgit v1.2.1 From 06bd99f61779417453a049934ab136c8be9df955 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 21 Sep 2010 00:18:15 -0500 Subject: dns: write only 127.0.0.1 to resolv.conf when caching If all nameservers are listed in resolv.conf, glibc apparently tries them all (even if 'options rotate' isn't specified??). Leading to queries for internet hosts being directed to VPN-specific DNS servers in split-DNS situations. I've verified this with wireshark; I see queries going out over the tunnel to VPN nameservers for non-internal addresses, while BIND itself never logs anything about queries to VPN nameservers for that same address. Thus the only thing left is to blame glibc... --- src/dns-manager/nm-dns-manager.c | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/src/dns-manager/nm-dns-manager.c b/src/dns-manager/nm-dns-manager.c index a0c6a6c4ce..77ad9d73eb 100644 --- a/src/dns-manager/nm-dns-manager.c +++ b/src/dns-manager/nm-dns-manager.c @@ -253,7 +253,6 @@ dispatch_netconfig (const char *domain, char **nameservers, const char *nis_domain, char **nis_servers, - gboolean caching, const char *iface, GError **error) { @@ -281,8 +280,6 @@ dispatch_netconfig (const char *domain, str = g_strjoinv (" ", searches); if (domain) { - char *tmp; - tmp = g_strconcat (domain, " ", str, NULL); g_free (str); str = tmp; @@ -293,14 +290,9 @@ dispatch_netconfig (const char *domain, } if (nameservers) { - tmp = g_strjoinv (" ", nameservers); - if (caching) - str = g_strdup_printf ("127.0.0.1 %s", tmp); - else - str = g_strdup (tmp); + str = g_strjoinv (" ", nameservers); write_to_netconfig (fd, "DNSSERVERS", str); g_free (str); - g_free (tmp); } if (nis_domain) @@ -335,7 +327,6 @@ static gboolean write_resolv_conf (FILE *f, const char *domain, char **searches, char **nameservers, - gboolean caching, GError **error) { char *domain_str = NULL; @@ -367,14 +358,11 @@ write_resolv_conf (FILE *f, const char *domain, str = g_string_new (""); - if (caching) - g_string_append_printf (str, "nameserver 127.0.0.1\n"); - if (nameservers) { int num = g_strv_length (nameservers); for (i = 0; i < num; i++) { - if (i == 3 && !caching) { + if (i == 3) { g_string_append (str, "# "); g_string_append (str, _("NOTE: the libc resolver may not support more than 3 nameservers.")); g_string_append (str, "\n# "); @@ -408,7 +396,6 @@ static gboolean dispatch_resolvconf (const char *domain, char **searches, char **nameservers, - gboolean caching, const char *iface, GError **error) { @@ -430,7 +417,7 @@ dispatch_resolvconf (const char *domain, RESOLVCONF_PATH, g_strerror (errno)); else { - retval = write_resolv_conf (f, domain, searches, nameservers, caching, error); + retval = write_resolv_conf (f, domain, searches, nameservers, error); retval &= (pclose (f) == 0); } } else { @@ -450,7 +437,6 @@ static gboolean update_resolv_conf (const char *domain, char **searches, char **nameservers, - gboolean caching, const char *iface, GError **error) { @@ -498,7 +484,7 @@ update_resolv_conf (const char *domain, strcpy (tmp_resolv_conf_realpath, RESOLV_CONF); } - write_resolv_conf (f, domain, searches, nameservers, caching, error); + write_resolv_conf (f, domain, searches, nameservers, error); if (fclose (f) < 0) { if (*error == NULL) { @@ -728,20 +714,31 @@ update_dns (NMDnsManager *self, g_slist_free (dev_configs); g_slist_free (other_configs); + /* If caching was successful, we only send 127.0.0.1 to /etc/resolv.conf + * to ensure that the glibc resolver doesn't try to round-robin nameservers, + * but only uses the local caching nameserver. + */ + if (caching) { + if (nameservers) + g_strfreev (nameservers); + nameservers = g_new0 (char*, 2); + nameservers[0] = g_strdup ("127.0.0.1"); + } + #ifdef RESOLVCONF_PATH - success = dispatch_resolvconf (domain, searches, nameservers, caching, iface, error); + success = dispatch_resolvconf (domain, searches, nameservers, iface, error); #endif #ifdef TARGET_SUSE if (success == FALSE) { success = dispatch_netconfig (domain, searches, nameservers, nis_domain, nis_servers, - caching, iface, error); + iface, error); } #endif if (success == FALSE) - success = update_resolv_conf (domain, searches, nameservers, caching, iface, error); + success = update_resolv_conf (domain, searches, nameservers, iface, error); if (success) nm_system_update_dns (); -- cgit v1.2.1 From b008a486362fbac3c6460dbb4b864408531948a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 22 Sep 2010 12:26:44 +0200 Subject: cli: add D-Bus object path field for active connections (e.g.: nmcli -f name,uuid,dbus-path con status) --- cli/src/connections.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/src/connections.c b/cli/src/connections.c index cd1318eaf7..5099b502d9 100644 --- a/cli/src/connections.c +++ b/cli/src/connections.c @@ -65,9 +65,10 @@ static NmcOutputField nmc_fields_con_status[] = { {"DBUS-SERVICE", N_("DBUS-SERVICE"), 45, NULL, 0}, /* 5 */ {"SPEC-OBJECT", N_("SPEC-OBJECT"), 10, NULL, 0}, /* 6 */ {"VPN", N_("VPN"), 5, NULL, 0}, /* 7 */ + {"DBUS-PATH", N_("DBUS-PATH"), 51, NULL, 0}, /* 8 */ {NULL, NULL, 0, NULL, 0} }; -#define NMC_FIELDS_CON_STATUS_ALL "NAME,UUID,DEVICES,SCOPE,DEFAULT,VPN,DBUS-SERVICE,SPEC-OBJECT" +#define NMC_FIELDS_CON_STATUS_ALL "NAME,UUID,DEVICES,SCOPE,DEFAULT,VPN,DBUS-SERVICE,DBUS-PATH,SPEC-OBJECT" #define NMC_FIELDS_CON_STATUS_COMMON "NAME,UUID,DEVICES,SCOPE,DEFAULT,VPN" /* Available fields for 'con list' */ @@ -607,6 +608,7 @@ show_active_connection (gpointer data, gpointer user_data) info->nmc->allowed_fields[5].value = nm_active_connection_get_service_name (active); info->nmc->allowed_fields[6].value = nm_active_connection_get_specific_object (active); info->nmc->allowed_fields[7].value = NM_IS_VPN_CONNECTION (active) ? _("yes") : _("no"); + info->nmc->allowed_fields[8].value = nm_object_get_path (NM_OBJECT (active)); info->nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER_ADD & ~NMC_PF_FLAG_MAIN_HEADER_ONLY & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ print_fields (info->nmc->print_fields, info->nmc->allowed_fields); -- cgit v1.2.1 From 5e7b4e7d15e39a70b4180d3a86c6dfba36f2eadb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 22 Sep 2010 14:25:15 +0200 Subject: man: update nmcli man page --- man/nmcli.1.in | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/man/nmcli.1.in b/man/nmcli.1.in index 2fc99dc87b..44e9558ad2 100644 --- a/man/nmcli.1.in +++ b/man/nmcli.1.in @@ -22,7 +22,7 @@ .\" .\" Copyright (C) 2010 Red Hat, Inc. .\" -.TH NMCLI "1" "9 September 2010" +.TH NMCLI "1" "22 September 2010" .SH NAME nmcli \- command-line tool for controlling NetworkManager @@ -131,7 +131,7 @@ NetworkManager .br Use this object to inquire and change state of NetworkManager. .TP -.SS \fICOMMAND\fP := { status | sleep | wakeup | wifi | wwan } +.SS \fICOMMAND\fP := { status | enable | sleep | wifi | wwan } .sp .RS .TP @@ -145,28 +145,31 @@ command is provided to \fInm\fP object. No simple reference. .fi .TP -.B sleep +.B enable [true|false] .br -Put NetworkManager to sleeping mode. Thus all interfaces that NetworkManager -manages are deactivated. +Get networking-enabled status or enable/disable networking by NetworkManager. +All interfaces managed by NetworkManager are deactivated when networking has +been disabled. .br .nf \fBReference to D-Bus:\fP interface: org.freedesktop.NetworkManager -method: Sleep -arguments: TRUE +method: Enable +arguments: TRUE or FALSE .fi .TP -.B wakeup +.B sleep [true|false] .br -Awake NetworkManager from sleep. When NetworkManager is awaken, devices are -available to be activated. +Get sleep status or put to sleep/awake NetworkManager. All interfaces managed by NetworkManager +are deactivated when it falls asleep. This command is not meant for user to enable/disable +networking, use \fIenable\fP for that. D-Bus \fISleep\fP method is designed +to put NetworkManager to sleep or awake for suspending/resuming computer. .br .nf \fBReference to D-Bus:\fP interface: org.freedesktop.NetworkManager method: Sleep -arguments: FALSE +arguments: TRUE or FALSE .fi .TP .B wifi [on|off] -- cgit v1.2.1 From 0ec9bf2c73c9c73cbbe6e757c0857c67be971575 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 22 Sep 2010 13:20:02 -0500 Subject: libnm-util: enforce APN character restrictions APNs can only contain alphanumeric characters, '.', and '-'. To be helpful we strip spaces off before setting the APN internally so that previously (and incorrectly) valid APNs don't cause the whole connection to fail validation and thus disappear. The only case seen in the wild was a Pelephone IL APN which erroneously had a trailing space in the mobile broadband provider database. Bad characters cause the connection to fail with vague error messages about being unable to activate the PDP context during PPP negotiation. --- libnm-util/nm-setting-gsm.c | 39 +++++++++++++++++------ libnm-util/tests/test-general.c | 69 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 9 deletions(-) diff --git a/libnm-util/nm-setting-gsm.c b/libnm-util/nm-setting-gsm.c index 4b4560cd6d..575f94d382 100644 --- a/libnm-util/nm-setting-gsm.c +++ b/libnm-util/nm-setting-gsm.c @@ -231,12 +231,30 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) return FALSE; } - if (priv->apn && (strlen (priv->apn) < 1 || strchr (priv->apn, '"'))) { - g_set_error (error, - NM_SETTING_GSM_ERROR, - NM_SETTING_GSM_ERROR_INVALID_PROPERTY, - NM_SETTING_GSM_APN); - return FALSE; + if (priv->apn) { + guint32 apn_len = strlen (priv->apn); + guint32 i; + + if (apn_len < 1 || apn_len > 20) { + g_set_error (error, + NM_SETTING_GSM_ERROR, + NM_SETTING_GSM_ERROR_INVALID_PROPERTY, + NM_SETTING_GSM_APN); + return FALSE; + } + + /* APNs roughly follow the same rules as DNS domain names. Allowed + * characters are a-z, 0-9, . and -. GSM 03.60 Section 14.9. + */ + for (i = 0; i < apn_len; i++) { + if (!isalnum (priv->apn[i]) && (priv->apn[i] != '.') && (priv->apn[i] != '-')) { + g_set_error (error, + NM_SETTING_GSM_ERROR, + NM_SETTING_GSM_ERROR_INVALID_PROPERTY, + NM_SETTING_GSM_APN); + return FALSE; + } + } } if (priv->username && !strlen (priv->username)) { @@ -342,11 +360,11 @@ set_property (GObject *object, guint prop_id, break; case PROP_APN: g_free (priv->apn); - priv->apn = g_value_dup_string (value); + priv->apn = g_strstrip (g_value_dup_string (value)); break; case PROP_NETWORK_ID: g_free (priv->network_id); - priv->network_id = g_value_dup_string (value); + priv->network_id = g_strstrip (g_value_dup_string (value)); break; case PROP_NETWORK_TYPE: priv->network_type = g_value_get_int (value); @@ -503,6 +521,8 @@ nm_setting_gsm_class_init (NMSettingGsmClass *setting_class) * the user will be billed for their network usage and whether the user has * access to the Internet or just a provider-specific walled-garden, so it * is important to use the correct APN for the user's mobile broadband plan. + * The APN may only be composed of the characters a-z, 0-9, ., and - per + * GSM 03.60 Section 14.9. **/ g_object_class_install_property (object_class, PROP_APN, @@ -515,7 +535,8 @@ nm_setting_gsm_class_init (NMSettingGsmClass *setting_class) "user has access to the Internet or just a provider-" "specific walled-garden, so it is important to use " "the correct APN for the user's mobile broadband " - "plan.", + "plan. The APN may only be composed of the characters " + "a-z, 0-9, ., and - per GSM 03.60 Section 14.9.", NULL, G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); diff --git a/libnm-util/tests/test-general.c b/libnm-util/tests/test-general.c index 9530445959..855ee083fb 100644 --- a/libnm-util/tests/test-general.c +++ b/libnm-util/tests/test-general.c @@ -28,6 +28,7 @@ #include "nm-setting-connection.h" #include "nm-setting-vpn.h" +#include "nm-setting-gsm.h" #include "nm-setting-ip6-config.h" #include "nm-dbus-glib-types.h" @@ -222,6 +223,72 @@ test_setting_ip6_config_old_address_array (void) g_object_unref (s_ip6); } +static void +test_setting_gsm_apn_spaces (void) +{ + NMSettingGsm *s_gsm; + const char *tmp; + + s_gsm = (NMSettingGsm *) nm_setting_gsm_new (); + ASSERT (s_gsm != NULL, + "gsm-apn-spaces", + "error creating GSM setting"); + + /* Trailing space */ + g_object_set (s_gsm, NM_SETTING_GSM_APN, "foobar ", NULL); + tmp = nm_setting_gsm_get_apn (s_gsm); + ASSERT (tmp != NULL, + "gsm-apn-spaces", "empty APN"); + ASSERT (strcmp (tmp, "foobar") == 0, + "gsm-apn-spaces", "unexpected APN"); + + /* Leading space */ + g_object_set (s_gsm, NM_SETTING_GSM_APN, " foobar", NULL); + tmp = nm_setting_gsm_get_apn (s_gsm); + ASSERT (tmp != NULL, + "gsm-apn-spaces", "empty APN"); + ASSERT (strcmp (tmp, "foobar") == 0, + "gsm-apn-spaces", "unexpected APN"); +} + +static void +test_setting_gsm_apn_bad_chars (void) +{ + NMSettingGsm *s_gsm; + + s_gsm = (NMSettingGsm *) nm_setting_gsm_new (); + ASSERT (s_gsm != NULL, + "gsm-apn-bad-chars", + "error creating GSM setting"); + + g_object_set (s_gsm, NM_SETTING_GSM_NUMBER, "*99#", NULL); + + /* Make sure a valid APN works */ + g_object_set (s_gsm, NM_SETTING_GSM_APN, "foobar123.-baz", NULL); + ASSERT (nm_setting_verify (NM_SETTING (s_gsm), NULL, NULL) == TRUE, + "gsm-apn-bad-chars", "unexpectedly invalid GSM setting"); + + /* Random invalid chars */ + g_object_set (s_gsm, NM_SETTING_GSM_APN, "@#%$@#%@#%", NULL); + ASSERT (nm_setting_verify (NM_SETTING (s_gsm), NULL, NULL) == FALSE, + "gsm-apn-bad-chars", "unexpectedly valid GSM setting"); + + /* Spaces */ + g_object_set (s_gsm, NM_SETTING_GSM_APN, "foobar baz", NULL); + ASSERT (nm_setting_verify (NM_SETTING (s_gsm), NULL, NULL) == FALSE, + "gsm-apn-bad-chars", "unexpectedly valid GSM setting"); + + /* 0 characters long */ + g_object_set (s_gsm, NM_SETTING_GSM_APN, "", NULL); + ASSERT (nm_setting_verify (NM_SETTING (s_gsm), NULL, NULL) == FALSE, + "gsm-apn-bad-chars", "unexpectedly valid GSM setting"); + + /* 21-character long */ + g_object_set (s_gsm, NM_SETTING_GSM_APN, "abcdefghijklmnopqrstu", NULL); + ASSERT (nm_setting_verify (NM_SETTING (s_gsm), NULL, NULL) == FALSE, + "gsm-apn-bad-chars", "unexpectedly valid GSM setting"); +} + int main (int argc, char **argv) { GError *error = NULL; @@ -237,6 +304,8 @@ int main (int argc, char **argv) /* The tests */ test_setting_vpn_items (); test_setting_ip6_config_old_address_array (); + test_setting_gsm_apn_spaces (); + test_setting_gsm_apn_bad_chars (); base = g_path_get_basename (argv[0]); fprintf (stdout, "%s: SUCCESS\n", base); -- cgit v1.2.1 From a1731c60644432cdec94841a033340bfc88568ec Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 22 Sep 2010 13:43:23 -0500 Subject: libnm-util: fix max APN length It's not 20, it's DNS domain name length. --- libnm-util/nm-setting-gsm.c | 2 +- libnm-util/tests/test-general.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libnm-util/nm-setting-gsm.c b/libnm-util/nm-setting-gsm.c index 575f94d382..e9d06bea10 100644 --- a/libnm-util/nm-setting-gsm.c +++ b/libnm-util/nm-setting-gsm.c @@ -235,7 +235,7 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) guint32 apn_len = strlen (priv->apn); guint32 i; - if (apn_len < 1 || apn_len > 20) { + if (apn_len < 1 || apn_len > 64) { g_set_error (error, NM_SETTING_GSM_ERROR, NM_SETTING_GSM_ERROR_INVALID_PROPERTY, diff --git a/libnm-util/tests/test-general.c b/libnm-util/tests/test-general.c index 855ee083fb..e91e2b5ce2 100644 --- a/libnm-util/tests/test-general.c +++ b/libnm-util/tests/test-general.c @@ -283,8 +283,8 @@ test_setting_gsm_apn_bad_chars (void) ASSERT (nm_setting_verify (NM_SETTING (s_gsm), NULL, NULL) == FALSE, "gsm-apn-bad-chars", "unexpectedly valid GSM setting"); - /* 21-character long */ - g_object_set (s_gsm, NM_SETTING_GSM_APN, "abcdefghijklmnopqrstu", NULL); + /* 65-character long */ + g_object_set (s_gsm, NM_SETTING_GSM_APN, "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl1", NULL); ASSERT (nm_setting_verify (NM_SETTING (s_gsm), NULL, NULL) == FALSE, "gsm-apn-bad-chars", "unexpectedly valid GSM setting"); } -- cgit v1.2.1 From 8199c7275b51f42f8417bb0807b2aa1bb2cd6df7 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 22 Sep 2010 16:32:00 -0500 Subject: dns: warn that the BIND plugin is experimental It's still got a bunch of issues that need debugging, like when VPN nameservers exist but no domain and thus not doing split DNS, sometimes hosts outside the VPN don't resolve correctly, which was previously masked by having the non-VPN nameservers in /etc/resolv.conf where glibc would erroneously use them instead of asking BIND. To be fixed in a subsequent patch. The dnsmasq plugin seems to work great though. --- man/NetworkManager.conf.5.in | 4 ---- src/dns-manager/nm-dns-manager.c | 5 +++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/man/NetworkManager.conf.5.in b/man/NetworkManager.conf.5.in index 4e2bae9eb6..e0025e78d4 100644 --- a/man/NetworkManager.conf.5.in +++ b/man/NetworkManager.conf.5.in @@ -117,10 +117,6 @@ DNS data to applications that use it. .TP .I dnsmasq this plugin uses dnsmasq to provide local caching nameserver functionality. -.TP -.I bind -this plugin uses the ISC BIND program to provide local caching nameserver -functionality. .RE .SS [keyfile] This section contains keyfile-specific options and thus only has effect when using \fIkeyfile\fP plugin. diff --git a/src/dns-manager/nm-dns-manager.c b/src/dns-manager/nm-dns-manager.c index 77ad9d73eb..71adbc5263 100644 --- a/src/dns-manager/nm-dns-manager.c +++ b/src/dns-manager/nm-dns-manager.c @@ -1007,9 +1007,10 @@ load_plugins (NMDnsManager *self, const char **plugins) for (iter = plugins; iter && *iter; iter++) { if (!strcasecmp (*iter, "dnsmasq")) plugin = NM_DNS_PLUGIN (nm_dns_dnsmasq_new ()); - else if (!strcasecmp (*iter, "bind")) + else if (!strcasecmp (*iter, "bind")) { plugin = NM_DNS_PLUGIN (nm_dns_bind_new ()); - else { + nm_log_warn (LOGD_DNS, "The BIND plugin is experimental!"); + } else { nm_log_warn (LOGD_DNS, "Unknown DNS plugin '%s'", *iter);\ continue; } -- cgit v1.2.1 From b3aa9473c5d06988c79fe569a5eb5a677164dc09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Fri, 24 Sep 2010 14:38:50 +0200 Subject: cli: add D-Bus object path field for devices (e.g.: nmcli -f device,dbus-path dev status) --- cli/src/devices.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cli/src/devices.c b/cli/src/devices.c index 7c9dcc5210..436b4b6eb8 100644 --- a/cli/src/devices.c +++ b/cli/src/devices.c @@ -58,12 +58,13 @@ /* Available fields for 'dev status' */ static NmcOutputField nmc_fields_dev_status[] = { - {"DEVICE", N_("DEVICE"), 10, NULL, 0}, /* 0 */ - {"TYPE", N_("TYPE"), 17, NULL, 0}, /* 1 */ - {"STATE", N_("STATE"), 12, NULL, 0}, /* 2 */ - {NULL, NULL, 0, NULL, 0} + {"DEVICE", N_("DEVICE"), 10, NULL, 0}, /* 0 */ + {"TYPE", N_("TYPE"), 17, NULL, 0}, /* 1 */ + {"STATE", N_("STATE"), 13, NULL, 0}, /* 2 */ + {"DBUS-PATH", N_("DBUS-PATH"), 43, NULL, 0}, /* 3 */ + {NULL, NULL, 0, NULL, 0} }; -#define NMC_FIELDS_DEV_STATUS_ALL "DEVICE,TYPE,STATE" +#define NMC_FIELDS_DEV_STATUS_ALL "DEVICE,TYPE,STATE,DBUS-PATH" #define NMC_FIELDS_DEV_STATUS_COMMON "DEVICE,TYPE,STATE" @@ -763,6 +764,7 @@ show_device_status (NMDevice *device, NmCli *nmc) nmc->allowed_fields[0].value = nm_device_get_iface (device); nmc->allowed_fields[1].value = get_device_type (device); nmc->allowed_fields[2].value = device_state_to_string (nm_device_get_state (device)); + nmc->allowed_fields[3].value = nm_object_get_path (NM_OBJECT (device)); nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER_ADD & ~NMC_PF_FLAG_MAIN_HEADER_ONLY & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ print_fields (nmc->print_fields, nmc->allowed_fields); -- cgit v1.2.1 From 596cf1a232d33c0dbeee61d8e927d7a09f40159f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 24 Sep 2010 14:12:58 -0500 Subject: wifi: use PMKSA caching with PEAP-GTC (rh #615032) (rh #636877) We don't want to require a full 802.1x reauth when using OTP tokens and roaming between APs in the same ESS, since that takes a long time (user has to find the token and type in the code). --- src/supplicant-manager/nm-supplicant-config.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/supplicant-manager/nm-supplicant-config.c b/src/supplicant-manager/nm-supplicant-config.c index b516de520b..e33f67abf5 100644 --- a/src/supplicant-manager/nm-supplicant-config.c +++ b/src/supplicant-manager/nm-supplicant-config.c @@ -711,6 +711,8 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self, gboolean success, added; GString *phase1, *phase2; const GByteArray *array; + gboolean peap = FALSE; + guint32 i, num_eap; g_return_val_if_fail (NM_IS_SUPPLICANT_CONFIG (self), FALSE); g_return_val_if_fail (setting != NULL, FALSE); @@ -733,6 +735,28 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self, ADD_STRING_LIST_VAL (setting, 802_1x, eap_method, eap_methods, "eap", TRUE, FALSE); + /* Check for PEAP + GTC */ + num_eap = nm_setting_802_1x_get_num_eap_methods (setting); + for (i = 0; i < num_eap; i++) { + const char *method = nm_setting_802_1x_get_eap_method (setting, i); + + if (method && (strcasecmp (method, "peap") == 0)) { + peap = TRUE; + break; + } + } + + /* When using PEAP-GTC, we're likely using Cisco kit, so we want to turn + * on PMKSA caching so that roaming between access points actually works + * without a full reauth (which requires a new token code). We may want + * to extend this to all PEAP phase2 methods at some point. + */ + value = nm_setting_802_1x_get_phase2_auth (setting); + if (peap && value && (strcasecmp (value, "gtc") == 0)) { + if (!nm_supplicant_config_add_option (self, "proactive_key_caching", "1", -1, FALSE)) + return FALSE; + } + /* Drop the fragment size a bit for better compatibility */ if (!nm_supplicant_config_add_option (self, "fragment_size", "1300", -1, FALSE)) return FALSE; -- cgit v1.2.1 From 9e2ec0b7a1452940aa328abc61389e2ee5a533ab Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 24 Sep 2010 18:25:45 -0500 Subject: system-settings: fix use-after-free causing crashes when hostname is empty Should be returning NULL here since the actual hostname is returned in the for() loop if the plugin supports hostnames. But if the plugin for some reason returns an empty string (which they aren't supposed to do) then hostname would be left assigned to an already-freed value, which was then returned to higher layers. ==12331== Invalid free() / delete / delete[] ==12331== at 0x4024B3A: free (vg_replace_malloc.c:366) ==12331== by 0x448BFC5: g_free (gmem.c:191) ==12331== by 0x43E0E05: value_free_string (gvaluetypes.c:268) ==12331== by 0x43DC587: g_value_unset (gvalue.c:276) ==12331== by 0x80B297F: notify (nm-sysconfig-settings.c:229) ==12331== by 0x43C64E7: g_cclosure_marshal_VOID__PARAM (gmarshal.c:531) ==12331== by 0x43B78B8: g_type_class_meta_marshal (gclosure.c:878) ==12331== by 0x43B9251: g_closure_invoke (gclosure.c:767) ==12331== by 0x43CD239: signal_emit_unlocked_R (gsignal.c:3178) ==12331== by 0x43CEDB3: g_signal_emit_valist (gsignal.c:2981) ==12331== by 0x43CF255: g_signal_emit (gsignal.c:3038) ==12331== by 0x43BD630: g_object_dispatch_properties_changed (gobject.c:801) ==12331== Address 0x479f208 is 0 bytes inside a block of size 1 free'd ==12331== at 0x4024B3A: free (vg_replace_malloc.c:366) ==12331== by 0x448BFC5: g_free (gmem.c:191) ==12331== by 0x80B1A08: nm_sysconfig_settings_get_hostname (nm-sysconfig-settings.c:280) ==12331== by 0x80B27C7: get_property (nm-sysconfig-settings.c:1415) ==12331== by 0x43BC707: g_object_get_property (gobject.c:935) ==12331== by 0x80B288D: notify (nm-sysconfig-settings.c:225) ==12331== by 0x43C64E7: g_cclosure_marshal_VOID__PARAM (gmarshal.c:531) ==12331== by 0x43B78B8: g_type_class_meta_marshal (gclosure.c:878) ==12331== by 0x43B9251: g_closure_invoke (gclosure.c:767) ==12331== by 0x43CD239: signal_emit_unlocked_R (gsignal.c:3178) ==12331== by 0x43CEDB3: g_signal_emit_valist (gsignal.c:2981) ==12331== by 0x43CF255: g_signal_emit (gsignal.c:3038) --- src/system-settings/nm-sysconfig-settings.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/system-settings/nm-sysconfig-settings.c b/src/system-settings/nm-sysconfig-settings.c index 7f6a640e72..616f8b1cf6 100644 --- a/src/system-settings/nm-sysconfig-settings.c +++ b/src/system-settings/nm-sysconfig-settings.c @@ -259,6 +259,7 @@ get_plugin (NMSysconfigSettings *self, guint32 capability) return NULL; } +/* Returns an allocated string which the caller owns and must eventually free */ char * nm_sysconfig_settings_get_hostname (NMSysconfigSettings *self) { @@ -281,7 +282,7 @@ nm_sysconfig_settings_get_hostname (NMSysconfigSettings *self) } } - return hostname; + return NULL; } static void -- cgit v1.2.1 From 6f2aa8a817c3696b2ac946a1f08385fbaf3812b9 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 24 Sep 2010 18:54:37 -0500 Subject: ifupdown: return NULL hostname, not a zero-length string --- system-settings/plugins/ifupdown/plugin.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/system-settings/plugins/ifupdown/plugin.c b/system-settings/plugins/ifupdown/plugin.c index 5ccdcc8d4a..33c058e5b4 100644 --- a/system-settings/plugins/ifupdown/plugin.c +++ b/system-settings/plugins/ifupdown/plugin.c @@ -565,6 +565,12 @@ update_system_hostname(NMInotifyHelper *inotify_helper, priv->hostname = g_strstrip(hostname_file); + /* We shouldn't return a zero-length hostname, but NULL */ + if (priv->hostname && !strlen (priv->hostname)) { + g_free (priv->hostname); + priv->hostname = NULL; + } + g_object_notify (G_OBJECT (config), NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME); } -- cgit v1.2.1 From b80f31e19177d2f2d0881c3e99b608407aaec16d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 25 Sep 2010 00:34:10 -0500 Subject: trivial: typo fixes Sent by a Debian user to Michael Biebl. No other attribution information available. Thanks Debian user! --- ChangeLog | 6 +++--- README | 4 ++-- libnm-glib/nm-device.c | 2 +- src/dhcp-manager/nm-dhcp-dhclient.c | 2 +- src/nm-device.c | 4 ++-- system-settings/plugins/ifcfg-rh/reader.c | 2 +- system-settings/plugins/keyfile/reader.c | 2 +- system-settings/plugins/keyfile/writer.c | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index d529664b9e..b611b3d4f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1317,7 +1317,7 @@ 2008-09-30 Dan Williams * src/NetworkManagerPolicy.c - - (lookup_thread_worker): don't store the idle handler ID becuase the + - (lookup_thread_worker): don't store the idle handler ID because the idle handler could have already run and freed the LookupThread structure @@ -8391,7 +8391,7 @@ internally; clients should provide a setting that applies to the device with 'autoconnect: True'. Problem was that these internally auto-created connections don't have a proxy or service - name becuase they weren't created by a settings daemon, and therefore + name because they weren't created by a settings daemon, and therefore clients have no idea what to do with them. 2007-10-03 Dan Williams @@ -9794,7 +9794,7 @@ * libnm-glib/nm-settings.c libnm-glib/nm-settings.h - make the dbus path a property of the object, and autogenerate it. - It can't be composed of the 'id' field becuase that's not available + It can't be composed of the 'id' field because that's not available yet during the GObject creation in nm_connection_settings_init() 2007-08-29 Dan Williams diff --git a/README b/README index acb807bfbf..286cabcb13 100644 --- a/README +++ b/README @@ -66,11 +66,11 @@ those drivers that are shipped with the upstream Linux kernel, because only those drivers can be easily fixed and debugged. ndiswrapper, vendor binary drivers, or other out-of-tree drivers may or may not work well with NetworkManager, precisely because they have not been vetted and improved by the -open-source community, and becuase problems in these drivers usually cannot +open-source community, and because problems in these drivers usually cannot be fixed. Sometimes, command-line tools like 'iwconfig' will work, but NetworkManager will -fail. This is again often due to buggy drivers, becuase these drivers simply +fail. This is again often due to buggy drivers, because these drivers simply aren't expecting the dynamic requests that NetworkManager and wpa_supplicant make. Driver bugs should be filed in the bug tracker of the distribution being run, since often distributions customize their kernel and drivers. diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c index a38c646a25..ea2a91d1ce 100644 --- a/libnm-glib/nm-device.c +++ b/libnm-glib/nm-device.c @@ -1165,7 +1165,7 @@ nm_device_update_description (NMDevice *device) * vendor and device ID information off it. */ - /* Ref the device again becuase we have to unref it each iteration, + /* Ref the device again because we have to unref it each iteration, * as g_udev_device_get_parent() returns a ref-ed object. */ tmpdev = g_object_ref (udev_device); diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c index 13caa028f9..2f25fca98b 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.c +++ b/src/dhcp-manager/nm-dhcp-dhclient.c @@ -390,7 +390,7 @@ merge_dhclient_config (const char *iface, } /* If the client ID is just hex digits and : then don't use quotes, - * becuase dhclient expects either a quoted ASCII string, or a byte + * because dhclient expects either a quoted ASCII string, or a byte * array formated as hex octets separated by : */ if (is_octets) diff --git a/src/nm-device.c b/src/nm-device.c index abffe1264f..a7f7b868bb 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -3767,7 +3767,7 @@ nm_device_state_changed (NMDevice *device, case NM_DEVICE_STATE_UNAVAILABLE: /* If the device can activate now (ie, it's got a carrier, the supplicant * is active, or whatever) schedule a delayed transition to DISCONNECTED - * to get things rolling. The device can't transition immediately becuase + * to get things rolling. The device can't transition immediately because * we can't change states again from the state handler for a variety of * reasons. */ @@ -3788,7 +3788,7 @@ nm_device_state_changed (NMDevice *device, case NM_DEVICE_STATE_FAILED: nm_log_warn (LOGD_DEVICE, "Activation (%s) failed.", nm_device_get_iface (device)); /* Schedule the transition to DISCONNECTED. The device can't transition - * immediately becuase we can't change states again from the state + * immediately because we can't change states again from the state * handler for a variety of reasons. */ priv->failed_to_disconnected_id = g_idle_add (failed_to_disconnected, device); diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index f1bf540e0b..9aefa9c5e5 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -1877,7 +1877,7 @@ parse_wpa_psk (shvarFile *ifcfg, char *psk = NULL, *p, *hashed = NULL; gboolean quoted = FALSE; - /* Passphrase must be between 10 and 66 characters in length becuase WPA + /* Passphrase must be between 10 and 66 characters in length because WPA * hex keys are exactly 64 characters (no quoting), and WPA passphrases * are between 8 and 63 characters (inclusive), plus optional quoting if * the passphrase contains spaces. diff --git a/system-settings/plugins/keyfile/reader.c b/system-settings/plugins/keyfile/reader.c index a5b4219c4a..841315d9c6 100644 --- a/system-settings/plugins/keyfile/reader.c +++ b/system-settings/plugins/keyfile/reader.c @@ -802,7 +802,7 @@ typedef struct { void (*parser) (NMSetting *setting, const char *key, GKeyFile *keyfile); } KeyParser; -/* A table of keys that require further parsing/conversion becuase they are +/* A table of keys that require further parsing/conversion because they are * stored in a format that can't be automatically read using the key's type. * i.e. IPv4 addresses, which are stored in NetworkManager as guint32, but are * stored in keyfiles as strings, eg "10.1.1.2" or IPv6 addresses stored diff --git a/system-settings/plugins/keyfile/writer.c b/system-settings/plugins/keyfile/writer.c index fdba70c969..ffac35cff5 100644 --- a/system-settings/plugins/keyfile/writer.c +++ b/system-settings/plugins/keyfile/writer.c @@ -503,7 +503,7 @@ typedef struct { void (*writer) (GKeyFile *keyfile, NMSetting *setting, const char *key, const GValue *value); } KeyWriter; -/* A table of keys that require further parsing/conversion becuase they are +/* A table of keys that require further parsing/conversion because they are * stored in a format that can't be automatically read using the key's type. * i.e. IPv4 addresses, which are stored in NetworkManager as guint32, but are * stored in keyfiles as strings, eg "10.1.1.2" or IPv6 addresses stored -- cgit v1.2.1 From 358261ccd9d1cf4b97969136d657e7c49be52bc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 27 Sep 2010 09:53:51 +0200 Subject: core: read initial MAC address on startup; reset to this MAC when disconnecting Previously, NM reset permanent MAC to an interface while disconnecting. That basically ignored MAC addresses set before NM started managing the interface. Now, the initial MAC address is remembered and set back to the interface when disconnecting. --- src/nm-device-ethernet.c | 37 +++++++++++++++++++++++++++++++++---- src/nm-device-wifi.c | 35 ++++++++++++++++++++++++++++++++--- src/nm-device.c | 3 +++ src/nm-device.h | 1 + 4 files changed, 69 insertions(+), 7 deletions(-) diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index 393b921c65..08bbc50112 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -107,8 +107,9 @@ typedef struct Supplicant { typedef struct { gboolean disposed; - guint8 hw_addr[ETH_ALEN]; /* Currently set MAC address */ - guint8 perm_hw_addr[ETH_ALEN]; /* Currently set MAC address */ + guint8 hw_addr[ETH_ALEN]; /* Currently set MAC address */ + guint8 perm_hw_addr[ETH_ALEN]; /* Permanent MAC address */ + guint8 initial_hw_addr[ETH_ALEN]; /* Initial MAC address (as seen when NM starts) */ gboolean carrier; NMNetlinkMonitor * monitor; @@ -739,6 +740,33 @@ real_update_permanent_hw_address (NMDevice *dev) close (fd); } +static void +real_update_initial_hw_address (NMDevice *dev) +{ + NMDeviceEthernet *self = NM_DEVICE_ETHERNET (dev); + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + char *mac_str = NULL; + guint8 *addr = priv->initial_hw_addr; + guint8 zero[ETH_ALEN] = {0,0,0,0,0,0}; + + /* This sets initial MAC address from current MAC address. It should only + * be called from NMDevice constructor() to really get the initial address. + */ + if (!memcmp (&priv->hw_addr, &zero, ETH_ALEN)) + real_update_hw_address (dev); + + if (memcmp (&priv->initial_hw_addr, &priv->hw_addr, ETH_ALEN)) + memcpy (&priv->initial_hw_addr, &priv->hw_addr, ETH_ALEN); + + mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", + addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); + + nm_log_dbg (LOGD_DEVICE | LOGD_ETHER, "(%s): read initial MAC address %s", + nm_device_get_iface (dev), mac_str); + + g_free (mac_str); +} + static guint32 real_get_generic_capabilities (NMDevice *dev) { @@ -1735,8 +1763,8 @@ real_deactivate_quickly (NMDevice *device) supplicant_interface_release (self); - /* Reset MAC address back to permanent address */ - _set_hw_addr (self, priv->perm_hw_addr, "reset"); + /* Reset MAC address back to initial address */ + _set_hw_addr (self, priv->initial_hw_addr, "reset"); } static gboolean @@ -2110,6 +2138,7 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *klass) parent_class->can_interrupt_activation = real_can_interrupt_activation; parent_class->update_hw_address = real_update_hw_address; parent_class->update_permanent_hw_address = real_update_permanent_hw_address; + parent_class->update_initial_hw_address = real_update_initial_hw_address; parent_class->get_best_auto_connection = real_get_best_auto_connection; parent_class->is_available = real_is_available; parent_class->connection_secrets_updated = real_connection_secrets_updated; diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 3973fe7bc5..b09d112547 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -146,8 +146,9 @@ typedef struct Supplicant { struct _NMDeviceWifiPrivate { gboolean disposed; - guint8 hw_addr[ETH_ALEN]; /* Currently set MAC address */ - guint8 perm_hw_addr[ETH_ALEN]; /* Permanent MAC address */ + guint8 hw_addr[ETH_ALEN]; /* Currently set MAC address */ + guint8 perm_hw_addr[ETH_ALEN]; /* Permanent MAC address */ + guint8 initial_hw_addr[ETH_ALEN]; /* Initial MAC address (as seen when NM starts) */ /* Legacy rfkill for ipw2x00; will be fixed with 2.6.33 kernel */ char * ipw_rfkill_path; @@ -1250,7 +1251,8 @@ real_deactivate_quickly (NMDevice *dev) g_object_unref (orig_ap); } - _set_hw_addr (self, priv->perm_hw_addr, "reset"); + /* Reset MAC address back to initial address */ + _set_hw_addr (self, priv->initial_hw_addr, "reset"); } static void @@ -3106,6 +3108,32 @@ real_update_permanent_hw_address (NMDevice *dev) close (fd); } +static void +real_update_initial_hw_address (NMDevice *dev) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (dev); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + char *mac_str = NULL; + guint8 *addr = priv->initial_hw_addr; + guint8 zero[ETH_ALEN] = {0,0,0,0,0,0}; + + /* This sets initial MAC address from current MAC address. It should only + * be called from NMDevice constructor() to really get the initial address. + */ + if (!memcmp (&priv->hw_addr, &zero, ETH_ALEN)) + real_update_hw_address (dev); + + if (memcmp (&priv->initial_hw_addr, &priv->hw_addr, ETH_ALEN)) + memcpy (&priv->initial_hw_addr, &priv->hw_addr, ETH_ALEN); + + mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", + addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); + + nm_log_dbg (LOGD_DEVICE | LOGD_ETHER, "(%s): read initial MAC address %s", + nm_device_get_iface (dev), mac_str); + + g_free (mac_str); +} static NMActStageReturn real_act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason) @@ -3935,6 +3963,7 @@ nm_device_wifi_class_init (NMDeviceWifiClass *klass) parent_class->take_down = real_take_down; parent_class->update_hw_address = real_update_hw_address; parent_class->update_permanent_hw_address = real_update_permanent_hw_address; + parent_class->update_initial_hw_address = real_update_initial_hw_address; parent_class->get_best_auto_connection = real_get_best_auto_connection; parent_class->is_available = real_is_available; parent_class->connection_secrets_updated = real_connection_secrets_updated; diff --git a/src/nm-device.c b/src/nm-device.c index a7f7b868bb..6b12471adc 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -288,6 +288,9 @@ constructor (GType type, if (NM_DEVICE_GET_CLASS (dev)->update_permanent_hw_address) NM_DEVICE_GET_CLASS (dev)->update_permanent_hw_address (dev); + if (NM_DEVICE_GET_CLASS (dev)->update_initial_hw_address) + NM_DEVICE_GET_CLASS (dev)->update_initial_hw_address (dev); + priv->dhcp_manager = nm_dhcp_manager_get (); update_accept_ra_save (dev); diff --git a/src/nm-device.h b/src/nm-device.h index ca067f441e..db2b1b7db0 100644 --- a/src/nm-device.h +++ b/src/nm-device.h @@ -73,6 +73,7 @@ typedef struct { void (* update_hw_address) (NMDevice *self); void (* update_permanent_hw_address) (NMDevice *self); + void (* update_initial_hw_address) (NMDevice *self); guint32 (* get_type_capabilities) (NMDevice *self); guint32 (* get_generic_capabilities) (NMDevice *self); -- cgit v1.2.1 From facf6b176f2d531dc1cbf797d214ae695b69ffca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 27 Sep 2010 10:34:56 +0200 Subject: core: add Version property to org.freedesktop.NetworkManager interface --- introspection/nm-manager-client.xml | 1 + introspection/nm-manager.xml | 6 ++++++ src/nm-manager.c | 12 ++++++++++++ src/nm-manager.h | 1 + 4 files changed, 20 insertions(+) diff --git a/introspection/nm-manager-client.xml b/introspection/nm-manager-client.xml index f30d1d671d..24e4a29eb5 100644 --- a/introspection/nm-manager-client.xml +++ b/introspection/nm-manager-client.xml @@ -61,6 +61,7 @@ object. dbus-glib generates the same bound function names for D-Bus the methods + diff --git a/introspection/nm-manager.xml b/introspection/nm-manager.xml index e1b466799f..f281d9d2c4 100644 --- a/introspection/nm-manager.xml +++ b/introspection/nm-manager.xml @@ -206,6 +206,12 @@ + + + NetworkManager version. + + + The overall state of the NetworkManager daemon. diff --git a/src/nm-manager.c b/src/nm-manager.c index abe30bf688..591c073125 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -274,6 +274,7 @@ static guint signals[LAST_SIGNAL] = { 0 }; enum { PROP_0, + PROP_VERSION, PROP_STATE, PROP_NETWORKING_ENABLED, PROP_WIRELESS_ENABLED, @@ -4398,6 +4399,9 @@ get_property (GObject *object, guint prop_id, NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); switch (prop_id) { + case PROP_VERSION: + g_value_set_string (value, VERSION); + break; case PROP_STATE: nm_manager_update_state (self); g_value_set_uint (value, priv->state); @@ -4587,6 +4591,14 @@ nm_manager_class_init (NMManagerClass *manager_class) object_class->dispose = dispose; /* properties */ + g_object_class_install_property + (object_class, PROP_VERSION, + g_param_spec_string (NM_MANAGER_VERSION, + "Version", + "NetworkManager version", + NULL, + G_PARAM_READABLE)); + g_object_class_install_property (object_class, PROP_STATE, g_param_spec_uint (NM_MANAGER_STATE, diff --git a/src/nm-manager.h b/src/nm-manager.h index 889938d977..280d554b2b 100644 --- a/src/nm-manager.h +++ b/src/nm-manager.h @@ -35,6 +35,7 @@ #define NM_IS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_MANAGER)) #define NM_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_MANAGER, NMManagerClass)) +#define NM_MANAGER_VERSION "version" #define NM_MANAGER_STATE "state" #define NM_MANAGER_NETWORKING_ENABLED "networking-enabled" #define NM_MANAGER_WIRELESS_ENABLED "wireless-enabled" -- cgit v1.2.1 From db3f91deae380db395d34c1fff600e4bad9dccd6 Mon Sep 17 00:00:00 2001 From: Pat Suwalski Date: Mon, 27 Sep 2010 11:08:03 +0200 Subject: system-settings: allow glob (*) in no-auto-default config file option When * is used instead of MAC addresses' list, no-auto-default option is valid for all interfaces. --- src/system-settings/nm-sysconfig-settings.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/system-settings/nm-sysconfig-settings.c b/src/system-settings/nm-sysconfig-settings.c index 616f8b1cf6..d929813f1b 100644 --- a/src/system-settings/nm-sysconfig-settings.c +++ b/src/system-settings/nm-sysconfig-settings.c @@ -1078,6 +1078,11 @@ is_mac_auto_wired_blacklisted (NMSysconfigSettings *self, const GByteArray *mac) for (iter = list; iter && *iter; iter++) { struct ether_addr *candidate; + if (strcmp(g_strstrip(*iter), "*") == 0) { + found = TRUE; + break; + } + candidate = ether_aton (*iter); if (candidate && !memcmp (mac->data, candidate->ether_addr_octet, ETH_ALEN)) { found = TRUE; @@ -1137,13 +1142,19 @@ default_wired_deleted (NMDefaultWiredConnection *wired, g_key_file_load_from_file (config, priv->config_file, G_KEY_FILE_KEEP_COMMENTS, NULL); list = g_key_file_get_string_list (config, "main", CONFIG_KEY_NO_AUTO_DEFAULT, &len, NULL); - /* Traverse entire list to get count of # items */ for (iter = list; iter && *iter; iter++) { struct ether_addr *candidate; + if (strcmp(g_strstrip(*iter), "*") == 0) { + found = TRUE; + break; + } + candidate = ether_aton (*iter); - if (candidate && !memcmp (mac->data, candidate->ether_addr_octet, ETH_ALEN)) + if (candidate && !memcmp (mac->data, candidate->ether_addr_octet, ETH_ALEN)) { found = TRUE; + break; + } } /* Add this device's MAC to the list */ -- cgit v1.2.1 From 9c0a812d52e79dc8214e91c9fa003508485ea03e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 27 Sep 2010 13:44:37 +0200 Subject: man: document usage of * glob in no-auto-default option (NetworkManager.conf) --- man/NetworkManager.conf.5.in | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/man/NetworkManager.conf.5.in b/man/NetworkManager.conf.5.in index e0025e78d4..ba575c9415 100644 --- a/man/NetworkManager.conf.5.in +++ b/man/NetworkManager.conf.5.in @@ -89,7 +89,7 @@ This key sets up what DHCP client NetworkManager will use. Presently be available on your system too. If this key is missing, available DHCP clients are looked for in this order: dhclient, dhcpcd. .TP -.B no-auto-default=\fI\fP,\fI\fP,... +.B no-auto-default=\fI\fP,\fI\fP,... | \fI*\fP Set devices for which NetworkManager shouldn't create default wired connection (Auto eth0). NetworkManager creates a default wired connection for any wired device that is managed and doesn't have a connection configured. List a device @@ -99,11 +99,13 @@ When the default wired connection is deleted or saved to a new persistent connec by a plugin, the MAC address of the wired device is automatically added to this list to prevent creating the default connection for that device again. Devices are specified by their MAC addresses, in lowercase. Multiple -entries are separated by commas. +entries are separated by commas. You can use the glob character \fI*\fP instead +of listing addresses to specify all devices. .br -Example: +Examples: .nf no-auto-default=00:22:68:5c:5d:c4,00:1e:65:ff:aa:ee +no-auto-default=* .fi .TP .B dns=\fIplugin1\fP,\fIplugin2\fP, ... -- cgit v1.2.1 From 36795744b71c154afe9514b8913f7a6c387e3062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Gonz=C3=A1lez?= Date: Mon, 27 Sep 2010 14:51:59 -0500 Subject: po: update Spanish translation (bgo #630562) --- po/es.po | 175 +++++++++++++++++++++++++++++---------------------------------- 1 file changed, 81 insertions(+), 94 deletions(-) diff --git a/po/es.po b/po/es.po index d002f77513..74746f4a46 100644 --- a/po/es.po +++ b/po/es.po @@ -1,5 +1,5 @@ # translation of es.po to Spanish -# translation of NetworkManager.HEAD.po to +# translation of NetworkManager.master.po to # Traducción de NetworkManager al español. # Copyright (C) Spanish translation for NetworkManager # This file is distributed under the same license as the NetworkManager package. @@ -12,11 +12,11 @@ # msgid "" msgstr "" -"Project-Id-Version: es\n" +"Project-Id-Version: NetworkManager.master\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-09-17 15:25+0000\n" -"PO-Revision-Date: 2010-09-18 11:01+0200\n" +"POT-Creation-Date: 2010-09-21 03:25+0000\n" +"PO-Revision-Date: 2010-09-25 11:36+0200\n" "Last-Translator: Jorge González \n" "Language-Team: Español \n" "MIME-Version: 1.0\n" @@ -94,7 +94,12 @@ msgstr "AUTOCONECTAR" msgid "READONLY" msgstr "SÓLOLECTURA" -#: ../cli/src/connections.c:158 +#. 7 +#: ../cli/src/connections.c:83 +msgid "DBUS-PATH" +msgstr "RUTA-DBUS" + +#: ../cli/src/connections.c:159 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -115,37 +120,37 @@ msgstr "" "]\n" " down id | uuid \n" -#: ../cli/src/connections.c:198 ../cli/src/connections.c:537 +#: ../cli/src/connections.c:199 ../cli/src/connections.c:540 #, c-format msgid "Error: 'con list': %s" msgstr "Error: «con list»: %s" -#: ../cli/src/connections.c:200 ../cli/src/connections.c:539 +#: ../cli/src/connections.c:201 ../cli/src/connections.c:542 #, c-format msgid "Error: 'con list': %s; allowed fields: %s" msgstr "Error: «con list»: %s; campos permitidos: %s" -#: ../cli/src/connections.c:208 +#: ../cli/src/connections.c:209 msgid "Connection details" msgstr "Detalles de conexiones" -#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 +#: ../cli/src/connections.c:384 ../cli/src/connections.c:605 msgid "system" msgstr "sistema" -#: ../cli/src/connections.c:382 ../cli/src/connections.c:602 +#: ../cli/src/connections.c:384 ../cli/src/connections.c:605 msgid "user" msgstr "usuario" -#: ../cli/src/connections.c:384 +#: ../cli/src/connections.c:386 msgid "never" msgstr "nunca" #. "CAPABILITIES" #. Print header #. "WIFI-PROPERTIES" -#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 -#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/connections.c:387 ../cli/src/connections.c:388 +#: ../cli/src/connections.c:606 ../cli/src/connections.c:609 #: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 #: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 #: ../cli/src/devices.c:587 ../cli/src/settings.c:508 @@ -164,8 +169,8 @@ msgstr "nunca" msgid "yes" msgstr "sí" -#: ../cli/src/connections.c:385 ../cli/src/connections.c:386 -#: ../cli/src/connections.c:603 ../cli/src/connections.c:606 +#: ../cli/src/connections.c:387 ../cli/src/connections.c:388 +#: ../cli/src/connections.c:606 ../cli/src/connections.c:609 #: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 #: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 #: ../cli/src/devices.c:587 ../cli/src/settings.c:508 @@ -184,272 +189,272 @@ msgstr "sí" msgid "no" msgstr "no" -#: ../cli/src/connections.c:458 ../cli/src/connections.c:501 +#: ../cli/src/connections.c:461 ../cli/src/connections.c:504 msgid "System connections" msgstr "Conexiones de sistema" -#: ../cli/src/connections.c:463 ../cli/src/connections.c:514 +#: ../cli/src/connections.c:466 ../cli/src/connections.c:517 msgid "User connections" msgstr "Conexiones de usuario" -#: ../cli/src/connections.c:475 ../cli/src/connections.c:1335 -#: ../cli/src/connections.c:1351 ../cli/src/connections.c:1360 -#: ../cli/src/connections.c:1371 ../cli/src/connections.c:1456 +#: ../cli/src/connections.c:478 ../cli/src/connections.c:1338 +#: ../cli/src/connections.c:1354 ../cli/src/connections.c:1363 +#: ../cli/src/connections.c:1374 ../cli/src/connections.c:1459 #: ../cli/src/devices.c:962 ../cli/src/devices.c:972 ../cli/src/devices.c:1074 #: ../cli/src/devices.c:1081 #, c-format msgid "Error: %s argument is missing." msgstr "Error: falta el argumento %s." -#: ../cli/src/connections.c:488 +#: ../cli/src/connections.c:491 #, c-format msgid "Error: %s - no such connection." msgstr "Error: %s - no hay tal conexión." -#: ../cli/src/connections.c:520 ../cli/src/connections.c:1384 -#: ../cli/src/connections.c:1474 ../cli/src/devices.c:785 +#: ../cli/src/connections.c:523 ../cli/src/connections.c:1387 +#: ../cli/src/connections.c:1477 ../cli/src/devices.c:785 #: ../cli/src/devices.c:852 ../cli/src/devices.c:986 ../cli/src/devices.c:1087 #, c-format msgid "Unknown parameter: %s\n" msgstr "Parámetro desconocido: %s\n" -#: ../cli/src/connections.c:529 +#: ../cli/src/connections.c:532 #, c-format msgid "Error: no valid parameter specified." msgstr "Error: no se especificó un parámetro válido." -#: ../cli/src/connections.c:544 ../cli/src/connections.c:1577 +#: ../cli/src/connections.c:547 ../cli/src/connections.c:1580 #: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:359 #, c-format msgid "Error: %s." msgstr "Error: %s." -#: ../cli/src/connections.c:650 +#: ../cli/src/connections.c:653 #, c-format msgid "Error: 'con status': %s" msgstr "Error: «con status»: %s" -#: ../cli/src/connections.c:652 +#: ../cli/src/connections.c:655 #, c-format msgid "Error: 'con status': %s; allowed fields: %s" msgstr "Error: «con status»: %s; campos permitidos: %s" -#: ../cli/src/connections.c:659 +#: ../cli/src/connections.c:662 msgid "Active connections" msgstr "Conexiones activas" -#: ../cli/src/connections.c:1027 +#: ../cli/src/connections.c:1030 #, c-format msgid "no active connection on device '%s'" msgstr "conexión no activa en el dispositivo «%s»" -#: ../cli/src/connections.c:1035 +#: ../cli/src/connections.c:1038 #, c-format msgid "no active connection or device" msgstr "conexión o dispositivo no activo" -#: ../cli/src/connections.c:1085 +#: ../cli/src/connections.c:1088 #, c-format msgid "device '%s' not compatible with connection '%s'" msgstr "dispositivo «%s» incompatible con conexión «%s»" -#: ../cli/src/connections.c:1087 +#: ../cli/src/connections.c:1090 #, c-format msgid "no device found for connection '%s'" msgstr "no se encontró dispositivo para conexión «%s»" -#: ../cli/src/connections.c:1098 +#: ../cli/src/connections.c:1101 msgid "activating" msgstr "activando" -#: ../cli/src/connections.c:1100 +#: ../cli/src/connections.c:1103 msgid "activated" msgstr "activada" -#: ../cli/src/connections.c:1103 ../cli/src/connections.c:1126 -#: ../cli/src/connections.c:1159 ../cli/src/devices.c:246 +#: ../cli/src/connections.c:1106 ../cli/src/connections.c:1129 +#: ../cli/src/connections.c:1162 ../cli/src/devices.c:246 #: ../cli/src/devices.c:558 ../cli/src/network-manager.c:94 #: ../cli/src/network-manager.c:149 ../cli/src/settings.c:473 msgid "unknown" msgstr "desconocido" -#: ../cli/src/connections.c:1112 +#: ../cli/src/connections.c:1115 msgid "VPN connecting (prepare)" msgstr "Conectando VPN (preparar)" -#: ../cli/src/connections.c:1114 +#: ../cli/src/connections.c:1117 msgid "VPN connecting (need authentication)" msgstr "Conectando VPN (necesita autenticación)" -#: ../cli/src/connections.c:1116 +#: ../cli/src/connections.c:1119 msgid "VPN connecting" msgstr "Conectando VPN" -#: ../cli/src/connections.c:1118 +#: ../cli/src/connections.c:1121 msgid "VPN connecting (getting IP configuration)" msgstr "Conectando VPN (obteniendo configuración IP)" -#: ../cli/src/connections.c:1120 +#: ../cli/src/connections.c:1123 msgid "VPN connected" msgstr "VPN conectada" -#: ../cli/src/connections.c:1122 +#: ../cli/src/connections.c:1125 msgid "VPN connection failed" msgstr "Falló la conexión VPN" -#: ../cli/src/connections.c:1124 +#: ../cli/src/connections.c:1127 msgid "VPN disconnected" msgstr "VPN desconectada" -#: ../cli/src/connections.c:1135 +#: ../cli/src/connections.c:1138 msgid "unknown reason" msgstr "razón desconocida" -#: ../cli/src/connections.c:1137 +#: ../cli/src/connections.c:1140 msgid "none" msgstr "ninguna" -#: ../cli/src/connections.c:1139 +#: ../cli/src/connections.c:1142 msgid "the user was disconnected" msgstr "el usuario estaba desconectado" -#: ../cli/src/connections.c:1141 +#: ../cli/src/connections.c:1144 msgid "the base network connection was interrupted" msgstr "se interrumpió la conexión de red de base" -#: ../cli/src/connections.c:1143 +#: ../cli/src/connections.c:1146 msgid "the VPN service stopped unexpectedly" msgstr "el servicio VPN se detuvo inesperadamente" -#: ../cli/src/connections.c:1145 +#: ../cli/src/connections.c:1148 msgid "the VPN service returned invalid configuration" msgstr "el servicio VPN retornó una configuración no válida" -#: ../cli/src/connections.c:1147 +#: ../cli/src/connections.c:1150 msgid "the connection attempt timed out" msgstr "se agotaron los intentos de conexión" -#: ../cli/src/connections.c:1149 +#: ../cli/src/connections.c:1152 msgid "the VPN service did not start in time" msgstr "el servicio VPN no inició a tiempo" -#: ../cli/src/connections.c:1151 +#: ../cli/src/connections.c:1154 msgid "the VPN service failed to start" msgstr "el servicio VPN falló en el inicio" -#: ../cli/src/connections.c:1153 +#: ../cli/src/connections.c:1156 msgid "no valid VPN secrets" msgstr "secretos VPN inválidos" -#: ../cli/src/connections.c:1155 +#: ../cli/src/connections.c:1158 msgid "invalid VPN secrets" msgstr "secretos VPN válidos" -#: ../cli/src/connections.c:1157 +#: ../cli/src/connections.c:1160 msgid "the connection was removed" msgstr "se eliminó la conexión" -#: ../cli/src/connections.c:1171 +#: ../cli/src/connections.c:1174 #, c-format msgid "state: %s\n" msgstr "estado: %s\n" -#: ../cli/src/connections.c:1174 ../cli/src/connections.c:1200 +#: ../cli/src/connections.c:1177 ../cli/src/connections.c:1203 #, c-format msgid "Connection activated\n" msgstr "Conexión activada\n" -#: ../cli/src/connections.c:1177 +#: ../cli/src/connections.c:1180 #, c-format msgid "Error: Connection activation failed." msgstr "Error: falló la activación de la conexión." -#: ../cli/src/connections.c:1196 +#: ../cli/src/connections.c:1199 #, c-format msgid "state: %s (%d)\n" msgstr "estado: %s (%d)\n" -#: ../cli/src/connections.c:1206 +#: ../cli/src/connections.c:1209 #, c-format msgid "Error: Connection activation failed: %s." msgstr "Error: falló la activación de la conexión: %s." -#: ../cli/src/connections.c:1223 ../cli/src/devices.c:909 +#: ../cli/src/connections.c:1226 ../cli/src/devices.c:909 #, c-format msgid "Error: Timeout %d sec expired." msgstr "Error: expiró la pausa de %d segundos." -#: ../cli/src/connections.c:1266 +#: ../cli/src/connections.c:1269 #, c-format msgid "Error: Connection activation failed: %s" msgstr "Error: falló la activación de la conexión: %s" -#: ../cli/src/connections.c:1280 +#: ../cli/src/connections.c:1283 #, c-format msgid "Error: Obtaining active connection for '%s' failed." msgstr "Error: falló la obtención de conexión activa para «%s»." -#: ../cli/src/connections.c:1289 +#: ../cli/src/connections.c:1292 #, c-format msgid "Active connection state: %s\n" msgstr "Estado de la conexión activa: %s\n" -#: ../cli/src/connections.c:1290 +#: ../cli/src/connections.c:1293 #, c-format msgid "Active connection path: %s\n" msgstr "Ruta de la conexión activa: %s\n" -#: ../cli/src/connections.c:1344 ../cli/src/connections.c:1465 +#: ../cli/src/connections.c:1347 ../cli/src/connections.c:1468 #, c-format msgid "Error: Unknown connection: %s." msgstr "Error: conexión desconocida: %s." -#: ../cli/src/connections.c:1379 ../cli/src/devices.c:980 +#: ../cli/src/connections.c:1382 ../cli/src/devices.c:980 #, c-format msgid "Error: timeout value '%s' is not valid." msgstr "Error: valor de pausa «%s» inválido." -#: ../cli/src/connections.c:1392 ../cli/src/connections.c:1482 +#: ../cli/src/connections.c:1395 ../cli/src/connections.c:1485 #, c-format msgid "Error: id or uuid has to be specified." msgstr "Error: se debe especificar un id o uuid." -#: ../cli/src/connections.c:1412 +#: ../cli/src/connections.c:1415 #, c-format msgid "Error: No suitable device found: %s." msgstr "Error: no se encontró un dispositivo apropiado: %s." -#: ../cli/src/connections.c:1414 +#: ../cli/src/connections.c:1417 #, c-format msgid "Error: No suitable device found." msgstr "Error: no se encontró un dispositivo apropiado." -#: ../cli/src/connections.c:1509 +#: ../cli/src/connections.c:1512 #, c-format msgid "Warning: Connection not active\n" msgstr "Advertencia: conexión inactiva\n" -#: ../cli/src/connections.c:1566 +#: ../cli/src/connections.c:1569 #, c-format msgid "Error: 'con' command '%s' is not valid." msgstr "Error: comando «con» «%s» no es válido." -#: ../cli/src/connections.c:1602 +#: ../cli/src/connections.c:1605 #, c-format msgid "Error: could not connect to D-Bus." msgstr "Error: no se pudo conectar con D-Bus." -#: ../cli/src/connections.c:1609 +#: ../cli/src/connections.c:1612 #, c-format msgid "Error: Could not get system settings." msgstr "Error: no se pudo obtener configuración de sistema." -#: ../cli/src/connections.c:1617 +#: ../cli/src/connections.c:1620 #, c-format msgid "Error: Could not get user settings." msgstr "Error: No se pudo obtener configuración de usuario." -#: ../cli/src/connections.c:1627 +#: ../cli/src/connections.c:1630 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "" @@ -891,17 +896,6 @@ msgstr "WWAN" #: ../cli/src/network-manager.c:64 #, c-format -#| msgid "" -#| "Usage: nmcli nm { COMMAND | help }\n" -#| "\n" -#| " COMMAND := { status | sleep | wakeup | wifi | wwan }\n" -#| "\n" -#| " status\n" -#| " sleep\n" -#| " wakeup\n" -#| " wifi [on|off]\n" -#| " wwan [on|off]\n" -#| "\n" msgid "" "Usage: nmcli nm { COMMAND | help }\n" "\n" @@ -973,19 +967,16 @@ msgstr "no ejecutando" #: ../cli/src/network-manager.c:175 #, c-format -#| msgid "Error: could not connect to D-Bus." msgid "Error: Couldn't connect to system bus: %s" msgstr "Error: no se pudo conectar con el bus del sistema: %s" #: ../cli/src/network-manager.c:186 #, c-format -#| msgid "Error: could not connect to D-Bus." msgid "Error: Couldn't create D-Bus object proxy." msgstr "Error: no se pudo crear un objeto proxy en D-Bus." #: ../cli/src/network-manager.c:192 #, c-format -#| msgid "Error: 'con list': %s" msgid "Error in sleep: %s" msgstr "Error al dormir: %s" @@ -996,25 +987,21 @@ msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" msgstr "Error: «--fields» valor «%s» no es válido aquí; campos permitidos: %s" #: ../cli/src/network-manager.c:245 -#| msgid "WiFi enabled" msgid "Networking enabled" msgstr "Red activada" #: ../cli/src/network-manager.c:256 #, c-format -#| msgid "Error: invalid 'wwan' parameter: '%s'." msgid "Error: invalid 'enable' parameter: '%s'; use 'true' or 'false'." msgstr "Error: parámetro «enable» inválido: «%s»; use «true» o «false»." #: ../cli/src/network-manager.c:265 #, c-format -#| msgid "Error: Could not connect to NetworkManager." msgid "Error: Sleeping status is not exported by NetworkManager." msgstr "Error: NetworkManager no exporta el estado para dormir." #: ../cli/src/network-manager.c:273 #, c-format -#| msgid "Error: invalid 'wifi' parameter: '%s'." msgid "Error: invalid 'sleep' parameter: '%s'; use 'true' or 'false'." msgstr "Error: parámetro «wifi» inválido: «%s»." -- cgit v1.2.1 From f62666dbff3dea6b1008b1fcd6ed66e7f981566e Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 27 Sep 2010 16:29:56 -0500 Subject: cli: don't crash if for some reason HW addresses aren't available (bgo #630534) --- cli/src/connections.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cli/src/connections.c b/cli/src/connections.c index 5099b502d9..e0b94ceb8c 100644 --- a/cli/src/connections.c +++ b/cli/src/connections.c @@ -717,10 +717,11 @@ check_ethernet_compatible (NMDeviceEthernet *device, NMConnection *connection, G if (s_wired) { const GByteArray *mac; const char *device_mac_str; - struct ether_addr *device_mac; + struct ether_addr *device_mac = NULL; device_mac_str = nm_device_ethernet_get_permanent_hw_address (device); - device_mac = ether_aton (device_mac_str); + if (device_mac_str) + device_mac = ether_aton (device_mac_str); if (!device_mac) { g_set_error (error, 0, 0, "Invalid device MAC address."); return FALSE; @@ -766,10 +767,11 @@ check_wifi_compatible (NMDeviceWifi *device, NMConnection *connection, GError ** if (s_wireless) { const GByteArray *mac; const char *device_mac_str; - struct ether_addr *device_mac; + struct ether_addr *device_mac = NULL; device_mac_str = nm_device_wifi_get_permanent_hw_address (device); - device_mac = ether_aton (device_mac_str); + if (device_mac_str) + device_mac = ether_aton (device_mac_str); if (!device_mac) { g_set_error (error, 0, 0, "Invalid device MAC address."); return FALSE; -- cgit v1.2.1 From 44cfbf201f90459b3f4098413a87e3280d770477 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 28 Sep 2010 14:18:34 -0500 Subject: wifi: allow proactive_key_caching through the supplicant settings filter (rh #615032) (rh #636877) This makes 596cf1a232d33c0dbeee61d8e927d7a09f40159f actually work. --- src/supplicant-manager/nm-supplicant-settings-verify.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/supplicant-manager/nm-supplicant-settings-verify.c b/src/supplicant-manager/nm-supplicant-settings-verify.c index 283346559b..c65af4dee5 100644 --- a/src/supplicant-manager/nm-supplicant-settings-verify.c +++ b/src/supplicant-manager/nm-supplicant-settings-verify.c @@ -123,6 +123,7 @@ static const struct Opt opt_table[] = { { "engine_id", TYPE_BYTES, 0, 0, FALSE, NULL }, { "key_id", TYPE_BYTES, 0, 0, FALSE, NULL }, { "fragment_size", TYPE_INT, 1, 2000, FALSE, NULL }, + { "proactive_key_caching", TYPE_INT, 0, 1, FALSE, NULL }, }; -- cgit v1.2.1 From e650b2f23db19cfe8d111cf0376e16a1f881a13b Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Wed, 29 Sep 2010 19:10:04 -0500 Subject: po: update Bulgarian translation (bgo #630950) --- po/bg.po | 1927 +++++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 1730 insertions(+), 197 deletions(-) diff --git a/po/bg.po b/po/bg.po index 7c8ad028e8..5a1e7c1c08 100644 --- a/po/bg.po +++ b/po/bg.po @@ -2,274 +2,1891 @@ # Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. # This file is distributed under the same license as the NetworkManager package. # Alexander Shopov , 2005, 2007, 2008. +# Damyan Ivanov , 2010. # msgid "" msgstr "" "Project-Id-Version: NetworkManager trunk\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-08-02 08:52+0300\n" -"PO-Revision-Date: 2008-08-01 07:30+0300\n" -"Last-Translator: Alexander Shopov \n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-09-20 15:25+0000\n" +"PO-Revision-Date: 2010-09-29 23:55+0300\n" +"Last-Translator: Damyan Ivanov \n" "Language-Team: Bulgarian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -#: ../src/nm-netlink-monitor.c:193 ../src/nm-netlink-monitor.c:471 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/devices.c:88 ../cli/src/devices.c:101 ../cli/src/devices.c:111 +#: ../cli/src/devices.c:121 ../cli/src/devices.c:134 ../cli/src/devices.c:145 +#: ../cli/src/devices.c:156 ../cli/src/devices.c:165 ../cli/src/devices.c:174 +msgid "NAME" +msgstr "ИМЕ" + +#. 0 +#: ../cli/src/connections.c:61 ../cli/src/connections.c:76 +msgid "UUID" +msgstr "УНИВЕРСАЛЕН ИДЕНТИФИКАТОР" + +#. 1 +#: ../cli/src/connections.c:62 +msgid "DEVICES" +msgstr "УСТРОЙСТВА" + +#. 2 +#: ../cli/src/connections.c:63 ../cli/src/connections.c:78 +msgid "SCOPE" +msgstr "ОБСЕГ" + +#. 3 +#: ../cli/src/connections.c:64 +msgid "DEFAULT" +msgstr "ПОДРАЗ." + +#. 4 +#: ../cli/src/connections.c:65 +msgid "DBUS-SERVICE" +msgstr "УСЛУГА-DBUS" + +#. 5 +#: ../cli/src/connections.c:66 +msgid "SPEC-OBJECT" +msgstr "СПЕЦИФИКАЦ." + +#. 6 +#: ../cli/src/connections.c:67 +msgid "VPN" +msgstr "ВЧМ" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:77 ../cli/src/devices.c:62 ../cli/src/devices.c:90 +msgid "TYPE" +msgstr "ВИД" + +# Заглавие за датата и часа, когато последно е използвана връзката. +# Използва се вътрешният формат (секунди от фиксирана дата през 1700г). +#. 3 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP" +msgstr "ПОСЛ. АКТ." + +# Заглавие за датата и часа, когато последно е използвана връзката. +# Използва се локализиран формат за дата и час. +#. 4 +#: ../cli/src/connections.c:80 +msgid "TIMESTAMP-REAL" +msgstr "ПОСЛЕДНО АКТИВНА" + +#. 5 +#: ../cli/src/connections.c:81 +msgid "AUTOCONNECT" +msgstr "АВТОМАТИЧНА" + +#. 6 +#: ../cli/src/connections.c:82 +msgid "READONLY" +msgstr "САМО ЧЕТ." + +#. 7 +#: ../cli/src/connections.c:83 +msgid "DBUS-PATH" +msgstr "ПЪТ-DBUS" + +#: ../cli/src/connections.c:159 #, c-format -msgid "error processing netlink message: %s" -msgstr "грешка при обработката на следното съобщение от мрежовия слой: %s" +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Употреба: nmcli con { КОМАНДА | help }\n" +" КОМАНДА := { list | status | up | down }\n" +"\n" +" list [id <ид> | uuid <ид> | system | user]\n" +" status\n" +" up id <ид> | uuid <ид> [iface <интерфейс>] [ap <хардуерен адрес>] [--" +"nowait] [--timeout <изчакване>]\n" +" down id <ид> | uuid <ид>\n" -#: ../src/nm-netlink-monitor.c:250 +#: ../cli/src/connections.c:199 ../cli/src/connections.c:540 #, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" +msgid "Error: 'con list': %s" +msgstr "Грешка при „con list“ – %s" + +#: ../cli/src/connections.c:201 ../cli/src/connections.c:542 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Грешка при „con list“ – %s; допустимите полета са %s" + +#: ../cli/src/connections.c:209 +#| msgid "Connection Established" +msgid "Connection details" +msgstr "Информация за връзката" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:605 +msgid "system" +msgstr "система" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:605 +msgid "user" +msgstr "потреб." + +#: ../cli/src/connections.c:386 +msgid "never" +msgstr "никога" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:387 ../cli/src/connections.c:388 +#: ../cli/src/connections.c:606 ../cli/src/connections.c:609 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:551 ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 +msgid "yes" +msgstr "да" + +#: ../cli/src/connections.c:387 ../cli/src/connections.c:388 +#: ../cli/src/connections.c:606 ../cli/src/connections.c:609 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:510 ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 ../cli/src/settings.c:1224 +#| msgid "none" +msgid "no" +msgstr "не" + +#: ../cli/src/connections.c:461 ../cli/src/connections.c:504 +#| msgid "No active connections!" +msgid "System connections" +msgstr "Системни връзки" + +#: ../cli/src/connections.c:466 ../cli/src/connections.c:517 +#| msgid "VPN Connections" +msgid "User connections" +msgstr "Потребителски връзки" + +#: ../cli/src/connections.c:478 ../cli/src/connections.c:1338 +#: ../cli/src/connections.c:1354 ../cli/src/connections.c:1363 +#: ../cli/src/connections.c:1374 ../cli/src/connections.c:1459 +#: ../cli/src/devices.c:962 ../cli/src/devices.c:972 ../cli/src/devices.c:1074 +#: ../cli/src/devices.c:1081 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Липсва аргумент за „%s“." + +#: ../cli/src/connections.c:491 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Няма връзка „%s“." + +#: ../cli/src/connections.c:523 ../cli/src/connections.c:1387 +#: ../cli/src/connections.c:1477 ../cli/src/devices.c:785 +#: ../cli/src/devices.c:852 ../cli/src/devices.c:986 ../cli/src/devices.c:1087 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Непознат параметър „%s“\n" + +#: ../cli/src/connections.c:532 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Няма указани параметри." + +#: ../cli/src/connections.c:547 ../cli/src/connections.c:1580 +#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:359 +#, c-format +msgid "Error: %s." +msgstr "Грешка – %s." + +#: ../cli/src/connections.c:653 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Грешка при „con status“ – %s" + +#: ../cli/src/connections.c:655 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Грешка при „con status“ – %s. Допустимите полета са %s" + +#: ../cli/src/connections.c:662 +#| msgid "No active connections!" +msgid "Active connections" +msgstr "Активни връзки" + +#: ../cli/src/connections.c:1030 +#, c-format +#| msgid "No active connections!" +msgid "no active connection on device '%s'" +msgstr "няма активна връзка, използваща устройството „%s“" + +#: ../cli/src/connections.c:1038 +#, c-format +#| msgid "No active connections!" +msgid "no active connection or device" +msgstr "няма активна връзка или устройство" + +#: ../cli/src/connections.c:1088 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "устройството „%s“ не е съвместимо с връзката „%s“" + +#: ../cli/src/connections.c:1090 +#, c-format +#| msgid "Error retrieving VPN connection '%s'" +msgid "no device found for connection '%s'" +msgstr "не е открито устройство за връзката „%s“" + +#: ../cli/src/connections.c:1101 +msgid "activating" +msgstr "включване" + +#: ../cli/src/connections.c:1103 +msgid "activated" +msgstr "включена" + +#: ../cli/src/connections.c:1106 ../cli/src/connections.c:1129 +#: ../cli/src/connections.c:1162 ../cli/src/devices.c:246 +#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:149 ../cli/src/settings.c:473 +#| msgid "(unknown)" +msgid "unknown" +msgstr "неизвестно" + +#: ../cli/src/connections.c:1115 +#| msgid "VPN connecting to '%s'" +msgid "VPN connecting (prepare)" +msgstr "Свързване към ВЧМ (подготовка)" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (need authentication)" +msgstr "Свързване към ВЧМ (нужна е идентификация)" + +#: ../cli/src/connections.c:1119 +#| msgid "VPN Connections" +msgid "VPN connecting" +msgstr "Свързване към ВЧМ" + +#: ../cli/src/connections.c:1121 +msgid "VPN connecting (getting IP configuration)" +msgstr "Свързване към ВЧМ (получаване на настройките за IP)" + +#: ../cli/src/connections.c:1123 +#| msgid "Disconnected" +msgid "VPN connected" +msgstr "Свързан към ВЧМ" + +#: ../cli/src/connections.c:1125 +#| msgid "VPN Connect Failure" +msgid "VPN connection failed" +msgstr "Неуспешно свързване към ВЧМ" + +#: ../cli/src/connections.c:1127 +#| msgid "Disconnected" +msgid "VPN disconnected" +msgstr "Връзката към ВЧМ е прекъсната" + +#: ../cli/src/connections.c:1138 +#| msgid "(unknown)" +msgid "unknown reason" +msgstr "неизвестна причина" + +#: ../cli/src/connections.c:1140 +msgid "none" +msgstr "липсва" + +#: ../cli/src/connections.c:1142 +#| msgid "The network connection has been disconnected." +msgid "the user was disconnected" +msgstr "потребителят е изключен" + +#: ../cli/src/connections.c:1144 +#| msgid "The network connection has been disconnected." +msgid "the base network connection was interrupted" +msgstr "основната връзка към мрежата е прекъсната" + +#: ../cli/src/connections.c:1146 +msgid "the VPN service stopped unexpectedly" +msgstr "услугата за ВЧМ спря неочаквано" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service returned invalid configuration" +msgstr "услугата за ВЧМ предостави неправилни настройки" + +#: ../cli/src/connections.c:1150 +msgid "the connection attempt timed out" +msgstr "времето за свързване изтече" + +#: ../cli/src/connections.c:1152 +msgid "the VPN service did not start in time" +msgstr "услугата за ВЧМ не успя да тръгне в определеното време" + +#: ../cli/src/connections.c:1154 +msgid "the VPN service failed to start" +msgstr "услугата за ВЧМ не успя да тръгне" + +#: ../cli/src/connections.c:1156 +msgid "no valid VPN secrets" +msgstr "няма правилни пароли за ВЧМ" + +#: ../cli/src/connections.c:1158 +msgid "invalid VPN secrets" +msgstr "неправилни пароли за ВЧМ" + +#: ../cli/src/connections.c:1160 +msgid "the connection was removed" +msgstr "връзката е премахната" + +#: ../cli/src/connections.c:1174 +#, c-format +msgid "state: %s\n" +msgstr "състояние: %s\n" + +#: ../cli/src/connections.c:1177 ../cli/src/connections.c:1203 +#, c-format +#| msgid "Connection Established" +msgid "Connection activated\n" +msgstr "Връзката е активирана\n" + +#: ../cli/src/connections.c:1180 +#, c-format +#| msgid "Connection to the wired network failed." +msgid "Error: Connection activation failed." +msgstr "Грешка при активиране на връзката." + +#: ../cli/src/connections.c:1199 +#, c-format +msgid "state: %s (%d)\n" +msgstr "състояние: %s (%d)\n" + +#: ../cli/src/connections.c:1209 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Грешка при активиране на връзката: %s." + +#: ../cli/src/connections.c:1226 ../cli/src/devices.c:909 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Просрочено е времето от %d сек." + +#: ../cli/src/connections.c:1269 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Грешка при активиране на връзката: %s" + +#: ../cli/src/connections.c:1283 +#, c-format +#| msgid "Error retrieving VPN connection '%s'" +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Грешка при получаване на активната връзка за „%s“." + +#: ../cli/src/connections.c:1292 +#, c-format +#| msgid "No active connections!" +msgid "Active connection state: %s\n" +msgstr "Състояние на активната връзка: %s\n" + +#: ../cli/src/connections.c:1293 +#, c-format +#| msgid "No active connections!" +msgid "Active connection path: %s\n" +msgstr "Път на активната връзка: %s\n" + +#: ../cli/src/connections.c:1347 ../cli/src/connections.c:1468 +#, c-format +#| msgid "Error retrieving VPN connection '%s'" +msgid "Error: Unknown connection: %s." +msgstr "Непозната връзка „%s“." + +#: ../cli/src/connections.c:1382 ../cli/src/devices.c:980 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Ограничението на времето „%s“ не е правилно." + +#: ../cli/src/connections.c:1395 ../cli/src/connections.c:1485 +#, c-format +msgid "Error: id or uuid has to be specified." msgstr "" -"не може да се зададе модул в мрежовия слой за наблюдение на състоянието на " -"връзката — %s" +"Указването на идентификатор или универсален идентификатор (uuid) е " +"задължително." -#: ../src/nm-netlink-monitor.c:260 +#: ../cli/src/connections.c:1415 #, c-format -msgid "unable to connect to netlink for monitoring link status: %s" +msgid "Error: No suitable device found: %s." +msgstr "Не е намерено подходящо устройство – %s." + +#: ../cli/src/connections.c:1417 +#, c-format +msgid "Error: No suitable device found." +msgstr "Не е намерено подходящо устройство." + +#: ../cli/src/connections.c:1512 +#, c-format +#| msgid "Connection Information" +msgid "Warning: Connection not active\n" +msgstr "Предупреждение: Връзката не е активна\n" + +#: ../cli/src/connections.c:1569 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "„con“ не поддържа команда „%s“." + +#: ../cli/src/connections.c:1605 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Грешка при свързване с D-Bus." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Грешка при получаване на системните настройки." + +#: ../cli/src/connections.c:1620 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Грешка при получаване на потребителските настройки." + +#: ../cli/src/connections.c:1630 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "" +"Грешка при получаване на списъка с връзки – услугите за настройки не са " +"налични." + +#. 0 +#. 9 +#: ../cli/src/devices.c:61 ../cli/src/devices.c:89 ../cli/src/devices.c:184 +msgid "DEVICE" +msgstr "УСТРОЙСТВО" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:63 ../cli/src/devices.c:93 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "СЪСТОЯНИЕ" + +#: ../cli/src/devices.c:72 +msgid "GENERAL" +msgstr "ОБЩИ" + +#. 0 +#: ../cli/src/devices.c:73 +msgid "CAPABILITIES" +msgstr "ВЪЗМОЖНОСТИ" + +#. 1 +#: ../cli/src/devices.c:74 +msgid "WIFI-PROPERTIES" +msgstr "БЕЗЖИЧНИ-ХАРАКТЕРИСТИКИ" + +#. 2 +#: ../cli/src/devices.c:75 +#| msgid "PEAP" +msgid "AP" +msgstr "ТД" + +#. 3 +#: ../cli/src/devices.c:76 +msgid "WIRED-PROPERTIES" +msgstr "ЖИЧНИ-ХАРАКТЕРИСТИКИ" + +#. 4 +#: ../cli/src/devices.c:77 +msgid "IP4-SETTINGS" +msgstr "ПАРАМЕТРИ-IP4" + +#. 5 +#: ../cli/src/devices.c:78 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 6 +#: ../cli/src/devices.c:79 +msgid "IP6-SETTINGS" +msgstr "ПАРАМЕТРИ-IP6" + +#. 7 +#: ../cli/src/devices.c:80 +msgid "IP6-DNS" +msgstr "IP6-DNS" + +#. 2 +#: ../cli/src/devices.c:91 +msgid "DRIVER" +msgstr "ДРАЙВЕР" + +#. 3 +#: ../cli/src/devices.c:92 +msgid "HWADDR" +msgstr "ХАРДУЕРЕН-АДРЕС" + +#. 0 +#: ../cli/src/devices.c:102 +msgid "CARRIER-DETECT" +msgstr "СИГНАЛ-ОТКР." + +#. 1 +#: ../cli/src/devices.c:103 +msgid "SPEED" +msgstr "СКОРОСТ" + +#. 0 +#: ../cli/src/devices.c:112 +msgid "CARRIER" +msgstr "СИГНАЛ" + +#. 0 +#: ../cli/src/devices.c:122 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:123 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:124 +#| msgid "WPA2 TKIP" +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:125 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:126 +#| msgid "AES-CCMP" +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:135 ../cli/src/devices.c:146 +msgid "ADDRESS" +msgstr "АДРЕС" + +#. 1 +#: ../cli/src/devices.c:136 ../cli/src/devices.c:147 +msgid "PREFIX" +msgstr "ПРЕФИКС" + +#. 2 +#: ../cli/src/devices.c:137 ../cli/src/devices.c:148 +msgid "GATEWAY" +msgstr "ШЛЮЗ" + +#. 0 +#: ../cli/src/devices.c:157 ../cli/src/devices.c:166 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:175 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:176 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:177 +msgid "MODE" +msgstr "РЕЖИМ" + +#. 3 +#: ../cli/src/devices.c:178 +msgid "FREQ" +msgstr "ЧЕСТОТА" + +#. 4 +#: ../cli/src/devices.c:179 +msgid "RATE" +msgstr "СКОРОСТ-ПРЕДАВАНЕ" + +#. 5 +#: ../cli/src/devices.c:180 +msgid "SIGNAL" +msgstr "СИГНАЛ" + +#. 6 +#: ../cli/src/devices.c:181 +msgid "SECURITY" +msgstr "СИГУРНОСТ" + +#. 7 +#: ../cli/src/devices.c:182 +msgid "WPA-FLAGS" +msgstr "ФЛАГОВЕ-WPA" + +#. 8 +#: ../cli/src/devices.c:183 +msgid "RSN-FLAGS" +msgstr "ФЛАГОВЕ-RSN" + +#. 10 +#: ../cli/src/devices.c:185 +msgid "ACTIVE" +msgstr "АКТИВНА" + +#: ../cli/src/devices.c:208 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"Употреба: nmcli dev { КОМАНДА | help }\n" +"\n" +" КОМАНДА := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [ iface <интерфейс>]\n" +" disconnect iface <интерфейс> [--nowait] [--timeout <време>]\n" +" wifi [list [iface <интерфейс>] [hwaddr <хардуерен адрес>]]\n" +"\n" + +#: ../cli/src/devices.c:228 +msgid "unmanaged" +msgstr "не се управлява" + +#: ../cli/src/devices.c:230 +msgid "unavailable" +msgstr "не е налично" + +# става дума за устройство +# или за общото състояние на N-M +#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:91 +#| msgid "Disconnected" +msgid "disconnected" +msgstr "без връзка" + +#: ../cli/src/devices.c:234 +msgid "connecting (prepare)" +msgstr "свързване (подготовка)" + +#: ../cli/src/devices.c:236 +#| msgid "Connection Information" +msgid "connecting (configuring)" +msgstr "свързване (настройка)" + +#: ../cli/src/devices.c:238 +msgid "connecting (need authentication)" +msgstr "свързване (нужна е идентификация)" + +#: ../cli/src/devices.c:240 +#| msgid "Connection Information" +msgid "connecting (getting IP configuration)" +msgstr "свързване (получаване на настройките за IP)" + +# става дума и за конкретно устройство, +# и за NM като цяло +#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:89 +#| msgid "Disconnected" +msgid "connected" +msgstr "има връзка" + +#: ../cli/src/devices.c:244 +#| msgid "Connection Established" +msgid "connection failed" +msgstr "неуспешно свързване" + +# вид устройство (жично, безжично, телефон, bluetooth) или вид мрежа (инфраструктура, ad-hoc) +#: ../cli/src/devices.c:267 ../cli/src/devices.c:424 +msgid "Unknown" +msgstr "Непознат" + +# низът се използва когато дадена безжична мрежа няма флагове от рода на pair_ccmp, pair_wpe140 и т.н. +#: ../cli/src/devices.c:299 +#| msgid "none" +msgid "(none)" +msgstr "(без)" + +#: ../cli/src/devices.c:324 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: грешка при преобразуване на адрес IP4 0x%X" + +#: ../cli/src/devices.c:393 +#, c-format +msgid "%u MHz" +msgstr "%u МХц" + +#: ../cli/src/devices.c:394 +#, c-format +#| msgid "%d Mb/s" +msgid "%u MB/s" +msgstr "%u МБ/с" + +#: ../cli/src/devices.c:403 +msgid "Encrypted: " +msgstr "Шифроване: " + +#: ../cli/src/devices.c:408 +msgid "WEP " +msgstr "WEP" + +#: ../cli/src/devices.c:410 +#| msgid "WPA TKIP" +msgid "WPA " +msgstr "WPA" + +#: ../cli/src/devices.c:412 +#| msgid "WPA2 TKIP" +msgid "WPA2 " +msgstr "WPA2" + +#: ../cli/src/devices.c:415 +#| msgid "WPA Enterprise" +msgid "Enterprise " +msgstr "Индустр." + +# Режима на мрежата +#: ../cli/src/devices.c:424 +msgid "Ad-Hoc" +msgstr "Специален" + +# Режима на мрежата +#: ../cli/src/devices.c:424 +msgid "Infrastructure" +msgstr "Инфраструктурен" + +#: ../cli/src/devices.c:486 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "Грешка при „dev list“ – %s" + +#: ../cli/src/devices.c:488 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Грешка при „dev list“ – %s; допустимите полета са %s" + +#: ../cli/src/devices.c:497 +msgid "Device details" +msgstr "Информация за устройството" + +# или е драйвер, +# или е грешка при прекъсване на връзката +#: ../cli/src/devices.c:527 ../cli/src/devices.c:925 +msgid "(unknown)" +msgstr "(няма информация)" + +# хардуерен адрес +#: ../cli/src/devices.c:528 +#| msgid "(unknown)" +msgid "unknown)" +msgstr "(няма информация)" + +#: ../cli/src/devices.c:554 +#, c-format +#| msgid "%d Mb/s" +msgid "%u Mb/s" +msgstr "%u Мб/с" + +# дадено устройство има сигнал по жицата +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:627 +#| msgid "None" +msgid "on" +msgstr "свързано" + +#: ../cli/src/devices.c:627 +msgid "off" +msgstr "без връзка" + +#: ../cli/src/devices.c:808 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "Грешка при „dev status“ – %s" + +#: ../cli/src/devices.c:810 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Грешка при „dev status“ – %s; допустимите полета са %s" + +#: ../cli/src/devices.c:817 +msgid "Status of devices" +msgstr "Състояние на устройствата" + +#: ../cli/src/devices.c:845 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Липсва аргумент за „%s“." + +#: ../cli/src/devices.c:874 ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Устройството „%s“ не е намерено." + +#: ../cli/src/devices.c:897 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Връзката на устройството „%s“ е прекъсната." + +#: ../cli/src/devices.c:922 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Грешка при прекъсване на връзката на устройството „%s“ (%s) – %s" + +#: ../cli/src/devices.c:930 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Състояние на устройството: %d (%s)\n" + +#: ../cli/src/devices.c:994 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Указването на „iface“ е задължително." + +#: ../cli/src/devices.c:1112 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "Грешка при „dev wifi“ – %s" + +#: ../cli/src/devices.c:1114 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Грешка при „dev wifi“ – %s; допустимите полета са %s" + +#: ../cli/src/devices.c:1121 +msgid "WiFi scan list" +msgstr "Открити безжични мрежи" + +#: ../cli/src/devices.c:1156 ../cli/src/devices.c:1210 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Не е открита точка за достъп с хардуерен адрес „%s“." + +#: ../cli/src/devices.c:1173 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "„%s“ не е устройство за безжична мрежа." + +#: ../cli/src/devices.c:1237 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "„%s“ не е правилна команда за „dev wifi“." + +#: ../cli/src/devices.c:1284 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "„%s“ не е правилна команда за „dev“." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "ВКЛЮЧЕН" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "NET-ENABLED" +msgstr "МРЕЖА-ВКЛЮЧ" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI-HARDWARE" +msgstr "БЕЗЖ. ХАРДУЕР" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WIFI" +msgstr "БЕЗЖ.МРЕЖА" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN-HARDWARE" +msgstr "МОБ. ХАРДУЕР" + +#. 5 +#: ../cli/src/network-manager.c:41 +msgid "WWAN" +msgstr "МОБ. МРЕЖА" + +#: ../cli/src/network-manager.c:64 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | enable | sleep | wifi | wwan }\n" +"\n" +" status\n" +" enable [true|false]\n" +" sleep [true|false]\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" msgstr "" -"не може да се осъществи връзка с мрежовия слой за наблюдение на състоянието " -"на връзката — %s" +"Употреба: nmcli nm { КОМАНДА | help }\n" +"\n" +" КОМАНДА := { status | enable | sleep | wifi | wwan }\n" +"\n" +" status\n" +" enable [true|false]\n" +" sleep [true|false]\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" -#: ../src/nm-netlink-monitor.c:268 +#: ../cli/src/network-manager.c:85 +msgid "asleep" +msgstr "спящ" + +#: ../cli/src/network-manager.c:87 +#| msgid "C_onnect" +msgid "connecting" +msgstr "свързване" + +#: ../cli/src/network-manager.c:128 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Грешка при „nm status“ – %s" + +#: ../cli/src/network-manager.c:130 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Грешка при „nm status“ – %s; допустимите полета са %s" + +#: ../cli/src/network-manager.c:137 +#| msgid "NetworkManager Applet" +msgid "NetworkManager status" +msgstr "Състояние на NetworkManager" + +#. Print header +#: ../cli/src/network-manager.c:144 ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 ../cli/src/network-manager.c:328 +msgid "enabled" +msgstr "включено" + +#: ../cli/src/network-manager.c:144 ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 ../cli/src/network-manager.c:328 +msgid "disabled" +msgstr "изключено" + +#: ../cli/src/network-manager.c:152 +msgid "running" +msgstr "включен" + +#: ../cli/src/network-manager.c:152 +msgid "not running" +msgstr "изключен" + +#: ../cli/src/network-manager.c:175 +#, c-format +msgid "Error: Couldn't connect to system bus: %s" +msgstr "Грешка при свързване към системната шина – %s" + +#: ../cli/src/network-manager.c:186 #, c-format -msgid "unable to join netlink group for monitoring link status: %s" +msgid "Error: Couldn't create D-Bus object proxy." +msgstr "Грешка при създаване на обект-посредник за D-Bus." + +#: ../cli/src/network-manager.c:192 +#, c-format +msgid "Error in sleep: %s" +msgstr "Грешка при приспиване – %s" + +#: ../cli/src/network-manager.c:237 ../cli/src/network-manager.c:286 +#: ../cli/src/network-manager.c:318 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Стойността „%s“ за „--fields“ не е правилна; допустимите полета са %s" + +#: ../cli/src/network-manager.c:245 +#| msgid "Networking disabled" +msgid "Networking enabled" +msgstr "Мрежата е включена" + +#: ../cli/src/network-manager.c:256 +#, c-format +msgid "Error: invalid 'enable' parameter: '%s'; use 'true' or 'false'." msgstr "" -"не може да се осъществи присъединяване към групата на мрежовия слой за " -"наблюдение на състоянието на връзката — %s" +"Недопустим аргумент на „enable“ – „%s“. Използвайте „true“ или „false“." -#: ../src/nm-netlink-monitor.c:276 +#: ../cli/src/network-manager.c:265 #, c-format -msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgid "Error: Sleeping status is not exported by NetworkManager." +msgstr "NetworkManager не предоставя информация за приспиването." + +#: ../cli/src/network-manager.c:273 +#, c-format +msgid "Error: invalid 'sleep' parameter: '%s'; use 'true' or 'false'." msgstr "" -"не може да се зададе временна памет в мрежовия слой за наблюдение на " -"състоянието на връзката — %s" +"„%s“ не е правилен параметър за „sleep“. Използвайте „true“ или „false“." + +#: ../cli/src/network-manager.c:294 +msgid "WiFi enabled" +msgstr "Безжичната мрежа е включена" -#: ../src/nm-netlink-monitor.c:494 +#: ../cli/src/network-manager.c:305 #, c-format -msgid "error occurred while waiting for data on socket" -msgstr "грешка при изчакване за данни през гнездо" +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "„%s“ не е правилен параметър за „wifi“." + +#: ../cli/src/network-manager.c:326 +msgid "WWAN enabled" +msgstr "Мобилната мрежа е включена" -#: ../src/NetworkManager.c:250 +#: ../cli/src/network-manager.c:337 #, c-format -msgid "Invalid option. Please use --help to see a list of valid options.\n" -msgstr "Неправилна опция. Ползвайте --help, за да видите списъка с опции.\n" +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "„%s“ не е правилен параметър за „wwan“." -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:87 -msgid "# Created by NetworkManager\n" -msgstr "# Създаден от NetworkManager\n" +#: ../cli/src/network-manager.c:348 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "„%s“ не е правилна команда за „nm“." -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:93 +#: ../cli/src/nmcli.c:69 #, c-format msgid "" -"# Merged from %s\n" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" "\n" msgstr "" -"# Слят от %s\n" +"Употреба: %s [ОПЦИИ] ОБЕКТ { КОМАНДА | help }\n" +"\n" +"ОПЦИИ\n" +" -t[erse] сбит изход\n" +" -p[retty] красив изход\n" +" -m[ode] tabular|multiline режим на изхода\n" +" -f[ields] <поле1,поле2,…>|all|common извеждани полета\n" +" -е[scape] yes|no кодиране на разделителите между " +"колоните в стойностите\n" +" -v[ersion] показване на версията на " +"програмата\n" +" -h[elp] показване на тази помощна " +"информация\n" +"\n" +"OBJECT\n" +" nm състояние на NetworkManager\n" +" con връзки на NetworkManager\n" +" dev устройства, управлявани от NetworkManager\n" "\n" -#: ../src/dns-manager/nm-dns-manager.c:117 -msgid "NOTE: the glibc resolver does not support more than 3 nameservers." -msgstr "БЕЛЕЖКА: стандартно glibc поддържа максимум 3 сървъра за имена." +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Обектът „%s“ е непознат. Опитайте с „nmcli help“." -#: ../src/dns-manager/nm-dns-manager.c:119 -msgid "The nameservers listed below may not be recognized." -msgstr "Сървърите за имена отдолу могат да не бъдат разпознати." +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Опцията „--terse“ е указана втори път." -#: ../system-settings/src/main.c:365 +#: ../cli/src/nmcli.c:148 #, c-format -msgid "Auto %s" -msgstr "Автоматично %s" +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Опцията „--terse“ е несъвместима с „--pretty“." -#: ../libnm-util/crypto.c:125 +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Опцията „--pretty“ е указана втори път." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Опцията „--pretty“ е несъвместима с „--terse“." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Липсва аргумент на опцията „%s“." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "„%s“ не е правилен аргумент за опцията „%s“." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Липсват полета за опциите „%s“." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli, версия %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Опцията „%s“ е непозната. Опитайте с „nmcli -help“." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "Получен е сигнал %d, спиране…" + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Грешка при свързване с NetworkManager." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "Успех" + +#: ../cli/src/settings.c:411 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (ключ в шестнайсетичен запис)" + +#: ../cli/src/settings.c:413 +#, c-format +#| msgid "WEP 128-bit Passphrase" +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128 битова парола)" + +#: ../cli/src/settings.c:416 +#, c-format +#| msgid "(unknown)" +msgid "%d (unknown)" +msgstr "%d (неизвестен)" + +#: ../cli/src/settings.c:442 +#| msgid "(unknown)" +msgid "0 (unknown)" +msgstr "0 (неизвестно)" + +#: ../cli/src/settings.c:448 +msgid "any, " +msgstr "всяка, " + +#: ../cli/src/settings.c:450 +msgid "900 MHz, " +msgstr "900 МХц, " + +#: ../cli/src/settings.c:452 +msgid "1800 MHz, " +msgstr "1800 МХц, " + +#: ../cli/src/settings.c:454 +msgid "1900 MHz, " +msgstr "1900 МХц, " + +#: ../cli/src/settings.c:456 +msgid "850 MHz, " +msgstr "850 МХц, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 МХц, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 МХц, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 МХц, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 МХц, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 МХц, " + +#: ../cli/src/settings.c:468 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 МХц, " + +#: ../cli/src/settings.c:470 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 МХц, " + +#: ../cli/src/settings.c:554 ../cli/src/settings.c:721 +msgid "auto" +msgstr "автоматично" + +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 +msgid "not set" +msgstr "не е зададено" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "полето „%s“ трябва да е единствено" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "грешно поле „%s“" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Опцията „--terse“ изисква указването на „--fields“" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "Опцията „--terse“ изисква конкретни стойности за „--fields“, а не „%s“" + +#: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." msgstr "Крайният етикет „%s“ липсва в сертификат във формат PEM." -#: ../libnm-util/crypto.c:135 +#: ../libnm-util/crypto.c:130 #, c-format msgid "Doesn't look like a PEM private key file." msgstr "Това не изглежда да е сертификат във формат PEM с частен ключ." -#: ../libnm-util/crypto.c:143 +#: ../libnm-util/crypto.c:138 #, c-format msgid "Not enough memory to store PEM file data." msgstr "" "Няма достатъчно памет за запазването на данните от сертификата във формат " "PEM." -#: ../libnm-util/crypto.c:159 +#: ../libnm-util/crypto.c:154 #, c-format msgid "Malformed PEM file: Proc-Type was not first tag." msgstr "" -"Неправилен сертификат във формат PEM: първият етикет не беше „Proc-Type“." +"Неправилен сертификат във формат PEM – първият етикет не е „Proc-Type“." -#: ../libnm-util/crypto.c:167 +#: ../libnm-util/crypto.c:162 #, c-format msgid "Malformed PEM file: unknown Proc-Type tag '%s'." msgstr "" "Неправилен сертификат във формат PEM: непознат етикет „Proc-Type“ — „%s“." -#: ../libnm-util/crypto.c:177 +#: ../libnm-util/crypto.c:172 #, c-format msgid "Malformed PEM file: DEK-Info was not the second tag." -msgstr "" -"Неправилен сертификат във формат PEM: вторият етикет не беше „DEK-Info“." +msgstr "Неправилен сертификат във формат PEM – вторият етикет не е „DEK-Info“." -#: ../libnm-util/crypto.c:188 +#: ../libnm-util/crypto.c:183 #, c-format msgid "Malformed PEM file: no IV found in DEK-Info tag." msgstr "" -"Неправилен сертификат във формат PEM: липсва първоначален вектор в етикета " -"„DEK-Info“." +"Неправилен сертификат във формат PEM – в етикета „DEK-Info“ липсва начален " +"вектор." -#: ../libnm-util/crypto.c:195 +#: ../libnm-util/crypto.c:190 #, c-format msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." msgstr "" -"Неправилен сертификат във формат PEM: неправилен първоначален вектор в " -"етикета „DEK-Info“." +"Неправилен сертификат във формат PEM – неправилен начален вектор в етикета " +"„DEK-Info“." -#: ../libnm-util/crypto.c:208 +#: ../libnm-util/crypto.c:203 #, c-format msgid "Malformed PEM file: unknown private key cipher '%s'." msgstr "" -"Неправилен сертификат във формат PEM: непознат шифър за частен ключ „%s“." +"Неправилен сертификат във формат PEM – непознат шифър „%s“ за частния ключ." -#: ../libnm-util/crypto.c:227 +#: ../libnm-util/crypto.c:222 #, c-format msgid "Could not decode private key." -msgstr "Частният ключ не може да бъде декодиран." +msgstr "Грешка при декодиране на частния ключ." -#: ../libnm-util/crypto.c:271 +#: ../libnm-util/crypto.c:267 #, c-format msgid "PEM certificate '%s' had no end tag '%s'." -msgstr "Крайният етикет „1$%s“ липсва в сертификата във формат PEM — „2$%s“." +msgstr "Крайният етикет „%2$s“ липсва в сертификата във формат PEM — „%1$s“." -#: ../libnm-util/crypto.c:281 +#: ../libnm-util/crypto.c:277 #, c-format msgid "Failed to decode certificate." -msgstr "Сертификатът не може да бъде декодиран." +msgstr "Грешка при декодиране на сертификата." -#: ../libnm-util/crypto.c:290 ../libnm-util/crypto.c:298 +#: ../libnm-util/crypto.c:286 #, c-format msgid "Not enough memory to store certificate data." -msgstr "Няма памет за запазването на данните от сертификат." +msgstr "Няма достатъчно памет за съхраняване на данните от сертификата." -#: ../libnm-util/crypto.c:328 +#: ../libnm-util/crypto.c:294 +#, c-format +#| msgid "Not enough memory to store PEM file data." +msgid "Not enough memory to store file data." +msgstr "Няма достатъчно памет за съхраняване на данните от файла." + +#: ../libnm-util/crypto.c:324 #, c-format msgid "IV must be an even number of bytes in length." -msgstr "Началният вектор трябва да е четен брой байта на дължина." +msgstr "Началният вектор трябва да е с размер четен брой байта." -#: ../libnm-util/crypto.c:337 +#: ../libnm-util/crypto.c:333 #, c-format msgid "Not enough memory to store the IV." -msgstr "Няма достатъчно памет за запазването на началния вектор." +msgstr "Няма достатъчно памет за съхраняване на началния вектор." -#: ../libnm-util/crypto.c:348 +#: ../libnm-util/crypto.c:344 #, c-format msgid "IV contains non-hexadecimal digits." msgstr "Началният вектор съдържа низ, който не е шестнайсетично число." -#: ../libnm-util/crypto.c:386 ../libnm-util/crypto_gnutls.c:126 -#: ../libnm-util/crypto_nss.c:136 +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "Шифърът за частен ключ „%s“ е непознат." -#: ../libnm-util/crypto.c:395 +#: ../libnm-util/crypto.c:391 +#, c-format +#| msgid "Not enough memory to store decrypted private key." +msgid "Not enough memory to decrypt private key." +msgstr "Няма достатъчно памет за разшифроване на частния ключ." + +#: ../libnm-util/crypto.c:511 #, c-format -msgid "Not enough memory to create private key decryption key." -msgstr "Няма достатъчно памет за създаването на частен ключ за дешифриране." +#| msgid "Failed to decrypt the private key: %d." +msgid "Unable to determine private key type." +msgstr "Видът на частния ключ не може да се определи." -#: ../libnm-util/crypto.c:513 +#: ../libnm-util/crypto.c:530 #, c-format msgid "Not enough memory to store decrypted private key." -msgstr "Няма достатъчно памет за запазването на частен ключ за дешифриране." +msgstr "Няма достатъчно памет за съхраняване на разшифрования частен ключ." -#: ../libnm-util/crypto_gnutls.c:73 +#: ../libnm-util/crypto_gnutls.c:49 +#| msgid "Failed to initialize the decryption context." +msgid "Failed to initialize the crypto engine." +msgstr "Грешка при инициализиране на модула за шифроване." + +#: ../libnm-util/crypto_gnutls.c:93 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." -msgstr "Модулът за MD5 не може да бъде инициализиран: %s / %s." +msgstr "Грешка при инициализиране на модула за MD5 – %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Неправилен начален вектор (трябва да е поне %zd)." -#: ../libnm-util/crypto_gnutls.c:135 ../libnm-util/crypto_nss.c:145 +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format msgid "Not enough memory for decrypted key buffer." -msgstr "Няма достатъчно памет за буфера за дешифриране." +msgstr "Няма достатъчно памет за буфера за разшифрования ключ." -#: ../libnm-util/crypto_gnutls.c:143 +#: ../libnm-util/crypto_gnutls.c:173 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." -msgstr "Контекстът за дешифриране не може да бъде инициализиран: %s / %s." +msgstr "Грешка при инициализиране на контекста за разшифроване – %s / %s." -#: ../libnm-util/crypto_gnutls.c:152 +#: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." -msgstr "Симетричният ключ за дешифриране не може да бъде зададен: %s / %s." +msgstr "Грешка при задаване на симетричния ключ за разшифроване – %s / %s." -#: ../libnm-util/crypto_gnutls.c:161 +#: ../libnm-util/crypto_gnutls.c:191 #, c-format msgid "Failed to set IV for decryption: %s / %s." -msgstr "Началният вектор за дешифриране не може да бъде зададен: %s / %s." +msgstr "Грешка при задаване на началния вектор за разшифроване – %s / %s." -#: ../libnm-util/crypto_gnutls.c:170 +#: ../libnm-util/crypto_gnutls.c:200 #, c-format msgid "Failed to decrypt the private key: %s / %s." -msgstr "Частният ключ не може да бъде дешифриран: %s / %s." +msgstr "Грешка при разшифроване на частния ключ – %s / %s." -#: ../libnm-util/crypto_gnutls.c:208 +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "" +"Грешка при разшифроване на частния ключ – неочаквана дължина на " +"подравняването." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key." +msgstr "Грешка при разшифроване на частния ключ." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Няма достатъчно памет за буфер при шифроване." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +#| msgid "Failed to initialize the decryption cipher context: %s / %s." +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Грешка при инициализиране на контекста за шифроване – %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +#| msgid "Failed to set symmetric key for decryption: %s / %s." +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Грешка при задаване на симетричния ключ за шифроване – %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +#| msgid "Failed to set IV for decryption: %s / %s." +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Грешка при задаване на началния вектор за шифроване – %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +#| msgid "Failed to decrypt the private key: %s / %s." +msgid "Failed to encrypt the data: %s / %s." +msgstr "Грешка при шифроване на данните – %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 #, c-format msgid "Error initializing certificate data: %s" -msgstr "Грешка при инициализиране на данните от сертификата: %s" +msgstr "Грешка при инициализиране на данните от сертификата – %s" -#: ../libnm-util/crypto_gnutls.c:220 +#: ../libnm-util/crypto_gnutls.c:384 #, c-format msgid "Couldn't decode certificate: %s" -msgstr "Сертификатът не може да бъде декодиран: %s" +msgstr "Грешка при декодиране на сертификата – %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "Грешка при инициализиране на модула за декодиране на PKCS#12 – %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +#| msgid "Couldn't decode certificate: %s" +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Грешка при декодиране на файла PKCS#12 – %s" -#: ../libnm-util/crypto_nss.c:78 +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +#| msgid "Couldn't decode certificate: %s" +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "Грешка при проверка на файла PKCS#12 – %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +#| msgid "Failed to initialize the MD5 engine: %s / %s." +msgid "Failed to initialize the crypto engine: %d." +msgstr "Грешка при инициализиране на модула за шифроване – %d." + +#: ../libnm-util/crypto_nss.c:111 #, c-format msgid "Failed to initialize the MD5 context: %d." -msgstr "Контекстът за MD5 не може да бъде инициализиран: %d." +msgstr "Грешка при инициализиране на контекста за MD5 – %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Неправилна дължина на началния вектор (трябва да е поне %d)." -#: ../libnm-util/crypto_nss.c:153 +#: ../libnm-util/crypto_nss.c:196 #, c-format msgid "Failed to initialize the decryption cipher slot." -msgstr "Буферът за шифъра за дешифриране не може да бъде инициализиран." +msgstr "Грешка при инициализиране на буфер за шифъра за разшифроване." -#: ../libnm-util/crypto_nss.c:163 +#: ../libnm-util/crypto_nss.c:206 #, c-format msgid "Failed to set symmetric key for decryption." -msgstr "Симетричният ключ за дешифриране не може да бъде зададен." +msgstr "Грешка при задаване на симетричния ключ за разшифроване." -#: ../libnm-util/crypto_nss.c:173 +#: ../libnm-util/crypto_nss.c:216 #, c-format msgid "Failed to set IV for decryption." -msgstr "Началният вектор за дешифриране не може да бъде зададен." +msgstr "Грешка при задаване на началния вектор за разшифроване." -#: ../libnm-util/crypto_nss.c:181 +#: ../libnm-util/crypto_nss.c:224 #, c-format msgid "Failed to initialize the decryption context." -msgstr "Контекстът за дешифриране не може да бъде инициализиран." +msgstr "Грешка при инициализиране на контекста за разшифроване." -#: ../libnm-util/crypto_nss.c:194 +#: ../libnm-util/crypto_nss.c:237 #, c-format msgid "Failed to decrypt the private key: %d." -msgstr "Частният ключ не може да бъде дешифриран: %d." +msgstr "Грешка при разшифроване на частния ключ – %d." -#: ../libnm-util/crypto_nss.c:206 +#: ../libnm-util/crypto_nss.c:245 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "" +"Грешка при разшифроване на частния ключ – твърде много разшифровани данни." + +#: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." -msgstr "Дешифрирането на частния ключ не може да приключи: %d." +msgstr "Грешка при завършване на разшифроването на частния ключ – %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +#| msgid "Failed to initialize the decryption cipher slot." +msgid "Failed to initialize the encryption cipher slot." +msgstr "Грешка при инициализиране на буфер за шифъра за шифроване." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +#| msgid "Failed to set symmetric key for decryption." +msgid "Failed to set symmetric key for encryption." +msgstr "Грешка при задаване на симетричния ключ за шифроване." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +#| msgid "Failed to set IV for decryption." +msgid "Failed to set IV for encryption." +msgstr "Грешка при задаване на началния вектор за шифроване." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +#| msgid "Failed to initialize the decryption context." +msgid "Failed to initialize the encryption context." +msgstr "Грешка при инициализиране на контекста за шифроване." -#: ../libnm-util/crypto_nss.c:250 +#: ../libnm-util/crypto_nss.c:396 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to encrypt: %d." +msgstr "Грешка при шифроване – %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Неочакван обем данни след шифроване." + +#: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" -msgstr "Сертификатът не може да бъде дешифриран: %d" +msgstr "Грешка при декодиране на сертификата – %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Грешка при преобразуване на паролата в UCS2 – %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Грешка при инициализиране на модула за декодиране на PKCS#12 – %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +#| msgid "Couldn't decode certificate: %d" +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Грешка при декодиране на файла с PKCS#12 – %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +#| msgid "Couldn't decode certificate: %d" +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Грешка при проверка на файла с PKCS#12 – %d" + +#: ../libnm-util/crypto_nss.c:557 +#| msgid "Could not decode private key." +msgid "Could not generate random data." +msgstr "Грешка при генериране на случайни числа." + +#: ../libnm-util/nm-utils.c:1975 +#, c-format +#| msgid "Not enough memory to create private key decryption key." +msgid "Not enough memory to make encryption key." +msgstr "Няма достатъчно памет за създаването на ключ за шифроване." + +#: ../libnm-util/nm-utils.c:2085 +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file creation." +msgstr "Няма достатъчно памет за създаването на файл във формат PEM." + +#: ../libnm-util/nm-utils.c:2097 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "" +"Няма достатъчно памет за записването на началния вектор във файл във формат " +"PEM." + +#: ../libnm-util/nm-utils.c:2109 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "" +"Няма достатъчно памет за записване на ключа за шифроване във файл във формат " +"PEM." + +#: ../libnm-util/nm-utils.c:2128 +#, c-format +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file data." +msgstr "Няма достатъчно памет за данните за файла във формат PEM." + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Споделяне на връзката през защитена безжична мрежа" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Споделяне на връзката през отворена безжична мрежа" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Промяна на името на хоста" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +#| msgid "No active connections!" +msgid "Modify system connections" +msgstr "Промяна на системни връзки" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Политиката на системата не позволява промяна на системните настройки" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "Политиката на системата не позволява промяна на името на хоста" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"Политиката на системата не позволява споделяне на връзки през защитена " +"безжична мрежа" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"Политиката на системата не позволява споделяне на връзки през отворена " +"безжична мрежа" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +#| msgid "No network connection" +msgid "Allow control of network connections" +msgstr "Разрешаване на управлението на мрежовите връзки" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "Разрешаване на използването на потребителски връзки" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "Включване и изключване на устройства за безжични мрежи" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "Включване и изключване на устройства за достъп до мобилни мрежи" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +#| msgid "Enable _Networking" +msgid "Enable or disable system networking" +msgstr "Включване и изключване на мрежата на системно ниво" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 +msgid "" +"Put NetworkManager to sleep or wake it up (should only be used by system " +"power management)" +msgstr "" +"Приспиване и събуждане на NetworkManager (за целите на модула за управление " +"на захранването на системата)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +msgid "System policy prevents control of network connections" +msgstr "Политиката на системата не позволява управляване на мрежовите връзки" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "" +"Политиката на системата не позволява включване и изключване на устройства за " +"безжични мрежи" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "" +"Политиката на системата не позволява включване и изключване на устройства за " +"мобилни мрежи" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +msgid "System policy prevents enabling or disabling system networking" +msgstr "" +"Политиката на системата не позволява включване и изключване на мрежата на " +"системно ниво" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "" +"Политиката на системата не позволява приспиване и събуждане на NetworkManager" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +msgid "System policy prevents use of user-specific connections" +msgstr "" +"Политиката на системата не позволява използване на потребителски връзки" + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "грешка при обработката на съобщение от мрежовия слой – %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "грешка при изчакване за данни през гнездо" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "" +"грешка при свързване с мрежовия слой за наблюдение на състоянието на " +"връзката — %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +#| msgid "unable to allocate netlink handle for monitoring link status: %s" +msgid "unable to enable netlink handle credential passing: %s" +msgstr "" +"грешка при включване на предаването на удостоверения в модула на мрежовия " +"слой — %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"грешка при задаване на модул в мрежовия слой за наблюдение на състоянието на " +"връзката — %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "" +"грешка при заделяне на временна памет в мрежовия слой за наблюдение на " +"състоянието на връзката — %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +#| msgid "unable to join netlink group for monitoring link status: %s" +msgid "unable to join netlink group: %s" +msgstr "грешка при присъединяване към групата на мрежовия слой — %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +#| msgid "error processing netlink message: %s" +msgid "error updating link cache: %s" +msgstr "грешка при обновяване на информацията за връзките – %s" + +#: ../src/main.c:499 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "Неправилна опция. Ползвайте --help, за да видите списъка с опции.\n" + +#: ../src/main.c:570 +#, c-format +#| msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. Ползвайте --help, за да видите списъка с опции.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:328 +msgid "# Created by NetworkManager\n" +msgstr "# Създаден от NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:344 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Слят от %s\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 +msgid "no usable DHCP client could be found." +msgstr "не е намерен подходящ клиент за DHCP." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 +msgid "'dhclient' could be found." +msgstr "Не е намерен „dhclient“." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 +msgid "'dhcpcd' could be found." +msgstr "Не е намерен „dhcpcd“." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "Клиентът за DHCP „%s“ не се поддържа" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "Непознат праг за съобщенията в журнала „%s“" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "Непознат домейн за съобщенията в журнала „%s“" + +#: ../src/dns-manager/nm-dns-manager.c:384 +#| msgid "NOTE: the glibc resolver does not support more than 3 nameservers." +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "ЗАБЕЛЕЖКА: libc може да не поддържа повече от 3 сървъра за имена." + +#: ../src/dns-manager/nm-dns-manager.c:386 +msgid "The nameservers listed below may not be recognized." +msgstr "Долните сървъри за имена може да не бъдат разпознати." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "Автоматично %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3412 +#: ../system-settings/plugins/ifnet/connection_parser.c:49 +#| msgid "Open System" +msgid "System" +msgstr "Системна" #~ msgid "Passphrase for wireless network %s" #~ msgstr "Парола за безжичната мрежа %s" @@ -277,33 +1894,18 @@ msgstr "Сертификатът не може да бъде дешифрира #~ msgid "Connection to the wireless network '%s' failed." #~ msgstr "Неуспешно свързване към безжичната мрежа „%s“." -#~ msgid "Connection to the wired network failed." -#~ msgstr "Неуспешно свързване към кабелната мрежа." - #~ msgid "Error displaying connection information:" #~ msgstr "Грешка при показване на информацията за връзката:" #~ msgid "Could not find some required resources (the glade file)!" #~ msgstr "Някои ресурси не бяха открити (файлът на glade)!" -#~ msgid "No active connections!" -#~ msgstr "Няма действащи връзки!" - -#~ msgid "%d Mb/s" -#~ msgstr "%d Mb/s" - #~ msgid "Wired Ethernet (%s)" #~ msgstr "Кабелен Етернет (%s)" #~ msgid "Wireless Ethernet (%s)" #~ msgstr "Безжичен Етернет (%s)" -#~ msgid "Unknown" -#~ msgstr "неопределима" - -#~ msgid "NetworkManager Applet" -#~ msgstr "Аплетът NetworkManager" - #~ msgid "" #~ "Copyright © 2004-2006 Red Hat, Inc.\n" #~ "Copyright © 2005-2006 Novell, Inc." @@ -351,9 +1953,6 @@ msgstr "Сертификатът не може да бъде дешифрира #~ "Връзката към ВЧМ „%s“ се провали поради грешка при стартиране на " #~ "програмата за ВЧМ." -#~ msgid "VPN Connect Failure" -#~ msgstr "Грешка при свързване към ВЧМ" - #~ msgid "Could not start the VPN connection '%s' due to a connection error." #~ msgstr "Връзката към ВЧМ „%s“ се провали поради грешка при свързването." @@ -386,9 +1985,6 @@ msgstr "Сертификатът не може да бъде дешифрира #~ msgid "The network device \"%s (%s)\" does not support link detection." #~ msgstr "Мрежовото устройство „%s (%s)“ не поддържа засичане на връзка." -#~ msgid "(unknown)" -#~ msgstr "(не се знае)" - #~ msgid "Preparing device %s for the wired network..." #~ msgstr "Подготвяне на устройството „%s“ за кабелната мрежа…" @@ -419,12 +2015,6 @@ msgstr "Сертификатът не може да бъде дешифрира #~ msgid "NetworkManager is not running" #~ msgstr "NetworkManager не е включен" -#~ msgid "Networking disabled" -#~ msgstr "Мрежата е изключена" - -#~ msgid "No network connection" -#~ msgstr "Няма връзка към мрежа" - #~ msgid "Wired network connection" #~ msgstr "Връзка към кабелна мрежа" @@ -437,9 +2027,6 @@ msgstr "Сертификатът не може да бъде дешифрира #~ msgid "VPN connection to '%s'" #~ msgstr "Връзка по ВЧМ към „%s“" -#~ msgid "VPN connecting to '%s'" -#~ msgstr "Свързване по ВЧМ към „%s“" - #~ msgid "_Connect to Other Wireless Network..." #~ msgstr "_Свързване към други безжични мрежи…" @@ -470,9 +2057,6 @@ msgstr "Сертификатът не може да бъде дешифрира #~ msgid "NetworkManager is not running..." #~ msgstr "NetworkManager не е включен…" -#~ msgid "Enable _Networking" -#~ msgstr "_Включване на мрежата" - #~ msgid "Enable _Wireless" #~ msgstr "Включване на _безжичната мрежа" @@ -492,39 +2076,21 @@ msgstr "Сертификатът не може да бъде дешифрира #~ "Аплетът NetworkManager не може да открие необходим ресурс. Програмата не " #~ "може да продължи работа.\n" -#~ msgid "Open System" -#~ msgstr "Открита система" - #~ msgid "Shared Key" #~ msgstr "Споделен ключ" #~ msgid "Automatic (Default)" #~ msgstr "Автоматично (по подразбиране)" -#~ msgid "AES-CCMP" -#~ msgstr "AES-CCMP" - -#~ msgid "TKIP" -#~ msgstr "TKIP" - #~ msgid "Dynamic WEP" #~ msgstr "Динамичен WEP" -#~ msgid "None" -#~ msgstr "Без" - #~ msgid "WEP 64/128-bit ASCII" #~ msgstr "40/128-битов ключ за WEP в ASCII" #~ msgid "WEP 64/128-bit Hex" #~ msgstr "40/128-битов шестнадесетичен ключ за WEP" -#~ msgid "WEP 128-bit Passphrase" -#~ msgstr "128 битова парола WEP" - -#~ msgid "PEAP" -#~ msgstr "PEAP" - #~ msgid "TLS" #~ msgstr "TLS" @@ -534,9 +2100,6 @@ msgstr "Сертификатът не може да бъде дешифрира #~ msgid "WPA2 Enterprise" #~ msgstr "WPA2 Enterprise" -#~ msgid "WPA Enterprise" -#~ msgstr "WPA Enterprise" - #~ msgid "WPA2 Personal" #~ msgstr "WPA2 Personal" @@ -683,15 +2246,9 @@ msgstr "Сертификатът не може да бъде дешифрира #~ msgid "CA Certificate File:" #~ msgstr "Файл със сертификатите на сертифициращите организации:" -#~ msgid "C_onnect" -#~ msgstr "_Свързване" - #~ msgid "Client Certificate File:" #~ msgstr "Файл с клиентските сертификати:" -#~ msgid "Connection Information" -#~ msgstr "Информация за връзката" - #~ msgid "Default Route:" #~ msgstr "Маршрут по подразбиране:" @@ -842,9 +2399,6 @@ msgstr "Сертификатът не може да бъде дешифрира #~ "софтуер за връзка към ВЧМ от вида „%1$s“. Свържете се със системния " #~ "администратор." -#~ msgid "Error retrieving VPN connection '%s'" -#~ msgstr "Грешка при получаване на информация за връзката към ВЧМ „%s“" - #~ msgid "" #~ "Could not find the UI files for VPN connection type '%s'. Contact your " #~ "system administrator." @@ -897,36 +2451,24 @@ msgstr "Сертификатът не може да бъде дешифрира #~ msgid "Manage Virtual Private Network Connections" #~ msgstr "Управление на връзките към ВЧМ" -#~ msgid "VPN Connections" -#~ msgstr "Връзки към ВЧМ" - #~ msgid "40-bit WEP" #~ msgstr "40-битов WEP" #~ msgid "104-bit WEP" #~ msgstr "104-битов WEP" -#~ msgid "WPA TKIP" -#~ msgstr "WPA TKIP" - #~ msgid "WPA CCMP" #~ msgstr "WPA CCMP" #~ msgid "WPA Automatic" #~ msgstr "Автоматичен WPA" -#~ msgid "WPA2 TKIP" -#~ msgstr "WPA2 TKIP" - #~ msgid "WPA2 CCMP" #~ msgstr "WPA2 CCMP" #~ msgid "WPA2 Automatic" #~ msgstr "Автоматичен WPA2" -#~ msgid "none" -#~ msgstr "липсва" - #~ msgid "operation took too long" #~ msgstr "операцията продължи прекалено дълго" @@ -949,14 +2491,5 @@ msgstr "Сертификатът не може да бъде дешифрира #~ msgid "You are now connected to the wired network." #~ msgstr "Свързани сте към кабелната мрежа." -#~ msgid "Connection Established" -#~ msgstr "Връзката е осъществена" - -#~ msgid "Disconnected" -#~ msgstr "Без връзка" - -#~ msgid "The network connection has been disconnected." -#~ msgstr "Връзката към мрежата е прекъсната." - #~ msgid "LEAP" #~ msgstr "LEAP" -- cgit v1.2.1 From 088454fcab2a37b9c27d7bae0af2ebc1466d701f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Thu, 30 Sep 2010 15:13:39 +0200 Subject: ifcfg-rh: fix assertion failure when IP4 setting is missing while writing connection --- system-settings/plugins/ifcfg-rh/writer.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c index 75fbca69e8..cf1e2663a5 100644 --- a/system-settings/plugins/ifcfg-rh/writer.c +++ b/system-settings/plugins/ifcfg-rh/writer.c @@ -1021,6 +1021,7 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) guint32 i, num; GString *searches; gboolean success = FALSE; + gboolean fake_ip4 = FALSE; const char *method = NULL; s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); @@ -1058,15 +1059,19 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) return TRUE; } - value = nm_setting_ip4_config_get_method (s_ip4); - g_assert (value); - if (!strcmp (value, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) + /* Temporarily create fake IP4 setting if missing; method set to DHCP above */ + if (!s_ip4) { + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + fake_ip4 = TRUE; + } + + if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) svSetValue (ifcfg, "BOOTPROTO", "dhcp", FALSE); - else if (!strcmp (value, NM_SETTING_IP4_CONFIG_METHOD_MANUAL)) + else if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_MANUAL)) svSetValue (ifcfg, "BOOTPROTO", "none", FALSE); - else if (!strcmp (value, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL)) + else if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL)) svSetValue (ifcfg, "BOOTPROTO", "autoip", FALSE); - else if (!strcmp (value, NM_SETTING_IP4_CONFIG_METHOD_SHARED)) + else if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_SHARED)) svSetValue (ifcfg, "BOOTPROTO", "shared", FALSE); num = nm_setting_ip4_config_get_num_addresses (s_ip4); @@ -1156,7 +1161,7 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) svSetValue (ifcfg, "PEERROUTES", NULL, FALSE); svSetValue (ifcfg, "DHCP_HOSTNAME", NULL, FALSE); svSetValue (ifcfg, "DHCP_CLIENT_ID", NULL, FALSE); - if (!strcmp (value, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) { + if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) { svSetValue (ifcfg, "PEERDNS", nm_setting_ip4_config_get_ignore_auto_dns (s_ip4) ? "no" : "yes", FALSE); @@ -1264,6 +1269,9 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) success = TRUE; out: + if (fake_ip4) + g_object_unref (s_ip4); + return success; } -- cgit v1.2.1 From 9ee41307fc356e915be7a6dc4aea19034f0735a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Thu, 30 Sep 2010 21:09:01 +0200 Subject: examples: add example for adding a connection in C (using glib) --- configure.ac | 1 + examples/C/Makefile.am | 2 + examples/C/add-connection-glib.c | 112 +++++++++++++++++++++++++++++++++++++++ examples/Makefile.am | 4 +- 4 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 examples/C/Makefile.am create mode 100644 examples/C/add-connection-glib.c diff --git a/configure.ac b/configure.ac index db28815783..568359706f 100644 --- a/configure.ac +++ b/configure.ac @@ -560,6 +560,7 @@ docs/libnm-util/Makefile NetworkManager.pc examples/Makefile examples/python/Makefile +examples/C/Makefile ]) AC_OUTPUT diff --git a/examples/C/Makefile.am b/examples/C/Makefile.am new file mode 100644 index 0000000000..68c0697b0b --- /dev/null +++ b/examples/C/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ + add-connection-glib.c diff --git a/examples/C/add-connection-glib.c b/examples/C/add-connection-glib.c new file mode 100644 index 0000000000..0e8dc18036 --- /dev/null +++ b/examples/C/add-connection-glib.c @@ -0,0 +1,112 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +/* + * The example shows how to call AddConnection() D-Bus method to add + * a connection to system settings service. It uses dbus-glib and libnm-util + * libraries. + * + * Compile with: + * gcc -Wall `pkg-config --libs --cflags glib-2.0 dbus-glib-1 libnm-util` add-connection-glib.c -o add-connection-glib + */ + +#include +#include + +#include +#include +#include +#include +#include +#include + +#define DBUS_TYPE_G_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE)) +#define DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, DBUS_TYPE_G_MAP_OF_VARIANT)) + +void add_connection (DBusGProxy *proxy, const char *con_name) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4; + char *uuid; + GHashTable *hash; + GError *error = NULL; + + /* Create a new connection object */ + connection = (NMConnection *) nm_connection_new (); + + /* Build up the 'connection' Setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + uuid = nm_utils_uuid_generate (); + g_object_set (G_OBJECT (s_con), + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_ID, con_name, + NM_SETTING_CONNECTION_TYPE, "802-3-ethernet", + NULL); + g_free (uuid); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + /* Build up the 'wired' Setting */ + s_wired = (NMSettingWired *) nm_setting_wired_new (); + nm_connection_add_setting (connection, NM_SETTING (s_wired)); + + /* Build up the 'ipv4' Setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + g_object_set (G_OBJECT (s_ip4), + NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, + NULL); + nm_connection_add_setting (connection, NM_SETTING (s_ip4)); + + hash = nm_connection_to_hash (connection); + + /* Call AddConnection with the hash as argument */ + dbus_g_proxy_call (proxy, "AddConnection", &error, + DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, hash, + G_TYPE_INVALID); + + g_hash_table_destroy (hash); + g_object_unref (connection); +} + + +int main (int argc, char *argv[]) +{ + DBusGConnection *bus; + DBusGProxy *proxy; + + /* Initialize GType system */ + g_type_init (); + + /* Get system bus */ + bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL); + + /* Create a D-Bus proxy; NM_DBUS_* defined in NetworkManager.h */ + proxy = dbus_g_proxy_new_for_name (bus, + NM_DBUS_SERVICE_SYSTEM_SETTINGS, + NM_DBUS_PATH_SETTINGS, + NM_DBUS_IFACE_SETTINGS); + + /* Add a connection */ + add_connection (proxy, "__Test connection__"); + + g_object_unref (proxy); + dbus_g_connection_unref (bus); + + return 0; +} diff --git a/examples/Makefile.am b/examples/Makefile.am index c2ddf781cc..643959b143 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -1 +1,3 @@ -SUBDIRS=python +SUBDIRS= \ + python \ + C -- cgit v1.2.1 From 43b55f719fe3c9e06cf7f86065b71cb6fccac279 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 4 Oct 2010 19:37:17 -0500 Subject: supplicant: simplify supplicant interface object Move GObject stuff to the bottom to reduce prototype abuse and remove unneeded prefixes from stuff that's private to the class itself. We also don't need the 'supplicant-manager' or 'device' properties since they weren't used anywhere. --- src/supplicant-manager/nm-supplicant-interface.c | 568 ++++++++++------------- 1 file changed, 245 insertions(+), 323 deletions(-) diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index a65a458f5b..c04dc5e1cf 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2006 - 2008 Red Hat, Inc. + * Copyright (C) 2006 - 2010 Red Hat, Inc. * Copyright (C) 2006 - 2008 Novell, Inc. */ @@ -47,26 +47,11 @@ G_DEFINE_TYPE (NMSupplicantInterface, nm_supplicant_interface, G_TYPE_OBJECT) NM_TYPE_SUPPLICANT_INTERFACE, \ NMSupplicantInterfacePrivate)) -static void nm_supplicant_interface_set_property (GObject * object, - guint prop_id, - const GValue * value, - GParamSpec * pspec); - -static void nm_supplicant_interface_get_property (GObject * object, - guint prop_id, - GValue * value, - GParamSpec * pspec); - static void nm_supplicant_interface_start (NMSupplicantInterface *self); static void nm_supplicant_interface_add_to_supplicant (NMSupplicantInterface *self, gboolean get_only); -static void nm_supplicant_interface_smgr_state_changed (NMSupplicantManager *smgr, - guint32 new_state, - guint32 old_state, - gpointer user_data); - static void nm_supplicant_interface_set_state (NMSupplicantInterface *self, guint32 new_state); @@ -82,14 +67,12 @@ enum { CONNECTION_ERROR, /* an error occurred during a connection request */ LAST_SIGNAL }; -static guint nm_supplicant_interface_signals[LAST_SIGNAL] = { 0 }; +static guint signals[LAST_SIGNAL] = { 0 }; /* Properties */ enum { PROP_0 = 0, - PROP_SUPPLICANT_MANAGER, - PROP_DEVICE, PROP_STATE, PROP_CONNECTION_STATE, PROP_SCANNING, @@ -121,7 +104,7 @@ typedef struct NMSupplicantConfig * cfg; - gboolean dispose_has_run; + gboolean disposed; } NMSupplicantInterfacePrivate; static gboolean @@ -203,103 +186,6 @@ nm_supplicant_info_destroy (gpointer user_data) } } - -NMSupplicantInterface * -nm_supplicant_interface_new (NMSupplicantManager * smgr, const char *ifname, gboolean is_wireless) -{ - NMSupplicantInterface * iface; - - g_return_val_if_fail (NM_IS_SUPPLICANT_MANAGER (smgr), NULL); - g_return_val_if_fail (ifname != NULL, NULL); - - iface = g_object_new (NM_TYPE_SUPPLICANT_INTERFACE, - "supplicant-manager", smgr, - "device", ifname, - NULL); - if (iface) { - NM_SUPPLICANT_INTERFACE_GET_PRIVATE (iface)->is_wireless = is_wireless; - nm_supplicant_interface_start (iface); - } - - return iface; -} - -static void -nm_supplicant_interface_init (NMSupplicantInterface * self) -{ - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); - - priv->state = NM_SUPPLICANT_INTERFACE_STATE_INIT; - priv->con_state = NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED; - priv->assoc_pcalls = nm_call_store_new (); - priv->other_pcalls = nm_call_store_new (); - - priv->dispose_has_run = FALSE; - - priv->dbus_mgr = nm_dbus_manager_get (); -} - - -static void -nm_supplicant_interface_set_property (GObject * object, - guint prop_id, - const GValue * value, - GParamSpec * pspec) -{ - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object); - gulong id; - - switch (prop_id) { - case PROP_SUPPLICANT_MANAGER: - priv->smgr = NM_SUPPLICANT_MANAGER (g_value_get_object (value)); - g_object_ref (G_OBJECT (priv->smgr)); - - id = g_signal_connect (priv->smgr, - "state", - G_CALLBACK (nm_supplicant_interface_smgr_state_changed), - object); - priv->smgr_state_sig_handler = id; - break; - case PROP_DEVICE: - /* Construct-only */ - priv->dev = g_strdup (g_value_get_string (value)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -nm_supplicant_interface_get_property (GObject * object, - guint prop_id, - GValue * value, - GParamSpec * pspec) -{ - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object); - - switch (prop_id) { - case PROP_SUPPLICANT_MANAGER: - g_value_set_object (value, G_OBJECT (priv->smgr)); - break; - case PROP_DEVICE: - g_value_set_string (value, priv->dev); - break; - case PROP_STATE: - g_value_set_uint (value, priv->state); - break; - case PROP_CONNECTION_STATE: - g_value_set_uint (value, priv->con_state); - break; - case PROP_SCANNING: - g_value_set_boolean (value, priv->scanning); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - static void try_remove_iface (DBusGConnection *g_connection, const char *path) @@ -322,175 +208,6 @@ try_remove_iface (DBusGConnection *g_connection, g_object_unref (proxy); } -static void -nm_supplicant_interface_dispose (GObject *object) -{ - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object); - guint32 sm_state; - - if (priv->dispose_has_run) { - G_OBJECT_CLASS (nm_supplicant_interface_parent_class)->dispose (object); - return; - } - - priv->dispose_has_run = TRUE; - - /* Ask wpa_supplicant to remove this interface */ - sm_state = nm_supplicant_manager_get_state (priv->smgr); - if (sm_state == NM_SUPPLICANT_MANAGER_STATE_IDLE) { - if (priv->object_path) { - try_remove_iface (nm_dbus_manager_get_connection (priv->dbus_mgr), - priv->object_path); - } - } - - if (priv->iface_proxy) - g_object_unref (priv->iface_proxy); - - if (priv->net_proxy) - g_object_unref (priv->net_proxy); - - if (priv->scan_results_timeout) - g_source_remove (priv->scan_results_timeout); - - if (priv->smgr) { - g_signal_handler_disconnect (priv->smgr, - priv->smgr_state_sig_handler); - g_object_unref (priv->smgr); - } - - g_free (priv->dev); - - /* Cancel pending calls before unrefing the dbus manager */ - cancel_all_callbacks (priv->other_pcalls); - nm_call_store_destroy (priv->other_pcalls); - - cancel_all_callbacks (priv->assoc_pcalls); - nm_call_store_destroy (priv->assoc_pcalls); - - if (priv->dbus_mgr) - g_object_unref (priv->dbus_mgr); - - if (priv->cfg) - g_object_unref (priv->cfg); - - g_free (priv->object_path); - - /* Chain up to the parent class */ - G_OBJECT_CLASS (nm_supplicant_interface_parent_class)->dispose (object); -} - -static void -nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - g_type_class_add_private (object_class, sizeof (NMSupplicantInterfacePrivate)); - - object_class->dispose = nm_supplicant_interface_dispose; - object_class->set_property = nm_supplicant_interface_set_property; - object_class->get_property = nm_supplicant_interface_get_property; - - /* Properties */ - g_object_class_install_property (object_class, - PROP_SUPPLICANT_MANAGER, - g_param_spec_object ("supplicant-manager", - "Supplicant Manager", - "Supplicant manager to which this interface belongs", - NM_TYPE_SUPPLICANT_MANAGER, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); - - g_object_class_install_property (object_class, - PROP_DEVICE, - g_param_spec_string ("device", - "Device", - "Device which this interface represents to the supplicant", - NULL, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); - - g_object_class_install_property (object_class, - PROP_STATE, - g_param_spec_uint ("state", - "State", - "State of the supplicant interface; INIT, READY, or DOWN", - NM_SUPPLICANT_INTERFACE_STATE_INIT, - NM_SUPPLICANT_INTERFACE_STATE_LAST - 1, - NM_SUPPLICANT_INTERFACE_STATE_INIT, - G_PARAM_READABLE)); - - g_object_class_install_property (object_class, - PROP_SCANNING, - g_param_spec_boolean ("scanning", - "Scanning", - "Scanning", - FALSE, - G_PARAM_READABLE)); - - /* Signals */ - nm_supplicant_interface_signals[STATE] = - g_signal_new ("state", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, state), - NULL, NULL, - _nm_marshal_VOID__UINT_UINT, - G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); - - nm_supplicant_interface_signals[REMOVED] = - g_signal_new ("removed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, removed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - nm_supplicant_interface_signals[SCANNED_AP] = - g_signal_new ("scanned-ap", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scanned_ap), - NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, G_TYPE_POINTER); - - nm_supplicant_interface_signals[SCAN_REQ_RESULT] = - g_signal_new ("scan-req-result", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scan_req_result), - NULL, NULL, - g_cclosure_marshal_VOID__BOOLEAN, - G_TYPE_NONE, 1, G_TYPE_BOOLEAN); - - nm_supplicant_interface_signals[SCAN_RESULTS] = - g_signal_new ("scan-results", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scan_results), - NULL, NULL, - g_cclosure_marshal_VOID__UINT, - G_TYPE_NONE, 1, G_TYPE_UINT); - - nm_supplicant_interface_signals[CONNECTION_STATE] = - g_signal_new ("connection-state", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, connection_state), - NULL, NULL, - _nm_marshal_VOID__UINT_UINT, - G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); - - nm_supplicant_interface_signals[CONNECTION_ERROR] = - g_signal_new ("connection-error", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, connection_error), - NULL, NULL, - _nm_marshal_VOID__STRING_STRING, - G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); -} - static void emit_error_helper (NMSupplicantInterface *self, GError *err) @@ -500,11 +217,7 @@ emit_error_helper (NMSupplicantInterface *self, if (err->domain == DBUS_GERROR && err->code == DBUS_GERROR_REMOTE_EXCEPTION) name = dbus_g_error_get_name (err); - g_signal_emit (self, - nm_supplicant_interface_signals[CONNECTION_ERROR], - 0, - name, - err->message); + g_signal_emit (self, signals[CONNECTION_ERROR], 0, name, err->message); } static void @@ -523,11 +236,7 @@ bssid_properties_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_ } g_error_free (err); } else { - g_signal_emit (info->interface, - nm_supplicant_interface_signals[SCANNED_AP], - 0, - hash); - + g_signal_emit (info->interface, signals[SCANNED_AP], 0, hash); g_hash_table_destroy (hash); } } @@ -571,10 +280,7 @@ scan_results_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; /* Notify listeners of the result of the scan */ - g_signal_emit (info->interface, - nm_supplicant_interface_signals[SCAN_RESULTS], - 0, - array->len); + g_signal_emit (info->interface, signals[SCAN_RESULTS], 0, array->len); /* Fire off a "properties" call for each returned BSSID */ for (i = 0; i < array->len; i++) { @@ -674,13 +380,8 @@ wpas_iface_handle_state_change (DBusGProxy *proxy, enum_new_state = wpas_state_string_to_enum (str_new_state); old_state = priv->con_state; priv->con_state = enum_new_state; - if (priv->con_state != old_state) { - g_signal_emit (user_data, - nm_supplicant_interface_signals[CONNECTION_STATE], - 0, - priv->con_state, - old_state); - } + if (priv->con_state != old_state) + g_signal_emit (user_data, signals[CONNECTION_STATE], 0, priv->con_state, old_state); } @@ -967,18 +668,14 @@ nm_supplicant_interface_set_state (NMSupplicantInterface * self, } priv->state = new_state; - g_signal_emit (self, - nm_supplicant_interface_signals[STATE], - 0, - priv->state, - old_state); + g_signal_emit (self, signals[STATE], 0, priv->state, old_state); } static void -nm_supplicant_interface_smgr_state_changed (NMSupplicantManager * smgr, - guint32 new_state, - guint32 old_state, - gpointer user_data) +smgr_state_changed (NMSupplicantManager *smgr, + guint32 new_state, + guint32 old_state, + gpointer user_data) { NMSupplicantInterface * self = NM_SUPPLICANT_INTERFACE (user_data); @@ -1194,9 +891,7 @@ call_set_blobs (NMSupplicantInfo *info, GHashTable *orig_blobs) const char *msg = "Not enough memory to create blob table."; nm_log_warn (LOGD_SUPPLICANT, "%s", msg); - g_signal_emit (info->interface, - nm_supplicant_interface_signals[CONNECTION_ERROR], - 0, "SendBlobError", msg); + g_signal_emit (info->interface, signals[CONNECTION_ERROR], 0, "SendBlobError", msg); return; } @@ -1339,10 +1034,7 @@ scan_request_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) } /* Notify listeners of the result of the scan */ - g_signal_emit (info->interface, - nm_supplicant_interface_signals[SCAN_REQ_RESULT], - 0, - success ? TRUE : FALSE); + g_signal_emit (info->interface, signals[SCAN_REQ_RESULT], 0, !!success); } gboolean @@ -1427,3 +1119,233 @@ nm_supplicant_interface_connection_state_to_string (guint32 state) return "unknown"; } +/*******************************************************************/ + +NMSupplicantInterface * +nm_supplicant_interface_new (NMSupplicantManager *smgr, + const char *ifname, + gboolean is_wireless) +{ + NMSupplicantInterface *self; + NMSupplicantInterfacePrivate *priv; + guint id; + + g_return_val_if_fail (NM_IS_SUPPLICANT_MANAGER (smgr), NULL); + g_return_val_if_fail (ifname != NULL, NULL); + + self = g_object_new (NM_TYPE_SUPPLICANT_INTERFACE, NULL); + if (self) { + priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + + priv->smgr = g_object_ref (smgr); + id = g_signal_connect (priv->smgr, + "state", + G_CALLBACK (smgr_state_changed), + self); + priv->smgr_state_sig_handler = id; + + priv->dev = g_strdup (ifname); + priv->is_wireless = is_wireless; + nm_supplicant_interface_start (self); + } + + return self; +} + +static void +nm_supplicant_interface_init (NMSupplicantInterface * self) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + + priv->state = NM_SUPPLICANT_INTERFACE_STATE_INIT; + priv->con_state = NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED; + priv->assoc_pcalls = nm_call_store_new (); + priv->other_pcalls = nm_call_store_new (); + priv->dbus_mgr = nm_dbus_manager_get (); +} + +static void +set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + switch (prop_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + switch (prop_id) { + case PROP_STATE: + g_value_set_uint (value, NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object)->state); + break; + case PROP_CONNECTION_STATE: + g_value_set_uint (value, NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object)->con_state); + break; + case PROP_SCANNING: + g_value_set_boolean (value, NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object)->scanning); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +dispose (GObject *object) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object); + guint32 sm_state; + + if (priv->disposed) { + G_OBJECT_CLASS (nm_supplicant_interface_parent_class)->dispose (object); + return; + } + priv->disposed = TRUE; + + /* Ask wpa_supplicant to remove this interface */ + sm_state = nm_supplicant_manager_get_state (priv->smgr); + if (sm_state == NM_SUPPLICANT_MANAGER_STATE_IDLE) { + if (priv->object_path) { + try_remove_iface (nm_dbus_manager_get_connection (priv->dbus_mgr), + priv->object_path); + } + } + + if (priv->iface_proxy) + g_object_unref (priv->iface_proxy); + + if (priv->net_proxy) + g_object_unref (priv->net_proxy); + + if (priv->scan_results_timeout) + g_source_remove (priv->scan_results_timeout); + + if (priv->smgr) { + g_signal_handler_disconnect (priv->smgr, + priv->smgr_state_sig_handler); + g_object_unref (priv->smgr); + } + + g_free (priv->dev); + + /* Cancel pending calls before unrefing the dbus manager */ + cancel_all_callbacks (priv->other_pcalls); + nm_call_store_destroy (priv->other_pcalls); + + cancel_all_callbacks (priv->assoc_pcalls); + nm_call_store_destroy (priv->assoc_pcalls); + + if (priv->dbus_mgr) + g_object_unref (priv->dbus_mgr); + + if (priv->cfg) + g_object_unref (priv->cfg); + + g_free (priv->object_path); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (nm_supplicant_interface_parent_class)->dispose (object); +} + +static void +nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (NMSupplicantInterfacePrivate)); + + object_class->dispose = dispose; + object_class->set_property = set_property; + object_class->get_property = get_property; + + /* Properties */ + g_object_class_install_property (object_class, PROP_STATE, + g_param_spec_uint ("state", + "State", + "State of the supplicant interface; INIT, READY, or DOWN", + NM_SUPPLICANT_INTERFACE_STATE_INIT, + NM_SUPPLICANT_INTERFACE_STATE_LAST - 1, + NM_SUPPLICANT_INTERFACE_STATE_INIT, + G_PARAM_READABLE)); + + g_object_class_install_property (object_class, PROP_SCANNING, + g_param_spec_boolean ("scanning", + "Scanning", + "Scanning", + FALSE, + G_PARAM_READABLE)); + + /* Signals */ + signals[STATE] = + g_signal_new ("state", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, state), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); + + signals[REMOVED] = + g_signal_new ("removed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, removed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[SCANNED_AP] = + g_signal_new ("scanned-ap", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scanned_ap), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); + + signals[SCAN_REQ_RESULT] = + g_signal_new ("scan-req-result", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scan_req_result), + NULL, NULL, + g_cclosure_marshal_VOID__BOOLEAN, + G_TYPE_NONE, 1, G_TYPE_BOOLEAN); + + signals[SCAN_RESULTS] = + g_signal_new ("scan-results", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scan_results), + NULL, NULL, + g_cclosure_marshal_VOID__UINT, + G_TYPE_NONE, 1, G_TYPE_UINT); + + signals[CONNECTION_STATE] = + g_signal_new ("connection-state", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, connection_state), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); + + signals[CONNECTION_ERROR] = + g_signal_new ("connection-error", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, connection_error), + NULL, NULL, + _nm_marshal_VOID__STRING_STRING, + G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); +} + -- cgit v1.2.1 From 0e61ddcd27b3fc89d7660c1d22f0ca4a638b00eb Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 4 Oct 2010 19:42:25 -0500 Subject: supplicant: use a GHashTable instead of a GSList for tracking interfaces It's just less code. Yay. --- src/supplicant-manager/nm-supplicant-interface.c | 8 +++++ src/supplicant-manager/nm-supplicant-interface.h | 4 ++- src/supplicant-manager/nm-supplicant-manager.c | 46 ++++++++---------------- 3 files changed, 25 insertions(+), 33 deletions(-) diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index c04dc5e1cf..3c3fe52f84 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -1119,6 +1119,14 @@ nm_supplicant_interface_connection_state_to_string (guint32 state) return "unknown"; } +const char * +nm_supplicant_interface_get_ifname (NMSupplicantInterface *self) +{ + g_return_val_if_fail (self != NULL, FALSE); + + return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->dev; +} + /*******************************************************************/ NMSupplicantInterface * diff --git a/src/supplicant-manager/nm-supplicant-interface.h b/src/supplicant-manager/nm-supplicant-interface.h index bee5436f5a..3e56f4efaf 100644 --- a/src/supplicant-manager/nm-supplicant-interface.h +++ b/src/supplicant-manager/nm-supplicant-interface.h @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2006 - 2008 Red Hat, Inc. + * Copyright (C) 2006 - 2010 Red Hat, Inc. * Copyright (C) 2007 - 2008 Novell, Inc. */ @@ -140,6 +140,8 @@ const char *nm_supplicant_interface_connection_state_to_string (guint32 state); gboolean nm_supplicant_interface_get_scanning (NMSupplicantInterface *self); +const char *nm_supplicant_interface_get_ifname (NMSupplicantInterface *self); + G_END_DECLS #endif /* NM_SUPPLICANT_INTERFACE_H */ diff --git a/src/supplicant-manager/nm-supplicant-manager.c b/src/supplicant-manager/nm-supplicant-manager.c index a2cf58eb8f..1077da8d7f 100644 --- a/src/supplicant-manager/nm-supplicant-manager.c +++ b/src/supplicant-manager/nm-supplicant-manager.c @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2006 - 2008 Red Hat, Inc. + * Copyright (C) 2006 - 2010 Red Hat, Inc. * Copyright (C) 2007 - 2008 Novell, Inc. */ @@ -35,7 +35,7 @@ typedef struct { NMDBusManager * dbus_mgr; guint32 state; - GSList * ifaces; + GHashTable * ifaces; gboolean dispose_has_run; guint poke_id; } NMSupplicantManagerPrivate; @@ -125,6 +125,8 @@ nm_supplicant_manager_init (NMSupplicantManager * self) priv->dbus_mgr = nm_dbus_manager_get (); priv->poke_id = 0; + priv->ifaces = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); + running = nm_supplicant_manager_startup (self); g_signal_connect (priv->dbus_mgr, @@ -265,33 +267,23 @@ nm_supplicant_manager_startup (NMSupplicantManager * self) NMSupplicantInterface * nm_supplicant_manager_get_iface (NMSupplicantManager * self, - const char *ifname, - gboolean is_wireless) + const char *ifname, + gboolean is_wireless) { NMSupplicantManagerPrivate *priv; NMSupplicantInterface * iface = NULL; - GSList * elt; g_return_val_if_fail (NM_IS_SUPPLICANT_MANAGER (self), NULL); g_return_val_if_fail (ifname != NULL, NULL); priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); - /* Ensure we don't already have this interface */ - for (elt = priv->ifaces; elt; elt = g_slist_next (elt)) { - NMSupplicantInterface * if_tmp = (NMSupplicantInterface *) elt->data; - - if (!strcmp (ifname, nm_supplicant_interface_get_device (if_tmp))) { - iface = if_tmp; - break; - } - } - + iface = g_hash_table_lookup (priv->ifaces, ifname); if (!iface) { nm_log_dbg (LOGD_SUPPLICANT, "(%s): creating new supplicant interface", ifname); iface = nm_supplicant_interface_new (self, ifname, is_wireless); if (iface) - priv->ifaces = g_slist_append (priv->ifaces, iface); + g_hash_table_insert (priv->ifaces, g_strdup (ifname), iface); } else { nm_log_dbg (LOGD_SUPPLICANT, "(%s): returning existing supplicant interface", ifname); } @@ -300,30 +292,20 @@ nm_supplicant_manager_get_iface (NMSupplicantManager * self, } void -nm_supplicant_manager_release_iface (NMSupplicantManager * self, - NMSupplicantInterface * iface) +nm_supplicant_manager_release_iface (NMSupplicantManager *self, + NMSupplicantInterface *iface) { NMSupplicantManagerPrivate *priv; - GSList * elt; + const char *ifname; g_return_if_fail (NM_IS_SUPPLICANT_MANAGER (self)); g_return_if_fail (NM_IS_SUPPLICANT_INTERFACE (iface)); priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); - for (elt = priv->ifaces; elt; elt = g_slist_next (elt)) { - NMSupplicantInterface * if_tmp = (NMSupplicantInterface *) elt->data; - - if (if_tmp == iface) { - /* Remove the iface from the supplicant manager's list and - * dereference to match additional reference in get_iface. - */ - priv->ifaces = g_slist_remove_link (priv->ifaces, elt); - g_slist_free_1 (elt); - g_object_unref (iface); - break; - } - } + ifname = nm_supplicant_interface_get_ifname (iface); + g_assert (ifname); + g_hash_table_remove (priv->ifaces, ifname); } const char * -- cgit v1.2.1 From edd2369eb86bec16a35f64f4ebde3d2d5d45d6d9 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 4 Oct 2010 23:25:18 -0500 Subject: supplicant: reorganize supplicant manager class Gets rid of prototypes and simplifies the code a bit. --- src/supplicant-manager/nm-supplicant-manager.c | 289 ++++++++++++------------- 1 file changed, 134 insertions(+), 155 deletions(-) diff --git a/src/supplicant-manager/nm-supplicant-manager.c b/src/supplicant-manager/nm-supplicant-manager.c index 1077da8d7f..56a5e58d63 100644 --- a/src/supplicant-manager/nm-supplicant-manager.c +++ b/src/supplicant-manager/nm-supplicant-manager.c @@ -36,8 +36,8 @@ typedef struct { NMDBusManager * dbus_mgr; guint32 state; GHashTable * ifaces; - gboolean dispose_has_run; - guint poke_id; + gboolean disposed; + guint poke_id; } NMSupplicantManagerPrivate; #define NM_SUPPLICANT_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ @@ -46,41 +46,14 @@ typedef struct { G_DEFINE_TYPE (NMSupplicantManager, nm_supplicant_manager, G_TYPE_OBJECT) - -static void nm_supplicant_manager_name_owner_changed (NMDBusManager *dbus_mgr, - const char *name, - const char *old, - const char *new, - gpointer user_data); - -static void nm_supplicant_manager_set_state (NMSupplicantManager * self, - guint32 new_state); - -static gboolean nm_supplicant_manager_startup (NMSupplicantManager * self); - - /* Signals */ enum { STATE, /* change in the manager's state */ LAST_SIGNAL }; -static guint nm_supplicant_manager_signals[LAST_SIGNAL] = { 0 }; - - -NMSupplicantManager * -nm_supplicant_manager_get (void) -{ - static NMSupplicantManager * singleton = NULL; - - if (!singleton) { - singleton = NM_SUPPLICANT_MANAGER (g_object_new (NM_TYPE_SUPPLICANT_MANAGER, NULL)); - } else { - g_object_ref (singleton); - } +static guint signals[LAST_SIGNAL] = { 0 }; - g_assert (singleton); - return singleton; -} +/********************************************************************/ static gboolean poke_supplicant_cb (gpointer user_data) @@ -114,117 +87,6 @@ out: return FALSE; } -static void -nm_supplicant_manager_init (NMSupplicantManager * self) -{ - NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); - gboolean running; - - priv->dispose_has_run = FALSE; - priv->state = NM_SUPPLICANT_MANAGER_STATE_DOWN; - priv->dbus_mgr = nm_dbus_manager_get (); - priv->poke_id = 0; - - priv->ifaces = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); - - running = nm_supplicant_manager_startup (self); - - g_signal_connect (priv->dbus_mgr, - "name-owner-changed", - G_CALLBACK (nm_supplicant_manager_name_owner_changed), - self); - - if (!running) { - /* Try to activate the supplicant */ - priv->poke_id = g_idle_add (poke_supplicant_cb, (gpointer) self); - } -} - -static void -nm_supplicant_manager_dispose (GObject *object) -{ - NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (object); - - if (priv->dispose_has_run) { - G_OBJECT_CLASS (nm_supplicant_manager_parent_class)->dispose (object); - return; - } - - priv->dispose_has_run = TRUE; - - if (priv->poke_id) { - g_source_remove (priv->poke_id); - priv->poke_id = 0; - } - - if (priv->dbus_mgr) { - g_object_unref (G_OBJECT (priv->dbus_mgr)); - priv->dbus_mgr = NULL; - } - - /* Chain up to the parent class */ - G_OBJECT_CLASS (nm_supplicant_manager_parent_class)->dispose (object); -} - -static void -nm_supplicant_manager_class_init (NMSupplicantManagerClass *klass) -{ - GObjectClass * object_class = G_OBJECT_CLASS (klass); - - g_type_class_add_private (object_class, sizeof (NMSupplicantManagerPrivate)); - - object_class->dispose = nm_supplicant_manager_dispose; - - /* Signals */ - nm_supplicant_manager_signals[STATE] = - g_signal_new ("state", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantManagerClass, state), - NULL, NULL, - _nm_marshal_VOID__UINT_UINT, - G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); -} - -static void -nm_supplicant_manager_name_owner_changed (NMDBusManager *dbus_mgr, - const char *name, - const char *old_owner, - const char *new_owner, - gpointer user_data) -{ - NMSupplicantManager * self = (NMSupplicantManager *) user_data; - NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); - gboolean old_owner_good = (old_owner && strlen (old_owner)); - gboolean new_owner_good = (new_owner && strlen (new_owner)); - - /* Can't handle the signal if its not from the supplicant service */ - if (strcmp (WPAS_DBUS_SERVICE, name) != 0) - return; - - if (!old_owner_good && new_owner_good) { - gboolean running; - - running = nm_supplicant_manager_startup (self); - - if (running && priv->poke_id) { - g_source_remove (priv->poke_id); - priv->poke_id = 0; - } - } else if (old_owner_good && !new_owner_good) { - nm_supplicant_manager_set_state (self, NM_SUPPLICANT_MANAGER_STATE_DOWN); - - if (priv->poke_id) - g_source_remove (priv->poke_id); - - /* Poke the supplicant so that it gets activated by dbus system bus - * activation. - */ - priv->poke_id = g_idle_add (poke_supplicant_cb, (gpointer) self); - } -} - - guint32 nm_supplicant_manager_get_state (NMSupplicantManager * self) { @@ -234,25 +96,20 @@ nm_supplicant_manager_get_state (NMSupplicantManager * self) } static void -nm_supplicant_manager_set_state (NMSupplicantManager * self, guint32 new_state) +set_state (NMSupplicantManager *self, guint32 new_state) { NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); guint32 old_state; - if (new_state == priv->state) - return; - - old_state = priv->state; - priv->state = new_state; - g_signal_emit (self, - nm_supplicant_manager_signals[STATE], - 0, - priv->state, - old_state); + if (new_state != priv->state) { + old_state = priv->state; + priv->state = new_state; + g_signal_emit (self, signals[STATE], 0, priv->state, old_state); + } } static gboolean -nm_supplicant_manager_startup (NMSupplicantManager * self) +startup (NMSupplicantManager * self) { gboolean running; @@ -260,7 +117,7 @@ nm_supplicant_manager_startup (NMSupplicantManager * self) running = nm_dbus_manager_name_has_owner (NM_SUPPLICANT_MANAGER_GET_PRIVATE (self)->dbus_mgr, WPAS_DBUS_SERVICE); if (running) - nm_supplicant_manager_set_state (self, NM_SUPPLICANT_MANAGER_STATE_IDLE); + set_state (self, NM_SUPPLICANT_MANAGER_STATE_IDLE); return running; } @@ -322,4 +179,126 @@ nm_supplicant_manager_state_to_string (guint32 state) return "unknown"; } +static void +name_owner_changed (NMDBusManager *dbus_mgr, + const char *name, + const char *old_owner, + const char *new_owner, + gpointer user_data) +{ + NMSupplicantManager * self = (NMSupplicantManager *) user_data; + NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); + gboolean old_owner_good = (old_owner && strlen (old_owner)); + gboolean new_owner_good = (new_owner && strlen (new_owner)); + + /* Can't handle the signal if its not from the supplicant service */ + if (strcmp (WPAS_DBUS_SERVICE, name) != 0) + return; + + if (!old_owner_good && new_owner_good) { + gboolean running; + + running = startup (self); + + if (running && priv->poke_id) { + g_source_remove (priv->poke_id); + priv->poke_id = 0; + } + } else if (old_owner_good && !new_owner_good) { + set_state (self, NM_SUPPLICANT_MANAGER_STATE_DOWN); + + if (priv->poke_id) + g_source_remove (priv->poke_id); + + /* Poke the supplicant so that it gets activated by dbus system bus + * activation. + */ + priv->poke_id = g_idle_add (poke_supplicant_cb, (gpointer) self); + } +} + +/*******************************************************************/ + +NMSupplicantManager * +nm_supplicant_manager_get (void) +{ + static NMSupplicantManager *singleton = NULL; + + if (!singleton) + singleton = NM_SUPPLICANT_MANAGER (g_object_new (NM_TYPE_SUPPLICANT_MANAGER, NULL)); + else + g_object_ref (singleton); + + g_assert (singleton); + return singleton; +} + +static void +nm_supplicant_manager_init (NMSupplicantManager * self) +{ + NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); + gboolean running; + + priv->state = NM_SUPPLICANT_MANAGER_STATE_DOWN; + priv->dbus_mgr = nm_dbus_manager_get (); + priv->poke_id = 0; + + priv->ifaces = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); + + running = startup (self); + + g_signal_connect (priv->dbus_mgr, + "name-owner-changed", + G_CALLBACK (name_owner_changed), + self); + + if (!running) { + /* Try to activate the supplicant */ + priv->poke_id = g_idle_add (poke_supplicant_cb, (gpointer) self); + } +} + +static void +dispose (GObject *object) +{ + NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (object); + + if (priv->disposed) { + G_OBJECT_CLASS (nm_supplicant_manager_parent_class)->dispose (object); + return; + } + priv->disposed = TRUE; + + if (priv->poke_id) { + g_source_remove (priv->poke_id); + priv->poke_id = 0; + } + + if (priv->dbus_mgr) { + g_object_unref (G_OBJECT (priv->dbus_mgr)); + priv->dbus_mgr = NULL; + } + + /* Chain up to the parent class */ + G_OBJECT_CLASS (nm_supplicant_manager_parent_class)->dispose (object); +} + +static void +nm_supplicant_manager_class_init (NMSupplicantManagerClass *klass) +{ + GObjectClass * object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (NMSupplicantManagerPrivate)); + + object_class->dispose = dispose; + + /* Signals */ + signals[STATE] = g_signal_new ("state", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantManagerClass, state), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); +} -- cgit v1.2.1 From aadc6d6a7e72fca2ea4a9095a9e0616156b5675b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 5 Oct 2010 14:17:40 -0500 Subject: Revert "supplicant: reorganize supplicant manager class" This reverts commit edd2369eb86bec16a35f64f4ebde3d2d5d45d6d9. --- src/supplicant-manager/nm-supplicant-manager.c | 289 +++++++++++++------------ 1 file changed, 155 insertions(+), 134 deletions(-) diff --git a/src/supplicant-manager/nm-supplicant-manager.c b/src/supplicant-manager/nm-supplicant-manager.c index 56a5e58d63..1077da8d7f 100644 --- a/src/supplicant-manager/nm-supplicant-manager.c +++ b/src/supplicant-manager/nm-supplicant-manager.c @@ -36,8 +36,8 @@ typedef struct { NMDBusManager * dbus_mgr; guint32 state; GHashTable * ifaces; - gboolean disposed; - guint poke_id; + gboolean dispose_has_run; + guint poke_id; } NMSupplicantManagerPrivate; #define NM_SUPPLICANT_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ @@ -46,14 +46,41 @@ typedef struct { G_DEFINE_TYPE (NMSupplicantManager, nm_supplicant_manager, G_TYPE_OBJECT) + +static void nm_supplicant_manager_name_owner_changed (NMDBusManager *dbus_mgr, + const char *name, + const char *old, + const char *new, + gpointer user_data); + +static void nm_supplicant_manager_set_state (NMSupplicantManager * self, + guint32 new_state); + +static gboolean nm_supplicant_manager_startup (NMSupplicantManager * self); + + /* Signals */ enum { STATE, /* change in the manager's state */ LAST_SIGNAL }; -static guint signals[LAST_SIGNAL] = { 0 }; +static guint nm_supplicant_manager_signals[LAST_SIGNAL] = { 0 }; + + +NMSupplicantManager * +nm_supplicant_manager_get (void) +{ + static NMSupplicantManager * singleton = NULL; + + if (!singleton) { + singleton = NM_SUPPLICANT_MANAGER (g_object_new (NM_TYPE_SUPPLICANT_MANAGER, NULL)); + } else { + g_object_ref (singleton); + } -/********************************************************************/ + g_assert (singleton); + return singleton; +} static gboolean poke_supplicant_cb (gpointer user_data) @@ -87,6 +114,117 @@ out: return FALSE; } +static void +nm_supplicant_manager_init (NMSupplicantManager * self) +{ + NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); + gboolean running; + + priv->dispose_has_run = FALSE; + priv->state = NM_SUPPLICANT_MANAGER_STATE_DOWN; + priv->dbus_mgr = nm_dbus_manager_get (); + priv->poke_id = 0; + + priv->ifaces = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); + + running = nm_supplicant_manager_startup (self); + + g_signal_connect (priv->dbus_mgr, + "name-owner-changed", + G_CALLBACK (nm_supplicant_manager_name_owner_changed), + self); + + if (!running) { + /* Try to activate the supplicant */ + priv->poke_id = g_idle_add (poke_supplicant_cb, (gpointer) self); + } +} + +static void +nm_supplicant_manager_dispose (GObject *object) +{ + NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (object); + + if (priv->dispose_has_run) { + G_OBJECT_CLASS (nm_supplicant_manager_parent_class)->dispose (object); + return; + } + + priv->dispose_has_run = TRUE; + + if (priv->poke_id) { + g_source_remove (priv->poke_id); + priv->poke_id = 0; + } + + if (priv->dbus_mgr) { + g_object_unref (G_OBJECT (priv->dbus_mgr)); + priv->dbus_mgr = NULL; + } + + /* Chain up to the parent class */ + G_OBJECT_CLASS (nm_supplicant_manager_parent_class)->dispose (object); +} + +static void +nm_supplicant_manager_class_init (NMSupplicantManagerClass *klass) +{ + GObjectClass * object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (NMSupplicantManagerPrivate)); + + object_class->dispose = nm_supplicant_manager_dispose; + + /* Signals */ + nm_supplicant_manager_signals[STATE] = + g_signal_new ("state", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantManagerClass, state), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); +} + +static void +nm_supplicant_manager_name_owner_changed (NMDBusManager *dbus_mgr, + const char *name, + const char *old_owner, + const char *new_owner, + gpointer user_data) +{ + NMSupplicantManager * self = (NMSupplicantManager *) user_data; + NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); + gboolean old_owner_good = (old_owner && strlen (old_owner)); + gboolean new_owner_good = (new_owner && strlen (new_owner)); + + /* Can't handle the signal if its not from the supplicant service */ + if (strcmp (WPAS_DBUS_SERVICE, name) != 0) + return; + + if (!old_owner_good && new_owner_good) { + gboolean running; + + running = nm_supplicant_manager_startup (self); + + if (running && priv->poke_id) { + g_source_remove (priv->poke_id); + priv->poke_id = 0; + } + } else if (old_owner_good && !new_owner_good) { + nm_supplicant_manager_set_state (self, NM_SUPPLICANT_MANAGER_STATE_DOWN); + + if (priv->poke_id) + g_source_remove (priv->poke_id); + + /* Poke the supplicant so that it gets activated by dbus system bus + * activation. + */ + priv->poke_id = g_idle_add (poke_supplicant_cb, (gpointer) self); + } +} + + guint32 nm_supplicant_manager_get_state (NMSupplicantManager * self) { @@ -96,20 +234,25 @@ nm_supplicant_manager_get_state (NMSupplicantManager * self) } static void -set_state (NMSupplicantManager *self, guint32 new_state) +nm_supplicant_manager_set_state (NMSupplicantManager * self, guint32 new_state) { NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); guint32 old_state; - if (new_state != priv->state) { - old_state = priv->state; - priv->state = new_state; - g_signal_emit (self, signals[STATE], 0, priv->state, old_state); - } + if (new_state == priv->state) + return; + + old_state = priv->state; + priv->state = new_state; + g_signal_emit (self, + nm_supplicant_manager_signals[STATE], + 0, + priv->state, + old_state); } static gboolean -startup (NMSupplicantManager * self) +nm_supplicant_manager_startup (NMSupplicantManager * self) { gboolean running; @@ -117,7 +260,7 @@ startup (NMSupplicantManager * self) running = nm_dbus_manager_name_has_owner (NM_SUPPLICANT_MANAGER_GET_PRIVATE (self)->dbus_mgr, WPAS_DBUS_SERVICE); if (running) - set_state (self, NM_SUPPLICANT_MANAGER_STATE_IDLE); + nm_supplicant_manager_set_state (self, NM_SUPPLICANT_MANAGER_STATE_IDLE); return running; } @@ -179,126 +322,4 @@ nm_supplicant_manager_state_to_string (guint32 state) return "unknown"; } -static void -name_owner_changed (NMDBusManager *dbus_mgr, - const char *name, - const char *old_owner, - const char *new_owner, - gpointer user_data) -{ - NMSupplicantManager * self = (NMSupplicantManager *) user_data; - NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); - gboolean old_owner_good = (old_owner && strlen (old_owner)); - gboolean new_owner_good = (new_owner && strlen (new_owner)); - - /* Can't handle the signal if its not from the supplicant service */ - if (strcmp (WPAS_DBUS_SERVICE, name) != 0) - return; - - if (!old_owner_good && new_owner_good) { - gboolean running; - - running = startup (self); - - if (running && priv->poke_id) { - g_source_remove (priv->poke_id); - priv->poke_id = 0; - } - } else if (old_owner_good && !new_owner_good) { - set_state (self, NM_SUPPLICANT_MANAGER_STATE_DOWN); - - if (priv->poke_id) - g_source_remove (priv->poke_id); - - /* Poke the supplicant so that it gets activated by dbus system bus - * activation. - */ - priv->poke_id = g_idle_add (poke_supplicant_cb, (gpointer) self); - } -} - -/*******************************************************************/ - -NMSupplicantManager * -nm_supplicant_manager_get (void) -{ - static NMSupplicantManager *singleton = NULL; - - if (!singleton) - singleton = NM_SUPPLICANT_MANAGER (g_object_new (NM_TYPE_SUPPLICANT_MANAGER, NULL)); - else - g_object_ref (singleton); - - g_assert (singleton); - return singleton; -} - -static void -nm_supplicant_manager_init (NMSupplicantManager * self) -{ - NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); - gboolean running; - - priv->state = NM_SUPPLICANT_MANAGER_STATE_DOWN; - priv->dbus_mgr = nm_dbus_manager_get (); - priv->poke_id = 0; - - priv->ifaces = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); - - running = startup (self); - - g_signal_connect (priv->dbus_mgr, - "name-owner-changed", - G_CALLBACK (name_owner_changed), - self); - - if (!running) { - /* Try to activate the supplicant */ - priv->poke_id = g_idle_add (poke_supplicant_cb, (gpointer) self); - } -} - -static void -dispose (GObject *object) -{ - NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (object); - - if (priv->disposed) { - G_OBJECT_CLASS (nm_supplicant_manager_parent_class)->dispose (object); - return; - } - priv->disposed = TRUE; - - if (priv->poke_id) { - g_source_remove (priv->poke_id); - priv->poke_id = 0; - } - - if (priv->dbus_mgr) { - g_object_unref (G_OBJECT (priv->dbus_mgr)); - priv->dbus_mgr = NULL; - } - - /* Chain up to the parent class */ - G_OBJECT_CLASS (nm_supplicant_manager_parent_class)->dispose (object); -} - -static void -nm_supplicant_manager_class_init (NMSupplicantManagerClass *klass) -{ - GObjectClass * object_class = G_OBJECT_CLASS (klass); - - g_type_class_add_private (object_class, sizeof (NMSupplicantManagerPrivate)); - - object_class->dispose = dispose; - - /* Signals */ - signals[STATE] = g_signal_new ("state", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantManagerClass, state), - NULL, NULL, - _nm_marshal_VOID__UINT_UINT, - G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); -} -- cgit v1.2.1 From 8738aad6f248405aaf7d567a5c07c2176b243810 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 5 Oct 2010 14:17:48 -0500 Subject: Revert "supplicant: use a GHashTable instead of a GSList for tracking interfaces" This reverts commit 0e61ddcd27b3fc89d7660c1d22f0ca4a638b00eb. --- src/supplicant-manager/nm-supplicant-interface.c | 8 ----- src/supplicant-manager/nm-supplicant-interface.h | 4 +-- src/supplicant-manager/nm-supplicant-manager.c | 46 ++++++++++++++++-------- 3 files changed, 33 insertions(+), 25 deletions(-) diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index 3c3fe52f84..c04dc5e1cf 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -1119,14 +1119,6 @@ nm_supplicant_interface_connection_state_to_string (guint32 state) return "unknown"; } -const char * -nm_supplicant_interface_get_ifname (NMSupplicantInterface *self) -{ - g_return_val_if_fail (self != NULL, FALSE); - - return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->dev; -} - /*******************************************************************/ NMSupplicantInterface * diff --git a/src/supplicant-manager/nm-supplicant-interface.h b/src/supplicant-manager/nm-supplicant-interface.h index 3e56f4efaf..bee5436f5a 100644 --- a/src/supplicant-manager/nm-supplicant-interface.h +++ b/src/supplicant-manager/nm-supplicant-interface.h @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2006 - 2010 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Red Hat, Inc. * Copyright (C) 2007 - 2008 Novell, Inc. */ @@ -140,8 +140,6 @@ const char *nm_supplicant_interface_connection_state_to_string (guint32 state); gboolean nm_supplicant_interface_get_scanning (NMSupplicantInterface *self); -const char *nm_supplicant_interface_get_ifname (NMSupplicantInterface *self); - G_END_DECLS #endif /* NM_SUPPLICANT_INTERFACE_H */ diff --git a/src/supplicant-manager/nm-supplicant-manager.c b/src/supplicant-manager/nm-supplicant-manager.c index 1077da8d7f..a2cf58eb8f 100644 --- a/src/supplicant-manager/nm-supplicant-manager.c +++ b/src/supplicant-manager/nm-supplicant-manager.c @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2006 - 2010 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Red Hat, Inc. * Copyright (C) 2007 - 2008 Novell, Inc. */ @@ -35,7 +35,7 @@ typedef struct { NMDBusManager * dbus_mgr; guint32 state; - GHashTable * ifaces; + GSList * ifaces; gboolean dispose_has_run; guint poke_id; } NMSupplicantManagerPrivate; @@ -125,8 +125,6 @@ nm_supplicant_manager_init (NMSupplicantManager * self) priv->dbus_mgr = nm_dbus_manager_get (); priv->poke_id = 0; - priv->ifaces = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); - running = nm_supplicant_manager_startup (self); g_signal_connect (priv->dbus_mgr, @@ -267,23 +265,33 @@ nm_supplicant_manager_startup (NMSupplicantManager * self) NMSupplicantInterface * nm_supplicant_manager_get_iface (NMSupplicantManager * self, - const char *ifname, - gboolean is_wireless) + const char *ifname, + gboolean is_wireless) { NMSupplicantManagerPrivate *priv; NMSupplicantInterface * iface = NULL; + GSList * elt; g_return_val_if_fail (NM_IS_SUPPLICANT_MANAGER (self), NULL); g_return_val_if_fail (ifname != NULL, NULL); priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); - iface = g_hash_table_lookup (priv->ifaces, ifname); + /* Ensure we don't already have this interface */ + for (elt = priv->ifaces; elt; elt = g_slist_next (elt)) { + NMSupplicantInterface * if_tmp = (NMSupplicantInterface *) elt->data; + + if (!strcmp (ifname, nm_supplicant_interface_get_device (if_tmp))) { + iface = if_tmp; + break; + } + } + if (!iface) { nm_log_dbg (LOGD_SUPPLICANT, "(%s): creating new supplicant interface", ifname); iface = nm_supplicant_interface_new (self, ifname, is_wireless); if (iface) - g_hash_table_insert (priv->ifaces, g_strdup (ifname), iface); + priv->ifaces = g_slist_append (priv->ifaces, iface); } else { nm_log_dbg (LOGD_SUPPLICANT, "(%s): returning existing supplicant interface", ifname); } @@ -292,20 +300,30 @@ nm_supplicant_manager_get_iface (NMSupplicantManager * self, } void -nm_supplicant_manager_release_iface (NMSupplicantManager *self, - NMSupplicantInterface *iface) +nm_supplicant_manager_release_iface (NMSupplicantManager * self, + NMSupplicantInterface * iface) { NMSupplicantManagerPrivate *priv; - const char *ifname; + GSList * elt; g_return_if_fail (NM_IS_SUPPLICANT_MANAGER (self)); g_return_if_fail (NM_IS_SUPPLICANT_INTERFACE (iface)); priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); - ifname = nm_supplicant_interface_get_ifname (iface); - g_assert (ifname); - g_hash_table_remove (priv->ifaces, ifname); + for (elt = priv->ifaces; elt; elt = g_slist_next (elt)) { + NMSupplicantInterface * if_tmp = (NMSupplicantInterface *) elt->data; + + if (if_tmp == iface) { + /* Remove the iface from the supplicant manager's list and + * dereference to match additional reference in get_iface. + */ + priv->ifaces = g_slist_remove_link (priv->ifaces, elt); + g_slist_free_1 (elt); + g_object_unref (iface); + break; + } + } } const char * -- cgit v1.2.1 From 410c3543841ab9563c40ab03cc2ffba647cdcea9 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 5 Oct 2010 14:17:53 -0500 Subject: Revert "supplicant: simplify supplicant interface object" This reverts commit 43b55f719fe3c9e06cf7f86065b71cb6fccac279. --- src/supplicant-manager/nm-supplicant-interface.c | 568 +++++++++++++---------- 1 file changed, 323 insertions(+), 245 deletions(-) diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index c04dc5e1cf..a65a458f5b 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2006 - 2010 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Red Hat, Inc. * Copyright (C) 2006 - 2008 Novell, Inc. */ @@ -47,11 +47,26 @@ G_DEFINE_TYPE (NMSupplicantInterface, nm_supplicant_interface, G_TYPE_OBJECT) NM_TYPE_SUPPLICANT_INTERFACE, \ NMSupplicantInterfacePrivate)) +static void nm_supplicant_interface_set_property (GObject * object, + guint prop_id, + const GValue * value, + GParamSpec * pspec); + +static void nm_supplicant_interface_get_property (GObject * object, + guint prop_id, + GValue * value, + GParamSpec * pspec); + static void nm_supplicant_interface_start (NMSupplicantInterface *self); static void nm_supplicant_interface_add_to_supplicant (NMSupplicantInterface *self, gboolean get_only); +static void nm_supplicant_interface_smgr_state_changed (NMSupplicantManager *smgr, + guint32 new_state, + guint32 old_state, + gpointer user_data); + static void nm_supplicant_interface_set_state (NMSupplicantInterface *self, guint32 new_state); @@ -67,12 +82,14 @@ enum { CONNECTION_ERROR, /* an error occurred during a connection request */ LAST_SIGNAL }; -static guint signals[LAST_SIGNAL] = { 0 }; +static guint nm_supplicant_interface_signals[LAST_SIGNAL] = { 0 }; /* Properties */ enum { PROP_0 = 0, + PROP_SUPPLICANT_MANAGER, + PROP_DEVICE, PROP_STATE, PROP_CONNECTION_STATE, PROP_SCANNING, @@ -104,7 +121,7 @@ typedef struct NMSupplicantConfig * cfg; - gboolean disposed; + gboolean dispose_has_run; } NMSupplicantInterfacePrivate; static gboolean @@ -186,6 +203,103 @@ nm_supplicant_info_destroy (gpointer user_data) } } + +NMSupplicantInterface * +nm_supplicant_interface_new (NMSupplicantManager * smgr, const char *ifname, gboolean is_wireless) +{ + NMSupplicantInterface * iface; + + g_return_val_if_fail (NM_IS_SUPPLICANT_MANAGER (smgr), NULL); + g_return_val_if_fail (ifname != NULL, NULL); + + iface = g_object_new (NM_TYPE_SUPPLICANT_INTERFACE, + "supplicant-manager", smgr, + "device", ifname, + NULL); + if (iface) { + NM_SUPPLICANT_INTERFACE_GET_PRIVATE (iface)->is_wireless = is_wireless; + nm_supplicant_interface_start (iface); + } + + return iface; +} + +static void +nm_supplicant_interface_init (NMSupplicantInterface * self) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + + priv->state = NM_SUPPLICANT_INTERFACE_STATE_INIT; + priv->con_state = NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED; + priv->assoc_pcalls = nm_call_store_new (); + priv->other_pcalls = nm_call_store_new (); + + priv->dispose_has_run = FALSE; + + priv->dbus_mgr = nm_dbus_manager_get (); +} + + +static void +nm_supplicant_interface_set_property (GObject * object, + guint prop_id, + const GValue * value, + GParamSpec * pspec) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object); + gulong id; + + switch (prop_id) { + case PROP_SUPPLICANT_MANAGER: + priv->smgr = NM_SUPPLICANT_MANAGER (g_value_get_object (value)); + g_object_ref (G_OBJECT (priv->smgr)); + + id = g_signal_connect (priv->smgr, + "state", + G_CALLBACK (nm_supplicant_interface_smgr_state_changed), + object); + priv->smgr_state_sig_handler = id; + break; + case PROP_DEVICE: + /* Construct-only */ + priv->dev = g_strdup (g_value_get_string (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_supplicant_interface_get_property (GObject * object, + guint prop_id, + GValue * value, + GParamSpec * pspec) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_SUPPLICANT_MANAGER: + g_value_set_object (value, G_OBJECT (priv->smgr)); + break; + case PROP_DEVICE: + g_value_set_string (value, priv->dev); + break; + case PROP_STATE: + g_value_set_uint (value, priv->state); + break; + case PROP_CONNECTION_STATE: + g_value_set_uint (value, priv->con_state); + break; + case PROP_SCANNING: + g_value_set_boolean (value, priv->scanning); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + static void try_remove_iface (DBusGConnection *g_connection, const char *path) @@ -208,6 +322,175 @@ try_remove_iface (DBusGConnection *g_connection, g_object_unref (proxy); } +static void +nm_supplicant_interface_dispose (GObject *object) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object); + guint32 sm_state; + + if (priv->dispose_has_run) { + G_OBJECT_CLASS (nm_supplicant_interface_parent_class)->dispose (object); + return; + } + + priv->dispose_has_run = TRUE; + + /* Ask wpa_supplicant to remove this interface */ + sm_state = nm_supplicant_manager_get_state (priv->smgr); + if (sm_state == NM_SUPPLICANT_MANAGER_STATE_IDLE) { + if (priv->object_path) { + try_remove_iface (nm_dbus_manager_get_connection (priv->dbus_mgr), + priv->object_path); + } + } + + if (priv->iface_proxy) + g_object_unref (priv->iface_proxy); + + if (priv->net_proxy) + g_object_unref (priv->net_proxy); + + if (priv->scan_results_timeout) + g_source_remove (priv->scan_results_timeout); + + if (priv->smgr) { + g_signal_handler_disconnect (priv->smgr, + priv->smgr_state_sig_handler); + g_object_unref (priv->smgr); + } + + g_free (priv->dev); + + /* Cancel pending calls before unrefing the dbus manager */ + cancel_all_callbacks (priv->other_pcalls); + nm_call_store_destroy (priv->other_pcalls); + + cancel_all_callbacks (priv->assoc_pcalls); + nm_call_store_destroy (priv->assoc_pcalls); + + if (priv->dbus_mgr) + g_object_unref (priv->dbus_mgr); + + if (priv->cfg) + g_object_unref (priv->cfg); + + g_free (priv->object_path); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (nm_supplicant_interface_parent_class)->dispose (object); +} + +static void +nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (NMSupplicantInterfacePrivate)); + + object_class->dispose = nm_supplicant_interface_dispose; + object_class->set_property = nm_supplicant_interface_set_property; + object_class->get_property = nm_supplicant_interface_get_property; + + /* Properties */ + g_object_class_install_property (object_class, + PROP_SUPPLICANT_MANAGER, + g_param_spec_object ("supplicant-manager", + "Supplicant Manager", + "Supplicant manager to which this interface belongs", + NM_TYPE_SUPPLICANT_MANAGER, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property (object_class, + PROP_DEVICE, + g_param_spec_string ("device", + "Device", + "Device which this interface represents to the supplicant", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property (object_class, + PROP_STATE, + g_param_spec_uint ("state", + "State", + "State of the supplicant interface; INIT, READY, or DOWN", + NM_SUPPLICANT_INTERFACE_STATE_INIT, + NM_SUPPLICANT_INTERFACE_STATE_LAST - 1, + NM_SUPPLICANT_INTERFACE_STATE_INIT, + G_PARAM_READABLE)); + + g_object_class_install_property (object_class, + PROP_SCANNING, + g_param_spec_boolean ("scanning", + "Scanning", + "Scanning", + FALSE, + G_PARAM_READABLE)); + + /* Signals */ + nm_supplicant_interface_signals[STATE] = + g_signal_new ("state", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, state), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); + + nm_supplicant_interface_signals[REMOVED] = + g_signal_new ("removed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, removed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + nm_supplicant_interface_signals[SCANNED_AP] = + g_signal_new ("scanned-ap", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scanned_ap), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); + + nm_supplicant_interface_signals[SCAN_REQ_RESULT] = + g_signal_new ("scan-req-result", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scan_req_result), + NULL, NULL, + g_cclosure_marshal_VOID__BOOLEAN, + G_TYPE_NONE, 1, G_TYPE_BOOLEAN); + + nm_supplicant_interface_signals[SCAN_RESULTS] = + g_signal_new ("scan-results", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scan_results), + NULL, NULL, + g_cclosure_marshal_VOID__UINT, + G_TYPE_NONE, 1, G_TYPE_UINT); + + nm_supplicant_interface_signals[CONNECTION_STATE] = + g_signal_new ("connection-state", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, connection_state), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); + + nm_supplicant_interface_signals[CONNECTION_ERROR] = + g_signal_new ("connection-error", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, connection_error), + NULL, NULL, + _nm_marshal_VOID__STRING_STRING, + G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); +} + static void emit_error_helper (NMSupplicantInterface *self, GError *err) @@ -217,7 +500,11 @@ emit_error_helper (NMSupplicantInterface *self, if (err->domain == DBUS_GERROR && err->code == DBUS_GERROR_REMOTE_EXCEPTION) name = dbus_g_error_get_name (err); - g_signal_emit (self, signals[CONNECTION_ERROR], 0, name, err->message); + g_signal_emit (self, + nm_supplicant_interface_signals[CONNECTION_ERROR], + 0, + name, + err->message); } static void @@ -236,7 +523,11 @@ bssid_properties_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_ } g_error_free (err); } else { - g_signal_emit (info->interface, signals[SCANNED_AP], 0, hash); + g_signal_emit (info->interface, + nm_supplicant_interface_signals[SCANNED_AP], + 0, + hash); + g_hash_table_destroy (hash); } } @@ -280,7 +571,10 @@ scan_results_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; /* Notify listeners of the result of the scan */ - g_signal_emit (info->interface, signals[SCAN_RESULTS], 0, array->len); + g_signal_emit (info->interface, + nm_supplicant_interface_signals[SCAN_RESULTS], + 0, + array->len); /* Fire off a "properties" call for each returned BSSID */ for (i = 0; i < array->len; i++) { @@ -380,8 +674,13 @@ wpas_iface_handle_state_change (DBusGProxy *proxy, enum_new_state = wpas_state_string_to_enum (str_new_state); old_state = priv->con_state; priv->con_state = enum_new_state; - if (priv->con_state != old_state) - g_signal_emit (user_data, signals[CONNECTION_STATE], 0, priv->con_state, old_state); + if (priv->con_state != old_state) { + g_signal_emit (user_data, + nm_supplicant_interface_signals[CONNECTION_STATE], + 0, + priv->con_state, + old_state); + } } @@ -668,14 +967,18 @@ nm_supplicant_interface_set_state (NMSupplicantInterface * self, } priv->state = new_state; - g_signal_emit (self, signals[STATE], 0, priv->state, old_state); + g_signal_emit (self, + nm_supplicant_interface_signals[STATE], + 0, + priv->state, + old_state); } static void -smgr_state_changed (NMSupplicantManager *smgr, - guint32 new_state, - guint32 old_state, - gpointer user_data) +nm_supplicant_interface_smgr_state_changed (NMSupplicantManager * smgr, + guint32 new_state, + guint32 old_state, + gpointer user_data) { NMSupplicantInterface * self = NM_SUPPLICANT_INTERFACE (user_data); @@ -891,7 +1194,9 @@ call_set_blobs (NMSupplicantInfo *info, GHashTable *orig_blobs) const char *msg = "Not enough memory to create blob table."; nm_log_warn (LOGD_SUPPLICANT, "%s", msg); - g_signal_emit (info->interface, signals[CONNECTION_ERROR], 0, "SendBlobError", msg); + g_signal_emit (info->interface, + nm_supplicant_interface_signals[CONNECTION_ERROR], + 0, "SendBlobError", msg); return; } @@ -1034,7 +1339,10 @@ scan_request_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) } /* Notify listeners of the result of the scan */ - g_signal_emit (info->interface, signals[SCAN_REQ_RESULT], 0, !!success); + g_signal_emit (info->interface, + nm_supplicant_interface_signals[SCAN_REQ_RESULT], + 0, + success ? TRUE : FALSE); } gboolean @@ -1119,233 +1427,3 @@ nm_supplicant_interface_connection_state_to_string (guint32 state) return "unknown"; } -/*******************************************************************/ - -NMSupplicantInterface * -nm_supplicant_interface_new (NMSupplicantManager *smgr, - const char *ifname, - gboolean is_wireless) -{ - NMSupplicantInterface *self; - NMSupplicantInterfacePrivate *priv; - guint id; - - g_return_val_if_fail (NM_IS_SUPPLICANT_MANAGER (smgr), NULL); - g_return_val_if_fail (ifname != NULL, NULL); - - self = g_object_new (NM_TYPE_SUPPLICANT_INTERFACE, NULL); - if (self) { - priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); - - priv->smgr = g_object_ref (smgr); - id = g_signal_connect (priv->smgr, - "state", - G_CALLBACK (smgr_state_changed), - self); - priv->smgr_state_sig_handler = id; - - priv->dev = g_strdup (ifname); - priv->is_wireless = is_wireless; - nm_supplicant_interface_start (self); - } - - return self; -} - -static void -nm_supplicant_interface_init (NMSupplicantInterface * self) -{ - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); - - priv->state = NM_SUPPLICANT_INTERFACE_STATE_INIT; - priv->con_state = NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED; - priv->assoc_pcalls = nm_call_store_new (); - priv->other_pcalls = nm_call_store_new (); - priv->dbus_mgr = nm_dbus_manager_get (); -} - -static void -set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - switch (prop_id) { - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - switch (prop_id) { - case PROP_STATE: - g_value_set_uint (value, NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object)->state); - break; - case PROP_CONNECTION_STATE: - g_value_set_uint (value, NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object)->con_state); - break; - case PROP_SCANNING: - g_value_set_boolean (value, NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object)->scanning); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -dispose (GObject *object) -{ - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object); - guint32 sm_state; - - if (priv->disposed) { - G_OBJECT_CLASS (nm_supplicant_interface_parent_class)->dispose (object); - return; - } - priv->disposed = TRUE; - - /* Ask wpa_supplicant to remove this interface */ - sm_state = nm_supplicant_manager_get_state (priv->smgr); - if (sm_state == NM_SUPPLICANT_MANAGER_STATE_IDLE) { - if (priv->object_path) { - try_remove_iface (nm_dbus_manager_get_connection (priv->dbus_mgr), - priv->object_path); - } - } - - if (priv->iface_proxy) - g_object_unref (priv->iface_proxy); - - if (priv->net_proxy) - g_object_unref (priv->net_proxy); - - if (priv->scan_results_timeout) - g_source_remove (priv->scan_results_timeout); - - if (priv->smgr) { - g_signal_handler_disconnect (priv->smgr, - priv->smgr_state_sig_handler); - g_object_unref (priv->smgr); - } - - g_free (priv->dev); - - /* Cancel pending calls before unrefing the dbus manager */ - cancel_all_callbacks (priv->other_pcalls); - nm_call_store_destroy (priv->other_pcalls); - - cancel_all_callbacks (priv->assoc_pcalls); - nm_call_store_destroy (priv->assoc_pcalls); - - if (priv->dbus_mgr) - g_object_unref (priv->dbus_mgr); - - if (priv->cfg) - g_object_unref (priv->cfg); - - g_free (priv->object_path); - - /* Chain up to the parent class */ - G_OBJECT_CLASS (nm_supplicant_interface_parent_class)->dispose (object); -} - -static void -nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - g_type_class_add_private (object_class, sizeof (NMSupplicantInterfacePrivate)); - - object_class->dispose = dispose; - object_class->set_property = set_property; - object_class->get_property = get_property; - - /* Properties */ - g_object_class_install_property (object_class, PROP_STATE, - g_param_spec_uint ("state", - "State", - "State of the supplicant interface; INIT, READY, or DOWN", - NM_SUPPLICANT_INTERFACE_STATE_INIT, - NM_SUPPLICANT_INTERFACE_STATE_LAST - 1, - NM_SUPPLICANT_INTERFACE_STATE_INIT, - G_PARAM_READABLE)); - - g_object_class_install_property (object_class, PROP_SCANNING, - g_param_spec_boolean ("scanning", - "Scanning", - "Scanning", - FALSE, - G_PARAM_READABLE)); - - /* Signals */ - signals[STATE] = - g_signal_new ("state", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, state), - NULL, NULL, - _nm_marshal_VOID__UINT_UINT, - G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); - - signals[REMOVED] = - g_signal_new ("removed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, removed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[SCANNED_AP] = - g_signal_new ("scanned-ap", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scanned_ap), - NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, G_TYPE_POINTER); - - signals[SCAN_REQ_RESULT] = - g_signal_new ("scan-req-result", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scan_req_result), - NULL, NULL, - g_cclosure_marshal_VOID__BOOLEAN, - G_TYPE_NONE, 1, G_TYPE_BOOLEAN); - - signals[SCAN_RESULTS] = - g_signal_new ("scan-results", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scan_results), - NULL, NULL, - g_cclosure_marshal_VOID__UINT, - G_TYPE_NONE, 1, G_TYPE_UINT); - - signals[CONNECTION_STATE] = - g_signal_new ("connection-state", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, connection_state), - NULL, NULL, - _nm_marshal_VOID__UINT_UINT, - G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); - - signals[CONNECTION_ERROR] = - g_signal_new ("connection-error", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, connection_error), - NULL, NULL, - _nm_marshal_VOID__STRING_STRING, - G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); -} - -- cgit v1.2.1 From 71c4e2338bfa6f27d51fbb5e54276c5b8afe2455 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 5 Oct 2010 14:19:43 -0500 Subject: supplicant: simplify supplicant interface object Move GObject stuff to the bottom to reduce prototype abuse and remove unneeded prefixes from stuff that's private to the class itself. We also don't need the 'supplicant-manager' or 'device' properties since they weren't used anywhere. --- src/supplicant-manager/nm-supplicant-interface.c | 568 ++++++++++------------- 1 file changed, 245 insertions(+), 323 deletions(-) diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index a65a458f5b..c04dc5e1cf 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2006 - 2008 Red Hat, Inc. + * Copyright (C) 2006 - 2010 Red Hat, Inc. * Copyright (C) 2006 - 2008 Novell, Inc. */ @@ -47,26 +47,11 @@ G_DEFINE_TYPE (NMSupplicantInterface, nm_supplicant_interface, G_TYPE_OBJECT) NM_TYPE_SUPPLICANT_INTERFACE, \ NMSupplicantInterfacePrivate)) -static void nm_supplicant_interface_set_property (GObject * object, - guint prop_id, - const GValue * value, - GParamSpec * pspec); - -static void nm_supplicant_interface_get_property (GObject * object, - guint prop_id, - GValue * value, - GParamSpec * pspec); - static void nm_supplicant_interface_start (NMSupplicantInterface *self); static void nm_supplicant_interface_add_to_supplicant (NMSupplicantInterface *self, gboolean get_only); -static void nm_supplicant_interface_smgr_state_changed (NMSupplicantManager *smgr, - guint32 new_state, - guint32 old_state, - gpointer user_data); - static void nm_supplicant_interface_set_state (NMSupplicantInterface *self, guint32 new_state); @@ -82,14 +67,12 @@ enum { CONNECTION_ERROR, /* an error occurred during a connection request */ LAST_SIGNAL }; -static guint nm_supplicant_interface_signals[LAST_SIGNAL] = { 0 }; +static guint signals[LAST_SIGNAL] = { 0 }; /* Properties */ enum { PROP_0 = 0, - PROP_SUPPLICANT_MANAGER, - PROP_DEVICE, PROP_STATE, PROP_CONNECTION_STATE, PROP_SCANNING, @@ -121,7 +104,7 @@ typedef struct NMSupplicantConfig * cfg; - gboolean dispose_has_run; + gboolean disposed; } NMSupplicantInterfacePrivate; static gboolean @@ -203,103 +186,6 @@ nm_supplicant_info_destroy (gpointer user_data) } } - -NMSupplicantInterface * -nm_supplicant_interface_new (NMSupplicantManager * smgr, const char *ifname, gboolean is_wireless) -{ - NMSupplicantInterface * iface; - - g_return_val_if_fail (NM_IS_SUPPLICANT_MANAGER (smgr), NULL); - g_return_val_if_fail (ifname != NULL, NULL); - - iface = g_object_new (NM_TYPE_SUPPLICANT_INTERFACE, - "supplicant-manager", smgr, - "device", ifname, - NULL); - if (iface) { - NM_SUPPLICANT_INTERFACE_GET_PRIVATE (iface)->is_wireless = is_wireless; - nm_supplicant_interface_start (iface); - } - - return iface; -} - -static void -nm_supplicant_interface_init (NMSupplicantInterface * self) -{ - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); - - priv->state = NM_SUPPLICANT_INTERFACE_STATE_INIT; - priv->con_state = NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED; - priv->assoc_pcalls = nm_call_store_new (); - priv->other_pcalls = nm_call_store_new (); - - priv->dispose_has_run = FALSE; - - priv->dbus_mgr = nm_dbus_manager_get (); -} - - -static void -nm_supplicant_interface_set_property (GObject * object, - guint prop_id, - const GValue * value, - GParamSpec * pspec) -{ - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object); - gulong id; - - switch (prop_id) { - case PROP_SUPPLICANT_MANAGER: - priv->smgr = NM_SUPPLICANT_MANAGER (g_value_get_object (value)); - g_object_ref (G_OBJECT (priv->smgr)); - - id = g_signal_connect (priv->smgr, - "state", - G_CALLBACK (nm_supplicant_interface_smgr_state_changed), - object); - priv->smgr_state_sig_handler = id; - break; - case PROP_DEVICE: - /* Construct-only */ - priv->dev = g_strdup (g_value_get_string (value)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -nm_supplicant_interface_get_property (GObject * object, - guint prop_id, - GValue * value, - GParamSpec * pspec) -{ - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object); - - switch (prop_id) { - case PROP_SUPPLICANT_MANAGER: - g_value_set_object (value, G_OBJECT (priv->smgr)); - break; - case PROP_DEVICE: - g_value_set_string (value, priv->dev); - break; - case PROP_STATE: - g_value_set_uint (value, priv->state); - break; - case PROP_CONNECTION_STATE: - g_value_set_uint (value, priv->con_state); - break; - case PROP_SCANNING: - g_value_set_boolean (value, priv->scanning); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - static void try_remove_iface (DBusGConnection *g_connection, const char *path) @@ -322,175 +208,6 @@ try_remove_iface (DBusGConnection *g_connection, g_object_unref (proxy); } -static void -nm_supplicant_interface_dispose (GObject *object) -{ - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object); - guint32 sm_state; - - if (priv->dispose_has_run) { - G_OBJECT_CLASS (nm_supplicant_interface_parent_class)->dispose (object); - return; - } - - priv->dispose_has_run = TRUE; - - /* Ask wpa_supplicant to remove this interface */ - sm_state = nm_supplicant_manager_get_state (priv->smgr); - if (sm_state == NM_SUPPLICANT_MANAGER_STATE_IDLE) { - if (priv->object_path) { - try_remove_iface (nm_dbus_manager_get_connection (priv->dbus_mgr), - priv->object_path); - } - } - - if (priv->iface_proxy) - g_object_unref (priv->iface_proxy); - - if (priv->net_proxy) - g_object_unref (priv->net_proxy); - - if (priv->scan_results_timeout) - g_source_remove (priv->scan_results_timeout); - - if (priv->smgr) { - g_signal_handler_disconnect (priv->smgr, - priv->smgr_state_sig_handler); - g_object_unref (priv->smgr); - } - - g_free (priv->dev); - - /* Cancel pending calls before unrefing the dbus manager */ - cancel_all_callbacks (priv->other_pcalls); - nm_call_store_destroy (priv->other_pcalls); - - cancel_all_callbacks (priv->assoc_pcalls); - nm_call_store_destroy (priv->assoc_pcalls); - - if (priv->dbus_mgr) - g_object_unref (priv->dbus_mgr); - - if (priv->cfg) - g_object_unref (priv->cfg); - - g_free (priv->object_path); - - /* Chain up to the parent class */ - G_OBJECT_CLASS (nm_supplicant_interface_parent_class)->dispose (object); -} - -static void -nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - g_type_class_add_private (object_class, sizeof (NMSupplicantInterfacePrivate)); - - object_class->dispose = nm_supplicant_interface_dispose; - object_class->set_property = nm_supplicant_interface_set_property; - object_class->get_property = nm_supplicant_interface_get_property; - - /* Properties */ - g_object_class_install_property (object_class, - PROP_SUPPLICANT_MANAGER, - g_param_spec_object ("supplicant-manager", - "Supplicant Manager", - "Supplicant manager to which this interface belongs", - NM_TYPE_SUPPLICANT_MANAGER, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); - - g_object_class_install_property (object_class, - PROP_DEVICE, - g_param_spec_string ("device", - "Device", - "Device which this interface represents to the supplicant", - NULL, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); - - g_object_class_install_property (object_class, - PROP_STATE, - g_param_spec_uint ("state", - "State", - "State of the supplicant interface; INIT, READY, or DOWN", - NM_SUPPLICANT_INTERFACE_STATE_INIT, - NM_SUPPLICANT_INTERFACE_STATE_LAST - 1, - NM_SUPPLICANT_INTERFACE_STATE_INIT, - G_PARAM_READABLE)); - - g_object_class_install_property (object_class, - PROP_SCANNING, - g_param_spec_boolean ("scanning", - "Scanning", - "Scanning", - FALSE, - G_PARAM_READABLE)); - - /* Signals */ - nm_supplicant_interface_signals[STATE] = - g_signal_new ("state", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, state), - NULL, NULL, - _nm_marshal_VOID__UINT_UINT, - G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); - - nm_supplicant_interface_signals[REMOVED] = - g_signal_new ("removed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, removed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - nm_supplicant_interface_signals[SCANNED_AP] = - g_signal_new ("scanned-ap", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scanned_ap), - NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, G_TYPE_POINTER); - - nm_supplicant_interface_signals[SCAN_REQ_RESULT] = - g_signal_new ("scan-req-result", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scan_req_result), - NULL, NULL, - g_cclosure_marshal_VOID__BOOLEAN, - G_TYPE_NONE, 1, G_TYPE_BOOLEAN); - - nm_supplicant_interface_signals[SCAN_RESULTS] = - g_signal_new ("scan-results", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scan_results), - NULL, NULL, - g_cclosure_marshal_VOID__UINT, - G_TYPE_NONE, 1, G_TYPE_UINT); - - nm_supplicant_interface_signals[CONNECTION_STATE] = - g_signal_new ("connection-state", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, connection_state), - NULL, NULL, - _nm_marshal_VOID__UINT_UINT, - G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); - - nm_supplicant_interface_signals[CONNECTION_ERROR] = - g_signal_new ("connection-error", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, connection_error), - NULL, NULL, - _nm_marshal_VOID__STRING_STRING, - G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); -} - static void emit_error_helper (NMSupplicantInterface *self, GError *err) @@ -500,11 +217,7 @@ emit_error_helper (NMSupplicantInterface *self, if (err->domain == DBUS_GERROR && err->code == DBUS_GERROR_REMOTE_EXCEPTION) name = dbus_g_error_get_name (err); - g_signal_emit (self, - nm_supplicant_interface_signals[CONNECTION_ERROR], - 0, - name, - err->message); + g_signal_emit (self, signals[CONNECTION_ERROR], 0, name, err->message); } static void @@ -523,11 +236,7 @@ bssid_properties_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_ } g_error_free (err); } else { - g_signal_emit (info->interface, - nm_supplicant_interface_signals[SCANNED_AP], - 0, - hash); - + g_signal_emit (info->interface, signals[SCANNED_AP], 0, hash); g_hash_table_destroy (hash); } } @@ -571,10 +280,7 @@ scan_results_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; /* Notify listeners of the result of the scan */ - g_signal_emit (info->interface, - nm_supplicant_interface_signals[SCAN_RESULTS], - 0, - array->len); + g_signal_emit (info->interface, signals[SCAN_RESULTS], 0, array->len); /* Fire off a "properties" call for each returned BSSID */ for (i = 0; i < array->len; i++) { @@ -674,13 +380,8 @@ wpas_iface_handle_state_change (DBusGProxy *proxy, enum_new_state = wpas_state_string_to_enum (str_new_state); old_state = priv->con_state; priv->con_state = enum_new_state; - if (priv->con_state != old_state) { - g_signal_emit (user_data, - nm_supplicant_interface_signals[CONNECTION_STATE], - 0, - priv->con_state, - old_state); - } + if (priv->con_state != old_state) + g_signal_emit (user_data, signals[CONNECTION_STATE], 0, priv->con_state, old_state); } @@ -967,18 +668,14 @@ nm_supplicant_interface_set_state (NMSupplicantInterface * self, } priv->state = new_state; - g_signal_emit (self, - nm_supplicant_interface_signals[STATE], - 0, - priv->state, - old_state); + g_signal_emit (self, signals[STATE], 0, priv->state, old_state); } static void -nm_supplicant_interface_smgr_state_changed (NMSupplicantManager * smgr, - guint32 new_state, - guint32 old_state, - gpointer user_data) +smgr_state_changed (NMSupplicantManager *smgr, + guint32 new_state, + guint32 old_state, + gpointer user_data) { NMSupplicantInterface * self = NM_SUPPLICANT_INTERFACE (user_data); @@ -1194,9 +891,7 @@ call_set_blobs (NMSupplicantInfo *info, GHashTable *orig_blobs) const char *msg = "Not enough memory to create blob table."; nm_log_warn (LOGD_SUPPLICANT, "%s", msg); - g_signal_emit (info->interface, - nm_supplicant_interface_signals[CONNECTION_ERROR], - 0, "SendBlobError", msg); + g_signal_emit (info->interface, signals[CONNECTION_ERROR], 0, "SendBlobError", msg); return; } @@ -1339,10 +1034,7 @@ scan_request_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) } /* Notify listeners of the result of the scan */ - g_signal_emit (info->interface, - nm_supplicant_interface_signals[SCAN_REQ_RESULT], - 0, - success ? TRUE : FALSE); + g_signal_emit (info->interface, signals[SCAN_REQ_RESULT], 0, !!success); } gboolean @@ -1427,3 +1119,233 @@ nm_supplicant_interface_connection_state_to_string (guint32 state) return "unknown"; } +/*******************************************************************/ + +NMSupplicantInterface * +nm_supplicant_interface_new (NMSupplicantManager *smgr, + const char *ifname, + gboolean is_wireless) +{ + NMSupplicantInterface *self; + NMSupplicantInterfacePrivate *priv; + guint id; + + g_return_val_if_fail (NM_IS_SUPPLICANT_MANAGER (smgr), NULL); + g_return_val_if_fail (ifname != NULL, NULL); + + self = g_object_new (NM_TYPE_SUPPLICANT_INTERFACE, NULL); + if (self) { + priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + + priv->smgr = g_object_ref (smgr); + id = g_signal_connect (priv->smgr, + "state", + G_CALLBACK (smgr_state_changed), + self); + priv->smgr_state_sig_handler = id; + + priv->dev = g_strdup (ifname); + priv->is_wireless = is_wireless; + nm_supplicant_interface_start (self); + } + + return self; +} + +static void +nm_supplicant_interface_init (NMSupplicantInterface * self) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + + priv->state = NM_SUPPLICANT_INTERFACE_STATE_INIT; + priv->con_state = NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED; + priv->assoc_pcalls = nm_call_store_new (); + priv->other_pcalls = nm_call_store_new (); + priv->dbus_mgr = nm_dbus_manager_get (); +} + +static void +set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + switch (prop_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + switch (prop_id) { + case PROP_STATE: + g_value_set_uint (value, NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object)->state); + break; + case PROP_CONNECTION_STATE: + g_value_set_uint (value, NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object)->con_state); + break; + case PROP_SCANNING: + g_value_set_boolean (value, NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object)->scanning); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +dispose (GObject *object) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object); + guint32 sm_state; + + if (priv->disposed) { + G_OBJECT_CLASS (nm_supplicant_interface_parent_class)->dispose (object); + return; + } + priv->disposed = TRUE; + + /* Ask wpa_supplicant to remove this interface */ + sm_state = nm_supplicant_manager_get_state (priv->smgr); + if (sm_state == NM_SUPPLICANT_MANAGER_STATE_IDLE) { + if (priv->object_path) { + try_remove_iface (nm_dbus_manager_get_connection (priv->dbus_mgr), + priv->object_path); + } + } + + if (priv->iface_proxy) + g_object_unref (priv->iface_proxy); + + if (priv->net_proxy) + g_object_unref (priv->net_proxy); + + if (priv->scan_results_timeout) + g_source_remove (priv->scan_results_timeout); + + if (priv->smgr) { + g_signal_handler_disconnect (priv->smgr, + priv->smgr_state_sig_handler); + g_object_unref (priv->smgr); + } + + g_free (priv->dev); + + /* Cancel pending calls before unrefing the dbus manager */ + cancel_all_callbacks (priv->other_pcalls); + nm_call_store_destroy (priv->other_pcalls); + + cancel_all_callbacks (priv->assoc_pcalls); + nm_call_store_destroy (priv->assoc_pcalls); + + if (priv->dbus_mgr) + g_object_unref (priv->dbus_mgr); + + if (priv->cfg) + g_object_unref (priv->cfg); + + g_free (priv->object_path); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (nm_supplicant_interface_parent_class)->dispose (object); +} + +static void +nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (NMSupplicantInterfacePrivate)); + + object_class->dispose = dispose; + object_class->set_property = set_property; + object_class->get_property = get_property; + + /* Properties */ + g_object_class_install_property (object_class, PROP_STATE, + g_param_spec_uint ("state", + "State", + "State of the supplicant interface; INIT, READY, or DOWN", + NM_SUPPLICANT_INTERFACE_STATE_INIT, + NM_SUPPLICANT_INTERFACE_STATE_LAST - 1, + NM_SUPPLICANT_INTERFACE_STATE_INIT, + G_PARAM_READABLE)); + + g_object_class_install_property (object_class, PROP_SCANNING, + g_param_spec_boolean ("scanning", + "Scanning", + "Scanning", + FALSE, + G_PARAM_READABLE)); + + /* Signals */ + signals[STATE] = + g_signal_new ("state", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, state), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); + + signals[REMOVED] = + g_signal_new ("removed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, removed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[SCANNED_AP] = + g_signal_new ("scanned-ap", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scanned_ap), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); + + signals[SCAN_REQ_RESULT] = + g_signal_new ("scan-req-result", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scan_req_result), + NULL, NULL, + g_cclosure_marshal_VOID__BOOLEAN, + G_TYPE_NONE, 1, G_TYPE_BOOLEAN); + + signals[SCAN_RESULTS] = + g_signal_new ("scan-results", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scan_results), + NULL, NULL, + g_cclosure_marshal_VOID__UINT, + G_TYPE_NONE, 1, G_TYPE_UINT); + + signals[CONNECTION_STATE] = + g_signal_new ("connection-state", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, connection_state), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); + + signals[CONNECTION_ERROR] = + g_signal_new ("connection-error", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, connection_error), + NULL, NULL, + _nm_marshal_VOID__STRING_STRING, + G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); +} + -- cgit v1.2.1 From 262db04e2015bd3911f1d9649ea49549f3f50dff Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 5 Oct 2010 14:19:56 -0500 Subject: supplicant: use a GHashTable instead of a GSList for tracking interfaces It's just less code. Yay. --- src/supplicant-manager/nm-supplicant-interface.c | 8 +++++ src/supplicant-manager/nm-supplicant-interface.h | 4 ++- src/supplicant-manager/nm-supplicant-manager.c | 46 ++++++++---------------- 3 files changed, 25 insertions(+), 33 deletions(-) diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index c04dc5e1cf..3c3fe52f84 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -1119,6 +1119,14 @@ nm_supplicant_interface_connection_state_to_string (guint32 state) return "unknown"; } +const char * +nm_supplicant_interface_get_ifname (NMSupplicantInterface *self) +{ + g_return_val_if_fail (self != NULL, FALSE); + + return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->dev; +} + /*******************************************************************/ NMSupplicantInterface * diff --git a/src/supplicant-manager/nm-supplicant-interface.h b/src/supplicant-manager/nm-supplicant-interface.h index bee5436f5a..3e56f4efaf 100644 --- a/src/supplicant-manager/nm-supplicant-interface.h +++ b/src/supplicant-manager/nm-supplicant-interface.h @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2006 - 2008 Red Hat, Inc. + * Copyright (C) 2006 - 2010 Red Hat, Inc. * Copyright (C) 2007 - 2008 Novell, Inc. */ @@ -140,6 +140,8 @@ const char *nm_supplicant_interface_connection_state_to_string (guint32 state); gboolean nm_supplicant_interface_get_scanning (NMSupplicantInterface *self); +const char *nm_supplicant_interface_get_ifname (NMSupplicantInterface *self); + G_END_DECLS #endif /* NM_SUPPLICANT_INTERFACE_H */ diff --git a/src/supplicant-manager/nm-supplicant-manager.c b/src/supplicant-manager/nm-supplicant-manager.c index a2cf58eb8f..1077da8d7f 100644 --- a/src/supplicant-manager/nm-supplicant-manager.c +++ b/src/supplicant-manager/nm-supplicant-manager.c @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2006 - 2008 Red Hat, Inc. + * Copyright (C) 2006 - 2010 Red Hat, Inc. * Copyright (C) 2007 - 2008 Novell, Inc. */ @@ -35,7 +35,7 @@ typedef struct { NMDBusManager * dbus_mgr; guint32 state; - GSList * ifaces; + GHashTable * ifaces; gboolean dispose_has_run; guint poke_id; } NMSupplicantManagerPrivate; @@ -125,6 +125,8 @@ nm_supplicant_manager_init (NMSupplicantManager * self) priv->dbus_mgr = nm_dbus_manager_get (); priv->poke_id = 0; + priv->ifaces = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); + running = nm_supplicant_manager_startup (self); g_signal_connect (priv->dbus_mgr, @@ -265,33 +267,23 @@ nm_supplicant_manager_startup (NMSupplicantManager * self) NMSupplicantInterface * nm_supplicant_manager_get_iface (NMSupplicantManager * self, - const char *ifname, - gboolean is_wireless) + const char *ifname, + gboolean is_wireless) { NMSupplicantManagerPrivate *priv; NMSupplicantInterface * iface = NULL; - GSList * elt; g_return_val_if_fail (NM_IS_SUPPLICANT_MANAGER (self), NULL); g_return_val_if_fail (ifname != NULL, NULL); priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); - /* Ensure we don't already have this interface */ - for (elt = priv->ifaces; elt; elt = g_slist_next (elt)) { - NMSupplicantInterface * if_tmp = (NMSupplicantInterface *) elt->data; - - if (!strcmp (ifname, nm_supplicant_interface_get_device (if_tmp))) { - iface = if_tmp; - break; - } - } - + iface = g_hash_table_lookup (priv->ifaces, ifname); if (!iface) { nm_log_dbg (LOGD_SUPPLICANT, "(%s): creating new supplicant interface", ifname); iface = nm_supplicant_interface_new (self, ifname, is_wireless); if (iface) - priv->ifaces = g_slist_append (priv->ifaces, iface); + g_hash_table_insert (priv->ifaces, g_strdup (ifname), iface); } else { nm_log_dbg (LOGD_SUPPLICANT, "(%s): returning existing supplicant interface", ifname); } @@ -300,30 +292,20 @@ nm_supplicant_manager_get_iface (NMSupplicantManager * self, } void -nm_supplicant_manager_release_iface (NMSupplicantManager * self, - NMSupplicantInterface * iface) +nm_supplicant_manager_release_iface (NMSupplicantManager *self, + NMSupplicantInterface *iface) { NMSupplicantManagerPrivate *priv; - GSList * elt; + const char *ifname; g_return_if_fail (NM_IS_SUPPLICANT_MANAGER (self)); g_return_if_fail (NM_IS_SUPPLICANT_INTERFACE (iface)); priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); - for (elt = priv->ifaces; elt; elt = g_slist_next (elt)) { - NMSupplicantInterface * if_tmp = (NMSupplicantInterface *) elt->data; - - if (if_tmp == iface) { - /* Remove the iface from the supplicant manager's list and - * dereference to match additional reference in get_iface. - */ - priv->ifaces = g_slist_remove_link (priv->ifaces, elt); - g_slist_free_1 (elt); - g_object_unref (iface); - break; - } - } + ifname = nm_supplicant_interface_get_ifname (iface); + g_assert (ifname); + g_hash_table_remove (priv->ifaces, ifname); } const char * -- cgit v1.2.1 From 4d63f084031bfe88887b6d655ecad2b81a135005 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 5 Oct 2010 14:20:23 -0500 Subject: supplicant: reorganize supplicant manager class Gets rid of prototypes and simplifies the code a bit. --- src/supplicant-manager/nm-supplicant-manager.c | 289 ++++++++++++------------- 1 file changed, 134 insertions(+), 155 deletions(-) diff --git a/src/supplicant-manager/nm-supplicant-manager.c b/src/supplicant-manager/nm-supplicant-manager.c index 1077da8d7f..56a5e58d63 100644 --- a/src/supplicant-manager/nm-supplicant-manager.c +++ b/src/supplicant-manager/nm-supplicant-manager.c @@ -36,8 +36,8 @@ typedef struct { NMDBusManager * dbus_mgr; guint32 state; GHashTable * ifaces; - gboolean dispose_has_run; - guint poke_id; + gboolean disposed; + guint poke_id; } NMSupplicantManagerPrivate; #define NM_SUPPLICANT_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ @@ -46,41 +46,14 @@ typedef struct { G_DEFINE_TYPE (NMSupplicantManager, nm_supplicant_manager, G_TYPE_OBJECT) - -static void nm_supplicant_manager_name_owner_changed (NMDBusManager *dbus_mgr, - const char *name, - const char *old, - const char *new, - gpointer user_data); - -static void nm_supplicant_manager_set_state (NMSupplicantManager * self, - guint32 new_state); - -static gboolean nm_supplicant_manager_startup (NMSupplicantManager * self); - - /* Signals */ enum { STATE, /* change in the manager's state */ LAST_SIGNAL }; -static guint nm_supplicant_manager_signals[LAST_SIGNAL] = { 0 }; - - -NMSupplicantManager * -nm_supplicant_manager_get (void) -{ - static NMSupplicantManager * singleton = NULL; - - if (!singleton) { - singleton = NM_SUPPLICANT_MANAGER (g_object_new (NM_TYPE_SUPPLICANT_MANAGER, NULL)); - } else { - g_object_ref (singleton); - } +static guint signals[LAST_SIGNAL] = { 0 }; - g_assert (singleton); - return singleton; -} +/********************************************************************/ static gboolean poke_supplicant_cb (gpointer user_data) @@ -114,117 +87,6 @@ out: return FALSE; } -static void -nm_supplicant_manager_init (NMSupplicantManager * self) -{ - NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); - gboolean running; - - priv->dispose_has_run = FALSE; - priv->state = NM_SUPPLICANT_MANAGER_STATE_DOWN; - priv->dbus_mgr = nm_dbus_manager_get (); - priv->poke_id = 0; - - priv->ifaces = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); - - running = nm_supplicant_manager_startup (self); - - g_signal_connect (priv->dbus_mgr, - "name-owner-changed", - G_CALLBACK (nm_supplicant_manager_name_owner_changed), - self); - - if (!running) { - /* Try to activate the supplicant */ - priv->poke_id = g_idle_add (poke_supplicant_cb, (gpointer) self); - } -} - -static void -nm_supplicant_manager_dispose (GObject *object) -{ - NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (object); - - if (priv->dispose_has_run) { - G_OBJECT_CLASS (nm_supplicant_manager_parent_class)->dispose (object); - return; - } - - priv->dispose_has_run = TRUE; - - if (priv->poke_id) { - g_source_remove (priv->poke_id); - priv->poke_id = 0; - } - - if (priv->dbus_mgr) { - g_object_unref (G_OBJECT (priv->dbus_mgr)); - priv->dbus_mgr = NULL; - } - - /* Chain up to the parent class */ - G_OBJECT_CLASS (nm_supplicant_manager_parent_class)->dispose (object); -} - -static void -nm_supplicant_manager_class_init (NMSupplicantManagerClass *klass) -{ - GObjectClass * object_class = G_OBJECT_CLASS (klass); - - g_type_class_add_private (object_class, sizeof (NMSupplicantManagerPrivate)); - - object_class->dispose = nm_supplicant_manager_dispose; - - /* Signals */ - nm_supplicant_manager_signals[STATE] = - g_signal_new ("state", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantManagerClass, state), - NULL, NULL, - _nm_marshal_VOID__UINT_UINT, - G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); -} - -static void -nm_supplicant_manager_name_owner_changed (NMDBusManager *dbus_mgr, - const char *name, - const char *old_owner, - const char *new_owner, - gpointer user_data) -{ - NMSupplicantManager * self = (NMSupplicantManager *) user_data; - NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); - gboolean old_owner_good = (old_owner && strlen (old_owner)); - gboolean new_owner_good = (new_owner && strlen (new_owner)); - - /* Can't handle the signal if its not from the supplicant service */ - if (strcmp (WPAS_DBUS_SERVICE, name) != 0) - return; - - if (!old_owner_good && new_owner_good) { - gboolean running; - - running = nm_supplicant_manager_startup (self); - - if (running && priv->poke_id) { - g_source_remove (priv->poke_id); - priv->poke_id = 0; - } - } else if (old_owner_good && !new_owner_good) { - nm_supplicant_manager_set_state (self, NM_SUPPLICANT_MANAGER_STATE_DOWN); - - if (priv->poke_id) - g_source_remove (priv->poke_id); - - /* Poke the supplicant so that it gets activated by dbus system bus - * activation. - */ - priv->poke_id = g_idle_add (poke_supplicant_cb, (gpointer) self); - } -} - - guint32 nm_supplicant_manager_get_state (NMSupplicantManager * self) { @@ -234,25 +96,20 @@ nm_supplicant_manager_get_state (NMSupplicantManager * self) } static void -nm_supplicant_manager_set_state (NMSupplicantManager * self, guint32 new_state) +set_state (NMSupplicantManager *self, guint32 new_state) { NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); guint32 old_state; - if (new_state == priv->state) - return; - - old_state = priv->state; - priv->state = new_state; - g_signal_emit (self, - nm_supplicant_manager_signals[STATE], - 0, - priv->state, - old_state); + if (new_state != priv->state) { + old_state = priv->state; + priv->state = new_state; + g_signal_emit (self, signals[STATE], 0, priv->state, old_state); + } } static gboolean -nm_supplicant_manager_startup (NMSupplicantManager * self) +startup (NMSupplicantManager * self) { gboolean running; @@ -260,7 +117,7 @@ nm_supplicant_manager_startup (NMSupplicantManager * self) running = nm_dbus_manager_name_has_owner (NM_SUPPLICANT_MANAGER_GET_PRIVATE (self)->dbus_mgr, WPAS_DBUS_SERVICE); if (running) - nm_supplicant_manager_set_state (self, NM_SUPPLICANT_MANAGER_STATE_IDLE); + set_state (self, NM_SUPPLICANT_MANAGER_STATE_IDLE); return running; } @@ -322,4 +179,126 @@ nm_supplicant_manager_state_to_string (guint32 state) return "unknown"; } +static void +name_owner_changed (NMDBusManager *dbus_mgr, + const char *name, + const char *old_owner, + const char *new_owner, + gpointer user_data) +{ + NMSupplicantManager * self = (NMSupplicantManager *) user_data; + NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); + gboolean old_owner_good = (old_owner && strlen (old_owner)); + gboolean new_owner_good = (new_owner && strlen (new_owner)); + + /* Can't handle the signal if its not from the supplicant service */ + if (strcmp (WPAS_DBUS_SERVICE, name) != 0) + return; + + if (!old_owner_good && new_owner_good) { + gboolean running; + + running = startup (self); + + if (running && priv->poke_id) { + g_source_remove (priv->poke_id); + priv->poke_id = 0; + } + } else if (old_owner_good && !new_owner_good) { + set_state (self, NM_SUPPLICANT_MANAGER_STATE_DOWN); + + if (priv->poke_id) + g_source_remove (priv->poke_id); + + /* Poke the supplicant so that it gets activated by dbus system bus + * activation. + */ + priv->poke_id = g_idle_add (poke_supplicant_cb, (gpointer) self); + } +} + +/*******************************************************************/ + +NMSupplicantManager * +nm_supplicant_manager_get (void) +{ + static NMSupplicantManager *singleton = NULL; + + if (!singleton) + singleton = NM_SUPPLICANT_MANAGER (g_object_new (NM_TYPE_SUPPLICANT_MANAGER, NULL)); + else + g_object_ref (singleton); + + g_assert (singleton); + return singleton; +} + +static void +nm_supplicant_manager_init (NMSupplicantManager * self) +{ + NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); + gboolean running; + + priv->state = NM_SUPPLICANT_MANAGER_STATE_DOWN; + priv->dbus_mgr = nm_dbus_manager_get (); + priv->poke_id = 0; + + priv->ifaces = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); + + running = startup (self); + + g_signal_connect (priv->dbus_mgr, + "name-owner-changed", + G_CALLBACK (name_owner_changed), + self); + + if (!running) { + /* Try to activate the supplicant */ + priv->poke_id = g_idle_add (poke_supplicant_cb, (gpointer) self); + } +} + +static void +dispose (GObject *object) +{ + NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (object); + + if (priv->disposed) { + G_OBJECT_CLASS (nm_supplicant_manager_parent_class)->dispose (object); + return; + } + priv->disposed = TRUE; + + if (priv->poke_id) { + g_source_remove (priv->poke_id); + priv->poke_id = 0; + } + + if (priv->dbus_mgr) { + g_object_unref (G_OBJECT (priv->dbus_mgr)); + priv->dbus_mgr = NULL; + } + + /* Chain up to the parent class */ + G_OBJECT_CLASS (nm_supplicant_manager_parent_class)->dispose (object); +} + +static void +nm_supplicant_manager_class_init (NMSupplicantManagerClass *klass) +{ + GObjectClass * object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (NMSupplicantManagerPrivate)); + + object_class->dispose = dispose; + + /* Signals */ + signals[STATE] = g_signal_new ("state", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantManagerClass, state), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); +} -- cgit v1.2.1 From f3a1366b55f5367c87afb95a2208cbb40729f5bf Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 6 Oct 2010 11:05:21 -0500 Subject: supplicant: collapse supplicant interface states We only really need one state for the supplicant interface which simplifies handling in the Wifi and Wired device classes quite a bit. It also simplifies the supplicant interface class too. One behavioral change in the device classes is not running the supplicant interface state changes from an idle; we'll have to see if that causes problems. ISTR long ago that processing the state change signals directly caused some issues, but we've significantly reworked somethings since then so we may be able to get away with this now. --- src/nm-device-ethernet.c | 298 +++---------- src/nm-device-wifi.c | 354 +++------------ src/supplicant-manager/nm-supplicant-interface.c | 536 ++++++++++------------- src/supplicant-manager/nm-supplicant-interface.h | 53 +-- src/supplicant-manager/nm-supplicant-manager.c | 232 ++++------ src/supplicant-manager/nm-supplicant-manager.h | 38 +- 6 files changed, 457 insertions(+), 1054 deletions(-) diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index 08bbc50112..13139542fa 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -78,30 +78,17 @@ typedef enum #define NM_ETHERNET_ERROR (nm_ethernet_error_quark ()) #define NM_TYPE_ETHERNET_ERROR (nm_ethernet_error_get_type ()) -typedef struct SupplicantStateTask { - NMDeviceEthernet *self; - guint32 new_state; - guint32 old_state; - gboolean mgr_task; - guint source_id; -} SupplicantStateTask; - typedef struct Supplicant { NMSupplicantManager *mgr; NMSupplicantInterface *iface; /* signal handler ids */ - guint mgr_state_id; guint iface_error_id; guint iface_state_id; - guint iface_con_state_id; /* Timeouts and idles */ guint iface_con_error_cb_id; guint con_timeout_id; - - GSList *iface_tasks; - GSList *mgr_tasks; } Supplicant; typedef struct { @@ -996,30 +983,6 @@ remove_supplicant_timeouts (NMDeviceEthernet *self) } } -static void -finish_supplicant_task (SupplicantStateTask *task, gboolean remove_source) -{ - NMDeviceEthernet *self = task->self; - NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); - - /* idle/timeout handlers should pass FALSE for remove_source, since they - * will tell glib to remove their source from the mainloop by returning - * FALSE when they exit. When called from this NMDevice's dispose handler, - * remove_source should be TRUE to cancel all outstanding idle/timeout - * handlers asynchronously. - */ - if (task->source_id && remove_source) - g_source_remove (task->source_id); - - if (task->mgr_task) - priv->supplicant.mgr_tasks = g_slist_remove (priv->supplicant.mgr_tasks, task); - else - priv->supplicant.iface_tasks = g_slist_remove (priv->supplicant.iface_tasks, task); - - memset (task, 0, sizeof (SupplicantStateTask)); - g_slice_free (SupplicantStateTask, task); -} - static void remove_supplicant_interface_error_handler (NMDeviceEthernet *self) { @@ -1044,28 +1007,14 @@ supplicant_interface_release (NMDeviceEthernet *self) remove_supplicant_timeouts (self); remove_supplicant_interface_error_handler (self); - /* Clean up all pending supplicant interface state idle tasks */ - while (priv->supplicant.iface_tasks) - finish_supplicant_task ((SupplicantStateTask *) priv->supplicant.iface_tasks->data, TRUE); - - if (priv->supplicant.iface_con_state_id) { - g_signal_handler_disconnect (priv->supplicant.iface, priv->supplicant.iface_con_state_id); - priv->supplicant.iface_con_state_id = 0; - } - if (priv->supplicant.iface_state_id > 0) { g_signal_handler_disconnect (priv->supplicant.iface, priv->supplicant.iface_state_id); priv->supplicant.iface_state_id = 0; } - if (priv->supplicant.mgr_state_id) { - g_signal_handler_disconnect (priv->supplicant.mgr, priv->supplicant.mgr_state_id); - priv->supplicant.mgr_state_id = 0; - } - if (priv->supplicant.iface) { nm_supplicant_interface_disconnect (priv->supplicant.iface); - nm_supplicant_manager_release_iface (priv->supplicant.mgr, priv->supplicant.iface); + nm_supplicant_manager_iface_release (priv->supplicant.mgr, priv->supplicant.iface); priv->supplicant.iface = NULL; } } @@ -1127,77 +1076,6 @@ time_out: return FALSE; } -static gboolean -schedule_state_handler (NMDeviceEthernet *self, - GSourceFunc handler, - guint32 new_state, - guint32 old_state, - gboolean mgr_task) -{ - NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); - SupplicantStateTask *task; - - if (new_state == old_state) - return TRUE; - - task = g_slice_new0 (SupplicantStateTask); - if (!task) { - nm_log_err (LOGD_DEVICE, "Not enough memory to process supplicant manager state change."); - return FALSE; - } - - task->self = self; - task->new_state = new_state; - task->old_state = old_state; - task->mgr_task = mgr_task; - - task->source_id = g_idle_add (handler, task); - if (mgr_task) - priv->supplicant.mgr_tasks = g_slist_append (priv->supplicant.mgr_tasks, task); - else - priv->supplicant.iface_tasks = g_slist_append (priv->supplicant.iface_tasks, task); - return TRUE; -} - -static gboolean -supplicant_mgr_state_cb_handler (gpointer user_data) -{ - SupplicantStateTask *task = (SupplicantStateTask *) user_data; - NMDevice *device = NM_DEVICE (task->self); - - /* If the supplicant went away, release the supplicant interface */ - if (task->new_state == NM_SUPPLICANT_MANAGER_STATE_DOWN) { - supplicant_interface_release (task->self); - - if (nm_device_get_state (device) > NM_DEVICE_STATE_UNAVAILABLE) { - nm_device_state_changed (device, NM_DEVICE_STATE_UNAVAILABLE, - NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED); - } - } - - finish_supplicant_task (task, FALSE); - return FALSE; -} - -static void -supplicant_mgr_state_cb (NMSupplicantInterface * iface, - guint32 new_state, - guint32 old_state, - gpointer user_data) -{ - nm_log_info (LOGD_DEVICE | LOGD_ETHER, - "(%s): supplicant manager state: %s -> %s", - nm_device_get_iface (NM_DEVICE (user_data)), - nm_supplicant_manager_state_to_string (old_state), - nm_supplicant_manager_state_to_string (new_state)); - - schedule_state_handler (NM_DEVICE_ETHERNET (user_data), - supplicant_mgr_state_cb_handler, - new_state, - old_state, - TRUE); -} - static NMSupplicantConfig * build_supplicant_config (NMDeviceEthernet *self) { @@ -1224,20 +1102,33 @@ build_supplicant_config (NMDeviceEthernet *self) return config; } -static gboolean -supplicant_iface_state_cb_handler (gpointer user_data) +static void +supplicant_iface_state_cb (NMSupplicantInterface *iface, + guint32 new_state, + guint32 old_state, + gpointer user_data) { - SupplicantStateTask *task = (SupplicantStateTask *) user_data; - NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (task->self); - NMDevice *device = NM_DEVICE (task->self); + NMDeviceEthernet *self = NM_DEVICE_ETHERNET (user_data); + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + NMDevice *device = NM_DEVICE (self); + NMSupplicantConfig *config; + gboolean success = FALSE; + NMDeviceState devstate; + + if (new_state == old_state) + return; + + nm_log_info (LOGD_DEVICE | LOGD_ETHER, + "(%s): supplicant interface state: %s -> %s", + nm_device_get_iface (device), + nm_supplicant_interface_state_to_string (old_state), + nm_supplicant_interface_state_to_string (new_state)); - if (task->new_state == NM_SUPPLICANT_INTERFACE_STATE_READY) { - NMSupplicantConfig *config; - const char *iface; - gboolean success = FALSE; + devstate = nm_device_get_state (device); - iface = nm_device_get_iface (device); - config = build_supplicant_config (task->self); + switch (new_state) { + case NM_SUPPLICANT_INTERFACE_STATE_READY: + config = build_supplicant_config (self); if (config) { success = nm_supplicant_interface_set_config (priv->supplicant.iface, config); g_object_unref (config); @@ -1246,99 +1137,54 @@ supplicant_iface_state_cb_handler (gpointer user_data) nm_log_err (LOGD_DEVICE | LOGD_ETHER, "Activation (%s/wired): couldn't send security " "configuration to the supplicant.", - iface); + nm_device_get_iface (device)); } } else { nm_log_warn (LOGD_DEVICE | LOGD_ETHER, "Activation (%s/wired): couldn't build security configuration.", - iface); + nm_device_get_iface (device)); } - if (!success) - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED); - } else if (task->new_state == NM_SUPPLICANT_INTERFACE_STATE_DOWN) { - NMDeviceState state = nm_device_get_state (device); - - supplicant_interface_release (task->self); - - if (nm_device_is_activating (device) || state == NM_DEVICE_STATE_ACTIVATED) - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED); - } - - finish_supplicant_task (task, FALSE); - return FALSE; -} - -static void -supplicant_iface_state_cb (NMSupplicantInterface * iface, - guint32 new_state, - guint32 old_state, - gpointer user_data) -{ - - nm_log_info (LOGD_DEVICE | LOGD_ETHER, - "(%s): supplicant interface state: %s -> %s", - nm_device_get_iface (NM_DEVICE (user_data)), - nm_supplicant_interface_state_to_string (old_state), - nm_supplicant_interface_state_to_string (new_state)); - - schedule_state_handler (NM_DEVICE_ETHERNET (user_data), - supplicant_iface_state_cb_handler, - new_state, - old_state, - FALSE); -} - -static gboolean -supplicant_iface_connection_state_cb_handler (gpointer user_data) -{ - SupplicantStateTask *task = (SupplicantStateTask *) user_data; - NMDevice *dev = NM_DEVICE (task->self); - - if (task->new_state == NM_SUPPLICANT_INTERFACE_CON_STATE_COMPLETED) { - remove_supplicant_interface_error_handler (task->self); - remove_supplicant_timeouts (task->self); + if (!success) { + nm_device_state_changed (device, + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED); + } + break; + case NM_SUPPLICANT_INTERFACE_STATE_COMPLETED: + remove_supplicant_interface_error_handler (self); + remove_supplicant_timeouts (self); /* If this is the initial association during device activation, * schedule the next activation stage. */ - if (nm_device_get_state (dev) == NM_DEVICE_STATE_CONFIG) { + if (devstate == NM_DEVICE_STATE_CONFIG) { nm_log_info (LOGD_DEVICE | LOGD_ETHER, "Activation (%s/wired) Stage 2 of 5 (Device Configure) successful.", - nm_device_get_iface (dev)); - nm_device_activate_schedule_stage3_ip_config_start (dev); + nm_device_get_iface (device)); + nm_device_activate_schedule_stage3_ip_config_start (device); } - } else if (task->new_state == NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED) { - if (nm_device_get_state (dev) == NM_DEVICE_STATE_ACTIVATED || nm_device_is_activating (dev)) { - NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (task->self); - + break; + case NM_SUPPLICANT_INTERFACE_STATE_DISCONNECTED: + if ((devstate == NM_DEVICE_STATE_ACTIVATED) || nm_device_is_activating (device)) { /* Start the link timeout so we allow some time for reauthentication */ if (!priv->supplicant_timeout_id) - priv->supplicant_timeout_id = g_timeout_add_seconds (15, link_timeout_cb, dev); + priv->supplicant_timeout_id = g_timeout_add_seconds (15, link_timeout_cb, device); } - } - - finish_supplicant_task (task, FALSE); - return FALSE; -} - -static void -supplicant_iface_connection_state_cb (NMSupplicantInterface * iface, - guint32 new_state, - guint32 old_state, - gpointer user_data) -{ - nm_log_info (LOGD_DEVICE | LOGD_ETHER, - "(%s) supplicant connection state: %s -> %s", - nm_device_get_iface (NM_DEVICE (user_data)), - nm_supplicant_interface_connection_state_to_string (old_state), - nm_supplicant_interface_connection_state_to_string (new_state)); + break; + case NM_SUPPLICANT_INTERFACE_STATE_DOWN: + supplicant_interface_release (self); + remove_supplicant_timeouts (self); - schedule_state_handler (NM_DEVICE_ETHERNET (user_data), - supplicant_iface_connection_state_cb_handler, - new_state, - old_state, - FALSE); + if ((devstate == NM_DEVICE_STATE_ACTIVATED) || nm_device_is_activating (device)) { + nm_device_state_changed (device, + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED); + } + break; + default: + break; + } } static gboolean @@ -1456,38 +1302,26 @@ supplicant_interface_init (NMDeviceEthernet *self) iface = nm_device_get_iface (NM_DEVICE (self)); /* Create supplicant interface */ - priv->supplicant.iface = nm_supplicant_manager_get_iface (priv->supplicant.mgr, iface, FALSE); + priv->supplicant.iface = nm_supplicant_manager_iface_get (priv->supplicant.mgr, iface, FALSE); if (!priv->supplicant.iface) { nm_log_err (LOGD_DEVICE | LOGD_ETHER, "Couldn't initialize supplicant interface for %s.", iface); supplicant_interface_release (self); - return FALSE; } /* Listen for it's state signals */ priv->supplicant.iface_state_id = g_signal_connect (priv->supplicant.iface, - "state", - G_CALLBACK (supplicant_iface_state_cb), - self); + "state", + G_CALLBACK (supplicant_iface_state_cb), + self); /* Hook up error signal handler to capture association errors */ priv->supplicant.iface_error_id = g_signal_connect (priv->supplicant.iface, - "connection-error", - G_CALLBACK (supplicant_iface_connection_error_cb), - self); - - priv->supplicant.iface_con_state_id = g_signal_connect (priv->supplicant.iface, - "connection-state", - G_CALLBACK (supplicant_iface_connection_state_cb), - self); - - /* Listen for supplicant manager state changes */ - priv->supplicant.mgr_state_id = g_signal_connect (priv->supplicant.mgr, - "state", - G_CALLBACK (supplicant_mgr_state_cb), - self); + "connection-error", + G_CALLBACK (supplicant_iface_connection_error_cb), + self); /* Set up a timeout on the connection attempt to fail it after 25 seconds */ priv->supplicant.con_timeout_id = g_timeout_add_seconds (25, supplicant_connection_timeout_cb, self); @@ -2047,12 +1881,6 @@ dispose (GObject *object) priv->disposed = TRUE; - /* Clean up all pending supplicant tasks */ - while (priv->supplicant.iface_tasks) - finish_supplicant_task ((SupplicantStateTask *) priv->supplicant.iface_tasks->data, TRUE); - while (priv->supplicant.mgr_tasks) - finish_supplicant_task ((SupplicantStateTask *) priv->supplicant.mgr_tasks->data, TRUE); - if (priv->link_connected_id) { g_signal_handler_disconnect (priv->monitor, priv->link_connected_id); priv->link_connected_id = 0; diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index b09d112547..44d5a12754 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -113,34 +113,21 @@ typedef enum { #define NM_WIFI_ERROR (nm_wifi_error_quark ()) #define NM_TYPE_WIFI_ERROR (nm_wifi_error_get_type ()) -typedef struct SupplicantStateTask { - NMDeviceWifi *self; - guint32 new_state; - guint32 old_state; - gboolean mgr_task; - guint source_id; -} SupplicantStateTask; - typedef struct Supplicant { NMSupplicantManager *mgr; NMSupplicantInterface *iface; /* signal handler ids */ - guint mgr_state_id; guint iface_error_id; guint iface_state_id; guint iface_scanned_ap_id; guint iface_scan_request_result_id; guint iface_scan_results_id; - guint iface_con_state_id; guint iface_notify_scanning_id; /* Timeouts and idles */ guint iface_con_error_cb_id; guint con_timeout_id; - - GSList *mgr_tasks; - GSList *iface_tasks; } Supplicant; struct _NMDeviceWifiPrivate { @@ -199,15 +186,10 @@ static void cleanup_association_attempt (NMDeviceWifi * self, static void remove_supplicant_timeouts (NMDeviceWifi *self); -static void supplicant_iface_state_cb (NMSupplicantInterface * iface, +static void supplicant_iface_state_cb (NMSupplicantInterface *iface, guint32 new_state, guint32 old_state, - NMDeviceWifi *self); - -static void supplicant_iface_connection_state_cb (NMSupplicantInterface * iface, - guint32 new_state, - guint32 old_state, - NMDeviceWifi *self); + gpointer user_data); static void supplicant_iface_scanned_ap_cb (NMSupplicantInterface * iface, GHashTable *properties, @@ -221,11 +203,6 @@ static void supplicant_iface_scan_results_cb (NMSupplicantInterface * iface, guint32 num_bssids, NMDeviceWifi * self); -static void supplicant_mgr_state_cb (NMSupplicantInterface * iface, - guint32 new_state, - guint32 old_state, - NMDeviceWifi *self); - static void supplicant_iface_notify_scanning_cb (NMSupplicantInterface * iface, GParamSpec * pspec, NMDeviceWifi * self); @@ -625,10 +602,7 @@ constructor (GType type, /* Connect to the supplicant manager */ priv->supplicant.mgr = nm_supplicant_manager_get (); - priv->supplicant.mgr_state_id = g_signal_connect (priv->supplicant.mgr, - "state", - G_CALLBACK (supplicant_mgr_state_cb), - self); + g_assert (priv->supplicant.mgr); /* The ipw2x00 drivers don't integrate with the kernel rfkill subsystem until * 2.6.33. Thus all our nice libgudev magic is useless. So we get to poll. @@ -657,17 +631,13 @@ static gboolean supplicant_interface_acquire (NMDeviceWifi *self) { NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); - guint id, mgr_state; + guint id; g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (priv->supplicant.mgr != NULL, FALSE); /* interface already acquired? */ g_return_val_if_fail (priv->supplicant.iface == NULL, TRUE); - mgr_state = nm_supplicant_manager_get_state (priv->supplicant.mgr); - g_return_val_if_fail (mgr_state == NM_SUPPLICANT_MANAGER_STATE_IDLE, FALSE); - - priv->supplicant.iface = nm_supplicant_manager_get_iface (priv->supplicant.mgr, + priv->supplicant.iface = nm_supplicant_manager_iface_get (priv->supplicant.mgr, nm_device_get_iface (NM_DEVICE (self)), TRUE); if (priv->supplicant.iface == NULL) { @@ -700,12 +670,6 @@ supplicant_interface_acquire (NMDeviceWifi *self) self); priv->supplicant.iface_scan_results_id = id; - id = g_signal_connect (priv->supplicant.iface, - "connection-state", - G_CALLBACK (supplicant_iface_connection_state_cb), - self); - priv->supplicant.iface_con_state_id = id; - id = g_signal_connect (priv->supplicant.iface, "notify::scanning", G_CALLBACK (supplicant_iface_notify_scanning_cb), @@ -715,30 +679,6 @@ supplicant_interface_acquire (NMDeviceWifi *self) return TRUE; } -static void -finish_supplicant_task (SupplicantStateTask *task, gboolean remove_source) -{ - NMDeviceWifi *self = task->self; - NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); - - /* idle/timeout handlers should pass FALSE for remove_source, since they - * will tell glib to remove their source from the mainloop by returning - * FALSE when they exit. When called from this NMDevice's dispose handler, - * remove_source should be TRUE to cancel all outstanding idle/timeout - * handlers asynchronously. - */ - if (task->source_id && remove_source) - g_source_remove (task->source_id); - - if (task->mgr_task) - priv->supplicant.mgr_tasks = g_slist_remove (priv->supplicant.mgr_tasks, task); - else - priv->supplicant.iface_tasks = g_slist_remove (priv->supplicant.iface_tasks, task); - - memset (task, 0, sizeof (SupplicantStateTask)); - g_slice_free (SupplicantStateTask, task); -} - static void remove_supplicant_interface_error_handler (NMDeviceWifi *self) { @@ -776,10 +716,6 @@ supplicant_interface_release (NMDeviceWifi *self) remove_supplicant_interface_error_handler (self); - /* Clean up all pending supplicant interface state idle tasks */ - while (priv->supplicant.iface_tasks) - finish_supplicant_task ((SupplicantStateTask *) priv->supplicant.iface_tasks->data, TRUE); - if (priv->supplicant.iface_state_id > 0) { g_signal_handler_disconnect (priv->supplicant.iface, priv->supplicant.iface_state_id); priv->supplicant.iface_state_id = 0; @@ -800,11 +736,6 @@ supplicant_interface_release (NMDeviceWifi *self) priv->supplicant.iface_scan_results_id = 0; } - if (priv->supplicant.iface_con_state_id > 0) { - g_signal_handler_disconnect (priv->supplicant.iface, priv->supplicant.iface_con_state_id); - priv->supplicant.iface_con_state_id = 0; - } - if (priv->supplicant.iface_notify_scanning_id > 0) { g_signal_handler_disconnect (priv->supplicant.iface, priv->supplicant.iface_notify_scanning_id); priv->supplicant.iface_notify_scanning_id = 0; @@ -814,7 +745,7 @@ supplicant_interface_release (NMDeviceWifi *self) /* Tell the supplicant to disconnect from the current AP */ nm_supplicant_interface_disconnect (priv->supplicant.iface); - nm_supplicant_manager_release_iface (priv->supplicant.mgr, priv->supplicant.iface); + nm_supplicant_manager_iface_release (priv->supplicant.mgr, priv->supplicant.iface); priv->supplicant.iface = NULL; } } @@ -1837,11 +1768,11 @@ scanning_allowed (NMDeviceWifi *self) } /* Don't scan if the supplicant is busy */ - sup_state = nm_supplicant_interface_get_connection_state (priv->supplicant.iface); - if ( sup_state == NM_SUPPLICANT_INTERFACE_CON_STATE_ASSOCIATING - || sup_state == NM_SUPPLICANT_INTERFACE_CON_STATE_ASSOCIATED - || sup_state == NM_SUPPLICANT_INTERFACE_CON_STATE_4WAY_HANDSHAKE - || sup_state == NM_SUPPLICANT_INTERFACE_CON_STATE_GROUP_HANDSHAKE + sup_state = nm_supplicant_interface_get_state (priv->supplicant.iface); + if ( sup_state == NM_SUPPLICANT_INTERFACE_STATE_ASSOCIATING + || sup_state == NM_SUPPLICANT_INTERFACE_STATE_ASSOCIATED + || sup_state == NM_SUPPLICANT_INTERFACE_STATE_4WAY_HANDSHAKE + || sup_state == NM_SUPPLICANT_INTERFACE_STATE_GROUP_HANDSHAKE || nm_supplicant_interface_get_scanning (priv->supplicant.iface)) return FALSE; @@ -2441,253 +2372,97 @@ time_out: return FALSE; } -static gboolean -schedule_state_handler (NMDeviceWifi *self, - GSourceFunc handler, - guint32 new_state, - guint32 old_state, - gboolean mgr_task) +static void +supplicant_iface_state_cb (NMSupplicantInterface *iface, + guint32 new_state, + guint32 old_state, + gpointer user_data) { - NMDeviceWifiPrivate *priv; - SupplicantStateTask *task; - - g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (handler != NULL, FALSE); + NMDeviceWifi *self = NM_DEVICE_WIFI (user_data); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + NMDevice *device = NM_DEVICE (self); + NMDeviceState devstate; + gboolean scanning; if (new_state == old_state) - return TRUE; - - priv = NM_DEVICE_WIFI_GET_PRIVATE (self); - - task = g_slice_new0 (SupplicantStateTask); - if (!task) { - nm_log_err (LOGD_WIFI, "Not enough memory to process supplicant manager state change."); - return FALSE; - } - - task->self = self; - task->new_state = new_state; - task->old_state = old_state; - task->mgr_task = mgr_task; - - task->source_id = g_idle_add (handler, task); - if (mgr_task) - priv->supplicant.mgr_tasks = g_slist_append (priv->supplicant.mgr_tasks, task); - else - priv->supplicant.iface_tasks = g_slist_append (priv->supplicant.iface_tasks, task); - - return TRUE; -} - -static gboolean -supplicant_iface_state_cb_handler (gpointer user_data) -{ - SupplicantStateTask *task = (SupplicantStateTask *) user_data; - NMDeviceWifi *self; - NMDeviceWifiPrivate *priv; - - g_return_val_if_fail (task != NULL, FALSE); + return; - self = task->self; - priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + nm_log_info (LOGD_DEVICE | LOGD_WIFI, + "(%s): supplicant interface state: %s -> %s", + nm_device_get_iface (device), + nm_supplicant_interface_state_to_string (old_state), + nm_supplicant_interface_state_to_string (new_state)); - nm_log_info (LOGD_WIFI, "(%s): supplicant interface state: %s -> %s", - nm_device_get_iface (NM_DEVICE (self)), - nm_supplicant_interface_state_to_string (task->old_state), - nm_supplicant_interface_state_to_string (task->new_state)); + devstate = nm_device_get_state (device); + scanning = nm_supplicant_interface_get_scanning (iface); - if (task->new_state == NM_SUPPLICANT_INTERFACE_STATE_READY) { + switch (new_state) { + case NM_SUPPLICANT_INTERFACE_STATE_READY: priv->scan_interval = SCAN_INTERVAL_MIN; /* If the interface can now be activated because the supplicant is now * available, transition to DISCONNECTED. */ - if ( (nm_device_get_state (NM_DEVICE (self)) == NM_DEVICE_STATE_UNAVAILABLE) - && nm_device_is_available (NM_DEVICE (self))) { - nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_DISCONNECTED, + if ((devstate == NM_DEVICE_STATE_UNAVAILABLE) && nm_device_is_available (device)) { + nm_device_state_changed (device, + NM_DEVICE_STATE_DISCONNECTED, NM_DEVICE_STATE_REASON_SUPPLICANT_AVAILABLE); } - nm_log_dbg (LOGD_WIFI_SCAN, "(%s): supplicant ready, requesting initial scan", - nm_device_get_iface (NM_DEVICE (self))); + nm_log_dbg (LOGD_WIFI_SCAN, + "(%s): supplicant ready, requesting initial scan", + nm_device_get_iface (device)); /* Request a scan to get latest results */ cancel_pending_scan (self); request_wireless_scan (self); - } else if (task->new_state == NM_SUPPLICANT_INTERFACE_STATE_DOWN) { - cleanup_association_attempt (self, FALSE); - supplicant_interface_release (self); - nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_UNAVAILABLE, - NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED); - } - - finish_supplicant_task (task, FALSE); - return FALSE; -} - - -static void -supplicant_iface_state_cb (NMSupplicantInterface * iface, - guint32 new_state, - guint32 old_state, - NMDeviceWifi *self) -{ - g_return_if_fail (self != NULL); - - schedule_state_handler (self, - supplicant_iface_state_cb_handler, - new_state, - old_state, - FALSE); -} - - -static gboolean -supplicant_iface_connection_state_cb_handler (gpointer user_data) -{ - SupplicantStateTask *task = (SupplicantStateTask *) user_data; - NMDeviceWifi *self = task->self; - NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); - NMDevice *dev = NM_DEVICE (self); - gboolean scanning; - - if (!nm_device_get_act_request (dev)) { - /* The device is not activating or already activated; do nothing. */ - goto out; - } - - nm_log_info (LOGD_WIFI, "(%s): supplicant connection state: %s -> %s", - nm_device_get_iface (dev), - nm_supplicant_interface_connection_state_to_string (task->old_state), - nm_supplicant_interface_connection_state_to_string (task->new_state)); - - scanning = nm_supplicant_interface_get_scanning (priv->supplicant.iface); - - if (task->new_state == NM_SUPPLICANT_INTERFACE_CON_STATE_COMPLETED) { + break; + case NM_SUPPLICANT_INTERFACE_STATE_COMPLETED: remove_supplicant_interface_error_handler (self); remove_supplicant_timeouts (self); /* If this is the initial association during device activation, * schedule the next activation stage. */ - if (nm_device_get_state (dev) == NM_DEVICE_STATE_CONFIG) { + if (devstate == NM_DEVICE_STATE_CONFIG) { NMAccessPoint *ap = nm_device_wifi_get_activation_ap (self); - const GByteArray * ssid = nm_ap_get_ssid (ap); + const GByteArray *ssid = nm_ap_get_ssid (ap); nm_log_info (LOGD_DEVICE | LOGD_WIFI, "Activation (%s/wireless) Stage 2 of 5 (Device Configure) " "successful. Connected to wireless network '%s'.", - nm_device_get_iface (dev), + nm_device_get_iface (device), ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : "(none)"); - nm_device_activate_schedule_stage3_ip_config_start (dev); + nm_device_activate_schedule_stage3_ip_config_start (device); } - } else if (task->new_state == NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED) { - if (nm_device_get_state (dev) == NM_DEVICE_STATE_ACTIVATED || nm_device_is_activating (dev)) { + break; + case NM_SUPPLICANT_INTERFACE_STATE_DISCONNECTED: + if ((devstate == NM_DEVICE_STATE_ACTIVATED) || nm_device_is_activating (device)) { /* Start the link timeout so we allow some time for reauthentication, * use a longer timeout if we are scanning since some cards take a * while to scan. */ if (!priv->link_timeout_id) { priv->link_timeout_id = g_timeout_add_seconds (scanning ? 30 : 15, - link_timeout_cb, self); + link_timeout_cb, self); } } + break; + case NM_SUPPLICANT_INTERFACE_STATE_DOWN: + cleanup_association_attempt (self, FALSE); + supplicant_interface_release (self); + nm_device_state_changed (device, + NM_DEVICE_STATE_UNAVAILABLE, + NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED); + break; + default: + break; } -out: /* Signal scanning state changes */ - if ( task->new_state == NM_SUPPLICANT_INTERFACE_CON_STATE_SCANNING - || task->old_state == NM_SUPPLICANT_INTERFACE_CON_STATE_SCANNING) + if ( new_state == NM_SUPPLICANT_INTERFACE_STATE_SCANNING + || old_state == NM_SUPPLICANT_INTERFACE_STATE_SCANNING) g_object_notify (G_OBJECT (self), "scanning"); - - finish_supplicant_task (task, FALSE); - return FALSE; -} - - -static void -supplicant_iface_connection_state_cb (NMSupplicantInterface * iface, - guint32 new_state, - guint32 old_state, - NMDeviceWifi *self) -{ - g_return_if_fail (self != NULL); - - schedule_state_handler (self, - supplicant_iface_connection_state_cb_handler, - new_state, - old_state, - FALSE); -} - - -static gboolean -supplicant_mgr_state_cb_handler (gpointer user_data) -{ - SupplicantStateTask *task = (SupplicantStateTask *) user_data; - NMDeviceWifi *self; - NMDeviceWifiPrivate *priv; - NMDevice *dev; - NMDeviceState dev_state; - - g_return_val_if_fail (task != NULL, FALSE); - - self = task->self; - priv = NM_DEVICE_WIFI_GET_PRIVATE (self); - dev = NM_DEVICE (self); - - nm_log_info (LOGD_WIFI, "(%s): supplicant manager state: %s -> %s", - nm_device_get_iface (NM_DEVICE (self)), - nm_supplicant_manager_state_to_string (task->old_state), - nm_supplicant_manager_state_to_string (task->new_state)); - - /* If the supplicant went away, release the supplicant interface */ - if (task->new_state == NM_SUPPLICANT_MANAGER_STATE_DOWN) { - if (priv->supplicant.iface) { - cleanup_association_attempt (self, FALSE); - supplicant_interface_release (self); - } - - if (nm_device_get_state (dev) > NM_DEVICE_STATE_UNAVAILABLE) { - nm_device_state_changed (dev, NM_DEVICE_STATE_UNAVAILABLE, - NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED); - } - } else if (task->new_state == NM_SUPPLICANT_MANAGER_STATE_IDLE) { - dev_state = nm_device_get_state (dev); - if ( priv->enabled - && !priv->supplicant.iface - && (dev_state >= NM_DEVICE_STATE_UNAVAILABLE) - && (nm_device_get_firmware_missing (NM_DEVICE (self)) == FALSE)) { - /* request a supplicant interface from the supplicant manager */ - supplicant_interface_acquire (self); - - /* if wireless is enabled and we have a supplicant interface, - * we can transition to the DISCONNECTED state. - */ - if (priv->supplicant.iface) { - nm_device_state_changed (dev, NM_DEVICE_STATE_DISCONNECTED, - NM_DEVICE_STATE_REASON_NONE); - } - } - } - - finish_supplicant_task (task, FALSE); - return FALSE; -} - -static void -supplicant_mgr_state_cb (NMSupplicantInterface * iface, - guint32 new_state, - guint32 old_state, - NMDeviceWifi *self) -{ - g_return_if_fail (self != NULL); - - schedule_state_handler (self, - supplicant_mgr_state_cb_handler, - new_state, - old_state, - TRUE); } struct iface_con_error_cb_data { @@ -3845,20 +3620,9 @@ dispose (GObject *object) priv->periodic_source_id = 0; } - /* Clean up all pending supplicant tasks */ - while (priv->supplicant.iface_tasks) - finish_supplicant_task ((SupplicantStateTask *) priv->supplicant.iface_tasks->data, TRUE); - while (priv->supplicant.mgr_tasks) - finish_supplicant_task ((SupplicantStateTask *) priv->supplicant.mgr_tasks->data, TRUE); - cleanup_association_attempt (self, TRUE); supplicant_interface_release (self); - if (priv->supplicant.mgr_state_id) { - g_signal_handler_disconnect (priv->supplicant.mgr, priv->supplicant.mgr_state_id); - priv->supplicant.mgr_state_id = 0; - } - if (priv->supplicant.mgr) { g_object_unref (priv->supplicant.mgr); priv->supplicant.mgr = NULL; diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index 3c3fe52f84..20cce6de5c 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -47,15 +47,6 @@ G_DEFINE_TYPE (NMSupplicantInterface, nm_supplicant_interface, G_TYPE_OBJECT) NM_TYPE_SUPPLICANT_INTERFACE, \ NMSupplicantInterfacePrivate)) -static void nm_supplicant_interface_start (NMSupplicantInterface *self); - -static void nm_supplicant_interface_add_to_supplicant (NMSupplicantInterface *self, - gboolean get_only); - -static void nm_supplicant_interface_set_state (NMSupplicantInterface *self, - guint32 new_state); - - /* Signals */ enum { STATE, /* change in the interface's state */ @@ -63,7 +54,6 @@ enum { SCANNED_AP, /* interface saw a new access point from a scan */ SCAN_REQ_RESULT, /* result of a wireless scan request */ SCAN_RESULTS, /* scan results returned from supplicant */ - CONNECTION_STATE, /* link state of the device's connection */ CONNECTION_ERROR, /* an error occurred during a connection request */ LAST_SIGNAL }; @@ -74,16 +64,14 @@ static guint signals[LAST_SIGNAL] = { 0 }; enum { PROP_0 = 0, PROP_STATE, - PROP_CONNECTION_STATE, PROP_SCANNING, LAST_PROP }; -typedef struct -{ +typedef struct { NMSupplicantManager * smgr; - gulong smgr_state_sig_handler; + gulong smgr_running_id; NMDBusManager * dbus_mgr; char * dev; gboolean is_wireless; @@ -93,9 +81,9 @@ typedef struct NMCallStore * assoc_pcalls; NMCallStore * other_pcalls; - guint32 con_state; gboolean scanning; + DBusGProxy * wpas_proxy; DBusGProxy * iface_proxy; DBusGProxy * net_proxy; @@ -186,28 +174,6 @@ nm_supplicant_info_destroy (gpointer user_data) } } -static void -try_remove_iface (DBusGConnection *g_connection, - const char *path) -{ - DBusGProxy *proxy; - - g_return_if_fail (g_connection != NULL); - g_return_if_fail (path != NULL); - - proxy = dbus_g_proxy_new_for_name (g_connection, - WPAS_DBUS_SERVICE, - WPAS_DBUS_PATH, - WPAS_DBUS_INTERFACE); - if (!proxy) - return; - - dbus_g_proxy_call_no_reply (proxy, "removeInterface", - DBUS_TYPE_G_OBJECT_PATH, path, - G_TYPE_INVALID); - g_object_unref (proxy); -} - static void emit_error_helper (NMSupplicantInterface *self, GError *err) @@ -344,50 +310,80 @@ wpas_iface_query_scan_results (DBusGProxy *proxy, gpointer user_data) } static guint32 -wpas_state_string_to_enum (const char * str_state) +wpas_state_string_to_enum (const char *str_state) { - guint32 enum_state = NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED; + guint32 enum_state = NM_SUPPLICANT_INTERFACE_STATE_DISCONNECTED; if (!strcmp (str_state, "DISCONNECTED")) - enum_state = NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED; + enum_state = NM_SUPPLICANT_INTERFACE_STATE_DISCONNECTED; else if (!strcmp (str_state, "INACTIVE")) - enum_state = NM_SUPPLICANT_INTERFACE_CON_STATE_INACTIVE; + enum_state = NM_SUPPLICANT_INTERFACE_STATE_INACTIVE; else if (!strcmp (str_state, "SCANNING")) - enum_state = NM_SUPPLICANT_INTERFACE_CON_STATE_SCANNING; + enum_state = NM_SUPPLICANT_INTERFACE_STATE_SCANNING; else if (!strcmp (str_state, "ASSOCIATING")) - enum_state = NM_SUPPLICANT_INTERFACE_CON_STATE_ASSOCIATING; + enum_state = NM_SUPPLICANT_INTERFACE_STATE_ASSOCIATING; else if (!strcmp (str_state, "ASSOCIATED")) - enum_state = NM_SUPPLICANT_INTERFACE_CON_STATE_ASSOCIATED; + enum_state = NM_SUPPLICANT_INTERFACE_STATE_ASSOCIATED; else if (!strcmp (str_state, "4WAY_HANDSHAKE")) - enum_state = NM_SUPPLICANT_INTERFACE_CON_STATE_4WAY_HANDSHAKE; + enum_state = NM_SUPPLICANT_INTERFACE_STATE_4WAY_HANDSHAKE; else if (!strcmp (str_state, "GROUP_HANDSHAKE")) - enum_state = NM_SUPPLICANT_INTERFACE_CON_STATE_GROUP_HANDSHAKE; + enum_state = NM_SUPPLICANT_INTERFACE_STATE_GROUP_HANDSHAKE; else if (!strcmp (str_state, "COMPLETED")) - enum_state = NM_SUPPLICANT_INTERFACE_CON_STATE_COMPLETED; + enum_state = NM_SUPPLICANT_INTERFACE_STATE_COMPLETED; return enum_state; } +static void +set_state (NMSupplicantInterface *self, guint32 new_state) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + guint32 old_state = priv->state; + + g_return_if_fail (new_state < NM_SUPPLICANT_INTERFACE_STATE_LAST); + + if (new_state == priv->state) + return; + + /* DOWN is a terminal state */ + g_return_if_fail (priv->state != NM_SUPPLICANT_INTERFACE_STATE_DOWN); + + /* Cannot regress to READY or INIT from higher states */ + if (priv->state <= NM_SUPPLICANT_INTERFACE_STATE_READY) + g_return_if_fail (new_state > priv->state); + + if (new_state == NM_SUPPLICANT_INTERFACE_STATE_DOWN) { + /* Cancel all pending calls when going down */ + cancel_all_callbacks (priv->other_pcalls); + cancel_all_callbacks (priv->assoc_pcalls); + + /* Disconnect supplicant manager state listeners since we're done */ + if (priv->smgr_running_id) { + g_signal_handler_disconnect (priv->smgr, priv->smgr_running_id); + priv->smgr_running_id = 0; + } + } + + priv->state = new_state; + g_signal_emit (self, signals[STATE], 0, priv->state, old_state); +} + +/* Supplicant state signal handler */ static void wpas_iface_handle_state_change (DBusGProxy *proxy, const char *str_new_state, const char *str_old_state, gpointer user_data) { - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (user_data); - guint32 old_state, enum_new_state; - - enum_new_state = wpas_state_string_to_enum (str_new_state); - old_state = priv->con_state; - priv->con_state = enum_new_state; - if (priv->con_state != old_state) - g_signal_emit (user_data, signals[CONNECTION_STATE], 0, priv->con_state, old_state); + set_state (NM_SUPPLICANT_INTERFACE (user_data), + wpas_state_string_to_enum (str_new_state)); } - +/* Explicit state request reply handler */ static void iface_state_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { + NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; GError *err = NULL; char *state_str = NULL; @@ -397,12 +393,8 @@ iface_state_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) nm_log_warn (LOGD_SUPPLICANT, "could not get interface state: %s.", err->message); g_error_free (err); } else { - NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); - - priv->con_state = wpas_state_string_to_enum (state_str); + set_state (info->interface, wpas_state_string_to_enum (state_str)); g_free (state_str); - nm_supplicant_interface_set_state (info->interface, NM_SUPPLICANT_INTERFACE_STATE_READY); } } @@ -479,225 +471,181 @@ nm_supplicant_interface_get_scanning (NMSupplicantInterface *self) priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); if (priv->scanning) return TRUE; - if (priv->con_state == NM_SUPPLICANT_INTERFACE_CON_STATE_SCANNING) + if (priv->state == NM_SUPPLICANT_INTERFACE_STATE_SCANNING) return TRUE; return FALSE; } static void -nm_supplicant_interface_add_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +interface_add_done (NMSupplicantInterface *self, char *path) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + + nm_log_dbg (LOGD_SUPPLICANT, "(%s): interface added to supplicant", priv->dev); + + priv->object_path = path; + + priv->iface_proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr), + WPAS_DBUS_SERVICE, + path, + WPAS_DBUS_IFACE_INTERFACE); + + dbus_g_object_register_marshaller (_nm_marshal_VOID__STRING_STRING, + G_TYPE_NONE, + G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_add_signal (priv->iface_proxy, "StateChange", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->iface_proxy, "StateChange", + G_CALLBACK (wpas_iface_handle_state_change), + self, + NULL); + + dbus_g_proxy_add_signal (priv->iface_proxy, "ScanResultsAvailable", G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->iface_proxy, "ScanResultsAvailable", + G_CALLBACK (wpas_iface_query_scan_results), + self, + NULL); + + dbus_g_proxy_add_signal (priv->iface_proxy, "Scanning", G_TYPE_BOOLEAN, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->iface_proxy, "Scanning", + G_CALLBACK (wpas_iface_handle_scanning), + self, + NULL); + + /* Interface added to the supplicant; get its initial state. */ + wpas_iface_get_state (self); + wpas_iface_get_scanning (self); + + set_state (self, NM_SUPPLICANT_INTERFACE_STATE_READY); +} + +static void +interface_get_cb (DBusGProxy *proxy, + DBusGProxyCall *call_id, + gpointer user_data) { NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); - GError *err = NULL; + GError *error = NULL; char *path = NULL; - if (!dbus_g_proxy_end_call (proxy, call_id, &err, - DBUS_TYPE_G_OBJECT_PATH, &path, - G_TYPE_INVALID)) { - - if (dbus_g_error_has_name (err, WPAS_ERROR_INVALID_IFACE)) { - /* Interface not added, try to add it */ - nm_supplicant_interface_add_to_supplicant (info->interface, FALSE); - } else if (dbus_g_error_has_name (err, WPAS_ERROR_EXISTS_ERROR)) { - /* Interface already added, just try to get the interface */ - nm_supplicant_interface_add_to_supplicant (info->interface, TRUE); - } else { - nm_log_err (LOGD_SUPPLICANT, "(%s): error getting interface: %s", - priv->dev, err->message); - } - - g_error_free (err); + if (dbus_g_proxy_end_call (proxy, call_id, &error, + DBUS_TYPE_G_OBJECT_PATH, &path, + G_TYPE_INVALID)) { + interface_add_done (info->interface, path); } else { - nm_log_dbg (LOGD_SUPPLICANT, "(%s): interface added to supplicant", priv->dev); - - priv->object_path = path; - - priv->iface_proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr), - WPAS_DBUS_SERVICE, - path, - WPAS_DBUS_IFACE_INTERFACE); - - dbus_g_proxy_add_signal (priv->iface_proxy, "ScanResultsAvailable", G_TYPE_INVALID); - - dbus_g_object_register_marshaller (_nm_marshal_VOID__STRING_STRING, - G_TYPE_NONE, - G_TYPE_STRING, G_TYPE_STRING, - G_TYPE_INVALID); - - dbus_g_proxy_add_signal (priv->iface_proxy, "StateChange", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - - dbus_g_proxy_connect_signal (priv->iface_proxy, "ScanResultsAvailable", - G_CALLBACK (wpas_iface_query_scan_results), - info->interface, - NULL); - - dbus_g_proxy_connect_signal (priv->iface_proxy, "StateChange", - G_CALLBACK (wpas_iface_handle_state_change), - info->interface, - NULL); - - dbus_g_proxy_add_signal (priv->iface_proxy, "Scanning", G_TYPE_BOOLEAN, G_TYPE_INVALID); - - dbus_g_proxy_connect_signal (priv->iface_proxy, "Scanning", - G_CALLBACK (wpas_iface_handle_scanning), - info->interface, - NULL); - - /* Interface added to the supplicant; get its initial state. */ - wpas_iface_get_state (info->interface); - wpas_iface_get_scanning (info->interface); + nm_log_err (LOGD_SUPPLICANT, "(%s): error adding interface: %s", + priv->dev, error->message); + g_clear_error (&error); } } static void -nm_supplicant_interface_add_to_supplicant (NMSupplicantInterface * self, - gboolean get_only) +interface_get (NMSupplicantInterface *self) { NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); NMSupplicantInfo *info; - DBusGProxy *proxy; DBusGProxyCall *call; - proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr), - WPAS_DBUS_SERVICE, - WPAS_DBUS_PATH, - WPAS_DBUS_INTERFACE); - info = nm_supplicant_info_new (self, proxy, priv->other_pcalls); - - if (get_only) { - call = dbus_g_proxy_begin_call (proxy, "getInterface", - nm_supplicant_interface_add_cb, - info, - nm_supplicant_info_destroy, - G_TYPE_STRING, priv->dev, - G_TYPE_INVALID); - } else { - GHashTable *hash = g_hash_table_new (g_str_hash, g_str_equal); - GValue *driver; - - driver = g_new0 (GValue, 1); - g_value_init (driver, G_TYPE_STRING); - g_value_set_string (driver, priv->is_wireless ? "wext" : "wired"); - g_hash_table_insert (hash, "driver", driver); + info = nm_supplicant_info_new (self, priv->wpas_proxy, priv->other_pcalls); + call = dbus_g_proxy_begin_call (priv->wpas_proxy, "getInterface", + interface_get_cb, + info, + nm_supplicant_info_destroy, + G_TYPE_STRING, priv->dev, + G_TYPE_INVALID); + nm_supplicant_info_set_call (info, call); +} - call = dbus_g_proxy_begin_call (proxy, "addInterface", - nm_supplicant_interface_add_cb, - info, - nm_supplicant_info_destroy, - G_TYPE_STRING, priv->dev, - DBUS_TYPE_G_MAP_OF_VARIANT, hash, - G_TYPE_INVALID); +static void +interface_add_cb (DBusGProxy *proxy, + DBusGProxyCall *call_id, + gpointer user_data) +{ + NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); + GError *error = NULL; + char *path = NULL; - g_value_unset (driver); - g_free (driver); - g_hash_table_destroy (hash); + if (dbus_g_proxy_end_call (proxy, call_id, &error, + DBUS_TYPE_G_OBJECT_PATH, &path, + G_TYPE_INVALID)) { + interface_add_done (info->interface, path); + } else { + if (dbus_g_error_has_name (error, WPAS_ERROR_EXISTS_ERROR)) { + /* Interface already added, just get its object path */ + interface_get (info->interface); + } else { + nm_log_err (LOGD_SUPPLICANT, "(%s): error adding interface: %s", + priv->dev, error->message); + } + g_clear_error (&error); } - - g_object_unref (proxy); - - nm_supplicant_info_set_call (info, call); } static void -nm_supplicant_interface_start (NMSupplicantInterface * self) +interface_add (NMSupplicantInterface * self, gboolean is_wireless) { NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); - guint32 state; + DBusGProxyCall *call; + NMSupplicantInfo *info; + GHashTable *hash; + GValue *driver; /* Can only start the interface from INIT state */ g_return_if_fail (priv->state == NM_SUPPLICANT_INTERFACE_STATE_INIT); nm_log_dbg (LOGD_SUPPLICANT, "(%s): adding interface to supplicant", priv->dev); - state = nm_supplicant_manager_get_state (priv->smgr); - if (state == NM_SUPPLICANT_MANAGER_STATE_IDLE) { - nm_supplicant_interface_set_state (self, NM_SUPPLICANT_INTERFACE_STATE_STARTING); - nm_supplicant_interface_add_to_supplicant (self, FALSE); - } else if (state == NM_SUPPLICANT_MANAGER_STATE_DOWN) { - /* Don't do anything; wait for signal from supplicant manager - * that its state has changed. - */ - } else - nm_log_warn (LOGD_SUPPLICANT, "Unknown supplicant manager state!"); -} - -static void -nm_supplicant_interface_handle_supplicant_manager_idle_state (NMSupplicantInterface * self) -{ - switch (NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->state) { - case NM_SUPPLICANT_INTERFACE_STATE_INIT: - /* Move to STARTING state when supplicant is ready */ - nm_supplicant_interface_start (self); - break; - case NM_SUPPLICANT_INTERFACE_STATE_STARTING: - /* Don't do anything here, though we should never hit this */ - break; - case NM_SUPPLICANT_INTERFACE_STATE_READY: - /* Don't do anything here, though we should never hit this */ - break; - case NM_SUPPLICANT_INTERFACE_STATE_DOWN: - /* Don't do anything here; interface can't get out of DOWN state */ - break; - default: - nm_log_warn (LOGD_SUPPLICANT, "Unknown supplicant interface state!"); - break; - } -} + /* Try to add the interface to the supplicant. If the supplicant isn't + * running, this will start it via D-Bus activation and return the response + * when the supplicant has started. + */ + info = nm_supplicant_info_new (self, priv->wpas_proxy, priv->other_pcalls); -static void -nm_supplicant_interface_set_state (NMSupplicantInterface * self, - guint32 new_state) -{ - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); - guint32 old_state; + driver = g_new0 (GValue, 1); + g_value_init (driver, G_TYPE_STRING); + g_value_set_string (driver, is_wireless ? "wext" : "wired"); - g_return_if_fail (new_state < NM_SUPPLICANT_INTERFACE_STATE_LAST); + hash = g_hash_table_new (g_str_hash, g_str_equal); + g_hash_table_insert (hash, "driver", driver); - if (new_state == priv->state) - return; + call = dbus_g_proxy_begin_call (priv->wpas_proxy, "addInterface", + interface_add_cb, + info, + nm_supplicant_info_destroy, + G_TYPE_STRING, priv->dev, + DBUS_TYPE_G_MAP_OF_VARIANT, hash, + G_TYPE_INVALID); - old_state = priv->state; - if (new_state == NM_SUPPLICANT_INTERFACE_STATE_DOWN) { - /* If the interface is transitioning to DOWN and there's are - * in-progress pending calls, cancel them. - */ - cancel_all_callbacks (priv->other_pcalls); - cancel_all_callbacks (priv->assoc_pcalls); - } + g_hash_table_destroy (hash); + g_value_unset (driver); + g_free (driver); - priv->state = new_state; - g_signal_emit (self, signals[STATE], 0, priv->state, old_state); + nm_supplicant_info_set_call (info, call); } static void -smgr_state_changed (NMSupplicantManager *smgr, - guint32 new_state, - guint32 old_state, - gpointer user_data) +smgr_running_cb (NMSupplicantManager *smgr, + GParamSpec *pspec, + gpointer user_data) { - NMSupplicantInterface * self = NM_SUPPLICANT_INTERFACE (user_data); - - switch (new_state) { - case NM_SUPPLICANT_MANAGER_STATE_DOWN: - /* The supplicant went away, likely the connection to it is also - * gone. Therefore, this interface must move to the DOWN state - * and be disposed of. - */ - nm_supplicant_interface_set_state (self, NM_SUPPLICANT_INTERFACE_STATE_DOWN); - break; - case NM_SUPPLICANT_MANAGER_STATE_IDLE: - /* Handle the supplicant now being available. */ - nm_supplicant_interface_handle_supplicant_manager_idle_state (self); - break; - default: - nm_log_warn (LOGD_SUPPLICANT, "Unknown supplicant manager state!"); - break; + NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data); + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (user_data); + + if (nm_supplicant_manager_running (smgr)) { + /* This can happen if the supplicant couldn't be activated but + * for some reason was started after the activation failure. + */ + if (priv->state == NM_SUPPLICANT_INTERFACE_STATE_INIT) + interface_add (self, priv->is_wireless); + } else { + /* The supplicant stopped; so we must tear down the interface */ + set_state (self, NM_SUPPLICANT_INTERFACE_STATE_DOWN); } } - static void remove_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { @@ -742,16 +690,13 @@ nm_supplicant_interface_disconnect (NMSupplicantInterface * self) if (!priv->iface_proxy) return; - /* Don't try to disconnect if the supplicant interface is already - * disconnected. - */ - if (priv->con_state == NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED - || priv->con_state == NM_SUPPLICANT_INTERFACE_CON_STATE_INACTIVE) { + /* Don't try to disconnect if the supplicant interface is already disconnected */ + if ( priv->state == NM_SUPPLICANT_INTERFACE_STATE_DISCONNECTED + || priv->state == NM_SUPPLICANT_INTERFACE_STATE_INACTIVE) { if (priv->net_proxy) { g_object_unref (priv->net_proxy); priv->net_proxy = NULL; } - return; } @@ -1011,14 +956,6 @@ nm_supplicant_interface_set_config (NMSupplicantInterface * self, return call != NULL; } -const char * -nm_supplicant_interface_get_device (NMSupplicantInterface * self) -{ - g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), NULL); - - return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->dev; -} - static void scan_request_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { @@ -1067,62 +1004,61 @@ nm_supplicant_interface_get_state (NMSupplicantInterface * self) return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->state; } -guint32 -nm_supplicant_interface_get_connection_state (NMSupplicantInterface * self) -{ - g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED); - - return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->con_state; -} - const char * nm_supplicant_interface_state_to_string (guint32 state) { switch (state) { case NM_SUPPLICANT_INTERFACE_STATE_INIT: return "init"; - case NM_SUPPLICANT_INTERFACE_STATE_STARTING: - return "starting"; case NM_SUPPLICANT_INTERFACE_STATE_READY: return "ready"; - case NM_SUPPLICANT_INTERFACE_STATE_DOWN: - return "down"; - default: - break; - } - return "unknown"; -} - -const char * -nm_supplicant_interface_connection_state_to_string (guint32 state) -{ - switch (state) { - case NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED: + case NM_SUPPLICANT_INTERFACE_STATE_DISCONNECTED: return "disconnected"; - case NM_SUPPLICANT_INTERFACE_CON_STATE_INACTIVE: + case NM_SUPPLICANT_INTERFACE_STATE_INACTIVE: return "inactive"; - case NM_SUPPLICANT_INTERFACE_CON_STATE_SCANNING: + case NM_SUPPLICANT_INTERFACE_STATE_SCANNING: return "scanning"; - case NM_SUPPLICANT_INTERFACE_CON_STATE_ASSOCIATING: + case NM_SUPPLICANT_INTERFACE_STATE_ASSOCIATING: return "associating"; - case NM_SUPPLICANT_INTERFACE_CON_STATE_ASSOCIATED: + case NM_SUPPLICANT_INTERFACE_STATE_ASSOCIATED: return "associated"; - case NM_SUPPLICANT_INTERFACE_CON_STATE_4WAY_HANDSHAKE: + case NM_SUPPLICANT_INTERFACE_STATE_4WAY_HANDSHAKE: return "4-way handshake"; - case NM_SUPPLICANT_INTERFACE_CON_STATE_GROUP_HANDSHAKE: + case NM_SUPPLICANT_INTERFACE_STATE_GROUP_HANDSHAKE: return "group handshake"; - case NM_SUPPLICANT_INTERFACE_CON_STATE_COMPLETED: + case NM_SUPPLICANT_INTERFACE_STATE_COMPLETED: return "completed"; + case NM_SUPPLICANT_INTERFACE_STATE_DOWN: + return "down"; default: break; } return "unknown"; } +const char * +nm_supplicant_interface_get_device (NMSupplicantInterface * self) +{ + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), NULL); + + return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->dev; +} + +const char * +nm_supplicant_interface_get_object_path (NMSupplicantInterface *self) +{ + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), NULL); + + return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->object_path; +} + const char * nm_supplicant_interface_get_ifname (NMSupplicantInterface *self) { g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), FALSE); return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->dev; } @@ -1147,14 +1083,15 @@ nm_supplicant_interface_new (NMSupplicantManager *smgr, priv->smgr = g_object_ref (smgr); id = g_signal_connect (priv->smgr, - "state", - G_CALLBACK (smgr_state_changed), + "notify::" NM_SUPPLICANT_MANAGER_RUNNING, + G_CALLBACK (smgr_running_cb), self); - priv->smgr_state_sig_handler = id; + priv->smgr_running_id = id; priv->dev = g_strdup (ifname); priv->is_wireless = is_wireless; - nm_supplicant_interface_start (self); + + interface_add (self, priv->is_wireless); } return self; @@ -1164,12 +1101,18 @@ static void nm_supplicant_interface_init (NMSupplicantInterface * self) { NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + DBusGConnection *bus; priv->state = NM_SUPPLICANT_INTERFACE_STATE_INIT; - priv->con_state = NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED; priv->assoc_pcalls = nm_call_store_new (); priv->other_pcalls = nm_call_store_new (); priv->dbus_mgr = nm_dbus_manager_get (); + + bus = nm_dbus_manager_get_connection (priv->dbus_mgr); + priv->wpas_proxy = dbus_g_proxy_new_for_name (bus, + WPAS_DBUS_SERVICE, + WPAS_DBUS_PATH, + WPAS_DBUS_INTERFACE); } static void @@ -1195,9 +1138,6 @@ get_property (GObject *object, case PROP_STATE: g_value_set_uint (value, NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object)->state); break; - case PROP_CONNECTION_STATE: - g_value_set_uint (value, NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object)->con_state); - break; case PROP_SCANNING: g_value_set_boolean (value, NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object)->scanning); break; @@ -1211,7 +1151,6 @@ static void dispose (GObject *object) { NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object); - guint32 sm_state; if (priv->disposed) { G_OBJECT_CLASS (nm_supplicant_interface_parent_class)->dispose (object); @@ -1219,27 +1158,21 @@ dispose (GObject *object) } priv->disposed = TRUE; - /* Ask wpa_supplicant to remove this interface */ - sm_state = nm_supplicant_manager_get_state (priv->smgr); - if (sm_state == NM_SUPPLICANT_MANAGER_STATE_IDLE) { - if (priv->object_path) { - try_remove_iface (nm_dbus_manager_get_connection (priv->dbus_mgr), - priv->object_path); - } - } - if (priv->iface_proxy) g_object_unref (priv->iface_proxy); if (priv->net_proxy) g_object_unref (priv->net_proxy); + if (priv->wpas_proxy) + g_object_unref (priv->wpas_proxy); + if (priv->scan_results_timeout) g_source_remove (priv->scan_results_timeout); if (priv->smgr) { - g_signal_handler_disconnect (priv->smgr, - priv->smgr_state_sig_handler); + if (priv->smgr_running_id) + g_signal_handler_disconnect (priv->smgr, priv->smgr_running_id); g_object_unref (priv->smgr); } @@ -1338,15 +1271,6 @@ nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass) g_cclosure_marshal_VOID__UINT, G_TYPE_NONE, 1, G_TYPE_UINT); - signals[CONNECTION_STATE] = - g_signal_new ("connection-state", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, connection_state), - NULL, NULL, - _nm_marshal_VOID__UINT_UINT, - G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); - signals[CONNECTION_ERROR] = g_signal_new ("connection-error", G_OBJECT_CLASS_TYPE (object_class), diff --git a/src/supplicant-manager/nm-supplicant-interface.h b/src/supplicant-manager/nm-supplicant-interface.h index 3e56f4efaf..d6e4a55969 100644 --- a/src/supplicant-manager/nm-supplicant-interface.h +++ b/src/supplicant-manager/nm-supplicant-interface.h @@ -26,47 +26,25 @@ #include #include "nm-supplicant-types.h" -G_BEGIN_DECLS - /* * Supplicant interface states - * The states are linear, ie INIT -> READY -> DOWN and state may only be - * changed in one direction. If an interface reaches the DOWN state, it - * cannot be re-initialized; it must be torn down and a new one created. - * - * INIT: interface has been created, but cannot be used yet; it is waiting - * for pending requests of the supplicant to complete. - * READY: interface is ready for use - * DOWN: interface has been removed or has otherwise been made invalid; it - * must be torn down. - * - * Note: LAST is an invalid state and only used for boundary checking. + * A mix of wpa_supplicant interface states and internal states. */ enum { NM_SUPPLICANT_INTERFACE_STATE_INIT = 0, - NM_SUPPLICANT_INTERFACE_STATE_STARTING, NM_SUPPLICANT_INTERFACE_STATE_READY, + NM_SUPPLICANT_INTERFACE_STATE_DISCONNECTED, + NM_SUPPLICANT_INTERFACE_STATE_INACTIVE, + NM_SUPPLICANT_INTERFACE_STATE_SCANNING, + NM_SUPPLICANT_INTERFACE_STATE_ASSOCIATING, + NM_SUPPLICANT_INTERFACE_STATE_ASSOCIATED, + NM_SUPPLICANT_INTERFACE_STATE_4WAY_HANDSHAKE, + NM_SUPPLICANT_INTERFACE_STATE_GROUP_HANDSHAKE, + NM_SUPPLICANT_INTERFACE_STATE_COMPLETED, NM_SUPPLICANT_INTERFACE_STATE_DOWN, NM_SUPPLICANT_INTERFACE_STATE_LAST }; - -/* - * Supplicant interface connection states - * The wpa_supplicant state for the connection. - */ -enum { - NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED = 0, - NM_SUPPLICANT_INTERFACE_CON_STATE_INACTIVE, - NM_SUPPLICANT_INTERFACE_CON_STATE_SCANNING, - NM_SUPPLICANT_INTERFACE_CON_STATE_ASSOCIATING, - NM_SUPPLICANT_INTERFACE_CON_STATE_ASSOCIATED, - NM_SUPPLICANT_INTERFACE_CON_STATE_4WAY_HANDSHAKE, - NM_SUPPLICANT_INTERFACE_CON_STATE_GROUP_HANDSHAKE, - NM_SUPPLICANT_INTERFACE_CON_STATE_COMPLETED, - NM_SUPPLICANT_INTERFACE_CON_STATE_LAST -}; - #define NM_TYPE_SUPPLICANT_INTERFACE (nm_supplicant_interface_get_type ()) #define NM_SUPPLICANT_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SUPPLICANT_INTERFACE, NMSupplicantInterface)) #define NM_SUPPLICANT_INTERFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SUPPLICANT_INTERFACE, NMSupplicantInterfaceClass)) @@ -103,11 +81,6 @@ typedef struct { void (*scan_results) (NMSupplicantInterface * iface, guint num_bssids); - /* link state of the device's connection */ - void (*connection_state) (NMSupplicantInterface * iface, - guint32 new_state, - guint32 old_state); - /* an error occurred during a connection request */ void (*connection_error) (NMSupplicantInterface * iface, const char * name, @@ -128,20 +101,16 @@ void nm_supplicant_interface_disconnect (NMSupplicantInterface * iface); const char * nm_supplicant_interface_get_device (NMSupplicantInterface * iface); +const char *nm_supplicant_interface_get_object_path (NMSupplicantInterface * iface); + gboolean nm_supplicant_interface_request_scan (NMSupplicantInterface * self); guint32 nm_supplicant_interface_get_state (NMSupplicantInterface * self); -guint32 nm_supplicant_interface_get_connection_state (NMSupplicantInterface * self); - const char *nm_supplicant_interface_state_to_string (guint32 state); -const char *nm_supplicant_interface_connection_state_to_string (guint32 state); - gboolean nm_supplicant_interface_get_scanning (NMSupplicantInterface *self); const char *nm_supplicant_interface_get_ifname (NMSupplicantInterface *self); -G_END_DECLS - #endif /* NM_SUPPLICANT_INTERFACE_H */ diff --git a/src/supplicant-manager/nm-supplicant-manager.c b/src/supplicant-manager/nm-supplicant-manager.c index 56a5e58d63..c139ec6fef 100644 --- a/src/supplicant-manager/nm-supplicant-manager.c +++ b/src/supplicant-manager/nm-supplicant-manager.c @@ -26,19 +26,7 @@ #include "nm-supplicant-manager.h" #include "nm-supplicant-interface.h" #include "nm-dbus-manager.h" -#include "nm-marshal.h" #include "nm-logging.h" -#include "nm-glib-compat.h" - -#define SUPPLICANT_POKE_INTERVAL 120 - -typedef struct { - NMDBusManager * dbus_mgr; - guint32 state; - GHashTable * ifaces; - gboolean disposed; - guint poke_id; -} NMSupplicantManagerPrivate; #define NM_SUPPLICANT_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ NM_TYPE_SUPPLICANT_MANAGER, \ @@ -46,84 +34,26 @@ typedef struct { G_DEFINE_TYPE (NMSupplicantManager, nm_supplicant_manager, G_TYPE_OBJECT) -/* Signals */ +/* Properties */ enum { - STATE, /* change in the manager's state */ - LAST_SIGNAL + PROP_0 = 0, + PROP_RUNNING, + LAST_PROP }; -static guint signals[LAST_SIGNAL] = { 0 }; - -/********************************************************************/ - -static gboolean -poke_supplicant_cb (gpointer user_data) -{ - NMSupplicantManager *self = NM_SUPPLICANT_MANAGER (user_data); - NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); - DBusGConnection *g_connection; - DBusGProxy *proxy; - const char *tmp = "ignoreme"; - - g_connection = nm_dbus_manager_get_connection (priv->dbus_mgr); - proxy = dbus_g_proxy_new_for_name (g_connection, - WPAS_DBUS_SERVICE, - WPAS_DBUS_PATH, - WPAS_DBUS_INTERFACE); - if (!proxy) { - nm_log_warn (LOGD_SUPPLICANT, "Error: could not init wpa_supplicant proxy"); - goto out; - } - nm_log_info (LOGD_SUPPLICANT, "Trying to start the supplicant..."); - dbus_g_proxy_call_no_reply (proxy, "getInterface", G_TYPE_STRING, tmp, G_TYPE_INVALID); - g_object_unref (proxy); - -out: - /* Reschedule the poke */ - priv->poke_id = g_timeout_add_seconds (SUPPLICANT_POKE_INTERVAL, - poke_supplicant_cb, - (gpointer) self); - - return FALSE; -} - -guint32 -nm_supplicant_manager_get_state (NMSupplicantManager * self) -{ - g_return_val_if_fail (NM_IS_SUPPLICANT_MANAGER (self), FALSE); - - return NM_SUPPLICANT_MANAGER_GET_PRIVATE (self)->state; -} - -static void -set_state (NMSupplicantManager *self, guint32 new_state) -{ - NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); - guint32 old_state; - - if (new_state != priv->state) { - old_state = priv->state; - priv->state = new_state; - g_signal_emit (self, signals[STATE], 0, priv->state, old_state); - } -} - -static gboolean -startup (NMSupplicantManager * self) -{ - gboolean running; - - /* FIXME: convert to pending call */ - running = nm_dbus_manager_name_has_owner (NM_SUPPLICANT_MANAGER_GET_PRIVATE (self)->dbus_mgr, - WPAS_DBUS_SERVICE); - if (running) - set_state (self, NM_SUPPLICANT_MANAGER_STATE_IDLE); +typedef struct { + NMDBusManager * dbus_mgr; + guint name_owner_id; + DBusGProxy * proxy; + gboolean running; + GHashTable * ifaces; + gboolean disposed; +} NMSupplicantManagerPrivate; - return running; -} +/********************************************************************/ NMSupplicantInterface * -nm_supplicant_manager_get_iface (NMSupplicantManager * self, +nm_supplicant_manager_iface_get (NMSupplicantManager * self, const char *ifname, gboolean is_wireless) { @@ -149,34 +79,37 @@ nm_supplicant_manager_get_iface (NMSupplicantManager * self, } void -nm_supplicant_manager_release_iface (NMSupplicantManager *self, +nm_supplicant_manager_iface_release (NMSupplicantManager *self, NMSupplicantInterface *iface) { NMSupplicantManagerPrivate *priv; - const char *ifname; + const char *ifname, *op; g_return_if_fail (NM_IS_SUPPLICANT_MANAGER (self)); g_return_if_fail (NM_IS_SUPPLICANT_INTERFACE (iface)); priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); + /* Ask wpa_supplicant to remove this interface */ + op = nm_supplicant_interface_get_object_path (iface); + if (priv->running && priv->proxy && op) { + dbus_g_proxy_call_no_reply (priv->proxy, "removeInterface", + DBUS_TYPE_G_OBJECT_PATH, op, + G_TYPE_INVALID); + } + ifname = nm_supplicant_interface_get_ifname (iface); g_assert (ifname); g_hash_table_remove (priv->ifaces, ifname); } -const char * -nm_supplicant_manager_state_to_string (guint32 state) +gboolean +nm_supplicant_manager_running (NMSupplicantManager *self) { - switch (state) { - case NM_SUPPLICANT_MANAGER_STATE_DOWN: - return "down"; - case NM_SUPPLICANT_MANAGER_STATE_IDLE: - return "idle"; - default: - break; - } - return "unknown"; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_SUPPLICANT_MANAGER (self), FALSE); + + return NM_SUPPLICANT_MANAGER_GET_PRIVATE (self)->running; } static void @@ -186,34 +119,23 @@ name_owner_changed (NMDBusManager *dbus_mgr, const char *new_owner, gpointer user_data) { - NMSupplicantManager * self = (NMSupplicantManager *) user_data; + NMSupplicantManager *self = NM_SUPPLICANT_MANAGER (user_data); NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); gboolean old_owner_good = (old_owner && strlen (old_owner)); gboolean new_owner_good = (new_owner && strlen (new_owner)); - /* Can't handle the signal if its not from the supplicant service */ + /* We only care about the supplicant here */ if (strcmp (WPAS_DBUS_SERVICE, name) != 0) return; if (!old_owner_good && new_owner_good) { - gboolean running; - - running = startup (self); - - if (running && priv->poke_id) { - g_source_remove (priv->poke_id); - priv->poke_id = 0; - } + nm_log_info (LOGD_SUPPLICANT, "wpa_supplicant started"); + priv->running = TRUE; + g_object_notify (G_OBJECT (self), NM_SUPPLICANT_MANAGER_RUNNING); } else if (old_owner_good && !new_owner_good) { - set_state (self, NM_SUPPLICANT_MANAGER_STATE_DOWN); - - if (priv->poke_id) - g_source_remove (priv->poke_id); - - /* Poke the supplicant so that it gets activated by dbus system bus - * activation. - */ - priv->poke_id = g_idle_add (poke_supplicant_cb, (gpointer) self); + nm_log_info (LOGD_SUPPLICANT, "wpa_supplicant stopped"); + priv->running = FALSE; + g_object_notify (G_OBJECT (self), NM_SUPPLICANT_MANAGER_RUNNING); } } @@ -237,24 +159,40 @@ static void nm_supplicant_manager_init (NMSupplicantManager * self) { NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); - gboolean running; + DBusGConnection *bus; - priv->state = NM_SUPPLICANT_MANAGER_STATE_DOWN; priv->dbus_mgr = nm_dbus_manager_get (); - priv->poke_id = 0; + priv->name_owner_id = g_signal_connect (priv->dbus_mgr, + "name-owner-changed", + G_CALLBACK (name_owner_changed), + self); + priv->running = nm_dbus_manager_name_has_owner (priv->dbus_mgr, WPAS_DBUS_SERVICE); + + bus = nm_dbus_manager_get_connection (priv->dbus_mgr); + priv->proxy = dbus_g_proxy_new_for_name (bus, + WPAS_DBUS_SERVICE, + WPAS_DBUS_PATH, + WPAS_DBUS_INTERFACE); priv->ifaces = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); +} - running = startup (self); - - g_signal_connect (priv->dbus_mgr, - "name-owner-changed", - G_CALLBACK (name_owner_changed), - self); +static void +set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +{ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); +} - if (!running) { - /* Try to activate the supplicant */ - priv->poke_id = g_idle_add (poke_supplicant_cb, (gpointer) self); +static void +get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +{ + switch (prop_id) { + case PROP_RUNNING: + g_value_set_boolean (value, NM_SUPPLICANT_MANAGER_GET_PRIVATE (object)->running); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; } } @@ -263,22 +201,22 @@ dispose (GObject *object) { NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (object); - if (priv->disposed) { - G_OBJECT_CLASS (nm_supplicant_manager_parent_class)->dispose (object); - return; - } + if (priv->disposed) + goto out; priv->disposed = TRUE; - if (priv->poke_id) { - g_source_remove (priv->poke_id); - priv->poke_id = 0; - } - if (priv->dbus_mgr) { + if (priv->name_owner_id) + g_signal_handler_disconnect (priv->dbus_mgr, priv->name_owner_id); g_object_unref (G_OBJECT (priv->dbus_mgr)); - priv->dbus_mgr = NULL; } + g_hash_table_destroy (priv->ifaces); + + if (priv->proxy) + g_object_unref (priv->proxy); + +out: /* Chain up to the parent class */ G_OBJECT_CLASS (nm_supplicant_manager_parent_class)->dispose (object); } @@ -286,19 +224,19 @@ dispose (GObject *object) static void nm_supplicant_manager_class_init (NMSupplicantManagerClass *klass) { - GObjectClass * object_class = G_OBJECT_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (object_class, sizeof (NMSupplicantManagerPrivate)); + object_class->get_property = get_property; + object_class->set_property = set_property; object_class->dispose = dispose; - /* Signals */ - signals[STATE] = g_signal_new ("state", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantManagerClass, state), - NULL, NULL, - _nm_marshal_VOID__UINT_UINT, - G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); + g_object_class_install_property (object_class, PROP_RUNNING, + g_param_spec_boolean (NM_SUPPLICANT_MANAGER_RUNNING, + "Running", + "Running", + FALSE, + G_PARAM_READABLE)); } diff --git a/src/supplicant-manager/nm-supplicant-manager.h b/src/supplicant-manager/nm-supplicant-manager.h index fef2a77444..ca3b643f57 100644 --- a/src/supplicant-manager/nm-supplicant-manager.h +++ b/src/supplicant-manager/nm-supplicant-manager.h @@ -33,23 +33,6 @@ G_BEGIN_DECLS -/* - * Supplicant manager states - * Either state may transition to the other state at any time. - * - * DOWN: supplicant manager has been created, but cannot be used; the supplicant - * is either not running or has not yet been fully initialized. - * IDLE: supplicant manager is ready for use - * - * Note: LAST is an invalid state and only used for boundary checking. - */ -enum { - NM_SUPPLICANT_MANAGER_STATE_DOWN = 0, - NM_SUPPLICANT_MANAGER_STATE_IDLE, - NM_SUPPLICANT_MANAGER_STATE_LAST -}; - - #define NM_TYPE_SUPPLICANT_MANAGER (nm_supplicant_manager_get_type ()) #define NM_SUPPLICANT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SUPPLICANT_MANAGER, NMSupplicantManager)) #define NM_SUPPLICANT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SUPPLICANT_MANAGER, NMSupplicantManagerClass)) @@ -57,6 +40,8 @@ enum { #define NM_IS_SUPPLICANT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SUPPLICANT_MANAGER)) #define NM_SUPPLICANT_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SUPPLICANT_MANAGER, NMSupplicantManagerClass)) +#define NM_SUPPLICANT_MANAGER_RUNNING "running" + struct _NMSupplicantManager { GObject parent; @@ -65,24 +50,19 @@ struct _NMSupplicantManager typedef struct { GObjectClass parent; - - /* class members */ - void (* state) (NMSupplicantManager * mgr, guint32 new_state, guint32 old_state); } NMSupplicantManagerClass; GType nm_supplicant_manager_get_type (void); -NMSupplicantManager * nm_supplicant_manager_get (void); - -guint32 nm_supplicant_manager_get_state (NMSupplicantManager * mgr); +NMSupplicantManager *nm_supplicant_manager_get (void); -NMSupplicantInterface * nm_supplicant_manager_get_iface (NMSupplicantManager * mgr, - const char *ifname, - gboolean is_wireless); +NMSupplicantInterface *nm_supplicant_manager_iface_get (NMSupplicantManager *mgr, + const char *ifname, + gboolean is_wireless); -void nm_supplicant_manager_release_iface (NMSupplicantManager * mgr, - NMSupplicantInterface * iface); +void nm_supplicant_manager_iface_release (NMSupplicantManager *mgr, + NMSupplicantInterface *iface); -const char *nm_supplicant_manager_state_to_string (guint32 state); +gboolean nm_supplicant_manager_running (NMSupplicantManager *mgr); #endif /* NM_SUPPLICANT_MANAGER_H */ -- cgit v1.2.1 From 516ea8bf12a60db58ce7fe20bfae9b5b70af4172 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 6 Oct 2010 15:43:41 -0500 Subject: wifi: simplify supplicant interface signal handling --- src/nm-device-wifi.c | 52 +++++++++++++++++----------------------------------- 1 file changed, 17 insertions(+), 35 deletions(-) diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 44d5a12754..49529708b2 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -113,17 +113,14 @@ typedef enum { #define NM_WIFI_ERROR (nm_wifi_error_quark ()) #define NM_TYPE_WIFI_ERROR (nm_wifi_error_get_type ()) +#define SUP_SIG_ID_LEN 5 + typedef struct Supplicant { NMSupplicantManager *mgr; NMSupplicantInterface *iface; - /* signal handler ids */ + guint sig_ids[SUP_SIG_ID_LEN]; guint iface_error_id; - guint iface_state_id; - guint iface_scanned_ap_id; - guint iface_scan_request_result_id; - guint iface_scan_results_id; - guint iface_notify_scanning_id; /* Timeouts and idles */ guint iface_con_error_cb_id; @@ -631,7 +628,7 @@ static gboolean supplicant_interface_acquire (NMDeviceWifi *self) { NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); - guint id; + guint id, i = 0; g_return_val_if_fail (self != NULL, FALSE); /* interface already acquired? */ @@ -646,35 +643,37 @@ supplicant_interface_acquire (NMDeviceWifi *self) return FALSE; } + memset (priv->supplicant.sig_ids, 0, sizeof (priv->supplicant.sig_ids)); + id = g_signal_connect (priv->supplicant.iface, "state", G_CALLBACK (supplicant_iface_state_cb), self); - priv->supplicant.iface_state_id = id; + priv->supplicant.sig_ids[i++] = id; id = g_signal_connect (priv->supplicant.iface, "scanned-ap", G_CALLBACK (supplicant_iface_scanned_ap_cb), self); - priv->supplicant.iface_scanned_ap_id = id; + priv->supplicant.sig_ids[i++] = id; id = g_signal_connect (priv->supplicant.iface, "scan-req-result", G_CALLBACK (supplicant_iface_scan_request_result_cb), self); - priv->supplicant.iface_scan_request_result_id = id; + priv->supplicant.sig_ids[i++] = id; id = g_signal_connect (priv->supplicant.iface, "scan-results", G_CALLBACK (supplicant_iface_scan_results_cb), self); - priv->supplicant.iface_scan_results_id = id; + priv->supplicant.sig_ids[i++] = id; id = g_signal_connect (priv->supplicant.iface, "notify::scanning", G_CALLBACK (supplicant_iface_notify_scanning_cb), self); - priv->supplicant.iface_notify_scanning_id = id; + priv->supplicant.sig_ids[i++] = id; return TRUE; } @@ -702,6 +701,7 @@ static void supplicant_interface_release (NMDeviceWifi *self) { NMDeviceWifiPrivate *priv; + guint i; g_return_if_fail (self != NULL); @@ -716,30 +716,12 @@ supplicant_interface_release (NMDeviceWifi *self) remove_supplicant_interface_error_handler (self); - if (priv->supplicant.iface_state_id > 0) { - g_signal_handler_disconnect (priv->supplicant.iface, priv->supplicant.iface_state_id); - priv->supplicant.iface_state_id = 0; - } - - if (priv->supplicant.iface_scanned_ap_id > 0) { - g_signal_handler_disconnect (priv->supplicant.iface, priv->supplicant.iface_scanned_ap_id); - priv->supplicant.iface_scanned_ap_id = 0; - } - - if (priv->supplicant.iface_scan_request_result_id > 0) { - g_signal_handler_disconnect (priv->supplicant.iface, priv->supplicant.iface_scan_request_result_id); - priv->supplicant.iface_scan_request_result_id = 0; - } - - if (priv->supplicant.iface_scan_results_id > 0) { - g_signal_handler_disconnect (priv->supplicant.iface, priv->supplicant.iface_scan_results_id); - priv->supplicant.iface_scan_results_id = 0; - } - - if (priv->supplicant.iface_notify_scanning_id > 0) { - g_signal_handler_disconnect (priv->supplicant.iface, priv->supplicant.iface_notify_scanning_id); - priv->supplicant.iface_notify_scanning_id = 0; + /* Clear supplicant interface signal handlers */ + for (i = 0; i < SUP_SIG_ID_LEN; i++) { + if (priv->supplicant.sig_ids[i] > 0) + g_signal_handler_disconnect (priv->supplicant.iface, priv->supplicant.sig_ids[i]); } + memset (priv->supplicant.sig_ids, 0, sizeof (priv->supplicant.sig_ids)); if (priv->supplicant.iface) { /* Tell the supplicant to disconnect from the current AP */ -- cgit v1.2.1 From d18911aabdb945e33ad193e422fda86c9a63b89a Mon Sep 17 00:00:00 2001 From: Brett Witherspoon Date: Wed, 6 Oct 2010 15:47:32 -0500 Subject: doc: don't install docs when docs are disabled (bgo #631133) --- docs/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index fe74511025..5a3da7e067 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -1,7 +1,7 @@ -SUBDIRS = libnm-glib libnm-util - if WITH_DOCS +SUBDIRS = libnm-glib libnm-util + INCLUDES = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/libnm-util -- cgit v1.2.1 From 66ef151da184290ea24b8d51b313b2a4f567f528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Dr=C4=85g?= Date: Wed, 6 Oct 2010 15:49:16 -0500 Subject: po: update Polish translation (bgo #631153) --- po/pl.po | 1759 ++++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 967 insertions(+), 792 deletions(-) diff --git a/po/pl.po b/po/pl.po index cfa994a294..f1b0650d04 100644 --- a/po/pl.po +++ b/po/pl.po @@ -7,20 +7,96 @@ msgid "" msgstr "" "Project-Id-Version: NetworkManager\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-02-26 03:24+0000\n" -"PO-Revision-Date: 2010-03-08 11:52+0100\n" -"Last-Translator: Tomasz Dominikowski \n" -"Language-Team: Polish \n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-09-22 03:25+0000\n" +"PO-Revision-Date: 2010-09-22 17:43+0200\n" +"Last-Translator: Piotr Drąg \n" +"Language-Team: Polish \n" +"Language: pl\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" +"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-Poedit-Language: Polish\n" "X-Poedit-Country: Poland\n" +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/devices.c:88 ../cli/src/devices.c:101 ../cli/src/devices.c:111 +#: ../cli/src/devices.c:121 ../cli/src/devices.c:134 ../cli/src/devices.c:145 +#: ../cli/src/devices.c:156 ../cli/src/devices.c:165 ../cli/src/devices.c:174 +msgid "NAME" +msgstr "NAZWA" -#: ../cli/src/connections.c:86 +#. 0 +#: ../cli/src/connections.c:61 ../cli/src/connections.c:76 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:62 +msgid "DEVICES" +msgstr "URZĄDZENIA" + +#. 2 +#: ../cli/src/connections.c:63 ../cli/src/connections.c:78 +msgid "SCOPE" +msgstr "ZAKRES" + +#. 3 +#: ../cli/src/connections.c:64 +msgid "DEFAULT" +msgstr "DOMYŚLNE" + +#. 4 +#: ../cli/src/connections.c:65 +msgid "DBUS-SERVICE" +msgstr "USŁUGA-DBUS" + +#. 5 +#: ../cli/src/connections.c:66 +msgid "SPEC-OBJECT" +msgstr "KONKRETNY-OBIEKT" + +#. 6 +#: ../cli/src/connections.c:67 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:77 ../cli/src/devices.c:62 ../cli/src/devices.c:90 +msgid "TYPE" +msgstr "TYP" + +#. 3 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP" +msgstr "OKRES-CZASU" + +#. 4 +#: ../cli/src/connections.c:80 +msgid "TIMESTAMP-REAL" +msgstr "RZECZYWISTY-OKRES-CZASU" + +#. 5 +#: ../cli/src/connections.c:81 +msgid "AUTOCONNECT" +msgstr "ŁĄCZENIE-AUTOMATYCZNE" + +#. 6 +#: ../cli/src/connections.c:82 +msgid "READONLY" +msgstr "TYLKO-DO-ODCZYTU" + +#. 7 +#: ../cli/src/connections.c:83 +msgid "DBUS-PATH" +msgstr "ŚCIEŻKA-DO-DBUS" + +#: ../cli/src/connections.c:159 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -28,7 +104,8 @@ msgid "" "\n" " list [id | uuid | system | user]\n" " status\n" -" up id | uuid [iface ] [ap ] [--nowait] [--timeout ]\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" " down id | uuid \n" msgstr "" "Użycie: nmcli con { POLECENIE | help }\n" @@ -36,418 +113,528 @@ msgstr "" "\n" " list [id | uuid | system | user]\n" " status\n" -" up id | uuid [iface ] [ap ] [--nowait] [--timeout ]\n" +" up id | uuid [iface ] [ap ] [--" +"nowait] [--timeout ]\n" " down id | uuid \n" +#: ../cli/src/connections.c:199 ../cli/src/connections.c:540 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Błąd: \"con list\": %s" + +#: ../cli/src/connections.c:201 ../cli/src/connections.c:542 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Błąd: \"con list\": %s; dozwolone pola: %s" + +#: ../cli/src/connections.c:209 +msgid "Connection details" +msgstr "Szczegóły połączenia" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:605 +msgid "system" +msgstr "systemowe" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:605 +msgid "user" +msgstr "użytkownika" + +#: ../cli/src/connections.c:386 +msgid "never" +msgstr "nigdy" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:387 ../cli/src/connections.c:388 +#: ../cli/src/connections.c:606 ../cli/src/connections.c:609 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:551 ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 +msgid "yes" +msgstr "tak" -#: ../cli/src/connections.c:158 -msgid "Connections" -msgstr "Połączenia" - - -#: ../cli/src/connections.c:158 -#: ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 -#: ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 -#: ../cli/src/connections.c:207 -#: ../cli/src/devices.c:298 -#: ../cli/src/devices.c:458 -#: ../cli/src/devices.c:460 -msgid "Type" -msgstr "Typ" - - -#: ../cli/src/connections.c:158 -#: ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 -#: ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 -#: ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 -#: ../cli/src/connections.c:299 -msgid "UUID" -msgstr "UUID" - - -#: ../cli/src/connections.c:158 -#: ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 -#: ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 -#: ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 -#: ../cli/src/connections.c:299 -msgid "Name" -msgstr "Nazwa" - - -#: ../cli/src/connections.c:163 -#, c-format -msgid "System connections:\n" -msgstr "Połączenia systemowe:\n" - +#: ../cli/src/connections.c:387 ../cli/src/connections.c:388 +#: ../cli/src/connections.c:606 ../cli/src/connections.c:609 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:510 ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 ../cli/src/settings.c:1224 +msgid "no" +msgstr "nie" -#: ../cli/src/connections.c:167 -#, c-format -msgid "User connections:\n" -msgstr "Połączenia użytkownika:\n" +#: ../cli/src/connections.c:461 ../cli/src/connections.c:504 +msgid "System connections" +msgstr "Połączenia systemowe" +#: ../cli/src/connections.c:466 ../cli/src/connections.c:517 +msgid "User connections" +msgstr "Połączenia użytkownika" -#: ../cli/src/connections.c:178 -#: ../cli/src/connections.c:967 -#: ../cli/src/connections.c:983 -#: ../cli/src/connections.c:992 -#: ../cli/src/connections.c:1003 -#: ../cli/src/connections.c:1085 -#: ../cli/src/devices.c:604 -#: ../cli/src/devices.c:614 -#: ../cli/src/devices.c:699 -#: ../cli/src/devices.c:785 -#: ../cli/src/devices.c:792 +#: ../cli/src/connections.c:478 ../cli/src/connections.c:1338 +#: ../cli/src/connections.c:1354 ../cli/src/connections.c:1363 +#: ../cli/src/connections.c:1374 ../cli/src/connections.c:1459 +#: ../cli/src/devices.c:962 ../cli/src/devices.c:972 ../cli/src/devices.c:1074 +#: ../cli/src/devices.c:1081 #, c-format msgid "Error: %s argument is missing." msgstr "Błąd: brak parametru %s." - -#: ../cli/src/connections.c:189 +#: ../cli/src/connections.c:491 #, c-format msgid "Error: %s - no such connection." msgstr "Błąd: %s - nie ma takiego połączenia." - -#: ../cli/src/connections.c:196 -msgid "System-wide connections" -msgstr "Połączenia systemowe" - - -#: ../cli/src/connections.c:205 -msgid "User connections" -msgstr "Połączenia użytkownika" - - -#: ../cli/src/connections.c:212 -#: ../cli/src/connections.c:1016 -#: ../cli/src/connections.c:1103 -#: ../cli/src/devices.c:446 -#: ../cli/src/devices.c:494 -#: ../cli/src/devices.c:628 -#: ../cli/src/devices.c:706 -#: ../cli/src/devices.c:798 +#: ../cli/src/connections.c:523 ../cli/src/connections.c:1387 +#: ../cli/src/connections.c:1477 ../cli/src/devices.c:785 +#: ../cli/src/devices.c:852 ../cli/src/devices.c:986 ../cli/src/devices.c:1087 #, c-format msgid "Unknown parameter: %s\n" msgstr "Nieznany parametr: %s\n" - -#: ../cli/src/connections.c:221 +#: ../cli/src/connections.c:532 #, c-format msgid "Error: no valid parameter specified." msgstr "Błąd: nie podano prawidłowego parametru." +#: ../cli/src/connections.c:547 ../cli/src/connections.c:1580 +#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:359 +#, c-format +msgid "Error: %s." +msgstr "Błąd: %s." -#. FIXME: Fix the output -#: ../cli/src/connections.c:268 -#: ../cli/src/devices.c:302 -#: ../cli/src/devices.c:321 -#: ../cli/src/devices.c:353 -#: ../cli/src/devices.c:355 -#: ../cli/src/devices.c:357 -#: ../cli/src/devices.c:359 -#: ../cli/src/devices.c:361 -msgid "yes" -msgstr "tak" - - -#: ../cli/src/connections.c:268 -#: ../cli/src/devices.c:304 -msgid "no" -msgstr "nie" +#: ../cli/src/connections.c:653 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Błąd: \"con status\": %s" +#: ../cli/src/connections.c:655 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Błąd: \"con status\": %s; dozwolone pola: %s" -#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:662 msgid "Active connections" msgstr "Aktywne połączenia" - -#: ../cli/src/connections.c:297 -#: ../cli/src/connections.c:299 -#: ../cli/src/devices.c:302 -#: ../cli/src/devices.c:304 -msgid "Default" -msgstr "Domyślne" - - -#: ../cli/src/connections.c:297 -#: ../cli/src/connections.c:299 -msgid "Service" -msgstr "Usługa" - - -#: ../cli/src/connections.c:297 -#: ../cli/src/connections.c:299 -msgid "Devices" -msgstr "Urządzenia" - - -#: ../cli/src/connections.c:659 +#: ../cli/src/connections.c:1030 #, c-format msgid "no active connection on device '%s'" msgstr "brak aktywnych połączeń na urządzeniu \"%s\"" - -#: ../cli/src/connections.c:667 +#: ../cli/src/connections.c:1038 #, c-format msgid "no active connection or device" msgstr "brak aktywnych połączeń na urządzeń" +#: ../cli/src/connections.c:1088 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "urządzenie \"%s\" nie jest zgodne z połączeniem \"%s\"" + +#: ../cli/src/connections.c:1090 +#, c-format +msgid "no device found for connection '%s'" +msgstr "nie odnaleziono urządzenia dla połączenia \"%s\"" -#: ../cli/src/connections.c:730 +#: ../cli/src/connections.c:1101 msgid "activating" msgstr "aktywowanie" - -#: ../cli/src/connections.c:732 +#: ../cli/src/connections.c:1103 msgid "activated" msgstr "aktywowano" - -#: ../cli/src/connections.c:735 -#: ../cli/src/connections.c:758 -#: ../cli/src/connections.c:791 -#: ../cli/src/devices.c:111 -#: ../cli/src/network-manager.c:76 -#: ../cli/src/network-manager.c:98 +#: ../cli/src/connections.c:1106 ../cli/src/connections.c:1129 +#: ../cli/src/connections.c:1162 ../cli/src/devices.c:246 +#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:149 ../cli/src/settings.c:473 msgid "unknown" msgstr "nieznane" - -#: ../cli/src/connections.c:744 +#: ../cli/src/connections.c:1115 msgid "VPN connecting (prepare)" msgstr "Łączenie z VPN (przygotowanie)" - -#: ../cli/src/connections.c:746 +#: ../cli/src/connections.c:1117 msgid "VPN connecting (need authentication)" msgstr "Łączenie z VPN (wymaga uwierzytelnienia)" - -#: ../cli/src/connections.c:748 +#: ../cli/src/connections.c:1119 msgid "VPN connecting" msgstr "Łączenie z VPN" - -#: ../cli/src/connections.c:750 +#: ../cli/src/connections.c:1121 msgid "VPN connecting (getting IP configuration)" msgstr "Łączenie z VPN (pobieranie konfiguracji adresu IP)" - -#: ../cli/src/connections.c:752 +#: ../cli/src/connections.c:1123 msgid "VPN connected" msgstr "Połączono z VPN" - -#: ../cli/src/connections.c:754 +#: ../cli/src/connections.c:1125 msgid "VPN connection failed" msgstr "Połączenie z VPN się nie powiodło" - -#: ../cli/src/connections.c:756 +#: ../cli/src/connections.c:1127 msgid "VPN disconnected" msgstr "Rozłączono z VPN" - -#: ../cli/src/connections.c:767 +#: ../cli/src/connections.c:1138 msgid "unknown reason" msgstr "nieznany powód" - -#: ../cli/src/connections.c:769 +#: ../cli/src/connections.c:1140 msgid "none" msgstr "brak" - -#: ../cli/src/connections.c:771 +#: ../cli/src/connections.c:1142 msgid "the user was disconnected" msgstr "użytkownik został rozłączony" - -#: ../cli/src/connections.c:773 +#: ../cli/src/connections.c:1144 msgid "the base network connection was interrupted" msgstr "podstawowe połączenie sieciowe zostało przerwane" - -#: ../cli/src/connections.c:775 +#: ../cli/src/connections.c:1146 msgid "the VPN service stopped unexpectedly" msgstr "usługa VPN została nieoczekiwanie zatrzymana" - -#: ../cli/src/connections.c:777 +#: ../cli/src/connections.c:1148 msgid "the VPN service returned invalid configuration" msgstr "usługa VPN zwróciła nieprawidłową konfigurację" - -#: ../cli/src/connections.c:779 +#: ../cli/src/connections.c:1150 msgid "the connection attempt timed out" msgstr "próba połączenia przekroczyła czas oczekiwania" - -#: ../cli/src/connections.c:781 +#: ../cli/src/connections.c:1152 msgid "the VPN service did not start in time" msgstr "usługa VPN nie została uruchomiona w czasie" - -#: ../cli/src/connections.c:783 +#: ../cli/src/connections.c:1154 msgid "the VPN service failed to start" msgstr "uruchomienie usługi VPN się nie powiodło" - -#: ../cli/src/connections.c:785 +#: ../cli/src/connections.c:1156 msgid "no valid VPN secrets" msgstr "brak prawidłowych haseł VPN" - -#: ../cli/src/connections.c:787 +#: ../cli/src/connections.c:1158 msgid "invalid VPN secrets" msgstr "nieprawidłowe hasła VPN" - -#: ../cli/src/connections.c:789 +#: ../cli/src/connections.c:1160 msgid "the connection was removed" msgstr "połączenie zostało usunięte" - -#: ../cli/src/connections.c:803 +#: ../cli/src/connections.c:1174 #, c-format msgid "state: %s\n" msgstr "stan: %s\n" - -#: ../cli/src/connections.c:806 -#: ../cli/src/connections.c:832 +#: ../cli/src/connections.c:1177 ../cli/src/connections.c:1203 #, c-format msgid "Connection activated\n" msgstr "Aktywowano połączenie\n" - -#: ../cli/src/connections.c:809 +#: ../cli/src/connections.c:1180 #, c-format msgid "Error: Connection activation failed." msgstr "Błąd: aktywacja połączenia się nie powiodła." - -#: ../cli/src/connections.c:828 +#: ../cli/src/connections.c:1199 #, c-format msgid "state: %s (%d)\n" msgstr "stan: %s (%d)\n" - -#: ../cli/src/connections.c:838 +#: ../cli/src/connections.c:1209 #, c-format msgid "Error: Connection activation failed: %s." msgstr "Błąd: aktywacja połączenia się nie powiodła: %s." - -#: ../cli/src/connections.c:855 -#: ../cli/src/devices.c:551 +#: ../cli/src/connections.c:1226 ../cli/src/devices.c:909 #, c-format msgid "Error: Timeout %d sec expired." msgstr "Błąd: przekroczono czas oczekiwania o %d sekund." - -#: ../cli/src/connections.c:898 +#: ../cli/src/connections.c:1269 #, c-format msgid "Error: Connection activation failed: %s" msgstr "Błąd: aktywacja połączenia się nie powiodła: %s" - -#: ../cli/src/connections.c:912 +#: ../cli/src/connections.c:1283 #, c-format msgid "Error: Obtaining active connection for '%s' failed." msgstr "Błąd: uzyskanie aktywnego połączenia dla \"%s\" się nie powiodło." - -#: ../cli/src/connections.c:921 +#: ../cli/src/connections.c:1292 #, c-format msgid "Active connection state: %s\n" msgstr "Stan aktywnego połączenia: %s\n" - -#: ../cli/src/connections.c:922 +#: ../cli/src/connections.c:1293 #, c-format msgid "Active connection path: %s\n" msgstr "Ścieżka aktywnego połączenia: %s\n" - -#: ../cli/src/connections.c:976 -#: ../cli/src/connections.c:1094 +#: ../cli/src/connections.c:1347 ../cli/src/connections.c:1468 #, c-format msgid "Error: Unknown connection: %s." msgstr "Błąd: nieznane połączenie: %s." - -#: ../cli/src/connections.c:1011 -#: ../cli/src/devices.c:622 +#: ../cli/src/connections.c:1382 ../cli/src/devices.c:980 #, c-format msgid "Error: timeout value '%s' is not valid." msgstr "Błąd: wartość czasu oczekiwania \"%s\" jest nieprawidłowa." - -#: ../cli/src/connections.c:1024 -#: ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:1395 ../cli/src/connections.c:1485 #, c-format msgid "Error: id or uuid has to be specified." msgstr "Błąd: należy podać identyfikator lub UUID." - -#: ../cli/src/connections.c:1044 +#: ../cli/src/connections.c:1415 #, c-format msgid "Error: No suitable device found: %s." msgstr "Błąd: nie odnaleziono odpowiedniego urządzenia: %s" - -#: ../cli/src/connections.c:1046 +#: ../cli/src/connections.c:1417 #, c-format msgid "Error: No suitable device found." msgstr "Błąd: nie odnaleziono odpowiedniego urządzenia." - -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1512 #, c-format msgid "Warning: Connection not active\n" msgstr "Ostrzeżenie: połączenie nie jest aktywne\n" - -#: ../cli/src/connections.c:1189 +#: ../cli/src/connections.c:1569 #, c-format msgid "Error: 'con' command '%s' is not valid." msgstr "Błąd: polecenie \"con\" \"%s\" jest nieprawidłowe." - -#: ../cli/src/connections.c:1216 +#: ../cli/src/connections.c:1605 #, c-format msgid "Error: could not connect to D-Bus." msgstr "Błąd: nie można połączyć się z D-Bus." - -#: ../cli/src/connections.c:1223 +#: ../cli/src/connections.c:1612 #, c-format msgid "Error: Could not get system settings." msgstr "Błąd: nie można uzyskać ustawień systemu." - -#: ../cli/src/connections.c:1231 +#: ../cli/src/connections.c:1620 #, c-format msgid "Error: Could not get user settings." msgstr "Błąd: nie można uzyskać ustawień użytkownika." - -#: ../cli/src/connections.c:1241 +#: ../cli/src/connections.c:1630 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "Błąd: nie można uzyskać połączeń: usługi ustawień nie są uruchomione." - +#. 0 +#. 9 +#: ../cli/src/devices.c:61 ../cli/src/devices.c:89 ../cli/src/devices.c:184 +msgid "DEVICE" +msgstr "URZĄDZENIE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:63 ../cli/src/devices.c:93 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STAN" + +#: ../cli/src/devices.c:72 +msgid "GENERAL" +msgstr "OGÓLNE" + +#. 0 #: ../cli/src/devices.c:73 +msgid "CAPABILITIES" +msgstr "MOŻLIWOŚCI" + +#. 1 +#: ../cli/src/devices.c:74 +msgid "WIFI-PROPERTIES" +msgstr "WŁAŚCIWOŚCI-WIFI" + +#. 2 +#: ../cli/src/devices.c:75 +msgid "AP" +msgstr "PUNKT-DOSTĘPOWY" + +#. 3 +#: ../cli/src/devices.c:76 +msgid "WIRED-PROPERTIES" +msgstr "WŁAŚCIWOŚCI-POŁĄCZENIA-PRZEWODOWEGO" + +#. 4 +#: ../cli/src/devices.c:77 +msgid "IP4-SETTINGS" +msgstr "USTAWIENIA-IP4" + +#. 5 +#: ../cli/src/devices.c:78 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 6 +#: ../cli/src/devices.c:79 +msgid "IP6-SETTINGS" +msgstr "USTAWIENIA-IP6" + +#. 7 +#: ../cli/src/devices.c:80 +msgid "IP6-DNS" +msgstr "IP6-DNS" + +#. 2 +#: ../cli/src/devices.c:91 +msgid "DRIVER" +msgstr "STEROWNIK" + +#. 3 +#: ../cli/src/devices.c:92 +msgid "HWADDR" +msgstr "ADRES-SPRZĘTOWY" + +#. 0 +#: ../cli/src/devices.c:102 +msgid "CARRIER-DETECT" +msgstr "WYKRYWANIE-OPERATORA" + +#. 1 +#: ../cli/src/devices.c:103 +msgid "SPEED" +msgstr "PRĘDKOŚĆ" + +#. 0 +#: ../cli/src/devices.c:112 +msgid "CARRIER" +msgstr "OPERATOR" + +#. 0 +#: ../cli/src/devices.c:122 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:123 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:124 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:125 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:126 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:135 ../cli/src/devices.c:146 +msgid "ADDRESS" +msgstr "ADRES" + +#. 1 +#: ../cli/src/devices.c:136 ../cli/src/devices.c:147 +msgid "PREFIX" +msgstr "PRZEDROSTEK" + +#. 2 +#: ../cli/src/devices.c:137 ../cli/src/devices.c:148 +msgid "GATEWAY" +msgstr "BRAMA" + +#. 0 +#: ../cli/src/devices.c:157 ../cli/src/devices.c:166 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:175 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:176 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:177 +msgid "MODE" +msgstr "TRYB" + +#. 3 +#: ../cli/src/devices.c:178 +msgid "FREQ" +msgstr "CZĘSTOTLIWOŚĆ" + +#. 4 +#: ../cli/src/devices.c:179 +msgid "RATE" +msgstr "OCENA" + +#. 5 +#: ../cli/src/devices.c:180 +msgid "SIGNAL" +msgstr "SYGNAŁ" + +#. 6 +#: ../cli/src/devices.c:181 +msgid "SECURITY" +msgstr "ZABEZPIECZENIA" + +#. 7 +#: ../cli/src/devices.c:182 +msgid "WPA-FLAGS" +msgstr "FLAGI-WPA" + +#. 8 +#: ../cli/src/devices.c:183 +msgid "RSN-FLAGS" +msgstr "FLAGI-RSN" + +#. 10 +#: ../cli/src/devices.c:185 +msgid "ACTIVE" +msgstr "AKTYWNOŚĆ" + +#: ../cli/src/devices.c:208 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -457,581 +644,404 @@ msgid "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" msgstr "" "Użycie: nmcli dev { POLECENIE | help }\n" "\n" -" COMMAND := { status | list | disconnect | wifi }\n" +" POLECENIE := { status | list | disconnect | wifi }\n" "\n" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" - -#: ../cli/src/devices.c:93 +#: ../cli/src/devices.c:228 msgid "unmanaged" msgstr "niezarządzane" - -#: ../cli/src/devices.c:95 +#: ../cli/src/devices.c:230 msgid "unavailable" msgstr "niedostępne" - -#: ../cli/src/devices.c:97 -#: ../cli/src/network-manager.c:73 +#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:91 msgid "disconnected" msgstr "rozłączono" - -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:234 msgid "connecting (prepare)" msgstr "łączenie (przygotowanie)" - -#: ../cli/src/devices.c:101 +#: ../cli/src/devices.c:236 msgid "connecting (configuring)" msgstr "łączenie (konfigurowanie)" - -#: ../cli/src/devices.c:103 +#: ../cli/src/devices.c:238 msgid "connecting (need authentication)" msgstr "łączenie (wymaga uwierzytelnienia)" - -#: ../cli/src/devices.c:105 +#: ../cli/src/devices.c:240 msgid "connecting (getting IP configuration)" msgstr "łączenie (pobieranie konfiguracji adresu IP)" - -#: ../cli/src/devices.c:107 -#: ../cli/src/network-manager.c:71 +#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:89 msgid "connected" msgstr "połączono" - -#: ../cli/src/devices.c:109 +#: ../cli/src/devices.c:244 msgid "connection failed" msgstr "połączenie się nie powiodło" - -#: ../cli/src/devices.c:132 -#: ../cli/src/devices.c:876 +#: ../cli/src/devices.c:267 ../cli/src/devices.c:424 msgid "Unknown" msgstr "Nieznane" - -#. print them -#: ../cli/src/devices.c:164 -#: ../cli/src/devices.c:266 -#: ../cli/src/devices.c:861 -#: ../cli/src/devices.c:879 +#: ../cli/src/devices.c:299 msgid "(none)" msgstr "(brak)" - -#: ../cli/src/devices.c:209 +#: ../cli/src/devices.c:324 #, c-format msgid "%s: error converting IP4 address 0x%X" msgstr "%s: błąd podczas konwertowania adresu IPv4 0x%X" - -#: ../cli/src/devices.c:238 +#: ../cli/src/devices.c:393 #, c-format -msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" -msgstr "%s, %s, częstotliwość %d MHz, prędkość %d Mb/s, siła sygnału %d" - - -#: ../cli/src/devices.c:239 -msgid "Ad-Hoc" -msgstr "Ad-hoc" - - -#: ../cli/src/devices.c:248 -msgid ", Encrypted: " -msgstr ", zaszyfrowane: " - - -#: ../cli/src/devices.c:253 -msgid " WEP" -msgstr " WEP" +msgid "%u MHz" +msgstr "%u MHz" +#: ../cli/src/devices.c:394 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" -#: ../cli/src/devices.c:255 -msgid " WPA" -msgstr " WPA" +#: ../cli/src/devices.c:403 +msgid "Encrypted: " +msgstr "Zaszyfrowane: " +#: ../cli/src/devices.c:408 +msgid "WEP " +msgstr "WEP " -#: ../cli/src/devices.c:257 -msgid " WPA2" -msgstr " WPA2" +#: ../cli/src/devices.c:410 +msgid "WPA " +msgstr "WPA " +#: ../cli/src/devices.c:412 +msgid "WPA2 " +msgstr "WPA2 " -#: ../cli/src/devices.c:260 -msgid " Enterprise" -msgstr " Enterprise" +#: ../cli/src/devices.c:415 +msgid "Enterprise " +msgstr "Enterprise " +#: ../cli/src/devices.c:424 +msgid "Ad-Hoc" +msgstr "Ad-hoc" -#: ../cli/src/devices.c:294 -#: ../cli/src/devices.c:458 -#: ../cli/src/devices.c:460 -msgid "Device" -msgstr "Urządzenie" +#: ../cli/src/devices.c:424 +msgid "Infrastructure" +msgstr "Infrastruktura" +#: ../cli/src/devices.c:486 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "Błąd: \"dev list\": %s" -#: ../cli/src/devices.c:299 -msgid "Driver" -msgstr "Sterownik" +#: ../cli/src/devices.c:488 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Błąd: \"dev list\": %s; dozwolone pola: %s" +#: ../cli/src/devices.c:497 +msgid "Device details" +msgstr "Informacje o urządzeniu" -#: ../cli/src/devices.c:299 -#: ../cli/src/devices.c:567 +#: ../cli/src/devices.c:527 ../cli/src/devices.c:925 msgid "(unknown)" msgstr "(nieznane)" +#: ../cli/src/devices.c:528 +msgid "unknown)" +msgstr "nieznane)" -#: ../cli/src/devices.c:300 -#: ../cli/src/devices.c:458 -#: ../cli/src/devices.c:460 -msgid "State" -msgstr "Stan" - - -#: ../cli/src/devices.c:313 -msgid "HW Address" -msgstr "Adres sprzętowy" - - -#: ../cli/src/devices.c:319 -#, c-format -msgid "" -"\n" -" Capabilities:\n" -msgstr "" -"\n" -" Możliwości:\n" - - -#: ../cli/src/devices.c:321 -msgid "Carrier Detect" -msgstr "Wykrywanie operatora" - - -#: ../cli/src/devices.c:336 +#: ../cli/src/devices.c:554 #, c-format msgid "%u Mb/s" msgstr "%u Mb/s" - -#: ../cli/src/devices.c:337 -msgid "Speed" -msgstr "Prędkość" - - -#: ../cli/src/devices.c:348 -#, c-format -msgid "" -"\n" -" Wireless Properties\n" -msgstr "" -"\n" -" Właściwości sieci bezprzewodowej\n" - - -#: ../cli/src/devices.c:353 -msgid "WEP Encryption" -msgstr "Szyfrowanie WEP" - - -#: ../cli/src/devices.c:355 -msgid "WPA Encryption" -msgstr "Szyfrowanie WPA" - - -#: ../cli/src/devices.c:357 -msgid "WPA2 Encryption" -msgstr "Szyfrowanie WPA2" - - -#: ../cli/src/devices.c:359 -msgid "TKIP cipher" -msgstr "Szyfr TKIP" - - -#: ../cli/src/devices.c:361 -msgid "CCMP cipher" -msgstr "Szyfr CCMP" - - -#: ../cli/src/devices.c:368 -#, c-format -msgid "" -"\n" -" Wireless Access Points %s\n" -msgstr "" -"\n" -" Bezprzewodowe punkty dostępowe %s\n" - - -#: ../cli/src/devices.c:368 -msgid "(* = current AP)" -msgstr "(* = bieżący punkt dostępowy)" - - -#: ../cli/src/devices.c:374 -#, c-format -msgid "" -"\n" -" Wired Properties\n" -msgstr "" -"\n" -" Właściwości sieci przewodowej\n" - - -#: ../cli/src/devices.c:377 -#: ../cli/src/devices.c:379 -msgid "Carrier" -msgstr "Operator" - - -#: ../cli/src/devices.c:377 +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:627 msgid "on" msgstr "włączone" - -#: ../cli/src/devices.c:379 +#: ../cli/src/devices.c:627 msgid "off" msgstr "wyłączone" - -#: ../cli/src/devices.c:387 +#: ../cli/src/devices.c:808 #, c-format -msgid "" -"\n" -" IPv4 Settings:\n" -msgstr "" -"\n" -" Ustawienia IPv4:\n" - - -#: ../cli/src/devices.c:395 -msgid "Address" -msgstr "Adres" - - -#: ../cli/src/devices.c:401 -msgid "Prefix" -msgstr "Przedrostek" - - -#: ../cli/src/devices.c:405 -msgid "Gateway" -msgstr "Brama" - - -#: ../cli/src/devices.c:416 -msgid "DNS" -msgstr "DNS" +msgid "Error: 'dev status': %s" +msgstr "Błąd: \"dev status\": %s" +#: ../cli/src/devices.c:810 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Błąd: \"dev status\": %s; dozwolone pola: %s" -#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:817 msgid "Status of devices" msgstr "Stan urządzenia" - -#: ../cli/src/devices.c:487 +#: ../cli/src/devices.c:845 #, c-format msgid "Error: '%s' argument is missing." msgstr "Błąd: brak parametru \"%s\"." - -#: ../cli/src/devices.c:516 -#: ../cli/src/devices.c:655 -#: ../cli/src/devices.c:729 +#: ../cli/src/devices.c:874 ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: Device '%s' not found." msgstr "Błąd: nie odnaleziono urządzenia \"%s\"." - -#: ../cli/src/devices.c:539 +#: ../cli/src/devices.c:897 #, c-format msgid "Success: Device '%s' successfully disconnected." msgstr "Powodzenie: urządzenie \"%s\" zostało rozłączone." - -#: ../cli/src/devices.c:564 +#: ../cli/src/devices.c:922 #, c-format msgid "Error: Device '%s' (%s) disconnecting failed: %s" msgstr "Błąd: rozłączenie urządzenia \"%s\" (%s) się nie powiodło: %s" - -#: ../cli/src/devices.c:572 +#: ../cli/src/devices.c:930 #, c-format msgid "Device state: %d (%s)\n" msgstr "Stan urządzenia: %d (%s)\n" - -#: ../cli/src/devices.c:636 +#: ../cli/src/devices.c:994 #, c-format msgid "Error: iface has to be specified." msgstr "Błąd: należy podać interfejs." - -#: ../cli/src/devices.c:736 -#: ../cli/src/devices.c:746 -msgid "WiFi scan list" -msgstr "Lista skanowania sieci WiFi" - - -#: ../cli/src/devices.c:740 +#: ../cli/src/devices.c:1112 #, c-format -msgid "Error: Device '%s' is not a WiFi device." -msgstr "Błąd: urządzenie \"%s\" nie jest urządzeniem WiFi." - - -#: ../cli/src/devices.c:754 -msgid "Device:" -msgstr "Urządzenie:" - - -#: ../cli/src/devices.c:806 -#, c-format -msgid "Error: hwaddr has to be specified." -msgstr "Błąd: należy podać adres sprzętowy." - - -#: ../cli/src/devices.c:844 -#, c-format -msgid "Error: Access point with hwaddr '%s' not found." -msgstr "Błąd: nie odnaleziono punktu dostępowego z adresem sprzętowym \"%s\"." - - -#: ../cli/src/devices.c:862 -#, c-format -msgid "%u MHz" -msgstr "%u MHz" - +msgid "Error: 'dev wifi': %s" +msgstr "Błąd: \"dev wifi\": %s" -#: ../cli/src/devices.c:863 +#: ../cli/src/devices.c:1114 #, c-format -msgid "%u MB/s" -msgstr "%u MB/s" - - -#: ../cli/src/devices.c:869 -#: ../cli/src/devices.c:871 -msgid "AP parameters" -msgstr "Parametry punkty dostępowego" - - -#: ../cli/src/devices.c:873 -msgid "SSID:" -msgstr "SSID:" - - -#: ../cli/src/devices.c:874 -msgid "BSSID:" -msgstr "BSSID:" - - -#: ../cli/src/devices.c:875 -msgid "Frequency:" -msgstr "Częstotliwość:" - - -#: ../cli/src/devices.c:876 -msgid "Mode:" -msgstr "Tryb:" - - -#: ../cli/src/devices.c:876 -msgid "Ad-hoc" -msgstr "Ad-hoc" - - -#: ../cli/src/devices.c:876 -msgid "Infrastructure" -msgstr "Infrastruktura" - - -#: ../cli/src/devices.c:877 -msgid "Maximal bitrate:" -msgstr "Maksymalna prędkość:" - - -#: ../cli/src/devices.c:878 -msgid "Strength:" -msgstr "Siła sygnału:" - - -#: ../cli/src/devices.c:879 -msgid "Flags:" -msgstr "Flagi:" - - -#: ../cli/src/devices.c:879 -msgid "privacy" -msgstr "prywatne" - - -#: ../cli/src/devices.c:880 -msgid "WPA flags:" -msgstr "Flagi WPA:" +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Błąd: \"dev wifi\": %s; dozwolone pola: %s" +#: ../cli/src/devices.c:1121 +msgid "WiFi scan list" +msgstr "Lista skanowania sieci WiFi" -#: ../cli/src/devices.c:881 -msgid "RSN flags:" -msgstr "Flagi RSN:" +#: ../cli/src/devices.c:1156 ../cli/src/devices.c:1210 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Błąd: nie odnaleziono punktu dostępowego z adresem sprzętowym \"%s\"." +#: ../cli/src/devices.c:1173 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Błąd: urządzenie \"%s\" nie jest urządzeniem WiFi." -#: ../cli/src/devices.c:907 +#: ../cli/src/devices.c:1237 #, c-format msgid "Error: 'dev wifi' command '%s' is not valid." msgstr "Błąd: polecenie \"dev wifi\" \"%s\" jest nieprawidłowe." - -#: ../cli/src/devices.c:943 +#: ../cli/src/devices.c:1284 #, c-format msgid "Error: 'dev' command '%s' is not valid." msgstr "Błąd: polecenie \"dev\" \"%s\" jest nieprawidłowe." +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "URUCHOMIONE" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "NET-ENABLED" +msgstr "SIEĆ-WŁĄCZONA" -#: ../cli/src/network-manager.c:46 +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI-HARDWARE" +msgstr "SPRZĘT-WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WIFI" +msgstr "WIFI" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN-HARDWARE" +msgstr "SPRZĘT-WWAN" + +#. 5 +#: ../cli/src/network-manager.c:41 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:64 #, c-format msgid "" "Usage: nmcli nm { COMMAND | help }\n" "\n" -" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +" COMMAND := { status | enable | sleep | wifi | wwan }\n" "\n" " status\n" -" sleep\n" -" wakeup\n" +" enable [true|false]\n" +" sleep [true|false]\n" " wifi [on|off]\n" " wwan [on|off]\n" "\n" msgstr "" "Użycie: nmcli nm { POLECENIE | help }\n" "\n" -" POLECENIE := { status | sleep | wakeup | wifi | wwan }\n" +" POLECENIE := { status | enable | sleep | wifi | wwan }\n" "\n" " status\n" -" sleep\n" -" wakeup\n" +" enable [true|false]\n" +" sleep [true|false]\n" " wifi [on|off]\n" " wwan [on|off]\n" "\n" - -#: ../cli/src/network-manager.c:67 +#: ../cli/src/network-manager.c:85 msgid "asleep" msgstr "wstrzymane" - -#: ../cli/src/network-manager.c:69 +#: ../cli/src/network-manager.c:87 msgid "connecting" msgstr "łączenie" +#: ../cli/src/network-manager.c:128 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Błąd: \"nm status\": %s" -#: ../cli/src/network-manager.c:93 -#: ../cli/src/network-manager.c:94 -#: ../cli/src/network-manager.c:95 -#: ../cli/src/network-manager.c:96 -#: ../cli/src/network-manager.c:143 -#: ../cli/src/network-manager.c:160 -msgid "enabled" -msgstr "włączone" - - -#: ../cli/src/network-manager.c:93 -#: ../cli/src/network-manager.c:94 -#: ../cli/src/network-manager.c:95 -#: ../cli/src/network-manager.c:96 -#: ../cli/src/network-manager.c:143 -#: ../cli/src/network-manager.c:160 -msgid "disabled" -msgstr "wyłączone" - +#: ../cli/src/network-manager.c:130 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Błąd: \"nm status\": %s; dozwolone pola: %s" -#: ../cli/src/network-manager.c:102 +#: ../cli/src/network-manager.c:137 msgid "NetworkManager status" msgstr "Stan programu NetworkManager" +#. Print header +#: ../cli/src/network-manager.c:144 ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 ../cli/src/network-manager.c:328 +msgid "enabled" +msgstr "włączone" -#: ../cli/src/network-manager.c:104 -msgid "NM running:" -msgstr "Program NetworkManager jest uruchomiony:" - +#: ../cli/src/network-manager.c:144 ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 ../cli/src/network-manager.c:328 +msgid "disabled" +msgstr "wyłączone" -#: ../cli/src/network-manager.c:104 +#: ../cli/src/network-manager.c:152 msgid "running" msgstr "uruchamiany" - -#: ../cli/src/network-manager.c:104 +#: ../cli/src/network-manager.c:152 msgid "not running" msgstr "nieuruchomiony" +#: ../cli/src/network-manager.c:175 +#, c-format +msgid "Error: Couldn't connect to system bus: %s" +msgstr "Błąd: nie można połączyć się z magistralą systemową: %s" -#: ../cli/src/network-manager.c:105 -msgid "NM state:" -msgstr "Stan programu NetworkManager:" - - -#: ../cli/src/network-manager.c:106 -msgid "NM wireless hardware:" -msgstr "Adres sprzętowy programu NetworkManager:" +#: ../cli/src/network-manager.c:186 +#, c-format +msgid "Error: Couldn't create D-Bus object proxy." +msgstr "Błąd: nie można utworzyć pośrednika obiektu usługi D-Bus." +#: ../cli/src/network-manager.c:192 +#, c-format +msgid "Error in sleep: %s" +msgstr "Błąd w poleceniu sleep: %s" -#. no argument, show current state -#: ../cli/src/network-manager.c:107 -#: ../cli/src/network-manager.c:143 -msgid "NM wireless:" -msgstr "Sieć bezprzewodowa programu NetworkManager:" +#: ../cli/src/network-manager.c:237 ../cli/src/network-manager.c:286 +#: ../cli/src/network-manager.c:318 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "" +"Błąd: wartość \"%s\" opcji \"--fields\" jest nieprawidłowa; dozwolone pola: " +"%s." +#: ../cli/src/network-manager.c:245 +msgid "Networking enabled" +msgstr "Sieć jest włączona" -#: ../cli/src/network-manager.c:108 -msgid "NM WWAN hardware:" -msgstr "WWAM sprzętu programu NetworkManager:" +#: ../cli/src/network-manager.c:256 +#, c-format +msgid "Error: invalid 'enable' parameter: '%s'; use 'true' or 'false'." +msgstr "" +"Błąd: nieprawidłowy parametr \"enable\": \"%s\"; należy użyć \"true\" lub " +"\"false\"." +#: ../cli/src/network-manager.c:265 +#, c-format +msgid "Error: Sleeping status is not exported by NetworkManager." +msgstr "Błąd: stan snu nie jest eksportowany przez program NetworkManager." -#. no argument, show current state -#: ../cli/src/network-manager.c:109 -#: ../cli/src/network-manager.c:160 -msgid "NM WWAN:" -msgstr "WWAN programu NetworkManager:" +#: ../cli/src/network-manager.c:273 +#, c-format +msgid "Error: invalid 'sleep' parameter: '%s'; use 'true' or 'false'." +msgstr "" +"Błąd: nieprawidłowy parametr \"sleep\": \"%s\"; należy użyć \"true\" lub " +"\"false\"." +#: ../cli/src/network-manager.c:294 +msgid "WiFi enabled" +msgstr "WiFi jest włączone" -#: ../cli/src/network-manager.c:150 +#: ../cli/src/network-manager.c:305 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." msgstr "Błąd: nieprawidłowy parametr \"wifi\": \"%s\"." +#: ../cli/src/network-manager.c:326 +msgid "WWAN enabled" +msgstr "WWAN jest włączone" -#: ../cli/src/network-manager.c:167 +#: ../cli/src/network-manager.c:337 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." msgstr "Błąd: nieprawidłowy parametr \"wwan\": \"%s\"." - -#: ../cli/src/network-manager.c:178 +#: ../cli/src/network-manager.c:348 #, c-format msgid "Error: 'nm' command '%s' is not valid." msgstr "Błąd: parametr \"nm\" \"%s\" jest nieprawidłowy." - -#: ../cli/src/nmcli.c:65 +#: ../cli/src/nmcli.c:69 #, c-format msgid "" "Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" "\n" "OPTIONS\n" -" -t[erse] terse output\n" -" -p[retty] pretty output\n" -" -v[ersion] show program version\n" -" -h[elp] print this help\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" "\n" "OBJECT\n" " nm NetworkManager status\n" @@ -1042,10 +1052,14 @@ msgstr "" "Użycie: %s [OPCJE] OBIEKT { POLECENIE | help }\n" "\n" "OPCJE\n" -" -t[erse] zwięzłe wyjście\n" -" -p[retty] sformatowane wyjście\n" -" -v[ersion] wyświetla wersję programu\n" -" -h[elp] wyświetla tę opcję\n" +" -t[erse] zwięzłe wyjście\n" +" -p[retty] sformatowane wyjście\n" +" -m[ode] tabulatory|wielowierszowe tryb wyjścia\n" +" -f[ields] |all|common określa pola do wyjścia\n" +" -e[scape] yes|no modyfikuje separatory kolumn w " +"wartościach\n" +" -v[ersion] wyświetla wersję programu\n" +" -h[elp] wyświetla tę opcję\n" "\n" "OBIEKT\n" " nm stan programu NetworkManager\n" @@ -1053,41 +1067,170 @@ msgstr "" " dev urządzenia zarządzane przez program NetworkManager\n" "\n" +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "" +"Błąd: obiekt \"%s\" jest nieznany, można spróbować polecenie \"nmcli help\"." -#: ../cli/src/nmcli.c:106 +#: ../cli/src/nmcli.c:143 #, c-format -msgid "Object '%s' is unknown, try 'nmcli help'." -msgstr "Obiekt \"%s\" jest nieznany. Można spróbować polecenie \"nmcli help\"." +msgid "Error: Option '--terse' is specified the second time." +msgstr "Błąd: opcja \"--terse\" został podana po raz drugi." +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "" +"Błąd: opcja \"--terse\" jest wzajemnie wykluczająca z opcją \"--pretty\"." -#: ../cli/src/nmcli.c:139 +#: ../cli/src/nmcli.c:156 #, c-format -msgid "nmcli tool, version %s\n" -msgstr "narzędzie nmcli, wersja %s\n" +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Błąd: opcja \"--pretty\" został podana po raz drugi." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "" +"Błąd: opcja \"--pretty\" jest wzajemnie wykluczająca z opcją \"--terse\"." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Błąd: brak parametru dla opcji \"%s\"." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Błąd: \"%s\" nie jest prawidłowym parametrem dla opcji \"%s\"." +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Błąd: brak pól dla opcji \"%s\"." -#: ../cli/src/nmcli.c:145 +#: ../cli/src/nmcli.c:209 #, c-format -msgid "Option '%s' is unknown, try 'nmcli -help'." -msgstr "Opcja \"%s\" jest nieznana. Można spróbować polecenie \"nmcli help\"." +msgid "nmcli tool, version %s\n" +msgstr "narzędzie nmcli, wersja %s\n" +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "" +"Błąd: opcja \"%s\" jest nieznana. Można spróbować polecenie \"nmcli help\"." -#: ../cli/src/nmcli.c:164 +#: ../cli/src/nmcli.c:234 #, c-format msgid "Caught signal %d, shutting down..." msgstr "Przechwycono sygnał %d, wyłączanie..." - -#: ../cli/src/nmcli.c:189 +#: ../cli/src/nmcli.c:259 #, c-format msgid "Error: Could not connect to NetworkManager." msgstr "Błąd: nie można połączyć się z programem NetworkManager." - -#: ../cli/src/nmcli.c:205 +#: ../cli/src/nmcli.c:275 msgid "Success" msgstr "Powodzenie" +#: ../cli/src/settings.c:411 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (klucz-szesnastkowy-acsii))" + +#: ../cli/src/settings.c:413 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-bitowe hasło)" + +#: ../cli/src/settings.c:416 +#, c-format +msgid "%d (unknown)" +msgstr "%d (nieznane)" + +#: ../cli/src/settings.c:442 +msgid "0 (unknown)" +msgstr "0 (nieznane)" + +#: ../cli/src/settings.c:448 +msgid "any, " +msgstr "dowolne, " + +#: ../cli/src/settings.c:450 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:454 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:456 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:468 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:470 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:554 ../cli/src/settings.c:721 +msgid "auto" +msgstr "automatyczne" + +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 +msgid "not set" +msgstr "nieustawione" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "pole \"%s\" musi być same" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "nieprawidłowe pole \"%s\"" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Opcja \"--terse\" wymaga podania opcji \"--fields\"" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "" +"Opcja \"--terse\" wymaga konkretnej wartości opcji \"--fields\", nie \"%s\"" #: ../libnm-util/crypto.c:120 #, c-format @@ -1099,7 +1242,6 @@ msgstr "Plik klucza PEM nie zawiera znacznika końcowego \"%s\"." msgid "Doesn't look like a PEM private key file." msgstr "Nie wygląda na plik klucza prywatnego PEM." - #: ../libnm-util/crypto.c:138 #, c-format msgid "Not enough memory to store PEM file data." @@ -1145,7 +1287,6 @@ msgstr "Nie można zdekodować klucza prywatnego." msgid "PEM certificate '%s' had no end tag '%s'." msgstr "Certyfikat PEM \"%s\" nie zawiera kończącego znacznika \"%s\"." - #: ../libnm-util/crypto.c:277 #, c-format msgid "Failed to decode certificate." @@ -1161,7 +1302,6 @@ msgstr "Brak wystarczającej ilości pamięci do przechowania danych certyfikatu msgid "Not enough memory to store file data." msgstr "Brak wystarczającej ilości pamięci do przechowania danych pliku." - #: ../libnm-util/crypto.c:324 #, c-format msgid "IV must be an even number of bytes in length." @@ -1172,16 +1312,13 @@ msgstr "Liczba bajtów w IV musi być liczbą parzystą." msgid "Not enough memory to store the IV." msgstr "Brak wystarczającej ilości pamięci do przechowania IV." - #: ../libnm-util/crypto.c:344 #, c-format msgid "IV contains non-hexadecimal digits." msgstr "IV zawiera nieszesnastkowe cyfry." -#: ../libnm-util/crypto.c:382 -#: ../libnm-util/crypto_gnutls.c:148 -#: ../libnm-util/crypto_gnutls.c:266 -#: ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 #: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." @@ -1192,7 +1329,6 @@ msgstr "Nieznany szyfr klucza prywatnego \"%s\"." msgid "Not enough memory to decrypt private key." msgstr "Brak wystarczającej ilości pamięci do odszyfrowania klucza prywatnego." - #: ../libnm-util/crypto.c:511 #, c-format msgid "Unable to determine private key type." @@ -1201,95 +1337,85 @@ msgstr "Nie można określić typu klucza prywatnego." #: ../libnm-util/crypto.c:530 #, c-format msgid "Not enough memory to store decrypted private key." -msgstr "Brak wystarczającej ilości pamięci do przechowania odszyfrowanego klucza prywatnego." - +msgstr "" +"Brak wystarczającej ilości pamięci do przechowania odszyfrowanego klucza " +"prywatnego." #: ../libnm-util/crypto_gnutls.c:49 msgid "Failed to initialize the crypto engine." msgstr "Zainicjowanie modułu szyfrowania się nie powiodło." - #: ../libnm-util/crypto_gnutls.c:93 #, c-format msgid "Failed to initialize the MD5 engine: %s / %s." msgstr "Zainicjowanie modułu MD5 się nie powiodło: %s / %s." - #: ../libnm-util/crypto_gnutls.c:156 #, c-format msgid "Invalid IV length (must be at least %zd)." msgstr "Nieprawidłowa długość IV (musi wynosić co najmniej %zd)." -#: ../libnm-util/crypto_gnutls.c:165 -#: ../libnm-util/crypto_nss.c:188 +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 #, c-format msgid "Not enough memory for decrypted key buffer." msgstr "Brak wystarczającej ilości pamięci dla bufora odszyfrowanego klucza." - #: ../libnm-util/crypto_gnutls.c:173 #, c-format msgid "Failed to initialize the decryption cipher context: %s / %s." -msgstr "Zainicjowanie kontekstu szyfru do odszyfrowania się nie powiodło: %s / %s." - +msgstr "" +"Zainicjowanie kontekstu szyfru do odszyfrowania się nie powiodło: %s / %s." #: ../libnm-util/crypto_gnutls.c:182 #, c-format msgid "Failed to set symmetric key for decryption: %s / %s." -msgstr "Ustawienie klucza symetrycznego do odszyfrowania się nie powiodło: %s / %s." - +msgstr "" +"Ustawienie klucza symetrycznego do odszyfrowania się nie powiodło: %s / %s." #: ../libnm-util/crypto_gnutls.c:191 #, c-format msgid "Failed to set IV for decryption: %s / %s." msgstr "Ustawienie IV do odszyfrowania się nie powiodło: %s / %s." - #: ../libnm-util/crypto_gnutls.c:200 #, c-format msgid "Failed to decrypt the private key: %s / %s." msgstr "Odszyfrowanie klucza prywatnego się nie powiodło: %s / %s." - -#: ../libnm-util/crypto_gnutls.c:210 -#: ../libnm-util/crypto_nss.c:267 +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 #, c-format msgid "Failed to decrypt the private key: unexpected padding length." -msgstr "Odszyfrowanie klucza prywatnego się nie powiodło: nieoczekiwana długość wypełnienia." - +msgstr "" +"Odszyfrowanie klucza prywatnego się nie powiodło: nieoczekiwana długość " +"wypełnienia." -#: ../libnm-util/crypto_gnutls.c:221 -#: ../libnm-util/crypto_nss.c:278 +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 #, c-format msgid "Failed to decrypt the private key." msgstr "Odszyfrowanie klucza prywatnego się nie powiodło." - -#: ../libnm-util/crypto_gnutls.c:286 -#: ../libnm-util/crypto_nss.c:356 +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 #, c-format msgid "Could not allocate memory for encrypting." msgstr "Nie można przydzielić pamięci do szyfrowania." - #: ../libnm-util/crypto_gnutls.c:294 #, c-format msgid "Failed to initialize the encryption cipher context: %s / %s." -msgstr "Zainicjowanie kontekstu szyfru do szyfrowania się nie powiodło: %s / %s." - +msgstr "" +"Zainicjowanie kontekstu szyfru do szyfrowania się nie powiodło: %s / %s." #: ../libnm-util/crypto_gnutls.c:303 #, c-format msgid "Failed to set symmetric key for encryption: %s / %s." -msgstr "Ustawienie klucza symetrycznego do szyfrowania się nie powiodło: %s / %s." - +msgstr "" +"Ustawienie klucza symetrycznego do szyfrowania się nie powiodło: %s / %s." #: ../libnm-util/crypto_gnutls.c:313 #, c-format msgid "Failed to set IV for encryption: %s / %s." msgstr "Ustawienie IV do szyfrowania się nie powiodło: %s / %s." - #: ../libnm-util/crypto_gnutls.c:322 #, c-format msgid "Failed to encrypt the data: %s / %s." @@ -1300,7 +1426,6 @@ msgstr "Zaszyfrowanie danych się nie powiodło: %s / %s." msgid "Error initializing certificate data: %s" msgstr "Błąd podczas inicjowania danych certyfikatu: %s" - #: ../libnm-util/crypto_gnutls.c:384 #, c-format msgid "Couldn't decode certificate: %s" @@ -1311,121 +1436,103 @@ msgstr "Nie można zdekodować certyfikatu: %s" msgid "Couldn't initialize PKCS#12 decoder: %s" msgstr "Nie można zainicjować dekodera PKCS#12: %s" - #: ../libnm-util/crypto_gnutls.c:421 #, c-format msgid "Couldn't decode PKCS#12 file: %s" msgstr "Nie można odszyfrować pliku PKCS#12: %s" - #: ../libnm-util/crypto_gnutls.c:433 #, c-format msgid "Couldn't verify PKCS#12 file: %s" msgstr "Nie można zweryfikować pliku PKCS#12: %s" - #: ../libnm-util/crypto_nss.c:56 #, c-format msgid "Failed to initialize the crypto engine: %d." msgstr "Zainicjowanie modułu szyfrowania się nie powiodło: %d." - #: ../libnm-util/crypto_nss.c:111 #, c-format msgid "Failed to initialize the MD5 context: %d." msgstr "Zainicjowanie kontekstu MD5 się nie powiodło: %d." - #: ../libnm-util/crypto_nss.c:179 #, c-format msgid "Invalid IV length (must be at least %d)." msgstr "Nieprawidłowa długość IV (musi wynosić co najmniej %d)." - #: ../libnm-util/crypto_nss.c:196 #, c-format msgid "Failed to initialize the decryption cipher slot." msgstr "Zainicjowanie gniazda szyfru do odszyfrowania się nie powiodło." - #: ../libnm-util/crypto_nss.c:206 #, c-format msgid "Failed to set symmetric key for decryption." msgstr "Ustawienie klucza symetrycznego do odszyfrowania się nie powiodło." - #: ../libnm-util/crypto_nss.c:216 #, c-format msgid "Failed to set IV for decryption." msgstr "Ustawienie IV do odszyfrowania się nie powiodło." - #: ../libnm-util/crypto_nss.c:224 #, c-format msgid "Failed to initialize the decryption context." msgstr "Zainicjowanie kontekstu odszyfrowania się nie powiodło." - #: ../libnm-util/crypto_nss.c:237 #, c-format msgid "Failed to decrypt the private key: %d." msgstr "Odszyfrowanie klucza prywatnego się nie powiodło: %d." - #: ../libnm-util/crypto_nss.c:245 #, c-format msgid "Failed to decrypt the private key: decrypted data too large." -msgstr "Odszyfrowanie klucza prywatnego się nie powiodło: odszyfrowane dane są za duże." - +msgstr "" +"Odszyfrowanie klucza prywatnego się nie powiodło: odszyfrowane dane są za " +"duże." #: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." msgstr "Zakończenie odszyfrowania klucza prywatnego się nie powiodło: %d." - #: ../libnm-util/crypto_nss.c:364 #, c-format msgid "Failed to initialize the encryption cipher slot." msgstr "Zainicjowanie gniazda szyfru do szyfrowania się nie powiodło." - #: ../libnm-util/crypto_nss.c:372 #, c-format msgid "Failed to set symmetric key for encryption." msgstr "Ustawienie klucza symetrycznego do szyfrowania się nie powiodło." - #: ../libnm-util/crypto_nss.c:380 #, c-format msgid "Failed to set IV for encryption." msgstr "Ustawienie IV do szyfrowania się nie powiodło." - #: ../libnm-util/crypto_nss.c:388 #, c-format msgid "Failed to initialize the encryption context." msgstr "Zainicjowanie kontekstu szyfrowania się nie powiodło." - #: ../libnm-util/crypto_nss.c:396 #, c-format msgid "Failed to encrypt: %d." msgstr "Zaszyfrowanie się nie powiodło: %d." - #: ../libnm-util/crypto_nss.c:404 #, c-format msgid "Unexpected amount of data after encrypting." msgstr "Nieoczekiwana ilość danych po zaszyfrowaniu." - #: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" msgstr "Nie można zdekodować certyfikatu: %d" - #: ../libnm-util/crypto_nss.c:482 #, c-format msgid "Couldn't convert password to UCS2: %d" @@ -1436,109 +1543,200 @@ msgstr "Nie można przekonwertować hasła do UCS2: %d" msgid "Couldn't initialize PKCS#12 decoder: %d" msgstr "Nie można zainicjować dekodera PKCS#12: %d" - #: ../libnm-util/crypto_nss.c:519 #, c-format msgid "Couldn't decode PKCS#12 file: %d" msgstr "Nie można odszyfrować pliku PKCS#12: %d" - #: ../libnm-util/crypto_nss.c:528 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "Nie można zweryfikować pliku PKCS#12: %d" - #: ../libnm-util/crypto_nss.c:557 msgid "Could not generate random data." msgstr "Nie można utworzyć losowych danych." - -#: ../libnm-util/nm-utils.c:1545 +#: ../libnm-util/nm-utils.c:1975 #, c-format msgid "Not enough memory to make encryption key." msgstr "Brak wystarczającej ilości pamięci, aby utworzyć klucz szyfrowania." - -#: ../libnm-util/nm-utils.c:1655 +#: ../libnm-util/nm-utils.c:2085 msgid "Could not allocate memory for PEM file creation." msgstr "Nie można przydzielić pamięci do utworzenia pliku PEM." - -#: ../libnm-util/nm-utils.c:1667 +#: ../libnm-util/nm-utils.c:2097 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "Nie można przydzielić pamięci do zapisywania IV do pliku PEM." - -#: ../libnm-util/nm-utils.c:1679 +#: ../libnm-util/nm-utils.c:2109 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." -msgstr "Nie można przydzielić pamięci do zapisywania zaszyfrowanego klucza do pliku PEM." - +msgstr "" +"Nie można przydzielić pamięci do zapisywania zaszyfrowanego klucza do pliku " +"PEM." -#: ../libnm-util/nm-utils.c:1698 +#: ../libnm-util/nm-utils.c:2128 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "Nie można przydzielić pamięci dla danych pliku PEM." -#: ../src/nm-netlink-monitor.c:194 -#: ../src/nm-netlink-monitor.c:464 -#: ../src/nm-netlink-monitor.c:582 -#: ../src/ip6-manager/nm-netlink-listener.c:352 -#, c-format -msgid "error processing netlink message: %s" -msgstr "błąd podczas przetwarzania komunikatu netlink: %s" +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Współdzielenie połączenia przez chronioną sieć WiFi" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Współdzielenie połączenia przez otwartą sieć WiFi" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Modyfikacja trwałej systemowej nazwy komputera" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Modyfikacja połączeń systemowych" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Polityka systemu powstrzymuje modyfikację ustawień systemowych" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "" +"Polityka systemu powstrzymuje modyfikację trwałej systemowej nazwy komputera" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"Polityka systemu powstrzymuje współdzielenie połączeń przez chronioną sieć " +"WiFi" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"Polityka systemu powstrzymuje współdzielenie połączeń przez otwartą sieć WiFi" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "Umożliwienie kontroli połączeń sieciowych" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "Umożliwienie użycia połączeń użytkowników" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "Włączenie lub wyłączenie urządzeń WiFi" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "Włączenie lub wyłączenie urządzeń komórkowych" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "Włączenie lub wyłączenie sieci systemowej" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 +msgid "" +"Put NetworkManager to sleep or wake it up (should only be used by system " +"power management)" +msgstr "" +"Umieszczenie programu NetworkManager w stanie uśpienia lub przebudzenie go " +"(powinno być używane tylko przez systemowe zarządzanie zasilaniem)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +msgid "System policy prevents control of network connections" +msgstr "Polityka systemu powstrzymuje kontrolę połączeń sieciowych" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "Polityka systemu powstrzymuje włączanie lub wyłączanie urządzeń WiFi" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "" +"Polityka systemu powstrzymuje włączenie lub wyłączenie urządzeń komórkowych" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +msgid "System policy prevents enabling or disabling system networking" +msgstr "" +"Polityka systemu powstrzymuje włączanie lub wyłączanie sieci systemowej" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "" +"Polityka systemu powstrzymuje umieszczenie programu NetworkManager w stanie " +"uśpienia lub przebudzenie go" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +msgid "System policy prevents use of user-specific connections" +msgstr "Polityka systemu powstrzymuje użycie połączeń użytkownika" -#: ../src/nm-netlink-monitor.c:260 +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "nie można przydzielić uchwytu netlink dla monitorowania stanu połączenia: %s" +msgid "error processing netlink message: %s" +msgstr "błąd podczas przetwarzania komunikatu netlink: %s" +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "wystąpił błąd podczas oczekiwania na dane na gnieździe" -#: ../src/nm-netlink-monitor.c:270 +#: ../src/nm-netlink-monitor.c:254 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" -msgstr "nie można połączyć się z netlink dla monitorowania stanu połączenia: %s" - +msgstr "" +"nie można połączyć się z netlink dla monitorowania stanu połączenia: %s" -#: ../src/nm-netlink-monitor.c:278 +#: ../src/nm-netlink-monitor.c:265 #, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "nie można dołączyć do grupy netlink dla monitorowania stanu połączenia: %s" +msgid "unable to enable netlink handle credential passing: %s" +msgstr "" +"nie można włączyć przekazywania danych uwierzytelniających uchwytu netlink: " +"%s" +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"nie można przydzielić uchwytu netlink dla monitorowania stanu połączenia: %s" -#: ../src/nm-netlink-monitor.c:286 +#: ../src/nm-netlink-monitor.c:376 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" -msgstr "nie można przydzielić pamięci podręcznej połączenia netlink dla monitorowania stanu połączenia: %s" - - -#: ../src/nm-netlink-monitor.c:494 -#: ../src/ip6-manager/nm-netlink-listener.c:382 -msgid "error occurred while waiting for data on socket" -msgstr "wystąpił błąd podczas oczekiwania na dane na gnieździe" +msgstr "" +"nie można przydzielić pamięci podręcznej połączenia netlink dla " +"monitorowania stanu połączenia: %s" +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "nie można dołączyć do grupy netlink: %s" -#: ../src/nm-netlink-monitor.c:558 -#: ../src/nm-netlink-monitor.c:571 +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 #, c-format msgid "error updating link cache: %s" msgstr "błąd podczas aktualizowania pamięci podręcznej połączenia: %s" - -#: ../src/NetworkManager.c:494 +#: ../src/main.c:499 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" -msgstr "Nieprawidłowa opcja. Parametr --help wyświetli listę prawidłowych opcji.\n" +msgstr "" +"Nieprawidłowa opcja. Parametr --help wyświetli listę prawidłowych opcji.\n" +#: ../src/main.c:570 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. Parametr --help wyświetli listę prawidłowych opcji.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:300 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:328 msgid "# Created by NetworkManager\n" msgstr "# Utworzony przez program NetworkManager\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:316 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:344 #, c-format msgid "" "# Merged from %s\n" @@ -1547,70 +1745,47 @@ msgstr "" "# Scalony od %s\n" "\n" +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 +msgid "no usable DHCP client could be found." +msgstr "nie odnaleziono używalnego klienta DHCP." -#: ../src/ip6-manager/nm-netlink-listener.c:200 +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 +msgid "'dhclient' could be found." +msgstr "nie można odnaleźć polecenia \"dhclient\"." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 +msgid "'dhcpcd' could be found." +msgstr "nie można odnaleźć usługi \"dhcpcd\"." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 #, c-format -msgid "unable to allocate netlink handle: %s" -msgstr "nie można przydzielić uchwytu netlink: %s" +msgid "unsupported DHCP client '%s'" +msgstr "nieobsługiwany klient DHCP \"%s\"" -#: ../src/ip6-manager/nm-netlink-listener.c:210 +#: ../src/logging/nm-logging.c:146 #, c-format -msgid "unable to connect to netlink: %s" -msgstr "nie można połączyć się z netlink: %s" +msgid "Unknown log level '%s'" +msgstr "Nieznany poziom dziennika \"%s\"" -#: ../src/ip6-manager/nm-netlink-listener.c:307 +#: ../src/logging/nm-logging.c:171 #, c-format -msgid "unable to join netlink group: %s" -msgstr "nie można dołączyć do grupy netlink: %s" +msgid "Unknown log domain '%s'" +msgstr "Nieznana domena dziennika \"%s\"" -#: ../src/dns-manager/nm-dns-manager.c:315 +#: ../src/dns-manager/nm-dns-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "UWAGA: obsługa nazw libc nie obsługuje więcej niż 3 serwery nazw." -#: ../src/dns-manager/nm-dns-manager.c:317 +#: ../src/dns-manager/nm-dns-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "Poniższe serwery nazw nie mogą nie zostać rozpoznane." - #: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" msgstr "Automatyczne %s" - -#: ../system-settings/plugins/ifcfg-rh/reader.c:3213 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3412 +#: ../system-settings/plugins/ifnet/connection_parser.c:49 msgid "System" msgstr "Systemowe" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 -msgid "Connection sharing via a protected WiFi network" -msgstr "Współdzielenie połączenia przez chronioną sieć WiFi" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 -msgid "Connection sharing via an open WiFi network" -msgstr "Współdzielenie połączenia przez otwartą sieć WiFi" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 -msgid "Modify persistent system hostname" -msgstr "Modyfikacja trwałej systemowej nazwy komputera" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 -msgid "Modify system connections" -msgstr "Modyfikacja połączeń systemowych" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 -msgid "System policy prevents modification of system settings" -msgstr "Polityka systemu powstrzymuje modyfikację ustawień systemowych" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 -msgid "System policy prevents modification of the persistent system hostname" -msgstr "Polityka systemu powstrzymuje modyfikację trwałej systemowej nazwy komputera" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 -msgid "System policy prevents sharing connections via a protected WiFi network" -msgstr "Polityka systemu powstrzymuje współdzielenie połączeń przez chronioną sieć WiFi" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 -msgid "System policy prevents sharing connections via an open WiFi network" -msgstr "Polityka systemu powstrzymuje współdzielenie połączeń przez otwartą sieć WiFi" - -- cgit v1.2.1 From c35a763c17004f406e76de77e344d8f505fe45b9 Mon Sep 17 00:00:00 2001 From: Gabor Kelemen Date: Wed, 6 Oct 2010 15:51:27 -0500 Subject: po: update Hungarian translation (bgo #631186) --- po/hu.po | 1499 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 1399 insertions(+), 100 deletions(-) diff --git a/po/hu.po b/po/hu.po index f71625495e..0ca4386f29 100644 --- a/po/hu.po +++ b/po/hu.po @@ -7,16 +7,1234 @@ msgid "" msgstr "" "Project-Id-Version: NetworkManager master\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2009-09-29 03:25+0000\n" -"PO-Revision-Date: 2010-01-03 14:57+0100\n" +"POT-Creation-Date: 2010-09-22 03:25+0000\n" +"PO-Revision-Date: 2010-10-02 20:50+0200\n" "Last-Translator: Gabor Kelemen \n" "Language-Team: Hungarian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Launchpad-Export-Date: 2010-10-02 18:28+0000\n" "X-Generator: KBabel 1.11.4\n" +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/devices.c:88 ../cli/src/devices.c:101 ../cli/src/devices.c:111 +#: ../cli/src/devices.c:121 ../cli/src/devices.c:134 ../cli/src/devices.c:145 +#: ../cli/src/devices.c:156 ../cli/src/devices.c:165 ../cli/src/devices.c:174 +msgid "NAME" +msgstr "NÉV" + +#. 0 +#: ../cli/src/connections.c:61 ../cli/src/connections.c:76 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:62 +msgid "DEVICES" +msgstr "ESZKÖZÖK" + +#. 2 +#: ../cli/src/connections.c:63 ../cli/src/connections.c:78 +msgid "SCOPE" +msgstr "HATÓKÖR" + +#. 3 +#: ../cli/src/connections.c:64 +msgid "DEFAULT" +msgstr "ALAPÉRTELMEZETT" + +#. 4 +#: ../cli/src/connections.c:65 +msgid "DBUS-SERVICE" +msgstr "DBUS-SZOLGÁLTATÁS" + +#. 5 +#: ../cli/src/connections.c:66 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJEKTUM" + +#. 6 +#: ../cli/src/connections.c:67 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:77 ../cli/src/devices.c:62 ../cli/src/devices.c:90 +msgid "TYPE" +msgstr "TÍPUS" + +#. 3 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP" +msgstr "IDŐBÉLYEG" + +#. 4 +#: ../cli/src/connections.c:80 +msgid "TIMESTAMP-REAL" +msgstr "IDŐBÉLYEG-VALÓDI" + +#. 5 +#: ../cli/src/connections.c:81 +msgid "AUTOCONNECT" +msgstr "AUTO-CSATLAKOZÁS" + +#. 6 +#: ../cli/src/connections.c:82 +msgid "READONLY" +msgstr "CSAK OLVASHATÓ" + +#. 7 +#: ../cli/src/connections.c:83 +msgid "DBUS-PATH" +msgstr "DBUS-ÚTVONAL" + +#: ../cli/src/connections.c:159 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Használat: nmcli con { PARANCS | help }\n" +" PARANCS := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--" +"nowait] [--timeout ]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:540 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Hiba: „con list”: %s" + +#: ../cli/src/connections.c:201 ../cli/src/connections.c:542 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Hiba: „con list”: %s; engedélyezett mezők: %s" + +#: ../cli/src/connections.c:209 +msgid "Connection details" +msgstr "Kapcsolat részletei" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:605 +msgid "system" +msgstr "rendszer" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:605 +msgid "user" +msgstr "felhasználó" + +#: ../cli/src/connections.c:386 +msgid "never" +msgstr "soha" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:387 ../cli/src/connections.c:388 +#: ../cli/src/connections.c:606 ../cli/src/connections.c:609 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:551 ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 +msgid "yes" +msgstr "igen" + +#: ../cli/src/connections.c:387 ../cli/src/connections.c:388 +#: ../cli/src/connections.c:606 ../cli/src/connections.c:609 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:510 ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 ../cli/src/settings.c:1224 +msgid "no" +msgstr "nem" + +#: ../cli/src/connections.c:461 ../cli/src/connections.c:504 +msgid "System connections" +msgstr "Rendszerkapcsolatok" + +#: ../cli/src/connections.c:466 ../cli/src/connections.c:517 +msgid "User connections" +msgstr "Felhasználói kapcsolatok" + +#: ../cli/src/connections.c:478 ../cli/src/connections.c:1338 +#: ../cli/src/connections.c:1354 ../cli/src/connections.c:1363 +#: ../cli/src/connections.c:1374 ../cli/src/connections.c:1459 +#: ../cli/src/devices.c:962 ../cli/src/devices.c:972 ../cli/src/devices.c:1074 +#: ../cli/src/devices.c:1081 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Hiba: az argumentum (%s) hiányzik." + +#: ../cli/src/connections.c:491 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Hiba: nincs ilyen kapcsolat: %s." + +#: ../cli/src/connections.c:523 ../cli/src/connections.c:1387 +#: ../cli/src/connections.c:1477 ../cli/src/devices.c:785 +#: ../cli/src/devices.c:852 ../cli/src/devices.c:986 ../cli/src/devices.c:1087 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Ismeretlen paraméter: %s\n" + +#: ../cli/src/connections.c:532 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Hiba: nincs megadva érvényes paraméter." + +#: ../cli/src/connections.c:547 ../cli/src/connections.c:1580 +#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:359 +#, c-format +msgid "Error: %s." +msgstr "Hiba: %s." + +#: ../cli/src/connections.c:653 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Hiba: „con status”: %s" + +#: ../cli/src/connections.c:655 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Hiba: „con status”: %s; engedélyezett mezők: %s" + +#: ../cli/src/connections.c:662 +msgid "Active connections" +msgstr "Aktív kapcsolatok" + +#: ../cli/src/connections.c:1030 +#, c-format +msgid "no active connection on device '%s'" +msgstr "nincs aktív kapcsolat a(z) „%s” eszközön" + +#: ../cli/src/connections.c:1038 +#, c-format +msgid "no active connection or device" +msgstr "nincs aktív kapcsolat vagy eszköz" + +#: ../cli/src/connections.c:1088 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "a(z) „%s” eszköz nem kompatibilis a(z) „%s” kapcsolattal" + +#: ../cli/src/connections.c:1090 +#, c-format +msgid "no device found for connection '%s'" +msgstr "nem található eszköz a(z) „%s” kapcsolathoz" + +#: ../cli/src/connections.c:1101 +msgid "activating" +msgstr "aktiválás" + +#: ../cli/src/connections.c:1103 +msgid "activated" +msgstr "aktiválva" + +#: ../cli/src/connections.c:1106 ../cli/src/connections.c:1129 +#: ../cli/src/connections.c:1162 ../cli/src/devices.c:246 +#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:149 ../cli/src/settings.c:473 +msgid "unknown" +msgstr "ismeretlen" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting (prepare)" +msgstr "VPN kapcsolódás (előkészítés)" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (need authentication)" +msgstr "VPN csatlakozás (hitelesítés szükséges)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connecting" +msgstr "VPN csatlakozás" + +#: ../cli/src/connections.c:1121 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN kapcsolódás (IP-beállítások lekérése)" + +#: ../cli/src/connections.c:1123 +msgid "VPN connected" +msgstr "VPN csatlakozott" + +#: ../cli/src/connections.c:1125 +msgid "VPN connection failed" +msgstr "VPN csatlakozás sikertelen" + +#: ../cli/src/connections.c:1127 +msgid "VPN disconnected" +msgstr "VPN leválasztva" + +#: ../cli/src/connections.c:1138 +msgid "unknown reason" +msgstr "ismeretlen ok" + +#: ../cli/src/connections.c:1140 +msgid "none" +msgstr "nincs" + +#: ../cli/src/connections.c:1142 +msgid "the user was disconnected" +msgstr "felhasználó leválasztva" + +#: ../cli/src/connections.c:1144 +msgid "the base network connection was interrupted" +msgstr "az alap hálózati kapcsolat megszakadt" + +#: ../cli/src/connections.c:1146 +msgid "the VPN service stopped unexpectedly" +msgstr "a VPN szolgáltatás váratlanul leállt" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service returned invalid configuration" +msgstr "a VPN szolgáltatás érvénytelen beállításokat adott" + +#: ../cli/src/connections.c:1150 +msgid "the connection attempt timed out" +msgstr "a csatlakozási kísérlet túllépte az időkorlátot" + +#: ../cli/src/connections.c:1152 +msgid "the VPN service did not start in time" +msgstr "a VPN szolgáltatás nem indult el időben" + +#: ../cli/src/connections.c:1154 +msgid "the VPN service failed to start" +msgstr "a VPN szolgáltatás nem indult el" + +#: ../cli/src/connections.c:1156 +msgid "no valid VPN secrets" +msgstr "nincsenek érvényes VPN titkok" + +#: ../cli/src/connections.c:1158 +msgid "invalid VPN secrets" +msgstr "érvénytelen VPN titkok" + +#: ../cli/src/connections.c:1160 +msgid "the connection was removed" +msgstr "a kapcsolat eltávolításra került" + +#: ../cli/src/connections.c:1174 +#, c-format +msgid "state: %s\n" +msgstr "állapot: %s\n" + +#: ../cli/src/connections.c:1177 ../cli/src/connections.c:1203 +#, c-format +msgid "Connection activated\n" +msgstr "Kapcsolat aktiválva\n" + +#: ../cli/src/connections.c:1180 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Hiba: a kapcsolat aktiválása meghiúsult." + +#: ../cli/src/connections.c:1199 +#, c-format +msgid "state: %s (%d)\n" +msgstr "állapot: %s (%d)\n" + +#: ../cli/src/connections.c:1209 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Hiba: a kapcsolat aktiválása meghiúsult: %s." + +#: ../cli/src/connections.c:1226 ../cli/src/devices.c:909 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Hiba: az időkorlát (%d mp) lejárt." + +#: ../cli/src/connections.c:1269 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Hiba: a kapcsolat aktiválása meghiúsult: %s" + +#: ../cli/src/connections.c:1283 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Hiba: az aktív kapcsolat létrehozása meghiúsult ehhez: „%s”." + +#: ../cli/src/connections.c:1292 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Aktív kapcsolat állapota: %s\n" + +#: ../cli/src/connections.c:1293 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Aktív kapcsolat útvonala: %s\n" + +#: ../cli/src/connections.c:1347 ../cli/src/connections.c:1468 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Hiba: ismeretlen kapcsolat: %s." + +#: ../cli/src/connections.c:1382 ../cli/src/devices.c:980 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Hiba: a(z) „%s” időkorlát érvénytelen." + +#: ../cli/src/connections.c:1395 ../cli/src/connections.c:1485 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Hiba: meg kell adni az id vagy uuid egyikét." + +#: ../cli/src/connections.c:1415 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Hiba: nem található megfelelő eszköz: %s." + +#: ../cli/src/connections.c:1417 +#, c-format +msgid "Error: No suitable device found." +msgstr "Hiba: nem található megfelelő eszköz." + +#: ../cli/src/connections.c:1512 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Figyelmeztetés: a kapcsolat nem aktív\n" + +#: ../cli/src/connections.c:1569 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Hiba: a(z) „%s” „con” parancs nem érvényes." + +#: ../cli/src/connections.c:1605 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Hiba: nem lehet a D-Bushoz kapcsolódni." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Hiba: a rendszer beállításai nem kérhetők le." + +#: ../cli/src/connections.c:1620 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Hiba: a felhasználó beállításai nem kérhetők le." + +#: ../cli/src/connections.c:1630 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "Hiba: nem kérhetők le a kapcsolatok: a beállítószolgáltatások nem futnak." + +#. 0 +#. 9 +#: ../cli/src/devices.c:61 ../cli/src/devices.c:89 ../cli/src/devices.c:184 +msgid "DEVICE" +msgstr "ESZKÖZ" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:63 ../cli/src/devices.c:93 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "ÁLLAPOT" + +#: ../cli/src/devices.c:72 +msgid "GENERAL" +msgstr "ÁLTALÁNOS" + +#. 0 +#: ../cli/src/devices.c:73 +msgid "CAPABILITIES" +msgstr "KÉPESSÉGEK" + +#. 1 +#: ../cli/src/devices.c:74 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-KÉPESSÉGEK" + +#. 2 +#: ../cli/src/devices.c:75 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:76 +msgid "WIRED-PROPERTIES" +msgstr "VEZETÉKES-TULAJDONSÁGOK" + +#. 4 +#: ../cli/src/devices.c:77 +msgid "IP4-SETTINGS" +msgstr "IP4-BEÁLLÍTÁSOK" + +#. 5 +#: ../cli/src/devices.c:78 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 6 +#: ../cli/src/devices.c:79 +msgid "IP6-SETTINGS" +msgstr "IP6-BEÁLLÍTÁSOK" + +#. 7 +#: ../cli/src/devices.c:80 +msgid "IP6-DNS" +msgstr "IP6-DNS" + +#. 2 +#: ../cli/src/devices.c:91 +msgid "DRIVER" +msgstr "ILLESZTŐPROGRAM" + +#. 3 +#: ../cli/src/devices.c:92 +msgid "HWADDR" +msgstr "HWCÍM" + +#. 0 +#: ../cli/src/devices.c:102 +msgid "CARRIER-DETECT" +msgstr "HORDOZÓ-FELISMERÉS" + +#. 1 +#: ../cli/src/devices.c:103 +msgid "SPEED" +msgstr "SEBESSÉG" + +#. 0 +#: ../cli/src/devices.c:112 +msgid "CARRIER" +msgstr "HORDOZÓ" + +#. 0 +#: ../cli/src/devices.c:122 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:123 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:124 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:125 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:126 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:135 ../cli/src/devices.c:146 +msgid "ADDRESS" +msgstr "CÍM" + +#. 1 +#: ../cli/src/devices.c:136 ../cli/src/devices.c:147 +msgid "PREFIX" +msgstr "ELŐTAG" + +#. 2 +#: ../cli/src/devices.c:137 ../cli/src/devices.c:148 +msgid "GATEWAY" +msgstr "ÁTJÁRÓ" + +#. 0 +#: ../cli/src/devices.c:157 ../cli/src/devices.c:166 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:175 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:176 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:177 +msgid "MODE" +msgstr "MÓD" + +#. 3 +#: ../cli/src/devices.c:178 +msgid "FREQ" +msgstr "FREK" + +#. 4 +#: ../cli/src/devices.c:179 +msgid "RATE" +msgstr "SEBESSÉG" + +#. 5 +#: ../cli/src/devices.c:180 +msgid "SIGNAL" +msgstr "SZIGNÁL" + +#. 6 +#: ../cli/src/devices.c:181 +msgid "SECURITY" +msgstr "BIZTONSÁG" + +#. 7 +#: ../cli/src/devices.c:182 +msgid "WPA-FLAGS" +msgstr "WPA-JELZŐK" + +#. 8 +#: ../cli/src/devices.c:183 +msgid "RSN-FLAGS" +msgstr "RSN-JELZŐK" + +#. 10 +#: ../cli/src/devices.c:185 +msgid "ACTIVE" +msgstr "AKTÍV" + +#: ../cli/src/devices.c:208 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"Használat: nmcli dev { PARANCS | help }\n" +"\n" +" PARANCS := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:228 +msgid "unmanaged" +msgstr "kezeletlen" + +#: ../cli/src/devices.c:230 +msgid "unavailable" +msgstr "elérhetetlen" + +#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:91 +msgid "disconnected" +msgstr "leválasztva" + +#: ../cli/src/devices.c:234 +msgid "connecting (prepare)" +msgstr "kapcsolódás (előkészítés)" + +#: ../cli/src/devices.c:236 +msgid "connecting (configuring)" +msgstr "kapcsolódás (konfigurálás)" + +#: ../cli/src/devices.c:238 +msgid "connecting (need authentication)" +msgstr "kapcsolódás (hitelesítés szükséges)" + +#: ../cli/src/devices.c:240 +msgid "connecting (getting IP configuration)" +msgstr "kapcsolódás (IP-beállítások lekérése)" + +#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:89 +msgid "connected" +msgstr "kapcsolódva" + +#: ../cli/src/devices.c:244 +msgid "connection failed" +msgstr "kapcsolódás sikertelen" + +#: ../cli/src/devices.c:267 ../cli/src/devices.c:424 +msgid "Unknown" +msgstr "Ismeretlen" + +#: ../cli/src/devices.c:299 +msgid "(none)" +msgstr "(semmi)" + +#: ../cli/src/devices.c:324 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: hiba az IP4 cím (0x%X) konvertálásakor" + +#: ../cli/src/devices.c:393 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:394 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:403 +msgid "Encrypted: " +msgstr "Titkosított: " + +#: ../cli/src/devices.c:408 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:410 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:412 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:415 +msgid "Enterprise " +msgstr "Enterprise " + +#: ../cli/src/devices.c:424 +msgid "Ad-Hoc" +msgstr "Eseti" + +#: ../cli/src/devices.c:424 +msgid "Infrastructure" +msgstr "Infrastruktúra" + +#: ../cli/src/devices.c:486 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "Hiba: „dev list”: %s" + +#: ../cli/src/devices.c:488 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Hiba: „dev list”: %s; engedélyezett mezők: %s" + +#: ../cli/src/devices.c:497 +msgid "Device details" +msgstr "Eszköz részletei" + +#: ../cli/src/devices.c:527 ../cli/src/devices.c:925 +msgid "(unknown)" +msgstr "(ismeretlen)" + +#: ../cli/src/devices.c:528 +msgid "unknown)" +msgstr "ismeretlen)" + +#: ../cli/src/devices.c:554 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:627 +msgid "on" +msgstr "be" + +#: ../cli/src/devices.c:627 +msgid "off" +msgstr "ki" + +#: ../cli/src/devices.c:808 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "Hiba: „dev status”: %s" + +#: ../cli/src/devices.c:810 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Hiba: „dev status”: %s; engedélyezett mezők: %s" + +#: ../cli/src/devices.c:817 +msgid "Status of devices" +msgstr "Eszközök állapota" + +#: ../cli/src/devices.c:845 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Hiba: „%s” argumentum hiányzik." + +#: ../cli/src/devices.c:874 ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Hiba: a(z) „%s” eszköz nem található." + +#: ../cli/src/devices.c:897 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Siker: a(z) „%s” eszköz sikeresen leválasztva." + +#: ../cli/src/devices.c:922 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Hiba: a(z) „%s” (%s) eszköz leválasztása meghiúsult: %s" + +#: ../cli/src/devices.c:930 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Eszköz állapota: %d (%s)\n" + +#: ../cli/src/devices.c:994 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Hiba: meg kell adni a csatolót." + +#: ../cli/src/devices.c:1112 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "Hiba: „dev wifi”: %s" + +#: ../cli/src/devices.c:1114 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Hiba: „dev wifi”: %s; engedélyezett mezők: %s" + +#: ../cli/src/devices.c:1121 +msgid "WiFi scan list" +msgstr "WiFi-keresési lista" + +#: ../cli/src/devices.c:1156 ../cli/src/devices.c:1210 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Hiba: nem található a(z) „%s” hwcímű hozzáférési pont," + +#: ../cli/src/devices.c:1173 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Hiba: a(z) „%s” eszköz nem WiFi-eszköz." + +#: ../cli/src/devices.c:1237 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Hiba: a „dev wifi” parancs („%s) nem érvényes." + +#: ../cli/src/devices.c:1284 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Hiba: a „dev” parancs („%s) nem érvényes." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "FUT" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "NET-ENABLED" +msgstr "NET-KÉPES" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDVER" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WIFI" +msgstr "WIFI" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDVER" + +#. 5 +#: ../cli/src/network-manager.c:41 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:64 +#, c-format +#| msgid "" +#| "Usage: nmcli nm { COMMAND | help }\n" +#| "\n" +#| " COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +#| "\n" +#| " status\n" +#| " sleep\n" +#| " wakeup\n" +#| " wifi [on|off]\n" +#| " wwan [on|off]\n" +#| "\n" +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | enable | sleep | wifi | wwan }\n" +"\n" +" status\n" +" enable [true|false]\n" +" sleep [true|false]\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Használat: nmcli nm { PARANCS | help }\n" +"\n" +" PARANCS := { status | enable | sleep | wifi | wwan }\n" +"\n" +" status\n" +" enable [true|false]\n" +" sleep [true|false]\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:85 +msgid "asleep" +msgstr "alszik" + +#: ../cli/src/network-manager.c:87 +msgid "connecting" +msgstr "csatlakozás" + +#: ../cli/src/network-manager.c:128 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Hiba: „nm status”: %s" + +#: ../cli/src/network-manager.c:130 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Hiba: „nm status”: %s; engedélyezett mezők: %s" + +#: ../cli/src/network-manager.c:137 +msgid "NetworkManager status" +msgstr "Hálózatkezelő állapota" + +#. Print header +#: ../cli/src/network-manager.c:144 ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 ../cli/src/network-manager.c:328 +msgid "enabled" +msgstr "engedélyezve" + +#: ../cli/src/network-manager.c:144 ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 ../cli/src/network-manager.c:328 +msgid "disabled" +msgstr "letiltva" + +#: ../cli/src/network-manager.c:152 +msgid "running" +msgstr "fut" + +#: ../cli/src/network-manager.c:152 +msgid "not running" +msgstr "nem fut" + +#: ../cli/src/network-manager.c:175 +#, c-format +#| msgid "Error: could not connect to D-Bus." +msgid "Error: Couldn't connect to system bus: %s" +msgstr "Hiba: nem lehet a rendszerbuszhoz kapcsolódni: %s" + +#: ../cli/src/network-manager.c:186 +#, c-format +#| msgid "Error: could not connect to D-Bus." +msgid "Error: Couldn't create D-Bus object proxy." +msgstr "Hiba: nem lehet a D-Bus objektumproxyhoz kapcsolódni." + +#: ../cli/src/network-manager.c:192 +#, c-format +#| msgid "Error: 'con list': %s" +msgid "Error in sleep: %s" +msgstr "Hiba az alváskor: %s" + +#: ../cli/src/network-manager.c:237 ../cli/src/network-manager.c:286 +#: ../cli/src/network-manager.c:318 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Hiba: a(z) „%s” „--fields” érték itt nem érvényes; engedélyezett mezők: %s" + +#: ../cli/src/network-manager.c:245 +#| msgid "WiFi enabled" +msgid "Networking enabled" +msgstr "Hálózatkezelés engedélyezve" + +#: ../cli/src/network-manager.c:256 +#, c-format +#| msgid "Error: invalid 'wwan' parameter: '%s'." +msgid "Error: invalid 'enable' parameter: '%s'; use 'true' or 'false'." +msgstr "Hiba: érvénytelen „enable” paraméter: „%s”; használja a „true” vagy „false” egyikét." + +#: ../cli/src/network-manager.c:265 +#, c-format +#| msgid "Error: Could not connect to NetworkManager." +msgid "Error: Sleeping status is not exported by NetworkManager." +msgstr "Hiba: a Hálózatkezelő nem exportálta az alvási állapotot." + +#: ../cli/src/network-manager.c:273 +#, c-format +#| msgid "Error: invalid 'wifi' parameter: '%s'." +msgid "Error: invalid 'sleep' parameter: '%s'; use 'true' or 'false'." +msgstr "Hiba: érvénytelen „sleep” paraméter: „%s”; használja a „true” vagy „false” egyikét." + +#: ../cli/src/network-manager.c:294 +msgid "WiFi enabled" +msgstr "WiFi engedélyezve" + +#: ../cli/src/network-manager.c:305 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Hiba: érvénytelen „wifi” paraméter: „%s”." + +#: ../cli/src/network-manager.c:326 +msgid "WWAN enabled" +msgstr "WWAN engedélyezve" + +#: ../cli/src/network-manager.c:337 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Hiba: érvénytelen „wwan” paraméter: „%s”." + +#: ../cli/src/network-manager.c:348 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Hiba: a(z) „%s” „nm” parancs nem érvényes." + +#: ../cli/src/nmcli.c:69 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Használat: %s [KAPCSOLÓK] OBJEKTUM { PARANCS | help }\n" +"\n" +"KAPCSOLÓK\n" +" -t[erse] tömör kimenet\n" +" -p[retty] szép kimenet\n" +" -m[ode] tabular|multiline kimeneti mód\n" +" -f[ields] |all|common kiírandó mezők megadása\n" +" -e[scape] yes|no oszlopelválasztók escape-lése " +"az értékekben\n" +" -v[ersion] programverzió kiírása\n" +" -h[elp] ezen súgó kiírása\n" +"\n" +"OBJEKTUM\n" +" nm Hálózatkezelő állapota\n" +" con Hálózatkezelő kapcsolatai\n" +" dev A Hálózatkezelő által kezelt eszközök\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Hiba: a(z) „%s” objektum ismeretlen, adja ki az „nmcli help” parancsot." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Hiba: a „--terse” kapcsoló másodszor lett megadva." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Hiba: a „--terse” és a „--pretty” kapcsolók kölcsönösen kizáróak." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Hiba: a „--pretty” kapcsoló másodszor lett megadva." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Hiba: a „--pretty” és „--terse” kapcsolók kölcsönösen kizáróak." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Hiba: a(z) „%s” kapcsoló argumentuma hiányzik." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Hiba: „%s” nem érvényes argumentum a(z) „%s” kapcsolóhoz." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Hiba: a(z) „%s” kapcsoló mezői hiányoznak." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli eszköz, %s verzió\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Hiba: a(z) „%s” kapcsoló ismeretlen, adja ki az „nmcli-help” parancsot." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "%d szignál érkezett, leállítás…" + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Hiba: nem lehet kapcsolódni a Hálózatkezelőhöz." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "Siker" + +#: ../cli/src/settings.c:411 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-kulcs)" + +#: ../cli/src/settings.c:413 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128 bites jelmondat)" + +#: ../cli/src/settings.c:416 +#, c-format +msgid "%d (unknown)" +msgstr "%d (ismeretlen)" + +#: ../cli/src/settings.c:442 +msgid "0 (unknown)" +msgstr "0 (ismeretlen)" + +#: ../cli/src/settings.c:448 +msgid "any, " +msgstr "bármely, " + +#: ../cli/src/settings.c:450 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:454 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:456 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:468 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:470 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:554 ../cli/src/settings.c:721 +msgid "auto" +msgstr "auto" + +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 +msgid "not set" +msgstr "nincs beállítva" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "a(z) „%s” mezőnek önállónak kell lennie" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "érvénytelen mező: „%s”" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "A „--terse” megköveteli a „--fields” megadását." + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "A „--terse” adott „--fields” kapcsolóértékeket követel meg, nem ezt: „%s”." + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." @@ -104,7 +1322,7 @@ msgstr "Az IV nem hexadecimális számjegyeket tartalmaz." #: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 #: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 -#: ../libnm-util/crypto_nss.c:335 +#: ../libnm-util/crypto_nss.c:336 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "A(z) „%s” személyeskulcs-titkosító ismeretlen." @@ -163,17 +1381,17 @@ msgstr "Az IV beállítása meghiúsult a visszafejtéshez: %s / %s." msgid "Failed to decrypt the private key: %s / %s." msgstr "A személyes kulcs visszafejtése meghiúsult: %s / %s." -#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:266 +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 #, c-format msgid "Failed to decrypt the private key: unexpected padding length." msgstr "A személyes kulcs visszafejtése meghiúsult: váratlan kitöltéshossz." -#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:277 +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 #, c-format msgid "Failed to decrypt the private key." msgstr "A személyes kulcs visszafejtése meghiúsult." -#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:355 +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 #, c-format msgid "Could not allocate memory for encrypting." msgstr "Nem sikerült memóriát foglalni a titkosításhoz." @@ -223,7 +1441,7 @@ msgstr "A PKCS#12 fájl nem fejthető vissza: %s" msgid "Couldn't verify PKCS#12 file: %s" msgstr "A PKCS#12 fájl nem ellenőrizhető: %s" -#: ../libnm-util/crypto_nss.c:57 +#: ../libnm-util/crypto_nss.c:56 #, c-format msgid "Failed to initialize the crypto engine: %d." msgstr "A titkosító alrendszer előkészítése meghiúsult: %d." @@ -266,153 +1484,259 @@ msgstr "A személyes kulcs visszafejtése meghiúsult: %d." #: ../libnm-util/crypto_nss.c:245 #, c-format msgid "Failed to decrypt the private key: decrypted data too large." -msgstr "A személyes kulcs visszafejtése meghiúsult: a visszafejtett adatok túl nagyok." +msgstr "" +"A személyes kulcs visszafejtése meghiúsult: a visszafejtett adatok túl " +"nagyok." #: ../libnm-util/crypto_nss.c:256 #, c-format msgid "Failed to finalize decryption of the private key: %d." msgstr "A személyes kulcs visszafejtésének befejezése meghiúsult: %d." -#: ../libnm-util/crypto_nss.c:363 +#: ../libnm-util/crypto_nss.c:364 #, c-format msgid "Failed to initialize the encryption cipher slot." msgstr "A titkosítóhely előkészítése meghiúsult." -#: ../libnm-util/crypto_nss.c:371 +#: ../libnm-util/crypto_nss.c:372 #, c-format msgid "Failed to set symmetric key for encryption." msgstr "A szimmetrikus kulcs nem állítható be a titkosításhoz." -#: ../libnm-util/crypto_nss.c:379 +#: ../libnm-util/crypto_nss.c:380 #, c-format msgid "Failed to set IV for encryption." msgstr "Az IV nem állítható be a titkosításhoz." -#: ../libnm-util/crypto_nss.c:387 +#: ../libnm-util/crypto_nss.c:388 #, c-format msgid "Failed to initialize the encryption context." msgstr "A titkosítási kontextus előkészítése meghiúsult." -#: ../libnm-util/crypto_nss.c:395 +#: ../libnm-util/crypto_nss.c:396 #, c-format msgid "Failed to encrypt: %d." msgstr "A titkosítás meghiúsult: %d." -#: ../libnm-util/crypto_nss.c:403 +#: ../libnm-util/crypto_nss.c:404 #, c-format msgid "Unexpected amount of data after encrypting." msgstr "Váratlan mennyiségű adat a titkosítás után." -#: ../libnm-util/crypto_nss.c:446 +#: ../libnm-util/crypto_nss.c:447 #, c-format msgid "Couldn't decode certificate: %d" msgstr "A tanúsítvány nem fejthető vissza: %d" -#: ../libnm-util/crypto_nss.c:481 +#: ../libnm-util/crypto_nss.c:482 #, c-format msgid "Couldn't convert password to UCS2: %d" msgstr "A jelszó nem alakítható UCS2 formátumra: %d" -#: ../libnm-util/crypto_nss.c:509 +#: ../libnm-util/crypto_nss.c:510 #, c-format msgid "Couldn't initialize PKCS#12 decoder: %d" msgstr "A PKCS#12 dekódoló nem készíthető elő: %d" -#: ../libnm-util/crypto_nss.c:518 +#: ../libnm-util/crypto_nss.c:519 #, c-format msgid "Couldn't decode PKCS#12 file: %d" msgstr "A PKCS#12 fájl nem fejthető vissza: %d" -#: ../libnm-util/crypto_nss.c:527 +#: ../libnm-util/crypto_nss.c:528 #, c-format msgid "Couldn't verify PKCS#12 file: %d" msgstr "A PKCS#12 fájl nem ellenőrizhető: %d" -#: ../libnm-util/crypto_nss.c:556 +#: ../libnm-util/crypto_nss.c:557 msgid "Could not generate random data." msgstr "Nem sikerült a véletlen adatok előállítása." -#: ../libnm-util/nm-utils.c:1522 +#: ../libnm-util/nm-utils.c:1975 #, c-format msgid "Not enough memory to make encryption key." msgstr "Nincs elég memória titkosítási kulcs készítéséhez." -#: ../libnm-util/nm-utils.c:1633 +#: ../libnm-util/nm-utils.c:2085 msgid "Could not allocate memory for PEM file creation." msgstr "Nem sikerült memóriát foglalni PEM fájl készítéséhez." -#: ../libnm-util/nm-utils.c:1645 +#: ../libnm-util/nm-utils.c:2097 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "Nem sikerült memóriát foglalni az IV írásához PEM fájlba." -#: ../libnm-util/nm-utils.c:1657 +#: ../libnm-util/nm-utils.c:2109 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "Nem sikerült memóriát foglalni a titkosított kulcs PEM fájlba írásához." -#: ../libnm-util/nm-utils.c:1676 +#: ../libnm-util/nm-utils.c:2128 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "Nem sikerült memóriát foglalni a PEM fájl adatainak." -#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 -#: ../src/nm-netlink-monitor.c:569 -#: ../src/ip6-manager/nm-netlink-listener.c:352 +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Kapcsolatmegosztás védett WiFi hálózaton" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Kapcsolatmegosztás nyílt WiFi hálózaton" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Állandó rendszergépnév módosítása" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Rendszerkapcsolatok módosítása" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "A rendszer házirendje megakadályozza a rendszerbeállítások módosítását" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "" +"A rendszer házirendje megakadályozza a rendszer állandó gépnevének " +"módosítását" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"A rendszer házirendje megakadályozza a kapcsolatok megosztását védett WiFi " +"hálózaton" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"A rendszer házirendje megakadályozza a kapcsolatok megosztását nyílt WiFi " +"hálózaton" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "Hálózati kapcsolatok felügyeletének engedélyezése" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "Felhasználói szintű kapcsolatok engedélyezése" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "WiFi eszközök be- és kikapcsolása" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "Mobil széles sávú eszközök be- és kikapcsolása" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "Rendszer hálózatkezelésének be- és kikapcsolása" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 +msgid "" +"Put NetworkManager to sleep or wake it up (should only be used by system " +"power management)" +msgstr "" +"Hálózatkezelő elaltatása vagy felébresztése (csak a rendszer " +"energiagazdálkodása által használandó)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +msgid "System policy prevents control of network connections" +msgstr "A rendszer házirendje megakadályozza a hálózati kapcsolatok felügyeletét" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "A rendszer házirendje megakadályozza a WiFi eszközök be- vagy kikapcsolását" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "" +"A rendszer házirendje megakadályozza a mobil széles sávú eszközök be- vagy " +"kikapcsolását" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +msgid "System policy prevents enabling or disabling system networking" +msgstr "" +"A rendszer házirendje megakadályozza a rendszer hálózatkezelésének be- vagy " +"kikapcsolását" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "" +"A rendszer házirendje megakadályozza a Hálózatkezelő elaltatását vagy " +"felébresztését" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +msgid "System policy prevents use of user-specific connections" +msgstr "A rendszer házirendje megakadályozza a felhasználói kapcsolatok használatát" + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format msgid "error processing netlink message: %s" msgstr "hiba a netlink üzenet feldolgozásakor: %s" -#: ../src/nm-netlink-monitor.c:260 -#, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "" -"nem lehet netlink kezelőt lefoglalni a kapcsolat állapotának megfigyelése " -"érdekében: %s" +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "hiba lépett fel adatokra várakozás közben a foglalaton" -#: ../src/nm-netlink-monitor.c:270 +#: ../src/nm-netlink-monitor.c:254 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "" "nem lehet kapcsolódni a netlinkhez a kapcsolat állapotának megfigyelése " "érdekében: %s" -#: ../src/nm-netlink-monitor.c:278 +#: ../src/nm-netlink-monitor.c:265 #, c-format -msgid "unable to join netlink group for monitoring link status: %s" +msgid "unable to enable netlink handle credential passing: %s" msgstr "" -"nem lehet csatlakozni a netlink csoporthoz a kapcsolat állapotának " -"megfigyelése érdekében: %s" +"nem engedélyezhető a hálózati kapcsolatkezelő hitelesítési adatainak " +"átadása: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"nem lehet netlink kezelőt lefoglalni a kapcsolat állapotának megfigyelése " +"érdekében: %s" -#: ../src/nm-netlink-monitor.c:286 +#: ../src/nm-netlink-monitor.c:376 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "" "nem lehet netlink kapcsolat-gyorsítótárat lefoglalni a kapcsolat állapotának " "megfigyelése érdekében: %s" -#: ../src/nm-netlink-monitor.c:494 -#: ../src/ip6-manager/nm-netlink-listener.c:382 -msgid "error occurred while waiting for data on socket" -msgstr "hiba lépett fel adatokra várakozás közben a foglalaton" +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "nem lehet csatlakozni a netlink csoporthoz: %s" -#: ../src/nm-netlink-monitor.c:558 +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 #, c-format msgid "error updating link cache: %s" msgstr "hiba a kapcsolat gyorsítótárának frissítésekor: %s" -#: ../src/NetworkManager.c:330 +#: ../src/main.c:499 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "" "Érvénytelen kapcsoló. Az érvényes kapcsolók listájáért használja a --help " "kapcsolót.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 +#: ../src/main.c:570 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. Használja a --help kapcsolót az érvényes kapcsolókért.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:328 msgid "# Created by NetworkManager\n" -msgstr "# Készítette a NetworkManager\n" +msgstr "# Készítette a Hálózatkezelő\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:344 #, c-format msgid "" "# Merged from %s\n" @@ -421,73 +1745,48 @@ msgstr "" "# Összefésülve ebből: %s\n" "\n" -#: ../src/ip6-manager/nm-netlink-listener.c:200 +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 +msgid "no usable DHCP client could be found." +msgstr "nem található használható DHCP-kliens." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 +msgid "'dhclient' could be found." +msgstr "A „dhclient” nem használható." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 +msgid "'dhcpcd' could be found." +msgstr "A „dhcpd” nem használható." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 #, c-format -msgid "unable to allocate netlink handle: %s" -msgstr "nem lehet netlink kezelőt lefoglalni: %s" +msgid "unsupported DHCP client '%s'" +msgstr "nem támogatott DHCP-kliens („%s”)" -#: ../src/ip6-manager/nm-netlink-listener.c:210 +#: ../src/logging/nm-logging.c:146 #, c-format -msgid "unable to connect to netlink: %s" -msgstr "nem lehet kapcsolódni a netlinkhez: %s" +msgid "Unknown log level '%s'" +msgstr "Ismeretlen naplózási szint: „%s”" -#: ../src/ip6-manager/nm-netlink-listener.c:307 +#: ../src/logging/nm-logging.c:171 #, c-format -msgid "unable to join netlink group: %s" -msgstr "nem lehet csatlakozni a netlink csoporthoz: %s" +msgid "Unknown log domain '%s'" +msgstr "Ismeretlen naplózási tartomány: „%s”" -#: ../src/dns-manager/nm-dns-manager.c:315 +#: ../src/dns-manager/nm-dns-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "MEGJEGYZÉS: a libc feloldó nem támogat háromnál több névkiszolgálót." -#: ../src/dns-manager/nm-dns-manager.c:317 +#: ../src/dns-manager/nm-dns-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "Az alább felsorolt névkiszolgálók lehet, hogy nem kerülnek felismerésre." -#: ../src/system-settings/nm-default-wired-connection.c:194 +#: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" msgstr "Automatikus %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:2406 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3412 +#: ../system-settings/plugins/ifnet/connection_parser.c:49 msgid "System" msgstr "Rendszer" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 -msgid "Connection sharing via a protected WiFi network" -msgstr "Kapcsolatmegosztás védett WiFi hálózaton" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 -msgid "Connection sharing via an open WiFi network" -msgstr "Kapcsolatmegosztás nyílt WiFi hálózaton" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 -msgid "Modify persistent system hostname" -msgstr "Állandó rendszergépnév módosítása" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 -msgid "Modify system connections" -msgstr "Rendszerkapcsolatok módosítása" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 -msgid "System policy prevents modification of system settings" -msgstr "A rendszer házirendje megakadályozza a rendszerbeállítások módosítását" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 -msgid "System policy prevents modification of the persistent system hostname" -msgstr "" -"A rendszer házirendje megakadályozza a rendszer állandó gépnevének " -"módosítását" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 -msgid "System policy prevents sharing connections via a protected WiFi network" -msgstr "" -"A rendszer házirendje megakadályozza a kapcsolatok megosztását védett WiFi " -"hálózaton" - -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 -msgid "System policy prevents sharing connections via an open WiFi network" -msgstr "" -"A rendszer házirendje megakadályozza a kapcsolatok megosztását nyílt WiFi " -"hálózaton" - -- cgit v1.2.1 From 61e86600d5ed2d5e3721074ec68e289c93fe67cc Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Wed, 6 Oct 2010 17:12:10 -0500 Subject: dhcp: fix uninitialized variable usage with dhcp3 --- src/dhcp-manager/nm-dhcp-dhclient.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c index 2f25fca98b..091ae2f989 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.c +++ b/src/dhcp-manager/nm-dhcp-dhclient.c @@ -512,6 +512,8 @@ dhclient_start (NMDHCPClient *client, uuid = nm_dhcp_client_get_uuid (client); ipv6 = nm_dhcp_client_get_ipv6 (client); + log_domain = ipv6 ? LOGD_DHCP6 : LOGD_DHCP4; + #if defined(DHCLIENT_V3) if (ipv6) { nm_log_warn (log_domain, "(%s): ISC dhcp3 does not support IPv6", iface); @@ -521,8 +523,6 @@ dhclient_start (NMDHCPClient *client, g_return_val_if_fail (ip_opt != NULL, -1); #endif - log_domain = ipv6 ? LOGD_DHCP6 : LOGD_DHCP4; - priv->pid_file = g_strdup_printf (LOCALSTATEDIR "/run/dhclient%s-%s.pid", ipv6 ? "6" : "", iface); -- cgit v1.2.1 From febb3d2cb460e28b42fc3abeeaaa5b9fc94fde81 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Wed, 6 Oct 2010 17:14:54 -0500 Subject: system-settings: add timestamp to default auto wired connections (bgo #583756) --- src/system-settings/nm-default-wired-connection.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/system-settings/nm-default-wired-connection.c b/src/system-settings/nm-default-wired-connection.c index 54e00d6273..1cda3d9e23 100644 --- a/src/system-settings/nm-default-wired-connection.c +++ b/src/system-settings/nm-default-wired-connection.c @@ -163,6 +163,7 @@ constructor (GType type, NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, NM_SETTING_CONNECTION_UUID, uuid, NM_SETTING_CONNECTION_READ_ONLY, priv->read_only, + NM_SETTING_CONNECTION_TIMESTAMP, time (NULL), NULL); g_free (id); -- cgit v1.2.1 From 82dd97c4b73ace6067fbe3fa92a3c7eb5a95e89b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 7 Oct 2010 00:29:44 -0500 Subject: policy: ensure stale IP mappings are not left in /etc/hosts (bgo #629020) (rh #630146) NM-added mappings for active IP addresses were not getting properly removed when the address disappeared of NM quit, because the bits of code that determine whether or not /etc/hosts should change were not taking the disappearance of the IP address into account, and were leaving the file unchanged. To fix that, if there is no default IP address, but there are NM-added IP address entries in /etc/hosts, make sure we update /etc/hosts and remove them. --- src/nm-policy-hosts.c | 43 +++++++++++++++++++++++++++++++++++++++++++ src/nm-policy.c | 9 +++++++++ 2 files changed, 52 insertions(+) diff --git a/src/nm-policy-hosts.c b/src/nm-policy-hosts.c index 0403b03725..1b57d4275f 100644 --- a/src/nm-policy-hosts.c +++ b/src/nm-policy-hosts.c @@ -63,6 +63,21 @@ is_local_mapping (const char *str, gboolean ip6, const char *hostname) && nm_policy_hosts_find_token (str, hostname ? hostname : fallback)); } +static gboolean +is_ip4_addr (const char *str) +{ + struct in_addr found; + char buf[INET_ADDRSTRLEN + 2]; + const char *p = str; + guint32 i = 0; + + memset (buf, 0, sizeof (buf)); + while (*p && !isblank (*p) && (i < sizeof (buf))) + buf[i++] = *p++; + + return inet_pton (AF_INET, buf, &found) == 1 ? TRUE : FALSE; +} + static gboolean ip4_addr_matches (const char *str, const char *ip4_addr) { @@ -85,6 +100,21 @@ ip4_addr_matches (const char *str, const char *ip4_addr) return memcmp (&found, &given, sizeof (found)) == 0; } +static gboolean +is_ip6_addr (const char *str) +{ + struct in6_addr found; + char buf[INET6_ADDRSTRLEN + 2]; + const char *p = str; + guint32 i = 0; + + memset (buf, 0, sizeof (buf)); + while (*p && !isblank (*p) && (i < sizeof (buf))) + buf[i++] = *p++; + + return inet_pton (AF_INET6, buf, &found) == 1 ? TRUE : FALSE; +} + static gboolean ip6_addr_matches (const char *str, const char *ip6_addr) { @@ -176,7 +206,14 @@ nm_policy_get_etc_hosts (const char **lines, found_user_host4 = TRUE; host4_before = TRUE; /* Ignore if user added mapping manually */ } + } else if (!ip4_addr && strstr (*line, ADDED_TAG)) { + /* If this is a stale NM-added IPv4 entry we need to remove it, + * so make sure we update /etc/hosts. + */ + if (is_ip4_addr (*line)) + found_host4 = FALSE; } + if (ip6_addr && ip6_addr_matches (*line, ip6_addr)) { found_host6 = TRUE; if (strstr (*line, ADDED_TAG)) { @@ -186,6 +223,12 @@ nm_policy_get_etc_hosts (const char **lines, found_user_host6 = TRUE; host6_before = TRUE; /* Ignore if user added mapping manually */ } + } else if (!ip6_addr && strstr (*line, ADDED_TAG)) { + /* If this is a stale NM-added IPv6 entry we need to remove it, + * so make sure we update /etc/hosts. + */ + if (is_ip6_addr (*line)) + found_host6 = FALSE; } } diff --git a/src/nm-policy.c b/src/nm-policy.c index 3ab4db550c..7382ece145 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -1234,6 +1234,15 @@ nm_policy_destroy (NMPolicy *policy) } g_slist_free (policy->dev_signal_ids); + /* Rewrite /etc/hosts on exit to ensure we don't leave stale IP addresses + * lying around. FIXME: this will take out a valid IP address of an + * ethernet device we're leaving active (ie, a connection we can "assume" + * when NM starts again). + */ + policy->default_device4 = NULL; + policy->default_device6 = NULL; + update_system_hostname (policy, NULL, NULL); + g_free (policy->orig_hostname); g_free (policy->cur_hostname); -- cgit v1.2.1 From aeeac548a85c020d3b239824632924f533a2f63c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 7 Oct 2010 12:04:41 -0500 Subject: dns: fix use-after-free in plugin error path --- src/dns-manager/nm-dns-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dns-manager/nm-dns-manager.c b/src/dns-manager/nm-dns-manager.c index 71adbc5263..7a6fbbc9d9 100644 --- a/src/dns-manager/nm-dns-manager.c +++ b/src/dns-manager/nm-dns-manager.c @@ -572,7 +572,7 @@ update_dns (NMDnsManager *self, priv = NM_DNS_MANAGER_GET_PRIVATE (self); - if (iface) { + if (iface && (iface != priv->last_iface)) { g_free (priv->last_iface); priv->last_iface = g_strdup (iface); } -- cgit v1.2.1 From 03517015cc2030cc2bbaaa0b39621e7976a26187 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 7 Oct 2010 12:09:17 -0500 Subject: core: check address family, not route family --- src/nm-system.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nm-system.c b/src/nm-system.c index 0911b82182..7921fec654 100644 --- a/src/nm-system.c +++ b/src/nm-system.c @@ -1254,11 +1254,11 @@ dump_route (struct rtnl_route *route) memset (buf4, 0, sizeof (buf4)); nl = rtnl_route_get_dst (route); if (nl) { - if (rtnl_route_get_family (route) == AF_INET) { + if (nl_addr_get_family (nl) == AF_INET) { addr4 = nl_addr_get_binary_addr (nl); if (addr4) inet_ntop (AF_INET, addr4, &buf4[0], sizeof (buf4)); - } else if (rtnl_route_get_family (route) == AF_INET6) { + } else if (nl_addr_get_family (nl) == AF_INET6) { addr6 = nl_addr_get_binary_addr (nl); if (addr6) inet_ntop (AF_INET6, addr6, &buf6[0], sizeof (buf6)); -- cgit v1.2.1 From 8502f0c874e5bab3c111f6c5f6185b3fe2b92784 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 7 Oct 2010 13:52:51 -0500 Subject: core: fix use-after-free getting user connections G_SLICE debugging uncovered a use-after-free when freeing the batched user connection settings callback list. We don't actually care about the DBusPendingCalls anyway, so just make the list a counter and simplify the code in the process. --- src/nm-manager.c | 55 +++++++++++++++++++++++-------------------------------- 1 file changed, 23 insertions(+), 32 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 591c073125..758a0826bd 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -930,8 +930,7 @@ typedef struct GetSettingsInfo { NMManager *manager; NMConnection *connection; DBusGProxy *proxy; - DBusGProxyCall *call; - GSList **calls; + guint32 *calls; } GetSettingsInfo; static void @@ -943,10 +942,9 @@ free_get_settings_info (gpointer data) * send out the connections-added signal. */ if (info->calls) { - *(info->calls) = g_slist_remove (*(info->calls), info->call); - if (g_slist_length (*(info->calls)) == 0) { - g_slist_free (*(info->calls)); - g_slice_free (GSList, (gpointer) info->calls); + (*info->calls)--; + if (*info->calls == 0) { + g_slice_free (guint32, (gpointer) info->calls); g_signal_emit (info->manager, signals[CONNECTIONS_ADDED], 0, NM_CONNECTION_SCOPE_USER); /* Update the Bluetooth connections for all the new connections */ @@ -1117,20 +1115,18 @@ user_connection_updated_cb (DBusGProxy *proxy, } static void -user_internal_new_connection_cb (DBusGProxy *proxy, +user_internal_new_connection_cb (NMManager *manager, const char *path, - NMManager *manager, - GSList **calls) + guint32 *counter) { - struct GetSettingsInfo *info; + GetSettingsInfo *info; DBusGProxy *con_proxy; DBusGConnection *g_connection; - DBusGProxyCall *call; NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); g_connection = nm_dbus_manager_get_connection (priv->dbus_mgr); con_proxy = dbus_g_proxy_new_for_name (g_connection, - dbus_g_proxy_get_bus_name (proxy), + NM_DBUS_SERVICE_USER_SETTINGS, path, NM_DBUS_IFACE_SETTINGS_CONNECTION); if (!con_proxy) { @@ -1154,16 +1150,16 @@ user_internal_new_connection_cb (DBusGProxy *proxy, info = g_slice_new0 (GetSettingsInfo); info->manager = g_object_ref (manager); - info->calls = calls; - call = dbus_g_proxy_begin_call (con_proxy, "GetSettings", - user_connection_get_settings_cb, - info, - free_get_settings_info, - G_TYPE_INVALID); - info->call = call; info->proxy = con_proxy; - if (info->calls) - *(info->calls) = g_slist_prepend (*(info->calls), call); + if (counter) { + info->calls = counter; + (*info->calls)++; + } + dbus_g_proxy_begin_call (con_proxy, "GetSettings", + user_connection_get_settings_cb, + info, + free_get_settings_info, + G_TYPE_INVALID); } static void @@ -1174,7 +1170,7 @@ user_list_connections_cb (DBusGProxy *proxy, NMManager *manager = NM_MANAGER (user_data); GError *err = NULL; GPtrArray *ops; - GSList **calls = NULL; + guint32 *counter = NULL; int i; if (!dbus_g_proxy_end_call (proxy, call_id, &err, @@ -1182,26 +1178,21 @@ user_list_connections_cb (DBusGProxy *proxy, G_TYPE_INVALID)) { nm_log_warn (LOGD_USER_SET, "couldn't retrieve connections: %s", err && err->message ? err->message : "(unknown)"); - g_error_free (err); - goto out; + g_clear_error (&err); + return; } /* Keep track of all calls made here; don't want to emit connection-added for * each one, but emit connections-added when they are all done. */ - calls = g_slice_new0 (GSList *); - + counter = g_slice_new0 (guint32); for (i = 0; i < ops->len; i++) { char *op = g_ptr_array_index (ops, i); - user_internal_new_connection_cb (proxy, op, manager, calls); + user_internal_new_connection_cb (manager, op, counter); g_free (op); } - g_ptr_array_free (ops, TRUE); - -out: - return; } static void @@ -1219,7 +1210,7 @@ user_proxy_destroyed_cb (DBusGProxy *proxy, NMManager *self) static void user_new_connection_cb (DBusGProxy *proxy, const char *path, gpointer user_data) { - user_internal_new_connection_cb (proxy, path, NM_MANAGER (user_data), NULL); + user_internal_new_connection_cb (NM_MANAGER (user_data), path, NULL); } static gboolean -- cgit v1.2.1 From 35b1ed9082eebbcebee1b09792f9e5652f1005d3 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 7 Oct 2010 14:06:50 -0500 Subject: dns: actually kill stale dnsmasq process Interpret the return value of kill(2) correctly... --- src/dns-manager/nm-dns-plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dns-manager/nm-dns-plugin.c b/src/dns-manager/nm-dns-plugin.c index d47640b1c3..5766a90d43 100644 --- a/src/dns-manager/nm-dns-plugin.c +++ b/src/dns-manager/nm-dns-plugin.c @@ -106,7 +106,7 @@ kill_existing (const char *progname, const char *pidfile, const char *kill_match goto out; if (strstr (cmdline_contents, kill_match)) { - if (kill (pid, 0)) { + if (kill (pid, 0) == 0) { nm_log_dbg (LOGD_DNS, "Killing stale %s child process %ld", progname, pid); kill (pid, SIGKILL); } -- cgit v1.2.1 From 4a7c77ac9589a6786d7b5318fbaf8696e74436b0 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 7 Oct 2010 14:07:34 -0500 Subject: dnsmasq: actually kill stale dnsmasq process Interpret the return value of kill(2) correctly... --- src/dnsmasq-manager/nm-dnsmasq-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dnsmasq-manager/nm-dnsmasq-manager.c b/src/dnsmasq-manager/nm-dnsmasq-manager.c index e6c67a1e31..1dc42fc65d 100644 --- a/src/dnsmasq-manager/nm-dnsmasq-manager.c +++ b/src/dnsmasq-manager/nm-dnsmasq-manager.c @@ -385,7 +385,7 @@ kill_existing_for_iface (const char *iface, const char *pidfile) goto out; if (strstr (cmdline_contents, "bin/dnsmasq")) { - if (kill (pid, 0)) { + if (kill (pid, 0) == 0) { nm_log_dbg (LOGD_SHARING, "Killing stale dnsmasq process %ld", pid); kill (pid, SIGKILL); } -- cgit v1.2.1 From ee9ce6027b3fc0cb4aa14442ef8b628b80b726eb Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 7 Oct 2010 18:08:52 -0500 Subject: policy: preserve custom hostnames on local-mapping lines (rh #627269) Try to preserve custom hostnames (ie, anything not a localhost* variant, the current hostname, or the previous hostname) when rewriting the 127.0.0.1/::1 localhost mapping lines. --- src/nm-policy-hostname.c | 7 +- src/nm-policy-hosts.c | 159 +++++++++++++++++++++++++++++++++--------- src/nm-policy-hosts.h | 2 + src/tests/test-policy-hosts.c | 140 ++++++++++++++++++++++++++++++++----- 4 files changed, 257 insertions(+), 51 deletions(-) diff --git a/src/nm-policy-hostname.c b/src/nm-policy-hostname.c index 0a49f9e2ea..42a2e0f9a4 100644 --- a/src/nm-policy-hostname.c +++ b/src/nm-policy-hostname.c @@ -217,7 +217,7 @@ nm_policy_set_system_hostname (const char *new_hostname, char old_hostname[HOST_NAME_MAX + 1]; int ret = 0; const char *name; - gboolean set_hostname = TRUE, changed = FALSE; + gboolean set_hostname = TRUE, changed = FALSE, old_valid = TRUE; if (new_hostname) g_warn_if_fail (strlen (new_hostname)); @@ -230,11 +230,15 @@ nm_policy_set_system_hostname (const char *new_hostname, if (ret != 0) { nm_log_warn (LOGD_DNS, "couldn't get the system hostname: (%d) %s", errno, strerror (errno)); + old_valid = FALSE; } else { /* Don't set the hostname if it isn't actually changing */ if ( (new_hostname && !strcmp (old_hostname, new_hostname)) || (!new_hostname && !strcmp (old_hostname, FALLBACK_HOSTNAME4))) set_hostname = FALSE; + + if (old_hostname[0] == '\0') + old_valid = FALSE; } if (set_hostname) { @@ -255,6 +259,7 @@ nm_policy_set_system_hostname (const char *new_hostname, * /etc/hosts at all. */ if (!nm_policy_hosts_update_etc_hosts (name, + old_valid ? old_hostname : NULL, FALLBACK_HOSTNAME4, FALLBACK_HOSTNAME6, ip4_addr, diff --git a/src/nm-policy-hosts.c b/src/nm-policy-hosts.c index 1b57d4275f..ddc828d522 100644 --- a/src/nm-policy-hosts.c +++ b/src/nm-policy-hosts.c @@ -28,6 +28,9 @@ #include "nm-policy-hosts.h" #include "nm-logging.h" +#define IP4_LH "127.0.0.1" +#define IP6_LH "::1" + gboolean nm_policy_hosts_find_token (const char *line, const char *token) { @@ -56,7 +59,7 @@ nm_policy_hosts_find_token (const char *line, const char *token) static gboolean is_local_mapping (const char *str, gboolean ip6, const char *hostname) { - const char *addr = ip6 ? "::1" : "127.0.0.1"; + const char *addr = ip6 ? IP6_LH : IP4_LH; const char *fallback = ip6 ? "localhost6" : "localhost"; return ( !strncmp (str, addr, strlen (addr)) @@ -137,12 +140,71 @@ ip6_addr_matches (const char *str, const char *ip6_addr) return memcmp (&found, &given, sizeof (found)) == 0; } +static char * +get_custom_hostnames (const char *line, + const char *hostname, + const char *old_hostname) +{ + char **items = NULL, **iter; + guint start = 0; + GString *str = NULL; + char *custom = NULL; + + g_return_val_if_fail (line != NULL, NULL); + + if (!strncmp (line, IP4_LH, strlen (IP4_LH))) + start = strlen (IP4_LH); + else if (!strncmp (line, IP6_LH, strlen (IP6_LH))) + start = strlen (IP6_LH); + + g_return_val_if_fail (start > 0, NULL); + + /* Split the line into tokens */ + items = g_strsplit_set (line + start, " \t", -1); + if (!items) + return NULL; + + str = g_string_sized_new (50); + /* Ignore current & old hostnames, and localhost-anything */ + for (iter = items; iter && *iter; iter++) { + if (*iter[0] == '\0') + continue; + if (hostname && !strcmp (*iter, hostname)) + continue; + if (old_hostname && !strcmp (*iter, old_hostname)) + continue; + if (!strcmp (*iter, "localhost")) + continue; + if (!strcmp (*iter, "localhost6")) + continue; + if (!strcmp (*iter, "localhost.localdomain")) + continue; + if (!strcmp (*iter, "localhost4.localdomain4")) + continue; + if (!strcmp (*iter, "localhost6.localdomain6")) + continue; + + /* Found a custom hostname */ + g_string_append_c (str, '\t'); + g_string_append (str, *iter); + } + + if (str->len) + custom = g_string_free (str, FALSE); + else + g_string_free (str, TRUE); + + g_strfreev (items); + return custom; +} + #define ADDED_TAG "# Added by NetworkManager" GString * nm_policy_get_etc_hosts (const char **lines, gsize existing_len, const char *hostname, + const char *old_hostname, const char *fallback_hostname4, const char *fallback_hostname6, const char *ip4_addr, @@ -163,7 +225,10 @@ nm_policy_get_etc_hosts (const char **lines, gboolean hostname6_is_fallback; gboolean host4_before = FALSE; gboolean host6_before = FALSE; + gboolean no_stale = TRUE; char *short_hostname = NULL; + char *custom4 = NULL; + char *custom6 = NULL; g_return_val_if_fail (lines != NULL, FALSE); g_return_val_if_fail (hostname != NULL, FALSE); @@ -181,21 +246,20 @@ nm_policy_get_etc_hosts (const char **lines, * If all these things exist we don't need to bother updating the file. */ - if (!ip4_addr) { - found_host4 = TRUE; + if (!ip4_addr) host4_before = TRUE; - } - if (!ip6_addr) { - found_host6 = TRUE; + if (!ip6_addr) host6_before = TRUE; - } /* Look for the four cases from above */ for (line = lines; lines && *line; line++) { - if (!strlen (*line) || (*line[0] == '#')) + gboolean found_hostname = FALSE; + + if ((*line[0] == '\0') || (*line[0] == '#')) continue; - if (nm_policy_hosts_find_token (*line, hostname)) { + found_hostname = nm_policy_hosts_find_token (*line, hostname); + if (found_hostname) { /* Found the current hostname on this line */ if (ip4_addr && ip4_addr_matches (*line, ip4_addr)) { found_host4 = TRUE; @@ -211,7 +275,7 @@ nm_policy_get_etc_hosts (const char **lines, * so make sure we update /etc/hosts. */ if (is_ip4_addr (*line)) - found_host4 = FALSE; + no_stale = FALSE; } if (ip6_addr && ip6_addr_matches (*line, ip6_addr)) { @@ -228,26 +292,54 @@ nm_policy_get_etc_hosts (const char **lines, * so make sure we update /etc/hosts. */ if (is_ip6_addr (*line)) - found_host6 = FALSE; + no_stale = FALSE; } } if (is_local_mapping (*line, FALSE, "localhost")) { /* a 127.0.0.1 line containing 'localhost' */ found_localhost4 = TRUE; + custom4 = get_custom_hostnames (*line, hostname, old_hostname); + if (!ip4_addr) { + /* If there's no IP-specific mapping for the current hostname + * but that hostname is present on in the local mapping line, + * we've found our IPv4 hostname mapping. If the hostname is + * the fallback *IPv6* hostname it's not going to show up in + * the IPv4 local mapping though, so fake it. + */ + if (hostname6_is_fallback || found_hostname) + found_host4 = TRUE; + } } else if (is_local_mapping (*line, TRUE, "localhost6")) { /* a ::1 line containing 'localhost6' */ found_localhost6 = TRUE; + custom6 = get_custom_hostnames (*line, hostname, old_hostname); + if (!ip6_addr) { + /* If there's no IP-specific mapping for the current hostname + * but that hostname is present on in the local mapping line, + * we've found our IPv6 hostname mapping. If the hostname is + * the fallback *IPv4* hostname it's not going to show up in + * the IPv6 local mapping though, so fake it. + */ + if (hostname4_is_fallback || found_hostname) + found_host6 = TRUE; + } } - if (found_localhost4 && found_host4 && found_localhost6 && found_host6 && host4_before && host6_before) - return NULL; /* No update required */ + if ( found_localhost4 + && found_host4 + && found_localhost6 + && found_host6 + && host4_before + && host6_before + && no_stale) + goto out; /* No update required */ } contents = g_string_sized_new (existing_len ? existing_len + 100 : 200); if (!contents) { g_set_error_literal (error, 0, 0, "not enough memory"); - return NULL; + goto out; } /* Find the short hostname, like 'foo' from 'foo.bar.baz'; we want to @@ -277,8 +369,6 @@ nm_policy_get_etc_hosts (const char **lines, * 'localhost6'. */ for (line = lines, initial_comments = TRUE; lines && *line; line++) { - gboolean add_line = TRUE; - /* This is the first line after the initial comments */ if (strlen (*line) && initial_comments && (*line[0] != '#')) { initial_comments = FALSE; @@ -311,7 +401,10 @@ nm_policy_get_etc_hosts (const char **lines, if (short_hostname) g_string_append_printf (contents, "\t%s", short_hostname); } - g_string_append_printf (contents, "\t%s\tlocalhost\n", fallback_hostname4); + g_string_append_printf (contents, "\t%s\tlocalhost", fallback_hostname4); + if (custom4) + g_string_append (contents, custom4); + g_string_append_c (contents, '\n'); /* IPv6 localhost line */ g_string_append (contents, "::1"); @@ -320,26 +413,23 @@ nm_policy_get_etc_hosts (const char **lines, if (short_hostname) g_string_append_printf (contents, "\t%s", short_hostname); } - g_string_append_printf (contents, "\t%s\tlocalhost6\n", fallback_hostname6); + g_string_append_printf (contents, "\t%s\tlocalhost6", fallback_hostname6); + if (custom6) + g_string_append (contents, custom6); + g_string_append_c (contents, '\n'); added = TRUE; } /* 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)) - 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)) - add_line = FALSE; - - if (add_line && !strstr (*line, ADDED_TAG)) { + if ( !is_local_mapping (*line, FALSE, "localhost") + && !is_local_mapping (*line, FALSE, fallback_hostname4) + && !is_local_mapping (*line, FALSE, hostname) + && !is_local_mapping (*line, TRUE, "localhost6") + && !is_local_mapping (*line, TRUE, fallback_hostname6) + && !is_local_mapping (*line, TRUE, hostname) + && !strstr (*line, ADDED_TAG)) { + g_string_append (contents, *line); /* Only append the new line if this isn't the last line in the file */ if (*(line+1)) @@ -370,12 +460,16 @@ nm_policy_get_etc_hosts (const char **lines, g_string_append_printf (contents, "::1\t%s\tlocalhost6\n", fallback_hostname6); } +out: + g_free (custom4); + g_free (custom6); g_free (short_hostname); return contents; } gboolean nm_policy_hosts_update_etc_hosts (const char *hostname, + const char *old_hostname, const char *fallback_hostname4, const char *fallback_hostname6, const char *ip4_addr, @@ -405,6 +499,7 @@ nm_policy_hosts_update_etc_hosts (const char *hostname, new_contents = nm_policy_get_etc_hosts ((const char **) lines, contents_len, hostname, + old_hostname, fallback_hostname4, fallback_hostname6, ip4_addr, diff --git a/src/nm-policy-hosts.h b/src/nm-policy-hosts.h index 76288bf56b..ebaaf0fd41 100644 --- a/src/nm-policy-hosts.h +++ b/src/nm-policy-hosts.h @@ -24,6 +24,7 @@ #include gboolean nm_policy_hosts_update_etc_hosts (const char *hostname, + const char *old_hostname, const char *fallback_hostname4, const char *fallback_hostname6, const char *ip4_addr, @@ -36,6 +37,7 @@ gboolean nm_policy_hosts_find_token (const char *line, const char *token); GString *nm_policy_get_etc_hosts (const char **lines, gsize existing_len, const char *hostname, + const char *old_hostname, const char *fallback_hostname4, const char *fallback_hostname6, const char *ip4_addr, diff --git a/src/tests/test-policy-hosts.c b/src/tests/test-policy-hosts.c index e6775f35e8..3c27af2c2f 100644 --- a/src/tests/test-policy-hosts.c +++ b/src/tests/test-policy-hosts.c @@ -26,6 +26,8 @@ #define FALLBACK_HOSTNAME4 "localhost.localdomain" #define FALLBACK_HOSTNAME6 "localhost6.localdomain6" +#define DEBUG 0 + static void test_generic (const char *before, const char *after, @@ -43,6 +45,7 @@ test_generic (const char *before, newc = nm_policy_get_etc_hosts ((const char **) lines, strlen (before), hostname, + NULL, FALLBACK_HOSTNAME4, FALLBACK_HOSTNAME6, ip4_addr, @@ -56,11 +59,11 @@ test_generic (const char *before, g_clear_error (&error); } else if (after == NULL) { /* No change to /etc/hosts required */ -#if 0 +#if DEBUG if (newc != NULL) { g_message ("\n- NEW ---------------------------------\n" "%s" - "- EXPECTED NONE -------------------------\n", + "+ EXPECTED NONE +++++++++++++++++++++++++\n", newc->str); } #endif @@ -70,10 +73,10 @@ test_generic (const char *before, g_assert (newc != NULL); g_assert (error == NULL); -#if 0 +#if DEBUG g_message ("\n- NEW ---------------------------------\n" "%s" - "- EXPECTED ------------------------------\n" + "+ EXPECTED ++++++++++++++++++++++++++++++\n" "%s" "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", newc->str, after); @@ -167,10 +170,17 @@ static const char *named_generic_before = \ "::1 localhost6.localdomain6 localhost6\n" "127.0.0.1 lcmd.us.intellitxt.com\n"; +static const char *named_generic_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 playboy localhost.localdomain localhost\n" + "::1 playboy localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + static void test_hosts_named_generic (void) { - test_generic (named_generic_before, NULL, "playboy", NULL, NULL, FALSE); + test_generic (named_generic_before, named_generic_after, "playboy", NULL, NULL, FALSE); } /*******************************************/ @@ -609,24 +619,114 @@ static const char *long_before = \ "127.0.0.1 ad.doubleclick.net\n" "127.0.0.1 oascentral.movietickets.com\n" "127.0.0.1 view.atdmt.com\n" - "127.0.0.1 ads.chumcity.com\n" - "127.0.0.1 ads.as4x.tmcs.net\n" - "127.0.0.1 n4403ad.doubleclick.net\n" - "127.0.0.1 www.assoc-amazon.com\n" - "127.0.0.1 s25.sitemeter.com\n" - "127.0.0.1 adlog.com.com\n" - "127.0.0.1 ahs.laptopmag.com\n" - "127.0.0.1 altfarm.mediaplex.com\n" - "127.0.0.1 ads.addynamix.com\n" - "127.0.0.1 srx.main.ebayrtm.com\n" - "127.0.0.1 cdn5.tribalfusion.com\n" - "127.0.0.1 a.tribalfusion.com\n"; + "127.0.0.1 ads.chumcity.com\n"; +static const char *long_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 comet localhost.localdomain localhost\n" + "::1 comet localhost6.localdomain6 localhost6\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n" + "127.0.0.1 adserver.adtech.de\n" + "127.0.0.1 a.as-us.falkag.net\n" + "127.0.0.1 a.as-eu.falkag.net\n" + "127.0.0.1 ads.doubleclick.com\n" + "\n" + "# random comment\n" + "127.0.0.1 m1.2mdn.net\n" + "127.0.0.1 ds.serving-sys.com\n" + "127.0.0.1 pagead2.googlesyndication.com\n" + "127.0.0.1 ad.doubleclick.com\n" + "127.0.0.1 ad.doubleclick.net\n" + "127.0.0.1 oascentral.movietickets.com\n" + "127.0.0.1 view.atdmt.com\n" + "127.0.0.1 ads.chumcity.com\n"; static void test_hosts_long (void) { - test_generic (long_before, NULL, "comet", NULL, NULL, FALSE); + test_generic (long_before, long_after, "comet", NULL, NULL, FALSE); +} + +/*******************************************/ + +static const char *custom4_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost pintglass\n" + "::1 localhost6.localdomain6 localhost6\n"; + +static const char *custom4_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 comet localhost.localdomain localhost pintglass\n" + "::1 comet localhost6.localdomain6 localhost6\n"; + +static void +test_hosts_custom4 (void) +{ + test_generic (custom4_before, custom4_after, "comet", NULL, NULL, FALSE); +} + +/*******************************************/ + +static const char *custom6_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6 pintglass\n"; + +static const char *custom6_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 comet localhost.localdomain localhost\n" + "::1 comet localhost6.localdomain6 localhost6 pintglass\n"; + +static void +test_hosts_custom6 (void) +{ + test_generic (custom6_before, custom6_after, "comet", NULL, NULL, FALSE); +} + +/*******************************************/ + +static const char *custom46_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost shotglass\n" + "::1 localhost6.localdomain6 localhost6 pintglass\n"; + +static const char *custom46_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 comet localhost.localdomain localhost shotglass\n" + "::1 comet localhost6.localdomain6 localhost6 pintglass\n"; + +static void +test_hosts_custom46 (void) +{ + test_generic (custom46_before, custom46_after, "comet", NULL, NULL, FALSE); +} + +/*******************************************/ + +static const char *custom46_mixed_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost shotglass\n" + "::1 localhost6.localdomain6 localhost6 pintglass\n"; + +static const char *custom46_mixed_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 comet localhost.localdomain localhost shotglass\n" + "::1 comet localhost6.localdomain6 localhost6 pintglass\n"; + +static void +test_hosts_custom46_mixed (void) +{ + test_generic (custom46_mixed_before, custom46_mixed_after, "comet", NULL, NULL, FALSE); } /*******************************************/ @@ -712,6 +812,10 @@ int main (int argc, char **argv) g_test_suite_add (suite, TESTCASE (test_hosts_no_host4, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_no_host6, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_long, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_custom4, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_custom6, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_custom46, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_custom46_mixed, NULL)); return g_test_run (); } -- cgit v1.2.1 From ad3cb6d8328f49bd1c7a21f344a26f12db4abd36 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 7 Oct 2010 18:14:29 -0500 Subject: policy: add testcases for removing stale hosts mappings (bgo #629020) (rh #630146) --- src/tests/test-policy-hosts.c | 67 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/src/tests/test-policy-hosts.c b/src/tests/test-policy-hosts.c index 3c27af2c2f..8865c4264e 100644 --- a/src/tests/test-policy-hosts.c +++ b/src/tests/test-policy-hosts.c @@ -731,6 +731,70 @@ test_hosts_custom46_mixed (void) /*******************************************/ +static const char *stale4_removed_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "1.2.3.4 comet # Added by NetworkManager\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 comet localhost6.localdomain6 localhost6\n"; + +static const char *stale4_removed_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 comet localhost.localdomain localhost\n" + "::1 comet localhost6.localdomain6 localhost6\n"; + +static void +test_hosts_stale4_removed (void) +{ + test_generic (stale4_removed_before, stale4_removed_after, "comet", NULL, NULL, FALSE); +} + +/*******************************************/ + +static const char *stale6_removed_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "3001:abba::3234 comet # Added by NetworkManager\n" + "127.0.0.1 comet localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n"; + +static const char *stale6_removed_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 comet localhost.localdomain localhost\n" + "::1 comet localhost6.localdomain6 localhost6\n"; + +static void +test_hosts_stale6_removed (void) +{ + test_generic (stale6_removed_before, stale6_removed_after, "comet", NULL, NULL, FALSE); +} + +/*******************************************/ + +static const char *stale46_removed_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "1.2.3.4 comet # Added by NetworkManager\n" + "3001:abba::3234 comet # Added by NetworkManager\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n"; + +static const char *stale46_removed_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 comet localhost.localdomain localhost\n" + "::1 comet localhost6.localdomain6 localhost6\n"; + +static void +test_hosts_stale46_removed (void) +{ + test_generic (stale46_removed_before, stale46_removed_after, "comet", NULL, NULL, FALSE); +} + +/*******************************************/ + typedef struct { const char *line; const char *token; @@ -816,6 +880,9 @@ int main (int argc, char **argv) g_test_suite_add (suite, TESTCASE (test_hosts_custom6, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_custom46, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_custom46_mixed, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_stale4_removed, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_stale6_removed, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_stale46_removed, NULL)); return g_test_run (); } -- cgit v1.2.1 From bbf3f12d7b2c79c49d87d41e6cf7b65ac7782071 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 7 Oct 2010 18:24:59 -0500 Subject: policy: prevent hostname duplication in /etc/hosts --- src/nm-policy-hosts.c | 48 +++++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/src/nm-policy-hosts.c b/src/nm-policy-hosts.c index ddc828d522..a6bb083f24 100644 --- a/src/nm-policy-hosts.c +++ b/src/nm-policy-hosts.c @@ -143,7 +143,9 @@ ip6_addr_matches (const char *str, const char *ip6_addr) static char * get_custom_hostnames (const char *line, const char *hostname, - const char *old_hostname) + const char *old_hostname, + const char *short_hostname, + const char *fallback_hostname) { char **items = NULL, **iter; guint start = 0; @@ -173,6 +175,10 @@ get_custom_hostnames (const char *line, continue; if (old_hostname && !strcmp (*iter, old_hostname)) continue; + if (short_hostname && !strcmp (*iter, short_hostname)) + continue; + if (fallback_hostname && !strcmp (*iter, fallback_hostname)) + continue; if (!strcmp (*iter, "localhost")) continue; if (!strcmp (*iter, "localhost6")) @@ -236,6 +242,24 @@ nm_policy_get_etc_hosts (const char **lines, hostname4_is_fallback = !strcmp (hostname, fallback_hostname4); hostname6_is_fallback = !strcmp (hostname, fallback_hostname6); + /* Find the short hostname, like 'foo' from 'foo.bar.baz'; we want to + * make sure that the entries we add for this host also include the short + * hostname too so that if the resolver does not answer queries for the + * machine's actual hostname/domain, that stuff like 'ping foo' still works. + */ + if (!hostname4_is_fallback || !hostname6_is_fallback) { + char *dot; + + short_hostname = g_strdup (hostname); + dot = strchr (short_hostname, '.'); + if (dot && *(dot+1)) + *dot = '\0'; + else { + g_free (short_hostname); + short_hostname = NULL; + } + } + /* We need the following in /etc/hosts: * * 1) current hostname mapped to current IPv4 addresses if IPv4 is active @@ -299,7 +323,7 @@ nm_policy_get_etc_hosts (const char **lines, if (is_local_mapping (*line, FALSE, "localhost")) { /* a 127.0.0.1 line containing 'localhost' */ found_localhost4 = TRUE; - custom4 = get_custom_hostnames (*line, hostname, old_hostname); + custom4 = get_custom_hostnames (*line, hostname, old_hostname, short_hostname, fallback_hostname4); if (!ip4_addr) { /* If there's no IP-specific mapping for the current hostname * but that hostname is present on in the local mapping line, @@ -313,7 +337,7 @@ nm_policy_get_etc_hosts (const char **lines, } else if (is_local_mapping (*line, TRUE, "localhost6")) { /* a ::1 line containing 'localhost6' */ found_localhost6 = TRUE; - custom6 = get_custom_hostnames (*line, hostname, old_hostname); + custom6 = get_custom_hostnames (*line, hostname, old_hostname, short_hostname, fallback_hostname6); if (!ip6_addr) { /* If there's no IP-specific mapping for the current hostname * but that hostname is present on in the local mapping line, @@ -342,24 +366,6 @@ nm_policy_get_etc_hosts (const char **lines, goto out; } - /* Find the short hostname, like 'foo' from 'foo.bar.baz'; we want to - * make sure that the entries we add for this host also include the short - * hostname too so that if the resolver does not answer queries for the - * machine's actual hostname/domain, that stuff like 'ping foo' still works. - */ - if (!hostname4_is_fallback || !hostname6_is_fallback) { - char *dot; - - short_hostname = g_strdup (hostname); - dot = strchr (short_hostname, '.'); - if (dot && *(dot+1)) - *dot = '\0'; - else { - g_free (short_hostname); - short_hostname = NULL; - } - } - /* Construct the new hosts file; replace any 127.0.0.1/::1 entry that is * at the beginning of the file or right after initial comments and contains * the string 'localhost' (for IPv4) or 'localhost6' (for IPv6). If there -- cgit v1.2.1 From 9ee77769afbd2cb6f9d461095ce0de31f4c68dac Mon Sep 17 00:00:00 2001 From: cee1 Date: Fri, 8 Oct 2010 16:43:16 -0500 Subject: trivial: add missing includes --- libnm-util/crypto.c | 1 + libnm-util/nm-setting-wireless.c | 1 + 2 files changed, 2 insertions(+) diff --git a/libnm-util/crypto.c b/libnm-util/crypto.c index 813cbc8ee5..70872db414 100644 --- a/libnm-util/crypto.c +++ b/libnm-util/crypto.c @@ -23,6 +23,7 @@ #include #include +#include #include #include #include diff --git a/libnm-util/nm-setting-wireless.c b/libnm-util/nm-setting-wireless.c index 99af8f2a34..ec7d53ad77 100644 --- a/libnm-util/nm-setting-wireless.c +++ b/libnm-util/nm-setting-wireless.c @@ -24,6 +24,7 @@ */ #include +#include #include #include -- cgit v1.2.1 From be97e7f10498d49b7632cbcdfa866bcdf47e174e Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 8 Oct 2010 22:45:35 -0500 Subject: build: include for kill(2), isblank(3), and isascii(3) config.h defines _GNU_SOURCE, which in turn defines the bits necessary for kill, isblank, and isascii. So wherever we use those, we need to make sure config.h is included. --- libnm-util/nm-setting-wireless-security.c | 3 ++- src/dhcp-manager/nm-dhcp-client.c | 1 + src/dns-manager/nm-dns-bind.c | 1 + src/dns-manager/nm-dns-dnsmasq.c | 1 + src/dns-manager/nm-dns-plugin.c | 1 + src/dnsmasq-manager/nm-dnsmasq-manager.c | 1 + src/nm-device.c | 1 + src/nm-policy-hosts.c | 1 + src/nm-policy.c | 1 + src/ppp-manager/nm-ppp-manager.c | 1 + src/vpn-manager/nm-vpn-service.c | 1 + system-settings/plugins/ifcfg-rh/reader.c | 1 + system-settings/plugins/ifnet/net_utils.c | 1 + 13 files changed, 14 insertions(+), 1 deletion(-) diff --git a/libnm-util/nm-setting-wireless-security.c b/libnm-util/nm-setting-wireless-security.c index 678a6fad80..ca789b422b 100644 --- a/libnm-util/nm-setting-wireless-security.c +++ b/libnm-util/nm-setting-wireless-security.c @@ -19,10 +19,11 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2010 Red Hat, Inc. * (C) Copyright 2007 - 2008 Novell, Inc. */ +#include #include #include #include diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c index 1d50d4221b..28b2c78fe2 100644 --- a/src/dhcp-manager/nm-dhcp-client.c +++ b/src/dhcp-manager/nm-dhcp-client.c @@ -17,6 +17,7 @@ * */ +#include #include #include #include diff --git a/src/dns-manager/nm-dns-bind.c b/src/dns-manager/nm-dns-bind.c index 2e1ec67dec..9e3fc1739e 100644 --- a/src/dns-manager/nm-dns-bind.c +++ b/src/dns-manager/nm-dns-bind.c @@ -18,6 +18,7 @@ * */ +#include #include #include #include diff --git a/src/dns-manager/nm-dns-dnsmasq.c b/src/dns-manager/nm-dns-dnsmasq.c index 254e2ffbb6..41c8e2a642 100644 --- a/src/dns-manager/nm-dns-dnsmasq.c +++ b/src/dns-manager/nm-dns-dnsmasq.c @@ -18,6 +18,7 @@ * */ +#include #include #include #include diff --git a/src/dns-manager/nm-dns-plugin.c b/src/dns-manager/nm-dns-plugin.c index 5766a90d43..f7d65a529b 100644 --- a/src/dns-manager/nm-dns-plugin.c +++ b/src/dns-manager/nm-dns-plugin.c @@ -17,6 +17,7 @@ * */ +#include #include #include #include diff --git a/src/dnsmasq-manager/nm-dnsmasq-manager.c b/src/dnsmasq-manager/nm-dnsmasq-manager.c index 1dc42fc65d..701c078268 100644 --- a/src/dnsmasq-manager/nm-dnsmasq-manager.c +++ b/src/dnsmasq-manager/nm-dnsmasq-manager.c @@ -18,6 +18,7 @@ * Copyright (C) 2008 - 2010 Red Hat, Inc. */ +#include #include #include #include diff --git a/src/nm-device.c b/src/nm-device.c index 6b12471adc..e8f0b206ca 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -19,6 +19,7 @@ * Copyright (C) 2006 - 2008 Novell, Inc. */ +#include #include #include #include diff --git a/src/nm-policy-hosts.c b/src/nm-policy-hosts.c index a6bb083f24..7f9cff8074 100644 --- a/src/nm-policy-hosts.c +++ b/src/nm-policy-hosts.c @@ -18,6 +18,7 @@ * Copyright (C) 2004 - 2010 Red Hat, Inc. */ +#include #include #include #include diff --git a/src/nm-policy.c b/src/nm-policy.c index 7382ece145..e8a18d0262 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -19,6 +19,7 @@ * Copyright (C) 2007 - 2008 Novell, Inc. */ +#include #include #include #include diff --git a/src/ppp-manager/nm-ppp-manager.c b/src/ppp-manager/nm-ppp-manager.c index 148ad2cf63..efa660b03f 100644 --- a/src/ppp-manager/nm-ppp-manager.c +++ b/src/ppp-manager/nm-ppp-manager.c @@ -19,6 +19,7 @@ * Copyright (C) 2008 - 2010 Red Hat, Inc. */ +#include #include #include #include diff --git a/src/vpn-manager/nm-vpn-service.c b/src/vpn-manager/nm-vpn-service.c index 37bd75d4eb..3d44d9004b 100644 --- a/src/vpn-manager/nm-vpn-service.c +++ b/src/vpn-manager/nm-vpn-service.c @@ -19,6 +19,7 @@ * Copyright (C) 2005 - 2008 Novell, Inc. */ +#include #include #include #include diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index 9aefa9c5e5..f25acc892d 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -18,6 +18,7 @@ * Copyright (C) 2008 - 2010 Red Hat, Inc. */ +#include #include #include #include diff --git a/system-settings/plugins/ifnet/net_utils.c b/system-settings/plugins/ifnet/net_utils.c index 8f1b81b0b3..8a541979d8 100644 --- a/system-settings/plugins/ifnet/net_utils.c +++ b/system-settings/plugins/ifnet/net_utils.c @@ -19,6 +19,7 @@ * Copyright (C) 1999-2010 Gentoo Foundation, Inc. */ +#include #include #include #include -- cgit v1.2.1 From d40c81b06a1f947b1b9a2d727683a31bfb10bebc Mon Sep 17 00:00:00 2001 From: Alex Vogt Date: Fri, 8 Oct 2010 23:03:10 -0500 Subject: linexa: add basic Linexa support --- configure.ac | 12 +++++-- initscript/Makefile.am | 3 ++ initscript/linexa/Makefile.am | 6 ++++ initscript/linexa/networkmanager.in | 59 +++++++++++++++++++++++++++++++++ src/backends/Makefile.am | 4 +++ src/backends/NetworkManagerLinexa.c | 66 +++++++++++++++++++++++++++++++++++++ 6 files changed, 148 insertions(+), 2 deletions(-) create mode 100644 initscript/linexa/Makefile.am create mode 100644 initscript/linexa/networkmanager.in create mode 100644 src/backends/NetworkManagerLinexa.c diff --git a/configure.ac b/configure.ac index 568359706f..e66a1f4903 100644 --- a/configure.ac +++ b/configure.ac @@ -84,7 +84,7 @@ dnl Make sha1.c happy on big endian systems dnl AC_C_BIGENDIAN -AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, arch, slackware, paldo, mandriva or pardus])) +AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, arch, slackware, paldo, mandriva, pardus or linexa])) if test "z$with_distro" = "z"; then AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat") AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse") @@ -96,6 +96,7 @@ if test "z$with_distro" = "z"; then AC_CHECK_FILE(/etc/frugalware-release,with_distro="frugalware") AC_CHECK_FILE(/etc/mandriva-release,with_distro="mandriva") AC_CHECK_FILE(/etc/pardus-release,with_distro="pardus") + AC_CHECK_FILE(/etc/linexa-release,with_distro="linexa") if test "z$with_distro" = "z"; then with_distro=`lsb_release -is` fi @@ -107,7 +108,7 @@ if test "z$with_distro" = "z"; then exit 1 else case $with_distro in - redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware|mandriva|pardus) ;; + redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware|mandriva|pardus|linexa) ;; *) echo "Your distribution (${with_distro}) is not yet supported! (patches welcome)" exit 1 @@ -165,6 +166,11 @@ if test x"$with_distro" = xpardus; then AC_DEFINE(TARGET_PARDUS, 1, [Define if you have Pardus]) fi +AM_CONDITIONAL(TARGET_LINEXA, test x"$with_distro" = xlinexa) +if test x"$with_distro" = xlinexa; then + AC_DEFINE(TARGET_LINEXA, 1, [Define if you have linexa]) +fi + dnl dnl Distribution version string dnl @@ -543,6 +549,8 @@ initscript/paldo/Makefile initscript/paldo/NetworkManager initscript/Mandriva/Makefile initscript/Mandriva/networkmanager +initscript/linexa/Makefile +initscript/linexa/networkmanager introspection/Makefile man/Makefile man/NetworkManager.8 diff --git a/initscript/Makefile.am b/initscript/Makefile.am index 4cc710eba4..65555e3eff 100644 --- a/initscript/Makefile.am +++ b/initscript/Makefile.am @@ -23,3 +23,6 @@ endif if TARGET_MANDRIVA SUBDIRS += Mandriva endif +if TARGET_LINEXA +SUBDIRS += linexa +endif diff --git a/initscript/linexa/Makefile.am b/initscript/linexa/Makefile.am new file mode 100644 index 0000000000..0a0cc2bb3e --- /dev/null +++ b/initscript/linexa/Makefile.am @@ -0,0 +1,6 @@ +EXTRA_DIST = networkmanager +DISTCLEANFILES = networkmanager + +initddir = $(sysconfdir)/rc.d/init.d +initd_SCRIPTS = networkmanager + diff --git a/initscript/linexa/networkmanager.in b/initscript/linexa/networkmanager.in new file mode 100644 index 0000000000..0d754c3604 --- /dev/null +++ b/initscript/linexa/networkmanager.in @@ -0,0 +1,59 @@ +#!/bin/bash +# Start the networkmanager daemon +# +# Author: Elias +# [2010-08-20] + +# Information about the daemon +title="networkmanager" # No spaces allowed in here +start_after="dbus" # dependencies for start-up +stop_after="xinetd" # dependencies for stop +runlevel="2" # start/stop in this runlevel +sequence="25" # "checkinstall networkmanager enable" + # will create links to: + # /etc/rc.d/rc${runlevel}.d/S${sequence}${title} + # /etc/rc.d/rc${runlevel}.d/S$((100 - ${sequence}))${title} + +# check whether daemon is running +# returns 0 if running, >0 if not +check() { + [ -f /var/run/NetworkManager.pid ] +} + +# start procedure +start() { + if check ; then + warning "${title} is already running. Type 'service restart ${title}'" # Issue a warning + else + /usr/sbin/NetworkManager & + evaluate_retval "Starting ${title}. " # Print [ done ] or [ failed ] depending on outcome + fi +} + +# stop procedure +stop() { + if check ; then # daemon is running + kill $(cat /var/run/NetworkManager.pid) + evaluate_retval "Stopping ${title}." # Print [ done ] or [ failed ] depending on outcome + else # daemon not running + warning "${title} is not running." # Issue a warning + fi +} + +# restart procedure +restart() { + stop + sleep 1 + start +} + +# reload action +reload() { + if check ; then # daemon is running + kill -HUP $(cat /var/run/NetworkManager.pid) &>/dev/null + evaluate_retval "Reloading ${title}." # Print [ done ] or [ failed ] depending on outcome + else # daemon not running + warning "${title} is not running." # Issue a warning + fi +} + diff --git a/src/backends/Makefile.am b/src/backends/Makefile.am index b35fafd72a..036dc6de38 100644 --- a/src/backends/Makefile.am +++ b/src/backends/Makefile.am @@ -53,6 +53,10 @@ if TARGET_PARDUS libnmbackend_la_SOURCES += NetworkManagerPardus.c endif +if TARGET_LINEXA +libnmbackend_la_SOURCES += NetworkManagerLinexa.c +endif + libnmbackend_la_LIBADD += \ $(top_builddir)/src/logging/libnm-logging.la \ $(DBUS_LIBS) \ diff --git a/src/backends/NetworkManagerLinexa.c b/src/backends/NetworkManagerLinexa.c new file mode 100644 index 0000000000..015aa17c68 --- /dev/null +++ b/src/backends/NetworkManagerLinexa.c @@ -0,0 +1,66 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * Matthew Garrett + * + * Heavily based on NetworkManagerRedhat.c by Dan Williams + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2004 Tom Parker + * (C) Copyright 2004 Matthew Garrett + * (C) Copyright 2004 Red Hat, Inc. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "NetworkManagerGeneric.h" +#include "nm-system.h" +#include "NetworkManagerUtils.h" +#include "nm-logging.h" + +/* + * nm_system_enable_loopback + * + * Bring up the loopback interface + * + */ +void nm_system_enable_loopback (void) +{ + nm_generic_enable_loopback (); +} + +/* + * nm_system_update_dns + * + * Invalidate the nscd host cache, if it exists, since + * we changed resolv.conf. + * + */ +void nm_system_update_dns (void) +{ + if (g_file_test ("/usr/sbin/nscd", G_FILE_TEST_IS_EXECUTABLE)) { + nm_log_info (LOGD_DNS, "Clearing nscd hosts cache."); + nm_spawn_process ("/usr/sbin/nscd -i hosts"); + } +} + + -- cgit v1.2.1 From 5858c6103e2d79e864f3cbb43601ec3dff7c0a74 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 11 Oct 2010 20:27:51 -0500 Subject: supplicant: make sure we remove the right interface It shouldn't ever happen that two interface objects for the same network interface are active at the same time, but make sure we yell if it does. --- src/supplicant-manager/nm-supplicant-manager.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/supplicant-manager/nm-supplicant-manager.c b/src/supplicant-manager/nm-supplicant-manager.c index c139ec6fef..35fbdb340d 100644 --- a/src/supplicant-manager/nm-supplicant-manager.c +++ b/src/supplicant-manager/nm-supplicant-manager.c @@ -88,8 +88,13 @@ nm_supplicant_manager_iface_release (NMSupplicantManager *self, g_return_if_fail (NM_IS_SUPPLICANT_MANAGER (self)); g_return_if_fail (NM_IS_SUPPLICANT_INTERFACE (iface)); + ifname = nm_supplicant_interface_get_ifname (iface); + g_assert (ifname); + priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); + g_return_if_fail (g_hash_table_lookup (priv->ifaces, ifname) == iface); + /* Ask wpa_supplicant to remove this interface */ op = nm_supplicant_interface_get_object_path (iface); if (priv->running && priv->proxy && op) { @@ -98,8 +103,6 @@ nm_supplicant_manager_iface_release (NMSupplicantManager *self, G_TYPE_INVALID); } - ifname = nm_supplicant_interface_get_ifname (iface); - g_assert (ifname); g_hash_table_remove (priv->ifaces, ifname); } -- cgit v1.2.1 From 48e37de3a4de76a4146d4a716c315031de658e4a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 11 Oct 2010 20:30:40 -0500 Subject: supplicant: prevent a race condition due to D-Bus activation interface_add() could get called from two places: by the wifi/eth device class when activating (which if the supplicant isn't yet running will D-Bus activate it) and from the NameOwnerChanged handler for the wpa_supplicant dbus service smgr_running_cb(). So if the supplicant wasn't running, nm_supplicant_interface_new() would call interface_add() to bring the supplicant to life via activation, then go on and create priv->iface_proxy. When the supplicant appeared and D-Bus sent the NameOwnerChanged, smgr_running_cb() would also call interface_add(), creating a second priv->iface_proxy. The first one got lost and lived after its parent NMSupplicantInterface was killed, and could still respond to signals over the bus. Prevent that by adding another state, STARTING, that indicates that we've already started talking to the supplicant. Also be extra paranoid about disconnecting signal handlers on the proxy. --- src/supplicant-manager/nm-supplicant-interface.c | 51 +++++++++++++++++++----- src/supplicant-manager/nm-supplicant-interface.h | 1 + 2 files changed, 42 insertions(+), 10 deletions(-) diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index 20cce6de5c..415c46d6a3 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -40,8 +40,17 @@ #define WPAS_ERROR_EXISTS_ERROR WPAS_DBUS_INTERFACE ".ExistsError" -G_DEFINE_TYPE (NMSupplicantInterface, nm_supplicant_interface, G_TYPE_OBJECT) +static void wpas_iface_handle_state_change (DBusGProxy *proxy, + const char *str_new_state, + const char *str_old_state, + gpointer user_data); + +static void wpas_iface_handle_scanning (DBusGProxy *proxy, + gboolean scanning, + gpointer user_data); + +G_DEFINE_TYPE (NMSupplicantInterface, nm_supplicant_interface, G_TYPE_OBJECT) #define NM_SUPPLICANT_INTERFACE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ NM_TYPE_SUPPLICANT_INTERFACE, \ @@ -362,6 +371,23 @@ set_state (NMSupplicantInterface *self, guint32 new_state) g_signal_handler_disconnect (priv->smgr, priv->smgr_running_id); priv->smgr_running_id = 0; } + + if (priv->iface_proxy) { + dbus_g_proxy_disconnect_signal (priv->iface_proxy, + "StateChange", + G_CALLBACK (wpas_iface_handle_state_change), + self); + + dbus_g_proxy_disconnect_signal (priv->iface_proxy, + "ScanResultsAvailable", + G_CALLBACK (wpas_iface_query_scan_results), + self); + + dbus_g_proxy_disconnect_signal (priv->iface_proxy, + "Scanning", + G_CALLBACK (wpas_iface_handle_scanning), + self); + } } priv->state = new_state; @@ -584,7 +610,7 @@ interface_add_cb (DBusGProxy *proxy, } static void -interface_add (NMSupplicantInterface * self, gboolean is_wireless) +interface_add (NMSupplicantInterface *self, gboolean is_wireless) { NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); DBusGProxyCall *call; @@ -597,6 +623,9 @@ interface_add (NMSupplicantInterface * self, gboolean is_wireless) nm_log_dbg (LOGD_SUPPLICANT, "(%s): adding interface to supplicant", priv->dev); + /* Move to starting to prevent double-calls of interface_add() */ + set_state (self, NM_SUPPLICANT_INTERFACE_STATE_STARTING); + /* Try to add the interface to the supplicant. If the supplicant isn't * running, this will start it via D-Bus activation and return the response * when the supplicant has started. @@ -1010,6 +1039,8 @@ nm_supplicant_interface_state_to_string (guint32 state) switch (state) { case NM_SUPPLICANT_INTERFACE_STATE_INIT: return "init"; + case NM_SUPPLICANT_INTERFACE_STATE_STARTING: + return "starting"; case NM_SUPPLICANT_INTERFACE_STATE_READY: return "ready"; case NM_SUPPLICANT_INTERFACE_STATE_DISCONNECTED: @@ -1158,6 +1189,13 @@ dispose (GObject *object) } priv->disposed = TRUE; + /* Cancel pending calls before unrefing the dbus manager */ + cancel_all_callbacks (priv->other_pcalls); + nm_call_store_destroy (priv->other_pcalls); + + cancel_all_callbacks (priv->assoc_pcalls); + nm_call_store_destroy (priv->assoc_pcalls); + if (priv->iface_proxy) g_object_unref (priv->iface_proxy); @@ -1178,13 +1216,6 @@ dispose (GObject *object) g_free (priv->dev); - /* Cancel pending calls before unrefing the dbus manager */ - cancel_all_callbacks (priv->other_pcalls); - nm_call_store_destroy (priv->other_pcalls); - - cancel_all_callbacks (priv->assoc_pcalls); - nm_call_store_destroy (priv->assoc_pcalls); - if (priv->dbus_mgr) g_object_unref (priv->dbus_mgr); @@ -1212,7 +1243,7 @@ nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass) g_object_class_install_property (object_class, PROP_STATE, g_param_spec_uint ("state", "State", - "State of the supplicant interface; INIT, READY, or DOWN", + "State of the supplicant interface", NM_SUPPLICANT_INTERFACE_STATE_INIT, NM_SUPPLICANT_INTERFACE_STATE_LAST - 1, NM_SUPPLICANT_INTERFACE_STATE_INIT, diff --git a/src/supplicant-manager/nm-supplicant-interface.h b/src/supplicant-manager/nm-supplicant-interface.h index d6e4a55969..8c51caa1d9 100644 --- a/src/supplicant-manager/nm-supplicant-interface.h +++ b/src/supplicant-manager/nm-supplicant-interface.h @@ -32,6 +32,7 @@ */ enum { NM_SUPPLICANT_INTERFACE_STATE_INIT = 0, + NM_SUPPLICANT_INTERFACE_STATE_STARTING, NM_SUPPLICANT_INTERFACE_STATE_READY, NM_SUPPLICANT_INTERFACE_STATE_DISCONNECTED, NM_SUPPLICANT_INTERFACE_STATE_INACTIVE, -- cgit v1.2.1 From 39e111e5ebbd3f70c41e8d901bab4a68ca171788 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 11 Oct 2010 20:35:54 -0500 Subject: supplicant: ignore unknown wpa_supplicant states Don't treat them as DISCONNECTED. --- src/supplicant-manager/nm-supplicant-interface.c | 36 ++++++++++++++---------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index 415c46d6a3..91da8c6a14 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -318,29 +318,27 @@ wpas_iface_query_scan_results (DBusGProxy *proxy, gpointer user_data) } } -static guint32 +static int wpas_state_string_to_enum (const char *str_state) { - guint32 enum_state = NM_SUPPLICANT_INTERFACE_STATE_DISCONNECTED; - if (!strcmp (str_state, "DISCONNECTED")) - enum_state = NM_SUPPLICANT_INTERFACE_STATE_DISCONNECTED; + return NM_SUPPLICANT_INTERFACE_STATE_DISCONNECTED; else if (!strcmp (str_state, "INACTIVE")) - enum_state = NM_SUPPLICANT_INTERFACE_STATE_INACTIVE; + return NM_SUPPLICANT_INTERFACE_STATE_INACTIVE; else if (!strcmp (str_state, "SCANNING")) - enum_state = NM_SUPPLICANT_INTERFACE_STATE_SCANNING; + return NM_SUPPLICANT_INTERFACE_STATE_SCANNING; else if (!strcmp (str_state, "ASSOCIATING")) - enum_state = NM_SUPPLICANT_INTERFACE_STATE_ASSOCIATING; + return NM_SUPPLICANT_INTERFACE_STATE_ASSOCIATING; else if (!strcmp (str_state, "ASSOCIATED")) - enum_state = NM_SUPPLICANT_INTERFACE_STATE_ASSOCIATED; + return NM_SUPPLICANT_INTERFACE_STATE_ASSOCIATED; else if (!strcmp (str_state, "4WAY_HANDSHAKE")) - enum_state = NM_SUPPLICANT_INTERFACE_STATE_4WAY_HANDSHAKE; + return NM_SUPPLICANT_INTERFACE_STATE_4WAY_HANDSHAKE; else if (!strcmp (str_state, "GROUP_HANDSHAKE")) - enum_state = NM_SUPPLICANT_INTERFACE_STATE_GROUP_HANDSHAKE; + return NM_SUPPLICANT_INTERFACE_STATE_GROUP_HANDSHAKE; else if (!strcmp (str_state, "COMPLETED")) - enum_state = NM_SUPPLICANT_INTERFACE_STATE_COMPLETED; + return NM_SUPPLICANT_INTERFACE_STATE_COMPLETED; - return enum_state; + return -1; } static void @@ -401,8 +399,11 @@ wpas_iface_handle_state_change (DBusGProxy *proxy, const char *str_old_state, gpointer user_data) { - set_state (NM_SUPPLICANT_INTERFACE (user_data), - wpas_state_string_to_enum (str_new_state)); + int enum_state = wpas_state_string_to_enum (str_new_state); + + g_return_if_fail (enum_state > 0); + + set_state (NM_SUPPLICANT_INTERFACE (user_data), (guint32) enum_state); } /* Explicit state request reply handler */ @@ -412,6 +413,7 @@ iface_state_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; GError *err = NULL; char *state_str = NULL; + int enum_state; if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_STRING, &state_str, @@ -419,7 +421,11 @@ iface_state_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) nm_log_warn (LOGD_SUPPLICANT, "could not get interface state: %s.", err->message); g_error_free (err); } else { - set_state (info->interface, wpas_state_string_to_enum (state_str)); + enum_state = wpas_state_string_to_enum (state_str); + g_warn_if_fail (enum_state > 0); + + if (enum_state > 0) + set_state (info->interface, (guint32) enum_state); g_free (state_str); } } -- cgit v1.2.1 From f532f41c022857768464e335865863c39caf5c7c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 12 Oct 2010 14:18:42 -0500 Subject: supplicant: ratelimit supplicant activation If the supplicant dies a number of times within a short period of time, make it go sit in the corner for a bit instead of continuously trying to start it and have it die again. Instead of just exposing a "running" value, instead make a meta "available" value that's a combination of whether the supplicant is actually running plus whether we want to talk to it right now or not. --- src/supplicant-manager/nm-supplicant-interface.c | 32 ++++---- src/supplicant-manager/nm-supplicant-interface.h | 3 +- src/supplicant-manager/nm-supplicant-manager.c | 99 ++++++++++++++++++++---- src/supplicant-manager/nm-supplicant-manager.h | 4 +- 4 files changed, 106 insertions(+), 32 deletions(-) diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index 91da8c6a14..bad8f26634 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -80,7 +80,7 @@ enum { typedef struct { NMSupplicantManager * smgr; - gulong smgr_running_id; + gulong smgr_avail_id; NMDBusManager * dbus_mgr; char * dev; gboolean is_wireless; @@ -365,9 +365,9 @@ set_state (NMSupplicantInterface *self, guint32 new_state) cancel_all_callbacks (priv->assoc_pcalls); /* Disconnect supplicant manager state listeners since we're done */ - if (priv->smgr_running_id) { - g_signal_handler_disconnect (priv->smgr, priv->smgr_running_id); - priv->smgr_running_id = 0; + if (priv->smgr_avail_id) { + g_signal_handler_disconnect (priv->smgr, priv->smgr_avail_id); + priv->smgr_avail_id = 0; } if (priv->iface_proxy) { @@ -662,14 +662,14 @@ interface_add (NMSupplicantInterface *self, gboolean is_wireless) } static void -smgr_running_cb (NMSupplicantManager *smgr, - GParamSpec *pspec, - gpointer user_data) +smgr_avail_cb (NMSupplicantManager *smgr, + GParamSpec *pspec, + gpointer user_data) { NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data); NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (user_data); - if (nm_supplicant_manager_running (smgr)) { + if (nm_supplicant_manager_available (smgr)) { /* This can happen if the supplicant couldn't be activated but * for some reason was started after the activation failure. */ @@ -1105,7 +1105,8 @@ nm_supplicant_interface_get_ifname (NMSupplicantInterface *self) NMSupplicantInterface * nm_supplicant_interface_new (NMSupplicantManager *smgr, const char *ifname, - gboolean is_wireless) + gboolean is_wireless, + gboolean start_now) { NMSupplicantInterface *self; NMSupplicantInterfacePrivate *priv; @@ -1120,15 +1121,16 @@ nm_supplicant_interface_new (NMSupplicantManager *smgr, priv->smgr = g_object_ref (smgr); id = g_signal_connect (priv->smgr, - "notify::" NM_SUPPLICANT_MANAGER_RUNNING, - G_CALLBACK (smgr_running_cb), + "notify::" NM_SUPPLICANT_MANAGER_AVAILABLE, + G_CALLBACK (smgr_avail_cb), self); - priv->smgr_running_id = id; + priv->smgr_avail_id = id; priv->dev = g_strdup (ifname); priv->is_wireless = is_wireless; - interface_add (self, priv->is_wireless); + if (start_now) + interface_add (self, priv->is_wireless); } return self; @@ -1215,8 +1217,8 @@ dispose (GObject *object) g_source_remove (priv->scan_results_timeout); if (priv->smgr) { - if (priv->smgr_running_id) - g_signal_handler_disconnect (priv->smgr, priv->smgr_running_id); + if (priv->smgr_avail_id) + g_signal_handler_disconnect (priv->smgr, priv->smgr_avail_id); g_object_unref (priv->smgr); } diff --git a/src/supplicant-manager/nm-supplicant-interface.h b/src/supplicant-manager/nm-supplicant-interface.h index 8c51caa1d9..9471bd771b 100644 --- a/src/supplicant-manager/nm-supplicant-interface.h +++ b/src/supplicant-manager/nm-supplicant-interface.h @@ -93,7 +93,8 @@ GType nm_supplicant_interface_get_type (void); NMSupplicantInterface * nm_supplicant_interface_new (NMSupplicantManager * smgr, const char *ifname, - gboolean is_wireless); + gboolean is_wireless, + gboolean start_now); gboolean nm_supplicant_interface_set_config (NMSupplicantInterface * iface, NMSupplicantConfig * cfg); diff --git a/src/supplicant-manager/nm-supplicant-manager.c b/src/supplicant-manager/nm-supplicant-manager.c index 35fbdb340d..35ef749cb6 100644 --- a/src/supplicant-manager/nm-supplicant-manager.c +++ b/src/supplicant-manager/nm-supplicant-manager.c @@ -37,7 +37,7 @@ G_DEFINE_TYPE (NMSupplicantManager, nm_supplicant_manager, G_TYPE_OBJECT) /* Properties */ enum { PROP_0 = 0, - PROP_RUNNING, + PROP_AVAILABLE, LAST_PROP }; @@ -47,18 +47,27 @@ typedef struct { DBusGProxy * proxy; gboolean running; GHashTable * ifaces; + guint die_count_reset_id; + guint die_count; gboolean disposed; } NMSupplicantManagerPrivate; /********************************************************************/ +static inline gboolean +die_count_exceeded (guint32 count) +{ + return count > 2; +} + NMSupplicantInterface * nm_supplicant_manager_iface_get (NMSupplicantManager * self, const char *ifname, gboolean is_wireless) { NMSupplicantManagerPrivate *priv; - NMSupplicantInterface * iface = NULL; + NMSupplicantInterface *iface = NULL; + gboolean start_now; g_return_val_if_fail (NM_IS_SUPPLICANT_MANAGER (self), NULL); g_return_val_if_fail (ifname != NULL, NULL); @@ -67,8 +76,15 @@ nm_supplicant_manager_iface_get (NMSupplicantManager * self, iface = g_hash_table_lookup (priv->ifaces, ifname); if (!iface) { + /* If we're making the supplicant take a time out for a bit, don't + * let the supplicant interface start immediately, just let it hang + * around in INIT state until we're ready to talk to the supplicant + * again. + */ + start_now = !die_count_exceeded (priv->die_count); + nm_log_dbg (LOGD_SUPPLICANT, "(%s): creating new supplicant interface", ifname); - iface = nm_supplicant_interface_new (self, ifname, is_wireless); + iface = nm_supplicant_interface_new (self, ifname, is_wireless, start_now); if (iface) g_hash_table_insert (priv->ifaces, g_strdup (ifname), iface); } else { @@ -107,14 +123,51 @@ nm_supplicant_manager_iface_release (NMSupplicantManager *self, } gboolean -nm_supplicant_manager_running (NMSupplicantManager *self) +nm_supplicant_manager_available (NMSupplicantManager *self) { g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (NM_IS_SUPPLICANT_MANAGER (self), FALSE); + if (die_count_exceeded (NM_SUPPLICANT_MANAGER_GET_PRIVATE (self)->die_count)) + return FALSE; return NM_SUPPLICANT_MANAGER_GET_PRIVATE (self)->running; } +static void +set_running (NMSupplicantManager *self, gboolean now_running) +{ + NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); + gboolean old_available = nm_supplicant_manager_available (self); + + priv->running = now_running; + if (old_available != nm_supplicant_manager_available (self)) + g_object_notify (G_OBJECT (self), NM_SUPPLICANT_MANAGER_AVAILABLE); +} + +static void +set_die_count (NMSupplicantManager *self, guint new_die_count) +{ + NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); + gboolean old_available = nm_supplicant_manager_available (self); + + priv->die_count = new_die_count; + if (old_available != nm_supplicant_manager_available (self)) + g_object_notify (G_OBJECT (self), NM_SUPPLICANT_MANAGER_AVAILABLE); +} + +static gboolean +wpas_die_count_reset_cb (gpointer user_data) +{ + NMSupplicantManager *self = NM_SUPPLICANT_MANAGER (user_data); + NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); + + /* Reset the die count back to zero, which allows use of the supplicant again */ + priv->die_count_reset_id = 0; + set_die_count (self, 0); + nm_log_info (LOGD_SUPPLICANT, "wpa_supplicant die count reset"); + return FALSE; +} + static void name_owner_changed (NMDBusManager *dbus_mgr, const char *name, @@ -133,12 +186,27 @@ name_owner_changed (NMDBusManager *dbus_mgr, if (!old_owner_good && new_owner_good) { nm_log_info (LOGD_SUPPLICANT, "wpa_supplicant started"); - priv->running = TRUE; - g_object_notify (G_OBJECT (self), NM_SUPPLICANT_MANAGER_RUNNING); + set_running (self, TRUE); } else if (old_owner_good && !new_owner_good) { nm_log_info (LOGD_SUPPLICANT, "wpa_supplicant stopped"); - priv->running = FALSE; - g_object_notify (G_OBJECT (self), NM_SUPPLICANT_MANAGER_RUNNING); + + /* Reschedule the die count reset timeout. Every time the supplicant + * dies we wait 10 seconds before resetting the counter. If the + * supplicant died more than twice before the timer is reset, then + * we don't try to talk to the supplicant for a while. + */ + if (priv->die_count_reset_id) + g_source_remove (priv->die_count_reset_id); + priv->die_count_reset_id = g_timeout_add_seconds (10, wpas_die_count_reset_cb, self); + set_die_count (self, priv->die_count + 1); + + if (die_count_exceeded (priv->die_count)) { + nm_log_info (LOGD_SUPPLICANT, + "wpa_supplicant die count %d; ignoring for 10 seconds", + priv->die_count); + } + + set_running (self, FALSE); } } @@ -190,8 +258,8 @@ static void get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { switch (prop_id) { - case PROP_RUNNING: - g_value_set_boolean (value, NM_SUPPLICANT_MANAGER_GET_PRIVATE (object)->running); + case PROP_AVAILABLE: + g_value_set_boolean (value, nm_supplicant_manager_available (NM_SUPPLICANT_MANAGER (object))); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -208,6 +276,9 @@ dispose (GObject *object) goto out; priv->disposed = TRUE; + if (priv->die_count_reset_id) + g_source_remove (priv->die_count_reset_id); + if (priv->dbus_mgr) { if (priv->name_owner_id) g_signal_handler_disconnect (priv->dbus_mgr, priv->name_owner_id); @@ -235,10 +306,10 @@ nm_supplicant_manager_class_init (NMSupplicantManagerClass *klass) object_class->set_property = set_property; object_class->dispose = dispose; - g_object_class_install_property (object_class, PROP_RUNNING, - g_param_spec_boolean (NM_SUPPLICANT_MANAGER_RUNNING, - "Running", - "Running", + g_object_class_install_property (object_class, PROP_AVAILABLE, + g_param_spec_boolean (NM_SUPPLICANT_MANAGER_AVAILABLE, + "Available", + "Available", FALSE, G_PARAM_READABLE)); } diff --git a/src/supplicant-manager/nm-supplicant-manager.h b/src/supplicant-manager/nm-supplicant-manager.h index ca3b643f57..e9c31a997b 100644 --- a/src/supplicant-manager/nm-supplicant-manager.h +++ b/src/supplicant-manager/nm-supplicant-manager.h @@ -40,7 +40,7 @@ G_BEGIN_DECLS #define NM_IS_SUPPLICANT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SUPPLICANT_MANAGER)) #define NM_SUPPLICANT_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SUPPLICANT_MANAGER, NMSupplicantManagerClass)) -#define NM_SUPPLICANT_MANAGER_RUNNING "running" +#define NM_SUPPLICANT_MANAGER_AVAILABLE "available" struct _NMSupplicantManager { @@ -63,6 +63,6 @@ NMSupplicantInterface *nm_supplicant_manager_iface_get (NMSupplicantManager *mgr void nm_supplicant_manager_iface_release (NMSupplicantManager *mgr, NMSupplicantInterface *iface); -gboolean nm_supplicant_manager_running (NMSupplicantManager *mgr); +gboolean nm_supplicant_manager_available (NMSupplicantManager *mgr); #endif /* NM_SUPPLICANT_MANAGER_H */ -- cgit v1.2.1 From 9f2b48ef084f8f5b361bb16146b27b92c18607d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Fri, 15 Oct 2010 09:41:34 +0200 Subject: libnm-glib: call D-Bus with a timeout when Set()ting properties The caller needs to be authenticated, so wait a bit to be sure it didn't quit too quickly. --- libnm-glib/Makefile.am | 2 +- libnm-glib/nm-object.c | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/libnm-glib/Makefile.am b/libnm-glib/Makefile.am index 008cc6df16..ec21a328e9 100644 --- a/libnm-glib/Makefile.am +++ b/libnm-glib/Makefile.am @@ -132,7 +132,7 @@ libnm_glib_la_LIBADD = \ $(GUDEV_LIBS) libnm_glib_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-glib.ver \ - -version-info "6:1:4" + -version-info "6:2:4" noinst_PROGRAMS = libnm-glib-test diff --git a/libnm-glib/nm-object.c b/libnm-glib/nm-object.c index 72ea05005e..85cb6b78ab 100644 --- a/libnm-glib/nm-object.c +++ b/libnm-glib/nm-object.c @@ -527,12 +527,17 @@ _nm_object_set_property (NMObject *object, g_return_if_fail (prop_name != NULL); g_return_if_fail (G_IS_VALUE (value)); - dbus_g_proxy_call_no_reply (NM_OBJECT_GET_PRIVATE (object)->properties_proxy, - "Set", - G_TYPE_STRING, interface, - G_TYPE_STRING, prop_name, - G_TYPE_VALUE, value, - G_TYPE_INVALID); + if (!dbus_g_proxy_call_with_timeout (NM_OBJECT_GET_PRIVATE (object)->properties_proxy, + "Set", 2000, NULL, + G_TYPE_STRING, interface, + G_TYPE_STRING, prop_name, + G_TYPE_VALUE, value, + G_TYPE_INVALID)) { + + /* Ignore errors. dbus_g_proxy_call_with_timeout() is called instead of + * dbus_g_proxy_call_no_reply() to give NM chance to authenticate the caller. + */ + } } char * -- cgit v1.2.1 From 8310593ce48a85aa82d4a2adf805662f2b019ef5 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 15 Oct 2010 10:28:38 -0500 Subject: core: ignore authorization for sleep/wake requests (but restrict to root) (rh #638640) Everyone uses pm-utils still for sleep/wake support, and that's traditionally how NM was put to sleep and woken up. But pm-utils uses dbus-send without --print-reply so dbus-send quits immediately after sending the message. That doesn't give NM enough time to get the senders UID and thus validate the request, so the request gets denied, and sometimes NM stays asleep after the machine is woken up. Instead, don't get the sender's UID and try to authorize it, but just let the request go through. Rely on D-Bus permissions to make sure that only root can call sleep/wake methods. --- src/NetworkManager.conf | 24 ++++++++++++++++++++++++ src/nm-manager.c | 20 +++++++++++++++++++- 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/src/NetworkManager.conf b/src/NetworkManager.conf index 8d08314002..1f1ed49b46 100644 --- a/src/NetworkManager.conf +++ b/src/NetworkManager.conf @@ -60,6 +60,18 @@ + + + + + + @@ -72,6 +84,18 @@ send_interface="org.freedesktop.NetworkManager" send_member="SetLogging"/> + + + + + + diff --git a/src/nm-manager.c b/src/nm-manager.c index 758a0826bd..4a3e4997d9 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -3369,6 +3369,7 @@ _internal_sleep (NMManager *self, gboolean do_sleep) g_object_notify (G_OBJECT (self), NM_MANAGER_SLEEPING); } +#if 0 static void sleep_auth_done_cb (NMAuthChain *chain, GError *error, @@ -3407,6 +3408,7 @@ sleep_auth_done_cb (NMAuthChain *chain, nm_auth_chain_unref (chain); } +#endif static void impl_manager_sleep (NMManager *self, @@ -3414,10 +3416,12 @@ impl_manager_sleep (NMManager *self, DBusGMethodInvocation *context) { NMManagerPrivate *priv; - NMAuthChain *chain; GError *error = NULL; +#if 0 + NMAuthChain *chain; gulong sender_uid = G_MAXULONG; const char *error_desc = NULL; +#endif g_return_if_fail (NM_IS_MANAGER (self)); @@ -3432,6 +3436,19 @@ impl_manager_sleep (NMManager *self, return; } + /* Unconditionally allow the request. Previously it was polkit protected + * but unfortunately that doesn't work for short-lived processes like + * pm-utils. It uses dbus-send without --print-reply, which quits + * immediately after sending the request, and NM is unable to obtain the + * sender's UID as dbus-send has already dropped off the bus. Thus NM + * fails the request. Instead, don't validate the request, but rely on + * D-Bus permissions to restrict the call to root. + */ + _internal_sleep (self, do_sleep); + dbus_g_method_return (context); + return; + +#if 0 if (!nm_auth_get_caller_uid (context, priv->dbus_mgr, &sender_uid, &error_desc)) { error = g_error_new_literal (NM_MANAGER_ERROR, NM_MANAGER_ERROR_PERMISSION_DENIED, @@ -3457,6 +3474,7 @@ impl_manager_sleep (NMManager *self, nm_auth_chain_set_data (chain, "sleep", GUINT_TO_POINTER (do_sleep), NULL); nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_SLEEP_WAKE, TRUE); +#endif } static void -- cgit v1.2.1 From 98d759e41736da6dab0456f24623b8b8be229de6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D0=BB=D0=BE=D1=88=20=D0=9F=D0=BE=D0=BF=D0=BE?= =?UTF-8?q?=D0=B2=D0=B8=D1=9B?= Date: Tue, 19 Oct 2010 11:17:51 -0500 Subject: po: updated Serbian translation (bgo #632454) --- po/sr.po | 2256 +++++++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 1949 insertions(+), 307 deletions(-) diff --git a/po/sr.po b/po/sr.po index e04c016477..160630c377 100644 --- a/po/sr.po +++ b/po/sr.po @@ -1,437 +1,2079 @@ # Serbian Cyrillic and Latin translations for NetworkManager # Copyright (C) 2004-2005 GNOME Foundation # This file is distributed under the same licence as the NetworkManager package. +# Милош Поповић , 2010. # msgid "" msgstr "" "Project-Id-Version: NetworkManager\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-05-13 16:11-0400\n" -"PO-Revision-Date: 2006-06-02 20:40+0200\n" -"Last-Translator: Filip Miletic \n" -"Language-Team: Serbian \n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-09-22 03:25+0000\n" +"PO-Revision-Date: 2010-10-18 16:48+0200\n" +"Last-Translator: Милош Поповић \n" +"Language-Team: Serbian \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" +"Plural-Forms: nplurals=4; plural=n==1? 3 : n%10==1 && n%100!=11 ? 0 : n" +"%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/devices.c:88 ../cli/src/devices.c:101 ../cli/src/devices.c:111 +#: ../cli/src/devices.c:121 ../cli/src/devices.c:134 ../cli/src/devices.c:145 +#: ../cli/src/devices.c:156 ../cli/src/devices.c:165 ../cli/src/devices.c:174 +msgid "NAME" +msgstr "ИМЕ" + +#. 0 +#: ../cli/src/connections.c:61 ../cli/src/connections.c:76 +msgid "UUID" +msgstr "УУИД" + +#. 1 +#: ../cli/src/connections.c:62 +msgid "DEVICES" +msgstr "УРЕЂАЈИ" + +#. 2 +#: ../cli/src/connections.c:63 ../cli/src/connections.c:78 +msgid "SCOPE" +msgstr "ОПСЕГ" + +#. 3 +#: ../cli/src/connections.c:64 +msgid "DEFAULT" +msgstr "ПОДРАЗУМЕВАНО" + +#. 4 +#: ../cli/src/connections.c:65 +msgid "DBUS-SERVICE" +msgstr "ДБУС-СЕРВИС" + +#. 5 +#: ../cli/src/connections.c:66 +msgid "SPEC-OBJECT" +msgstr "СПЕЦ-ОБЈЕКТ" + +#. 6 +#: ../cli/src/connections.c:67 +msgid "VPN" +msgstr "ВПН" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:77 ../cli/src/devices.c:62 ../cli/src/devices.c:90 +msgid "TYPE" +msgstr "ВРСТА" + +#. 3 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP" +msgstr "ОЗНАКА_ВРЕМЕНА" + +#. 4 +#: ../cli/src/connections.c:80 +msgid "TIMESTAMP-REAL" +msgstr "СТВАРНА-ОЗНАКА_ВРЕМЕНА" + +#. 5 +#: ../cli/src/connections.c:81 +msgid "AUTOCONNECT" +msgstr "САМОПОВЕЗИВАЊЕ" + +#. 6 +#: ../cli/src/connections.c:82 +msgid "READONLY" +msgstr "САМО_ЗА_ЧИТАЊЕ" + +#. 7 +#: ../cli/src/connections.c:83 +msgid "DBUS-PATH" +msgstr "ДБАС-ПУТАЊА" + +#: ../cli/src/connections.c:159 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Употреба: nmcli con { НАРЕДБА | help }\n" +" НАРЕДБА := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:540 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Грешка: „con list“: %s" -#: examples/python/systray/eggtrayicon.c:111 gnome/applet/eggtrayicon.c:118 -msgid "Orientation" -msgstr "Усмерење" +#: ../cli/src/connections.c:201 ../cli/src/connections.c:542 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Грешка: „con list“: %s; дозвољена поља: %s" + +#: ../cli/src/connections.c:209 +msgid "Connection details" +msgstr "Подаци о вези" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:605 +msgid "system" +msgstr "систем" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:605 +msgid "user" +msgstr "корисник" + +#: ../cli/src/connections.c:386 +msgid "never" +msgstr "никада" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:387 ../cli/src/connections.c:388 +#: ../cli/src/connections.c:606 ../cli/src/connections.c:609 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:551 ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 +msgid "yes" +msgstr "да" + +#: ../cli/src/connections.c:387 ../cli/src/connections.c:388 +#: ../cli/src/connections.c:606 ../cli/src/connections.c:609 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:510 ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 ../cli/src/settings.c:1224 +msgid "no" +msgstr "не" + +#: ../cli/src/connections.c:461 ../cli/src/connections.c:504 +msgid "System connections" +msgstr "Везе на систему" + +#: ../cli/src/connections.c:466 ../cli/src/connections.c:517 +msgid "User connections" +msgstr "Корисникове везе" + +#: ../cli/src/connections.c:478 ../cli/src/connections.c:1338 +#: ../cli/src/connections.c:1354 ../cli/src/connections.c:1363 +#: ../cli/src/connections.c:1374 ../cli/src/connections.c:1459 +#: ../cli/src/devices.c:962 ../cli/src/devices.c:972 ../cli/src/devices.c:1074 +#: ../cli/src/devices.c:1081 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Грешка: Недостаје аргумент %s." -# Потребан је бољи превод за ово -#: examples/python/systray/eggtrayicon.c:112 gnome/applet/eggtrayicon.c:119 -msgid "The orientation of the tray." -msgstr "Усмерење обавештајне зоне." +#: ../cli/src/connections.c:491 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Грешка: %s — ова веза не постоји." -#: gnome/applet/applet-dbus-info.c:852 +#: ../cli/src/connections.c:523 ../cli/src/connections.c:1387 +#: ../cli/src/connections.c:1477 ../cli/src/devices.c:785 +#: ../cli/src/devices.c:852 ../cli/src/devices.c:986 ../cli/src/devices.c:1087 #, c-format -msgid "" -"The requested wireless network '%s' does not appear to be in range. A " -"different wireless network will be used if any are available." -msgstr "Тражена бежична мрежа „%s“ није у домету. Биће коришћена друга бежична мрежа ако је расположива." +msgid "Unknown parameter: %s\n" +msgstr "Непознати параметар: %s\n" -#: gnome/applet/applet-dbus.c:573 +#: ../cli/src/connections.c:532 #, c-format -msgid "Connection to the wireless network '%s' failed.\n" -msgstr "Неуспела веза са бежичном мрежом „%s“.\n" +msgid "Error: no valid parameter specified." +msgstr "Грешка: није одређен исправан параметар." -#: gnome/applet/applet-dbus.c:578 -msgid "Connection to the wired network failed.\n" -msgstr "Неуспела веза са жичаном мрежом.\n" +#: ../cli/src/connections.c:547 ../cli/src/connections.c:1580 +#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:359 +#, c-format +msgid "Error: %s." +msgstr "Грешка: %s." + +#: ../cli/src/connections.c:653 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Грешка: „con status“: %s" -#: gnome/applet/applet.c:194 gnome/applet/applet.c:212 -msgid "NetworkManager Applet" -msgstr "Аплет Управник мреже" +#: ../cli/src/connections.c:655 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Грешка: „con status“: %s; дозвољена поља: %s" -#: gnome/applet/applet.c:196 gnome/applet/applet.c:214 -msgid "Copyright (C) 2004-2005 Red Hat, Inc." -msgstr "Copyright (C) 2004-2005 Red Hat, Inc." +#: ../cli/src/connections.c:662 +msgid "Active connections" +msgstr "Активне везе" -#: gnome/applet/applet.c:197 gnome/applet/applet.c:215 -msgid "" -"Notification area applet for managing your network devices and connections." -msgstr "Аплет за обавештајну зону за управљање мрежним уређајима и везама." +#: ../cli/src/connections.c:1030 +#, c-format +msgid "no active connection on device '%s'" +msgstr "нема активних веза на уређају „%s“" + +#: ../cli/src/connections.c:1038 +#, c-format +msgid "no active connection or device" +msgstr "нема активних веза на уређају" + +#: ../cli/src/connections.c:1088 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "уређај „%s“ не подржава везу „%s“" + +#: ../cli/src/connections.c:1090 +#, c-format +msgid "no device found for connection '%s'" +msgstr "не постоји уређај за везу „%s“" + +#: ../cli/src/connections.c:1101 +msgid "activating" +msgstr "покрећем" + +#: ../cli/src/connections.c:1103 +msgid "activated" +msgstr "покренуто" + +#: ../cli/src/connections.c:1106 ../cli/src/connections.c:1129 +#: ../cli/src/connections.c:1162 ../cli/src/devices.c:246 +#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:149 ../cli/src/settings.c:473 +msgid "unknown" +msgstr "непознато" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting (prepare)" +msgstr "Повезивање на ВПН (припрема)" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (need authentication)" +msgstr "Повезивање на ВПН (потребна пријава)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connecting" +msgstr "Повезивање на ВПН" + +#: ../cli/src/connections.c:1121 +msgid "VPN connecting (getting IP configuration)" +msgstr "Повезивање на ВПН (прикупљам ИП подешавања)" + +#: ../cli/src/connections.c:1123 +msgid "VPN connected" +msgstr "Повезани сте на ВПН" + +#: ../cli/src/connections.c:1125 +msgid "VPN connection failed" +msgstr "Није успело повезивање на ВПН" + +#: ../cli/src/connections.c:1127 +msgid "VPN disconnected" +msgstr "ВПН веза је прекинута" + +#: ../cli/src/connections.c:1138 +msgid "unknown reason" +msgstr "непознат разлог" + +#: ../cli/src/connections.c:1140 +msgid "none" +msgstr "ништа" + +#: ../cli/src/connections.c:1142 +msgid "the user was disconnected" +msgstr "корисник је откачен са мреже" + +#: ../cli/src/connections.c:1144 +msgid "the base network connection was interrupted" +msgstr "основна мрежна веза је поремећена" + +#: ../cli/src/connections.c:1146 +msgid "the VPN service stopped unexpectedly" +msgstr "ВПН сервис је неочекивано изашао" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service returned invalid configuration" +msgstr "ВПН сервис је вратио погрешне поставке" + +#: ../cli/src/connections.c:1150 +msgid "the connection attempt timed out" +msgstr "истекло је време за покушај повезивања" + +#: ../cli/src/connections.c:1152 +msgid "the VPN service did not start in time" +msgstr "ВПН сервис није покренут на време" + +#: ../cli/src/connections.c:1154 +msgid "the VPN service failed to start" +msgstr "не могу да покренем ВПН сервис" + +#: ../cli/src/connections.c:1156 +msgid "no valid VPN secrets" +msgstr "нису исправне ВПН лозинке" + +#: ../cli/src/connections.c:1158 +msgid "invalid VPN secrets" +msgstr "неисправне ВПН лозинке" + +#: ../cli/src/connections.c:1160 +msgid "the connection was removed" +msgstr "веза је уклоњена" + +#: ../cli/src/connections.c:1174 +#, c-format +msgid "state: %s\n" +msgstr "стање: %s\n" -#: gnome/applet/applet.c:280 +#: ../cli/src/connections.c:1177 ../cli/src/connections.c:1203 +#, c-format +msgid "Connection activated\n" +msgstr "Веза је покренута\n" + +#: ../cli/src/connections.c:1180 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Грешка: Није успело покретање везе." + +#: ../cli/src/connections.c:1199 +#, c-format +msgid "state: %s (%d)\n" +msgstr "стање: %s (%d)\n" + +#: ../cli/src/connections.c:1209 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Грешка: Покретање везе није успело: %s." + +#: ../cli/src/connections.c:1226 ../cli/src/devices.c:909 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Грешка: Истекло је време од %d s." + +#: ../cli/src/connections.c:1269 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Грешка: Није успело покретање везе: %s" + +#: ../cli/src/connections.c:1283 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Грешка: Не могу да нађем покренуту везу за „%s“." + +#: ../cli/src/connections.c:1292 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Стање активне везе: %s\n" + +#: ../cli/src/connections.c:1293 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Путања до активне везе: %s\n" + +#: ../cli/src/connections.c:1347 ../cli/src/connections.c:1468 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Грешка: Непозната веза: %s." + +#: ../cli/src/connections.c:1382 ../cli/src/devices.c:980 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Грешка: није исправна вредност „%s“ за истек времена." + +#: ../cli/src/connections.c:1395 ../cli/src/connections.c:1485 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Грешка: морате да задате ид или ууид." + +#: ../cli/src/connections.c:1415 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Грешка: Није пронађен одговарајући уређај: %s." + +#: ../cli/src/connections.c:1417 +#, c-format +msgid "Error: No suitable device found." +msgstr "Грешка: Није пронађен одговарајући уређај." + +#: ../cli/src/connections.c:1512 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Упозорење: Није покренута веза\n" + +#: ../cli/src/connections.c:1569 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Грешка: „con“ наредба „%s“ није исправна." + +#: ../cli/src/connections.c:1605 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Грешка: не могу да се повежем на Д-Бас." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Грешка: Не могу да добијем системска подешавања." + +#: ../cli/src/connections.c:1620 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Грешка: Не могу да добијем корисничка подешавања." + +#: ../cli/src/connections.c:1630 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "" +"Грешка: Не могу да нађем везе: управљачки програми за подешавања нису " +"покренути." + +#. 0 +#. 9 +#: ../cli/src/devices.c:61 ../cli/src/devices.c:89 ../cli/src/devices.c:184 +msgid "DEVICE" +msgstr "УРЕЂАЈ" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:63 ../cli/src/devices.c:93 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "СТАЊЕ" + +#: ../cli/src/devices.c:72 +msgid "GENERAL" +msgstr "ОПШТЕ" + +#. 0 +#: ../cli/src/devices.c:73 +msgid "CAPABILITIES" +msgstr "СПОСОБНОСТИ" + +#. 1 +#: ../cli/src/devices.c:74 +msgid "WIFI-PROPERTIES" +msgstr "БЕЖИЧНЕ-ОСОБИНЕ" + +#. 2 +#: ../cli/src/devices.c:75 +msgid "AP" +msgstr "АП" + +#. 3 +#: ../cli/src/devices.c:76 +msgid "WIRED-PROPERTIES" +msgstr "ЖИЧАНЕ-ОСОБИНЕ" + +#. 4 +#: ../cli/src/devices.c:77 +msgid "IP4-SETTINGS" +msgstr "ИП4-ПОДЕШАВАЊА" + +#. 5 +#: ../cli/src/devices.c:78 +msgid "IP4-DNS" +msgstr "ИП4-ДНС" + +#. 6 +#: ../cli/src/devices.c:79 +msgid "IP6-SETTINGS" +msgstr "ИП6-ПОДЕШАВАЊА" + +#. 7 +#: ../cli/src/devices.c:80 +msgid "IP6-DNS" +msgstr "ИП6-ДНС" + +#. 2 +#: ../cli/src/devices.c:91 +msgid "DRIVER" +msgstr "ДРАЈВЕР" + +#. 3 +#: ../cli/src/devices.c:92 +msgid "HWADDR" +msgstr "ХАРДВАДРЕСА" + +#. 0 +#: ../cli/src/devices.c:102 +msgid "CARRIER-DETECT" +msgstr "НАЛАЖ-НОСАЧА" + +#. 1 +#: ../cli/src/devices.c:103 +msgid "SPEED" +msgstr "БРЗИНА" + +#. 0 +#: ../cli/src/devices.c:112 +msgid "CARRIER" +msgstr "НОСАЧ" + +#. 0 +#: ../cli/src/devices.c:122 +msgid "WEP" +msgstr "ВЕП" + +#. 1 +#: ../cli/src/devices.c:123 +msgid "WPA" +msgstr "ВПА" + +#. 2 +#: ../cli/src/devices.c:124 +msgid "WPA2" +msgstr "ВПА2" + +#. 3 +#: ../cli/src/devices.c:125 +msgid "TKIP" +msgstr "ТКИП" + +#. 4 +#: ../cli/src/devices.c:126 +msgid "CCMP" +msgstr "ЦЦМП" + +#. 0 +#: ../cli/src/devices.c:135 ../cli/src/devices.c:146 +msgid "ADDRESS" +msgstr "АДРЕСА" + +#. 1 +#: ../cli/src/devices.c:136 ../cli/src/devices.c:147 +msgid "PREFIX" +msgstr "ПРЕФИКС" + +#. 2 +#: ../cli/src/devices.c:137 ../cli/src/devices.c:148 +msgid "GATEWAY" +msgstr "ПРОЛАЗ" + +#. 0 +#: ../cli/src/devices.c:157 ../cli/src/devices.c:166 +msgid "DNS" +msgstr "ДНС" + +#. 0 +#: ../cli/src/devices.c:175 +msgid "SSID" +msgstr "ССИД" + +#. 1 +#: ../cli/src/devices.c:176 +msgid "BSSID" +msgstr "БССИД" + +#. 2 +#: ../cli/src/devices.c:177 +msgid "MODE" +msgstr "МОД" + +#. 3 +#: ../cli/src/devices.c:178 +msgid "FREQ" +msgstr "ФРЕК" + +#. 4 +#: ../cli/src/devices.c:179 +msgid "RATE" +msgstr "ПРОТОК" + +#. 5 +#: ../cli/src/devices.c:180 +msgid "SIGNAL" +msgstr "СИГНАЛ" + +#. 6 +#: ../cli/src/devices.c:181 +msgid "SECURITY" +msgstr "СИГУРНОСТ" + +#. 7 +#: ../cli/src/devices.c:182 +msgid "WPA-FLAGS" +msgstr "ВПА-ЗАСТАВИЦЕ" + +#. 8 +#: ../cli/src/devices.c:183 +msgid "RSN-FLAGS" +msgstr "РСН-ЗАСТАВИЦЕ" + +#. 10 +#: ../cli/src/devices.c:185 +msgid "ACTIVE" +msgstr "АКТИВНО" + +#: ../cli/src/devices.c:208 #, c-format msgid "" -"VPN Login Failure\n" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" "\n" -"Could not start the VPN connection '%s' due to a login failure.\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" -"The VPN service said: \"%s\"" msgstr "" -"Пријава на VPN није успела\n" +"Употреба: nmcli уређај { НАРЕДБА | help }\n" +"\n" +" НАРЕДБА := { status | list | disconnect | wifi }\n" "\n" -"VPN веза са мрежом „%s“ није остварена јер пријава није успела.\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" -"Порука VPN сервиса је била : „%s“" -#: gnome/applet/applet.c:341 +#: ../cli/src/devices.c:228 +msgid "unmanaged" +msgstr "неподешено" + +#: ../cli/src/devices.c:230 +msgid "unavailable" +msgstr "недоступно" + +#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:91 +msgid "disconnected" +msgstr "није повезано" + +#: ../cli/src/devices.c:234 +msgid "connecting (prepare)" +msgstr "повезујем се (припрема)" + +#: ../cli/src/devices.c:236 +msgid "connecting (configuring)" +msgstr "повезујем се (подешавам)" + +#: ../cli/src/devices.c:238 +msgid "connecting (need authentication)" +msgstr "повезујем се (потребна пријава)" + +#: ../cli/src/devices.c:240 +msgid "connecting (getting IP configuration)" +msgstr "повезујем се (преузимам ИП подешавања)" + +#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:89 +msgid "connected" +msgstr "повезан" + +#: ../cli/src/devices.c:244 +msgid "connection failed" +msgstr "повезивање није успело" + +#: ../cli/src/devices.c:267 ../cli/src/devices.c:424 +msgid "Unknown" +msgstr "Непознато" + +#: ../cli/src/devices.c:299 +msgid "(none)" +msgstr "(ништа)" + +#: ../cli/src/devices.c:324 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: грешка при преводу ИП4 адресе 0x%X" + +#: ../cli/src/devices.c:393 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:394 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:403 +msgid "Encrypted: " +msgstr "Шифровано: " + +#: ../cli/src/devices.c:408 +msgid "WEP " +msgstr "ВЕП" + +#: ../cli/src/devices.c:410 +msgid "WPA " +msgstr "ВПА" + +#: ../cli/src/devices.c:412 +msgid "WPA2 " +msgstr "ЦПА2" + +#: ../cli/src/devices.c:415 +msgid "Enterprise " +msgstr "Предузимљиво" + +#: ../cli/src/devices.c:424 +msgid "Ad-Hoc" +msgstr "Ад-Хок" + +#: ../cli/src/devices.c:424 +msgid "Infrastructure" +msgstr "Инфраструктурно" + +#: ../cli/src/devices.c:486 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "Грешка: „dev list“: %s" + +#: ../cli/src/devices.c:488 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Грешка: „dev list“: %s; дозвољена поља: %s" + +#: ../cli/src/devices.c:497 +msgid "Device details" +msgstr "Подаци о драјверу" + +#: ../cli/src/devices.c:527 ../cli/src/devices.c:925 +msgid "(unknown)" +msgstr "(непознато)" + +#: ../cli/src/devices.c:528 +msgid "unknown)" +msgstr "непознато)" + +#: ../cli/src/devices.c:554 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:627 +msgid "on" +msgstr "укљ" + +#: ../cli/src/devices.c:627 +msgid "off" +msgstr "искљ" + +#: ../cli/src/devices.c:808 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "Грешка: „dev status“: %s" + +#: ../cli/src/devices.c:810 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Грешка „dev status“: %s; дозвољена поља: %s" + +#: ../cli/src/devices.c:817 +msgid "Status of devices" +msgstr "Стање уређаја" + +#: ../cli/src/devices.c:845 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Грешка: недостаје аргумент „%s“." + +#: ../cli/src/devices.c:874 ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Грешка: Није нађен уређај „%s“." + +#: ../cli/src/devices.c:897 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Веза на уређају „%s“ је успешно прекинута." + +#: ../cli/src/devices.c:922 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Грешка: Не могу да прекинем везу на уређају „%s“ (%s): %s" + +#: ../cli/src/devices.c:930 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Стање уређаја: %d (%s)\n" + +#: ../cli/src/devices.c:994 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Грешка: морате да задате iface." + +#: ../cli/src/devices.c:1112 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "Грешка: „dev wifi“: %s" + +#: ../cli/src/devices.c:1114 #, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Грешка: „dev wifi“: %s; дозвољена поља: %s" + +#: ../cli/src/devices.c:1121 +msgid "WiFi scan list" +msgstr "Списак претраге бежичних мрежа" + +#: ../cli/src/devices.c:1156 ../cli/src/devices.c:1210 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Грешка: Није нађена приступна тачка са хардверском адресом „%s“." + +#: ../cli/src/devices.c:1173 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Грешка: „%s“ није бежични мрежни уређај." + +#: ../cli/src/devices.c:1237 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Грешка: „dev wifi“ наредба „%s“ није исправна." + +#: ../cli/src/devices.c:1284 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Грешка: „dev“ наредба „%s“ није исправна." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "ПОКРЕНУТО" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "NET-ENABLED" +msgstr "МРЕЖА-ОМОГУЋЕНА" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI-HARDWARE" +msgstr "WIFI-УРЕЂАЈ" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WIFI" +msgstr "WIFI" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN-HARDWARE" +msgstr "WWAN-УРЕЂАЈ" + +#. 5 +#: ../cli/src/network-manager.c:41 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:64 +#, c-format +#| msgid "" +#| "Usage: nmcli nm { COMMAND | help }\n" +#| "\n" +#| " COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +#| "\n" +#| " status\n" +#| " sleep\n" +#| " wakeup\n" +#| " wifi [on|off]\n" +#| " wwan [on|off]\n" +#| "\n" msgid "" -"VPN Login Message\n" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | enable | sleep | wifi | wwan }\n" "\n" -"VPN connection '%s' said:\n" +" status\n" +" enable [true|false]\n" +" sleep [true|false]\n" +" wifi [on|off]\n" +" wwan [on|off]\n" "\n" -"\"%s\"" msgstr "" -"Порука при пријави на VPN\n" +"Употреба: nmcli nm { НАРЕДБА | help }\n" +"\n" +" НАРЕДБА := { status | enable| sleep | wifi | wwan }\n" "\n" -"Порука VPN везе „%s“ је:\n" +" status\n" +" enable [true|false]\n" +" sleep [true|false]\n" +" wifi [on|off]\n" +" wwan [on|off]\n" "\n" -"„%s“" -#: gnome/applet/applet.c:559 gnome/applet/applet.c:1922 -#: gnome/applet/other-network-dialog.c:315 -#: gnome/applet/passphrase-dialog.c:430 +#: ../cli/src/network-manager.c:85 +msgid "asleep" +msgstr "успаван" + +#: ../cli/src/network-manager.c:87 +msgid "connecting" +msgstr "повезује се" + +#: ../cli/src/network-manager.c:128 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Грешка: „nm status“: %s" + +#: ../cli/src/network-manager.c:130 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Грешка: „nm status“: %s; дозвољена поља: %s" + +#: ../cli/src/network-manager.c:137 +msgid "NetworkManager status" +msgstr "Стање Управника мреже" + +#. Print header +#: ../cli/src/network-manager.c:144 ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 ../cli/src/network-manager.c:328 +msgid "enabled" +msgstr "омогућен" + +#: ../cli/src/network-manager.c:144 ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 ../cli/src/network-manager.c:328 +msgid "disabled" +msgstr "онемогућен" + +#: ../cli/src/network-manager.c:152 +msgid "running" +msgstr "покренут" + +#: ../cli/src/network-manager.c:152 +msgid "not running" +msgstr "није покренут" + +#: ../cli/src/network-manager.c:175 +#, c-format +#| msgid "Error: could not connect to D-Bus." +msgid "Error: Couldn't connect to system bus: %s" +msgstr "Грешка: не могу да се повежем на системску магистралу: %s" + +#: ../cli/src/network-manager.c:186 +#, c-format +#| msgid "Error: could not connect to D-Bus." +msgid "Error: Couldn't create D-Bus object proxy." +msgstr "Грешка: не могу да образујем ДБас посредника." + +#: ../cli/src/network-manager.c:192 +#, c-format +#| msgid "Error: 'con list': %s" +msgid "Error in sleep: %s" +msgstr "Грешка при успављивању: %s" + +#: ../cli/src/network-manager.c:237 ../cli/src/network-manager.c:286 +#: ../cli/src/network-manager.c:318 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Грешка: „--fields“ вредност „%s“ није дозвољена овде; дозвољене су: %s" + +#: ../cli/src/network-manager.c:245 +#| msgid "WiFi enabled" +msgid "Networking enabled" +msgstr "Умрежавање је омогућено" + +#: ../cli/src/network-manager.c:256 +#, c-format +#| msgid "Error: invalid 'wwan' parameter: '%s'." +msgid "Error: invalid 'enable' parameter: '%s'; use 'true' or 'false'." +msgstr "" +"Грешка: неисправан „enable“ параметар: „%s“; дозвољени су „true“ и „false“." + +#: ../cli/src/network-manager.c:265 +#, c-format +#| msgid "Error: Could not connect to NetworkManager." +msgid "Error: Sleeping status is not exported by NetworkManager." +msgstr "Грешка: Управника мреже није извезао стање успављивања." + +#: ../cli/src/network-manager.c:273 +#, c-format +#| msgid "Error: invalid 'wifi' parameter: '%s'." +msgid "Error: invalid 'sleep' parameter: '%s'; use 'true' or 'false'." +msgstr "" +"Грешка: неисправан „sleep“ параметар: „%s“; дозвољени су „true“ и „false“." + +#: ../cli/src/network-manager.c:294 +msgid "WiFi enabled" +msgstr "WiFi омогућен" + +#: ../cli/src/network-manager.c:305 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Грешка: неисправан „wifi“ параметар: „%s“." + +#: ../cli/src/network-manager.c:326 +msgid "WWAN enabled" +msgstr "WWAN омогућен" + +#: ../cli/src/network-manager.c:337 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Грешка: неисправан „wwan“ параметар: „%s“." + +#: ../cli/src/network-manager.c:348 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Грешка: „nm“ наредба „'%s“ није исправна." + +#: ../cli/src/nmcli.c:69 +#, c-format msgid "" -"The NetworkManager Applet could not find some required resources (the glade " -"file was not found)." -msgstr "Аплет Управник мреже није могао да пронађе неке од потребних ресурса (глејд датотека није пронађена)." +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Употреба: %s [ОПЦИЈЕ] ОБЈЕКАТ { НАРЕДБА | help }\n" +"\n" +"ОПЦИЈЕ\n" +" -t[erse] сажет испис\n" +" -p[retty] уређен испис\n" +" -m[ode] tabular|multiline режим исписа\n" +" -f[ields] |all|common одређује поља за испис\n" +" -e[scape] yes|no не додаје раздвојнике колона у " +"вредностима\n" +" -v[ersion] исписује издање програма\n" +" -h[elp] исписује ову помоћ\n" +"\n" +"ОБЈЕКАТ\n" +" nm стање Управника везама\n" +" con везе Управника везама\n" +" dev уређаји Управника мрежама\n" +"\n" -#: gnome/applet/applet.c:572 +#: ../cli/src/nmcli.c:113 #, c-format -msgid "The network device \"%s (%s)\" does not support wireless scanning." -msgstr "Мрежни уређај „%s (%s)“ не подржава потрагу за бежичним мрежама." +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Грешка: „%s“ је непознати објекат, погледајте „nmcli help“." -#: gnome/applet/applet.c:579 +#: ../cli/src/nmcli.c:143 #, c-format -msgid "The network device \"%s (%s)\" does not support link detection." -msgstr "Мрежни уређај „%s (%s)“ не подржава откривање везе." +msgid "Error: Option '--terse' is specified the second time." +msgstr "Грешка: Опција „--terse“ је задата по други пут." -#: gnome/applet/applet.c:700 +#: ../cli/src/nmcli.c:148 #, c-format -msgid "Preparing device %s for the wired network..." -msgstr "Припрема уређаја %s за жичану мрежу..." +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Грешка: Опције „--terse“ и „--pretty“ се међусобно искључују." -#: gnome/applet/applet.c:702 +#: ../cli/src/nmcli.c:156 #, c-format -msgid "Preparing device %s for the wireless network '%s'..." -msgstr "Припрема уређаја %s за бежичну мрежу „%s“..." +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Грешка: Опција „--pretty“ је задата по други пут." -#: gnome/applet/applet.c:709 +#: ../cli/src/nmcli.c:161 #, c-format -msgid "Configuring device %s for the wired network..." -msgstr "Подешавање уређаја %s за бежичну мрежу..." +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Грешка: Опције „--pretty“ и „--terse“ се међусобно искључују." -#: gnome/applet/applet.c:711 +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 #, c-format -msgid "Attempting to join the wireless network '%s'..." -msgstr "Покушај приступа бежичној мрежи „%s“..." +msgid "Error: missing argument for '%s' option." +msgstr "Грешка: недостаје аргумент уз опцију „%s“." -#: gnome/applet/applet.c:718 +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 #, c-format -msgid "Waiting for Network Key for the wireless network '%s'..." -msgstr "Чекање на мрежни кључ за бежичну мрежу „%s“..." +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Грешка: „%s“ није исправан аргумент уз опцију „%s“." -#: gnome/applet/applet.c:725 gnome/applet/applet.c:734 -msgid "Requesting a network address from the wired network..." -msgstr "Потраживање мрежне адресе за жичану мрежу..." +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Грешка: недостају поља за „%s“ опцију." -#: gnome/applet/applet.c:727 gnome/applet/applet.c:736 +#: ../cli/src/nmcli.c:209 #, c-format -msgid "Requesting a network address from the wireless network '%s'..." -msgstr "Потраживање мрежне адресе за бежичну мрежу „%s“..." +msgid "nmcli tool, version %s\n" +msgstr "nmcli алат, издање %s\n" -#: gnome/applet/applet.c:743 -msgid "Finishing connection to the wired network..." -msgstr "Обустављање везе са жичаном мрежом..." +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Грешка: Опција „%s“ је непозната, пробајте „nmcli -help“." -#: gnome/applet/applet.c:745 +#: ../cli/src/nmcli.c:234 #, c-format -msgid "Finishing connection to the wireless network '%s'..." -msgstr "Обустављање везе са бежичном мрежом „%s“..." +msgid "Caught signal %d, shutting down..." +msgstr "Добио сам сигнал %d, искључујем..." -#: gnome/applet/applet.c:791 -msgid "NetworkManager is not running" -msgstr "Управљач мреже није покренут" +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Грешка: Не могу да се повежем на Управника мреже." -#: gnome/applet/applet.c:802 -msgid "No network connection" -msgstr "Нема мрежних веза" +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "Успешно" -#: gnome/applet/applet.c:809 -msgid "Wired network connection" -msgstr "Жична мрежна веза" +#: ../cli/src/settings.c:411 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (хексадекадни-аски-кључ)" -# FIXME Ад-хок -#: gnome/applet/applet.c:816 -msgid "Connected to an Ad-Hoc wireless network" -msgstr "Повезан са ад-хок бежичном мрежом" +#: ../cli/src/settings.c:413 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-битна лозинка)" -#: gnome/applet/applet.c:830 +#: ../cli/src/settings.c:416 #, c-format -msgid "Wireless network connection to '%s' (%d%%)" -msgstr "Бежична мрежна веза са „%s“ (%d%%)" +msgid "%d (unknown)" +msgstr "%d (непознато)" -#: gnome/applet/applet.c:1181 -msgid "Other Wireless Networks..." -msgstr "Остале бежичне мреже..." +#: ../cli/src/settings.c:442 +msgid "0 (unknown)" +msgstr "0 (напознато)" -#: gnome/applet/applet.c:1202 -msgid "Create new Wireless Network..." -msgstr "Направи нову бежичну мрежу..." +#: ../cli/src/settings.c:448 +msgid "any, " +msgstr "вило које, " -#: gnome/applet/applet.c:1315 -msgid "VPN Connections" -msgstr "VPN везе" +#: ../cli/src/settings.c:450 +msgid "900 MHz, " +msgstr "900 MHz, " -#: gnome/applet/applet.c:1337 -msgid "Disconnect VPN..." -msgstr "Искључи VPN..." +#: ../cli/src/settings.c:452 +msgid "1800 MHz, " +msgstr "1800 MHz, " -#: gnome/applet/applet.c:1366 -msgid "No network devices have been found" -msgstr "Није пронађен ниједан мрежни уређај" +#: ../cli/src/settings.c:454 +msgid "1900 MHz, " +msgstr "1900 MHz, " -#: gnome/applet/applet.c:1529 -msgid "NetworkManager is not running..." -msgstr "Управљач мрежом није покренут..." +#: ../cli/src/settings.c:456 +msgid "850 MHz, " +msgstr "850 MHz, " -#: gnome/applet/applet.c:1599 gnome/applet/applet.c:1647 -msgid "Pause Wireless Scanning" -msgstr "Обустави тражење бежичне мреже" +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " -#: gnome/applet/applet.c:1604 -msgid "Resume Wireless Scanning" -msgstr "Настави тражење бежичне мреже" +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " -#: gnome/applet/applet.c:1614 gnome/applet/applet.c:1653 -msgid "Stop All Wireless Devices" -msgstr "Заустави све бежичне уређаје" +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " -#: gnome/applet/applet.c:1619 -msgid "Start All Wireless Devices" -msgstr "Покрени све бежичне уређаје" +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " -#: gnome/applet/applet.c:1662 -msgid "Help" -msgstr "Помоћ" +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " -#: gnome/applet/applet.c:1669 -msgid "About" -msgstr "О програму" +#: ../cli/src/settings.c:468 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " -#: gnome/applet/applet.c:2070 -msgid "" -"The NetworkManager applet could not find some required resources. It cannot " -"continue.\n" -msgstr "Управљач мрежом није успео да пронађе неопходне ресурсе и не може да настави рад.\n" +#: ../cli/src/settings.c:470 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:554 ../cli/src/settings.c:721 +msgid "auto" +msgstr "аутоматски" + +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 +msgid "not set" +msgstr "није изабрано" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "поље „%s“ мора да буде празно" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "неисправно поље „%s“" -#: gnome/applet/gtkcellrendererprogress.c:243 -#: gnome/applet/gtkcellrendererprogress.c:301 +#: ../cli/src/utils.c:146 #, c-format -msgid "progress bar label|%d %%" -msgstr "%d %%" +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Опција „--terse“ захтева опцију „--fields“" -#: gnome/applet/menu-items.c:91 +#: ../cli/src/utils.c:150 #, c-format -msgid "Wired Network (%s)" -msgstr "Жичана мрежа (%s)" +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "Опција „--terse“ захтева опцију „--fields“, а не „%s“" -#: gnome/applet/menu-items.c:93 -msgid "Wired Network" -msgstr "Жичана мрежа" +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "ПЕМ датотека са кључем нема завршну ознаку „%s“." -#: gnome/applet/menu-items.c:166 +#: ../libnm-util/crypto.c:130 #, c-format -msgid "Wireless Network (%s)" -msgid_plural "Wireless Networks (%s)" -msgstr[0] "Бежична мрежа (%s)" -msgstr[1] "Бежичне мреже (%s)" -msgstr[2] "Бежичних мрежа (%s)" +msgid "Doesn't look like a PEM private key file." +msgstr "Не изгледа као приватна ПЕМ датотека са кључем." -#: gnome/applet/menu-items.c:168 -msgid "Wireless Network" -msgid_plural "Wireless Networks" -msgstr[0] "Бежична мрежа" -msgstr[1] "Бежичне мреже" -msgstr[2] "Бежичне мреже" +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Нема довољно меморије за чување ПЕМ података." -#: gnome/applet/menu-items.c:294 -msgid " (invalid Unicode)" -msgstr " (неисправан Уникод)" +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Лоша ПЕМ датотека: Proc-Type није прва ознака." -#: gnome/applet/other-network-dialog.c:148 -#: gnome/applet/passphrase-dialog.c:164 -#: gnome/applet/applet.glade.h:27 -msgid "Passphrase:" -msgstr "Лозинка:" +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Лоша ПЕМ датотека: непозната Proc-Type ознака „%s“." -#: gnome/applet/other-network-dialog.c:151 -#: gnome/applet/passphrase-dialog.c:167 -msgid "Ascii Key:" -msgstr "АСКРИ кључ:" +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Лоша ПЕМ датотека: DEK-Info није друга ознака." -#: gnome/applet/other-network-dialog.c:154 -#: gnome/applet/passphrase-dialog.c:170 -msgid "Hex Key:" -msgstr "Хекса кључ:" +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Лоша ПЕМ датотека: није дат ИВ унутар DEK-Info ознаке." -#: gnome/applet/other-network-dialog.c:229 -msgid "Create new wireless network" -msgstr "Направи нову бежичну мрежу" +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "Лоша ПЕМ датотека: неисправан формат за ИВ унутар DEK-Info ознаке." -#: gnome/applet/other-network-dialog.c:230 -msgid "" -"Enter the ESSID and security settings of the wireless network you wish to " -"create." -msgstr "Унесите ESSID и безбедносне поставке бежичне мреже коју желите да начините." +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Лоша ПЕМ датотека: непозната шифра приватног кључа „%s“." -#: gnome/applet/other-network-dialog.c:235 -msgid "Custom wireless network" -msgstr "Корисничка бежична мрежа" +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "Не могу да дешифрујем приватни кључ." -#: gnome/applet/other-network-dialog.c:236 -msgid "Enter the ESSID of the wireless network to which you wish to connect." -msgstr "Унесите ESSID бежичне мреже са којом желите да се повежете." +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "ПЕМ сертификат „%s“ нема завршну ознаку „%s“." -#: gnome/applet/vpn-password-dialog.c:105 +#: ../libnm-util/crypto.c:277 #, c-format -msgid "You must log in to access the Virtual Private Network '%s'." -msgstr "Морате бити пријављени како бисте користили виртуелну приватну мрежу „%s“." +msgid "Failed to decode certificate." +msgstr "Не могу да дешифрујем сертификат." -#: gnome/applet/applet.glade.h:1 -msgid " " -msgstr " " +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Нема довољно меморије за чување података о сертификату." -#: gnome/applet/applet.glade.h:2 -msgid "*" -msgstr "*" +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "Нема довољно меморије за чување података о датотеци." -#: gnome/applet/applet.glade.h:3 -msgid "" -"128-bit Passphrase (WEP)\n" -"Ascii Key (WEP)\n" -"Hex Key (WEP)" +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV мора да садржи паран број битова." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Нема довољно меморије за чување IV." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV садржи цифре које нису хексадецималне." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Лозинка приватног кључа „%s“ није позната." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "Нема довољно меморије за дешифровање приватног кључа." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "Не могу да одредим врсту приватног кључа." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Нема довољно меморије за чување дешифрованог приватног кључа." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "Не могу да покренем програм за шифровање." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Не могу да покренем програм за MD5 суму: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Неисправна IV дужина (мора да буде бар %zd)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Нема довољно меморије у остави за дешифровани кључ." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Не могу да покренем дешифровање лозинке: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "Не могу да поставим симетрични кључ за дешифровање: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Не могу да поставим ИВ за дешифровање: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Не могу да дешифрујем приватни кључ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "Не могу да дешифрујем приватни кључ: неочекивана дужина." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "Не могу да дешифрујем приватни кључ." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Не могу да резервишем меморију за дешифровање." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Не могу да покренем шифровање лозинке: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Не могу да поставим симетрични кључ за шифровање: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Не могу да поставим IV за шифровање: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Не могу да шифрујем податке: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Грешка приликом отварања података о сертификату: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Де могу да дешифрујем сертификат: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "Не могу да започнем PKCS#12 дешифровање: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Не могу да дешифрујем PKCS#12 датотеку: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "Не могу да проверим PKCS#12 датотеку: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Не могу да покренем програм за шифровање: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Не могу да покренем MD5 садржај: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Неисправна IV дужина (мора да буде бар %d)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Не могу да покренем слот за дешифровање лозинке." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Не могу да поставим симетрични кључ за шифровање." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Не могу да поставим IV за дешифровање." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Не могу да покренем садржај за дешифровање." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Не могу да дешифрујем приватни кључ: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "Не могу да дешифрујем приватни кључ: дешифровани подаци су предугачки." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Не могу да завршим дешифровање приватног кључа: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "Не могу да покренем слот за шифровање лозинке." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "Не могу да поставим симетрични кључ за шифровање." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Не могу да поставим ИВ за шифровање." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "Не могу да покренем садржај за шифровање." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Не могу да шифрујем: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Неочекиван обим података након шифровања." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Не могу да дешифрујем сертификат: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Не могу да претворим лозинку у UCS2: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Не могу да покренем програм за PKCS#12 :дешифровање %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Не могу да дешифрујем PKCS#12 датотеку: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Не могу да проверим PKCS#12 датотеку: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "Не могу да образујем насумичне податке." + +#: ../libnm-util/nm-utils.c:1975 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Нема довољно меморије за шифровање кључа." + +#: ../libnm-util/nm-utils.c:2085 +msgid "Could not allocate memory for PEM file creation." +msgstr "Не могу да резервишем меморију за образовање ПЕМ датотеке." + +#: ../libnm-util/nm-utils.c:2097 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Не могу да резервишем меморију за упис IV у ПЕМ датотеку." + +#: ../libnm-util/nm-utils.c:2109 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "" -"128-битни кључ (WEP)\n" -"АСКРИ кључ (WEP)\n" -"Хекс кључ (WEP)" +"Не могу да резервишем меморију за упис шифрованог кључа у ПЕМ датотеку." -#: gnome/applet/applet.glade.h:6 -msgid "" -"128-bit passphrase (WEP)\n" -"Ascii key (WEP)\n" -"Hex key (WEP)" +#: ../libnm-util/nm-utils.c:2128 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Не могу да резервишем меморију за ПЕМ датотеку." + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Веза се дели преко заштићене бежичне мреже" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Веза се дели преко отворене бежичне мреже" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Трајно измени име хоста" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Измени везе" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Овлашћења система не дозвољавају измену системских подешавања" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "Овлашћења система не дозвољавају измену хоста" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" msgstr "" -"128-битни кључ (WEP)\n" -"АСКРИ кључ (WEP)\n" -"Хекс кључ (WEP)" +"Овлашћења система не дозвољавају дељење везе преко заштићене бежичне мреже" -#: gnome/applet/applet.glade.h:10 -#, no-c-format -msgid "" -"Passphrase Required by Wireless " -"Network\n" -"\n" -"A passphrase or encryption key is required to access the wireless network '%" -"s'." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" msgstr "" -"Бежична мрежа захтева лозинку\n" -"\n" -" Лозинка или кључ за шифровање су неопходни за приступ бежичној мрежи „%s“." +"Овлашћења система не дозвољавају дељење везе преко отворене бежичне мреже" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "Дозволи контролу мрежних веза" -#: gnome/applet/applet.glade.h:14 -#, no-c-format +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "Дозволи везе које одређује корисник" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "Омогући или онемогући бежичне уређаје" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "Омогући или онемогући мобилне широкопојасне уређаје" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "Омогући или онемогући умрежавање на систему" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 msgid "" -"Reduced Network Functionality\n" -"\n" -"%s It will not be completely functional." +"Put NetworkManager to sleep or wake it up (should only be used by system " +"power management)" msgstr "" -"Смањена употребна вредност мреже\n" -"\n" -"%s неће бити сасвим употребљива." +"Омогућава успављивање Управника мреже (користи се са Управником потрошње на " +"систему)" -#: gnome/applet/applet.glade.h:18 -#, no-c-format -msgid "" -"Wireless Network Login Confirmation\n" -"\n" -"You have chosen log in to the wireless network '%s'. If you are sure this " -"wireless network is secure, click the checkbox below and NetworkManager will " -"no longer pester you with stupid questions when you connect to it." +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +msgid "System policy prevents control of network connections" +msgstr "Овлашћења система онемогућавају контролу мрежних веза" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "Овлашћења система онемогућавају управљање бежичним уређајима" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" msgstr "" -"Потврда пријаве на мрежу\n" -"\n" -"Желите да се пријавите на мрежу „%s“. Ако сте сигурни да је ова бежична мрежа безбедна, обележите кућицу испод и Управник мреже вам више неће постављати сувишна питања при пријави на ову мрежу." +"Овлашћења система онемогућавају управљање мобилним широкопојасним уређајима" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +msgid "System policy prevents enabling or disabling system networking" +msgstr "Овлашћења система онемогућавају управљање мрежом на систему" -#: gnome/applet/applet.glade.h:21 -msgid "Always Trust this Wireless Network" -msgstr "Увек поклони поверење бежичној мрежи" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "Овлашћења система онемогућавају успављивање Управника мрежом" -#: gnome/applet/applet.glade.h:22 -msgid "C_onnect" -msgstr "П_овежи се" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +msgid "System policy prevents use of user-specific connections" +msgstr "Овлашћења система онемогућавају употребу корисникових веза" -#: gnome/applet/applet.glade.h:23 -msgid "Connect with encryption enabled" -msgstr "Повежи се и укључи шифровање" +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "грешка у обради нетлинк поруке: %s" -#: gnome/applet/applet.glade.h:24 -msgid "Don't remind me again" -msgstr "Не подсећај ме више" +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "грешка приликом чекања података на утичници" -#: gnome/applet/applet.glade.h:25 -msgid "Key Type:" -msgstr "Врста кључа:" +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "не могу да се повежем на нетлинк ради праћења стања везе: %s" -#: gnome/applet/applet.glade.h:26 -msgid "Key type:" -msgstr "Врста кључа:" +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "не могу да укључим нетлинк сигурносни пролаз: %s" -#: gnome/applet/applet.glade.h:28 -msgid "Wireless Network Key Required" -msgstr "Потребан је кључ за бежичну мрежу" +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "не могу да резервишем нетлинк за праћење стања везе: %s" -#: gnome/applet/applet.glade.h:29 -msgid "Wireless _adapter:" -msgstr "Бежични _уређај:" +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "не могу да резервишем нетлинк оставу ради праћења стања везе: %s" -#: gnome/applet/applet.glade.h:30 -msgid "Wireless _network:" -msgstr "Бежична _мрежа:" +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "не могу да се прикључин нетлинк групи: %s" -#: gnome/applet/applet.glade.h:31 -msgid "_Login to Network" -msgstr "_Умрежи се" +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "грешка при освежавању оставе са везама: %s" -#: gnome/applet/applet.glade.h:32 -msgid "_OK" -msgstr "_У реду" +#: ../src/main.c:499 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "Неисправна опција. Унесите „--help“ за списак свих опција.\n" -#: src/nm-netlink-monitor.c:154 +#: ../src/main.c:570 #, c-format -msgid "" -"unable to create netlink socket for monitoring wired ethernet devices - %s" -msgstr "Није могуће направити утичницу за посматрање жичаног мрежног уређаја - %s" +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. Покрените са --help за списак доступних опција.\n" -#: src/nm-netlink-monitor.c:172 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:328 +msgid "# Created by NetworkManager\n" +msgstr "# Направио NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:344 #, c-format msgid "" -"unable to bind to netlink socket for monitoring wired ethernet devices - %s" -msgstr "Није могуће повезати се на утичницу за посматрање жичаног мрежног уређаја - %s" +"# Merged from %s\n" +"\n" +msgstr "" +"# Спојено са %s\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 +msgid "no usable DHCP client could be found." +msgstr "не могу да нађем ДХЦП програм." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 +msgid "'dhclient' could be found." +msgstr "Не могу да нађем „dhclient“." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 +msgid "'dhcpcd' could be found." +msgstr "Не могу да нађем „dhcpcd“." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "неподржан ДХЦП клијент „%s“" -#: src/nm-netlink-monitor.c:404 -msgid "operation took too long" -msgstr "Потрага је предуго трајала" +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "„%s“ није подржан ниво записа дневника" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "„%s“ је непознат домен дневника" -#: src/nm-netlink-monitor.c:501 -msgid "received data from wrong type of sender" -msgstr "Примљени су подаци погрешног типа од пошиљаоца" +#: ../src/dns-manager/nm-dns-manager.c:384 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "ПРИМЕДБА: либц разрешавање не подржава више од 3 сервера имена." -#: src/nm-netlink-monitor.c:514 -msgid "received data from unexpected sender" -msgstr "Примљени су подаци од неочекиваног пошиљаоца" +#: ../src/dns-manager/nm-dns-manager.c:386 +msgid "The nameservers listed below may not be recognized." +msgstr "Следећи сервери имена можда нису препознати." -#: src/nm-netlink-monitor.c:536 +#: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format -msgid "%s" -msgstr "%s" +msgid "Auto %s" +msgstr "Ауто %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3412 +#: ../system-settings/plugins/ifnet/connection_parser.c:49 +msgid "System" +msgstr "Систем" + +#~ msgid "Orientation" +#~ msgstr "Усмерење" + +# Потребан је бољи превод за ово +#~ msgid "The orientation of the tray." +#~ msgstr "Усмерење обавештајне зоне." + +#~ msgid "" +#~ "The requested wireless network '%s' does not appear to be in range. A " +#~ "different wireless network will be used if any are available." +#~ msgstr "" +#~ "Тражена бежична мрежа „%s“ није у домету. Биће коришћена друга бежична " +#~ "мрежа ако је расположива." + +#~ msgid "Connection to the wireless network '%s' failed.\n" +#~ msgstr "Неуспела веза са бежичном мрежом „%s“.\n" + +#~ msgid "Copyright (C) 2004-2005 Red Hat, Inc." +#~ msgstr "Copyright (C) 2004-2005 Red Hat, Inc." + +#~ msgid "" +#~ "Notification area applet for managing your network devices and " +#~ "connections." +#~ msgstr "Аплет за обавештајну зону за управљање мрежним уређајима и везама." + +#~ msgid "" +#~ "VPN Login Failure\n" +#~ "\n" +#~ "Could not start the VPN connection '%s' due to a login failure.\n" +#~ "\n" +#~ "The VPN service said: \"%s\"" +#~ msgstr "" +#~ "Пријава на VPN није успела\n" +#~ "\n" +#~ "VPN веза са мрежом „%s“ није остварена јер пријава није успела.\n" +#~ "\n" +#~ "Порука VPN сервиса је била : „%s“" + +#~ msgid "" +#~ "VPN Login Message\n" +#~ "\n" +#~ "VPN connection '%s' said:\n" +#~ "\n" +#~ "\"%s\"" +#~ msgstr "" +#~ "Порука при пријави на VPN\n" +#~ "\n" +#~ "Порука VPN везе „%s“ је:\n" +#~ "\n" +#~ "„%s“" + +#~ msgid "" +#~ "The NetworkManager Applet could not find some required resources (the " +#~ "glade file was not found)." +#~ msgstr "" +#~ "Аплет Управник мреже није могао да пронађе неке од потребних ресурса " +#~ "(глејд датотека није пронађена)." + +#~ msgid "The network device \"%s (%s)\" does not support wireless scanning." +#~ msgstr "Мрежни уређај „%s (%s)“ не подржава потрагу за бежичним мрежама." + +#~ msgid "The network device \"%s (%s)\" does not support link detection." +#~ msgstr "Мрежни уређај „%s (%s)“ не подржава откривање везе." + +#~ msgid "Preparing device %s for the wired network..." +#~ msgstr "Припрема уређаја %s за жичану мрежу..." + +#~ msgid "Preparing device %s for the wireless network '%s'..." +#~ msgstr "Припрема уређаја %s за бежичну мрежу „%s“..." + +#~ msgid "Configuring device %s for the wired network..." +#~ msgstr "Подешавање уређаја %s за бежичну мрежу..." + +#~ msgid "Attempting to join the wireless network '%s'..." +#~ msgstr "Покушај приступа бежичној мрежи „%s“..." + +#~ msgid "Waiting for Network Key for the wireless network '%s'..." +#~ msgstr "Чекање на мрежни кључ за бежичну мрежу „%s“..." + +#~ msgid "Requesting a network address from the wired network..." +#~ msgstr "Потраживање мрежне адресе за жичану мрежу..." + +#~ msgid "Requesting a network address from the wireless network '%s'..." +#~ msgstr "Потраживање мрежне адресе за бежичну мрежу „%s“..." + +#~ msgid "Finishing connection to the wired network..." +#~ msgstr "Обустављање везе са жичаном мрежом..." + +#~ msgid "Finishing connection to the wireless network '%s'..." +#~ msgstr "Обустављање везе са бежичном мрежом „%s“..." + +#~ msgid "NetworkManager is not running" +#~ msgstr "Управљач мреже није покренут" + +#~ msgid "Wired network connection" +#~ msgstr "Жична мрежна веза" + +# FIXME Ад-хок +#~ msgid "Connected to an Ad-Hoc wireless network" +#~ msgstr "Повезан са ад-хок бежичном мрежом" + +#~ msgid "Wireless network connection to '%s' (%d%%)" +#~ msgstr "Бежична мрежна веза са „%s“ (%d%%)" + +#~ msgid "Other Wireless Networks..." +#~ msgstr "Остале бежичне мреже..." + +#~ msgid "Create new Wireless Network..." +#~ msgstr "Направи нову бежичну мрежу..." + +#~ msgid "No network devices have been found" +#~ msgstr "Није пронађен ниједан мрежни уређај" + +#~ msgid "NetworkManager is not running..." +#~ msgstr "Управљач мрежом није покренут..." + +#~ msgid "Pause Wireless Scanning" +#~ msgstr "Обустави тражење бежичне мреже" + +#~ msgid "Resume Wireless Scanning" +#~ msgstr "Настави тражење бежичне мреже" + +#~ msgid "Stop All Wireless Devices" +#~ msgstr "Заустави све бежичне уређаје" -#: src/nm-netlink-monitor.c:645 -msgid "too much data was sent over socket and some of it was lost" -msgstr "Сувише података је послато кроз утичницу и нешто од њих је изгубљено" +#~ msgid "Start All Wireless Devices" +#~ msgstr "Покрени све бежичне уређаје" + +#~ msgid "Help" +#~ msgstr "Помоћ" + +#~ msgid "About" +#~ msgstr "О програму" + +#~ msgid "" +#~ "The NetworkManager applet could not find some required resources. It " +#~ "cannot continue.\n" +#~ msgstr "" +#~ "Управљач мрежом није успео да пронађе неопходне ресурсе и не може да " +#~ "настави рад.\n" + +#~ msgid "progress bar label|%d %%" +#~ msgstr "%d %%" + +#~ msgid "Wired Network (%s)" +#~ msgstr "Жичана мрежа (%s)" + +#~ msgid "Wired Network" +#~ msgstr "Жичана мрежа" + +#~ msgid "Wireless Network (%s)" +#~ msgid_plural "Wireless Networks (%s)" +#~ msgstr[0] "Бежична мрежа (%s)" +#~ msgstr[1] "Бежичне мреже (%s)" +#~ msgstr[2] "Бежичних мрежа (%s)" + +#~ msgid "Wireless Network" +#~ msgid_plural "Wireless Networks" +#~ msgstr[0] "Бежична мрежа" +#~ msgstr[1] "Бежичне мреже" +#~ msgstr[2] "Бежичне мреже" + +#~ msgid " (invalid Unicode)" +#~ msgstr " (неисправан Уникод)" + +#~ msgid "Passphrase:" +#~ msgstr "Лозинка:" + +#~ msgid "Ascii Key:" +#~ msgstr "АСКРИ кључ:" + +#~ msgid "Hex Key:" +#~ msgstr "Хекса кључ:" + +#~ msgid "Create new wireless network" +#~ msgstr "Направи нову бежичну мрежу" + +#~ msgid "" +#~ "Enter the ESSID and security settings of the wireless network you wish to " +#~ "create." +#~ msgstr "" +#~ "Унесите ESSID и безбедносне поставке бежичне мреже коју желите да " +#~ "начините." + +#~ msgid "Custom wireless network" +#~ msgstr "Корисничка бежична мрежа" + +#~ msgid "" +#~ "Enter the ESSID of the wireless network to which you wish to connect." +#~ msgstr "Унесите ESSID бежичне мреже са којом желите да се повежете." + +#~ msgid "You must log in to access the Virtual Private Network '%s'." +#~ msgstr "" +#~ "Морате бити пријављени како бисте користили виртуелну приватну мрежу „%s“." + +#~ msgid " " +#~ msgstr " " + +#~ msgid "*" +#~ msgstr "*" + +#~ msgid "" +#~ "128-bit Passphrase (WEP)\n" +#~ "Ascii Key (WEP)\n" +#~ "Hex Key (WEP)" +#~ msgstr "" +#~ "128-битни кључ (WEP)\n" +#~ "АСКРИ кључ (WEP)\n" +#~ "Хекс кључ (WEP)" + +#~ msgid "" +#~ "128-bit passphrase (WEP)\n" +#~ "Ascii key (WEP)\n" +#~ "Hex key (WEP)" +#~ msgstr "" +#~ "128-битни кључ (WEP)\n" +#~ "АСКРИ кључ (WEP)\n" +#~ "Хекс кључ (WEP)" + +#~ msgid "" +#~ "Passphrase Required by Wireless " +#~ "Network\n" +#~ "\n" +#~ "A passphrase or encryption key is required to access the wireless network " +#~ "'%s'." +#~ msgstr "" +#~ "Бежична мрежа захтева лозинку\n" +#~ "\n" +#~ " Лозинка или кључ за шифровање су неопходни за приступ бежичној мрежи " +#~ "„%s“." + +#~ msgid "" +#~ "Reduced Network Functionality\n" +#~ "\n" +#~ "%s It will not be completely functional." +#~ msgstr "" +#~ "Смањена употребна вредност мреже\n" +#~ "\n" +#~ "%s неће бити сасвим употребљива." + +#~ msgid "" +#~ "Wireless Network Login " +#~ "Confirmation\n" +#~ "\n" +#~ "You have chosen log in to the wireless network '%s'. If you are sure " +#~ "this wireless network is secure, click the checkbox below and " +#~ "NetworkManager will no longer pester you with stupid questions when you " +#~ "connect to it." +#~ msgstr "" +#~ "Потврда пријаве на мрежу\n" +#~ "\n" +#~ "Желите да се пријавите на мрежу „%s“. Ако сте сигурни да је ова бежична " +#~ "мрежа безбедна, обележите кућицу испод и Управник мреже вам више неће " +#~ "постављати сувишна питања при пријави на ову мрежу." + +#~ msgid "Always Trust this Wireless Network" +#~ msgstr "Увек поклони поверење бежичној мрежи" + +#~ msgid "Connect with encryption enabled" +#~ msgstr "Повежи се и укључи шифровање" + +#~ msgid "Don't remind me again" +#~ msgstr "Не подсећај ме више" + +#~ msgid "Key Type:" +#~ msgstr "Врста кључа:" + +#~ msgid "Key type:" +#~ msgstr "Врста кључа:" + +#~ msgid "Wireless Network Key Required" +#~ msgstr "Потребан је кључ за бежичну мрежу" + +#~ msgid "Wireless _adapter:" +#~ msgstr "Бежични _уређај:" + +#~ msgid "Wireless _network:" +#~ msgstr "Бежична _мрежа:" + +#~ msgid "_Login to Network" +#~ msgstr "_Умрежи се" + +#~ msgid "_OK" +#~ msgstr "_У реду" + +#~ msgid "operation took too long" +#~ msgstr "Потрага је предуго трајала" + +#~ msgid "received data from wrong type of sender" +#~ msgstr "Примљени су подаци погрешног типа од пошиљаоца" + +#~ msgid "received data from unexpected sender" +#~ msgstr "Примљени су подаци од неочекиваног пошиљаоца" + +#~ msgid "%s" +#~ msgstr "%s" + +#~ msgid "too much data was sent over socket and some of it was lost" +#~ msgstr "" +#~ "Сувише података је послато кроз утичницу и нешто од њих је изгубљено" -- cgit v1.2.1 From d030a528458972152737eac2a07414e3fcf8c4bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Popovi=C4=87?= Date: Tue, 19 Oct 2010 11:18:54 -0500 Subject: po: updated Serbian Latin translation (bgo #632454) --- po/sr@latin.po | 2256 ++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 1949 insertions(+), 307 deletions(-) diff --git a/po/sr@latin.po b/po/sr@latin.po index 4904cecd39..3158facc03 100644 --- a/po/sr@latin.po +++ b/po/sr@latin.po @@ -1,437 +1,2079 @@ # Serbian Cyrillic and Latin translations for NetworkManager # Copyright (C) 2004-2005 GNOME Foundation # This file is distributed under the same licence as the NetworkManager package. +# Miloš Popović , 2010. # msgid "" msgstr "" "Project-Id-Version: NetworkManager\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-05-13 16:11-0400\n" -"PO-Revision-Date: 2006-06-02 20:40+0200\n" -"Last-Translator: Filip Miletic \n" -"Language-Team: Serbian \n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-09-22 03:25+0000\n" +"PO-Revision-Date: 2010-10-18 16:48+0200\n" +"Last-Translator: Miloš Popović \n" +"Language-Team: Serbian \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" +"Plural-Forms: nplurals=4; plural=n==1? 3 : n%10==1 && n%100!=11 ? 0 : n" +"%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/devices.c:88 ../cli/src/devices.c:101 ../cli/src/devices.c:111 +#: ../cli/src/devices.c:121 ../cli/src/devices.c:134 ../cli/src/devices.c:145 +#: ../cli/src/devices.c:156 ../cli/src/devices.c:165 ../cli/src/devices.c:174 +msgid "NAME" +msgstr "IME" + +#. 0 +#: ../cli/src/connections.c:61 ../cli/src/connections.c:76 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:62 +msgid "DEVICES" +msgstr "UREĐAJI" + +#. 2 +#: ../cli/src/connections.c:63 ../cli/src/connections.c:78 +msgid "SCOPE" +msgstr "OPSEG" + +#. 3 +#: ../cli/src/connections.c:64 +msgid "DEFAULT" +msgstr "PODRAZUMEVANO" + +#. 4 +#: ../cli/src/connections.c:65 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVIS" + +#. 5 +#: ../cli/src/connections.c:66 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJEKT" + +#. 6 +#: ../cli/src/connections.c:67 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:77 ../cli/src/devices.c:62 ../cli/src/devices.c:90 +msgid "TYPE" +msgstr "VRSTA" + +#. 3 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP" +msgstr "OZNAKA_VREMENA" + +#. 4 +#: ../cli/src/connections.c:80 +msgid "TIMESTAMP-REAL" +msgstr "STVARNA-OZNAKA_VREMENA" + +#. 5 +#: ../cli/src/connections.c:81 +msgid "AUTOCONNECT" +msgstr "SAMOPOVEZIVANJE" + +#. 6 +#: ../cli/src/connections.c:82 +msgid "READONLY" +msgstr "SAMO_ZA_ČITANJE" + +#. 7 +#: ../cli/src/connections.c:83 +msgid "DBUS-PATH" +msgstr "DBAS-PUTANJA" + +#: ../cli/src/connections.c:159 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Upotreba: nmcli con { NAREDBA | help }\n" +" NAREDBA := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:540 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Greška: „con list“: %s" -#: examples/python/systray/eggtrayicon.c:111 gnome/applet/eggtrayicon.c:118 -msgid "Orientation" -msgstr "Usmerenje" +#: ../cli/src/connections.c:201 ../cli/src/connections.c:542 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Greška: „con list“: %s; dozvoljena polja: %s" + +#: ../cli/src/connections.c:209 +msgid "Connection details" +msgstr "Podaci o vezi" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:605 +msgid "system" +msgstr "sistem" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:605 +msgid "user" +msgstr "korisnik" + +#: ../cli/src/connections.c:386 +msgid "never" +msgstr "nikada" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:387 ../cli/src/connections.c:388 +#: ../cli/src/connections.c:606 ../cli/src/connections.c:609 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:551 ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 +msgid "yes" +msgstr "da" + +#: ../cli/src/connections.c:387 ../cli/src/connections.c:388 +#: ../cli/src/connections.c:606 ../cli/src/connections.c:609 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:510 ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 ../cli/src/settings.c:1224 +msgid "no" +msgstr "ne" + +#: ../cli/src/connections.c:461 ../cli/src/connections.c:504 +msgid "System connections" +msgstr "Veze na sistemu" + +#: ../cli/src/connections.c:466 ../cli/src/connections.c:517 +msgid "User connections" +msgstr "Korisnikove veze" + +#: ../cli/src/connections.c:478 ../cli/src/connections.c:1338 +#: ../cli/src/connections.c:1354 ../cli/src/connections.c:1363 +#: ../cli/src/connections.c:1374 ../cli/src/connections.c:1459 +#: ../cli/src/devices.c:962 ../cli/src/devices.c:972 ../cli/src/devices.c:1074 +#: ../cli/src/devices.c:1081 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Greška: Nedostaje argument %s." -# Potreban je bolji prevod za ovo -#: examples/python/systray/eggtrayicon.c:112 gnome/applet/eggtrayicon.c:119 -msgid "The orientation of the tray." -msgstr "Usmerenje obaveštajne zone." +#: ../cli/src/connections.c:491 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Greška: %s — ova veza ne postoji." -#: gnome/applet/applet-dbus-info.c:852 +#: ../cli/src/connections.c:523 ../cli/src/connections.c:1387 +#: ../cli/src/connections.c:1477 ../cli/src/devices.c:785 +#: ../cli/src/devices.c:852 ../cli/src/devices.c:986 ../cli/src/devices.c:1087 #, c-format -msgid "" -"The requested wireless network '%s' does not appear to be in range. A " -"different wireless network will be used if any are available." -msgstr "Tražena bežična mreža „%s“ nije u dometu. Biće korišćena druga bežična mreža ako je raspoloživa." +msgid "Unknown parameter: %s\n" +msgstr "Nepoznati parametar: %s\n" -#: gnome/applet/applet-dbus.c:573 +#: ../cli/src/connections.c:532 #, c-format -msgid "Connection to the wireless network '%s' failed.\n" -msgstr "Neuspela veza sa bežičnom mrežom „%s“.\n" +msgid "Error: no valid parameter specified." +msgstr "Greška: nije određen ispravan parametar." -#: gnome/applet/applet-dbus.c:578 -msgid "Connection to the wired network failed.\n" -msgstr "Neuspela veza sa žičanom mrežom.\n" +#: ../cli/src/connections.c:547 ../cli/src/connections.c:1580 +#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:359 +#, c-format +msgid "Error: %s." +msgstr "Greška: %s." + +#: ../cli/src/connections.c:653 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Greška: „con status“: %s" -#: gnome/applet/applet.c:194 gnome/applet/applet.c:212 -msgid "NetworkManager Applet" -msgstr "Aplet Upravnik mreže" +#: ../cli/src/connections.c:655 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Greška: „con status“: %s; dozvoljena polja: %s" -#: gnome/applet/applet.c:196 gnome/applet/applet.c:214 -msgid "Copyright (C) 2004-2005 Red Hat, Inc." -msgstr "Copyright (C) 2004-2005 Red Hat, Inc." +#: ../cli/src/connections.c:662 +msgid "Active connections" +msgstr "Aktivne veze" -#: gnome/applet/applet.c:197 gnome/applet/applet.c:215 -msgid "" -"Notification area applet for managing your network devices and connections." -msgstr "Aplet za obaveštajnu zonu za upravljanje mrežnim uređajima i vezama." +#: ../cli/src/connections.c:1030 +#, c-format +msgid "no active connection on device '%s'" +msgstr "nema aktivnih veza na uređaju „%s“" + +#: ../cli/src/connections.c:1038 +#, c-format +msgid "no active connection or device" +msgstr "nema aktivnih veza na uređaju" + +#: ../cli/src/connections.c:1088 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "uređaj „%s“ ne podržava vezu „%s“" + +#: ../cli/src/connections.c:1090 +#, c-format +msgid "no device found for connection '%s'" +msgstr "ne postoji uređaj za vezu „%s“" + +#: ../cli/src/connections.c:1101 +msgid "activating" +msgstr "pokrećem" + +#: ../cli/src/connections.c:1103 +msgid "activated" +msgstr "pokrenuto" + +#: ../cli/src/connections.c:1106 ../cli/src/connections.c:1129 +#: ../cli/src/connections.c:1162 ../cli/src/devices.c:246 +#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:149 ../cli/src/settings.c:473 +msgid "unknown" +msgstr "nepoznato" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting (prepare)" +msgstr "Povezivanje na VPN (priprema)" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (need authentication)" +msgstr "Povezivanje na VPN (potrebna prijava)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connecting" +msgstr "Povezivanje na VPN" + +#: ../cli/src/connections.c:1121 +msgid "VPN connecting (getting IP configuration)" +msgstr "Povezivanje na VPN (prikupljam IP podešavanja)" + +#: ../cli/src/connections.c:1123 +msgid "VPN connected" +msgstr "Povezani ste na VPN" + +#: ../cli/src/connections.c:1125 +msgid "VPN connection failed" +msgstr "Nije uspelo povezivanje na VPN" + +#: ../cli/src/connections.c:1127 +msgid "VPN disconnected" +msgstr "VPN veza je prekinuta" + +#: ../cli/src/connections.c:1138 +msgid "unknown reason" +msgstr "nepoznat razlog" + +#: ../cli/src/connections.c:1140 +msgid "none" +msgstr "ništa" + +#: ../cli/src/connections.c:1142 +msgid "the user was disconnected" +msgstr "korisnik je otkačen sa mreže" + +#: ../cli/src/connections.c:1144 +msgid "the base network connection was interrupted" +msgstr "osnovna mrežna veza je poremećena" + +#: ../cli/src/connections.c:1146 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN servis je neočekivano izašao" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service returned invalid configuration" +msgstr "VPN servis je vratio pogrešne postavke" + +#: ../cli/src/connections.c:1150 +msgid "the connection attempt timed out" +msgstr "isteklo je vreme za pokušaj povezivanja" + +#: ../cli/src/connections.c:1152 +msgid "the VPN service did not start in time" +msgstr "VPN servis nije pokrenut na vreme" + +#: ../cli/src/connections.c:1154 +msgid "the VPN service failed to start" +msgstr "ne mogu da pokrenem VPN servis" + +#: ../cli/src/connections.c:1156 +msgid "no valid VPN secrets" +msgstr "nisu ispravne VPN lozinke" + +#: ../cli/src/connections.c:1158 +msgid "invalid VPN secrets" +msgstr "neispravne VPN lozinke" + +#: ../cli/src/connections.c:1160 +msgid "the connection was removed" +msgstr "veza je uklonjena" + +#: ../cli/src/connections.c:1174 +#, c-format +msgid "state: %s\n" +msgstr "stanje: %s\n" -#: gnome/applet/applet.c:280 +#: ../cli/src/connections.c:1177 ../cli/src/connections.c:1203 +#, c-format +msgid "Connection activated\n" +msgstr "Veza je pokrenuta\n" + +#: ../cli/src/connections.c:1180 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Greška: Nije uspelo pokretanje veze." + +#: ../cli/src/connections.c:1199 +#, c-format +msgid "state: %s (%d)\n" +msgstr "stanje: %s (%d)\n" + +#: ../cli/src/connections.c:1209 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Greška: Pokretanje veze nije uspelo: %s." + +#: ../cli/src/connections.c:1226 ../cli/src/devices.c:909 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Greška: Isteklo je vreme od %d s." + +#: ../cli/src/connections.c:1269 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Greška: Nije uspelo pokretanje veze: %s" + +#: ../cli/src/connections.c:1283 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Greška: Ne mogu da nađem pokrenutu vezu za „%s“." + +#: ../cli/src/connections.c:1292 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Stanje aktivne veze: %s\n" + +#: ../cli/src/connections.c:1293 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Putanja do aktivne veze: %s\n" + +#: ../cli/src/connections.c:1347 ../cli/src/connections.c:1468 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Greška: Nepoznata veza: %s." + +#: ../cli/src/connections.c:1382 ../cli/src/devices.c:980 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Greška: nije ispravna vrednost „%s“ za istek vremena." + +#: ../cli/src/connections.c:1395 ../cli/src/connections.c:1485 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Greška: morate da zadate id ili uuid." + +#: ../cli/src/connections.c:1415 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Greška: Nije pronađen odgovarajući uređaj: %s." + +#: ../cli/src/connections.c:1417 +#, c-format +msgid "Error: No suitable device found." +msgstr "Greška: Nije pronađen odgovarajući uređaj." + +#: ../cli/src/connections.c:1512 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Upozorenje: Nije pokrenuta veza\n" + +#: ../cli/src/connections.c:1569 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Greška: „con“ naredba „%s“ nije ispravna." + +#: ../cli/src/connections.c:1605 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Greška: ne mogu da se povežem na D-Bas." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Greška: Ne mogu da dobijem sistemska podešavanja." + +#: ../cli/src/connections.c:1620 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Greška: Ne mogu da dobijem korisnička podešavanja." + +#: ../cli/src/connections.c:1630 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "" +"Greška: Ne mogu da nađem veze: upravljački programi za podešavanja nisu " +"pokrenuti." + +#. 0 +#. 9 +#: ../cli/src/devices.c:61 ../cli/src/devices.c:89 ../cli/src/devices.c:184 +msgid "DEVICE" +msgstr "UREĐAJ" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:63 ../cli/src/devices.c:93 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STANJE" + +#: ../cli/src/devices.c:72 +msgid "GENERAL" +msgstr "OPŠTE" + +#. 0 +#: ../cli/src/devices.c:73 +msgid "CAPABILITIES" +msgstr "SPOSOBNOSTI" + +#. 1 +#: ../cli/src/devices.c:74 +msgid "WIFI-PROPERTIES" +msgstr "BEŽIČNE-OSOBINE" + +#. 2 +#: ../cli/src/devices.c:75 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:76 +msgid "WIRED-PROPERTIES" +msgstr "ŽIČANE-OSOBINE" + +#. 4 +#: ../cli/src/devices.c:77 +msgid "IP4-SETTINGS" +msgstr "IP4-PODEŠAVANJA" + +#. 5 +#: ../cli/src/devices.c:78 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 6 +#: ../cli/src/devices.c:79 +msgid "IP6-SETTINGS" +msgstr "IP6-PODEŠAVANJA" + +#. 7 +#: ../cli/src/devices.c:80 +msgid "IP6-DNS" +msgstr "IP6-DNS" + +#. 2 +#: ../cli/src/devices.c:91 +msgid "DRIVER" +msgstr "DRAJVER" + +#. 3 +#: ../cli/src/devices.c:92 +msgid "HWADDR" +msgstr "HARDVADRESA" + +#. 0 +#: ../cli/src/devices.c:102 +msgid "CARRIER-DETECT" +msgstr "NALAŽ-NOSAČA" + +#. 1 +#: ../cli/src/devices.c:103 +msgid "SPEED" +msgstr "BRZINA" + +#. 0 +#: ../cli/src/devices.c:112 +msgid "CARRIER" +msgstr "NOSAČ" + +#. 0 +#: ../cli/src/devices.c:122 +msgid "WEP" +msgstr "VEP" + +#. 1 +#: ../cli/src/devices.c:123 +msgid "WPA" +msgstr "VPA" + +#. 2 +#: ../cli/src/devices.c:124 +msgid "WPA2" +msgstr "VPA2" + +#. 3 +#: ../cli/src/devices.c:125 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:126 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:135 ../cli/src/devices.c:146 +msgid "ADDRESS" +msgstr "ADRESA" + +#. 1 +#: ../cli/src/devices.c:136 ../cli/src/devices.c:147 +msgid "PREFIX" +msgstr "PREFIKS" + +#. 2 +#: ../cli/src/devices.c:137 ../cli/src/devices.c:148 +msgid "GATEWAY" +msgstr "PROLAZ" + +#. 0 +#: ../cli/src/devices.c:157 ../cli/src/devices.c:166 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:175 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:176 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:177 +msgid "MODE" +msgstr "MOD" + +#. 3 +#: ../cli/src/devices.c:178 +msgid "FREQ" +msgstr "FREK" + +#. 4 +#: ../cli/src/devices.c:179 +msgid "RATE" +msgstr "PROTOK" + +#. 5 +#: ../cli/src/devices.c:180 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:181 +msgid "SECURITY" +msgstr "SIGURNOST" + +#. 7 +#: ../cli/src/devices.c:182 +msgid "WPA-FLAGS" +msgstr "VPA-ZASTAVICE" + +#. 8 +#: ../cli/src/devices.c:183 +msgid "RSN-FLAGS" +msgstr "RSN-ZASTAVICE" + +#. 10 +#: ../cli/src/devices.c:185 +msgid "ACTIVE" +msgstr "AKTIVNO" + +#: ../cli/src/devices.c:208 #, c-format msgid "" -"VPN Login Failure\n" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" "\n" -"Could not start the VPN connection '%s' due to a login failure.\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" -"The VPN service said: \"%s\"" msgstr "" -"Prijava na VPN nije uspela\n" +"Upotreba: nmcli uređaj { NAREDBA | help }\n" +"\n" +" NAREDBA := { status | list | disconnect | wifi }\n" "\n" -"VPN veza sa mrežom „%s“ nije ostvarena jer prijava nije uspela.\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" -"Poruka VPN servisa je bila : „%s“" -#: gnome/applet/applet.c:341 +#: ../cli/src/devices.c:228 +msgid "unmanaged" +msgstr "nepodešeno" + +#: ../cli/src/devices.c:230 +msgid "unavailable" +msgstr "nedostupno" + +#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:91 +msgid "disconnected" +msgstr "nije povezano" + +#: ../cli/src/devices.c:234 +msgid "connecting (prepare)" +msgstr "povezujem se (priprema)" + +#: ../cli/src/devices.c:236 +msgid "connecting (configuring)" +msgstr "povezujem se (podešavam)" + +#: ../cli/src/devices.c:238 +msgid "connecting (need authentication)" +msgstr "povezujem se (potrebna prijava)" + +#: ../cli/src/devices.c:240 +msgid "connecting (getting IP configuration)" +msgstr "povezujem se (preuzimam IP podešavanja)" + +#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:89 +msgid "connected" +msgstr "povezan" + +#: ../cli/src/devices.c:244 +msgid "connection failed" +msgstr "povezivanje nije uspelo" + +#: ../cli/src/devices.c:267 ../cli/src/devices.c:424 +msgid "Unknown" +msgstr "Nepoznato" + +#: ../cli/src/devices.c:299 +msgid "(none)" +msgstr "(ništa)" + +#: ../cli/src/devices.c:324 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: greška pri prevodu IP4 adrese 0x%X" + +#: ../cli/src/devices.c:393 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:394 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:403 +msgid "Encrypted: " +msgstr "Šifrovano: " + +#: ../cli/src/devices.c:408 +msgid "WEP " +msgstr "VEP" + +#: ../cli/src/devices.c:410 +msgid "WPA " +msgstr "VPA" + +#: ../cli/src/devices.c:412 +msgid "WPA2 " +msgstr "CPA2" + +#: ../cli/src/devices.c:415 +msgid "Enterprise " +msgstr "Preduzimljivo" + +#: ../cli/src/devices.c:424 +msgid "Ad-Hoc" +msgstr "Ad-Hok" + +#: ../cli/src/devices.c:424 +msgid "Infrastructure" +msgstr "Infrastrukturno" + +#: ../cli/src/devices.c:486 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "Greška: „dev list“: %s" + +#: ../cli/src/devices.c:488 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Greška: „dev list“: %s; dozvoljena polja: %s" + +#: ../cli/src/devices.c:497 +msgid "Device details" +msgstr "Podaci o drajveru" + +#: ../cli/src/devices.c:527 ../cli/src/devices.c:925 +msgid "(unknown)" +msgstr "(nepoznato)" + +#: ../cli/src/devices.c:528 +msgid "unknown)" +msgstr "nepoznato)" + +#: ../cli/src/devices.c:554 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:627 +msgid "on" +msgstr "uklj" + +#: ../cli/src/devices.c:627 +msgid "off" +msgstr "isklj" + +#: ../cli/src/devices.c:808 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "Greška: „dev status“: %s" + +#: ../cli/src/devices.c:810 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Greška „dev status“: %s; dozvoljena polja: %s" + +#: ../cli/src/devices.c:817 +msgid "Status of devices" +msgstr "Stanje uređaja" + +#: ../cli/src/devices.c:845 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Greška: nedostaje argument „%s“." + +#: ../cli/src/devices.c:874 ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Greška: Nije nađen uređaj „%s“." + +#: ../cli/src/devices.c:897 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Veza na uređaju „%s“ je uspešno prekinuta." + +#: ../cli/src/devices.c:922 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Greška: Ne mogu da prekinem vezu na uređaju „%s“ (%s): %s" + +#: ../cli/src/devices.c:930 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Stanje uređaja: %d (%s)\n" + +#: ../cli/src/devices.c:994 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Greška: morate da zadate iface." + +#: ../cli/src/devices.c:1112 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "Greška: „dev wifi“: %s" + +#: ../cli/src/devices.c:1114 #, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Greška: „dev wifi“: %s; dozvoljena polja: %s" + +#: ../cli/src/devices.c:1121 +msgid "WiFi scan list" +msgstr "Spisak pretrage bežičnih mreža" + +#: ../cli/src/devices.c:1156 ../cli/src/devices.c:1210 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Greška: Nije nađena pristupna tačka sa hardverskom adresom „%s“." + +#: ../cli/src/devices.c:1173 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Greška: „%s“ nije bežični mrežni uređaj." + +#: ../cli/src/devices.c:1237 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Greška: „dev wifi“ naredba „%s“ nije ispravna." + +#: ../cli/src/devices.c:1284 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Greška: „dev“ naredba „%s“ nije ispravna." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "POKRENUTO" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "NET-ENABLED" +msgstr "MREŽA-OMOGUĆENA" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI-HARDWARE" +msgstr "WIFI-UREĐAJ" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WIFI" +msgstr "WIFI" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN-HARDWARE" +msgstr "WWAN-UREĐAJ" + +#. 5 +#: ../cli/src/network-manager.c:41 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:64 +#, c-format +#| msgid "" +#| "Usage: nmcli nm { COMMAND | help }\n" +#| "\n" +#| " COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +#| "\n" +#| " status\n" +#| " sleep\n" +#| " wakeup\n" +#| " wifi [on|off]\n" +#| " wwan [on|off]\n" +#| "\n" msgid "" -"VPN Login Message\n" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | enable | sleep | wifi | wwan }\n" "\n" -"VPN connection '%s' said:\n" +" status\n" +" enable [true|false]\n" +" sleep [true|false]\n" +" wifi [on|off]\n" +" wwan [on|off]\n" "\n" -"\"%s\"" msgstr "" -"Poruka pri prijavi na VPN\n" +"Upotreba: nmcli nm { NAREDBA | help }\n" +"\n" +" NAREDBA := { status | enable| sleep | wifi | wwan }\n" "\n" -"Poruka VPN veze „%s“ je:\n" +" status\n" +" enable [true|false]\n" +" sleep [true|false]\n" +" wifi [on|off]\n" +" wwan [on|off]\n" "\n" -"„%s“" -#: gnome/applet/applet.c:559 gnome/applet/applet.c:1922 -#: gnome/applet/other-network-dialog.c:315 -#: gnome/applet/passphrase-dialog.c:430 +#: ../cli/src/network-manager.c:85 +msgid "asleep" +msgstr "uspavan" + +#: ../cli/src/network-manager.c:87 +msgid "connecting" +msgstr "povezuje se" + +#: ../cli/src/network-manager.c:128 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Greška: „nm status“: %s" + +#: ../cli/src/network-manager.c:130 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Greška: „nm status“: %s; dozvoljena polja: %s" + +#: ../cli/src/network-manager.c:137 +msgid "NetworkManager status" +msgstr "Stanje Upravnika mreže" + +#. Print header +#: ../cli/src/network-manager.c:144 ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 ../cli/src/network-manager.c:328 +msgid "enabled" +msgstr "omogućen" + +#: ../cli/src/network-manager.c:144 ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 ../cli/src/network-manager.c:328 +msgid "disabled" +msgstr "onemogućen" + +#: ../cli/src/network-manager.c:152 +msgid "running" +msgstr "pokrenut" + +#: ../cli/src/network-manager.c:152 +msgid "not running" +msgstr "nije pokrenut" + +#: ../cli/src/network-manager.c:175 +#, c-format +#| msgid "Error: could not connect to D-Bus." +msgid "Error: Couldn't connect to system bus: %s" +msgstr "Greška: ne mogu da se povežem na sistemsku magistralu: %s" + +#: ../cli/src/network-manager.c:186 +#, c-format +#| msgid "Error: could not connect to D-Bus." +msgid "Error: Couldn't create D-Bus object proxy." +msgstr "Greška: ne mogu da obrazujem DBas posrednika." + +#: ../cli/src/network-manager.c:192 +#, c-format +#| msgid "Error: 'con list': %s" +msgid "Error in sleep: %s" +msgstr "Greška pri uspavljivanju: %s" + +#: ../cli/src/network-manager.c:237 ../cli/src/network-manager.c:286 +#: ../cli/src/network-manager.c:318 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Greška: „--fields“ vrednost „%s“ nije dozvoljena ovde; dozvoljene su: %s" + +#: ../cli/src/network-manager.c:245 +#| msgid "WiFi enabled" +msgid "Networking enabled" +msgstr "Umrežavanje je omogućeno" + +#: ../cli/src/network-manager.c:256 +#, c-format +#| msgid "Error: invalid 'wwan' parameter: '%s'." +msgid "Error: invalid 'enable' parameter: '%s'; use 'true' or 'false'." +msgstr "" +"Greška: neispravan „enable“ parametar: „%s“; dozvoljeni su „true“ i „false“." + +#: ../cli/src/network-manager.c:265 +#, c-format +#| msgid "Error: Could not connect to NetworkManager." +msgid "Error: Sleeping status is not exported by NetworkManager." +msgstr "Greška: Upravnika mreže nije izvezao stanje uspavljivanja." + +#: ../cli/src/network-manager.c:273 +#, c-format +#| msgid "Error: invalid 'wifi' parameter: '%s'." +msgid "Error: invalid 'sleep' parameter: '%s'; use 'true' or 'false'." +msgstr "" +"Greška: neispravan „sleep“ parametar: „%s“; dozvoljeni su „true“ i „false“." + +#: ../cli/src/network-manager.c:294 +msgid "WiFi enabled" +msgstr "WiFi omogućen" + +#: ../cli/src/network-manager.c:305 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Greška: neispravan „wifi“ parametar: „%s“." + +#: ../cli/src/network-manager.c:326 +msgid "WWAN enabled" +msgstr "WWAN omogućen" + +#: ../cli/src/network-manager.c:337 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Greška: neispravan „wwan“ parametar: „%s“." + +#: ../cli/src/network-manager.c:348 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Greška: „nm“ naredba „'%s“ nije ispravna." + +#: ../cli/src/nmcli.c:69 +#, c-format msgid "" -"The NetworkManager Applet could not find some required resources (the glade " -"file was not found)." -msgstr "Aplet Upravnik mreže nije mogao da pronađe neke od potrebnih resursa (glejd datoteka nije pronađena)." +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Upotreba: %s [OPCIJE] OBJEKAT { NAREDBA | help }\n" +"\n" +"OPCIJE\n" +" -t[erse] sažet ispis\n" +" -p[retty] uređen ispis\n" +" -m[ode] tabular|multiline režim ispisa\n" +" -f[ields] |all|common određuje polja za ispis\n" +" -e[scape] yes|no ne dodaje razdvojnike kolona u " +"vrednostima\n" +" -v[ersion] ispisuje izdanje programa\n" +" -h[elp] ispisuje ovu pomoć\n" +"\n" +"OBJEKAT\n" +" nm stanje Upravnika vezama\n" +" con veze Upravnika vezama\n" +" dev uređaji Upravnika mrežama\n" +"\n" -#: gnome/applet/applet.c:572 +#: ../cli/src/nmcli.c:113 #, c-format -msgid "The network device \"%s (%s)\" does not support wireless scanning." -msgstr "Mrežni uređaj „%s (%s)“ ne podržava potragu za bežičnim mrežama." +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Greška: „%s“ je nepoznati objekat, pogledajte „nmcli help“." -#: gnome/applet/applet.c:579 +#: ../cli/src/nmcli.c:143 #, c-format -msgid "The network device \"%s (%s)\" does not support link detection." -msgstr "Mrežni uređaj „%s (%s)“ ne podržava otkrivanje veze." +msgid "Error: Option '--terse' is specified the second time." +msgstr "Greška: Opcija „--terse“ je zadata po drugi put." -#: gnome/applet/applet.c:700 +#: ../cli/src/nmcli.c:148 #, c-format -msgid "Preparing device %s for the wired network..." -msgstr "Priprema uređaja %s za žičanu mrežu..." +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Greška: Opcije „--terse“ i „--pretty“ se međusobno isključuju." -#: gnome/applet/applet.c:702 +#: ../cli/src/nmcli.c:156 #, c-format -msgid "Preparing device %s for the wireless network '%s'..." -msgstr "Priprema uređaja %s za bežičnu mrežu „%s“..." +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Greška: Opcija „--pretty“ je zadata po drugi put." -#: gnome/applet/applet.c:709 +#: ../cli/src/nmcli.c:161 #, c-format -msgid "Configuring device %s for the wired network..." -msgstr "Podešavanje uređaja %s za bežičnu mrežu..." +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Greška: Opcije „--pretty“ i „--terse“ se međusobno isključuju." -#: gnome/applet/applet.c:711 +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 #, c-format -msgid "Attempting to join the wireless network '%s'..." -msgstr "Pokušaj pristupa bežičnoj mreži „%s“..." +msgid "Error: missing argument for '%s' option." +msgstr "Greška: nedostaje argument uz opciju „%s“." -#: gnome/applet/applet.c:718 +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 #, c-format -msgid "Waiting for Network Key for the wireless network '%s'..." -msgstr "Čekanje na mrežni ključ za bežičnu mrežu „%s“..." +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Greška: „%s“ nije ispravan argument uz opciju „%s“." -#: gnome/applet/applet.c:725 gnome/applet/applet.c:734 -msgid "Requesting a network address from the wired network..." -msgstr "Potraživanje mrežne adrese za žičanu mrežu..." +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Greška: nedostaju polja za „%s“ opciju." -#: gnome/applet/applet.c:727 gnome/applet/applet.c:736 +#: ../cli/src/nmcli.c:209 #, c-format -msgid "Requesting a network address from the wireless network '%s'..." -msgstr "Potraživanje mrežne adrese za bežičnu mrežu „%s“..." +msgid "nmcli tool, version %s\n" +msgstr "nmcli alat, izdanje %s\n" -#: gnome/applet/applet.c:743 -msgid "Finishing connection to the wired network..." -msgstr "Obustavljanje veze sa žičanom mrežom..." +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Greška: Opcija „%s“ je nepoznata, probajte „nmcli -help“." -#: gnome/applet/applet.c:745 +#: ../cli/src/nmcli.c:234 #, c-format -msgid "Finishing connection to the wireless network '%s'..." -msgstr "Obustavljanje veze sa bežičnom mrežom „%s“..." +msgid "Caught signal %d, shutting down..." +msgstr "Dobio sam signal %d, isključujem..." -#: gnome/applet/applet.c:791 -msgid "NetworkManager is not running" -msgstr "Upravljač mreže nije pokrenut" +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Greška: Ne mogu da se povežem na Upravnika mreže." -#: gnome/applet/applet.c:802 -msgid "No network connection" -msgstr "Nema mrežnih veza" +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "Uspešno" -#: gnome/applet/applet.c:809 -msgid "Wired network connection" -msgstr "Žična mrežna veza" +#: ../cli/src/settings.c:411 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (heksadekadni-aski-ključ)" -# FIXME Ad-hok -#: gnome/applet/applet.c:816 -msgid "Connected to an Ad-Hoc wireless network" -msgstr "Povezan sa ad-hok bežičnom mrežom" +#: ../cli/src/settings.c:413 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-bitna lozinka)" -#: gnome/applet/applet.c:830 +#: ../cli/src/settings.c:416 #, c-format -msgid "Wireless network connection to '%s' (%d%%)" -msgstr "Bežična mrežna veza sa „%s“ (%d%%)" +msgid "%d (unknown)" +msgstr "%d (nepoznato)" -#: gnome/applet/applet.c:1181 -msgid "Other Wireless Networks..." -msgstr "Ostale bežične mreže..." +#: ../cli/src/settings.c:442 +msgid "0 (unknown)" +msgstr "0 (napoznato)" -#: gnome/applet/applet.c:1202 -msgid "Create new Wireless Network..." -msgstr "Napravi novu bežičnu mrežu..." +#: ../cli/src/settings.c:448 +msgid "any, " +msgstr "vilo koje, " -#: gnome/applet/applet.c:1315 -msgid "VPN Connections" -msgstr "VPN veze" +#: ../cli/src/settings.c:450 +msgid "900 MHz, " +msgstr "900 MHz, " -#: gnome/applet/applet.c:1337 -msgid "Disconnect VPN..." -msgstr "Isključi VPN..." +#: ../cli/src/settings.c:452 +msgid "1800 MHz, " +msgstr "1800 MHz, " -#: gnome/applet/applet.c:1366 -msgid "No network devices have been found" -msgstr "Nije pronađen nijedan mrežni uređaj" +#: ../cli/src/settings.c:454 +msgid "1900 MHz, " +msgstr "1900 MHz, " -#: gnome/applet/applet.c:1529 -msgid "NetworkManager is not running..." -msgstr "Upravljač mrežom nije pokrenut..." +#: ../cli/src/settings.c:456 +msgid "850 MHz, " +msgstr "850 MHz, " -#: gnome/applet/applet.c:1599 gnome/applet/applet.c:1647 -msgid "Pause Wireless Scanning" -msgstr "Obustavi traženje bežične mreže" +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " -#: gnome/applet/applet.c:1604 -msgid "Resume Wireless Scanning" -msgstr "Nastavi traženje bežične mreže" +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " -#: gnome/applet/applet.c:1614 gnome/applet/applet.c:1653 -msgid "Stop All Wireless Devices" -msgstr "Zaustavi sve bežične uređaje" +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " -#: gnome/applet/applet.c:1619 -msgid "Start All Wireless Devices" -msgstr "Pokreni sve bežične uređaje" +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " -#: gnome/applet/applet.c:1662 -msgid "Help" -msgstr "Pomoć" +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " -#: gnome/applet/applet.c:1669 -msgid "About" -msgstr "O programu" +#: ../cli/src/settings.c:468 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " -#: gnome/applet/applet.c:2070 -msgid "" -"The NetworkManager applet could not find some required resources. It cannot " -"continue.\n" -msgstr "Upravljač mrežom nije uspeo da pronađe neophodne resurse i ne može da nastavi rad.\n" +#: ../cli/src/settings.c:470 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:554 ../cli/src/settings.c:721 +msgid "auto" +msgstr "automatski" + +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 +msgid "not set" +msgstr "nije izabrano" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "polje „%s“ mora da bude prazno" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "neispravno polje „%s“" -#: gnome/applet/gtkcellrendererprogress.c:243 -#: gnome/applet/gtkcellrendererprogress.c:301 +#: ../cli/src/utils.c:146 #, c-format -msgid "progress bar label|%d %%" -msgstr "%d %%" +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Opcija „--terse“ zahteva opciju „--fields“" -#: gnome/applet/menu-items.c:91 +#: ../cli/src/utils.c:150 #, c-format -msgid "Wired Network (%s)" -msgstr "Žičana mreža (%s)" +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "Opcija „--terse“ zahteva opciju „--fields“, a ne „%s“" -#: gnome/applet/menu-items.c:93 -msgid "Wired Network" -msgstr "Žičana mreža" +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM datoteka sa ključem nema završnu oznaku „%s“." -#: gnome/applet/menu-items.c:166 +#: ../libnm-util/crypto.c:130 #, c-format -msgid "Wireless Network (%s)" -msgid_plural "Wireless Networks (%s)" -msgstr[0] "Bežična mreža (%s)" -msgstr[1] "Bežične mreže (%s)" -msgstr[2] "Bežičnih mreža (%s)" +msgid "Doesn't look like a PEM private key file." +msgstr "Ne izgleda kao privatna PEM datoteka sa ključem." -#: gnome/applet/menu-items.c:168 -msgid "Wireless Network" -msgid_plural "Wireless Networks" -msgstr[0] "Bežična mreža" -msgstr[1] "Bežične mreže" -msgstr[2] "Bežične mreže" +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Nema dovoljno memorije za čuvanje PEM podataka." -#: gnome/applet/menu-items.c:294 -msgid " (invalid Unicode)" -msgstr " (neispravan Unikod)" +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Loša PEM datoteka: Proc-Type nije prva oznaka." -#: gnome/applet/other-network-dialog.c:148 -#: gnome/applet/passphrase-dialog.c:164 -#: gnome/applet/applet.glade.h:27 -msgid "Passphrase:" -msgstr "Lozinka:" +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Loša PEM datoteka: nepoznata Proc-Type oznaka „%s“." -#: gnome/applet/other-network-dialog.c:151 -#: gnome/applet/passphrase-dialog.c:167 -msgid "Ascii Key:" -msgstr "ASKRI ključ:" +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Loša PEM datoteka: DEK-Info nije druga oznaka." -#: gnome/applet/other-network-dialog.c:154 -#: gnome/applet/passphrase-dialog.c:170 -msgid "Hex Key:" -msgstr "Heksa ključ:" +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Loša PEM datoteka: nije dat IV unutar DEK-Info oznake." -#: gnome/applet/other-network-dialog.c:229 -msgid "Create new wireless network" -msgstr "Napravi novu bežičnu mrežu" +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "Loša PEM datoteka: neispravan format za IV unutar DEK-Info oznake." -#: gnome/applet/other-network-dialog.c:230 -msgid "" -"Enter the ESSID and security settings of the wireless network you wish to " -"create." -msgstr "Unesite ESSID i bezbednosne postavke bežične mreže koju želite da načinite." +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Loša PEM datoteka: nepoznata šifra privatnog ključa „%s“." -#: gnome/applet/other-network-dialog.c:235 -msgid "Custom wireless network" -msgstr "Korisnička bežična mreža" +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "Ne mogu da dešifrujem privatni ključ." -#: gnome/applet/other-network-dialog.c:236 -msgid "Enter the ESSID of the wireless network to which you wish to connect." -msgstr "Unesite ESSID bežične mreže sa kojom želite da se povežete." +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM sertifikat „%s“ nema završnu oznaku „%s“." -#: gnome/applet/vpn-password-dialog.c:105 +#: ../libnm-util/crypto.c:277 #, c-format -msgid "You must log in to access the Virtual Private Network '%s'." -msgstr "Morate biti prijavljeni kako biste koristili virtuelnu privatnu mrežu „%s“." +msgid "Failed to decode certificate." +msgstr "Ne mogu da dešifrujem sertifikat." -#: gnome/applet/applet.glade.h:1 -msgid " " -msgstr " " +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Nema dovoljno memorije za čuvanje podataka o sertifikatu." -#: gnome/applet/applet.glade.h:2 -msgid "*" -msgstr "*" +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "Nema dovoljno memorije za čuvanje podataka o datoteci." -#: gnome/applet/applet.glade.h:3 -msgid "" -"128-bit Passphrase (WEP)\n" -"Ascii Key (WEP)\n" -"Hex Key (WEP)" +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV mora da sadrži paran broj bitova." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Nema dovoljno memorije za čuvanje IV." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV sadrži cifre koje nisu heksadecimalne." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Lozinka privatnog ključa „%s“ nije poznata." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "Nema dovoljno memorije za dešifrovanje privatnog ključa." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "Ne mogu da odredim vrstu privatnog ključa." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Nema dovoljno memorije za čuvanje dešifrovanog privatnog ključa." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "Ne mogu da pokrenem program za šifrovanje." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Ne mogu da pokrenem program za MD5 sumu: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Neispravna IV dužina (mora da bude bar %zd)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Nema dovoljno memorije u ostavi za dešifrovani ključ." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Ne mogu da pokrenem dešifrovanje lozinke: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "Ne mogu da postavim simetrični ključ za dešifrovanje: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Ne mogu da postavim IV za dešifrovanje: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Ne mogu da dešifrujem privatni ključ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "Ne mogu da dešifrujem privatni ključ: neočekivana dužina." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "Ne mogu da dešifrujem privatni ključ." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Ne mogu da rezervišem memoriju za dešifrovanje." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Ne mogu da pokrenem šifrovanje lozinke: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Ne mogu da postavim simetrični ključ za šifrovanje: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Ne mogu da postavim IV za šifrovanje: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Ne mogu da šifrujem podatke: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Greška prilikom otvaranja podataka o sertifikatu: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "De mogu da dešifrujem sertifikat: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "Ne mogu da započnem PKCS#12 dešifrovanje: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Ne mogu da dešifrujem PKCS#12 datoteku: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "Ne mogu da proverim PKCS#12 datoteku: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Ne mogu da pokrenem program za šifrovanje: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Ne mogu da pokrenem MD5 sadržaj: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Neispravna IV dužina (mora da bude bar %d)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Ne mogu da pokrenem slot za dešifrovanje lozinke." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Ne mogu da postavim simetrični ključ za šifrovanje." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Ne mogu da postavim IV za dešifrovanje." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Ne mogu da pokrenem sadržaj za dešifrovanje." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Ne mogu da dešifrujem privatni ključ: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "Ne mogu da dešifrujem privatni ključ: dešifrovani podaci su predugački." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Ne mogu da završim dešifrovanje privatnog ključa: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "Ne mogu da pokrenem slot za šifrovanje lozinke." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "Ne mogu da postavim simetrični ključ za šifrovanje." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Ne mogu da postavim IV za šifrovanje." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "Ne mogu da pokrenem sadržaj za šifrovanje." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Ne mogu da šifrujem: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Neočekivan obim podataka nakon šifrovanja." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Ne mogu da dešifrujem sertifikat: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Ne mogu da pretvorim lozinku u UCS2: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Ne mogu da pokrenem program za PKCS#12 :dešifrovanje %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Ne mogu da dešifrujem PKCS#12 datoteku: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Ne mogu da proverim PKCS#12 datoteku: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "Ne mogu da obrazujem nasumične podatke." + +#: ../libnm-util/nm-utils.c:1975 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Nema dovoljno memorije za šifrovanje ključa." + +#: ../libnm-util/nm-utils.c:2085 +msgid "Could not allocate memory for PEM file creation." +msgstr "Ne mogu da rezervišem memoriju za obrazovanje PEM datoteke." + +#: ../libnm-util/nm-utils.c:2097 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Ne mogu da rezervišem memoriju za upis IV u PEM datoteku." + +#: ../libnm-util/nm-utils.c:2109 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "" -"128-bitni ključ (WEP)\n" -"ASKRI ključ (WEP)\n" -"Heks ključ (WEP)" +"Ne mogu da rezervišem memoriju za upis šifrovanog ključa u PEM datoteku." -#: gnome/applet/applet.glade.h:6 -msgid "" -"128-bit passphrase (WEP)\n" -"Ascii key (WEP)\n" -"Hex key (WEP)" +#: ../libnm-util/nm-utils.c:2128 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Ne mogu da rezervišem memoriju za PEM datoteku." + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Veza se deli preko zaštićene bežične mreže" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Veza se deli preko otvorene bežične mreže" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Trajno izmeni ime hosta" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Izmeni veze" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Ovlašćenja sistema ne dozvoljavaju izmenu sistemskih podešavanja" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "Ovlašćenja sistema ne dozvoljavaju izmenu hosta" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" msgstr "" -"128-bitni ključ (WEP)\n" -"ASKRI ključ (WEP)\n" -"Heks ključ (WEP)" +"Ovlašćenja sistema ne dozvoljavaju deljenje veze preko zaštićene bežične mreže" -#: gnome/applet/applet.glade.h:10 -#, no-c-format -msgid "" -"Passphrase Required by Wireless " -"Network\n" -"\n" -"A passphrase or encryption key is required to access the wireless network '%" -"s'." +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" msgstr "" -"Bežična mreža zahteva lozinku\n" -"\n" -" Lozinka ili ključ za šifrovanje su neophodni za pristup bežičnoj mreži „%s“." +"Ovlašćenja sistema ne dozvoljavaju deljenje veze preko otvorene bežične mreže" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "Dozvoli kontrolu mrežnih veza" -#: gnome/applet/applet.glade.h:14 -#, no-c-format +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "Dozvoli veze koje određuje korisnik" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "Omogući ili onemogući bežične uređaje" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "Omogući ili onemogući mobilne širokopojasne uređaje" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "Omogući ili onemogući umrežavanje na sistemu" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 msgid "" -"Reduced Network Functionality\n" -"\n" -"%s It will not be completely functional." +"Put NetworkManager to sleep or wake it up (should only be used by system " +"power management)" msgstr "" -"Smanjena upotrebna vrednost mreže\n" -"\n" -"%s neće biti sasvim upotrebljiva." +"Omogućava uspavljivanje Upravnika mreže (koristi se sa Upravnikom potrošnje na " +"sistemu)" -#: gnome/applet/applet.glade.h:18 -#, no-c-format -msgid "" -"Wireless Network Login Confirmation\n" -"\n" -"You have chosen log in to the wireless network '%s'. If you are sure this " -"wireless network is secure, click the checkbox below and NetworkManager will " -"no longer pester you with stupid questions when you connect to it." +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +msgid "System policy prevents control of network connections" +msgstr "Ovlašćenja sistema onemogućavaju kontrolu mrežnih veza" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "Ovlašćenja sistema onemogućavaju upravljanje bežičnim uređajima" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" msgstr "" -"Potvrda prijave na mrežu\n" -"\n" -"Želite da se prijavite na mrežu „%s“. Ako ste sigurni da je ova bežična mreža bezbedna, obeležite kućicu ispod i Upravnik mreže vam više neće postavljati suvišna pitanja pri prijavi na ovu mrežu." +"Ovlašćenja sistema onemogućavaju upravljanje mobilnim širokopojasnim uređajima" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +msgid "System policy prevents enabling or disabling system networking" +msgstr "Ovlašćenja sistema onemogućavaju upravljanje mrežom na sistemu" -#: gnome/applet/applet.glade.h:21 -msgid "Always Trust this Wireless Network" -msgstr "Uvek pokloni poverenje bežičnoj mreži" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "Ovlašćenja sistema onemogućavaju uspavljivanje Upravnika mrežom" -#: gnome/applet/applet.glade.h:22 -msgid "C_onnect" -msgstr "P_oveži se" +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +msgid "System policy prevents use of user-specific connections" +msgstr "Ovlašćenja sistema onemogućavaju upotrebu korisnikovih veza" -#: gnome/applet/applet.glade.h:23 -msgid "Connect with encryption enabled" -msgstr "Poveži se i uključi šifrovanje" +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "greška u obradi netlink poruke: %s" -#: gnome/applet/applet.glade.h:24 -msgid "Don't remind me again" -msgstr "Ne podsećaj me više" +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "greška prilikom čekanja podataka na utičnici" -#: gnome/applet/applet.glade.h:25 -msgid "Key Type:" -msgstr "Vrsta ključa:" +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "ne mogu da se povežem na netlink radi praćenja stanja veze: %s" -#: gnome/applet/applet.glade.h:26 -msgid "Key type:" -msgstr "Vrsta ključa:" +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "ne mogu da uključim netlink sigurnosni prolaz: %s" -#: gnome/applet/applet.glade.h:28 -msgid "Wireless Network Key Required" -msgstr "Potreban je ključ za bežičnu mrežu" +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "ne mogu da rezervišem netlink za praćenje stanja veze: %s" -#: gnome/applet/applet.glade.h:29 -msgid "Wireless _adapter:" -msgstr "Bežični _uređaj:" +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "ne mogu da rezervišem netlink ostavu radi praćenja stanja veze: %s" -#: gnome/applet/applet.glade.h:30 -msgid "Wireless _network:" -msgstr "Bežična _mreža:" +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "ne mogu da se priključin netlink grupi: %s" -#: gnome/applet/applet.glade.h:31 -msgid "_Login to Network" -msgstr "_Umreži se" +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "greška pri osvežavanju ostave sa vezama: %s" -#: gnome/applet/applet.glade.h:32 -msgid "_OK" -msgstr "_U redu" +#: ../src/main.c:499 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "Neispravna opcija. Unesite „--help“ za spisak svih opcija.\n" -#: src/nm-netlink-monitor.c:154 +#: ../src/main.c:570 #, c-format -msgid "" -"unable to create netlink socket for monitoring wired ethernet devices - %s" -msgstr "Nije moguće napraviti utičnicu za posmatranje žičanog mrežnog uređaja - %s" +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. Pokrenite sa --help za spisak dostupnih opcija.\n" -#: src/nm-netlink-monitor.c:172 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:328 +msgid "# Created by NetworkManager\n" +msgstr "# Napravio NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:344 #, c-format msgid "" -"unable to bind to netlink socket for monitoring wired ethernet devices - %s" -msgstr "Nije moguće povezati se na utičnicu za posmatranje žičanog mrežnog uređaja - %s" +"# Merged from %s\n" +"\n" +msgstr "" +"# Spojeno sa %s\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 +msgid "no usable DHCP client could be found." +msgstr "ne mogu da nađem DHCP program." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 +msgid "'dhclient' could be found." +msgstr "Ne mogu da nađem „dhclient“." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 +msgid "'dhcpcd' could be found." +msgstr "Ne mogu da nađem „dhcpcd“." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "nepodržan DHCP klijent „%s“" -#: src/nm-netlink-monitor.c:404 -msgid "operation took too long" -msgstr "Potraga je predugo trajala" +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "„%s“ nije podržan nivo zapisa dnevnika" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "„%s“ je nepoznat domen dnevnika" -#: src/nm-netlink-monitor.c:501 -msgid "received data from wrong type of sender" -msgstr "Primljeni su podaci pogrešnog tipa od pošiljaoca" +#: ../src/dns-manager/nm-dns-manager.c:384 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "PRIMEDBA: libc razrešavanje ne podržava više od 3 servera imena." -#: src/nm-netlink-monitor.c:514 -msgid "received data from unexpected sender" -msgstr "Primljeni su podaci od neočekivanog pošiljaoca" +#: ../src/dns-manager/nm-dns-manager.c:386 +msgid "The nameservers listed below may not be recognized." +msgstr "Sledeći serveri imena možda nisu prepoznati." -#: src/nm-netlink-monitor.c:536 +#: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format -msgid "%s" -msgstr "%s" +msgid "Auto %s" +msgstr "Auto %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3412 +#: ../system-settings/plugins/ifnet/connection_parser.c:49 +msgid "System" +msgstr "Sistem" + +#~ msgid "Orientation" +#~ msgstr "Usmerenje" + +# Potreban je bolji prevod za ovo +#~ msgid "The orientation of the tray." +#~ msgstr "Usmerenje obaveštajne zone." + +#~ msgid "" +#~ "The requested wireless network '%s' does not appear to be in range. A " +#~ "different wireless network will be used if any are available." +#~ msgstr "" +#~ "Tražena bežična mreža „%s“ nije u dometu. Biće korišćena druga bežična " +#~ "mreža ako je raspoloživa." + +#~ msgid "Connection to the wireless network '%s' failed.\n" +#~ msgstr "Neuspela veza sa bežičnom mrežom „%s“.\n" + +#~ msgid "Copyright (C) 2004-2005 Red Hat, Inc." +#~ msgstr "Copyright (C) 2004-2005 Red Hat, Inc." + +#~ msgid "" +#~ "Notification area applet for managing your network devices and " +#~ "connections." +#~ msgstr "Aplet za obaveštajnu zonu za upravljanje mrežnim uređajima i vezama." + +#~ msgid "" +#~ "VPN Login Failure\n" +#~ "\n" +#~ "Could not start the VPN connection '%s' due to a login failure.\n" +#~ "\n" +#~ "The VPN service said: \"%s\"" +#~ msgstr "" +#~ "Prijava na VPN nije uspela\n" +#~ "\n" +#~ "VPN veza sa mrežom „%s“ nije ostvarena jer prijava nije uspela.\n" +#~ "\n" +#~ "Poruka VPN servisa je bila : „%s“" + +#~ msgid "" +#~ "VPN Login Message\n" +#~ "\n" +#~ "VPN connection '%s' said:\n" +#~ "\n" +#~ "\"%s\"" +#~ msgstr "" +#~ "Poruka pri prijavi na VPN\n" +#~ "\n" +#~ "Poruka VPN veze „%s“ je:\n" +#~ "\n" +#~ "„%s“" + +#~ msgid "" +#~ "The NetworkManager Applet could not find some required resources (the " +#~ "glade file was not found)." +#~ msgstr "" +#~ "Aplet Upravnik mreže nije mogao da pronađe neke od potrebnih resursa " +#~ "(glejd datoteka nije pronađena)." + +#~ msgid "The network device \"%s (%s)\" does not support wireless scanning." +#~ msgstr "Mrežni uređaj „%s (%s)“ ne podržava potragu za bežičnim mrežama." + +#~ msgid "The network device \"%s (%s)\" does not support link detection." +#~ msgstr "Mrežni uređaj „%s (%s)“ ne podržava otkrivanje veze." + +#~ msgid "Preparing device %s for the wired network..." +#~ msgstr "Priprema uređaja %s za žičanu mrežu..." + +#~ msgid "Preparing device %s for the wireless network '%s'..." +#~ msgstr "Priprema uređaja %s za bežičnu mrežu „%s“..." + +#~ msgid "Configuring device %s for the wired network..." +#~ msgstr "Podešavanje uređaja %s za bežičnu mrežu..." + +#~ msgid "Attempting to join the wireless network '%s'..." +#~ msgstr "Pokušaj pristupa bežičnoj mreži „%s“..." + +#~ msgid "Waiting for Network Key for the wireless network '%s'..." +#~ msgstr "Čekanje na mrežni ključ za bežičnu mrežu „%s“..." + +#~ msgid "Requesting a network address from the wired network..." +#~ msgstr "Potraživanje mrežne adrese za žičanu mrežu..." + +#~ msgid "Requesting a network address from the wireless network '%s'..." +#~ msgstr "Potraživanje mrežne adrese za bežičnu mrežu „%s“..." + +#~ msgid "Finishing connection to the wired network..." +#~ msgstr "Obustavljanje veze sa žičanom mrežom..." + +#~ msgid "Finishing connection to the wireless network '%s'..." +#~ msgstr "Obustavljanje veze sa bežičnom mrežom „%s“..." + +#~ msgid "NetworkManager is not running" +#~ msgstr "Upravljač mreže nije pokrenut" + +#~ msgid "Wired network connection" +#~ msgstr "Žična mrežna veza" + +# FIXME Ad-hok +#~ msgid "Connected to an Ad-Hoc wireless network" +#~ msgstr "Povezan sa ad-hok bežičnom mrežom" + +#~ msgid "Wireless network connection to '%s' (%d%%)" +#~ msgstr "Bežična mrežna veza sa „%s“ (%d%%)" + +#~ msgid "Other Wireless Networks..." +#~ msgstr "Ostale bežične mreže..." + +#~ msgid "Create new Wireless Network..." +#~ msgstr "Napravi novu bežičnu mrežu..." + +#~ msgid "No network devices have been found" +#~ msgstr "Nije pronađen nijedan mrežni uređaj" + +#~ msgid "NetworkManager is not running..." +#~ msgstr "Upravljač mrežom nije pokrenut..." + +#~ msgid "Pause Wireless Scanning" +#~ msgstr "Obustavi traženje bežične mreže" + +#~ msgid "Resume Wireless Scanning" +#~ msgstr "Nastavi traženje bežične mreže" + +#~ msgid "Stop All Wireless Devices" +#~ msgstr "Zaustavi sve bežične uređaje" -#: src/nm-netlink-monitor.c:645 -msgid "too much data was sent over socket and some of it was lost" -msgstr "Suviše podataka je poslato kroz utičnicu i nešto od njih je izgubljeno" +#~ msgid "Start All Wireless Devices" +#~ msgstr "Pokreni sve bežične uređaje" + +#~ msgid "Help" +#~ msgstr "Pomoć" + +#~ msgid "About" +#~ msgstr "O programu" + +#~ msgid "" +#~ "The NetworkManager applet could not find some required resources. It " +#~ "cannot continue.\n" +#~ msgstr "" +#~ "Upravljač mrežom nije uspeo da pronađe neophodne resurse i ne može da " +#~ "nastavi rad.\n" + +#~ msgid "progress bar label|%d %%" +#~ msgstr "%d %%" + +#~ msgid "Wired Network (%s)" +#~ msgstr "Žičana mreža (%s)" + +#~ msgid "Wired Network" +#~ msgstr "Žičana mreža" + +#~ msgid "Wireless Network (%s)" +#~ msgid_plural "Wireless Networks (%s)" +#~ msgstr[0] "Bežična mreža (%s)" +#~ msgstr[1] "Bežične mreže (%s)" +#~ msgstr[2] "Bežičnih mreža (%s)" + +#~ msgid "Wireless Network" +#~ msgid_plural "Wireless Networks" +#~ msgstr[0] "Bežična mreža" +#~ msgstr[1] "Bežične mreže" +#~ msgstr[2] "Bežične mreže" + +#~ msgid " (invalid Unicode)" +#~ msgstr " (neispravan Unikod)" + +#~ msgid "Passphrase:" +#~ msgstr "Lozinka:" + +#~ msgid "Ascii Key:" +#~ msgstr "ASKRI ključ:" + +#~ msgid "Hex Key:" +#~ msgstr "Heksa ključ:" + +#~ msgid "Create new wireless network" +#~ msgstr "Napravi novu bežičnu mrežu" + +#~ msgid "" +#~ "Enter the ESSID and security settings of the wireless network you wish to " +#~ "create." +#~ msgstr "" +#~ "Unesite ESSID i bezbednosne postavke bežične mreže koju želite da " +#~ "načinite." + +#~ msgid "Custom wireless network" +#~ msgstr "Korisnička bežična mreža" + +#~ msgid "" +#~ "Enter the ESSID of the wireless network to which you wish to connect." +#~ msgstr "Unesite ESSID bežične mreže sa kojom želite da se povežete." + +#~ msgid "You must log in to access the Virtual Private Network '%s'." +#~ msgstr "" +#~ "Morate biti prijavljeni kako biste koristili virtuelnu privatnu mrežu „%s“." + +#~ msgid " " +#~ msgstr " " + +#~ msgid "*" +#~ msgstr "*" + +#~ msgid "" +#~ "128-bit Passphrase (WEP)\n" +#~ "Ascii Key (WEP)\n" +#~ "Hex Key (WEP)" +#~ msgstr "" +#~ "128-bitni ključ (WEP)\n" +#~ "ASKRI ključ (WEP)\n" +#~ "Heks ključ (WEP)" + +#~ msgid "" +#~ "128-bit passphrase (WEP)\n" +#~ "Ascii key (WEP)\n" +#~ "Hex key (WEP)" +#~ msgstr "" +#~ "128-bitni ključ (WEP)\n" +#~ "ASKRI ključ (WEP)\n" +#~ "Heks ključ (WEP)" + +#~ msgid "" +#~ "Passphrase Required by Wireless " +#~ "Network\n" +#~ "\n" +#~ "A passphrase or encryption key is required to access the wireless network " +#~ "'%s'." +#~ msgstr "" +#~ "Bežična mreža zahteva lozinku\n" +#~ "\n" +#~ " Lozinka ili ključ za šifrovanje su neophodni za pristup bežičnoj mreži " +#~ "„%s“." + +#~ msgid "" +#~ "Reduced Network Functionality\n" +#~ "\n" +#~ "%s It will not be completely functional." +#~ msgstr "" +#~ "Smanjena upotrebna vrednost mreže\n" +#~ "\n" +#~ "%s neće biti sasvim upotrebljiva." + +#~ msgid "" +#~ "Wireless Network Login " +#~ "Confirmation\n" +#~ "\n" +#~ "You have chosen log in to the wireless network '%s'. If you are sure " +#~ "this wireless network is secure, click the checkbox below and " +#~ "NetworkManager will no longer pester you with stupid questions when you " +#~ "connect to it." +#~ msgstr "" +#~ "Potvrda prijave na mrežu\n" +#~ "\n" +#~ "Želite da se prijavite na mrežu „%s“. Ako ste sigurni da je ova bežična " +#~ "mreža bezbedna, obeležite kućicu ispod i Upravnik mreže vam više neće " +#~ "postavljati suvišna pitanja pri prijavi na ovu mrežu." + +#~ msgid "Always Trust this Wireless Network" +#~ msgstr "Uvek pokloni poverenje bežičnoj mreži" + +#~ msgid "Connect with encryption enabled" +#~ msgstr "Poveži se i uključi šifrovanje" + +#~ msgid "Don't remind me again" +#~ msgstr "Ne podsećaj me više" + +#~ msgid "Key Type:" +#~ msgstr "Vrsta ključa:" + +#~ msgid "Key type:" +#~ msgstr "Vrsta ključa:" + +#~ msgid "Wireless Network Key Required" +#~ msgstr "Potreban je ključ za bežičnu mrežu" + +#~ msgid "Wireless _adapter:" +#~ msgstr "Bežični _uređaj:" + +#~ msgid "Wireless _network:" +#~ msgstr "Bežična _mreža:" + +#~ msgid "_Login to Network" +#~ msgstr "_Umreži se" + +#~ msgid "_OK" +#~ msgstr "_U redu" + +#~ msgid "operation took too long" +#~ msgstr "Potraga je predugo trajala" + +#~ msgid "received data from wrong type of sender" +#~ msgstr "Primljeni su podaci pogrešnog tipa od pošiljaoca" + +#~ msgid "received data from unexpected sender" +#~ msgstr "Primljeni su podaci od neočekivanog pošiljaoca" + +#~ msgid "%s" +#~ msgstr "%s" + +#~ msgid "too much data was sent over socket and some of it was lost" +#~ msgstr "" +#~ "Suviše podataka je poslato kroz utičnicu i nešto od njih je izgubljeno" -- cgit v1.2.1 From 92aae19b67bc2f33d8df1ebdf364313f974211a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Machat?= Date: Tue, 19 Oct 2010 11:21:40 -0500 Subject: po: updated Czech translation (bgo #632329) --- po/cs.po | 1594 +++++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 1065 insertions(+), 529 deletions(-) diff --git a/po/cs.po b/po/cs.po index 4c59825e84..ccea6bdbe0 100644 --- a/po/cs.po +++ b/po/cs.po @@ -1,26 +1,101 @@ # Czech translation of NetworkManager. -# Copyright (C) 2004, 2005, 2006, 2008 the author(s) of NetworkManager. +# Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 the author(s) of NetworkManager. # Copyright (C) 2004, 2005, 2006 Miloslav Trmac . # This file is distributed under the same license as the NetworkManager package. -# Miloslav Trmac , 2004 - 2006. +# Miloslav Trmac , 2004, 2005, 2006. # Jakub Friedl , 2006. # Jiří Eischmann , 2008. # Marek Černocký , 2010. +# Vladimír Machat , 2010. msgid "" msgstr "" "Project-Id-Version: NetworkManager\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "product=NetworkManager&component=general\n" -"POT-Creation-Date: 2010-04-09 03:24+0000\n" -"PO-Revision-Date: 2010-04-23 13:02+0200\n" -"Last-Translator: Marek Černocký \n" +"POT-Creation-Date: 2010-09-22 03:25+0000\n" +"PO-Revision-Date: 2010-10-10 13:00+0100\n" +"Last-Translator: Vladimír Machat \n" "Language-Team: Czech \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==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" -#: ../cli/src/connections.c:86 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/devices.c:88 ../cli/src/devices.c:101 ../cli/src/devices.c:111 +#: ../cli/src/devices.c:121 ../cli/src/devices.c:134 ../cli/src/devices.c:145 +#: ../cli/src/devices.c:156 ../cli/src/devices.c:165 ../cli/src/devices.c:174 +msgid "NAME" +msgstr "NÁZEV" + +#. 0 +#: ../cli/src/connections.c:61 ../cli/src/connections.c:76 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:62 +msgid "DEVICES" +msgstr "ZAŘÍZENÍ" + +#. 2 +#: ../cli/src/connections.c:63 ../cli/src/connections.c:78 +msgid "SCOPE" +msgstr "ROZSAH" + +#. 3 +#: ../cli/src/connections.c:64 +msgid "DEFAULT" +msgstr "VÝCHOZÍ" + +#. 4 +#: ../cli/src/connections.c:65 +msgid "DBUS-SERVICE" +msgstr "SLUŽBA-DBUS" + +#. 5 +#: ../cli/src/connections.c:66 +msgid "SPEC-OBJECT" +msgstr "OBJEKT-SPEC" + +#. 6 +#: ../cli/src/connections.c:67 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:77 ../cli/src/devices.c:62 ../cli/src/devices.c:90 +msgid "TYPE" +msgstr "TYP" + +#. 3 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP" +msgstr "ČASOVÉ-RAZÍTKO" + +#. 4 +#: ../cli/src/connections.c:80 +msgid "TIMESTAMP-REAL" +msgstr "ČASOVÉ-RAZÍTKO-REÁLNÉ" + +#. 5 +#: ../cli/src/connections.c:81 +msgid "AUTOCONNECT" +msgstr "AUTOMATICKY-PŘIPOJIT" + +#. 6 +#: ../cli/src/connections.c:82 +msgid "READONLY" +msgstr "JEN-KE-ČTENÍ" + +#. 7 +#: ../cli/src/connections.c:83 +msgid "DBUS-PATH" +msgstr "CESTA-DBUS" + +#: ../cli/src/connections.c:159 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -41,310 +116,524 @@ msgstr "" "timeout <časový_limit>]\n" " down id | uuid \n" -#: ../cli/src/connections.c:158 -msgid "Connections" -msgstr "Připojení" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/devices.c:298 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "Type" -msgstr "Typ" - -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "UUID" -msgstr "UUID" +#: ../cli/src/connections.c:199 ../cli/src/connections.c:540 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Chyba: „con list“: %s" + +#: ../cli/src/connections.c:201 ../cli/src/connections.c:542 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Chyba: „con status“: %s; povolená pole: %s" + +#: ../cli/src/connections.c:209 +msgid "Connection details" +msgstr "Detaily připojení" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:605 +msgid "system" +msgstr "systém" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:605 +msgid "user" +msgstr "uživatel" + +#: ../cli/src/connections.c:386 +msgid "never" +msgstr "nikdy" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:387 ../cli/src/connections.c:388 +#: ../cli/src/connections.c:606 ../cli/src/connections.c:609 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:551 ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 +msgid "yes" +msgstr "ano" -#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 -#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 -#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Name" -msgstr "Název" +#: ../cli/src/connections.c:387 ../cli/src/connections.c:388 +#: ../cli/src/connections.c:606 ../cli/src/connections.c:609 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:510 ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 ../cli/src/settings.c:1224 +msgid "no" +msgstr "ne" -#: ../cli/src/connections.c:163 -#, c-format -msgid "System connections:\n" -msgstr "Systémová připojení:\n" +#: ../cli/src/connections.c:461 ../cli/src/connections.c:504 +msgid "System connections" +msgstr "Systémové připojení" -#: ../cli/src/connections.c:167 -#, c-format -msgid "User connections:\n" -msgstr "Uživatelská připojení:\n" +#: ../cli/src/connections.c:466 ../cli/src/connections.c:517 +msgid "User connections" +msgstr "Uživatelské připojení" -#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 -#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 -#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 -#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 -#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 +#: ../cli/src/connections.c:478 ../cli/src/connections.c:1338 +#: ../cli/src/connections.c:1354 ../cli/src/connections.c:1363 +#: ../cli/src/connections.c:1374 ../cli/src/connections.c:1459 +#: ../cli/src/devices.c:962 ../cli/src/devices.c:972 ../cli/src/devices.c:1074 +#: ../cli/src/devices.c:1081 #, c-format msgid "Error: %s argument is missing." msgstr "Chyba: schází argument %s." -#: ../cli/src/connections.c:189 +#: ../cli/src/connections.c:491 #, c-format msgid "Error: %s - no such connection." msgstr "Chyba: %s - takové připojení neexistuje." -#: ../cli/src/connections.c:196 -msgid "System-wide connections" -msgstr "Připojení v rámci systému" - -#: ../cli/src/connections.c:205 -msgid "User connections" -msgstr "Uživatelská připojení" - -#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 -#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 -#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 -#: ../cli/src/devices.c:798 +#: ../cli/src/connections.c:523 ../cli/src/connections.c:1387 +#: ../cli/src/connections.c:1477 ../cli/src/devices.c:785 +#: ../cli/src/devices.c:852 ../cli/src/devices.c:986 ../cli/src/devices.c:1087 #, c-format msgid "Unknown parameter: %s\n" msgstr "Neznámý parametr: %s\n" -#: ../cli/src/connections.c:221 +#: ../cli/src/connections.c:532 #, c-format msgid "Error: no valid parameter specified." msgstr "Chyba: nezadán žádný platný parametr." -#. FIXME: Fix the output -#: ../cli/src/connections.c:268 ../cli/src/devices.c:302 -#: ../cli/src/devices.c:321 ../cli/src/devices.c:353 ../cli/src/devices.c:355 -#: ../cli/src/devices.c:357 ../cli/src/devices.c:359 ../cli/src/devices.c:361 -msgid "yes" -msgstr "ano" +#: ../cli/src/connections.c:547 ../cli/src/connections.c:1580 +#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:359 +#, c-format +msgid "Error: %s." +msgstr "Chyba: %s." -#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 -msgid "no" -msgstr "ne" +#: ../cli/src/connections.c:653 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Chyba: „con status“: %s" -#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:655 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Chyba: „con status“: %s; povolená pole: %s" + +#: ../cli/src/connections.c:662 msgid "Active connections" msgstr "Aktivní připojení" -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 -msgid "Default" -msgstr "Výchozí" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Service" -msgstr "Služba" - -#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 -msgid "Devices" -msgstr "Zařízení" - -#: ../cli/src/connections.c:659 +#: ../cli/src/connections.c:1030 #, c-format msgid "no active connection on device '%s'" msgstr "žádné aktivní připojení nebo zařízení „%s“" -#: ../cli/src/connections.c:667 +#: ../cli/src/connections.c:1038 #, c-format msgid "no active connection or device" msgstr "žádné aktivní připojení nebo zařízení" -#: ../cli/src/connections.c:730 +#: ../cli/src/connections.c:1088 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "zařízení „%s“ není kompatibilní s připojením „%s“" + +#: ../cli/src/connections.c:1090 +#, c-format +msgid "no device found for connection '%s'" +msgstr "pro připojení „%s“ nebylo nalezeno žádné zařízení" + +#: ../cli/src/connections.c:1101 msgid "activating" msgstr "aktivuje se" -#: ../cli/src/connections.c:732 +#: ../cli/src/connections.c:1103 msgid "activated" msgstr "aktivováno" -#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 -#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 -#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 +#: ../cli/src/connections.c:1106 ../cli/src/connections.c:1129 +#: ../cli/src/connections.c:1162 ../cli/src/devices.c:246 +#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:149 ../cli/src/settings.c:473 msgid "unknown" -msgstr "neznámo" +msgstr "neznámé" -#: ../cli/src/connections.c:744 +#: ../cli/src/connections.c:1115 msgid "VPN connecting (prepare)" msgstr "VPN se připojuje (příprava)" -#: ../cli/src/connections.c:746 +#: ../cli/src/connections.c:1117 msgid "VPN connecting (need authentication)" msgstr "VPN se připojuje (požaduje ověření)" -#: ../cli/src/connections.c:748 +#: ../cli/src/connections.c:1119 msgid "VPN connecting" msgstr "VPN se připojuje" -#: ../cli/src/connections.c:750 +#: ../cli/src/connections.c:1121 msgid "VPN connecting (getting IP configuration)" msgstr "VPN se připojuje (získává se nastavení IP)" -#: ../cli/src/connections.c:752 +#: ../cli/src/connections.c:1123 msgid "VPN connected" msgstr "VPN připojena" -#: ../cli/src/connections.c:754 +#: ../cli/src/connections.c:1125 msgid "VPN connection failed" msgstr "VPN se nezdařilo připojit" -#: ../cli/src/connections.c:756 +#: ../cli/src/connections.c:1127 msgid "VPN disconnected" msgstr "VPN odpojena" -#: ../cli/src/connections.c:767 +#: ../cli/src/connections.c:1138 msgid "unknown reason" msgstr "neznámý důvod" -#: ../cli/src/connections.c:769 +#: ../cli/src/connections.c:1140 msgid "none" msgstr "žádný" -#: ../cli/src/connections.c:771 +#: ../cli/src/connections.c:1142 msgid "the user was disconnected" msgstr "uživatel byl odpojen" -#: ../cli/src/connections.c:773 +#: ../cli/src/connections.c:1144 msgid "the base network connection was interrupted" msgstr "základní síťové připojení bylo přerušeno" -#: ../cli/src/connections.c:775 +#: ../cli/src/connections.c:1146 msgid "the VPN service stopped unexpectedly" msgstr "služba VPN neočekávaně zastavena" -#: ../cli/src/connections.c:777 +#: ../cli/src/connections.c:1148 msgid "the VPN service returned invalid configuration" msgstr "služba VPN vrátila neplatné nastavení" -#: ../cli/src/connections.c:779 +#: ../cli/src/connections.c:1150 msgid "the connection attempt timed out" msgstr "pokusu o připojení vypršel časový limit" -#: ../cli/src/connections.c:781 +#: ../cli/src/connections.c:1152 msgid "the VPN service did not start in time" msgstr "služba VPN se nespustila v časovém limitu" -#: ../cli/src/connections.c:783 +#: ../cli/src/connections.c:1154 msgid "the VPN service failed to start" msgstr "službu VPN se nezdařilo spustit" -#: ../cli/src/connections.c:785 +#: ../cli/src/connections.c:1156 msgid "no valid VPN secrets" msgstr "žádná platná utajení VPN" -#: ../cli/src/connections.c:787 +#: ../cli/src/connections.c:1158 msgid "invalid VPN secrets" msgstr "neplatná utajení VPN" -#: ../cli/src/connections.c:789 +#: ../cli/src/connections.c:1160 msgid "the connection was removed" msgstr "připojení odstraněno" -#: ../cli/src/connections.c:803 +#: ../cli/src/connections.c:1174 #, c-format msgid "state: %s\n" msgstr "stav: %s\n" -#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#: ../cli/src/connections.c:1177 ../cli/src/connections.c:1203 #, c-format msgid "Connection activated\n" msgstr "Připojení aktivováno\n" -#: ../cli/src/connections.c:809 +#: ../cli/src/connections.c:1180 #, c-format msgid "Error: Connection activation failed." msgstr "Chyba: Selhala aktivace připojení." -#: ../cli/src/connections.c:828 +#: ../cli/src/connections.c:1199 #, c-format msgid "state: %s (%d)\n" msgstr "stav: %s (%d)\n" -#: ../cli/src/connections.c:838 +#: ../cli/src/connections.c:1209 #, c-format msgid "Error: Connection activation failed: %s." msgstr "Chyba: Selhala aktivace připojení: %s" -#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#: ../cli/src/connections.c:1226 ../cli/src/devices.c:909 #, c-format msgid "Error: Timeout %d sec expired." msgstr "Chyba: Časový limit %d sekund vypršel." -#: ../cli/src/connections.c:898 +#: ../cli/src/connections.c:1269 #, c-format msgid "Error: Connection activation failed: %s" msgstr "Chyba: Selhala aktivace připojení: %s" -#: ../cli/src/connections.c:912 +#: ../cli/src/connections.c:1283 #, c-format msgid "Error: Obtaining active connection for '%s' failed." msgstr "Chyba: Získání aktivního připojení pro „%s“ selhalo." -#: ../cli/src/connections.c:921 +#: ../cli/src/connections.c:1292 #, c-format msgid "Active connection state: %s\n" msgstr "Stav aktivního připojení: %s\n" -#: ../cli/src/connections.c:922 +#: ../cli/src/connections.c:1293 #, c-format msgid "Active connection path: %s\n" msgstr "Cesta aktivního připojení: %s\n" -#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#: ../cli/src/connections.c:1347 ../cli/src/connections.c:1468 #, c-format msgid "Error: Unknown connection: %s." msgstr "Chyba: Neznámé připojení: %s." -#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#: ../cli/src/connections.c:1382 ../cli/src/devices.c:980 #, c-format msgid "Error: timeout value '%s' is not valid." msgstr "Chyba: hodnota časového limitu „%s“ není platná." -#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:1395 ../cli/src/connections.c:1485 #, c-format msgid "Error: id or uuid has to be specified." msgstr "Chyba: nebylo určeno id nebo uuid." -#: ../cli/src/connections.c:1044 +#: ../cli/src/connections.c:1415 #, c-format msgid "Error: No suitable device found: %s." msgstr "Chyba: Nenalezeno vhodné zařízení: %s." -#: ../cli/src/connections.c:1046 +#: ../cli/src/connections.c:1417 #, c-format msgid "Error: No suitable device found." msgstr "Chyba: Nenalezeno vhodné zařízení." -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1512 #, c-format msgid "Warning: Connection not active\n" msgstr "Varování: Připojení není aktivní\n" -#: ../cli/src/connections.c:1189 +#: ../cli/src/connections.c:1569 #, c-format msgid "Error: 'con' command '%s' is not valid." msgstr "Chyba: příkaz „%s“ není pro „con“ platný." -#: ../cli/src/connections.c:1216 +#: ../cli/src/connections.c:1605 #, c-format msgid "Error: could not connect to D-Bus." msgstr "Chyba: nelze se připojit ke sběrnici D-Bus." -#: ../cli/src/connections.c:1223 +#: ../cli/src/connections.c:1612 #, c-format msgid "Error: Could not get system settings." msgstr "Chyba: Nelze získat systémová nastavení." -#: ../cli/src/connections.c:1231 +#: ../cli/src/connections.c:1620 #, c-format msgid "Error: Could not get user settings." msgstr "Chyba: Nelze získat uživatelská nastavení." -#: ../cli/src/connections.c:1241 +#: ../cli/src/connections.c:1630 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "Chyba: Nelze získat připojení: služba správy nastavení neběží." +#. 0 +#. 9 +#: ../cli/src/devices.c:61 ../cli/src/devices.c:89 ../cli/src/devices.c:184 +msgid "DEVICE" +msgstr "ZAŘÍZENÍ" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:63 ../cli/src/devices.c:93 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STAV" + +#: ../cli/src/devices.c:72 +msgid "GENERAL" +msgstr "OBECNÉ" + +#. 0 #: ../cli/src/devices.c:73 +msgid "CAPABILITIES" +msgstr "SCHOPNOSTI" + +#. 1 +#: ../cli/src/devices.c:74 +msgid "WIFI-PROPERTIES" +msgstr "VLASTNOSTI-WIFI" + +#. 2 +#: ../cli/src/devices.c:75 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:76 +msgid "WIRED-PROPERTIES" +msgstr "DRÁTOVÉ-VLASTNOSTI" + +#. 4 +#: ../cli/src/devices.c:77 +msgid "IP4-SETTINGS" +msgstr "NASTAVENÍ-IP4" + +#. 5 +#: ../cli/src/devices.c:78 +msgid "IP4-DNS" +msgstr "DNS-IP4" + +#. 6 +#: ../cli/src/devices.c:79 +msgid "IP6-SETTINGS" +msgstr "NASTAVENÍ-IP6" + +#. 7 +#: ../cli/src/devices.c:80 +msgid "IP6-DNS" +msgstr "DNS-IP6" + +#. 2 +#: ../cli/src/devices.c:91 +msgid "DRIVER" +msgstr "OVLADAČ" + +#. 3 +#: ../cli/src/devices.c:92 +msgid "HWADDR" +msgstr "HWADRESA" + +#. 0 +#: ../cli/src/devices.c:102 +msgid "CARRIER-DETECT" +msgstr "DETEKCE-SIGNÁLU" + +#. 1 +#: ../cli/src/devices.c:103 +msgid "SPEED" +msgstr "RYCHLOST" + +#. 0 +#: ../cli/src/devices.c:112 +msgid "CARRIER" +msgstr "SIGNÁL" + +#. 0 +#: ../cli/src/devices.c:122 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:123 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:124 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:125 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:126 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:135 ../cli/src/devices.c:146 +msgid "ADDRESS" +msgstr "ADRESA" + +#. 1 +#: ../cli/src/devices.c:136 ../cli/src/devices.c:147 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:137 ../cli/src/devices.c:148 +msgid "GATEWAY" +msgstr "BRÁNA" + +#. 0 +#: ../cli/src/devices.c:157 ../cli/src/devices.c:166 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:175 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:176 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:177 +msgid "MODE" +msgstr "REŽIM" + +#. 3 +#: ../cli/src/devices.c:178 +msgid "FREQ" +msgstr "FREKV" + +#. 4 +#: ../cli/src/devices.c:179 +msgid "RATE" +msgstr "POMĚR" + +#. 5 +#: ../cli/src/devices.c:180 +msgid "SIGNAL" +msgstr "SIGNÁL" + +#. 6 +#: ../cli/src/devices.c:181 +msgid "SECURITY" +msgstr "BEZPEČNOST" + +#. 7 +#: ../cli/src/devices.c:182 +msgid "WPA-FLAGS" +msgstr "PŘÍZNAKY-WPA" + +#. 8 +#: ../cli/src/devices.c:183 +msgid "RSN-FLAGS" +msgstr "PŘÍZNAKY-RSN" + +#. 10 +#: ../cli/src/devices.c:185 +msgid "ACTIVE" +msgstr "AKTIVNÍ" + +#: ../cli/src/devices.c:208 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -354,7 +643,7 @@ msgid "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout ]\n" -" wifi [list [iface ] | apinfo iface hwaddr ]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" msgstr "" "Použití: nmcli dev {PŘÍKAZ | help}\n" @@ -364,457 +653,389 @@ msgstr "" " status\n" " list [iface ]\n" " disconnect iface [--nowait] [--timeout <časový_limit>]\n" -" wifi [list [iface ] | apinfo iface hwaddr " -"]\n" +" wifi [list [iface ] [hwaddr ]]\n" "\n" -#: ../cli/src/devices.c:93 +#: ../cli/src/devices.c:228 msgid "unmanaged" msgstr "není pod správou" -#: ../cli/src/devices.c:95 +#: ../cli/src/devices.c:230 msgid "unavailable" msgstr "nedostupné" -#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:91 msgid "disconnected" msgstr "odpojeno" -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:234 msgid "connecting (prepare)" msgstr "připojuje se (příprava)" -#: ../cli/src/devices.c:101 +#: ../cli/src/devices.c:236 msgid "connecting (configuring)" msgstr "připojuje se (nastavování)" -#: ../cli/src/devices.c:103 +#: ../cli/src/devices.c:238 msgid "connecting (need authentication)" msgstr "připojuje se (požadováno ověření)" -#: ../cli/src/devices.c:105 +#: ../cli/src/devices.c:240 msgid "connecting (getting IP configuration)" msgstr "připojuje se (získává se nastavení IP)" -#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:89 msgid "connected" msgstr "připojeno" -#: ../cli/src/devices.c:109 +#: ../cli/src/devices.c:244 msgid "connection failed" msgstr "připojení se nezdařilo" -#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +#: ../cli/src/devices.c:267 ../cli/src/devices.c:424 msgid "Unknown" msgstr "Neznámý" -#. print them -#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 -#: ../cli/src/devices.c:879 +#: ../cli/src/devices.c:299 msgid "(none)" msgstr "(nic)" -#: ../cli/src/devices.c:209 +#: ../cli/src/devices.c:324 #, c-format msgid "%s: error converting IP4 address 0x%X" msgstr "%s: chyba převodu adresy IP4 0x%X" -#: ../cli/src/devices.c:238 +#: ../cli/src/devices.c:393 #, c-format -msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" -msgstr "%s, %s, Frekv %d MHz, Rychlost %d Mb/s, Síla sig %d" - -#: ../cli/src/devices.c:239 -msgid "Ad-Hoc" -msgstr "Ad-Hoc" - -#: ../cli/src/devices.c:248 -msgid ", Encrypted: " -msgstr ", Šifrováno: " - -#: ../cli/src/devices.c:253 -msgid " WEP" -msgstr " WEP" +msgid "%u MHz" +msgstr "%u MHz" -#: ../cli/src/devices.c:255 -msgid " WPA" -msgstr " WPA" +#: ../cli/src/devices.c:394 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" -#: ../cli/src/devices.c:257 -msgid " WPA2" -msgstr " WPA2" +#: ../cli/src/devices.c:403 +msgid "Encrypted: " +msgstr "Šifrováno: " -#: ../cli/src/devices.c:260 -msgid " Enterprise" -msgstr " Podnikové" +#: ../cli/src/devices.c:408 +msgid "WEP " +msgstr "WEP " -#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "Device" -msgstr "Zařízení" +#: ../cli/src/devices.c:410 +msgid "WPA " +msgstr "WPA " -#: ../cli/src/devices.c:299 -msgid "Driver" -msgstr "Ovladač" +#: ../cli/src/devices.c:412 +msgid "WPA2 " +msgstr "WPA2 " -#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 -msgid "(unknown)" -msgstr "(neznámo)" +#: ../cli/src/devices.c:415 +msgid "Enterprise " +msgstr "Podnikové " -#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 -msgid "State" -msgstr "Stav" - -#: ../cli/src/devices.c:313 -msgid "HW Address" -msgstr "HW adresa" - -#: ../cli/src/devices.c:319 -#, c-format -msgid "" -"\n" -" Capabilities:\n" -msgstr "" -"\n" -" Schopnosti:\n" +#: ../cli/src/devices.c:424 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" -#: ../cli/src/devices.c:321 -msgid "Carrier Detect" -msgstr "Detekce nosného signálu" +#: ../cli/src/devices.c:424 +msgid "Infrastructure" +msgstr "Infrastruktura" -#: ../cli/src/devices.c:336 +#: ../cli/src/devices.c:486 #, c-format -msgid "%u Mb/s" -msgstr "%u Mb/s" +msgid "Error: 'dev list': %s" +msgstr "Chyba: „dev list“: %s" -#: ../cli/src/devices.c:337 -msgid "Speed" -msgstr "Rychlost" - -#: ../cli/src/devices.c:348 +#: ../cli/src/devices.c:488 #, c-format -msgid "" -"\n" -" Wireless Properties\n" -msgstr "" -"\n" -" Vlastnosti bezdrátové části\n" - -#: ../cli/src/devices.c:353 -msgid "WEP Encryption" -msgstr "Šifrování WEP" - -#: ../cli/src/devices.c:355 -msgid "WPA Encryption" -msgstr "Šifrování WPA" - -#: ../cli/src/devices.c:357 -msgid "WPA2 Encryption" -msgstr "Šifrování WPA2" +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Chyba: „dev list“: %s; povolená pole: %s" -#: ../cli/src/devices.c:359 -msgid "TKIP cipher" -msgstr "Šifra TKIP" +#: ../cli/src/devices.c:497 +msgid "Device details" +msgstr "Detaily zařízení" -#: ../cli/src/devices.c:361 -msgid "CCMP cipher" -msgstr "Šifra CCMP" - -#: ../cli/src/devices.c:368 -#, c-format -msgid "" -"\n" -" Wireless Access Points %s\n" -msgstr "" -"\n" -" Bezdrátový přístupový bod %s\n" +#: ../cli/src/devices.c:527 ../cli/src/devices.c:925 +msgid "(unknown)" +msgstr "(neznámo)" -#: ../cli/src/devices.c:368 -msgid "(* = current AP)" -msgstr "(* = aktuální přístupový bod)" +#: ../cli/src/devices.c:528 +msgid "unknown)" +msgstr "neznámé)" -#: ../cli/src/devices.c:374 +#: ../cli/src/devices.c:554 #, c-format -msgid "" -"\n" -" Wired Properties\n" -msgstr "" -"\n" -" Vlastnosti drátové části\n" - -#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 -msgid "Carrier" -msgstr "Nosný signál" +msgid "%u Mb/s" +msgstr "%u Mb/s" -#: ../cli/src/devices.c:377 +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:627 msgid "on" msgstr "zapnut" -#: ../cli/src/devices.c:379 +#: ../cli/src/devices.c:627 msgid "off" msgstr "vypnut" -#: ../cli/src/devices.c:387 +#: ../cli/src/devices.c:808 #, c-format -msgid "" -"\n" -" IPv4 Settings:\n" -msgstr "" -"\n" -" Nastavení IPv4:\n" - -#: ../cli/src/devices.c:395 -msgid "Address" -msgstr "Adresa" - -#: ../cli/src/devices.c:401 -msgid "Prefix" -msgstr "Předčíslí" +msgid "Error: 'dev status': %s" +msgstr "Chyba: „dev status“: %s" -#: ../cli/src/devices.c:405 -msgid "Gateway" -msgstr "Brána" - -#: ../cli/src/devices.c:416 -msgid "DNS" -msgstr "DNS" +#: ../cli/src/devices.c:810 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Chyba: „dev status“: %s; povolená pole: %s" -#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:817 msgid "Status of devices" msgstr "Stav zařízení" -#: ../cli/src/devices.c:487 +#: ../cli/src/devices.c:845 #, c-format msgid "Error: '%s' argument is missing." msgstr "Chyba: schází argument „%s“." -#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#: ../cli/src/devices.c:874 ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: Device '%s' not found." msgstr "Chyba: Zařízení „%s“ nenalezeno." -#: ../cli/src/devices.c:539 +#: ../cli/src/devices.c:897 #, c-format msgid "Success: Device '%s' successfully disconnected." msgstr "Úspěch: Zařízení „%s“ úspěšně odpojeno." -#: ../cli/src/devices.c:564 +#: ../cli/src/devices.c:922 #, c-format msgid "Error: Device '%s' (%s) disconnecting failed: %s" msgstr "Chyba: Odpojení zařízení „%s“ (%s) selhalo: %s" -#: ../cli/src/devices.c:572 +#: ../cli/src/devices.c:930 #, c-format msgid "Device state: %d (%s)\n" msgstr "Stav zařízení: %d (%s)\n" -#: ../cli/src/devices.c:636 +#: ../cli/src/devices.c:994 #, c-format msgid "Error: iface has to be specified." msgstr "Chyba: nebylo určeno rozhraní." -#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 -msgid "WiFi scan list" -msgstr "Seznam prohledání WiFi" - -#: ../cli/src/devices.c:740 +#: ../cli/src/devices.c:1112 #, c-format -msgid "Error: Device '%s' is not a WiFi device." -msgstr "Chyba: Zařízení „%s“ není zařízení WiFi." - -#: ../cli/src/devices.c:754 -msgid "Device:" -msgstr "Zařízení:" +msgid "Error: 'dev wifi': %s" +msgstr "Chyba: „dev wifi“: %s" -#: ../cli/src/devices.c:806 +#: ../cli/src/devices.c:1114 #, c-format -msgid "Error: hwaddr has to be specified." -msgstr "Chyba: musí být určena hardwarová adresa." +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Chyba: „dev wifi“: %s; povolená pole: %s" -#: ../cli/src/devices.c:844 +#: ../cli/src/devices.c:1121 +msgid "WiFi scan list" +msgstr "Seznam prohledání WiFi" + +#: ../cli/src/devices.c:1156 ../cli/src/devices.c:1210 #, c-format msgid "Error: Access point with hwaddr '%s' not found." msgstr "Chyba: Přístupový bod s hardwarovou adresou „%s“ nenalezen." -#: ../cli/src/devices.c:862 +#: ../cli/src/devices.c:1173 #, c-format -msgid "%u MHz" -msgstr "%u MHz" +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Chyba: Zařízení „%s“ není zařízení WiFi." -#: ../cli/src/devices.c:863 +#: ../cli/src/devices.c:1237 #, c-format -msgid "%u MB/s" -msgstr "%u MB/s" - -#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 -msgid "AP parameters" -msgstr "Parametry přístupového bodu" - -#: ../cli/src/devices.c:873 -msgid "SSID:" -msgstr "SSID:" - -#: ../cli/src/devices.c:874 -msgid "BSSID:" -msgstr "BSSID:" - -#: ../cli/src/devices.c:875 -msgid "Frequency:" -msgstr "Kmitočet:" - -#: ../cli/src/devices.c:876 -msgid "Mode:" -msgstr "Režim:" - -#: ../cli/src/devices.c:876 -msgid "Ad-hoc" -msgstr "Ad-hoc" - -#: ../cli/src/devices.c:876 -msgid "Infrastructure" -msgstr "Infrastruktura" - -#: ../cli/src/devices.c:877 -msgid "Maximal bitrate:" -msgstr "Max. přenosová rychlost:" +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Chyba: příkaz „%s“ není pro „dev wifi“ platný." -#: ../cli/src/devices.c:878 -msgid "Strength:" -msgstr "Síla signálu:" +#: ../cli/src/devices.c:1284 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Chyba: příkaz „%s“ není pro „dev“ platný." -#: ../cli/src/devices.c:879 -msgid "Flags:" -msgstr "Příznaky:" +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "BĚŽÍCÍ" -#: ../cli/src/devices.c:879 -msgid "privacy" -msgstr "soukromé" +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "NET-ENABLED" +msgstr "SÍŤ-POVOLENA" -#: ../cli/src/devices.c:880 -msgid "WPA flags:" -msgstr "Příznaky WPA:" +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" -#: ../cli/src/devices.c:881 -msgid "RSN flags:" -msgstr "Příznaky RSN:" +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WIFI" +msgstr "WIFI" -#: ../cli/src/devices.c:907 -#, c-format -msgid "Error: 'dev wifi' command '%s' is not valid." -msgstr "Chyba: příkaz „%s“ není pro „dev wifi“ platný." +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" -#: ../cli/src/devices.c:943 -#, c-format -msgid "Error: 'dev' command '%s' is not valid." -msgstr "Chyba: příkaz „%s“ není pro „dev“ platný." +#. 5 +#: ../cli/src/network-manager.c:41 +msgid "WWAN" +msgstr "WWAN" -#: ../cli/src/network-manager.c:46 +#: ../cli/src/network-manager.c:64 #, c-format msgid "" "Usage: nmcli nm { COMMAND | help }\n" "\n" -" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +" COMMAND := { status | enable | sleep | wifi | wwan }\n" "\n" " status\n" -" sleep\n" -" wakeup\n" +" enable [true|false]\n" +" sleep [true|false]\n" " wifi [on|off]\n" " wwan [on|off]\n" "\n" msgstr "" -"Použití: nmcli nm {PŘÍKAZ | help}\n" +"Použití: nmcli nm { PŘÍKAZ | help}\n" "\n" -" PŘÍKAZ := {status | sleep | wakeup | wifi | wwan}\n" +" PŘÍKAZ := {status | enable | sleep | wifi | wwan}\n" "\n" " status\n" -" sleep\n" -" wakeup\n" +" enable [true|false]\n" +" sleep [true|false]\n" " wifi [on|off]\n" " wwan [on|off]\n" "\n" -#: ../cli/src/network-manager.c:67 +#: ../cli/src/network-manager.c:85 msgid "asleep" msgstr "uspán" -#: ../cli/src/network-manager.c:69 +#: ../cli/src/network-manager.c:87 msgid "connecting" msgstr "připojuje se" -#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 -#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 -#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 -msgid "enabled" -msgstr "povoleno" +#: ../cli/src/network-manager.c:128 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Chyba: „nm status“: %s" -#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 -#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 -#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 -msgid "disabled" -msgstr "zakázáno" +#: ../cli/src/network-manager.c:130 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Chyba: „nm status“: %s; povolená pole: %s" -#: ../cli/src/network-manager.c:102 +#: ../cli/src/network-manager.c:137 msgid "NetworkManager status" msgstr "Stav správce sítě NetworkManager" -#: ../cli/src/network-manager.c:104 -msgid "NM running:" -msgstr "Běh NM:" +#. Print header +#: ../cli/src/network-manager.c:144 ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 ../cli/src/network-manager.c:328 +msgid "enabled" +msgstr "povoleno" + +#: ../cli/src/network-manager.c:144 ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 ../cli/src/network-manager.c:328 +msgid "disabled" +msgstr "zakázáno" -#: ../cli/src/network-manager.c:104 +#: ../cli/src/network-manager.c:152 msgid "running" msgstr "běží" -#: ../cli/src/network-manager.c:104 +#: ../cli/src/network-manager.c:152 msgid "not running" msgstr "neběží" -#: ../cli/src/network-manager.c:105 -msgid "NM state:" -msgstr "Stav NM:" +#: ../cli/src/network-manager.c:175 +#, c-format +msgid "Error: Couldn't connect to system bus: %s" +msgstr "Chyba: Nelze se připojit k systémové sběrnici: %s" + +#: ../cli/src/network-manager.c:186 +#, c-format +msgid "Error: Couldn't create D-Bus object proxy." +msgstr "Chyba: Nelze vytvořit proxy objekt D-Bus." + +#: ../cli/src/network-manager.c:192 +#, c-format +msgid "Error in sleep: %s" +msgstr "Chyba při uspání: %s" -#: ../cli/src/network-manager.c:106 -msgid "NM wireless hardware:" -msgstr "Bezdrátový hardware NM:" +#: ../cli/src/network-manager.c:237 ../cli/src/network-manager.c:286 +#: ../cli/src/network-manager.c:318 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "" +"Chyba: hodnota „%s“ přepínače „--fields“ je zde neplatná; povolená pole: %s" -#. no argument, show current state -#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 -msgid "NM wireless:" -msgstr "Bezdrátové sítě NM:" +#: ../cli/src/network-manager.c:245 +msgid "Networking enabled" +msgstr "Síť povolena" -#: ../cli/src/network-manager.c:108 -msgid "NM WWAN hardware:" -msgstr "Hardware WWAN NM" +#: ../cli/src/network-manager.c:256 +#, c-format +msgid "Error: invalid 'enable' parameter: '%s'; use 'true' or 'false'." +msgstr "Chyba: neplatný parametr „enable“: „%s“; použijte „true“ nebo „false“." + +#: ../cli/src/network-manager.c:265 +#, c-format +msgid "Error: Sleeping status is not exported by NetworkManager." +msgstr "Chyba: Network Manager neexportuje stav uspání." + +#: ../cli/src/network-manager.c:273 +#, c-format +msgid "Error: invalid 'sleep' parameter: '%s'; use 'true' or 'false'." +msgstr "Chyba: neplatný parametr „sleep“: „%s“; použijte „true“ nebo „false“." -#. no argument, show current state -#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 -msgid "NM WWAN:" -msgstr "Sítě WWAN NM:" +#: ../cli/src/network-manager.c:294 +msgid "WiFi enabled" +msgstr "WiFi povoleno" -#: ../cli/src/network-manager.c:150 +#: ../cli/src/network-manager.c:305 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." -msgstr "Chyba: neplatný parametr pro „wifi“: „%s“" +msgstr "Chyba: neplatný parametr pro „wifi“: „%s“." -#: ../cli/src/network-manager.c:167 +#: ../cli/src/network-manager.c:326 +msgid "WWAN enabled" +msgstr "WWAN povoleno" + +#: ../cli/src/network-manager.c:337 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." -msgstr "Chyba: neplatný parametr pro „wwan“: „%s“" +msgstr "Chyba: neplatný parametr pro „wwan“: „%s“." -#: ../cli/src/network-manager.c:178 +#: ../cli/src/network-manager.c:348 #, c-format msgid "Error: 'nm' command '%s' is not valid." msgstr "Chyba: příkaz „%s“ není pro „nm“ platný." -#: ../cli/src/nmcli.c:65 +#: ../cli/src/nmcli.c:69 #, c-format msgid "" "Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" "\n" "OPTIONS\n" -" -t[erse] terse output\n" -" -p[retty] pretty output\n" -" -v[ersion] show program version\n" -" -h[elp] print this help\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" "\n" "OBJECT\n" " nm NetworkManager status\n" @@ -825,46 +1046,181 @@ msgstr "" "Použití: %s [PŘEPÍNAČE] OBJEKT {PŘÍKAZ | help}\n" "\n" "PŘEPÍNAČE\n" -" -t[erse] stručný výpis\n" -" -p[retty] hezký výpis\n" -" -v[ersion] zobrazit verzi programu\n" -" -h[elp] zobrazit tuto nápovědu\n" +" -t[erse] stručný výpis\n" +" -p[retty] hezký výpis\n" +" -m[ode] tabular|multiline režim výstupu\n" +" -f[ields] |all|common specifikace polí výstupu\n" +" -e[scape] yes|no oddělovače sloupců v hodnotách\n" +" -v[ersion] zobrazit verzi programu\n" +" -h[elp] zobrazit tuto nápovědu\n" "\n" "OBJEKT\n" " nm stav NetworkManageru\n" -" con připojení v NetworkManageru\n" +" con připojení NetworkManageru\n" " dev zařízení spravovaná NetworkManagerem\n" "\n" -#: ../cli/src/nmcli.c:106 +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Chyba: Objekt „%s“ je neznámý, zkuste „nmcli help“." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Chyba: Přepínač „--terse“ je specifikován dvakrát." + +#: ../cli/src/nmcli.c:148 #, c-format -msgid "Object '%s' is unknown, try 'nmcli help'." -msgstr "Objekt „%s“ je neznámý, zkuste „nmcli help“." +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Chyba: Přepínač „--terse“ je vzájemně neslučitelný s „--pretty“." -#: ../cli/src/nmcli.c:139 +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Chyba: Přepínač „--pretty“ je specifikován dvakrát." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Chyba: Přepínač „--pretty“ je vzájemně neslučitelný s „--terse“." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Chyba: Chybí argument pro přepínač „%s“." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Chyba: „%s“ je neplatný argument pro přepínač „%s“." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Chyba: pole pro přepínače „%s“ chybí." + +#: ../cli/src/nmcli.c:209 #, c-format msgid "nmcli tool, version %s\n" msgstr "nástroj nmcli, verze %s\n" -#: ../cli/src/nmcli.c:145 +#: ../cli/src/nmcli.c:215 #, c-format -msgid "Option '%s' is unknown, try 'nmcli -help'." -msgstr "Přepínač „%s“ je neznámý, zkuste „nmcli -help“." +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Chyba: Přepínač „%s“ je neznámý, zkuste „nmcli -help“." -#: ../cli/src/nmcli.c:164 +#: ../cli/src/nmcli.c:234 #, c-format msgid "Caught signal %d, shutting down..." msgstr "Zachycen signál %d, vypíná se…" -#: ../cli/src/nmcli.c:189 +#: ../cli/src/nmcli.c:259 #, c-format msgid "Error: Could not connect to NetworkManager." msgstr "Chyba: Nelze se připojit ke správci sítě NetworkManager." -#: ../cli/src/nmcli.c:205 +#: ../cli/src/nmcli.c:275 msgid "Success" msgstr "Úspěch" +#: ../cli/src/settings.c:411 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-klíč)" + +#: ../cli/src/settings.c:413 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128bitové heslo)" + +#: ../cli/src/settings.c:416 +#, c-format +msgid "%d (unknown)" +msgstr "%d (neznámé)" + +#: ../cli/src/settings.c:442 +msgid "0 (unknown)" +msgstr "0 (neznámé)" + +#: ../cli/src/settings.c:448 +msgid "any, " +msgstr "jakékoliv, " + +#: ../cli/src/settings.c:450 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:454 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:456 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:468 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:470 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:554 ../cli/src/settings.c:721 +msgid "auto" +msgstr "automaticky" + +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 +msgid "not set" +msgstr "nenastaveno" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "pole „%s“ musí být samo" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "neplatné pole „%s“" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Přepínač „--terse“ vyžaduje určení „--fields“" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "" +"Přepínač „--terse“ vyžaduje určité hodnoty přepínače „--fields“, ne „%s“" + #: ../libnm-util/crypto.c:120 #, c-format msgid "PEM key file had no end tag '%s'." @@ -932,7 +1288,6 @@ msgstr "Nedostatek paměti pro uložení dat certifikátu." #: ../libnm-util/crypto.c:294 #, c-format -#| msgid "Not enough memory to store PEM file data." msgid "Not enough memory to store file data." msgstr "Nedostatek paměti na uložení dat souboru." @@ -960,13 +1315,11 @@ msgstr "Šifra soukromého klíče „%s“ je neznámá." #: ../libnm-util/crypto.c:391 #, c-format -#| msgid "Not enough memory to store decrypted private key." msgid "Not enough memory to decrypt private key." msgstr "Nedostatek paměti pro dešifrování soukromého klíče." #: ../libnm-util/crypto.c:511 #, c-format -#| msgid "Failed to decrypt the private key: %d." msgid "Unable to determine private key type." msgstr "Nelze určit typ soukromého klíče." @@ -1016,13 +1369,11 @@ msgstr "Selhalo dekódování soukromého klíče: %s / %s." #: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 #, c-format -#| msgid "Failed to decrypt the private key: %d." msgid "Failed to decrypt the private key: unexpected padding length." msgstr "Selhalo dešifrování soukromého klíče: neočekávané zarovnání délky." #: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 #, c-format -#| msgid "Failed to decrypt the private key: %d." msgid "Failed to decrypt the private key." msgstr "Selhalo dešifrování soukromého klíče." @@ -1033,25 +1384,21 @@ msgstr "Nelze alokovat paměť pro šifrování." #: ../libnm-util/crypto_gnutls.c:294 #, c-format -#| msgid "Failed to initialize the decryption cipher context: %s / %s." msgid "Failed to initialize the encryption cipher context: %s / %s." msgstr "Selhala inicializace kontextu šifrovací šifry: %s / %s." #: ../libnm-util/crypto_gnutls.c:303 #, c-format -#| msgid "Failed to set symmetric key for decryption: %s / %s." msgid "Failed to set symmetric key for encryption: %s / %s." msgstr "Selhalo nastavení symetrického klíče pro šifrování: %s / %s." #: ../libnm-util/crypto_gnutls.c:313 #, c-format -#| msgid "Failed to set IV for decryption: %s / %s." msgid "Failed to set IV for encryption: %s / %s." msgstr "Selhalo nastavení IV pro šifrování: %s / %s." #: ../libnm-util/crypto_gnutls.c:322 #, c-format -#| msgid "Failed to decrypt the private key: %s / %s." msgid "Failed to encrypt the data: %s / %s." msgstr "Selhalo šifrování dat: %s / %s." @@ -1072,13 +1419,11 @@ msgstr "Nelze inicializovat dekodér PKCS#12: %s" #: ../libnm-util/crypto_gnutls.c:421 #, c-format -#| msgid "Couldn't decode certificate: %s" msgid "Couldn't decode PKCS#12 file: %s" msgstr "Nelze dekódovat soubor PKCS#12: %s" #: ../libnm-util/crypto_gnutls.c:433 #, c-format -#| msgid "Couldn't decode certificate: %s" msgid "Couldn't verify PKCS#12 file: %s" msgstr "Nelze ověřit soubor PKCS#12: %s" @@ -1124,7 +1469,6 @@ msgstr "Selhalo dešifrování soukromého klíče: %d." #: ../libnm-util/crypto_nss.c:245 #, c-format -#| msgid "Failed to decrypt the private key: %d." msgid "Failed to decrypt the private key: decrypted data too large." msgstr "" "Selhalo dešifrování soukromého klíče: dešifrovaná data jsou příliš velká." @@ -1136,33 +1480,28 @@ msgstr "Selhalo dokončení dešifrování soukromého klíče: %d." #: ../libnm-util/crypto_nss.c:364 #, c-format -#| msgid "Failed to initialize the decryption cipher slot." msgid "Failed to initialize the encryption cipher slot." msgstr "Selhala inicializace slotu šifrovací šifry." #: ../libnm-util/crypto_nss.c:372 #, c-format -#| msgid "Failed to set symmetric key for decryption." msgid "Failed to set symmetric key for encryption." msgstr "Selhalo nastavení symetrického klíče pro šifrování." #: ../libnm-util/crypto_nss.c:380 #, c-format -#| msgid "Failed to set IV for decryption." msgid "Failed to set IV for encryption." msgstr "Selhalo nastavení IV pro šifrování." #: ../libnm-util/crypto_nss.c:388 #, c-format -#| msgid "Failed to initialize the decryption context." msgid "Failed to initialize the encryption context." msgstr "Selhala inicializace kontextu šifrování." #: ../libnm-util/crypto_nss.c:396 #, c-format -#| msgid "Failed to decrypt the private key: %d." msgid "Failed to encrypt: %d." -msgstr "Selhalo šifrování: %d" +msgstr "Selhalo šifrování: %d." #: ../libnm-util/crypto_nss.c:404 #, c-format @@ -1186,102 +1525,185 @@ msgstr "Nelze inicializovat dekodér PKCS#12: %d" #: ../libnm-util/crypto_nss.c:519 #, c-format -#| msgid "Couldn't decode certificate: %d" msgid "Couldn't decode PKCS#12 file: %d" msgstr "Nelze dekódovat soubor PKCS#12: %d" #: ../libnm-util/crypto_nss.c:528 #, c-format -#| msgid "Couldn't decode certificate: %d" msgid "Couldn't verify PKCS#12 file: %d" msgstr "Nelze ověřit soubor PKCS#12: %d" #: ../libnm-util/crypto_nss.c:557 -#| msgid "Could not decode private key." msgid "Could not generate random data." msgstr "Nelze vygenerovat náhodná data." -#: ../libnm-util/nm-utils.c:1818 +#: ../libnm-util/nm-utils.c:1975 #, c-format -#| msgid "Not enough memory to create private key decryption key." msgid "Not enough memory to make encryption key." msgstr "Nedostatek paměti pro vytvoření šifrovacího klíče." -#: ../libnm-util/nm-utils.c:1928 -#| msgid "Not enough memory to store PEM file data." +#: ../libnm-util/nm-utils.c:2085 msgid "Could not allocate memory for PEM file creation." msgstr "Nelze alokovat paměť pro vytvoření souboru PEM." -#: ../libnm-util/nm-utils.c:1940 +#: ../libnm-util/nm-utils.c:2097 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "Nelze alokovat paměť pro zápis IV do souboru PEM." -#: ../libnm-util/nm-utils.c:1952 +#: ../libnm-util/nm-utils.c:2109 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "Nelze alokovat paměť pro zápis šifrovaného klíče do souboru PEM." -#: ../libnm-util/nm-utils.c:1971 +#: ../libnm-util/nm-utils.c:2128 #, c-format -#| msgid "Not enough memory to store PEM file data." msgid "Could not allocate memory for PEM file data." msgstr "Nelze alokovat paměť pro data souboru PEM." -#: ../src/nm-netlink-monitor.c:195 ../src/nm-netlink-monitor.c:463 -#: ../src/nm-netlink-monitor.c:581 -#: ../src/ip6-manager/nm-netlink-listener.c:351 +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Sdílení připojení přes chráněnou síť WiFi" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Sdílení připojení přes otevřenou síť WiFi" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Měnit trvalý systémový název počítače" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Měnit systémová připojení" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Systémová politika zabránila změně systémového nastavení" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "Systémová politika zabránila změně trvalého systémového názvu počítače" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "Systémová politika zabránila sdílení připojení přes chráněnou síť WiFi" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "Systémová politika zabránila sdílení připojení přes otevřenou síť WiFi" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "Povolit ovládání síťových připojení" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "Povolit použití uživatelem specifikovaných připojení" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "Povolit nebo zakázat zařízení WiFi" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "Povolit nebo zakázat mobilní širokopásmová zařízení" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "Povolit nebo zakázat systémovou síť" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 +msgid "" +"Put NetworkManager to sleep or wake it up (should only be used by system " +"power management)" +msgstr "" +"Uspat Network Manager nebo jej probudit (mělo by být používáno pouze " +"systémovou správou napájení)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +msgid "System policy prevents control of network connections" +msgstr "Systémová politika zamezuje ovládání síťových připojení" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "Systémová politika zamezuje povolit nebo zakázat zařízení WiFi" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "" +"Systémová politika zamezuje povolení nebo zakázání mobilních širokopásmových " +"zařízení" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +msgid "System policy prevents enabling or disabling system networking" +msgstr "Systémová politika zamezuje povolit nebo zakázat systémovou síť" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "Systémová politika zamezuje NetworkManager uspat nebo probudit" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +msgid "System policy prevents use of user-specific connections" +msgstr "" +"Systémová politika zamezuje použití uživatelsky specifikovaných připojení" + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 #, c-format msgid "error processing netlink message: %s" msgstr "chyba při zpracování zprávy netlink: %s" -#: ../src/nm-netlink-monitor.c:259 -#, c-format -msgid "unable to allocate netlink handle for monitoring link status: %s" -msgstr "nelze alokovat ovládání netlinku pro sledování stavu spojení: %s" +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "vyskytla se chyba při čekání na data ze soketu" -#: ../src/nm-netlink-monitor.c:269 +#: ../src/nm-netlink-monitor.c:254 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "nelze se připojit k netlinku pro sledování stavu spojení: %s" -#: ../src/nm-netlink-monitor.c:277 +#: ../src/nm-netlink-monitor.c:265 #, c-format -msgid "unable to join netlink group for monitoring link status: %s" -msgstr "nelze se připojit ke skupině netlink pro sledování stavu spojení: %s" +msgid "unable to enable netlink handle credential passing: %s" +msgstr "nelze alokovat ovládání netlinku: %s" -#: ../src/nm-netlink-monitor.c:285 +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "nelze alokovat ovládání netlinku pro sledování stavu spojení: %s" + +#: ../src/nm-netlink-monitor.c:376 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "nelze alokovat mezipaměť netlinku pro sledování stavu spojení: %s" -#: ../src/nm-netlink-monitor.c:493 -#: ../src/ip6-manager/nm-netlink-listener.c:381 -msgid "error occurred while waiting for data on socket" -msgstr "vyskytla se chyba při čekání na data ze soketu" +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "nelze se připojit ke skupině netlink: %s" -#: ../src/nm-netlink-monitor.c:557 ../src/nm-netlink-monitor.c:570 +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 #, c-format msgid "error updating link cache: %s" msgstr "chyba při aktualizaci mezipaměti spojení: %s" -#: ../src/main.c:498 +#: ../src/main.c:499 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "" -"Neplatný přepínač. Platné přepínače si můžete zobrazit pomocí --help.\n" +"Neplatný přepínač. Platné přepínače si můžete zobrazit pomocí --help.\n" -#: ../src/main.c:558 +#: ../src/main.c:570 #, c-format -#| msgid "Invalid option. Please use --help to see a list of valid options.\n" msgid "%s. Please use --help to see a list of valid options.\n" msgstr "%s. Pomocí --help si prosím zobrazte seznam platných přepínačů.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:328 msgid "# Created by NetworkManager\n" msgstr "# Vytvořeno NetworkManagerem\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:344 #, c-format msgid "" "# Merged from %s\n" @@ -1290,41 +1712,23 @@ msgstr "" "# Sloučeno z %s\n" "\n" -#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 msgid "no usable DHCP client could be found." msgstr "nebyl nalezen žádný použitelný klient DHCP." -#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 msgid "'dhclient' could be found." msgstr "„dhclient“ byl nalezen." -#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 msgid "'dhcpcd' could be found." msgstr "„dhcpcd“ byl nalezen." -#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 #, c-format msgid "unsupported DHCP client '%s'" msgstr "nepodporovaný klient DHCP „%s“" -#: ../src/ip6-manager/nm-netlink-listener.c:199 -#, c-format -#| msgid "unable to allocate netlink handle for monitoring link status: %s" -msgid "unable to allocate netlink handle: %s" -msgstr "nelze alokovat ovládání netlinku: %s" - -#: ../src/ip6-manager/nm-netlink-listener.c:209 -#, c-format -#| msgid "unable to connect to netlink for monitoring link status: %s" -msgid "unable to connect to netlink: %s" -msgstr "nelze se připojit k netlinku: %s" - -#: ../src/ip6-manager/nm-netlink-listener.c:306 -#, c-format -#| msgid "unable to join netlink group for monitoring link status: %s" -msgid "unable to join netlink group: %s" -msgstr "nelze se připojit ke skupině netlink: %s" - #: ../src/logging/nm-logging.c:146 #, c-format msgid "Unknown log level '%s'" @@ -1335,52 +1739,184 @@ msgstr "Neznámá úroveň evidence „%s“" msgid "Unknown log domain '%s'" msgstr "Neznámá doména evidence „%s“" -#: ../src/dns-manager/nm-dns-manager.c:314 +#: ../src/dns-manager/nm-dns-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" -"Poznámka: překladač adres z libc nemůže podporovat více než 3 jmenné servery." +"POZNÁMKA: překladač adres z libc nemůže podporovat více než 3 jmenné servery." -#: ../src/dns-manager/nm-dns-manager.c:316 +#: ../src/dns-manager/nm-dns-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "Jmenné servery uvedené v následujícím seznamu nelze rozpoznat." #: ../src/system-settings/nm-default-wired-connection.c:157 #, c-format msgid "Auto %s" -msgstr "%s (automaticky)" +msgstr "Automaticky %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3213 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3412 +#: ../system-settings/plugins/ifnet/connection_parser.c:49 msgid "System" msgstr "Systém" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 -msgid "Connection sharing via a protected WiFi network" -msgstr "Sdílení připojení přes chráněnou síť WiFi" +#~ msgid "Type" +#~ msgstr "Typ" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 -msgid "Connection sharing via an open WiFi network" -msgstr "Sdílení připojení přes otevřenou síť WiFi" +#~ msgid "Name" +#~ msgstr "Název" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 -msgid "Modify persistent system hostname" -msgstr "Měnit trvalý systémový název počítače" +#~ msgid "User connections:\n" +#~ msgstr "Uživatelská připojení:\n" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 -msgid "Modify system connections" -msgstr "Měnit systémová připojení" +#~ msgid "System-wide connections" +#~ msgstr "Připojení v rámci systému" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 -msgid "System policy prevents modification of system settings" -msgstr "Systémová politika zabránila změně systémového nastavení." +#~ msgid "Default" +#~ msgstr "Výchozí" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 -msgid "System policy prevents modification of the persistent system hostname" -msgstr "Systémová politika zabránila změně trvalého systémového názvu počítače" +#~ msgid "Service" +#~ msgstr "Služba" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 -msgid "System policy prevents sharing connections via a protected WiFi network" -msgstr "Systémová politika zabránila sdílení připojení přes chráněnou síť WiFi" +#~ msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +#~ msgstr "%s, %s, Frekv %d MHz, Rychlost %d Mb/s, Síla sig %d" -#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 -msgid "System policy prevents sharing connections via an open WiFi network" -msgstr "Systémová politika zabránila sdílení připojení přes otevřenou síť WiFi" +#~ msgid "Device" +#~ msgstr "Zařízení" + +#~ msgid "Driver" +#~ msgstr "Ovladač" + +#~ msgid "State" +#~ msgstr "Stav" + +#~ msgid "HW Address" +#~ msgstr "HW adresa" + +#~ msgid "" +#~ "\n" +#~ " Capabilities:\n" +#~ msgstr "" +#~ "\n" +#~ " Schopnosti:\n" + +#~ msgid "Carrier Detect" +#~ msgstr "Detekce nosného signálu" + +#~ msgid "Speed" +#~ msgstr "Rychlost" + +#~ msgid "" +#~ "\n" +#~ " Wireless Properties\n" +#~ msgstr "" +#~ "\n" +#~ " Vlastnosti bezdrátové části\n" + +#~ msgid "WEP Encryption" +#~ msgstr "Šifrování WEP" + +#~ msgid "WPA Encryption" +#~ msgstr "Šifrování WPA" + +#~ msgid "WPA2 Encryption" +#~ msgstr "Šifrování WPA2" + +#~ msgid "TKIP cipher" +#~ msgstr "Šifra TKIP" + +#~ msgid "CCMP cipher" +#~ msgstr "Šifra CCMP" + +#~ msgid "" +#~ "\n" +#~ " Wireless Access Points %s\n" +#~ msgstr "" +#~ "\n" +#~ " Bezdrátový přístupový bod %s\n" + +#~ msgid "(* = current AP)" +#~ msgstr "(* = aktuální přístupový bod)" + +#~ msgid "" +#~ "\n" +#~ " Wired Properties\n" +#~ msgstr "" +#~ "\n" +#~ " Vlastnosti drátové části\n" + +#~ msgid "Carrier" +#~ msgstr "Nosný signál" + +#~ msgid "" +#~ "\n" +#~ " IPv4 Settings:\n" +#~ msgstr "" +#~ "\n" +#~ " Nastavení IPv4:\n" + +#~ msgid "Address" +#~ msgstr "Adresa" + +#~ msgid "Prefix" +#~ msgstr "Předčíslí" + +#~ msgid "Gateway" +#~ msgstr "Brána" + +#~ msgid "Device:" +#~ msgstr "Zařízení:" + +#~ msgid "Error: hwaddr has to be specified." +#~ msgstr "Chyba: musí být určena hardwarová adresa." + +#~ msgid "AP parameters" +#~ msgstr "Parametry přístupového bodu" + +#~ msgid "Frequency:" +#~ msgstr "Kmitočet:" + +#~ msgid "Mode:" +#~ msgstr "Režim:" + +#~ msgid "Ad-hoc" +#~ msgstr "Ad-hoc" + +#~ msgid "Maximal bitrate:" +#~ msgstr "Max. přenosová rychlost:" + +#~ msgid "Strength:" +#~ msgstr "Síla signálu:" + +#~ msgid "Flags:" +#~ msgstr "Příznaky:" + +#~ msgid "privacy" +#~ msgstr "soukromé" + +#~ msgid "WPA flags:" +#~ msgstr "Příznaky WPA:" + +#~ msgid "RSN flags:" +#~ msgstr "Příznaky RSN:" + +#~ msgid "NM running:" +#~ msgstr "Běh NM:" + +#~ msgid "NM state:" +#~ msgstr "Stav NM:" + +#~ msgid "NM wireless hardware:" +#~ msgstr "Bezdrátový hardware NM:" + +#~ msgid "NM wireless:" +#~ msgstr "Bezdrátové sítě NM:" + +#~ msgid "NM WWAN hardware:" +#~ msgstr "Hardware WWAN NM" + +#~ msgid "unable to join netlink group for monitoring link status: %s" +#~ msgstr "" +#~ "nelze se připojit ke skupině netlink pro sledování stavu spojení: %s" + +#~| msgid "unable to connect to netlink for monitoring link status: %s" +#~ msgid "unable to connect to netlink: %s" +#~ msgstr "nelze se připojit k netlinku: %s" -- cgit v1.2.1 From 80b9047e1cdbf65e3392a3bf6aeca4bff6cedacc Mon Sep 17 00:00:00 2001 From: Rimas Kudelis Date: Wed, 20 Oct 2010 17:25:12 -0500 Subject: po: udpated Lithuanian translation (bgo #632634) --- po/lt.po | 555 ++++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 320 insertions(+), 235 deletions(-) diff --git a/po/lt.po b/po/lt.po index 6c1d170c31..2f58078c69 100644 --- a/po/lt.po +++ b/po/lt.po @@ -3,93 +3,99 @@ # This file is distributed under the same license as the NetworkManager package. # Žygimantas Beručka , 2005-2006, 2008, 2010. # Aurimas Černius , 2010. +# Rimas Kudelis , 2010. msgid "" msgstr "" "Project-Id-Version: NetworkManager HEAD\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=Networ" "kManager&component=general\n" -"POT-Creation-Date: 2010-06-28 08:52+0000\n" -"PO-Revision-Date: 2010-07-15 14:09+0300\n" -"Last-Translator: Aurimas Černius \n" -"Language-Team: Lithuanian \n" +"POT-Creation-Date: 2010-09-20 15:25+0000\n" +"PO-Revision-Date: 2010-10-16 17:10+0300\n" +"Last-Translator: Rimas Kudelis \n" +"Language-Team: Lithuanian \n" "Language: lt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: UTF-8\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%" "100<10 || n%100>=20) ? 1 : 2);\n" -"X-Generator: Virtaal 0.6.1\n" +"X-Generator: Virtaal 0.5.2\n" -#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 -#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 -#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 -#: ../cli/src/devices.c:152 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/devices.c:88 ../cli/src/devices.c:101 ../cli/src/devices.c:111 +#: ../cli/src/devices.c:121 ../cli/src/devices.c:134 ../cli/src/devices.c:145 +#: ../cli/src/devices.c:156 ../cli/src/devices.c:165 ../cli/src/devices.c:174 msgid "NAME" msgstr "PAVADINIMAS" #. 0 -#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +#: ../cli/src/connections.c:61 ../cli/src/connections.c:76 msgid "UUID" msgstr "UUID" #. 1 -#: ../cli/src/connections.c:61 +#: ../cli/src/connections.c:62 msgid "DEVICES" msgstr "ĮRENGINIAI" #. 2 -#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +#: ../cli/src/connections.c:63 ../cli/src/connections.c:78 msgid "SCOPE" msgstr "SRITIS" #. 3 -#: ../cli/src/connections.c:63 +#: ../cli/src/connections.c:64 msgid "DEFAULT" msgstr "NUMATYTASIS" #. 4 -#: ../cli/src/connections.c:64 +#: ../cli/src/connections.c:65 msgid "DBUS-SERVICE" msgstr "DBUS-TARNYBA" #. 5 -#: ../cli/src/connections.c:65 +#: ../cli/src/connections.c:66 msgid "SPEC-OBJECT" msgstr "SPEC-OBJECTAS" #. 6 -#: ../cli/src/connections.c:66 +#: ../cli/src/connections.c:67 msgid "VPN" msgstr "VPN" #. 1 #. 0 #. 1 -#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +#: ../cli/src/connections.c:77 ../cli/src/devices.c:62 ../cli/src/devices.c:90 msgid "TYPE" msgstr "TIPAS" #. 3 -#: ../cli/src/connections.c:78 +#: ../cli/src/connections.c:79 msgid "TIMESTAMP" msgstr "LAIKO-ŽYMA" #. 4 -#: ../cli/src/connections.c:79 +#: ../cli/src/connections.c:80 msgid "TIMESTAMP-REAL" msgstr "LAIKO-ŽYMA-TIKROJI" #. 5 -#: ../cli/src/connections.c:80 +#: ../cli/src/connections.c:81 msgid "AUTOCONNECT" msgstr "AUTOPRISIJUNGIMAS" #. 6 -#: ../cli/src/connections.c:81 +#: ../cli/src/connections.c:82 msgid "READONLY" msgstr "TIKSKAITOMA" -#: ../cli/src/connections.c:157 +#. 7 +#: ../cli/src/connections.c:83 +msgid "DBUS-PATH" +msgstr "DBUS-KELIAS" + +#: ../cli/src/connections.c:159 #, c-format msgid "" "Usage: nmcli con { COMMAND | help }\n" @@ -110,40 +116,40 @@ msgstr "" "]\n" " down id | uuid \n" -#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#: ../cli/src/connections.c:199 ../cli/src/connections.c:540 #, c-format msgid "Error: 'con list': %s" msgstr "Klaida: „con list“: %s" -#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#: ../cli/src/connections.c:201 ../cli/src/connections.c:542 #, c-format msgid "Error: 'con list': %s; allowed fields: %s" msgstr "Klaida: „con list“: %s; leidžiami laukai: %s" -#: ../cli/src/connections.c:207 +#: ../cli/src/connections.c:209 msgid "Connection details" msgstr "Ryšio informacija" -#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +#: ../cli/src/connections.c:384 ../cli/src/connections.c:605 msgid "system" msgstr "sisteminis" -#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +#: ../cli/src/connections.c:384 ../cli/src/connections.c:605 msgid "user" msgstr "naudotojo" -#: ../cli/src/connections.c:383 +#: ../cli/src/connections.c:386 msgid "never" msgstr "niekada" #. "CAPABILITIES" #. Print header #. "WIFI-PROPERTIES" -#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 -#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 -#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 -#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/connections.c:387 ../cli/src/connections.c:388 +#: ../cli/src/connections.c:606 ../cli/src/connections.c:609 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 #: ../cli/src/settings.c:551 ../cli/src/settings.c:652 #: ../cli/src/settings.c:926 ../cli/src/settings.c:927 #: ../cli/src/settings.c:929 ../cli/src/settings.c:931 @@ -159,11 +165,11 @@ msgstr "niekada" msgid "yes" msgstr "taip" -#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 -#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 -#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 -#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 -#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/connections.c:387 ../cli/src/connections.c:388 +#: ../cli/src/connections.c:606 ../cli/src/connections.c:609 +#: ../cli/src/devices.c:432 ../cli/src/devices.c:557 ../cli/src/devices.c:583 +#: ../cli/src/devices.c:584 ../cli/src/devices.c:585 ../cli/src/devices.c:586 +#: ../cli/src/devices.c:587 ../cli/src/settings.c:508 #: ../cli/src/settings.c:510 ../cli/src/settings.c:551 #: ../cli/src/settings.c:652 ../cli/src/settings.c:926 #: ../cli/src/settings.c:927 ../cli/src/settings.c:929 @@ -179,445 +185,458 @@ msgstr "taip" msgid "no" msgstr "ne" -#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +#: ../cli/src/connections.c:461 ../cli/src/connections.c:504 msgid "System connections" msgstr "Sistemos ryšiai" -#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +#: ../cli/src/connections.c:466 ../cli/src/connections.c:517 msgid "User connections" msgstr "Naudotojo ryšiai" -#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 -#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 -#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 -#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 -#: ../cli/src/devices.c:980 +#: ../cli/src/connections.c:478 ../cli/src/connections.c:1338 +#: ../cli/src/connections.c:1354 ../cli/src/connections.c:1363 +#: ../cli/src/connections.c:1374 ../cli/src/connections.c:1459 +#: ../cli/src/devices.c:962 ../cli/src/devices.c:972 ../cli/src/devices.c:1074 +#: ../cli/src/devices.c:1081 #, c-format msgid "Error: %s argument is missing." msgstr "Klaida: trūksta argumento %s." -#: ../cli/src/connections.c:487 +#: ../cli/src/connections.c:491 #, c-format msgid "Error: %s - no such connection." msgstr "Klaida: ryšio %s nėra." -#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 -#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 -#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#: ../cli/src/connections.c:523 ../cli/src/connections.c:1387 +#: ../cli/src/connections.c:1477 ../cli/src/devices.c:785 +#: ../cli/src/devices.c:852 ../cli/src/devices.c:986 ../cli/src/devices.c:1087 #, c-format msgid "Unknown parameter: %s\n" msgstr "Nežinomas parametras: %s\n" -#: ../cli/src/connections.c:528 +#: ../cli/src/connections.c:532 #, c-format msgid "Error: no valid parameter specified." msgstr "Klaida: nenurodyta tinkamų parametrų." -#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 -#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#: ../cli/src/connections.c:547 ../cli/src/connections.c:1580 +#: ../cli/src/devices.c:1293 ../cli/src/network-manager.c:359 #, c-format msgid "Error: %s." msgstr "Klaida: %s" -#: ../cli/src/connections.c:649 +#: ../cli/src/connections.c:653 #, c-format msgid "Error: 'con status': %s" msgstr "Klaida: „con status“: %s" -#: ../cli/src/connections.c:651 +#: ../cli/src/connections.c:655 #, c-format msgid "Error: 'con status': %s; allowed fields: %s" msgstr "Klaida: „con status“: %s; leidžiami laukai: %s" -#: ../cli/src/connections.c:658 +#: ../cli/src/connections.c:662 msgid "Active connections" msgstr "Aktyvūs ryšiai" -#: ../cli/src/connections.c:1026 +#: ../cli/src/connections.c:1030 #, c-format msgid "no active connection on device '%s'" msgstr "nėra aktyvaus ryšio įrenginyje „%s“" -#: ../cli/src/connections.c:1034 +#: ../cli/src/connections.c:1038 #, c-format msgid "no active connection or device" msgstr "nėra aktyvaus ryšio įrenginyje" -#: ../cli/src/connections.c:1084 +#: ../cli/src/connections.c:1088 #, c-format msgid "device '%s' not compatible with connection '%s'" msgstr "įrenginys „%s“ nesuderinamas su ryšiu „%s“" -#: ../cli/src/connections.c:1086 +#: ../cli/src/connections.c:1090 #, c-format msgid "no device found for connection '%s'" msgstr "nerastas įrenginys ryšiui „%s“" -#: ../cli/src/connections.c:1097 +#: ../cli/src/connections.c:1101 msgid "activating" msgstr "aktyvuojama" -#: ../cli/src/connections.c:1099 +#: ../cli/src/connections.c:1103 msgid "activated" msgstr "aktyvuota" -#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 -#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 -#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 -#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:473 +#: ../cli/src/connections.c:1106 ../cli/src/connections.c:1129 +#: ../cli/src/connections.c:1162 ../cli/src/devices.c:246 +#: ../cli/src/devices.c:558 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:149 ../cli/src/settings.c:473 msgid "unknown" msgstr "nežinoma" -#: ../cli/src/connections.c:1111 +#: ../cli/src/connections.c:1115 msgid "VPN connecting (prepare)" msgstr "VPN jungiamasi (ruošiama)" -#: ../cli/src/connections.c:1113 +#: ../cli/src/connections.c:1117 msgid "VPN connecting (need authentication)" msgstr "VPN jungiamasi (reikia nustatyti tapatybę)" -#: ../cli/src/connections.c:1115 +#: ../cli/src/connections.c:1119 msgid "VPN connecting" msgstr "VPN jungiamasi" -#: ../cli/src/connections.c:1117 +#: ../cli/src/connections.c:1121 msgid "VPN connecting (getting IP configuration)" msgstr "VPN jungiamasi (gaunama IP konfigūracija)" -#: ../cli/src/connections.c:1119 +#: ../cli/src/connections.c:1123 msgid "VPN connected" msgstr "VPN prisijungta" -#: ../cli/src/connections.c:1121 +#: ../cli/src/connections.c:1125 msgid "VPN connection failed" msgstr "VPN prisijungti nepavyko" -#: ../cli/src/connections.c:1123 +#: ../cli/src/connections.c:1127 msgid "VPN disconnected" msgstr "VPN atsijungta" -#: ../cli/src/connections.c:1134 +#: ../cli/src/connections.c:1138 msgid "unknown reason" msgstr "nežinoma priežastis" -#: ../cli/src/connections.c:1136 +#: ../cli/src/connections.c:1140 msgid "none" msgstr "jokia" -#: ../cli/src/connections.c:1138 +#: ../cli/src/connections.c:1142 msgid "the user was disconnected" msgstr "naudotojas buvo atjungtas" -#: ../cli/src/connections.c:1140 +#: ../cli/src/connections.c:1144 msgid "the base network connection was interrupted" msgstr "bazinis tinklo ryšys buvo pertrauktas" -#: ../cli/src/connections.c:1142 +#: ../cli/src/connections.c:1146 msgid "the VPN service stopped unexpectedly" msgstr "VPN tarnyba netikėtai sustojo" -#: ../cli/src/connections.c:1144 +#: ../cli/src/connections.c:1148 msgid "the VPN service returned invalid configuration" msgstr "VPN tarnyba grąžino netinkamą konfigūraciją" -#: ../cli/src/connections.c:1146 +#: ../cli/src/connections.c:1150 msgid "the connection attempt timed out" msgstr "bandymo jungtis laikas baigėsi" -#: ../cli/src/connections.c:1148 +#: ../cli/src/connections.c:1152 msgid "the VPN service did not start in time" msgstr "VPN tarnyba nebuvo paleista laiku" -#: ../cli/src/connections.c:1150 +#: ../cli/src/connections.c:1154 msgid "the VPN service failed to start" msgstr "nepavyko paleisti VPN tarnybos" -#: ../cli/src/connections.c:1152 +#: ../cli/src/connections.c:1156 msgid "no valid VPN secrets" msgstr "nėra tinkamų VPN paslapčių" -#: ../cli/src/connections.c:1154 +#: ../cli/src/connections.c:1158 msgid "invalid VPN secrets" msgstr "netinkamos VPN paslaptys" -#: ../cli/src/connections.c:1156 +#: ../cli/src/connections.c:1160 msgid "the connection was removed" msgstr "ryšys buvo pašalintas" -#: ../cli/src/connections.c:1170 +#: ../cli/src/connections.c:1174 #, c-format msgid "state: %s\n" msgstr "būsena: %s\n" -#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#: ../cli/src/connections.c:1177 ../cli/src/connections.c:1203 #, c-format msgid "Connection activated\n" msgstr "Ryšys aktyvuotas\n" -#: ../cli/src/connections.c:1176 +#: ../cli/src/connections.c:1180 #, c-format msgid "Error: Connection activation failed." msgstr "Klaida: nepavyko aktyvuoti ryšio." -#: ../cli/src/connections.c:1195 +#: ../cli/src/connections.c:1199 #, c-format msgid "state: %s (%d)\n" msgstr "būsena: %s (%d)\n" -#: ../cli/src/connections.c:1205 +#: ../cli/src/connections.c:1209 #, c-format msgid "Error: Connection activation failed: %s." msgstr "Klaida: nepavyko aktyvuoti ryšio: %s." -#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#: ../cli/src/connections.c:1226 ../cli/src/devices.c:909 #, c-format msgid "Error: Timeout %d sec expired." msgstr "Klaida: baigėsi %d sek. laikas." -#: ../cli/src/connections.c:1265 +#: ../cli/src/connections.c:1269 #, c-format msgid "Error: Connection activation failed: %s" msgstr "Klaida: nepavyko aktyvuoti ryšio: %s" -#: ../cli/src/connections.c:1279 +#: ../cli/src/connections.c:1283 #, c-format msgid "Error: Obtaining active connection for '%s' failed." msgstr "Klaida: nepavyko „%s“ gauti aktyvaus ryšio." -#: ../cli/src/connections.c:1288 +#: ../cli/src/connections.c:1292 #, c-format msgid "Active connection state: %s\n" msgstr "Aktyvaus ryšio būsena: %s\n" -#: ../cli/src/connections.c:1289 +#: ../cli/src/connections.c:1293 #, c-format msgid "Active connection path: %s\n" msgstr "Aktyvaus ryšio kelias: %s\n" -#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#: ../cli/src/connections.c:1347 ../cli/src/connections.c:1468 #, c-format msgid "Error: Unknown connection: %s." msgstr "Klaida: nežinomas ryšys: %s" -#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#: ../cli/src/connections.c:1382 ../cli/src/devices.c:980 #, c-format msgid "Error: timeout value '%s' is not valid." msgstr "Klaida: netinkama laukimo laiko reikšmė „%s“." -#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#: ../cli/src/connections.c:1395 ../cli/src/connections.c:1485 #, c-format msgid "Error: id or uuid has to be specified." msgstr "Klaida: id arba uuid turi būti nurodytas." -#: ../cli/src/connections.c:1411 +#: ../cli/src/connections.c:1415 #, c-format msgid "Error: No suitable device found: %s." msgstr "Klaida: nerastas tinkamas įrenginys: %s." -#: ../cli/src/connections.c:1413 +#: ../cli/src/connections.c:1417 #, c-format msgid "Error: No suitable device found." msgstr "Klaida: nerastas tinkamas įrenginys." -#: ../cli/src/connections.c:1505 +#: ../cli/src/connections.c:1512 #, c-format msgid "Warning: Connection not active\n" msgstr "Įspėjimas: ryšys neaktyvus\n" -#: ../cli/src/connections.c:1561 +#: ../cli/src/connections.c:1569 #, c-format msgid "Error: 'con' command '%s' is not valid." msgstr "Klaida: netinkama „con“ komanda „%s“." -#: ../cli/src/connections.c:1597 +#: ../cli/src/connections.c:1605 #, c-format msgid "Error: could not connect to D-Bus." msgstr "Klaida: nepavyko prisijungti prie D-Bus." -#: ../cli/src/connections.c:1604 +#: ../cli/src/connections.c:1612 #, c-format msgid "Error: Could not get system settings." msgstr "Klaida: nepavyko gauti sistemos nustatymų." -#: ../cli/src/connections.c:1612 +#: ../cli/src/connections.c:1620 #, c-format msgid "Error: Could not get user settings." msgstr "Klaida: nepavyko gauti naudotojo nustatymų." -#: ../cli/src/connections.c:1622 +#: ../cli/src/connections.c:1630 #, c-format msgid "Error: Can't obtain connections: settings services are not running." msgstr "Klaida: nepavyko gauti ryšių: nustatymų tarnybos neveikia." #. 0 #. 9 -#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +#: ../cli/src/devices.c:61 ../cli/src/devices.c:89 ../cli/src/devices.c:184 msgid "DEVICE" msgstr "ĮRENGINYS" #. 1 #. 4 #. 0 -#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/devices.c:63 ../cli/src/devices.c:93 #: ../cli/src/network-manager.c:36 msgid "STATE" msgstr "BŪSENA" -#: ../cli/src/devices.c:71 +#: ../cli/src/devices.c:72 msgid "GENERAL" msgstr "BENDRA" #. 0 -#: ../cli/src/devices.c:72 +#: ../cli/src/devices.c:73 msgid "CAPABILITIES" msgstr "GEBOS" #. 1 -#: ../cli/src/devices.c:73 +#: ../cli/src/devices.c:74 msgid "WIFI-PROPERTIES" msgstr "WIFI-SAVYBĖS" #. 2 -#: ../cli/src/devices.c:74 +#: ../cli/src/devices.c:75 msgid "AP" msgstr "AP" #. 3 -#: ../cli/src/devices.c:75 +#: ../cli/src/devices.c:76 msgid "WIRED-PROPERTIES" msgstr "LAIDINIO-TINKLO-SAVYBĖS" #. 4 -#: ../cli/src/devices.c:76 +#: ../cli/src/devices.c:77 msgid "IP4-SETTINGS" msgstr "IP4-PARAMETRAI" #. 5 -#: ../cli/src/devices.c:77 +#: ../cli/src/devices.c:78 msgid "IP4-DNS" msgstr "IP4-DNS" +#. 6 +#: ../cli/src/devices.c:79 +#| msgid "IP4-SETTINGS" +msgid "IP6-SETTINGS" +msgstr "IP6-PARAMETRAI" + +#. 7 +#: ../cli/src/devices.c:80 +#| msgid "IP4-DNS" +msgid "IP6-DNS" +msgstr "IP6-DNS" + #. 2 -#: ../cli/src/devices.c:88 +#: ../cli/src/devices.c:91 msgid "DRIVER" msgstr "TVARKYKLĖ" #. 3 -#: ../cli/src/devices.c:89 +#: ../cli/src/devices.c:92 msgid "HWADDR" msgstr "APARATINIS-ADRESAS" #. 0 -#: ../cli/src/devices.c:99 +#: ../cli/src/devices.c:102 msgid "CARRIER-DETECT" msgstr "NEŠLIO-APTIKIMAS" #. 1 -#: ../cli/src/devices.c:100 +#: ../cli/src/devices.c:103 msgid "SPEED" msgstr "SPARTA" #. 0 -#: ../cli/src/devices.c:109 +#: ../cli/src/devices.c:112 msgid "CARRIER" msgstr "NEŠLYS" #. 0 -#: ../cli/src/devices.c:119 +#: ../cli/src/devices.c:122 msgid "WEP" msgstr "WEP" #. 1 -#: ../cli/src/devices.c:120 +#: ../cli/src/devices.c:123 msgid "WPA" msgstr "WPA" #. 2 -#: ../cli/src/devices.c:121 +#: ../cli/src/devices.c:124 msgid "WPA2" msgstr "WPA2" #. 3 -#: ../cli/src/devices.c:122 +#: ../cli/src/devices.c:125 msgid "TKIP" msgstr "TKIP" #. 4 -#: ../cli/src/devices.c:123 +#: ../cli/src/devices.c:126 msgid "CCMP" msgstr "CCMP" #. 0 -#: ../cli/src/devices.c:132 +#: ../cli/src/devices.c:135 ../cli/src/devices.c:146 msgid "ADDRESS" msgstr "ADRESAS" #. 1 -#: ../cli/src/devices.c:133 +#: ../cli/src/devices.c:136 ../cli/src/devices.c:147 msgid "PREFIX" msgstr "PRIEŠDĖLIS" #. 2 -#: ../cli/src/devices.c:134 +#: ../cli/src/devices.c:137 ../cli/src/devices.c:148 msgid "GATEWAY" msgstr "ŠLIUZAS" #. 0 -#: ../cli/src/devices.c:143 +#: ../cli/src/devices.c:157 ../cli/src/devices.c:166 msgid "DNS" msgstr "DNS" #. 0 -#: ../cli/src/devices.c:153 +#: ../cli/src/devices.c:175 msgid "SSID" msgstr "SSID" #. 1 -#: ../cli/src/devices.c:154 +#: ../cli/src/devices.c:176 msgid "BSSID" msgstr "BSSID" #. 2 -#: ../cli/src/devices.c:155 +#: ../cli/src/devices.c:177 msgid "MODE" msgstr "VEIKSENA" #. 3 -#: ../cli/src/devices.c:156 +#: ../cli/src/devices.c:178 msgid "FREQ" msgstr "DAŽNIS" #. 4 -#: ../cli/src/devices.c:157 +#: ../cli/src/devices.c:179 msgid "RATE" msgstr "DAŽNUMAS" #. 5 -#: ../cli/src/devices.c:158 +#: ../cli/src/devices.c:180 + msgid "SIGNAL" msgstr "SIGNALAS" #. 6 -#: ../cli/src/devices.c:159 +#: ../cli/src/devices.c:181 msgid "SECURITY" msgstr "SAUGA" #. 7 -#: ../cli/src/devices.c:160 +#: ../cli/src/devices.c:182 msgid "WPA-FLAGS" msgstr "WPA-ŽYMOS" #. 8 -#: ../cli/src/devices.c:161 +#: ../cli/src/devices.c:183 msgid "RSN-FLAGS" msgstr "RSN-ŽYMOS" #. 10 -#: ../cli/src/devices.c:163 +#: ../cli/src/devices.c:185 msgid "ACTIVE" msgstr "AKTYVUS" -#: ../cli/src/devices.c:186 +#: ../cli/src/devices.c:208 #, c-format msgid "" "Usage: nmcli dev { COMMAND | help }\n" @@ -640,204 +659,205 @@ msgstr "" " wifi [list [iface ] [hwaddr ]]\n" "\n" -#: ../cli/src/devices.c:206 +#: ../cli/src/devices.c:228 msgid "unmanaged" msgstr "nevaldomas" -#: ../cli/src/devices.c:208 +#: ../cli/src/devices.c:230 msgid "unavailable" msgstr "neprieinamas" -#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +#: ../cli/src/devices.c:232 ../cli/src/network-manager.c:91 msgid "disconnected" msgstr "atjungtas" -#: ../cli/src/devices.c:212 +#: ../cli/src/devices.c:234 msgid "connecting (prepare)" msgstr "jungiamasi (ruošiama)" -#: ../cli/src/devices.c:214 +#: ../cli/src/devices.c:236 msgid "connecting (configuring)" msgstr "jungiamasi (konfigūruojama)" -#: ../cli/src/devices.c:216 +#: ../cli/src/devices.c:238 msgid "connecting (need authentication)" msgstr "jungiamasi (reikia nustatyti tapatybę)" -#: ../cli/src/devices.c:218 +#: ../cli/src/devices.c:240 msgid "connecting (getting IP configuration)" msgstr "jungiamasi (gaunama IP konfigūracija)" -#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +#: ../cli/src/devices.c:242 ../cli/src/network-manager.c:89 msgid "connected" msgstr "prisijungta" -#: ../cli/src/devices.c:222 +#: ../cli/src/devices.c:244 msgid "connection failed" msgstr "prisijungti nepavyko" -#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +#: ../cli/src/devices.c:267 ../cli/src/devices.c:424 msgid "Unknown" msgstr "Nežinoma" -#: ../cli/src/devices.c:277 +#: ../cli/src/devices.c:299 msgid "(none)" msgstr "(jokios)" -#: ../cli/src/devices.c:302 +#: ../cli/src/devices.c:324 #, c-format msgid "%s: error converting IP4 address 0x%X" msgstr "%s: klaida konvertuojant IP4 adresą 0x%X" -#: ../cli/src/devices.c:349 +#: ../cli/src/devices.c:393 #, c-format msgid "%u MHz" msgstr "%u MHz" -#: ../cli/src/devices.c:350 +#: ../cli/src/devices.c:394 #, c-format msgid "%u MB/s" msgstr "%u MB/s" -#: ../cli/src/devices.c:359 +#: ../cli/src/devices.c:403 msgid "Encrypted: " msgstr "Šifruota: " -#: ../cli/src/devices.c:364 +#: ../cli/src/devices.c:408 msgid "WEP " msgstr "WEP" -#: ../cli/src/devices.c:366 +#: ../cli/src/devices.c:410 msgid "WPA " msgstr "WPA" -#: ../cli/src/devices.c:368 +#: ../cli/src/devices.c:412 msgid "WPA2 " msgstr "WPA2" -#: ../cli/src/devices.c:371 +#: ../cli/src/devices.c:415 msgid "Enterprise " msgstr "Kompanija " -#: ../cli/src/devices.c:380 +#: ../cli/src/devices.c:424 msgid "Ad-Hoc" msgstr "Ad-Hoc" -#: ../cli/src/devices.c:380 +#: ../cli/src/devices.c:424 msgid "Infrastructure" msgstr "Infrastruktūra" -#: ../cli/src/devices.c:442 +#: ../cli/src/devices.c:486 #, c-format msgid "Error: 'dev list': %s" msgstr "Klaida: „dev list“: %s" -#: ../cli/src/devices.c:444 +#: ../cli/src/devices.c:488 #, c-format msgid "Error: 'dev list': %s; allowed fields: %s" msgstr "Klaida: „dev list“: %s; leidžiami laukai: %s" -#: ../cli/src/devices.c:453 +#: ../cli/src/devices.c:497 msgid "Device details" msgstr "Įrenginio informacija" -#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +#: ../cli/src/devices.c:527 ../cli/src/devices.c:925 msgid "(unknown)" msgstr "(nežinoma)" -#: ../cli/src/devices.c:484 +#: ../cli/src/devices.c:528 msgid "unknown)" msgstr "nežinoma)" -#: ../cli/src/devices.c:510 +#: ../cli/src/devices.c:554 #, c-format msgid "%u Mb/s" msgstr "%u Mb/s" #. Print header #. "WIRED-PROPERTIES" -#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:627 msgid "on" msgstr "įjungta" -#: ../cli/src/devices.c:583 +#: ../cli/src/devices.c:627 msgid "off" msgstr "išjungta" -#: ../cli/src/devices.c:710 +#: ../cli/src/devices.c:808 #, c-format msgid "Error: 'dev status': %s" msgstr "Klaida: „dev status“: %s" -#: ../cli/src/devices.c:712 +#: ../cli/src/devices.c:810 #, c-format msgid "Error: 'dev status': %s; allowed fields: %s" msgstr "Klaida: „dev status“: %s; leidžiami laukai: %s" -#: ../cli/src/devices.c:719 +#: ../cli/src/devices.c:817 msgid "Status of devices" msgstr "Įrenginių būsena" -#: ../cli/src/devices.c:747 +#: ../cli/src/devices.c:845 #, c-format msgid "Error: '%s' argument is missing." msgstr "Klaida: trūksta argumento „%s“." -#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#: ../cli/src/devices.c:874 ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1136 #, c-format msgid "Error: Device '%s' not found." msgstr "Klaida: nerastas įrenginys „%s“." -#: ../cli/src/devices.c:799 +#: ../cli/src/devices.c:897 #, c-format msgid "Success: Device '%s' successfully disconnected." msgstr "Pavyko: sėkmingai atjungtas įrenginys „%s“." -#: ../cli/src/devices.c:824 +#: ../cli/src/devices.c:922 #, c-format msgid "Error: Device '%s' (%s) disconnecting failed: %s" msgstr "Klaida: įrenginio „%s“ (%s) atjungti nepavyko: %s" -#: ../cli/src/devices.c:832 +#: ../cli/src/devices.c:930 #, c-format msgid "Device state: %d (%s)\n" msgstr "Įrenginio būsena: %d (%s)\n" -#: ../cli/src/devices.c:896 +#: ../cli/src/devices.c:994 #, c-format msgid "Error: iface has to be specified." msgstr "Klaida: turi būti nurodytas iface." -#: ../cli/src/devices.c:1011 +#: ../cli/src/devices.c:1112 #, c-format msgid "Error: 'dev wifi': %s" msgstr "Klaida: „dev wifi“: %s" -#: ../cli/src/devices.c:1013 +#: ../cli/src/devices.c:1114 #, c-format msgid "Error: 'dev wifi': %s; allowed fields: %s" msgstr "Klaida: „dev wifi“: %s; leidžiami laukai: %s" -#: ../cli/src/devices.c:1020 +#: ../cli/src/devices.c:1121 msgid "WiFi scan list" msgstr "WiFi skenavimo sąrašas" -#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#: ../cli/src/devices.c:1156 ../cli/src/devices.c:1210 #, c-format msgid "Error: Access point with hwaddr '%s' not found." msgstr "Klaida: nerastas prieigos taškas su hwaddr „%s“." -#: ../cli/src/devices.c:1072 +#: ../cli/src/devices.c:1173 #, c-format msgid "Error: Device '%s' is not a WiFi device." msgstr "Klaida: „%s“ nėra WiFi įrenginys " -#: ../cli/src/devices.c:1136 +#: ../cli/src/devices.c:1237 #, c-format msgid "Error: 'dev wifi' command '%s' is not valid." msgstr "Klaida: netinkama „dev wifi“ komanda „%s“." -#: ../cli/src/devices.c:1183 +#: ../cli/src/devices.c:1284 #, c-format msgid "Error: 'dev' command '%s' is not valid." msgstr "Klaida: netinkama „dev“ komanda „%s“." @@ -848,116 +868,178 @@ msgstr "VEIKIA" #. 1 #: ../cli/src/network-manager.c:37 -msgid "WIFI-HARDWARE" -msgstr "WIFI-APARATINĖ-ĮRANGA" +msgid "NET-ENABLED" +msgstr "TINKLAS-ĮJUNGTAS" #. 2 #: ../cli/src/network-manager.c:38 -msgid "WIFI" -msgstr "WIFI" +msgid "WIFI-HARDWARE" +msgstr "WIFI-APARATINĖ-ĮRANGA" #. 3 #: ../cli/src/network-manager.c:39 -msgid "WWAN-HARDWARE" -msgstr "WWAN-APARATINĖ-ĮRANGA" +msgid "WIFI" +msgstr "WIFI" #. 4 #: ../cli/src/network-manager.c:40 +msgid "WWAN-HARDWARE" +msgstr "WWAN-APARATINĖ-ĮRANGA" + +#. 5 +#: ../cli/src/network-manager.c:41 msgid "WWAN" msgstr "WWAN" -#: ../cli/src/network-manager.c:62 -#, c-format +#: ../cli/src/network-manager.c:64 +#, c-format +#| msgid "" +#| "Usage: nmcli nm { COMMAND | help }\n" +#| "\n" +#| " COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +#| "\n" +#| " status\n" +#| " sleep\n" +#| " wakeup\n" +#| " wifi [on|off]\n" +#| " wwan [on|off]\n" +#| "\n" msgid "" "Usage: nmcli nm { COMMAND | help }\n" "\n" -" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +" COMMAND := { status | enable | sleep | wifi | wwan }\n" "\n" " status\n" -" sleep\n" -" wakeup\n" +" enable [true|false]\n" +" sleep [true|false]\n" " wifi [on|off]\n" " wwan [on|off]\n" "\n" msgstr "" "Naudojimas: nmcli nm { KOMANDA | help }\n" "\n" -" KOMANDA := { status | sleep | wakeup | wifi | wwan }\n" +" KOMANDA := { status | enable | sleep | wifi | wwan }\n" "\n" " status\n" -" sleep\n" -" wakeup\n" +" enable [on|off]\n" +" sleep [on|off]\n" " wifi [on|off]\n" " wwan [on|off]\n" "\n" -#: ../cli/src/network-manager.c:83 +#: ../cli/src/network-manager.c:85 msgid "asleep" msgstr "miegantis" -#: ../cli/src/network-manager.c:85 +#: ../cli/src/network-manager.c:87 msgid "connecting" msgstr "jungiamasi" -#: ../cli/src/network-manager.c:125 +#: ../cli/src/network-manager.c:128 #, c-format msgid "Error: 'nm status': %s" msgstr "Klaida: „nm status“: %s" -#: ../cli/src/network-manager.c:127 +#: ../cli/src/network-manager.c:130 #, c-format msgid "Error: 'nm status': %s; allowed fields: %s" msgstr "Klaida: „nm status“: %s; leidžiami laukai: %s" -#: ../cli/src/network-manager.c:134 +#: ../cli/src/network-manager.c:137 msgid "NetworkManager status" msgstr "NetworkManager būsena" #. Print header -#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 -#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 -#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +#: ../cli/src/network-manager.c:144 ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 ../cli/src/network-manager.c:328 msgid "enabled" msgstr "įjungta" -#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 -#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 -#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +#: ../cli/src/network-manager.c:144 ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 ../cli/src/network-manager.c:328 msgid "disabled" msgstr "išjungta" -#: ../cli/src/network-manager.c:148 +#: ../cli/src/network-manager.c:152 msgid "running" msgstr "veikia" -#: ../cli/src/network-manager.c:148 +#: ../cli/src/network-manager.c:152 msgid "not running" msgstr "neveikia" -#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#: ../cli/src/network-manager.c:175 +#, c-format +#| msgid "Error: could not connect to D-Bus." +msgid "Error: Couldn't connect to system bus: %s" +msgstr "Klaida: nepavyko prisijungti prie sistemos magistralės: %s" + +#: ../cli/src/network-manager.c:186 +#, c-format +#| msgid "Error: could not connect to D-Bus." +msgid "Error: Couldn't create D-Bus object proxy." +msgstr "Klaida: nepavyko sukurti D-Bus tarpinio objekto." + +#: ../cli/src/network-manager.c:192 +#, c-format +#| msgid "Error: 'con list': %s" +msgid "Error in sleep: %s" +msgstr "Klaida užmigdant: %s" + +#: ../cli/src/network-manager.c:237 ../cli/src/network-manager.c:286 +#: ../cli/src/network-manager.c:318 #, c-format msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" msgstr "Klaida: „--fields“ reikšmė „%s“ čia netinkama; leidžiami laukai: %s" -#: ../cli/src/network-manager.c:209 +#: ../cli/src/network-manager.c:245 +#| msgid "WiFi enabled" +msgid "Networking enabled" +msgstr "Tinklas įjungtas" + +#: ../cli/src/network-manager.c:256 +#, c-format +#| msgid "Error: invalid 'wwan' parameter: '%s'." +msgid "Error: invalid 'enable' parameter: '%s'; use 'true' or 'false'." +msgstr "" +"Klaida: netinkamas „enable“ parametras: „%s“; naudokite „true“ arba „false“." + +#: ../cli/src/network-manager.c:265 +#, c-format +#| msgid "Error: Could not connect to NetworkManager." +msgid "Error: Sleeping status is not exported by NetworkManager." +msgstr "Klaida: „NetworkManager“ nepateikia informacijos apie miego būseną." + +#: ../cli/src/network-manager.c:273 +#, c-format +#| msgid "Error: invalid 'wifi' parameter: '%s'." +msgid "Error: invalid 'sleep' parameter: '%s'; use 'true' or 'false'." +msgstr "" +"Klaida: netinkamas „sleep“ parametras: „%s“; naudokite „true“ arba „false“." + +#: ../cli/src/network-manager.c:294 msgid "WiFi enabled" msgstr "WiFi įjungtas" -#: ../cli/src/network-manager.c:220 +#: ../cli/src/network-manager.c:305 #, c-format msgid "Error: invalid 'wifi' parameter: '%s'." msgstr "Klaida: netinkamas „wifi“ parametras: „%s“." -#: ../cli/src/network-manager.c:241 +#: ../cli/src/network-manager.c:326 msgid "WWAN enabled" msgstr "WWAN įjungta" -#: ../cli/src/network-manager.c:252 +#: ../cli/src/network-manager.c:337 #, c-format msgid "Error: invalid 'wwan' parameter: '%s'." msgstr "Klaida: netinkamas „wwan“ parametras: „%s“." -#: ../cli/src/network-manager.c:263 +#: ../cli/src/network-manager.c:348 #, c-format msgid "Error: 'nm' command '%s' is not valid." msgstr "Klaida: netinkama „nm“ komanda „%s“." @@ -1014,7 +1096,8 @@ msgstr "Klaida: parinktis „--terse“ nurodyta antrą kartą." #: ../cli/src/nmcli.c:148 #, c-format msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." -msgstr "Klaida: parinktis „--terse“ yra tarpusavyje nesuderinama su „--pretty“." +msgstr "" +"Klaida: parinktis „--terse“ yra tarpusavyje nesuderinama su „--pretty“." #: ../cli/src/nmcli.c:156 #, c-format @@ -1024,7 +1107,8 @@ msgstr "Klaida: parinktis „--pretty“ nurodyta antrą kartą." #: ../cli/src/nmcli.c:161 #, c-format msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." -msgstr "Klaida: parinktis „--pretty“ yra tarpusavyje nesuderinama su „--terse“." +msgstr "" +"Klaida: parinktis „--pretty“ yra tarpusavyje nesuderinama su „--terse“." #: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 #, c-format @@ -1480,26 +1564,26 @@ msgstr "Nepavyko patvirtinti PKCS#12 failo: %d" msgid "Could not generate random data." msgstr "Nepavyko sugeneruoti atsitiktinių duomenų." -#: ../libnm-util/nm-utils.c:1925 +#: ../libnm-util/nm-utils.c:1975 #, c-format msgid "Not enough memory to make encryption key." msgstr "Nepakanka atminties šifravimo raktui sukurti." -#: ../libnm-util/nm-utils.c:2035 +#: ../libnm-util/nm-utils.c:2085 msgid "Could not allocate memory for PEM file creation." msgstr "Nepakanka atminties PEM failui sukurti." -#: ../libnm-util/nm-utils.c:2047 +#: ../libnm-util/nm-utils.c:2097 #, c-format msgid "Could not allocate memory for writing IV to PEM file." msgstr "Nepakanka atminties IV įrašyti į PEM failą." -#: ../libnm-util/nm-utils.c:2059 +#: ../libnm-util/nm-utils.c:2109 #, c-format msgid "Could not allocate memory for writing encrypted key to PEM file." msgstr "Nepakanka atminties šifruotam raktui įrašyti į PEM failą." -#: ../libnm-util/nm-utils.c:2078 +#: ../libnm-util/nm-utils.c:2128 #, c-format msgid "Could not allocate memory for PEM file data." msgstr "Nepakanka atminties PEM failo duomenims." @@ -1634,23 +1718,23 @@ msgstr "nepavyko prisijungti prie netlink grupės: %s" msgid "error updating link cache: %s" msgstr "klaida atnaujinant saito podėlį: %s" -#: ../src/main.c:502 +#: ../src/main.c:499 #, c-format msgid "Invalid option. Please use --help to see a list of valid options.\n" msgstr "" "Netinkama parinktis. Galimų parinkčių sąrašą galite pamatyti naudodami " "parametrą --help.\n" -#: ../src/main.c:568 +#: ../src/main.c:570 #, c-format msgid "%s. Please use --help to see a list of valid options.\n" msgstr "%s. Naudokite --help, galimų parinkčių sąrašui gauti.\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:328 msgid "# Created by NetworkManager\n" msgstr "# Sukurta NetworkManager programos\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:344 #, c-format msgid "" "# Merged from %s\n" @@ -1659,19 +1743,19 @@ msgstr "" "# Sulieta iš %s\n" "\n" -#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 msgid "no usable DHCP client could be found." msgstr "nerastas veikiantis DHCP klientas." -#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 msgid "'dhclient' could be found." msgstr "nerastas „dhclient“." -#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 msgid "'dhcpcd' could be found." msgstr "nerastas „dhcpcd“." -#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 #, c-format msgid "unsupported DHCP client '%s'" msgstr "nepalaikomas DHCP klientas „%s“." @@ -1686,13 +1770,13 @@ msgstr "Nežinomas žurnalo vedimo lygis „%s“" msgid "Unknown log domain '%s'" msgstr "Nežinoma žurnalo sritis „%s“" -#: ../src/dns-manager/nm-dns-manager.c:350 +#: ../src/dns-manager/nm-dns-manager.c:384 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "PASTABA: libc adresų nustatymo funkcija gali nepalaikyti daugiau nei 3 vardų " "serverių." -#: ../src/dns-manager/nm-dns-manager.c:352 +#: ../src/dns-manager/nm-dns-manager.c:386 msgid "The nameservers listed below may not be recognized." msgstr "Žemiau pateikti vardų serveriai gali būti neatpažinti." @@ -1701,7 +1785,8 @@ msgstr "Žemiau pateikti vardų serveriai gali būti neatpažinti." msgid "Auto %s" msgstr "Automatinis %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:3275 +#: ../system-settings/plugins/ifcfg-rh/reader.c:3412 +#: ../system-settings/plugins/ifnet/connection_parser.c:49 msgid "System" msgstr "Sistema" -- cgit v1.2.1 From 8b006f331dc28f61cf063b2e8415305041e0ca7c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 21 Oct 2010 13:34:40 -0500 Subject: dhcp: add support for Fedora dhclient RFC3442 routes (rh #639935) Add support for Fedora's dhclient's built-in RFC3442 classless static routes format. Since the Fedora format uses the same name as the dhcpcd format, we need to refactor a bunch of the code to ensure we can distinguish between the types. Do this at runtime now by consolidating the classless static routes parsing code into the DHCP Client base class and rework the unit tests so that we can test all variations of the classless static route parsing code at the same time. This also fixes a bug with the dhcpcd classless static route gateway handling that would return the wrong gateway address. Many thanks to Jiri Popelka from Red Hat for the initial patch and explanations. --- src/dhcp-manager/nm-dhcp-client.c | 250 ++++++++++++++++++- src/dhcp-manager/nm-dhcp-client.h | 9 - src/dhcp-manager/nm-dhcp-dhclient.c | 131 ---------- src/dhcp-manager/nm-dhcp-dhcpcd.c | 78 ------ src/tests/test-dhcp-options.c | 478 ++++++++++++++++++++++-------------- 5 files changed, 534 insertions(+), 412 deletions(-) diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c index 28b2c78fe2..0c7f3d49b5 100644 --- a/src/dhcp-manager/nm-dhcp-client.c +++ b/src/dhcp-manager/nm-dhcp-client.c @@ -18,6 +18,7 @@ */ #include +#include #include #include #include @@ -647,6 +648,243 @@ nm_dhcp_client_foreach_option (NMDHCPClient *self, /********************************************/ +static gboolean +ip4_process_dhcpcd_rfc3442_routes (const char *str, + NMIP4Config *ip4_config, + guint32 *gwaddr) +{ + char **routes, **r; + gboolean have_routes = FALSE; + + routes = g_strsplit (str, " ", 0); + if (g_strv_length (routes) == 0) + goto out; + + if ((g_strv_length (routes) % 2) != 0) { + nm_log_warn (LOGD_DHCP4, " classless static routes provided, but invalid"); + goto out; + } + + for (r = routes; *r; r += 2) { + char *slash; + NMIP4Route *route; + int rt_cidr = 32; + struct in_addr rt_addr; + struct in_addr rt_route; + + slash = strchr(*r, '/'); + if (slash) { + *slash = '\0'; + errno = 0; + rt_cidr = strtol (slash + 1, NULL, 10); + if ((errno == EINVAL) || (errno == ERANGE)) { + nm_log_warn (LOGD_DHCP4, "DHCP provided invalid classless static route cidr: '%s'", slash + 1); + continue; + } + } + if (inet_pton (AF_INET, *r, &rt_addr) <= 0) { + nm_log_warn (LOGD_DHCP4, "DHCP provided invalid classless static route address: '%s'", *r); + continue; + } + if (inet_pton (AF_INET, *(r + 1), &rt_route) <= 0) { + nm_log_warn (LOGD_DHCP4, "DHCP provided invalid classless static route gateway: '%s'", *(r + 1)); + continue; + } + + have_routes = TRUE; + if (rt_cidr == 0 && rt_addr.s_addr == 0) { + /* FIXME: how to handle multiple routers? */ + *gwaddr = rt_route.s_addr; + } else { + route = nm_ip4_route_new (); + nm_ip4_route_set_dest (route, (guint32) rt_addr.s_addr); + nm_ip4_route_set_prefix (route, rt_cidr); + nm_ip4_route_set_next_hop (route, (guint32) rt_route.s_addr); + + nm_ip4_config_take_route (ip4_config, route); + nm_log_info (LOGD_DHCP4, " classless static route %s/%d gw %s", *r, rt_cidr, *(r + 1)); + } + } + +out: + g_strfreev (routes); + return have_routes; +} + +static const char ** +process_dhclient_rfc3442_route (const char **octets, NMIP4Route **out_route) +{ + const char **o = octets; + int addr_len = 0, i = 0; + long int tmp; + NMIP4Route *route; + char *next_hop; + struct in_addr tmp_addr; + + if (!*o) + return o; /* no prefix */ + + tmp = strtol (*o, NULL, 10); + if (tmp < 0 || tmp > 32) /* 32 == max IP4 prefix length */ + return o; + + route = nm_ip4_route_new (); + nm_ip4_route_set_prefix (route, (guint32) tmp); + o++; + + if (tmp > 0) + addr_len = ((tmp - 1) / 8) + 1; + + /* ensure there's at least the address + next hop left */ + if (g_strv_length ((char **) o) < addr_len + 4) + goto error; + + if (tmp) { + const char *addr[4] = { "0", "0", "0", "0" }; + char *str_addr; + + for (i = 0; i < addr_len; i++) + addr[i] = *o++; + + str_addr = g_strjoin (".", addr[0], addr[1], addr[2], addr[3], NULL); + if (inet_pton (AF_INET, str_addr, &tmp_addr) <= 0) { + g_free (str_addr); + goto error; + } + tmp_addr.s_addr &= nm_utils_ip4_prefix_to_netmask ((guint32) tmp); + nm_ip4_route_set_dest (route, tmp_addr.s_addr); + } + + /* Handle next hop */ + next_hop = g_strjoin (".", o[0], o[1], o[2], o[3], NULL); + if (inet_pton (AF_INET, next_hop, &tmp_addr) <= 0) { + g_free (next_hop); + goto error; + } + nm_ip4_route_set_next_hop (route, tmp_addr.s_addr); + g_free (next_hop); + + *out_route = route; + return o + 4; /* advance to past the next hop */ + +error: + nm_ip4_route_unref (route); + return o; +} + +static gboolean +ip4_process_dhclient_rfc3442_routes (const char *str, + NMIP4Config *ip4_config, + guint32 *gwaddr) +{ + char **octets, **o; + gboolean have_routes = FALSE; + NMIP4Route *route = NULL; + + o = octets = g_strsplit_set (str, " .", 0); + if (g_strv_length (octets) < 5) { + nm_log_warn (LOGD_DHCP4, "ignoring invalid classless static routes '%s'", str); + goto out; + } + + while (*o) { + route = NULL; + o = (char **) process_dhclient_rfc3442_route ((const char **) o, &route); + if (!route) { + nm_log_warn (LOGD_DHCP4, "ignoring invalid classless static routes"); + break; + } + + have_routes = TRUE; + if (nm_ip4_route_get_prefix (route) == 0) { + /* gateway passed as classless static route */ + *gwaddr = nm_ip4_route_get_next_hop (route); + nm_ip4_route_unref (route); + } else { + char addr[INET_ADDRSTRLEN + 1]; + char nh[INET_ADDRSTRLEN + 1]; + struct in_addr tmp; + + /* normal route */ + nm_ip4_config_take_route (ip4_config, route); + + tmp.s_addr = nm_ip4_route_get_dest (route); + inet_ntop (AF_INET, &tmp, addr, sizeof (addr)); + tmp.s_addr = nm_ip4_route_get_next_hop (route); + inet_ntop (AF_INET, &tmp, nh, sizeof (nh)); + nm_log_info (LOGD_DHCP4, " classless static route %s/%d gw %s", + addr, nm_ip4_route_get_prefix (route), nh); + } + } + +out: + g_strfreev (octets); + return have_routes; +} + +static gboolean +ip4_process_classless_routes (GHashTable *options, + NMIP4Config *ip4_config, + guint32 *gwaddr) +{ + const char *str, *p; + + g_return_val_if_fail (options != NULL, FALSE); + g_return_val_if_fail (ip4_config != NULL, FALSE); + + *gwaddr = 0; + + /* dhcpd/dhclient in Fedora has support for rfc3442 implemented using a + * slightly different format: + * + * option classless-static-routes = array of (destination-descriptor ip-address); + * + * which results in: + * + * 0 192.168.0.113 25.129.210.177.132 192.168.0.113 7.2 10.34.255.6 + * + * dhcpcd supports classless static routes natively and uses this same + * option identifier with the following format: + * + * 192.168.10.0/24 192.168.1.1 10.0.0.0/8 10.17.66.41 + */ + str = g_hash_table_lookup (options, "new_classless_static_routes"); + + /* dhclient doesn't have actual support for rfc3442 classless static routes + * upstream. Thus, people resort to defining the option in dhclient.conf + * and using arbitrary formats like so: + * + * option rfc3442-classless-static-routes code 121 = array of unsigned integer 8; + * + * See https://lists.isc.org/pipermail/dhcp-users/2008-December/007629.html + */ + if (!str) + str = g_hash_table_lookup (options, "new_rfc3442_classless_static_routes"); + + /* Microsoft version; same as rfc3442 but with a different option # (249) */ + if (!str) + str = g_hash_table_lookup (options, "new_ms_classless_static_routes"); + + if (!str || !strlen (str)) + return FALSE; + + p = str; + while (*p) { + if (!isdigit (*p) && (*p != ' ') && (*p != '.') && (*p != '/')) { + nm_log_warn (LOGD_DHCP4, "ignoring invalid classless static routes '%s'", str); + return FALSE; + } + p++; + }; + + if (strchr (str, '/')) { + /* dhcpcd format */ + return ip4_process_dhcpcd_rfc3442_routes (str, ip4_config, gwaddr); + } + + return ip4_process_dhclient_rfc3442_routes (str, ip4_config, gwaddr); +} + static void process_classful_routes (GHashTable *options, NMIP4Config *ip4_config) { @@ -747,7 +985,6 @@ ip4_options_to_config (NMDHCPClient *self) NMIP4Address *addr = NULL; char *str = NULL; guint32 gwaddr = 0, prefix = 0; - gboolean have_classless = FALSE; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL); @@ -788,17 +1025,8 @@ ip4_options_to_config (NMDHCPClient *self) /* Routes: if the server returns classless static routes, we MUST ignore * the 'static_routes' option. */ - if (NM_DHCP_CLIENT_GET_CLASS (self)->ip4_process_classless_routes) { - have_classless = NM_DHCP_CLIENT_GET_CLASS (self)->ip4_process_classless_routes (self, - priv->options, - ip4_config, - &gwaddr); - } - - if (!have_classless) { - gwaddr = 0; /* Ensure client code doesn't lie */ + if (!ip4_process_classless_routes (priv->options, ip4_config, &gwaddr)) process_classful_routes (priv->options, ip4_config); - } if (gwaddr) { char buf[INET_ADDRSTRLEN + 1]; diff --git a/src/dhcp-manager/nm-dhcp-client.h b/src/dhcp-manager/nm-dhcp-client.h index 8c2d465310..f357170b9c 100644 --- a/src/dhcp-manager/nm-dhcp-client.h +++ b/src/dhcp-manager/nm-dhcp-client.h @@ -76,15 +76,6 @@ typedef struct { /* Methods */ - /* Given the options table, extract any classless routes, add them to - * the IP4 config and return TRUE if any existed. If a gateway was sent - * as a classless route return that in out_gwaddr. - */ - gboolean (*ip4_process_classless_routes) (NMDHCPClient *self, - GHashTable *options, - NMIP4Config *ip4_config, - guint32 *out_gwaddr); - GPid (*ip4_start) (NMDHCPClient *self, NMSettingIP4Config *s_ip4, guint8 *anycast_addr, diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c index 091ae2f989..d8781524e9 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.c +++ b/src/dhcp-manager/nm-dhcp-dhclient.c @@ -635,136 +635,6 @@ real_stop (NMDHCPClient *client) remove (priv->pid_file); } -static const char ** -process_rfc3442_route (const char **octets, NMIP4Route **out_route) -{ - const char **o = octets; - int addr_len = 0, i = 0; - long int tmp; - NMIP4Route *route; - char *next_hop; - struct in_addr tmp_addr; - - if (!*o) - return o; /* no prefix */ - - tmp = strtol (*o, NULL, 10); - if (tmp < 0 || tmp > 32) /* 32 == max IP4 prefix length */ - return o; - - route = nm_ip4_route_new (); - nm_ip4_route_set_prefix (route, (guint32) tmp); - o++; - - if (tmp > 0) - addr_len = ((tmp - 1) / 8) + 1; - - /* ensure there's at least the address + next hop left */ - if (g_strv_length ((char **) o) < addr_len + 4) - goto error; - - if (tmp) { - const char *addr[4] = { "0", "0", "0", "0" }; - char *str_addr; - - for (i = 0; i < addr_len; i++) - addr[i] = *o++; - - str_addr = g_strjoin (".", addr[0], addr[1], addr[2], addr[3], NULL); - if (inet_pton (AF_INET, str_addr, &tmp_addr) <= 0) { - g_free (str_addr); - goto error; - } - tmp_addr.s_addr &= nm_utils_ip4_prefix_to_netmask ((guint32) tmp); - nm_ip4_route_set_dest (route, tmp_addr.s_addr); - } - - /* Handle next hop */ - next_hop = g_strjoin (".", o[0], o[1], o[2], o[3], NULL); - if (inet_pton (AF_INET, next_hop, &tmp_addr) <= 0) { - g_free (next_hop); - goto error; - } - nm_ip4_route_set_next_hop (route, tmp_addr.s_addr); - g_free (next_hop); - - *out_route = route; - return o + 4; /* advance to past the next hop */ - -error: - nm_ip4_route_unref (route); - return o; -} - -static gboolean -real_ip4_process_classless_routes (NMDHCPClient *client, - GHashTable *options, - NMIP4Config *ip4_config, - guint32 *gwaddr) -{ - const char *str; - char **octets, **o; - gboolean have_routes = FALSE; - NMIP4Route *route = NULL; - - /* dhclient doesn't have actual support for rfc3442 classless static routes - * upstream. Thus, people resort to defining the option in dhclient.conf - * and using arbitrary formats like so: - * - * option rfc3442-classless-static-routes code 121 = array of unsigned integer 8; - * - * See https://lists.isc.org/pipermail/dhcp-users/2008-December/007629.html - */ - - str = g_hash_table_lookup (options, "new_rfc3442_classless_static_routes"); - /* Microsoft version; same as rfc3442 but with a different option # (249) */ - if (!str) - str = g_hash_table_lookup (options, "new_ms_classless_static_routes"); - - if (!str || !strlen (str)) - return FALSE; - - o = octets = g_strsplit (str, " ", 0); - if (g_strv_length (octets) < 5) { - nm_log_warn (LOGD_DHCP4, "ignoring invalid classless static routes '%s'", str); - goto out; - } - - while (*o) { - route = NULL; - o = (char **) process_rfc3442_route ((const char **) o, &route); - if (!route) { - nm_log_warn (LOGD_DHCP4, "ignoring invalid classless static routes"); - break; - } - - have_routes = TRUE; - if (nm_ip4_route_get_prefix (route) == 0) { - /* gateway passed as classless static route */ - *gwaddr = nm_ip4_route_get_next_hop (route); - nm_ip4_route_unref (route); - } else { - char addr[INET_ADDRSTRLEN + 1]; - char nh[INET_ADDRSTRLEN + 1]; - struct in_addr tmp; - - /* normal route */ - nm_ip4_config_take_route (ip4_config, route); - - tmp.s_addr = nm_ip4_route_get_dest (route); - inet_ntop (AF_INET, &tmp, addr, sizeof (addr)); - tmp.s_addr = nm_ip4_route_get_next_hop (route); - inet_ntop (AF_INET, &tmp, nh, sizeof (nh)); - nm_log_info (LOGD_DHCP4, " classless static route %s/%d gw %s", - addr, nm_ip4_route_get_prefix (route), nh); - } - } - -out: - g_strfreev (octets); - return have_routes; -} - /***************************************************/ static void @@ -801,6 +671,5 @@ nm_dhcp_dhclient_class_init (NMDHCPDhclientClass *dhclient_class) client_class->ip4_start = real_ip4_start; client_class->ip6_start = real_ip6_start; client_class->stop = real_stop; - client_class->ip4_process_classless_routes = real_ip4_process_classless_routes; } diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.c b/src/dhcp-manager/nm-dhcp-dhcpcd.c index c9fdc956e3..378a97b611 100644 --- a/src/dhcp-manager/nm-dhcp-dhcpcd.c +++ b/src/dhcp-manager/nm-dhcp-dhcpcd.c @@ -179,83 +179,6 @@ real_stop (NMDHCPClient *client) remove (priv->pid_file); } -static gboolean -real_ip4_process_classless_routes (NMDHCPClient *client, - GHashTable *options, - NMIP4Config *ip4_config, - guint32 *gwaddr) -{ - const char *str; - char **routes, **r; - gboolean have_routes = FALSE; - - /* Classless static routes over-ride any static routes and routers - * provided. We should also check for MS classless static routes as - * they implemented the draft RFC using their own code. - */ - str = g_hash_table_lookup (options, "new_classless_static_routes"); - if (!str) - str = g_hash_table_lookup (options, "new_ms_classless_static_routes"); - - if (!str || !strlen (str)) - return FALSE; - - routes = g_strsplit (str, " ", 0); - if (g_strv_length (routes) == 0) - goto out; - - if ((g_strv_length (routes) % 2) != 0) { - nm_log_warn (LOGD_DHCP4, " classless static routes provided, but invalid"); - goto out; - } - - for (r = routes; *r; r += 2) { - char *slash; - NMIP4Route *route; - int rt_cidr = 32; - struct in_addr rt_addr; - struct in_addr rt_route; - - slash = strchr(*r, '/'); - if (slash) { - *slash = '\0'; - errno = 0; - rt_cidr = strtol (slash + 1, NULL, 10); - if ((errno == EINVAL) || (errno == ERANGE)) { - nm_log_warn (LOGD_DHCP4, "DHCP provided invalid classless static route cidr: '%s'", slash + 1); - continue; - } - } - if (inet_pton (AF_INET, *r, &rt_addr) <= 0) { - nm_log_warn (LOGD_DHCP4, "DHCP provided invalid classless static route address: '%s'", *r); - continue; - } - if (inet_pton (AF_INET, *(r + 1), &rt_route) <= 0) { - nm_log_warn (LOGD_DHCP4, "DHCP provided invalid classless static route gateway: '%s'", *(r + 1)); - continue; - } - - have_routes = TRUE; - if (rt_cidr == 0 && rt_addr.s_addr == 0) { - /* FIXME: how to handle multiple routers? */ - *gwaddr = rt_addr.s_addr; - } else { - route = nm_ip4_route_new (); - nm_ip4_route_set_dest (route, (guint32) rt_addr.s_addr); - nm_ip4_route_set_prefix (route, rt_cidr); - nm_ip4_route_set_next_hop (route, (guint32) rt_route.s_addr); - - - nm_ip4_config_take_route (ip4_config, route); - nm_log_info (LOGD_DHCP4, " classless static route %s/%d gw %s", *r, rt_cidr, *(r + 1)); - } - } - -out: - g_strfreev (routes); - return have_routes; -} - /***************************************************/ static void @@ -290,6 +213,5 @@ nm_dhcp_dhcpcd_class_init (NMDHCPDhcpcdClass *dhcpcd_class) client_class->ip4_start = real_ip4_start; client_class->ip6_start = real_ip6_start; client_class->stop = real_stop; - client_class->ip4_process_classless_routes = real_ip4_process_classless_routes; } diff --git a/src/tests/test-dhcp-options.c b/src/tests/test-dhcp-options.c index dd1f914959..aa85f87e70 100644 --- a/src/tests/test-dhcp-options.c +++ b/src/tests/test-dhcp-options.c @@ -250,300 +250,406 @@ test_wins_options (const char *client) g_hash_table_destroy (options); } -static Option classless_routes_options[] = { - /* For dhclient */ - { "new_rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 8 10 10 17 66 41" }, - /* For dhcpcd */ - { "new_classless_static_routes", "192.168.10.0/24 192.168.1.1 10.0.0.0/8 10.17.66.41" }, - { NULL, NULL } -}; +static void +ip4_test_route (const char *test, + NMIP4Config *ip4_config, + guint route_num, + const char *expected_dest, + const char *expected_gw, + guint expected_prefix) +{ + NMIP4Route *route; + struct in_addr tmp; + + route = nm_ip4_config_get_route (ip4_config, route_num); + ASSERT (inet_pton (AF_INET, expected_dest, &tmp) > 0, + test, "couldn't convert expected route destination #1"); + ASSERT (nm_ip4_route_get_dest (route) == tmp.s_addr, + test, "unexpected route %d destination", route_num + 1); + + ASSERT (inet_pton (AF_INET, expected_gw, &tmp) > 0, + test, "couldn't convert expected route next hop %d", + route_num + 1); + ASSERT (nm_ip4_route_get_next_hop (route) == tmp.s_addr, + test, "unexpected route %d next hop", route_num + 1); + + ASSERT (nm_ip4_route_get_prefix (route) == expected_prefix, + test, "unexpected route %d prefix", route_num + 1); + ASSERT (nm_ip4_route_get_metric (route) == 0, + test, "unexpected route %d metric", route_num + 1); +} static void -test_classless_static_routes (const char *client) +ip4_test_gateway (const char *test, + NMIP4Config *ip4_config, + const char *expected_gw) +{ + NMIP4Address *addr; + struct in_addr tmp; + + ASSERT (nm_ip4_config_get_num_addresses (ip4_config) == 1, + test, "unexpected number of IP addresses"); + addr = nm_ip4_config_get_address (ip4_config, 0); + ASSERT (inet_pton (AF_INET, expected_gw, &tmp) > 0, + test, "couldn't convert expected IP gateway"); + ASSERT (nm_ip4_address_get_gateway (addr) == tmp.s_addr, + test, "unexpected IP gateway"); +} + +static void +test_classless_static_routes_1 (const char *client) { GHashTable *options; NMIP4Config *ip4_config; - NMIP4Route *route; - struct in_addr tmp; const char *expected_route1_dest = "192.168.10.0"; const char *expected_route1_gw = "192.168.1.1"; const char *expected_route2_dest = "10.0.0.0"; const char *expected_route2_gw = "10.17.66.41"; + static Option data[] = { + /* dhclient custom format */ + { "new_rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 8 10 10 17 66 41" }, + { NULL, NULL } + }; options = fill_table (generic_options, NULL); - options = fill_table (classless_routes_options, options); + options = fill_table (data, options); ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); ASSERT (ip4_config != NULL, - "dhcp-rfc3442", "failed to parse DHCP4 options"); + "dhcp-classless-1", "failed to parse DHCP4 options"); /* IP4 routes */ ASSERT (nm_ip4_config_get_num_routes (ip4_config) == 2, - "dhcp-rfc3442", "unexpected number of IP routes"); + "dhcp-classless-1", "unexpected number of IP routes"); + ip4_test_route ("dhcp-classless-1", ip4_config, 0, + expected_route1_dest, expected_route1_gw, 24); + ip4_test_route ("dhcp-classless-1", ip4_config, 1, + expected_route2_dest, expected_route2_gw, 8); - /* Route #1 */ - route = nm_ip4_config_get_route (ip4_config, 0); - ASSERT (inet_pton (AF_INET, expected_route1_dest, &tmp) > 0, - "dhcp-rfc3442", "couldn't convert expected route destination #1"); - ASSERT (nm_ip4_route_get_dest (route) == tmp.s_addr, - "dhcp-rfc3442", "unexpected route #1 destination"); - - ASSERT (inet_pton (AF_INET, expected_route1_gw, &tmp) > 0, - "dhcp-rfc3442", "couldn't convert expected route next hop #1"); - ASSERT (nm_ip4_route_get_next_hop (route) == tmp.s_addr, - "dhcp-rfc3442", "unexpected route #1 next hop"); + g_hash_table_destroy (options); +} - ASSERT (nm_ip4_route_get_prefix (route) == 24, - "dhcp-rfc3442", "unexpected route #1 prefix"); - ASSERT (nm_ip4_route_get_metric (route) == 0, - "dhcp-rfc3442", "unexpected route #1 metric"); +static void +test_classless_static_routes_2 (const char *client) +{ + GHashTable *options; + NMIP4Config *ip4_config; + const char *expected_route1_dest = "192.168.10.0"; + const char *expected_route1_gw = "192.168.1.1"; + const char *expected_route2_dest = "10.0.0.0"; + const char *expected_route2_gw = "10.17.66.41"; + static Option data[] = { + /* dhcpcd format */ + { "new_classless_static_routes", "192.168.10.0/24 192.168.1.1 10.0.0.0/8 10.17.66.41" }, + { NULL, NULL } + }; - /* Route #2 */ - route = nm_ip4_config_get_route (ip4_config, 1); - ASSERT (inet_pton (AF_INET, expected_route2_dest, &tmp) > 0, - "dhcp-rfc3442", "couldn't convert expected route destination #2"); - ASSERT (nm_ip4_route_get_dest (route) == tmp.s_addr, - "dhcp-rfc3442", "unexpected route #2 destination"); + options = fill_table (generic_options, NULL); + options = fill_table (data, options); - ASSERT (inet_pton (AF_INET, expected_route2_gw, &tmp) > 0, - "dhcp-rfc3442", "couldn't convert expected route next hop #2"); - ASSERT (nm_ip4_route_get_next_hop (route) == tmp.s_addr, - "dhcp-rfc3442", "unexpected route #2 next hop"); + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); + ASSERT (ip4_config != NULL, + "dhcp-classless-2", "failed to parse DHCP4 options"); - ASSERT (nm_ip4_route_get_prefix (route) == 8, - "dhcp-rfc3442", "unexpected route #2 prefix"); - ASSERT (nm_ip4_route_get_metric (route) == 0, - "dhcp-rfc3442", "unexpected route #2 metric"); + /* IP4 routes */ + ASSERT (nm_ip4_config_get_num_routes (ip4_config) == 2, + "dhcp-classless-2", "unexpected number of IP routes"); + ip4_test_route ("dhcp-classless-2", ip4_config, 0, + expected_route1_dest, expected_route1_gw, 24); + ip4_test_route ("dhcp-classless-2", ip4_config, 1, + expected_route2_dest, expected_route2_gw, 8); g_hash_table_destroy (options); } -static Option invalid_classless_routes1[] = { - /* For dhclient */ - { "new_rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 45 10 17 66 41" }, - /* For dhcpcd */ - { "new_classless_static_routes", "192.168.10.0/24 192.168.1.1 10.0.adfadf/44 10.17.66.41" }, - { NULL, NULL } -}; +static void +test_fedora_dhclient_classless_static_routes (const char *client) +{ + GHashTable *options; + NMIP4Config *ip4_config; + const char *expected_route1_dest = "129.210.177.128"; + const char *expected_route1_gw = "192.168.0.113"; + const char *expected_route2_dest = "2.0.0.0"; + const char *expected_route2_gw = "10.34.255.6"; + const char *expected_gateway = "192.168.0.113"; + static Option data[] = { + /* Fedora dhclient format */ + { "new_classless_static_routes", "0 192.168.0.113 25.129.210.177.132 192.168.0.113 7.2 10.34.255.6" }, + { NULL, NULL } + }; + + options = fill_table (generic_options, NULL); + options = fill_table (data, options); + + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); + ASSERT (ip4_config != NULL, + "dhcp-fedora-dhclient-classless", "failed to parse DHCP4 options"); + + /* IP4 routes */ + ASSERT (nm_ip4_config_get_num_routes (ip4_config) == 2, + "dhcp-fedora-dhclient-classless", "unexpected number of IP routes"); + ip4_test_route ("dhcp-fedora-dhclient-classless", ip4_config, 0, + expected_route1_dest, expected_route1_gw, 25); + ip4_test_route ("dhcp-fedora-dhclient-classless", ip4_config, 1, + expected_route2_dest, expected_route2_gw, 7); + + /* Gateway */ + ip4_test_gateway ("dhcp-fedora-dhclient-classless", ip4_config, expected_gateway); + + g_hash_table_destroy (options); +} static void -test_invalid_classless_routes1 (const char *client) +test_dhclient_invalid_classless_routes_1 (const char *client) { GHashTable *options; NMIP4Config *ip4_config; - NMIP4Route *route; - struct in_addr tmp; const char *expected_route1_dest = "192.168.10.0"; const char *expected_route1_gw = "192.168.1.1"; + static Option data[] = { + /* dhclient format */ + { "new_rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 45 10 17 66 41" }, + { NULL, NULL } + }; options = fill_table (generic_options, NULL); - options = fill_table (invalid_classless_routes1, options); + options = fill_table (data, options); ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); ASSERT (ip4_config != NULL, - "dhcp-rfc3442-invalid-1", "failed to parse DHCP4 options"); + "dhcp-dhclient-classless-invalid-1", "failed to parse DHCP4 options"); /* IP4 routes */ ASSERT (nm_ip4_config_get_num_routes (ip4_config) == 1, - "dhcp-rfc3442-invalid-1", "unexpected number of IP routes"); + "dhcp-dhclient-classless-invalid-1", "unexpected number of IP routes"); - /* Route #1 */ - route = nm_ip4_config_get_route (ip4_config, 0); - ASSERT (inet_pton (AF_INET, expected_route1_dest, &tmp) > 0, - "dhcp-rfc3442-invalid-1", "couldn't convert expected route destination #1"); - ASSERT (nm_ip4_route_get_dest (route) == tmp.s_addr, - "dhcp-rfc3442-invalid-1", "unexpected route #1 destination"); + ip4_test_route ("dhcp-dhclient-classless-invalid-1", ip4_config, 0, + expected_route1_dest, expected_route1_gw, 24); - ASSERT (inet_pton (AF_INET, expected_route1_gw, &tmp) > 0, - "dhcp-rfc3442-invalid-1", "couldn't convert expected route next hop #1"); - ASSERT (nm_ip4_route_get_next_hop (route) == tmp.s_addr, - "dhcp-rfc3442-invalid-1", "unexpected route #1 next hop"); + g_hash_table_destroy (options); +} - ASSERT (nm_ip4_route_get_prefix (route) == 24, - "dhcp-rfc3442-invalid-1", "unexpected route #1 prefix"); - ASSERT (nm_ip4_route_get_metric (route) == 0, - "dhcp-rfc3442-invalid-1", "unexpected route #1 metric"); +static void +test_dhcpcd_invalid_classless_routes_1 (const char *client) +{ + GHashTable *options; + NMIP4Config *ip4_config; + const char *expected_route1_dest = "10.1.1.5"; + const char *expected_route1_gw = "10.1.1.1"; + const char *expected_route2_dest = "100.99.88.56"; + const char *expected_route2_gw = "10.1.1.1"; + static Option data[] = { + /* dhcpcd format */ + { "new_classless_static_routes", "192.168.10.0/24 192.168.1.1 10.0.adfadf/44 10.17.66.41" }, + { NULL, NULL } + }; + + options = fill_table (generic_options, NULL); + options = fill_table (data, options); + + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); + ASSERT (ip4_config != NULL, + "dhcp-dhcpcd-classless-invalid-1", "failed to parse DHCP4 options"); + + /* Test falling back to old-style static routes if the classless static + * routes are invalid. + */ + ASSERT (nm_ip4_config_get_num_routes (ip4_config) == 2, + "dhcp-dhcpcdp-classless-invalid-1", "unexpected number of routes"); + ip4_test_route ("dhcp-dhcpcdp-classless-invalid-1", ip4_config, 0, + expected_route1_dest, expected_route1_gw, 32); + ip4_test_route ("dhcp-dhcpcdp-classless-invalid-1", ip4_config, 1, + expected_route2_dest, expected_route2_gw, 32); g_hash_table_destroy (options); } -static Option invalid_classless_routes2[] = { - /* For dhclient */ - { "new_rfc3442_classless_static_routes", "45 10 17 66 41 24 192 168 10 192 168 1 1" }, - /* For dhcpcd */ - { "new_classless_static_routes", "10.0.adfadf/44 10.17.66.41 192.168.10.0/24 192.168.1.1" }, - { NULL, NULL } -}; - static void -test_invalid_classless_routes2 (const char *client) +test_dhclient_invalid_classless_routes_2 (const char *client) { GHashTable *options; NMIP4Config *ip4_config; - NMIP4Route *route; - struct in_addr tmp; const char *expected_route1_dest = "10.1.1.5"; const char *expected_route1_gw = "10.1.1.1"; const char *expected_route2_dest = "100.99.88.56"; const char *expected_route2_gw = "10.1.1.1"; + static Option data[] = { + { "new_rfc3442_classless_static_routes", "45 10 17 66 41 24 192 168 10 192 168 1 1" }, + { NULL, NULL } + }; options = fill_table (generic_options, NULL); - options = fill_table (invalid_classless_routes2, options); + options = fill_table (data, options); ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); ASSERT (ip4_config != NULL, - "dhcp-rfc3442-invalid-2", "failed to parse DHCP4 options"); + "dhcp-dhclient-classless-invalid-2", "failed to parse DHCP4 options"); /* Test falling back to old-style static routes if the classless static * routes are invalid. */ - - /* Routes */ ASSERT (nm_ip4_config_get_num_routes (ip4_config) == 2, - "dhcp-rfc3442-invalid-2", "unexpected number of routes"); + "dhcp-dhclient-classless-invalid-2", "unexpected number of routes"); + ip4_test_route ("dhcp-dhclient-classless-invalid-2", ip4_config, 0, + expected_route1_dest, expected_route1_gw, 32); + ip4_test_route ("dhcp-dhclient-classless-invalid-2", ip4_config, 1, + expected_route2_dest, expected_route2_gw, 32); - /* Route #1 */ - route = nm_ip4_config_get_route (ip4_config, 0); - ASSERT (inet_pton (AF_INET, expected_route1_dest, &tmp) > 0, - "dhcp-rfc3442-invalid-2", "couldn't convert expected route destination #1"); - ASSERT (nm_ip4_route_get_dest (route) == tmp.s_addr, - "dhcp-rfc3442-invalid-2", "unexpected route #1 destination"); + g_hash_table_destroy (options); +} - ASSERT (inet_pton (AF_INET, expected_route1_gw, &tmp) > 0, - "dhcp-rfc3442-invalid-2", "couldn't convert expected route next hop #1"); - ASSERT (nm_ip4_route_get_next_hop (route) == tmp.s_addr, - "dhcp-rfc3442-invalid-2", "unexpected route #1 next hop"); +static void +test_dhcpcd_invalid_classless_routes_2 (const char *client) +{ + GHashTable *options; + NMIP4Config *ip4_config; + const char *expected_route1_dest = "10.1.1.5"; + const char *expected_route1_gw = "10.1.1.1"; + const char *expected_route2_dest = "100.99.88.56"; + const char *expected_route2_gw = "10.1.1.1"; + static Option data[] = { + { "new_classless_static_routes", "10.0.adfadf/44 10.17.66.41 192.168.10.0/24 192.168.1.1" }, + { NULL, NULL } + }; - ASSERT (nm_ip4_route_get_prefix (route) == 32, - "dhcp-rfc3442-invalid-2", "unexpected route #1 prefix"); - ASSERT (nm_ip4_route_get_metric (route) == 0, - "dhcp-rfc3442-invalid-2", "unexpected route #1 metric"); + options = fill_table (generic_options, NULL); + options = fill_table (data, options); - /* Route #2 */ - route = nm_ip4_config_get_route (ip4_config, 1); - ASSERT (inet_pton (AF_INET, expected_route2_dest, &tmp) > 0, - "dhcp-rfc3442-invalid-2", "couldn't convert expected route destination #2"); - ASSERT (nm_ip4_route_get_dest (route) == tmp.s_addr, - "dhcp-rfc3442-invalid-2", "unexpected route #2 destination"); + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); + ASSERT (ip4_config != NULL, + "dhcp-dhcpcd-classless-invalid-2", "failed to parse DHCP4 options"); - ASSERT (inet_pton (AF_INET, expected_route2_gw, &tmp) > 0, - "dhcp-rfc3442-invalid-2", "couldn't convert expected route next hop #2"); - ASSERT (nm_ip4_route_get_next_hop (route) == tmp.s_addr, - "dhcp-rfc3442-invalid-2", "unexpected route #2 next hop"); + /* Test falling back to old-style static routes if the classless static + * routes are invalid. + */ - ASSERT (nm_ip4_route_get_prefix (route) == 32, - "dhcp-rfc3442-invalid-2", "unexpected route #2 prefix"); - ASSERT (nm_ip4_route_get_metric (route) == 0, - "dhcp-rfc3442-invalid-2", "unexpected route #2 metric"); + /* Routes */ + ASSERT (nm_ip4_config_get_num_routes (ip4_config) == 2, + "dhcp-dhcpcd-classless-invalid-2", "unexpected number of routes"); + ip4_test_route ("dhcp-dhcpcd-classless-invalid-2", ip4_config, 0, + expected_route1_dest, expected_route1_gw, 32); + ip4_test_route ("dhcp-dhcpcd-classless-invalid-2", ip4_config, 1, + expected_route2_dest, expected_route2_gw, 32); g_hash_table_destroy (options); } -static Option invalid_classless_routes3[] = { - /* For dhclient */ - { "new_rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 32 128 10 17 66 41" }, - /* For dhcpcd */ - { "new_classless_static_routes", "192.168.10.0/24 192.168.1.1 128/32 10.17.66.41" }, - { NULL, NULL } -}; - static void -test_invalid_classless_routes3 (const char *client) +test_dhclient_invalid_classless_routes_3 (const char *client) { GHashTable *options; NMIP4Config *ip4_config; - NMIP4Route *route; - struct in_addr tmp; const char *expected_route1_dest = "192.168.10.0"; const char *expected_route1_gw = "192.168.1.1"; + static Option data[] = { + { "new_rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 32 128 10 17 66 41" }, + { NULL, NULL } + }; options = fill_table (generic_options, NULL); - options = fill_table (invalid_classless_routes3, options); + options = fill_table (data, options); ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); ASSERT (ip4_config != NULL, - "dhcp-rfc3442-invalid-3", "failed to parse DHCP4 options"); + "dhcp-dhclient-classless-invalid-3", "failed to parse DHCP4 options"); /* IP4 routes */ ASSERT (nm_ip4_config_get_num_routes (ip4_config) == 1, - "dhcp-rfc3442-invalid-3", "unexpected number of IP routes"); + "dhcp-dhclient-classless-invalid-3", "unexpected number of IP routes"); + ip4_test_route ("dhcp-dhclient-classless-invalid-3", ip4_config, 0, + expected_route1_dest, expected_route1_gw, 24); - /* Route #1 */ - route = nm_ip4_config_get_route (ip4_config, 0); - ASSERT (inet_pton (AF_INET, expected_route1_dest, &tmp) > 0, - "dhcp-rfc3442-invalid-3", "couldn't convert expected route destination #1"); - ASSERT (nm_ip4_route_get_dest (route) == tmp.s_addr, - "dhcp-rfc3442-invalid-3", "unexpected route #1 destination"); + g_hash_table_destroy (options); +} - ASSERT (inet_pton (AF_INET, expected_route1_gw, &tmp) > 0, - "dhcp-rfc3442-invalid-3", "couldn't convert expected route next hop #1"); - ASSERT (nm_ip4_route_get_next_hop (route) == tmp.s_addr, - "dhcp-rfc3442-invalid-3", "unexpected route #1 next hop"); +static void +test_dhcpcd_invalid_classless_routes_3 (const char *client) +{ + GHashTable *options; + NMIP4Config *ip4_config; + const char *expected_route1_dest = "192.168.10.0"; + const char *expected_route1_gw = "192.168.1.1"; + static Option data[] = { + { "new_classless_static_routes", "192.168.10.0/24 192.168.1.1 128/32 10.17.66.41" }, + { NULL, NULL } + }; - ASSERT (nm_ip4_route_get_prefix (route) == 24, - "dhcp-rfc3442-invalid-3", "unexpected route #1 prefix"); - ASSERT (nm_ip4_route_get_metric (route) == 0, - "dhcp-rfc3442-invalid-3", "unexpected route #1 metric"); + options = fill_table (generic_options, NULL); + options = fill_table (data, options); + + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); + ASSERT (ip4_config != NULL, + "dhcp-dhcpcd-classless-invalid-3", "failed to parse DHCP4 options"); + + /* IP4 routes */ + ASSERT (nm_ip4_config_get_num_routes (ip4_config) == 1, + "dhcp-dhcpcd-classless-invalid-3", "unexpected number of IP routes"); + ip4_test_route ("dhcp-dhcpcd-classless-invalid-3", ip4_config, 0, + expected_route1_dest, expected_route1_gw, 24); g_hash_table_destroy (options); } -static Option gw_in_classless_routes[] = { - /* For dhclient */ - { "new_rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 0 192 2 3 4" }, - /* For dhcpcd */ - { "new_classless_static_routes", "192.168.10.0/24 192.168.1.1 0.0.0.0/0 192.2.3.4" }, - { NULL, NULL } -}; - static void -test_gateway_in_classless_routes (const char *client) +test_dhclient_gw_in_classless_routes (const char *client) { GHashTable *options; NMIP4Config *ip4_config; - NMIP4Address *addr; - NMIP4Route *route; - struct in_addr tmp; const char *expected_route1_dest = "192.168.10.0"; const char *expected_route1_gw = "192.168.1.1"; const char *expected_gateway = "192.2.3.4"; + static Option data[] = { + { "new_rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 0 192 2 3 4" }, + { NULL, NULL } + }; options = fill_table (generic_options, NULL); - options = fill_table (gw_in_classless_routes, options); + options = fill_table (data, options); ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); ASSERT (ip4_config != NULL, - "dhcp-rfc3442-gateway", "failed to parse DHCP4 options"); + "dhcp-dhclient-classless-gateway", "failed to parse DHCP4 options"); /* IP4 routes */ ASSERT (nm_ip4_config_get_num_routes (ip4_config) == 1, - "dhcp-rfc3442-gateway", "unexpected number of IP routes"); + "dhcp-dhclient-classless-gateway", "unexpected number of IP routes"); + ip4_test_route ("dhcp-dhclient-classless-gateway", ip4_config, 0, + expected_route1_dest, expected_route1_gw, 24); - /* Route #1 */ - route = nm_ip4_config_get_route (ip4_config, 0); - ASSERT (inet_pton (AF_INET, expected_route1_dest, &tmp) > 0, - "dhcp-rfc3442-gateway", "couldn't convert expected route destination #1"); - ASSERT (nm_ip4_route_get_dest (route) == tmp.s_addr, - "dhcp-rfc3442-gateway", "unexpected route #1 destination"); + /* Gateway */ + ip4_test_gateway ("dhcp-dhclient-classless-gateway", ip4_config, expected_gateway); - ASSERT (inet_pton (AF_INET, expected_route1_gw, &tmp) > 0, - "dhcp-rfc3442-gateway", "couldn't convert expected route next hop #1"); - ASSERT (nm_ip4_route_get_next_hop (route) == tmp.s_addr, - "dhcp-rfc3442-gateway", "unexpected route #1 next hop"); + g_hash_table_destroy (options); +} - ASSERT (nm_ip4_route_get_prefix (route) == 24, - "dhcp-rfc3442-gateway", "unexpected route #1 prefix"); - ASSERT (nm_ip4_route_get_metric (route) == 0, - "dhcp-rfc3442-gateway", "unexpected route #1 metric"); +static void +test_dhcpcd_gw_in_classless_routes (const char *client) +{ + GHashTable *options; + NMIP4Config *ip4_config; + const char *expected_route1_dest = "192.168.10.0"; + const char *expected_route1_gw = "192.168.1.1"; + const char *expected_gateway = "192.2.3.4"; + static Option data[] = { + { "new_classless_static_routes", "192.168.10.0/24 192.168.1.1 0.0.0.0/0 192.2.3.4" }, + { NULL, NULL } + }; - /* Address */ - ASSERT (nm_ip4_config_get_num_addresses (ip4_config) == 1, - "dhcp-rfc3442-gateway", "unexpected number of IP addresses"); - addr = nm_ip4_config_get_address (ip4_config, 0); - ASSERT (inet_pton (AF_INET, expected_gateway, &tmp) > 0, - "dhcp-rfc3442-gateway", "couldn't convert expected IP gateway"); - ASSERT (nm_ip4_address_get_gateway (addr) == tmp.s_addr, - "dhcp-rfc3442-gateway", "unexpected IP gateway"); + options = fill_table (generic_options, NULL); + options = fill_table (data, options); + + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); + ASSERT (ip4_config != NULL, + "dhcp-dhcpcd-classless-gateway", "failed to parse DHCP4 options"); + + /* IP4 routes */ + ASSERT (nm_ip4_config_get_num_routes (ip4_config) == 1, + "dhcp-dhcpcd-classless-gateway", "unexpected number of IP routes"); + ip4_test_route ("dhcp-dhcpcd-classless-gateway", ip4_config, 0, + expected_route1_dest, expected_route1_gw, 24); + + /* Gateway */ + ip4_test_gateway ("dhcp-dhcpcd-classless-gateway", ip4_config, expected_gateway); g_hash_table_destroy (options); } @@ -694,11 +800,17 @@ int main (int argc, char **argv) test_generic_options (client); test_wins_options (client); - test_classless_static_routes (client); - test_invalid_classless_routes1 (client); - test_invalid_classless_routes2 (client); - test_invalid_classless_routes3 (client); - test_gateway_in_classless_routes (client); + test_classless_static_routes_1 (client); + test_classless_static_routes_2 (client); + test_fedora_dhclient_classless_static_routes (client); + test_dhclient_invalid_classless_routes_1 (client); + test_dhcpcd_invalid_classless_routes_1 (client); + test_dhclient_invalid_classless_routes_2 (client); + test_dhcpcd_invalid_classless_routes_2 (client); + test_dhclient_invalid_classless_routes_3 (client); + test_dhcpcd_invalid_classless_routes_3 (client); + test_dhclient_gw_in_classless_routes (client); + test_dhcpcd_gw_in_classless_routes (client); test_escaped_domain_searches (client); test_invalid_escaped_domain_searches (client); test_ip4_missing_prefix (client, "192.168.1.10", 24); -- cgit v1.2.1 From bc76e40dec6b017c9886fd0c4bc19c6da62e43ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Tue, 26 Oct 2010 13:42:43 +0200 Subject: trivial: make connection activating error more precise --- src/nm-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 4a3e4997d9..8f3d1430fb 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -2891,7 +2891,7 @@ nm_manager_activate_connection (NMManager *manager, if (state < NM_DEVICE_STATE_DISCONNECTED) { g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_UNMANAGED_DEVICE, - "%s", "Device not managed by NetworkManager"); + "%s", "Device not managed by NetworkManager or unavailable"); return NULL; } -- cgit v1.2.1 From 4501e33b852be184a30cbdc2e49803d341db9d0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 1 Nov 2010 16:02:32 +0100 Subject: dispatcher: don't warn about invalid connection for 'hostname' action (rh #627649) --- callouts/nm-dispatcher-action.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/callouts/nm-dispatcher-action.c b/callouts/nm-dispatcher-action.c index 828d8be13c..8040853f7a 100644 --- a/callouts/nm-dispatcher-action.c +++ b/callouts/nm-dispatcher-action.c @@ -489,6 +489,10 @@ nm_dispatcher_action (Handler *h, if (!d->persist) d->quit_timeout = g_timeout_add_seconds (10, quit_timeout_cb, NULL); + /* Hostname changes don't require a device nor contain a connection */ + if (!strcmp (action, "hostname")) + goto dispatch; + connection = nm_connection_new_from_hash (connection_hash, error); if (connection) { NMSettingConnection *s_con; @@ -506,10 +510,6 @@ nm_dispatcher_action (Handler *h, *error = NULL; } - /* Hostname changes don't require a device */ - if (!strcmp (action, "hostname")) - goto dispatch; - /* interface name */ value = g_hash_table_lookup (device_props, NMD_DEVICE_PROPS_INTERFACE); if (!value || !G_VALUE_HOLDS_STRING (value)) { -- cgit v1.2.1 From 6e067a9d2bd5d5fc7bae18828c3deb39689f9e88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Tue, 2 Nov 2010 12:15:54 +0100 Subject: ifcfg-rh: ignore temporary files with ';[a-fA-F0-9]{8}' suffix created by rpm (rh #598203) --- system-settings/plugins/ifcfg-rh/common.h | 4 ++-- system-settings/plugins/ifcfg-rh/utils.c | 26 ++++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/common.h b/system-settings/plugins/ifcfg-rh/common.h index e7cd93e908..095e20e927 100644 --- a/system-settings/plugins/ifcfg-rh/common.h +++ b/system-settings/plugins/ifcfg-rh/common.h @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * (C) Copyright 2008 - 2009 Red Hat, Inc. + * (C) Copyright 2008 - 2010 Red Hat, Inc. */ #ifndef __COMMON_H__ @@ -39,7 +39,7 @@ #define IFCFG_DIR SYSCONFDIR"/sysconfig/network-scripts" #define IFCFG_PLUGIN_NAME "ifcfg-rh" -#define IFCFG_PLUGIN_INFO "(c) 2007 - 2008 Red Hat, Inc. To report bugs please use the NetworkManager mailing list." +#define IFCFG_PLUGIN_INFO "(c) 2007 - 2010 Red Hat, Inc. To report bugs please use the NetworkManager mailing list." #define TYPE_ETHERNET "Ethernet" #define TYPE_WIRELESS "Wireless" diff --git a/system-settings/plugins/ifcfg-rh/utils.c b/system-settings/plugins/ifcfg-rh/utils.c index 9e79ce0b42..92a0b802f0 100644 --- a/system-settings/plugins/ifcfg-rh/utils.c +++ b/system-settings/plugins/ifcfg-rh/utils.c @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * (C) Copyright 2008 - 2009 Red Hat, Inc. + * (C) Copyright 2008 - 2010 Red Hat, Inc. */ #include @@ -115,6 +115,27 @@ utils_hexstr2bin (const char *hex, size_t len) /* End from hostap */ +/* + * Check ';[a-fA-F0-9]{8}' file suffix used for temporary files by rpm when + * installing packages. + * + * Implementation taken from upstart. + */ +static gboolean +check_rpm_temp_suffix (const char *path) +{ + const char *ptr; + + g_return_val_if_fail (path != NULL, FALSE); + + /* Matches *;[a-fA-F0-9]{8}; used by rpm */ + ptr = strrchr (path, ';'); + if (ptr && (strspn (ptr + 1, "abcdefABCDEF0123456789") == 8) + && (! ptr[9])) + return TRUE; + return FALSE; +} + static gboolean check_suffix (const char *base, const char *tag) { @@ -162,7 +183,8 @@ utils_should_ignore_file (const char *filename, gboolean only_ifcfg) && !check_suffix (base, REJ_TAG) && !check_suffix (base, RPMNEW_TAG) && !check_suffix (base, AUGNEW_TAG) - && !check_suffix (base, AUGTMP_TAG)) + && !check_suffix (base, AUGTMP_TAG) + && !check_rpm_temp_suffix (base)) ignore = FALSE; g_free (base); -- cgit v1.2.1 From 607350294d6efff579220baba61e8e63b135cf03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Tue, 19 Oct 2010 11:10:17 +0200 Subject: core: update timestamp in active system connections every 5 mins (bgo #583756) This patch updates timestamps in system connections. The update occurs on connection activation and then periodically every 5 mins while the connection is active. It only works for plugins having write support and for writable connections (not read-only). --- src/nm-manager.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/src/nm-manager.c b/src/nm-manager.c index 8f3d1430fb..eb393facc4 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -245,6 +245,8 @@ typedef struct { guint fw_monitor_id; guint fw_changed_id; + guint timestamp_update_id; + gboolean disposed; } NMManagerPrivate; @@ -461,6 +463,45 @@ nm_manager_update_state (NMManager *manager) } } +static void +ignore_cb (NMSettingsConnectionInterface *connection, GError *error, gpointer user_data) +{ +} + +static void +update_active_connection_timestamp (NMManager *manager, NMDevice *device) +{ + NMActRequest *req; + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingsConnectionInterface *connection_interface; + NMManagerPrivate *priv; + + g_return_if_fail (NM_IS_DEVICE (device)); + + priv = NM_MANAGER_GET_PRIVATE (manager); + req = nm_device_get_act_request (device); + if (!req) + return; + + connection = nm_act_request_get_connection (req); + g_assert (connection); + + if (nm_connection_get_scope (connection) != NM_CONNECTION_SCOPE_SYSTEM) + return; + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (NM_CONNECTION (connection), NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + g_object_set (s_con, NM_SETTING_CONNECTION_TIMESTAMP, (guint64) time (NULL), NULL); + + if (nm_setting_connection_get_read_only (s_con)) + return; + + connection_interface = nm_settings_interface_get_connection_by_path (NM_SETTINGS_INTERFACE (priv->sys_settings), + nm_connection_get_path (connection)); + nm_settings_connection_interface_update (connection_interface, ignore_cb, NULL); +} + static void manager_device_state_changed (NMDevice *device, NMDeviceState new_state, @@ -483,6 +524,9 @@ manager_device_state_changed (NMDevice *device, } nm_manager_update_state (manager); + + if (new_state == NM_DEVICE_STATE_ACTIVATED) + update_active_connection_timestamp (manager, device); } /* Removes a device from a device list; returns the start of the new device list */ @@ -4333,6 +4377,11 @@ dispose (GObject *object) g_object_unref (priv->fw_monitor); } + if (priv->timestamp_update_id) { + g_source_remove (priv->timestamp_update_id); + priv->timestamp_update_id = 0; + } + G_OBJECT_CLASS (nm_manager_parent_class)->dispose (object); } @@ -4445,6 +4494,28 @@ get_property (GObject *object, guint prop_id, } } +static gboolean +periodic_update_active_connection_timestamps (gpointer user_data) +{ + NMManager *manager = NM_MANAGER (user_data); + GPtrArray *active; + int i; + + active = get_active_connections (manager, NULL); + + for (i = 0; i < active->len; i++) { + const char *active_path = g_ptr_array_index (active, i); + NMActRequest *req; + NMDevice *device = NULL; + + req = nm_manager_get_act_request_by_path (manager, active_path, &device); + if (device && nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) + update_active_connection_timestamp (manager, device); + } + + return TRUE; +} + static void nm_manager_init (NMManager *manager) { @@ -4583,6 +4654,9 @@ nm_manager_init (NMManager *manager) nm_log_warn (LOGD_CORE, "failed to monitor kernel firmware directory '%s'.", KERNEL_FIRMWARE_DIR); } + + /* Update timestamps in active connections */ + priv->timestamp_update_id = g_timeout_add_seconds (300, (GSourceFunc) periodic_update_active_connection_timestamps, manager); } static void -- cgit v1.2.1 From fe493ec91e582e1879684d33d43cd5eca390c409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Tue, 19 Oct 2010 19:32:01 +0200 Subject: core: add configurable auto connection retries (bgo #628825) Presently, when automatic connecting fails, the connection is marked as invalid and is not retried again. This commit adds a configuration parameter to specify how many times the connection should be re-tried. --- libnm-util/Makefile.am | 2 +- libnm-util/libnm-util.ver | 1 + libnm-util/nm-setting-connection.c | 56 ++++++++++++++++++++++++++++++++++---- libnm-util/nm-setting-connection.h | 30 ++++++++++---------- src/nm-policy.c | 37 +++++++++++++++++++++---- 5 files changed, 100 insertions(+), 26 deletions(-) diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am index f43fb60242..9cf2a06bac 100644 --- a/libnm-util/Makefile.am +++ b/libnm-util/Makefile.am @@ -59,7 +59,7 @@ libnm_util_la_SOURCES= \ libnm_util_la_LIBADD = $(GLIB_LIBS) $(DBUS_LIBS) $(UUID_LIBS) libnm_util_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-util.ver \ - -version-info "7:0:6" + -version-info "8:0:7" if WITH_GNUTLS libnm_util_la_SOURCES += crypto_gnutls.c diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver index 6c2b9fc71e..0cf3f12b1e 100644 --- a/libnm-util/libnm-util.ver +++ b/libnm-util/libnm-util.ver @@ -113,6 +113,7 @@ global: nm_setting_connection_get_uuid; nm_setting_connection_get_connection_type; nm_setting_connection_get_autoconnect; + nm_setting_connection_get_autoconnect_retries; nm_setting_connection_get_timestamp; nm_setting_connection_get_read_only; nm_setting_duplicate; diff --git a/libnm-util/nm-setting-connection.c b/libnm-util/nm-setting-connection.c index 65f613eba9..10f4b09a9d 100644 --- a/libnm-util/nm-setting-connection.c +++ b/libnm-util/nm-setting-connection.c @@ -19,7 +19,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2010 Red Hat, Inc. * (C) Copyright 2007 - 2008 Novell, Inc. */ @@ -86,6 +86,7 @@ typedef struct { char *uuid; char *type; gboolean autoconnect; + gint autoconnect_retries; guint64 timestamp; gboolean read_only; } NMSettingConnectionPrivate; @@ -96,6 +97,7 @@ enum { PROP_UUID, PROP_TYPE, PROP_AUTOCONNECT, + PROP_AUTOCONNECT_RETRIES, PROP_TIMESTAMP, PROP_READ_ONLY, @@ -178,6 +180,22 @@ nm_setting_connection_get_autoconnect (NMSettingConnection *setting) return NM_SETTING_CONNECTION_GET_PRIVATE (setting)->autoconnect; } +/** + * nm_setting_connection_get_autoconnect_retries: + * @setting: the #NMSettingConnection + * + * Returns the #NMSettingConnection:autoconnect-retries property of the connection. + * + * Returns: the connection's number of autoconnect retries + **/ +gint +nm_setting_connection_get_autoconnect_retries (NMSettingConnection *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_CONNECTION (setting), 0); + + return NM_SETTING_CONNECTION_GET_PRIVATE (setting)->autoconnect_retries; +} + /** * nm_setting_connection_get_timestamp: * @setting: the #NMSettingConnection @@ -334,6 +352,9 @@ set_property (GObject *object, guint prop_id, case PROP_AUTOCONNECT: priv->autoconnect = g_value_get_boolean (value); break; + case PROP_AUTOCONNECT_RETRIES: + priv->autoconnect_retries = g_value_get_int (value); + break; case PROP_TIMESTAMP: priv->timestamp = g_value_get_uint64 (value); break; @@ -365,6 +386,9 @@ get_property (GObject *object, guint prop_id, case PROP_AUTOCONNECT: g_value_set_boolean (value, nm_setting_connection_get_autoconnect (setting)); break; + case PROP_AUTOCONNECT_RETRIES: + g_value_set_int (value, nm_setting_connection_get_autoconnect_retries (setting)); + break; case PROP_TIMESTAMP: g_value_set_uint64 (value, nm_setting_connection_get_timestamp (setting)); break; @@ -469,19 +493,39 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class) * * Whether or not the connection should be automatically connected by * NetworkManager when the resources for the connection are available. - * %TRUE to automatically activate the connection, %FALSE to require manual - * intervention to activate the connection. Defaults to %TRUE. + * %TRUE to automatically activate the connection. It makes autoconnect-retries + * attempts at most in addition to the initial try. %FALSE to require + * manual intervention to activate the connection. Defaults to %TRUE. **/ g_object_class_install_property (object_class, PROP_AUTOCONNECT, g_param_spec_boolean (NM_SETTING_CONNECTION_AUTOCONNECT, "Autoconnect", "If TRUE, NetworkManager will activate this connection " - "when its network resources are available. If FALSE, " - "the connection must be manually activated by the user " - "or some other mechanism.", + "when its network resources are available. It makes " + "autoconnect-retries attempts at most when the initial " + "activation was not successful. If FALSE, the connection " + "must be manually activated by the user or some other " + "mechanism.", TRUE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE)); + /** + * NMSettingConnection:autoconnect-retries: + * + * How many retries should be made by NetworkManager to automatically + * connect, when the initial attempt was not successful. + * Special value is: -1: infinite. Defaults to 0. + **/ + g_object_class_install_property + (object_class, PROP_AUTOCONNECT_RETRIES, + g_param_spec_int (NM_SETTING_CONNECTION_AUTOCONNECT_RETRIES, + "Autoconnect-Retries", + "How many retries should be made by NetworkManager to " + "automatically connect, when the initial attempt was not " + "successful. Special value is -1 meaning infinite. " + "Defaults to 0.", + -1, G_MAXINT, 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE)); /** * NMSettingConnection:timestamp: diff --git a/libnm-util/nm-setting-connection.h b/libnm-util/nm-setting-connection.h index 6dedca220b..ad962a952b 100644 --- a/libnm-util/nm-setting-connection.h +++ b/libnm-util/nm-setting-connection.h @@ -19,7 +19,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2010 Red Hat, Inc. * (C) Copyright 2007 - 2008 Novell, Inc. */ @@ -68,12 +68,13 @@ GType nm_setting_connection_error_get_type (void); #define NM_SETTING_CONNECTION_ERROR nm_setting_connection_error_quark () GQuark nm_setting_connection_error_quark (void); -#define NM_SETTING_CONNECTION_ID "id" -#define NM_SETTING_CONNECTION_UUID "uuid" -#define NM_SETTING_CONNECTION_TYPE "type" -#define NM_SETTING_CONNECTION_AUTOCONNECT "autoconnect" -#define NM_SETTING_CONNECTION_TIMESTAMP "timestamp" -#define NM_SETTING_CONNECTION_READ_ONLY "read-only" +#define NM_SETTING_CONNECTION_ID "id" +#define NM_SETTING_CONNECTION_UUID "uuid" +#define NM_SETTING_CONNECTION_TYPE "type" +#define NM_SETTING_CONNECTION_AUTOCONNECT "autoconnect" +#define NM_SETTING_CONNECTION_AUTOCONNECT_RETRIES "autoconnect-retries" +#define NM_SETTING_CONNECTION_TIMESTAMP "timestamp" +#define NM_SETTING_CONNECTION_READ_ONLY "read-only" /** * NMSettingConnection: @@ -97,13 +98,14 @@ typedef struct { GType nm_setting_connection_get_type (void); -NMSetting * nm_setting_connection_new (void); -const char *nm_setting_connection_get_id (NMSettingConnection *setting); -const char *nm_setting_connection_get_uuid (NMSettingConnection *setting); -const char *nm_setting_connection_get_connection_type (NMSettingConnection *setting); -gboolean nm_setting_connection_get_autoconnect (NMSettingConnection *setting); -guint64 nm_setting_connection_get_timestamp (NMSettingConnection *setting); -gboolean nm_setting_connection_get_read_only (NMSettingConnection *setting); +NMSetting * nm_setting_connection_new (void); +const char *nm_setting_connection_get_id (NMSettingConnection *setting); +const char *nm_setting_connection_get_uuid (NMSettingConnection *setting); +const char *nm_setting_connection_get_connection_type (NMSettingConnection *setting); +gboolean nm_setting_connection_get_autoconnect (NMSettingConnection *setting); +gint nm_setting_connection_get_autoconnect_retries (NMSettingConnection *setting); +guint64 nm_setting_connection_get_timestamp (NMSettingConnection *setting); +gboolean nm_setting_connection_get_read_only (NMSettingConnection *setting); G_END_DECLS diff --git a/src/nm-policy.c b/src/nm-policy.c index e8a18d0262..d9be65c8a5 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -66,6 +66,7 @@ struct NMPolicy { }; #define INVALID_TAG "invalid" +#define RETRIES_TAG "autoconnect-retries" static const char * get_connection_id (NMConnection *connection) @@ -714,6 +715,19 @@ update_routing_and_dns (NMPolicy *policy, gboolean force_update) update_system_hostname (policy, policy->default_device4, policy->default_device6); } +static void +reset_auto_connection_retries (NMConnection *connection) +{ + NMSettingConnection *s_con; + int retries; + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + + retries = nm_setting_connection_get_autoconnect_retries (s_con); + g_object_set_data (G_OBJECT (connection), RETRIES_TAG, GINT_TO_POINTER (retries)); +} + typedef struct { NMPolicy *policy; NMDevice *device; @@ -744,17 +758,26 @@ auto_activate_device (gpointer user_data) if (nm_manager_auto_user_connections_allowed (policy->manager)) connections = g_slist_concat (connections, nm_manager_get_connections (policy->manager, NM_CONNECTION_SCOPE_USER)); - /* Remove connections that are in the invalid list. */ + /* Remove connections that have INVALID_TAG and shouldn't be retried any more. */ iter = connections; while (iter) { NMConnection *iter_connection = NM_CONNECTION (iter->data); GSList *next = g_slist_next (iter); if (g_object_get_data (G_OBJECT (iter_connection), INVALID_TAG)) { - connections = g_slist_remove_link (connections, iter); - g_object_unref (iter_connection); - g_slist_free (iter); + int retries = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (iter_connection), RETRIES_TAG)); + if (retries == 0) { + connections = g_slist_remove_link (connections, iter); + g_object_unref (iter_connection); + g_slist_free (iter); + } else if (retries > 0) { + g_object_set_data (G_OBJECT (iter_connection), RETRIES_TAG, GINT_TO_POINTER (retries-1)); + } + } else { + /* Set the initial # of retries for auto-connection */ + reset_auto_connection_retries (iter_connection); } + iter = next; } @@ -902,7 +925,8 @@ device_state_changed (NMDevice *device, */ if (connection && IS_ACTIVATING_STATE (old_state)) { g_object_set_data (G_OBJECT (connection), INVALID_TAG, GUINT_TO_POINTER (TRUE)); - nm_log_info (LOGD_DEVICE, "Marking connection '%s' invalid.", get_connection_id (connection)); + if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (connection), RETRIES_TAG)) == 0) + nm_log_info (LOGD_DEVICE, "Marking connection '%s' invalid.", get_connection_id (connection)); nm_connection_clear_secrets (connection); } schedule_activate_check (policy, device, 3); @@ -912,6 +936,9 @@ device_state_changed (NMDevice *device, /* Clear the invalid tag on the connection */ g_object_set_data (G_OBJECT (connection), INVALID_TAG, NULL); + /* Reset RETRIES_TAG to number from the setting */ + reset_auto_connection_retries (connection); + /* And clear secrets so they will always be requested from the * settings service when the next connection is made. */ -- cgit v1.2.1 From 3d8b6acabac935af2ac82a94ad495620f98c8453 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 3 Nov 2010 13:23:09 -0500 Subject: core: revert API parts of fe493ec91e582e1879684d33d43cd5eca390c409 And add a default autoconnect retries value. --- libnm-util/Makefile.am | 2 +- libnm-util/libnm-util.ver | 1 - libnm-util/nm-setting-connection.c | 56 ++++---------------------------------- libnm-util/nm-setting-connection.h | 30 ++++++++++---------- src/nm-policy.c | 30 ++++++++++---------- 5 files changed, 36 insertions(+), 83 deletions(-) diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am index 9cf2a06bac..f43fb60242 100644 --- a/libnm-util/Makefile.am +++ b/libnm-util/Makefile.am @@ -59,7 +59,7 @@ libnm_util_la_SOURCES= \ libnm_util_la_LIBADD = $(GLIB_LIBS) $(DBUS_LIBS) $(UUID_LIBS) libnm_util_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-util.ver \ - -version-info "8:0:7" + -version-info "7:0:6" if WITH_GNUTLS libnm_util_la_SOURCES += crypto_gnutls.c diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver index 0cf3f12b1e..6c2b9fc71e 100644 --- a/libnm-util/libnm-util.ver +++ b/libnm-util/libnm-util.ver @@ -113,7 +113,6 @@ global: nm_setting_connection_get_uuid; nm_setting_connection_get_connection_type; nm_setting_connection_get_autoconnect; - nm_setting_connection_get_autoconnect_retries; nm_setting_connection_get_timestamp; nm_setting_connection_get_read_only; nm_setting_duplicate; diff --git a/libnm-util/nm-setting-connection.c b/libnm-util/nm-setting-connection.c index 10f4b09a9d..65f613eba9 100644 --- a/libnm-util/nm-setting-connection.c +++ b/libnm-util/nm-setting-connection.c @@ -19,7 +19,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2007 - 2010 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Red Hat, Inc. * (C) Copyright 2007 - 2008 Novell, Inc. */ @@ -86,7 +86,6 @@ typedef struct { char *uuid; char *type; gboolean autoconnect; - gint autoconnect_retries; guint64 timestamp; gboolean read_only; } NMSettingConnectionPrivate; @@ -97,7 +96,6 @@ enum { PROP_UUID, PROP_TYPE, PROP_AUTOCONNECT, - PROP_AUTOCONNECT_RETRIES, PROP_TIMESTAMP, PROP_READ_ONLY, @@ -180,22 +178,6 @@ nm_setting_connection_get_autoconnect (NMSettingConnection *setting) return NM_SETTING_CONNECTION_GET_PRIVATE (setting)->autoconnect; } -/** - * nm_setting_connection_get_autoconnect_retries: - * @setting: the #NMSettingConnection - * - * Returns the #NMSettingConnection:autoconnect-retries property of the connection. - * - * Returns: the connection's number of autoconnect retries - **/ -gint -nm_setting_connection_get_autoconnect_retries (NMSettingConnection *setting) -{ - g_return_val_if_fail (NM_IS_SETTING_CONNECTION (setting), 0); - - return NM_SETTING_CONNECTION_GET_PRIVATE (setting)->autoconnect_retries; -} - /** * nm_setting_connection_get_timestamp: * @setting: the #NMSettingConnection @@ -352,9 +334,6 @@ set_property (GObject *object, guint prop_id, case PROP_AUTOCONNECT: priv->autoconnect = g_value_get_boolean (value); break; - case PROP_AUTOCONNECT_RETRIES: - priv->autoconnect_retries = g_value_get_int (value); - break; case PROP_TIMESTAMP: priv->timestamp = g_value_get_uint64 (value); break; @@ -386,9 +365,6 @@ get_property (GObject *object, guint prop_id, case PROP_AUTOCONNECT: g_value_set_boolean (value, nm_setting_connection_get_autoconnect (setting)); break; - case PROP_AUTOCONNECT_RETRIES: - g_value_set_int (value, nm_setting_connection_get_autoconnect_retries (setting)); - break; case PROP_TIMESTAMP: g_value_set_uint64 (value, nm_setting_connection_get_timestamp (setting)); break; @@ -493,39 +469,19 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class) * * Whether or not the connection should be automatically connected by * NetworkManager when the resources for the connection are available. - * %TRUE to automatically activate the connection. It makes autoconnect-retries - * attempts at most in addition to the initial try. %FALSE to require - * manual intervention to activate the connection. Defaults to %TRUE. + * %TRUE to automatically activate the connection, %FALSE to require manual + * intervention to activate the connection. Defaults to %TRUE. **/ g_object_class_install_property (object_class, PROP_AUTOCONNECT, g_param_spec_boolean (NM_SETTING_CONNECTION_AUTOCONNECT, "Autoconnect", "If TRUE, NetworkManager will activate this connection " - "when its network resources are available. It makes " - "autoconnect-retries attempts at most when the initial " - "activation was not successful. If FALSE, the connection " - "must be manually activated by the user or some other " - "mechanism.", + "when its network resources are available. If FALSE, " + "the connection must be manually activated by the user " + "or some other mechanism.", TRUE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE)); - /** - * NMSettingConnection:autoconnect-retries: - * - * How many retries should be made by NetworkManager to automatically - * connect, when the initial attempt was not successful. - * Special value is: -1: infinite. Defaults to 0. - **/ - g_object_class_install_property - (object_class, PROP_AUTOCONNECT_RETRIES, - g_param_spec_int (NM_SETTING_CONNECTION_AUTOCONNECT_RETRIES, - "Autoconnect-Retries", - "How many retries should be made by NetworkManager to " - "automatically connect, when the initial attempt was not " - "successful. Special value is -1 meaning infinite. " - "Defaults to 0.", - -1, G_MAXINT, 0, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE)); /** * NMSettingConnection:timestamp: diff --git a/libnm-util/nm-setting-connection.h b/libnm-util/nm-setting-connection.h index ad962a952b..6dedca220b 100644 --- a/libnm-util/nm-setting-connection.h +++ b/libnm-util/nm-setting-connection.h @@ -19,7 +19,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2007 - 2010 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Red Hat, Inc. * (C) Copyright 2007 - 2008 Novell, Inc. */ @@ -68,13 +68,12 @@ GType nm_setting_connection_error_get_type (void); #define NM_SETTING_CONNECTION_ERROR nm_setting_connection_error_quark () GQuark nm_setting_connection_error_quark (void); -#define NM_SETTING_CONNECTION_ID "id" -#define NM_SETTING_CONNECTION_UUID "uuid" -#define NM_SETTING_CONNECTION_TYPE "type" -#define NM_SETTING_CONNECTION_AUTOCONNECT "autoconnect" -#define NM_SETTING_CONNECTION_AUTOCONNECT_RETRIES "autoconnect-retries" -#define NM_SETTING_CONNECTION_TIMESTAMP "timestamp" -#define NM_SETTING_CONNECTION_READ_ONLY "read-only" +#define NM_SETTING_CONNECTION_ID "id" +#define NM_SETTING_CONNECTION_UUID "uuid" +#define NM_SETTING_CONNECTION_TYPE "type" +#define NM_SETTING_CONNECTION_AUTOCONNECT "autoconnect" +#define NM_SETTING_CONNECTION_TIMESTAMP "timestamp" +#define NM_SETTING_CONNECTION_READ_ONLY "read-only" /** * NMSettingConnection: @@ -98,14 +97,13 @@ typedef struct { GType nm_setting_connection_get_type (void); -NMSetting * nm_setting_connection_new (void); -const char *nm_setting_connection_get_id (NMSettingConnection *setting); -const char *nm_setting_connection_get_uuid (NMSettingConnection *setting); -const char *nm_setting_connection_get_connection_type (NMSettingConnection *setting); -gboolean nm_setting_connection_get_autoconnect (NMSettingConnection *setting); -gint nm_setting_connection_get_autoconnect_retries (NMSettingConnection *setting); -guint64 nm_setting_connection_get_timestamp (NMSettingConnection *setting); -gboolean nm_setting_connection_get_read_only (NMSettingConnection *setting); +NMSetting * nm_setting_connection_new (void); +const char *nm_setting_connection_get_id (NMSettingConnection *setting); +const char *nm_setting_connection_get_uuid (NMSettingConnection *setting); +const char *nm_setting_connection_get_connection_type (NMSettingConnection *setting); +gboolean nm_setting_connection_get_autoconnect (NMSettingConnection *setting); +guint64 nm_setting_connection_get_timestamp (NMSettingConnection *setting); +gboolean nm_setting_connection_get_read_only (NMSettingConnection *setting); G_END_DECLS diff --git a/src/nm-policy.c b/src/nm-policy.c index d9be65c8a5..b0c366234b 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -67,6 +67,7 @@ struct NMPolicy { #define INVALID_TAG "invalid" #define RETRIES_TAG "autoconnect-retries" +#define RETRIES_DEFAULT 4 static const char * get_connection_id (NMConnection *connection) @@ -716,16 +717,15 @@ update_routing_and_dns (NMPolicy *policy, gboolean force_update) } static void -reset_auto_connection_retries (NMConnection *connection) +set_connection_auto_retries (NMConnection *connection, guint retries) { - NMSettingConnection *s_con; - int retries; - - s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); - g_assert (s_con); + g_object_set_data (G_OBJECT (connection), RETRIES_TAG, GUINT_TO_POINTER (retries)); +} - retries = nm_setting_connection_get_autoconnect_retries (s_con); - g_object_set_data (G_OBJECT (connection), RETRIES_TAG, GINT_TO_POINTER (retries)); +static guint32 +get_connection_auto_retries (NMConnection *connection) +{ + return GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (connection), RETRIES_TAG)); } typedef struct { @@ -765,17 +765,17 @@ auto_activate_device (gpointer user_data) GSList *next = g_slist_next (iter); if (g_object_get_data (G_OBJECT (iter_connection), INVALID_TAG)) { - int retries = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (iter_connection), RETRIES_TAG)); + guint retries = get_connection_auto_retries (iter_connection); + if (retries == 0) { connections = g_slist_remove_link (connections, iter); g_object_unref (iter_connection); g_slist_free (iter); - } else if (retries > 0) { - g_object_set_data (G_OBJECT (iter_connection), RETRIES_TAG, GINT_TO_POINTER (retries-1)); - } + } else if (retries > 0) + set_connection_auto_retries (iter_connection, retries - 1); } else { /* Set the initial # of retries for auto-connection */ - reset_auto_connection_retries (iter_connection); + set_connection_auto_retries (iter_connection, RETRIES_DEFAULT); } iter = next; @@ -925,7 +925,7 @@ device_state_changed (NMDevice *device, */ if (connection && IS_ACTIVATING_STATE (old_state)) { g_object_set_data (G_OBJECT (connection), INVALID_TAG, GUINT_TO_POINTER (TRUE)); - if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (connection), RETRIES_TAG)) == 0) + if (get_connection_auto_retries (connection) == 0) nm_log_info (LOGD_DEVICE, "Marking connection '%s' invalid.", get_connection_id (connection)); nm_connection_clear_secrets (connection); } @@ -937,7 +937,7 @@ device_state_changed (NMDevice *device, g_object_set_data (G_OBJECT (connection), INVALID_TAG, NULL); /* Reset RETRIES_TAG to number from the setting */ - reset_auto_connection_retries (connection); + set_connection_auto_retries (connection, RETRIES_DEFAULT); /* And clear secrets so they will always be requested from the * settings service when the next connection is made. -- cgit v1.2.1 From 389a29757142111f6824894fc92b7cbd7980ed87 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 3 Nov 2010 14:58:02 -0500 Subject: libnm-util: silence warning --- libnm-util/nm-setting-gsm.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libnm-util/nm-setting-gsm.c b/libnm-util/nm-setting-gsm.c index e9d06bea10..9f24265d8c 100644 --- a/libnm-util/nm-setting-gsm.c +++ b/libnm-util/nm-setting-gsm.c @@ -344,6 +344,7 @@ set_property (GObject *object, guint prop_id, { NMSettingGsmPrivate *priv = NM_SETTING_GSM_GET_PRIVATE (object); const char *str; + char *tmp; switch (prop_id) { case PROP_NUMBER: @@ -360,11 +361,17 @@ set_property (GObject *object, guint prop_id, break; case PROP_APN: g_free (priv->apn); - priv->apn = g_strstrip (g_value_dup_string (value)); + priv->apn = NULL; + tmp = g_value_dup_string (value); + if (tmp) + priv->apn = g_strstrip (tmp); break; case PROP_NETWORK_ID: g_free (priv->network_id); - priv->network_id = g_strstrip (g_value_dup_string (value)); + priv->network_id = NULL; + tmp = g_value_dup_string (value); + if (tmp) + priv->network_id = g_strstrip (tmp); break; case PROP_NETWORK_TYPE: priv->network_type = g_value_get_int (value); -- cgit v1.2.1 From 3b4e9dd75e7023d43ef020b6ea47ecc33025e87b Mon Sep 17 00:00:00 2001 From: "Wulf C. Krueger" Date: Fri, 5 Nov 2010 13:41:20 -0500 Subject: backends: add Exherbo support (bgo #634058) --- configure.ac | 10 ++++-- src/backends/Makefile.am | 4 +++ src/backends/NetworkManagerExherbo.c | 64 ++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 src/backends/NetworkManagerExherbo.c diff --git a/configure.ac b/configure.ac index e66a1f4903..d96530ebdb 100644 --- a/configure.ac +++ b/configure.ac @@ -84,7 +84,7 @@ dnl Make sha1.c happy on big endian systems dnl AC_C_BIGENDIAN -AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, arch, slackware, paldo, mandriva, pardus or linexa])) +AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, arch, slackware, paldo, mandriva, pardus, linexa or exherbo])) if test "z$with_distro" = "z"; then AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat") AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse") @@ -97,6 +97,7 @@ if test "z$with_distro" = "z"; then AC_CHECK_FILE(/etc/mandriva-release,with_distro="mandriva") AC_CHECK_FILE(/etc/pardus-release,with_distro="pardus") AC_CHECK_FILE(/etc/linexa-release,with_distro="linexa") + AC_CHECK_FILE(/etc/exherbo-release,with_distro="exherbo") if test "z$with_distro" = "z"; then with_distro=`lsb_release -is` fi @@ -108,7 +109,7 @@ if test "z$with_distro" = "z"; then exit 1 else case $with_distro in - redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware|mandriva|pardus|linexa) ;; + redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware|mandriva|pardus|linexa|exherbo) ;; *) echo "Your distribution (${with_distro}) is not yet supported! (patches welcome)" exit 1 @@ -171,6 +172,11 @@ if test x"$with_distro" = xlinexa; then AC_DEFINE(TARGET_LINEXA, 1, [Define if you have linexa]) fi +AM_CONDITIONAL(TARGET_EXHERBO, test x"$with_distro" = xexherbo) +if test x"$with_distro" = xexherbo; then + AC_DEFINE(TARGET_EXHERBO, 1, [Define if you have Exherbo]) +fi + dnl dnl Distribution version string dnl diff --git a/src/backends/Makefile.am b/src/backends/Makefile.am index 036dc6de38..fbec9aaf87 100644 --- a/src/backends/Makefile.am +++ b/src/backends/Makefile.am @@ -57,6 +57,10 @@ if TARGET_LINEXA libnmbackend_la_SOURCES += NetworkManagerLinexa.c endif +if TARGET_EXHERBO +libnmbackend_la_SOURCES += NetworkManagerExherbo.c +endif + libnmbackend_la_LIBADD += \ $(top_builddir)/src/logging/libnm-logging.la \ $(DBUS_LIBS) \ diff --git a/src/backends/NetworkManagerExherbo.c b/src/backends/NetworkManagerExherbo.c new file mode 100644 index 0000000000..d7e24cf603 --- /dev/null +++ b/src/backends/NetworkManagerExherbo.c @@ -0,0 +1,64 @@ +/* NetworkManager -- Network link manager + * + * Dan Williams + * Dan Willemsen + * Robert Paskowitz + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2004 Red Hat, Inc. + * (C) Copyright 2004 Dan Willemsen + * (C) Copyright 2004 Robert Paskowitz + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "NetworkManagerGeneric.h" +#include "nm-system.h" +#include "NetworkManagerUtils.h" +#include "nm-logging.h" + +/* + * nm_system_enable_loopback + * + * Bring up the loopback interface + * + */ +void nm_system_enable_loopback (void) +{ + nm_generic_enable_loopback (); +} + +/* + * nm_system_update_dns + * + * Make glibc/nscd aware of any changes to the resolv.conf file by + * restarting nscd. Only restart if already running. + * + */ +void nm_system_update_dns (void) +{ + if (g_file_test ("/usr/sbin/nscd", G_FILE_TEST_IS_EXECUTABLE)) { + nm_log_info (LOGD_DNS, "Clearing nscd hosts cache."); + nm_spawn_process ("/usr/sbin/nscd -i hosts"); + } +} + -- cgit v1.2.1 From 68e4d31629e803214bb8c52696b08c35f91bada6 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 7 Nov 2010 15:02:11 -0600 Subject: build: get the right NSS cflags and libs --- configure.ac | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d96530ebdb..d784f098ba 100644 --- a/configure.ac +++ b/configure.ac @@ -281,6 +281,8 @@ with_nss=no with_gnutls=no if test x"$ac_crypto" = xnss; then PKG_CHECK_MODULES(NSS, [nss >= 3.11]) + AC_SUBST(NSS_CFLAGS) + AC_SUBST(NSS_LIBS) AC_DEFINE(HAVE_NSS, 1, [Define if you have NSS]) with_nss=yes elif test x"$ac_crypto" = xgnutls; then @@ -297,7 +299,7 @@ elif test x"$ac_crypto" = xgnutls; then with_gnutls=yes fi else - AC_MSG_ERROR([Please choose either 'nss' or 'gnutls' for certificate and key operations]) + AC_MSG_ERROR([Please choose either 'nss' or 'gnutls' for certificate and crypto operations]) fi AM_CONDITIONAL(WITH_NSS, test x"$with_nss" != xno) AM_CONDITIONAL(WITH_GNUTLS, test x"$with_gnutls" != xno) -- cgit v1.2.1 From 846d92c737bb12157b8720b46d3bc3bcbd8b05fd Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 7 Nov 2010 16:31:53 -0600 Subject: build: work around pkg-config bug #29801 PKG_CHECK_MODULES() succeeds even if the module's dependencies are not satisfied, leading to empty CFLAGS and LIBS. --- configure.ac | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/configure.ac b/configure.ac index d784f098ba..54e1acf795 100644 --- a/configure.ac +++ b/configure.ac @@ -281,6 +281,18 @@ with_nss=no with_gnutls=no if test x"$ac_crypto" = xnss; then PKG_CHECK_MODULES(NSS, [nss >= 3.11]) + + # Work around a pkg-config bug (fdo #29801) where exists != usable + AC_PATH_PROG(PKGCONFIG_PATH, pkg-config, no) + if test x"$PKGCONFIG_PATH" = xno; then + AC_MSG_ERROR([pkgconfig required but not found]) + else + `$PKGCONFIG_PATH --cflags --libs nss` + if test x"$?" != "x0"; then + AC_MSG_ERROR([No usable NSS found]) + fi + fi + AC_SUBST(NSS_CFLAGS) AC_SUBST(NSS_LIBS) AC_DEFINE(HAVE_NSS, 1, [Define if you have NSS]) -- cgit v1.2.1 From 6fd3c0d576090603d8e7b754994fb21a9f1d434f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ozan=20=C3=87a=C4=9Flayan?= Date: Mon, 8 Nov 2010 11:26:51 +0100 Subject: keyfile: remove unused D-Bus calls from test-keyfile.c --- system-settings/plugins/keyfile/tests/test-keyfile.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/system-settings/plugins/keyfile/tests/test-keyfile.c b/system-settings/plugins/keyfile/tests/test-keyfile.c index 7bf63ef539..05131c8fe8 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; } -- cgit v1.2.1 From 579ec4e02621980fabf8fa4b515b41160c464b91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 8 Nov 2010 11:34:26 +0100 Subject: ifcfg-rh: remove unused D-Bus calls from ifcfg-rh tests --- system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index bca9af123d..1945fb99cd 100644 --- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -29,8 +29,6 @@ #include #include -#include - #include #include #include @@ -9490,11 +9488,9 @@ test_read_vlan_interface (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); -- cgit v1.2.1 From fcf87d87ae6e17322486e7f2cbd4806eb75d421a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 8 Nov 2010 09:06:47 -0600 Subject: build: one more small fix for NSS detection + pkg-config stupidity --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 54e1acf795..f80c1aa9b7 100644 --- a/configure.ac +++ b/configure.ac @@ -287,7 +287,7 @@ if test x"$ac_crypto" = xnss; then if test x"$PKGCONFIG_PATH" = xno; then AC_MSG_ERROR([pkgconfig required but not found]) else - `$PKGCONFIG_PATH --cflags --libs nss` + FOO=`$PKGCONFIG_PATH --cflags --libs nss` if test x"$?" != "x0"; then AC_MSG_ERROR([No usable NSS found]) fi -- cgit v1.2.1 From e8da63889b4124cfe3344e38b0931abf208e98da Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 8 Nov 2010 09:07:08 -0600 Subject: keyfile: create keyfile data directory during install So distributions don't have to do it. --- system-settings/plugins/keyfile/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/system-settings/plugins/keyfile/Makefile.am b/system-settings/plugins/keyfile/Makefile.am index 1c1fd4a7de..c519adcaf9 100644 --- a/system-settings/plugins/keyfile/Makefile.am +++ b/system-settings/plugins/keyfile/Makefile.am @@ -49,6 +49,8 @@ libnm_settings_plugin_keyfile_la_LIBADD = \ $(DBUS_LIBS) \ $(GIO_LIBS) +keyfiledir=$(sysconfdir)/NetworkManager/system-connections + install-data-hook: $(mkinstalldirs) -m 0755 $(DESTDIR)$(keyfiledir) -- cgit v1.2.1 From cbb0d6d116e2d5e844c2c118f2f707d10e6b6fc4 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 8 Nov 2010 09:09:54 -0600 Subject: build: create NM state directory at install time --- src/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Makefile.am b/src/Makefile.am index 8c01df0fb4..d7dccaaf1c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -275,8 +275,10 @@ EXTRA_DIST = \ $(NetworkManager_DATA) rundir=$(localstatedir)/run/NetworkManager +statedir=$(localstatedir)/lib/NetworkManager install-data-hook: $(mkinstalldirs) -m 0700 $(DESTDIR)$(rundir) + $(mkinstalldirs) -m 0700 $(DESTDIR)$(statedir) CLEANFILES = $(BUILT_SOURCES) -- cgit v1.2.1 From 57bef052ce4c9e44592bf7afd5106ae8a3b71d77 Mon Sep 17 00:00:00 2001 From: Ionut Biru Date: Mon, 8 Nov 2010 17:53:46 +0100 Subject: test: install nm-online binary --- test/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index 8e235e4322..7bdaf0db96 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -10,9 +10,9 @@ AM_CPPFLAGS = \ -DNM_RUN_DIR=\"$(rundir)\" \ -DDATADIR=\"$(datadir)\" -bin_PROGRAMS = nm-tool +bin_PROGRAMS = nm-tool nm-online -noinst_PROGRAMS = nm-online libnm-glib-test +noinst_PROGRAMS = libnm-glib-test nm_tool_SOURCES = nm-tool.c nm_tool_LDADD = \ -- cgit v1.2.1 From c580444fd7384abe43b22bf62654ab54c1f7833a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 10 Nov 2010 16:14:51 +0100 Subject: keyfile: quiet keyfile plugin when re-read connection is the same as in-memory one It occurs, for example, when NM updates connection's timestamp. --- system-settings/plugins/keyfile/plugin.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/system-settings/plugins/keyfile/plugin.c b/system-settings/plugins/keyfile/plugin.c index 27ae0a06f6..f57a4b6bd1 100644 --- a/system-settings/plugins/keyfile/plugin.c +++ b/system-settings/plugins/keyfile/plugin.c @@ -203,15 +203,18 @@ dir_changed (GFileMonitor *monitor, break; case G_FILE_MONITOR_EVENT_CREATED: case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: - PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, "updating %s", name); - if (connection) { /* Update */ NMKeyfileConnection *tmp; tmp = nm_keyfile_connection_new (name, &error); if (tmp) { - update_connection_settings (connection, tmp); + if (!nm_connection_compare (NM_CONNECTION (connection), + NM_CONNECTION (tmp), + NM_SETTING_COMPARE_FLAG_EXACT)) { + PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, "updating %s", name); + update_connection_settings (connection, tmp); + } g_object_unref (tmp); } else { /* Error; remove the connection */ @@ -221,6 +224,8 @@ dir_changed (GFileMonitor *monitor, remove_connection (SC_PLUGIN_KEYFILE (config), connection, name); } } else { + PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, "updating %s", name); + /* New */ connection = nm_keyfile_connection_new (name, &error); if (connection) { -- cgit v1.2.1 From 0376f6b1ceda64e279e64bfb37ab67f0c36478b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 10 Nov 2010 16:21:25 +0100 Subject: keyfile: ignore temporary files (bgo #602868) Ignore temporary files created by vim editor and temporary files created internally by g_file_set_contents() (mkstemp()) when writing connections. --- system-settings/plugins/keyfile/Makefile.am | 2 + system-settings/plugins/keyfile/common.h | 3 + system-settings/plugins/keyfile/plugin.c | 9 +++ system-settings/plugins/keyfile/utils.c | 97 +++++++++++++++++++++++++++++ system-settings/plugins/keyfile/utils.h | 30 +++++++++ 5 files changed, 141 insertions(+) create mode 100644 system-settings/plugins/keyfile/utils.c create mode 100644 system-settings/plugins/keyfile/utils.h diff --git a/system-settings/plugins/keyfile/Makefile.am b/system-settings/plugins/keyfile/Makefile.am index c519adcaf9..128775ee97 100644 --- a/system-settings/plugins/keyfile/Makefile.am +++ b/system-settings/plugins/keyfile/Makefile.am @@ -16,6 +16,8 @@ libkeyfile_io_la_SOURCES = \ writer.c \ writer.h \ errors.c \ + utils.c \ + utils.h \ common.h libkeyfile_io_la_CPPFLAGS = \ diff --git a/system-settings/plugins/keyfile/common.h b/system-settings/plugins/keyfile/common.h index 7d94a7053e..6c8f9cebb8 100644 --- a/system-settings/plugins/keyfile/common.h +++ b/system-settings/plugins/keyfile/common.h @@ -23,6 +23,9 @@ #include +#define SWP_TAG ".swp" +#define SWPX_TAG ".swpx" + #define KEYFILE_PLUGIN_NAME "keyfile" #define KEYFILE_PLUGIN_INFO "(c) 2007 - 2010 Red Hat, Inc. To report bugs please use the NetworkManager mailing list." diff --git a/system-settings/plugins/keyfile/plugin.c b/system-settings/plugins/keyfile/plugin.c index f57a4b6bd1..5a927ce75d 100644 --- a/system-settings/plugins/keyfile/plugin.c +++ b/system-settings/plugins/keyfile/plugin.c @@ -39,6 +39,7 @@ #include "nm-keyfile-connection.h" #include "writer.h" #include "common.h" +#include "utils.h" #define CONF_FILE SYSCONFDIR "/NetworkManager/NetworkManager.conf" #define OLD_CONF_FILE SYSCONFDIR "/NetworkManager/nm-system-settings.conf" @@ -89,6 +90,9 @@ read_connections (NMSystemConfigInterface *config) NMKeyfileConnection *connection; char *full_path; + if (utils_should_ignore_file (item)) + continue; + full_path = g_build_filename (KEYFILE_DIR, item, NULL); PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, "parsing %s ... ", item); connection = nm_keyfile_connection_new (full_path, &error); @@ -192,6 +196,11 @@ dir_changed (GFileMonitor *monitor, GError *error = NULL; name = g_file_get_path (file); + if (utils_should_ignore_file (name)) { + g_free (name); + return; + } + connection = g_hash_table_lookup (priv->hash, name); switch (event_type) { diff --git a/system-settings/plugins/keyfile/utils.c b/system-settings/plugins/keyfile/utils.c new file mode 100644 index 0000000000..de64f7913b --- /dev/null +++ b/system-settings/plugins/keyfile/utils.c @@ -0,0 +1,97 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#include +#include +#include +#include "utils.h" + + +static const char temp_letters[] = +"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + +/* + * Check '.[a-zA-Z0-9]{6}' file suffix used for temporary files by g_file_set_contents() (mkstemp()). + */ +static gboolean +check_mkstemp_suffix (const char *path) +{ + const char *ptr; + + g_return_val_if_fail (path != NULL, FALSE); + + /* Matches *.[a-zA-Z0-9]{6} suffix of mkstemp()'s temporary files */ + ptr = strrchr (path, '.'); + if (ptr && (strspn (ptr + 1, temp_letters) == 6) && (! ptr[7])) + return TRUE; + return FALSE; +} + +static gboolean +check_prefix (const char *base, const char *tag) +{ + int len, tag_len; + + g_return_val_if_fail (base != NULL, TRUE); + g_return_val_if_fail (tag != NULL, TRUE); + + len = strlen (base); + tag_len = strlen (tag); + if ((len > tag_len) && !strncasecmp (base, tag, tag_len)) + return TRUE; + return FALSE; +} + +static gboolean +check_suffix (const char *base, const char *tag) +{ + int len, tag_len; + + g_return_val_if_fail (base != NULL, TRUE); + g_return_val_if_fail (tag != NULL, TRUE); + + len = strlen (base); + tag_len = strlen (tag); + if ((len > tag_len) && !strcasecmp (base + len - tag_len, tag)) + return TRUE; + return FALSE; +} + +gboolean +utils_should_ignore_file (const char *filename) +{ + char *base; + gboolean ignore = FALSE; + + g_return_val_if_fail (filename != NULL, TRUE); + + base = g_path_get_basename (filename); + g_return_val_if_fail (base != NULL, TRUE); + + /* Ignore files with certain patterns */ + if ( (check_prefix (base, ".") && check_suffix (base, SWP_TAG)) /* vim temporary files: .filename.swp */ + || (check_prefix (base, ".") && check_suffix (base, SWPX_TAG)) /* vim temporary files: .filename.swpx */ + || check_mkstemp_suffix (base)) /* temporary files created by mkstemp() */ + ignore = TRUE; + + g_free (base); + return ignore; +} + diff --git a/system-settings/plugins/keyfile/utils.h b/system-settings/plugins/keyfile/utils.h new file mode 100644 index 0000000000..3c1a6104bd --- /dev/null +++ b/system-settings/plugins/keyfile/utils.h @@ -0,0 +1,30 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#ifndef _UTILS_H_ +#define _UTILS_H_ + +#include +#include "common.h" + +gboolean utils_should_ignore_file (const char *filename); + +#endif /* _UTILS_H_ */ + -- cgit v1.2.1 From d32a29ec5285b3f44bf36b07bfec85703ac041ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 10 Nov 2010 17:28:36 +0100 Subject: ifcfg-rh: quiet ifcfg-rh plugin when re-read connection is the same as in-memory one It occurs, for example, when NM updates connection's timestamp. --- system-settings/plugins/ifcfg-rh/plugin.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/plugin.c b/system-settings/plugins/ifcfg-rh/plugin.c index e6dfa5bcea..37bf97280c 100644 --- a/system-settings/plugins/ifcfg-rh/plugin.c +++ b/system-settings/plugins/ifcfg-rh/plugin.c @@ -218,8 +218,6 @@ connection_changed_handler (SCPluginIfcfg *plugin, g_return_if_fail (do_remove != NULL); g_return_if_fail (do_new != NULL); - PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "updating %s", path); - new = (NMIfcfgConnection *) nm_ifcfg_connection_new (path, &error, &ignore_error); if (!new) { /* errors reading connection; remove it */ @@ -234,8 +232,19 @@ connection_changed_handler (SCPluginIfcfg *plugin, return; } + /* Successfully read connection changes */ + /* When the connections are the same, nothing is done */ + if (nm_connection_compare (NM_CONNECTION (connection), + NM_CONNECTION (new), + NM_SETTING_COMPARE_FLAG_EXACT)) { + g_object_unref (new); + return; + } + + PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "updating %s", path); + old_unmanaged = nm_ifcfg_connection_get_unmanaged_spec (NM_IFCFG_CONNECTION (connection)); new_unmanaged = nm_ifcfg_connection_get_unmanaged_spec (NM_IFCFG_CONNECTION (new)); -- cgit v1.2.1 From 568f5e073be31fdf357a4ab4a484d57e9559f29b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 16 Nov 2010 17:57:57 -0600 Subject: release: bump version to 0.8.990 Bump master branch version way past stable branch version for development purposes. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index f80c1aa9b7..9cb0e9c49c 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ AC_PREREQ(2.52) -AC_INIT(NetworkManager, 0.8.1, dcbw@redhat.com, NetworkManager) +AC_INIT(NetworkManager, 0.8.990, dcbw@redhat.com, NetworkManager) AM_INIT_AUTOMAKE([1.9 subdir-objects tar-ustar no-dist-gzip dist-bzip2]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])]) AM_MAINTAINER_MODE -- cgit v1.2.1 From 3992c7db507d586ffeffa214edc4b9a399b8b396 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 18 Nov 2010 16:30:00 -0600 Subject: dhcpcd: prevent dhcpcd from messing with routing (bgo #634983) Since NM is already handling that. --- src/dhcp-manager/nm-dhcp-dhcpcd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.c b/src/dhcp-manager/nm-dhcp-dhcpcd.c index 378a97b611..4fb703c480 100644 --- a/src/dhcp-manager/nm-dhcp-dhcpcd.c +++ b/src/dhcp-manager/nm-dhcp-dhcpcd.c @@ -128,6 +128,8 @@ real_ip4_start (NMDHCPClient *client, g_ptr_array_add (argv, (gpointer) "-L"); /* Disable built-in IPv4LL since we use avahi-autoipd */ + g_ptr_array_add (argv, (gpointer) "-G"); /* Let NM handle routing */ + g_ptr_array_add (argv, (gpointer) "-c"); /* Set script file */ g_ptr_array_add (argv, (gpointer) ACTION_SCRIPT_PATH ); -- cgit v1.2.1 From 02a1da41c6bef08e6be3f98f590fa7b97898baee Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 18 Nov 2010 17:02:04 -0600 Subject: supplicant: convert add/remove to new supplicant dbus interface --- src/supplicant-manager/nm-supplicant-interface.c | 22 ++++++++++++++-------- src/supplicant-manager/nm-supplicant-manager.c | 2 +- src/supplicant-manager/nm-supplicant-manager.h | 6 +++--- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index bad8f26634..996eb65087 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -37,7 +37,7 @@ #define WPAS_DBUS_IFACE_BSSID WPAS_DBUS_INTERFACE ".BSSID" #define WPAS_DBUS_IFACE_NETWORK WPAS_DBUS_INTERFACE ".Network" #define WPAS_ERROR_INVALID_IFACE WPAS_DBUS_INTERFACE ".InvalidInterface" -#define WPAS_ERROR_EXISTS_ERROR WPAS_DBUS_INTERFACE ".ExistsError" +#define WPAS_ERROR_EXISTS_ERROR WPAS_DBUS_INTERFACE ".InterfaceExists" static void wpas_iface_handle_state_change (DBusGProxy *proxy, @@ -580,7 +580,7 @@ interface_get (NMSupplicantInterface *self) DBusGProxyCall *call; info = nm_supplicant_info_new (self, priv->wpas_proxy, priv->other_pcalls); - call = dbus_g_proxy_begin_call (priv->wpas_proxy, "getInterface", + call = dbus_g_proxy_begin_call (priv->wpas_proxy, "GetInterface", interface_get_cb, info, nm_supplicant_info_destroy, @@ -622,7 +622,7 @@ interface_add (NMSupplicantInterface *self, gboolean is_wireless) DBusGProxyCall *call; NMSupplicantInfo *info; GHashTable *hash; - GValue *driver; + GValue *driver, *ifname; /* Can only start the interface from INIT state */ g_return_if_fail (priv->state == NM_SUPPLICANT_INTERFACE_STATE_INIT); @@ -639,24 +639,30 @@ interface_add (NMSupplicantInterface *self, gboolean is_wireless) info = nm_supplicant_info_new (self, priv->wpas_proxy, priv->other_pcalls); + hash = g_hash_table_new (g_str_hash, g_str_equal); + driver = g_new0 (GValue, 1); g_value_init (driver, G_TYPE_STRING); - g_value_set_string (driver, is_wireless ? "wext" : "wired"); + g_value_set_string (driver, is_wireless ? "nl80211,wext" : "wired"); + g_hash_table_insert (hash, "Driver", driver); - hash = g_hash_table_new (g_str_hash, g_str_equal); - g_hash_table_insert (hash, "driver", driver); + ifname = g_new0 (GValue, 1); + g_value_init (ifname, G_TYPE_STRING); + g_value_set_string (ifname, priv->dev); + g_hash_table_insert (hash, "Ifname", ifname); - call = dbus_g_proxy_begin_call (priv->wpas_proxy, "addInterface", + call = dbus_g_proxy_begin_call (priv->wpas_proxy, "CreateInterface", interface_add_cb, info, nm_supplicant_info_destroy, - G_TYPE_STRING, priv->dev, DBUS_TYPE_G_MAP_OF_VARIANT, hash, G_TYPE_INVALID); g_hash_table_destroy (hash); g_value_unset (driver); g_free (driver); + g_value_unset (ifname); + g_free (ifname); nm_supplicant_info_set_call (info, call); } diff --git a/src/supplicant-manager/nm-supplicant-manager.c b/src/supplicant-manager/nm-supplicant-manager.c index 35ef749cb6..19ee5730f9 100644 --- a/src/supplicant-manager/nm-supplicant-manager.c +++ b/src/supplicant-manager/nm-supplicant-manager.c @@ -114,7 +114,7 @@ nm_supplicant_manager_iface_release (NMSupplicantManager *self, /* Ask wpa_supplicant to remove this interface */ op = nm_supplicant_interface_get_object_path (iface); if (priv->running && priv->proxy && op) { - dbus_g_proxy_call_no_reply (priv->proxy, "removeInterface", + dbus_g_proxy_call_no_reply (priv->proxy, "RemoveInterface", DBUS_TYPE_G_OBJECT_PATH, op, G_TYPE_INVALID); } diff --git a/src/supplicant-manager/nm-supplicant-manager.h b/src/supplicant-manager/nm-supplicant-manager.h index e9c31a997b..9e2f3b21b1 100644 --- a/src/supplicant-manager/nm-supplicant-manager.h +++ b/src/supplicant-manager/nm-supplicant-manager.h @@ -26,9 +26,9 @@ #include "nm-supplicant-types.h" #include "nm-device.h" -#define WPAS_DBUS_SERVICE "fi.epitest.hostap.WPASupplicant" -#define WPAS_DBUS_PATH "/fi/epitest/hostap/WPASupplicant" -#define WPAS_DBUS_INTERFACE "fi.epitest.hostap.WPASupplicant" +#define WPAS_DBUS_SERVICE "fi.w1.wpa_supplicant1" +#define WPAS_DBUS_PATH "/fi/w1/wpa_supplicant1" +#define WPAS_DBUS_INTERFACE "fi.w1.wpa_supplicant1" G_BEGIN_DECLS -- cgit v1.2.1 From 3951942fa1f505e5ab2d7802004c8b6708da469e Mon Sep 17 00:00:00 2001 From: Mathieu Trudel-Lapierre Date: Fri, 19 Nov 2010 16:17:40 -0600 Subject: wired: fix uninitialized variable --- src/nm-device-ethernet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index 13139542fa..00e8a2167a 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -295,7 +295,7 @@ _update_s390_subchannels (NMDeviceEthernet *self) const char *iface; GUdevClient *client; GUdevDevice *dev; - GUdevDevice *parent; + GUdevDevice *parent = NULL; const char *parent_path, *item, *driver; const char *subsystems[] = { "net", NULL }; GDir *dir; -- cgit v1.2.1 From 92b58e56f5cc01b484af36623e17ee4ea386e53a Mon Sep 17 00:00:00 2001 From: Mikhail Efremov Date: Fri, 19 Nov 2010 16:52:55 -0600 Subject: dhcp: ensure that dhcp client is exited On restart ensure that the client we're trying to kill has actually exited even if it's not our child. --- src/dhcp-manager/nm-dhcp-client.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c index 0c7f3d49b5..3a8b194081 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); } -- cgit v1.2.1 From 528e0876082f563e6fbafc3f7c2c44c5ef184750 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 22 Nov 2010 08:22:50 -0600 Subject: wifi: handle new supplicant AP property formats --- src/nm-wifi-ap.c | 165 ++++++++++++++++++++++++++++++++----------------------- src/nm-wifi-ap.h | 4 -- 2 files changed, 95 insertions(+), 74 deletions(-) diff --git a/src/nm-wifi-ap.c b/src/nm-wifi-ap.c index 7770b8bc42..642b6d978e 100644 --- a/src/nm-wifi-ap.c +++ b/src/nm-wifi-ap.c @@ -369,10 +369,69 @@ NMAccessPoint *nm_ap_new (void) return (NMAccessPoint *) object; } +static guint32 +pair_to_flags (const char *str) +{ + g_return_val_if_fail (str != NULL, NM_802_11_AP_SEC_NONE); + + if (strcmp (str, "wep40") == 0) + return NM_802_11_AP_SEC_PAIR_WEP40; + if (strcmp (str, "wep104") == 0) + return NM_802_11_AP_SEC_PAIR_WEP104; + if (strcmp (str, "tkip") == 0) + return NM_802_11_AP_SEC_PAIR_TKIP; + if (strcmp (str, "ccmp") == 0) + return NM_802_11_AP_SEC_PAIR_CCMP; + return NM_802_11_AP_SEC_NONE; +} + +static guint32 +group_to_flags (const char *str) +{ + g_return_val_if_fail (str != NULL, NM_802_11_AP_SEC_NONE); + + if (strcmp (str, "wep40") == 0) + return NM_802_11_AP_SEC_GROUP_WEP40; + if (strcmp (str, "wep104") == 0) + return NM_802_11_AP_SEC_GROUP_WEP104; + if (strcmp (str, "tkip") == 0) + return NM_802_11_AP_SEC_GROUP_TKIP; + if (strcmp (str, "ccmp") == 0) + return NM_802_11_AP_SEC_GROUP_CCMP; + return NM_802_11_AP_SEC_NONE; +} -#define IEEE80211_CAP_ESS 0x0001 -#define IEEE80211_CAP_IBSS 0x0002 -#define IEEE80211_CAP_PRIVACY 0x0010 +static guint32 +security_from_dict (GHashTable *security) +{ + GValue *value; + guint32 flags = NM_802_11_AP_SEC_NONE; + const char **items, **iter; + + value = g_hash_table_lookup (security, "KeyMgmt"); + if (value) { + items = g_value_get_boxed (value); + for (iter = items; iter && *iter; iter++) { + if (strcmp (*iter, "wpa-psk") == 0) + flags |= NM_802_11_AP_SEC_KEY_MGMT_PSK; + else if (strcmp (*iter, "wpa-eap") == 0) + flags |= NM_802_11_AP_SEC_KEY_MGMT_802_1X; + } + } + + value = g_hash_table_lookup (security, "Pairwise"); + if (value) { + items = g_value_get_boxed (value); + for (iter = items; iter && *iter; iter++) + flags |= pair_to_flags (*iter); + } + + value = g_hash_table_lookup (security, "Group"); + if (value) + flags |= group_to_flags (g_value_get_string (value)); + + return flags; +} static void foreach_property_cb (gpointer key, gpointer value, gpointer user_data) @@ -383,9 +442,9 @@ foreach_property_cb (gpointer key, gpointer value, gpointer user_data) if (G_VALUE_HOLDS_BOXED (variant)) { GArray *array = g_value_get_boxed (variant); - if (!strcmp (key, "ssid")) { + if (!strcmp (key, "SSID")) { guint32 len = MIN (IW_ESSID_MAX_SIZE, array->len); - GByteArray * ssid; + GByteArray *ssid; /* Stupid ieee80211 layer uses */ if (((len == 8) || (len == 9)) @@ -399,7 +458,7 @@ foreach_property_cb (gpointer key, gpointer value, gpointer user_data) g_byte_array_append (ssid, (const guint8 *) array->data, len); nm_ap_set_ssid (ap, ssid); g_byte_array_free (ssid, TRUE); - } else if (!strcmp (key, "bssid")) { + } else if (!strcmp (key, "BSSID")) { struct ether_addr addr; if (array->len != ETH_ALEN) @@ -407,43 +466,49 @@ foreach_property_cb (gpointer key, gpointer value, gpointer user_data) memset (&addr, 0, sizeof (struct ether_addr)); memcpy (&addr, array->data, ETH_ALEN); nm_ap_set_address (ap, &addr); - } else if (!strcmp (key, "wpaie")) { - guint8 * ie = (guint8 *) array->data; + } else if (!strcmp (key, "Rates")) { + guint32 maxrate = 0; + int i; + + /* Find the max AP rate */ + for (i = 0; i < array->len; i++) { + guint32 r = g_array_index (array, guint32, i); + + if (r > maxrate) { + maxrate = r; + nm_ap_set_max_bitrate (ap, r / 1000); + } + } + } else if (!strcmp (key, "WPA")) { guint32 flags = nm_ap_get_wpa_flags (ap); - if (array->len <= 0 || array->len > WPA_MAX_IE_LEN) - return; - flags = nm_ap_add_security_from_ie (flags, ie, array->len); + flags |= security_from_dict (g_value_get_boxed (variant)); nm_ap_set_wpa_flags (ap, flags); - } else if (!strcmp (key, "rsnie")) { - guint8 * ie = (guint8 *) array->data; + } else if (!strcmp (key, "RSN")) { guint32 flags = nm_ap_get_rsn_flags (ap); - if (array->len <= 0 || array->len > WPA_MAX_IE_LEN) - return; - flags = nm_ap_add_security_from_ie (flags, ie, array->len); + flags |= security_from_dict (g_value_get_boxed (variant)); nm_ap_set_rsn_flags (ap, flags); } - } else if (G_VALUE_HOLDS_INT (variant)) { - gint32 int_val = g_value_get_int (variant); - - if (!strcmp (key, "frequency")) { - nm_ap_set_freq (ap, (guint32) int_val); - } else if (!strcmp (key, "maxrate")) { - /* Supplicant reports as b/s, we use Kb/s internally */ - nm_ap_set_max_bitrate (ap, int_val / 1000); - } } else if (G_VALUE_HOLDS_UINT (variant)) { guint32 val = g_value_get_uint (variant); - if (!strcmp (key, "capabilities")) { - if (val & IEEE80211_CAP_ESS) { + if (!strcmp (key, "Frequency")) + nm_ap_set_freq (ap, val); + } else if (G_VALUE_HOLDS_STRING (variant)) { + const char *val = g_value_get_string (variant); + + if (val && !strcmp (key, "Mode")) { + if (strcmp (val, "infrastructure") == 0) nm_ap_set_mode (ap, NM_802_11_MODE_INFRA); - } else if (val & IEEE80211_CAP_IBSS) { + else if (strcmp (val, "ad-hoc") == 0) nm_ap_set_mode (ap, NM_802_11_MODE_ADHOC); - } + } + } else if (G_VALUE_HOLDS_BOOLEAN (variant)) { + gboolean val = g_value_get_boolean (variant); - if (val & IEEE80211_CAP_PRIVACY) { + if (strcmp (key, "Privacy") == 0) { + if (val) { guint32 flags = nm_ap_get_flags (ap); nm_ap_set_flags (ap, flags | NM_802_11_AP_FLAGS_PRIVACY); } @@ -451,7 +516,6 @@ foreach_property_cb (gpointer key, gpointer value, gpointer user_data) } } - NMAccessPoint * nm_ap_new_from_properties (GHashTable *properties) { @@ -1170,45 +1234,6 @@ void nm_ap_set_user_addresses (NMAccessPoint *ap, GSList *list) } -guint32 -nm_ap_add_security_from_ie (guint32 flags, - const guint8 *wpa_ie, - guint32 length) -{ - wpa_ie_data * cap_data; - - if (!(cap_data = wpa_parse_wpa_ie (wpa_ie, length))) - return NM_802_11_AP_SEC_NONE; - - /* Pairwise cipher flags */ - if (cap_data->pairwise_cipher & IW_AUTH_CIPHER_WEP40) - flags |= NM_802_11_AP_SEC_PAIR_WEP40; - if (cap_data->pairwise_cipher & IW_AUTH_CIPHER_WEP104) - flags |= NM_802_11_AP_SEC_PAIR_WEP104; - if (cap_data->pairwise_cipher & IW_AUTH_CIPHER_TKIP) - flags |= NM_802_11_AP_SEC_PAIR_TKIP; - if (cap_data->pairwise_cipher & IW_AUTH_CIPHER_CCMP) - flags |= NM_802_11_AP_SEC_PAIR_CCMP; - - /* Group cipher flags */ - if (cap_data->group_cipher & IW_AUTH_CIPHER_WEP40) - flags |= NM_802_11_AP_SEC_GROUP_WEP40; - if (cap_data->group_cipher & IW_AUTH_CIPHER_WEP104) - flags |= NM_802_11_AP_SEC_GROUP_WEP104; - if (cap_data->group_cipher & IW_AUTH_CIPHER_TKIP) - flags |= NM_802_11_AP_SEC_GROUP_TKIP; - if (cap_data->group_cipher & IW_AUTH_CIPHER_CCMP) - flags |= NM_802_11_AP_SEC_GROUP_CCMP; - - if (cap_data->key_mgmt & IW_AUTH_KEY_MGMT_802_1X) - flags |= NM_802_11_AP_SEC_KEY_MGMT_802_1X; - if (cap_data->key_mgmt & IW_AUTH_KEY_MGMT_PSK) - flags |= NM_802_11_AP_SEC_KEY_MGMT_PSK; - - g_slice_free (wpa_ie_data, cap_data); - return flags; -} - gboolean nm_ap_check_compatible (NMAccessPoint *self, NMConnection *connection) diff --git a/src/nm-wifi-ap.h b/src/nm-wifi-ap.h index 86b785a316..09c87d970a 100644 --- a/src/nm-wifi-ap.h +++ b/src/nm-wifi-ap.h @@ -110,10 +110,6 @@ void nm_ap_set_user_created (NMAccessPoint *ap, gboolean user_created); GSList * nm_ap_get_user_addresses (const NMAccessPoint *ap); void nm_ap_set_user_addresses (NMAccessPoint *ap, GSList *list); -guint32 nm_ap_add_security_from_ie (guint32 flags, - const guint8 *wpa_ie, - guint32 length); - gboolean nm_ap_check_compatible (NMAccessPoint *self, NMConnection *connection); -- cgit v1.2.1 From 8bbbd3edc30dd44f13d6b468d162696b6ab3d1cc Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 22 Nov 2010 08:25:09 -0600 Subject: wifi: convert AP handling to new supplicant interface --- src/nm-device-wifi.c | 60 ++- src/supplicant-manager/nm-supplicant-interface.c | 458 +++++++++-------------- src/supplicant-manager/nm-supplicant-interface.h | 20 +- 3 files changed, 217 insertions(+), 321 deletions(-) diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 49529708b2..3644ccfc4c 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -188,17 +188,13 @@ static void supplicant_iface_state_cb (NMSupplicantInterface *iface, guint32 old_state, gpointer user_data); -static void supplicant_iface_scanned_ap_cb (NMSupplicantInterface * iface, - GHashTable *properties, - NMDeviceWifi * self); +static void supplicant_iface_new_bss_cb (NMSupplicantInterface * iface, + GHashTable *properties, + NMDeviceWifi * self); -static void supplicant_iface_scan_request_result_cb (NMSupplicantInterface * iface, - gboolean success, - NMDeviceWifi * self); - -static void supplicant_iface_scan_results_cb (NMSupplicantInterface * iface, - guint32 num_bssids, - NMDeviceWifi * self); +static void supplicant_iface_scan_done_cb (NMSupplicantInterface * iface, + gboolean success, + NMDeviceWifi * self); static void supplicant_iface_notify_scanning_cb (NMSupplicantInterface * iface, GParamSpec * pspec, @@ -646,26 +642,20 @@ supplicant_interface_acquire (NMDeviceWifi *self) memset (priv->supplicant.sig_ids, 0, sizeof (priv->supplicant.sig_ids)); id = g_signal_connect (priv->supplicant.iface, - "state", + NM_SUPPLICANT_INTERFACE_STATE, G_CALLBACK (supplicant_iface_state_cb), self); priv->supplicant.sig_ids[i++] = id; id = g_signal_connect (priv->supplicant.iface, - "scanned-ap", - G_CALLBACK (supplicant_iface_scanned_ap_cb), - self); - priv->supplicant.sig_ids[i++] = id; - - id = g_signal_connect (priv->supplicant.iface, - "scan-req-result", - G_CALLBACK (supplicant_iface_scan_request_result_cb), + NM_SUPPLICANT_INTERFACE_NEW_BSS, + G_CALLBACK (supplicant_iface_new_bss_cb), self); priv->supplicant.sig_ids[i++] = id; id = g_signal_connect (priv->supplicant.iface, - "scan-results", - G_CALLBACK (supplicant_iface_scan_results_cb), + NM_SUPPLICANT_INTERFACE_SCAN_DONE, + G_CALLBACK (supplicant_iface_scan_done_cb), self); priv->supplicant.sig_ids[i++] = id; @@ -1910,28 +1900,19 @@ cancel_pending_scan (NMDeviceWifi *self) } } - static void -supplicant_iface_scan_request_result_cb (NMSupplicantInterface *iface, - gboolean success, - NMDeviceWifi *self) +supplicant_iface_scan_done_cb (NMSupplicantInterface *iface, + gboolean success, + NMDeviceWifi *self) { - nm_log_dbg (LOGD_WIFI_SCAN, "(%s): scan request %s", + nm_log_dbg (LOGD_WIFI_SCAN, "(%s): scan %s", nm_device_get_iface (NM_DEVICE (self)), success ? "successful" : "failed"); if (check_scanning_allowed (self)) schedule_scan (self, TRUE); -} -static void -supplicant_iface_scan_results_cb (NMSupplicantInterface *iface, - guint32 num_results, - NMDeviceWifi *self) -{ - nm_log_dbg (LOGD_WIFI_SCAN, "(%s): scan results available (%d APs found)", - nm_device_get_iface (NM_DEVICE (self)), - num_results); +#if 0 if (num_results == 0) { /* ensure that old APs get culled, which otherwise only * happens when there are actual scan results to process. @@ -1939,6 +1920,7 @@ supplicant_iface_scan_results_cb (NMSupplicantInterface *iface, cull_scan_list (self); nm_device_wifi_ap_list_print (self); } +#endif } static gboolean @@ -2197,9 +2179,9 @@ set_ap_strength_from_properties (NMDeviceWifi *self, } static void -supplicant_iface_scanned_ap_cb (NMSupplicantInterface *iface, - GHashTable *properties, - NMDeviceWifi *self) +supplicant_iface_new_bss_cb (NMSupplicantInterface *iface, + GHashTable *properties, + NMDeviceWifi *self) { NMDeviceState state; NMAccessPoint *ap; @@ -3075,7 +3057,7 @@ real_act_stage2_config (NMDevice *dev, NMDeviceStateReason *reason) /* Hook up error signal handler to capture association errors */ id = g_signal_connect (priv->supplicant.iface, - "connection-error", + NM_SUPPLICANT_INTERFACE_CONNECTION_ERROR, G_CALLBACK (supplicant_iface_connection_error_cb), self); priv->supplicant.iface_error_id = id; diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index 996eb65087..ae6630ea67 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -34,23 +34,20 @@ #include "nm-glib-compat.h" #define WPAS_DBUS_IFACE_INTERFACE WPAS_DBUS_INTERFACE ".Interface" -#define WPAS_DBUS_IFACE_BSSID WPAS_DBUS_INTERFACE ".BSSID" +#define WPAS_DBUS_IFACE_BSS WPAS_DBUS_INTERFACE ".BSS" #define WPAS_DBUS_IFACE_NETWORK WPAS_DBUS_INTERFACE ".Network" #define WPAS_ERROR_INVALID_IFACE WPAS_DBUS_INTERFACE ".InvalidInterface" #define WPAS_ERROR_EXISTS_ERROR WPAS_DBUS_INTERFACE ".InterfaceExists" +G_DEFINE_TYPE (NMSupplicantInterface, nm_supplicant_interface, G_TYPE_OBJECT) -static void wpas_iface_handle_state_change (DBusGProxy *proxy, - const char *str_new_state, - const char *str_old_state, - gpointer user_data); - -static void wpas_iface_handle_scanning (DBusGProxy *proxy, - gboolean scanning, - gpointer user_data); - +static void wpas_iface_properties_changed (DBusGProxy *proxy, + GHashTable *props, + gpointer user_data); -G_DEFINE_TYPE (NMSupplicantInterface, nm_supplicant_interface, G_TYPE_OBJECT) +static void wpas_iface_scan_done (DBusGProxy *proxy, + gboolean success, + gpointer user_data); #define NM_SUPPLICANT_INTERFACE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ NM_TYPE_SUPPLICANT_INTERFACE, \ @@ -60,9 +57,8 @@ G_DEFINE_TYPE (NMSupplicantInterface, nm_supplicant_interface, G_TYPE_OBJECT) enum { STATE, /* change in the interface's state */ REMOVED, /* interface was removed by the supplicant */ - SCANNED_AP, /* interface saw a new access point from a scan */ - SCAN_REQ_RESULT, /* result of a wireless scan request */ - SCAN_RESULTS, /* scan results returned from supplicant */ + NEW_BSS, /* interface saw a new access point from a scan */ + SCAN_DONE, /* wifi scan is complete */ CONNECTION_ERROR, /* an error occurred during a connection request */ LAST_SIGNAL }; @@ -72,7 +68,6 @@ static guint signals[LAST_SIGNAL] = { 0 }; /* Properties */ enum { PROP_0 = 0, - PROP_STATE, PROP_SCANNING, LAST_PROP }; @@ -94,9 +89,9 @@ typedef struct { DBusGProxy * wpas_proxy; DBusGProxy * iface_proxy; + DBusGProxy * props_proxy; DBusGProxy * net_proxy; - guint scan_results_timeout; guint32 last_scan; NMSupplicantConfig * cfg; @@ -199,143 +194,80 @@ static void bssid_properties_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; - GError *err = NULL; - GHashTable *hash = NULL; + GError *error = NULL; + GHashTable *props = NULL; - if (!dbus_g_proxy_end_call (proxy, call_id, &err, - DBUS_TYPE_G_MAP_OF_VARIANT, &hash, - G_TYPE_INVALID)) { - if (!strstr (err->message, "The BSSID requested was invalid")) { + if (dbus_g_proxy_end_call (proxy, call_id, &error, + DBUS_TYPE_G_MAP_OF_VARIANT, &props, + G_TYPE_INVALID)) { + g_signal_emit (info->interface, signals[NEW_BSS], 0, props); + g_hash_table_destroy (props); + } else { + if (!strstr (error->message, "The BSSID requested was invalid")) { nm_log_warn (LOGD_SUPPLICANT, "Couldn't retrieve BSSID properties: %s.", - err->message); + error->message); } - g_error_free (err); - } else { - g_signal_emit (info->interface, signals[SCANNED_AP], 0, hash); - g_hash_table_destroy (hash); + g_error_free (error); } } static void -request_bssid_properties (NMSupplicantInterface * self, - const char * op) +request_bss_properties (NMSupplicantInterface *self, + GPtrArray *paths) { NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); - NMSupplicantInfo *info; - DBusGProxy *proxy; - DBusGProxyCall *call; - - proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr), - WPAS_DBUS_SERVICE, - op, - WPAS_DBUS_IFACE_BSSID); - info = nm_supplicant_info_new (self, proxy, priv->other_pcalls); - call = dbus_g_proxy_begin_call (proxy, "properties", - bssid_properties_cb, - info, - nm_supplicant_info_destroy, - G_TYPE_INVALID); - nm_supplicant_info_set_call (info, call); - g_object_unref (proxy); -} - -static void -scan_results_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) -{ - GError *err = NULL; - GPtrArray *array = NULL; - - if (!dbus_g_proxy_end_call (proxy, call_id, &err, - DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH, &array, - G_TYPE_INVALID)) { - nm_log_warn (LOGD_SUPPLICANT, "could not get scan results: %s.", err->message); - g_error_free (err); - } else { - int i; - NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; - - /* Notify listeners of the result of the scan */ - g_signal_emit (info->interface, signals[SCAN_RESULTS], 0, array->len); + int i; - /* Fire off a "properties" call for each returned BSSID */ - for (i = 0; i < array->len; i++) { - char *op = g_ptr_array_index (array, i); - - request_bssid_properties (info->interface, op); - g_free (op); - } + /* Fire off a "properties" call for each returned BSSID */ + for (i = 0; i < paths->len; i++) { + NMSupplicantInfo *info; + DBusGProxy *proxy; + DBusGProxyCall *call; - g_ptr_array_free (array, TRUE); + proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr), + WPAS_DBUS_SERVICE, + g_ptr_array_index (paths, i), + DBUS_INTERFACE_PROPERTIES); + info = nm_supplicant_info_new (self, proxy, priv->other_pcalls); + call = dbus_g_proxy_begin_call (proxy, "GetAll", + bssid_properties_cb, + info, + nm_supplicant_info_destroy, + G_TYPE_STRING, WPAS_DBUS_IFACE_BSS, + G_TYPE_INVALID); + nm_supplicant_info_set_call (info, call); + g_object_unref (proxy); } } -static gboolean -request_scan_results (gpointer user_data) -{ - NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data); - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); - NMSupplicantInfo *info; - DBusGProxyCall *call; - GTimeVal cur_time; - - priv->scan_results_timeout = 0; - - g_return_val_if_fail (priv->iface_proxy != NULL, FALSE); - - info = nm_supplicant_info_new (self, priv->iface_proxy, priv->other_pcalls); - call = dbus_g_proxy_begin_call (priv->iface_proxy, "scanResults", - scan_results_cb, - info, - nm_supplicant_info_destroy, - G_TYPE_INVALID); - nm_supplicant_info_set_call (info, call); - - g_get_current_time (&cur_time); - priv->last_scan = cur_time.tv_sec; - return FALSE; -} - static void -wpas_iface_query_scan_results (DBusGProxy *proxy, gpointer user_data) +wpas_iface_bss_added (DBusGProxy *proxy, + const char *object_path, + GHashTable *props, + gpointer user_data) { - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (user_data); - GTimeVal cur_time; - - /* Only query scan results if a query is not queued */ - if (priv->scan_results_timeout) - return; - - g_get_current_time (&cur_time); - - /* Only fetch scan results every 4s max, but initially do it right away */ - if (priv->last_scan + 4 < cur_time.tv_sec) { - priv->scan_results_timeout = g_idle_add (request_scan_results, - user_data); - } else { - priv->scan_results_timeout = - g_timeout_add_seconds ((4 - (cur_time.tv_sec - priv->last_scan)), - request_scan_results, user_data); - } +g_message ("%s: here op %s props %p", __func__, object_path, props); + g_signal_emit (NM_SUPPLICANT_INTERFACE (user_data), signals[NEW_BSS], 0, props); } static int wpas_state_string_to_enum (const char *str_state) { - if (!strcmp (str_state, "DISCONNECTED")) + if (!strcmp (str_state, "disconnected")) return NM_SUPPLICANT_INTERFACE_STATE_DISCONNECTED; - else if (!strcmp (str_state, "INACTIVE")) + else if (!strcmp (str_state, "inactive")) return NM_SUPPLICANT_INTERFACE_STATE_INACTIVE; - else if (!strcmp (str_state, "SCANNING")) + else if (!strcmp (str_state, "scanning")) return NM_SUPPLICANT_INTERFACE_STATE_SCANNING; - else if (!strcmp (str_state, "ASSOCIATING")) + else if (!strcmp (str_state, "associating")) return NM_SUPPLICANT_INTERFACE_STATE_ASSOCIATING; - else if (!strcmp (str_state, "ASSOCIATED")) + else if (!strcmp (str_state, "associated")) return NM_SUPPLICANT_INTERFACE_STATE_ASSOCIATED; - else if (!strcmp (str_state, "4WAY_HANDSHAKE")) + else if (!strcmp (str_state, "4way_handshake")) return NM_SUPPLICANT_INTERFACE_STATE_4WAY_HANDSHAKE; - else if (!strcmp (str_state, "GROUP_HANDSHAKE")) + else if (!strcmp (str_state, "group_handshake")) return NM_SUPPLICANT_INTERFACE_STATE_GROUP_HANDSHAKE; - else if (!strcmp (str_state, "COMPLETED")) + else if (!strcmp (str_state, "completed")) return NM_SUPPLICANT_INTERFACE_STATE_COMPLETED; return -1; @@ -372,18 +304,16 @@ set_state (NMSupplicantInterface *self, guint32 new_state) if (priv->iface_proxy) { dbus_g_proxy_disconnect_signal (priv->iface_proxy, - "StateChange", - G_CALLBACK (wpas_iface_handle_state_change), + "PropertiesChanged", + G_CALLBACK (wpas_iface_properties_changed), self); - dbus_g_proxy_disconnect_signal (priv->iface_proxy, - "ScanResultsAvailable", - G_CALLBACK (wpas_iface_query_scan_results), + "ScanDone", + G_CALLBACK (wpas_iface_scan_done), self); - dbus_g_proxy_disconnect_signal (priv->iface_proxy, - "Scanning", - G_CALLBACK (wpas_iface_handle_scanning), + "BSSAdded", + G_CALLBACK (wpas_iface_bss_added), self); } } @@ -392,122 +322,123 @@ set_state (NMSupplicantInterface *self, guint32 new_state) g_signal_emit (self, signals[STATE], 0, priv->state, old_state); } -/* Supplicant state signal handler */ static void -wpas_iface_handle_state_change (DBusGProxy *proxy, - const char *str_new_state, - const char *str_old_state, - gpointer user_data) +set_state_from_string (NMSupplicantInterface *self, const char *new_state) { - int enum_state = wpas_state_string_to_enum (str_new_state); - - g_return_if_fail (enum_state > 0); + int state; - set_state (NM_SUPPLICANT_INTERFACE (user_data), (guint32) enum_state); + state = wpas_state_string_to_enum (new_state); + g_warn_if_fail (state > 0); + if (state > 0) + set_state (self, (guint32) state); } -/* Explicit state request reply handler */ static void -iface_state_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +set_scanning (NMSupplicantInterface *self, gboolean new_scanning) { - NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; - GError *err = NULL; - char *state_str = NULL; - int enum_state; + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + GTimeVal cur_time; - if (!dbus_g_proxy_end_call (proxy, call_id, &err, - G_TYPE_STRING, &state_str, - G_TYPE_INVALID)) { - nm_log_warn (LOGD_SUPPLICANT, "could not get interface state: %s.", err->message); - g_error_free (err); - } else { - enum_state = wpas_state_string_to_enum (state_str); - g_warn_if_fail (enum_state > 0); + if (priv->scanning != new_scanning) { + priv->scanning = new_scanning; + + /* Cache time of last scan completion */ + if (priv->scanning == FALSE) { + g_get_current_time (&cur_time); + priv->last_scan = cur_time.tv_sec; + } - if (enum_state > 0) - set_state (info->interface, (guint32) enum_state); - g_free (state_str); + g_object_notify (G_OBJECT (self), "scanning"); } } +gboolean +nm_supplicant_interface_get_scanning (NMSupplicantInterface *self) +{ + NMSupplicantInterfacePrivate *priv; + + g_return_val_if_fail (self != NULL, FALSE); + + priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + if (priv->scanning) + return TRUE; + if (priv->state == NM_SUPPLICANT_INTERFACE_STATE_SCANNING) + return TRUE; + return FALSE; +} + static void -wpas_iface_get_state (NMSupplicantInterface *self) +wpas_iface_scan_done (DBusGProxy *proxy, + gboolean success, + gpointer user_data) { + NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data); NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); - NMSupplicantInfo *info; - DBusGProxyCall *call; + GTimeVal cur_time; - info = nm_supplicant_info_new (self, priv->iface_proxy, priv->other_pcalls); - call = dbus_g_proxy_begin_call (priv->iface_proxy, "state", - iface_state_cb, - info, - nm_supplicant_info_destroy, - G_TYPE_INVALID); - nm_supplicant_info_set_call (info, call); + /* Cache last scan completed time */ + g_get_current_time (&cur_time); + priv->last_scan = cur_time.tv_sec; + + g_signal_emit (self, signals[SCAN_DONE], 0, success); } static void -iface_scanning_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +wpas_iface_properties_changed (DBusGProxy *proxy, + GHashTable *props, + gpointer user_data) +{ + NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data); + GValue *value; + + value = g_hash_table_lookup (props, "Scanning"); + if (value && G_VALUE_HOLDS_BOOLEAN (value)) + set_scanning (self, g_value_get_boolean (value)); + + value = g_hash_table_lookup (props, "State"); + if (value && G_VALUE_HOLDS_STRING (value)) + set_state_from_string (self, g_value_get_string (value)); + + value = g_hash_table_lookup (props, "BSSs"); + if (value && G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH)) + request_bss_properties (self, g_value_get_boxed (value)); +} + +static void +iface_get_props_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); - gboolean scanning = FALSE; + GHashTable *props = NULL; + GError *error = NULL; - if (dbus_g_proxy_end_call (proxy, call_id, NULL, - G_TYPE_BOOLEAN, &scanning, - G_TYPE_INVALID)) { - if (scanning != priv->scanning) { - priv->scanning = scanning; - g_object_notify (G_OBJECT (info->interface), "scanning"); - } + if (dbus_g_proxy_end_call (proxy, call_id, &error, + DBUS_TYPE_G_MAP_OF_VARIANT, &props, + G_TYPE_INVALID)) { + wpas_iface_properties_changed (NULL, props, info->interface); + } else { + nm_log_warn (LOGD_SUPPLICANT, "could not get interface properties: %s.", + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); } } static void -wpas_iface_get_scanning (NMSupplicantInterface *self) +wpas_iface_get_props (NMSupplicantInterface *self) { NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); NMSupplicantInfo *info; DBusGProxyCall *call; - info = nm_supplicant_info_new (self, priv->iface_proxy, priv->other_pcalls); - call = dbus_g_proxy_begin_call (priv->iface_proxy, "scanning", - iface_scanning_cb, + info = nm_supplicant_info_new (self, priv->props_proxy, priv->other_pcalls); + call = dbus_g_proxy_begin_call (priv->props_proxy, "GetAll", + iface_get_props_cb, info, nm_supplicant_info_destroy, + G_TYPE_STRING, WPAS_DBUS_IFACE_INTERFACE, G_TYPE_INVALID); nm_supplicant_info_set_call (info, call); } -static void -wpas_iface_handle_scanning (DBusGProxy *proxy, - gboolean scanning, - gpointer user_data) -{ - NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data); - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); - - if (scanning != priv->scanning) { - priv->scanning = scanning; - g_object_notify (G_OBJECT (self), "scanning"); - } -} - -gboolean -nm_supplicant_interface_get_scanning (NMSupplicantInterface *self) -{ - NMSupplicantInterfacePrivate *priv; - - g_return_val_if_fail (self != NULL, FALSE); - - priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); - if (priv->scanning) - return TRUE; - if (priv->state == NM_SUPPLICANT_INTERFACE_STATE_SCANNING) - return TRUE; - return FALSE; -} - static void interface_add_done (NMSupplicantInterface *self, char *path) { @@ -522,31 +453,38 @@ interface_add_done (NMSupplicantInterface *self, char *path) path, WPAS_DBUS_IFACE_INTERFACE); - dbus_g_object_register_marshaller (_nm_marshal_VOID__STRING_STRING, + dbus_g_object_register_marshaller (g_cclosure_marshal_VOID__BOXED, G_TYPE_NONE, - G_TYPE_STRING, G_TYPE_STRING, + DBUS_TYPE_G_MAP_OF_VARIANT, G_TYPE_INVALID); - dbus_g_proxy_add_signal (priv->iface_proxy, "StateChange", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (priv->iface_proxy, "StateChange", - G_CALLBACK (wpas_iface_handle_state_change), + dbus_g_proxy_add_signal (priv->iface_proxy, "PropertiesChanged", + DBUS_TYPE_G_MAP_OF_VARIANT, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->iface_proxy, "PropertiesChanged", + G_CALLBACK (wpas_iface_properties_changed), + self, NULL); + + dbus_g_proxy_add_signal (priv->iface_proxy, "ScanDone", G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->iface_proxy, "ScanDone", + G_CALLBACK (wpas_iface_scan_done), self, NULL); - dbus_g_proxy_add_signal (priv->iface_proxy, "ScanResultsAvailable", G_TYPE_INVALID); - dbus_g_proxy_connect_signal (priv->iface_proxy, "ScanResultsAvailable", - G_CALLBACK (wpas_iface_query_scan_results), - self, - NULL); - - dbus_g_proxy_add_signal (priv->iface_proxy, "Scanning", G_TYPE_BOOLEAN, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (priv->iface_proxy, "Scanning", - G_CALLBACK (wpas_iface_handle_scanning), + dbus_g_object_register_marshaller (_nm_marshal_VOID__STRING_BOXED, + G_TYPE_NONE, + G_TYPE_STRING, DBUS_TYPE_G_MAP_OF_VARIANT, + G_TYPE_INVALID); + dbus_g_proxy_add_signal (priv->iface_proxy, "BSSAdded", G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->iface_proxy, "BSSAdded", + G_CALLBACK (wpas_iface_bss_added), self, NULL); - /* Interface added to the supplicant; get its initial state. */ - wpas_iface_get_state (self); - wpas_iface_get_scanning (self); + priv->props_proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr), + WPAS_DBUS_SERVICE, + path, + DBUS_INTERFACE_PROPERTIES); + /* Get initial properties */ + wpas_iface_get_props (self); set_state (self, NM_SUPPLICANT_INTERFACE_STATE_READY); } @@ -743,7 +681,7 @@ nm_supplicant_interface_disconnect (NMSupplicantInterface * self) /* Remove any network that was added by NetworkManager */ if (priv->net_proxy) { - dbus_g_proxy_begin_call (priv->iface_proxy, "removeNetwork", + dbus_g_proxy_begin_call (priv->iface_proxy, "RemoveNetwork", remove_network_cb, NULL, NULL, DBUS_TYPE_G_OBJECT_PATH, dbus_g_proxy_get_path (priv->net_proxy), @@ -753,7 +691,7 @@ nm_supplicant_interface_disconnect (NMSupplicantInterface * self) priv->net_proxy = NULL; } - dbus_g_proxy_begin_call (priv->iface_proxy, "disconnect", + dbus_g_proxy_begin_call (priv->iface_proxy, "Disconnect", disconnect_cb, NULL, NULL, G_TYPE_INVALID); @@ -789,7 +727,7 @@ set_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) DBusGProxyCall *call; info = nm_supplicant_info_new (info->interface, priv->iface_proxy, priv->assoc_pcalls); - call = dbus_g_proxy_begin_call (priv->iface_proxy, "selectNetwork", + call = dbus_g_proxy_begin_call (priv->iface_proxy, "SelectNetwork", select_network_cb, info, nm_supplicant_info_destroy, @@ -1002,17 +940,12 @@ scan_request_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; GError *err = NULL; - guint32 success = 0; - if (!dbus_g_proxy_end_call (proxy, call_id, &err, - G_TYPE_UINT, &success, - G_TYPE_INVALID)) { + if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_INVALID)) { nm_log_warn (LOGD_SUPPLICANT, "Could not get scan request result: %s", err->message); - g_error_free (err); } - - /* Notify listeners of the result of the scan */ - g_signal_emit (info->interface, signals[SCAN_REQ_RESULT], 0, !!success); + g_signal_emit (info->interface, signals[SCAN_DONE], 0, err ? FALSE : TRUE); + g_clear_error (&err); } gboolean @@ -1180,9 +1113,6 @@ get_property (GObject *object, GParamSpec *pspec) { switch (prop_id) { - case PROP_STATE: - g_value_set_uint (value, NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object)->state); - break; case PROP_SCANNING: g_value_set_boolean (value, NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object)->scanning); break; @@ -1210,6 +1140,9 @@ dispose (GObject *object) cancel_all_callbacks (priv->assoc_pcalls); nm_call_store_destroy (priv->assoc_pcalls); + if (priv->props_proxy) + g_object_unref (priv->props_proxy); + if (priv->iface_proxy) g_object_unref (priv->iface_proxy); @@ -1219,9 +1152,6 @@ dispose (GObject *object) if (priv->wpas_proxy) g_object_unref (priv->wpas_proxy); - if (priv->scan_results_timeout) - g_source_remove (priv->scan_results_timeout); - if (priv->smgr) { if (priv->smgr_avail_id) g_signal_handler_disconnect (priv->smgr, priv->smgr_avail_id); @@ -1254,15 +1184,6 @@ nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass) object_class->get_property = get_property; /* Properties */ - g_object_class_install_property (object_class, PROP_STATE, - g_param_spec_uint ("state", - "State", - "State of the supplicant interface", - NM_SUPPLICANT_INTERFACE_STATE_INIT, - NM_SUPPLICANT_INTERFACE_STATE_LAST - 1, - NM_SUPPLICANT_INTERFACE_STATE_INIT, - G_PARAM_READABLE)); - g_object_class_install_property (object_class, PROP_SCANNING, g_param_spec_boolean ("scanning", "Scanning", @@ -1272,7 +1193,7 @@ nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass) /* Signals */ signals[STATE] = - g_signal_new ("state", + g_signal_new (NM_SUPPLICANT_INTERFACE_STATE, G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (NMSupplicantInterfaceClass, state), @@ -1281,7 +1202,7 @@ nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass) G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); signals[REMOVED] = - g_signal_new ("removed", + g_signal_new (NM_SUPPLICANT_INTERFACE_REMOVED, G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (NMSupplicantInterfaceClass, removed), @@ -1289,35 +1210,26 @@ nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - signals[SCANNED_AP] = - g_signal_new ("scanned-ap", + signals[NEW_BSS] = + g_signal_new (NM_SUPPLICANT_INTERFACE_NEW_BSS, G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scanned_ap), + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, new_bss), NULL, NULL, g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); - signals[SCAN_REQ_RESULT] = - g_signal_new ("scan-req-result", + signals[SCAN_DONE] = + g_signal_new (NM_SUPPLICANT_INTERFACE_SCAN_DONE, G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scan_req_result), + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scan_done), NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN); - signals[SCAN_RESULTS] = - g_signal_new ("scan-results", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scan_results), - NULL, NULL, - g_cclosure_marshal_VOID__UINT, - G_TYPE_NONE, 1, G_TYPE_UINT); - signals[CONNECTION_ERROR] = - g_signal_new ("connection-error", + g_signal_new (NM_SUPPLICANT_INTERFACE_CONNECTION_ERROR, G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (NMSupplicantInterfaceClass, connection_error), diff --git a/src/supplicant-manager/nm-supplicant-interface.h b/src/supplicant-manager/nm-supplicant-interface.h index 9471bd771b..44c92f19c6 100644 --- a/src/supplicant-manager/nm-supplicant-interface.h +++ b/src/supplicant-manager/nm-supplicant-interface.h @@ -53,6 +53,12 @@ enum { #define NM_IS_SUPPLICANT_INTERFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SUPPLICANT_INTERFACE)) #define NM_SUPPLICANT_INTERFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SUPPLICANT_INTERFACE, NMSupplicantInterfaceClass)) +#define NM_SUPPLICANT_INTERFACE_STATE "state" +#define NM_SUPPLICANT_INTERFACE_REMOVED "removed" +#define NM_SUPPLICANT_INTERFACE_NEW_BSS "new-bss" +#define NM_SUPPLICANT_INTERFACE_SCAN_DONE "scan-done" +#define NM_SUPPLICANT_INTERFACE_CONNECTION_ERROR "connection-error" + struct _NMSupplicantInterface { GObject parent; }; @@ -70,18 +76,14 @@ typedef struct { /* interface was removed by the supplicant */ void (*removed) (NMSupplicantInterface * iface); - /* interface saw a new access point from a scan */ - void (*scanned_ap) (NMSupplicantInterface * iface, - DBusMessage * message); + /* interface saw a new BSS */ + void (*new_bss) (NMSupplicantInterface *iface, + GHashTable *props); - /* result of a wireless scan request */ - void (*scan_req_result) (NMSupplicantInterface * iface, + /* wireless scan is done */ + void (*scan_done) (NMSupplicantInterface *iface, gboolean success); - /* scan results returned from supplicant */ - void (*scan_results) (NMSupplicantInterface * iface, - guint num_bssids); - /* an error occurred during a connection request */ void (*connection_error) (NMSupplicantInterface * iface, const char * name, -- cgit v1.2.1 From 848f9f42610e39f1c49066082ad2541fe4303cc3 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 22 Nov 2010 08:30:13 -0600 Subject: wifi: convert parts of association path to new supplicant interface --- src/supplicant-manager/nm-supplicant-interface.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index ae6630ea67..0fac765fb5 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -889,8 +889,8 @@ set_ap_scan_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) nm_log_info (LOGD_SUPPLICANT, "Config: set interface ap_scan to %d", nm_supplicant_config_get_ap_scan (priv->cfg)); - info = nm_supplicant_info_new (info->interface, proxy, info->store); - call = dbus_g_proxy_begin_call (proxy, "addNetwork", + info = nm_supplicant_info_new (info->interface, priv->iface_proxy, info->store); + call = dbus_g_proxy_begin_call (priv->iface_proxy, "AddNetwork", add_network_cb, info, nm_supplicant_info_destroy, @@ -922,12 +922,14 @@ nm_supplicant_interface_set_config (NMSupplicantInterface * self, g_object_ref (priv->cfg); - info = nm_supplicant_info_new (self, priv->iface_proxy, priv->other_pcalls); + info = nm_supplicant_info_new (self, priv->props_proxy, priv->other_pcalls); ap_scan = nm_supplicant_config_get_ap_scan (priv->cfg); - call = dbus_g_proxy_begin_call (priv->iface_proxy, "setAPScan", + call = dbus_g_proxy_begin_call (priv->props_proxy, "Set", set_ap_scan_cb, info, nm_supplicant_info_destroy, + G_TYPE_STRING, WPAS_DBUS_IFACE_INTERFACE, + G_TYPE_STRING, "ApScan", G_TYPE_UINT, ap_scan, G_TYPE_INVALID); nm_supplicant_info_set_call (info, call); -- cgit v1.2.1 From 6ecb45ddf07718cf41c22a5c3a5038923fadcbfe Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 22 Nov 2010 08:40:21 -0600 Subject: wifi: convert scanning to new supplicant interface --- src/supplicant-manager/nm-supplicant-interface.c | 28 +++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index 0fac765fb5..36faab7034 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -950,23 +950,49 @@ scan_request_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) g_clear_error (&err); } +static void +destroy_gvalue (gpointer data) +{ + GValue *value = (GValue *) data; + + g_value_unset (value); + g_slice_free (GValue, value); +} + +static GValue * +string_to_gvalue (const char *str) +{ + GValue *val = g_slice_new0 (GValue); + + g_value_init (val, G_TYPE_STRING); + g_value_set_string (val, str); + return val; +} + gboolean nm_supplicant_interface_request_scan (NMSupplicantInterface * self) { NMSupplicantInterfacePrivate *priv; NMSupplicantInfo *info; DBusGProxyCall *call; + GHashTable *hash; g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), FALSE); priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + /* Scan parameters */ + hash = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, destroy_gvalue); + g_hash_table_insert (hash, "Type", string_to_gvalue ("active")); + info = nm_supplicant_info_new (self, priv->iface_proxy, priv->other_pcalls); - call = dbus_g_proxy_begin_call (priv->iface_proxy, "scan", + call = dbus_g_proxy_begin_call (priv->iface_proxy, "Scan", scan_request_cb, info, nm_supplicant_info_destroy, + DBUS_TYPE_G_MAP_OF_VARIANT, hash, G_TYPE_INVALID); + g_hash_table_destroy (hash); nm_supplicant_info_set_call (info, call); return call != NULL; -- cgit v1.2.1 From f5e084c668dc3cbd1a8f968644e2da1caffd1838 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 22 Nov 2010 09:05:09 -0600 Subject: supplicant: convert association paths to new supplicant interface --- src/supplicant-manager/nm-supplicant-interface.c | 132 +++++++++-------------- 1 file changed, 48 insertions(+), 84 deletions(-) diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index 36faab7034..cd2d2b5e7b 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -90,7 +90,7 @@ typedef struct { DBusGProxy * wpas_proxy; DBusGProxy * iface_proxy; DBusGProxy * props_proxy; - DBusGProxy * net_proxy; + char * net_path; guint32 last_scan; @@ -672,23 +672,20 @@ nm_supplicant_interface_disconnect (NMSupplicantInterface * self) /* Don't try to disconnect if the supplicant interface is already disconnected */ if ( priv->state == NM_SUPPLICANT_INTERFACE_STATE_DISCONNECTED || priv->state == NM_SUPPLICANT_INTERFACE_STATE_INACTIVE) { - if (priv->net_proxy) { - g_object_unref (priv->net_proxy); - priv->net_proxy = NULL; - } + g_free (priv->net_path); + priv->net_path = NULL; return; } /* Remove any network that was added by NetworkManager */ - if (priv->net_proxy) { + if (priv->net_path) { dbus_g_proxy_begin_call (priv->iface_proxy, "RemoveNetwork", remove_network_cb, NULL, NULL, - DBUS_TYPE_G_OBJECT_PATH, dbus_g_proxy_get_path (priv->net_proxy), + DBUS_TYPE_G_OBJECT_PATH, priv->net_path, G_TYPE_INVALID); - - g_object_unref (priv->net_proxy); - priv->net_proxy = NULL; + g_free (priv->net_path); + priv->net_path = NULL; } dbus_g_proxy_begin_call (priv->iface_proxy, "Disconnect", @@ -702,9 +699,8 @@ select_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_dat { NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; GError *err = NULL; - guint tmp; - if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_UINT, &tmp, G_TYPE_INVALID)) { + if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_INVALID)) { nm_log_warn (LOGD_SUPPLICANT, "Couldn't select network config: %s.", err->message); emit_error_helper (info->interface, err); g_error_free (err); @@ -712,54 +708,26 @@ select_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_dat } static void -set_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +call_select_network (NMSupplicantInterface *self) { - NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); - GError *err = NULL; - guint tmp; - - if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_UINT, &tmp, G_TYPE_INVALID)) { - nm_log_warn (LOGD_SUPPLICANT, "Couldn't set network config: %s.", err->message); - emit_error_helper (info->interface, err); - g_error_free (err); - } else { - DBusGProxyCall *call; - - info = nm_supplicant_info_new (info->interface, priv->iface_proxy, priv->assoc_pcalls); - call = dbus_g_proxy_begin_call (priv->iface_proxy, "SelectNetwork", - select_network_cb, - info, - nm_supplicant_info_destroy, - DBUS_TYPE_G_OBJECT_PATH, dbus_g_proxy_get_path (proxy), - G_TYPE_INVALID); - nm_supplicant_info_set_call (info, call); - } -} - -static void -call_set_network (NMSupplicantInfo *info) -{ - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); - GHashTable *config_hash; + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); DBusGProxyCall *call; + NMSupplicantInfo *info; - config_hash = nm_supplicant_config_get_hash (priv->cfg); - call = dbus_g_proxy_begin_call (priv->net_proxy, "set", - set_network_cb, + info = nm_supplicant_info_new (self, priv->iface_proxy, priv->assoc_pcalls); + call = dbus_g_proxy_begin_call (priv->iface_proxy, "SelectNetwork", + select_network_cb, info, nm_supplicant_info_destroy, - DBUS_TYPE_G_MAP_OF_VARIANT, config_hash, + DBUS_TYPE_G_OBJECT_PATH, priv->net_path, G_TYPE_INVALID); nm_supplicant_info_set_call (info, call); - g_hash_table_destroy (config_hash); } static void set_blobs_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); GError *err = NULL; guint tmp; @@ -767,10 +735,8 @@ set_blobs_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) nm_log_warn (LOGD_SUPPLICANT, "Couldn't set network certificates: %s.", err->message); emit_error_helper (info->interface, err); g_error_free (err); - } else { - info = nm_supplicant_info_new (info->interface, priv->iface_proxy, priv->assoc_pcalls); - call_set_network (info); - } + } else + call_select_network (info->interface); } static GValue * @@ -802,11 +768,12 @@ convert_blob (const char *key, const GByteArray *value, GHashTable *hash) } static void -call_set_blobs (NMSupplicantInfo *info, GHashTable *orig_blobs) +call_set_blobs (NMSupplicantInterface *self, GHashTable *orig_blobs) { - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); DBusGProxyCall *call; GHashTable *blobs; + NMSupplicantInfo *info; blobs = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, @@ -815,12 +782,13 @@ call_set_blobs (NMSupplicantInfo *info, GHashTable *orig_blobs) const char *msg = "Not enough memory to create blob table."; nm_log_warn (LOGD_SUPPLICANT, "%s", msg); - g_signal_emit (info->interface, signals[CONNECTION_ERROR], 0, "SendBlobError", msg); + g_signal_emit (self, signals[CONNECTION_ERROR], 0, "SendBlobError", msg); return; } g_hash_table_foreach (orig_blobs, (GHFunc) convert_blob, blobs); + info = nm_supplicant_info_new (self, priv->iface_proxy, priv->assoc_pcalls); call = dbus_g_proxy_begin_call (priv->iface_proxy, "setBlobs", set_blobs_cb, info, @@ -835,38 +803,29 @@ static void add_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); GError *err = NULL; - char *path = NULL; + GHashTable *blobs; + + g_free (priv->net_path); + priv->net_path = NULL; if (!dbus_g_proxy_end_call (proxy, call_id, &err, - DBUS_TYPE_G_OBJECT_PATH, &path, + DBUS_TYPE_G_OBJECT_PATH, &priv->net_path, G_TYPE_INVALID)) { nm_log_warn (LOGD_SUPPLICANT, "Couldn't add a network to the supplicant interface: %s.", err->message); emit_error_helper (info->interface, err); g_error_free (err); - } else { - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); - GHashTable *blobs; - - priv->net_proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr), - WPAS_DBUS_SERVICE, - path, - WPAS_DBUS_IFACE_NETWORK); - g_free (path); - - info = nm_supplicant_info_new (info->interface, - priv->net_proxy, - priv->assoc_pcalls); - /* Send any blobs first; if there aren't any jump to sending the - * config settings. - */ - blobs = nm_supplicant_config_get_blobs (priv->cfg); - if (g_hash_table_size (blobs) > 0) - call_set_blobs (info, blobs); - else - call_set_network (info); + return; } + + /* Send blobs first; otherwise jump to sending the config settings */ + blobs = nm_supplicant_config_get_blobs (priv->cfg); + if (g_hash_table_size (blobs) > 0) + call_set_blobs (info->interface, blobs); + else + call_select_network (info->interface); } static void @@ -875,10 +834,10 @@ set_ap_scan_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); GError *err = NULL; - guint32 tmp; DBusGProxyCall *call; + GHashTable *config_hash; - if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_UINT, &tmp, G_TYPE_INVALID)) { + if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_INVALID)) { nm_log_warn (LOGD_SUPPLICANT, "Couldn't send AP scan mode to the supplicant interface: %s.", err->message); emit_error_helper (info->interface, err); @@ -890,11 +849,14 @@ set_ap_scan_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) nm_supplicant_config_get_ap_scan (priv->cfg)); info = nm_supplicant_info_new (info->interface, priv->iface_proxy, info->store); + config_hash = nm_supplicant_config_get_hash (priv->cfg); call = dbus_g_proxy_begin_call (priv->iface_proxy, "AddNetwork", add_network_cb, info, nm_supplicant_info_destroy, + DBUS_TYPE_G_MAP_OF_VARIANT, config_hash, G_TYPE_INVALID); + g_hash_table_destroy (config_hash); nm_supplicant_info_set_call (info, call); } @@ -905,7 +867,7 @@ nm_supplicant_interface_set_config (NMSupplicantInterface * self, NMSupplicantInterfacePrivate *priv; NMSupplicantInfo *info; DBusGProxyCall *call; - guint32 ap_scan; + GValue value = { 0, }; g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), FALSE); @@ -922,18 +884,21 @@ nm_supplicant_interface_set_config (NMSupplicantInterface * self, g_object_ref (priv->cfg); + g_value_init (&value, G_TYPE_UINT); + g_value_set_uint (&value, nm_supplicant_config_get_ap_scan (priv->cfg)); + info = nm_supplicant_info_new (self, priv->props_proxy, priv->other_pcalls); - ap_scan = nm_supplicant_config_get_ap_scan (priv->cfg); call = dbus_g_proxy_begin_call (priv->props_proxy, "Set", set_ap_scan_cb, info, nm_supplicant_info_destroy, G_TYPE_STRING, WPAS_DBUS_IFACE_INTERFACE, G_TYPE_STRING, "ApScan", - G_TYPE_UINT, ap_scan, + G_TYPE_VALUE, &value, G_TYPE_INVALID); nm_supplicant_info_set_call (info, call); + g_value_unset (&value); return call != NULL; } @@ -1174,8 +1139,7 @@ dispose (GObject *object) if (priv->iface_proxy) g_object_unref (priv->iface_proxy); - if (priv->net_proxy) - g_object_unref (priv->net_proxy); + g_free (priv->net_path); if (priv->wpas_proxy) g_object_unref (priv->wpas_proxy); -- cgit v1.2.1 From fb6cde508c1417765684ae940f72d639067ddf0a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 22 Nov 2010 22:34:04 -0600 Subject: supplicant: convert blob handling to new supplicant interface --- src/supplicant-manager/nm-supplicant-interface.c | 94 +++++++----------------- 1 file changed, 28 insertions(+), 66 deletions(-) diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index cd2d2b5e7b..a92268c3d4 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -91,6 +91,7 @@ typedef struct { DBusGProxy * iface_proxy; DBusGProxy * props_proxy; char * net_path; + guint32 blobs_left; guint32 last_scan; @@ -246,7 +247,6 @@ wpas_iface_bss_added (DBusGProxy *proxy, GHashTable *props, gpointer user_data) { -g_message ("%s: here op %s props %p", __func__, object_path, props); g_signal_emit (NM_SUPPLICANT_INTERFACE (user_data), signals[NEW_BSS], 0, props); } @@ -714,6 +714,10 @@ call_select_network (NMSupplicantInterface *self) DBusGProxyCall *call; NMSupplicantInfo *info; + /* We only select the network after all blobs (if any) have been set */ + if (priv->blobs_left > 0) + return; + info = nm_supplicant_info_new (self, priv->iface_proxy, priv->assoc_pcalls); call = dbus_g_proxy_begin_call (priv->iface_proxy, "SelectNetwork", select_network_cb, @@ -725,12 +729,15 @@ call_select_network (NMSupplicantInterface *self) } static void -set_blobs_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +add_blob_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); GError *err = NULL; guint tmp; + priv->blobs_left--; + if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_UINT, &tmp, G_TYPE_INVALID)) { nm_log_warn (LOGD_SUPPLICANT, "Couldn't set network certificates: %s.", err->message); emit_error_helper (info->interface, err); @@ -739,66 +746,6 @@ set_blobs_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) call_select_network (info->interface); } -static GValue * -byte_array_to_gvalue (const GByteArray *array) -{ - GValue *val; - - val = g_slice_new0 (GValue); - g_value_init (val, DBUS_TYPE_G_UCHAR_ARRAY); - g_value_set_boxed (val, array); - - return val; -} - -static void -blob_free (GValue *val) -{ - g_value_unset (val); - g_slice_free (GValue, val); -} - -static void -convert_blob (const char *key, const GByteArray *value, GHashTable *hash) -{ - GValue *val; - - val = byte_array_to_gvalue (value); - g_hash_table_insert (hash, g_strdup (key), val); -} - -static void -call_set_blobs (NMSupplicantInterface *self, GHashTable *orig_blobs) -{ - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); - DBusGProxyCall *call; - GHashTable *blobs; - NMSupplicantInfo *info; - - blobs = g_hash_table_new_full (g_str_hash, g_str_equal, - (GDestroyNotify) g_free, - (GDestroyNotify) blob_free); - if (!blobs) { - const char *msg = "Not enough memory to create blob table."; - - nm_log_warn (LOGD_SUPPLICANT, "%s", msg); - g_signal_emit (self, signals[CONNECTION_ERROR], 0, "SendBlobError", msg); - return; - } - - g_hash_table_foreach (orig_blobs, (GHFunc) convert_blob, blobs); - - info = nm_supplicant_info_new (self, priv->iface_proxy, priv->assoc_pcalls); - call = dbus_g_proxy_begin_call (priv->iface_proxy, "setBlobs", - set_blobs_cb, - info, - nm_supplicant_info_destroy, - DBUS_TYPE_G_MAP_OF_VARIANT, blobs, - G_TYPE_INVALID); - nm_supplicant_info_set_call (info, call); - g_hash_table_destroy (blobs); -} - static void add_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { @@ -806,6 +753,10 @@ add_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); GError *err = NULL; GHashTable *blobs; + GHashTableIter iter; + gpointer name, data; + DBusGProxyCall *call; + NMSupplicantInfo *blob_info; g_free (priv->net_path); priv->net_path = NULL; @@ -822,10 +773,21 @@ add_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) /* Send blobs first; otherwise jump to sending the config settings */ blobs = nm_supplicant_config_get_blobs (priv->cfg); - if (g_hash_table_size (blobs) > 0) - call_set_blobs (info->interface, blobs); - else - call_select_network (info->interface); + priv->blobs_left = g_hash_table_size (blobs); + g_hash_table_iter_init (&iter, blobs); + while (g_hash_table_iter_next (&iter, &name, &data)) { + blob_info = nm_supplicant_info_new (info->interface, priv->iface_proxy, priv->assoc_pcalls); + call = dbus_g_proxy_begin_call (priv->iface_proxy, "AddBlob", + add_blob_cb, + blob_info, + nm_supplicant_info_destroy, + DBUS_TYPE_STRING, name, + DBUS_TYPE_G_UCHAR_ARRAY, blobs, + G_TYPE_INVALID); + nm_supplicant_info_set_call (blob_info, call); + } + + call_select_network (info->interface); } static void -- cgit v1.2.1 From bfbb71b763378df7620381f5b98fc60573feb5aa Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 23 Nov 2010 00:02:46 -0600 Subject: wifi: update signal quality calculation for new supplicant interface --- src/nm-device-wifi.c | 40 ---------------------------------------- src/nm-wifi-ap.c | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 40 deletions(-) diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 3644ccfc4c..a2b3b4c1e2 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -2140,44 +2140,6 @@ cull_scan_list (NMDeviceWifi *self) removed, total); } -#define SET_QUALITY_MEMBER(qual_item, lc_member, uc_member) \ - if (lc_member != -1) { \ - qual_item.lc_member = lc_member; \ - qual_item.updated |= IW_QUAL_##uc_member##_UPDATED; \ - } else { \ - qual_item.updated |= IW_QUAL_##uc_member##_INVALID; \ - } - -static void -set_ap_strength_from_properties (NMDeviceWifi *self, - NMAccessPoint *ap, - GHashTable *properties) -{ - NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); - int qual, level, noise; - struct iw_quality quality; - GValue *value; - gint8 strength; - - value = (GValue *) g_hash_table_lookup (properties, "quality"); - qual = value ? g_value_get_int (value) : -1; - - value = (GValue *) g_hash_table_lookup (properties, "level"); - level = value ? g_value_get_int (value) : -1; - - value = (GValue *) g_hash_table_lookup (properties, "noise"); - noise = value ? g_value_get_int (value) : -1; - - /* Calculate and set the AP's signal quality */ - memset (&quality, 0, sizeof (struct iw_quality)); - SET_QUALITY_MEMBER (quality, qual, QUAL); - SET_QUALITY_MEMBER (quality, level, LEVEL); - SET_QUALITY_MEMBER (quality, noise, NOISE); - - strength = wireless_qual_to_percent (&quality, &priv->max_qual); - nm_ap_set_strength (ap, strength); -} - static void supplicant_iface_new_bss_cb (NMSupplicantInterface *iface, GHashTable *properties, @@ -2197,8 +2159,6 @@ supplicant_iface_new_bss_cb (NMSupplicantInterface *iface, ap = nm_ap_new_from_properties (properties); if (ap) { - set_ap_strength_from_properties (self, ap, properties); - nm_ap_print_self (ap, "AP: "); /* Add the AP to the device's AP list */ diff --git a/src/nm-wifi-ap.c b/src/nm-wifi-ap.c index 642b6d978e..4438118729 100644 --- a/src/nm-wifi-ap.c +++ b/src/nm-wifi-ap.c @@ -22,6 +22,7 @@ #include "wireless-helper.h" #include +#include #include "nm-wifi-ap.h" #include "NetworkManagerUtils.h" @@ -495,6 +496,19 @@ foreach_property_cb (gpointer key, gpointer value, gpointer user_data) if (!strcmp (key, "Frequency")) nm_ap_set_freq (ap, val); + } else if (G_VALUE_HOLDS_INT (variant)) { + gint val = g_value_get_int (variant); + + if (!strcmp (key, "Signal")) { + if (val < 0) { + /* Rough conversion: best = -40, worst = -100 */ + val = abs (CLAMP (val, -100, -40) + 40); + val = 100 - (int) ((100.0 * (double) val) / 60.0); + } else + val /= 100; + + nm_ap_set_strength (ap, val); + } } else if (G_VALUE_HOLDS_STRING (variant)) { const char *val = g_value_get_string (variant); -- cgit v1.2.1 From 8c9a124e72ca5ff4e648e91001fd540f0c179f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Tue, 23 Nov 2010 16:27:21 +0100 Subject: keyfile: allow uppercase MAC addresses in unmanaged-devices in config file (rh #654714) --- system-settings/plugins/keyfile/plugin.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/system-settings/plugins/keyfile/plugin.c b/system-settings/plugins/keyfile/plugin.c index 5a927ce75d..da6456d983 100644 --- a/system-settings/plugins/keyfile/plugin.c +++ b/system-settings/plugins/keyfile/plugin.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -418,8 +419,23 @@ get_unmanaged_specs (NMSystemConfigInterface *config) udis = g_strsplit (str, ";", -1); g_free (str); - for (i = 0; udis[i] != NULL; i++) - specs = g_slist_append (specs, udis[i]); + for (i = 0; udis[i] != NULL; i++) { + /* Verify unmanaged specification and add it to the list */ + if (strlen (udis[i]) > 4 && !strncmp (udis[i], "mac:", 4) && ether_aton (udis[i] + 4)) { + char *p = udis[i]; + + /* To accept uppercase MACs in configuration file, we have to convert values to lowercase here. + * Unmanaged MACs in specs are always in lowercase. */ + while (*p) { + *p = g_ascii_tolower (*p); + p++; + } + specs = g_slist_append (specs, udis[i]); + } else { + g_warning ("Error in file '%s': invalid unmanaged-devices entry: '%s'", priv->conf_file, udis[i]); + g_free (udis[i]); + } + } g_free (udis); /* Yes, g_free, not g_strfreev because we need the strings in the list */ } -- cgit v1.2.1 From 5c9e82d17b936c17eae16b4cb37497e68054470f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Tue, 23 Nov 2010 16:45:04 +0100 Subject: man: update NetworkManager.conf man page --- man/NetworkManager.conf.5.in | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/man/NetworkManager.conf.5.in b/man/NetworkManager.conf.5.in index ba575c9415..c866f1b337 100644 --- a/man/NetworkManager.conf.5.in +++ b/man/NetworkManager.conf.5.in @@ -2,7 +2,7 @@ .\" .\" Copyright (C) 2010 Red Hat, Inc. .\" -.TH "NetworkManager.conf" "5" "16 September 2010" "" +.TH "NetworkManager.conf" "5" "23 November 2010" "" .SH NAME NetworkManager.conf \- NetworkManager configuration file .SH SYNOPSIS @@ -129,10 +129,12 @@ Set a persistent hostname when using the \fIkeyfile\fP plugin. .B unmanaged-devices=\fImac:\fP;\fImac:\fP;... Set devices that should be ignored by NetworkManager when using the \fIkeyfile\fP plugin. Devices are specified in the following format: "mac:", where - is MAC address of the device to be ignored, in lowercase. Multiple -entries are separated by a semicolon. Example: + is MAC address of the device to be ignored, in hex-digits-and-colons notation. +Multiple entries are separated by a semicolon. No spaces are allowed in the value. +.br +Example: .nf -unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1e:65:30:d1:c4 +unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4 .fi .SS [ifupdown] This section contains ifupdown-specific options and thus only has effect when using \fIifupdown\fP plugin. -- cgit v1.2.1 From 4b022ed32bb3d729fd21d2e33483fda03c6a6333 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Tue, 23 Nov 2010 19:06:58 +0100 Subject: core: correct TIMESTAMP type; fixes potential crash when time() is 32bit The Crash appeared on some platforms in glib while processing variable arguments. --- src/system-settings/nm-default-wired-connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system-settings/nm-default-wired-connection.c b/src/system-settings/nm-default-wired-connection.c index 1cda3d9e23..0d19dea014 100644 --- a/src/system-settings/nm-default-wired-connection.c +++ b/src/system-settings/nm-default-wired-connection.c @@ -163,7 +163,7 @@ constructor (GType type, NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, NM_SETTING_CONNECTION_UUID, uuid, NM_SETTING_CONNECTION_READ_ONLY, priv->read_only, - NM_SETTING_CONNECTION_TIMESTAMP, time (NULL), + NM_SETTING_CONNECTION_TIMESTAMP, (guint64) time (NULL), NULL); g_free (id); -- cgit v1.2.1 From 608783c5b773a30139158ef3b00c211dcc255ee8 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 23 Nov 2010 13:10:01 -0600 Subject: core: handle device removal when properties are unreadable By the time we get the udev device removal notification we may not be able to read properties, since the device has already been removed from sysfs. That means we can't get the ifindex, so we need to fall back to the interface name. But we always want to prefer the ifindex since that will never change as long as the device is connected, unlike the interface name. --- src/nm-manager.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/nm-manager.c b/src/nm-manager.c index eb393facc4..48f2173d87 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -2426,6 +2426,14 @@ udev_device_removed_cb (NMUdevManager *manager, ifindex = g_udev_device_get_property_as_int (udev_device, "IFINDEX"); device = find_device_by_ifindex (self, ifindex); + if (!device) { + /* On removal we won't always be able to read properties anymore, as + * they may have already been removed from sysfs. Instead, we just + * have to fall back to the device's interface name. + */ + device = find_device_by_iface (self, g_udev_device_get_name (udev_device)); + } + if (device) priv->devices = remove_one_device (self, priv->devices, device, FALSE); } -- cgit v1.2.1 From 40bbd4e2f2b221ca2894e0ad2026c0bf231479bd Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 23 Nov 2010 16:28:25 -0600 Subject: examples: fix querying active connections --- examples/python/nm-state.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/python/nm-state.py b/examples/python/nm-state.py index fddd2da629..2bbdd2db4a 100644 --- a/examples/python/nm-state.py +++ b/examples/python/nm-state.py @@ -47,13 +47,13 @@ active = manager_prop_iface.Get("org.freedesktop.NetworkManager", "ActiveConnect for a in active: ac_proxy = bus.get_object("org.freedesktop.NetworkManager", a) prop_iface = dbus.Interface(ac_proxy, "org.freedesktop.DBus.Properties") - state = prop_iface.Get("org.freedesktop.NetworkManager.ActiveConnection", "State") + state = prop_iface.Get("org.freedesktop.NetworkManager.Connection.Active", "State") # Connections in NM are a collection of settings that describe everything # needed to connect to a specific network. Lets get those details so we # can find the user-readable name of the connection. - con_path = prop_iface.Get("org.freedesktop.NetworkManager.ActiveConnection", "Connection") - con_service = prop_iface.Get("org.freedesktop.NetworkManager.ActiveConnection", "ServiceName") + con_path = prop_iface.Get("org.freedesktop.NetworkManager.Connection.Active", "Connection") + con_service = prop_iface.Get("org.freedesktop.NetworkManager.Connection.Active", "ServiceName") # ask the provider of the connection for its details service_proxy = bus.get_object(con_service, con_path) -- cgit v1.2.1 From 4b37101ef4e91efb57525ad694169b48b56a0a61 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 23 Nov 2010 22:17:21 -0600 Subject: core: suppress error message when user settings service is not active Don't bother trying to initialize the user settings proxy when it isn't even active. Would trigger a warning to syslog if PolicyKit permissions changed via changes to /usr/share/polkit-1/actions/. --- src/nm-manager.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 48f2173d87..afcc6add54 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -1356,6 +1356,12 @@ user_proxy_init (NMManager *self) g_return_if_fail (self != NULL); g_return_if_fail (priv->user_proxy == NULL); + /* Don't try to initialize the user settings proxy if the user + * settings service doesn't actually exist. + */ + if (!nm_dbus_manager_name_has_owner (priv->dbus_mgr, NM_DBUS_SERVICE_USER_SETTINGS)) + return; + bus = nm_dbus_manager_get_connection (priv->dbus_mgr); priv->user_proxy = dbus_g_proxy_new_for_name_owner (bus, NM_DBUS_SERVICE_USER_SETTINGS, @@ -3975,8 +3981,7 @@ nm_manager_start (NMManager *self) * they will be queried when the user settings service shows up on the * bus in nm_manager_name_owner_changed(). */ - if (nm_dbus_manager_name_has_owner (priv->dbus_mgr, NM_DBUS_SERVICE_USER_SETTINGS)) - user_proxy_init (self); + user_proxy_init (self); nm_udev_manager_query_devices (priv->udev_mgr); bluez_manager_resync_devices (self); -- cgit v1.2.1 From f6f8ef2f8a1f0c89c78f85f48bf88c62dcad5aec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 24 Nov 2010 12:51:08 +0100 Subject: dns: fix a crash due to uninitialized nis_domain (novell #655685) Reported and tested by Raymond Wooninck. Thanks! --- src/dns-manager/nm-dns-manager.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dns-manager/nm-dns-manager.c b/src/dns-manager/nm-dns-manager.c index 7a6fbbc9d9..b0cdcc267d 100644 --- a/src/dns-manager/nm-dns-manager.c +++ b/src/dns-manager/nm-dns-manager.c @@ -583,6 +583,7 @@ update_dns (NMDnsManager *self, rc.nameservers = g_ptr_array_new (); rc.domain = NULL; rc.searches = g_ptr_array_new (); + rc.nis_domain = NULL; rc.nis_servers = g_ptr_array_new (); if (priv->ip4_vpn_config) -- cgit v1.2.1 From 690357116017c190aab0cfed7612c3b16cb269df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 24 Nov 2010 17:24:28 +0100 Subject: ifcfg-rh: allow missing and 0.0.0.0 GATEWAYn lines in ifcfg-routes (rh #647992) GATEWAY0=0.0.0.0 was erroneously denied. Also, missing GATEWAY0 entry caused ifcfg-rh plugin to regard the connection as invalid. The commit fixes that and makes it behave in accordance with initscripts. --- system-settings/plugins/ifcfg-rh/reader.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index f25acc892d..b4ee1307b9 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -683,12 +683,7 @@ read_one_ip4_route (shvarFile *ifcfg, /* Next hop */ if (!read_ip4_address (ifcfg, gw_tag, &tmp, error)) goto out; - if (!tmp) { - g_set_error (error, IFCFG_PLUGIN_ERROR, 0, - "Missing or invalid IP4 gateway address '%d'", - tmp); - goto out; - } + /* No need to check tmp, because we don't make distinction between missing GATEWAY IP and 0.0.0.0 */ nm_ip4_route_set_next_hop (route, tmp); /* Prefix */ -- cgit v1.2.1 From bfbf5ef374a192c88488594d9f811007f5f6f831 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Mon, 6 Dec 2010 15:55:48 +0100 Subject: ifcfg-rh: fix missing connections when an unmanaged interface was present Don't emit "unmanaged-specs-changed" signal in read_one_connection(), because it causes that next connections are not listed (get_connections() is called prematurely and only connections read so far are available). Steps to reproduce the bug: 1) create ifcfg-fake DEVICE=loremipsum HWADDR=01:02:03:04:05:06 NM_CONTROLLED=no 2) restart NetworkManager 3) only connections read *before* ifcfg-fake are available Thanks to Robert Vogelgesang for updating the patch and analysis! --- system-settings/plugins/ifcfg-rh/plugin.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/plugin.c b/system-settings/plugins/ifcfg-rh/plugin.c index 37bf97280c..8dce0334a5 100644 --- a/system-settings/plugins/ifcfg-rh/plugin.c +++ b/system-settings/plugins/ifcfg-rh/plugin.c @@ -147,7 +147,6 @@ read_one_connection (SCPluginIfcfg *plugin, const char *filename) if (nm_ifcfg_connection_get_unmanaged_spec (connection)) { PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "Ignoring connection '%s' and its " "device due to NM_CONTROLLED/BRIDGE/VLAN.", cid); - g_signal_emit_by_name (plugin, NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED); } else { /* Wait for the connection to become unmanaged once it knows the * UDI of it's device, if/when the device gets plugged in. @@ -314,7 +313,9 @@ handle_connection_remove_or_new (SCPluginIfcfg *plugin, if (do_new) { connection = read_one_connection (plugin, path); if (connection) { - if (!nm_ifcfg_connection_get_unmanaged_spec (connection)) + if (nm_ifcfg_connection_get_unmanaged_spec (connection)) + g_signal_emit_by_name (plugin, NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED); + else g_signal_emit_by_name (plugin, NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, connection); } } -- cgit v1.2.1 From 740dc88cb3db3f910948e50b9340016ab8c5e84c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Canek=20Pel=C3=A1ez=20Vald=C3=A9s?= Date: Mon, 6 Dec 2010 09:33:29 -0600 Subject: gentoo: handle both systemd and OpenRC loopback init at runtime See Gentoo #318365 --- src/backends/NetworkManagerGentoo.c | 49 ++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/src/backends/NetworkManagerGentoo.c b/src/backends/NetworkManagerGentoo.c index 8d9e68c59c..2854901a56 100644 --- a/src/backends/NetworkManagerGentoo.c +++ b/src/backends/NetworkManagerGentoo.c @@ -30,12 +30,22 @@ #include #include #include +#include #include "NetworkManagerGeneric.h" #include "nm-system.h" #include "NetworkManagerUtils.h" #include "nm-logging.h" +#define BUFFER_SIZE 512 + +static void openrc_start_lo_if_necessary() +{ + /* No need to run net.lo if it is already running */ + if (nm_spawn_process ("/etc/init.d/net.lo status") != 0) + nm_spawn_process ("/etc/init.d/net.lo start"); +} + /* * nm_system_enable_loopback * @@ -44,9 +54,42 @@ */ void nm_system_enable_loopback (void) { - /* No need to run net.lo if it is already running */ - if (nm_spawn_process ("/etc/init.d/net.lo status") != 0) - nm_spawn_process("/etc/init.d/net.lo start"); + GFile *file; + GFileInputStream *in; + gchar buffer[BUFFER_SIZE]; + gchar *comm, *readed, *tmp; + gssize r; + + file = g_file_new_for_path ("/proc/1/comm"); + in = g_file_read (file, NULL, NULL); + + /* If anything goes wrong trying to open /proc/1/comm, + we will assume OpenRC. */ + if (!in) { + openrc_start_lo_if_necessary (); + return; + } + + comm = g_strdup(""); + while ((r = g_input_stream_read (G_INPUT_STREAM(in), buffer, BUFFER_SIZE, NULL, NULL)) > 0) { + readed = g_strndup (buffer, r); + tmp = g_strconcat (comm, readed, NULL); + g_free (comm); + g_free (readed); + comm = tmp; + } + + if (g_strstr_len (comm, -1, "systemd")) { + /* We use the generic loopback enabler if using systemd. */ + nm_log_info (LOGD_CORE, "NetworkManager is running with systemd..."); + nm_generic_enable_loopback (); + } else { + /* OpenRC otherwise. */ + nm_log_info (LOGD_CORE, "NetworkManager is running with OpenRC..."); + openrc_start_lo_if_necessary(); + } + + g_free (comm); } /* -- cgit v1.2.1 From fd3e8e45765c4606402d45d993c102b32dae6d8a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 6 Dec 2010 12:12:52 -0600 Subject: examples: build C examples --- examples/C/Makefile.am | 17 +++++++++++++++++ examples/C/add-connection-glib.c | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/examples/C/Makefile.am b/examples/C/Makefile.am index 68c0697b0b..7313de95dc 100644 --- a/examples/C/Makefile.am +++ b/examples/C/Makefile.am @@ -1,2 +1,19 @@ +INCLUDES = -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/libnm-glib \ + -I${top_srcdir}/include + +AM_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) + +noinst_PROGRAMS = add-connection-glib + +add_connection_glib_SOURCES = add-connection-glib.c +add_connection_glib_LDADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + EXTRA_DIST = \ add-connection-glib.c + diff --git a/examples/C/add-connection-glib.c b/examples/C/add-connection-glib.c index 0e8dc18036..4cdcfa2310 100644 --- a/examples/C/add-connection-glib.c +++ b/examples/C/add-connection-glib.c @@ -38,7 +38,8 @@ #define DBUS_TYPE_G_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE)) #define DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, DBUS_TYPE_G_MAP_OF_VARIANT)) -void add_connection (DBusGProxy *proxy, const char *con_name) +static void +add_connection (DBusGProxy *proxy, const char *con_name) { NMConnection *connection; NMSettingConnection *s_con; -- cgit v1.2.1 From c602487ff3872a5e524b3431339127c9d1eeb495 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 6 Dec 2010 12:14:06 -0600 Subject: test: add C example for printing active connection details --- examples/C/Makefile.am | 11 +- examples/C/get-active-connections.c | 225 ++++++++++++++++++++++++++++++++++++ 2 files changed, 234 insertions(+), 2 deletions(-) create mode 100644 examples/C/get-active-connections.c diff --git a/examples/C/Makefile.am b/examples/C/Makefile.am index 7313de95dc..461d1c3403 100644 --- a/examples/C/Makefile.am +++ b/examples/C/Makefile.am @@ -6,7 +6,7 @@ AM_CPPFLAGS = \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) -noinst_PROGRAMS = add-connection-glib +noinst_PROGRAMS = add-connection-glib get-active-connections add_connection_glib_SOURCES = add-connection-glib.c add_connection_glib_LDADD = \ @@ -14,6 +14,13 @@ add_connection_glib_LDADD = \ $(DBUS_LIBS) \ $(GLIB_LIBS) +get_active_connections_SOURCES = get-active-connections.c +get_active_connections_LDADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + EXTRA_DIST = \ - add-connection-glib.c + add-connection-glib.c \ + get-active-connections.c diff --git a/examples/C/get-active-connections.c b/examples/C/get-active-connections.c new file mode 100644 index 0000000000..3053a82b96 --- /dev/null +++ b/examples/C/get-active-connections.c @@ -0,0 +1,225 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +/* + * The example shows how to call the D-Bus properties interface to get the + * list of currently active connections known to NetworkManager. It uses + * dbus-glib and libnm-util libraries. + * + * Compile with: + * gcc -Wall `pkg-config --libs --cflags glib-2.0 dbus-glib-1 libnm-util` get-active-connections.c -o get-active-connections + */ + +#include +#include + +#include +#include +#include +#include +#include +#include + +#define DBUS_TYPE_G_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE)) +#define DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, DBUS_TYPE_G_MAP_OF_VARIANT)) +#define DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH)) + +static void +print_connection (DBusGConnection *bus, const char *service, const char *path) +{ + DBusGProxy *proxy; + GError *error = NULL; + GHashTable *hash = NULL; + NMConnection *connection = NULL; + + /* Create a D-Bus proxy; NM_DBUS_* defined in NetworkManager.h */ + proxy = dbus_g_proxy_new_for_name (bus, + service, + path, + NM_DBUS_IFACE_SETTINGS_CONNECTION); + g_assert (proxy); + + if (!dbus_g_proxy_call (proxy, "GetSettings", &error, + G_TYPE_INVALID, + DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, &hash, + G_TYPE_INVALID)) { + g_warning ("Failed to get active connection Connection property: %s", + error->message); + g_error_free (error); + goto out; + } + + connection = nm_connection_new_from_hash (hash, &error); + if (!connection) { + g_warning ("Received invalid connection data: %s", error->message); + g_error_free (error); + goto out; + } + + g_message ("%s => %s", service, path); + nm_connection_dump (connection); + +out: + if (connection) + g_object_unref (connection); + if (hash) + g_hash_table_destroy (hash); + g_object_unref (proxy); +} + +static void +get_active_connection_details (DBusGConnection *bus, const char *obj_path) +{ + DBusGProxy *props_proxy; + GValue path_value = { 0 }; + GValue serv_value = { 0 }; + GError *error = NULL; + const char *path = NULL, *service = NULL; + + /* Create a D-Bus proxy; NM_DBUS_* defined in NetworkManager.h */ + props_proxy = dbus_g_proxy_new_for_name (bus, + NM_DBUS_SERVICE, + obj_path, + DBUS_INTERFACE_PROPERTIES); + g_assert (props_proxy); + + /* Get the object path of the Connection details */ + if (!dbus_g_proxy_call (props_proxy, "Get", &error, + G_TYPE_STRING, NM_DBUS_INTERFACE_ACTIVE_CONNECTION, + G_TYPE_STRING, "Connection", + G_TYPE_INVALID, + G_TYPE_VALUE, &path_value, + G_TYPE_INVALID)) { + g_warning ("Failed to get active connection Connection property: %s", + error->message); + g_error_free (error); + goto out; + } + + if (!G_VALUE_HOLDS (&path_value, DBUS_TYPE_G_OBJECT_PATH)) { + g_warning ("Unexpected type returned getting Connection property: %s", + G_VALUE_TYPE_NAME (&path_value)); + goto out; + } + + path = g_value_get_boxed (&path_value); + if (!path) { + g_warning ("Missing connection path!"); + goto out; + } + + /* Get the service name of the D-Bus service that provides the Connection */ + if (!dbus_g_proxy_call (props_proxy, "Get", &error, + G_TYPE_STRING, NM_DBUS_INTERFACE_ACTIVE_CONNECTION, + G_TYPE_STRING, "ServiceName", + G_TYPE_INVALID, + G_TYPE_VALUE, &serv_value, + G_TYPE_INVALID)) { + g_warning ("Failed to get active connection ServiceName property: %s", + error->message); + g_error_free (error); + goto out; + } + + if (!G_VALUE_HOLDS (&serv_value, G_TYPE_STRING)) { + g_warning ("Unexpected type returned getting Connection property: %s", + G_VALUE_TYPE_NAME (&serv_value)); + goto out; + } + + service = g_value_get_string (&serv_value); + if (!service) { + g_warning ("Missing connection service name!"); + goto out; + } + + print_connection (bus, service, path); + +out: + g_value_unset (&path_value); + g_value_unset (&serv_value); + g_object_unref (props_proxy); +} + +static void +get_active_connections (DBusGConnection *bus, DBusGProxy *proxy) +{ + GError *error = NULL; + GValue value = { 0 }; + GPtrArray *paths = NULL; + int i; + + /* Call AddConnection with the hash as argument */ + if (!dbus_g_proxy_call (proxy, "Get", &error, + G_TYPE_STRING, NM_DBUS_INTERFACE, + G_TYPE_STRING, "ActiveConnections", + G_TYPE_INVALID, + G_TYPE_VALUE, &value, + G_TYPE_INVALID)) { + g_warning ("Failed to get ActiveConnections property: %s", error->message); + g_error_free (error); + return; + } + + if (!G_VALUE_HOLDS (&value, DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH)) { + g_warning ("Unexpected type returned getting ActiveConnections: %s", + G_VALUE_TYPE_NAME (&value)); + goto out; + } + + paths = g_value_get_boxed (&value); + if (!paths) { + g_warning ("Could not retrieve active connections property"); + goto out; + } + + for (i = 0; i < paths->len; i++) + get_active_connection_details (bus, g_ptr_array_index (paths, i)); + +out: + g_value_unset (&value); +} + + +int main (int argc, char *argv[]) +{ + DBusGConnection *bus; + DBusGProxy *props_proxy; + + /* Initialize GType system */ + g_type_init (); + + /* Get system bus */ + bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL); + + /* Create a D-Bus proxy; NM_DBUS_* defined in NetworkManager.h */ + props_proxy = dbus_g_proxy_new_for_name (bus, + NM_DBUS_SERVICE, + NM_DBUS_PATH, + DBUS_INTERFACE_PROPERTIES); + g_assert (props_proxy); + + /* Add a connection */ + get_active_connections (bus, props_proxy); + + g_object_unref (props_proxy); + dbus_g_connection_unref (bus); + + return 0; +} -- cgit v1.2.1 From e821e619924eaf06ddfa40f78a56e72fb8a82299 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 6 Dec 2010 12:27:50 -0600 Subject: examples: update comments --- examples/C/get-active-connections.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/examples/C/get-active-connections.c b/examples/C/get-active-connections.c index 3053a82b96..689b7ff6e2 100644 --- a/examples/C/get-active-connections.c +++ b/examples/C/get-active-connections.c @@ -48,13 +48,20 @@ print_connection (DBusGConnection *bus, const char *service, const char *path) GHashTable *hash = NULL; NMConnection *connection = NULL; - /* Create a D-Bus proxy; NM_DBUS_* defined in NetworkManager.h */ + /* This function asks the Settings Service that provides this network + * configuration for the details of that configuration. + */ + + /* Create the D-Bus proxy for the Settings Service so we can ask it for the + * connection configuration details. + */ proxy = dbus_g_proxy_new_for_name (bus, service, path, NM_DBUS_IFACE_SETTINGS_CONNECTION); g_assert (proxy); + /* Request the all the configuration of the Connection */ if (!dbus_g_proxy_call (proxy, "GetSettings", &error, G_TYPE_INVALID, DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, &hash, @@ -65,6 +72,9 @@ print_connection (DBusGConnection *bus, const char *service, const char *path) goto out; } + /* Using the raw configuration, create an NMConnection object for it. This + * step also verifies that the data we got from the settings service is + * valid. */ connection = nm_connection_new_from_hash (hash, &error); if (!connection) { g_warning ("Received invalid connection data: %s", error->message); @@ -72,6 +82,7 @@ print_connection (DBusGConnection *bus, const char *service, const char *path) goto out; } + /* And finally dump all the configuration to stdout */ g_message ("%s => %s", service, path); nm_connection_dump (connection); @@ -92,7 +103,13 @@ get_active_connection_details (DBusGConnection *bus, const char *obj_path) GError *error = NULL; const char *path = NULL, *service = NULL; - /* Create a D-Bus proxy; NM_DBUS_* defined in NetworkManager.h */ + /* This function gets the backing Connection object that describes the + * network configuration that the ActiveConnection object is actually using. + * The ActiveConnection object contains the mapping between the configuration + * and the actual network interfaces that are using that configuration. + */ + + /* Create a D-Bus object proxy for the active connection object's properties */ props_proxy = dbus_g_proxy_new_for_name (bus, NM_DBUS_SERVICE, obj_path, @@ -149,6 +166,7 @@ get_active_connection_details (DBusGConnection *bus, const char *obj_path) goto out; } + /* Print out the actual connection details */ print_connection (bus, service, path); out: @@ -165,7 +183,7 @@ get_active_connections (DBusGConnection *bus, DBusGProxy *proxy) GPtrArray *paths = NULL; int i; - /* Call AddConnection with the hash as argument */ + /* Get the ActiveConnections property from the NM Manager object */ if (!dbus_g_proxy_call (proxy, "Get", &error, G_TYPE_STRING, NM_DBUS_INTERFACE, G_TYPE_STRING, "ActiveConnections", @@ -177,20 +195,24 @@ get_active_connections (DBusGConnection *bus, DBusGProxy *proxy) return; } + /* Make sure the ActiveConnections property is the type we expect it to be */ if (!G_VALUE_HOLDS (&value, DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH)) { g_warning ("Unexpected type returned getting ActiveConnections: %s", G_VALUE_TYPE_NAME (&value)); goto out; } + /* Extract the active connections array from the GValue */ paths = g_value_get_boxed (&value); if (!paths) { g_warning ("Could not retrieve active connections property"); goto out; } + /* And print out the details of each active connection */ for (i = 0; i < paths->len; i++) get_active_connection_details (bus, g_ptr_array_index (paths, i)); + g_ptr_array_free (paths, TRUE); out: g_value_unset (&value); @@ -208,7 +230,9 @@ int main (int argc, char *argv[]) /* Get system bus */ bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL); - /* Create a D-Bus proxy; NM_DBUS_* defined in NetworkManager.h */ + /* Create a D-Bus proxy to get the object properties from the NM Manager + * object. NM_DBUS_* defines are from NetworkManager.h. + */ props_proxy = dbus_g_proxy_new_for_name (bus, NM_DBUS_SERVICE, NM_DBUS_PATH, -- cgit v1.2.1 From 9e9a46b405baefe7a7b011862e57eeb472d9e3a7 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 6 Dec 2010 15:55:30 -0600 Subject: wifi: remove useless warning --- src/nm-device-wifi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index a2b3b4c1e2..5141a8f7d6 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -3477,12 +3477,11 @@ real_set_enabled (NMDeviceInterface *device, gboolean enabled) /* Wait for some drivers like ipw3945 to come back to life */ success = wireless_get_range (self, &range, NULL); - /* iface should be NULL here, but handle it anyway if it's not */ - g_warn_if_fail (priv->supplicant.iface == NULL); + /* Re-initialize the supplicant interface and wait for it to be ready */ if (priv->supplicant.iface) supplicant_interface_release (self); - supplicant_interface_acquire (self); + nm_log_dbg (LOGD_WIFI, "(%s): enable waiting on supplicant state", nm_device_get_iface (NM_DEVICE (device))); } else { -- cgit v1.2.1 From a08dd2c39d14ce933e1adb3cf0377e84ca84925e Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 7 Dec 2010 13:58:49 -0600 Subject: supplicant: fix handling when supplicant cannot be service activated If the supplicant cannot be service activated, wait until it shows up on the bus instead of sitting around doing nothing. This fixes a small regression introduced when the _READY state was added to the supplicant interface object. --- src/supplicant-manager/nm-supplicant-interface.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index a92268c3d4..777d46abe9 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -287,8 +287,8 @@ set_state (NMSupplicantInterface *self, guint32 new_state) /* DOWN is a terminal state */ g_return_if_fail (priv->state != NM_SUPPLICANT_INTERFACE_STATE_DOWN); - /* Cannot regress to READY or INIT from higher states */ - if (priv->state <= NM_SUPPLICANT_INTERFACE_STATE_READY) + /* Cannot regress to READY, STARTING, or INIT from higher states */ + if (priv->state >= NM_SUPPLICANT_INTERFACE_STATE_READY) g_return_if_fail (new_state > priv->state); if (new_state == NM_SUPPLICANT_INTERFACE_STATE_DOWN) { @@ -504,9 +504,10 @@ interface_get_cb (DBusGProxy *proxy, G_TYPE_INVALID)) { interface_add_done (info->interface, path); } else { - nm_log_err (LOGD_SUPPLICANT, "(%s): error adding interface: %s", + nm_log_err (LOGD_SUPPLICANT, "(%s): error getting interface: %s", priv->dev, error->message); g_clear_error (&error); + set_state (info->interface, NM_SUPPLICANT_INTERFACE_STATE_DOWN); } } @@ -545,9 +546,19 @@ interface_add_cb (DBusGProxy *proxy, if (dbus_g_error_has_name (error, WPAS_ERROR_EXISTS_ERROR)) { /* Interface already added, just get its object path */ interface_get (info->interface); + } else if ( g_error_matches (error, DBUS_GERROR, DBUS_GERROR_SERVICE_UNKNOWN) + || dbus_g_error_has_name (error, DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND)) { + /* Supplicant wasn't running and could be launched via service + * activation. Wait for it to start by moving back to the INIT + * state. + */ + nm_log_dbg (LOGD_SUPPLICANT, "(%s): failed to activate supplicant: %s", + priv->dev, error->message); + set_state (info->interface, NM_SUPPLICANT_INTERFACE_STATE_INIT); } else { nm_log_err (LOGD_SUPPLICANT, "(%s): error adding interface: %s", priv->dev, error->message); + set_state (info->interface, NM_SUPPLICANT_INTERFACE_STATE_DOWN); } g_clear_error (&error); } -- cgit v1.2.1 From af406bdc9657c1fa53556c892b7edb0b4b256b1c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 7 Dec 2010 14:12:55 -0600 Subject: libnm-glib: actually define the "ip-interface" property Looks like it got left out of 6ab5a9597a26235c9839df346fc3ce95f35a240f --- libnm-glib/nm-device.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c index ea2a91d1ce..b8998f70b8 100644 --- a/libnm-glib/nm-device.c +++ b/libnm-glib/nm-device.c @@ -476,6 +476,20 @@ nm_device_class_init (NMDeviceClass *device_class) NULL, G_PARAM_READABLE)); + /** + * NMDevice:ip-interface: + * + * The IP interface of the device which should be used for all IP-related + * operations like addressing and routing. + **/ + g_object_class_install_property + (object_class, PROP_IP_INTERFACE, + g_param_spec_string (NM_DEVICE_IP_INTERFACE, + "IP Interface", + "IP Interface name", + NULL, + G_PARAM_READABLE)); + /** * NMDevice:udi: * -- cgit v1.2.1 From 12345affa58604994123ea92f77059d8e6cdda75 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 7 Dec 2010 14:18:44 -0600 Subject: wifi: move wireless_qual_to_percent() to get rid of prototype Now that it's only used in one place we can get rid of the prototype. --- src/nm-device-wifi.c | 205 +++++++++++++++++++++++++-------------------------- 1 file changed, 101 insertions(+), 104 deletions(-) diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 5141a8f7d6..38631d7552 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -175,9 +175,6 @@ static void schedule_scan (NMDeviceWifi *self, gboolean backoff); static void cancel_pending_scan (NMDeviceWifi *self); -static int wireless_qual_to_percent (const struct iw_quality *qual, - const struct iw_quality *max_qual); - static void cleanup_association_attempt (NMDeviceWifi * self, gboolean disconnect); @@ -294,6 +291,107 @@ ipw_rfkill_state_work (gpointer user_data) return TRUE; } +/* + * wireless_qual_to_percent + * + * Convert an iw_quality structure from SIOCGIWSTATS into a magical signal + * strength percentage. + * + */ +static int +wireless_qual_to_percent (const struct iw_quality *qual, + const struct iw_quality *max_qual) +{ + int percent = -1; + int level_percent = -1; + + g_return_val_if_fail (qual != NULL, -1); + g_return_val_if_fail (max_qual != NULL, -1); + + nm_log_dbg (LOGD_WIFI, + "QL: qual %d/%u/0x%X, level %d/%u/0x%X, noise %d/%u/0x%X, updated: 0x%X ** MAX: qual %d/%u/0x%X, level %d/%u/0x%X, noise %d/%u/0x%X, updated: 0x%X", + (__s8) qual->qual, qual->qual, qual->qual, + (__s8) qual->level, qual->level, qual->level, + (__s8) qual->noise, qual->noise, qual->noise, + qual->updated, + (__s8) max_qual->qual, max_qual->qual, max_qual->qual, + (__s8) max_qual->level, max_qual->level, max_qual->level, + (__s8) max_qual->noise, max_qual->noise, max_qual->noise, + max_qual->updated); + + /* Try using the card's idea of the signal quality first as long as it tells us what the max quality is. + * Drivers that fill in quality values MUST treat them as percentages, ie the "Link Quality" MUST be + * bounded by 0 and max_qual->qual, and MUST change in a linear fashion. Within those bounds, drivers + * are free to use whatever they want to calculate "Link Quality". + */ + if ((max_qual->qual != 0) && !(max_qual->updated & IW_QUAL_QUAL_INVALID) && !(qual->updated & IW_QUAL_QUAL_INVALID)) + percent = (int)(100 * ((double)qual->qual / (double)max_qual->qual)); + + /* If the driver doesn't specify a complete and valid quality, we have two options: + * + * 1) dBm: driver must specify max_qual->level = 0, and have valid values for + * qual->level and (qual->noise OR max_qual->noise) + * 2) raw RSSI: driver must specify max_qual->level > 0, and have valid values for + * qual->level and max_qual->level + * + * This is the WEXT spec. If this interpretation is wrong, I'll fix it. Otherwise, + * If drivers don't conform to it, they are wrong and need to be fixed. + */ + + if ( (max_qual->level == 0) && !(max_qual->updated & IW_QUAL_LEVEL_INVALID) /* Valid max_qual->level == 0 */ + && !(qual->updated & IW_QUAL_LEVEL_INVALID) /* Must have valid qual->level */ + && ( ((max_qual->noise > 0) && !(max_qual->updated & IW_QUAL_NOISE_INVALID)) /* Must have valid max_qual->noise */ + || ((qual->noise > 0) && !(qual->updated & IW_QUAL_NOISE_INVALID))) /* OR valid qual->noise */ + ) { + /* Absolute power values (dBm) */ + + /* Reasonable fallbacks for dumb drivers that don't specify either level. */ + #define FALLBACK_NOISE_FLOOR_DBM -90 + #define FALLBACK_SIGNAL_MAX_DBM -20 + int max_level = FALLBACK_SIGNAL_MAX_DBM; + int noise = FALLBACK_NOISE_FLOOR_DBM; + int level = qual->level - 0x100; + + level = CLAMP (level, FALLBACK_NOISE_FLOOR_DBM, FALLBACK_SIGNAL_MAX_DBM); + + if ((qual->noise > 0) && !(qual->updated & IW_QUAL_NOISE_INVALID)) + noise = qual->noise - 0x100; + else if ((max_qual->noise > 0) && !(max_qual->updated & IW_QUAL_NOISE_INVALID)) + noise = max_qual->noise - 0x100; + noise = CLAMP (noise, FALLBACK_NOISE_FLOOR_DBM, FALLBACK_SIGNAL_MAX_DBM); + + /* A sort of signal-to-noise ratio calculation */ + level_percent = (int)(100 - 70 *( + ((double)max_level - (double)level) / + ((double)max_level - (double)noise))); + nm_log_dbg (LOGD_WIFI, "QL1: level_percent is %d. max_level %d, level %d, noise_floor %d.", + level_percent, max_level, level, noise); + } else if ( (max_qual->level != 0) + && !(max_qual->updated & IW_QUAL_LEVEL_INVALID) /* Valid max_qual->level as upper bound */ + && !(qual->updated & IW_QUAL_LEVEL_INVALID)) { + /* Relative power values (RSSI) */ + + int level = qual->level; + + /* Signal level is relavtive (0 -> max_qual->level) */ + level = CLAMP (level, 0, max_qual->level); + level_percent = (int)(100 * ((double)level / (double)max_qual->level)); + nm_log_dbg (LOGD_WIFI, "QL2: level_percent is %d. max_level %d, level %d.", + level_percent, max_qual->level, level); + } else if (percent == -1) { + nm_log_dbg (LOGD_WIFI, "QL: Could not get quality %% value from driver. Driver is probably buggy."); + } + + /* If the quality percent was 0 or doesn't exist, then try to use signal levels instead */ + if ((percent < 1) && (level_percent >= 0)) + percent = level_percent; + + nm_log_dbg (LOGD_WIFI, "QL: Final quality percent is %d (%d).", + percent, CLAMP (percent, 0, 100)); + return (CLAMP (percent, 0, 100)); +} + + /* * nm_device_wifi_update_signal_strength * @@ -1490,107 +1588,6 @@ nm_device_wifi_get_frequency (NMDeviceWifi *self) return freq; } -/* - * wireless_stats_to_percent - * - * Convert an iw_stats structure from a scan or the card into - * a magical signal strength percentage. - * - */ -static int -wireless_qual_to_percent (const struct iw_quality *qual, - const struct iw_quality *max_qual) -{ - int percent = -1; - int level_percent = -1; - - g_return_val_if_fail (qual != NULL, -1); - g_return_val_if_fail (max_qual != NULL, -1); - - nm_log_dbg (LOGD_WIFI, - "QL: qual %d/%u/0x%X, level %d/%u/0x%X, noise %d/%u/0x%X, updated: 0x%X ** MAX: qual %d/%u/0x%X, level %d/%u/0x%X, noise %d/%u/0x%X, updated: 0x%X", - (__s8) qual->qual, qual->qual, qual->qual, - (__s8) qual->level, qual->level, qual->level, - (__s8) qual->noise, qual->noise, qual->noise, - qual->updated, - (__s8) max_qual->qual, max_qual->qual, max_qual->qual, - (__s8) max_qual->level, max_qual->level, max_qual->level, - (__s8) max_qual->noise, max_qual->noise, max_qual->noise, - max_qual->updated); - - /* Try using the card's idea of the signal quality first as long as it tells us what the max quality is. - * Drivers that fill in quality values MUST treat them as percentages, ie the "Link Quality" MUST be - * bounded by 0 and max_qual->qual, and MUST change in a linear fashion. Within those bounds, drivers - * are free to use whatever they want to calculate "Link Quality". - */ - if ((max_qual->qual != 0) && !(max_qual->updated & IW_QUAL_QUAL_INVALID) && !(qual->updated & IW_QUAL_QUAL_INVALID)) - percent = (int)(100 * ((double)qual->qual / (double)max_qual->qual)); - - /* If the driver doesn't specify a complete and valid quality, we have two options: - * - * 1) dBm: driver must specify max_qual->level = 0, and have valid values for - * qual->level and (qual->noise OR max_qual->noise) - * 2) raw RSSI: driver must specify max_qual->level > 0, and have valid values for - * qual->level and max_qual->level - * - * This is the WEXT spec. If this interpretation is wrong, I'll fix it. Otherwise, - * If drivers don't conform to it, they are wrong and need to be fixed. - */ - - if ( (max_qual->level == 0) && !(max_qual->updated & IW_QUAL_LEVEL_INVALID) /* Valid max_qual->level == 0 */ - && !(qual->updated & IW_QUAL_LEVEL_INVALID) /* Must have valid qual->level */ - && ( ((max_qual->noise > 0) && !(max_qual->updated & IW_QUAL_NOISE_INVALID)) /* Must have valid max_qual->noise */ - || ((qual->noise > 0) && !(qual->updated & IW_QUAL_NOISE_INVALID))) /* OR valid qual->noise */ - ) { - /* Absolute power values (dBm) */ - - /* Reasonable fallbacks for dumb drivers that don't specify either level. */ - #define FALLBACK_NOISE_FLOOR_DBM -90 - #define FALLBACK_SIGNAL_MAX_DBM -20 - int max_level = FALLBACK_SIGNAL_MAX_DBM; - int noise = FALLBACK_NOISE_FLOOR_DBM; - int level = qual->level - 0x100; - - level = CLAMP (level, FALLBACK_NOISE_FLOOR_DBM, FALLBACK_SIGNAL_MAX_DBM); - - if ((qual->noise > 0) && !(qual->updated & IW_QUAL_NOISE_INVALID)) - noise = qual->noise - 0x100; - else if ((max_qual->noise > 0) && !(max_qual->updated & IW_QUAL_NOISE_INVALID)) - noise = max_qual->noise - 0x100; - noise = CLAMP (noise, FALLBACK_NOISE_FLOOR_DBM, FALLBACK_SIGNAL_MAX_DBM); - - /* A sort of signal-to-noise ratio calculation */ - level_percent = (int)(100 - 70 *( - ((double)max_level - (double)level) / - ((double)max_level - (double)noise))); - nm_log_dbg (LOGD_WIFI, "QL1: level_percent is %d. max_level %d, level %d, noise_floor %d.", - level_percent, max_level, level, noise); - } else if ( (max_qual->level != 0) - && !(max_qual->updated & IW_QUAL_LEVEL_INVALID) /* Valid max_qual->level as upper bound */ - && !(qual->updated & IW_QUAL_LEVEL_INVALID)) { - /* Relative power values (RSSI) */ - - int level = qual->level; - - /* Signal level is relavtive (0 -> max_qual->level) */ - level = CLAMP (level, 0, max_qual->level); - level_percent = (int)(100 * ((double)level / (double)max_qual->level)); - nm_log_dbg (LOGD_WIFI, "QL2: level_percent is %d. max_level %d, level %d.", - level_percent, max_qual->level, level); - } else if (percent == -1) { - nm_log_dbg (LOGD_WIFI, "QL: Could not get quality %% value from driver. Driver is probably buggy."); - } - - /* If the quality percent was 0 or doesn't exist, then try to use signal levels instead */ - if ((percent < 1) && (level_percent >= 0)) - percent = level_percent; - - nm_log_dbg (LOGD_WIFI, "QL: Final quality percent is %d (%d).", - percent, CLAMP (percent, 0, 100)); - return (CLAMP (percent, 0, 100)); -} - - /* * nm_device_wifi_get_ssid * -- cgit v1.2.1 From 19392097593e49ac6de1e2e5dc9557256175bc1b Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Thu, 9 Dec 2010 00:13:37 -0600 Subject: ifupdown: Correctly mark unmanaged devices (debian #569215) If we find a "iface ..." line, add the interface to well_known_interfaces no matter if there is a connection for it or not. Otherwise we fail to mark devices as unmageded in cases like iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf as NM does not know how to parse such a interface configuration. Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=569215 --- system-settings/plugins/ifupdown/plugin.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/system-settings/plugins/ifupdown/plugin.c b/system-settings/plugins/ifupdown/plugin.c index 33c058e5b4..7daa06a000 100644 --- a/system-settings/plugins/ifupdown/plugin.c +++ b/system-settings/plugins/ifupdown/plugin.c @@ -368,6 +368,7 @@ SCPluginIfupdown_init (NMSystemConfigInterface *config) /* Remove any connection for this block that was previously found */ exported = g_hash_table_lookup (priv->iface_connections, block->name); if (exported) { + PLUGIN_PRINT("SCPlugin-Ifupdown", "deleting %s from iface_connections", block->name); nm_settings_connection_interface_delete (NM_SETTINGS_CONNECTION_INTERFACE (exported), ignore_cb, NULL); @@ -377,11 +378,14 @@ SCPluginIfupdown_init (NMSystemConfigInterface *config) /* add the new connection */ exported = nm_ifupdown_connection_new (block); if (exported) { + PLUGIN_PRINT("SCPlugin-Ifupdown", "adding %s to iface_connections", block->name); g_hash_table_insert (priv->iface_connections, block->name, exported); - g_hash_table_insert (priv->well_known_interfaces, block->name, "known"); } + PLUGIN_PRINT("SCPlugin-Ifupdown", "adding iface %s to well_known_interfaces", block->name); + g_hash_table_insert (priv->well_known_interfaces, block->name, "known"); } else if (!strcmp ("mapping", block->type)) { g_hash_table_insert (priv->well_known_interfaces, block->name, "known"); + PLUGIN_PRINT("SCPlugin-Ifupdown", "adding mapping %s to well_known_interfaces", block->name); } block = block->next; } -- cgit v1.2.1 From 898e08eef1ae4e255d5808bb17443874073f3641 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Thu, 9 Dec 2010 00:15:17 -0600 Subject: ifupdown: Allow to mark bridge ports as unmanaged (debian #530335) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Parse bridge configurations in /etc/network/interfaces and add interfaces defined via bridge_ports to well_known_interfaces. This allows to mark those interfaces as unmanaged if managed=false. The "all" keyword and regexes are not supported and simply skipped. Example: iface br0 inet manual bridge_ports eth0 eth1 (→ eth0/1 will be marked as unmanaged) See also: http://manpages.ubuntu.com/manpages/maverick/man5/bridge-utils-interfaces.5.html Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=530335 --- system-settings/plugins/ifupdown/plugin.c | 45 ++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/system-settings/plugins/ifupdown/plugin.c b/system-settings/plugins/ifupdown/plugin.c index 7daa06a000..8cfbedcd64 100644 --- a/system-settings/plugins/ifupdown/plugin.c +++ b/system-settings/plugins/ifupdown/plugin.c @@ -362,9 +362,51 @@ SCPluginIfupdown_init (NMSystemConfigInterface *config) while (block) { if(!strcmp ("auto", block->type) || !strcmp ("allow-hotplug", block->type)) g_hash_table_insert (auto_ifaces, block->name, GUINT_TO_POINTER (1)); - else if (!strcmp ("iface", block->type) && strcmp ("lo", block->name)) { + else if (!strcmp ("iface", block->type)) { NMIfupdownConnection *exported; + /* Bridge configuration */ + if(!strncmp ("br", block->name, 2)) { + /* Try to find bridge ports */ + const char *ports = ifparser_getkey (block, "bridge_ports"); + if (ports) { + int i; + int state = 0; + char **port_ifaces; + + PLUGIN_PRINT("SCPlugin-Ifupdown", "found bridge ports %s for %s", ports, block->name); + + port_ifaces = g_strsplit_set (ports, " \t", -1); + for (i = 0; i < g_strv_length (port_ifaces); i++) { + char *token = port_ifaces[i]; + /* Skip crazy stuff like regex or all */ + if (!strcmp ("all", token)) { + continue; + } + /* Small SM to skip everything inside regex */ + if (!strcmp ("regex", token)) { + state++; + continue; + } + if (!strcmp ("noregex", token)) { + state--; + continue; + } + if (state == 0 && strlen (token) > 0) { + PLUGIN_PRINT("SCPlugin-Ifupdown", "adding bridge port %s to well_known_interfaces", token); + g_hash_table_insert (priv->well_known_interfaces, g_strdup (token), "known"); + } + } + g_strfreev (port_ifaces); + } + goto next; + } + + /* Skip loopback configuration */ + if(!strcmp ("lo", block->name)) { + goto next; + } + /* Remove any connection for this block that was previously found */ exported = g_hash_table_lookup (priv->iface_connections, block->name); if (exported) { @@ -387,6 +429,7 @@ SCPluginIfupdown_init (NMSystemConfigInterface *config) g_hash_table_insert (priv->well_known_interfaces, block->name, "known"); PLUGIN_PRINT("SCPlugin-Ifupdown", "adding mapping %s to well_known_interfaces", block->name); } + next: block = block->next; } -- cgit v1.2.1 From fd5e8c2f05144d05f4dbafd0efc17253288927c8 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 10 Dec 2010 18:50:49 -0600 Subject: core: fix leak parsing config file --- src/main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 7e75f05efb..7a8e7e88ee 100644 --- a/src/main.c +++ b/src/main.c @@ -306,6 +306,7 @@ parse_config_file (const char *filename, GError **error) { GKeyFile *config; + gboolean success = FALSE; config = g_key_file_new (); if (!config) { @@ -316,11 +317,11 @@ parse_config_file (const char *filename, g_key_file_set_list_separator (config, ','); if (!g_key_file_load_from_file (config, filename, G_KEY_FILE_NONE, error)) - return FALSE; + goto out; *plugins = g_key_file_get_value (config, "main", "plugins", error); if (*error) - return FALSE; + goto out; *dhcp_client = g_key_file_get_value (config, "main", "dhcp", NULL); *dns_plugins = g_key_file_get_string_list (config, "main", "dns", NULL, NULL); @@ -328,8 +329,11 @@ parse_config_file (const char *filename, *log_level = g_key_file_get_value (config, "logging", "level", NULL); *log_domains = g_key_file_get_value (config, "logging", "domains", NULL); + success = TRUE; + +out: g_key_file_free (config); - return TRUE; + return success; } static gboolean -- cgit v1.2.1 From 1cd17ac8969ae200b4d30aa5afeb9e5823ab18c6 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 11 Dec 2010 11:59:40 -0600 Subject: supplicant: fix leak updating BSS properties --- src/supplicant-manager/nm-supplicant-interface.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index 777d46abe9..24c3b85a12 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -415,6 +415,7 @@ iface_get_props_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_da DBUS_TYPE_G_MAP_OF_VARIANT, &props, G_TYPE_INVALID)) { wpas_iface_properties_changed (NULL, props, info->interface); + g_hash_table_destroy (props); } else { nm_log_warn (LOGD_SUPPLICANT, "could not get interface properties: %s.", error && error->message ? error->message : "(unknown)"); -- cgit v1.2.1 From ea16af7c18ca18101a1be937f951ffe8c9e18165 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 11 Dec 2010 12:31:10 -0600 Subject: supplicant: fix up return arguments for Disconnect and RemoveNetwork --- src/supplicant-manager/nm-supplicant-interface.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index 24c3b85a12..11064a1904 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -640,26 +640,24 @@ smgr_avail_cb (NMSupplicantManager *smgr, static void remove_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { - GError *err = NULL; - guint tmp; + GError *error = NULL; - if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_UINT, &tmp, G_TYPE_INVALID)) { + if (!dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID)) { nm_log_dbg (LOGD_SUPPLICANT, "Couldn't remove network from supplicant interface: %s.", - err->message); - g_error_free (err); + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); } } static void disconnect_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { - GError *err = NULL; - guint tmp; + GError *error = NULL; - if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_UINT, &tmp, G_TYPE_INVALID)) { + if (!dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID)) { nm_log_warn (LOGD_SUPPLICANT, "Couldn't disconnect supplicant interface: %s.", - err->message); - g_error_free (err); + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); } } -- cgit v1.2.1 From e3ba9162c2ede4ab2cc6eb42021909bc11722562 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 11 Dec 2010 12:33:15 -0600 Subject: supplicant: fix state handling after READY has been reached We only want to prevent regression to > READY after READY has been reached, since the interface state will track the supplicant connection state which legitimately jumps around. --- src/supplicant-manager/nm-supplicant-interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index 11064a1904..93807b9360 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -289,7 +289,7 @@ set_state (NMSupplicantInterface *self, guint32 new_state) /* Cannot regress to READY, STARTING, or INIT from higher states */ if (priv->state >= NM_SUPPLICANT_INTERFACE_STATE_READY) - g_return_if_fail (new_state > priv->state); + g_return_if_fail (new_state > NM_SUPPLICANT_INTERFACE_STATE_READY); if (new_state == NM_SUPPLICANT_INTERFACE_STATE_DOWN) { /* Cancel all pending calls when going down */ -- cgit v1.2.1 From ca6e6b620df910b0c1da5aecb17419e18b53f0eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 13 Dec 2010 16:18:35 +0100 Subject: examples: add C examples for listing connections from system settings service --- examples/C/Makefile.am | 23 +++- examples/C/list-connections-dbus.c | 83 ++++++++++++++ examples/C/list-connections-libnm-glib.c | 178 +++++++++++++++++++++++++++++++ 3 files changed, 282 insertions(+), 2 deletions(-) create mode 100644 examples/C/list-connections-dbus.c create mode 100644 examples/C/list-connections-libnm-glib.c diff --git a/examples/C/Makefile.am b/examples/C/Makefile.am index 461d1c3403..88f1e48421 100644 --- a/examples/C/Makefile.am +++ b/examples/C/Makefile.am @@ -6,7 +6,11 @@ AM_CPPFLAGS = \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) -noinst_PROGRAMS = add-connection-glib get-active-connections +noinst_PROGRAMS = \ + add-connection-glib \ + get-active-connections \ + list-connections-dbus \ + list-connections-libnm-glib add_connection_glib_SOURCES = add-connection-glib.c add_connection_glib_LDADD = \ @@ -20,7 +24,22 @@ get_active_connections_LDADD = \ $(DBUS_LIBS) \ $(GLIB_LIBS) +list_connections_dbus_SOURCES = list-connections-dbus.c +list_connections_dbus_LDADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +list_connections_libnm_glib_SOURCES = list-connections-libnm-glib.c +list_connections_libnm_glib_LDADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + EXTRA_DIST = \ add-connection-glib.c \ - get-active-connections.c + get-active-connections.c \ + list-connections-dbus.c \ + list-connections-libnm-glib.c diff --git a/examples/C/list-connections-dbus.c b/examples/C/list-connections-dbus.c new file mode 100644 index 0000000000..957723c4e9 --- /dev/null +++ b/examples/C/list-connections-dbus.c @@ -0,0 +1,83 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +/* + * The example shows how to list connections from System Settings service using direct + * D-Bus call of ListConnections method. + * The example uses dbus-glib, libnm-util libraries. + * + * Compile with: + * gcc -Wall `pkg-config --libs --cflags glib-2.0 dbus-glib-1 libnm-util` list-connections-dbus.c -o list-connections-dbus + */ + +#include +#include +#include + +#include +#include + +#define DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH)) + +static void +list_connections (DBusGProxy *proxy) +{ + int i; + GError *error = NULL; + GPtrArray *con_array; + + /* Call ListConnections D-Bus method */ + dbus_g_proxy_call (proxy, "ListConnections", &error, + /* No input arguments */ + G_TYPE_INVALID, + DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH, &con_array, /* Return values */ + G_TYPE_INVALID); + + for (i = 0; con_array && i < con_array->len; i++) { + char *connection_path = g_ptr_array_index (con_array, i); + printf ("%s\n", connection_path); + g_free (connection_path); + } + g_ptr_array_free (con_array, TRUE); +} + +int main (int argc, char *argv[]) +{ + DBusGConnection *bus; + DBusGProxy *proxy; + + /* Initialize GType system */ + g_type_init (); + + /* Get system bus */ + bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL); + + /* Create a D-Bus proxy; NM_DBUS_* defined in NetworkManager.h */ + proxy = dbus_g_proxy_new_for_name (bus, + NM_DBUS_SERVICE_SYSTEM_SETTINGS, + NM_DBUS_PATH_SETTINGS, + NM_DBUS_IFACE_SETTINGS); + + /* List connections of system settings service */ + list_connections (proxy); + + g_object_unref (proxy); + dbus_g_connection_unref (bus); + + return 0; +} diff --git a/examples/C/list-connections-libnm-glib.c b/examples/C/list-connections-libnm-glib.c new file mode 100644 index 0000000000..4fc2556a4c --- /dev/null +++ b/examples/C/list-connections-libnm-glib.c @@ -0,0 +1,178 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +/* + * The example shows how to list connections from System Settings service using libnm-glib + * (that wraps direct D-Bus calls). + * The example uses dbus-glib, libnm-util and libnm-glib libraries. + * + * Compile with: + * gcc -Wall `pkg-config --libs --cflags glib-2.0 dbus-glib-1 libnm-util libnm-glib` list-connections-libnm-glib.c -o list-connections-libnm-glib + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + + +/* Global variables */ +GMainLoop *loop = NULL; /* Main loop variable - needed for waiting for signal */ +int result = EXIT_SUCCESS; + +static void +signal_handler (int signo) +{ + if (signo == SIGINT || signo == SIGTERM) { + g_message ("Caught signal %d, shutting down...", signo); + g_main_loop_quit (loop); + } +} + +static void +setup_signals (void) +{ + struct sigaction action; + sigset_t mask; + + sigemptyset (&mask); + action.sa_handler = signal_handler; + action.sa_mask = mask; + action.sa_flags = 0; + sigaction (SIGTERM, &action, NULL); + sigaction (SIGINT, &action, NULL); +} + +/* Print details of connection */ +static void +show_connection (NMConnection *data, gpointer user_data) +{ + NMConnection *connection = (NMConnection *) data; + NMSettingConnection *s_con; + guint64 timestamp; + char *timestamp_str; + char timestamp_real_str[64]; + const char *val1, *val2, *val3, *val4, *val5; + + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + if (s_con) { + /* Get various info from NMSettingConnection and show it */ + timestamp = nm_setting_connection_get_timestamp (s_con); + timestamp_str = g_strdup_printf ("%" G_GUINT64_FORMAT, timestamp); + strftime (timestamp_real_str, sizeof (timestamp_real_str), "%c", localtime ((time_t *) ×tamp)); + + val1 = nm_setting_connection_get_id (s_con); + val2 = nm_setting_connection_get_uuid (s_con); + val3 = nm_setting_connection_get_connection_type (s_con); + val4 = nm_connection_get_path (connection); + val5 = timestamp ? timestamp_real_str : "never"; + + printf ("%-25s | %s | %-15s | %-43s | %s\n", val1, val2, val3, val4, val5); + + g_free (timestamp_str); + } +} + +/* This callback is called when connections from the settings service are ready. + * Now the connections can be listed. + */ +static void +get_connections_cb (NMSettingsInterface *settings, gpointer user_data) +{ + GSList *system_connections; + + system_connections = nm_settings_interface_list_connections (settings); + + printf ("System connections:\n===================\n"); + + g_slist_foreach (system_connections, (GFunc) show_connection, NULL); + + g_slist_free (system_connections); + g_object_unref (settings); + + /* We are done, exit main loop */ + g_main_loop_quit (loop); +} + +/* Get system settings and then connect to connections-read signal */ +static gboolean +list_connections (gpointer data) +{ + DBusGConnection *bus = (DBusGConnection *) data; + NMRemoteSettingsSystem *system_settings; + gboolean system_settings_running; + + /* Get system settings */ + if (!(system_settings = nm_remote_settings_system_new (bus))) { + g_message ("Error: Could not get system settings."); + result = EXIT_FAILURE; + g_main_loop_quit (loop); + return FALSE; + } + + /* Find out whether setting service is running */ + g_object_get (system_settings, NM_REMOTE_SETTINGS_SERVICE_RUNNING, &system_settings_running, NULL); + + if (!system_settings_running) { + g_message ("Error: Can't obtain connections: settings service is not running."); + result = EXIT_FAILURE; + g_main_loop_quit (loop); + return FALSE; + } + + /* Connect to signal "connections-read" - emitted when connections are fetched and ready */ + g_signal_connect (system_settings, NM_SETTINGS_INTERFACE_CONNECTIONS_READ, + G_CALLBACK (get_connections_cb), NULL); + + return FALSE; +} + +int main (int argc, char *argv[]) +{ + DBusGConnection *bus; + + /* Initialize GType system */ + g_type_init (); + + /* Get system bus */ + bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL); + + /* Run list_connections from main loop, because we need to wait for "connections-read" + * signal to have connections ready. The execution will be finished in get_connections_cb() + * callback on the signal. + */ + g_idle_add (list_connections, bus); + + loop = g_main_loop_new (NULL, FALSE); /* Create main loop */ + setup_signals (); /* Setup UNIX signals */ + g_main_loop_run (loop); /* Run main loop */ + + g_main_loop_unref (loop); + dbus_g_connection_unref (bus); + + return result; +} -- cgit v1.2.1 From 1beb2632a0ce5acb1bb2df35a6fb0cc5d4ad83b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 13 Dec 2010 16:36:46 +0100 Subject: examples: fix double free() error in get-active-connections --- examples/C/get-active-connections.c | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/C/get-active-connections.c b/examples/C/get-active-connections.c index 689b7ff6e2..a605c2ac4b 100644 --- a/examples/C/get-active-connections.c +++ b/examples/C/get-active-connections.c @@ -212,7 +212,6 @@ get_active_connections (DBusGConnection *bus, DBusGProxy *proxy) /* And print out the details of each active connection */ for (i = 0; i < paths->len; i++) get_active_connection_details (bus, g_ptr_array_index (paths, i)); - g_ptr_array_free (paths, TRUE); out: g_value_unset (&value); -- cgit v1.2.1 From a6dccad94c49a5a9adc845f039e66ea9da034460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 13 Dec 2010 17:13:16 +0100 Subject: examples: trivial comment fix --- examples/C/get-active-connections.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/C/get-active-connections.c b/examples/C/get-active-connections.c index a605c2ac4b..36224d29ad 100644 --- a/examples/C/get-active-connections.c +++ b/examples/C/get-active-connections.c @@ -238,7 +238,7 @@ int main (int argc, char *argv[]) DBUS_INTERFACE_PROPERTIES); g_assert (props_proxy); - /* Add a connection */ + /* Get active connections */ get_active_connections (bus, props_proxy); g_object_unref (props_proxy); -- cgit v1.2.1 From d4ac3cd5936b44021c75dcad00f9249448ae7247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 13 Dec 2010 20:55:02 +0100 Subject: libnm-util: fix a memory leaks in nm_setting_to_string() --- libnm-util/nm-setting.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libnm-util/nm-setting.c b/libnm-util/nm-setting.c index 06994c73de..190199c121 100644 --- a/libnm-util/nm-setting.c +++ b/libnm-util/nm-setting.c @@ -620,6 +620,8 @@ nm_setting_to_string (NMSetting *setting) is_serializable = prop_spec->flags & NM_SETTING_PARAM_SERIALIZE; is_default = g_param_value_defaults (prop_spec, &value); + g_value_unset (&value); + if (is_serializable || is_default) { g_string_append (string, " ("); -- cgit v1.2.1 From 5281c9231199dfc62f00e4266452bec3a6169191 Mon Sep 17 00:00:00 2001 From: Kristjan SCHMIDT Date: Wed, 15 Dec 2010 15:17:48 -0600 Subject: po: add Esperanto translation (bgo #637011) --- po/LINGUAS | 1 + po/eo.po | 1766 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1767 insertions(+) create mode 100644 po/eo.po diff --git a/po/LINGUAS b/po/LINGUAS index 2428598623..f77d9c0d23 100644 --- a/po/LINGUAS +++ b/po/LINGUAS @@ -14,6 +14,7 @@ dz el en_CA en_GB +eo es et eu diff --git a/po/eo.po b/po/eo.po new file mode 100644 index 0000000000..c099b86cd0 --- /dev/null +++ b/po/eo.po @@ -0,0 +1,1766 @@ +# Esperanto translation for NetworkManager +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the network-manager package. +# +# Patrick (Petriko) OUDEJANS < >, 2010. +# Aisano < >, 2010. +# Kim RIBEIRO < >, 2010. +# Serge LEBLANC < >, 2010. +# Kristjan SCHMIDT , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: network-manager\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-12-10 15:25+0000\n" +"PO-Revision-Date: 2010-12-11 10:32+0100\n" +"Last-Translator: Kristjan SCHMIDT \n" +"Language-Team: Esperanto \n" +"Language: eo\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"X-Launchpad-Export-Date: 2010-12-10 16:56+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#: ../cli/src/connections.c:60 ../cli/src/connections.c:76 +#: ../cli/src/devices.c:89 ../cli/src/devices.c:102 ../cli/src/devices.c:112 +#: ../cli/src/devices.c:122 ../cli/src/devices.c:135 ../cli/src/devices.c:146 +#: ../cli/src/devices.c:157 ../cli/src/devices.c:166 ../cli/src/devices.c:175 +msgid "NAME" +msgstr "NOMO" + +#. 0 +#: ../cli/src/connections.c:61 ../cli/src/connections.c:77 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:62 +msgid "DEVICES" +msgstr "APARATOJ" + +#. 2 +#: ../cli/src/connections.c:63 ../cli/src/connections.c:79 +msgid "SCOPE" +msgstr "AMPLEKSO" + +#. 3 +#: ../cli/src/connections.c:64 +msgid "DEFAULT" +msgstr "DEFAŬLTA" + +#. 4 +#: ../cli/src/connections.c:65 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVO" + +#. 5 +#: ../cli/src/connections.c:66 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJEKTO" + +#. 6 +#: ../cli/src/connections.c:67 +msgid "VPN" +msgstr "VPN" + +#. 7 +#. 2 +#: ../cli/src/connections.c:68 ../cli/src/connections.c:84 +#: ../cli/src/devices.c:64 +msgid "DBUS-PATH" +msgstr "DBUS-VOJO" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:78 ../cli/src/devices.c:62 ../cli/src/devices.c:91 +msgid "TYPE" +msgstr "SPECO" + +#. 3 +#: ../cli/src/connections.c:80 +msgid "TIMESTAMP" +msgstr "TEMPINDIKO" + +#. 4 +#: ../cli/src/connections.c:81 +msgid "TIMESTAMP-REAL" +msgstr "REALA-TEMPINDIKO" + +#. 5 +#: ../cli/src/connections.c:82 +msgid "AUTOCONNECT" +msgstr "AŬTOMATA-KONEKTO" + +#. 6 +#: ../cli/src/connections.c:83 +msgid "READONLY" +msgstr "NUR-LEGI" + +#: ../cli/src/connections.c:160 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Uzo: nmcli con { KOMANDO | help }\n" +" KOMANDO := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:200 ../cli/src/connections.c:541 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Eraro: 'con list': %s" + +#: ../cli/src/connections.c:202 ../cli/src/connections.c:543 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Eraro: 'con list': %s; permesataj kampoj: %s" + +#: ../cli/src/connections.c:210 +msgid "Connection details" +msgstr "Konektodetaloj" + +#: ../cli/src/connections.c:385 ../cli/src/connections.c:606 +msgid "system" +msgstr "sistemo" + +#: ../cli/src/connections.c:385 ../cli/src/connections.c:606 +msgid "user" +msgstr "uzanto" + +#: ../cli/src/connections.c:387 +msgid "never" +msgstr "neniam" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:388 ../cli/src/connections.c:389 +#: ../cli/src/connections.c:607 ../cli/src/connections.c:610 +#: ../cli/src/devices.c:433 ../cli/src/devices.c:558 ../cli/src/devices.c:584 +#: ../cli/src/devices.c:585 ../cli/src/devices.c:586 ../cli/src/devices.c:587 +#: ../cli/src/devices.c:588 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:551 ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 +msgid "yes" +msgstr "jes" + +#: ../cli/src/connections.c:388 ../cli/src/connections.c:389 +#: ../cli/src/connections.c:607 ../cli/src/connections.c:610 +#: ../cli/src/devices.c:433 ../cli/src/devices.c:558 ../cli/src/devices.c:584 +#: ../cli/src/devices.c:585 ../cli/src/devices.c:586 ../cli/src/devices.c:587 +#: ../cli/src/devices.c:588 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:510 ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 ../cli/src/settings.c:1224 +msgid "no" +msgstr "ne" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:505 +msgid "System connections" +msgstr "Sistemkonektoj" + +#: ../cli/src/connections.c:467 ../cli/src/connections.c:518 +msgid "User connections" +msgstr "Uzanto-konektoj" + +#: ../cli/src/connections.c:479 ../cli/src/connections.c:1342 +#: ../cli/src/connections.c:1358 ../cli/src/connections.c:1367 +#: ../cli/src/connections.c:1378 ../cli/src/connections.c:1463 +#: ../cli/src/devices.c:964 ../cli/src/devices.c:974 ../cli/src/devices.c:1076 +#: ../cli/src/devices.c:1083 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Eraro: argumento %s mankas." + +#: ../cli/src/connections.c:492 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Eraro: %s - neniu tia konekto" + +#: ../cli/src/connections.c:524 ../cli/src/connections.c:1391 +#: ../cli/src/connections.c:1481 ../cli/src/devices.c:787 +#: ../cli/src/devices.c:854 ../cli/src/devices.c:988 ../cli/src/devices.c:1089 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Nekonata parametro: %s\n" + +#: ../cli/src/connections.c:533 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Eraro: neniu valida parametro difinita." + +#: ../cli/src/connections.c:548 ../cli/src/connections.c:1584 +#: ../cli/src/devices.c:1295 ../cli/src/network-manager.c:359 +#, c-format +msgid "Error: %s." +msgstr "Eraro: %s." + +#: ../cli/src/connections.c:655 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Eraro: 'con status': %s" + +#: ../cli/src/connections.c:657 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Eraro: 'con status': %s; permesataj kampoj: %s" + +#: ../cli/src/connections.c:664 +msgid "Active connections" +msgstr "Aktivaj konektoj" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection on device '%s'" +msgstr "neniu aktiva konekto sur aparato '%s'" + +#: ../cli/src/connections.c:1042 +#, c-format +msgid "no active connection or device" +msgstr "neniu aktiva konekto aŭ aparato" + +#: ../cli/src/connections.c:1092 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "aparato '%s' ne kongruas kun konekto '%s'" + +#: ../cli/src/connections.c:1094 +#, c-format +msgid "no device found for connection '%s'" +msgstr "neniu aparato trovita por konekto '%s'" + +#: ../cli/src/connections.c:1105 +msgid "activating" +msgstr "enŝaltas" + +#: ../cli/src/connections.c:1107 +msgid "activated" +msgstr "enŝaltite" + +#: ../cli/src/connections.c:1110 ../cli/src/connections.c:1133 +#: ../cli/src/connections.c:1166 ../cli/src/devices.c:247 +#: ../cli/src/devices.c:559 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:149 ../cli/src/settings.c:473 +msgid "unknown" +msgstr "nekonate" + +#: ../cli/src/connections.c:1119 +msgid "VPN connecting (prepare)" +msgstr "VPN konektas (preparo)" + +#: ../cli/src/connections.c:1121 +msgid "VPN connecting (need authentication)" +msgstr "VPN konektas (bezonas aŭtentigon)" + +#: ../cli/src/connections.c:1123 +msgid "VPN connecting" +msgstr "VPN konektas" + +#: ../cli/src/connections.c:1125 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN konektas (akiras IP-agordaron)" + +#: ../cli/src/connections.c:1127 +msgid "VPN connected" +msgstr "VPN konektita" + +#: ../cli/src/connections.c:1129 +msgid "VPN connection failed" +msgstr "VPN-konekto fiaskis" + +#: ../cli/src/connections.c:1131 +msgid "VPN disconnected" +msgstr "VPN malkonektis" + +#: ../cli/src/connections.c:1142 +msgid "unknown reason" +msgstr "nekonata kialo" + +#: ../cli/src/connections.c:1144 +msgid "none" +msgstr "nenio" + +#: ../cli/src/connections.c:1146 +msgid "the user was disconnected" +msgstr "la uzanto estis malkonektita" + +#: ../cli/src/connections.c:1148 +msgid "the base network connection was interrupted" +msgstr "la baza retkonekto estis interrompita" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service stopped unexpectedly" +msgstr "la VPN-servo neatendite ĉesis" + +#: ../cli/src/connections.c:1152 +msgid "the VPN service returned invalid configuration" +msgstr "la VPN-servo revenigis nevalidan agordaron" + +#: ../cli/src/connections.c:1154 +msgid "the connection attempt timed out" +msgstr "la konektoprovo eltempiĝis" + +#: ../cli/src/connections.c:1156 +msgid "the VPN service did not start in time" +msgstr "la VPN-servo ne startis ĝustatempe" + +#: ../cli/src/connections.c:1158 +msgid "the VPN service failed to start" +msgstr "la VPN-servo fiaskis starti" + +#: ../cli/src/connections.c:1160 +msgid "no valid VPN secrets" +msgstr "neniu valida VPN-sekreto" + +#: ../cli/src/connections.c:1162 +msgid "invalid VPN secrets" +msgstr "nevalidaj VPN-sekretoj" + +#: ../cli/src/connections.c:1164 +msgid "the connection was removed" +msgstr "la konekto estis forigita" + +#: ../cli/src/connections.c:1178 +#, c-format +msgid "state: %s\n" +msgstr "stato: %s\n" + +#: ../cli/src/connections.c:1181 ../cli/src/connections.c:1207 +#, c-format +msgid "Connection activated\n" +msgstr "Konekto enŝaltita\n" + +#: ../cli/src/connections.c:1184 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Eraro: Enŝalto de konekto fiaskis." + +#: ../cli/src/connections.c:1203 +#, c-format +msgid "state: %s (%d)\n" +msgstr "stato: %s (%d)\n" + +#: ../cli/src/connections.c:1213 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Eraro: Enŝalto de konekto fiaskis: %s." + +#: ../cli/src/connections.c:1230 ../cli/src/devices.c:911 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Eraro: Eltempiĝo finiĝis %d sek." + +#: ../cli/src/connections.c:1273 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Eraro: Enŝalto de konekto fiaskis: %s" + +#: ../cli/src/connections.c:1287 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Eraro: Akiro de aktiva konekto por '%s' fiaskis." + +#: ../cli/src/connections.c:1296 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Stato de aktiva konekto: %s\n" + +#: ../cli/src/connections.c:1297 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Vojo de aktiva konekto: %s\n" + +#: ../cli/src/connections.c:1351 ../cli/src/connections.c:1472 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Eraro: Nekonata konekto: %s." + +#: ../cli/src/connections.c:1386 ../cli/src/devices.c:982 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Eraro: eltempiĝa valoro '%s' ne validas." + +#: ../cli/src/connections.c:1399 ../cli/src/connections.c:1489 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Eraro: id aŭ uuid devas esti specifata." + +#: ../cli/src/connections.c:1419 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Eraro: Trovis neniun taŭgan aparaton: %s." + +#: ../cli/src/connections.c:1421 +#, c-format +msgid "Error: No suitable device found." +msgstr "Eraro: Trovis neniun taŭgan aparaton." + +#: ../cli/src/connections.c:1516 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Atenton: Konekto ne aktivas\n" + +#: ../cli/src/connections.c:1573 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Eraro: 'con'-komando '%s' ne validas." + +#: ../cli/src/connections.c:1609 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Eraro: ne povis konekti al D-Bus." + +#: ../cli/src/connections.c:1616 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Eraro: Ne povis akiri sistemajn agordojn." + +#: ../cli/src/connections.c:1624 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Eraro: Ne povis akiri uzanto-agordojn." + +#: ../cli/src/connections.c:1634 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "Eraro: Ne povas obteni konektojn: agordo-servoj ne aktivas." + +#. 0 +#. 9 +#: ../cli/src/devices.c:61 ../cli/src/devices.c:90 ../cli/src/devices.c:185 +msgid "DEVICE" +msgstr "APARATO" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:63 ../cli/src/devices.c:94 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATO" + +#: ../cli/src/devices.c:73 +msgid "GENERAL" +msgstr "ĜENERALA" + +#. 0 +#: ../cli/src/devices.c:74 +msgid "CAPABILITIES" +msgstr "KAPABLOJ" + +#. 1 +#: ../cli/src/devices.c:75 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-ECOJ" + +#. 2 +#: ../cli/src/devices.c:76 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:77 +msgid "WIRED-PROPERTIES" +msgstr "DRATA-ECOJ" + +#. 4 +#: ../cli/src/devices.c:78 +msgid "IP4-SETTINGS" +msgstr "IP4-AGORDOJ" + +#. 5 +#: ../cli/src/devices.c:79 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 6 +#: ../cli/src/devices.c:80 +msgid "IP6-SETTINGS" +msgstr "IP6-AGORDOJ" + +#. 7 +#: ../cli/src/devices.c:81 +msgid "IP6-DNS" +msgstr "IP6-DNS" + +#. 2 +#: ../cli/src/devices.c:92 +msgid "DRIVER" +msgstr "PELILO" + +#. 3 +#: ../cli/src/devices.c:93 +msgid "HWADDR" +msgstr "APARATADRESO" + +#. 0 +#: ../cli/src/devices.c:103 +msgid "CARRIER-DETECT" +msgstr "PORTANTO-REKONO" + +#. 1 +#: ../cli/src/devices.c:104 +msgid "SPEED" +msgstr "RAPIDO" + +#. 0 +#: ../cli/src/devices.c:113 +msgid "CARRIER" +msgstr "PORTANTO" + +#. 0 +#: ../cli/src/devices.c:123 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:124 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:125 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:126 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:127 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:136 ../cli/src/devices.c:147 +msgid "ADDRESS" +msgstr "ADRESO" + +#. 1 +#: ../cli/src/devices.c:137 ../cli/src/devices.c:148 +msgid "PREFIX" +msgstr "PREFIKSO" + +#. 2 +#: ../cli/src/devices.c:138 ../cli/src/devices.c:149 +msgid "GATEWAY" +msgstr "KLUZO" + +#. 0 +#: ../cli/src/devices.c:158 ../cli/src/devices.c:167 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:176 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:177 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:178 +msgid "MODE" +msgstr "REĜIMO" + +#. 3 +#: ../cli/src/devices.c:179 +msgid "FREQ" +msgstr "FREKV" + +#. 4 +#: ../cli/src/devices.c:180 +msgid "RATE" +msgstr "TRANSMETRAPIDO" + +#. 5 +#: ../cli/src/devices.c:181 +msgid "SIGNAL" +msgstr "SIGNALO" + +#. 6 +#: ../cli/src/devices.c:182 +msgid "SECURITY" +msgstr "SEKURECO" + +#. 7 +#: ../cli/src/devices.c:183 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGOJ" + +#. 8 +#: ../cli/src/devices.c:184 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGOJ" + +#. 10 +#: ../cli/src/devices.c:186 +msgid "ACTIVE" +msgstr "AKTIVA" + +#: ../cli/src/devices.c:209 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"Usage: nmcli dev { KOMANDO | help }\n" +"\n" +" KOMANDO := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:229 +msgid "unmanaged" +msgstr "nemastrumata" + +#: ../cli/src/devices.c:231 +msgid "unavailable" +msgstr "neatingebla" + +#: ../cli/src/devices.c:233 ../cli/src/network-manager.c:91 +msgid "disconnected" +msgstr "nekonektite" + +#: ../cli/src/devices.c:235 +msgid "connecting (prepare)" +msgstr "konektas (preparo)" + +#: ../cli/src/devices.c:237 +msgid "connecting (configuring)" +msgstr "konektas (agordado)" + +#: ../cli/src/devices.c:239 +msgid "connecting (need authentication)" +msgstr "konektas (bezonas aŭtentigon)" + +#: ../cli/src/devices.c:241 +msgid "connecting (getting IP configuration)" +msgstr "konektas (akiras IP-agordaron)" + +#: ../cli/src/devices.c:243 ../cli/src/network-manager.c:89 +msgid "connected" +msgstr "konektita" + +#: ../cli/src/devices.c:245 +msgid "connection failed" +msgstr "konekto fiaskis" + +#: ../cli/src/devices.c:268 ../cli/src/devices.c:425 +msgid "Unknown" +msgstr "Nekonata" + +#: ../cli/src/devices.c:300 +msgid "(none)" +msgstr "(nenio)" + +#: ../cli/src/devices.c:325 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: eraro dum konverto de IP4-adreso 0x%X" + +#: ../cli/src/devices.c:394 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:395 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:404 +msgid "Encrypted: " +msgstr "Ĉifrita: " + +#: ../cli/src/devices.c:409 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:411 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:413 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:416 +msgid "Enterprise " +msgstr "Entrepreno " + +#: ../cli/src/devices.c:425 +msgid "Ad-Hoc" +msgstr "Laŭcela" + +#: ../cli/src/devices.c:425 +msgid "Infrastructure" +msgstr "Infrastrukturo" + +#: ../cli/src/devices.c:487 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "Eraro: 'dev list': %s" + +#: ../cli/src/devices.c:489 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Eraro: 'dev list': %s; permesataj kampoj: %s" + +#: ../cli/src/devices.c:498 +msgid "Device details" +msgstr "Detaloj de aparato" + +#: ../cli/src/devices.c:528 ../cli/src/devices.c:927 +msgid "(unknown)" +msgstr "(nekonata)" + +#: ../cli/src/devices.c:529 +msgid "unknown)" +msgstr "nekonata)" + +#: ../cli/src/devices.c:555 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:628 +msgid "on" +msgstr "enŝaltite" + +#: ../cli/src/devices.c:628 +msgid "off" +msgstr "elŝaltite" + +#: ../cli/src/devices.c:810 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "Eraro: 'dev status': %s" + +#: ../cli/src/devices.c:812 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Eraro: 'dev status': %s; permesataj kampoj: %s" + +#: ../cli/src/devices.c:819 +msgid "Status of devices" +msgstr "Stato de aparatoj" + +#: ../cli/src/devices.c:847 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Eraro: argumento '%s' mankas." + +#: ../cli/src/devices.c:876 ../cli/src/devices.c:1015 +#: ../cli/src/devices.c:1138 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Eraro: Aparato '%s' ne trovita." + +#: ../cli/src/devices.c:899 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Sukceso: Aparato '%s' sukcese malkonektiĝis." + +#: ../cli/src/devices.c:924 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Eraro: Aparato '%s' (%s) eraro dum malkonektiĝo: %s" + +#: ../cli/src/devices.c:932 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Stato de aparato: %d (%s)\n" + +#: ../cli/src/devices.c:996 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Eraro: 'iface' devas esti specifata." + +#: ../cli/src/devices.c:1114 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "Eraro: 'dev wifi': %s" + +#: ../cli/src/devices.c:1116 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Eraro: 'dev wifi': %s; permesataj kampoj: %s" + +#: ../cli/src/devices.c:1123 +msgid "WiFi scan list" +msgstr "WiFi-skanlisto" + +#: ../cli/src/devices.c:1158 ../cli/src/devices.c:1212 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Eraro: Retkaptejo kun 'hwaddr' '%s' ne trovita" + +#: ../cli/src/devices.c:1175 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Eraro: Aparato '%s' ne estas WiFi-aparato." + +#: ../cli/src/devices.c:1239 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Eraro: 'dev wifi'-komando '%s' ne validas." + +#: ../cli/src/devices.c:1286 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Eraro: 'dev'-komando '%s' ne validas." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "AKTIVA" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "NET-ENABLED" +msgstr "RET-ENŜALTITE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI-HARDWARE" +msgstr "WIFI-APARATARO" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WIFI" +msgstr "WIFI" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN-HARDWARE" +msgstr "WWAN-APARATARO" + +#. 5 +#: ../cli/src/network-manager.c:41 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:64 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | enable | sleep | wifi | wwan }\n" +"\n" +" status\n" +" enable [true|false]\n" +" sleep [true|false]\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Uzo: nmcli nm { KOMANDO | help }\n" +"\n" +" KOMANDO := { status | enable | sleep | wifi | wwan }\n" +"\n" +" status\n" +" enable [true|false]\n" +" sleep [true|false]\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:85 +msgid "asleep" +msgstr "dormas" + +#: ../cli/src/network-manager.c:87 +msgid "connecting" +msgstr "konektas" + +#: ../cli/src/network-manager.c:128 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Eraro: 'nm status': %s" + +#: ../cli/src/network-manager.c:130 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Eraro: 'nm status': %s; permesataj kampoj: %s" + +#: ../cli/src/network-manager.c:137 +msgid "NetworkManager status" +msgstr "Stato de NetworkManager" + +#. Print header +#: ../cli/src/network-manager.c:144 ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 ../cli/src/network-manager.c:328 +msgid "enabled" +msgstr "enŝaltita" + +#: ../cli/src/network-manager.c:144 ../cli/src/network-manager.c:145 +#: ../cli/src/network-manager.c:146 ../cli/src/network-manager.c:147 +#: ../cli/src/network-manager.c:154 ../cli/src/network-manager.c:247 +#: ../cli/src/network-manager.c:296 ../cli/src/network-manager.c:328 +msgid "disabled" +msgstr "elŝaltite" + +#: ../cli/src/network-manager.c:152 +msgid "running" +msgstr "aktiva" + +#: ../cli/src/network-manager.c:152 +msgid "not running" +msgstr "neaktiva" + +#: ../cli/src/network-manager.c:175 +#, c-format +msgid "Error: Couldn't connect to system bus: %s" +msgstr "Eraro: Ne povis konekti al sistem-buso: %s." + +#: ../cli/src/network-manager.c:186 +#, c-format +msgid "Error: Couldn't create D-Bus object proxy." +msgstr "Eraro: Ne povis krei D-busan objekt-prokurservilon." + +#: ../cli/src/network-manager.c:192 +#, c-format +msgid "Error in sleep: %s" +msgstr "Eraro dum dormo: %s" + +#: ../cli/src/network-manager.c:237 ../cli/src/network-manager.c:286 +#: ../cli/src/network-manager.c:318 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Eraro: valoro '--fields' '%s' ne validas tie ĉi; permesataj kampoj: %s" + +#: ../cli/src/network-manager.c:245 +msgid "Networking enabled" +msgstr "Retkonektado enŝaltita" + +#: ../cli/src/network-manager.c:256 +#, c-format +msgid "Error: invalid 'enable' parameter: '%s'; use 'true' or 'false'." +msgstr "Eraro: nevalida 'enŝalt'-parametro: '%s'; uzu 'true' aŭ 'false'." + +#: ../cli/src/network-manager.c:265 +#, c-format +msgid "Error: Sleeping status is not exported by NetworkManager." +msgstr "Eraro: Dorm-stato ne estas elportite de NetworkManager." + +#: ../cli/src/network-manager.c:273 +#, c-format +msgid "Error: invalid 'sleep' parameter: '%s'; use 'true' or 'false'." +msgstr "Eraro: nevalida 'dorm'-parametro: '%s'; uzu 'true' aŭ 'false'." + +#: ../cli/src/network-manager.c:294 +msgid "WiFi enabled" +msgstr "WiFi enŝaltita" + +#: ../cli/src/network-manager.c:305 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Eraro: nevalida 'wifi'-parametro: '%s'." + +#: ../cli/src/network-manager.c:326 +msgid "WWAN enabled" +msgstr "WWAN enŝaltita" + +#: ../cli/src/network-manager.c:337 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Eraro: nevalida 'wwan'-parametro: '%s'." + +#: ../cli/src/network-manager.c:348 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Eraro: 'nm'-komando '%s' ne validas." + +#: ../cli/src/nmcli.c:69 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -m[ode] tabular|multiline output mode\n" +" -f[ields] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Uzo: %s [OPCIOJ] OBJEKTO { KOMANDO | help }\n" +"\n" +"OPCIOJ\n" +" -t[erse] konciza eligo\n" +" -p[retty] bela eligo\n" +" -m[ode] tabular|multiline eliga reĝimo\n" +" -f[ields] |all|common specifigi eligo-kampojn\n" +" -e[scape] yes|no eskapaj kolumno-separoj en " +"valoroj\n" +" -v[ersion] montri programversion\n" +" -h[elp] printi tiun ĉi help-paĝon\n" +"\n" +"OBJEKTO\n" +" nm stato de NetworkManager\n" +" con konektoj de NetworkManager\n" +" dev aparatoj mastrumataj de NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Eraro: Objekto '%s' estas nekonata, provu: 'nmcli help'." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Eraro: Opcio '--terse' specifiĝis duan fojon." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Eraro: Opcioj '--terse' kaj '--pretty' ekskludas unu la alian." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Eraro: Opcio '--pretty' specifiĝis duan fojon." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Eraro: Opcioj '--pretty' kaj '--terse' ekskludas unu la alian." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Eraro: mankas argumento por elektindaĵo '%s'." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Eraro: '%s' ne estas valida argumento por elektindaĵo '%s'." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Eraro: kampoj por elektindaĵoj '%s' mankas." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "ilo 'nmcli', versio %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Eraro: Opcio '%s' estas nekonata, provu: 'nmcli -help'." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "Ricevis signalon '%d', elŝaltas..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Eraro: Ne eblis konekti al NetworkManager" + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "Sukceso" + +#: ../cli/src/settings.c:411 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (heks-ascii-ŝlosilo)" + +#: ../cli/src/settings.c:413 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-bita pasvorto)" + +#: ../cli/src/settings.c:416 +#, c-format +msgid "%d (unknown)" +msgstr "%d (nekonata)" + +#: ../cli/src/settings.c:442 +msgid "0 (unknown)" +msgstr "0 (nekonata)" + +#: ../cli/src/settings.c:448 +msgid "any, " +msgstr "ajna, " + +#: ../cli/src/settings.c:450 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:454 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:456 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:468 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:470 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:554 ../cli/src/settings.c:721 +msgid "auto" +msgstr "aŭto" + +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 +msgid "not set" +msgstr "neagordita" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "kampo '%s' devas esti sola" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "nevalida kampo '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Elektindaĵo '--terse' postulas specifigon de '--fields'" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "" +"Elektindaĵo '--terse' postulas specifajn elektindajn valorojn de '--fields', " +"ne '%s'" + +#: ../libnm-util/crypto.c:121 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM-ŝlosil-dosiero ne havis finan etikedon '%s'." + +#: ../libnm-util/crypto.c:131 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Tio ĉi ne aspektas kiel privat-ŝlosila PEM-dosiero." + +#: ../libnm-util/crypto.c:139 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Malsufiĉas memoro por stori datenojn de PEM-dosiero." + +#: ../libnm-util/crypto.c:155 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Misforma PEM-dosiero: 'Proc-Type' ne estas la unua etikedo." + +#: ../libnm-util/crypto.c:163 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Misforma PEM-dosiero: nekonata Proc-Type-etikedo \"%s\"." + +#: ../libnm-util/crypto.c:173 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Misforma PEM-dosiero: 'DEK-Info' ne estas la dua etikedo." + +#: ../libnm-util/crypto.c:184 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Misforma PEM-dosiero: mi ne trovis IV en la etikedo \"DEK-Info\"." + +#: ../libnm-util/crypto.c:191 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "" +"Misforma PEM-dosiero: nevalida struktturo de IV en la etikedo \"DEK-Info\"." + +#: ../libnm-util/crypto.c:204 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Misforma PEM-dosiero: nekonata privat-ŝlosila ĉifro \"%s\"." + +#: ../libnm-util/crypto.c:223 +#, c-format +msgid "Could not decode private key." +msgstr "Ne eblis malĉifri la privatan ŝlosilon." + +#: ../libnm-util/crypto.c:268 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "La PEM-certigilo \"%s\" ne havas finan etikedon \"%s\"." + +#: ../libnm-util/crypto.c:278 +#, c-format +msgid "Failed to decode certificate." +msgstr "Malsuksesis malĉifri la certigilon." + +#: ../libnm-util/crypto.c:287 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Malsufiĉas memoro por stori la datenojn de la certigilo." + +#: ../libnm-util/crypto.c:295 +#, c-format +msgid "Not enough memory to store file data." +msgstr "Malsufiĉas memoro por stori la datenojn de la dosiero." + +#: ../libnm-util/crypto.c:325 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV nepre amkplesu paran nombron da bajtoj." + +#: ../libnm-util/crypto.c:334 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Malsufiĉas memoro por stori la IV-on." + +#: ../libnm-util/crypto.c:345 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV enhavas nedeksesumajn ciferojn" + +#: ../libnm-util/crypto.c:383 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Privata Cipher-ŝlosilo '%s' estas nekonata." + +#: ../libnm-util/crypto.c:392 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "Nesufiĉa memoro por malĉifri privatan ŝlosilon." + +#: ../libnm-util/crypto.c:512 +#, c-format +msgid "Unable to determine private key type." +msgstr "Ne eblas determini la tipon de la privata ŝlosilo." + +#: ../libnm-util/crypto.c:531 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Nesufiĉa memoro por gardi privatan ŝlosilon malĉifritan." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "Pretigo de la kriptografia maŝino fiaskis." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Pretigo de la MD5-maŝino fiaskis: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Nevalida amplekso por IV (devas esti almenaŭ %zd)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Nesufiĉa memoro por bufro de la malĉifrita ŝlosilo." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Fiaskis pravalorizi la malĉifran Cipher-kuntekston: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "Fiaskis agordi simetrian ŝlosilon por malĉifro: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Fiaskis agordi IV por malĉifro: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Fiaskis malĉifri la privatan ŝlosilon: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "Fiaskis malĉifri la privatan ŝlosilon: neatendita ŝtopada longo." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "Fiaskis malĉifri la privatan ŝlosilon." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Ne eblis rezervi memoron por ĉifrado." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Fiaskis valorizi la ĉifradan kuntekston: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Fiaskis agordi simetrian ŝlosilon por ĉifrado: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Fiaskis agordi IV por ĉifrado: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Ĉifrado de datumoj malsukcesis: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Eraro dum pravalorizo de atestilaj datumoj: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Ne povis malkodi certigilon: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "Ne povis pravalorizi PKCS#12-malkodilon: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Ne eblis dekodi PKCS#12-dosieron: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "No povis kontroli PKCS#12-dosieron: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Pravalorigo de la kriptografia maŝino fiaskis: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Fiaskis pravalorizi la MD5-kuntekston: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Nevalida IV-longo (devas esti almenaŭ %d)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Fiaskis pravalorizi la malĉifran Cipher-foldon." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Fiaskis agordi simetrian ŝlosilon por malĉifrado." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Fiaskis agordi IV por malĉifrado." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Fiaskis pravalorizi la malĉifran kuntekston." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Fiaskis malĉifri la privatan ŝlosilon: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "Fiaskis malĉifri la privatan ŝlosilon: malĉifritaj datumoj tro longas." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Fiaskis fini malĉifradon de la privata ŝlosilo: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "Fiaskis pravalorizi la ĉifran Cipher-foldon." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "Fiaskis agordi simetrian ŝlosilon por ĉifrado." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Fiaskis agordi IV por ĉifrado." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "Fiaskis pravalorizi la ĉifradan kuntekston." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Fiaskis ĉifri: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Neatendita nombro da datumoj post ĉifrado." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Ne povis malkodigi atestilon: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Ne povis konverti pasvorton al UCS2: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Ne povis pravalorizi PKCS#12-malkodilon: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Ne povis malkodigi PKCS#12-dosieron: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Ne povis kontroli PKCS#12-dosieron: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "Ne povis generi hazardajn datumojn." + +#: ../libnm-util/nm-utils.c:1975 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Nesufiĉa memoro por fari ĉifran ŝlosilon." + +#: ../libnm-util/nm-utils.c:2085 +msgid "Could not allocate memory for PEM file creation." +msgstr "Ne povis atribui memoron por kreo de PEM-dosiero." + +#: ../libnm-util/nm-utils.c:2097 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Ne povis atribui memoron por konservi IV en PEM-dosieron." + +#: ../libnm-util/nm-utils.c:2109 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "" +"Ne povis atribui memoron por konservi ĉifritan ŝlosilon en PEM-dosieron." + +#: ../libnm-util/nm-utils.c:2128 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Ne povis atribui memoron por datumoj de PEM-dosiero." + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Kundivido de konektoj per protektita WiFi-reto" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Kundivido de konektoj per malferma WiFi-reto" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Modifi permanentan sisteman gastigan nomon" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Modifi sistemajn konektojn" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Sistempolico preventas modifadon de sistemagordoj" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "Sistempolico preventas modifadon de la konstanta sistem-gastnomo" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "Sistempolico preventas kundividon de konektoj per protektita WiFi-reto" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "Sistempolitiko preventas kundividon de konektoj per malferma WiFi-reto" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "Permesi kontrolon de retkonektoj" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "Permesi uzon de specifaj konektoj por uzantoj" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "Enŝalti aŭ elŝalti WiFi-aparatojn" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "Enŝalti aŭ elŝalti poŝtelefonajn larĝkapacitajn aparatojn" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "Enŝalti aŭ elŝalti sistemretkonektadon" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 +msgid "" +"Put NetworkManager to sleep or wake it up (should only be used by system " +"power management)" +msgstr "" +"Dormigi aŭ veki NetworkManager (estu uzata nur de sistema energimastumado)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +msgid "System policy prevents control of network connections" +msgstr "Sistempolitiko preventas kontrolon de retkonektoj" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "Sistempolitiko preventas enŝalton aŭ malŝalton de WiFi-aparatoj" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "" +"Sistempolitiko preventas enŝalton aŭ malŝalton de poŝtelefonaj larĝkapacitaj " +"aparatoj" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +msgid "System policy prevents enabling or disabling system networking" +msgstr "Sistempolitiko preventas enŝalton aŭ malŝalton de sistema retkonektado" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "Sistempolitiko preventas dormigi aŭ veki NetworkManager" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +msgid "System policy prevents use of user-specific connections" +msgstr "Sistempolitiko preventas uzon de uzant-specifaj konektoj" + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "eraro dum traktado de netlink-mesaĝo: %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "okazis eraro dum atendado je datumoj sur kontaktoskatolo" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "ne eblas konekti al netlink por kontroli ligilan staton: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "ne povis aktivigi la netlink-tenilan legitimaĵo-pasadon: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "ne povis atribui retligiltenilon por kontroli ligilstaton: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "" +"ne povis atribui ligilan kaŝmemoron de netlink por kontroli ligilstaton: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "ne eblas membriĝi al retligila grupo: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "eraro dum ĝisdatigo de ligila kaŝmemoro: %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"Nevalida elektindaĵo. Bonvolu uzi --help por vidi liston da validaj " +"elektindaĵoj.\n" + +#: ../src/main.c:573 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. Bovolu uzi --help por vidi liston da validaj elektindaĵoj.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:328 +msgid "# Created by NetworkManager\n" +msgstr "# Kreita de NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:344 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Kunfandita el %s\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:284 +msgid "no usable DHCP client could be found." +msgstr "neniu uzebla DHCP-kliento estis trovebla" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:293 +msgid "'dhclient' could be found." +msgstr "'dhclient' povis esti trovita." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:303 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' povis esti trovita." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:311 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "nesubtenata DHCP-kliento '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "Nekonata protokolnivelo '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "Nekonata protokola regiono '%s'" + +#: ../src/dns-manager/nm-dns-manager.c:367 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "NOTO: la libc-solvilo eble ne povus subteni pli ol 3 nomservilojn." + +#: ../src/dns-manager/nm-dns-manager.c:369 +msgid "The nameservers listed below may not be recognized." +msgstr "La sube ligstigitaj nomserviloj eble ne estos rekonataj." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "Aŭto %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3408 +#: ../system-settings/plugins/ifnet/connection_parser.c:49 +msgid "System" +msgstr "Sistemo" -- cgit v1.2.1 From 82291075893428fee425b773ea538dcb0a85ea5d Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Sun, 12 Dec 2010 13:18:00 +0100 Subject: ip6: rdnss structure needs to be packed (bgo #637075) The code assumes this structure is packed, so let's make sure it actually is. --- src/ip6-manager/nm-ip6-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index f6f6127ce7..e9540a0314 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -575,7 +575,7 @@ struct nd_opt_rdnss { uint16_t nd_opt_rdnss_reserved1; uint32_t nd_opt_rdnss_lifetime; /* followed by one or more IPv6 addresses */ -}; +} __attribute__ ((packed)); static NMIP6Device * process_nduseropt (NMIP6Manager *manager, struct nl_msg *msg) -- cgit v1.2.1 From 4e8cb2f193f90bdcde2e1eb1ddd875c57b5808ea Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Wed, 15 Dec 2010 17:37:14 -0600 Subject: ip6: restructure RDNSS code to be RFC compliant (bgo #637075) RFC5006/RFC6106 specifies fairly clearly how to handle multiple RDDNS options. Unfortunately the previous code didn't deal with this and hence would misbehave in all but the simplest setups. The new code should be fully compliant with the following exceptions: - Router lifetime not respected - No "sufficient number" management. - DHCPv6 servers might not be prioritised over RDDNS ones. --- src/ip6-manager/nm-ip6-manager.c | 163 ++++++++++++++++++++++++--------------- 1 file changed, 99 insertions(+), 64 deletions(-) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index e9540a0314..ae748ca1b3 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -285,7 +285,7 @@ set_rdnss_timeout (NMIP6Device *device) nm_log_dbg (LOGD_IP6, "(%s): removing expired RA-provided nameserver %s", device->iface, buf); } - g_array_remove_index_fast (device->rdnss_servers, i--); + g_array_remove_index (device->rdnss_servers, i--); continue; } @@ -577,19 +577,106 @@ struct nd_opt_rdnss { /* followed by one or more IPv6 addresses */ } __attribute__ ((packed)); +static gboolean +process_nduseropt_rdnss (NMIP6Device *device, struct nd_opt_hdr *opt) +{ + size_t opt_len; + struct nd_opt_rdnss *rdnss_opt; + time_t now = time (NULL); + struct in6_addr *addr; + GArray *new_servers; + NMIP6RDNSS server, *cur_server; + gboolean changed = FALSE; + guint i; + + opt_len = opt->nd_opt_len; + + if (opt_len < 3 || (opt_len & 1) == 0) + return FALSE; + + rdnss_opt = (struct nd_opt_rdnss *) opt; + + new_servers = g_array_new (FALSE, FALSE, sizeof (NMIP6RDNSS)); + + /* Pad the DNS server expiry somewhat to give a bit of slack in cases + * where one RA gets lost or something (which can happen on unreliable + * links like WiFi where certain types of frames are not retransmitted). + * Note that 0 has special meaning and is therefore not adjusted. + */ + server.expires = ntohl (rdnss_opt->nd_opt_rdnss_lifetime); + if (server.expires > 0) + server.expires += now + 10; + + for (addr = (struct in6_addr *) (rdnss_opt + 1); opt_len >= 2; addr++, opt_len -= 2) { + char buf[INET6_ADDRSTRLEN + 1]; + + if (!inet_ntop (AF_INET6, addr, buf, sizeof (buf))) + strcpy(buf, "[invalid]"); + + for (i = 0; i < device->rdnss_servers->len; i++) { + cur_server = &(g_array_index (device->rdnss_servers, NMIP6RDNSS, i)); + + if (!IN6_ARE_ADDR_EQUAL (addr, &cur_server->addr)) + continue; + + cur_server->expires = server.expires; + + if (server.expires > 0) { + nm_log_dbg (LOGD_IP6, "(%s): refreshing RA-provided nameserver %s (expires in %d seconds)", + device->iface, buf, + server.expires - now); + break; + } + + nm_log_dbg (LOGD_IP6, "(%s): removing RA-provided nameserver %s on router request", + device->iface, buf); + + g_array_remove_index (device->rdnss_servers, i); + changed = TRUE; + break; + } + + if (server.expires == 0) + continue; + if (i < device->rdnss_servers->len) + continue; + + nm_log_dbg (LOGD_IP6, "(%s): found RA-provided nameserver %s (expires in %d seconds)", + device->iface, buf, server.expires - now); + + server.addr = *addr; + g_array_append_val (new_servers, server); + } + + /* New servers must be added in the order they are listed in the + * RA option and before any existing servers. + * + * Note: This is the place to remove servers if we want to cap the + * number of resolvers. The RFC states that the one to expire + * first of the existing servers should be removed. + */ + if (new_servers->len) { + g_array_prepend_vals (device->rdnss_servers, + new_servers->data, new_servers->len); + changed = TRUE; + } + + g_array_free (new_servers, TRUE); + + /* Timeouts may have changed even if IPs didn't */ + set_rdnss_timeout (device); + + return changed; +} + static NMIP6Device * process_nduseropt (NMIP6Manager *manager, struct nl_msg *msg) { NMIP6Device *device; struct nduseroptmsg *ndmsg; struct nd_opt_hdr *opt; - guint opts_len, i; - time_t now = time (NULL); - struct nd_opt_rdnss *rdnss_opt; - struct in6_addr *addr; - GArray *servers; - NMIP6RDNSS server, *sa, *sb; - gboolean changed; + guint opts_len; + gboolean changed = FALSE; nm_log_dbg (LOGD_IP6, "processing netlink nduseropt message"); @@ -608,8 +695,6 @@ process_nduseropt (NMIP6Manager *manager, struct nl_msg *msg) return NULL; } - servers = g_array_new (FALSE, FALSE, sizeof (NMIP6RDNSS)); - opt = (struct nd_opt_hdr *) (ndmsg + 1); opts_len = ndmsg->nduseropt_opts_len; @@ -619,66 +704,16 @@ process_nduseropt (NMIP6Manager *manager, struct nl_msg *msg) if (nd_opt_len == 0 || opts_len < (nd_opt_len << 3)) break; - if (opt->nd_opt_type != ND_OPT_RDNSS) - goto next; - - if (nd_opt_len < 3 || (nd_opt_len & 1) == 0) - goto next; - - rdnss_opt = (struct nd_opt_rdnss *) opt; - - /* Pad the DNS server expiry somewhat to give a bit of slack in cases - * where one RA gets lost or something (which can happen on unreliable - * links like wifi where certain types of frames are not retransmitted). - */ - server.expires = now + ntohl (rdnss_opt->nd_opt_rdnss_lifetime) + 10; - - for (addr = (struct in6_addr *) (rdnss_opt + 1); nd_opt_len >= 2; addr++, nd_opt_len -= 2) { - char buf[INET6_ADDRSTRLEN + 1]; - - if (inet_ntop (AF_INET6, addr, buf, sizeof (buf))) { - nm_log_dbg (LOGD_IP6, "(%s): found RA-provided nameserver %s (expires in %d seconds)", - device->iface, buf, - ntohl (rdnss_opt->nd_opt_rdnss_lifetime)); - } - - server.addr = *addr; - g_array_append_val (servers, server); + switch (opt->nd_opt_type) { + case ND_OPT_RDNSS: + changed = process_nduseropt_rdnss (device, opt); + break; } - next: opts_len -= opt->nd_opt_len << 3; opt = (struct nd_opt_hdr *) ((uint8_t *) opt + (opt->nd_opt_len << 3)); } - /* See if anything (other than expiration time) changed */ - if (servers->len != device->rdnss_servers->len) - changed = TRUE; - else { - for (i = 0; i < servers->len; i++) { - sa = &(g_array_index (servers, NMIP6RDNSS, i)); - sb = &(g_array_index (device->rdnss_servers, NMIP6RDNSS, i)); - if (IN6_ARE_ADDR_EQUAL (&sa->addr, &sb->addr) == FALSE) { - changed = TRUE; - break; - } - } - changed = FALSE; - } - - if (changed) { - nm_log_dbg (LOGD_IP6, "(%s): RA-provided nameservers changed", device->iface); - } - - /* Always copy in new servers (even if unchanged) to get their updated - * expiration times. - */ - g_array_free (device->rdnss_servers, TRUE); - device->rdnss_servers = servers; - - /* Timeouts may have changed even if IPs didn't */ - set_rdnss_timeout (device); - if (changed) return device; else -- cgit v1.2.1 From 83bc6639142831e864c4ce77cf7b1830bb2fcc74 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 13 Dec 2010 22:28:53 +0100 Subject: ip6: support for DNS Search List option (bgo #637077) RFC6101 adds the DNS Search List option to router advertisements. This allows stateless configuration of suffixes to try when doing DNS lookups. Make sure we catch these when provided by the kernel and reconfigure things appropriately. NOTE: this commit depends on a kernel patch: http://marc.info/?l=linux-netdev&m=129216173321352&w=2 --- src/ip6-manager/nm-ip6-manager.c | 233 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 233 insertions(+) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index ae748ca1b3..ea93f02c02 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -76,6 +76,11 @@ typedef struct { time_t expires; } NMIP6RDNSS; +typedef struct { + char domain[256]; + time_t expires; +} NMIP6DNSSL; + /******************************************************************/ typedef struct { @@ -97,6 +102,9 @@ typedef struct { GArray *rdnss_servers; guint rdnss_timeout_id; + GArray *dnssl_domains; + guint dnssl_timeout_id; + guint ip6flags_poll_id; guint32 ra_flags; @@ -122,6 +130,10 @@ nm_ip6_device_destroy (NMIP6Device *device) g_array_free (device->rdnss_servers, TRUE); if (device->rdnss_timeout_id) g_source_remove (device->rdnss_timeout_id); + if (device->dnssl_domains) + g_array_free (device->dnssl_domains, TRUE); + if (device->dnssl_timeout_id) + g_source_remove (device->dnssl_timeout_id); if (device->ip6flags_poll_id) g_source_remove (device->ip6flags_poll_id); @@ -155,6 +167,8 @@ nm_ip6_device_new (NMIP6Manager *manager, int ifindex) device->rdnss_servers = g_array_new (FALSE, FALSE, sizeof (NMIP6RDNSS)); + device->dnssl_domains = g_array_new (FALSE, FALSE, sizeof (NMIP6DNSSL)); + g_hash_table_replace (priv->devices, GINT_TO_POINTER (device->ifindex), device); /* and the original value of IPv6 enable/disable */ @@ -300,6 +314,61 @@ set_rdnss_timeout (NMIP6Device *device) } } +static void set_dnssl_timeout (NMIP6Device *device); + +static gboolean +dnssl_expired (gpointer user_data) +{ + NMIP6Device *device = user_data; + CallbackInfo info = { device, IP6_DHCP_OPT_NONE }; + + nm_log_dbg (LOGD_IP6, "(%s): IPv6 DNSSL information expired", device->iface); + + set_dnssl_timeout (device); + emit_config_changed (&info); + return FALSE; +} + +static void +set_dnssl_timeout (NMIP6Device *device) +{ + time_t expires = 0, now = time (NULL); + NMIP6DNSSL *dnssl; + int i; + + if (device->dnssl_timeout_id) { + g_source_remove (device->dnssl_timeout_id); + device->dnssl_timeout_id = 0; + } + + /* Find the soonest expiration time. */ + for (i = 0; i < device->dnssl_domains->len; i++) { + dnssl = &g_array_index (device->dnssl_domains, NMIP6DNSSL, i); + if (dnssl->expires == 0) + continue; + + /* If the entry has already expired, remove it; the "+ 1" is + * because g_timeout_add_seconds() might fudge the timing a + * bit. + */ + if (dnssl->expires <= now + 1) { + nm_log_dbg (LOGD_IP6, "(%s): removing expired RA-provided domain %s", + device->iface, dnssl->domain); + g_array_remove_index (device->dnssl_domains, i--); + continue; + } + + if (!expires || dnssl->expires < expires) + expires = dnssl->expires; + } + + if (expires) { + device->dnssl_timeout_id = g_timeout_add_seconds (expires - now, + dnssl_expired, + device); + } +} + static CallbackInfo * callback_info_new (NMIP6Device *device, guint dhcp_opts, gboolean success) { @@ -569,6 +638,8 @@ process_prefix (NMIP6Manager *manager, struct nl_msg *msg) */ #define ND_OPT_RDNSS 25 +#define ND_OPT_DNSSL 31 + struct nd_opt_rdnss { uint8_t nd_opt_rdnss_type; uint8_t nd_opt_rdnss_len; @@ -577,6 +648,14 @@ struct nd_opt_rdnss { /* followed by one or more IPv6 addresses */ } __attribute__ ((packed)); +struct nd_opt_dnssl { + uint8_t nd_opt_dnssl_type; + uint8_t nd_opt_dnssl_len; + uint16_t nd_opt_dnssl_reserved1; + uint32_t nd_opt_dnssl_lifetime; + /* followed by one or more suffixes */ +} __attribute__ ((packed)); + static gboolean process_nduseropt_rdnss (NMIP6Device *device, struct nd_opt_hdr *opt) { @@ -669,6 +748,149 @@ process_nduseropt_rdnss (NMIP6Device *device, struct nd_opt_hdr *opt) return changed; } +static const char * +parse_dnssl_domain (const unsigned char *buffer, size_t maxlen) +{ + static char domain[256]; + size_t label_len; + + domain[0] = '\0'; + + while (maxlen > 0) { + label_len = *buffer; + buffer++; + maxlen--; + + if (label_len == 0) + return domain; + + if (label_len > maxlen) + return NULL; + if ((sizeof (domain) - strlen (domain)) < (label_len + 2)) + return NULL; + + if (domain[0] != '\0') + strcat (domain, "."); + strncat (domain, (const char *)buffer, label_len); + buffer += label_len; + maxlen -= label_len; + } + + return NULL; +} + +static gboolean +process_nduseropt_dnssl (NMIP6Device *device, struct nd_opt_hdr *opt) +{ + size_t opt_len; + struct nd_opt_dnssl *dnssl_opt; + unsigned char *opt_ptr; + time_t now = time (NULL); + GArray *new_domains; + NMIP6DNSSL domain, *cur_domain; + gboolean changed; + guint i; + + opt_len = opt->nd_opt_len; + + if (opt_len < 2) + return FALSE; + + dnssl_opt = (struct nd_opt_dnssl *) opt; + + opt_ptr = (unsigned char *)(dnssl_opt + 1); + opt_len = (opt_len - 1) * 8; /* prefer bytes for later handling */ + + new_domains = g_array_new (FALSE, FALSE, sizeof (NMIP6DNSSL)); + + changed = FALSE; + + /* Pad the DNS server expiry somewhat to give a bit of slack in cases + * where one RA gets lost or something (which can happen on unreliable + * links like wifi where certain types of frames are not retransmitted). + * Note that 0 has special meaning and is therefore not adjusted. + */ + domain.expires = ntohl (dnssl_opt->nd_opt_dnssl_lifetime); + if (domain.expires > 0) + domain.expires += now + 10; + + while (opt_len) { + const char *domain_str; + + domain_str = parse_dnssl_domain (opt_ptr, opt_len); + if (domain_str == NULL) { + nm_log_dbg (LOGD_IP6, "(%s): invalid DNSSL option, parsing aborted", + device->iface); + break; + } + + /* The DNSSL encoding of domains happen to occupy the same size + * as the length of the resulting string, including terminating + * null. */ + opt_ptr += strlen (domain_str) + 1; + opt_len -= strlen (domain_str) + 1; + + /* Ignore empty domains. They're probably just padding... */ + if (domain_str[0] == '\0') + continue; + + for (i = 0; i < device->dnssl_domains->len; i++) { + cur_domain = &(g_array_index (device->dnssl_domains, NMIP6DNSSL, i)); + + if (strcmp (domain_str, cur_domain->domain) != 0) + continue; + + cur_domain->expires = domain.expires; + + if (domain.expires > 0) { + nm_log_dbg (LOGD_IP6, "(%s): refreshing RA-provided domain %s (expires in %d seconds)", + device->iface, domain_str, + domain.expires - now); + break; + } + + nm_log_dbg (LOGD_IP6, "(%s): removing RA-provided domain %s on router request", + device->iface, domain_str); + + g_array_remove_index (device->dnssl_domains, i); + changed = TRUE; + break; + } + + if (domain.expires == 0) + continue; + if (i < device->dnssl_domains->len) + continue; + + nm_log_dbg (LOGD_IP6, "(%s): found RA-provided domain %s (expires in %d seconds)", + device->iface, domain_str, domain.expires - now); + + g_assert (strlen (domain_str) < sizeof (domain.domain)); + strcpy (domain.domain, domain_str); + g_array_append_val (new_domains, domain); + } + + /* New domains must be added in the order they are listed in the + * RA option and before any existing domains. + * + * Note: This is the place to remove domains if we want to cap the + * number of domains. The RFC states that the one to expire + * first of the existing domains should be removed. + */ + if (new_domains->len) { + g_array_prepend_vals (device->dnssl_domains, + new_domains->data, new_domains->len); + changed = TRUE; + } + + g_array_free (new_domains, TRUE); + + /* Timeouts may have changed even if domains didn't */ + set_dnssl_timeout (device); + + return changed; +} + static NMIP6Device * process_nduseropt (NMIP6Manager *manager, struct nl_msg *msg) { @@ -708,6 +930,9 @@ process_nduseropt (NMIP6Manager *manager, struct nl_msg *msg) case ND_OPT_RDNSS: changed = process_nduseropt_rdnss (device, opt); break; + case ND_OPT_DNSSL: + changed = process_nduseropt_dnssl (device, opt); + break; } opts_len -= opt->nd_opt_len << 3; @@ -1049,6 +1274,14 @@ nm_ip6_manager_get_ip6_config (NMIP6Manager *manager, int ifindex) nm_ip6_config_add_nameserver (config, &rdnss[i].addr); } + /* Add DNS domains */ + if (device->dnssl_domains) { + NMIP6DNSSL *dnssl = (NMIP6DNSSL *)(device->dnssl_domains->data); + + for (i = 0; i < device->dnssl_domains->len; i++) + nm_ip6_config_add_domain (config, dnssl[i].domain); + } + return config; } -- cgit v1.2.1 From 9c7afa193c4c031e4cf9f2d7a2422afcb34ac4f9 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 15 Dec 2010 17:52:55 -0600 Subject: libnm-glib: fix export of NMDHCP6Config symbols Found by Giovanni Campagna --- libnm-glib/libnm-glib.ver | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libnm-glib/libnm-glib.ver b/libnm-glib/libnm-glib.ver index 1596afaad9..0691ad9d03 100644 --- a/libnm-glib/libnm-glib.ver +++ b/libnm-glib/libnm-glib.ver @@ -95,6 +95,10 @@ global: nm_dhcp4_config_get_options; nm_dhcp4_config_get_type; nm_dhcp4_config_new; + nm_dhcp6_config_get_one_option; + nm_dhcp6_config_get_options; + nm_dhcp6_config_get_type; + nm_dhcp6_config_new; nm_exported_connection_export; nm_exported_connection_get_type; nm_exported_connection_new; -- cgit v1.2.1 From 7e5ab41d134a42be4d7d50e6b98b26dc270fa7d8 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 15 Dec 2010 18:03:49 -0600 Subject: build: remove random leftover bits of GConf stuff --- configure.ac | 2 +- libnm-glib/Makefile.am | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 9cb0e9c49c..0665886927 100644 --- a/configure.ac +++ b/configure.ac @@ -30,7 +30,7 @@ AC_SUBST([ACLOCAL_AMFLAGS]) dnl maintainer mode stuff if test $USE_MAINTAINER_MODE = yes; then - DISABLE_DEPRECATED="-DG_DISABLE_DEPRECATED -DGCONF_DISABLE_DEPRECATED" + DISABLE_DEPRECATED="-DG_DISABLE_DEPRECATED" else DISABLE_DEPRECATED="" fi diff --git a/libnm-glib/Makefile.am b/libnm-glib/Makefile.am index ec21a328e9..66b1c9fee6 100644 --- a/libnm-glib/Makefile.am +++ b/libnm-glib/Makefile.am @@ -52,7 +52,6 @@ lib_LTLIBRARIES = libnm-glib.la libnm-glib-vpn.la libnm_glib_la_CFLAGS = \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ - $(GCONF_CFLAGS) \ $(GUDEV_CFLAGS) libnmincludedir = $(includedir)/libnm-glib @@ -128,7 +127,6 @@ libnm_glib_la_LIBADD = \ $(builddir)/libdeprecated-nm-glib.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ - $(GCONF_LIBS) \ $(GUDEV_LIBS) libnm_glib_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-glib.ver \ -- cgit v1.2.1 From b3800183b434bbaf90d627a2e44c631cf04e8b71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Thu, 16 Dec 2010 13:49:28 +0100 Subject: libnm-util: fix nm_utils_security_valid() checks for Ad-Hoc APs (rh #632123) Without the fix fake Ad-Hoc APs created by nm-applet's "Create New Wireless Network..." don't pass the check and nm-applet can crash. --- libnm-util/nm-utils.c | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c index ce13da3c86..9c3662f47f 100644 --- a/libnm-util/nm-utils.c +++ b/libnm-util/nm-utils.c @@ -1269,14 +1269,24 @@ nm_utils_security_valid (NMUtilsSecurityType type, if (!(wifi_caps & NM_WIFI_DEVICE_CAP_WPA)) return FALSE; if (have_ap) { - /* Ad-Hoc WPA APs won't necessarily have the PSK flag set */ - if ((ap_wpa & NM_802_11_AP_SEC_KEY_MGMT_PSK) || adhoc) { - if ( (ap_wpa & NM_802_11_AP_SEC_PAIR_TKIP) + /* Ad-Hoc WPA APs won't necessarily have the PSK flag set, and + * they don't have any pairwise ciphers. */ + if (adhoc) { + if ( (ap_wpa & NM_802_11_AP_SEC_GROUP_TKIP) && (wifi_caps & NM_WIFI_DEVICE_CAP_CIPHER_TKIP)) return TRUE; - if ( (ap_wpa & NM_802_11_AP_SEC_PAIR_CCMP) + if ( (ap_wpa & NM_802_11_AP_SEC_GROUP_CCMP) && (wifi_caps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP)) return TRUE; + } else { + if (ap_wpa & NM_802_11_AP_SEC_KEY_MGMT_PSK) { + if ( (ap_wpa & NM_802_11_AP_SEC_PAIR_TKIP) + && (wifi_caps & NM_WIFI_DEVICE_CAP_CIPHER_TKIP)) + return TRUE; + if ( (ap_wpa & NM_802_11_AP_SEC_PAIR_CCMP) + && (wifi_caps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP)) + return TRUE; + } } return FALSE; } @@ -1285,14 +1295,22 @@ nm_utils_security_valid (NMUtilsSecurityType type, if (!(wifi_caps & NM_WIFI_DEVICE_CAP_RSN)) return FALSE; if (have_ap) { - /* Ad-Hoc WPA APs won't necessarily have the PSK flag set */ - if ((ap_rsn & NM_802_11_AP_SEC_KEY_MGMT_PSK) || adhoc) { - if ( (ap_rsn & NM_802_11_AP_SEC_PAIR_TKIP) - && (wifi_caps & NM_WIFI_DEVICE_CAP_CIPHER_TKIP)) + /* Ad-Hoc WPA APs won't necessarily have the PSK flag set, and + * they don't have any pairwise ciphers, nor any RSA flags yet. */ + if (adhoc) { + if (wifi_caps & NM_WIFI_DEVICE_CAP_CIPHER_TKIP) return TRUE; - if ( (ap_rsn & NM_802_11_AP_SEC_PAIR_CCMP) - && (wifi_caps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP)) + if (wifi_caps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP) return TRUE; + } else { + if (ap_rsn & NM_802_11_AP_SEC_KEY_MGMT_PSK) { + if ( (ap_rsn & NM_802_11_AP_SEC_PAIR_TKIP) + && (wifi_caps & NM_WIFI_DEVICE_CAP_CIPHER_TKIP)) + return TRUE; + if ( (ap_rsn & NM_802_11_AP_SEC_PAIR_CCMP) + && (wifi_caps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP)) + return TRUE; + } } return FALSE; } -- cgit v1.2.1 From 6f37a967eb3d6e7463672a1d72fa3d4f71ac5228 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 16 Dec 2010 17:47:59 -0600 Subject: dns: direct IPv4 reverse DNS queries to split DNS servers When split DNS is used for a local caching nameserver, make sure that reverse DNS queries for hosts within the VPN tunnel are directed to the VPN's nameservers, not to the public upstream nameservers. --- src/dns-manager/Makefile.am | 4 +- src/dns-manager/nm-dns-dnsmasq.c | 22 +++++++-- src/dns-manager/nm-dns-utils.c | 99 ++++++++++++++++++++++++++++++++++++++++ src/dns-manager/nm-dns-utils.h | 28 ++++++++++++ 4 files changed, 148 insertions(+), 5 deletions(-) create mode 100644 src/dns-manager/nm-dns-utils.c create mode 100644 src/dns-manager/nm-dns-utils.h diff --git a/src/dns-manager/Makefile.am b/src/dns-manager/Makefile.am index 1ffe62dcf0..7b5fc4f847 100644 --- a/src/dns-manager/Makefile.am +++ b/src/dns-manager/Makefile.am @@ -14,7 +14,9 @@ libdns_manager_la_SOURCES = \ nm-dns-dnsmasq.h \ nm-dns-dnsmasq.c \ nm-dns-bind.h \ - nm-dns-bind.c + nm-dns-bind.c \ + nm-dns-utils.h \ + nm-dns-utils.c libdns_manager_la_CPPFLAGS = \ $(DBUS_CFLAGS) \ diff --git a/src/dns-manager/nm-dns-dnsmasq.c b/src/dns-manager/nm-dns-dnsmasq.c index 41c8e2a642..9cc019780b 100644 --- a/src/dns-manager/nm-dns-dnsmasq.c +++ b/src/dns-manager/nm-dns-dnsmasq.c @@ -33,6 +33,7 @@ #include "nm-logging.h" #include "nm-ip4-config.h" #include "nm-ip6-config.h" +#include "nm-dns-utils.h" G_DEFINE_TYPE (NMDnsDnsmasq, nm_dns_dnsmasq, NM_TYPE_DNS_PLUGIN) @@ -75,9 +76,11 @@ add_ip4_config (GString *str, NMIP4Config *ip4, gboolean split) gboolean added = FALSE; if (split) { + char **domains, **iter; + /* FIXME: it appears that dnsmasq can only handle one nameserver - * per domain (at the manpage seems to indicate that) so only use - * the first nameserver here. + * per domain (and the manpage says this too) so only use the first + * nameserver here. */ addr.s_addr = nm_ip4_config_get_nameserver (ip4, 0); memset (&buf[0], 0, sizeof (buf)); @@ -103,6 +106,17 @@ add_ip4_config (GString *str, NMIP4Config *ip4, gboolean split) added = TRUE; } } + + /* Ensure reverse-DNS works by directing queries for in-addr.arpa + * domains to the split domain's nameserver. + */ + domains = nm_dns_utils_get_ip4_rdns_domains (ip4); + if (domains) { + for (iter = domains; iter && *iter; iter++) + g_string_append_printf (str, "server=/%s/%s\n", *iter, buf); + g_strfreev (domains); + added = TRUE; + } } /* If no searches or domains, just add the namservers */ @@ -216,7 +230,7 @@ update (NMDnsPlugin *plugin, } /* Now add interface configs without split DNS */ - for (iter = (GSList *) dev_configs; iter;iter = g_slist_next (iter)) { + for (iter = (GSList *) dev_configs; iter; iter = g_slist_next (iter)) { if (NM_IS_IP4_CONFIG (iter->data)) add_ip4_config (conf, NM_IP4_CONFIG (iter->data), FALSE); else if (NM_IS_IP6_CONFIG (iter->data)) @@ -224,7 +238,7 @@ update (NMDnsPlugin *plugin, } /* And any other random configs */ - for (iter = (GSList *) other_configs; iter;iter = g_slist_next (iter)) { + for (iter = (GSList *) other_configs; iter; iter = g_slist_next (iter)) { if (NM_IS_IP4_CONFIG (iter->data)) add_ip4_config (conf, NM_IP4_CONFIG (iter->data), FALSE); else if (NM_IS_IP6_CONFIG (iter->data)) diff --git a/src/dns-manager/nm-dns-utils.c b/src/dns-manager/nm-dns-utils.c new file mode 100644 index 0000000000..615adfd151 --- /dev/null +++ b/src/dns-manager/nm-dns-utils.c @@ -0,0 +1,99 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2010 Red Hat, Inc. + * + */ + +#include +#include + +#include "nm-dns-utils.h" +#include "nm-utils.h" + +static void +add_ip4_to_rdns_array (guint32 ip, GPtrArray *domains) /* network byte order */ +{ + guint32 defprefix; + guchar *p; + char *str = NULL; + int i; + + defprefix = nm_utils_ip4_get_default_prefix (ip); + + /* Convert to host byte order, mask the host bits, and convert back */ + ip = ntohl (ip); + ip &= 0xFFFFFFFF << (32 - defprefix); + ip = htonl (ip); + p = (guchar *) &ip; + + if (defprefix == 8) + str = g_strdup_printf ("%u.in-addr.arpa", p[0] & 0xFF); + else if (defprefix == 16) + str = g_strdup_printf ("%u.%u.in-addr.arpa", p[1] & 0xFF, p[0] & 0xFF); + else if (defprefix == 24) + str = g_strdup_printf ("%u.%u.%u.in-addr.arpa", p[2] & 0xFF, p[1] & 0xFF, p[0] & 0xFF); + + g_return_if_fail (str != NULL); + + /* Suppress duplicates */ + for (i = 0; i < domains->len; i++) { + if (strcmp (str, g_ptr_array_index (domains, i)) == 0) + break; + } + + if (i == domains->len) + g_ptr_array_add (domains, str); + else + g_free (str); +} + +char ** +nm_dns_utils_get_ip4_rdns_domains (NMIP4Config *ip4) +{ + GPtrArray *domains = NULL; + int i; + + g_return_val_if_fail (ip4 != NULL, NULL); + + domains = g_ptr_array_sized_new (5); + + /* To calculate the reverse DNS domains for this IP4 config, we take + * all the IP addresses and routes in the config, calculate the network + * portion, and convert that to classful, and use the network bits for + * the final domain. FIXME: better handle classless routing, which might + * require us to add multiple domains for each actual network prefix to + * cover all the separate networks in that block. + */ + + for (i = 0; i < nm_ip4_config_get_num_addresses (ip4); i++) { + NMIP4Address *addr = nm_ip4_config_get_address (ip4, i); + + add_ip4_to_rdns_array (nm_ip4_address_get_address (addr), domains); + } + + for (i = 0; i < nm_ip4_config_get_num_routes (ip4); i++) { + NMIP4Route *route = nm_ip4_config_get_route (ip4, i); + + add_ip4_to_rdns_array (nm_ip4_route_get_dest (route), domains); + } + + /* Terminating NULL so we can use g_strfreev() to free it */ + g_ptr_array_add (domains, NULL); + + /* Free the array and return NULL if the only element was the ending NULL */ + return (char **) g_ptr_array_free (domains, (domains->len == 1)); +} + diff --git a/src/dns-manager/nm-dns-utils.h b/src/dns-manager/nm-dns-utils.h new file mode 100644 index 0000000000..daa6711cce --- /dev/null +++ b/src/dns-manager/nm-dns-utils.h @@ -0,0 +1,28 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2010 Red Hat, Inc. + * + */ + +#ifndef NM_DNS_UTILS_H +#define NM_DNS_UTILS_H + +#include "nm-ip4-config.h" + +char **nm_dns_utils_get_ip4_rdns_domains (NMIP4Config *ip4); + +#endif /* NM_DNS_UTILS_H */ + -- cgit v1.2.1 From 592a1d46680367130274b3bb94c6ff6f553bf2e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Fri, 17 Dec 2010 11:37:10 +0100 Subject: cli: add D-Bus object path field for APs (e.g.:nmcli -f NAME,SSID,BSSID,SIGNAL,DBUS-PATH dev wifi list) --- cli/src/devices.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/src/devices.c b/cli/src/devices.c index 436b4b6eb8..12da386c4d 100644 --- a/cli/src/devices.c +++ b/cli/src/devices.c @@ -184,9 +184,10 @@ static NmcOutputField nmc_fields_dev_wifi_list[] = { {"RSN-FLAGS", N_("RSN-FLAGS"), 25, NULL, 0}, /* 9 */ {"DEVICE", N_("DEVICE"), 10, NULL, 0}, /* 10 */ {"ACTIVE", N_("ACTIVE"), 8, NULL, 0}, /* 11 */ + {"DBUS-PATH", N_("DBUS-PATH"), 46, NULL, 0}, /* 12 */ {NULL, NULL, 0, NULL, 0} }; -#define NMC_FIELDS_DEV_WIFI_LIST_ALL "SSID,BSSID,MODE,FREQ,RATE,SIGNAL,SECURITY,WPA-FLAGS,RSN-FLAGS,DEVICE,ACTIVE" +#define NMC_FIELDS_DEV_WIFI_LIST_ALL "SSID,BSSID,MODE,FREQ,RATE,SIGNAL,SECURITY,WPA-FLAGS,RSN-FLAGS,DEVICE,ACTIVE,DBUS-PATH" #define NMC_FIELDS_DEV_WIFI_LIST_COMMON "SSID,BSSID,MODE,FREQ,RATE,SIGNAL,SECURITY,ACTIVE" #define NMC_FIELDS_DEV_WIFI_LIST_FOR_DEV_LIST "NAME,"NMC_FIELDS_DEV_WIFI_LIST_COMMON @@ -431,6 +432,7 @@ detail_access_point (gpointer data, gpointer user_data) info->nmc->allowed_fields[9].value = rsn_flags_str; info->nmc->allowed_fields[10].value = info->device; info->nmc->allowed_fields[11].value = active ? _("yes") : _("no"); + info->nmc->allowed_fields[12].value = nm_object_get_path (NM_OBJECT (ap)); info->nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER_ADD & ~NMC_PF_FLAG_MAIN_HEADER_ONLY & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ print_fields (info->nmc->print_fields, info->nmc->allowed_fields); -- cgit v1.2.1 From 570585077950cb59e30a3c2dd4ea19befd80efbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Fri, 17 Dec 2010 13:42:07 +0100 Subject: examples: add C example showing APs' information --- examples/C/Makefile.am | 13 +- examples/C/get-ap-info-libnm-glib.c | 229 ++++++++++++++++++++++++++++++++++++ 2 files changed, 240 insertions(+), 2 deletions(-) create mode 100644 examples/C/get-ap-info-libnm-glib.c diff --git a/examples/C/Makefile.am b/examples/C/Makefile.am index 88f1e48421..a8b5a64075 100644 --- a/examples/C/Makefile.am +++ b/examples/C/Makefile.am @@ -10,7 +10,8 @@ noinst_PROGRAMS = \ add-connection-glib \ get-active-connections \ list-connections-dbus \ - list-connections-libnm-glib + list-connections-libnm-glib \ + get-ap-info-libnm-glib add_connection_glib_SOURCES = add-connection-glib.c add_connection_glib_LDADD = \ @@ -37,9 +38,17 @@ list_connections_libnm_glib_LDADD = \ $(DBUS_LIBS) \ $(GLIB_LIBS) +get_ap_info_libnm_glib_SOURCES = get-ap-info-libnm-glib.c +get_ap_info_libnm_glib_LDADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + EXTRA_DIST = \ add-connection-glib.c \ get-active-connections.c \ list-connections-dbus.c \ - list-connections-libnm-glib.c + list-connections-libnm-glib.c \ + get-ap-info-libnm-glib.c diff --git a/examples/C/get-ap-info-libnm-glib.c b/examples/C/get-ap-info-libnm-glib.c new file mode 100644 index 0000000000..6ff310d821 --- /dev/null +++ b/examples/C/get-ap-info-libnm-glib.c @@ -0,0 +1,229 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +/* + * The example shows how to get info about APs visible by Wi-Fi devices + * using libnm-glib (that wraps direct D-Bus calls). + * The example uses dbus-glib, libnm-util and libnm-glib libraries. + * + * Compile with: + * gcc -Wall `pkg-config --libs --cflags glib-2.0 dbus-glib-1 libnm-util libnm-glib` get-ap-info-libnm-glib.c -o get-ap-info-libnm-glib + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +/* Convert flags to string */ +static char * +ap_wpa_rsn_flags_to_string (guint32 flags) +{ + char *flags_str[16]; /* Enough space for flags and terminating NULL */ + char *ret_str; + int i = 0; + + if (flags & NM_802_11_AP_SEC_PAIR_WEP40) + flags_str[i++] = g_strdup ("pair_wpe40"); + if (flags & NM_802_11_AP_SEC_PAIR_WEP104) + flags_str[i++] = g_strdup ("pair_wpe104"); + if (flags & NM_802_11_AP_SEC_PAIR_TKIP) + flags_str[i++] = g_strdup ("pair_tkip"); + if (flags & NM_802_11_AP_SEC_PAIR_CCMP) + flags_str[i++] = g_strdup ("pair_ccmp"); + if (flags & NM_802_11_AP_SEC_GROUP_WEP40) + flags_str[i++] = g_strdup ("group_wpe40"); + if (flags & NM_802_11_AP_SEC_GROUP_WEP104) + flags_str[i++] = g_strdup ("group_wpe104"); + if (flags & NM_802_11_AP_SEC_GROUP_TKIP) + flags_str[i++] = g_strdup ("group_tkip"); + if (flags & NM_802_11_AP_SEC_GROUP_CCMP) + flags_str[i++] = g_strdup ("group_ccmp"); + if (flags & NM_802_11_AP_SEC_KEY_MGMT_PSK) + flags_str[i++] = g_strdup ("psk"); + if (flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X) + flags_str[i++] = g_strdup ("802.1X"); + + if (i == 0) + flags_str[i++] = g_strdup ("none"); + + flags_str[i] = NULL; + + ret_str = g_strjoinv (" ", flags_str); + + i = 0; + while (flags_str[i]) + g_free (flags_str[i++]); + + return ret_str; +} + +static void +show_access_point_info (NMAccessPoint *ap) +{ + guint32 flags, wpa_flags, rsn_flags, freq, bitrate; + guint8 strength; + const GByteArray *ssid; + const char *hwaddr; + NM80211Mode mode; + char *freq_str, *ssid_str, *bitrate_str, *strength_str, *wpa_flags_str, *rsn_flags_str; + GString *security_str; + + /* Get AP properties */ + flags = nm_access_point_get_flags (ap); + wpa_flags = nm_access_point_get_wpa_flags (ap); + rsn_flags = nm_access_point_get_rsn_flags (ap); + ssid = nm_access_point_get_ssid (ap); + hwaddr = nm_access_point_get_hw_address (ap); + freq = nm_access_point_get_frequency (ap); + mode = nm_access_point_get_mode (ap); + bitrate = nm_access_point_get_max_bitrate (ap); + strength = nm_access_point_get_strength (ap); + + /* Convert to strings */ + ssid_str = nm_utils_ssid_to_utf8 ((const char *) ssid->data, ssid->len); + freq_str = g_strdup_printf ("%u MHz", freq); + bitrate_str = g_strdup_printf ("%u MB/s", bitrate/1000); + strength_str = g_strdup_printf ("%u", strength); + wpa_flags_str = ap_wpa_rsn_flags_to_string (wpa_flags); + rsn_flags_str = ap_wpa_rsn_flags_to_string (rsn_flags); + + security_str = g_string_new (NULL); + if ( !(flags & NM_802_11_AP_FLAGS_PRIVACY) + && (wpa_flags != NM_802_11_AP_SEC_NONE) + && (rsn_flags != NM_802_11_AP_SEC_NONE)) + g_string_append (security_str, "Encrypted: "); + + if ( (flags & NM_802_11_AP_FLAGS_PRIVACY) + && (wpa_flags == NM_802_11_AP_SEC_NONE) + && (rsn_flags == NM_802_11_AP_SEC_NONE)) + g_string_append (security_str, "WEP "); + if (wpa_flags != NM_802_11_AP_SEC_NONE) + g_string_append (security_str, "WPA "); + if (rsn_flags != NM_802_11_AP_SEC_NONE) + g_string_append (security_str, "WPA2 "); + if ( (wpa_flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X) + || (rsn_flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X)) + g_string_append (security_str, "Enterprise "); + + if (security_str->len > 0) + g_string_truncate (security_str, security_str->len-1); /* Chop off last space */ + + printf ("SSID: %s\n", ssid_str); + printf ("BSSID: %s\n", hwaddr); + printf ("Mode: %s\n", mode == NM_802_11_MODE_ADHOC ? "Ad-Hoc" : mode == NM_802_11_MODE_INFRA ? "Infrastructure" : "Unknown"); + printf ("Freq: %s\n", freq_str); + printf ("Bitrate: %s\n", bitrate_str); + printf ("Strength: %s\n", strength_str); + printf ("Security: %s\n", security_str->str); + printf ("WPA flags: %s\n", wpa_flags_str); + printf ("RSN flags: %s\n", rsn_flags_str); + printf ("D-Bus path: %s\n\n", nm_object_get_path (NM_OBJECT (ap))); + + g_free (ssid_str); + g_free (freq_str); + g_free (bitrate_str); + g_free (strength_str); + g_free (wpa_flags_str); + g_free (rsn_flags_str); + g_string_free (security_str, TRUE); +} + +static void +show_wifi_device_info (NMDevice *device) +{ + NMAccessPoint *active_ap = NULL; + const GPtrArray *aps; + const char *iface; + const char *driver; + guint32 speed; + const GByteArray *active_ssid; + char *active_ssid_str = NULL; + int i; + + /* Get active AP */ + if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) { + if ((active_ap = nm_device_wifi_get_active_access_point (NM_DEVICE_WIFI (device)))) { + active_ssid = nm_access_point_get_ssid (active_ap); + active_ssid_str = nm_utils_ssid_to_utf8 ((const char *) active_ssid->data, active_ssid->len); + } + } + + iface = nm_device_get_iface (device); + driver = nm_device_get_driver (device); + speed = nm_device_wifi_get_bitrate (NM_DEVICE_WIFI (device)); + speed /= 1000; + + printf ("Device: %s ---- Driver: %s ---- Speed: %d MB/s ---- Active AP: %s\n", + iface, driver, speed, active_ssid_str ? active_ssid_str : "none"); + printf ("=================================================================================\n"); + g_free (active_ssid_str); + + /* Get all APs of the Wi-Fi device */ + aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (device)); + + /* Print AP details */ + for (i = 0; aps && (i < aps->len); i++) { + NMAccessPoint *ap = g_ptr_array_index (aps, i); + show_access_point_info (ap); + } +} + +int main (int argc, char *argv[]) +{ + DBusGConnection *bus; + NMClient *client; + const GPtrArray *devices; + int i; + + /* Initialize GType system */ + g_type_init (); + + /* Get system bus */ + bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL); + + /* Get NMClient object */ + client = nm_client_new (); + if (!client) { + dbus_g_connection_unref (bus); + g_message ("Error: Could not create NMClient."); + return EXIT_FAILURE; + } + + /* Get all devices managed by NetworkManager */ + devices = nm_client_get_devices (client); + + /* Go through the array and process Wi-Fi devices */ + for (i = 0; devices && (i < devices->len); i++) { + NMDevice *device = g_ptr_array_index (devices, i); + if (NM_IS_DEVICE_WIFI (device)) + show_wifi_device_info (device); + } + + g_object_unref (client); + dbus_g_connection_unref (bus); + + return EXIT_SUCCESS; +} -- cgit v1.2.1 From 39eed50e470d6f41222e40ce0276b898e8c84dc4 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 17 Dec 2010 09:22:11 -0600 Subject: policy: stop touching /etc/hosts Handling of /etc/hosts is highly site- and admin- specific in many more complex cases, and it's exceedingly hard and error- prone for NetworkManager to handle all those cases. So remove this functionality entirely. That's not a big loss, as it turns out there's a much more elegant solution. The only requirement is that the machine's hostname map back to an IP address owned by the machine. That requirement can be satisifed by nss-myhostname or even possibly the distro's installer. If the user does not want nss-myhostname then it can be uninstalled. Distros should use a "recommends" feature in their packaging system so that the NetworkManager package does *not* have a hard requirement on nss-myhostname. Thus everyone is happy; things Just Work when nss-myhostname is installed, but more advanced users can uninstall it and customize /etc/hosts as they wish. Another alternative is a dispatcher script that listents for the 'hostname' event, and updates /etc/hosts according to the administrator's preference. --- src/main.c | 4 + src/nm-policy-hostname.c | 56 +--- src/nm-policy-hostname.h | 5 +- src/nm-policy-hosts.c | 520 ++--------------------------- src/nm-policy-hosts.h | 20 +- src/nm-policy.c | 42 +-- src/tests/test-policy-hosts.c | 761 ++---------------------------------------- 7 files changed, 76 insertions(+), 1332 deletions(-) diff --git a/src/main.c b/src/main.c index 7a8e7e88ee..5591c505ce 100644 --- a/src/main.c +++ b/src/main.c @@ -49,6 +49,7 @@ #include "nm-netlink-monitor.h" #include "nm-vpn-manager.h" #include "nm-logging.h" +#include "nm-policy-hosts.h" #if !defined(NM_DIST_VERSION) # define NM_DIST_VERSION VERSION @@ -717,6 +718,9 @@ main (int argc, char *argv[]) goto done; } + /* Clean leftover "# Added by NetworkManager" entries from /etc/hosts */ + nm_policy_hosts_clean_etc_hosts (); + nm_manager_start (manager); /* Bring up the loopback interface. */ diff --git a/src/nm-policy-hostname.c b/src/nm-policy-hostname.c index 42a2e0f9a4..4fe69c5a9b 100644 --- a/src/nm-policy-hostname.c +++ b/src/nm-policy-hostname.c @@ -30,7 +30,6 @@ #include "nm-logging.h" #include "nm-policy-hostname.h" -#include "nm-policy-hosts.h" /************************************************************************/ @@ -206,74 +205,39 @@ hostname_thread_is_dead (HostnameThread *ht) /************************************************************************/ #define FALLBACK_HOSTNAME4 "localhost.localdomain" -#define FALLBACK_HOSTNAME6 "localhost6.localdomain6" gboolean -nm_policy_set_system_hostname (const char *new_hostname, - const char *ip4_addr, - const char *ip6_addr, - const char *msg) +nm_policy_set_system_hostname (const char *new_hostname, const char *msg) { char old_hostname[HOST_NAME_MAX + 1]; - int ret = 0; const char *name; - gboolean set_hostname = TRUE, changed = FALSE, old_valid = TRUE; + int ret; if (new_hostname) g_warn_if_fail (strlen (new_hostname)); - name = (new_hostname && strlen (new_hostname)) ? new_hostname : FALLBACK_HOSTNAME4; - old_hostname[HOST_NAME_MAX] = '\0'; errno = 0; ret = gethostname (old_hostname, HOST_NAME_MAX); if (ret != 0) { nm_log_warn (LOGD_DNS, "couldn't get the system hostname: (%d) %s", errno, strerror (errno)); - old_valid = FALSE; } else { /* Don't set the hostname if it isn't actually changing */ if ( (new_hostname && !strcmp (old_hostname, new_hostname)) || (!new_hostname && !strcmp (old_hostname, FALLBACK_HOSTNAME4))) - set_hostname = FALSE; - - if (old_hostname[0] == '\0') - old_valid = FALSE; - } - - if (set_hostname) { - nm_log_info (LOGD_DNS, "Setting system hostname to '%s' (%s)", name, msg); - ret = sethostname (name, strlen (name)); - if (ret != 0) { - nm_log_warn (LOGD_DNS, "couldn't set the system hostname to '%s': (%d) %s", - name, errno, strerror (errno)); return FALSE; - } } - /* But even if the hostname isn't changing, always try updating /etc/hosts - * just in case the hostname changed while NM wasn't running; we need to - * make sure that /etc/hosts has valid mappings for '127.0.0.1' and the - * current system hostname. If those exist, - * nm_policy_hosts_update_etc_hosts() will just return and won't touch - * /etc/hosts at all. - */ - if (!nm_policy_hosts_update_etc_hosts (name, - old_valid ? old_hostname : NULL, - FALLBACK_HOSTNAME4, - FALLBACK_HOSTNAME6, - ip4_addr, - ip6_addr, - &changed)) { - /* error updating /etc/hosts; fallback to localhost.localdomain */ - nm_log_info (LOGD_DNS, "Setting system hostname to '" FALLBACK_HOSTNAME4 "' (error updating /etc/hosts)"); - ret = sethostname (FALLBACK_HOSTNAME4, strlen (FALLBACK_HOSTNAME4)); - if (ret != 0) { - nm_log_warn (LOGD_DNS, "couldn't set the fallback system hostname (%s): (%d) %s", - FALLBACK_HOSTNAME4, errno, strerror (errno)); - } + name = (new_hostname && strlen (new_hostname)) ? new_hostname : FALLBACK_HOSTNAME4; + + nm_log_info (LOGD_DNS, "Setting system hostname to '%s' (%s)", name, msg); + ret = sethostname (name, strlen (name)); + if (ret != 0) { + nm_log_warn (LOGD_DNS, "couldn't set the system hostname to '%s': (%d) %s", + name, errno, strerror (errno)); } - return changed; + return (ret == 0); } diff --git a/src/nm-policy-hostname.h b/src/nm-policy-hostname.h index 9c76884726..e76713f16d 100644 --- a/src/nm-policy-hostname.h +++ b/src/nm-policy-hostname.h @@ -24,10 +24,7 @@ #include -gboolean nm_policy_set_system_hostname (const char *new_hostname, - const char *ip4_addr, - const char *ip6_addr, - const char *msg); +gboolean nm_policy_set_system_hostname (const char *new_hostname, const char *msg); typedef struct HostnameThread HostnameThread; diff --git a/src/nm-policy-hosts.c b/src/nm-policy-hosts.c index 7f9cff8074..8bbd1d3b5f 100644 --- a/src/nm-policy-hosts.c +++ b/src/nm-policy-hosts.c @@ -20,526 +20,74 @@ #include #include -#include -#include -#include -#include -#include #include "nm-policy-hosts.h" #include "nm-logging.h" -#define IP4_LH "127.0.0.1" -#define IP6_LH "::1" - -gboolean -nm_policy_hosts_find_token (const char *line, const char *token) -{ - const char *start = line, *p = line; - - g_return_val_if_fail (line != NULL, FALSE); - g_return_val_if_fail (token != NULL, FALSE); - g_return_val_if_fail (strlen (token) > 0, FALSE); - - /* Walk through the line to find the next whitespace character */ - while (p <= line + strlen (line)) { - if (isblank (*p) || (*p == '\0')) { - /* Token starts with 'start' and ends with 'end' */ - if ((p > start) && *start && (p - start == strlen (token)) && !strncmp (start, token, (p - start))) - return TRUE; /* found */ - - /* not found; advance start and continue looking */ - start = p + 1; - } - p++; - } - - return FALSE; -} - -static gboolean -is_local_mapping (const char *str, gboolean ip6, const char *hostname) -{ - const char *addr = ip6 ? IP6_LH : IP4_LH; - const char *fallback = ip6 ? "localhost6" : "localhost"; - - return ( !strncmp (str, addr, strlen (addr)) - && nm_policy_hosts_find_token (str, hostname ? hostname : fallback)); -} - -static gboolean -is_ip4_addr (const char *str) -{ - struct in_addr found; - char buf[INET_ADDRSTRLEN + 2]; - const char *p = str; - guint32 i = 0; - - memset (buf, 0, sizeof (buf)); - while (*p && !isblank (*p) && (i < sizeof (buf))) - buf[i++] = *p++; - - return inet_pton (AF_INET, buf, &found) == 1 ? TRUE : FALSE; -} - -static gboolean -ip4_addr_matches (const char *str, const char *ip4_addr) -{ - struct in_addr found, given; - char buf[INET_ADDRSTRLEN + 2]; - const char *p = str; - guint32 i = 0; - - g_return_val_if_fail (ip4_addr != NULL, FALSE); - - memset (buf, 0, sizeof (buf)); - while (*p && !isblank (*p) && (i < sizeof (buf))) - buf[i++] = *p++; - - if (inet_pton (AF_INET, buf, &found) != 1) - return FALSE; - if (inet_pton (AF_INET, ip4_addr, &given) != 1) - return FALSE; - - return memcmp (&found, &given, sizeof (found)) == 0; -} - -static gboolean -is_ip6_addr (const char *str) -{ - struct in6_addr found; - char buf[INET6_ADDRSTRLEN + 2]; - const char *p = str; - guint32 i = 0; - - memset (buf, 0, sizeof (buf)); - while (*p && !isblank (*p) && (i < sizeof (buf))) - buf[i++] = *p++; - - return inet_pton (AF_INET6, buf, &found) == 1 ? TRUE : FALSE; -} - -static gboolean -ip6_addr_matches (const char *str, const char *ip6_addr) -{ - struct in6_addr found, given; - char buf[INET6_ADDRSTRLEN + 2]; - const char *p = str; - guint32 i = 0; - - g_return_val_if_fail (ip6_addr != NULL, FALSE); - - memset (buf, 0, sizeof (buf)); - while (*p && !isblank (*p) && (i < sizeof (buf))) - buf[i++] = *p++; - - if (inet_pton (AF_INET6, buf, &found) != 1) - return FALSE; - if (inet_pton (AF_INET6, ip6_addr, &given) != 1) - return FALSE; - - return memcmp (&found, &given, sizeof (found)) == 0; -} - -static char * -get_custom_hostnames (const char *line, - const char *hostname, - const char *old_hostname, - const char *short_hostname, - const char *fallback_hostname) -{ - char **items = NULL, **iter; - guint start = 0; - GString *str = NULL; - char *custom = NULL; - - g_return_val_if_fail (line != NULL, NULL); - - if (!strncmp (line, IP4_LH, strlen (IP4_LH))) - start = strlen (IP4_LH); - else if (!strncmp (line, IP6_LH, strlen (IP6_LH))) - start = strlen (IP6_LH); - - g_return_val_if_fail (start > 0, NULL); - - /* Split the line into tokens */ - items = g_strsplit_set (line + start, " \t", -1); - if (!items) - return NULL; - - str = g_string_sized_new (50); - /* Ignore current & old hostnames, and localhost-anything */ - for (iter = items; iter && *iter; iter++) { - if (*iter[0] == '\0') - continue; - if (hostname && !strcmp (*iter, hostname)) - continue; - if (old_hostname && !strcmp (*iter, old_hostname)) - continue; - if (short_hostname && !strcmp (*iter, short_hostname)) - continue; - if (fallback_hostname && !strcmp (*iter, fallback_hostname)) - continue; - if (!strcmp (*iter, "localhost")) - continue; - if (!strcmp (*iter, "localhost6")) - continue; - if (!strcmp (*iter, "localhost.localdomain")) - continue; - if (!strcmp (*iter, "localhost4.localdomain4")) - continue; - if (!strcmp (*iter, "localhost6.localdomain6")) - continue; - - /* Found a custom hostname */ - g_string_append_c (str, '\t'); - g_string_append (str, *iter); - } - - if (str->len) - custom = g_string_free (str, FALSE); - else - g_string_free (str, TRUE); - - g_strfreev (items); - return custom; -} - #define ADDED_TAG "# Added by NetworkManager" GString * -nm_policy_get_etc_hosts (const char **lines, - gsize existing_len, - const char *hostname, - const char *old_hostname, - const char *fallback_hostname4, - const char *fallback_hostname6, - const char *ip4_addr, - const char *ip6_addr, - GError **error) +nm_policy_get_etc_hosts (const char *contents, gsize contents_len) { - GString *contents = NULL; - const char **line; - gboolean found_localhost4 = FALSE; - gboolean found_localhost6 = FALSE; - gboolean found_host4 = FALSE; - gboolean found_host6 = FALSE; - gboolean found_user_host4 = FALSE; - gboolean found_user_host6 = FALSE; - gboolean initial_comments = TRUE; - gboolean added = FALSE; - gboolean hostname4_is_fallback; - gboolean hostname6_is_fallback; - gboolean host4_before = FALSE; - gboolean host6_before = FALSE; - gboolean no_stale = TRUE; - char *short_hostname = NULL; - char *custom4 = NULL; - char *custom6 = NULL; - - g_return_val_if_fail (lines != NULL, FALSE); - g_return_val_if_fail (hostname != NULL, FALSE); - - hostname4_is_fallback = !strcmp (hostname, fallback_hostname4); - hostname6_is_fallback = !strcmp (hostname, fallback_hostname6); - - /* Find the short hostname, like 'foo' from 'foo.bar.baz'; we want to - * make sure that the entries we add for this host also include the short - * hostname too so that if the resolver does not answer queries for the - * machine's actual hostname/domain, that stuff like 'ping foo' still works. - */ - if (!hostname4_is_fallback || !hostname6_is_fallback) { - char *dot; - - short_hostname = g_strdup (hostname); - dot = strchr (short_hostname, '.'); - if (dot && *(dot+1)) - *dot = '\0'; - else { - g_free (short_hostname); - short_hostname = NULL; - } - } - - /* We need the following in /etc/hosts: - * - * 1) current hostname mapped to current IPv4 addresses if IPv4 is active - * 2) current hostname mapped to current IPv6 addresses if IPv6 is active - * 3) 'localhost' mapped to 127.0.0.1 - * 4) 'localhost6' mapped to ::1 - * - * If all these things exist we don't need to bother updating the file. - */ - - if (!ip4_addr) - host4_before = TRUE; - if (!ip6_addr) - host6_before = TRUE; - - /* Look for the four cases from above */ - for (line = lines; lines && *line; line++) { - gboolean found_hostname = FALSE; - - if ((*line[0] == '\0') || (*line[0] == '#')) - continue; + char **lines = NULL, **iter; + GString *new_contents = NULL; - found_hostname = nm_policy_hosts_find_token (*line, hostname); - if (found_hostname) { - /* Found the current hostname on this line */ - if (ip4_addr && ip4_addr_matches (*line, ip4_addr)) { - found_host4 = TRUE; - if (strstr (*line, ADDED_TAG)) { - if (!host4_before) - host4_before = !found_localhost4; - } else { - found_user_host4 = TRUE; - host4_before = TRUE; /* Ignore if user added mapping manually */ - } - } else if (!ip4_addr && strstr (*line, ADDED_TAG)) { - /* If this is a stale NM-added IPv4 entry we need to remove it, - * so make sure we update /etc/hosts. - */ - if (is_ip4_addr (*line)) - no_stale = FALSE; - } + if (contents_len == 0 || !strstr (contents, ADDED_TAG)) + return NULL; - if (ip6_addr && ip6_addr_matches (*line, ip6_addr)) { - found_host6 = TRUE; - if (strstr (*line, ADDED_TAG)) { - if (!host6_before) - host6_before = !found_localhost6; - } else { - found_user_host6 = TRUE; - host6_before = TRUE; /* Ignore if user added mapping manually */ - } - } else if (!ip6_addr && strstr (*line, ADDED_TAG)) { - /* If this is a stale NM-added IPv6 entry we need to remove it, - * so make sure we update /etc/hosts. - */ - if (is_ip6_addr (*line)) - no_stale = FALSE; - } - } + new_contents = g_string_sized_new (contents_len); - if (is_local_mapping (*line, FALSE, "localhost")) { - /* a 127.0.0.1 line containing 'localhost' */ - found_localhost4 = TRUE; - custom4 = get_custom_hostnames (*line, hostname, old_hostname, short_hostname, fallback_hostname4); - if (!ip4_addr) { - /* If there's no IP-specific mapping for the current hostname - * but that hostname is present on in the local mapping line, - * we've found our IPv4 hostname mapping. If the hostname is - * the fallback *IPv6* hostname it's not going to show up in - * the IPv4 local mapping though, so fake it. - */ - if (hostname6_is_fallback || found_hostname) - found_host4 = TRUE; - } - } else if (is_local_mapping (*line, TRUE, "localhost6")) { - /* a ::1 line containing 'localhost6' */ - found_localhost6 = TRUE; - custom6 = get_custom_hostnames (*line, hostname, old_hostname, short_hostname, fallback_hostname6); - if (!ip6_addr) { - /* If there's no IP-specific mapping for the current hostname - * but that hostname is present on in the local mapping line, - * we've found our IPv6 hostname mapping. If the hostname is - * the fallback *IPv4* hostname it's not going to show up in - * the IPv6 local mapping though, so fake it. - */ - if (hostname4_is_fallback || found_hostname) - found_host6 = TRUE; - } + /* Remove "# Added ..." lines */ + lines = g_strsplit_set (contents, "\n\r", -1); + for (iter = lines; iter && *iter; iter++) { + if (!strstr (*iter, ADDED_TAG)) { + g_string_append (new_contents, *iter); + g_string_append_c (new_contents, '\n'); } - - if ( found_localhost4 - && found_host4 - && found_localhost6 - && found_host6 - && host4_before - && host6_before - && no_stale) - goto out; /* No update required */ - } - - contents = g_string_sized_new (existing_len ? existing_len + 100 : 200); - if (!contents) { - g_set_error_literal (error, 0, 0, "not enough memory"); - goto out; } + g_strfreev (lines); - /* Construct the new hosts file; replace any 127.0.0.1/::1 entry that is - * at the beginning of the file or right after initial comments and contains - * the string 'localhost' (for IPv4) or 'localhost6' (for IPv6). If there - * is no 127.0.0.1 or ::1 entry at the beginning or after initial comments - * that contains 'localhost' or 'localhost6', add one there - * and ignore any other 127.0.0.1/::1 entries that contain 'localhost' or - * 'localhost6'. + /* Remove last blank line at end of file, if one exists; this is + * an artifact of how g_strsplit_set() works. */ - for (line = lines, initial_comments = TRUE; lines && *line; line++) { - /* This is the first line after the initial comments */ - if (strlen (*line) && initial_comments && (*line[0] != '#')) { - initial_comments = FALSE; - - /* If the user added their own mapping for the hostname, just make - * a simple 'localhost' mapping and assume the user knows what they - * are doing with their manual hostname entry. Otherwise if the - * hostname wasn't found somewhere else, add it to the localhost - * mapping line to make sure it's mapped to something. - */ - - /* Add the address mappings first so they take precedence */ - if (!hostname4_is_fallback && ip4_addr && !found_user_host4) { - g_string_append_printf (contents, "%s\t%s", ip4_addr, hostname); - if (short_hostname) - g_string_append_printf (contents, "\t%s", short_hostname); - g_string_append_printf (contents, "\t%s\n", ADDED_TAG); - } - if (!hostname6_is_fallback && ip6_addr && !found_user_host6) { - g_string_append_printf (contents, "%s\t%s", ip6_addr, hostname); - if (short_hostname) - g_string_append_printf (contents, "\t%s", short_hostname); - g_string_append_printf (contents, "\t%s\n", ADDED_TAG); - } + if ( (new_contents->len > 2) + && (new_contents->str[new_contents->len - 1] == '\n')) + g_string_truncate (new_contents, new_contents->len - 1); - /* IPv4 localhost line */ - g_string_append (contents, "127.0.0.1"); - if (!hostname4_is_fallback && !ip4_addr && !found_user_host4) { - g_string_append_printf (contents, "\t%s", hostname); - if (short_hostname) - g_string_append_printf (contents, "\t%s", short_hostname); - } - g_string_append_printf (contents, "\t%s\tlocalhost", fallback_hostname4); - if (custom4) - g_string_append (contents, custom4); - g_string_append_c (contents, '\n'); - - /* IPv6 localhost line */ - g_string_append (contents, "::1"); - if (!hostname6_is_fallback && !hostname4_is_fallback && !ip6_addr && !found_user_host6) { - g_string_append_printf (contents, "\t%s", hostname); - if (short_hostname) - g_string_append_printf (contents, "\t%s", short_hostname); - } - g_string_append_printf (contents, "\t%s\tlocalhost6", fallback_hostname6); - if (custom6) - g_string_append (contents, custom6); - g_string_append_c (contents, '\n'); - - added = TRUE; - } - - /* Don't add the original line if it is a localhost mapping */ - if ( !is_local_mapping (*line, FALSE, "localhost") - && !is_local_mapping (*line, FALSE, fallback_hostname4) - && !is_local_mapping (*line, FALSE, hostname) - && !is_local_mapping (*line, TRUE, "localhost6") - && !is_local_mapping (*line, TRUE, fallback_hostname6) - && !is_local_mapping (*line, TRUE, hostname) - && !strstr (*line, ADDED_TAG)) { - - g_string_append (contents, *line); - /* Only append the new line if this isn't the last line in the file */ - if (*(line+1)) - g_string_append_c (contents, '\n'); - } - } - - /* Hmm, /etc/hosts was empty for some reason */ - if (!added) { - g_string_append (contents, "# Do not remove the following lines, or various programs\n"); - g_string_append (contents, "# that require network functionality will fail.\n"); - - /* Add the address mappings first so they take precedence */ - if (!hostname4_is_fallback && ip4_addr) { - g_string_append_printf (contents, "%s\t%s", ip4_addr, hostname); - if (short_hostname) - g_string_append_printf (contents, "\t%s", short_hostname); - g_string_append_printf (contents, "\t%s\n", ADDED_TAG); - } - if (!hostname6_is_fallback && ip6_addr) { - g_string_append_printf (contents, "%s\t%s", ip6_addr, hostname); - if (short_hostname) - g_string_append_printf (contents, "\t%s", short_hostname); - g_string_append_printf (contents, "\t%s\n", ADDED_TAG); - } - - g_string_append_printf (contents, "127.0.0.1\t%s\tlocalhost\n", fallback_hostname4); - g_string_append_printf (contents, "::1\t%s\tlocalhost6\n", fallback_hostname6); - } - -out: - g_free (custom4); - g_free (custom6); - g_free (short_hostname); - return contents; + return new_contents; } -gboolean -nm_policy_hosts_update_etc_hosts (const char *hostname, - const char *old_hostname, - const char *fallback_hostname4, - const char *fallback_hostname6, - const char *ip4_addr, - const char *ip6_addr, - gboolean *out_changed) +/* remove any leftover "# Added by NetworkManager" lines */ +void +nm_policy_hosts_clean_etc_hosts (void) { char *contents = NULL; - char **lines = NULL; - GError *error = NULL; - GString *new_contents = NULL; gsize contents_len = 0; - gboolean success = FALSE; - - g_return_val_if_fail (hostname != NULL, FALSE); - g_return_val_if_fail (out_changed != NULL, FALSE); + GError *error = NULL; + GString *new; if (!g_file_get_contents (SYSCONFDIR "/hosts", &contents, &contents_len, &error)) { nm_log_warn (LOGD_DNS, "couldn't read " SYSCONFDIR "/hosts: (%d) %s", error ? error->code : 0, (error && error->message) ? error->message : "(unknown)"); g_clear_error (&error); - return FALSE; + return; } - /* Get the new /etc/hosts contents */ - lines = g_strsplit_set (contents, "\n\r", 0); - new_contents = nm_policy_get_etc_hosts ((const char **) lines, - contents_len, - hostname, - old_hostname, - fallback_hostname4, - fallback_hostname6, - ip4_addr, - ip6_addr, - &error); - g_strfreev (lines); - g_free (contents); - - if (new_contents) { - nm_log_info (LOGD_DNS, "Updating /etc/hosts with new system hostname"); + new = nm_policy_get_etc_hosts (contents, contents_len); + if (new && new->len) { + nm_log_info (LOGD_DNS, "Cleaning leftovers from /etc/hosts"); g_clear_error (&error); - /* And actually update /etc/hosts */ - if (!g_file_set_contents (SYSCONFDIR "/hosts", new_contents->str, -1, &error)) { - nm_log_warn (LOGD_DNS, "couldn't update " SYSCONFDIR "/hosts: (%d) %s", - error ? error->code : 0, - (error && error->message) ? error->message : "(unknown)"); + if (!g_file_set_contents (SYSCONFDIR "/hosts", new->str, -1, &error)) { + nm_log_dbg (LOGD_DNS, "couldn't update " SYSCONFDIR "/hosts: (%d) %s", + error ? error->code : 0, + (error && error->message) ? error->message : "(unknown)"); g_clear_error (&error); - } else { - success = TRUE; - *out_changed = TRUE; } - - g_string_free (new_contents, TRUE); - } else if (!error) { - /* No change required */ - success = TRUE; - } else { - nm_log_warn (LOGD_DNS, "couldn't read " SYSCONFDIR "/hosts: (%d) %s", - error->code, error->message ? error->message : "(unknown)"); - g_clear_error (&error); } - return success; + if (new) + g_string_free (new, TRUE); } diff --git a/src/nm-policy-hosts.h b/src/nm-policy-hosts.h index ebaaf0fd41..9f4bf9a9a9 100644 --- a/src/nm-policy-hosts.h +++ b/src/nm-policy-hosts.h @@ -23,26 +23,10 @@ #include -gboolean nm_policy_hosts_update_etc_hosts (const char *hostname, - const char *old_hostname, - const char *fallback_hostname4, - const char *fallback_hostname6, - const char *ip4_addr, - const char *ip6_addr, - gboolean *out_changed); +void nm_policy_hosts_clean_etc_hosts (void); /* Only for testcases; don't use outside of nm-policy-hosts.c */ -gboolean nm_policy_hosts_find_token (const char *line, const char *token); - -GString *nm_policy_get_etc_hosts (const char **lines, - gsize existing_len, - const char *hostname, - const char *old_hostname, - const char *fallback_hostname4, - const char *fallback_hostname6, - const char *ip4_addr, - const char *ip6_addr, - GError **error); +GString *nm_policy_get_etc_hosts (const char *contents, gsize contents_len); #endif /* NM_POLICY_HOSTS_H */ diff --git a/src/nm-policy.c b/src/nm-policy.c index b0c366234b..b5c212929b 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -42,7 +42,6 @@ #include "nm-system.h" #include "nm-dns-manager.h" #include "nm-vpn-manager.h" -#include "nm-policy-hosts.h" #include "nm-policy-hostname.h" struct NMPolicy { @@ -235,9 +234,6 @@ _set_hostname (NMPolicy *policy, const char *new_hostname, const char *msg) { - char ip4_addr[INET_ADDRSTRLEN + 1]; - char ip6_addr[INET6_ADDRSTRLEN + 1]; - if (change_hostname) { NMDnsManager *dns_mgr; @@ -249,43 +245,7 @@ _set_hostname (NMPolicy *policy, g_object_unref (dns_mgr); } - /* Get the default IPv4 and IPv6 addresses so we can assign - * the hostname to them in /etc/hosts. - */ - memset (ip4_addr, 0, sizeof (ip4_addr)); - if (policy->default_device4) { - NMIP4Config *config = NULL; - NMIP4Address *addr = NULL; - - config = nm_device_get_ip4_config (policy->default_device4); - if (config) - addr = nm_ip4_config_get_address (config, 0); - - if (addr) { - struct in_addr tmp; - - tmp.s_addr = nm_ip4_address_get_address (addr); - inet_ntop (AF_INET, &tmp, ip4_addr, sizeof (ip4_addr)); - } - } - - memset (ip6_addr, 0, sizeof (ip6_addr)); - if (policy->default_device6) { - NMIP6Config *config = NULL; - NMIP6Address *addr = NULL; - - config = nm_device_get_ip6_config (policy->default_device6); - if (config) - addr = nm_ip6_config_get_address (config, 0); - - if (addr) - inet_ntop (AF_INET6, nm_ip6_address_get_address (addr), ip6_addr, sizeof (ip6_addr)); - } - - if (nm_policy_set_system_hostname (policy->cur_hostname, - strlen (ip4_addr) ? ip4_addr : NULL, - strlen (ip6_addr) ? ip6_addr : NULL, - msg)) + if (nm_policy_set_system_hostname (policy->cur_hostname, msg)) nm_utils_call_dispatcher ("hostname", NULL, NULL, NULL); } diff --git a/src/tests/test-policy-hosts.c b/src/tests/test-policy-hosts.c index 8865c4264e..62862e756f 100644 --- a/src/tests/test-policy-hosts.c +++ b/src/tests/test-policy-hosts.c @@ -23,41 +23,17 @@ #include "nm-policy-hosts.h" -#define FALLBACK_HOSTNAME4 "localhost.localdomain" -#define FALLBACK_HOSTNAME6 "localhost6.localdomain6" - -#define DEBUG 0 +#define DEBUG 1 static void -test_generic (const char *before, - const char *after, - const char *hostname, - const char *ip4_addr, - const char *ip6_addr, - gboolean expect_error) +test_generic (const char *before, const char *after) { - char **lines; GString *newc; - GError *error = NULL; /* Get the new /etc/hosts contents */ - lines = g_strsplit_set (before, "\n\r", 0); - newc = nm_policy_get_etc_hosts ((const char **) lines, - strlen (before), - hostname, - NULL, - FALLBACK_HOSTNAME4, - FALLBACK_HOSTNAME6, - ip4_addr, - ip6_addr, - &error); - g_strfreev (lines); + newc = nm_policy_get_etc_hosts (before, strlen (before)); - if (expect_error) { - g_assert (newc == NULL); - g_assert (error != NULL); - g_clear_error (&error); - } else if (after == NULL) { + if (after == NULL) { /* No change to /etc/hosts required */ #if DEBUG if (newc != NULL) { @@ -68,10 +44,8 @@ test_generic (const char *before, } #endif g_assert (newc == NULL); - g_assert (error == NULL); } else { g_assert (newc != NULL); - g_assert (error == NULL); #if DEBUG g_message ("\n- NEW ---------------------------------\n" @@ -81,7 +55,6 @@ test_generic (const char *before, "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", newc->str, after); #endif - g_assert (strlen (newc->str) == strlen (after)); g_assert (strcmp (newc->str, after) == 0); g_string_free (newc, TRUE); } @@ -99,7 +72,7 @@ static const char *generic_before = \ static void test_hosts_generic (void) { - test_generic (generic_before, NULL, "localhost.localdomain", NULL, NULL, FALSE); + test_generic (generic_before, NULL); } /*******************************************/ @@ -112,311 +85,25 @@ static const char *generic_no_boilerplate_before = \ static void test_hosts_generic_no_boilerplate (void) { - test_generic (generic_no_boilerplate_before, NULL, "localhost.localdomain", NULL, NULL, FALSE); -} - -/*******************************************/ - -static const char *generic_no_boilerplate_no_lh_before = \ - "127.0.0.1 localhost.localdomain\n" - "::1 localhost6.localdomain6 localhost6\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; - -static const char *generic_no_boilerplate_no_lh_after = \ - "127.0.0.1 localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; - -static void -test_hosts_generic_no_boilerplate_no_lh (void) -{ - test_generic (generic_no_boilerplate_no_lh_before, - generic_no_boilerplate_no_lh_after, - "localhost.localdomain", - NULL, - NULL, - FALSE); -} - -/*******************************************/ - - -static const char *generic_no_boilerplate_no_lh_no_host_before = \ - "127.0.0.1 localhost.localdomain\n" - "::1 localhost6.localdomain6 localhost6\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; - -static const char *generic_no_boilerplate_no_lh_no_host_after = \ - "127.0.0.1 comet localhost.localdomain localhost\n" - "::1 comet localhost6.localdomain6 localhost6\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; - -static void -test_hosts_generic_no_boilerplate_no_lh_no_host (void) -{ - test_generic (generic_no_boilerplate_no_lh_no_host_before, - generic_no_boilerplate_no_lh_no_host_after, - "comet", - NULL, - NULL, - FALSE); -} - -/*******************************************/ -static const char *named_generic_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 playboy localhost\n" - "::1 localhost6.localdomain6 localhost6\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; - -static const char *named_generic_after = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 playboy localhost.localdomain localhost\n" - "::1 playboy localhost6.localdomain6 localhost6\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; - -static void -test_hosts_named_generic (void) -{ - test_generic (named_generic_before, named_generic_after, "playboy", NULL, NULL, FALSE); + test_generic (generic_no_boilerplate_before, NULL); } /*******************************************/ -static const char *named4_non127_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 localhost.localdomain localhost\n" - "::1 tomcat localhost6.localdomain6 localhost6\n" - "127.0.0.1 lcmd.us.intellitxt.com\n" - "192.168.1.2 tomcat\n"; - -static void -test_hosts_named4_non127 (void) -{ - test_generic (named4_non127_before, NULL, "tomcat", "192.168.1.2", NULL, FALSE); -} - -/*******************************************/ - -static const char *named6_non127_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 tomcat localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n" - "127.0.0.1 lcmd.us.intellitxt.com\n" - "3001:abba::3234 tomcat\n"; - -static void -test_hosts_named6_non127 (void) -{ - test_generic (named6_non127_before, NULL, "tomcat", NULL, "3001:abba::3234", FALSE); -} - -/*******************************************/ - -static const char *named4_non127_more_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 localhost.localdomain localhost\n" - "::1 tomcat localhost6.localdomain6 localhost6\n" - "127.0.0.1 lcmd.us.intellitxt.com\n" - "192.168.1.2 tomcat\n" - "127.0.0.1 lcmd.us.intellitxt.com\n" - "127.0.0.1 srx.main.ebayrtm.com\n" - "127.0.0.1 cdn5.tribalfusion.com\n"; - -static void -test_hosts_named4_non127_more (void) -{ - test_generic (named4_non127_more_before, NULL, "tomcat", "192.168.1.2", NULL, FALSE); -} - -/*******************************************/ - -static const char *named6_non127_more_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 tomcat localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n" - "127.0.0.1 lcmd.us.intellitxt.com\n" - "3001:abba::3234 tomcat\n" - "127.0.0.1 lcmd.us.intellitxt.com\n" - "127.0.0.1 srx.main.ebayrtm.com\n" - "127.0.0.1 cdn5.tribalfusion.com\n"; - -static void -test_hosts_named6_non127_more (void) -{ - test_generic (named6_non127_more_before, NULL, "tomcat", NULL, "3001:abba::3234", FALSE); -} - -/*******************************************/ - -static const char *named_no_lh_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 localhost.localdomain\n" - "::1 localhost6.localdomain6 localhost6\n" - "127.0.0.1 lcmd.us.intellitxt.com\n" - "192.168.1.2 tomcat\n"; - -static const char *named_no_lh_after = \ +static const char *leftover_before = \ "# Do not remove the following line, or various programs\n" "# that require network functionality will fail.\n" + "192.168.1.2 comet # Added by NetworkManager\n" "127.0.0.1 localhost.localdomain localhost\n" - "::1 tomcat localhost6.localdomain6 localhost6\n" - "127.0.0.1 lcmd.us.intellitxt.com\n" - "192.168.1.2 tomcat\n"; - -static void -test_hosts_named_no_localhost (void) -{ - test_generic (named_no_lh_before, named_no_lh_after, "tomcat", "192.168.1.2", NULL, FALSE); -} - -/*******************************************/ - -static const char *no_lh_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 tomcat\n" - "::1 localhost6.localdomain6 localhost6\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; - -static const char *no_lh_after = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 tomcat localhost.localdomain localhost\n" - "::1 tomcat localhost6.localdomain6 localhost6\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; - -static void -test_hosts_no_localhost (void) -{ - test_generic (no_lh_before, no_lh_after, "tomcat", NULL, NULL, FALSE); -} - -/*******************************************/ - -static const char *named_last_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 sparcbook.ausil.us\n" - "::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 sparcbook.ausil.us\n"; - -static void -test_hosts_named_last (void) -{ - test_generic (named_last_before, NULL, "sparcbook.ausil.us", NULL, NULL, FALSE); -} - -/*******************************************/ - -static const char *no_host4_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "::1 localhost6.localdomain6 localhost6\n" - "\n" - "127.0.0.1 lcmd.us.intellitxt.com\n" - "127.0.0.1 srx.main.ebayrtm.com\n" - "127.0.0.1 cdn5.tribalfusion.com\n" - "127.0.0.1 a.tribalfusion.com\n"; - -static const char *no_host4_after = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 comet localhost.localdomain localhost\n" - "::1 comet localhost6.localdomain6 localhost6\n" - "\n" - "127.0.0.1 lcmd.us.intellitxt.com\n" - "127.0.0.1 srx.main.ebayrtm.com\n" - "127.0.0.1 cdn5.tribalfusion.com\n" - "127.0.0.1 a.tribalfusion.com\n"; - -static void -test_hosts_no_host4 (void) -{ - test_generic (no_host4_before, no_host4_after, "comet", NULL, NULL, FALSE); -} - -/*******************************************/ - -static const char *no_host6_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 localhost.localdomain localhost\n" - "\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; - -static const char *no_host6_after = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 comet localhost.localdomain localhost\n" - "::1 comet localhost6.localdomain6 localhost6\n" - "\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; - -static void -test_hosts_no_host6 (void) -{ - test_generic (no_host6_before, no_host6_after, "comet", NULL, NULL, FALSE); -} - -/*******************************************/ - -static const char *named46_non127_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n" - "192.168.1.2 comet\n" - "3001:abba::3234 comet\n" - "\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; - -static void -test_hosts_named46_non127 (void) -{ - test_generic (named46_non127_before, NULL, "comet", "192.168.1.2", "3001:abba::3234", FALSE); -} - -/*******************************************/ - -static const char *named46_non127_long_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n" - "192.168.1.2 comet.space comet\n" - "3001:abba::3234 comet.space comet\n" - "\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; - -static void -test_hosts_named46_non127_long (void) -{ - test_generic (named46_non127_long_before, NULL, "comet.space", "192.168.1.2", "3001:abba::3234", FALSE); -} - -/*******************************************/ - -static const char *named46_non127_other4_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 localhost.localdomain localhost\n" "::1 localhost6.localdomain6 localhost6\n" "192.168.1.3 comet\n" "3001:abba::3234 comet\n" "\n" "127.0.0.1 lcmd.us.intellitxt.com\n"; -static const char *named46_non127_other4_after = \ +static const char *leftover_after = \ "# Do not remove the following line, or various programs\n" "# that require network functionality will fail.\n" - "192.168.1.2 comet # Added by NetworkManager\n" "127.0.0.1 localhost.localdomain localhost\n" "::1 localhost6.localdomain6 localhost6\n" "192.168.1.3 comet\n" @@ -425,416 +112,44 @@ static const char *named46_non127_other4_after = \ "127.0.0.1 lcmd.us.intellitxt.com\n"; static void -test_hosts_named46_non127_other4 (void) +test_hosts_leftover (void) { - test_generic (named46_non127_other4_before, named46_non127_other4_after, "comet", "192.168.1.2", "3001:abba::3234", FALSE); + test_generic (leftover_before, leftover_after); } /*******************************************/ -static const char *named46_non127_other4_long_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n" - "192.168.1.3 comet.space\n" - "3001:abba::3234 comet.space\n" - "\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; - -static const char *named46_non127_other4_long_after = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "192.168.1.2 comet.space comet # Added by NetworkManager\n" - "127.0.0.1 localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n" - "192.168.1.3 comet.space\n" - "3001:abba::3234 comet.space\n" - "\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; - -static void -test_hosts_named46_non127_other4_long (void) -{ - test_generic (named46_non127_other4_long_before, named46_non127_other4_long_after, "comet.space", "192.168.1.2", "3001:abba::3234", FALSE); -} - -/*******************************************/ - -static const char *named46_non127_other6_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n" - "192.168.1.2 comet\n" - "3001:abba::9675 comet\n" - "\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; - -static const char *named46_non127_other6_after = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "3001:abba::3234 comet # Added by NetworkManager\n" - "127.0.0.1 localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n" - "192.168.1.2 comet\n" - "3001:abba::9675 comet\n" - "\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; - -static void -test_hosts_named46_non127_other6 (void) -{ - test_generic (named46_non127_other6_before, named46_non127_other6_after, "comet", "192.168.1.2", "3001:abba::3234", FALSE); -} - -/*******************************************/ - -static const char *named46_non127_other6_long_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n" - "192.168.1.2 comet.space\n" - "3001:abba::9675 comet.space\n" - "\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; - -static const char *named46_non127_other6_long_after = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "3001:abba::3234 comet.space comet # Added by NetworkManager\n" - "127.0.0.1 localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n" - "192.168.1.2 comet.space\n" - "3001:abba::9675 comet.space\n" - "\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; - -static void -test_hosts_named46_non127_other6_long (void) -{ - test_generic (named46_non127_other6_long_before, named46_non127_other6_long_after, "comet.space", "192.168.1.2", "3001:abba::3234", FALSE); -} - -/*******************************************/ - -static const char *unnamed46_non127_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n" - "\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; - -static const char *unnamed46_non127_after = \ +static const char *leftover_double_newline_before = \ "# Do not remove the following line, or various programs\n" "# that require network functionality will fail.\n" "192.168.1.2 comet # Added by NetworkManager\n" - "3001:abba::3234 comet # Added by NetworkManager\n" - "127.0.0.1 localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n" - "\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; - -static void -test_hosts_unnamed46_non127 (void) -{ - test_generic (unnamed46_non127_before, unnamed46_non127_after, "comet", "192.168.1.2", "3001:abba::3234", FALSE); -} - -/*******************************************/ - -static const char *unnamed46_non127_long_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n" - "\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; - -static const char *unnamed46_non127_long_after = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "192.168.1.2 comet.space comet # Added by NetworkManager\n" - "3001:abba::3234 comet.space comet # Added by NetworkManager\n" "127.0.0.1 localhost.localdomain localhost\n" "::1 localhost6.localdomain6 localhost6\n" + "192.168.1.3 comet\n" + "3001:abba::3234 comet\n" "\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; - -static void -test_hosts_unnamed46_non127_long (void) -{ - test_generic (unnamed46_non127_long_before, unnamed46_non127_long_after, "comet.space", "192.168.1.2", "3001:abba::3234", FALSE); -} - -/*******************************************/ - -static const char *named46_non127_wrong_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n" - "192.168.1.3 comet # Added by NetworkManager\n" - "3001:abba::9876 comet # Added by NetworkManager\n" - "\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; + "127.0.0.1 lcmd.us.intellitxt.com\n" + "\n"; -static const char *named46_non127_wrong_after = \ +static const char *leftover_double_newline_after = \ "# Do not remove the following line, or various programs\n" "# that require network functionality will fail.\n" - "192.168.1.2 comet # Added by NetworkManager\n" - "3001:abba::3234 comet # Added by NetworkManager\n" "127.0.0.1 localhost.localdomain localhost\n" "::1 localhost6.localdomain6 localhost6\n" - "\n" - "127.0.0.1 lcmd.us.intellitxt.com\n"; - -static void -test_hosts_named46_non127_wrong (void) -{ - test_generic (named46_non127_wrong_before, named46_non127_wrong_after, "comet", "192.168.1.2", "3001:abba::3234", FALSE); -} - -/*******************************************/ - -static const char *long_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 localhost.localdomain localhost comet\n" - "::1 localhost6.localdomain6 localhost6\n" - "\n" - "127.0.0.1 lcmd.us.intellitxt.com\n" - "127.0.0.1 adserver.adtech.de\n" - "127.0.0.1 a.as-us.falkag.net\n" - "127.0.0.1 a.as-eu.falkag.net\n" - "127.0.0.1 ads.doubleclick.com\n" - "\n" - "# random comment\n" - "127.0.0.1 m1.2mdn.net\n" - "127.0.0.1 ds.serving-sys.com\n" - "127.0.0.1 pagead2.googlesyndication.com\n" - "127.0.0.1 ad.doubleclick.com\n" - "127.0.0.1 ad.doubleclick.net\n" - "127.0.0.1 oascentral.movietickets.com\n" - "127.0.0.1 view.atdmt.com\n" - "127.0.0.1 ads.chumcity.com\n"; - -static const char *long_after = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 comet localhost.localdomain localhost\n" - "::1 comet localhost6.localdomain6 localhost6\n" + "192.168.1.3 comet\n" + "3001:abba::3234 comet\n" "\n" "127.0.0.1 lcmd.us.intellitxt.com\n" - "127.0.0.1 adserver.adtech.de\n" - "127.0.0.1 a.as-us.falkag.net\n" - "127.0.0.1 a.as-eu.falkag.net\n" - "127.0.0.1 ads.doubleclick.com\n" - "\n" - "# random comment\n" - "127.0.0.1 m1.2mdn.net\n" - "127.0.0.1 ds.serving-sys.com\n" - "127.0.0.1 pagead2.googlesyndication.com\n" - "127.0.0.1 ad.doubleclick.com\n" - "127.0.0.1 ad.doubleclick.net\n" - "127.0.0.1 oascentral.movietickets.com\n" - "127.0.0.1 view.atdmt.com\n" - "127.0.0.1 ads.chumcity.com\n"; - -static void -test_hosts_long (void) -{ - test_generic (long_before, long_after, "comet", NULL, NULL, FALSE); -} - -/*******************************************/ - -static const char *custom4_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 localhost.localdomain localhost pintglass\n" - "::1 localhost6.localdomain6 localhost6\n"; - -static const char *custom4_after = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 comet localhost.localdomain localhost pintglass\n" - "::1 comet localhost6.localdomain6 localhost6\n"; - -static void -test_hosts_custom4 (void) -{ - test_generic (custom4_before, custom4_after, "comet", NULL, NULL, FALSE); -} - -/*******************************************/ - -static const char *custom6_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6 pintglass\n"; - -static const char *custom6_after = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 comet localhost.localdomain localhost\n" - "::1 comet localhost6.localdomain6 localhost6 pintglass\n"; - -static void -test_hosts_custom6 (void) -{ - test_generic (custom6_before, custom6_after, "comet", NULL, NULL, FALSE); -} - -/*******************************************/ - -static const char *custom46_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 localhost.localdomain localhost shotglass\n" - "::1 localhost6.localdomain6 localhost6 pintglass\n"; - -static const char *custom46_after = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 comet localhost.localdomain localhost shotglass\n" - "::1 comet localhost6.localdomain6 localhost6 pintglass\n"; - -static void -test_hosts_custom46 (void) -{ - test_generic (custom46_before, custom46_after, "comet", NULL, NULL, FALSE); -} - -/*******************************************/ - -static const char *custom46_mixed_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 localhost.localdomain localhost shotglass\n" - "::1 localhost6.localdomain6 localhost6 pintglass\n"; - -static const char *custom46_mixed_after = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 comet localhost.localdomain localhost shotglass\n" - "::1 comet localhost6.localdomain6 localhost6 pintglass\n"; - -static void -test_hosts_custom46_mixed (void) -{ - test_generic (custom46_mixed_before, custom46_mixed_after, "comet", NULL, NULL, FALSE); -} - -/*******************************************/ - -static const char *stale4_removed_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "1.2.3.4 comet # Added by NetworkManager\n" - "127.0.0.1 localhost.localdomain localhost\n" - "::1 comet localhost6.localdomain6 localhost6\n"; - -static const char *stale4_removed_after = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 comet localhost.localdomain localhost\n" - "::1 comet localhost6.localdomain6 localhost6\n"; + "\n"; static void -test_hosts_stale4_removed (void) +test_hosts_leftover_double_newline (void) { - test_generic (stale4_removed_before, stale4_removed_after, "comet", NULL, NULL, FALSE); + test_generic (leftover_double_newline_before, leftover_double_newline_after); } /*******************************************/ -static const char *stale6_removed_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "3001:abba::3234 comet # Added by NetworkManager\n" - "127.0.0.1 comet localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n"; - -static const char *stale6_removed_after = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 comet localhost.localdomain localhost\n" - "::1 comet localhost6.localdomain6 localhost6\n"; - -static void -test_hosts_stale6_removed (void) -{ - test_generic (stale6_removed_before, stale6_removed_after, "comet", NULL, NULL, FALSE); -} - -/*******************************************/ - -static const char *stale46_removed_before = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "1.2.3.4 comet # Added by NetworkManager\n" - "3001:abba::3234 comet # Added by NetworkManager\n" - "127.0.0.1 localhost.localdomain localhost\n" - "::1 localhost6.localdomain6 localhost6\n"; - -static const char *stale46_removed_after = \ - "# Do not remove the following line, or various programs\n" - "# that require network functionality will fail.\n" - "127.0.0.1 comet localhost.localdomain localhost\n" - "::1 comet localhost6.localdomain6 localhost6\n"; - -static void -test_hosts_stale46_removed (void) -{ - test_generic (stale46_removed_before, stale46_removed_after, "comet", NULL, NULL, FALSE); -} - -/*******************************************/ - -typedef struct { - const char *line; - const char *token; - gboolean expected; -} Foo; - -static Foo foo[] = { - /* Using \t here to easily differentiate tabs vs. spaces for testing */ - { "127.0.0.1\tfoobar\tblah", "blah", TRUE }, - { "", "blah", FALSE }, - { "1.1.1.1\tbork\tfoo", "blah", FALSE }, - { "127.0.0.1 foobar\tblah", "blah", TRUE }, - { "127.0.0.1 foobar blah", "blah", TRUE }, - { "127.0.0.1 localhost", "localhost.localdomain", FALSE }, - { "192.168.1.1 blah borkbork", "blah", TRUE }, - { "192.168.1.1 foobar\tblah borkbork", "blah", TRUE }, - { "192.168.1.1\tfoobar\tblah\tborkbork", "blah", TRUE }, - { "192.168.1.1 \tfoobar \tblah \tborkbork\t ", "blah", TRUE }, - { "\t\t\t\t \t\t\tasdfadf a\t\t\t\t\t \t\t\t\t\t ", "blah", FALSE }, - { NULL, NULL, FALSE } -}; - -static void -test_find_token (void) -{ - Foo *iter = &foo[0]; - - while (iter->line) { - gboolean found; - - found = nm_policy_hosts_find_token (iter->line, iter->token); - if (found != iter->expected) { - g_warning ("find-token: unexpected token result %d for '%s' <= '%s' (expected %d)", - found, iter->line, iter->token, iter->expected); - } - g_assert (found == iter->expected); - iter++; - } -} - #if GLIB_CHECK_VERSION(2,25,12) typedef GTestFixtureFunc TCFunc; #else @@ -851,38 +166,10 @@ int main (int argc, char **argv) suite = g_test_get_root (); - g_test_suite_add (suite, TESTCASE (test_find_token, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_generic, NULL)); g_test_suite_add (suite, TESTCASE (test_hosts_generic_no_boilerplate, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_generic_no_boilerplate_no_lh, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_generic_no_boilerplate_no_lh_no_host, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_named_generic, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_named4_non127, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_named6_non127, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_named4_non127_more, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_named6_non127_more, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127_long, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127_other4, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127_other4_long, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127_other6, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127_other6_long, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_named46_non127_wrong, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_unnamed46_non127, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_unnamed46_non127_long, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_named_no_localhost, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_no_localhost, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_named_last, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_no_host4, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_no_host6, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_long, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_custom4, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_custom6, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_custom46, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_custom46_mixed, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_stale4_removed, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_stale6_removed, NULL)); - g_test_suite_add (suite, TESTCASE (test_hosts_stale46_removed, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_leftover, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_leftover_double_newline, NULL)); return g_test_run (); } -- cgit v1.2.1 From 297e3c6463f54956077cfaf08d09fc6f5aafc5dd Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 17 Dec 2010 23:00:03 -0600 Subject: dhclient: split out dhclient config merging and add testcases --- .gitignore | 1 + configure.ac | 1 + po/POTFILES.in | 1 + src/dhcp-manager/Makefile.am | 38 ++++- src/dhcp-manager/nm-dhcp-dhclient-utils.c | 214 ++++++++++++++++++++++++++++ src/dhcp-manager/nm-dhcp-dhclient-utils.h | 35 +++++ src/dhcp-manager/nm-dhcp-dhclient.c | 97 +------------ src/dhcp-manager/tests/Makefile.am | 28 ++++ src/dhcp-manager/tests/test-dhcp-dhclient.c | 203 ++++++++++++++++++++++++++ 9 files changed, 521 insertions(+), 97 deletions(-) create mode 100644 src/dhcp-manager/nm-dhcp-dhclient-utils.c create mode 100644 src/dhcp-manager/nm-dhcp-dhclient-utils.h create mode 100644 src/dhcp-manager/tests/Makefile.am create mode 100644 src/dhcp-manager/tests/test-dhcp-dhclient.c diff --git a/.gitignore b/.gitignore index 033eaada1e..201955cec8 100644 --- a/.gitignore +++ b/.gitignore @@ -93,6 +93,7 @@ libnm-util/tests/test-need-secrets libnm-util/tests/test-setting-8021x src/tests/test-dhcp-options src/tests/test-policy-hosts +src/dhcp-manager/tests/test-dhcp-dhclient system-settings/plugins/keyfile/tests/test-keyfile system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh diff --git a/configure.ac b/configure.ac index 0665886927..cf05ab7aa8 100644 --- a/configure.ac +++ b/configure.ac @@ -518,6 +518,7 @@ src/logging/Makefile src/dns-manager/Makefile src/vpn-manager/Makefile src/dhcp-manager/Makefile +src/dhcp-manager/tests/Makefile src/ip6-manager/Makefile src/supplicant-manager/Makefile src/supplicant-manager/tests/Makefile diff --git a/po/POTFILES.in b/po/POTFILES.in index f3421b4a60..d4988c43ca 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -16,6 +16,7 @@ policy/org.freedesktop.NetworkManager.policy.in src/nm-netlink-monitor.c src/main.c src/dhcp-manager/nm-dhcp-dhclient.c +src/dhcp-manager/nm-dhcp-dhclient-utils.c src/dhcp-manager/nm-dhcp-manager.c src/logging/nm-logging.c src/dns-manager/nm-dns-manager.c diff --git a/src/dhcp-manager/Makefile.am b/src/dhcp-manager/Makefile.am index e29c6718a3..14ddde0bd2 100644 --- a/src/dhcp-manager/Makefile.am +++ b/src/dhcp-manager/Makefile.am @@ -1,3 +1,5 @@ +SUBDIRS=. tests + INCLUDES = \ -I${top_srcdir} \ -I${top_srcdir}/include \ @@ -6,15 +8,40 @@ INCLUDES = \ -I${top_srcdir}/libnm-util \ -I${top_srcdir}/src -noinst_LTLIBRARIES = libdhcp-manager.la +noinst_LTLIBRARIES = libdhcp-manager.la libdhcp-dhclient.la + +################## dhclient ################## + +libdhcp_dhclient_la_SOURCES = \ + nm-dhcp-dhclient-utils.h \ + nm-dhcp-dhclient-utils.c \ + nm-dhcp-dhclient.h \ + nm-dhcp-dhclient.c + +libdhcp_dhclient_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DLIBEXECDIR=\"$(libexecdir)\" \ + -DLOCALSTATEDIR=\"$(localstatedir)\" \ + -DDHCLIENT_PATH=\"$(DHCLIENT_PATH)\" \ + -DDHCLIENT_V$(DHCLIENT_VERSION) + +libdhcp_dhclient_la_LIBADD = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +################## main lib ################## libdhcp_manager_la_SOURCES = \ nm-dhcp-client.c \ nm-dhcp-client.h \ nm-dhcp-manager.c \ nm-dhcp-manager.h \ - nm-dhcp-dhclient.h \ - nm-dhcp-dhclient.c \ nm-dhcp-dhcpcd.h \ nm-dhcp-dhcpcd.c @@ -22,18 +49,15 @@ libdhcp_manager_la_CPPFLAGS = \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ -DG_DISABLE_DEPRECATED \ - -DBINDIR=\"$(bindir)\" \ - -DDATADIR=\"$(datadir)\" \ - -DSYSCONFDIR=\"$(sysconfdir)\" \ -DLIBEXECDIR=\"$(libexecdir)\" \ -DLOCALSTATEDIR=\"$(localstatedir)\" \ -DDHCLIENT_PATH=\"$(DHCLIENT_PATH)\" \ - -DDHCLIENT_V$(DHCLIENT_VERSION) \ -DDHCPCD_PATH=\"$(DHCPCD_PATH)\" libdhcp_manager_la_LIBADD = \ $(top_builddir)/marshallers/libmarshallers.la \ $(top_builddir)/src/logging/libnm-logging.la \ + $(builddir)/libdhcp-dhclient.la \ $(DBUS_LIBS) \ $(GLIB_LIBS) diff --git a/src/dhcp-manager/nm-dhcp-dhclient-utils.c b/src/dhcp-manager/nm-dhcp-dhclient-utils.c new file mode 100644 index 0000000000..cfc766f253 --- /dev/null +++ b/src/dhcp-manager/nm-dhcp-dhclient-utils.c @@ -0,0 +1,214 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2010 Red Hat, Inc. + */ + +#include + +#include +#include +#include +#include + +#include "nm-dhcp-dhclient-utils.h" + +#define CLIENTID_TAG "send dhcp-client-identifier" +#define CLIENTID_FORMAT CLIENTID_TAG " \"%s\"; # added by NetworkManager" +#define CLIENTID_FORMAT_OCTETS CLIENTID_TAG " %s; # added by NetworkManager" + +#define HOSTNAME_TAG "send host-name" +#define HOSTNAME_FORMAT HOSTNAME_TAG " \"%s\"; # added by NetworkManager" + +#define ALSOREQ_TAG "also request " + +static void +add_also_request (GPtrArray *array, const char *item) +{ + int i; + + for (i = 0; i < array->len; i++) { + if (!strcmp (g_ptr_array_index (array, i), item)) + return; + } + g_ptr_array_add (array, g_strdup (item)); +} + +char * +nm_dhcp_dhclient_create_config (const char *interface, + NMSettingIP4Config *s_ip4, + guint8 *anycast_addr, + const char *hostname, + const char *orig_path, + const char *orig_contents) +{ + GString *new_contents; + GPtrArray *alsoreq; + int i; + + new_contents = g_string_new (_("# Created by NetworkManager\n")); + alsoreq = g_ptr_array_sized_new (5); + + if (orig_contents) { + char **lines, **line; + gboolean in_alsoreq = FALSE; + + g_string_append_printf (new_contents, _("# Merged from %s\n\n"), orig_path); + + lines = g_strsplit_set (orig_contents, "\n\r", 0); + for (line = lines; lines && *line; line++) { + char *p = *line; + + if (!strlen (g_strstrip (p))) + continue; + + /* Override config file "dhcp-client-id" and use one from the + * connection. + */ + if ( s_ip4 + && nm_setting_ip4_config_get_dhcp_client_id (s_ip4) + && !strncmp (p, CLIENTID_TAG, strlen (CLIENTID_TAG))) + continue; + + /* Override config file hostname and use one from the connection */ + if (hostname && !strncmp (p, HOSTNAME_TAG, strlen (HOSTNAME_TAG))) + continue; + + /* Check for "also require" */ + if (!strncmp (p, ALSOREQ_TAG, strlen (ALSOREQ_TAG))) { + in_alsoreq = TRUE; + p += strlen (ALSOREQ_TAG); + } + + if (in_alsoreq) { + char **areq, **aiter; + + /* Grab each 'also require' option and save for later */ + areq = g_strsplit_set (p, "\t ,", -1); + for (aiter = areq; aiter && *aiter; aiter++) { + if (!strlen (g_strstrip (*aiter))) + continue; + + if (*aiter[0] == ';') { + /* all done */ + in_alsoreq = FALSE; + break; + } + + if (!isalnum ((*aiter)[0])) + continue; + + if ((*aiter)[strlen (*aiter) - 1] == ';') { + /* Remove the EOL marker */ + (*aiter)[strlen (*aiter) - 1] = '\0'; + in_alsoreq = FALSE; + } + + add_also_request (alsoreq, *aiter); + } + + if (areq) + g_strfreev (areq); + + continue; + } + + /* Existing configuration line is OK, add it to new configuration */ + g_string_append (new_contents, *line); + g_string_append_c (new_contents, '\n'); + } + + if (lines) + g_strfreev (lines); + } else + g_string_append_c (new_contents, '\n'); + + /* Add NM options from connection */ + if (s_ip4) { + const char *tmp; + gboolean added = FALSE; + + tmp = nm_setting_ip4_config_get_dhcp_client_id (s_ip4); + if (tmp) { + gboolean is_octets = TRUE; + const char *p = tmp; + + while (*p) { + if (!isxdigit (*p) && (*p != ':')) { + is_octets = FALSE; + break; + } + p++; + } + + /* If the client ID is just hex digits and : then don't use quotes, + * because dhclient expects either a quoted ASCII string, or a byte + * array formated as hex octets separated by : + */ + if (is_octets) + g_string_append_printf (new_contents, CLIENTID_FORMAT_OCTETS "\n", tmp); + else + g_string_append_printf (new_contents, CLIENTID_FORMAT "\n", tmp); + added = TRUE; + } + + if (hostname) { + g_string_append_printf (new_contents, HOSTNAME_FORMAT "\n", hostname); + added = TRUE; + } + + if (added) + g_string_append_c (new_contents, '\n'); + } + + /* Define options for classless static routes */ + g_string_append (new_contents, + "option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;\n"); + g_string_append (new_contents, + "option ms-classless-static-routes code 249 = array of unsigned integer 8;\n"); + + g_string_append_c (new_contents, '\n'); + + /* Everything we want to request from the DHCP server */ + add_also_request (alsoreq, "rfc3442-classless-static-routes"); + add_also_request (alsoreq, "ms-classless-static-routes"); + add_also_request (alsoreq, "ntp-servers"); + + /* And add it to the dhclient configuration */ + for (i = 0; i < alsoreq->len; i++) { + char *t = g_ptr_array_index (alsoreq, i); + + g_string_append_printf (new_contents, "also request %s;\n", t); + g_free (t); + } + g_ptr_array_free (alsoreq, TRUE); + + g_string_append_c (new_contents, '\n'); + + if (anycast_addr) { + g_string_append_printf (new_contents, "interface \"%s\" {\n" + " initial-interval 1; \n" + " anycast-mac ethernet %02x:%02x:%02x:%02x:%02x:%02x;\n" + "}\n", + interface, + anycast_addr[0], anycast_addr[1], + anycast_addr[2], anycast_addr[3], + anycast_addr[4], anycast_addr[5]); + } + + return g_string_free (new_contents, FALSE); +} + diff --git a/src/dhcp-manager/nm-dhcp-dhclient-utils.h b/src/dhcp-manager/nm-dhcp-dhclient-utils.h new file mode 100644 index 0000000000..77def55182 --- /dev/null +++ b/src/dhcp-manager/nm-dhcp-dhclient-utils.h @@ -0,0 +1,35 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2010 Red Hat, Inc. + */ + +#ifndef NM_DHCP_DHCLIENT_UTILS_H +#define NM_DHCP_DHCLIENT_UTILS_H + +#include +#include + +#include + +char *nm_dhcp_dhclient_create_config (const char *interface, + NMSettingIP4Config *s_ip4, + guint8 *anycast_addr, + const char *hostname, + const char *orig_path, + const char *orig_contents); + +#endif /* NM_DHCP_DHCLIENT_UTILS_H */ + diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c index d8781524e9..f6f2a540dc 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.c +++ b/src/dhcp-manager/nm-dhcp-dhclient.c @@ -39,6 +39,7 @@ #include "nm-dhcp-dhclient.h" #include "nm-utils.h" #include "nm-logging.h" +#include "nm-dhcp-dhclient-utils.h" G_DEFINE_TYPE (NMDHCPDhclient, nm_dhcp_dhclient, NM_TYPE_DHCP_CLIENT) @@ -302,12 +303,6 @@ out: } -#define DHCP_CLIENT_ID_TAG "send dhcp-client-identifier" -#define DHCP_CLIENT_ID_FORMAT DHCP_CLIENT_ID_TAG " \"%s\"; # added by NetworkManager" -#define DHCP_CLIENT_ID_FORMAT_OCTETS DHCP_CLIENT_ID_TAG " %s; # added by NetworkManager" - -#define DHCP_HOSTNAME_TAG "send host-name" -#define DHCP_HOSTNAME_FORMAT DHCP_HOSTNAME_TAG " \"%s\"; # added by NetworkManager" static gboolean merge_dhclient_config (const char *iface, @@ -318,105 +313,27 @@ merge_dhclient_config (const char *iface, const char *orig_path, GError **error) { - GString *new_contents; - char *orig_contents = NULL; + char *orig = NULL, *new; gboolean success = FALSE; g_return_val_if_fail (iface != NULL, FALSE); g_return_val_if_fail (conf_file != NULL, FALSE); - new_contents = g_string_new (_("# Created by NetworkManager\n")); - if (g_file_test (orig_path, G_FILE_TEST_EXISTS)) { GError *read_error = NULL; - if (!g_file_get_contents (orig_path, &orig_contents, NULL, &read_error)) { + if (!g_file_get_contents (orig_path, &orig, NULL, &read_error)) { nm_log_warn (LOGD_DHCP, "(%s): error reading dhclient configuration %s: %s", iface, orig_path, read_error->message); g_error_free (read_error); } } - /* Add existing options, if any, but ignore stuff NM will replace. */ - if (orig_contents) { - char **lines = NULL, **line; - - g_string_append_printf (new_contents, _("# Merged from %s\n\n"), orig_path); - - lines = g_strsplit_set (orig_contents, "\n\r", 0); - for (line = lines; lines && *line; line++) { - gboolean ignore = FALSE; - - if (!strlen (g_strstrip (*line))) - continue; - - if ( s_ip4 - && nm_setting_ip4_config_get_dhcp_client_id (s_ip4) - && !strncmp (*line, DHCP_CLIENT_ID_TAG, strlen (DHCP_CLIENT_ID_TAG))) - ignore = TRUE; - - if ( s_ip4 - && hostname - && !strncmp (*line, DHCP_HOSTNAME_TAG, strlen (DHCP_HOSTNAME_TAG))) - ignore = TRUE; - - if (!ignore) { - g_string_append (new_contents, *line); - g_string_append_c (new_contents, '\n'); - } - } - - if (lines) - g_strfreev (lines); - g_free (orig_contents); - } else - g_string_append_c (new_contents, '\n'); - - /* Add NM options from connection */ - if (s_ip4) { - const char *tmp; - - tmp = nm_setting_ip4_config_get_dhcp_client_id (s_ip4); - if (tmp) { - gboolean is_octets = TRUE; - const char *p = tmp; - - while (*p) { - if (!isxdigit (*p) && (*p != ':')) { - is_octets = FALSE; - break; - } - p++; - } - - /* If the client ID is just hex digits and : then don't use quotes, - * because dhclient expects either a quoted ASCII string, or a byte - * array formated as hex octets separated by : - */ - if (is_octets) - g_string_append_printf (new_contents, DHCP_CLIENT_ID_FORMAT_OCTETS "\n", tmp); - else - g_string_append_printf (new_contents, DHCP_CLIENT_ID_FORMAT "\n", tmp); - } - - if (hostname) - g_string_append_printf (new_contents, DHCP_HOSTNAME_FORMAT "\n", hostname); - } - - if (anycast_addr) { - g_string_append_printf (new_contents, "interface \"%s\" {\n" - " initial-interval 1; \n" - " anycast-mac ethernet %02x:%02x:%02x:%02x:%02x:%02x;\n" - "}\n", - iface, - anycast_addr[0], anycast_addr[1], - anycast_addr[2], anycast_addr[3], - anycast_addr[4], anycast_addr[5]); - } - - success = g_file_set_contents (conf_file, new_contents->str, -1, error); + new = nm_dhcp_dhclient_create_config (iface, s_ip4, anycast_addr, hostname, orig_path, orig); + g_assert (new); + success = g_file_set_contents (conf_file, new, -1, error); + g_free (new); - g_string_free (new_contents, TRUE); return success; } diff --git a/src/dhcp-manager/tests/Makefile.am b/src/dhcp-manager/tests/Makefile.am new file mode 100644 index 0000000000..b075fd683a --- /dev/null +++ b/src/dhcp-manager/tests/Makefile.am @@ -0,0 +1,28 @@ +INCLUDES = \ + -I$(top_srcdir)/include \ + -I${top_srcdir}/libnm-util \ + -I$(top_srcdir)/src/dhcp-manager + +noinst_PROGRAMS = test-dhcp-dhclient + +####### policy /etc/hosts test ####### + +test_dhcp_dhclient_SOURCES = \ + test-dhcp-dhclient.c + +test_dhcp_dhclient_CPPFLAGS = \ + $(GLIB_CFLAGS) + +test_dhcp_dhclient_LDADD = \ + -ldl \ + $(top_builddir)/src/dhcp-manager/libdhcp-dhclient.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(GLIB_LIBS) + +if WITH_TESTS + +check-local: test-dhcp-dhclient + $(abs_builddir)/test-dhcp-dhclient + +endif + diff --git a/src/dhcp-manager/tests/test-dhcp-dhclient.c b/src/dhcp-manager/tests/test-dhcp-dhclient.c new file mode 100644 index 0000000000..1f5166b003 --- /dev/null +++ b/src/dhcp-manager/tests/test-dhcp-dhclient.c @@ -0,0 +1,203 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2010 Red Hat, Inc. + * + */ + +#include +#include + +#include "nm-dhcp-dhclient-utils.h" +#include "nm-utils.h" + +#define DEBUG 0 + +static void +test_config (const char *orig, + const char *expected, + const char *hostname, + const char *dhcp_client_id, + const char *iface, + guint8 *anycast_addr) +{ + NMSettingIP4Config *s_ip4; + char *new; + + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, dhcp_client_id, NULL); + + new = nm_dhcp_dhclient_create_config (iface, + s_ip4, + anycast_addr, + hostname, + "/path/to/dhclient.conf", + orig); + g_assert (new != NULL); + +#if DEBUG + g_message ("\n- NEW ---------------------------------\n" + "%s" + "+ EXPECTED ++++++++++++++++++++++++++++++\n" + "%s" + "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + new, expected); +#endif + g_assert (strlen (new) == strlen (expected)); + g_assert (strcmp (new, expected) == 0); + g_free (new); +} + +/*******************************************/ + +static const char *orig_missing_expected = \ + "# Created by NetworkManager\n" + "\n" + "option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;\n" + "option ms-classless-static-routes code 249 = array of unsigned integer 8;\n" + "\n" + "also request rfc3442-classless-static-routes;\n" + "also request ms-classless-static-routes;\n" + "also request ntp-servers;\n" + "\n"; + +static void +test_orig_missing (void) +{ + test_config (NULL, orig_missing_expected, + NULL, + NULL, + "eth0", + NULL); +} + +/*******************************************/ + +static const char *override_client_id_orig = \ + "send dhcp-client-identifier 00:30:04:20:7A:08;\n"; + +static const char *override_client_id_expected = \ + "# Created by NetworkManager\n" + "# Merged from /path/to/dhclient.conf\n" + "\n" + "send dhcp-client-identifier 11:22:33:44:55:66; # added by NetworkManager\n" + "\n" + "option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;\n" + "option ms-classless-static-routes code 249 = array of unsigned integer 8;\n" + "\n" + "also request rfc3442-classless-static-routes;\n" + "also request ms-classless-static-routes;\n" + "also request ntp-servers;\n" + "\n"; + +static void +test_override_client_id (void) +{ + test_config (override_client_id_orig, override_client_id_expected, + NULL, + "11:22:33:44:55:66", + "eth0", + NULL); +} + +/*******************************************/ + +static const char *override_hostname_orig = \ + "send host-name \"foobar\";\n"; + +static const char *override_hostname_expected = \ + "# Created by NetworkManager\n" + "# Merged from /path/to/dhclient.conf\n" + "\n" + "send host-name \"blahblah\"; # added by NetworkManager\n" + "\n" + "option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;\n" + "option ms-classless-static-routes code 249 = array of unsigned integer 8;\n" + "\n" + "also request rfc3442-classless-static-routes;\n" + "also request ms-classless-static-routes;\n" + "also request ntp-servers;\n" + "\n"; + +static void +test_override_hostname (void) +{ + test_config (override_hostname_orig, override_hostname_expected, + "blahblah", + NULL, + "eth0", + NULL); +} + +/*******************************************/ + +static const char *existing_alsoreq_orig = \ + "also request something;\n" + "also request another-thing;\n" + ; + +static const char *existing_alsoreq_expected = \ + "# Created by NetworkManager\n" + "# Merged from /path/to/dhclient.conf\n" + "\n" + "option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;\n" + "option ms-classless-static-routes code 249 = array of unsigned integer 8;\n" + "\n" + "also request something;\n" + "also request another-thing;\n" + "also request rfc3442-classless-static-routes;\n" + "also request ms-classless-static-routes;\n" + "also request ntp-servers;\n" + "\n"; + +static void +test_existing_alsoreq (void) +{ + test_config (existing_alsoreq_orig, existing_alsoreq_expected, + NULL, + NULL, + "eth0", + NULL); +} + +/*******************************************/ + +#if GLIB_CHECK_VERSION(2,25,12) +typedef GTestFixtureFunc TCFunc; +#else +typedef void (*TCFunc)(void); +#endif + +#define TESTCASE(t, d) g_test_create_case (#t, 0, d, NULL, (TCFunc) t, NULL) + +int main (int argc, char **argv) +{ + GTestSuite *suite; + + g_test_init (&argc, &argv, NULL); + + g_type_init (); + + suite = g_test_get_root (); + + g_test_suite_add (suite, TESTCASE (test_orig_missing, NULL)); + g_test_suite_add (suite, TESTCASE (test_override_client_id, NULL)); + g_test_suite_add (suite, TESTCASE (test_override_hostname, NULL)); + g_test_suite_add (suite, TESTCASE (test_existing_alsoreq, NULL)); + + return g_test_run (); +} + -- cgit v1.2.1 From e079f25a2b9553b1082aa15057b6dd07decd3558 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 17 Dec 2010 23:05:41 -0600 Subject: dhclient: explicitly request WPAD option (bgo #368423) --- src/dhcp-manager/nm-dhcp-dhclient-utils.c | 3 +++ src/dhcp-manager/tests/test-dhcp-dhclient.c | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/src/dhcp-manager/nm-dhcp-dhclient-utils.c b/src/dhcp-manager/nm-dhcp-dhclient-utils.c index cfc766f253..cc5255ab59 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient-utils.c +++ b/src/dhcp-manager/nm-dhcp-dhclient-utils.c @@ -179,12 +179,15 @@ nm_dhcp_dhclient_create_config (const char *interface, "option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;\n"); g_string_append (new_contents, "option ms-classless-static-routes code 249 = array of unsigned integer 8;\n"); + /* Web Proxy Auto-Discovery option (bgo #368423) */ + g_string_append (new_contents, "option wpad code 252 = string;\n"); g_string_append_c (new_contents, '\n'); /* Everything we want to request from the DHCP server */ add_also_request (alsoreq, "rfc3442-classless-static-routes"); add_also_request (alsoreq, "ms-classless-static-routes"); + add_also_request (alsoreq, "wpad"); add_also_request (alsoreq, "ntp-servers"); /* And add it to the dhclient configuration */ diff --git a/src/dhcp-manager/tests/test-dhcp-dhclient.c b/src/dhcp-manager/tests/test-dhcp-dhclient.c index 1f5166b003..37d37e7f09 100644 --- a/src/dhcp-manager/tests/test-dhcp-dhclient.c +++ b/src/dhcp-manager/tests/test-dhcp-dhclient.c @@ -68,9 +68,11 @@ static const char *orig_missing_expected = \ "\n" "option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;\n" "option ms-classless-static-routes code 249 = array of unsigned integer 8;\n" + "option wpad code 252 = string;\n" "\n" "also request rfc3442-classless-static-routes;\n" "also request ms-classless-static-routes;\n" + "also request wpad;\n" "also request ntp-servers;\n" "\n"; @@ -97,9 +99,11 @@ static const char *override_client_id_expected = \ "\n" "option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;\n" "option ms-classless-static-routes code 249 = array of unsigned integer 8;\n" + "option wpad code 252 = string;\n" "\n" "also request rfc3442-classless-static-routes;\n" "also request ms-classless-static-routes;\n" + "also request wpad;\n" "also request ntp-servers;\n" "\n"; @@ -126,9 +130,11 @@ static const char *override_hostname_expected = \ "\n" "option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;\n" "option ms-classless-static-routes code 249 = array of unsigned integer 8;\n" + "option wpad code 252 = string;\n" "\n" "also request rfc3442-classless-static-routes;\n" "also request ms-classless-static-routes;\n" + "also request wpad;\n" "also request ntp-servers;\n" "\n"; @@ -155,11 +161,13 @@ static const char *existing_alsoreq_expected = \ "\n" "option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;\n" "option ms-classless-static-routes code 249 = array of unsigned integer 8;\n" + "option wpad code 252 = string;\n" "\n" "also request something;\n" "also request another-thing;\n" "also request rfc3442-classless-static-routes;\n" "also request ms-classless-static-routes;\n" + "also request wpad;\n" "also request ntp-servers;\n" "\n"; -- cgit v1.2.1 From 08ba12929d7f478ae9e57bcecb278443f830e923 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 19 Dec 2010 12:10:57 -0600 Subject: dhclient: add testcase for multiline 'also require' statements --- src/dhcp-manager/tests/test-dhcp-dhclient.c | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/dhcp-manager/tests/test-dhcp-dhclient.c b/src/dhcp-manager/tests/test-dhcp-dhclient.c index 37d37e7f09..c1cd6f80c4 100644 --- a/src/dhcp-manager/tests/test-dhcp-dhclient.c +++ b/src/dhcp-manager/tests/test-dhcp-dhclient.c @@ -183,6 +183,43 @@ test_existing_alsoreq (void) /*******************************************/ +static const char *existing_multiline_alsoreq_orig = \ + "also request something another-thing yet-another-thing\n" + " foobar baz blah;\n" + ; + +static const char *existing_multiline_alsoreq_expected = \ + "# Created by NetworkManager\n" + "# Merged from /path/to/dhclient.conf\n" + "\n" + "option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;\n" + "option ms-classless-static-routes code 249 = array of unsigned integer 8;\n" + "option wpad code 252 = string;\n" + "\n" + "also request something;\n" + "also request another-thing;\n" + "also request yet-another-thing;\n" + "also request foobar;\n" + "also request baz;\n" + "also request blah;\n" + "also request rfc3442-classless-static-routes;\n" + "also request ms-classless-static-routes;\n" + "also request wpad;\n" + "also request ntp-servers;\n" + "\n"; + +static void +test_existing_multiline_alsoreq (void) +{ + test_config (existing_multiline_alsoreq_orig, existing_multiline_alsoreq_expected, + NULL, + NULL, + "eth0", + NULL); +} + +/*******************************************/ + #if GLIB_CHECK_VERSION(2,25,12) typedef GTestFixtureFunc TCFunc; #else @@ -205,6 +242,7 @@ int main (int argc, char **argv) g_test_suite_add (suite, TESTCASE (test_override_client_id, NULL)); g_test_suite_add (suite, TESTCASE (test_override_hostname, NULL)); g_test_suite_add (suite, TESTCASE (test_existing_alsoreq, NULL)); + g_test_suite_add (suite, TESTCASE (test_existing_multiline_alsoreq, NULL)); return g_test_run (); } -- cgit v1.2.1 From 2bee736df163b5ee28b13c85f7b63ba55be80415 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 1 Jan 2011 18:00:50 -0600 Subject: modem: handle IP Method changes after modem has been created Some modems don't know their IP method when they are created, but will update it later. Handle the changed signal for that. --- src/modem-manager/nm-modem.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modem-manager/nm-modem.c b/src/modem-manager/nm-modem.c index e07b818bbb..b3f7eaa1cb 100644 --- a/src/modem-manager/nm-modem.c +++ b/src/modem-manager/nm-modem.c @@ -876,6 +876,12 @@ modem_properties_changed (DBusGProxy *proxy, priv->mm_enabled = g_value_get_boolean (value); g_object_notify (G_OBJECT (self), NM_MODEM_ENABLED); } + + value = g_hash_table_lookup (props, "IpMethod"); + if (value && G_VALUE_HOLDS_UINT (value)) { + priv->ip_method = g_value_get_uint (value); + g_object_notify (G_OBJECT (self), NM_MODEM_IP_METHOD); + } } /*****************************************************************************/ -- cgit v1.2.1 From 81cb867e9fbde39d70154f832c25edaa2d0afc28 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 2 Jan 2011 10:24:23 -0600 Subject: policy: don't update hostname on exit It's a leftover from when /etc/hosts got fixed up, and since that isn't being done anymore, there's no reason to touch the hostname on exit. It will already have been updated in response to device deactivation (if the hostname was DHCP-provided for example) so it shouldn't need to be touched on exit. This also removes a potential crash on shutdown when systemd or another startup manager kills D-Bus before NetworkManager, which made the dispatcher code angry (which got executed on hostname change). --- src/nm-policy.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/nm-policy.c b/src/nm-policy.c index b5c212929b..53557039e5 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -1222,15 +1222,6 @@ nm_policy_destroy (NMPolicy *policy) } g_slist_free (policy->dev_signal_ids); - /* Rewrite /etc/hosts on exit to ensure we don't leave stale IP addresses - * lying around. FIXME: this will take out a valid IP address of an - * ethernet device we're leaving active (ie, a connection we can "assume" - * when NM starts again). - */ - policy->default_device4 = NULL; - policy->default_device6 = NULL; - update_system_hostname (policy, NULL, NULL); - g_free (policy->orig_hostname); g_free (policy->cur_hostname); -- cgit v1.2.1 From 15a9f29a14783fcd1b8e936a8338452737825726 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 2 Jan 2011 10:49:36 -0600 Subject: core: handle D-Bus disconnect better on exit We're just going to quit here anyway, so we don't need to make sure the property filter is unregistered. Fixes a crash on exit if D-Bus has quit before NM has. --- src/nm-manager.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index afcc6add54..9bd5354152 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -4364,10 +4364,11 @@ dispose (GObject *object) /* Unregister property filter */ bus = nm_dbus_manager_get_connection (priv->dbus_mgr); - g_assert (bus); - dbus_connection = dbus_g_connection_get_connection (bus); - g_assert (dbus_connection); - dbus_connection_remove_filter (dbus_connection, prop_filter, manager); + if (bus) { + dbus_connection = dbus_g_connection_get_connection (bus); + g_assert (dbus_connection); + dbus_connection_remove_filter (dbus_connection, prop_filter, manager); + } g_object_unref (priv->dbus_mgr); if (priv->bluez_mgr) -- cgit v1.2.1