From 21965b14315358740c99e702d9dcdf99b0cebf9a Mon Sep 17 00:00:00 2001 From: Krishna Babu K Date: Sat, 30 Jan 2010 14:05:37 -0800 Subject: [PATCH 1/7] po: updated Telugu translation (bgo #608426) --- po/te.po | 265 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 215 insertions(+), 50 deletions(-) diff --git a/po/te.po b/po/te.po index 5dd39f9965..7b3ace2288 100644 --- a/po/te.po +++ b/po/te.po @@ -1,15 +1,15 @@ -# translation of NetworkManager.po.master.te.po to Telugu +# translation of NetworkManager.master.te.po to Telugu # Telugu translation of NetworkManager. # Copyright (C) 2009 NetworkManager's COPYRIGHT HOLDER # This file is distributed under the same license as the NetworkManager package. # -# Krishna Babu K , 2009. +# Krishna Babu K , 2009, 2010. msgid "" msgstr "" -"Project-Id-Version: NetworkManager.po.master.te\n" +"Project-Id-Version: NetworkManager.master.te\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" -"POT-Creation-Date: 2009-06-12 03:24+0000\n" -"PO-Revision-Date: 2009-06-12 17:50+0530\n" +"POT-Creation-Date: 2009-09-29 03:25+0000\n" +"PO-Revision-Date: 2010-01-29 15:20+0530\n" "Last-Translator: Krishna Babu K \n" "Language-Team: Telugu \n" "MIME-Version: 1.0\n" @@ -17,6 +17,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" "Plural-Forms: nplurals=2; plural=(n!=1);\n\n" +"\n" #: ../libnm-util/crypto.c:120 #, c-format @@ -103,8 +104,9 @@ msgstr "IV నిల్వవుంచుటకు సరిపోవునం 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:335 #, c-format msgid "Private key cipher '%s' was unknown." msgstr "వ్యక్తిగత కీ సైఫర్ '%s' అనునది తెలియనిది." @@ -124,72 +126,111 @@ msgstr "వ్యక్తిగత కీ రకమును నిర్ణయ msgid "Not enough memory to store decrypted private key." 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:266 +#, 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:277 #, 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:355 +#, 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 #, c-format msgid "Failed to initialize the crypto engine: %d." msgstr "క్రిప్టో యింజన్ సిద్దము చేయుటలో విఫలమైంది: %d." @@ -199,105 +240,186 @@ 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:363 +#, c-format +#| msgid "Failed to initialize the decryption cipher slot." +msgid "Failed to initialize the encryption cipher slot." +msgstr "ఎన్క్రిప్షన్ సైఫర్ స్లాట్‌ను సిద్దముచేయుటలో విఫలమైంది." + +#: ../libnm-util/crypto_nss.c:371 +#, c-format +#| msgid "Failed to set symmetric key for decryption." +msgid "Failed to set symmetric key for encryption." +msgstr "ఎన్క్రిప్షన్ కొరకు సిమ్మెట్రిక్ కీను అమర్చుటలో విఫలమైంది." + +#: ../libnm-util/crypto_nss.c:379 +#, c-format +#| msgid "Failed to set IV for decryption." +msgid "Failed to set IV for encryption." +msgstr "ఎన్క్రిప్షన్ కొరకు IV అమర్చుటలో విఫలమైంది." + +#: ../libnm-util/crypto_nss.c:387 +#, c-format +#| msgid "Failed to initialize the decryption context." +msgid "Failed to initialize the encryption context." +msgstr "ఎన్క్రిప్షన్ సందర్భమును సిద్దముచేయుటలో విఫలమైంది." + +#: ../libnm-util/crypto_nss.c:395 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to encrypt: %d." +msgstr "ఎన్క్రిప్టు చేయుటకు విఫలమైంది: %d." + +#: ../libnm-util/crypto_nss.c:403 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "ఎన్క్రిప్టు చేసిన తర్వాత అనుకోని డాటా మొత్తము." + +#: ../libnm-util/crypto_nss.c:446 #, c-format msgid "Couldn't decode certificate: %d" msgstr "దృవీకరణపత్రమును డీకోడ్ చేయలేక పోయింది: %d" -#: ../libnm-util/crypto_nss.c:319 +#: ../libnm-util/crypto_nss.c:481 #, c-format msgid "Couldn't convert password to UCS2: %d" msgstr "సంకేతపదమును UCS2కు మార్చలేక పోయింది: %d" -#: ../libnm-util/crypto_nss.c:347 +#: ../libnm-util/crypto_nss.c:509 #, 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:518 #, 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:527 #, 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:458 +#: ../libnm-util/crypto_nss.c:556 +#| msgid "Could not decode private key." +msgid "Could not generate random data." +msgstr "యాదృశ్చిక డాటాను జనియింపచేయలేక పోయింది." + +#: ../libnm-util/nm-utils.c:1522 +#, c-format +#| msgid "Not enough memory to decrypt private key." +msgid "Not enough memory to make encryption key." +msgstr "ఎన్క్రిప్షన్ కీను తయారుచేయుటకు సరిపోవు మెమొరీ లేదు." + +#: ../libnm-util/nm-utils.c:1633 +#| 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:1645 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "IVను PEM ఫైలునకు వ్రాయుటకు మెమొరీను కేటాయించలేక పోయింది." + +#: ../libnm-util/nm-utils.c:1657 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "ఎన్క్రిప్టు చేసిన కీను PEM ఫైలునకు వ్రాయుటకు మెమొరీను కేటాయించలేక పోయింది." + +#: ../libnm-util/nm-utils.c:1676 +#, c-format +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file data." +msgstr "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 #, c-format msgid "error processing netlink message: %s" msgstr "నెట్‌లింక్ సందేశమును ప్రోసెసింగ్ చేయుటలో దోషము: %s" -#: ../src/nm-netlink-monitor.c:255 +#: ../src/nm-netlink-monitor.c:260 #, c-format msgid "unable to allocate netlink handle for monitoring link status: %s" msgstr "లింకు స్థితిని పర్యవేక్షించుటకు నెట్‌లింకు హాండిల్‌ను కేటాయించలేక పోయింది: %s" -#: ../src/nm-netlink-monitor.c:265 +#: ../src/nm-netlink-monitor.c:270 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "లింకు స్థితిని పర్యవేక్షించుటకు నెట్‌లింకుకు అనుసంధానము కాలేకపోయింది: %s" -#: ../src/nm-netlink-monitor.c:273 +#: ../src/nm-netlink-monitor.c:278 #, c-format msgid "unable to join netlink group for monitoring link status: %s" msgstr "లింకు స్థితిని పర్యవేక్షించుటకు నెట్‌లింకు సమూహమును కలుపలేక పోయింది:%s" -#: ../src/nm-netlink-monitor.c:281 +#: ../src/nm-netlink-monitor.c:286 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "లింకు స్థితిని పర్యవేక్షించుటకు నెట్‌లింకు క్యాచీని కేటాయించలేక పోయింది: %s" -#: ../src/nm-netlink-monitor.c:422 +#: ../src/nm-netlink-monitor.c:494 +#: ../src/ip6-manager/nm-netlink-listener.c:382 +msgid "error occurred while waiting for data on socket" +msgstr "సాకెట్ నందు డాటా కొరకు వేచివుండునప్పుడు దోషము సంభవించినది" + +#: ../src/nm-netlink-monitor.c:558 #, c-format msgid "error updating link cache: %s" msgstr "లింకు క్యాచీని నవీకరించుటలో దోషము: %s" -#: ../src/nm-netlink-monitor.c:488 -msgid "error occurred while waiting for data on socket" -msgstr "సాకెట్ నందు డాటా కొరకు వేచివుండునప్పుడు దోషము సంభవించినది" - -#: ../src/NetworkManager.c:329 +#: ../src/NetworkManager.c:330 #, 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:97 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 msgid "# Created by NetworkManager\n" msgstr "# నెట్వర్కునిర్వాహిక ద్వారా సృష్టించబడింది\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:103 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 #, c-format msgid "" "# Merged from %s\n" @@ -306,28 +428,71 @@ msgstr "" "# %sనుండి కలుపబడింది\n" "\n" -#: ../src/named-manager/nm-named-manager.c:255 +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +#| msgid "unable to allocate netlink handle for monitoring link status: %s" +msgid "unable to allocate netlink handle: %s" +msgstr "నెట్‌లింక్ సంభాలికను కేటాయించలేక పోయింది: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +#| msgid "unable to connect to netlink for monitoring link status: %s" +msgid "unable to connect to netlink: %s" +msgstr "నెట్‌లింక్‌కు అనుసంధానము కాలేకపోయింది: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +#| msgid "unable to join netlink group for monitoring link status: %s" +msgid "unable to join netlink group: %s" +msgstr "నెట్‌లింకు సమూహాన్ని చేర్చుకొనలేక పోయింది: %s" + +#: ../src/named-manager/nm-named-manager.c:315 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "గమనిక: libc రిజాల్వర్ 3 నామపు సేవికలకన్నా యెక్కువ వాటికి మద్దతివ్వలేదు." -#: ../src/named-manager/nm-named-manager.c:257 +#: ../src/named-manager/nm-named-manager.c:317 msgid "The nameservers listed below may not be recognized." msgstr "క్రిందన జాబితాచేసివున్న నామపుసేవికలు గుర్తించబడక పోవచ్చును." -#: ../src/system-settings/nm-default-wired-connection.c:182 +#: ../src/system-settings/nm-default-wired-connection.c:194 #, c-format msgid "Auto %s" msgstr "స్వయంచాలక %s" -#: ../system-settings/plugins/ifcfg-rh/reader.c:2168 +#: ../system-settings/plugins/ifcfg-rh/reader.c:2406 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:2 +#: ../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 "రక్షిత 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 నెట్వర్కు ద్వారా అనుసంధానములను భాగస్వామ్యపరచుట సిస్టమ్ విధానము నిరోధించుచున్నది" + From f6c383ff14412ea264fa8740dec84f92a89bd385 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 1 Feb 2010 17:29:58 -0800 Subject: [PATCH 2/7] policy: be more selective when adding hostname to /etc/hosts (debian #567411) If the user has already mapped the hostname to some other address, assume the user knows what they are doing (since they probably do) and leave that mapping alone, and create a minimal 127.0.0.1 entry. If there was no hostname mapping, add it to the 127.0.0.1 entry like NM did before. --- src/NetworkManagerPolicy.c | 124 ++++++++++++++++++++++++++++++++++--- 1 file changed, 116 insertions(+), 8 deletions(-) diff --git a/src/NetworkManagerPolicy.c b/src/NetworkManagerPolicy.c index 7034520fb0..1b7801c510 100644 --- a/src/NetworkManagerPolicy.c +++ b/src/NetworkManagerPolicy.c @@ -252,13 +252,84 @@ get_best_device (NMManager *manager, NMActRequest **out_req) return best; } +static gboolean +is_localhost_mapping (const char *str) +{ + return (!strncmp (str, "127.0.0.1", strlen ("127.0.0.1")) && strstr (str, "localhost")); +} + +static gboolean +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 && !strncmp (start, token, (p - start))) + return TRUE; /* found */ + + /* not found; advance start and continue looking */ + start = p + 1; + } + p++; + } + + return FALSE; +} + +#if 0 +/* Testcase for find_token; break it out and add it to the testsuite */ + +typedef struct { + const char *line; + const char *token; + gboolean expected; +} Foo; + +static Foo foo[] = { + { "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 }, + { "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 } +}; + +int main(int argc, char **argv) +{ + Foo *iter = &foo[0]; + + while (iter->line) { + if (find_token (iter->line, iter->token) != iter->expected) { + g_message ("Failed: '%s' <= '%s' (%d)", iter->line, iter->token, iter->expected); + return 1; + } + iter++; + } + + g_message ("Success"); + return 0; +} +#endif + #define FALLBACK_HOSTNAME "localhost.localdomain" static gboolean update_etc_hosts (const char *hostname) { char *contents = NULL; - char **lines = NULL, **line; + char **lines = NULL, **line, **host_mapping = NULL; GError *error = NULL; gboolean initial_comments = TRUE; gboolean added = FALSE; @@ -285,25 +356,62 @@ update_etc_hosts (const char *hostname) return FALSE; } - /* Replace any 127.0.0.1 entry that is at the beginning of the file or right - * after initial comments. If there is no 127.0.0.1 entry at the beginning - * or after initial comments, add one there and ignore any other 127.0.0.1 - * entries. + /* Two-pass modification of /etc/hosts: + * + * 1) Look for a non-comment, non-localhost line that contains the current + * hostname. Mark that line. + * + * 2) For each line in the existing /etc/hosts, add it to the new /etc/hosts + * unless it starts with 127.0.0.1 and is right after the initial comments + * (if any) and contains "localhost". */ + + /* Find any existing hostname mapping */ for (line = lines; lines && *line; line++) { + /* Look for any line that (a) contains the current hostname, and + * (b) does not start with '127.0.0.1' and contain 'localhost'. + */ + if ( strlen (*line) + && (*line[0] != '#') + && find_token (*line, hostname) + && !is_localhost_mapping (*line)) { + host_mapping = line; + break; + } + } + + /* 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'. + */ + for (line = lines, initial_comments = TRUE; lines && *line; line++) { gboolean add_line = TRUE; /* This is the first line after the initial comments */ - if (initial_comments && (*line[0] != '#')) { + if (strlen (*line) && initial_comments && (*line[0] != '#')) { initial_comments = FALSE; - g_string_append_printf (new_contents, "127.0.0.1\t%s", hostname); + + /* If some other line contained the hostname, 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 (host_mapping) + g_string_append (new_contents, "127.0.0.1"); + else + g_string_append_printf (new_contents, "127.0.0.1\t%s", hostname); + if (strcmp (hostname, FALLBACK_HOSTNAME)) g_string_append_printf (new_contents, "\t" FALLBACK_HOSTNAME); + g_string_append (new_contents, "\tlocalhost\n"); added = TRUE; /* Don't add the entry if it's supposed to be the actual localhost reverse mapping */ - if (!strncmp (*line, "127.0.0.1", strlen ("127.0.0.1")) && strstr (*line, "localhost")) + if (is_localhost_mapping (*line)) add_line = FALSE; } From 74dfcf6ad794a79da2cb4762438e510ae60c8c8b Mon Sep 17 00:00:00 2001 From: Tournaris Pavlos Date: Tue, 2 Feb 2010 09:48:40 -0800 Subject: [PATCH 3/7] po: update Greek translation (bgo #608810) --- po/el.po | 103 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 73 insertions(+), 30 deletions(-) diff --git a/po/el.po b/po/el.po index 8a36618ff1..7890d9b9ce 100644 --- a/po/el.po +++ b/po/el.po @@ -4,21 +4,22 @@ # Nikos Charonitakis , 2005. # Kostas Papadimas , 2005-2007. # Dimitris Glezos , 2006. -# Jennie Petoumenou , 2008. +# Jennie Petoumenou , 2008, 2009. +# Tournaris Pavlos , 2009. 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: 2008-12-07 22:31+0000\n" -"PO-Revision-Date: 2008-12-18 16:53+0100\n" -"Last-Translator: Jennie Petoumenou \n" -"Language-Team: Greek \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" "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: Lokalize 0.2\n" +"X-Generator: Lokalize 0.3\n" #: ../libnm-util/crypto.c:120 #, c-format @@ -28,7 +29,7 @@ msgstr "Το αρχείο κλειδιού PEM δεν είχε ετικέτα τ #: ../libnm-util/crypto.c:130 #, c-format msgid "Doesn't look like a PEM private key file." -msgstr "Δεν μοιάζει με αρχείο ιδιωτικού κλειδιού PEM." +msgstr "Δε μοιάζει με αρχείο ιδιωτικού κλειδιού PEM." #: ../libnm-util/crypto.c:138 #, c-format @@ -75,7 +76,7 @@ msgstr "Αδύνατη η αποκωδικοποίηση του ιδιωτικο #: ../libnm-util/crypto.c:267 #, c-format msgid "PEM certificate '%s' had no end tag '%s'." -msgstr "Το πιστοποιητικό PEM '%s' δεν διέθετε ετικέτα τέλους '%s'." +msgstr "Το πιστοποιητικό PEM '%s' δε διέθετε ετικέτα τέλους '%s'." #: ../libnm-util/crypto.c:277 #, c-format @@ -96,7 +97,7 @@ msgstr "Δεν επαρκεί η μνήμη για την αποθήκευση #: ../libnm-util/crypto.c:324 #, c-format msgid "IV must be an even number of bytes in length." -msgstr "Το μήκος του IV πρέπει να αντιστοιχεί σε άρτιο αριθμό bytes." +msgstr "Το μήκος του IV πρέπει να αντιστοιχεί σε άρτιο αριθμό byte." #: ../libnm-util/crypto.c:333 #, c-format @@ -199,9 +200,10 @@ 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 #, c-format msgid "Failed to initialize the crypto engine: %d." -msgstr "Απέτυχε η αρχικοποίηση της μηχανής crypto: %d." +msgstr "Απέτυχε η αρχικοποίηση της μηχανής κρυπτογραφίας: %d." #: ../libnm-util/crypto_nss.c:111 #, c-format @@ -256,67 +258,62 @@ msgstr "Αδύνατη η αρχικοποίηση του αποκωδικοπο #: ../libnm-util/crypto_nss.c:356 #, c-format msgid "Couldn't decode PKCS#12 file: %d" -msgstr "Αδύνατη η αρχικοποίηση του αρχείου PKCS#12: %d" +msgstr "Αδύνατη η αποκωδικοποίηση του αρχείου PKCS#12: %d" #: ../libnm-util/crypto_nss.c:365 #, 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:454 +#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 #, c-format msgid "error processing netlink message: %s" msgstr "σφάλμα κατά την επεξεργασία μηνύματος netlink: %s" -#: ../src/nm-netlink-monitor.c:251 +#: ../src/nm-netlink-monitor.c:260 #, c-format msgid "unable to allocate netlink handle for monitoring link status: %s" msgstr "" "αδύνατη η δέσμευση χειριστή netlink για την παρακολούθηση της κατάστασης της " "σύνδεσης: %s" -#: ../src/nm-netlink-monitor.c:261 +#: ../src/nm-netlink-monitor.c:270 #, c-format msgid "unable to connect to netlink for monitoring link status: %s" msgstr "" "αδύνατη η σύνδεση με το netlink για την παρακολούθηση της κατάστασης της " "σύνδεσης: %s" -#: ../src/nm-netlink-monitor.c:269 +#: ../src/nm-netlink-monitor.c:278 #, c-format msgid "unable to join netlink group for monitoring link status: %s" msgstr "" "αδύνατη η ένταξη στην ομάδα του netlink για την παρακολούθηση της κατάστασης " "της σύνδεσης: %s" -#: ../src/nm-netlink-monitor.c:277 +#: ../src/nm-netlink-monitor.c:286 #, c-format msgid "unable to allocate netlink link cache for monitoring link status: %s" msgstr "" "αδύνατη η εκχώρηση λανθάνουσας μνήμης στη σύνδεση netlink για την " "παρακολούθηση της κατάστασης της σύνδεσης δικτύου: %s" -#: ../src/nm-netlink-monitor.c:418 -#, c-format -msgid "error updating link cache: %s" -msgstr "σφάλμα κατά την ενημέρωση της λανθάνουσας μνήμης της σύνδεσης: %s" - -#: ../src/nm-netlink-monitor.c:484 +#: ../src/nm-netlink-monitor.c:494 msgid "error occurred while waiting for data on socket" msgstr "σφάλμα κατά την αναμονή για δεδομένα στην υποδοχή" -#: ../src/NetworkManager.c:293 +#: ../src/NetworkManager.c:330 #, 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:88 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 msgid "# Created by NetworkManager\n" msgstr "# Δημιουργήθηκε από το NetworkManager\n" -#: ../src/dhcp-manager/nm-dhcp-dhclient.c:94 +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 #, c-format msgid "" "# Merged from %s\n" @@ -325,18 +322,64 @@ msgstr "" "# Συγχωνεύθηκαν από το %s\n" "\n" -#: ../src/named-manager/nm-named-manager.c:256 +#: ../src/named-manager/nm-named-manager.c:315 msgid "NOTE: the libc resolver may not support more than 3 nameservers." msgstr "" "ΣΗΜΕΙΩΣΗ: Ο libc resolver μπορεί να μην υποστηρίζει περισσότερους από 3 " "εξυπηρετητές ονομάτων." -#: ../src/named-manager/nm-named-manager.c:258 +#: ../src/named-manager/nm-named-manager.c:317 msgid "The nameservers listed below may not be recognized." msgstr "Οι κάτωθι εξυπηρετητές ονομάτων ίσως να μην αναγνωρίζονται." -#: ../system-settings/src/main.c:380 +#: ../src/system-settings/nm-default-wired-connection.c:194 #, c-format msgid "Auto %s" msgstr "Αυτόματο %s" +#: ../system-settings/plugins/ifcfg-rh/reader.c:2446 +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" From 2a7a4ebaf6112ff82e91a5cf3b3639db022b8a1a Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Mon, 8 Feb 2010 09:34:28 -0800 Subject: [PATCH 4/7] ifupdown: interpret allow-hotplug as autoconnect (debian #568784) --- system-settings/plugins/ifupdown/plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-settings/plugins/ifupdown/plugin.c b/system-settings/plugins/ifupdown/plugin.c index 18afce4f4a..ae09840eb1 100644 --- a/system-settings/plugins/ifupdown/plugin.c +++ b/system-settings/plugins/ifupdown/plugin.c @@ -355,7 +355,7 @@ SCPluginIfupdown_init (NMSystemConfigInterface *config) ifparser_init (); block = ifparser_getfirst (); while (block) { - if(!strcmp ("auto", block->type)) + 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)) { NMIfupdownConnection *exported; From 21242568a6191a6c8067bf5af42135d21c5dac41 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 8 Feb 2010 13:16:14 -0800 Subject: [PATCH 5/7] gsm: handle PIN requests during modem enable too (bgo #609197) Fix a regression after f61af8e139a35cfa52e443fdc66ad4c05851085f where a PIN request while enabling the modem wouldn't properly make NM request secrets from the settings service. --- src/modem-manager/nm-modem-gsm.c | 121 +++++++++++++++++++++++++------ 1 file changed, 100 insertions(+), 21 deletions(-) diff --git a/src/modem-manager/nm-modem-gsm.c b/src/modem-manager/nm-modem-gsm.c index e77b9e70f8..f3e4d23b63 100644 --- a/src/modem-manager/nm-modem-gsm.c +++ b/src/modem-manager/nm-modem-gsm.c @@ -173,6 +173,41 @@ clear_pin (NMDevice *device) g_object_set (G_OBJECT (setting), NM_SETTING_GSM_PIN, NULL, NULL); } +static void +request_secrets (NMDevice *device, + const char *setting_name, + const char *hint1, + const char *hint2, + gboolean always_ask) +{ + NMActRequest *req; + NMConnection *connection; + guint32 tries = 0; + + g_return_if_fail (device != NULL); + g_return_if_fail (hint1 || hint2); + + req = nm_device_get_act_request (device); + g_assert (req); + connection = nm_act_request_get_connection (req); + g_assert (connection); + + nm_device_state_changed (device, NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE); + + if (!always_ask) + tries = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (connection), GSM_SECRETS_TRIES)); + + nm_act_request_get_secrets (req, + setting_name ? setting_name : NM_SETTING_GSM_SETTING_NAME, + (tries || always_ask) ? TRUE : FALSE, + SECRETS_CALLER_GSM, + hint1, + hint2); + + if (!always_ask) + g_object_set_data (G_OBJECT (connection), GSM_SECRETS_TRIES, GUINT_TO_POINTER (++tries)); +} + static void stage1_prepare_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { @@ -198,15 +233,9 @@ stage1_prepare_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_d error && error->message ? error->message : "(unknown)"); } - if (required_secret) { - nm_device_state_changed (device, NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE); - nm_act_request_get_secrets (nm_device_get_act_request (device), - NM_SETTING_GSM_SETTING_NAME, - retry_secret, - SECRETS_CALLER_GSM, - required_secret, - NULL); - } else + if (required_secret) + request_secrets (device, NULL, required_secret, NULL, retry_secret); + else nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, translate_mm_error (error)); g_error_free (error); @@ -287,6 +316,59 @@ do_connect (NMModem *modem) g_hash_table_destroy (properties); } +static void +stage1_pin_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + GError *error = NULL; + + if (dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID)) { + /* Success; go back and try the enable again */ + nm_device_activate_schedule_stage1_device_prepare (device); + } else { + nm_warning ("GSM PIN unlock failed: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_error_free (error); + + clear_pin (device); + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_GSM_PIN_CHECK_FAILED); + } +} + +static void +handle_enable_pin_required (NMDevice *device) +{ + NMActRequest *req; + NMConnection *connection; + NMSettingGsm *s_gsm; + const char *pin = NULL; + + req = nm_device_get_act_request (device); + g_assert (req); + connection = nm_act_request_get_connection (req); + g_assert (connection); + + /* See if we have a PIN already */ + s_gsm = (NMSettingGsm *) nm_connection_get_setting (connection, NM_TYPE_SETTING_GSM); + if (s_gsm) + pin = nm_setting_gsm_get_pin (s_gsm); + + /* If we do, send it */ + if (pin) { + NMModem *modem = NM_MODEM (device); + + dbus_g_proxy_begin_call_with_timeout (nm_modem_get_proxy (modem, MM_DBUS_INTERFACE_MODEM_GSM_CARD), + "SendPin", stage1_pin_done, + modem, NULL, 10000, + G_TYPE_STRING, pin, + G_TYPE_INVALID); + } else { + /* Otherwise try to get the PIN */ + request_secrets (device, NULL, NM_SETTING_GSM_PIN, NULL, FALSE); + } +} + static void stage1_enable_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { @@ -299,8 +381,13 @@ stage1_enable_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_da nm_warning ("GSM modem enable failed: (%d) %s", error ? error->code : -1, error && error->message ? error->message : "(unknown)"); + + if (dbus_g_error_has_name (error, MM_MODEM_ERROR_SIM_PIN)) + handle_enable_pin_required (device); + else + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, translate_mm_error (error)); + g_error_free (error); - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_NONE); } } @@ -312,7 +399,6 @@ real_act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason) const char *setting_name; GPtrArray *hints = NULL; const char *hint1 = NULL, *hint2 = NULL; - guint32 tries; req = nm_device_get_act_request (device); g_assert (req); @@ -337,6 +423,8 @@ real_act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason) return NM_ACT_STAGE_RETURN_POSTPONE; } + /* Get the required secrets */ + if (hints) { if (hints->len > 0) hint1 = g_ptr_array_index (hints, 0); @@ -344,16 +432,7 @@ real_act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason) hint2 = g_ptr_array_index (hints, 1); } - nm_device_state_changed (device, NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE); - - tries = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (connection), GSM_SECRETS_TRIES)); - nm_act_request_get_secrets (req, - setting_name, - tries ? TRUE : FALSE, - SECRETS_CALLER_GSM, - hint1, - hint2); - g_object_set_data (G_OBJECT (connection), GSM_SECRETS_TRIES, GUINT_TO_POINTER (++tries)); + request_secrets (device, setting_name, hint1, hint2, FALSE); if (hints) g_ptr_array_free (hints, TRUE); From 096f87e16034e216f06da97c04deb3821f68b95f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 9 Feb 2010 23:50:26 -0800 Subject: [PATCH 6/7] modem: ignore Enabled property changes while activating Due to various ordering issues in ModemManager, when the Enable() call fails because a PIN is required, MM will disable the modem and *then* complete the dbus call. That means that NM gets the Enable property change before the Enable() call completes, and NM would then transition the device to DISCONNECTED. What we really want to do is get the response from MM and then figure out whether to fail activation or get secrets, not go to DISCONNECTED. To fix this, ignore Enabled property changes to FALSE while activating so we can handle it ourselves. There are still a few fixes left in nm-applet to make the secrets request for PINs work on-the-fly, but saved in the connection works fine. --- src/modem-manager/nm-modem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modem-manager/nm-modem.c b/src/modem-manager/nm-modem.c index 4788673c1f..5b001eec52 100644 --- a/src/modem-manager/nm-modem.c +++ b/src/modem-manager/nm-modem.c @@ -622,7 +622,7 @@ modem_properties_changed (DBusGProxy *proxy, if (priv->mm_enabled == FALSE) { state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (self)); - if (IS_ACTIVATING_STATE (state) || (state == NM_DEVICE_STATE_ACTIVATED)) { + if (state == NM_DEVICE_STATE_ACTIVATED) { nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_DISCONNECTED, NM_DEVICE_STATE_REASON_NONE); From b4d0114ff623b6560d7f22f49d0f64ecf159e642 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 11 Feb 2010 11:28:59 -0800 Subject: [PATCH 7/7] gsm: split password and PIN try counters To ensure that getting one wrong doesn't force a request for another. --- src/modem-manager/nm-modem-gsm.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/modem-manager/nm-modem-gsm.c b/src/modem-manager/nm-modem-gsm.c index f3e4d23b63..fcc811fc4c 100644 --- a/src/modem-manager/nm-modem-gsm.c +++ b/src/modem-manager/nm-modem-gsm.c @@ -51,6 +51,7 @@ typedef enum { #define GSM_SECRETS_TRIES "gsm-secrets-tries" +#define PIN_TRIES "pin-tries" G_DEFINE_TYPE (NMModemGsm, nm_modem_gsm, NM_TYPE_MODEM) @@ -178,6 +179,7 @@ request_secrets (NMDevice *device, const char *setting_name, const char *hint1, const char *hint2, + const char *tries_tag, gboolean always_ask) { NMActRequest *req; @@ -195,7 +197,7 @@ request_secrets (NMDevice *device, nm_device_state_changed (device, NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE); if (!always_ask) - tries = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (connection), GSM_SECRETS_TRIES)); + tries = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (connection), tries_tag)); nm_act_request_get_secrets (req, setting_name ? setting_name : NM_SETTING_GSM_SETTING_NAME, @@ -205,7 +207,7 @@ request_secrets (NMDevice *device, hint2); if (!always_ask) - g_object_set_data (G_OBJECT (connection), GSM_SECRETS_TRIES, GUINT_TO_POINTER (++tries)); + g_object_set_data (G_OBJECT (connection), tries_tag, GUINT_TO_POINTER (++tries)); } static void @@ -221,9 +223,10 @@ stage1_prepare_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_d const char *required_secret = NULL; gboolean retry_secret = FALSE; - if (dbus_g_error_has_name (error, MM_MODEM_ERROR_SIM_PIN)) + if (dbus_g_error_has_name (error, MM_MODEM_ERROR_SIM_PIN)) { + clear_pin (device); required_secret = NM_SETTING_GSM_PIN; - else if (dbus_g_error_has_name (error, MM_MODEM_ERROR_SIM_WRONG)) { + } else if (dbus_g_error_has_name (error, MM_MODEM_ERROR_SIM_WRONG)) { clear_pin (device); required_secret = NM_SETTING_GSM_PIN; retry_secret = TRUE; @@ -234,7 +237,7 @@ stage1_prepare_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_d } if (required_secret) - request_secrets (device, NULL, required_secret, NULL, retry_secret); + request_secrets (device, NULL, required_secret, NULL, PIN_TRIES, retry_secret); else nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, translate_mm_error (error)); @@ -365,7 +368,7 @@ handle_enable_pin_required (NMDevice *device) G_TYPE_INVALID); } else { /* Otherwise try to get the PIN */ - request_secrets (device, NULL, NM_SETTING_GSM_PIN, NULL, FALSE); + request_secrets (device, NULL, NM_SETTING_GSM_PIN, NULL, PIN_TRIES, FALSE); } } @@ -424,7 +427,6 @@ real_act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason) } /* Get the required secrets */ - if (hints) { if (hints->len > 0) hint1 = g_ptr_array_index (hints, 0); @@ -432,7 +434,7 @@ real_act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason) hint2 = g_ptr_array_index (hints, 1); } - request_secrets (device, setting_name, hint1, hint2, FALSE); + request_secrets (device, setting_name, hint1, hint2, GSM_SECRETS_TRIES, FALSE); if (hints) g_ptr_array_free (hints, TRUE); @@ -562,6 +564,7 @@ real_deactivate_quickly (NMDevice *device) connection = nm_act_request_get_connection (req); g_assert (connection); g_object_set_data (G_OBJECT (connection), GSM_SECRETS_TRIES, NULL); + g_object_set_data (G_OBJECT (connection), PIN_TRIES, NULL); } if (NM_DEVICE_CLASS (nm_modem_gsm_parent_class)->deactivate_quickly)