about summary refs log tree commit diff
path: root/libnm
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2016-08-03 22:59:23 +0200
committerMichael Biebl <biebl@debian.org>2016-08-03 22:59:23 +0200
commitd6201f5d8daada3d64a0a3e0038e14eebec683ce (patch)
tree035500728cc23e7ee5368c3fd605270265a077f7 /libnm
parent73e152af6e3fb4f5848bfb8394484026ff119003 (diff)
Imported Upstream version 1.2.4 upstream/1.2.4
Diffstat (limited to 'libnm')
-rw-r--r--libnm/Makefile.am1
-rw-r--r--libnm/Makefile.in4
-rw-r--r--libnm/libnm.ver4
-rw-r--r--libnm/nm-client.h7
-rw-r--r--libnm/nm-device.c10
-rw-r--r--libnm/nm-enum-types.c2
-rw-r--r--libnm/nm-manager.c17
-rw-r--r--libnm/nm-property-docs.xml2
-rw-r--r--libnm/nm-setting-docs.xml2
-rw-r--r--libnm/tests/Makefile.in1
10 files changed, 36 insertions, 14 deletions
diff --git a/libnm/Makefile.am b/libnm/Makefile.am
index e035b3cd..184bdbdc 100644
--- a/libnm/Makefile.am
+++ b/libnm/Makefile.am
@@ -137,6 +137,7 @@ GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM --fhead '\#include "nm-default.h"\
 libnm_la_LIBADD = \
 	$(top_builddir)/libnm-core/libnm-core.la \
 	$(top_builddir)/introspection/libnmdbus.la \
+	$(LIBDL) \
 	$(GLIB_LIBS) \
 	$(UUID_LIBS) \
 	$(GUDEV_LIBS)
diff --git a/libnm/Makefile.in b/libnm/Makefile.in
index 899dd6da..f6ce85de 100644
--- a/libnm/Makefile.in
+++ b/libnm/Makefile.in
@@ -156,7 +156,7 @@ am__DEPENDENCIES_1 =
 libnm_la_DEPENDENCIES = $(top_builddir)/libnm-core/libnm-core.la \
 	$(top_builddir)/introspection/libnmdbus.la \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 am__objects_1 = nm-access-point.lo nm-active-connection.lo \
 	nm-client.lo nm-dbus-helpers.lo nm-device-adsl.lo \
 	nm-device-bond.lo nm-device-bridge.lo nm-device-bt.lo \
@@ -423,6 +423,7 @@ NEWT_LIBS = @NEWT_LIBS@
 NM = @NM@
 NMEDIT = @NMEDIT@
 NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@
+NM_CONFIG_DEFAULT_DNS_RC_MANAGER = @NM_CONFIG_DEFAULT_DNS_RC_MANAGER@
 NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@
 NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@
 NM_MAJOR_VERSION = @NM_MAJOR_VERSION@
@@ -790,6 +791,7 @@ GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM --fhead '\#include "nm-default.h"\
 libnm_la_LIBADD = \
 	$(top_builddir)/libnm-core/libnm-core.la \
 	$(top_builddir)/introspection/libnmdbus.la \
+	$(LIBDL) \
 	$(GLIB_LIBS) \
 	$(UUID_LIBS) \
 	$(GUDEV_LIBS)
diff --git a/libnm/libnm.ver b/libnm/libnm.ver
index 7ece1b2f..4fd8027c 100644
--- a/libnm/libnm.ver
+++ b/libnm/libnm.ver
@@ -1058,3 +1058,7 @@ global:
 	nm_vpn_service_plugin_set_ip6_config;
 	nm_vpn_service_plugin_set_login_banner;
 } libnm_1_0_0;
+
+libnm_1_2_4 {
+	nm_setting_ip_config_get_dns_priority;
+} libnm_1_2_0;
diff --git a/libnm/nm-client.h b/libnm/nm-client.h
index 66ec9ea5..6bae78fa 100644
--- a/libnm/nm-client.h
+++ b/libnm/nm-client.h
@@ -92,6 +92,9 @@ G_BEGIN_DECLS
  *  owned by the current user can be modified
  * @NM_CLIENT_PERMISSION_SETTINGS_MODIFY_HOSTNAME: controls whether the
  *  persistent hostname can be changed
+ * @NM_CLIENT_PERMISSION_SETTINGS_MODIFY_GLOBAL_DNS: modify persistent global
+ *  DNS configuration
+ * @NM_CLIENT_PERMISSION_RELOAD: controls access to Reload.
  * @NM_CLIENT_PERMISSION_LAST: a reserved boundary value
  *
  * #NMClientPermission values indicate various permissions that NetworkManager
@@ -110,8 +113,10 @@ typedef enum {
 	NM_CLIENT_PERMISSION_SETTINGS_MODIFY_SYSTEM = 9,
 	NM_CLIENT_PERMISSION_SETTINGS_MODIFY_OWN = 10,
 	NM_CLIENT_PERMISSION_SETTINGS_MODIFY_HOSTNAME = 11,
+	NM_CLIENT_PERMISSION_SETTINGS_MODIFY_GLOBAL_DNS = 12,
+	NM_CLIENT_PERMISSION_RELOAD = 13,
 
-	NM_CLIENT_PERMISSION_LAST = NM_CLIENT_PERMISSION_SETTINGS_MODIFY_HOSTNAME
+	NM_CLIENT_PERMISSION_LAST = 13,
 } NMClientPermission;
 
 /**
diff --git a/libnm/nm-device.c b/libnm/nm-device.c
index 496dd87a..b3dc01b2 100644
--- a/libnm/nm-device.c
+++ b/libnm/nm-device.c
@@ -1722,6 +1722,7 @@ get_description (NMDevice *device)
 	char *pdown;
 	char *vdown;
 	GString *str;
+	GParamSpec *name_prop;
 
 	dev_product = nm_device_get_product (device);
 	priv->short_product = fixup_desc_string (dev_product);
@@ -1729,6 +1730,15 @@ get_description (NMDevice *device)
 	dev_vendor = nm_device_get_vendor (device);
 	priv->short_vendor = fixup_desc_string (dev_vendor);
 
+	/* Grab device's preferred name, if any */
+	name_prop = g_object_class_find_property (G_OBJECT_GET_CLASS (G_OBJECT (device)), "name");
+	if (name_prop) {
+		g_object_get (device, "name", &priv->description, NULL);
+		if (priv->description && priv->description[0])
+			return;
+		g_clear_pointer (&priv->description, g_free);
+	}
+
 	if (!dev_product || !dev_vendor) {
 		priv->description = g_strdup (nm_device_get_iface (device));
 		return;
diff --git a/libnm/nm-enum-types.c b/libnm/nm-enum-types.c
index b27ccd73..a64e4cf0 100644
--- a/libnm/nm-enum-types.c
+++ b/libnm/nm-enum-types.c
@@ -63,6 +63,8 @@ nm_client_permission_get_type (void)
         { NM_CLIENT_PERMISSION_SETTINGS_MODIFY_SYSTEM, "NM_CLIENT_PERMISSION_SETTINGS_MODIFY_SYSTEM", "settings-modify-system" },
         { NM_CLIENT_PERMISSION_SETTINGS_MODIFY_OWN, "NM_CLIENT_PERMISSION_SETTINGS_MODIFY_OWN", "settings-modify-own" },
         { NM_CLIENT_PERMISSION_SETTINGS_MODIFY_HOSTNAME, "NM_CLIENT_PERMISSION_SETTINGS_MODIFY_HOSTNAME", "settings-modify-hostname" },
+        { NM_CLIENT_PERMISSION_SETTINGS_MODIFY_GLOBAL_DNS, "NM_CLIENT_PERMISSION_SETTINGS_MODIFY_GLOBAL_DNS", "settings-modify-global-dns" },
+        { NM_CLIENT_PERMISSION_RELOAD, "NM_CLIENT_PERMISSION_RELOAD", "reload" },
         { NM_CLIENT_PERMISSION_LAST, "NM_CLIENT_PERMISSION_LAST", "last" },
         { 0, NULL, NULL }
       };
diff --git a/libnm/nm-manager.c b/libnm/nm-manager.c
index a6c1f3f9..27bd4ca6 100644
--- a/libnm/nm-manager.c
+++ b/libnm/nm-manager.c
@@ -26,6 +26,7 @@
 #include <string.h>
 
 #include "nm-utils.h"
+#include "nm-common-macros.h"
 #include "nm-device-ethernet.h"
 #include "nm-device-wifi.h"
 #include "nm-device-private.h"
@@ -202,18 +203,6 @@ init_dbus (NMObject *object)
 	                  G_CALLBACK (manager_recheck_permissions), object);
 }
 
-#define NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK     "org.freedesktop.NetworkManager.enable-disable-network"
-#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI        "org.freedesktop.NetworkManager.enable-disable-wifi"
-#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN        "org.freedesktop.NetworkManager.enable-disable-wwan"
-#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WIMAX       "org.freedesktop.NetworkManager.enable-disable-wimax"
-#define NM_AUTH_PERMISSION_SLEEP_WAKE                 "org.freedesktop.NetworkManager.sleep-wake"
-#define NM_AUTH_PERMISSION_NETWORK_CONTROL            "org.freedesktop.NetworkManager.network-control"
-#define NM_AUTH_PERMISSION_WIFI_SHARE_PROTECTED       "org.freedesktop.NetworkManager.wifi.share.protected"
-#define NM_AUTH_PERMISSION_WIFI_SHARE_OPEN            "org.freedesktop.NetworkManager.wifi.share.open"
-#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_SYSTEM     "org.freedesktop.NetworkManager.settings.modify.system"
-#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_OWN        "org.freedesktop.NetworkManager.settings.modify.own"
-#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_HOSTNAME   "org.freedesktop.NetworkManager.settings.modify.hostname"
-
 static NMClientPermission
 nm_permission_to_client (const char *nm)
 {
@@ -239,6 +228,10 @@ nm_permission_to_client (const char *nm)
 		return NM_CLIENT_PERMISSION_SETTINGS_MODIFY_OWN;
 	else if (!strcmp (nm, NM_AUTH_PERMISSION_SETTINGS_MODIFY_HOSTNAME))
 		return NM_CLIENT_PERMISSION_SETTINGS_MODIFY_HOSTNAME;
+	else if (!strcmp (nm, NM_AUTH_PERMISSION_SETTINGS_MODIFY_GLOBAL_DNS))
+		return NM_CLIENT_PERMISSION_SETTINGS_MODIFY_GLOBAL_DNS;
+	else if (!strcmp (nm, NM_AUTH_PERMISSION_RELOAD))
+		return NM_CLIENT_PERMISSION_RELOAD;
 
 	return NM_CLIENT_PERMISSION_NONE;
 }
diff --git a/libnm/nm-property-docs.xml b/libnm/nm-property-docs.xml
index f75e233d..b4996bef 100644
--- a/libnm/nm-property-docs.xml
+++ b/libnm/nm-property-docs.xml
@@ -157,6 +157,7 @@
     <property name="dhcp-timeout" type="int32" default="0" description="A timeout for a DHCP transaction in seconds." />
     <property name="dns" type="array of uint32" default="[]" description="Array of IP addresses of DNS servers." />
     <property name="dns-options" type="array of string" default="[]" description="Array of DNS options. NULL means that the options are unset and left at the default. In this case NetworkManager will use default options. This is distinct from an empty list of properties." />
+    <property name="dns-priority" type="int32" default="0" description="DNS priority. The relative priority to be used when determining the order of DNS servers in resolv.conf.  A lower value means that servers will be on top of the file.  Zero selects the default value, which is 50 for VPNs and 100 for other connections.  When multiple devices have configurations with the same priority, the one with an active default route will be preferred.  Note that when using dns=dnsmasq the order is meaningless since dnsmasq forwards queries to all known servers at the same time. Negative values have the special effect of excluding other configurations with a greater priority value; so in presence of at least a negative priority, only DNS servers from configurations with the lowest priority value will be used." />
     <property name="dns-search" type="array of string" default="[]" description="Array of DNS search domains." />
     <property name="gateway" type="string" description="The gateway associated with this configuration. This is only meaningful if &quot;addresses&quot; is also set." />
     <property name="ignore-auto-dns" type="boolean" default="FALSE" description="When &quot;method&quot; is set to &quot;auto&quot; and this property to TRUE, automatically configured nameservers and search domains are ignored and only nameservers and search domains specified in the &quot;dns&quot; and &quot;dns-search&quot; properties, if any, are used." />
@@ -177,6 +178,7 @@
     <property name="dhcp-timeout" type="int32" default="0" description="A timeout for a DHCP transaction in seconds." />
     <property name="dns" type="array of byte array" default="[]" description="Array of IP addresses of DNS servers." />
     <property name="dns-options" type="array of string" default="[]" description="Array of DNS options. NULL means that the options are unset and left at the default. In this case NetworkManager will use default options. This is distinct from an empty list of properties." />
+    <property name="dns-priority" type="int32" default="0" description="DNS priority. The relative priority to be used when determining the order of DNS servers in resolv.conf.  A lower value means that servers will be on top of the file.  Zero selects the default value, which is 50 for VPNs and 100 for other connections.  When multiple devices have configurations with the same priority, the one with an active default route will be preferred.  Note that when using dns=dnsmasq the order is meaningless since dnsmasq forwards queries to all known servers at the same time. Negative values have the special effect of excluding other configurations with a greater priority value; so in presence of at least a negative priority, only DNS servers from configurations with the lowest priority value will be used." />
     <property name="dns-search" type="array of string" default="[]" description="Array of DNS search domains." />
     <property name="gateway" type="string" description="The gateway associated with this configuration. This is only meaningful if &quot;addresses&quot; is also set." />
     <property name="ignore-auto-dns" type="boolean" default="FALSE" description="When &quot;method&quot; is set to &quot;auto&quot; and this property to TRUE, automatically configured nameservers and search domains are ignored and only nameservers and search domains specified in the &quot;dns&quot; and &quot;dns-search&quot; properties, if any, are used." />
diff --git a/libnm/nm-setting-docs.xml b/libnm/nm-setting-docs.xml
index d3ede916..dd650ef6 100644
--- a/libnm/nm-setting-docs.xml
+++ b/libnm/nm-setting-docs.xml
@@ -160,6 +160,7 @@
     <property name="dhcp-timeout" type="int32" default="0" description="A timeout for a DHCP transaction in seconds." />
     <property name="dns" type="array of uint32" default="[]" description="Array of IP addresses of DNS servers (as network-byte-order integers)" />
     <property name="dns-options" type="array of string" default="[]" description="Array of DNS options. NULL means that the options are unset and left at the default. In this case NetworkManager will use default options. This is distinct from an empty list of properties." />
+    <property name="dns-priority" type="int32" default="0" description="DNS priority. The relative priority to be used when determining the order of DNS servers in resolv.conf.  A lower value means that servers will be on top of the file.  Zero selects the default value, which is 50 for VPNs and 100 for other connections.  When multiple devices have configurations with the same priority, the one with an active default route will be preferred.  Note that when using dns=dnsmasq the order is meaningless since dnsmasq forwards queries to all known servers at the same time. Negative values have the special effect of excluding other configurations with a greater priority value; so in presence of at least a negative priority, only DNS servers from configurations with the lowest priority value will be used." />
     <property name="dns-search" type="array of string" default="[]" description="Array of DNS search domains." />
     <property name="gateway" type="string" description="The gateway associated with this configuration. This is only meaningful if &quot;addresses&quot; is also set." />
     <property name="ignore-auto-dns" type="boolean" default="FALSE" description="When &quot;method&quot; is set to &quot;auto&quot; and this property to TRUE, automatically configured nameservers and search domains are ignored and only nameservers and search domains specified in the &quot;dns&quot; and &quot;dns-search&quot; properties, if any, are used." />
@@ -182,6 +183,7 @@
     <property name="dhcp-timeout" type="int32" default="0" description="A timeout for a DHCP transaction in seconds." />
     <property name="dns" type="array of byte array" default="[]" description="Array of IP addresses of DNS servers (in network byte order)" />
     <property name="dns-options" type="array of string" default="[]" description="Array of DNS options. NULL means that the options are unset and left at the default. In this case NetworkManager will use default options. This is distinct from an empty list of properties." />
+    <property name="dns-priority" type="int32" default="0" description="DNS priority. The relative priority to be used when determining the order of DNS servers in resolv.conf.  A lower value means that servers will be on top of the file.  Zero selects the default value, which is 50 for VPNs and 100 for other connections.  When multiple devices have configurations with the same priority, the one with an active default route will be preferred.  Note that when using dns=dnsmasq the order is meaningless since dnsmasq forwards queries to all known servers at the same time. Negative values have the special effect of excluding other configurations with a greater priority value; so in presence of at least a negative priority, only DNS servers from configurations with the lowest priority value will be used." />
     <property name="dns-search" type="array of string" default="[]" description="Array of DNS search domains." />
     <property name="gateway" type="string" description="The gateway associated with this configuration. This is only meaningful if &quot;addresses&quot; is also set." />
     <property name="ignore-auto-dns" type="boolean" default="FALSE" description="When &quot;method&quot; is set to &quot;auto&quot; and this property to TRUE, automatically configured nameservers and search domains are ignored and only nameservers and search domains specified in the &quot;dns&quot; and &quot;dns-search&quot; properties, if any, are used." />
diff --git a/libnm/tests/Makefile.in b/libnm/tests/Makefile.in
index 15846792..4592ac6c 100644
--- a/libnm/tests/Makefile.in
+++ b/libnm/tests/Makefile.in
@@ -563,6 +563,7 @@ NEWT_LIBS = @NEWT_LIBS@
 NM = @NM@
 NMEDIT = @NMEDIT@
 NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@
+NM_CONFIG_DEFAULT_DNS_RC_MANAGER = @NM_CONFIG_DEFAULT_DNS_RC_MANAGER@
 NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@
 NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@
 NM_MAJOR_VERSION = @NM_MAJOR_VERSION@