Re: [PATCH] Always set an error when nm_connection_verify fails
- From: Dan Williams <dcbw redhat com>
- To: Sjoerd Simons <sjoerd simons collabora co uk>
- Cc: networkmanager-list gnome org
- Subject: Re: [PATCH] Always set an error when nm_connection_verify fails
- Date: Mon, 04 Aug 2008 18:19:04 -0400
On Mon, 2008-08-04 at 12:28 +0100, Sjoerd Simons wrote:
> From: Sjoerd Simons <sjoerd luon net>
>
> Set the error if the settings don't contain a 'connection' substree. Prevents a
> crash in code assuming the error is set
Committed in somewhat modified form (svn3895); we want a new GError
class for this.
Thanks!
Dan
> Signed-off-by: Sjoerd Simons <sjoerd simons collabora co uk>
> ---
> libnm-util/nm-connection.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/libnm-util/nm-connection.c b/libnm-util/nm-connection.c
> index 870fea5..55ba46c 100644
> --- a/libnm-util/nm-connection.c
> +++ b/libnm-util/nm-connection.c
> @@ -443,6 +443,10 @@ nm_connection_verify (NMConnection *connection, GError **error)
> connection_setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION);
> if (!connection_setting) {
> g_warning ("'connection' setting not present.");
> + g_set_error (error,
> + NM_TYPE_SETTING_CONNECTION_ERROR,
> + NM_SETTING_CONNECTION_ERROR_MISSING_PROPERTY,
> + NM_SETTING_CONNECTION_SETTING_NAME);
> return FALSE;
> }
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]