2008-11-03 Dan Williams <dcbw@redhat.com>

* system-settings/src/main.c
		- (add_default_dhcp_connection): make the fallback connection read-only

	* libnm-glib/nm-settings.c
	  libnm-glib/nm-settings.h
		- Add detailed errors
		- (impl_exported_connection_update, impl_exported_connection_delete):
			return an error if the connection is read-only

	* system-settings/plugins/ifupdown/nm-ifupdown-connection.c
	  system-settings/plugins/keyfile/nm-keyfile-connection.c
	  system-settings/src/main.c
		- Use more detailed errors

	* system-settings/src/nm-system-config-error.c
	  system-settings/src/nm-system-config-error.h
	  system-settings/src/dbus-settings.c
		- Remove NM_SYSCONFIG_SETTINGS_ERROR_INVALID_CONNECTION, replaced by
			NM_SETTINGS_ERROR_INVALID_CONNECTION



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4254 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2008-11-03 22:32:49 +00:00
parent d576e409d4
commit 201fd4ed8e
9 changed files with 124 additions and 27 deletions

View File

@@ -28,6 +28,7 @@
#include <nm-setting-wireless-security.h>
#include <nm-system-config-interface.h>
#include <nm-system-config-error.h>
#include <nm-settings.h>
#include "nm-ifupdown-connection.h"
#include "parser.h"
@@ -217,8 +218,8 @@ service_get_secrets (NMExportedConnection *exported,
setting = nm_connection_get_setting_by_name (connection, setting_name);
if (!setting) {
g_set_error (&error, NM_SYSCONFIG_SETTINGS_ERROR,
NM_SYSCONFIG_SETTINGS_ERROR_INVALID_CONNECTION,
g_set_error (&error, NM_SETTINGS_ERROR,
NM_SETTINGS_ERROR_INVALID_CONNECTION,
"%s.%d - Connection didn't have requested setting '%s'.",
__FILE__, __LINE__, setting_name);
PLUGIN_PRINT ("SCPlugin-Ifupdown", "%s", error->message);
@@ -231,7 +232,7 @@ service_get_secrets (NMExportedConnection *exported,
g_free, (GDestroyNotify) g_hash_table_destroy);
if (!settings) {
g_set_error (&error, NM_SETTINGS_ERROR, 0,
g_set_error (&error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INTERNAL_ERROR,
"%s.%d - failed to hash setting (OOM?)",
__FILE__, __LINE__);
dbus_g_method_return_error (context, error);
@@ -245,7 +246,7 @@ service_get_secrets (NMExportedConnection *exported,
g_hash_table_insert(settings, g_strdup(setting_name), secrets);
dbus_g_method_return (context, settings);
} else {
g_set_error (&error, NM_SETTINGS_ERROR, 0,
g_set_error (&error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INTERNAL_ERROR,
"%s.%d - nm_setting_to_hash failed (OOM?)",
__FILE__, __LINE__);
dbus_g_method_return_error (context, error);

View File

@@ -22,6 +22,7 @@
#include <string.h>
#include <glib/gstdio.h>
#include <NetworkManager.h>
#include <nm-settings.h>
#include <nm-setting-connection.h>
#include <nm-utils.h>
@@ -131,7 +132,7 @@ extract_secrets (NMKeyfileConnection *exported,
tmp = connection_from_file (priv->filename, TRUE);
if (!tmp) {
g_set_error (error, NM_SETTINGS_ERROR, 1,
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_SECRETS_UNAVAILABLE,
"%s.%d - Could not read secrets from file %s.",
__FILE__, __LINE__, priv->filename);
return NULL;
@@ -140,7 +141,7 @@ extract_secrets (NMKeyfileConnection *exported,
setting = nm_connection_get_setting_by_name (tmp, setting_name);
if (!setting) {
g_object_unref (tmp);
g_set_error (error, NM_SETTINGS_ERROR, 1,
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_SECRETS_UNAVAILABLE,
"%s.%d - Could not read secrets from file %s.",
__FILE__, __LINE__, priv->filename);
return NULL;
@@ -171,7 +172,7 @@ service_get_secrets (NMExportedConnection *exported,
connection = nm_exported_connection_get_connection (exported);
setting = nm_connection_get_setting_by_name (connection, setting_name);
if (!setting) {
g_set_error (&error, NM_SETTINGS_ERROR, 1,
g_set_error (&error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
"%s.%d - Connection didn't have requested setting '%s'.",
__FILE__, __LINE__, setting_name);
goto error;