Merge remote branch 'origin/master' into rm-userset

This commit is contained in:
Dan Williams
2010-09-16 17:10:49 -05:00
74 changed files with 2304 additions and 775 deletions

View File

@@ -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)])
if test "x$with_systemdsystemunitdir" != xno; then
AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$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)
@@ -487,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

View File

@@ -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
@@ -243,7 +243,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 */

View File

@@ -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

View File

@@ -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<hwaddr>\fP,\fI<hwaddr>\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

View File

@@ -22,7 +22,7 @@
.\"
.\" Copyright (C) 2010 Red Hat, Inc.
.\"
.TH NMCLI "1" "14 April 2010"
.TH NMCLI "1" "9 September 2010"
.SH NAME
nmcli \- command-line tool for controlling NetworkManager
@@ -312,10 +312,54 @@ 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
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).

View File

@@ -17,7 +17,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

View File

@@ -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 ""

View File

@@ -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 "নিম্নলিখিত নাম-সেৱকসমূহ চিনাক্ত ন'হ'বও পাৰে ।"

View File

@@ -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ŭ."

View File

@@ -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 "Сървърите за имена отдолу могат да не бъдат разпознати."

View File

@@ -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 "নিম্নলিখিত নেম-সার্ভারগুলি সনাক্ত না হওয়ার সম্ভাবনা রয়েছে।"

View File

@@ -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."

View File

@@ -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."

View File

@@ -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."

1610
po/el.po

File diff suppressed because it is too large Load Diff

View File

@@ -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."

View File

@@ -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."

View File

@@ -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."

View File

@@ -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."

View File

@@ -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."

View File

@@ -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."

View File

@@ -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"

View File

@@ -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 "નીચે યાદી થયેલ નામસર્વરો એ ઓળખી શકાતા નથી."

View File

@@ -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 "नीचे सूची में दिया गया नेमसर्वर पहचाना नहीं जा सकता है."

View File

@@ -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."

View File

@@ -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."

View File

@@ -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."

View File

@@ -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 "以下の一覧にあるネームサーバーは認識されないかも知れません。"

View File

@@ -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 "ಈ ಕೆಳಗೆ ಸೂಚಿಸಲಾದ ನಾಮಪರಿಚಾರಕಗಳನ್ನು ಗುರುತಿಸಲಾಗಿಲ್ಲ."

View File

@@ -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 "아래 열거된 네임서버를 인식하지 못할 수 있습니다."

View File

@@ -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."

View File

@@ -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 "താഴെ പറഞ്ഞിരിക്കുന്ന നെയിംസര്‍വറുകള്‍ തിരിച്ചറിയപ്പെടുന്നവയല്ല."

View File

@@ -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 "खालिल यादीतील नेमसर्व्हर्स् अनोळखी राहतील."

View File

@@ -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."

View File

@@ -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."

View File

@@ -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 ""

View File

@@ -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ଗୁଡ଼ିକୁ ଚିହ୍ନି ହୋଇନପାରେ."

View File

@@ -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 "ਹੇਠਾਂ ਦਿੱਤੇ ਨੇਮ-ਸਰਵਰ ਪਛਾਣੇ ਨਹੀਂ ਜਾ ਸਕਦੇ।"

View File

@@ -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."

View File

@@ -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."

View File

@@ -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 "Нижеперечисленные сервера могут быть пропущены."

View File

@@ -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."

View File

@@ -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."

View File

@@ -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 "கீழே பட்டியலிட்டப்படுள்ள பெயர்சேவையகங்கள் கண்டுபிடிக்கப்படவில்லை."

View File

@@ -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 "క్రిందన జాబితాచేసివున్న నామపుసేవికలు గుర్తించబడక పోవచ్చును."

View File

@@ -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."

View File

@@ -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 "以下列出的名字服务器可能无法被识别。"

View File

@@ -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 "下面列出的名稱伺服器可能不會被辨識。"

View File

@@ -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 "下面列出的名稱伺服器可能不會被辨識。"

View File

@@ -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 \

View File

@@ -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

View File

@@ -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);
}

View File

@@ -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

View File

@@ -4,17 +4,17 @@ INCLUDES = \
-I${top_srcdir}/src \
-I${top_srcdir}/include
noinst_LTLIBRARIES = libnamed-manager.la
noinst_LTLIBRARIES = libdns-manager.la
libnamed_manager_la_SOURCES = nm-named-manager.h nm-named-manager.c
libdns_manager_la_SOURCES = nm-dns-manager.h nm-dns-manager.c
libnamed_manager_la_CPPFLAGS = \
libdns_manager_la_CPPFLAGS = \
$(DBUS_CFLAGS) \
$(GLIB_CFLAGS) \
-DNM_PKGDATADIR=\"$(pkgdatadir)\" \
-DNM_LOCALSTATEDIR=\"$(localstatedir)\"
libnamed_manager_la_LIBADD = \
libdns_manager_la_LIBADD = \
$(top_builddir)/src/logging/libnm-logging.la \
$(DBUS_LIBS) \
$(GLIB_LIBS)

View File

@@ -36,7 +36,7 @@
#include <glib/gi18n.h>
#include "nm-named-manager.h"
#include "nm-dns-manager.h"
#include "nm-ip4-config.h"
#include "nm-ip6-config.h"
#include "nm-logging.h"
@@ -53,14 +53,14 @@
#define ADDR_BUF_LEN 50
G_DEFINE_TYPE(NMNamedManager, nm_named_manager, G_TYPE_OBJECT)
G_DEFINE_TYPE(NMDnsManager, nm_dns_manager, G_TYPE_OBJECT)
#define NM_NAMED_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
NM_TYPE_NAMED_MANAGER, \
NMNamedManagerPrivate))
#define NM_DNS_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
NM_TYPE_DNS_MANAGER, \
NMDnsManagerPrivate))
struct NMNamedManagerPrivate {
struct NMDnsManagerPrivate {
NMIP4Config *ip4_vpn_config;
NMIP4Config *ip4_device_config;
NMIP6Config *ip6_vpn_config;
@@ -76,13 +76,13 @@ struct NMNamedManagerPrivate {
};
NMNamedManager *
nm_named_manager_get (void)
NMDnsManager *
nm_dns_manager_get (void)
{
static NMNamedManager * singleton = NULL;
static NMDnsManager * singleton = NULL;
if (!singleton)
singleton = NM_NAMED_MANAGER (g_object_new (NM_TYPE_NAMED_MANAGER, NULL));
singleton = NM_DNS_MANAGER (g_object_new (NM_TYPE_DNS_MANAGER, NULL));
else
g_object_ref (singleton);
@@ -92,11 +92,11 @@ nm_named_manager_get (void)
GQuark
nm_named_manager_error_quark (void)
nm_dns_manager_error_quark (void)
{
static GQuark quark = 0;
if (!quark)
quark = g_quark_from_static_string ("nm_named_manager_error");
quark = g_quark_from_static_string ("nm_dns_manager_error");
return quark;
}
@@ -284,7 +284,7 @@ dispatch_netconfig (const char *domain,
// 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
// 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.
@@ -353,8 +353,8 @@ write_resolv_conf (FILE *f, const char *domain,
if (fprintf (f, "%s","# Generated by NetworkManager\n") < 0) {
g_set_error (error,
NM_NAMED_MANAGER_ERROR,
NM_NAMED_MANAGER_ERROR_SYSTEM,
NM_DNS_MANAGER_ERROR,
NM_DNS_MANAGER_ERROR_SYSTEM,
"Could not write " RESOLV_CONF ": %s\n",
g_strerror (errno));
return FALSE;
@@ -428,8 +428,8 @@ dispatch_resolvconf (const char *domain,
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,
NM_DNS_MANAGER_ERROR,
NM_DNS_MANAGER_ERROR_SYSTEM,
"Could not write to %s: %s\n",
RESOLVCONF_PATH,
g_strerror (errno));
@@ -486,8 +486,8 @@ update_resolv_conf (const char *domain,
old_errno = errno;
if ((f = fopen (RESOLV_CONF, "w")) == NULL) {
g_set_error (error,
NM_NAMED_MANAGER_ERROR,
NM_NAMED_MANAGER_ERROR_SYSTEM,
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),
@@ -509,8 +509,8 @@ update_resolv_conf (const char *domain,
* since its error is more important.
*/
g_set_error (error,
NM_NAMED_MANAGER_ERROR,
NM_NAMED_MANAGER_ERROR_SYSTEM,
NM_DNS_MANAGER_ERROR,
NM_DNS_MANAGER_ERROR_SYSTEM,
"Could not close %s: %s\n",
tmp_resolv_conf_realpath,
g_strerror (errno));
@@ -523,8 +523,8 @@ update_resolv_conf (const char *domain,
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,
NM_DNS_MANAGER_ERROR,
NM_DNS_MANAGER_ERROR_SYSTEM,
"Could not replace " RESOLV_CONF ": %s\n",
g_strerror (errno));
}
@@ -537,9 +537,9 @@ out:
}
static gboolean
rewrite_resolv_conf (NMNamedManager *mgr, const char *iface, GError **error)
rewrite_resolv_conf (NMDnsManager *mgr, const char *iface, GError **error)
{
NMNamedManagerPrivate *priv;
NMDnsManagerPrivate *priv;
NMResolvConfData rc;
GSList *iter;
const char *domain = NULL;
@@ -553,7 +553,7 @@ rewrite_resolv_conf (NMNamedManager *mgr, const char *iface, GError **error)
g_return_val_if_fail (error != NULL, FALSE);
g_return_val_if_fail (*error == NULL, FALSE);
priv = NM_NAMED_MANAGER_GET_PRIVATE (mgr);
priv = NM_DNS_MANAGER_GET_PRIVATE (mgr);
if (iface) {
g_free (priv->last_iface);
@@ -669,25 +669,25 @@ rewrite_resolv_conf (NMNamedManager *mgr, const char *iface, GError **error)
}
gboolean
nm_named_manager_add_ip4_config (NMNamedManager *mgr,
nm_dns_manager_add_ip4_config (NMDnsManager *mgr,
const char *iface,
NMIP4Config *config,
NMNamedIPConfigType cfg_type)
NMDnsIPConfigType cfg_type)
{
NMNamedManagerPrivate *priv;
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_NAMED_MANAGER_GET_PRIVATE (mgr);
priv = NM_DNS_MANAGER_GET_PRIVATE (mgr);
switch (cfg_type) {
case NM_NAMED_IP_CONFIG_TYPE_VPN:
case NM_DNS_IP_CONFIG_TYPE_VPN:
priv->ip4_vpn_config = config;
break;
case NM_NAMED_IP_CONFIG_TYPE_BEST_DEVICE:
case NM_DNS_IP_CONFIG_TYPE_BEST_DEVICE:
priv->ip4_device_config = config;
break;
default:
@@ -707,18 +707,18 @@ nm_named_manager_add_ip4_config (NMNamedManager *mgr,
}
gboolean
nm_named_manager_remove_ip4_config (NMNamedManager *mgr,
nm_dns_manager_remove_ip4_config (NMDnsManager *mgr,
const char *iface,
NMIP4Config *config)
{
NMNamedManagerPrivate *priv;
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_NAMED_MANAGER_GET_PRIVATE (mgr);
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))
@@ -743,27 +743,27 @@ nm_named_manager_remove_ip4_config (NMNamedManager *mgr,
}
gboolean
nm_named_manager_add_ip6_config (NMNamedManager *mgr,
nm_dns_manager_add_ip6_config (NMDnsManager *mgr,
const char *iface,
NMIP6Config *config,
NMNamedIPConfigType cfg_type)
NMDnsIPConfigType cfg_type)
{
NMNamedManagerPrivate *priv;
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_NAMED_MANAGER_GET_PRIVATE (mgr);
priv = NM_DNS_MANAGER_GET_PRIVATE (mgr);
switch (cfg_type) {
case NM_NAMED_IP_CONFIG_TYPE_VPN:
case NM_DNS_IP_CONFIG_TYPE_VPN:
/* FIXME: not quite yet... */
g_return_val_if_fail (cfg_type != NM_NAMED_IP_CONFIG_TYPE_VPN, FALSE);
g_return_val_if_fail (cfg_type != NM_DNS_IP_CONFIG_TYPE_VPN, FALSE);
priv->ip6_vpn_config = config;
break;
case NM_NAMED_IP_CONFIG_TYPE_BEST_DEVICE:
case NM_DNS_IP_CONFIG_TYPE_BEST_DEVICE:
priv->ip6_device_config = config;
break;
default:
@@ -783,18 +783,18 @@ nm_named_manager_add_ip6_config (NMNamedManager *mgr,
}
gboolean
nm_named_manager_remove_ip6_config (NMNamedManager *mgr,
nm_dns_manager_remove_ip6_config (NMDnsManager *mgr,
const char *iface,
NMIP6Config *config)
{
NMNamedManagerPrivate *priv;
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_NAMED_MANAGER_GET_PRIVATE (mgr);
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))
@@ -819,10 +819,10 @@ nm_named_manager_remove_ip6_config (NMNamedManager *mgr,
}
void
nm_named_manager_set_hostname (NMNamedManager *mgr,
nm_dns_manager_set_hostname (NMDnsManager *mgr,
const char *hostname)
{
NMNamedManagerPrivate *priv = NM_NAMED_MANAGER_GET_PRIVATE (mgr);
NMDnsManagerPrivate *priv = NM_DNS_MANAGER_GET_PRIVATE (mgr);
GError *error = NULL;
const char *filtered = NULL;
@@ -854,30 +854,30 @@ nm_named_manager_set_hostname (NMNamedManager *mgr,
static void
nm_named_manager_init (NMNamedManager *mgr)
nm_dns_manager_init (NMDnsManager *mgr)
{
}
static void
nm_named_manager_finalize (GObject *object)
nm_dns_manager_finalize (GObject *object)
{
NMNamedManagerPrivate *priv = NM_NAMED_MANAGER_GET_PRIVATE (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_named_manager_parent_class)->finalize (object);
G_OBJECT_CLASS (nm_dns_manager_parent_class)->finalize (object);
}
static void
nm_named_manager_class_init (NMNamedManagerClass *klass)
nm_dns_manager_class_init (NMDnsManagerClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = nm_named_manager_finalize;
object_class->finalize = nm_dns_manager_finalize;
g_type_class_add_private (object_class, sizeof (NMNamedManagerPrivate));
g_type_class_add_private (object_class, sizeof (NMDnsManagerPrivate));
}

View File

@@ -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 <walters@redhat.com>
* 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 <glib-object.h>
#include <dbus/dbus.h>
#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 */

View File

@@ -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

View File

@@ -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);

View File

@@ -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 <walters@redhat.com>
* 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 <glib-object.h>
#include <dbus/dbus.h>
#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__ */

View File

@@ -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"
@@ -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));
@@ -3019,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);
@@ -3036,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;
}
@@ -3058,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);
@@ -3122,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);
@@ -3139,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;
}
@@ -3161,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);

View File

@@ -60,6 +60,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 *connection_path,
@@ -176,7 +178,8 @@ struct PendingActivation {
};
typedef struct {
gboolean enabled;
gboolean user_enabled;
gboolean sw_enabled;
gboolean hw_enabled;
RfKillType rtype;
const char *desc;
@@ -215,6 +218,7 @@ typedef struct {
guint modem_removed_id;
DBusGProxy *aipd_proxy;
DBusGProxy *upower_proxy;
PolkitAuthority *authority;
guint auth_changed_id;
@@ -975,50 +979,40 @@ write_value_to_state_file (const char *filename,
return ret;
}
static void
manager_set_radio_enabled (NMManager *manager,
RadioState *rstate,
gboolean enabled)
static gboolean
radio_enabled_for_rstate (RadioState *rstate)
{
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager);
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_update_radio_enabled (NMManager *self, RadioState *rstate)
{
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) {
@@ -1139,6 +1133,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,
@@ -1148,7 +1157,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);
@@ -1163,38 +1177,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
@@ -1347,7 +1354,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);
@@ -1386,14 +1393,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.
@@ -2396,13 +2404,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);
@@ -2448,6 +2456,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",
@@ -2476,7 +2487,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",
@@ -2550,6 +2561,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)
{
@@ -2886,34 +2911,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;
if (rstate->desc) {
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);
(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 */
@@ -3191,8 +3203,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);
@@ -3302,6 +3314,12 @@ 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);
if (priv->fw_monitor) {
if (priv->fw_monitor_id)
g_signal_handler_disconnect (priv->fw_monitor, priv->fw_monitor_id);
@@ -3316,6 +3334,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)
@@ -3329,12 +3383,12 @@ 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),
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),
manager_radio_user_toggled (NM_MANAGER (object),
&priv->radio_states[RFKILL_TYPE_WWAN],
g_value_get_boolean (value));
break;
@@ -3360,13 +3414,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);
@@ -3398,7 +3452,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;
@@ -3406,7 +3460,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;
@@ -3414,7 +3468,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;
@@ -3471,6 +3525,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,

View File

@@ -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.

View File

@@ -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"

View File

@@ -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

View File

@@ -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"\"

View File

@@ -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"
@@ -542,15 +542,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;
@@ -898,12 +898,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)

View File

@@ -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 = \

View File

@@ -40,6 +40,7 @@
#include <arpa/inet.h>
#include <netinet/ether.h>
#include <string.h>
#include <nm-system-config-error.h>
#include "nm-dbus-glib-types.h"
#include "reader.h"
@@ -986,27 +987,12 @@ 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))
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);
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;
@@ -1015,6 +1001,31 @@ connection_from_file (const char *filename)
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_SYSCONFIG_SETTINGS_ERROR,
NM_SYSCONFIG_SETTINGS_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_SYSCONFIG_SETTINGS_ERROR,
NM_SYSCONFIG_SETTINGS_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 ();
@@ -1082,12 +1093,20 @@ connection_from_file (const char *filename)
}
g_strfreev (groups);
} else {
g_warning ("Error parsing file '%s': %s", filename, err->message);
g_error_free (err);
/* Verify the connection */
if (!nm_connection_verify (connection, &verify_error)) {
g_set_error (error,
NM_SYSCONFIG_SETTINGS_ERROR,
NM_SYSCONFIG_SETTINGS_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;
}

View File

@@ -27,6 +27,6 @@
#include <glib.h>
#include <nm-connection.h>
NMConnection *connection_from_file (const char *filename);
NMConnection *connection_from_file (const char *filename, GError **error);
#endif /* _KEYFILE_PLUGIN_READER_H */

View File

@@ -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 <string.h>
@@ -25,6 +25,7 @@
#include <nm-setting-connection.h>
#include <nm-utils.h>
#include "nm-system-config-interface.h"
#include "nm-dbus-glib-types.h"
#include "nm-keyfile-connection.h"
#include "reader.h"
@@ -46,13 +47,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,
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_replace_settings (NM_SYSCONFIG_CONNECTION (object), tmp, 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 *
@@ -111,56 +154,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_replace_settings (NM_SYSCONFIG_CONNECTION (object), tmp, 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)
{
@@ -215,7 +208,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;

View File

@@ -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);

View File

@@ -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 <config.h>
@@ -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;
dir = g_dir_open (KEYFILE_DIR, 0, &err);
if (dir) {
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;
full_path = g_build_filename (KEYFILE_DIR, item, NULL);
connection = nm_keyfile_connection_new (full_path);
PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, "parsing %s ... ", item);
connection = nm_keyfile_connection_new (full_path, &error);
if (connection) {
NMSettingConnection *s_con;
const char *cid;
s_con = (NMSettingConnection *) nm_connection_get_setting (NM_CONNECTION (connection), NM_TYPE_SETTING_CONNECTION);
g_assert (s_con);
cid = nm_setting_connection_get_id (s_con);
g_assert (cid);
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);
} else {
g_warning ("Can not read directory '%s': %s", KEYFILE_DIR, err->message);
g_error_free (err);
}
}
typedef struct {
@@ -149,6 +167,21 @@ 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,
@@ -160,6 +193,7 @@ dir_changed (GFileMonitor *monitor,
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);
@@ -167,27 +201,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;
@@ -236,6 +275,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;

View File

@@ -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,

View File

@@ -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