diff options
author | Thomas Haller <thaller@redhat.com> | 2017-02-21 11:48:55 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-02-21 12:17:30 +0100 |
commit | d37c77234fe4e842ae7d7a513fc45daa50c70716 (patch) | |
tree | 10eaf84e024f2f97b641211eef490a9e43176641 | |
parent | 9b8e56180f21d7d877380021a40605b7e0717cb8 (diff) | |
download | NetworkManager-d37c77234fe4e842ae7d7a513fc45daa50c70716.tar.gz |
ifcfg: set error for failure reading unrecognized connection in connection_from_file_full()
-rw-r--r-- | src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c index 19a0552c4b..36287a6aa2 100644 --- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c +++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c @@ -5128,7 +5128,6 @@ connection_from_file_full (const char *filename, "File '%s' had neither TYPE nor DEVICE keys.", filename); return NULL; } - g_assert (device[0]); if (!strcmp (device, "lo")) { if (out_ignore_error) @@ -5232,8 +5231,11 @@ connection_from_file_full (const char *filename, connection = bridge_connection_from_ifcfg (filename, parsed, error); else { connection = create_unhandled_connection (filename, parsed, "unrecognized", out_unhandled); - if (!connection) + if (!connection) { PARSE_WARNING ("connection type was unrecognized but device was not uniquely identified; device may be managed"); + g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION, + "Failed to read unrecognized connection"); + } return g_steal_pointer (&connection); } |