NetworkManager/src/core/settings
Jan Vaclav 19a8feaad6 agent: print error message character in hex form if it's unprintable
Currently, when the agent manager is sent a registration request
containing UTF-8 characters, it will form an invalid error message
using only one of the bytes from the UTF-8 sequence, which causes
an assertion in glib to fail, which replaces the returned error message
with "[Invalid UTF-8]". It will also print an assertion failure to the
console, or crash NetworkManager on non-release builds.

This commit makes it so that it instead prints out the character in
hexadecimal form if it isn't normally printable, so that it is once
again a valid UTF-8 string.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1965

Fixes: a30cf19858 ('agent: add agent manager and minimal agent class')
(cherry picked from commit c9327b2e8b)
(cherry picked from commit f6f466ccf8)
2024-12-23 13:45:54 +01:00
..
plugins code format: run code format script 2024-06-28 11:14:22 +00:00
nm-agent-manager.c agent: print error message character in hex form if it's unprintable 2024-12-23 13:45:54 +01:00
nm-agent-manager.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-secret-agent.c doc: replace all (allow-none) annotations by (optional) and/or (nullable) 2023-03-27 11:49:43 +02:00
nm-secret-agent.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-settings-connection.c settings: add nm_settings_connection_persist_mode_to_string() 2024-05-23 13:44:11 +02:00
nm-settings-connection.h settings: add nm_settings_connection_persist_mode_to_string() 2024-05-23 13:44:11 +02:00
nm-settings-plugin.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-settings-plugin.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-settings-storage.c all: use nm_uuid_is_normalized() for checking valid UUID for "connection.uuid" 2021-06-04 09:29:23 +02:00
nm-settings-storage.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-settings-utils.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-settings-utils.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-settings.c all: use nm_strv_contains() instead of nm_strv_find_first() for membership check 2023-10-23 10:09:07 +02:00
nm-settings.h core: expose accessors to NMManager in NMSettings, NMSettingsConnection, NMDevice 2023-02-22 22:38:03 +00:00