Commit f98e2528 authored by Daniel Gnoutcheff's avatar Daniel Gnoutcheff

NetworkMangerSettings -> NetworkManager.Settings

Just for consistency, make settings related stuff live under the
org.freedesktop.NetworkManager namespace, rather than its own
org.freedesktop.NetworkManagerSettings namespace. Renames are done for
DBus interface names, DBus object paths, and polkit actions.
parent fb963098
......@@ -41,8 +41,8 @@ con = dbus.Dictionary({
bus = dbus.SystemBus()
proxy = bus.get_object("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManagerSettings")
settings = dbus.Interface(proxy, "org.freedesktop.NetworkManagerSettings")
proxy = bus.get_object("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager/Settings")
settings = dbus.Interface(proxy, "org.freedesktop.NetworkManager.Settings")
settings.AddConnection(con)
......@@ -73,21 +73,21 @@ def connection_to_string(config):
def print_connections():
# Ask the settings service for the list of connections it provides
service_name = "org.freedesktop.NetworkManager"
proxy = bus.get_object(service_name, "/org/freedesktop/NetworkManagerSettings")
settings = dbus.Interface(proxy, "org.freedesktop.NetworkManagerSettings")
proxy = bus.get_object(service_name, "/org/freedesktop/NetworkManager/Settings")
settings = dbus.Interface(proxy, "org.freedesktop.NetworkManager.Settings")
connection_paths = settings.ListConnections()
# List each connection's name, UUID, and type
for path in connection_paths:
con_proxy = bus.get_object(service_name, path)
connection = dbus.Interface(con_proxy, "org.freedesktop.NetworkManagerSettings.Connection")
connection = dbus.Interface(con_proxy, "org.freedesktop.NetworkManager.Settings.Connection")
config = connection.GetSettings()
# Now get secrets too; we grab the secrets for each type of connection
# (since there isn't a "get all secrets" call because most of the time
# you only need 'wifi' secrets or '802.1x' secrets, not everything) and
# merge that into the configuration data
connection_secrets = dbus.Interface(con_proxy, "org.freedesktop.NetworkManagerSettings.Connection.Secrets")
connection_secrets = dbus.Interface(con_proxy, "org.freedesktop.NetworkManager.Settings.Connection.Secrets")
merge_secrets(connection_secrets, config, '802-11-wireless')
merge_secrets(connection_secrets, config, '802-11-wireless-security')
merge_secrets(connection_secrets, config, '802-1x')
......
......@@ -54,7 +54,7 @@ for a in active:
# can find the user-readable name of the connection.
con_path = prop_iface.Get("org.freedesktop.NetworkManager.ActiveConnection", "Connection")
service_proxy = bus.get_object("org.freedesktop.NetworkManager", con_path)
con_iface = dbus.Interface(service_proxy, "org.freedesktop.NetworkManagerSettings.Connection")
con_iface = dbus.Interface(service_proxy, "org.freedesktop.NetworkManager.Settings.Connection")
con_details = con_iface.GetSettings()
con_name = con_details['connection']['id']
......
......@@ -37,8 +37,8 @@ DBusGMainLoop(set_as_default=True)
def get_connections():
bus = dbus.SystemBus()
proxy = bus.get_object('org.freedesktop.NetworkManager', '/org/freedesktop/NetworkManagerSettings')
iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManagerSettings')
proxy = bus.get_object('org.freedesktop.NetworkManager', '/org/freedesktop/NetworkManager/Settings')
iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManager.Settings')
return iface.ListConnections()
......@@ -46,7 +46,7 @@ def get_connection_by_uuid(uuid):
bus = dbus.SystemBus()
for c in get_connections():
proxy = bus.get_object('org.freedesktop.NetworkManager', c)
iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManagerSettings.Connection')
iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManager.Settings.Connection')
settings = iface.GetSettings()
if settings['connection']['uuid'] == uuid:
return c
......@@ -58,7 +58,7 @@ def list_uuids():
bus = dbus.SystemBus()
for c in get_connections():
proxy = bus.get_object('org.freedesktop.NetworkManager', c)
iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManagerSettings.Connection')
iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManager.Settings.Connection')
settings = iface.GetSettings()
conn = settings['connection']
print "%s - %s (%s)" % (conn['uuid'], conn['id'], conn['type'])
......@@ -77,7 +77,7 @@ def get_active_connection_path(uuid):
path = iface.Get('org.freedesktop.NetworkManager.Connection.Active', 'Connection')
proxy = bus.get_object('org.freedesktop.NetworkManager', path)
iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManagerSettings.Connection')
iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManager.Settings.Connection')
settings = iface.GetSettings()
if settings['connection']['uuid'] == uuid:
......
......@@ -45,12 +45,12 @@
#define NM_DBUS_INTERFACE_DHCP6_CONFIG NM_DBUS_INTERFACE ".DHCP6Config"
#define NM_DBUS_IFACE_SETTINGS "org.freedesktop.NetworkManagerSettings"
#define NM_DBUS_PATH_SETTINGS "/org/freedesktop/NetworkManagerSettings"
#define NM_DBUS_IFACE_SETTINGS "org.freedesktop.NetworkManager.Settings"
#define NM_DBUS_PATH_SETTINGS "/org/freedesktop/NetworkManager/Settings"
#define NM_DBUS_IFACE_SETTINGS_CONNECTION "org.freedesktop.NetworkManagerSettings.Connection"
#define NM_DBUS_PATH_SETTINGS_CONNECTION "/org/freedesktop/NetworkManagerSettings/Connection"
#define NM_DBUS_IFACE_SETTINGS_CONNECTION_SECRETS "org.freedesktop.NetworkManagerSettings.Connection.Secrets"
#define NM_DBUS_IFACE_SETTINGS_CONNECTION "org.freedesktop.NetworkManager.Settings.Connection"
#define NM_DBUS_PATH_SETTINGS_CONNECTION "/org/freedesktop/NetworkManager/Settings/Connection"
#define NM_DBUS_IFACE_SETTINGS_CONNECTION_SECRETS "org.freedesktop.NetworkManager.Settings.Connection.Secrets"
/*
......
<?xml version="1.0" encoding="UTF-8" ?>
<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
<interface name="org.freedesktop.NetworkManagerSettings">
<interface name="org.freedesktop.NetworkManager.Settings">
<tp:docstring>
The NetworkManagerSettings interface is provided by the service which provides connections to NetworkManager.
The Settings interface allows clients to view and administrate the connections stored and used by NetworkManager.
</tp:docstring>
<method name="ListConnections">
......
......@@ -2,7 +2,7 @@
<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
<interface name="org.freedesktop.NetworkManagerSettings.Connection">
<interface name="org.freedesktop.NetworkManager.Settings.Connection">
<tp:docstring>
Represents a single network connection configuration.
</tp:docstring>
......@@ -59,7 +59,7 @@
</interface>
<interface name="org.freedesktop.NetworkManagerSettings.Connection.Secrets">
<interface name="org.freedesktop.NetworkManager.Settings.Connection.Secrets">
<tp:docstring>
Secrets have a separate interface so that they can be locked down.
</tp:docstring>
......
......@@ -130,10 +130,10 @@ nm_remote_connection_commit_changes (NMRemoteConnection *self,
settings = nm_connection_to_hash (NM_CONNECTION (self));
call->call = org_freedesktop_NetworkManagerSettings_Connection_update_async (priv->proxy,
settings,
update_cb,
call);
call->call = org_freedesktop_NetworkManager_Settings_Connection_update_async (priv->proxy,
settings,
update_cb,
call);
g_assert (call->call);
priv->calls = g_slist_append (priv->calls, call);
......@@ -178,9 +178,9 @@ nm_remote_connection_delete (NMRemoteConnection *self,
call->user_data = user_data;
call->proxy = priv->proxy;
call->call = org_freedesktop_NetworkManagerSettings_Connection_delete_async (priv->proxy,
delete_cb,
call);
call->call = org_freedesktop_NetworkManager_Settings_Connection_delete_async (priv->proxy,
delete_cb,
call);
g_assert (call->call);
priv->calls = g_slist_append (priv->calls, call);
}
......@@ -230,12 +230,12 @@ nm_remote_connection_get_secrets (NMRemoteConnection *self,
call->user_data = user_data;
call->proxy = priv->secrets_proxy;
call->call = org_freedesktop_NetworkManagerSettings_Connection_Secrets_get_secrets_async (priv->secrets_proxy,
setting_name,
hints,
request_new,
get_secrets_cb,
call);
call->call = org_freedesktop_NetworkManager_Settings_Connection_Secrets_get_secrets_async (priv->secrets_proxy,
setting_name,
hints,
request_new,
get_secrets_cb,
call);
g_assert (call->call);
priv->calls = g_slist_append (priv->calls, call);
}
......@@ -362,9 +362,9 @@ constructor (GType type,
dbus_g_proxy_add_signal (priv->proxy, "Removed", G_TYPE_INVALID);
dbus_g_proxy_connect_signal (priv->proxy, "Removed", G_CALLBACK (removed_cb), object, NULL);
org_freedesktop_NetworkManagerSettings_Connection_get_settings_async (priv->proxy,
get_settings_cb,
object);
org_freedesktop_NetworkManager_Settings_Connection_get_settings_async (priv->proxy,
get_settings_cb,
object);
return object;
}
......
......@@ -223,9 +223,9 @@ fetch_connections (gpointer user_data)
priv->fetch_id = 0;
org_freedesktop_NetworkManagerSettings_list_connections_async (priv->proxy,
fetch_connections_done,
self);
org_freedesktop_NetworkManager_Settings_list_connections_async (priv->proxy,
fetch_connections_done,
self);
return FALSE;
}
......@@ -309,10 +309,10 @@ nm_remote_settings_add_connection (NMRemoteSettings *settings,
info->callback_data = user_data;
new_settings = nm_connection_to_hash (connection);
org_freedesktop_NetworkManagerSettings_add_connection_async (priv->proxy,
new_settings,
add_connection_done,
info);
org_freedesktop_NetworkManager_Settings_add_connection_async (priv->proxy,
new_settings,
add_connection_done,
info);
g_hash_table_destroy (new_settings);
return TRUE;
}
......
......@@ -11,7 +11,6 @@ libnm-util/crypto.c
libnm-util/crypto_gnutls.c
libnm-util/crypto_nss.c
libnm-util/nm-utils.c
policy/org.freedesktop.network-manager-settings.system.policy.in
policy/org.freedesktop.NetworkManager.policy.in
src/nm-netlink-monitor.c
src/main.c
......
polkit_policydir = $(datadir)/polkit-1/actions
dist_polkit_policy_in_files = \
org.freedesktop.network-manager-settings.system.policy.in \
org.freedesktop.NetworkManager.policy.in
dist_polkit_policy_DATA = $(dist_polkit_policy_in_files:.policy.in=.policy)
......
......@@ -54,5 +54,41 @@
</defaults>
</action>
<action id="org.freedesktop.NetworkManager.settings.modify">
<_description>Modify system connections</_description>
<_message>System policy prevents modification of system settings</_message>
<defaults>
<allow_inactive>no</allow_inactive>
<allow_active>auth_admin_keep</allow_active>
</defaults>
</action>
<action id="org.freedesktop.NetworkManager.settings.hostname.modify">
<_description>Modify persistent system hostname</_description>
<_message>System policy prevents modification of the persistent system hostname</_message>
<defaults>
<allow_inactive>no</allow_inactive>
<allow_active>auth_admin_keep</allow_active>
</defaults>
</action>
<action id="org.freedesktop.NetworkManager.settings.wifi.share.protected">
<_description>Connection sharing via a protected WiFi network</_description>
<_message>System policy prevents sharing connections via a protected WiFi network</_message>
<defaults>
<allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
<action id="org.freedesktop.NetworkManager.settings.wifi.share.open">
<_description>Connection sharing via an open WiFi network</_description>
<_message>System policy prevents sharing connections via an open WiFi network</_message>
<defaults>
<allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
</policyconfig>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
<policyconfig>
<vendor>NetworkManager</vendor>
<vendor_url>http://www.gnome.org/projects/NetworkManager</vendor_url>
<icon_name>nm-icon</icon_name>
<action id="org.freedesktop.network-manager-settings.system.modify">
<_description>Modify system connections</_description>
<_message>System policy prevents modification of system settings</_message>
<defaults>
<allow_inactive>no</allow_inactive>
<allow_active>auth_admin_keep</allow_active>
</defaults>
</action>
<action id="org.freedesktop.network-manager-settings.system.hostname.modify">
<_description>Modify persistent system hostname</_description>
<_message>System policy prevents modification of the persistent system hostname</_message>
<defaults>
<allow_inactive>no</allow_inactive>
<allow_active>auth_admin_keep</allow_active>
</defaults>
</action>
<action id="org.freedesktop.network-manager-settings.system.wifi.share.protected">
<_description>Connection sharing via a protected WiFi network</_description>
<_message>System policy prevents sharing connections via a protected WiFi network</_message>
<defaults>
<allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
<action id="org.freedesktop.network-manager-settings.system.wifi.share.open">
<_description>Connection sharing via an open WiFi network</_description>
<_message>System policy prevents sharing connections via an open WiFi network</_message>
<defaults>
<allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
</policyconfig>
......@@ -64,19 +64,19 @@
<deny send_destination="org.freedesktop.NetworkManager"/>
<allow send_destination="org.freedesktop.NetworkManager"
send_interface="org.freedesktop.NetworkManagerSettings"/>
send_interface="org.freedesktop.NetworkManager.Settings"/>
<allow send_destination="org.freedesktop.NetworkManager"
send_interface="org.freedesktop.NetworkManagerSettings.Connection"/>
send_interface="org.freedesktop.NetworkManager.Settings.Connection"/>
<allow send_destination="org.freedesktop.NetworkManager"
send_interface="org.freedesktop.NetworkManagerSettings.Secrets"/>
send_interface="org.freedesktop.NetworkManager.Settings.Secrets"/>
<deny send_destination="org.freedesktop.NetworkManager"
send_interface="org.freedesktop.NetworkManager"
send_member="SetLogging"/>
<!-- The org.freedesktop.NetworkManagerSettings.Connection.Secrets
<!-- The org.freedesktop.NetworkManager.Settings.Connection.Secrets
interface is secured via PolicyKit.
-->
</policy>
......
......@@ -24,9 +24,9 @@
#include <polkit/polkit.h>
#define NM_SYSCONFIG_POLICY_ACTION_CONNECTION_MODIFY "org.freedesktop.network-manager-settings.system.modify"
#define NM_SYSCONFIG_POLICY_ACTION_WIFI_SHARE_PROTECTED "org.freedesktop.network-manager-settings.system.wifi.share.protected"
#define NM_SYSCONFIG_POLICY_ACTION_WIFI_SHARE_OPEN "org.freedesktop.network-manager-settings.system.wifi.share.open"
#define NM_SYSCONFIG_POLICY_ACTION_HOSTNAME_MODIFY "org.freedesktop.network-manager-settings.system.hostname.modify"
#define NM_SYSCONFIG_POLICY_ACTION_CONNECTION_MODIFY "org.freedesktop.NetworkManager.settings.modify"
#define NM_SYSCONFIG_POLICY_ACTION_WIFI_SHARE_PROTECTED "org.freedesktop.NetworkManager.settings.wifi.share.protected"
#define NM_SYSCONFIG_POLICY_ACTION_WIFI_SHARE_OPEN "org.freedesktop.NetworkManager.settings.wifi.share.open"
#define NM_SYSCONFIG_POLICY_ACTION_HOSTNAME_MODIFY "org.freedesktop.NetworkManager.settings.hostname.modify"
#endif /* NM_POLKIT_HELPERS_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment