summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-06-17 13:14:22 +0200
committerThomas Haller <thaller@redhat.com>2016-06-28 17:34:42 +0200
commit521133d4565f80f7241c061df2d9557703f4ac78 (patch)
tree8af8bc1d04283baf8f451a55bd4b7644667b093c
parent5a740d323e74c73f65eb16685416c62816b6f9f6 (diff)
downloadNetworkManager-521133d4565f80f7241c061df2d9557703f4ac78.tar.gz
core: revert asserts to NM_ASSERT_VALID_PATH_COMPONENT() and _get_property_path()
If ofono violates these asserts, then the bug must be fixed somewhere else, not by silently doing something wrong.
-rw-r--r--src/nm-core-utils.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/nm-core-utils.c b/src/nm-core-utils.c
index 5b3cc72a1f..b20653838d 100644
--- a/src/nm-core-utils.c
+++ b/src/nm-core-utils.c
@@ -2558,14 +2558,7 @@ _get_property_path (const char *ifname,
ipv6 ? IPV6_PROPERTY_DIR : IPV4_PROPERTY_DIR,
ifname,
property);
-
- /* Ubuntu: don't assert, but log about the inconsistent size. */
- if (len > sizeof (path) - 1) {
- nm_log_warn (LOGD_CORE,
- "IPv6 property path is too long: '"
- IPV6_PROPERTY_DIR "%s/%s'",
- ifname, property);
- }
+ g_assert (len < sizeof (path) - 1);
return path;
}
@@ -2629,15 +2622,9 @@ NM_ASSERT_VALID_PATH_COMPONENT (const char *name)
nm_log_err (LOGD_CORE, "Failed asserting path component: %s%s%s",
NM_PRINT_FMT_QUOTED (name, "\"", name, "\"", "(null)"));
-
- /* Ubuntu: Don't outright fail, just return the name again. It's
- * logged as being invalid, which is enough.
- * There is a use of slashes in paths for oFono modems, which are
- * actually valid paths to refer to an oFono modem, just don't map to
- * anything on the filesystem. The following calls to sysctl paths can
- * (and will) fail, but that's fine.
- */
- return name;
+ g_error ("FATAL: Failed asserting path component: %s%s%s",
+ NM_PRINT_FMT_QUOTED (name, "\"", name, "\"", "(null)"));
+ g_assert_not_reached ();
}
gboolean