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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user