diff --git a/.gitignore b/.gitignore
index 2df9a0d4b..22f990911 100644
--- a/.gitignore
+++ b/.gitignore
@@ -106,5 +106,6 @@ m4/libtool.m4
m4/lt*.m4
policy/org.freedesktop.network-manager-settings.system.policy
+policy/org.freedesktop.NetworkManager.policy
cli/src/nmcli
diff --git a/initscript/RedHat/NetworkManager.in b/initscript/RedHat/NetworkManager.in
index 66f949597..e26e59ed4 100755
--- a/initscript/RedHat/NetworkManager.in
+++ b/initscript/RedHat/NetworkManager.in
@@ -49,7 +49,7 @@ start()
echo
echo -n $"Starting NetworkManager daemon: "
- daemon --check $servicename $processname --pid-file=$pidfile
+ daemon --pidfile $pidfile --check $servicename $processname --pid-file=$pidfile
RETVAL=$?
echo
if [ -n "${NETWORKWAIT}" ]; then
diff --git a/introspection/nm-device.xml b/introspection/nm-device.xml
index 7a02b73ef..016c121e7 100644
--- a/introspection/nm-device.xml
+++ b/introspection/nm-device.xml
@@ -9,7 +9,15 @@
- The network interface offered by the device.
+ The name of the device's control (and often data) interface.
+
+
+
+
+ The name of the device's data interface when available. This property
+ may not refer to the actual data interface until the device has
+ successfully established a data connection, indicated by the device's
+ State becoming ACTIVATED.
@@ -65,10 +73,11 @@
+
+
Disconnects a device and prevents the device from automatically activating further connections without user intervention.
-
diff --git a/introspection/nm-manager-client.xml b/introspection/nm-manager-client.xml
index 7a9e311ca..f30d1d671 100644
--- a/introspection/nm-manager-client.xml
+++ b/introspection/nm-manager-client.xml
@@ -31,19 +31,30 @@ object. dbus-glib generates the same bound function names for D-Bus the methods
+
+
+
+
+
+
+
+
+
+
+
diff --git a/introspection/nm-manager.xml b/introspection/nm-manager.xml
index 46db5afd8..e1b466799 100644
--- a/introspection/nm-manager.xml
+++ b/introspection/nm-manager.xml
@@ -77,6 +77,7 @@
Deactivate an active connection.
+
The currently active connection to deactivate.
@@ -86,6 +87,7 @@
+
Control the NetworkManager daemon's sleep state. When asleep, all
interfaces that it manages are deactivated. When awake, devices are
@@ -101,6 +103,7 @@
+
Control whether overall networking is enabled or disabled. When
disabled, all interfaces that NM manages are deactivated. When enabled,
@@ -116,6 +119,34 @@
+
+
+
+
+ Returns the permissions a caller has for various authenticated operations
+ that NetworkManager provides, like Enable/Disable networking, changing
+ WiFi, WWAN, and WiMAX state, etc.
+
+
+
+ Dictionary of available permissions and results. Each permission
+ is represented by a name (ie "org.freedesktop.NetworkManager.Foobar")
+ and each result is one of the following values: "yes" (the permission
+ is available), "auth" (the permission is available after a successful
+ authentication), or "no" (the permission is denied). Clients may use
+ these values in the UI to indicate the ability to perform certain
+ operations.
+
+
+
+
+
+
+ Emitted when system authorization details change, indicating that
+ clients may wish to recheck permissions with GetPermissions.
+
+
+
@@ -274,6 +305,7 @@
DEPRECATED. Control the NetworkManager daemon's sleep state. When asleep, all interfaces that it manages are deactivated.
+
@@ -281,6 +313,7 @@
DEPRECATED. Control the NetworkManager daemon's sleep state. When awake, all known interfaces are available to be activated.
+
diff --git a/libnm-glib/libnm-glib.ver b/libnm-glib/libnm-glib.ver
index 2b84dace1..1c4d8f43c 100644
--- a/libnm-glib/libnm-glib.ver
+++ b/libnm-glib/libnm-glib.ver
@@ -34,6 +34,7 @@ global:
nm_client_get_device_by_path;
nm_client_get_devices;
nm_client_get_manager_running;
+ nm_client_get_permission_result;
nm_client_get_state;
nm_client_get_type;
nm_client_networking_get_enabled;
diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c
index 00d729a2e..a1f986f49 100644
--- a/libnm-glib/nm-client.c
+++ b/libnm-glib/nm-client.c
@@ -58,6 +58,9 @@ typedef struct {
GPtrArray *devices;
GPtrArray *active_connections;
+ DBusGProxyCall *perm_call;
+ GHashTable *permissions;
+
gboolean have_networking_enabled;
gboolean networking_enabled;
gboolean wireless_enabled;
@@ -84,6 +87,7 @@ enum {
enum {
DEVICE_ADDED,
DEVICE_REMOVED,
+ PERMISSION_CHANGED,
LAST_SIGNAL
};
@@ -118,6 +122,8 @@ nm_client_init (NMClient *client)
priv->state = NM_STATE_UNKNOWN;
+ priv->permissions = g_hash_table_new (g_direct_hash, g_direct_equal);
+
g_signal_connect (client,
"notify::" NM_CLIENT_NETWORKING_ENABLED,
G_CALLBACK (handle_net_enabled_changed),
@@ -284,6 +290,114 @@ register_for_property_changed (NMClient *client)
property_changed_info);
}
+#define NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK "org.freedesktop.NetworkManager.enable-disable-network"
+#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI "org.freedesktop.NetworkManager.enable-disable-wifi"
+#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN "org.freedesktop.NetworkManager.enable-disable-wwan"
+#define NM_AUTH_PERMISSION_USE_USER_CONNECTIONS "org.freedesktop.NetworkManager.use-user-connections"
+
+static NMClientPermission
+nm_permission_to_client (const char *nm)
+{
+ if (!strcmp (nm, NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK))
+ return NM_CLIENT_PERMISSION_ENABLE_DISABLE_NETWORK;
+ else if (!strcmp (nm, NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI))
+ return NM_CLIENT_PERMISSION_ENABLE_DISABLE_WIFI;
+ else if (!strcmp (nm, NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN))
+ return NM_CLIENT_PERMISSION_ENABLE_DISABLE_WWAN;
+ else if (!strcmp (nm, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS))
+ return NM_CLIENT_PERMISSION_USE_USER_CONNECTIONS;
+ return NM_CLIENT_PERMISSION_NONE;
+}
+
+static NMClientPermissionResult
+nm_permission_result_to_client (const char *nm)
+{
+ if (!strcmp (nm, "yes"))
+ return NM_CLIENT_PERMISSION_RESULT_YES;
+ else if (!strcmp (nm, "no"))
+ return NM_CLIENT_PERMISSION_RESULT_NO;
+ else if (!strcmp (nm, "auth"))
+ return NM_CLIENT_PERMISSION_RESULT_AUTH;
+ return NM_CLIENT_PERMISSION_RESULT_UNKNOWN;
+}
+
+static void
+get_permissions_reply (DBusGProxy *proxy,
+ GHashTable *permissions,
+ GError *error,
+ gpointer user_data)
+{
+ NMClient *self = NM_CLIENT (user_data);
+ NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (self);
+ GHashTableIter iter;
+ gpointer key, value;
+ NMClientPermission perm;
+ NMClientPermissionResult perm_result;
+ GList *keys, *keys_iter;
+
+ priv->perm_call = NULL;
+
+ /* get list of old permissions for change notification */
+ keys = g_hash_table_get_keys (priv->permissions);
+ g_hash_table_remove_all (priv->permissions);
+
+ if (!error) {
+ /* Process new permissions */
+ g_hash_table_iter_init (&iter, permissions);
+ while (g_hash_table_iter_next (&iter, &key, &value)) {
+ perm = nm_permission_to_client ((const char *) key);
+ perm_result = nm_permission_result_to_client ((const char *) value);
+ if (perm) {
+ g_hash_table_insert (priv->permissions,
+ GUINT_TO_POINTER (perm),
+ GUINT_TO_POINTER (perm_result));
+
+ /* Remove this permission from the list of previous permissions
+ * we'll be sending NM_CLIENT_PERMISSION_RESULT_UNKNOWN for
+ * in the change signal since it is still a known permission.
+ */
+ keys = g_list_remove (keys, GUINT_TO_POINTER (perm));
+ }
+ }
+ }
+
+ /* Signal changes in all updated permissions */
+ g_hash_table_iter_init (&iter, priv->permissions);
+ while (g_hash_table_iter_next (&iter, &key, &value)) {
+ g_signal_emit (self, signals[PERMISSION_CHANGED], 0,
+ GPOINTER_TO_UINT (key),
+ GPOINTER_TO_UINT (value));
+ }
+
+ /* And signal changes in all permissions that used to be valid but for
+ * some reason weren't received in the last request (if any).
+ */
+ for (keys_iter = keys; keys_iter; keys_iter = g_list_next (keys_iter)) {
+ g_signal_emit (self, signals[PERMISSION_CHANGED], 0,
+ GPOINTER_TO_UINT (keys_iter->data),
+ NM_CLIENT_PERMISSION_RESULT_UNKNOWN);
+ }
+ g_list_free (keys);
+}
+
+static DBusGProxyCall *
+get_permissions (NMClient *self)
+{
+ return org_freedesktop_NetworkManager_get_permissions_async (NM_CLIENT_GET_PRIVATE (self)->client_proxy,
+ get_permissions_reply,
+ self);
+}
+
+static void
+client_recheck_permissions (DBusGProxy *proxy, gpointer user_data)
+{
+ NMClient *self = NM_CLIENT (user_data);
+ NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (self);
+
+ if (!priv->perm_call)
+ priv->perm_call = get_permissions (self);
+}
+
static GObject*
constructor (GType type,
guint n_construct_params,
@@ -324,6 +438,15 @@ constructor (GType type,
object,
NULL);
+ /* Permissions */
+ dbus_g_proxy_add_signal (priv->client_proxy, "CheckPermissions", G_TYPE_INVALID);
+ dbus_g_proxy_connect_signal (priv->client_proxy,
+ "CheckPermissions",
+ G_CALLBACK (client_recheck_permissions),
+ object,
+ NULL);
+ priv->perm_call = get_permissions (NM_CLIENT (object));
+
priv->bus_proxy = dbus_g_proxy_new_for_name (connection,
"org.freedesktop.DBus",
"/org/freedesktop/DBus",
@@ -381,12 +504,17 @@ dispose (GObject *object)
return;
}
+ if (priv->perm_call)
+ dbus_g_proxy_cancel_call (priv->client_proxy, priv->perm_call);
+
g_object_unref (priv->client_proxy);
g_object_unref (priv->bus_proxy);
free_object_array (&priv->devices);
free_object_array (&priv->active_connections);
+ g_hash_table_destroy (priv->permissions);
+
G_OBJECT_CLASS (nm_client_parent_class)->dispose (object);
}
@@ -626,6 +754,22 @@ nm_client_class_init (NMClientClass *client_class)
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
G_TYPE_OBJECT);
+
+ /**
+ * NMClient::permission-changed:
+ * @widget: the client that received the signal
+ * @permission: a permission from #NMClientPermission
+ * @result: the permission's result, one of #NMClientPermissionResult
+ *
+ * Notifies that a permission has changed
+ **/
+ signals[PERMISSION_CHANGED] =
+ g_signal_new ("permission-changed",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST,
+ 0, NULL, NULL,
+ _nm_marshal_VOID__UINT_UINT,
+ G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
}
/**
@@ -1158,3 +1302,25 @@ nm_client_get_manager_running (NMClient *client)
return NM_CLIENT_GET_PRIVATE (client)->manager_running;
}
+/**
+ * nm_client_get_permission_result:
+ * @client: a #NMClient
+ * @permission: the permission for which to return the result, one of #NMClientPermission
+ *
+ * Requests the result of a specific permission, which indicates whether the
+ * client can or cannot perform the action the permission represents
+ *
+ * Returns: the permission's result, one of #NMClientPermissionResult
+ **/
+NMClientPermissionResult
+nm_client_get_permission_result (NMClient *client, NMClientPermission permission)
+{
+ gpointer result;
+
+ g_return_val_if_fail (NM_IS_CLIENT (client), NM_CLIENT_PERMISSION_RESULT_UNKNOWN);
+
+ result = g_hash_table_lookup (NM_CLIENT_GET_PRIVATE (client)->permissions,
+ GUINT_TO_POINTER (permission));
+ return GPOINTER_TO_UINT (result);
+}
+
diff --git a/libnm-glib/nm-client.h b/libnm-glib/nm-client.h
index 6b912e05a..c67e0d8f8 100644
--- a/libnm-glib/nm-client.h
+++ b/libnm-glib/nm-client.h
@@ -50,6 +50,25 @@ G_BEGIN_DECLS
#define NM_CLIENT_WWAN_HARDWARE_ENABLED "wwan-hardware-enabled"
#define NM_CLIENT_ACTIVE_CONNECTIONS "active-connections"
+/* Permissions */
+typedef enum {
+ NM_CLIENT_PERMISSION_NONE = 0,
+ NM_CLIENT_PERMISSION_ENABLE_DISABLE_NETWORK = 1,
+ NM_CLIENT_PERMISSION_ENABLE_DISABLE_WIFI = 2,
+ NM_CLIENT_PERMISSION_ENABLE_DISABLE_WWAN = 3,
+ NM_CLIENT_PERMISSION_USE_USER_CONNECTIONS = 4,
+
+ NM_CLIENT_PERMISSION_LAST = NM_CLIENT_PERMISSION_USE_USER_CONNECTIONS
+} NMClientPermission;
+
+typedef enum {
+ NM_CLIENT_PERMISSION_RESULT_UNKNOWN = 0,
+ NM_CLIENT_PERMISSION_RESULT_YES,
+ NM_CLIENT_PERMISSION_RESULT_AUTH,
+ NM_CLIENT_PERMISSION_RESULT_NO
+} NMClientPermissionResult;
+
+
typedef struct {
NMObject parent;
} NMClient;
@@ -105,6 +124,9 @@ gboolean nm_client_get_manager_running (NMClient *client);
const GPtrArray *nm_client_get_active_connections (NMClient *client);
void nm_client_sleep (NMClient *client, gboolean sleep);
+NMClientPermissionResult nm_client_get_permission_result (NMClient *client,
+ NMClientPermission permission);
+
G_END_DECLS
#endif /* NM_CLIENT_H */
diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c
index 53fe0b73a..a38c646a2 100644
--- a/libnm-glib/nm-device.c
+++ b/libnm-glib/nm-device.c
@@ -49,6 +49,7 @@ typedef struct {
DBusGProxy *proxy;
char *iface;
+ char *ip_iface;
char *udi;
char *driver;
guint32 capabilities;
@@ -84,6 +85,7 @@ enum {
PROP_PRODUCT,
PROP_VENDOR,
PROP_DHCP6_CONFIG,
+ PROP_IP_INTERFACE,
LAST_PROP
};
@@ -272,6 +274,7 @@ register_for_property_changed (NMDevice *device)
const NMPropertiesChangedInfo property_changed_info[] = {
{ NM_DEVICE_UDI, _nm_object_demarshal_generic, &priv->udi },
{ NM_DEVICE_INTERFACE, _nm_object_demarshal_generic, &priv->iface },
+ { NM_DEVICE_IP_INTERFACE, _nm_object_demarshal_generic, &priv->ip_iface },
{ NM_DEVICE_DRIVER, _nm_object_demarshal_generic, &priv->driver },
{ NM_DEVICE_CAPABILITIES, _nm_object_demarshal_generic, &priv->capabilities },
{ NM_DEVICE_MANAGED, _nm_object_demarshal_generic, &priv->managed },
@@ -379,6 +382,7 @@ finalize (GObject *object)
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (object);
g_free (priv->iface);
+ g_free (priv->ip_iface);
g_free (priv->udi);
g_free (priv->driver);
g_free (priv->product);
@@ -402,6 +406,9 @@ get_property (GObject *object,
case PROP_INTERFACE:
g_value_set_string (value, nm_device_get_iface (device));
break;
+ case PROP_IP_INTERFACE:
+ g_value_set_string (value, nm_device_get_ip_iface (device));
+ break;
case PROP_DRIVER:
g_value_set_string (value, nm_device_get_driver (device));
break;
@@ -746,6 +753,33 @@ nm_device_get_iface (NMDevice *device)
return priv->iface;
}
+/**
+ * nm_device_get_ip_iface:
+ * @device: a #NMDevice
+ *
+ * Gets the IP interface name of the #NMDevice over which IP traffic flows
+ * when the device is in the ACTIVATED state.
+ *
+ * Returns: the IP traffic interface of the device. This is the internal string
+ * used by the device, and must not be modified.
+ **/
+const char *
+nm_device_get_ip_iface (NMDevice *device)
+{
+ NMDevicePrivate *priv;
+
+ g_return_val_if_fail (NM_IS_DEVICE (device), NULL);
+
+ priv = NM_DEVICE_GET_PRIVATE (device);
+ if (!priv->ip_iface) {
+ priv->ip_iface = _nm_object_get_string_property (NM_OBJECT (device),
+ NM_DBUS_INTERFACE_DEVICE,
+ "IpInterface");
+ }
+
+ return priv->ip_iface;
+}
+
/**
* nm_device_get_udi:
* @device: a #NMDevice
diff --git a/libnm-glib/nm-device.h b/libnm-glib/nm-device.h
index 5a47ff9a6..59bf4de6b 100644
--- a/libnm-glib/nm-device.h
+++ b/libnm-glib/nm-device.h
@@ -46,6 +46,7 @@ G_BEGIN_DECLS
#define NM_DEVICE_UDI "udi"
#define NM_DEVICE_INTERFACE "interface"
+#define NM_DEVICE_IP_INTERFACE "ip-interface"
#define NM_DEVICE_DRIVER "driver"
#define NM_DEVICE_CAPABILITIES "capabilities"
#define NM_DEVICE_MANAGED "managed"
@@ -85,6 +86,7 @@ GType nm_device_get_type (void);
GObject * nm_device_new (DBusGConnection *connection, const char *path);
const char * nm_device_get_iface (NMDevice *device);
+const char * nm_device_get_ip_iface (NMDevice *device);
const char * nm_device_get_udi (NMDevice *device);
const char * nm_device_get_driver (NMDevice *device);
guint32 nm_device_get_capabilities (NMDevice *device);
diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am
index ddc68408a..3233d4067 100644
--- a/libnm-util/Makefile.am
+++ b/libnm-util/Makefile.am
@@ -59,7 +59,7 @@ libnm_util_la_SOURCES= \
libnm_util_la_LIBADD = $(GLIB_LIBS) $(DBUS_LIBS) $(UUID_LIBS)
libnm_util_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-util.ver \
- -version-info "4:4:3"
+ -version-info "5:0:4"
if WITH_GNUTLS
libnm_util_la_SOURCES += crypto_gnutls.c
diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver
index f3d4344ca..e630b00ec 100644
--- a/libnm-util/libnm-util.ver
+++ b/libnm-util/libnm-util.ver
@@ -366,6 +366,10 @@ global:
nm_utils_ssid_to_utf8;
nm_utils_uuid_generate;
nm_utils_uuid_generate_from_string;
+ nm_utils_wifi_freq_to_channel;
+ nm_utils_wifi_channel_to_freq;
+ nm_utils_wifi_find_next_channel;
+ nm_utils_wifi_is_channel_valid;
nm_ip4_address_compare;
nm_ip4_address_dup;
nm_ip4_address_get_address;
diff --git a/libnm-util/nm-setting-wireless.c b/libnm-util/nm-setting-wireless.c
index 9213429c8..44d010f7a 100644
--- a/libnm-util/nm-setting-wireless.c
+++ b/libnm-util/nm-setting-wireless.c
@@ -19,7 +19,7 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
- * (C) Copyright 2007 - 2008 Red Hat, Inc.
+ * (C) Copyright 2007 - 2010 Red Hat, Inc.
* (C) Copyright 2007 - 2008 Novell, Inc.
*/
@@ -480,31 +480,11 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
}
if (priv->channel) {
- if (!strcmp (priv->band, "a")) {
- int i;
- int valid_channels[] = { 7, 8, 9, 11, 12, 16, 34, 36, 40, 44, 48,
- 52, 56, 60, 64, 100, 104, 108, 112, 116,
- 120, 124, 128, 132, 136, 140, 149, 153,
- 157, 161, 165, 183, 184, 185, 187, 188,
- 192, 196, 0 };
-
- for (i = 0; valid_channels[i]; i++) {
- if (priv->channel == valid_channels[i])
- break;
- }
-
- if (valid_channels[i] == 0) {
- g_set_error (error,
- NM_SETTING_WIRELESS_ERROR,
- NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY,
- NM_SETTING_WIRELESS_CHANNEL);
- return FALSE;
- }
- } else if (!strcmp (priv->band, "bg") && priv->channel > 14) {
- g_set_error (error,
- NM_SETTING_WIRELESS_ERROR,
- NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY,
- NM_SETTING_WIRELESS_CHANNEL);
+ if (!nm_utils_wifi_is_channel_valid (priv->channel, priv->band)) {
+ g_set_error (error,
+ NM_SETTING_WIRELESS_ERROR,
+ NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY,
+ NM_SETTING_WIRELESS_CHANNEL);
return FALSE;
}
}
diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c
index b8d2bc33e..1f587297e 100644
--- a/libnm-util/nm-utils.c
+++ b/libnm-util/nm-utils.c
@@ -117,7 +117,7 @@ static const struct IsoLangToEncodings isoLangEntries2[] =
/* Arabic */
{ "ar", {"iso-8859-6", "windows-1256", NULL} },
- /* Balitc */
+ /* Baltic */
{ "et", {"iso-8859-4", "windows-1257", NULL} }, /* Estonian */
{ "lt", {"iso-8859-4", "windows-1257", NULL} }, /* Lithuanian */
{ "lv", {"iso-8859-4", "windows-1257", NULL} }, /* Latvian */
@@ -2131,3 +2131,212 @@ out:
return ret;
}
+/* Band, channel/frequency stuff for wireless */
+struct cf_pair {
+ guint32 chan;
+ guint32 freq;
+};
+
+static struct cf_pair a_table[] = {
+ /* A band */
+ { 7, 5035 },
+ { 8, 5040 },
+ { 9, 5045 },
+ { 11, 5055 },
+ { 12, 5060 },
+ { 16, 5080 },
+ { 34, 5170 },
+ { 36, 5180 },
+ { 38, 5190 },
+ { 40, 5200 },
+ { 42, 5210 },
+ { 44, 5220 },
+ { 46, 5230 },
+ { 48, 5240 },
+ { 50, 5250 },
+ { 52, 5260 },
+ { 56, 5280 },
+ { 58, 5290 },
+ { 60, 5300 },
+ { 64, 5320 },
+ { 100, 5500 },
+ { 104, 5520 },
+ { 108, 5540 },
+ { 112, 5560 },
+ { 116, 5580 },
+ { 120, 5600 },
+ { 124, 5620 },
+ { 128, 5640 },
+ { 132, 5660 },
+ { 136, 5680 },
+ { 140, 5700 },
+ { 149, 5745 },
+ { 152, 5760 },
+ { 153, 5765 },
+ { 157, 5785 },
+ { 160, 5800 },
+ { 161, 5805 },
+ { 165, 5825 },
+ { 183, 4915 },
+ { 184, 4920 },
+ { 185, 4925 },
+ { 187, 4935 },
+ { 188, 4945 },
+ { 192, 4960 },
+ { 196, 4980 },
+ { 0, -1 }
+};
+
+static struct cf_pair bg_table[] = {
+ /* B/G band */
+ { 1, 2412 },
+ { 2, 2417 },
+ { 3, 2422 },
+ { 4, 2427 },
+ { 5, 2432 },
+ { 6, 2437 },
+ { 7, 2442 },
+ { 8, 2447 },
+ { 9, 2452 },
+ { 10, 2457 },
+ { 11, 2462 },
+ { 12, 2467 },
+ { 13, 2472 },
+ { 14, 2484 },
+ { 0, -1 }
+};
+
+/**
+ * nm_utils_wifi_freq_to_channel:
+ * @freq: frequency
+ *
+ * Utility function to translate a WiFi frequency to its corresponding channel.
+ *
+ * Returns: the channel represented by the frequency or 0
+ **/
+guint32
+nm_utils_wifi_freq_to_channel (guint32 freq)
+{
+ int i = 0;
+
+ if (freq > 4900) {
+ while (a_table[i].chan && (a_table[i].freq != freq))
+ i++;
+ return a_table[i].chan;
+ } else {
+ while (bg_table[i].chan && (bg_table[i].freq != freq))
+ i++;
+ return bg_table[i].chan;
+ }
+
+ return 0;
+}
+
+/**
+ * nm_utils_wifi_channel_to_freq:
+ * @channel: channel
+ * @band: frequency band for wireless ("a" or "bg")
+ *
+ * Utility function to translate a WiFi channel to its corresponding frequency.
+ *
+ * Returns: the frequency represented by the channel of the band,
+ * or -1 when the freq is invalid, or 0 when the band
+ * is invalid
+ **/
+guint32
+nm_utils_wifi_channel_to_freq (guint32 channel, const char *band)
+{
+ int i = 0;
+
+ if (!strcmp (band, "a")) {
+ while (a_table[i].chan && (a_table[i].chan != channel))
+ i++;
+ return a_table[i].freq;
+ } else if (!strcmp (band, "bg")) {
+ while (bg_table[i].chan && (bg_table[i].chan != channel))
+ i++;
+ return bg_table[i].freq;
+ }
+
+ return 0;
+}
+
+/**
+ * nm_utils_wifi_find_next_channel:
+ * @channel: current channel
+ * @direction: whether going downward (0 or less) or upward (1 or more)
+ * @band: frequency band for wireless ("a" or "bg")
+ *
+ * Utility function to find out next/previous WiFi channel for a channel.
+ *
+ * Returns: the next channel in the specified direction or 0
+ **/
+guint32
+nm_utils_wifi_find_next_channel (guint32 channel, int direction, char *band)
+{
+ size_t a_size = sizeof (a_table) / sizeof (struct cf_pair);
+ size_t bg_size = sizeof (bg_table) / sizeof (struct cf_pair);
+ struct cf_pair *pair = NULL;
+
+ if (!strcmp (band, "a")) {
+ if (channel < a_table[0].chan)
+ return a_table[0].chan;
+ if (channel > a_table[a_size - 2].chan)
+ return a_table[a_size - 2].chan;
+ pair = &a_table[0];
+ } else if (!strcmp (band, "bg")) {
+ if (channel < bg_table[0].chan)
+ return bg_table[0].chan;
+ if (channel > bg_table[bg_size - 2].chan)
+ return bg_table[bg_size - 2].chan;
+ pair = &bg_table[0];
+ } else {
+ g_assert_not_reached ();
+ return 0;
+ }
+
+ while (pair->chan) {
+ if (channel == pair->chan)
+ return channel;
+ if ((channel < (pair+1)->chan) && (channel > pair->chan)) {
+ if (direction > 0)
+ return (pair+1)->chan;
+ else
+ return pair->chan;
+ }
+ pair++;
+ }
+ return 0;
+}
+
+/**
+ * nm_utils_wifi_is_channel_valid:
+ * @channel: channel
+ * @band: frequency band for wireless ("a" or "bg")
+ *
+ * Utility function to verify WiFi channel validity.
+ *
+ * Returns: TRUE or FALSE
+ **/
+gboolean
+nm_utils_wifi_is_channel_valid (guint32 channel, const char *band)
+{
+ struct cf_pair *table = NULL;
+ int i = 0;
+
+ if (!strcmp (band, "a"))
+ table = a_table;
+ else if (!strcmp (band, "bg"))
+ table = bg_table;
+ else
+ return FALSE;
+
+ while (table[i].chan && (table[i].chan != channel))
+ i++;
+
+ if (table[i].chan != 0)
+ return TRUE;
+ else
+ return FALSE;
+}
+
diff --git a/libnm-util/nm-utils.h b/libnm-util/nm-utils.h
index 68501d53f..6be91793e 100644
--- a/libnm-util/nm-utils.h
+++ b/libnm-util/nm-utils.h
@@ -215,4 +215,9 @@ GByteArray *nm_utils_rsa_key_encrypt (const GByteArray *data,
G_END_DECLS
+guint32 nm_utils_wifi_freq_to_channel (guint32 freq);
+guint32 nm_utils_wifi_channel_to_freq (guint32 channel, const char *band);
+guint32 nm_utils_wifi_find_next_channel (guint32 channel, int direction, char *band);
+gboolean nm_utils_wifi_is_channel_valid (guint32 channel, const char *band);
+
#endif /* NM_UTILS_H */
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 4d7faa587..22e8cf382 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -11,6 +11,8 @@ libnm-util/crypto.c
libnm-util/crypto_gnutls.c
libnm-util/crypto_nss.c
libnm-util/nm-utils.c
+policy/org.freedesktop.network-manager-settings.system.policy.in
+policy/org.freedesktop.NetworkManager.policy.in
src/nm-netlink-monitor.c
src/main.c
src/dhcp-manager/nm-dhcp-dhclient.c
@@ -19,5 +21,4 @@ src/logging/nm-logging.c
src/named-manager/nm-named-manager.c
src/system-settings/nm-default-wired-connection.c
system-settings/plugins/ifcfg-rh/reader.c
-policy/org.freedesktop.network-manager-settings.system.policy.in
diff --git a/po/de.po b/po/de.po
index ad8f810f5..ef04aae23 100644
--- a/po/de.po
+++ b/po/de.po
@@ -1,4 +1,6 @@
-# translation of de.po to
+# German translation of NetworkManager.
+# Copyright (C) 2005 Dan Williams
+# This file is distributed under the same license as the NetworkManager package.
# Hendrik Brandt , 2004, 2005.
# Frank Arnold , 2005.
# Hendrik Richter , 2006.
@@ -6,94 +8,23 @@
# Andre Klapper , 2007.
# Hauke Mehrtens , 2008.
# Christian Kirbach , 2009, 2010.
-# Timo Trinks , 2010.
-# German translation of NetworkManager.
-# Copyright (C) 2005 Dan Williams
-# This file is distributed under the same license as the NetworkManager package.
+# Daniel Schury , 2010.
+#
msgid ""
msgstr ""
-"Project-Id-Version: de\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-05-06 14:31+0530\n"
-"PO-Revision-Date: 2010-05-07 10:49+1000\n"
-"Last-Translator: Timo Trinks \n"
-"Language-Team: \n"
+"Project-Id-Version: NetworkManager HEAD\n"
+"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
+"product=NetworkManager&component=general\n"
+"POT-Creation-Date: 2010-04-30 03:24+0000\n"
+"PO-Revision-Date: 2010-05-15 11:50+0200\n"
+"Last-Translator: Daniel Schury \n"
+"Language-Team: Deutsch \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
-"X-Generator: KBabel 1.11.4\n"
-#: ../cli/src/connections.c:59 ../cli/src/connections.c:74
-#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108
-#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142
-#: ../cli/src/devices.c:152
-msgid "NAME"
-msgstr "NAME"
-
-#. 0
-#: ../cli/src/connections.c:60 ../cli/src/connections.c:75
-msgid "UUID"
-msgstr "UUID"
-
-#. 1
-#: ../cli/src/connections.c:61
-msgid "DEVICES"
-msgstr "GERÄTE"
-
-#. 2
-#: ../cli/src/connections.c:62 ../cli/src/connections.c:77
-msgid "SCOPE"
-msgstr "BANDBREITE"
-
-#. 3
-#: ../cli/src/connections.c:63
-msgid "DEFAULT"
-msgstr "VORGABE"
-
-#. 4
-#: ../cli/src/connections.c:64
-msgid "DBUS-SERVICE"
-msgstr "DBUS-DIENST"
-
-#. 5
-#: ../cli/src/connections.c:65
-msgid "SPEC-OBJECT"
-msgstr "SPEC-OBJEKT"
-
-#. 6
-#: ../cli/src/connections.c:66
-msgid "VPN"
-msgstr "VPN"
-
-#. 1
-#. 0
-#. 1
-#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87
-msgid "TYPE"
-msgstr "TYP"
-
-#. 3
-#: ../cli/src/connections.c:78
-msgid "TIMESTAMP"
-msgstr "ZEITSTEMPEL"
-
-#. 4
-#: ../cli/src/connections.c:79
-msgid "TIMESTAMP-REAL"
-msgstr "ZEITSTEMPEL-REAL"
-
-#. 5
-#: ../cli/src/connections.c:80
-msgid "AUTOCONNECT"
-msgstr "AUTOCONNECT"
-
-#. 6
-#: ../cli/src/connections.c:81
-msgid "READONLY"
-msgstr "NURLESEN"
-
-#: ../cli/src/connections.c:157
+#: ../cli/src/connections.c:86
#, c-format
msgid ""
"Usage: nmcli con { COMMAND | help }\n"
@@ -114,516 +45,312 @@ msgstr ""
"]\n"
" down id | uuid \n"
-#: ../cli/src/connections.c:197 ../cli/src/connections.c:536
+#: ../cli/src/connections.c:158
+msgid "Connections"
+msgstr "Verbindungen"
+
+#: ../cli/src/connections.c:158 ../cli/src/connections.c:160
+#: ../cli/src/connections.c:196 ../cli/src/connections.c:198
+#: ../cli/src/connections.c:205 ../cli/src/connections.c:207
+#: ../cli/src/devices.c:298 ../cli/src/devices.c:458 ../cli/src/devices.c:460
+msgid "Type"
+msgstr "Typ"
+
+#: ../cli/src/connections.c:158 ../cli/src/connections.c:160
+#: ../cli/src/connections.c:196 ../cli/src/connections.c:198
+#: ../cli/src/connections.c:205 ../cli/src/connections.c:207
+#: ../cli/src/connections.c:297 ../cli/src/connections.c:299
+msgid "UUID"
+msgstr "UUID"
+
+#: ../cli/src/connections.c:158 ../cli/src/connections.c:160
+#: ../cli/src/connections.c:196 ../cli/src/connections.c:198
+#: ../cli/src/connections.c:205 ../cli/src/connections.c:207
+#: ../cli/src/connections.c:297 ../cli/src/connections.c:299
+msgid "Name"
+msgstr "Name"
+
+#: ../cli/src/connections.c:163
#, c-format
-msgid "Error: 'con list': %s"
-msgstr "Fehler: 'con list': %s"
+msgid "System connections:\n"
+msgstr "Systemverbindungen:\n"
-#: ../cli/src/connections.c:199 ../cli/src/connections.c:538
+#: ../cli/src/connections.c:167
#, c-format
-msgid "Error: 'con list': %s; allowed fields: %s"
-msgstr "Fehler: 'con list': %s; erlaubte Felder: %s"
+msgid "User connections:\n"
+msgstr "Benutzerverbindungen:\n"
-#: ../cli/src/connections.c:207
-msgid "Connection details"
-msgstr "Verbindungsdetails"
-
-#: ../cli/src/connections.c:381 ../cli/src/connections.c:601
-msgid "system"
-msgstr "System"
-
-#: ../cli/src/connections.c:381 ../cli/src/connections.c:601
-msgid "user"
-msgstr "Benutzer"
-
-#: ../cli/src/connections.c:383
-msgid "never"
-msgstr "nie"
-
-#. "CAPABILITIES"
-#. Print header
-#. "WIFI-PROPERTIES"
-#: ../cli/src/connections.c:384 ../cli/src/connections.c:385
-#: ../cli/src/connections.c:602 ../cli/src/connections.c:605
-#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539
-#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542
-#: ../cli/src/devices.c:543 ../cli/src/settings.c:504
-#: ../cli/src/settings.c:544 ../cli/src/settings.c:643
-#: ../cli/src/settings.c:912 ../cli/src/settings.c:913
-#: ../cli/src/settings.c:915 ../cli/src/settings.c:917
-#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043
-#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123
-#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125
-#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127
-#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129
-#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131
-#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133
-#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135
-#: ../cli/src/settings.c:1210
-msgid "yes"
-msgstr "ja"
-
-#: ../cli/src/connections.c:384 ../cli/src/connections.c:385
-#: ../cli/src/connections.c:602 ../cli/src/connections.c:605
-#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539
-#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542
-#: ../cli/src/devices.c:543 ../cli/src/settings.c:504
-#: ../cli/src/settings.c:506 ../cli/src/settings.c:544
-#: ../cli/src/settings.c:643 ../cli/src/settings.c:912
-#: ../cli/src/settings.c:913 ../cli/src/settings.c:915
-#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042
-#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044
-#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124
-#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126
-#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128
-#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130
-#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132
-#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134
-#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210
-msgid "no"
-msgstr "nein"
-
-#: ../cli/src/connections.c:457 ../cli/src/connections.c:500
-msgid "System connections"
-msgstr "System-Verbindungen"
-
-#: ../cli/src/connections.c:462 ../cli/src/connections.c:513
-msgid "User connections"
-msgstr "Benutzer-Verbindungen"
-
-#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334
-#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359
-#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452
-#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973
-#: ../cli/src/devices.c:980
+#: ../cli/src/connections.c:178 ../cli/src/connections.c:967
+#: ../cli/src/connections.c:983 ../cli/src/connections.c:992
+#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085
+#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699
+#: ../cli/src/devices.c:785 ../cli/src/devices.c:792
#, c-format
msgid "Error: %s argument is missing."
-msgstr "Fehler: %s Argument fehlt."
+msgstr "Fehler: Argument %s fehlt."
-#: ../cli/src/connections.c:487
+#: ../cli/src/connections.c:189
#, c-format
msgid "Error: %s - no such connection."
-msgstr "Fehler: %s - keine solche Verbindung."
+msgstr "Fehler: Verbindung %s existiert nicht."
-#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383
-#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687
-#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986
+#: ../cli/src/connections.c:196
+msgid "System-wide connections"
+msgstr "Systemweite Verbindungen"
+
+#: ../cli/src/connections.c:205
+msgid "User connections"
+msgstr "Benutzerverbindungen"
+
+#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016
+#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446
+#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706
+#: ../cli/src/devices.c:798
#, c-format
msgid "Unknown parameter: %s\n"
msgstr "Unbekannter Parameter: %s\n"
-#: ../cli/src/connections.c:528
+#: ../cli/src/connections.c:221
#, c-format
msgid "Error: no valid parameter specified."
-msgstr "Fehler: Kein gültiger Parameter angegeben."
+msgstr "Fehler: Es wurde kein gültiger Parameter angegeben."
-#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572
-#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274
-#, c-format
-msgid "Error: %s."
-msgstr "Fehler: %s."
+#. FIXME: Fix the output
+#: ../cli/src/connections.c:268 ../cli/src/devices.c:302
+#: ../cli/src/devices.c:321 ../cli/src/devices.c:353 ../cli/src/devices.c:355
+#: ../cli/src/devices.c:357 ../cli/src/devices.c:359 ../cli/src/devices.c:361
+msgid "yes"
+msgstr "ja"
-#: ../cli/src/connections.c:649
-#, c-format
-msgid "Error: 'con status': %s"
-msgstr "Fehler: 'con status': %s"
+#: ../cli/src/connections.c:268 ../cli/src/devices.c:304
+msgid "no"
+msgstr "nein"
-#: ../cli/src/connections.c:651
-#, c-format
-msgid "Error: 'con status': %s; allowed fields: %s"
-msgstr "Fehler: 'con status': %s; erlaubte Felder: %s"
-
-#: ../cli/src/connections.c:658
+#: ../cli/src/connections.c:297
msgid "Active connections"
msgstr "Aktive Verbindungen"
-#: ../cli/src/connections.c:1026
+#: ../cli/src/connections.c:297 ../cli/src/connections.c:299
+#: ../cli/src/devices.c:302 ../cli/src/devices.c:304
+msgid "Default"
+msgstr "Vorgabe"
+
+#: ../cli/src/connections.c:297 ../cli/src/connections.c:299
+msgid "Service"
+msgstr "Dienst"
+
+#: ../cli/src/connections.c:297 ../cli/src/connections.c:299
+msgid "Devices"
+msgstr "Geräte"
+
+#: ../cli/src/connections.c:659
#, c-format
msgid "no active connection on device '%s'"
-msgstr "keine aktive Verbindung auf Gerät '%s'"
+msgstr "Keine aktive Verbindung auf Gerät »%s«"
-#: ../cli/src/connections.c:1034
+#: ../cli/src/connections.c:667
#, c-format
msgid "no active connection or device"
-msgstr "keine aktive Verbindung auf Gerät"
+msgstr "Keine aktive Verbindung oder Gerät"
-#: ../cli/src/connections.c:1084
-#, c-format
-msgid "device '%s' not compatible with connection '%s'"
-msgstr "Gerät '%s' nicht mit Verbindung '%s' kompatibel"
-
-#: ../cli/src/connections.c:1086
-#, c-format
-msgid "no device found for connection '%s'"
-msgstr "kein Gerät für Verbindung '%s' gefunden"
-
-#: ../cli/src/connections.c:1097
+#: ../cli/src/connections.c:730
msgid "activating"
msgstr "wird aktiviert"
-#: ../cli/src/connections.c:1099
+#: ../cli/src/connections.c:732
msgid "activated"
msgstr "aktiviert"
-#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125
-#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224
-#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92
-#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469
+#: ../cli/src/connections.c:735 ../cli/src/connections.c:758
+#: ../cli/src/connections.c:791 ../cli/src/devices.c:111
+#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98
msgid "unknown"
msgstr "unbekannt"
-#: ../cli/src/connections.c:1111
+#: ../cli/src/connections.c:744
msgid "VPN connecting (prepare)"
-msgstr "VPN wird verbunden (vorbereiten)"
+msgstr "VPN wird verbunden (wird vorbereitet)"
-#: ../cli/src/connections.c:1113
+#: ../cli/src/connections.c:746
msgid "VPN connecting (need authentication)"
-msgstr "VPN wird verbunden (Authentifizierung erforderlich)"
+msgstr "VPN wird verbunden (Legitimierung wird benötigt)"
-#: ../cli/src/connections.c:1115
+#: ../cli/src/connections.c:748
msgid "VPN connecting"
msgstr "VPN wird verbunden"
-#: ../cli/src/connections.c:1117
+#: ../cli/src/connections.c:750
msgid "VPN connecting (getting IP configuration)"
-msgstr "VPN wird verbunden (IP-Konfiguration wird ermittelt)"
+msgstr "VPN wird verbunden (IP-Einstellungen werden ermittelt)"
-#: ../cli/src/connections.c:1119
+#: ../cli/src/connections.c:752
msgid "VPN connected"
msgstr "VPN verbunden"
-#: ../cli/src/connections.c:1121
+#: ../cli/src/connections.c:754
msgid "VPN connection failed"
-msgstr "VPN-Verbindung fehlgeschlagen"
+msgstr "VPN-Verbindung gescheitert"
-#: ../cli/src/connections.c:1123
+#: ../cli/src/connections.c:756
msgid "VPN disconnected"
msgstr "VPN getrennt"
-#: ../cli/src/connections.c:1134
+#: ../cli/src/connections.c:767
msgid "unknown reason"
msgstr "unbekannter Grund"
-#: ../cli/src/connections.c:1136
+#: ../cli/src/connections.c:769
msgid "none"
msgstr "kein"
-#: ../cli/src/connections.c:1138
+#: ../cli/src/connections.c:771
msgid "the user was disconnected"
-msgstr "der Benutzer wurde getrennt"
+msgstr "Der Benutzer wurde getrennt"
-#: ../cli/src/connections.c:1140
+#: ../cli/src/connections.c:773
msgid "the base network connection was interrupted"
-msgstr "die Basisverbindung wurde unterbrochen"
+msgstr "Die Basisverbindung wurde unterbrochen"
-#: ../cli/src/connections.c:1142
+#: ../cli/src/connections.c:775
msgid "the VPN service stopped unexpectedly"
-msgstr "der VPN-Dienst brach unerwartet ab"
+msgstr "Der VPN-Dienst wurde unerwartet gestoppt"
-#: ../cli/src/connections.c:1144
+#: ../cli/src/connections.c:777
msgid "the VPN service returned invalid configuration"
-msgstr "der VPN-Dienst gab eine ungültige Konfiguration zurück"
+msgstr "Der VPN-Dienst gab ungültige Einstellungen zurück"
-#: ../cli/src/connections.c:1146
+#: ../cli/src/connections.c:779
msgid "the connection attempt timed out"
-msgstr "Der Verbindungsversuch ist zeitlich abgelaufen"
+msgstr "Der Verbindungsversuch benötigte zu viel Zeit"
-#: ../cli/src/connections.c:1148
+#: ../cli/src/connections.c:781
msgid "the VPN service did not start in time"
-msgstr "der VPN-Dienst ist nicht rechtzeitig gestartet"
+msgstr "Der VPN-Dienst wurde nicht rechtzeitig gestartet"
-#: ../cli/src/connections.c:1150
+#: ../cli/src/connections.c:783
msgid "the VPN service failed to start"
-msgstr "der VPN-Dienst konnte nicht starten"
+msgstr "Der VPN-Dienst konnte nicht gestartet werden"
-#: ../cli/src/connections.c:1152
+#: ../cli/src/connections.c:785
msgid "no valid VPN secrets"
-msgstr "keine gültigen VPN-Geheimnisse"
+msgstr "Keine gültigen VPN-Schlüssel"
-#: ../cli/src/connections.c:1154
+#: ../cli/src/connections.c:787
msgid "invalid VPN secrets"
-msgstr "ungültige VPN-Geheimnisse"
+msgstr "Ungültige VPN-Schlüssel"
-#: ../cli/src/connections.c:1156
+#: ../cli/src/connections.c:789
msgid "the connection was removed"
msgstr "Die Verbindung wurde entfernt"
-#: ../cli/src/connections.c:1170
+#: ../cli/src/connections.c:803
#, c-format
msgid "state: %s\n"
msgstr "Status: %s\n"
-#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199
+#: ../cli/src/connections.c:806 ../cli/src/connections.c:832
#, c-format
msgid "Connection activated\n"
msgstr "Verbindung aktiviert\n"
-#: ../cli/src/connections.c:1176
+#: ../cli/src/connections.c:809
#, c-format
msgid "Error: Connection activation failed."
-msgstr "Fehler: Aktivierung der Verbindung fehlgeschlagen."
+msgstr "Fehler: Aktivierung der Verbindung ist gescheitert."
-#: ../cli/src/connections.c:1195
+#: ../cli/src/connections.c:828
#, c-format
msgid "state: %s (%d)\n"
msgstr "Status: %s (%d)\n"
-#: ../cli/src/connections.c:1205
+#: ../cli/src/connections.c:838
#, c-format
msgid "Error: Connection activation failed: %s."
-msgstr "Fehler: Aktivierung der Verbindung fehlgeschlagen: %s."
+msgstr "Fehler: Aktivierung der Verbindung ist gescheitert: %s."
-#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811
+#: ../cli/src/connections.c:855 ../cli/src/devices.c:551
#, c-format
msgid "Error: Timeout %d sec expired."
-msgstr "Fehler: Zeitbeschränkung von %d Sekunden abgelaufen."
+msgstr "Fehler: Zeitbeschränkung von %d Sekunden ist abgelaufen."
-#: ../cli/src/connections.c:1265
+#: ../cli/src/connections.c:898
#, c-format
msgid "Error: Connection activation failed: %s"
-msgstr "Fehler: Aktivierung der Verbindung fehlgeschlagen: %s"
+msgstr "Fehler: Aktivierung der Verbindung ist gescheitert: %s"
-#: ../cli/src/connections.c:1279
+#: ../cli/src/connections.c:912
#, c-format
msgid "Error: Obtaining active connection for '%s' failed."
-msgstr "Fehler: Erlangen der Verbindung für '%s' ist fehlgeschlagen."
+msgstr "Fehler: Ermittlung der aktiven Verbindung für »%s« ist gescheitert."
-#: ../cli/src/connections.c:1288
+#: ../cli/src/connections.c:921
#, c-format
msgid "Active connection state: %s\n"
msgstr "Status der aktiven Verbindung: %s\n"
-#: ../cli/src/connections.c:1289
+#: ../cli/src/connections.c:922
#, c-format
msgid "Active connection path: %s\n"
msgstr "Pfad der aktiven Verbindung: %s\n"
-#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461
+#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094
#, c-format
msgid "Error: Unknown connection: %s."
msgstr "Fehler: Unbekannte Verbindung: %s."
-#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882
+#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622
#, c-format
msgid "Error: timeout value '%s' is not valid."
-msgstr "Fehler: Der Wert '%s' für den Zeitablauf ist nicht gültig."
+msgstr "Fehler: Der Wert »%s« ist keine gültige Zeitangabe."
-#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478
+#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111
#, c-format
msgid "Error: id or uuid has to be specified."
-msgstr "Fehler: id oder uuid muss angegeben werden."
+msgstr "Fehler: id oder uuid müssen angegeben werden."
-#: ../cli/src/connections.c:1411
+#: ../cli/src/connections.c:1044
#, c-format
msgid "Error: No suitable device found: %s."
-msgstr "Fehler: Kein passendes Gerät gefunden: %s."
+msgstr "Fehler: Es wurde kein passendes Gerät gefunden: %s."
-#: ../cli/src/connections.c:1413
+#: ../cli/src/connections.c:1046
#, c-format
msgid "Error: No suitable device found."
-msgstr "Fehler: Kein passendes Gerät gefunden."
+msgstr "Fehler: Es wurde kein passendes Gerät gefunden."
-#: ../cli/src/connections.c:1505
+#: ../cli/src/connections.c:1138
#, c-format
msgid "Warning: Connection not active\n"
-msgstr "Warnung: Verbindung ist derzeit nicht aktiv\n"
+msgstr "Warnung: Verbindung ist nicht aktiv\n"
-#: ../cli/src/connections.c:1561
+#: ../cli/src/connections.c:1189
#, c-format
msgid "Error: 'con' command '%s' is not valid."
-msgstr "Fehler: Der Befehl '%s' für 'con' ist nicht gültig."
+msgstr "Fehler: Der »con«-Befehl »%s« ist ungültig."
-#: ../cli/src/connections.c:1597
+#: ../cli/src/connections.c:1216
#, c-format
msgid "Error: could not connect to D-Bus."
-msgstr "Fehler: Es konnte nicht mit D-Bus verbunden werden."
+msgstr "Fehler: Verbindung zu D-Bus konnte nicht hergestellt werden."
-#: ../cli/src/connections.c:1604
+#: ../cli/src/connections.c:1223
#, c-format
msgid "Error: Could not get system settings."
-msgstr "Fehler: Systemeinstellungen konnten nicht ermittelt werden"
+msgstr "Fehler: Systemeinstellungen konnten nicht ermittelt werden."
-#: ../cli/src/connections.c:1612
+#: ../cli/src/connections.c:1231
#, c-format
msgid "Error: Could not get user settings."
msgstr "Fehler: Benutzereinstellungen konnten nicht ermittelt werden."
-#: ../cli/src/connections.c:1622
+#: ../cli/src/connections.c:1241
#, c-format
msgid "Error: Can't obtain connections: settings services are not running."
msgstr ""
-"Fehler: Verbindungen können nicht erlangt werden: Die Einstellungsdienste "
+"Fehler: Verbindungen konnten nicht ermittelt werden: Die Einstellungsdienste "
"werden nicht ausgeführt."
-#. 0
-#. 9
-#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162
-msgid "DEVICE"
-msgstr "GERÄT"
-
-#. 1
-#. 4
-#. 0
-#: ../cli/src/devices.c:62 ../cli/src/devices.c:90
-#: ../cli/src/network-manager.c:36
-msgid "STATE"
-msgstr "STATUS"
-
-#: ../cli/src/devices.c:71
-msgid "GENERAL"
-msgstr "ALLGEMEIN"
-
-#. 0
-#: ../cli/src/devices.c:72
-msgid "CAPABILITIES"
-msgstr "FÄHIGKEITEN"
-
-#. 1
#: ../cli/src/devices.c:73
-msgid "WIFI-PROPERTIES"
-msgstr "WIFI-EIGENSCHAFTEN"
-
-#. 2
-#: ../cli/src/devices.c:74
-msgid "AP"
-msgstr "AP"
-
-#. 3
-#: ../cli/src/devices.c:75
-msgid "WIRED-PROPERTIES"
-msgstr "KABEL-EIGENSCHAFTEN"
-
-#. 4
-#: ../cli/src/devices.c:76
-msgid "IP4-SETTINGS"
-msgstr "IP4-EINSTELLUNGEN"
-
-#. 5
-#: ../cli/src/devices.c:77
-msgid "IP4-DNS"
-msgstr "IP4-DNS"
-
-#. 2
-#: ../cli/src/devices.c:88
-msgid "DRIVER"
-msgstr "TREIBER"
-
-#. 3
-#: ../cli/src/devices.c:89
-msgid "HWADDR"
-msgstr "HWADDR"
-
-#. 0
-#: ../cli/src/devices.c:99
-msgid "CARRIER-DETECT"
-msgstr "ANBIETER-SUCHE"
-
-#. 1
-#: ../cli/src/devices.c:100
-msgid "SPEED"
-msgstr "GESCHWINDIGKEIT"
-
-#. 0
-#: ../cli/src/devices.c:109
-msgid "CARRIER"
-msgstr "ANBIETER"
-
-#. 0
-#: ../cli/src/devices.c:119
-msgid "WEP"
-msgstr "WEP"
-
-#. 1
-#: ../cli/src/devices.c:120
-msgid "WPA"
-msgstr "WPA"
-
-#. 2
-#: ../cli/src/devices.c:121
-msgid "WPA2"
-msgstr "WPA2"
-
-#. 3
-#: ../cli/src/devices.c:122
-msgid "TKIP"
-msgstr "TKIP"
-
-#. 4
-#: ../cli/src/devices.c:123
-msgid "CCMP"
-msgstr "CCMP"
-
-#. 0
-#: ../cli/src/devices.c:132
-msgid "ADDRESS"
-msgstr "ADRESSE"
-
-#. 1
-#: ../cli/src/devices.c:133
-msgid "PREFIX"
-msgstr "PRÄFIX"
-
-#. 2
-#: ../cli/src/devices.c:134
-msgid "GATEWAY"
-msgstr "GATEWAY"
-
-#. 0
-#: ../cli/src/devices.c:143
-msgid "DNS"
-msgstr "DNS"
-
-#. 0
-#: ../cli/src/devices.c:153
-msgid "SSID"
-msgstr "SSID"
-
-#. 1
-#: ../cli/src/devices.c:154
-msgid "BSSID"
-msgstr "BSSID"
-
-#. 2
-#: ../cli/src/devices.c:155
-msgid "MODE"
-msgstr "MODUS"
-
-#. 3
-#: ../cli/src/devices.c:156
-msgid "FREQ"
-msgstr "FREQ"
-
-#. 4
-#: ../cli/src/devices.c:157
-msgid "RATE"
-msgstr "RATE"
-
-#. 5
-#: ../cli/src/devices.c:158
-msgid "SIGNAL"
-msgstr "SIGNAL"
-
-#. 6
-#: ../cli/src/devices.c:159
-msgid "SECURITY"
-msgstr "SICHERHEIT"
-
-#. 7
-#: ../cli/src/devices.c:160
-msgid "WPA-FLAGS"
-msgstr "WPA-FLAGS"
-
-#. 8
-#: ../cli/src/devices.c:161
-msgid "RSN-FLAGS"
-msgstr "RSN-FLAGS"
-
-#. 10
-#: ../cli/src/devices.c:163
-msgid "ACTIVE"
-msgstr "AKTIV"
-
-#: ../cli/src/devices.c:186
#, c-format
msgid ""
"Usage: nmcli dev { COMMAND | help }\n"
@@ -633,7 +360,7 @@ msgid ""
" status\n"
" list [iface ]\n"
" disconnect iface [--nowait] [--timeout ]\n"
-" wifi [list [iface ] [hwaddr ]]\n"
+" wifi [list [iface ] | apinfo iface hwaddr ]\n"
"\n"
msgstr ""
"Aufruf: nmcli dev { BEFEHL | help }\n"
@@ -643,237 +370,351 @@ msgstr ""
" status\n"
" list [iface ]\n"
" disconnect iface [--nowait] [--timeout ]\n"
-" wifi [list [iface ] [hwaddr ]]\n"
+" wifi [list [iface ] | apinfo iface hwaddr ]\n"
"\n"
-#: ../cli/src/devices.c:206
+#: ../cli/src/devices.c:93
msgid "unmanaged"
msgstr "nicht verwaltet"
-#: ../cli/src/devices.c:208
+#: ../cli/src/devices.c:95
msgid "unavailable"
msgstr "nicht verfügbar"
-#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89
+#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73
msgid "disconnected"
-msgstr "getrennt"
+msgstr "nicht verbunden"
-#: ../cli/src/devices.c:212
+#: ../cli/src/devices.c:99
msgid "connecting (prepare)"
-msgstr "wird verbunden (vorbereiten)"
+msgstr "wird verbunden (wird vorbereitet)"
-#: ../cli/src/devices.c:214
+#: ../cli/src/devices.c:101
msgid "connecting (configuring)"
-msgstr "wird verbunden (konfigurieren)"
+msgstr "wird verbunden (wird eingerichtet)"
-#: ../cli/src/devices.c:216
+#: ../cli/src/devices.c:103
msgid "connecting (need authentication)"
-msgstr "wird verbunden (Authentifizierung erforderlich)"
+msgstr "wird verbunden (Legitimierung wird benötigt)"
-#: ../cli/src/devices.c:218
+#: ../cli/src/devices.c:105
msgid "connecting (getting IP configuration)"
-msgstr "wird verbunden (IP-Konfiguration wird ermittelt)"
+msgstr "wird verbunden (IP-Einstellungen werden ermittelt)"
-#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87
+#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71
msgid "connected"
msgstr "verbunden"
-#: ../cli/src/devices.c:222
+#: ../cli/src/devices.c:109
msgid "connection failed"
-msgstr "Verbindung fehlgeschlagen"
+msgstr "Verbindung gescheitert"
-#: ../cli/src/devices.c:245 ../cli/src/devices.c:380
+#: ../cli/src/devices.c:132 ../cli/src/devices.c:876
msgid "Unknown"
msgstr "Unbekannt"
-#: ../cli/src/devices.c:277
+#. print them
+#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861
+#: ../cli/src/devices.c:879
msgid "(none)"
msgstr "(keine)"
-#: ../cli/src/devices.c:302
+#: ../cli/src/devices.c:209
#, c-format
msgid "%s: error converting IP4 address 0x%X"
msgstr "%s: Fehler bei Umwandlung der IPv4-Addresse 0x%X"
-#: ../cli/src/devices.c:349
+#: ../cli/src/devices.c:238
#, c-format
-msgid "%u MHz"
-msgstr "%u MHz"
+msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d"
+msgstr "%s, %s, Frequenz %d MHz, Durchsatz %d Mb/s, Stärke %d"
-#: ../cli/src/devices.c:350
-#, c-format
-msgid "%u MB/s"
-msgstr "%u MB/s"
-
-#: ../cli/src/devices.c:359
-msgid "Encrypted: "
-msgstr "Verschlüsselt: "
-
-#: ../cli/src/devices.c:364
-msgid "WEP "
-msgstr "WEP "
-
-#: ../cli/src/devices.c:366
-msgid "WPA "
-msgstr "WPA "
-
-#: ../cli/src/devices.c:368
-msgid "WPA2 "
-msgstr "WPA2 "
-
-# Das ergibt z.B. WPA-Enterprise, klingt komisch mit »Unternehmen«
-#: ../cli/src/devices.c:371
-msgid "Enterprise "
-msgstr "Enterprise "
-
-#: ../cli/src/devices.c:380
+#: ../cli/src/devices.c:239
msgid "Ad-Hoc"
msgstr "Ad-Hoc"
-#: ../cli/src/devices.c:380
-msgid "Infrastructure"
-msgstr "Infrastuktur"
+#: ../cli/src/devices.c:248
+msgid ", Encrypted: "
+msgstr ", Verschlüsselt: "
-#: ../cli/src/devices.c:442
-#, c-format
-msgid "Error: 'dev list': %s"
-msgstr "Fehler: 'dev list': %s"
+#: ../cli/src/devices.c:253
+msgid " WEP"
+msgstr " WEP"
-#: ../cli/src/devices.c:444
-#, c-format
-msgid "Error: 'dev list': %s; allowed fields: %s"
-msgstr "Fehler: 'dev list': %s; erlaubte Felder: %s"
+#: ../cli/src/devices.c:255
+msgid " WPA"
+msgstr " WPA"
-#: ../cli/src/devices.c:453
-msgid "Device details"
-msgstr "Gerätedetails"
+#: ../cli/src/devices.c:257
+msgid " WPA2"
+msgstr " WPA2"
-#: ../cli/src/devices.c:483 ../cli/src/devices.c:827
+# Das ergibt z.B. WPA-Enterprise, klingt komisch mit »Unternehmen«
+#: ../cli/src/devices.c:260
+msgid " Enterprise"
+msgstr " Enterprise"
+
+#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460
+msgid "Device"
+msgstr "Gerät"
+
+#: ../cli/src/devices.c:299
+msgid "Driver"
+msgstr "Treiber"
+
+#: ../cli/src/devices.c:299 ../cli/src/devices.c:567
msgid "(unknown)"
msgstr "(unbekannt)"
-#: ../cli/src/devices.c:484
-msgid "unknown)"
-msgstr "unbekannt)"
+#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460
+msgid "State"
+msgstr "Status"
-#: ../cli/src/devices.c:510
+#: ../cli/src/devices.c:313
+msgid "HW Address"
+msgstr "Hardwareadresse"
+
+#: ../cli/src/devices.c:319
+#, c-format
+msgid ""
+"\n"
+" Capabilities:\n"
+msgstr ""
+"\n"
+" Fähigkeiten:\n"
+
+#: ../cli/src/devices.c:321
+msgid "Carrier Detect"
+msgstr "Trägersignalkennung"
+
+#: ../cli/src/devices.c:336
#, c-format
msgid "%u Mb/s"
msgstr "%u Mb/s"
-#. Print header
-#. "WIRED-PROPERTIES"
-#: ../cli/src/devices.c:583
+#: ../cli/src/devices.c:337
+msgid "Speed"
+msgstr "Geschwindigkeit"
+
+#: ../cli/src/devices.c:348
+#, c-format
+msgid ""
+"\n"
+" Wireless Properties\n"
+msgstr ""
+"\n"
+" Eigenschaften der Funkverbindung\n"
+
+#: ../cli/src/devices.c:353
+msgid "WEP Encryption"
+msgstr "WEP-Verschlüsselung"
+
+#: ../cli/src/devices.c:355
+msgid "WPA Encryption"
+msgstr "WPA-Verschlüsselung"
+
+#: ../cli/src/devices.c:357
+msgid "WPA2 Encryption"
+msgstr "WPA2-Verschlüsselung"
+
+#: ../cli/src/devices.c:359
+msgid "TKIP cipher"
+msgstr "TKIP-Chiffre"
+
+#: ../cli/src/devices.c:361
+msgid "CCMP cipher"
+msgstr "CCMP-Chiffre"
+
+#: ../cli/src/devices.c:368
+#, c-format
+msgid ""
+"\n"
+" Wireless Access Points %s\n"
+msgstr ""
+"\n"
+" Funknetzwerk-Zugangspunkte %s\n"
+
+#: ../cli/src/devices.c:368
+msgid "(* = current AP)"
+msgstr "(* = momentaner Zugangspunkt)"
+
+#: ../cli/src/devices.c:374
+#, c-format
+msgid ""
+"\n"
+" Wired Properties\n"
+msgstr ""
+"\n"
+" Eigenschaften der kabelgebundenen Verbindung\n"
+
+#: ../cli/src/devices.c:377 ../cli/src/devices.c:379
+msgid "Carrier"
+msgstr "Trägersignal"
+
+#: ../cli/src/devices.c:377
msgid "on"
msgstr "an"
-#: ../cli/src/devices.c:583
+#: ../cli/src/devices.c:379
msgid "off"
msgstr "aus"
-#: ../cli/src/devices.c:710
+#: ../cli/src/devices.c:387
#, c-format
-msgid "Error: 'dev status': %s"
-msgstr "Fehler: 'dev status': %s"
+msgid ""
+"\n"
+" IPv4 Settings:\n"
+msgstr ""
+"\n"
+" IPv4-Einstellungen:\n"
-#: ../cli/src/devices.c:712
-#, c-format
-msgid "Error: 'dev status': %s; allowed fields: %s"
-msgstr "Fehler: 'dev status': %s; erlaubte Felder: %s"
+#: ../cli/src/devices.c:395
+msgid "Address"
+msgstr "Adresse"
-#: ../cli/src/devices.c:719
+#: ../cli/src/devices.c:401
+msgid "Prefix"
+msgstr "Präfix"
+
+#: ../cli/src/devices.c:405
+msgid "Gateway"
+msgstr "Gateway"
+
+#: ../cli/src/devices.c:416
+msgid "DNS"
+msgstr "DNS"
+
+#: ../cli/src/devices.c:458
msgid "Status of devices"
-msgstr "Status von Geräten"
+msgstr "Status der Geräte"
-#: ../cli/src/devices.c:747
+#: ../cli/src/devices.c:487
#, c-format
msgid "Error: '%s' argument is missing."
-msgstr "Fehler: Argument '%s' fehlt."
+msgstr "Fehler: Argument »%s« fehlt."
-#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035
+#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729
#, c-format
msgid "Error: Device '%s' not found."
-msgstr "Fehler: Gerät '%s' wurde nicht gefunden"
+msgstr "Fehler: Gerät »%s« wurde nicht gefunden."
-#: ../cli/src/devices.c:799
+#: ../cli/src/devices.c:539
#, c-format
msgid "Success: Device '%s' successfully disconnected."
-msgstr "Erfolg: Gerät '%s' wurde erfolgreich getrennt."
+msgstr "Erfolg: Gerät »%s« wurde erfolgreich getrennt."
-#: ../cli/src/devices.c:824
+#: ../cli/src/devices.c:564
#, c-format
msgid "Error: Device '%s' (%s) disconnecting failed: %s"
-msgstr "Fehler: Trennung des Gerätes '%s' (%s) ist fehlgeschlagen: %s"
+msgstr "Fehler: Trennung des Gerätes »%s« (%s) ist gescheitert: %s"
-#: ../cli/src/devices.c:832
+#: ../cli/src/devices.c:572
#, c-format
msgid "Device state: %d (%s)\n"
-msgstr "Gerätezustand: %d (%s)\n"
+msgstr "Gerätezustand: %d (%s)\n"
-#: ../cli/src/devices.c:896
+#: ../cli/src/devices.c:636
#, c-format
msgid "Error: iface has to be specified."
-msgstr "Fehler: Schnittstelle muss angegeben werden."
+msgstr "Fehler: Es muss eine Schnittstelle angegeben werden."
-#: ../cli/src/devices.c:1011
-#, c-format
-msgid "Error: 'dev wifi': %s"
-msgstr "Fehler: 'dev wifi': %s"
-
-#: ../cli/src/devices.c:1013
-#, c-format
-msgid "Error: 'dev wifi': %s; allowed fields: %s"
-msgstr "Fehler: 'dev wifi': %s; erlaubte Felder: %s"
-
-#: ../cli/src/devices.c:1020
+#: ../cli/src/devices.c:736 ../cli/src/devices.c:746
msgid "WiFi scan list"
-msgstr "Suchliste für WiFi"
+msgstr "Suchliste des WLAN"
-#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109
-#, c-format
-msgid "Error: Access point with hwaddr '%s' not found."
-msgstr "Fehler: Der Zugangspunkt mit Hardware-Adresse '%s' wurde nicht gefunden."
-
-#: ../cli/src/devices.c:1072
+#: ../cli/src/devices.c:740
#, c-format
msgid "Error: Device '%s' is not a WiFi device."
-msgstr "Fehler: Gerät '%s' ist kein WiFi-Gerät."
+msgstr "Fehler: Gerät »%s« ist kein WLAN-Gerät."
-#: ../cli/src/devices.c:1136
+#: ../cli/src/devices.c:754
+msgid "Device:"
+msgstr "Gerät:"
+
+#: ../cli/src/devices.c:806
+#, c-format
+msgid "Error: hwaddr has to be specified."
+msgstr "Fehler: Es muss eine Hardwareadresse angegeben werden."
+
+#: ../cli/src/devices.c:844
+#, c-format
+msgid "Error: Access point with hwaddr '%s' not found."
+msgstr ""
+"Fehler: Der Zugangspunkt mit der Hardware-Adresse »%s« wurde nicht gefunden."
+
+#: ../cli/src/devices.c:862
+#, c-format
+msgid "%u MHz"
+msgstr "%u MHz"
+
+#: ../cli/src/devices.c:863
+#, c-format
+msgid "%u MB/s"
+msgstr "%u MB/s"
+
+#: ../cli/src/devices.c:869 ../cli/src/devices.c:871
+msgid "AP parameters"
+msgstr "Parameter des Zugangspunkts"
+
+#: ../cli/src/devices.c:873
+msgid "SSID:"
+msgstr "SSID:"
+
+#: ../cli/src/devices.c:874
+msgid "BSSID:"
+msgstr "BSSID:"
+
+#: ../cli/src/devices.c:875
+msgid "Frequency:"
+msgstr "Frequenz:"
+
+#: ../cli/src/devices.c:876
+msgid "Mode:"
+msgstr "Modus:"
+
+#: ../cli/src/devices.c:876
+msgid "Ad-hoc"
+msgstr "Ad-hoc"
+
+#: ../cli/src/devices.c:876
+msgid "Infrastructure"
+msgstr "Infrastuktur"
+
+#: ../cli/src/devices.c:877
+msgid "Maximal bitrate:"
+msgstr "Maximale Übertragungsgeschwindigkeit:"
+
+#: ../cli/src/devices.c:878
+msgid "Strength:"
+msgstr "Stärke:"
+
+#: ../cli/src/devices.c:879
+msgid "Flags:"
+msgstr "Flags:"
+
+#: ../cli/src/devices.c:879
+msgid "privacy"
+msgstr "Vertraulichkeit"
+
+#: ../cli/src/devices.c:880
+msgid "WPA flags:"
+msgstr "WPA-Flags:"
+
+#: ../cli/src/devices.c:881
+msgid "RSN flags:"
+msgstr "RSN-Flags:"
+
+#: ../cli/src/devices.c:907
#, c-format
msgid "Error: 'dev wifi' command '%s' is not valid."
-msgstr "Fehler: Der Befehl '%s' für 'dev wifi' ist nicht gültig."
+msgstr "Fehler: Der Befehl »%s« für »dev wifi« ist ungültig."
-#: ../cli/src/devices.c:1183
+#: ../cli/src/devices.c:943
#, c-format
msgid "Error: 'dev' command '%s' is not valid."
-msgstr "Fehler: Der Befehl '%s' für 'dev' ist nicht gültig."
+msgstr "Fehler: Der Befehl »%s« für »dev« ist ungültig."
-#: ../cli/src/network-manager.c:35
-msgid "RUNNING"
-msgstr "WIRD AUSGEFÜHRT"
-
-#. 1
-#: ../cli/src/network-manager.c:37
-msgid "WIFI-HARDWARE"
-msgstr "WIFI-HARDWARE"
-
-#. 2
-#: ../cli/src/network-manager.c:38
-msgid "WIFI"
-msgstr "WIFI"
-
-#. 3
-#: ../cli/src/network-manager.c:39
-msgid "WWAN-HARDWARE"
-msgstr "WWAN-HARDWARE"
-
-#. 4
-#: ../cli/src/network-manager.c:40
-msgid "WWAN"
-msgstr "WWAN"
-
-#: ../cli/src/network-manager.c:62
+#: ../cli/src/network-manager.c:46
#, c-format
msgid ""
"Usage: nmcli nm { COMMAND | help }\n"
@@ -898,91 +739,89 @@ msgstr ""
" wwan [on|off]\n"
"\n"
-#: ../cli/src/network-manager.c:83
+#: ../cli/src/network-manager.c:67
msgid "asleep"
msgstr "schlafend"
-#: ../cli/src/network-manager.c:85
+#: ../cli/src/network-manager.c:69
msgid "connecting"
msgstr "wird verbunden"
-#: ../cli/src/network-manager.c:125
-#, c-format
-msgid "Error: 'nm status': %s"
-msgstr "Fehler: 'nm status': %s"
-
-#: ../cli/src/network-manager.c:127
-#, c-format
-msgid "Error: 'nm status': %s; allowed fields: %s"
-msgstr "Fehler: 'nm status': %s; erlaubte Felder: %s"
-
-#: ../cli/src/network-manager.c:134
-msgid "NetworkManager status"
-msgstr "Status von NetworkManager"
-
-#. Print header
-#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141
-#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143
-#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243
+#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94
+#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96
+#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160
msgid "enabled"
msgstr "aktiviert"
-#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141
-#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143
-#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243
+#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94
+#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96
+#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160
msgid "disabled"
msgstr "deaktiviert"
-#: ../cli/src/network-manager.c:148
+#: ../cli/src/network-manager.c:102
+msgid "NetworkManager status"
+msgstr "Status von NetworkManager"
+
+#: ../cli/src/network-manager.c:104
+msgid "NM running:"
+msgstr "NM läuft:"
+
+#: ../cli/src/network-manager.c:104
msgid "running"
msgstr "wird ausgeführt"
-#: ../cli/src/network-manager.c:148
+#: ../cli/src/network-manager.c:104
msgid "not running"
msgstr "wird nicht ausgeführt"
-#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233
-#, c-format
-msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s"
-msgstr "Fehler: '--fields' Wert '%s' hier nicht gültig; erlaubte Felder: %s"
+#: ../cli/src/network-manager.c:105
+msgid "NM state:"
+msgstr "Status von NM:"
-#: ../cli/src/network-manager.c:209
-msgid "WiFi enabled"
-msgstr "WiFi aktiviert"
+#: ../cli/src/network-manager.c:106
+msgid "NM wireless hardware:"
+msgstr "NM Funknetzwerk-Hardware:"
-#: ../cli/src/network-manager.c:220
+#. no argument, show current state
+#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143
+msgid "NM wireless:"
+msgstr "NM Funk:"
+
+#: ../cli/src/network-manager.c:108
+msgid "NM WWAN hardware:"
+msgstr "NM WWAN-Hardware:"
+
+#. no argument, show current state
+#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160
+msgid "NM WWAN:"
+msgstr "NM WWAN:"
+
+#: ../cli/src/network-manager.c:150
#, c-format
msgid "Error: invalid 'wifi' parameter: '%s'."
-msgstr "Fehler: Ungültiger 'wifi'-Parameter: '%s'."
+msgstr "Fehler: Ungültiger »wifi«-Parameter: »%s«."
-#: ../cli/src/network-manager.c:241
-msgid "WWAN enabled"
-msgstr "WWAN aktiviert"
-
-#: ../cli/src/network-manager.c:252
+#: ../cli/src/network-manager.c:167
#, c-format
msgid "Error: invalid 'wwan' parameter: '%s'."
-msgstr "Fehler: Ungültiger 'wwan'-Parameter: '%s'."
+msgstr "Fehler: Ungültiger »wwan«-Parameter: »%s«."
-#: ../cli/src/network-manager.c:263
+#: ../cli/src/network-manager.c:178
#, c-format
msgid "Error: 'nm' command '%s' is not valid."
-msgstr "Fehler: Der Befehl '%s' für 'nm' ist nicht gültig."
+msgstr "Fehler: Der Befehl »%s« für »nm« ist ungültig."
-#: ../cli/src/nmcli.c:69
+#: ../cli/src/nmcli.c:65
#, c-format
msgid ""
"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n"
"\n"
"OPTIONS\n"
-" -t[erse] terse output\n"
-" -p[retty] pretty output\n"
-" -m[ode] tabular|multiline output mode\n"
-" -f[ields] |all|common specify fields to output\n"
-" -e[scape] yes|no escape columns separators in "
-"values\n"
-" -v[ersion] show program version\n"
-" -h[elp] print this help\n"
+" -t[erse] terse output\n"
+" -p[retty] pretty output\n"
+" -v[ersion] show program version\n"
+" -h[elp] print this help\n"
"\n"
"OBJECT\n"
" nm NetworkManager status\n"
@@ -993,13 +832,10 @@ msgstr ""
"Aufruf: %s [OPTIONEN] OBJEKT { BEFEHL | help }\n"
"\n"
"OPTIONEN\n"
-" -t[erse] knappe Ausgabe\n"
-" -p[retty] hübsche Ausgabe\n"
-" -m[ode] tabular|multiline Ausgabemodus\n"
-" -f[ields] |all|common Ausgabefelder angeben\n"
-" -e[scape] yes|no Spaltentrenner in den Werten mit Maskierungszeichen versehen\n"
-" -v[ersion] Programm-Version anzeigen\n"
-" -h[elp] dies Hilfe ausgeben\n"
+" -t[erse] kurze Ausgabe\n"
+" -p[retty] hübsche Ausgabe\n"
+" -v[ersion] Programmversion anzeigen\n"
+" -h[elp] diese Hilfe ausgeben\n"
"\n"
"OBJEKT\n"
" nm Status von NetworkManager\n"
@@ -1007,361 +843,239 @@ msgstr ""
" dev von NetworkManager verwaltete Verbindungen\n"
"\n"
-#: ../cli/src/nmcli.c:113
+#: ../cli/src/nmcli.c:106
#, c-format
-msgid "Error: Object '%s' is unknown, try 'nmcli help'."
-msgstr "Fehler: Objekt '%s' ist unbekannt, versuchen Sie 'nmcli help'."
+msgid "Object '%s' is unknown, try 'nmcli help'."
+msgstr "Objekt »%s« ist unbekannt, versuchen Sie »nmcli help«."
-#: ../cli/src/nmcli.c:143
-#, c-format
-msgid "Error: Option '--terse' is specified the second time."
-msgstr "Fehler: Option '--terse' wird als zweite Option angegeben."
-
-#: ../cli/src/nmcli.c:148
-#, c-format
-msgid "Error: Option '--terse' is mutually exclusive with '--pretty'."
-msgstr "Fehler: Option '--terse' und '--pretty' schließen sich gegenseitig aus."
-
-#: ../cli/src/nmcli.c:156
-#, c-format
-msgid "Error: Option '--pretty' is specified the second time."
-msgstr "Fehler: Option '--pretty' wird als zweite Option angegeben."
-
-#: ../cli/src/nmcli.c:161
-#, c-format
-msgid "Error: Option '--pretty' is mutually exclusive with '--terse'."
-msgstr "Fehler: Option '--pretty' und '--terse' schließen sich gegenseitig aus."
-
-#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187
-#, c-format
-msgid "Error: missing argument for '%s' option."
-msgstr "Fehler: Fehlendes Argument für die Option '%s'."
-
-#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196
-#, c-format
-msgid "Error: '%s' is not valid argument for '%s' option."
-msgstr "Fehler: '%s' kein gültiges Argument für die Option '%s'."
-
-#: ../cli/src/nmcli.c:203
-#, c-format
-msgid "Error: fields for '%s' options are missing."
-msgstr "Fehler: Felder für die Optionen '%s' fehlen."
-
-#: ../cli/src/nmcli.c:209
+#: ../cli/src/nmcli.c:139
#, c-format
msgid "nmcli tool, version %s\n"
-msgstr "nmcli, Version %s\n"
+msgstr "nmcli-Werkzeug, Version %s\n"
-#: ../cli/src/nmcli.c:215
+#: ../cli/src/nmcli.c:145
#, c-format
-msgid "Error: Option '%s' is unknown, try 'nmcli -help'."
-msgstr "Fehler: Option '%s' ist unbekannt, versuchen Sie 'nmcli -help'."
+msgid "Option '%s' is unknown, try 'nmcli -help'."
+msgstr "Option »%s« ist unbekannt, versuchen Sie »nmcli -help«."
-#: ../cli/src/nmcli.c:234
+#: ../cli/src/nmcli.c:164
#, c-format
msgid "Caught signal %d, shutting down..."
msgstr "Signal %d wurde empfangen, wird beendet …"
-#: ../cli/src/nmcli.c:259
+#: ../cli/src/nmcli.c:189
#, c-format
msgid "Error: Could not connect to NetworkManager."
msgstr "Fehler: Verbindung mit NetworkManager konnte nicht hergestellt werden."
-#: ../cli/src/nmcli.c:275
+#: ../cli/src/nmcli.c:205
msgid "Success"
msgstr "Erfolg"
-#: ../cli/src/settings.c:407
-#, c-format
-msgid "%d (hex-ascii-key)"
-msgstr "%d (hex-ascii-key)"
-
-#: ../cli/src/settings.c:409
-#, c-format
-msgid "%d (104/128-bit passphrase)"
-msgstr "%d (104/128-Bit Passphrase)"
-
-#: ../cli/src/settings.c:412
-#, c-format
-msgid "%d (unknown)"
-msgstr "%d (unbekannt)"
-
-#: ../cli/src/settings.c:438
-msgid "0 (unknown)"
-msgstr "0 (unbekannt)"
-
-#: ../cli/src/settings.c:444
-msgid "any, "
-msgstr "beliebig, "
-
-#: ../cli/src/settings.c:446
-msgid "900 MHz, "
-msgstr "900 MHz, "
-
-#: ../cli/src/settings.c:448
-msgid "1800 MHz, "
-msgstr "1800 MHz, "
-
-#: ../cli/src/settings.c:450
-msgid "1900 MHz, "
-msgstr "1900 MHz, "
-
-#: ../cli/src/settings.c:452
-msgid "850 MHz, "
-msgstr "850 MHz, "
-
-#: ../cli/src/settings.c:454
-msgid "WCDMA 3GPP UMTS 2100 MHz, "
-msgstr "WCDMA 3GPP UMTS 2100 MHz, "
-
-#: ../cli/src/settings.c:456
-msgid "WCDMA 3GPP UMTS 1800 MHz, "
-msgstr "WCDMA 3GPP UMTS 1800 MHz, "
-
-#: ../cli/src/settings.c:458
-msgid "WCDMA 3GPP UMTS 1700/2100 MHz, "
-msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, "
-
-#: ../cli/src/settings.c:460
-msgid "WCDMA 3GPP UMTS 800 MHz, "
-msgstr "WCDMA 3GPP UMTS 800 MHz, "
-
-#: ../cli/src/settings.c:462
-msgid "WCDMA 3GPP UMTS 850 MHz, "
-msgstr "WCDMA 3GPP UMTS 850 MHz, "
-
-#: ../cli/src/settings.c:464
-msgid "WCDMA 3GPP UMTS 900 MHz, "
-msgstr "WCDMA 3GPP UMTS 900 MHz, "
-
-#: ../cli/src/settings.c:466
-msgid "WCDMA 3GPP UMTS 1700 MHz, "
-msgstr "WCDMA 3GPP UMTS 1700 MHz, "
-
-#: ../cli/src/settings.c:546 ../cli/src/settings.c:708
-msgid "auto"
-msgstr "auto"
-
-#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172
-msgid "not set"
-msgstr "nicht gesetzt"
-
-#: ../cli/src/utils.c:124
-#, c-format
-msgid "field '%s' has to be alone"
-msgstr "Feld '%s' muss isoliert sein"
-
-#: ../cli/src/utils.c:127
-#, c-format
-msgid "invalid field '%s'"
-msgstr "ungültiges Feld '%s'"
-
-#: ../cli/src/utils.c:146
-#, c-format
-msgid "Option '--terse' requires specifying '--fields'"
-msgstr "Option '--terse' erfordert die Angabe von '--fields'"
-
-#: ../cli/src/utils.c:150
-#, c-format
-msgid "Option '--terse' requires specific '--fields' option values , not '%s'"
-msgstr "Option '--terse' erfordert spezielle '--fields' Optionswerte , nicht '%s'"
-
#: ../libnm-util/crypto.c:120
#, c-format
msgid "PEM key file had no end tag '%s'."
-msgstr "PEM-Schlüssel Datei hat kein abschließendes Tag '%s'."
+msgstr "PEM-Schlüsseldatei hat kein abschließendes Tag »%s«."
#: ../libnm-util/crypto.c:130
#, c-format
msgid "Doesn't look like a PEM private key file."
-msgstr "Dies scheint kein privater PEM-Schlüssel zu sein."
+msgstr "Das sieht nicht nach einer privaten PEM-Schlüsseldatei aus."
#: ../libnm-util/crypto.c:138
#, c-format
msgid "Not enough memory to store PEM file data."
-msgstr "Es steht nicht genug Speicher zum Speichern der PEM-Datei zur Verfügung."
+msgstr "Nicht genügend freier Speicher zum Speichern der PEM-Datendatei."
#: ../libnm-util/crypto.c:154
#, c-format
msgid "Malformed PEM file: Proc-Type was not first tag."
-msgstr "Fehlerhafte PEM-Datei: Proc-Type ist nicht der erste Tag."
+msgstr "Fehlerhafte PEM-Datei: Proc-Type ist nicht das erste Tag."
#: ../libnm-util/crypto.c:162
#, c-format
msgid "Malformed PEM file: unknown Proc-Type tag '%s'."
-msgstr "Fehlerhafte PEM-Datei: unbekannter Proc-Type Tag '%s'."
+msgstr "Fehlerhafte PEM-Datei: unbekannter Proc-Type-Tag »%s«."
#: ../libnm-util/crypto.c:172
#, c-format
msgid "Malformed PEM file: DEK-Info was not the second tag."
-msgstr "Fehlerhafte PEM-Datei: DEK-Info ist nicht der zweite Tag."
+msgstr "Fehlerhafte PEM-Datei: DEK-Info ist nicht das zweite Tag."
#: ../libnm-util/crypto.c:183
#, c-format
msgid "Malformed PEM file: no IV found in DEK-Info tag."
-msgstr "Fehlerhafte PEM-Datei: kein IV im DEK-Info Tag gefunden."
+msgstr "Fehlerhafte PEM-Datei: kein IV im DEK-Info-Tag gefunden."
#: ../libnm-util/crypto.c:190
#, c-format
msgid "Malformed PEM file: invalid format of IV in DEK-Info tag."
-msgstr "Fehlerhafte PEM-Datei: falsches Format des IV in DEK-Info Tag."
+msgstr "Fehlerhafte PEM-Datei: falsches Format des IV im DEK-Info-Tag."
#: ../libnm-util/crypto.c:203
#, c-format
msgid "Malformed PEM file: unknown private key cipher '%s'."
-msgstr ""
-"Fehlerhafte PEM-Datei: Unbekannte Verschlüsselung '%s' des privaten "
-"Schlüssels."
+msgstr "Fehlerhafte PEM-Datei: Unbekannter privater Schlüsselstrom »%s«."
#: ../libnm-util/crypto.c:222
#, c-format
msgid "Could not decode private key."
-msgstr "Der private Schlüssel konnte nicht dekodiert werden."
+msgstr "Der private Schlüssel konnte nicht entschlüsselt werden."
#: ../libnm-util/crypto.c:267
#, c-format
msgid "PEM certificate '%s' had no end tag '%s'."
-msgstr "PEM-Zertifikat '%s' hat kein abschließendes Tag '%s'."
+msgstr "PEM-Zertifikat »%s« hat kein abschließendes Tag »%s«."
#: ../libnm-util/crypto.c:277
#, c-format
msgid "Failed to decode certificate."
-msgstr "Das Dekodieren des Zertifikats ist fehlgeschlagen."
+msgstr "Die Entschlüsselung des Zertifikats scheiterte."
#: ../libnm-util/crypto.c:286
#, c-format
msgid "Not enough memory to store certificate data."
-msgstr "Nicht genug Speicher zum Abspeichern des Zertifikates."
+msgstr "Nicht genug freier Speicher zum Speichern des Zertifikats."
#: ../libnm-util/crypto.c:294
#, c-format
msgid "Not enough memory to store file data."
-msgstr "Nicht genug Speicher zum Abspeichern der Datei."
+msgstr "Nicht genug freier Speicher zum Speichern der Datei."
#: ../libnm-util/crypto.c:324
#, c-format
msgid "IV must be an even number of bytes in length."
-msgstr "IV muss eine gerade Anzahl an Zeichen lang sein."
+msgstr "IV muss eine gerade Anzahl an Byte lang sein."
#: ../libnm-util/crypto.c:333
#, c-format
msgid "Not enough memory to store the IV."
-msgstr "Nicht genug Speicher zum Sichern des IV."
+msgstr "Nicht genug freier Speicher zum Speichern des IV."
#: ../libnm-util/crypto.c:344
#, c-format
msgid "IV contains non-hexadecimal digits."
-msgstr "IV enthält nicht hexadezimale Zeichen."
+msgstr "IV enthält nicht-hexadezimale Zeichen."
#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148
#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171
#: ../libnm-util/crypto_nss.c:336
#, c-format
msgid "Private key cipher '%s' was unknown."
-msgstr "Unbekannte Verschlüsselung '%s' des privaten Schlüssels."
+msgstr "Privater Schlüsselstrom »%s« ist unbekannt."
#: ../libnm-util/crypto.c:391
#, c-format
msgid "Not enough memory to decrypt private key."
-msgstr "Nicht genug Speicher zum Entschlüsseln des privaten Schlüssels."
+msgstr "Nicht genug freier Speicher zum Entschlüsseln des privaten Schlüssels."
#: ../libnm-util/crypto.c:511
#, c-format
msgid "Unable to determine private key type."
-msgstr "Die Art des privaten Schlüssels kann nicht bestimmt werden."
+msgstr "Der Typ des privaten Schlüssels konnte nicht bestimmt werden."
#: ../libnm-util/crypto.c:530
#, c-format
msgid "Not enough memory to store decrypted private key."
-msgstr "Nicht genug Speicher zum Speichern des entschlüsselten privaten Schlüssels."
+msgstr ""
+"Nicht genug freier Speicher zum Speichern des entschlüsselten privaten "
+"Schlüssels."
#: ../libnm-util/crypto_gnutls.c:49
msgid "Failed to initialize the crypto engine."
-msgstr "Fehler beim Initialisieren der Verschlüsselung."
+msgstr "Die Initialisierung der crypto-engine scheiterte."
#: ../libnm-util/crypto_gnutls.c:93
#, c-format
msgid "Failed to initialize the MD5 engine: %s / %s."
-msgstr "Fehler beim Initialisieren von MD5: %s / %s."
+msgstr "Die Initialisierung der MD5-engine %s / %s scheiterte."
#: ../libnm-util/crypto_gnutls.c:156
#, c-format
msgid "Invalid IV length (must be at least %zd)."
-msgstr "Ungültige Länge des IV (muss zumindest %zd sein)."
+msgstr "Ungültige IV-Länge (muss mindestens %zd betragen)."
#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188
#, c-format
msgid "Not enough memory for decrypted key buffer."
-msgstr "Nicht genug Speicher für den Puffer zur Entschlüsselung."
+msgstr ""
+"Nicht genug freier Speicher zum Zwischenspeichern des entschlüsselten "
+"Schlüssels."
#: ../libnm-util/crypto_gnutls.c:173
#, c-format
msgid "Failed to initialize the decryption cipher context: %s / %s."
-msgstr "Fehler beim Initialisieren des Entschlüsselungs-Kontextes: %s / %s."
+msgstr ""
+"Die Initialisierung des Entschlüsselung-Chiffrekontextes scheiterte: %s / %s."
#: ../libnm-util/crypto_gnutls.c:182
#, c-format
msgid "Failed to set symmetric key for decryption: %s / %s."
msgstr ""
-"Fehler beim Festlegen des symmetrischen Schlüssels für die Entschlüsselung: %"
-"s / %s."
+"Das Anlegen der symmetrischen Schlüssel zum Entschlüsseln scheiterte: %s / %"
+"s."
#: ../libnm-util/crypto_gnutls.c:191
#, c-format
msgid "Failed to set IV for decryption: %s / %s."
-msgstr "Fehler beim Festlegen des IV für die Verschlüsselung: %s / %s."
+msgstr "Das Anlegen des IV zum Entschlüsseln scheiterte: %s / %s."
#: ../libnm-util/crypto_gnutls.c:200
#, c-format
msgid "Failed to decrypt the private key: %s / %s."
-msgstr "Fehler beim Entschlüsseln des privaten Schlüssels: %s / %s."
+msgstr "Die Entschlüsselung des privaten Schlüssels scheiterte: %s / %s."
#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267
#, c-format
msgid "Failed to decrypt the private key: unexpected padding length."
-msgstr "Fehler beim Entschlüsseln des privaten Schlüssels: Unerwartete Fülllänge."
+msgstr ""
+"Die Entschlüsselung des privaten Schlüssels scheiterte: Unerwartete "
+"Zeilenlänge."
#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278
#, c-format
msgid "Failed to decrypt the private key."
-msgstr "Fehler beim Entschlüsseln des privaten Schlüssels."
+msgstr "Die Entschlüsselung des privaten Schlüssels scheiterte."
#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356
#, c-format
msgid "Could not allocate memory for encrypting."
-msgstr "Es konnte kein Arbeitsspeicher zur Verschlüsselung angefordert werden."
+msgstr ""
+"Es konnte nicht genügend freier Speicher zum Verschlüsseln angefordert "
+"werden."
#: ../libnm-util/crypto_gnutls.c:294
#, c-format
msgid "Failed to initialize the encryption cipher context: %s / %s."
-msgstr "Fehler beim Initialisieren des Verschlüsselungs-Kontextes: %s / %s."
+msgstr ""
+"Die Initialisierung des Verschlüsselung-Chiffrekontextes scheiterte: %s / %s."
#: ../libnm-util/crypto_gnutls.c:303
#, c-format
msgid "Failed to set symmetric key for encryption: %s / %s."
msgstr ""
-"Fehler beim Festlegen des symmetrischen Schlüssels für die Verschlüsselung: %"
-"s / %s."
+"Das Anlegen des symmetrischen Schlüssels zum Verschlüsseln scheiterte: %s / %"
+"s."
#: ../libnm-util/crypto_gnutls.c:313
#, c-format
msgid "Failed to set IV for encryption: %s / %s."
-msgstr "Fehler beim Festlegen des IV für die Verschlüsselung: %s / %s."
+msgstr "Das Anlegen des IV zur Verschlüsselung scheiterte: %s / %s."
#: ../libnm-util/crypto_gnutls.c:322
#, c-format
msgid "Failed to encrypt the data: %s / %s."
-msgstr "Fehler beim Verschlüsseln der Daten: %s / %s."
+msgstr "Die Verschlüsselung der Daten scheiterte: %s / %s."
#: ../libnm-util/crypto_gnutls.c:362
#, c-format
msgid "Error initializing certificate data: %s"
-msgstr "Fehler beim Initialisieren des Zertifikats: %s"
+msgstr "Die Initialisierung der Zertifikatsdaten schlug fehl: %s"
#: ../libnm-util/crypto_gnutls.c:384
#, c-format
msgid "Couldn't decode certificate: %s"
-msgstr "Zertifikat konnte nicht dekodiert werden: %s"
+msgstr "Zertifikat konnte nicht entschlüsselt werden: %s"
#: ../libnm-util/crypto_gnutls.c:408
#, c-format
@@ -1371,7 +1085,7 @@ msgstr "PKCS#12-Decoder konnte nicht initialisiert werden: %s"
#: ../libnm-util/crypto_gnutls.c:421
#, c-format
msgid "Couldn't decode PKCS#12 file: %s"
-msgstr "PKCS#12 konnte nicht decodiert werden: %s"
+msgstr "PKCS#12 konnte nicht entschlüsselt werden: %s"
#: ../libnm-util/crypto_gnutls.c:433
#, c-format
@@ -1381,79 +1095,82 @@ msgstr "PKCS#12-Datei konnte nicht überprüft werden: %s"
#: ../libnm-util/crypto_nss.c:56
#, c-format
msgid "Failed to initialize the crypto engine: %d."
-msgstr "Fehler beim Initialisieren der Verschlüsselung: %d."
+msgstr "Die Initialisierung der crypto-engine scheiterte: %d."
#: ../libnm-util/crypto_nss.c:111
#, c-format
msgid "Failed to initialize the MD5 context: %d."
-msgstr "Fehler beim Initialisieren des MD5-Kontextes: %d."
+msgstr "Die Initialisierung des MD5-Kontexts scheiterte: %d."
#: ../libnm-util/crypto_nss.c:179
#, c-format
msgid "Invalid IV length (must be at least %d)."
-msgstr "Ungültige Länge des IV (muss zumindest %d sein)."
+msgstr "Ungültige IV-Länge (muss mindestens %d betragen)."
#: ../libnm-util/crypto_nss.c:196
#, c-format
msgid "Failed to initialize the decryption cipher slot."
-msgstr "Fehler beim Einrichten des Verschlüsselungs-Slots."
+msgstr "Die Initialisierung des Entschlüsselungsstromslots scheiterte."
#: ../libnm-util/crypto_nss.c:206
#, c-format
msgid "Failed to set symmetric key for decryption."
-msgstr "Fehler beim Festlegen des symmetrischen Schlüssels für die Entschlüsselung."
+msgstr ""
+"Das Anlegen des symmetrischen Schlüssels zur Entschlüsselung scheiterte."
#: ../libnm-util/crypto_nss.c:216
#, c-format
msgid "Failed to set IV for decryption."
-msgstr "Fehler beim Festlegen des IV für die Entschlüsselung."
+msgstr "Das Anlegen des IV zur Entschlüsselung scheiterte."
#: ../libnm-util/crypto_nss.c:224
#, c-format
msgid "Failed to initialize the decryption context."
-msgstr "Fehler beim Einrichten des Entschlüsselungs-Kontextes."
+msgstr "Die Initialisierung des Entschlüsselungskontexts scheiterte."
#: ../libnm-util/crypto_nss.c:237
#, c-format
msgid "Failed to decrypt the private key: %d."
-msgstr "Fehler beim Entschlüsseln des privaten Schlüssels: %d."
+msgstr "Das Entschlüsseln des privaten Schlüssels scheiterte: %d."
#: ../libnm-util/crypto_nss.c:245
#, c-format
msgid "Failed to decrypt the private key: decrypted data too large."
msgstr ""
-"Fehler beim Entschlüsseln des privaten Schlüssels: Die entschlüsselten Daten "
-"sind zu groß."
+"Das Entschlüsseln des privaten Schlüssels scheiterte: Die entschlüsselten "
+"Daten sind zu groß."
#: ../libnm-util/crypto_nss.c:256
#, c-format
msgid "Failed to finalize decryption of the private key: %d."
-msgstr "Fehler beim Abschließen der Entschlüsselung des privaten Schlüssels: %d."
+msgstr ""
+"Das Abschließen der Entschlüsselung des privaten Schlüssels scheiterte: %d."
#: ../libnm-util/crypto_nss.c:364
#, c-format
msgid "Failed to initialize the encryption cipher slot."
-msgstr "Fehler beim Einrichten des Verschlüsselungs-Slots."
+msgstr "Die Initialisierung des Verschlüsselungsstromslots scheiterte."
#: ../libnm-util/crypto_nss.c:372
#, c-format
msgid "Failed to set symmetric key for encryption."
-msgstr "Fehler beim Festlegen des symmetrischen Schlüssels für die Verschlüsselung."
+msgstr ""
+"Das Anlegen des symmetrischen Schlüssels zur Verschlüsselung scheiterte."
#: ../libnm-util/crypto_nss.c:380
#, c-format
msgid "Failed to set IV for encryption."
-msgstr "Fehler beim Festlegen des IV für die Verschlüsselung."
+msgstr "Das Anlegen des IV zur Verschlüsselung scheiterte."
#: ../libnm-util/crypto_nss.c:388
#, c-format
msgid "Failed to initialize the encryption context."
-msgstr "Fehler beim Initialisieren des Verschlüsselungs-Kontextes."
+msgstr "Die Initialisierung des Verschlusselungskontexts scheiterte."
#: ../libnm-util/crypto_nss.c:396
#, c-format
msgid "Failed to encrypt: %d."
-msgstr "Fehler beim Verschlüsseln: %d."
+msgstr "Das Verschlüsseln scheiterte: %d."
#: ../libnm-util/crypto_nss.c:404
#, c-format
@@ -1463,12 +1180,12 @@ msgstr "Unerwartete Datenmenge nach der Verschlüsselung."
#: ../libnm-util/crypto_nss.c:447
#, c-format
msgid "Couldn't decode certificate: %d"
-msgstr "Zertifikat konnte nicht dekodiert werden: %d"
+msgstr "Das Zertifikat konnte nicht entschlüsselt werden: %d"
#: ../libnm-util/crypto_nss.c:482
#, c-format
msgid "Couldn't convert password to UCS2: %d"
-msgstr "Passwort konnte nicht zu UCS2 konvertiert werden: %d"
+msgstr "Das Passwort konnte nicht zu UCS2 konvertiert werden: %d"
#: ../libnm-util/crypto_nss.c:510
#, c-format
@@ -1478,7 +1195,7 @@ msgstr "PKCS#12-Decoder konnte nicht initialisiert werden: %d"
#: ../libnm-util/crypto_nss.c:519
#, c-format
msgid "Couldn't decode PKCS#12 file: %d"
-msgstr "PKCS#12-Datei konnte nicht decodiert werden: %d"
+msgstr "PKCS#12-Datei konnte nicht verschlüsselt werden: %d"
#: ../libnm-util/crypto_nss.c:528
#, c-format
@@ -1487,35 +1204,40 @@ msgstr "PKCS#12-Datei konnte nicht überprüft werden: %d"
#: ../libnm-util/crypto_nss.c:557
msgid "Could not generate random data."
-msgstr "Zufällige Daten konnten nicht erstellt werden."
+msgstr "Es konnten keine Zufallsdaten generiert werden."
-#: ../libnm-util/nm-utils.c:1925
+#: ../libnm-util/nm-utils.c:1924
#, c-format
msgid "Not enough memory to make encryption key."
-msgstr "Nicht genug Speicher zum Erstellen eines Schlüssels."
+msgstr ""
+"Nicht genügend freier Speicher zur Erstellung des Verschlüsselungsschlüssels."
-#: ../libnm-util/nm-utils.c:2035
+#: ../libnm-util/nm-utils.c:2034
msgid "Could not allocate memory for PEM file creation."
-msgstr "Es konnte kein Speicher zum Erstellen der PEM-Datei angefordert werden."
+msgstr ""
+"Es konnte nicht genügend freier Speicher zur Erstellung der PEM-Datei "
+"angefordert werden."
-#: ../libnm-util/nm-utils.c:2047
+#: ../libnm-util/nm-utils.c:2046
#, c-format
msgid "Could not allocate memory for writing IV to PEM file."
msgstr ""
-"Es konnte kein Speicher zum Schreiben des IV in die PEM-Datei angefordert "
-"werden."
+"Es konnte nicht genügend freier Speicher zum Schreiben des IV in die PEM-"
+"Datei angefordert werden."
-#: ../libnm-util/nm-utils.c:2059
+#: ../libnm-util/nm-utils.c:2058
#, c-format
msgid "Could not allocate memory for writing encrypted key to PEM file."
msgstr ""
-"Es konnte kein Speicher zum Schreiben des IV in die PEM-Datei angefordert "
-"werden."
+"Es konnte nicht genügend freier Speicher zum Schreiben des verschlüsselten "
+"Schlüssels in die PEM-Datei angefordert werden."
-#: ../libnm-util/nm-utils.c:2078
+#: ../libnm-util/nm-utils.c:2077
#, c-format
msgid "Could not allocate memory for PEM file data."
-msgstr "Es konnte kein Speicher für die Daten der PEM-Datei angefordert werden."
+msgstr ""
+"Es konnte nicht genügend freier Speicher für die PEM-Datei angefordert "
+"werden."
#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231
#: ../src/nm-netlink-monitor.c:653
@@ -1531,50 +1253,52 @@ msgstr "Während des Wartens auf Daten am Socket ist ein Fehler aufgetreten"
#, c-format
msgid "unable to connect to netlink for monitoring link status: %s"
msgstr ""
-"Es kann nicht mit netlink zur Überwachung der Netzwerkverbindung verbunden "
-"werden: %s"
+"Die Verbindung zu netlink zur Überwachung der Netzwerkverbindung konnte "
+"nicht hergestellt werden: %s"
#: ../src/nm-netlink-monitor.c:265
#, c-format
msgid "unable to enable netlink handle credential passing: %s"
-msgstr "Kann Weitergabe von Berechtigungen des netlink-Handle nicht aktivieren: %s"
+msgstr ""
+"Die netlink-Handle-Berechtigungsnachweisfreigabe konnte nicht aktiviert "
+"werden: %s"
#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353
#, c-format
msgid "unable to allocate netlink handle for monitoring link status: %s"
msgstr ""
-"Es kann kein netlink-Handle zur Überwachung der Netzwerkverbindung "
+"Es konnte kein netlink-Handle zur Überwachung der Netzwerkverbindung "
"angefordert werden: %s"
#: ../src/nm-netlink-monitor.c:376
#, c-format
msgid "unable to allocate netlink link cache for monitoring link status: %s"
msgstr ""
-"Es kann kein netlink-Cache zur Überwachung der Netzwerkverbindung belegt "
-"werden: %s"
+"Es konnte kein netlink-Verbindungszwischenspeicher zur Überwachung der "
+"Netzwerkverbindung angefordert werden: %s"
#: ../src/nm-netlink-monitor.c:502
#, c-format
msgid "unable to join netlink group: %s"
-msgstr "Der netlink-Gruppe kann nicht beigetreten werden: %s"
+msgstr "Der netlink-Gruppe konnte nicht beigetreten werden: %s"
#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642
#, c-format
msgid "error updating link cache: %s"
-msgstr "Fehler beim Aktualisieren des Verbindungs-Cache: %s"
+msgstr "Die Aktualisierung des Verbindungszwischenspeichers schlug fehl: %s"
#: ../src/main.c:502
#, c-format
msgid "Invalid option. Please use --help to see a list of valid options.\n"
msgstr ""
-"Ungültige Option. Verwenden Sie bitte '--help', um eine Liste der gültigen "
+"Ungültige Option. Verwenden Sie --help um eine Liste der verfügbaren "
"Optionen zu erhalten.\n"
#: ../src/main.c:562
#, c-format
msgid "%s. Please use --help to see a list of valid options.\n"
msgstr ""
-"%s Verwenden Sie bitte '--help', um eine Liste der gültigen Optionen zu "
+"%s. Verwenden Sie --help, um eine Liste der verfügbaren Optionen zu "
"erhalten.\n"
#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325
@@ -1587,64 +1311,62 @@ msgid ""
"# Merged from %s\n"
"\n"
msgstr ""
-"# Zusammengefügt aus %s\n"
+"# Zusammengeführt aus %s\n"
"\n"
#: ../src/dhcp-manager/nm-dhcp-manager.c:279
msgid "no usable DHCP client could be found."
-msgstr "Kein brauchbarer DHCP-Client gefunden."
+msgstr "Es konnte kein verwendbarer DHCP-Client gefunden werden."
#: ../src/dhcp-manager/nm-dhcp-manager.c:288
msgid "'dhclient' could be found."
-msgstr "'dhclient' wurde gefunden."
+msgstr "»dhclient« konnte nicht gefunden werden."
#: ../src/dhcp-manager/nm-dhcp-manager.c:298
msgid "'dhcpcd' could be found."
-msgstr "'dhcpcd' wurde gefunden."
+msgstr "»dhcpcd« konnte nicht gefunden werden."
#: ../src/dhcp-manager/nm-dhcp-manager.c:306
#, c-format
msgid "unsupported DHCP client '%s'"
-msgstr "Nicht unterstützter DHCP-Client '%s'"
+msgstr "Nicht unterstützter DHCP-Client »%s«"
#: ../src/logging/nm-logging.c:146
#, c-format
msgid "Unknown log level '%s'"
-msgstr "Unbekanntes Log-Level '%s'"
+msgstr "Unbekannte Protokollstufe »%s«"
#: ../src/logging/nm-logging.c:171
#, c-format
msgid "Unknown log domain '%s'"
-msgstr "Unbekannte Log-Domain '%s'"
+msgstr "Unbekannte Protokolldomäne »%s«"
#: ../src/named-manager/nm-named-manager.c:343
msgid "NOTE: the libc resolver may not support more than 3 nameservers."
msgstr ""
-"HINWEIS: Der libc-Auflöser unterstützt eventuell nicht mehr als 3 Server zur "
-"Namensauflösung."
+"HINWEIS: Der libc-resolver unterstützt eventuell nicht mehr als drei "
+"Nameserver."
#: ../src/named-manager/nm-named-manager.c:345
msgid "The nameservers listed below may not be recognized."
-msgstr ""
-"Die nachfolgend aufgelisteten Server zur Namensauflösung werden eventuell "
-"nicht erkannt."
+msgstr "Die nachfolgend gelisteten Nameserver werden eventuell nicht erkannt."
#: ../src/system-settings/nm-default-wired-connection.c:157
#, c-format
msgid "Auto %s"
msgstr "Auto %s"
-#: ../system-settings/plugins/ifcfg-rh/reader.c:3256
+#: ../system-settings/plugins/ifcfg-rh/reader.c:3254
msgid "System"
msgstr "System"
#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1
msgid "Connection sharing via a protected WiFi network"
-msgstr "Verbindungsfreigabe über ein geschütztes WiFi-Netzwerk"
+msgstr "Verbindungsfreigabe über ein geschütztes WLAN-Netzwerk"
#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2
msgid "Connection sharing via an open WiFi network"
-msgstr "Verbindungsfreigabe über ein offenes WiFi-Netzwerk"
+msgstr "Verbindungsfreigabe über ein offenes WLAN-Netzwerk"
#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3
msgid "Modify persistent system hostname"
@@ -1652,11 +1374,12 @@ msgstr "Den ständigen Rechnernamen des Systems bearbeiten"
#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4
msgid "Modify system connections"
-msgstr "System-Verbindungen bearbeiten"
+msgstr "Systemverbindungen bearbeiten"
#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5
msgid "System policy prevents modification of system settings"
-msgstr "Die Systemrichtlinien verhindern das Bearbeiten von Systemeinstellungen"
+msgstr ""
+"Die Systemrichtlinien verhindern das Bearbeiten von Systemeinstellungen"
#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6
msgid "System policy prevents modification of the persistent system hostname"
@@ -1668,11 +1391,32 @@ msgstr ""
msgid "System policy prevents sharing connections via a protected WiFi network"
msgstr ""
"Die Systemrichtlinien verhindern Verbindungsfreigaben über ein geschütztes "
-"WiFi-Netzwerk"
+"WLAN-Netzwerk"
#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8
msgid "System policy prevents sharing connections via an open WiFi network"
msgstr ""
-"Die Systemrichtlinien verhindern Verbindungsfreigaben über ein offenes WiFi-"
+"Die Systemrichtlinien verhindern Verbindungsfreigaben über ein offenes WLAN-"
"Netzwerk"
+#~ msgid "unable to join netlink group for monitoring link status: %s"
+#~ msgstr ""
+#~ "Es kann nicht mit einer netlink-Gruppe zur Überwachung der "
+#~ "Netzwerkverbindung verbunden werden: %s"
+
+#~ msgid "unable to connect to netlink: %s"
+#~ msgstr "Es kann nicht mit netlink verbunden werden: %s"
+
+#~ msgid "operation took too long"
+#~ msgstr "Vorgang dauerte zu lange"
+
+#~ msgid "received data from wrong type of sender"
+#~ msgstr "Daten von einem falschen Absendertyp erhalten"
+
+#~ msgid "received data from unexpected sender"
+#~ msgstr "Daten von einem unerwarteten Absender erhalten"
+
+#~ msgid "too much data was sent over socket and some of it was lost"
+#~ msgstr ""
+#~ "Es wurden zu viele Daten über den Socket gesendet und einige davon sind "
+#~ "verloren gegangen"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index a347564be..13c7a2762 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -1,98 +1,27 @@
-# translation of pt_BR.po to Portuguese
# Brazilian Portuguese translation of NetworkManager.
-# Copyright (C) 2004-2008, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2004-2008 Free Software Foundation, Inc.
# This file is distributed under the same license as the NetworkManager package.
-#
-# Raphael Higino , 2004-2007.
+# Raphael Higino , 2004-2007
# Luiz Armesto , 2007.
-# Henrique P. Machado , 2008.
+# Henrique P. Machado , 2008, 2010.
# Og Maciel , 2008.
# Fabrício Godoy , 2008.
-# Glaucia Cintra , 2010.
+#
msgid ""
msgstr ""
-"Project-Id-Version: pt_BR\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-05-06 14:31+0530\n"
-"PO-Revision-Date: 2010-05-07 14:38+1000\n"
-"Last-Translator: Glaucia Cintra \n"
-"Language-Team: Portuguese \n"
+"Project-Id-Version: NetworkManager\n"
+"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
+"product=NetworkManager&component=general\n"
+"POT-Creation-Date: 2010-04-27 15:25+0000\n"
+"PO-Revision-Date: 2010-06-06 18:36-0300\n"
+"Last-Translator: Henrique P. Machado \n"
+"Language-Team: Brazilian Portuguese \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-"X-Generator: KBabel 1.11.4\n"
-#: ../cli/src/connections.c:59 ../cli/src/connections.c:74
-#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108
-#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142
-#: ../cli/src/devices.c:152
-msgid "NAME"
-msgstr "NOME"
-
-#. 0
-#: ../cli/src/connections.c:60 ../cli/src/connections.c:75
-msgid "UUID"
-msgstr "UUID"
-
-#. 1
-#: ../cli/src/connections.c:61
-msgid "DEVICES"
-msgstr "DISPOSITIVOS"
-
-#. 2
-#: ../cli/src/connections.c:62 ../cli/src/connections.c:77
-msgid "SCOPE"
-msgstr "ESCOPO"
-
-#. 3
-#: ../cli/src/connections.c:63
-msgid "DEFAULT"
-msgstr "PADRÃO"
-
-#. 4
-#: ../cli/src/connections.c:64
-msgid "DBUS-SERVICE"
-msgstr "SERVIÇO-DBUS"
-
-#. 5
-#: ../cli/src/connections.c:65
-msgid "SPEC-OBJECT"
-msgstr "ESPECIFICAÇÕES DO OBJETO"
-
-#. 6
-#: ../cli/src/connections.c:66
-msgid "VPN"
-msgstr "VPN"
-
-#. 1
-#. 0
-#. 1
-#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87
-msgid "TYPE"
-msgstr "TIPO"
-
-#. 3
-#: ../cli/src/connections.c:78
-msgid "TIMESTAMP"
-msgstr "CARIMBO DE DATA E HORA"
-
-#. 4
-#: ../cli/src/connections.c:79
-msgid "TIMESTAMP-REAL"
-msgstr "CARIMBO DE DATA E HORA REAL"
-
-#. 5
-#: ../cli/src/connections.c:80
-msgid "AUTOCONNECT"
-msgstr "CONEXÃO AUTOMÁTICA"
-
-#. 6
-#: ../cli/src/connections.c:81
-msgid "READONLY"
-msgstr "SOMENTE LEITURA"
-
-#: ../cli/src/connections.c:157
+#: ../cli/src/connections.c:86
#, c-format
msgid ""
"Usage: nmcli con { COMMAND | help }\n"
@@ -104,8 +33,8 @@ msgid ""
"]\n"
" down id | uuid \n"
msgstr ""
-"Usage: nmcli con { COMMAND | help }\n"
-" COMMAND := { list | status | up | down }\n"
+"Uso: nmcli con { COMANDO | help }\n"
+" COMANDO := { list | status | up | down }\n"
"\n"
" list [id | uuid | system | user]\n"
" status\n"
@@ -113,516 +42,312 @@ msgstr ""
"]\n"
" down id | uuid \n"
-#: ../cli/src/connections.c:197 ../cli/src/connections.c:536
+#: ../cli/src/connections.c:158
+msgid "Connections"
+msgstr "Conexões"
+
+#: ../cli/src/connections.c:158 ../cli/src/connections.c:160
+#: ../cli/src/connections.c:196 ../cli/src/connections.c:198
+#: ../cli/src/connections.c:205 ../cli/src/connections.c:207
+#: ../cli/src/devices.c:298 ../cli/src/devices.c:458 ../cli/src/devices.c:460
+msgid "Type"
+msgstr "Tipo"
+
+#: ../cli/src/connections.c:158 ../cli/src/connections.c:160
+#: ../cli/src/connections.c:196 ../cli/src/connections.c:198
+#: ../cli/src/connections.c:205 ../cli/src/connections.c:207
+#: ../cli/src/connections.c:297 ../cli/src/connections.c:299
+msgid "UUID"
+msgstr "UUID"
+
+#: ../cli/src/connections.c:158 ../cli/src/connections.c:160
+#: ../cli/src/connections.c:196 ../cli/src/connections.c:198
+#: ../cli/src/connections.c:205 ../cli/src/connections.c:207
+#: ../cli/src/connections.c:297 ../cli/src/connections.c:299
+msgid "Name"
+msgstr "Nome"
+
+#: ../cli/src/connections.c:163
#, c-format
-msgid "Error: 'con list': %s"
-msgstr "Erro: lista 'con': %s"
+msgid "System connections:\n"
+msgstr "Conexões de sistema:\n"
-#: ../cli/src/connections.c:199 ../cli/src/connections.c:538
+#: ../cli/src/connections.c:167
#, c-format
-msgid "Error: 'con list': %s; allowed fields: %s"
-msgstr "Erro: 'con list': %s; campos permitidos: %s"
+msgid "User connections:\n"
+msgstr "Conexões de usuário:\n"
-#: ../cli/src/connections.c:207
-msgid "Connection details"
-msgstr "Detalhes de Conexões"
+#: ../cli/src/connections.c:178 ../cli/src/connections.c:967
+#: ../cli/src/connections.c:983 ../cli/src/connections.c:992
+#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085
+#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699
+#: ../cli/src/devices.c:785 ../cli/src/devices.c:792
+#, c-format
+msgid "Error: %s argument is missing."
+msgstr "Erro: faltando argumento %s."
-#: ../cli/src/connections.c:381 ../cli/src/connections.c:601
-msgid "system"
-msgstr "sistema"
+#: ../cli/src/connections.c:189
+#, c-format
+msgid "Error: %s - no such connection."
+msgstr "Erro: %s - não existe esta conexão."
-#: ../cli/src/connections.c:381 ../cli/src/connections.c:601
-msgid "user"
-msgstr "usuário"
-
-#: ../cli/src/connections.c:383
-msgid "never"
-msgstr "nunca"
-
-#. "CAPABILITIES"
-#. Print header
-#. "WIFI-PROPERTIES"
-#: ../cli/src/connections.c:384 ../cli/src/connections.c:385
-#: ../cli/src/connections.c:602 ../cli/src/connections.c:605
-#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539
-#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542
-#: ../cli/src/devices.c:543 ../cli/src/settings.c:504
-#: ../cli/src/settings.c:544 ../cli/src/settings.c:643
-#: ../cli/src/settings.c:912 ../cli/src/settings.c:913
-#: ../cli/src/settings.c:915 ../cli/src/settings.c:917
-#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043
-#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123
-#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125
-#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127
-#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129
-#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131
-#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133
-#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135
-#: ../cli/src/settings.c:1210
-msgid "yes"
-msgstr "sim"
-
-#: ../cli/src/connections.c:384 ../cli/src/connections.c:385
-#: ../cli/src/connections.c:602 ../cli/src/connections.c:605
-#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539
-#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542
-#: ../cli/src/devices.c:543 ../cli/src/settings.c:504
-#: ../cli/src/settings.c:506 ../cli/src/settings.c:544
-#: ../cli/src/settings.c:643 ../cli/src/settings.c:912
-#: ../cli/src/settings.c:913 ../cli/src/settings.c:915
-#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042
-#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044
-#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124
-#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126
-#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128
-#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130
-#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132
-#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134
-#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210
-msgid "no"
-msgstr "não"
-
-#: ../cli/src/connections.c:457 ../cli/src/connections.c:500
-msgid "System connections"
+#: ../cli/src/connections.c:196
+msgid "System-wide connections"
msgstr "Conexões de sistema"
-#: ../cli/src/connections.c:462 ../cli/src/connections.c:513
+#: ../cli/src/connections.c:205
msgid "User connections"
msgstr "Conexões de usuário"
-#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334
-#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359
-#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452
-#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973
-#: ../cli/src/devices.c:980
-#, c-format
-msgid "Error: %s argument is missing."
-msgstr "Erro: argumento %s está faltando"
-
-#: ../cli/src/connections.c:487
-#, c-format
-msgid "Error: %s - no such connection."
-msgstr "Erro: %s - não existe tal conexão"
-
-#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383
-#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687
-#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986
+#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016
+#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446
+#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706
+#: ../cli/src/devices.c:798
#, c-format
msgid "Unknown parameter: %s\n"
msgstr "Parâmetro desconhecido: %s\n"
-#: ../cli/src/connections.c:528
+#: ../cli/src/connections.c:221
#, c-format
msgid "Error: no valid parameter specified."
-msgstr "Erro: não existe um parâmetro válido especificado"
+msgstr "Erro: nenhum parâmetro válido especificado."
-#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572
-#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274
-#, c-format
-msgid "Error: %s."
-msgstr "Erro: %s"
+#. FIXME: Fix the output
+#: ../cli/src/connections.c:268 ../cli/src/devices.c:302
+#: ../cli/src/devices.c:321 ../cli/src/devices.c:353 ../cli/src/devices.c:355
+#: ../cli/src/devices.c:357 ../cli/src/devices.c:359 ../cli/src/devices.c:361
+msgid "yes"
+msgstr "sim"
-#: ../cli/src/connections.c:649
-#, c-format
-msgid "Error: 'con status': %s"
-msgstr "Erro: status 'con':%s"
+#: ../cli/src/connections.c:268 ../cli/src/devices.c:304
+msgid "no"
+msgstr "não"
-#: ../cli/src/connections.c:651
-#, c-format
-msgid "Error: 'con status': %s; allowed fields: %s"
-msgstr "Erro: status 'con':%s, campos permitidos: %s"
-
-#: ../cli/src/connections.c:658
+#: ../cli/src/connections.c:297
msgid "Active connections"
msgstr "Conexões ativas"
-#: ../cli/src/connections.c:1026
+#: ../cli/src/connections.c:297 ../cli/src/connections.c:299
+#: ../cli/src/devices.c:302 ../cli/src/devices.c:304
+msgid "Default"
+msgstr "Padrão"
+
+#: ../cli/src/connections.c:297 ../cli/src/connections.c:299
+msgid "Service"
+msgstr "Serviço"
+
+#: ../cli/src/connections.c:297 ../cli/src/connections.c:299
+msgid "Devices"
+msgstr "Dispositivos"
+
+#: ../cli/src/connections.c:659
#, c-format
msgid "no active connection on device '%s'"
-msgstr "nenhuma conexão ativa no dispositivo '%s'"
+msgstr "nenhuma conexão ativa no dispositivo \"%s\""
-#: ../cli/src/connections.c:1034
+#: ../cli/src/connections.c:667
#, c-format
msgid "no active connection or device"
-msgstr "nenhuma conexão ativa ou dispositivo"
+msgstr "nenhuma conexão ou dispositivo ativo"
-#: ../cli/src/connections.c:1084
-#, c-format
-msgid "device '%s' not compatible with connection '%s'"
-msgstr "dispositivo '%s' não compatível com a conexão '%s'"
-
-#: ../cli/src/connections.c:1086
-#, c-format
-msgid "no device found for connection '%s'"
-msgstr "nenhum dispositivo encontrado para a conexão '%s'"
-
-#: ../cli/src/connections.c:1097
+#: ../cli/src/connections.c:730
msgid "activating"
msgstr "ativando"
-#: ../cli/src/connections.c:1099
+#: ../cli/src/connections.c:732
msgid "activated"
msgstr "ativado"
-#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125
-#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224
-#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92
-#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469
+#: ../cli/src/connections.c:735 ../cli/src/connections.c:758
+#: ../cli/src/connections.c:791 ../cli/src/devices.c:111
+#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98
msgid "unknown"
msgstr "desconhecido"
-#: ../cli/src/connections.c:1111
+#: ../cli/src/connections.c:744
msgid "VPN connecting (prepare)"
-msgstr "Conectando com o VPN (preparar)"
+msgstr "Conexão VPN (preparando)"
-#: ../cli/src/connections.c:1113
+#: ../cli/src/connections.c:746
msgid "VPN connecting (need authentication)"
-msgstr "Conectando ao VPN (autenticação necessária)"
+msgstr "Conexão VPN (precisa de autenticação)"
-#: ../cli/src/connections.c:1115
+#: ../cli/src/connections.c:748
msgid "VPN connecting"
-msgstr "Conectando ao VPN"
+msgstr "Conexão VPN"
-#: ../cli/src/connections.c:1117
+#: ../cli/src/connections.c:750
msgid "VPN connecting (getting IP configuration)"
-msgstr "Conectando ao VPN (obtendo configuração do IP)"
+msgstr "Conexão VPN (obtendo configuração de IP)"
-#: ../cli/src/connections.c:1119
+#: ../cli/src/connections.c:752
msgid "VPN connected"
-msgstr "VPN conectado"
+msgstr "VPN conectada"
-#: ../cli/src/connections.c:1121
+#: ../cli/src/connections.c:754
msgid "VPN connection failed"
-msgstr "Falha da conexão ao VPN"
+msgstr "Conexão VPN falhou"
-#: ../cli/src/connections.c:1123
+#: ../cli/src/connections.c:756
msgid "VPN disconnected"
-msgstr "VPN desconectado"
+msgstr "VPN desconectada"
-#: ../cli/src/connections.c:1134
+#: ../cli/src/connections.c:767
msgid "unknown reason"
msgstr "razão desconhecida"
-#: ../cli/src/connections.c:1136
+#: ../cli/src/connections.c:769
msgid "none"
-msgstr "nenhuma"
+msgstr "nenhum(a)"
-#: ../cli/src/connections.c:1138
+#: ../cli/src/connections.c:771
msgid "the user was disconnected"
msgstr "o usuário foi desconectado"
-#: ../cli/src/connections.c:1140
+#: ../cli/src/connections.c:773
msgid "the base network connection was interrupted"
msgstr "a conexão de rede base foi interrompida"
-#: ../cli/src/connections.c:1142
+#: ../cli/src/connections.c:775
msgid "the VPN service stopped unexpectedly"
msgstr "o serviço VPN parou inesperadamente"
-#: ../cli/src/connections.c:1144
+#: ../cli/src/connections.c:777
msgid "the VPN service returned invalid configuration"
-msgstr "O serviço VPN retornou configurações inválidas"
+msgstr "o serviço VPN retornou uma configuração inválida"
-#: ../cli/src/connections.c:1146
+#: ../cli/src/connections.c:779
msgid "the connection attempt timed out"
-msgstr "a tentativa de conexão expirou o tempo limite"
+msgstr "tentativa de conexão esgotada"
-#: ../cli/src/connections.c:1148
+#: ../cli/src/connections.c:781
msgid "the VPN service did not start in time"
-msgstr "o serviço VPN não iniciou em tempo"
+msgstr "o serviço VPN não iniciou a tempo"
-#: ../cli/src/connections.c:1150
+#: ../cli/src/connections.c:783
msgid "the VPN service failed to start"
msgstr "o serviço VPN falhou ao iniciar"
-#: ../cli/src/connections.c:1152
+#: ../cli/src/connections.c:785
msgid "no valid VPN secrets"
-msgstr "Segredos do VPN não válidos"
+msgstr "sem segredos VPN válidos"
-#: ../cli/src/connections.c:1154
+#: ../cli/src/connections.c:787
msgid "invalid VPN secrets"
-msgstr "Segredos do VPN inválidos"
+msgstr "segredos VPN inválidos"
-#: ../cli/src/connections.c:1156
+#: ../cli/src/connections.c:789
msgid "the connection was removed"
msgstr "a conexão foi removida"
-#: ../cli/src/connections.c:1170
+#: ../cli/src/connections.c:803
#, c-format
msgid "state: %s\n"
-msgstr "stado: %s\n"
+msgstr "estado: %s\n"
-#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199
+#: ../cli/src/connections.c:806 ../cli/src/connections.c:832
#, c-format
msgid "Connection activated\n"
msgstr "Conexão ativada\n"
-#: ../cli/src/connections.c:1176
+#: ../cli/src/connections.c:809
#, c-format
msgid "Error: Connection activation failed."
-msgstr "Erro: Ativação da conexão falhou."
+msgstr "Erro: a ativação da conexão falhou."
-#: ../cli/src/connections.c:1195
+#: ../cli/src/connections.c:828
#, c-format
msgid "state: %s (%d)\n"
msgstr "estado: %s (%d)\n"
-#: ../cli/src/connections.c:1205
+#: ../cli/src/connections.c:838
#, c-format
msgid "Error: Connection activation failed: %s."
-msgstr "Erro: Ativação de conexão falhou: %s"
+msgstr "Erro: a ativação da conexão falhou: %s."
-#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811
+#: ../cli/src/connections.c:855 ../cli/src/devices.c:551
#, c-format
msgid "Error: Timeout %d sec expired."
-msgstr "Erro: o Timeout%d de segundos expirou"
+msgstr "Erro: tempo expirado - %d seg."
-#: ../cli/src/connections.c:1265
+#: ../cli/src/connections.c:898
#, c-format
msgid "Error: Connection activation failed: %s"
-msgstr "Erro: Ativação de conexão falhou: %s"
+msgstr "Erro: a ativação da conexão falhou: %s"
-#: ../cli/src/connections.c:1279
+#: ../cli/src/connections.c:912
#, c-format
msgid "Error: Obtaining active connection for '%s' failed."
-msgstr "Erro: Obtenção de conexão ativa para '%s' falhou."
+msgstr "Erro: falha na obtenção da conexão ativa para \"%s\"."
-#: ../cli/src/connections.c:1288
+#: ../cli/src/connections.c:921
#, c-format
msgid "Active connection state: %s\n"
-msgstr "Estado de conexão ativa: %s\n"
+msgstr "Estado da conexão ativa: %s\n"
-#: ../cli/src/connections.c:1289
+#: ../cli/src/connections.c:922
#, c-format
msgid "Active connection path: %s\n"
-msgstr "Caminho de conexão ativa: %s\n"
+msgstr "Caminho da conexão ativa: %s\n"
-#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461
+#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094
#, c-format
msgid "Error: Unknown connection: %s."
-msgstr "Erro: Conexão desconhecida: %s"
+msgstr "Erro: conexão desconhecida: %s."
-#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882
+#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622
#, c-format
msgid "Error: timeout value '%s' is not valid."
-msgstr "Erro: valor timeout '%s' não é válido."
+msgstr "Erro: valor do tempo de expiração \"%s\" não é válido."
-#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478
+#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111
#, c-format
msgid "Error: id or uuid has to be specified."
-msgstr "Erro: id ou uuid deve ser especificada."
+msgstr "Erro: id ou uuid tem que ser especificada."
-#: ../cli/src/connections.c:1411
+#: ../cli/src/connections.c:1044
#, c-format
msgid "Error: No suitable device found: %s."
-msgstr "Erro: Não foi encontrado nenhum dispositivo adequado: %s."
+msgstr "Erro: nenhum dispositivo adequado encontrado: %s."
-#: ../cli/src/connections.c:1413
+#: ../cli/src/connections.c:1046
#, c-format
msgid "Error: No suitable device found."
-msgstr "Erro: Não foi encontrado nenhum dispositivo adequado."
+msgstr "Erro: nenhum dispositivo adequado encontrado."
-#: ../cli/src/connections.c:1505
+#: ../cli/src/connections.c:1138
#, c-format
msgid "Warning: Connection not active\n"
-msgstr "Aviso: Conexão não ativa\n"
+msgstr "Aviso: conexão inativa\n"
-#: ../cli/src/connections.c:1561
+#: ../cli/src/connections.c:1189
#, c-format
msgid "Error: 'con' command '%s' is not valid."
-msgstr "Erro: 'con' comando '%s' não é válido."
+msgstr "Erro: comando \"con\" \"%s\" não é válido."
-#: ../cli/src/connections.c:1597
+#: ../cli/src/connections.c:1216
#, c-format
msgid "Error: could not connect to D-Bus."
-msgstr "Erro: Nâo foi possível conectar ao D-Bus."
+msgstr "Erro: não foi possível conectar ao D-Bus."
-#: ../cli/src/connections.c:1604
+#: ../cli/src/connections.c:1223
#, c-format
msgid "Error: Could not get system settings."
-msgstr "Erro: Não foi possível obter configurações de sistema"
+msgstr "Erro: não foi possível obter as configurações do sistema."
-#: ../cli/src/connections.c:1612
+#: ../cli/src/connections.c:1231
#, c-format
msgid "Error: Could not get user settings."
-msgstr "Erro: Não foi possível obter configurações de usuário."
+msgstr "Erro: não foi possível obter as configurações do usuário."
-#: ../cli/src/connections.c:1622
+#: ../cli/src/connections.c:1241
#, c-format
msgid "Error: Can't obtain connections: settings services are not running."
msgstr ""
-"Erro: Não foi possível obter conexões: serviços de configuração não estão "
-"funcionando."
+"Erro: Não é possível obter conexões - serviços de configuração não estão em "
+"execução."
-#. 0
-#. 9
-#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162
-msgid "DEVICE"
-msgstr "DISPOSITIVO"
-
-#. 1
-#. 4
-#. 0
-#: ../cli/src/devices.c:62 ../cli/src/devices.c:90
-#: ../cli/src/network-manager.c:36
-msgid "STATE"
-msgstr "ESTADO"
-
-#: ../cli/src/devices.c:71
-msgid "GENERAL"
-msgstr "GERAL"
-
-#. 0
-#: ../cli/src/devices.c:72
-msgid "CAPABILITIES"
-msgstr "CAPACIDADES"
-
-#. 1
#: ../cli/src/devices.c:73
-msgid "WIFI-PROPERTIES"
-msgstr "PROPRIEDADES DO WIFI"
-
-#. 2
-#: ../cli/src/devices.c:74
-msgid "AP"
-msgstr "AP"
-
-#. 3
-#: ../cli/src/devices.c:75
-msgid "WIRED-PROPERTIES"
-msgstr "PROPRIEDADES CABEADAS"
-
-#. 4
-#: ../cli/src/devices.c:76
-msgid "IP4-SETTINGS"
-msgstr "CONFIGURAÇÕES DO IP4"
-
-#. 5
-#: ../cli/src/devices.c:77
-msgid "IP4-DNS"
-msgstr "DNS DO IP4"
-
-#. 2
-#: ../cli/src/devices.c:88
-msgid "DRIVER"
-msgstr "DRIVER"
-
-#. 3
-#: ../cli/src/devices.c:89
-msgid "HWADDR"
-msgstr "HWADDR"
-
-#. 0
-#: ../cli/src/devices.c:99
-msgid "CARRIER-DETECT"
-msgstr "DETECTOR DE CARREGADOR"
-
-#. 1
-#: ../cli/src/devices.c:100
-msgid "SPEED"
-msgstr "VELOCIDADE"
-
-#. 0
-#: ../cli/src/devices.c:109
-msgid "CARRIER"
-msgstr "CARREGADOR"
-
-#. 0
-#: ../cli/src/devices.c:119
-msgid "WEP"
-msgstr "WEP"
-
-#. 1
-#: ../cli/src/devices.c:120
-msgid "WPA"
-msgstr "WPA"
-
-#. 2
-#: ../cli/src/devices.c:121
-msgid "WPA2"
-msgstr "WPA2"
-
-#. 3
-#: ../cli/src/devices.c:122
-msgid "TKIP"
-msgstr "TKIP"
-
-#. 4
-#: ../cli/src/devices.c:123
-msgid "CCMP"
-msgstr "CCMP"
-
-#. 0
-#: ../cli/src/devices.c:132
-msgid "ADDRESS"
-msgstr "ENDEREÇO"
-
-#. 1
-#: ../cli/src/devices.c:133
-msgid "PREFIX"
-msgstr "PREFIXO"
-
-#. 2
-#: ../cli/src/devices.c:134
-msgid "GATEWAY"
-msgstr "GATEWAY"
-
-#. 0
-#: ../cli/src/devices.c:143
-msgid "DNS"
-msgstr "DNS"
-
-#. 0
-#: ../cli/src/devices.c:153
-msgid "SSID"
-msgstr "SSID"
-
-#. 1
-#: ../cli/src/devices.c:154
-msgid "BSSID"
-msgstr "BSSID"
-
-#. 2
-#: ../cli/src/devices.c:155
-msgid "MODE"
-msgstr "MODO"
-
-#. 3
-#: ../cli/src/devices.c:156
-msgid "FREQ"
-msgstr "FREQ"
-
-#. 4
-#: ../cli/src/devices.c:157
-msgid "RATE"
-msgstr "TAXA"
-
-#. 5
-#: ../cli/src/devices.c:158
-msgid "SIGNAL"
-msgstr "SINAL"
-
-#. 6
-#: ../cli/src/devices.c:159
-msgid "SECURITY"
-msgstr "SEGURANÇA"
-
-#. 7
-#: ../cli/src/devices.c:160
-msgid "WPA-FLAGS"
-msgstr "SINALIZADOR DO WPA"
-
-#. 8
-#: ../cli/src/devices.c:161
-msgid "RSN-FLAGS"
-msgstr "SINALIZADOR DO RSN"
-
-#. 10
-#: ../cli/src/devices.c:163
-msgid "ACTIVE"
-msgstr "ATIVO"
-
-#: ../cli/src/devices.c:186
#, c-format
msgid ""
"Usage: nmcli dev { COMMAND | help }\n"
@@ -632,246 +357,359 @@ msgid ""
" status\n"
" list [iface ]\n"
" disconnect iface [--nowait] [--timeout ]\n"
-" wifi [list [iface ] [hwaddr ]]\n"
+" wifi [list [iface ] | apinfo iface hwaddr ]\n"
"\n"
msgstr ""
-"Usage: nmcli dev { COMMAND | help }\n"
+"Uso: nmcli dev { COMANDO | help }\n"
"\n"
-" COMMAND := { status | list | disconnect | wifi }\n"
+" COMANDO := { status | list | disconnect | wifi }\n"
"\n"
" status\n"
" list [iface ]\n"
" disconnect iface [--nowait] [--timeout ]\n"
-" wifi [list [iface ] [hwaddr ]]\n"
+" wifi [list [iface ] | apinfo iface hwaddr ]\n"
"\n"
-#: ../cli/src/devices.c:206
+#: ../cli/src/devices.c:93
msgid "unmanaged"
-msgstr "Não gerenciado"
+msgstr "não gerenciável"
-#: ../cli/src/devices.c:208
+#: ../cli/src/devices.c:95
msgid "unavailable"
msgstr "indisponível"
-#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89
+#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73
msgid "disconnected"
-msgstr "disconectado"
+msgstr "desconectado"
-#: ../cli/src/devices.c:212
+#: ../cli/src/devices.c:99
msgid "connecting (prepare)"
-msgstr "conectando (preparar)"
+msgstr "conectando (preparando)"
-#: ../cli/src/devices.c:214
+#: ../cli/src/devices.c:101
msgid "connecting (configuring)"
msgstr "conectando (configurando)"
-#: ../cli/src/devices.c:216
+#: ../cli/src/devices.c:103
msgid "connecting (need authentication)"
-msgstr "conectando (é necessário uma autenticação)"
+msgstr "conectando (precisa de autenticação)"
-#: ../cli/src/devices.c:218
+#: ../cli/src/devices.c:105
msgid "connecting (getting IP configuration)"
-msgstr "conectando (obtendo configuração do IP)"
+msgstr "conectando (obtendo configuração de IP)"
-#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87
+#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71
msgid "connected"
msgstr "conectado"
-#: ../cli/src/devices.c:222
+#: ../cli/src/devices.c:109
msgid "connection failed"
-msgstr "conexão falhou"
+msgstr "falha na conexão"
-#: ../cli/src/devices.c:245 ../cli/src/devices.c:380
+#: ../cli/src/devices.c:132 ../cli/src/devices.c:876
msgid "Unknown"
-msgstr "desconhecido"
+msgstr "Desconhecido"
-#: ../cli/src/devices.c:277
+#. print them
+#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861
+#: ../cli/src/devices.c:879
msgid "(none)"
-msgstr "(nenhum)"
+msgstr "(nenhum(a))"
-#: ../cli/src/devices.c:302
+#: ../cli/src/devices.c:209
#, c-format
msgid "%s: error converting IP4 address 0x%X"
msgstr "%s: erro ao converter endereço IP4 0x%X"
-#: ../cli/src/devices.c:349
+#: ../cli/src/devices.c:238
#, c-format
-msgid "%u MHz"
-msgstr "%u MHz"
+msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d"
+msgstr "%s, %s, Freq %d MHz, Taxa %d Mb/s, Força %d"
-#: ../cli/src/devices.c:350
-#, c-format
-msgid "%u MB/s"
-msgstr "%u MB/s"
-
-#: ../cli/src/devices.c:359
-msgid "Encrypted: "
-msgstr "Criptografado:"
-
-#: ../cli/src/devices.c:364
-msgid "WEP "
-msgstr "WEP"
-
-#: ../cli/src/devices.c:366
-msgid "WPA "
-msgstr "WPA"
-
-#: ../cli/src/devices.c:368
-msgid "WPA2 "
-msgstr "WPA2"
-
-#: ../cli/src/devices.c:371
-msgid "Enterprise "
-msgstr "Enterprise"
-
-#: ../cli/src/devices.c:380
+#: ../cli/src/devices.c:239
msgid "Ad-Hoc"
msgstr "Ad-Hoc"
-#: ../cli/src/devices.c:380
-msgid "Infrastructure"
-msgstr "Infraestrutura"
+#: ../cli/src/devices.c:248
+msgid ", Encrypted: "
+msgstr ", Criptografada:"
-#: ../cli/src/devices.c:442
-#, c-format
-msgid "Error: 'dev list': %s"
-msgstr "Erro: 'dev list': %s"
+#: ../cli/src/devices.c:253
+msgid " WEP"
+msgstr " WEP"
-#: ../cli/src/devices.c:444
-#, c-format
-msgid "Error: 'dev list': %s; allowed fields: %s"
-msgstr "Erro: 'dev list': %s, campos permitidos '%s'"
+#: ../cli/src/devices.c:255
+msgid " WPA"
+msgstr " WPA"
-#: ../cli/src/devices.c:453
-msgid "Device details"
-msgstr "Detalhes do Dispositivos"
+#: ../cli/src/devices.c:257
+msgid " WPA2"
+msgstr " WPA2"
-#: ../cli/src/devices.c:483 ../cli/src/devices.c:827
+#: ../cli/src/devices.c:260
+msgid " Enterprise"
+msgstr " Enterprise"
+
+#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460
+msgid "Device"
+msgstr "Dispositivo"
+
+#: ../cli/src/devices.c:299
+msgid "Driver"
+msgstr "Controlador"
+
+#: ../cli/src/devices.c:299 ../cli/src/devices.c:567
msgid "(unknown)"
msgstr "(desconhecido)"
-#: ../cli/src/devices.c:484
-msgid "unknown)"
-msgstr "desconhecido)"
+#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460
+msgid "State"
+msgstr "Estado"
-#: ../cli/src/devices.c:510
+#: ../cli/src/devices.c:313
+msgid "HW Address"
+msgstr "Endereço de HW"
+
+#: ../cli/src/devices.c:319
+#, c-format
+msgid ""
+"\n"
+" Capabilities:\n"
+msgstr ""
+"\n"
+" Capacidades:\n"
+
+#: ../cli/src/devices.c:321
+msgid "Carrier Detect"
+msgstr "Detecção de Operadora"
+
+#: ../cli/src/devices.c:336
#, c-format
msgid "%u Mb/s"
msgstr "%u Mb/s"
-#. Print header
-#. "WIRED-PROPERTIES"
-#: ../cli/src/devices.c:583
+#: ../cli/src/devices.c:337
+msgid "Speed"
+msgstr "Velocidade"
+
+#: ../cli/src/devices.c:348
+#, c-format
+msgid ""
+"\n"
+" Wireless Properties\n"
+msgstr ""
+"\n"
+" Propriedades de rede sem fio\n"
+
+#: ../cli/src/devices.c:353
+msgid "WEP Encryption"
+msgstr "Criptografia WEP"
+
+#: ../cli/src/devices.c:355
+msgid "WPA Encryption"
+msgstr "Criptografia WPA"
+
+#: ../cli/src/devices.c:357
+msgid "WPA2 Encryption"
+msgstr "Criptografia WPA2"
+
+#: ../cli/src/devices.c:359
+msgid "TKIP cipher"
+msgstr "Cifrador TKIP"
+
+#: ../cli/src/devices.c:361
+msgid "CCMP cipher"
+msgstr "Cifrador CCMP"
+
+#: ../cli/src/devices.c:368
+#, c-format
+msgid ""
+"\n"
+" Wireless Access Points %s\n"
+msgstr ""
+"\n"
+" Pontos de acesso sem fio %s\n"
+
+#: ../cli/src/devices.c:368
+msgid "(* = current AP)"
+msgstr "(* = PA atual)"
+
+#: ../cli/src/devices.c:374
+#, c-format
+msgid ""
+"\n"
+" Wired Properties\n"
+msgstr ""
+"\n"
+" Propriedades de rede com fio\n"
+
+#: ../cli/src/devices.c:377 ../cli/src/devices.c:379
+msgid "Carrier"
+msgstr "Operadora"
+
+#: ../cli/src/devices.c:377
msgid "on"
msgstr "ligado"
-#: ../cli/src/devices.c:583
+#: ../cli/src/devices.c:379
msgid "off"
msgstr "desligado"
-#: ../cli/src/devices.c:710
+#: ../cli/src/devices.c:387
#, c-format
-msgid "Error: 'dev status': %s"
-msgstr "Erro: 'dev status': %s"
+msgid ""
+"\n"
+" IPv4 Settings:\n"
+msgstr ""
+"\n"
+" Configurações IPv4\n"
-#: ../cli/src/devices.c:712
-#, c-format
-msgid "Error: 'dev status': %s; allowed fields: %s"
-msgstr "Erro: 'dev status': %s; campos permitidos: %s"
+#: ../cli/src/devices.c:395
+msgid "Address"
+msgstr "Endereço"
-#: ../cli/src/devices.c:719
+#: ../cli/src/devices.c:401
+msgid "Prefix"
+msgstr "Prefixo"
+
+#: ../cli/src/devices.c:405
+msgid "Gateway"
+msgstr "Gateway"
+
+#: ../cli/src/devices.c:416
+msgid "DNS"
+msgstr "DNS"
+
+#: ../cli/src/devices.c:458
msgid "Status of devices"
-msgstr "Estado dos dispositivos"
+msgstr "Status dos dispositivos"
-#: ../cli/src/devices.c:747
+#: ../cli/src/devices.c:487
#, c-format
msgid "Error: '%s' argument is missing."
-msgstr "Erro: argumento '%s' está faltando"
+msgstr "Erro: argumento \"%s\" está faltando."
-#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035
+#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729
#, c-format
msgid "Error: Device '%s' not found."
-msgstr "Erro: Dispositivo '%s' não foi encontrado."
+msgstr "Erro: dispositivo \"%s\" não encontrado."
-#: ../cli/src/devices.c:799
+#: ../cli/src/devices.c:539
#, c-format
msgid "Success: Device '%s' successfully disconnected."
-msgstr "Sucesso: Dispositivo '%s' foi desconectado com sucesso."
+msgstr "Sucesso: dispositivo \"%s\" desconectado com sucesso."
-#: ../cli/src/devices.c:824
+#: ../cli/src/devices.c:564
#, c-format
msgid "Error: Device '%s' (%s) disconnecting failed: %s"
-msgstr "Erro: Desconexão do Dispositivo '%s' (%s) falhou: %s"
+msgstr "Erro: desconexão do dispositivo \"%s\" (%s) falhou: %s"
-#: ../cli/src/devices.c:832
+#: ../cli/src/devices.c:572
#, c-format
msgid "Device state: %d (%s)\n"
-msgstr "Estado do Dispositivo: %d (%s)\n"
+msgstr "Estado do dispositivo: %d (%s)\n"
-#: ../cli/src/devices.c:896
+#: ../cli/src/devices.c:636
#, c-format
msgid "Error: iface has to be specified."
-msgstr "Erro: iface precisa ser especificado."
+msgstr "Erro: iface tem que ser especificada."
-#: ../cli/src/devices.c:1011
-#, c-format
-msgid "Error: 'dev wifi': %s"
-msgstr "Erro: dev wifi '%s' "
-
-#: ../cli/src/devices.c:1013
-#, c-format
-msgid "Error: 'dev wifi': %s; allowed fields: %s"
-msgstr "Erro: 'dev wifi': %s;campos permitidos: %s"
-
-#: ../cli/src/devices.c:1020
+#: ../cli/src/devices.c:736 ../cli/src/devices.c:746
msgid "WiFi scan list"
-msgstr "Lista de scan do WiFi "
+msgstr "Lista de varredura de redes sem fio"
-#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109
-#, c-format
-msgid "Error: Access point with hwaddr '%s' not found."
-msgstr "Erro: Ponto de aceso com o hwaddr '%s' não foi encontrado."
-
-#: ../cli/src/devices.c:1072
+#: ../cli/src/devices.c:740
#, c-format
msgid "Error: Device '%s' is not a WiFi device."
-msgstr "Erro: Dispositivo '%s' não é um dispositivo WiFi."
+msgstr "Erro: dispositivo \"%s\" não é um dispositivo sem fio."
-#: ../cli/src/devices.c:1136
+#: ../cli/src/devices.c:754
+msgid "Device:"
+msgstr "Dispositivo:"
+
+#: ../cli/src/devices.c:806
+#, c-format
+msgid "Error: hwaddr has to be specified."
+msgstr "Erro: hwaddr tem que ser especificado."
+
+#: ../cli/src/devices.c:844
+#, c-format
+msgid "Error: Access point with hwaddr '%s' not found."
+msgstr "Erro: Ponto de acesso com hwaddr \"%s\" não encontrado."
+
+#: ../cli/src/devices.c:862
+#, c-format
+msgid "%u MHz"
+msgstr "%u MHz"
+
+#: ../cli/src/devices.c:863
+#, c-format
+msgid "%u MB/s"
+msgstr "%u MB/s"
+
+#: ../cli/src/devices.c:869 ../cli/src/devices.c:871
+msgid "AP parameters"
+msgstr "Parâmetros do PA"
+
+#: ../cli/src/devices.c:873
+msgid "SSID:"
+msgstr "SSID:"
+
+#: ../cli/src/devices.c:874
+msgid "BSSID:"
+msgstr "BSSID:"
+
+#: ../cli/src/devices.c:875
+msgid "Frequency:"
+msgstr "Frequência:"
+
+#: ../cli/src/devices.c:876
+msgid "Mode:"
+msgstr "Modo:"
+
+#: ../cli/src/devices.c:876
+msgid "Ad-hoc"
+msgstr "Ad-hoc"
+
+#: ../cli/src/devices.c:876
+msgid "Infrastructure"
+msgstr "Infraestrutura"
+
+#: ../cli/src/devices.c:877
+msgid "Maximal bitrate:"
+msgstr "Bitrate máxima:"
+
+#: ../cli/src/devices.c:878
+msgid "Strength:"
+msgstr "Potência:"
+
+#: ../cli/src/devices.c:879
+msgid "Flags:"
+msgstr "Flags:"
+
+#: ../cli/src/devices.c:879
+msgid "privacy"
+msgstr "privacidade"
+
+#: ../cli/src/devices.c:880
+msgid "WPA flags:"
+msgstr "Flags WPA:"
+
+#: ../cli/src/devices.c:881
+msgid "RSN flags:"
+msgstr "Flags RSN:"
+
+#: ../cli/src/devices.c:907
#, c-format
msgid "Error: 'dev wifi' command '%s' is not valid."
-msgstr "Erro: comando dev wifi '%s' não é válido"
+msgstr "Erro: comando \"dev wifi %s\" é inválido."
-#: ../cli/src/devices.c:1183
+#: ../cli/src/devices.c:943
#, c-format
msgid "Error: 'dev' command '%s' is not valid."
-msgstr "Erro: comando 'dev' '%s' não é válido"
+msgstr "Erro: comando \"dev %s\" é inválido."
-#: ../cli/src/network-manager.c:35
-msgid "RUNNING"
-msgstr "EXECUTANDO"
-
-#. 1
-#: ../cli/src/network-manager.c:37
-msgid "WIFI-HARDWARE"
-msgstr "HARDWARE DO WIFI"
-
-#. 2
-#: ../cli/src/network-manager.c:38
-msgid "WIFI"
-msgstr "WIFI"
-
-#. 3
-#: ../cli/src/network-manager.c:39
-msgid "WWAN-HARDWARE"
-msgstr "HARDWARE DO WWAN"
-
-#. 4
-#: ../cli/src/network-manager.c:40
-msgid "WWAN"
-msgstr "WWAN"
-
-#: ../cli/src/network-manager.c:62
+#: ../cli/src/network-manager.c:46
#, c-format
msgid ""
"Usage: nmcli nm { COMMAND | help }\n"
@@ -885,9 +723,9 @@ msgid ""
" wwan [on|off]\n"
"\n"
msgstr ""
-"Usage: nmcli nm { COMMAND | help }\n"
+"Uso: nmcli nm { COMANDO | help }\n"
"\n"
-" COMMAND := { status | sleep | wakeup | wifi | wwan }\n"
+" COMANDO := { status | sleep | wakeup | wifi | wwan }\n"
"\n"
" status\n"
" sleep\n"
@@ -896,91 +734,89 @@ msgstr ""
" wwan [on|off]\n"
"\n"
-#: ../cli/src/network-manager.c:83
+#: ../cli/src/network-manager.c:67
msgid "asleep"
-msgstr "modo de espera"
+msgstr "adormecido"
-#: ../cli/src/network-manager.c:85
+#: ../cli/src/network-manager.c:69
msgid "connecting"
msgstr "conectando"
-#: ../cli/src/network-manager.c:125
-#, c-format
-msgid "Error: 'nm status': %s"
-msgstr "Erro: 'nm status': %s"
-
-#: ../cli/src/network-manager.c:127
-#, c-format
-msgid "Error: 'nm status': %s; allowed fields: %s"
-msgstr "Erro: 'nm status': %s; campos permitidos: %s"
-
-#: ../cli/src/network-manager.c:134
-msgid "NetworkManager status"
-msgstr "status do NetworkManager "
-
-#. Print header
-#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141
-#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143
-#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243
+#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94
+#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96
+#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160
msgid "enabled"
-msgstr "ativado"
+msgstr "habilitado"
-#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141
-#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143
-#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243
+#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94
+#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96
+#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160
msgid "disabled"
-msgstr "desativado"
+msgstr "desabilitado"
-#: ../cli/src/network-manager.c:148
+#: ../cli/src/network-manager.c:102
+msgid "NetworkManager status"
+msgstr "Status do NetworkManager"
+
+#: ../cli/src/network-manager.c:104
+msgid "NM running:"
+msgstr "NM rodando:"
+
+#: ../cli/src/network-manager.c:104
msgid "running"
-msgstr "executando:"
+msgstr "executando"
-#: ../cli/src/network-manager.c:148
+#: ../cli/src/network-manager.c:104
msgid "not running"
-msgstr "não está executando:"
+msgstr "não executando"
-#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233
-#, c-format
-msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s"
-msgstr "Erro: valor do '--fields' '%s' não é válido aqui; campos permitidos: %s"
+#: ../cli/src/network-manager.c:105
+msgid "NM state:"
+msgstr "Estado do NM:"
-#: ../cli/src/network-manager.c:209
-msgid "WiFi enabled"
-msgstr "WiFi ativado"
+#: ../cli/src/network-manager.c:106
+msgid "NM wireless hardware:"
+msgstr "Hardware sem fio do NM:"
-#: ../cli/src/network-manager.c:220
+#. no argument, show current state
+#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143
+msgid "NM wireless:"
+msgstr "NM sem fio:"
+
+#: ../cli/src/network-manager.c:108
+msgid "NM WWAN hardware:"
+msgstr "Hardware NM WWAN:"
+
+#. no argument, show current state
+#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160
+msgid "NM WWAN:"
+msgstr "NM WWAN:"
+
+#: ../cli/src/network-manager.c:150
#, c-format
msgid "Error: invalid 'wifi' parameter: '%s'."
-msgstr "Erro: parâmetro do 'wifi' inválido: '%s'"
+msgstr "Erro: parâmetro \"wifi\" inválido: \"%s\""
-#: ../cli/src/network-manager.c:241
-msgid "WWAN enabled"
-msgstr "WWAN ativado"
-
-#: ../cli/src/network-manager.c:252
+#: ../cli/src/network-manager.c:167
#, c-format
msgid "Error: invalid 'wwan' parameter: '%s'."
-msgstr "Erro: parâmetro 'wwan' inválido: '%s'."
+msgstr "Erro: parâmetro \"wwan\" inválido: \"%s\""
-#: ../cli/src/network-manager.c:263
+#: ../cli/src/network-manager.c:178
#, c-format
msgid "Error: 'nm' command '%s' is not valid."
-msgstr "Erro: comando 'nm' '%s' não é válido."
+msgstr "Erro: comando \"nm %s\" é inválido."
-#: ../cli/src/nmcli.c:69
+#: ../cli/src/nmcli.c:65
#, c-format
msgid ""
"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n"
"\n"
"OPTIONS\n"
-" -t[erse] terse output\n"
-" -p[retty] pretty output\n"
-" -m[ode] tabular|multiline output mode\n"
-" -f[ields] |all|common specify fields to output\n"
-" -e[scape] yes|no escape columns separators in "
-"values\n"
-" -v[ersion] show program version\n"
-" -h[elp] print this help\n"
+" -t[erse] terse output\n"
+" -p[retty] pretty output\n"
+" -v[ersion] show program version\n"
+" -h[elp] print this help\n"
"\n"
"OBJECT\n"
" nm NetworkManager status\n"
@@ -988,187 +824,53 @@ msgid ""
" dev devices managed by NetworkManager\n"
"\n"
msgstr ""
-"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n"
+"Uso: %s [OPÇÕES] OBJETO { COMANDO | help }\n"
"\n"
-"OPTIONS\n"
-" -t[erse] terse output\n"
-" -p[retty] pretty output\n"
-" -m[ode] tabular|multiline output mode\n"
-" -f[ields] |all|common specify fields to output\n"
-" -e[scape] yes|no escape columns separators in "
-"values\n"
-" -v[ersion] show program version\n"
-" -h[elp] print this help\n"
+"OPÇÕES\n"
+" -t[erse] saída concisa\n"
+" -p[retty] saída elegante\n"
+" -v[ersion] mostra a versão do programa\n"
+" -h[elp] imprime esta ajuda\n"
"\n"
-"OBJECT\n"
-" nm NetworkManager status\n"
-" con NetworkManager connections\n"
-" dev devices managed by NetworkManager\n"
+"OBJETO\n"
+" nm Status do NetworkManager\n"
+" con Conexões do NetworkManager\n"
+" dev Dispositivos gerenciados pelo NetworkManager\n"
"\n"
-#: ../cli/src/nmcli.c:113
+#: ../cli/src/nmcli.c:106
#, c-format
-msgid "Error: Object '%s' is unknown, try 'nmcli help'."
-msgstr "Erro: Objeto '%s' é desconhecido, tente o 'nmcli help'."
+msgid "Object '%s' is unknown, try 'nmcli help'."
+msgstr "Objeto \"%s\" é desconhecido, tente \"nmcli help\"."
-#: ../cli/src/nmcli.c:143
-#, c-format
-msgid "Error: Option '--terse' is specified the second time."
-msgstr "Erro: Opção '--terse' está especificada uma segunda vez"
-
-#: ../cli/src/nmcli.c:148
-#, c-format
-msgid "Error: Option '--terse' is mutually exclusive with '--pretty'."
-msgstr "Erro: Opção '--terse'é mutualmente exclusivo com o '--pretty'"
-
-#: ../cli/src/nmcli.c:156
-#, c-format
-msgid "Error: Option '--pretty' is specified the second time."
-msgstr "Erro: Opção '--pretty' está especificado uma segunda vez"
-
-#: ../cli/src/nmcli.c:161
-#, c-format
-msgid "Error: Option '--pretty' is mutually exclusive with '--terse'."
-msgstr "Erro: Opção '--pretty'é mutualmente exclusivo com o '--terse'"
-
-#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187
-#, c-format
-msgid "Error: missing argument for '%s' option."
-msgstr "Erro: argumento está faltando para a opção %s."
-
-#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196
-#, c-format
-msgid "Error: '%s' is not valid argument for '%s' option."
-msgstr "Erro: '%s' não é um argumento válido para a opção '%s'"
-
-#: ../cli/src/nmcli.c:203
-#, c-format
-msgid "Error: fields for '%s' options are missing."
-msgstr "Erro: campos para as opções '%s' estão faltando"
-
-#: ../cli/src/nmcli.c:209
+#: ../cli/src/nmcli.c:139
#, c-format
msgid "nmcli tool, version %s\n"
msgstr "ferramenta nmcli, versão %s\n"
-#: ../cli/src/nmcli.c:215
+#: ../cli/src/nmcli.c:145
#, c-format
-msgid "Error: Option '%s' is unknown, try 'nmcli -help'."
-msgstr "Erro: Opção '%s' é desconhecida, tente 'nmcli help'."
+msgid "Option '%s' is unknown, try 'nmcli -help'."
+msgstr "Opção \"%s\" é desconhecida, tente \"nmcli -help\"."
-#: ../cli/src/nmcli.c:234
+#: ../cli/src/nmcli.c:164
#, c-format
msgid "Caught signal %d, shutting down..."
-msgstr "Obtenção de sinal %d, fechando..."
+msgstr "Sinal capturado %d, desligando..."
-#: ../cli/src/nmcli.c:259
+#: ../cli/src/nmcli.c:189
#, c-format
msgid "Error: Could not connect to NetworkManager."
-msgstr "Erro: Não foi possível conectar ao NetworkManager."
+msgstr "Erro: não foi possível conectar ao NetworkManager."
-#: ../cli/src/nmcli.c:275
+#: ../cli/src/nmcli.c:205
msgid "Success"
msgstr "Sucesso"
-#: ../cli/src/settings.c:407
-#, c-format
-msgid "%d (hex-ascii-key)"
-msgstr "%d (hex-ascii-key)"
-
-#: ../cli/src/settings.c:409
-#, c-format
-msgid "%d (104/128-bit passphrase)"
-msgstr "%d (104/128-bit passphrase)"
-
-#: ../cli/src/settings.c:412
-#, c-format
-msgid "%d (unknown)"
-msgstr "%d (desconhecido)"
-
-#: ../cli/src/settings.c:438
-msgid "0 (unknown)"
-msgstr "0 (desconhecido)"
-
-#: ../cli/src/settings.c:444
-msgid "any, "
-msgstr "qualquer um"
-
-#: ../cli/src/settings.c:446
-msgid "900 MHz, "
-msgstr "900 MHz, "
-
-#: ../cli/src/settings.c:448
-msgid "1800 MHz, "
-msgstr "1800 MHz, "
-
-#: ../cli/src/settings.c:450
-msgid "1900 MHz, "
-msgstr "1900 MHz, "
-
-#: ../cli/src/settings.c:452
-msgid "850 MHz, "
-msgstr "850 MHz, "
-
-#: ../cli/src/settings.c:454
-msgid "WCDMA 3GPP UMTS 2100 MHz, "
-msgstr "WCDMA 3GPP UMTS 2100 MHz, "
-
-#: ../cli/src/settings.c:456
-msgid "WCDMA 3GPP UMTS 1800 MHz, "
-msgstr "WCDMA 3GPP UMTS 1800 MHz, "
-
-#: ../cli/src/settings.c:458
-msgid "WCDMA 3GPP UMTS 1700/2100 MHz, "
-msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, "
-
-#: ../cli/src/settings.c:460
-msgid "WCDMA 3GPP UMTS 800 MHz, "
-msgstr "WCDMA 3GPP UMTS 800 MHz, "
-
-#: ../cli/src/settings.c:462
-msgid "WCDMA 3GPP UMTS 850 MHz, "
-msgstr "WCDMA 3GPP UMTS 850 MHz, "
-
-#: ../cli/src/settings.c:464
-msgid "WCDMA 3GPP UMTS 900 MHz, "
-msgstr "WCDMA 3GPP UMTS 900 MHz, "
-
-#: ../cli/src/settings.c:466
-msgid "WCDMA 3GPP UMTS 1700 MHz, "
-msgstr "WCDMA 3GPP UMTS 1700 MHz, "
-
-#: ../cli/src/settings.c:546 ../cli/src/settings.c:708
-msgid "auto"
-msgstr "auto"
-
-#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172
-msgid "not set"
-msgstr "não definido"
-
-#: ../cli/src/utils.c:124
-#, c-format
-msgid "field '%s' has to be alone"
-msgstr "campo '%s' precisa estar sozinho"
-
-#: ../cli/src/utils.c:127
-#, c-format
-msgid "invalid field '%s'"
-msgstr "campo inválido '%s'"
-
-#: ../cli/src/utils.c:146
-#, c-format
-msgid "Option '--terse' requires specifying '--fields'"
-msgstr "Opção '--terse' requer a especificação de '..fields' "
-
-#: ../cli/src/utils.c:150
-#, c-format
-msgid "Option '--terse' requires specific '--fields' option values , not '%s'"
-msgstr "Opção '--terse' requer que especifique os valores da opção '--fields', e não '%s'"
-
#: ../libnm-util/crypto.c:120
#, c-format
msgid "PEM key file had no end tag '%s'."
-msgstr "A chave do arquivo PEM não tinha a marca de finalização '%s'."
+msgstr "A chave do arquivo PEM não tinha a marca de finalização \"%s\"."
#: ../libnm-util/crypto.c:130
#, c-format
@@ -1270,7 +972,8 @@ msgstr "Não foi possível determinar o tipo da chave privada."
#: ../libnm-util/crypto.c:530
#, c-format
msgid "Not enough memory to store decrypted private key."
-msgstr "Memória insuficiente para armazenar a chave privada de descriptografia."
+msgstr ""
+"Memória insuficiente para armazenar a chave privada de descriptografia."
#: ../libnm-util/crypto_gnutls.c:49
msgid "Failed to initialize the crypto engine."
@@ -1284,7 +987,7 @@ msgstr "Falha ao inicializar o motor MD5: %s / %s."
#: ../libnm-util/crypto_gnutls.c:156
#, c-format
msgid "Invalid IV length (must be at least %zd)."
-msgstr "Comprimento IV inválido (deve ter ao menos %zd)."
+msgstr "Tamanho do IV inválido (tem que ser pelo menos %zd)."
#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188
#, c-format
@@ -1314,7 +1017,9 @@ msgstr "Falha ao descriptografar a chave privada: %s / %s."
#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267
#, c-format
msgid "Failed to decrypt the private key: unexpected padding length."
-msgstr "Falha ao descriptografar a chave privada: comprimento da proteção inesperado."
+msgstr ""
+"Falha ao descriptografar a chave privada: comprimento de preenchimento não "
+"esperado."
#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278
#, c-format
@@ -1329,22 +1034,22 @@ msgstr "Não foi possível alocar memória para criptografia."
#: ../libnm-util/crypto_gnutls.c:294
#, c-format
msgid "Failed to initialize the encryption cipher context: %s / %s."
-msgstr "Falha ao inicializar o contexto da cifra de descriptografia: %s / %s. "
+msgstr "Falha ao inicializar o contexto da cifra de criptografia: %s / %s."
#: ../libnm-util/crypto_gnutls.c:303
#, c-format
msgid "Failed to set symmetric key for encryption: %s / %s."
-msgstr "Falha ao definir chave simétrica para descriptografia: %s / %s. "
+msgstr "Falha ao definir chave simétrica para criptografia: %s / %s."
#: ../libnm-util/crypto_gnutls.c:313
#, c-format
msgid "Failed to set IV for encryption: %s / %s."
-msgstr "Falha ao definir IV para descriptografia: %s / %s. "
+msgstr "Falha ao definir IV para criptografia: %s / %s."
#: ../libnm-util/crypto_gnutls.c:322
#, c-format
msgid "Failed to encrypt the data: %s / %s."
-msgstr "Falha ao descriptografar a chave privada: %s / %s. "
+msgstr "Falha ao criptografar a chave privada: %s / %s."
#: ../libnm-util/crypto_gnutls.c:362
#, c-format
@@ -1384,7 +1089,7 @@ msgstr "Falha ao inicializar o contexto MD5: %d."
#: ../libnm-util/crypto_nss.c:179
#, c-format
msgid "Invalid IV length (must be at least %d)."
-msgstr "Comprimento IV inválido (deve ter ao menos %d)."
+msgstr "Tamanho inválido do IV (tem que ser pelo menos %d)."
#: ../libnm-util/crypto_nss.c:196
#, c-format
@@ -1416,7 +1121,7 @@ msgstr "Falha ao descriptografar a chave privada: %d."
msgid "Failed to decrypt the private key: decrypted data too large."
msgstr ""
"Falha ao descriptografar a chave privada: dados descriptografados muito "
-"grandes."
+"compridos."
#: ../libnm-util/crypto_nss.c:256
#, c-format
@@ -1426,7 +1131,7 @@ msgstr "Falha ao finalizar a descriptografia da chave privada: %d."
#: ../libnm-util/crypto_nss.c:364
#, c-format
msgid "Failed to initialize the encryption cipher slot."
-msgstr "Falha ao inicializar o espaço de cifra de criptografia. "
+msgstr "Falha ao inicializar o espaço de cifra de criptografia."
#: ../libnm-util/crypto_nss.c:372
#, c-format
@@ -1446,12 +1151,12 @@ msgstr "Falha ao inicializar o contexto de criptografia."
#: ../libnm-util/crypto_nss.c:396
#, c-format
msgid "Failed to encrypt: %d."
-msgstr "Falha ao criptografar: %d."
+msgstr "Falha ao criptografar a chave privada: %d."
#: ../libnm-util/crypto_nss.c:404
#, c-format
msgid "Unexpected amount of data after encrypting."
-msgstr "Quantia inesperada de dados após criptografia."
+msgstr "Quantidade de dados inesperados depois da criptografia."
#: ../libnm-util/crypto_nss.c:447
#, c-format
@@ -1482,31 +1187,31 @@ msgstr "Não foi possível verificar o arquivo PKCS#12: %d"
msgid "Could not generate random data."
msgstr "Não foi possível gerar dados aleatórios."
-#: ../libnm-util/nm-utils.c:1925
+#: ../libnm-util/nm-utils.c:1924
#, c-format
msgid "Not enough memory to make encryption key."
-msgstr "Memória insuficiente para criptografar a chave."
+msgstr "Memória insuficiente para criar a chave de criptografia."
-#: ../libnm-util/nm-utils.c:2035
+#: ../libnm-util/nm-utils.c:2034
msgid "Could not allocate memory for PEM file creation."
-msgstr "Não foi possível alocar memória criar arquivo PEM."
+msgstr "Não foi possível alocar memória para criação do arquivo PEM."
-#: ../libnm-util/nm-utils.c:2047
+#: ../libnm-util/nm-utils.c:2046
#, c-format
msgid "Could not allocate memory for writing IV to PEM file."
msgstr "Não foi possível alocar memória para gravar IV no arquivo PEM."
-#: ../libnm-util/nm-utils.c:2059
+#: ../libnm-util/nm-utils.c:2058
#, c-format
msgid "Could not allocate memory for writing encrypted key to PEM file."
msgstr ""
-"Não foi possível alocar memória para gravar chave criptografada no arquivo "
+"Não foi possível alocar memória para gravar a chave criptografada no arquivo "
"PEM."
-#: ../libnm-util/nm-utils.c:2078
+#: ../libnm-util/nm-utils.c:2077
#, c-format
msgid "Could not allocate memory for PEM file data."
-msgstr "Nâo foi possível alocar memória para daods de arquivo PEM."
+msgstr "Não foi possível alocar memória para os dados do arquivo PEM."
#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231
#: ../src/nm-netlink-monitor.c:653
@@ -1521,12 +1226,15 @@ msgstr "ocorreu um erro ao esperar pelos dados da conexão"
#: ../src/nm-netlink-monitor.c:254
#, c-format
msgid "unable to connect to netlink for monitoring link status: %s"
-msgstr "não foi possível conectar ao netlink para monitoração de status do link: %s"
+msgstr ""
+"não foi possível conectar ao netlink para monitoração de status do link: %s"
#: ../src/nm-netlink-monitor.c:265
#, c-format
msgid "unable to enable netlink handle credential passing: %s"
-msgstr "não foi possível ativar o netlink para manipular a passagem da credencial: %s"
+msgstr ""
+"não foi possível habilitar o manipulador de credencial de passagem do "
+"netlink: %s"
#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353
#, c-format
@@ -1545,7 +1253,7 @@ msgstr ""
#: ../src/nm-netlink-monitor.c:502
#, c-format
msgid "unable to join netlink group: %s"
-msgstr "não foi possível associar-se ao grupo do netlink : %s"
+msgstr "não foi possível associar-se ao grupo do netlink: %s"
#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642
#, c-format
@@ -1555,7 +1263,8 @@ msgstr "erro ao atualizar o cache de link: %s"
#: ../src/main.c:502
#, c-format
msgid "Invalid option. Please use --help to see a list of valid options.\n"
-msgstr "Opção inválida. Por favor, use --help para ver uma lista de opções válidas.\n"
+msgstr ""
+"Opção inválida. Por favor, use --help para ver uma lista de opções válidas.\n"
#: ../src/main.c:562
#, c-format
@@ -1577,30 +1286,30 @@ msgstr ""
#: ../src/dhcp-manager/nm-dhcp-manager.c:279
msgid "no usable DHCP client could be found."
-msgstr "Não foi encontrado nenhum cliente DHCP usável."
+msgstr "nenhum cliente DHCP utilizável pôde ser encontrado."
#: ../src/dhcp-manager/nm-dhcp-manager.c:288
msgid "'dhclient' could be found."
-msgstr "'dhclient' não pôde ser encontrado."
+msgstr "\"dhclient\" não pôde ser encontrado."
#: ../src/dhcp-manager/nm-dhcp-manager.c:298
msgid "'dhcpcd' could be found."
-msgstr "Não foi possível encontrar 'dhcpcd'"
+msgstr "\"dhcpd\" não pôde ser encontrado."
#: ../src/dhcp-manager/nm-dhcp-manager.c:306
#, c-format
msgid "unsupported DHCP client '%s'"
-msgstr "Cliente DHCP sem suporte '%s'"
+msgstr "cliente DHCP \"%s\" não suportado"
#: ../src/logging/nm-logging.c:146
#, c-format
msgid "Unknown log level '%s'"
-msgstr "Nível de log desconhecido '%s'"
+msgstr "Nível de registro \"%s\" desconhecido"
#: ../src/logging/nm-logging.c:171
#, c-format
msgid "Unknown log domain '%s'"
-msgstr "Domínio de log desconhecido '%s'"
+msgstr "Domínio de registro \"%s\" desconhecido"
#: ../src/named-manager/nm-named-manager.c:343
msgid "NOTE: the libc resolver may not support more than 3 nameservers."
@@ -1617,21 +1326,21 @@ msgstr "Os servidores de nomes listados abaixo podem não ser reconhecidos."
msgid "Auto %s"
msgstr "Auto %s"
-#: ../system-settings/plugins/ifcfg-rh/reader.c:3256
+#: ../system-settings/plugins/ifcfg-rh/reader.c:3254
msgid "System"
msgstr "Sistema"
#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1
msgid "Connection sharing via a protected WiFi network"
-msgstr "Compartilhamento de conexão via rede WiFi protegida"
+msgstr "Compartilhamento de conexão via rede sem fio protegida"
#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2
msgid "Connection sharing via an open WiFi network"
-msgstr "Compartilhamento de conexão via rede de WiFi aberta"
+msgstr "Compartilhamento de conexão via rede sem fio aberta"
#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3
msgid "Modify persistent system hostname"
-msgstr "Modificar hostname do sistema persistente"
+msgstr "Modificar máquina de sistema persistente"
#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4
msgid "Modify system connections"
@@ -1639,21 +1348,21 @@ msgstr "Modificar conexões de sistema"
#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5
msgid "System policy prevents modification of system settings"
-msgstr "Política de sistema evita modificação de configuração de sistema"
+msgstr "Políticas de sistema previnem modificação das configurações do sistema"
#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6
msgid "System policy prevents modification of the persistent system hostname"
-msgstr "Política de sistema evita modificação de hostname de sistema persistente"
+msgstr ""
+"Políticas de sistema previnem modificação da máquina persistente do sistema"
#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7
msgid "System policy prevents sharing connections via a protected WiFi network"
msgstr ""
-"Política de Sistema evita compartilhamento de conexões via rede de WiFi "
-"protegida."
+"Políticas de sistema previnem compartilhamento de conexões através de uma "
+"rede sem fio protegida"
#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8
msgid "System policy prevents sharing connections via an open WiFi network"
msgstr ""
-"Política de Sistema evita compartilhamento de conexões via rede de WiFi "
-"aberta"
-
+"Políticas de sistema previnem compartilhamento de conexões através de uma "
+"rede sem fio aberta"
diff --git a/policy/Makefile.am b/policy/Makefile.am
index 409e8edda..4778ce230 100644
--- a/policy/Makefile.am
+++ b/policy/Makefile.am
@@ -1,6 +1,9 @@
polkit_policydir = $(datadir)/polkit-1/actions
-dist_polkit_policy_in_files = org.freedesktop.network-manager-settings.system.policy.in
+dist_polkit_policy_in_files = \
+ org.freedesktop.network-manager-settings.system.policy.in \
+ org.freedesktop.NetworkManager.policy.in
+
dist_polkit_policy_DATA = $(dist_polkit_policy_in_files:.policy.in=.policy)
@INTLTOOL_POLICY_RULE@
diff --git a/policy/org.freedesktop.NetworkManager.policy.in b/policy/org.freedesktop.NetworkManager.policy.in
new file mode 100644
index 000000000..e6540655d
--- /dev/null
+++ b/policy/org.freedesktop.NetworkManager.policy.in
@@ -0,0 +1,67 @@
+
+
+
+
+
+ NetworkManager
+ http://www.gnome.org/projects/NetworkManager
+ nm-icon
+
+
+ <_description>Enable or disable system networking
+ <_message>System policy prevents enabling or disabling system networking
+
+ no
+ yes
+
+
+
+
+ <_description>Put NetworkManager to sleep or wake it up (should only be used by system power management)
+ <_message>System policy prevents putting NetworkManager to sleep or waking it up
+
+ no
+ no
+
+
+
+
+ <_description>Enable or disable WiFi devices
+ <_message>System policy prevents enabling or disabling WiFi devices
+
+ no
+ yes
+
+
+
+
+ <_description>Enable or disable mobile broadband devices
+ <_message>System policy prevents enabling or disabling mobile broadband devices
+
+ no
+ yes
+
+
+
+
+ <_description>Allow use of user-specific connections
+ <_message>System policy prevents use of user-specific connections
+
+ no
+ yes
+
+
+
+
+ <_description>Allow control of network connections
+ <_message>System policy prevents control of network connections
+
+ yes
+ yes
+
+
+
+
+
diff --git a/src/Makefile.am b/src/Makefile.am
index 5d2db6e36..9a28751a3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -133,6 +133,8 @@ NetworkManager_SOURCES = \
nm-system.h \
nm-manager.c \
nm-manager.h \
+ nm-manager-auth.c \
+ nm-manager-auth.h \
nm-netlink-monitor.c \
nm-netlink-monitor.h \
nm-activation-request.c \
@@ -211,6 +213,7 @@ NetworkManager_CPPFLAGS = \
$(GUDEV_CFLAGS) \
$(LIBNL_CFLAGS) \
$(GMODULE_CFLAGS) \
+ $(POLKIT_CFLAGS) \
-DG_DISABLE_DEPRECATED \
-DBINDIR=\"$(bindir)\" \
-DSBINDIR=\"$(sbindir)\" \
@@ -242,6 +245,7 @@ NetworkManager_LDADD = \
$(GUDEV_LIBS) \
$(LIBNL_LIBS) \
$(GMODULE_LIBS) \
+ $(POLKIT_LIBS) \
$(LIBM) \
$(LIBDL)
diff --git a/src/dnsmasq-manager/nm-dnsmasq-manager.c b/src/dnsmasq-manager/nm-dnsmasq-manager.c
index ea529c77e..e6c67a1e3 100644
--- a/src/dnsmasq-manager/nm-dnsmasq-manager.c
+++ b/src/dnsmasq-manager/nm-dnsmasq-manager.c
@@ -251,8 +251,9 @@ create_dm_cmd_line (const char *iface,
GString *s;
NMIP4Address *tmp;
struct in_addr addr;
- char buf[INET_ADDRSTRLEN + 1];
+ char buf[INET_ADDRSTRLEN + 15];
char localaddr[INET_ADDRSTRLEN + 1];
+ int i;
dm_binary = nm_find_dnsmasq ();
if (!dm_binary) {
@@ -273,6 +274,21 @@ create_dm_cmd_line (const char *iface,
nm_cmd_line_add_string (cmd, "--log-queries");
}
+ /* dnsmasq may read from it's default config file location, which if that
+ * location is a valid config file, it will combine with the options here
+ * and cause undesirable side-effects. Like sending bogus IP addresses
+ * as the gateway or whatever. So give dnsmasq a bogus config file
+ * location to avoid screwing up the configuration we're passing to it.
+ */
+ memset (buf, 0, sizeof (buf));
+ strcpy (buf, "/tmp/");
+ for (i = 5; i < 15; i++)
+ buf[i] = (char) (g_random_int_range ((guint32) 'a', (guint32) 'z') & 0xFF);
+ strcat (buf, ".conf");
+
+ nm_cmd_line_add_string (cmd, "--conf-file");
+ nm_cmd_line_add_string (cmd, buf);
+
nm_cmd_line_add_string (cmd, "--no-hosts");
nm_cmd_line_add_string (cmd, "--keep-in-foreground");
nm_cmd_line_add_string (cmd, "--bind-interfaces");
diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c
index 5af9ec5f5..ce79664a8 100644
--- a/src/nm-device-ethernet.c
+++ b/src/nm-device-ethernet.c
@@ -1449,8 +1449,6 @@ real_deactivate_quickly (NMDevice *device)
{
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device);
- nm_device_set_ip_iface (device, NULL);
-
if (priv->pending_ip4_config) {
g_object_unref (priv->pending_ip4_config);
priv->pending_ip4_config = NULL;
diff --git a/src/nm-device-interface.c b/src/nm-device-interface.c
index bbc54a862..a0b9877bc 100644
--- a/src/nm-device-interface.c
+++ b/src/nm-device-interface.c
@@ -19,6 +19,8 @@
* Copyright (C) 2007 - 2010 Red Hat, Inc.
*/
+#include
+
#include "nm-marshal.h"
#include "nm-setting-connection.h"
#include "nm-device-interface.h"
@@ -26,8 +28,8 @@
#include "nm-properties-changed-signal.h"
#include "nm-rfkill.h"
-static gboolean impl_device_disconnect (NMDeviceInterface *device,
- GError **error);
+static void impl_device_disconnect (NMDeviceInterface *device,
+ DBusGMethodInvocation *context);
#include "nm-device-interface-glue.h"
@@ -88,7 +90,15 @@ nm_device_interface_init (gpointer g_iface)
"Interface",
"Interface",
NULL,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+
+ g_object_interface_install_property
+ (g_iface,
+ g_param_spec_string (NM_DEVICE_INTERFACE_IP_IFACE,
+ "IP Interface",
+ "IP Interface",
+ NULL,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_interface_install_property
(g_iface,
@@ -211,6 +221,13 @@ nm_device_interface_init (gpointer g_iface)
G_TYPE_NONE, 3,
G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT);
+ g_signal_new (NM_DEVICE_INTERFACE_DISCONNECT_REQUEST,
+ iface_type,
+ G_SIGNAL_RUN_FIRST,
+ 0, NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE, 1, G_TYPE_POINTER);
+
dbus_g_object_type_install_info (iface_type,
&dbus_glib_nm_device_interface_object_info);
@@ -334,11 +351,11 @@ nm_device_interface_disconnect (NMDeviceInterface *device,
return success;
}
-static gboolean
+static void
impl_device_disconnect (NMDeviceInterface *device,
- GError **error)
+ DBusGMethodInvocation *context)
{
- return nm_device_interface_disconnect (device, error);
+ g_signal_emit_by_name (device, NM_DEVICE_INTERFACE_DISCONNECT_REQUEST, context);
}
void
diff --git a/src/nm-device-interface.h b/src/nm-device-interface.h
index ea152602e..0d8772dfc 100644
--- a/src/nm-device-interface.h
+++ b/src/nm-device-interface.h
@@ -45,8 +45,11 @@ typedef enum
#define NM_DEVICE_INTERFACE_ERROR (nm_device_interface_error_quark ())
#define NM_TYPE_DEVICE_INTERFACE_ERROR (nm_device_interface_error_get_type ())
+#define NM_DEVICE_INTERFACE_DISCONNECT_REQUEST "disconnect-request"
+
#define NM_DEVICE_INTERFACE_UDI "udi"
#define NM_DEVICE_INTERFACE_IFACE "interface"
+#define NM_DEVICE_INTERFACE_IP_IFACE "ip-interface"
#define NM_DEVICE_INTERFACE_DRIVER "driver"
#define NM_DEVICE_INTERFACE_CAPABILITIES "capabilities"
#define NM_DEVICE_INTERFACE_IP4_ADDRESS "ip4-address"
@@ -67,6 +70,7 @@ typedef enum {
NM_DEVICE_INTERFACE_PROP_UDI = NM_DEVICE_INTERFACE_PROP_FIRST,
NM_DEVICE_INTERFACE_PROP_IFACE,
+ NM_DEVICE_INTERFACE_PROP_IP_IFACE,
NM_DEVICE_INTERFACE_PROP_DRIVER,
NM_DEVICE_INTERFACE_PROP_CAPABILITIES,
NM_DEVICE_INTERFACE_PROP_IP4_ADDRESS,
diff --git a/src/nm-device.c b/src/nm-device.c
index fcd312053..01874c5fd 100644
--- a/src/nm-device.c
+++ b/src/nm-device.c
@@ -388,11 +388,12 @@ void
nm_device_set_ip_iface (NMDevice *self, const char *iface)
{
NMDevicePrivate *priv;
+ char *old_ip_iface;
g_return_if_fail (NM_IS_DEVICE (self));
priv = NM_DEVICE_GET_PRIVATE (self);
- g_free (priv->ip_iface);
+ old_ip_iface = priv->ip_iface;
priv->ip_ifindex = 0;
priv->ip_iface = g_strdup (iface);
@@ -402,6 +403,11 @@ nm_device_set_ip_iface (NMDevice *self, const char *iface)
nm_log_warn (LOGD_HW, "(%s): failed to look up interface index", iface);
}
}
+
+ /* Emit change notification */
+ if (g_strcmp0 (old_ip_iface, priv->ip_iface))
+ g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_IP_IFACE);
+ g_free (old_ip_iface);
}
@@ -1019,6 +1025,7 @@ aipd_get_ip4_config (NMDevice *self, NMDeviceStateReason *reason)
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
NMIP4Config *config = NULL;
NMIP4Address *addr;
+ NMIP4Route *route;
g_return_val_if_fail (priv->aipd_addr > 0, NULL);
@@ -1033,6 +1040,14 @@ aipd_get_ip4_config (NMDevice *self, NMDeviceStateReason *reason)
nm_ip4_address_set_prefix (addr, 16);
nm_ip4_config_take_address (config, addr);
+ /* Add a multicast route for link-local connections: destination= 224.0.0.0, netmask=240.0.0.0 */
+ route = nm_ip4_route_new ();
+ nm_ip4_route_set_dest (route, (guint32) htonl (0xE0000000L));
+ nm_ip4_route_set_prefix (route, 4);
+ nm_ip4_route_set_next_hop (route, (guint32) 0);
+ nm_ip4_route_set_metric (route, 0);
+ nm_ip4_config_take_route (config, route);
+
return config;
}
@@ -2737,6 +2752,8 @@ nm_device_deactivate_quickly (NMDevice *self)
dnsmasq_cleanup (self);
aipd_cleanup (self);
+ nm_device_set_ip_iface (self, NULL);
+
/* Turn off router advertisements until they are needed */
if (priv->ip6_accept_ra_path)
nm_utils_do_sysctl (priv->ip6_accept_ra_path, "0\n");
@@ -3378,6 +3395,8 @@ set_property (GObject *object, guint prop_id,
}
}
break;
+ case NM_DEVICE_INTERFACE_PROP_IP_IFACE:
+ break;
case NM_DEVICE_INTERFACE_PROP_DRIVER:
priv->driver = g_strdup (g_value_get_string (value));
break;
@@ -3427,6 +3446,12 @@ get_property (GObject *object, guint prop_id,
case NM_DEVICE_INTERFACE_PROP_IFACE:
g_value_set_string (value, priv->iface);
break;
+ case NM_DEVICE_INTERFACE_PROP_IP_IFACE:
+ if ((state == NM_DEVICE_STATE_ACTIVATED) || (state == NM_DEVICE_STATE_IP_CONFIG))
+ g_value_set_string (value, nm_device_get_ip_iface (self));
+ else
+ g_value_set_string (value, NULL);
+ break;
case NM_DEVICE_INTERFACE_PROP_IFINDEX:
g_value_set_int (value, priv->ifindex);
break;
@@ -3531,6 +3556,10 @@ nm_device_class_init (NMDeviceClass *klass)
NM_DEVICE_INTERFACE_PROP_IFACE,
NM_DEVICE_INTERFACE_IFACE);
+ g_object_class_override_property (object_class,
+ NM_DEVICE_INTERFACE_PROP_IP_IFACE,
+ NM_DEVICE_INTERFACE_IP_IFACE);
+
g_object_class_override_property (object_class,
NM_DEVICE_INTERFACE_PROP_IFINDEX,
NM_DEVICE_INTERFACE_IFINDEX);
diff --git a/src/nm-manager-auth.c b/src/nm-manager-auth.c
new file mode 100644
index 000000000..5bd480f38
--- /dev/null
+++ b/src/nm-manager-auth.c
@@ -0,0 +1,402 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager -- Network link manager
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Copyright (C) 2010 Red Hat, Inc.
+ */
+
+#include "nm-manager-auth.h"
+#include "nm-logging.h"
+
+#include
+#include
+
+struct NMAuthChain {
+ guint32 refcount;
+ PolkitAuthority *authority;
+ GSList *calls;
+ GHashTable *data;
+
+ DBusGMethodInvocation *context;
+ char *owner;
+ GError *error;
+
+ NMAuthChainResultFunc done_func;
+ NMAuthChainCallFunc call_func;
+ gpointer user_data;
+};
+
+typedef struct {
+ NMAuthChain *chain;
+ GCancellable *cancellable;
+ char *permission;
+ gboolean disposed;
+} PolkitCall;
+
+typedef struct {
+ gpointer data;
+ GDestroyNotify destroy;
+} ChainData;
+
+static void
+free_data (gpointer data)
+{
+ ChainData *tmp = data;
+
+ if (tmp->destroy)
+ tmp->destroy (tmp->data);
+ memset (tmp, 0, sizeof (ChainData));
+ g_free (tmp);
+}
+
+static void
+default_call_func (NMAuthChain *chain,
+ const char *permission,
+ GError *error,
+ NMAuthCallResult result,
+ gpointer user_data)
+{
+ if (!error)
+ nm_auth_chain_set_data (chain, permission, GUINT_TO_POINTER (result), NULL);
+}
+
+NMAuthChain *
+nm_auth_chain_new (PolkitAuthority *authority,
+ DBusGMethodInvocation *context,
+ DBusGProxy *proxy,
+ NMAuthChainResultFunc done_func,
+ gpointer user_data)
+{
+ NMAuthChain *self;
+
+ g_return_val_if_fail (context || proxy, NULL);
+
+ self = g_malloc0 (sizeof (NMAuthChain));
+ self->refcount = 1;
+ self->authority = g_object_ref (authority);
+ self->data = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, free_data);
+ self->done_func = done_func;
+ self->call_func = /* call_func ? call_func : */ default_call_func;
+ self->user_data = user_data;
+ self->context = context;
+
+ if (proxy)
+ self->owner = g_strdup (dbus_g_proxy_get_bus_name (proxy));
+ else if (context)
+ self->owner = dbus_g_method_get_sender (context);
+
+ if (!self->owner) {
+ /* Need an owner */
+ g_warn_if_fail (self->owner);
+ nm_auth_chain_unref (self);
+ self = NULL;
+ }
+
+ return self;
+}
+
+gpointer
+nm_auth_chain_get_data (NMAuthChain *self, const char *tag)
+{
+ ChainData *tmp;
+
+ g_return_val_if_fail (self != NULL, NULL);
+ g_return_val_if_fail (tag != NULL, NULL);
+
+ tmp = g_hash_table_lookup (self->data, tag);
+ return tmp ? tmp->data : NULL;
+}
+
+void
+nm_auth_chain_set_data (NMAuthChain *self,
+ const char *tag,
+ gpointer data,
+ GDestroyNotify data_destroy)
+{
+ ChainData *tmp;
+
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (tag != NULL);
+
+ if (data == NULL)
+ g_hash_table_remove (self->data, tag);
+ else {
+ tmp = g_malloc0 (sizeof (ChainData));
+ tmp->data = data;
+ tmp->destroy = data_destroy;
+
+ g_hash_table_insert (self->data, g_strdup (tag), tmp);
+ }
+}
+
+static void
+nm_auth_chain_check_done (NMAuthChain *self)
+{
+ g_return_if_fail (self != NULL);
+
+ if (g_slist_length (self->calls) == 0) {
+ /* Ensure we say alive across the callback */
+ self->refcount++;
+ self->done_func (self, self->error, self->context, self->user_data);
+ nm_auth_chain_unref (self);
+ }
+}
+
+static void
+polkit_call_cancel (PolkitCall *call)
+{
+ call->disposed = TRUE;
+ g_cancellable_cancel (call->cancellable);
+}
+
+static void
+polkit_call_free (PolkitCall *call)
+{
+ g_return_if_fail (call != NULL);
+
+ call->disposed = TRUE;
+ g_free (call->permission);
+ call->permission = NULL;
+ call->chain = NULL;
+ g_object_unref (call->cancellable);
+ call->cancellable = NULL;
+ g_free (call);
+}
+
+static void
+pk_call_cb (GObject *object, GAsyncResult *result, gpointer user_data)
+{
+ PolkitCall *call = user_data;
+ NMAuthChain *chain;
+ PolkitAuthorizationResult *pk_result;
+ GError *error = NULL;
+ guint call_result = NM_AUTH_CALL_RESULT_UNKNOWN;
+
+ /* If the call is already disposed do nothing */
+ if (call->disposed) {
+ polkit_call_free (call);
+ return;
+ }
+
+ chain = call->chain;
+ chain->calls = g_slist_remove (chain->calls, call);
+
+ pk_result = polkit_authority_check_authorization_finish (chain->authority,
+ result,
+ &error);
+ if (error) {
+ if (!chain->error)
+ chain->error = g_error_copy (error);
+
+ nm_log_warn (LOGD_CORE, "error requesting auth for %s: (%d) %s",
+ call->permission,
+ error ? error->code : -1,
+ error && error->message ? error->message : "(unknown)");
+ } else {
+ if (polkit_authorization_result_get_is_authorized (pk_result)) {
+ /* Caller has the permission */
+ call_result = NM_AUTH_CALL_RESULT_YES;
+ } else if (polkit_authorization_result_get_is_challenge (pk_result)) {
+ /* Caller could authenticate to get the permission */
+ call_result = NM_AUTH_CALL_RESULT_AUTH;
+ } else
+ call_result = NM_AUTH_CALL_RESULT_NO;
+ }
+
+ chain->call_func (chain, call->permission, error, call_result, chain->user_data);
+ nm_auth_chain_check_done (chain);
+
+ g_clear_error (&error);
+ polkit_call_free (call);
+ if (pk_result)
+ g_object_unref (pk_result);
+}
+
+gboolean
+nm_auth_chain_add_call (NMAuthChain *self,
+ const char *permission,
+ gboolean allow_interaction)
+{
+ PolkitCall *call;
+ PolkitSubject *subject;
+ PolkitCheckAuthorizationFlags flags = POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE;
+
+ g_return_val_if_fail (self != NULL, FALSE);
+ g_return_val_if_fail (self->owner != NULL, FALSE);
+ g_return_val_if_fail (permission != NULL, FALSE);
+
+ subject = polkit_system_bus_name_new (self->owner);
+ if (!subject)
+ return FALSE;
+
+ call = g_malloc0 (sizeof (PolkitCall));
+ call->chain = self;
+ call->permission = g_strdup (permission);
+ call->cancellable = g_cancellable_new ();
+
+ self->calls = g_slist_append (self->calls, call);
+
+ if (allow_interaction)
+ flags = POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION;
+
+ polkit_authority_check_authorization (self->authority,
+ subject,
+ permission,
+ NULL,
+ flags,
+ call->cancellable,
+ pk_call_cb,
+ call);
+ g_object_unref (subject);
+ return TRUE;
+}
+
+void
+nm_auth_chain_unref (NMAuthChain *self)
+{
+ GSList *iter;
+
+ g_return_if_fail (self != NULL);
+
+ self->refcount--;
+ if (self->refcount > 0)
+ return;
+
+ g_object_unref (self->authority);
+ g_free (self->owner);
+
+ for (iter = self->calls; iter; iter = g_slist_next (iter))
+ polkit_call_cancel ((PolkitCall *) iter->data);
+ g_slist_free (self->calls);
+
+ g_clear_error (&self->error);
+ g_hash_table_destroy (self->data);
+
+ memset (self, 0, sizeof (NMAuthChain));
+ g_free (self);
+}
+
+/************ utils **************/
+
+gboolean
+nm_auth_get_caller_uid (DBusGMethodInvocation *context,
+ NMDBusManager *dbus_mgr,
+ gulong *out_uid,
+ const char **out_error_desc)
+{
+ DBusConnection *connection;
+ char *sender = NULL;
+ gboolean success = FALSE;
+ DBusError dbus_error;
+
+ g_return_val_if_fail (context != NULL, FALSE);
+ g_return_val_if_fail (dbus_mgr != NULL, FALSE);
+ g_return_val_if_fail (out_uid != NULL, FALSE);
+
+ *out_uid = G_MAXULONG;
+
+ sender = dbus_g_method_get_sender (context);
+ if (!sender) {
+ if (out_error_desc)
+ *out_error_desc = "Could not determine D-Bus requestor";
+ goto out;
+ }
+
+ connection = nm_dbus_manager_get_dbus_connection (dbus_mgr);
+ if (!connection) {
+ if (out_error_desc)
+ *out_error_desc = "Could not get the D-Bus system bus";
+ goto out;
+ }
+
+ dbus_error_init (&dbus_error);
+ /* FIXME: do this async */
+ *out_uid = dbus_bus_get_unix_user (connection, sender, &dbus_error);
+ if (dbus_error_is_set (&dbus_error)) {
+ if (out_error_desc)
+ *out_error_desc = "Could not determine the user ID of the requestor";
+ dbus_error_free (&dbus_error);
+ *out_uid = G_MAXULONG;
+ } else
+ success = TRUE;
+
+out:
+ g_free (sender);
+ return success;
+}
+
+gboolean
+nm_auth_uid_authorized (gulong uid,
+ NMDBusManager *dbus_mgr,
+ DBusGProxy *user_proxy,
+ const char **out_error_desc)
+{
+ DBusConnection *connection;
+ DBusError dbus_error;
+ char *service_owner = NULL;
+ const char *service_name;
+ gulong service_uid = G_MAXULONG;
+
+ g_return_val_if_fail (dbus_mgr != NULL, FALSE);
+ g_return_val_if_fail (out_error_desc != NULL, FALSE);
+
+ /* Ensure the request to activate the user connection came from the
+ * same session as the user settings service. FIXME: use ConsoleKit
+ * too.
+ */
+
+ if (!user_proxy) {
+ *out_error_desc = "No user settings service available";
+ return FALSE;
+ }
+
+ service_name = dbus_g_proxy_get_bus_name (user_proxy);
+ if (!service_name) {
+ *out_error_desc = "Could not determine user settings service name";
+ return FALSE;
+ }
+
+ connection = nm_dbus_manager_get_dbus_connection (dbus_mgr);
+ if (!connection) {
+ *out_error_desc = "Could not get the D-Bus system bus";
+ return FALSE;
+ }
+
+ service_owner = nm_dbus_manager_get_name_owner (dbus_mgr, service_name, NULL);
+ if (!service_owner) {
+ *out_error_desc = "Could not determine D-Bus owner of the user settings service";
+ return FALSE;
+ }
+
+ dbus_error_init (&dbus_error);
+ service_uid = dbus_bus_get_unix_user (connection, service_owner, &dbus_error);
+ g_free (service_owner);
+
+ if (dbus_error_is_set (&dbus_error)) {
+ dbus_error_free (&dbus_error);
+ *out_error_desc = "Could not determine the Unix UID of the sender of the request";
+ return FALSE;
+ }
+
+ /* And finally, the actual UID check */
+ if (uid != service_uid) {
+ *out_error_desc = "Requestor UID does not match the UID of the user settings service";
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
diff --git a/src/nm-manager-auth.h b/src/nm-manager-auth.h
new file mode 100644
index 000000000..dab32b0f5
--- /dev/null
+++ b/src/nm-manager-auth.h
@@ -0,0 +1,89 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager -- Network link manager
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Copyright (C) 2010 Red Hat, Inc.
+ */
+
+#ifndef NM_MANAGER_AUTH_H
+#define NM_MANAGER_AUTH_H
+
+#include
+#include
+#include
+
+#include "nm-dbus-manager.h"
+
+#define NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK "org.freedesktop.NetworkManager.enable-disable-network"
+#define NM_AUTH_PERMISSION_SLEEP_WAKE "org.freedesktop.NetworkManager.sleep-wake"
+#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI "org.freedesktop.NetworkManager.enable-disable-wifi"
+#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN "org.freedesktop.NetworkManager.enable-disable-wwan"
+#define NM_AUTH_PERMISSION_USE_USER_CONNECTIONS "org.freedesktop.NetworkManager.use-user-connections"
+#define NM_AUTH_PERMISSION_NETWORK_CONTROL "org.freedesktop.NetworkManager.network-control"
+
+
+typedef struct NMAuthChain NMAuthChain;
+
+typedef enum {
+ NM_AUTH_CALL_RESULT_UNKNOWN,
+ NM_AUTH_CALL_RESULT_YES,
+ NM_AUTH_CALL_RESULT_AUTH,
+ NM_AUTH_CALL_RESULT_NO,
+} NMAuthCallResult;
+
+typedef void (*NMAuthChainResultFunc) (NMAuthChain *chain,
+ GError *error,
+ DBusGMethodInvocation *context,
+ gpointer user_data);
+
+typedef void (*NMAuthChainCallFunc) (NMAuthChain *chain,
+ const char *permission,
+ GError *error,
+ NMAuthCallResult result,
+ gpointer user_data);
+
+NMAuthChain *nm_auth_chain_new (PolkitAuthority *authority,
+ DBusGMethodInvocation *context,
+ DBusGProxy *proxy,
+ NMAuthChainResultFunc done_func,
+ gpointer user_data);
+
+gpointer nm_auth_chain_get_data (NMAuthChain *chain, const char *tag);
+
+void nm_auth_chain_set_data (NMAuthChain *chain,
+ const char *tag,
+ gpointer data,
+ GDestroyNotify data_destroy);
+
+gboolean nm_auth_chain_add_call (NMAuthChain *chain,
+ const char *permission,
+ gboolean allow_interaction);
+
+void nm_auth_chain_unref (NMAuthChain *chain);
+
+/* Utils */
+gboolean nm_auth_get_caller_uid (DBusGMethodInvocation *context,
+ NMDBusManager *dbus_mgr,
+ gulong *out_uid,
+ const char **out_error_desc);
+
+gboolean nm_auth_uid_authorized (gulong uid,
+ NMDBusManager *dbus_mgr,
+ DBusGProxy *user_proxy,
+ const char **out_error_desc);
+
+#endif /* NM_MANAGER_AUTH_H */
+
diff --git a/src/nm-manager.c b/src/nm-manager.c
index 1bc9e5a46..31628f876 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -54,25 +54,33 @@
#include "nm-secrets-provider-interface.h"
#include "nm-settings-interface.h"
#include "nm-settings-system-interface.h"
+#include "nm-manager-auth.h"
#define NM_AUTOIP_DBUS_SERVICE "org.freedesktop.nm_avahi_autoipd"
#define NM_AUTOIP_DBUS_IFACE "org.freedesktop.nm_avahi_autoipd"
static gboolean impl_manager_get_devices (NMManager *manager, GPtrArray **devices, GError **err);
static void impl_manager_activate_connection (NMManager *manager,
- const char *service_name,
- const char *connection_path,
- const char *device_path,
- const char *specific_object_path,
- DBusGMethodInvocation *context);
+ const char *service_name,
+ const char *connection_path,
+ const char *device_path,
+ const char *specific_object_path,
+ DBusGMethodInvocation *context);
-static gboolean impl_manager_deactivate_connection (NMManager *manager,
- const char *connection_path,
- GError **error);
+static void impl_manager_deactivate_connection (NMManager *manager,
+ const char *connection_path,
+ DBusGMethodInvocation *context);
-static gboolean impl_manager_sleep (NMManager *manager, gboolean sleep, GError **err);
+static void impl_manager_sleep (NMManager *manager,
+ gboolean do_sleep,
+ DBusGMethodInvocation *context);
-static gboolean impl_manager_enable (NMManager *manager, gboolean enable, GError **err);
+static void impl_manager_enable (NMManager *manager,
+ gboolean enable,
+ DBusGMethodInvocation *context);
+
+static void impl_manager_get_permissions (NMManager *manager,
+ DBusGMethodInvocation *context);
static gboolean impl_manager_set_logging (NMManager *manager,
const char *level,
@@ -81,14 +89,12 @@ static gboolean impl_manager_set_logging (NMManager *manager,
/* Legacy 0.6 compatibility interface */
-static gboolean impl_manager_legacy_sleep (NMManager *manager, GError **err);
-static gboolean impl_manager_legacy_wake (NMManager *manager, GError **err);
+static void impl_manager_legacy_sleep (NMManager *manager, DBusGMethodInvocation *context);
+static void impl_manager_legacy_wake (NMManager *manager, DBusGMethodInvocation *context);
static gboolean impl_manager_legacy_state (NMManager *manager, guint32 *state, GError **err);
#include "nm-manager-glue.h"
-static void user_destroy_connections (NMManager *manager);
-
static void connection_added_default_handler (NMManager *manager,
NMConnection *connection,
NMConnectionScope scope);
@@ -141,14 +147,27 @@ static NMDevice *nm_manager_get_device_by_udi (NMManager *manager, const char *u
#define SSD_POKE_INTERVAL 120
#define ORIGDEV_TAG "originating-device"
-typedef struct {
+typedef struct PendingActivation PendingActivation;
+typedef void (*PendingActivationFunc) (PendingActivation *pending,
+ GError *error);
+
+struct PendingActivation {
+ NMManager *manager;
+
DBusGMethodInvocation *context;
+ PolkitAuthority *authority;
+ PendingActivationFunc callback;
+ NMAuthChain *chain;
+
+ gboolean have_connection;
+ gboolean authorized;
+
NMConnectionScope scope;
char *connection_path;
char *specific_object_path;
char *device_path;
guint timeout_id;
-} PendingConnectionInfo;
+};
typedef struct {
gboolean enabled;
@@ -174,6 +193,8 @@ typedef struct {
GHashTable *user_connections;
DBusGProxy *user_proxy;
+ NMAuthCallResult user_con_perm;
+ NMAuthCallResult user_net_perm;
GHashTable *system_connections;
NMSysconfigSettings *sys_settings;
@@ -181,7 +202,7 @@ typedef struct {
GSList *secrets_calls;
- PendingConnectionInfo *pending_connection_info;
+ GSList *pending_activations;
RadioState radio_states[RFKILL_TYPE_MAX];
gboolean sleeping;
@@ -196,6 +217,10 @@ typedef struct {
DBusGProxy *aipd_proxy;
+ PolkitAuthority *authority;
+ guint auth_changed_id;
+ GSList *auth_chains;
+
gboolean disposed;
} NMManagerPrivate;
@@ -215,6 +240,8 @@ enum {
CONNECTION_ADDED,
CONNECTION_UPDATED,
CONNECTION_REMOVED,
+ CHECK_PERMISSIONS,
+ USER_PERMISSIONS_CHANGED,
LAST_SIGNAL
};
@@ -560,19 +587,237 @@ emit_removed (gpointer key, gpointer value, gpointer user_data)
}
static void
-pending_connection_info_destroy (PendingConnectionInfo *info)
+nm_manager_pending_activation_remove (NMManager *self,
+ PendingActivation *pending)
{
- if (!info)
+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
+
+ priv->pending_activations = g_slist_remove (priv->pending_activations, pending);
+}
+
+static PendingActivation *
+pending_activation_new (NMManager *manager,
+ PolkitAuthority *authority,
+ DBusGMethodInvocation *context,
+ const char *device_path,
+ NMConnectionScope scope,
+ const char *connection_path,
+ const char *specific_object_path,
+ PendingActivationFunc callback)
+{
+ PendingActivation *pending;
+
+ g_return_val_if_fail (manager != NULL, NULL);
+ g_return_val_if_fail (authority != NULL, NULL);
+ g_return_val_if_fail (context != NULL, NULL);
+ g_return_val_if_fail (device_path != NULL, NULL);
+ g_return_val_if_fail (connection_path != NULL, NULL);
+
+ pending = g_slice_new0 (PendingActivation);
+ pending->manager = manager;
+ pending->authority = authority;
+ pending->context = context;
+ pending->callback = callback;
+
+ pending->device_path = g_strdup (device_path);
+ pending->scope = scope;
+ pending->connection_path = g_strdup (connection_path);
+
+ /* "/" is special-cased to NULL to get through D-Bus */
+ if (specific_object_path && strcmp (specific_object_path, "/"))
+ pending->specific_object_path = g_strdup (specific_object_path);
+
+ return pending;
+}
+
+static void
+pending_auth_user_done (NMAuthChain *chain,
+ GError *error,
+ DBusGMethodInvocation *context,
+ gpointer user_data)
+{
+ PendingActivation *pending = user_data;
+ NMAuthCallResult result;
+
+ pending->chain = NULL;
+
+ if (error) {
+ pending->callback (pending, error);
+ goto out;
+ }
+
+ /* Caller has had a chance to obtain authorization, so we only need to
+ * check for 'yes' here.
+ */
+ result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS));
+ if (result != NM_AUTH_CALL_RESULT_YES) {
+ error = g_error_new_literal (NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_PERMISSION_DENIED,
+ "Not authorized to use user connections.");
+ pending->callback (pending, error);
+ g_error_free (error);
+ } else
+ pending->callback (pending, NULL);
+
+out:
+ nm_auth_chain_unref (chain);
+}
+
+static void
+pending_auth_net_done (NMAuthChain *chain,
+ GError *error,
+ DBusGMethodInvocation *context,
+ gpointer user_data)
+{
+ PendingActivation *pending = user_data;
+ NMAuthCallResult result;
+
+ pending->chain = NULL;
+
+ if (error) {
+ pending->callback (pending, error);
+ goto out;
+ }
+
+ /* Caller has had a chance to obtain authorization, so we only need to
+ * check for 'yes' here.
+ */
+ result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL));
+ if (result != NM_AUTH_CALL_RESULT_YES) {
+ error = g_error_new_literal (NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_PERMISSION_DENIED,
+ "Not authorized to control networking.");
+ pending->callback (pending, error);
+ g_error_free (error);
+ goto out;
+ }
+
+ if (pending->scope == NM_CONNECTION_SCOPE_SYSTEM) {
+ /* System connection and the user is authorized for that if they have
+ * the network-control permission.
+ */
+ pending->callback (pending, NULL);
+ } else {
+ g_assert (pending->scope == NM_CONNECTION_SCOPE_USER);
+
+ /* User connection, check the 'use-user-connections' permission */
+ pending->chain = nm_auth_chain_new (pending->authority,
+ pending->context,
+ NULL,
+ pending_auth_user_done,
+ pending);
+ nm_auth_chain_add_call (pending->chain,
+ NM_AUTH_PERMISSION_USE_USER_CONNECTIONS,
+ TRUE);
+ }
+
+out:
+ nm_auth_chain_unref (chain);
+}
+
+static gboolean
+check_user_authorized (NMDBusManager *dbus_mgr,
+ DBusGProxy *user_proxy,
+ DBusGMethodInvocation *context,
+ NMConnectionScope scope,
+ gulong *out_sender_uid,
+ const char **out_error_desc)
+{
+ g_return_val_if_fail (dbus_mgr != NULL, FALSE);
+ g_return_val_if_fail (context != NULL, FALSE);
+ g_return_val_if_fail (out_sender_uid != NULL, FALSE);
+ g_return_val_if_fail (out_error_desc != NULL, FALSE);
+
+ *out_sender_uid = G_MAXULONG;
+
+ /* Get the UID */
+ if (!nm_auth_get_caller_uid (context, dbus_mgr, out_sender_uid, out_error_desc))
+ return FALSE;
+
+ /* root gets to do anything */
+ if (0 == *out_sender_uid)
+ return TRUE;
+
+ /* Check whether the UID is authorized for user connections */
+ if ( scope == NM_CONNECTION_SCOPE_USER
+ && !nm_auth_uid_authorized (*out_sender_uid,
+ dbus_mgr,
+ user_proxy,
+ out_error_desc))
+ return FALSE;
+
+ return TRUE;
+}
+
+static void
+pending_activation_check_authorized (PendingActivation *pending,
+ NMDBusManager *dbus_mgr,
+ DBusGProxy *user_proxy)
+{
+ const char *error_desc = NULL;
+ gulong sender_uid = G_MAXULONG;
+ GError *error;
+
+ g_return_if_fail (pending != NULL);
+ g_return_if_fail (dbus_mgr != NULL);
+
+ if (!check_user_authorized (dbus_mgr,
+ user_proxy,
+ pending->context,
+ pending->scope,
+ &sender_uid,
+ &error_desc)) {
+ error = g_error_new_literal (NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_PERMISSION_DENIED,
+ error_desc);
+ pending->callback (pending, error);
+ g_error_free (error);
return;
+ }
- if (info->timeout_id)
- g_source_remove (info->timeout_id);
+ /* Yay for root */
+ if (0 == sender_uid) {
+ pending->callback (pending, NULL);
+ return;
+ }
- g_free (info->connection_path);
- g_free (info->specific_object_path);
- g_free (info->device_path);
+ /* First check if the user is allowed to use networking at all, giving
+ * the user a chance to authenticate to gain the permission.
+ */
+ pending->chain = nm_auth_chain_new (pending->authority,
+ pending->context,
+ NULL,
+ pending_auth_net_done,
+ pending);
+ g_assert (pending->chain);
+ nm_auth_chain_add_call (pending->chain,
+ NM_AUTH_PERMISSION_NETWORK_CONTROL,
+ TRUE);
+}
- g_slice_free (PendingConnectionInfo, info);
+static void
+pending_activation_destroy (PendingActivation *pending,
+ GError *error,
+ const char *ac_path)
+{
+ g_return_if_fail (pending != NULL);
+
+ if (pending->timeout_id)
+ g_source_remove (pending->timeout_id);
+ g_free (pending->connection_path);
+ g_free (pending->specific_object_path);
+ g_free (pending->device_path);
+
+ if (error)
+ dbus_g_method_return_error (pending->context, error);
+ else if (ac_path)
+ dbus_g_method_return (pending->context, ac_path);
+
+ if (pending->chain)
+ nm_auth_chain_unref (pending->chain);
+
+ memset (pending, 0, sizeof (PendingActivation));
+ g_slice_free (PendingActivation, pending);
}
static GPtrArray *
@@ -632,19 +877,27 @@ remove_connection (NMManager *manager,
/*******************************************************************/
static void
-user_destroy_connections (NMManager *manager)
+user_proxy_cleanup (NMManager *self, gboolean resync_bt)
{
- NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager);
+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
if (priv->user_connections) {
- g_hash_table_foreach (priv->user_connections, emit_removed, manager);
+ g_hash_table_foreach (priv->user_connections, emit_removed, self);
g_hash_table_remove_all (priv->user_connections);
}
+ priv->user_net_perm = NM_AUTH_CALL_RESULT_UNKNOWN;
+ priv->user_con_perm = NM_AUTH_CALL_RESULT_UNKNOWN;
+
if (priv->user_proxy) {
g_object_unref (priv->user_proxy);
priv->user_proxy = NULL;
}
+
+ if (resync_bt) {
+ /* Resync BT devices since they are generated from connections */
+ bluez_manager_resync_devices (self);
+ }
}
typedef struct GetSettingsInfo {
@@ -926,49 +1179,171 @@ out:
}
static void
-user_new_connection_cb (DBusGProxy *proxy, const char *path, gpointer user_data)
+user_proxy_destroyed_cb (DBusGProxy *proxy, NMManager *self)
{
- user_internal_new_connection_cb (proxy, path, NM_MANAGER (user_data), NULL);
+ nm_log_dbg (LOGD_USER_SET, "Removing user connections...");
+
+ /* At this point the user proxy is already being disposed */
+ NM_MANAGER_GET_PRIVATE (self)->user_proxy = NULL;
+
+ /* User Settings service disappeared; throw away user connections */
+ user_proxy_cleanup (self, TRUE);
+}
+
+typedef struct {
+ DBusGProxy *proxy;
+ char *path;
+ NMManager *manager;
+} Foo;
+
+static gboolean
+blah (gpointer user_data)
+{
+ Foo *f = user_data;
+
+ user_internal_new_connection_cb (f->proxy, f->path, f->manager, NULL);
+ g_free (f->path);
+ g_free (f);
+ return FALSE;
}
static void
-user_query_connections (NMManager *manager)
+user_new_connection_cb (DBusGProxy *proxy, const char *path, gpointer user_data)
{
- NMManagerPrivate *priv;
- DBusGProxyCall *call;
- DBusGConnection *g_connection;
+ Foo *f = g_malloc0 (sizeof (Foo));
- g_return_if_fail (NM_IS_MANAGER (manager));
+ f->proxy = proxy;
+ f->path = g_strdup (path);
+ f->manager = NM_MANAGER (user_data);
- priv = NM_MANAGER_GET_PRIVATE (manager);
- if (!priv->user_proxy) {
- g_connection = nm_dbus_manager_get_connection (priv->dbus_mgr);
- priv->user_proxy = dbus_g_proxy_new_for_name (g_connection,
- NM_DBUS_SERVICE_USER_SETTINGS,
- NM_DBUS_PATH_SETTINGS,
- NM_DBUS_IFACE_SETTINGS);
- if (!priv->user_proxy) {
- nm_log_err (LOGD_USER_SET, "could not init user settings proxy");
- return;
- }
+ g_timeout_add_seconds (6, blah, f);
+}
+
+static gboolean
+user_settings_authorized (NMManager *self, NMAuthChain *chain)
+{
+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
+ NMAuthCallResult old_net_perm = priv->user_net_perm;
+ NMAuthCallResult old_con_perm = priv->user_con_perm;
+
+ /* If the user could potentially get authorization to use networking and/or
+ * to use user connections, the user settings service is authorized.
+ */
+ priv->user_net_perm = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL));
+ priv->user_con_perm = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS));
+
+ nm_log_dbg (LOGD_USER_SET, "User connections permissions: net %d, con %d",
+ priv->user_net_perm, priv->user_con_perm);
+
+ if (old_net_perm != priv->user_net_perm || old_con_perm != priv->user_con_perm)
+ g_signal_emit (self, signals[USER_PERMISSIONS_CHANGED], 0);
+
+ /* If the user can't control the network they certainly aren't allowed
+ * to provide user connections.
+ */
+ if ( priv->user_net_perm == NM_AUTH_CALL_RESULT_UNKNOWN
+ || priv->user_net_perm == NM_AUTH_CALL_RESULT_NO)
+ return FALSE;
+
+ /* And of course if they aren't allowed to use user connections, they can't
+ * provide them either.
+ */
+ if ( priv->user_con_perm == NM_AUTH_CALL_RESULT_UNKNOWN
+ || priv->user_con_perm == NM_AUTH_CALL_RESULT_NO)
+ return FALSE;
+
+ return TRUE;
+}
+
+static void
+user_proxy_auth_done (NMAuthChain *chain,
+ GError *error,
+ DBusGMethodInvocation *context,
+ gpointer user_data)
+{
+ NMManager *self = NM_MANAGER (user_data);
+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
+ gboolean authorized = FALSE;
+
+ priv->auth_chains = g_slist_remove (priv->auth_chains, chain);
+
+ if (error) {
+ nm_log_warn (LOGD_USER_SET, "User connections unavailable: (%d) %s",
+ error->code, error->message ? error->message : "(unknown)");
+ } else
+ authorized = user_settings_authorized (self, chain);
+
+ if (authorized) {
+ /* If authorized, finish setting up the user settings service proxy */
+ nm_log_dbg (LOGD_USER_SET, "Requesting user connections...");
+
+ authorized = TRUE;
dbus_g_proxy_add_signal (priv->user_proxy,
- "NewConnection",
- DBUS_TYPE_G_OBJECT_PATH,
- G_TYPE_INVALID);
-
+ "NewConnection",
+ DBUS_TYPE_G_OBJECT_PATH,
+ G_TYPE_INVALID);
dbus_g_proxy_connect_signal (priv->user_proxy, "NewConnection",
- G_CALLBACK (user_new_connection_cb),
- manager,
- NULL);
+ G_CALLBACK (user_new_connection_cb),
+ self,
+ NULL);
+
+ /* Clean up when the user settings proxy goes away */
+ g_signal_connect (priv->user_proxy, "destroy",
+ G_CALLBACK (user_proxy_destroyed_cb),
+ self);
+
+ /* Request user connections */
+ dbus_g_proxy_begin_call (priv->user_proxy, "ListConnections",
+ user_list_connections_cb,
+ self,
+ NULL,
+ G_TYPE_INVALID);
+ } else {
+ /* Otherwise, we ignore the user settings service completely */
+ user_proxy_cleanup (self, TRUE);
}
- /* grab connections */
- call = dbus_g_proxy_begin_call (priv->user_proxy, "ListConnections",
- user_list_connections_cb,
- manager,
- NULL,
- G_TYPE_INVALID);
+ nm_auth_chain_unref (chain);
+}
+
+static void
+user_proxy_init (NMManager *self)
+{
+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
+ DBusGConnection *bus;
+ NMAuthChain *chain;
+ GError *error = NULL;
+
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (priv->user_proxy == NULL);
+
+ bus = nm_dbus_manager_get_connection (priv->dbus_mgr);
+ priv->user_proxy = dbus_g_proxy_new_for_name_owner (bus,
+ NM_DBUS_SERVICE_USER_SETTINGS,
+ NM_DBUS_PATH_SETTINGS,
+ NM_DBUS_IFACE_SETTINGS,
+ &error);
+ if (!priv->user_proxy) {
+ nm_log_err (LOGD_USER_SET, "could not init user settings proxy: (%d) %s",
+ error ? error->code : -1,
+ error && error->message ? error->message : "(unknown)");
+ g_clear_error (&error);
+ return;
+ }
+
+ /* Kick off some PolicyKit authorization requests to figure out what
+ * permissions this user settings service has.
+ */
+ chain = nm_auth_chain_new (priv->authority,
+ NULL,
+ priv->user_proxy,
+ user_proxy_auth_done,
+ self);
+ priv->auth_chains = g_slist_prepend (priv->auth_chains, chain);
+
+ nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS, FALSE);
+ nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL, FALSE);
}
/*******************************************************************/
@@ -1150,14 +1525,10 @@ nm_manager_name_owner_changed (NMDBusManager *mgr,
gboolean new_owner_good = (new && (strlen (new) > 0));
if (strcmp (name, NM_DBUS_SERVICE_USER_SETTINGS) == 0) {
- if (!old_owner_good && new_owner_good) {
- /* User Settings service appeared, update stuff */
- user_query_connections (manager);
- } else {
- /* User Settings service disappeared, throw them away (?) */
- user_destroy_connections (manager);
- bluez_manager_resync_devices (manager);
- }
+ if (!old_owner_good && new_owner_good)
+ user_proxy_init (manager);
+ else
+ user_proxy_cleanup (manager, TRUE);
}
}
@@ -1464,6 +1835,172 @@ manager_modem_enabled_changed (NMModem *device, gpointer user_data)
nm_manager_rfkill_update (NM_MANAGER (user_data), RFKILL_TYPE_WWAN);
}
+static GError *
+deactivate_disconnect_check_error (GError *auth_error,
+ NMAuthCallResult result,
+ const char *detail)
+{
+ if (auth_error) {
+ nm_log_dbg (LOGD_CORE, "%s request failed: %s", detail, auth_error->message);
+ return g_error_new (NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_PERMISSION_DENIED,
+ "%s request failed: %s",
+ detail, auth_error->message);
+ } else if (result != NM_AUTH_CALL_RESULT_YES) {
+ return g_error_new (NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_PERMISSION_DENIED,
+ "Not authorized to %s user connections",
+ detail);
+ }
+ return NULL;
+}
+
+static void
+disconnect_user_auth_done_cb (NMAuthChain *chain,
+ GError *error,
+ DBusGMethodInvocation *context,
+ gpointer user_data)
+{
+ NMManager *self = NM_MANAGER (user_data);
+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
+ GError *ret_error = NULL;
+ NMAuthCallResult result;
+ NMDevice *device;
+
+ priv->auth_chains = g_slist_remove (priv->auth_chains, chain);
+
+ result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS));
+ ret_error = deactivate_disconnect_check_error (error, result, "Disconnect");
+ if (!ret_error) {
+ /* Everything authorized, deactivate the connection */
+ device = nm_auth_chain_get_data (chain, "device");
+ if (nm_device_interface_disconnect (NM_DEVICE_INTERFACE (device), &ret_error))
+ dbus_g_method_return (context);
+ }
+
+ if (ret_error)
+ dbus_g_method_return_error (context, ret_error);
+ g_clear_error (&ret_error);
+
+ nm_auth_chain_unref (chain);
+}
+
+static void
+disconnect_net_auth_done_cb (NMAuthChain *chain,
+ GError *error,
+ DBusGMethodInvocation *context,
+ gpointer user_data)
+{
+ NMManager *self = NM_MANAGER (user_data);
+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
+ GError *ret_error = NULL;
+ NMAuthCallResult result;
+ NMConnectionScope scope;
+ NMDevice *device;
+
+ priv->auth_chains = g_slist_remove (priv->auth_chains, chain);
+
+ result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL));
+ ret_error = deactivate_disconnect_check_error (error, result, "Disconnect");
+ if (ret_error) {
+ dbus_g_method_return_error (context, ret_error);
+ g_error_free (ret_error);
+ goto done;
+ }
+
+ /* If it's a system connection, we're done */
+ device = nm_auth_chain_get_data (chain, "device");
+ scope = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, "scope"));
+ if (scope == NM_CONNECTION_SCOPE_USER) {
+ NMAuthChain *user_chain;
+
+ /* It's a user connection, so we need to ensure the caller is
+ * authorized to manipulate user connections.
+ */
+ user_chain = nm_auth_chain_new (priv->authority, context, NULL, disconnect_user_auth_done_cb, self);
+ g_assert (user_chain);
+ priv->auth_chains = g_slist_append (priv->auth_chains, user_chain);
+
+ nm_auth_chain_set_data (user_chain, "device", g_object_ref (device), g_object_unref);
+ nm_auth_chain_set_data (user_chain, "scope", GUINT_TO_POINTER (scope), NULL);
+ nm_auth_chain_add_call (user_chain, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS, TRUE);
+ } else {
+ if (!nm_device_interface_disconnect (NM_DEVICE_INTERFACE (device), &ret_error)) {
+ dbus_g_method_return_error (context, ret_error);
+ g_clear_error (&ret_error);
+ } else
+ dbus_g_method_return (context);
+ }
+
+done:
+ nm_auth_chain_unref (chain);
+}
+
+static void
+manager_device_disconnect_request (NMDevice *device,
+ DBusGMethodInvocation *context,
+ NMManager *self)
+{
+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
+ NMActRequest *req;
+ NMConnection *connection;
+ GError *error = NULL;
+ NMConnectionScope scope;
+ gulong sender_uid = G_MAXULONG;
+ const char *error_desc = NULL;
+
+ req = nm_device_get_act_request (device);
+ if (!req) {
+ error = g_error_new_literal (NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_UNKNOWN_CONNECTION,
+ "This device is not active");
+ dbus_g_method_return_error (context, error);
+ g_error_free (error);
+ return;
+ }
+
+ connection = nm_act_request_get_connection (req);
+ g_assert (connection);
+
+ /* Need to check the caller's permissions and stuff before we can
+ * deactivate the connection.
+ */
+ scope = nm_connection_get_scope (connection);
+ if (!check_user_authorized (priv->dbus_mgr,
+ priv->user_proxy,
+ context,
+ scope,
+ &sender_uid,
+ &error_desc)) {
+ error = g_error_new_literal (NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_PERMISSION_DENIED,
+ error_desc);
+ dbus_g_method_return_error (context, error);
+ g_error_free (error);
+ return;
+ }
+
+ /* Yay for root */
+ if (0 == sender_uid) {
+ if (!nm_device_interface_disconnect (NM_DEVICE_INTERFACE (device), &error)) {
+ dbus_g_method_return_error (context, error);
+ g_clear_error (&error);
+ } else
+ dbus_g_method_return (context);
+ } else {
+ NMAuthChain *chain;
+
+ /* Otherwise validate the user request */
+ chain = nm_auth_chain_new (priv->authority, context, NULL, disconnect_net_auth_done_cb, self);
+ g_assert (chain);
+ priv->auth_chains = g_slist_append (priv->auth_chains, chain);
+
+ nm_auth_chain_set_data (chain, "device", g_object_ref (device), g_object_unref);
+ nm_auth_chain_set_data (chain, "scope", GUINT_TO_POINTER (scope), NULL);
+ nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL, TRUE);
+ }
+}
+
static void
add_device (NMManager *self, NMDevice *device)
{
@@ -1491,6 +2028,10 @@ add_device (NMManager *self, NMDevice *device)
G_CALLBACK (manager_device_state_changed),
self);
+ g_signal_connect (device, NM_DEVICE_INTERFACE_DISCONNECT_REQUEST,
+ G_CALLBACK (manager_device_disconnect_request),
+ self);
+
if (NM_IS_DEVICE_WIFI (device)) {
/* Attach to the access-point-added signal so that the manager can fill
* non-SSID-broadcasting APs with an SSID.
@@ -2240,25 +2781,21 @@ internal_activate_device (NMManager *manager,
static gboolean
wait_for_connection_expired (gpointer data)
{
- NMManager *manager = NM_MANAGER (data);
- NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager);
- PendingConnectionInfo *info = priv->pending_connection_info;
+ PendingActivation *pending = data;
GError *error = NULL;
- g_return_val_if_fail (info != NULL, FALSE);
+ g_return_val_if_fail (pending != NULL, FALSE);
- g_set_error (&error,
- NM_MANAGER_ERROR, NM_MANAGER_ERROR_UNKNOWN_CONNECTION,
- "%s", "Connection was not provided by any settings service");
- nm_log_warn (LOGD_CORE, "connection (%d) %s failed to activate (timeout): (%d) %s",
- info->scope, info->connection_path, error->code, error->message);
- dbus_g_method_return_error (info->context, error);
+ nm_log_warn (LOGD_CORE, "connection %s (scope %d) failed to activate (timeout)",
+ pending->connection_path, pending->scope);
+
+ nm_manager_pending_activation_remove (pending->manager, pending);
+
+ error = g_error_new_literal (NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_UNKNOWN_CONNECTION,
+ "Connection was not provided by any settings service");
+ pending_activation_destroy (pending, error, NULL);
g_error_free (error);
-
- info->timeout_id = 0;
- pending_connection_info_destroy (priv->pending_connection_info);
- priv->pending_connection_info = NULL;
-
return FALSE;
}
@@ -2369,229 +2906,145 @@ nm_manager_activate_connection (NMManager *manager,
return path;
}
-static void
-connection_added_default_handler (NMManager *manager,
- NMConnection *connection,
- NMConnectionScope scope)
+static PendingActivation *
+nm_manager_pending_activation_find (NMManager *self,
+ const char *path,
+ NMConnectionScope scope)
{
- NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager);
- PendingConnectionInfo *info = priv->pending_connection_info;
- const char *path;
+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
+ GSList *iter;
+
+ for (iter = priv->pending_activations; iter; iter = g_slist_next (iter)) {
+ PendingActivation *pending = iter->data;
+
+ if (!strcmp (pending->connection_path, path) && (pending->scope == scope))
+ return pending;
+ }
+ return NULL;
+}
+
+static void
+check_pending_ready (NMManager *self, PendingActivation *pending)
+{
+ NMConnection *connection;
+ const char *path = NULL;
GError *error = NULL;
- if (!info)
+ if (!pending->have_connection || !pending->authorized)
return;
- if (scope != info->scope)
- return;
+ /* Ok, we're authorized and the connection is available */
- if (strcmp (info->connection_path, nm_connection_get_path (connection)))
- return;
+ nm_manager_pending_activation_remove (self, pending);
- /* Will destroy below; can't be valid during the initial activation start */
- priv->pending_connection_info = NULL;
+ connection = nm_manager_get_connection_by_object_path (self,
+ pending->scope,
+ pending->connection_path);
+ if (!connection) {
+ error = g_error_new_literal (NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_UNKNOWN_CONNECTION,
+ "Connection could not be found.");
+ goto out;
+ }
- path = nm_manager_activate_connection (manager,
+ path = nm_manager_activate_connection (self,
connection,
- info->specific_object_path,
- info->device_path,
+ pending->specific_object_path,
+ pending->device_path,
TRUE,
&error);
- if (path) {
- dbus_g_method_return (info->context, path);
- g_object_notify (G_OBJECT (manager), NM_MANAGER_ACTIVE_CONNECTIONS);
- } else {
- dbus_g_method_return_error (info->context, error);
+ if (!path) {
nm_log_warn (LOGD_CORE, "connection (%d) %s failed to activate: (%d) %s",
- scope, info->connection_path, error->code, error->message);
- g_error_free (error);
- }
-
- pending_connection_info_destroy (info);
-}
-
-static gboolean
-is_user_request_authorized (NMManager *manager,
- DBusGMethodInvocation *context,
- GError **error)
-{
- NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager);
- DBusConnection *connection;
- char *sender = NULL;
- gulong sender_uid = G_MAXULONG;
- DBusError dbus_error;
- char *service_owner = NULL;
- const char *service_name;
- gulong service_uid = G_MAXULONG;
- gboolean success = FALSE;
-
- /* Ensure the request to activate the user connection came from the
- * same session as the user settings service. FIXME: use ConsoleKit
- * too.
- */
- if (!priv->user_proxy) {
- g_set_error (error, NM_MANAGER_ERROR,
- NM_MANAGER_ERROR_INVALID_SERVICE,
- "%s", "No user settings service available");
- goto out;
- }
-
- sender = dbus_g_method_get_sender (context);
- if (!sender) {
- g_set_error (error, NM_MANAGER_ERROR,
- NM_MANAGER_ERROR_PERMISSION_DENIED,
- "%s", "Could not determine D-Bus requestor");
- goto out;
- }
-
- connection = nm_dbus_manager_get_dbus_connection (priv->dbus_mgr);
- if (!connection) {
- g_set_error (error, NM_MANAGER_ERROR,
- NM_MANAGER_ERROR_PERMISSION_DENIED,
- "%s", "Could not get the D-Bus system bus");
- goto out;
- }
-
- dbus_error_init (&dbus_error);
- /* FIXME: do this async */
- sender_uid = dbus_bus_get_unix_user (connection, sender, &dbus_error);
- if (dbus_error_is_set (&dbus_error)) {
- dbus_error_free (&dbus_error);
- g_set_error (error, NM_MANAGER_ERROR,
- NM_MANAGER_ERROR_PERMISSION_DENIED,
- "%s", "Could not determine the Unix user ID of the requestor");
- goto out;
- }
-
- /* Let root activate anything.
- * FIXME: use a PolicyKit permission instead
- */
- if (0 == sender_uid) {
- success = TRUE;
- goto out;
- }
-
- service_name = dbus_g_proxy_get_bus_name (priv->user_proxy);
- if (!service_name) {
- g_set_error (error, NM_MANAGER_ERROR,
- NM_MANAGER_ERROR_PERMISSION_DENIED,
- "%s", "Could not determine user settings service name");
- goto out;
- }
-
- service_owner = nm_dbus_manager_get_name_owner (priv->dbus_mgr, service_name, NULL);
- if (!service_owner) {
- g_set_error (error, NM_MANAGER_ERROR,
- NM_MANAGER_ERROR_PERMISSION_DENIED,
- "%s", "Could not determine D-Bus owner of the user settings service");
- goto out;
- }
-
- dbus_error_init (&dbus_error);
- /* FIXME: do this async */
- service_uid = dbus_bus_get_unix_user (connection, service_owner, &dbus_error);
- if (dbus_error_is_set (&dbus_error)) {
- dbus_error_free (&dbus_error);
- g_set_error (error, NM_MANAGER_ERROR,
- NM_MANAGER_ERROR_PERMISSION_DENIED,
- "%s", "Could not determine the Unix UID of the sender of the request");
- goto out;
- }
-
- /* And finally, the actual UID check */
- if (sender_uid != service_uid) {
- g_set_error (error, NM_MANAGER_ERROR,
- NM_MANAGER_ERROR_PERMISSION_DENIED,
- "%s", "Requestor UID does not match the UID of the user settings service");
- goto out;
- }
-
- success = TRUE;
+ pending->scope, pending->connection_path, error->code, error->message);
+ } else
+ g_object_notify (G_OBJECT (pending->manager), NM_MANAGER_ACTIVE_CONNECTIONS);
out:
- g_free (sender);
- g_free (service_owner);
- return success;
+ pending_activation_destroy (pending, error, path);
+ g_clear_error (&error);
}
static void
-impl_manager_activate_connection (NMManager *manager,
+connection_added_default_handler (NMManager *self,
+ NMConnection *connection,
+ NMConnectionScope scope)
+{
+ PendingActivation *pending;
+
+ pending = nm_manager_pending_activation_find (self,
+ nm_connection_get_path (connection),
+ scope);
+ if (pending) {
+ pending->have_connection = TRUE;
+ check_pending_ready (self, pending);
+ }
+}
+
+static void
+activation_auth_done (PendingActivation *pending, GError *error)
+{
+ if (error) {
+ nm_manager_pending_activation_remove (pending->manager, pending);
+ pending_activation_destroy (pending, error, NULL);
+ return;
+ } else {
+ pending->authorized = TRUE;
+
+ /* Now that we're authorized, if the connection hasn't shown up yet,
+ * start a timer and wait for it.
+ */
+ if (!pending->have_connection && !pending->timeout_id)
+ pending->timeout_id = g_timeout_add_seconds (5, wait_for_connection_expired, pending);
+
+ check_pending_ready (pending->manager, pending);
+ }
+}
+
+static void
+impl_manager_activate_connection (NMManager *self,
const char *service_name,
const char *connection_path,
const char *device_path,
const char *specific_object_path,
DBusGMethodInvocation *context)
{
+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
NMConnectionScope scope = NM_CONNECTION_SCOPE_UNKNOWN;
- NMConnection *connection;
+ PendingActivation *pending;
GError *error = NULL;
- char *real_sop = NULL;
- char *path = NULL;
-
- if (!strcmp (service_name, NM_DBUS_SERVICE_USER_SETTINGS)) {
- if (!is_user_request_authorized (manager, context, &error))
- goto err;
+ if (!strcmp (service_name, NM_DBUS_SERVICE_USER_SETTINGS))
scope = NM_CONNECTION_SCOPE_USER;
- } else if (!strcmp (service_name, NM_DBUS_SERVICE_SYSTEM_SETTINGS))
+ else if (!strcmp (service_name, NM_DBUS_SERVICE_SYSTEM_SETTINGS))
scope = NM_CONNECTION_SCOPE_SYSTEM;
else {
- g_set_error (&error,
- NM_MANAGER_ERROR, NM_MANAGER_ERROR_INVALID_SERVICE,
- "%s", "Invalid settings service name");
- goto err;
- }
-
- /* "/" is special-cased to NULL to get through D-Bus */
- if (specific_object_path && strcmp (specific_object_path, "/"))
- real_sop = g_strdup (specific_object_path);
-
- connection = nm_manager_get_connection_by_object_path (manager, scope, connection_path);
- if (connection) {
- path = (char *) nm_manager_activate_connection (manager,
- connection,
- real_sop,
- device_path,
- TRUE,
- &error);
- if (path) {
- dbus_g_method_return (context, path);
- g_object_notify (G_OBJECT (manager), NM_MANAGER_ACTIVE_CONNECTIONS);
- }
- } else {
- PendingConnectionInfo *info;
- NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager);
-
- if (priv->pending_connection_info) {
- pending_connection_info_destroy (priv->pending_connection_info);
- priv->pending_connection_info = NULL;
- }
-
- /* Don't have the connection quite yet, probably created by
- * the client on-the-fly. Defer the activation until we have it
- */
-
- info = g_slice_new0 (PendingConnectionInfo);
- info->context = context;
- info->device_path = g_strdup (device_path);
- info->scope = scope;
- info->connection_path = g_strdup (connection_path);
- info->specific_object_path = g_strdup (real_sop);
- info->timeout_id = g_timeout_add_seconds (5, wait_for_connection_expired, manager);
-
- // FIXME: should probably be per-device, not global to the manager
- NM_MANAGER_GET_PRIVATE (manager)->pending_connection_info = info;
- }
-
- err:
- if (error) {
+ error = g_error_new_literal (NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_INVALID_SERVICE,
+ "Invalid settings service name");
dbus_g_method_return_error (context, error);
nm_log_warn (LOGD_CORE, "connection (%d) %s failed to activate: (%d) %s",
scope, connection_path, error->code, error->message);
g_error_free (error);
+ return;
}
- g_free (real_sop);
+ /* Need to check the caller's permissions and stuff before we can
+ * activate the connection.
+ */
+ pending = pending_activation_new (self,
+ priv->authority,
+ context,
+ device_path,
+ scope,
+ connection_path,
+ specific_object_path,
+ activation_auth_done);
+ priv->pending_activations = g_slist_prepend (priv->pending_activations, pending);
+
+ if (nm_manager_get_connection_by_object_path (self, scope, connection_path))
+ pending->have_connection = TRUE;
+
+ pending_activation_check_authorized (pending, priv->dbus_mgr, priv->user_proxy);
}
gboolean
@@ -2642,15 +3095,173 @@ done:
return success;
}
-static gboolean
-impl_manager_deactivate_connection (NMManager *manager,
- const char *connection_path,
- GError **error)
+static void
+deactivate_user_auth_done_cb (NMAuthChain *chain,
+ GError *error,
+ DBusGMethodInvocation *context,
+ gpointer user_data)
{
- return nm_manager_deactivate_connection (manager,
- connection_path,
- NM_DEVICE_STATE_REASON_USER_REQUESTED,
- error);
+ NMManager *self = NM_MANAGER (user_data);
+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
+ GError *ret_error = NULL;
+ NMAuthCallResult result;
+
+ priv->auth_chains = g_slist_remove (priv->auth_chains, chain);
+
+ result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS));
+ ret_error = deactivate_disconnect_check_error (error, result, "Deactivate");
+ if (!ret_error) {
+ /* Everything authorized, deactivate the connection */
+ if (nm_manager_deactivate_connection (self,
+ nm_auth_chain_get_data (chain, "path"),
+ NM_DEVICE_STATE_REASON_USER_REQUESTED,
+ &ret_error))
+ dbus_g_method_return (context);
+ }
+
+ if (ret_error)
+ dbus_g_method_return_error (context, ret_error);
+ g_clear_error (&ret_error);
+
+ nm_auth_chain_unref (chain);
+}
+
+static void
+deactivate_net_auth_done_cb (NMAuthChain *chain,
+ GError *error,
+ DBusGMethodInvocation *context,
+ gpointer user_data)
+{
+ NMManager *self = NM_MANAGER (user_data);
+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
+ GError *ret_error = NULL;
+ NMAuthCallResult result;
+ const char *active_path;
+ NMConnectionScope scope;
+
+ priv->auth_chains = g_slist_remove (priv->auth_chains, chain);
+
+ result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL));
+ ret_error = deactivate_disconnect_check_error (error, result, "Deactivate");
+ if (ret_error) {
+ dbus_g_method_return_error (context, ret_error);
+ g_error_free (ret_error);
+ goto done;
+ }
+
+ /* If it's a system connection, we're done */
+ active_path = nm_auth_chain_get_data (chain, "path");
+ scope = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, "scope"));
+ if (scope == NM_CONNECTION_SCOPE_USER) {
+ NMAuthChain *user_chain;
+
+ /* It's a user connection, so we need to ensure the caller is
+ * authorized to manipulate user connections.
+ */
+ user_chain = nm_auth_chain_new (priv->authority, context, NULL, deactivate_user_auth_done_cb, self);
+ g_assert (user_chain);
+ priv->auth_chains = g_slist_append (priv->auth_chains, user_chain);
+
+ nm_auth_chain_set_data (user_chain, "path", g_strdup (active_path), g_free);
+ nm_auth_chain_set_data (user_chain, "scope", GUINT_TO_POINTER (scope), NULL);
+ nm_auth_chain_add_call (user_chain, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS, TRUE);
+ } else {
+ if (!nm_manager_deactivate_connection (self,
+ active_path,
+ NM_DEVICE_STATE_REASON_USER_REQUESTED,
+ &ret_error)) {
+ dbus_g_method_return_error (context, ret_error);
+ g_clear_error (&ret_error);
+ } else
+ dbus_g_method_return (context);
+ }
+
+done:
+ nm_auth_chain_unref (chain);
+}
+
+static void
+impl_manager_deactivate_connection (NMManager *self,
+ const char *active_path,
+ DBusGMethodInvocation *context)
+{
+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
+ NMConnection *connection = NULL;
+ GError *error = NULL;
+ GSList *iter;
+ NMAuthChain *chain;
+ gulong sender_uid = G_MAXULONG;
+ NMConnectionScope scope;
+ const char *error_desc = NULL;
+
+ /* Check for device connections first */
+ for (iter = priv->devices; iter; iter = g_slist_next (iter)) {
+ NMActRequest *req;
+ const char *req_path = NULL;
+
+ req = nm_device_get_act_request (NM_DEVICE (iter->data));
+ if (req)
+ req_path = nm_act_request_get_active_connection_path (req);
+
+ if (req_path && !strcmp (active_path, req_path)) {
+ connection = nm_act_request_get_connection (req);
+ break;
+ }
+ }
+
+ /* Maybe it's a VPN */
+ if (!connection)
+ connection = nm_vpn_manager_get_connection_for_active (priv->vpn_manager, active_path);
+
+ if (!connection) {
+ error = g_error_new_literal (NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_CONNECTION_NOT_ACTIVE,
+ "The connection was not active.");
+ dbus_g_method_return_error (context, error);
+ g_error_free (error);
+ return;
+ }
+
+ /* Need to check the caller's permissions and stuff before we can
+ * deactivate the connection.
+ */
+ scope = nm_connection_get_scope (connection);
+ if (!check_user_authorized (priv->dbus_mgr,
+ priv->user_proxy,
+ context,
+ scope,
+ &sender_uid,
+ &error_desc)) {
+ error = g_error_new_literal (NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_PERMISSION_DENIED,
+ error_desc);
+ dbus_g_method_return_error (context, error);
+ g_error_free (error);
+ return;
+ }
+
+ /* Yay for root */
+ if (0 == sender_uid) {
+ if (!nm_manager_deactivate_connection (self,
+ active_path,
+ NM_DEVICE_STATE_REASON_USER_REQUESTED,
+ &error)) {
+ dbus_g_method_return_error (context, error);
+ g_clear_error (&error);
+ } else
+ dbus_g_method_return (context);
+
+ return;
+ }
+
+ /* Otherwise validate the user request */
+ chain = nm_auth_chain_new (priv->authority, context, NULL, deactivate_net_auth_done_cb, self);
+ g_assert (chain);
+ priv->auth_chains = g_slist_append (priv->auth_chains, chain);
+
+ nm_auth_chain_set_data (chain, "path", g_strdup (active_path), g_free);
+ nm_auth_chain_set_data (chain, "scope", GUINT_TO_POINTER (scope), NULL);
+ nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL, TRUE);
}
static void
@@ -2719,54 +3330,139 @@ do_sleep_wake (NMManager *self)
}
static gboolean
-impl_manager_sleep (NMManager *self, gboolean sleep, GError **error)
+return_no_pk_error (PolkitAuthority *authority,
+ const char *detail,
+ DBusGMethodInvocation *context)
{
- NMManagerPrivate *priv;
+ GError *error;
- g_return_val_if_fail (NM_IS_MANAGER (self), FALSE);
-
- priv = NM_MANAGER_GET_PRIVATE (self);
-
- if (priv->sleeping == sleep) {
- g_set_error (error,
- NM_MANAGER_ERROR, NM_MANAGER_ERROR_ALREADY_ASLEEP_OR_AWAKE,
- "Already %s", sleep ? "asleep" : "awake");
+ if (!authority) {
+ error = g_error_new (NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_PERMISSION_DENIED,
+ "%s request failed: PolicyKit not initialized",
+ detail);
+ dbus_g_method_return_error (context, error);
+ g_error_free (error);
return FALSE;
}
+ return TRUE;
+}
+
+static void
+_internal_sleep (NMManager *self, gboolean do_sleep)
+{
+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
nm_log_info (LOGD_SUSPEND, "%s requested (sleeping: %s enabled: %s)",
- sleep ? "sleep" : "wake",
+ do_sleep ? "sleep" : "wake",
priv->sleeping ? "yes" : "no",
priv->net_enabled ? "yes" : "no");
- priv->sleeping = sleep;
+ priv->sleeping = do_sleep;
do_sleep_wake (self);
g_object_notify (G_OBJECT (self), NM_MANAGER_SLEEPING);
- return TRUE;
}
-static gboolean
-impl_manager_enable (NMManager *self, gboolean enable, GError **error)
+static void
+sleep_auth_done_cb (NMAuthChain *chain,
+ GError *error,
+ DBusGMethodInvocation *context,
+ gpointer user_data)
+{
+ NMManager *self = NM_MANAGER (user_data);
+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
+ GError *ret_error;
+ NMAuthCallResult result;
+ gboolean do_sleep;
+
+ priv->auth_chains = g_slist_remove (priv->auth_chains, chain);
+
+ result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, NM_AUTH_PERMISSION_SLEEP_WAKE));
+ if (error) {
+ nm_log_dbg (LOGD_CORE, "Sleep/wake request failed: %s", error->message);
+ ret_error = g_error_new (NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_PERMISSION_DENIED,
+ "Sleep/wake request failed: %s",
+ error->message);
+ dbus_g_method_return_error (context, ret_error);
+ g_error_free (ret_error);
+ } else if (result != NM_AUTH_CALL_RESULT_YES) {
+ ret_error = g_error_new_literal (NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_PERMISSION_DENIED,
+ "Not authorized to sleep/wake");
+ dbus_g_method_return_error (context, ret_error);
+ g_error_free (ret_error);
+ } else {
+ /* Auth success */
+ do_sleep = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, "sleep"));
+ _internal_sleep (self, do_sleep);
+ dbus_g_method_return (context);
+ }
+
+ nm_auth_chain_unref (chain);
+}
+
+static void
+impl_manager_sleep (NMManager *self,
+ gboolean do_sleep,
+ DBusGMethodInvocation *context)
{
NMManagerPrivate *priv;
+ NMAuthChain *chain;
+ GError *error = NULL;
+ gulong sender_uid = G_MAXULONG;
+ const char *error_desc = NULL;
- g_return_val_if_fail (NM_IS_MANAGER (self), FALSE);
+ g_return_if_fail (NM_IS_MANAGER (self));
priv = NM_MANAGER_GET_PRIVATE (self);
- if (priv->net_enabled == enable) {
- g_set_error (error,
- NM_MANAGER_ERROR, NM_MANAGER_ERROR_ALREADY_ENABLED_OR_DISABLED,
- "Already %s", enable ? "enabled" : "disabled");
- return FALSE;
+ if (priv->sleeping == do_sleep) {
+ error = g_error_new (NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_ALREADY_ASLEEP_OR_AWAKE,
+ "Already %s", do_sleep ? "asleep" : "awake");
+ dbus_g_method_return_error (context, error);
+ g_error_free (error);
+ return;
}
+ if (!nm_auth_get_caller_uid (context, priv->dbus_mgr, &sender_uid, &error_desc)) {
+ error = g_error_new_literal (NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_PERMISSION_DENIED,
+ error_desc);
+ dbus_g_method_return_error (context, error);
+ g_error_free (error);
+ return;
+ }
+
+ /* Root doesn't need PK authentication */
+ if (0 == sender_uid) {
+ _internal_sleep (self, do_sleep);
+ dbus_g_method_return (context);
+ return;
+ }
+
+ if (!return_no_pk_error (priv->authority, "Sleep/wake", context))
+ return;
+
+ chain = nm_auth_chain_new (priv->authority, context, NULL, sleep_auth_done_cb, self);
+ g_assert (chain);
+ priv->auth_chains = g_slist_append (priv->auth_chains, chain);
+
+ nm_auth_chain_set_data (chain, "sleep", GUINT_TO_POINTER (do_sleep), NULL);
+ nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_SLEEP_WAKE, TRUE);
+}
+
+static void
+_internal_enable (NMManager *self, gboolean enable)
+{
+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
+ GError *err = NULL;
+
/* Update "NetworkingEnabled" key in state file */
if (priv->state_file) {
- GError *err = NULL;
-
if (!write_value_to_state_file (priv->state_file,
"main", "NetworkingEnabled",
G_TYPE_BOOLEAN, (gpointer) &enable,
@@ -2789,21 +3485,245 @@ impl_manager_enable (NMManager *self, gboolean enable, GError **error)
do_sleep_wake (self);
g_object_notify (G_OBJECT (self), NM_MANAGER_NETWORKING_ENABLED);
- return TRUE;
+}
+
+static void
+enable_net_done_cb (NMAuthChain *chain,
+ GError *error,
+ DBusGMethodInvocation *context,
+ gpointer user_data)
+{
+ NMManager *self = NM_MANAGER (user_data);
+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
+ GError *ret_error;
+ NMAuthCallResult result;
+ gboolean enable;
+
+ priv->auth_chains = g_slist_remove (priv->auth_chains, chain);
+
+ result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK));
+ if (error) {
+ nm_log_dbg (LOGD_CORE, "Enable request failed: %s", error->message);
+ ret_error = g_error_new (NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_PERMISSION_DENIED,
+ "Enable request failed: %s",
+ error->message);
+ dbus_g_method_return_error (context, ret_error);
+ g_error_free (ret_error);
+ } else if (result != NM_AUTH_CALL_RESULT_YES) {
+ ret_error = g_error_new_literal (NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_PERMISSION_DENIED,
+ "Not authorized to enable/disable networking");
+ dbus_g_method_return_error (context, ret_error);
+ g_error_free (ret_error);
+ } else {
+ /* Auth success */
+ enable = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, "enable"));
+ _internal_enable (self, enable);
+ dbus_g_method_return (context);
+ }
+
+ nm_auth_chain_unref (chain);
+}
+
+static void
+impl_manager_enable (NMManager *self,
+ gboolean enable,
+ DBusGMethodInvocation *context)
+{
+ NMManagerPrivate *priv;
+ NMAuthChain *chain;
+ GError *error = NULL;
+ gulong sender_uid = G_MAXULONG;
+ const char *error_desc = NULL;
+
+ g_return_if_fail (NM_IS_MANAGER (self));
+
+ priv = NM_MANAGER_GET_PRIVATE (self);
+
+ if (priv->net_enabled == enable) {
+ error = g_error_new (NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_ALREADY_ENABLED_OR_DISABLED,
+ "Already %s", enable ? "enabled" : "disabled");
+ dbus_g_method_return_error (context, error);
+ g_error_free (error);
+ return;
+ }
+
+ if (!nm_auth_get_caller_uid (context, priv->dbus_mgr, &sender_uid, &error_desc)) {
+ error = g_error_new_literal (NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_PERMISSION_DENIED,
+ error_desc);
+ dbus_g_method_return_error (context, error);
+ g_error_free (error);
+ return;
+ }
+
+ /* Root doesn't need PK authentication */
+ if (0 == sender_uid) {
+ _internal_enable (self, enable);
+ dbus_g_method_return (context);
+ return;
+ }
+
+ if (!return_no_pk_error (priv->authority, "Enable/disable", context))
+ return;
+
+ chain = nm_auth_chain_new (priv->authority, context, NULL, enable_net_done_cb, self);
+ g_assert (chain);
+ priv->auth_chains = g_slist_append (priv->auth_chains, chain);
+
+ nm_auth_chain_set_data (chain, "enable", GUINT_TO_POINTER (enable), NULL);
+ nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK, TRUE);
+}
+
+/* Permissions */
+
+static void
+user_proxy_permissions_changed_done (NMAuthChain *chain,
+ GError *error,
+ DBusGMethodInvocation *context,
+ gpointer user_data)
+{
+ NMManager *self = NM_MANAGER (user_data);
+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
+ gboolean authorized = FALSE;
+
+ priv->auth_chains = g_slist_remove (priv->auth_chains, chain);
+
+ if (error) {
+ nm_log_warn (LOGD_USER_SET, "User connections unavailable: (%d) %s",
+ error->code, error->message ? error->message : "(unknown)");
+ } else
+ authorized = user_settings_authorized (self, chain);
+
+ if (authorized) {
+ /* User connections are authorized */
+ if (!priv->user_proxy)
+ user_proxy_init (self);
+ } else
+ user_proxy_cleanup (self, TRUE);
+
+ nm_auth_chain_unref (chain);
+}
+
+static void
+pk_authority_changed_cb (GObject *object, gpointer user_data)
+{
+ NMManager *self = NM_MANAGER (user_data);
+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
+ NMAuthChain *chain;
+
+ /* If the user settings service wasn't previously authorized, we wouldn't
+ * care about it. But it might be authorized now, so lets check.
+ */
+ if (!priv->user_proxy)
+ user_proxy_init (self);
+ else {
+ /* Otherwise the user settings permissions could have changed so we
+ * need to recheck them.
+ */
+ chain = nm_auth_chain_new (priv->authority,
+ NULL,
+ priv->user_proxy,
+ user_proxy_permissions_changed_done,
+ self);
+ priv->auth_chains = g_slist_prepend (priv->auth_chains, chain);
+
+ nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS, FALSE);
+ nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL, FALSE);
+ }
+
+ /* Let clients know they should re-check their authorization */
+ g_signal_emit (NM_MANAGER (user_data), signals[CHECK_PERMISSIONS], 0);
+}
+
+static void
+get_perm_add_result (NMAuthChain *chain, GHashTable *results, const char *permission)
+{
+ NMAuthCallResult result;
+
+ result = GPOINTER_TO_UINT (nm_auth_chain_get_data (chain, permission));
+ if (result == NM_AUTH_CALL_RESULT_YES)
+ g_hash_table_insert (results, (char *) permission, "yes");
+ else if (result == NM_AUTH_CALL_RESULT_NO)
+ g_hash_table_insert (results, (char *) permission, "no");
+ else if (result == NM_AUTH_CALL_RESULT_AUTH)
+ g_hash_table_insert (results, (char *) permission, "auth");
+ else {
+ nm_log_dbg (LOGD_CORE, "unknown auth chain result %d", result);
+ }
+}
+
+static void
+get_permissions_done_cb (NMAuthChain *chain,
+ GError *error,
+ DBusGMethodInvocation *context,
+ gpointer user_data)
+{
+ NMManager *self = NM_MANAGER (user_data);
+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
+ GError *ret_error;
+ GHashTable *results;
+
+ priv->auth_chains = g_slist_remove (priv->auth_chains, chain);
+ if (error) {
+ nm_log_dbg (LOGD_CORE, "Permissions request failed: %s", error->message);
+ ret_error = g_error_new (NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_PERMISSION_DENIED,
+ "Permissions request failed: %s",
+ error->message);
+ dbus_g_method_return_error (context, ret_error);
+ g_error_free (ret_error);
+ } else {
+ results = g_hash_table_new (g_str_hash, g_str_equal);
+ get_perm_add_result (chain, results, NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK);
+ get_perm_add_result (chain, results, NM_AUTH_PERMISSION_SLEEP_WAKE);
+ get_perm_add_result (chain, results, NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI);
+ get_perm_add_result (chain, results, NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN);
+ get_perm_add_result (chain, results, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS);
+ get_perm_add_result (chain, results, NM_AUTH_PERMISSION_NETWORK_CONTROL);
+ dbus_g_method_return (context, results);
+ g_hash_table_destroy (results);
+ }
+
+ nm_auth_chain_unref (chain);
+}
+
+static void
+impl_manager_get_permissions (NMManager *self,
+ DBusGMethodInvocation *context)
+{
+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
+ NMAuthChain *chain;
+
+ if (!return_no_pk_error (priv->authority, "Permissions", context))
+ return;
+
+ chain = nm_auth_chain_new (priv->authority, context, NULL, get_permissions_done_cb, self);
+ g_assert (chain);
+ priv->auth_chains = g_slist_append (priv->auth_chains, chain);
+
+ nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK, FALSE);
+ nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_SLEEP_WAKE, FALSE);
+ nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI, FALSE);
+ nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN, FALSE);
+ nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_USE_USER_CONNECTIONS, FALSE);
+ nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL, FALSE);
}
/* Legacy 0.6 compatibility interface */
-static gboolean
-impl_manager_legacy_sleep (NMManager *manager, GError **error)
+static void
+impl_manager_legacy_sleep (NMManager *manager, DBusGMethodInvocation *context)
{
- return impl_manager_sleep (manager, TRUE, error);
+ return impl_manager_sleep (manager, TRUE, context);
}
-static gboolean
-impl_manager_legacy_wake (NMManager *manager, GError **error)
+static void
+impl_manager_legacy_wake (NMManager *manager, DBusGMethodInvocation *context)
{
- return impl_manager_sleep (manager, FALSE, error);
+ return impl_manager_sleep (manager, FALSE, context);
}
static gboolean
@@ -2836,6 +3756,15 @@ impl_manager_set_logging (NMManager *manager,
/* Connections */
+gboolean
+nm_manager_auto_user_connections_allowed (NMManager *self)
+{
+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
+
+ return priv->user_net_perm == NM_AUTH_CALL_RESULT_YES
+ && priv->user_con_perm == NM_AUTH_CALL_RESULT_YES;
+}
+
static int
connection_sort (gconstpointer pa, gconstpointer pb)
{
@@ -2972,7 +3901,7 @@ nm_manager_start (NMManager *self)
* bus in nm_manager_name_owner_changed().
*/
if (nm_dbus_manager_name_has_owner (priv->dbus_mgr, NM_DBUS_SERVICE_USER_SETTINGS))
- user_query_connections (self);
+ user_proxy_init (self);
nm_udev_manager_query_devices (priv->udev_mgr);
bluez_manager_resync_devices (self);
@@ -3068,6 +3997,7 @@ dispose (GObject *object)
{
NMManager *manager = NM_MANAGER (object);
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager);
+ GSList *iter;
if (priv->disposed) {
G_OBJECT_CLASS (nm_manager_parent_class)->dispose (object);
@@ -3075,8 +4005,14 @@ dispose (GObject *object)
}
priv->disposed = TRUE;
- pending_connection_info_destroy (priv->pending_connection_info);
- priv->pending_connection_info = NULL;
+ for (iter = priv->pending_activations; iter; iter = g_slist_next (iter))
+ pending_activation_destroy ((PendingActivation *) iter->data, NULL, NULL);
+ g_slist_free (priv->pending_activations);
+ priv->pending_activations = NULL;
+
+ g_slist_foreach (priv->auth_chains, (GFunc) nm_auth_chain_unref, NULL);
+ g_slist_free (priv->auth_chains);
+ g_object_unref (priv->authority);
while (g_slist_length (priv->secrets_calls))
free_get_secrets_info ((GetSecretsInfo *) priv->secrets_calls->data);
@@ -3089,7 +4025,7 @@ dispose (GObject *object)
FALSE);
}
- user_destroy_connections (manager);
+ user_proxy_cleanup (manager, FALSE);
g_hash_table_destroy (priv->user_connections);
priv->user_connections = NULL;
@@ -3286,6 +4222,15 @@ nm_manager_init (NMManager *manager)
NULL);
} else
nm_log_warn (LOGD_AUTOIP4, "could not initialize avahi-autoipd D-Bus proxy");
+
+ priv->authority = polkit_authority_get ();
+ if (priv->authority) {
+ priv->auth_changed_id = g_signal_connect (priv->authority,
+ "changed",
+ G_CALLBACK (pk_authority_changed_cb),
+ manager);
+ } else
+ nm_log_warn (LOGD_CORE, "failed to create PolicyKit authority.");
}
static void
@@ -3445,6 +4390,22 @@ nm_manager_class_init (NMManagerClass *manager_class)
_nm_marshal_VOID__OBJECT_UINT,
G_TYPE_NONE, 2, G_TYPE_OBJECT, G_TYPE_UINT);
+ signals[CHECK_PERMISSIONS] =
+ g_signal_new ("check-permissions",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST,
+ 0, NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ signals[USER_PERMISSIONS_CHANGED] =
+ g_signal_new ("user-permissions-changed",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST,
+ 0, NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
/* StateChange is DEPRECATED */
signals[STATE_CHANGE] =
g_signal_new ("state-change",
diff --git a/src/nm-manager.h b/src/nm-manager.h
index 0f4d72f2f..889938d97 100644
--- a/src/nm-manager.h
+++ b/src/nm-manager.h
@@ -111,6 +111,8 @@ NMState nm_manager_get_state (NMManager *manager);
GSList *nm_manager_get_connections (NMManager *manager, NMConnectionScope scope);
+gboolean nm_manager_auto_user_connections_allowed (NMManager *manager);
+
NMConnection * nm_manager_get_connection_by_object_path (NMManager *manager,
NMConnectionScope scope,
const char *path);
diff --git a/src/nm-policy-hostname.c b/src/nm-policy-hostname.c
index a273a9202..5fe8a1cee 100644
--- a/src/nm-policy-hostname.c
+++ b/src/nm-policy-hostname.c
@@ -24,6 +24,7 @@
#include
#include
#include
+#include
#include
@@ -40,7 +41,10 @@ struct HostnameThread {
gboolean dead;
int ret;
- guint32 ip4_addr;
+ struct sockaddr_in addr4;
+ struct sockaddr_in6 addr6;
+ struct sockaddr *addr;
+ size_t addr_size;
char hostname[NI_MAXHOST + 1];
HostnameThreadCallback callback;
@@ -53,9 +57,10 @@ hostname_thread_run_cb (gpointer user_data)
HostnameThread *ht = (HostnameThread *) user_data;
const char *hostname = NULL;
- if (strlen (ht->hostname))
+ if (strlen (ht->hostname) && strcmp (ht->hostname, "."))
hostname = ht->hostname;
+ nm_log_dbg (LOGD_DNS, "(%p) calling address reverse-lookup result handler", ht);
(*ht->callback) (ht, ht->ret, hostname, ht->user_data);
return FALSE;
}
@@ -64,9 +69,10 @@ static gpointer
hostname_thread_worker (gpointer data)
{
HostnameThread *ht = (HostnameThread *) data;
- struct sockaddr_in addr;
int i;
+ nm_log_dbg (LOGD_DNS, "(%p) starting address reverse-lookup", ht);
+
g_mutex_lock (ht->lock);
if (ht->dead) {
g_mutex_unlock (ht->lock);
@@ -74,21 +80,22 @@ hostname_thread_worker (gpointer data)
}
g_mutex_unlock (ht->lock);
- addr.sin_family = AF_INET;
- addr.sin_addr.s_addr = ht->ip4_addr;
-
- ht->ret = getnameinfo ((struct sockaddr *) &addr, sizeof (struct sockaddr_in),
- ht->hostname, NI_MAXHOST, NULL, 0,
- NI_NAMEREQD);
+ ht->ret = getnameinfo (ht->addr, ht->addr_size, ht->hostname, NI_MAXHOST, NULL, 0, NI_NAMEREQD);
if (ht->ret == 0) {
+ nm_log_dbg (LOGD_DNS, "(%p) address reverse-lookup returned hostname '%s'",
+ ht, ht->hostname);
for (i = 0; i < strlen (ht->hostname); i++)
ht->hostname[i] = tolower (ht->hostname[i]);
+ } else {
+ nm_log_dbg (LOGD_DNS, "(%p) address reverse-lookup failed: (%d) %s",
+ ht, ht->ret, gai_strerror (ht->ret));
}
/* Don't track the idle handler ID because by the time the g_idle_add()
* returns the ID, the handler may already have run and freed the
* HostnameThread.
*/
+ nm_log_dbg (LOGD_DNS, "(%p) scheduling address reverse-lookup result handler", ht);
g_idle_add (hostname_thread_run_cb, ht);
return (gpointer) TRUE;
}
@@ -98,15 +105,21 @@ hostname_thread_free (HostnameThread *ht)
{
g_return_if_fail (ht != NULL);
+ nm_log_dbg (LOGD_DNS, "(%p) freeing reverse-lookup thread", ht);
+
g_mutex_free (ht->lock);
memset (ht, 0, sizeof (HostnameThread));
g_free (ht);
}
HostnameThread *
-hostname_thread_new (guint32 ip4_addr, HostnameThreadCallback callback, gpointer user_data)
+hostname4_thread_new (guint32 ip4_addr,
+ HostnameThreadCallback callback,
+ gpointer user_data)
{
HostnameThread *ht;
+ struct sockaddr_in addr4;
+ char buf[INET_ADDRSTRLEN + 1];
ht = g_malloc0 (sizeof (HostnameThread));
g_assert (ht);
@@ -114,14 +127,59 @@ hostname_thread_new (guint32 ip4_addr, HostnameThreadCallback callback, gpointer
ht->lock = g_mutex_new ();
ht->callback = callback;
ht->user_data = user_data;
- ht->ip4_addr = ip4_addr;
+
+ ht->addr4.sin_family = AF_INET;
+ ht->addr4.sin_addr.s_addr = ip4_addr;
+ ht->addr = (struct sockaddr *) &ht->addr4;
+ ht->addr_size = sizeof (ht->addr4);
ht->thread = g_thread_create (hostname_thread_worker, ht, FALSE, NULL);
if (!ht->thread) {
hostname_thread_free (ht);
- ht = NULL;
+ return NULL;
}
+ if (!inet_ntop (AF_INET, &addr4.sin_addr, buf, sizeof (buf)))
+ strcpy (buf, "(unknown)");
+
+ nm_log_dbg (LOGD_DNS, "(%p) started IPv4 reverse-lookup thread for address '%s'",
+ ht, buf);
+
+ return ht;
+}
+
+HostnameThread *
+hostname6_thread_new (const struct in6_addr *ip6_addr,
+ HostnameThreadCallback callback,
+ gpointer user_data)
+{
+ HostnameThread *ht;
+ char buf[INET6_ADDRSTRLEN + 1];
+
+ ht = g_malloc0 (sizeof (HostnameThread));
+ g_assert (ht);
+
+ ht->lock = g_mutex_new ();
+ ht->callback = callback;
+ ht->user_data = user_data;
+
+ ht->addr6.sin6_family = AF_INET6;
+ ht->addr6.sin6_addr = *ip6_addr;
+ ht->addr = (struct sockaddr *) &ht->addr6;
+ ht->addr_size = sizeof (ht->addr6);
+
+ ht->thread = g_thread_create (hostname_thread_worker, ht, FALSE, NULL);
+ if (!ht->thread) {
+ hostname_thread_free (ht);
+ return NULL;
+ }
+
+ if (!inet_ntop (AF_INET, ip6_addr, buf, sizeof (buf)))
+ strcpy (buf, "(unknown)");
+
+ nm_log_dbg (LOGD_DNS, "(%p) started IPv6 reverse-lookup thread for address '%s'",
+ ht, buf);
+
return ht;
}
@@ -130,6 +188,8 @@ hostname_thread_kill (HostnameThread *ht)
{
g_return_if_fail (ht != NULL);
+ nm_log_dbg (LOGD_DNS, "(%p) stopping reverse-lookup thread", ht);
+
g_mutex_lock (ht->lock);
ht->dead = TRUE;
g_mutex_unlock (ht->lock);
diff --git a/src/nm-policy-hostname.h b/src/nm-policy-hostname.h
index c59ca4107..e76713f16 100644
--- a/src/nm-policy-hostname.h
+++ b/src/nm-policy-hostname.h
@@ -34,9 +34,13 @@ typedef void (*HostnameThreadCallback) (HostnameThread *ht,
const char *hostname,
gpointer user_data);
-HostnameThread * hostname_thread_new (guint32 ip4_addr,
- HostnameThreadCallback callback,
- gpointer user_data);
+HostnameThread * hostname4_thread_new (guint32 ip4_addr,
+ HostnameThreadCallback callback,
+ gpointer user_data);
+
+HostnameThread * hostname6_thread_new (const struct in6_addr *ip6_addr,
+ HostnameThreadCallback callback,
+ gpointer user_data);
void hostname_thread_free (HostnameThread *ht);
diff --git a/src/nm-policy.c b/src/nm-policy.c
index 455545b65..1fb9848b7 100644
--- a/src/nm-policy.c
+++ b/src/nm-policy.c
@@ -255,13 +255,12 @@ lookup_callback (HostnameThread *thread,
}
static void
-update_system_hostname (NMPolicy *policy, NMDevice *best)
+update_system_hostname (NMPolicy *policy, NMDevice *best4, NMDevice *best6)
{
char *configured_hostname = NULL;
- NMActRequest *best_req = NULL;
- NMDHCP4Config *dhcp4_config;
- NMIP4Config *ip4_config;
- NMIP4Address *addr;
+ NMActRequest *best_req4 = NULL;
+ NMActRequest *best_req6 = NULL;
+ const char *dhcp_hostname, *p;
g_return_if_fail (policy != NULL);
@@ -288,10 +287,12 @@ update_system_hostname (NMPolicy *policy, NMDevice *best)
}
/* Try automatically determined hostname from the best device's IP config */
- if (!best)
- best = get_best_ip4_device (policy->manager, &best_req);
+ if (!best4)
+ best4 = get_best_ip4_device (policy->manager, &best_req4);
+ if (!best6)
+ best6 = get_best_ip6_device (policy->manager, &best_req6);
- if (!best) {
+ if (!best4 && !best6) {
/* No best device; fall back to original hostname or if there wasn't
* one, 'localhost.localdomain'
*/
@@ -299,22 +300,43 @@ update_system_hostname (NMPolicy *policy, NMDevice *best)
return;
}
- /* Grab a hostname out of the device's DHCP4 config */
- dhcp4_config = nm_device_get_dhcp4_config (best);
- if (dhcp4_config) {
- const char *dhcp4_hostname, *p;
+ if (best4) {
+ NMDHCP4Config *dhcp4_config;
- p = dhcp4_hostname = nm_dhcp4_config_get_option (dhcp4_config, "host_name");
- if (dhcp4_hostname && strlen (dhcp4_hostname)) {
- /* Sanity check */
- while (*p) {
- if (!isblank (*p++)) {
- _set_hostname (dhcp4_hostname, "from DHCP");
- return;
+ /* Grab a hostname out of the device's DHCP4 config */
+ dhcp4_config = nm_device_get_dhcp4_config (best4);
+ if (dhcp4_config) {
+ p = dhcp_hostname = nm_dhcp4_config_get_option (dhcp4_config, "host_name");
+ if (dhcp_hostname && strlen (dhcp_hostname)) {
+ /* Sanity check; strip leading spaces */
+ while (*p) {
+ if (!isblank (*p++)) {
+ _set_hostname (dhcp_hostname, "from DHCPv4");
+ return;
+ }
}
+ nm_log_warn (LOGD_DNS, "DHCPv4-provided hostname '%s' looks invalid; ignoring it",
+ dhcp_hostname);
+ }
+ }
+ } else if (best6) {
+ NMDHCP6Config *dhcp6_config;
+
+ /* Grab a hostname out of the device's DHCP4 config */
+ dhcp6_config = nm_device_get_dhcp6_config (best6);
+ if (dhcp6_config) {
+ p = dhcp_hostname = nm_dhcp6_config_get_option (dhcp6_config, "host_name");
+ if (dhcp_hostname && strlen (dhcp_hostname)) {
+ /* Sanity check; strip leading spaces */
+ while (*p) {
+ if (!isblank (*p++)) {
+ _set_hostname (dhcp_hostname, "from DHCPv6");
+ return;
+ }
+ }
+ nm_log_warn (LOGD_DNS, "DHCPv6-provided hostname '%s' looks invalid; ignoring it",
+ dhcp_hostname);
}
- nm_log_warn (LOGD_DNS, "DHCP-provided hostname '%s' looks invalid; ignoring it",
- dhcp4_hostname);
}
}
@@ -326,23 +348,47 @@ update_system_hostname (NMPolicy *policy, NMDevice *best)
return;
}
- /* No configured hostname, no automatically determined hostname, and
- * no bootup hostname. Start reverse DNS of the current IP address.
+ /* No configured hostname, no automatically determined hostname, and no
+ * bootup hostname. Start reverse DNS of the current IPv4 or IPv6 address.
*/
- ip4_config = nm_device_get_ip4_config (best);
- if ( !ip4_config
- || (nm_ip4_config_get_num_nameservers (ip4_config) == 0)
- || (nm_ip4_config_get_num_addresses (ip4_config) == 0)) {
- /* No valid IP4 config (!!); fall back to localhost.localdomain */
- _set_hostname (NULL, "no IPv4 config");
- return;
+ if (best4) {
+ NMIP4Config *ip4_config;
+ NMIP4Address *addr4;
+
+ ip4_config = nm_device_get_ip4_config (best4);
+ if ( !ip4_config
+ || (nm_ip4_config_get_num_nameservers (ip4_config) == 0)
+ || (nm_ip4_config_get_num_addresses (ip4_config) == 0)) {
+ /* No valid IP4 config (!!); fall back to localhost.localdomain */
+ _set_hostname (NULL, "no IPv4 config");
+ return;
+ }
+
+ addr4 = nm_ip4_config_get_address (ip4_config, 0);
+ g_assert (addr4); /* checked for > 1 address above */
+
+ /* Start the hostname lookup thread */
+ policy->lookup = hostname4_thread_new (nm_ip4_address_get_address (addr4), lookup_callback, policy);
+ } else if (best6) {
+ NMIP6Config *ip6_config;
+ NMIP6Address *addr6;
+
+ ip6_config = nm_device_get_ip6_config (best6);
+ if ( !ip6_config
+ || (nm_ip6_config_get_num_nameservers (ip6_config) == 0)
+ || (nm_ip6_config_get_num_addresses (ip6_config) == 0)) {
+ /* No valid IP6 config (!!); fall back to localhost.localdomain */
+ _set_hostname (NULL, "no IPv6 config");
+ return;
+ }
+
+ addr6 = nm_ip6_config_get_address (ip6_config, 0);
+ g_assert (addr6); /* checked for > 1 address above */
+
+ /* Start the hostname lookup thread */
+ policy->lookup = hostname6_thread_new (nm_ip6_address_get_address (addr6), lookup_callback, policy);
}
- addr = nm_ip4_config_get_address (ip4_config, 0);
- g_assert (addr); /* checked for > 1 address above */
-
- /* Start the hostname lookup thread */
- policy->lookup = hostname_thread_new (nm_ip4_address_get_address (addr), lookup_callback, policy);
if (!policy->lookup) {
/* Fall back to 'localhost.localdomain' */
_set_hostname (NULL, "error starting hostname thread");
@@ -603,7 +649,7 @@ update_routing_and_dns (NMPolicy *policy, gboolean force_update)
update_ip6_routing_and_dns (policy, force_update);
/* Update the system hostname */
- update_system_hostname (policy, policy->default_device4);
+ update_system_hostname (policy, policy->default_device4, policy->default_device6);
}
typedef struct {
@@ -633,7 +679,8 @@ auto_activate_device (gpointer user_data)
/* System connections first, then user connections */
connections = nm_manager_get_connections (policy->manager, NM_CONNECTION_SCOPE_SYSTEM);
- connections = g_slist_concat (connections, nm_manager_get_connections (policy->manager, NM_CONNECTION_SCOPE_USER));
+ if (nm_manager_auto_user_connections_allowed (policy->manager))
+ connections = g_slist_concat (connections, nm_manager_get_connections (policy->manager, NM_CONNECTION_SCOPE_USER));
/* Remove connections that are in the invalid list. */
iter = connections;
@@ -652,13 +699,11 @@ auto_activate_device (gpointer user_data)
best_connection = nm_device_get_best_auto_connection (data->device, connections, &specific_object);
if (best_connection) {
GError *error = NULL;
- const char *device_path;
- device_path = nm_device_get_path (data->device);
if (!nm_manager_activate_connection (policy->manager,
best_connection,
specific_object,
- device_path,
+ nm_device_get_path (data->device),
FALSE,
&error)) {
NMSettingConnection *s_con;
@@ -712,7 +757,7 @@ global_state_changed (NMManager *manager, NMState state, gpointer user_data)
static void
hostname_changed (NMManager *manager, GParamSpec *pspec, gpointer user_data)
{
- update_system_hostname ((NMPolicy *) user_data, NULL);
+ update_system_hostname ((NMPolicy *) user_data, NULL, NULL);
}
static void
@@ -1013,6 +1058,12 @@ connection_removed (NMManager *manager,
g_ptr_array_free (list, TRUE);
}
+static void
+manager_user_permissions_changed (NMManager *manager, NMPolicy *policy)
+{
+ schedule_activate_all (policy);
+}
+
NMPolicy *
nm_policy_new (NMManager *manager, NMVPNManager *vpn_manager)
{
@@ -1088,6 +1139,10 @@ nm_policy_new (NMManager *manager, NMVPNManager *vpn_manager)
G_CALLBACK (connection_removed), policy);
policy->signal_ids = g_slist_append (policy->signal_ids, (gpointer) id);
+ id = g_signal_connect (manager, "user-permissions-changed",
+ G_CALLBACK (manager_user_permissions_changed), policy);
+ policy->signal_ids = g_slist_append (policy->signal_ids, (gpointer) id);
+
return policy;
}
diff --git a/src/nm-wifi-ap.c b/src/nm-wifi-ap.c
index c7b5d8a51..8a7e4e84d 100644
--- a/src/nm-wifi-ap.c
+++ b/src/nm-wifi-ap.c
@@ -15,7 +15,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * Copyright (C) 2004 - 2008 Red Hat, Inc.
+ * Copyright (C) 2004 - 2010 Red Hat, Inc.
* Copyright (C) 2006 - 2008 Novell, Inc.
*/
@@ -604,7 +604,7 @@ nm_ap_new_fake_from_connection (NMConnection *connection)
channel = nm_setting_wireless_get_channel (s_wireless);
if (band && channel) {
- guint32 freq = channel_to_freq (channel, band);
+ guint32 freq = nm_utils_wifi_channel_to_freq (channel, band);
if (freq == 0)
goto error;
@@ -1256,21 +1256,21 @@ nm_ap_check_compatible (NMAccessPoint *self,
channel = nm_setting_wireless_get_channel (s_wireless);
if (channel) {
- guint32 ap_chan = freq_to_channel (priv->freq);
+ guint32 ap_chan = nm_utils_wifi_freq_to_channel (priv->freq);
if (channel != ap_chan)
return FALSE;
}
s_wireless_sec = (NMSettingWirelessSecurity *) nm_connection_get_setting (connection,
- NM_TYPE_SETTING_WIRELESS_SECURITY);
+ NM_TYPE_SETTING_WIRELESS_SECURITY);
return nm_setting_wireless_ap_security_compatible (s_wireless,
- s_wireless_sec,
- nm_ap_get_flags (self),
- nm_ap_get_wpa_flags (self),
- nm_ap_get_rsn_flags (self),
- nm_ap_get_mode (self));
+ s_wireless_sec,
+ nm_ap_get_flags (self),
+ nm_ap_get_wpa_flags (self),
+ nm_ap_get_rsn_flags (self),
+ nm_ap_get_mode (self));
}
static gboolean
@@ -1364,114 +1364,3 @@ nm_ap_match_in_list (NMAccessPoint *find_ap,
return NULL;
}
-
-struct cf_pair {
- guint32 chan;
- guint32 freq;
-};
-
-static struct cf_pair a_table[] = {
- /* A band */
- { 7, 5035 },
- { 8, 5040 },
- { 9, 5045 },
- { 11, 5055 },
- { 12, 5060 },
- { 16, 5080 },
- { 34, 5170 },
- { 36, 5180 },
- { 38, 5190 },
- { 40, 5200 },
- { 42, 5210 },
- { 44, 5220 },
- { 46, 5230 },
- { 48, 5240 },
- { 50, 5250 },
- { 52, 5260 },
- { 56, 5280 },
- { 58, 5290 },
- { 60, 5300 },
- { 64, 5320 },
- { 100, 5500 },
- { 104, 5520 },
- { 108, 5540 },
- { 112, 5560 },
- { 116, 5580 },
- { 120, 5600 },
- { 124, 5620 },
- { 128, 5640 },
- { 132, 5660 },
- { 136, 5680 },
- { 140, 5700 },
- { 149, 5745 },
- { 152, 5760 },
- { 153, 5765 },
- { 157, 5785 },
- { 160, 5800 },
- { 161, 5805 },
- { 165, 5825 },
- { 183, 4915 },
- { 184, 4920 },
- { 185, 4925 },
- { 187, 4935 },
- { 188, 4945 },
- { 192, 4960 },
- { 196, 4980 },
- { 0, -1 }
-};
-
-static struct cf_pair bg_table[] = {
- /* B/G band */
- { 1, 2412 },
- { 2, 2417 },
- { 3, 2422 },
- { 4, 2427 },
- { 5, 2432 },
- { 6, 2437 },
- { 7, 2442 },
- { 8, 2447 },
- { 9, 2452 },
- { 10, 2457 },
- { 11, 2462 },
- { 12, 2467 },
- { 13, 2472 },
- { 14, 2484 },
- { 0, -1 }
-};
-
-guint32
-freq_to_channel (guint32 freq)
-{
- int i = 0;
-
- if (freq > 4900) {
- while (a_table[i].chan && (a_table[i].freq != freq))
- i++;
- return a_table[i].chan;
- } else {
- while (bg_table[i].chan && (bg_table[i].freq != freq))
- i++;
- return bg_table[i].chan;
- }
-
- return 0;
-}
-
-guint32
-channel_to_freq (guint32 channel, const char *band)
-{
- int i = 0;
-
- if (!strcmp (band, "a")) {
- while (a_table[i].chan && (a_table[i].chan != channel))
- i++;
- return a_table[i].freq;
- } else if (!strcmp (band, "bg")) {
- while (bg_table[i].chan && (bg_table[i].chan != channel))
- i++;
- return bg_table[i].freq;
- }
-
- return 0;
-}
-
diff --git a/src/nm-wifi-ap.h b/src/nm-wifi-ap.h
index edc9e56bf..86b785a31 100644
--- a/src/nm-wifi-ap.h
+++ b/src/nm-wifi-ap.h
@@ -15,7 +15,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * Copyright (C) 2004 - 2008 Red Hat, Inc.
+ * Copyright (C) 2004 - 2010 Red Hat, Inc.
* Copyright (C) 2006 - 2008 Novell, Inc.
*/
@@ -123,7 +123,4 @@ NMAccessPoint * nm_ap_match_in_list (NMAccessPoint *find_ap,
void nm_ap_print_self (NMAccessPoint *ap, const char * prefix);
-guint32 freq_to_channel (guint32 freq);
-guint32 channel_to_freq (guint32 channel, const char *band);
-
#endif /* NM_ACCESS_POINT_H */
diff --git a/src/vpn-manager/nm-vpn-manager.c b/src/vpn-manager/nm-vpn-manager.c
index 221a8b548..309331aed 100644
--- a/src/vpn-manager/nm-vpn-manager.c
+++ b/src/vpn-manager/nm-vpn-manager.c
@@ -304,6 +304,33 @@ nm_vpn_manager_get_active_connections (NMVPNManager *manager)
return list;
}
+NMConnection *
+nm_vpn_manager_get_connection_for_active (NMVPNManager *manager,
+ const char *active_path)
+{
+ NMVPNManagerPrivate *priv;
+ GSList *iter;
+
+ g_return_val_if_fail (NM_IS_VPN_MANAGER (manager), NULL);
+
+ priv = NM_VPN_MANAGER_GET_PRIVATE (manager);
+ for (iter = priv->services; iter; iter = g_slist_next (iter)) {
+ GSList *active, *elt;
+
+ active = nm_vpn_service_get_active_connections (NM_VPN_SERVICE (iter->data));
+ for (elt = active; elt; elt = g_slist_next (elt)) {
+ NMVPNConnection *candidate = NM_VPN_CONNECTION (elt->data);
+ const char *ac_path;
+
+ ac_path = nm_vpn_connection_get_active_connection_path (candidate);
+ if (ac_path && !strcmp (ac_path, active_path))
+ return nm_vpn_connection_get_connection (candidate);
+ }
+ }
+
+ return NULL;
+}
+
NMVPNManager *
nm_vpn_manager_get (void)
{
diff --git a/src/vpn-manager/nm-vpn-manager.h b/src/vpn-manager/nm-vpn-manager.h
index d07aa2509..f14844a9d 100644
--- a/src/vpn-manager/nm-vpn-manager.h
+++ b/src/vpn-manager/nm-vpn-manager.h
@@ -83,4 +83,7 @@ void nm_vpn_manager_add_active_connections (NMVPNManager *manager,
GSList *nm_vpn_manager_get_active_connections (NMVPNManager *manager);
+NMConnection *nm_vpn_manager_get_connection_for_active (NMVPNManager *manager,
+ const char *active_path);
+
#endif /* NM_VPN_VPN_MANAGER_H */
diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c
index 5ff70c7c8..edccd1efb 100644
--- a/system-settings/plugins/ifcfg-rh/reader.c
+++ b/system-settings/plugins/ifcfg-rh/reader.c
@@ -1622,21 +1622,27 @@ add_one_wep_key (shvarFile *ifcfg,
p++;
}
key = g_strdup (value);
- } else if ( strncmp (value, "s:", 2)
+ } else if ( !strncmp (value, "s:", 2)
&& (strlen (value) == 7 || strlen (value) == 15)) {
- /* ASCII passphrase */
+ /* ASCII key */
char *p = value + 2;
while (*p) {
if (!isascii ((int) (*p))) {
g_set_error (error, ifcfg_plugin_error_quark (), 0,
- "Invalid ASCII WEP passphrase.");
+ "Invalid ASCII WEP key.");
goto out;
}
p++;
}
- key = utils_bin2hexstr (value, strlen (value), strlen (value) * 2);
+ /* Remove 's:' prefix.
+ * Don't convert to hex string. wpa_supplicant takes 'wep_key0' option over D-Bus as byte array
+ * and converts it to hex string itself. Even though we convert hex string keys into a bin string
+ * before passing to wpa_supplicant, this prevents two unnecessary conversions. And mainly,
+ * ASCII WEP key doesn't change to HEX WEP key in UI, which could confuse users.
+ */
+ key = g_strdup (value + 2);
}
}
diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c
index 04dac8ec4..a9caf90a1 100644
--- a/system-settings/plugins/ifcfg-rh/writer.c
+++ b/system-settings/plugins/ifcfg-rh/writer.c
@@ -605,6 +605,8 @@ write_wireless_security_setting (NMConnection *connection,
key = nm_setting_wireless_security_get_wep_key (s_wsec, i);
if (key) {
+ char *ascii_key = NULL;
+
/* Passphrase needs a different ifcfg key since with WEP, there
* are some passphrases that are indistinguishable from WEP hex
* keys.
@@ -612,11 +614,19 @@ write_wireless_security_setting (NMConnection *connection,
key_type = nm_setting_wireless_security_get_wep_key_type (s_wsec);
if (key_type == NM_WEP_KEY_TYPE_PASSPHRASE)
tmp = g_strdup_printf ("KEY_PASSPHRASE%d", i + 1);
- else
+ else {
tmp = g_strdup_printf ("KEY%d", i + 1);
+ /* Add 's:' prefix for ASCII keys */
+ if (strlen (key) == 5 || strlen (key) == 13) {
+ ascii_key = g_strdup_printf ("s:%s", key);
+ key = ascii_key;
+ }
+ }
+
set_secret (ifcfg, tmp, key, FALSE);
g_free (tmp);
+ g_free (ascii_key);
}
}
}