summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-02-23 15:55:28 +0100
committerThomas Haller <thaller@redhat.com>2015-03-12 18:12:25 +0100
commit1e4612e476c48a4620a347948b5c1bf698dc1f43 (patch)
treea3ad4d0b75b5c07354f301f9ecf0bf426fae05c0
parentcbfa00219e77a0cbe9afa7aae548905f188bf6cf (diff)
downloadNetworkManager-1e4612e476c48a4620a347948b5c1bf698dc1f43.tar.gz
keyfile: add code comment to cert_writer() and downgrade assertion to g_critical()
-rw-r--r--src/settings/plugins/keyfile/writer.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/settings/plugins/keyfile/writer.c b/src/settings/plugins/keyfile/writer.c
index 314ff11608..483835048a 100644
--- a/src/settings/plugins/keyfile/writer.c
+++ b/src/settings/plugins/keyfile/writer.c
@@ -569,8 +569,15 @@ cert_writer (GKeyFile *file,
g_error_free (error);
}
g_free (new_path);
- } else
- g_assert_not_reached ();
+ } else {
+ /* scheme_func() returns UNKNOWN in all other cases. The only valid case
+ * where a scheme is allowed to be UNKNOWN, is unsetting the value. In this
+ * case, we don't expect the writer to be called, because the default value
+ * will not be serialized.
+ * The only other reason for the scheme to be UNKNOWN is an invalid cert.
+ * But our connection verifies, so that cannot happen either. */
+ g_return_if_reached ();
+ }
}
typedef struct {