NetworkManager/src/libnm-core-intern
Thomas Haller 890df48d14
libnm: verify and normalize "connection.secondaries"
So far, we didn't verify the secondary connections at all.
But these really are supposed to be UUIDs.

As we now also normalize "connection.uuid" to be in a strict
format, the user might have profiles with non-normalized UUIDs.
In that case, the "connection.uuid" would be normalized, but
"connection.secondaries" no longer matches. We can fix that by
also normalizing "connection.secondaries". OK, this is not a very good
reason, because it's unlikely to affect any users in practice ('though
it's easy to reproduce).

A better reason is that the secondary setting really should be well
defined and verified. As we didn't do that so far, we cannot simply
outright reject invalid settings. What this patch does instead, is
silently changing the profile to only contain valid settings.
That has it's own problems, like that the user setting an invalid
value does not get an error nor the desired(?) outcome.
But of all the bad choices, normalizing seems the most sensible
one.

Note that in practice, most client applications don't rely on setting
arbitrary (invalid) "UUIDs". They simply expect to be able to set valid
UUIDs, which they still are. For example, nm-connection-editor presents
a drop down list of VPN profile, and nmcli also resolves connection IDs
to the UUID. That is, clients already have an intimate understanding of
this setting, and don't blindly set arbitrary values. Hence, this
normalization is unlikely to hit users in practice. But what it gives
is the guarantee that a verified connection only contains valid UUIDs.

Now all UUIDs will be normalized, invalid entries removed, and the list
made unique.
2021-06-04 09:29:25 +02:00
..
meson.build build/meson: remove unnecessary libnm_core_intern_dep 2021-02-28 10:42:05 +01:00
nm-core-internal.h libnm: verify and normalize "connection.secondaries" 2021-06-04 09:29:25 +02:00
nm-keyfile-internal.h libnm/trivial: rename _nm_keyfile_equals() to _nm_keyfile_equal() 2021-05-27 09:56:41 +02:00
nm-keyfile-utils.h build: move "shared/nm-{glib-aux,log-null,log-core}" to "src/libnm-{glib-aux,log-null,log-core}" 2021-02-24 12:48:20 +01:00
nm-meta-setting-base-impl.h build: move "libnm-core/" to "src/" and split it 2021-02-18 19:46:51 +01:00
nm-meta-setting-base.h build: move "libnm-core/" to "src/" and split it 2021-02-18 19:46:51 +01:00
README.md build: move "libnm-core/" to "src/" and split it 2021-02-18 19:46:51 +01:00

libnm-core-intern

This contains header files only, which are also part of the internal API of libnm-core-impl.

libnm-core-impl is a static library that (among others) implements libnm-core-public (which is a part of the public API of libnm). This library gets statically linked into libnm and NetworkManager. Hence, those components can also access internal (but not private) API of libnm-core-impl, and this API is in libnm-core-intern.

These headers can thus be included by anybody who statically links with libnm-core-impl (including libnm-core-impl itself).

The directory should not be added to the include search path, instead users should explicitly #include "libnm-core-intern/nm-core-internal.h")

There is no source code here and no static library to link against.