mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-04 18:00:18 +01:00
keyfile: fix comparison in nms_keyfile_nmmeta_read()
"uuid" is returned from nms_keyfile_nmmeta_check_filename(),
and contains "$UUID.nmmeta". We must compare only the first
"uuid_len" bytes.
Fixes: 064544cc07 ('settings: support storing "shadowed-storage" to .nmmeta files')
This commit is contained in:
parent
25f4d23e13
commit
7e8e6836e0
1 changed files with 5 additions and 1 deletions
|
|
@ -137,7 +137,11 @@ nms_keyfile_nmmeta_read(const char * dirname,
|
|||
NMMETA_KF_GROUP_NAME_NMMETA,
|
||||
NMMETA_KF_KEY_NAME_NMMETA_UUID,
|
||||
NULL);
|
||||
if (!nm_streq0(v_uuid, uuid))
|
||||
if (!v_uuid)
|
||||
return FALSE;
|
||||
if (strncmp(v_uuid, uuid, uuid_len) != 0)
|
||||
return FALSE;
|
||||
if (v_uuid[uuid_len] != '\0')
|
||||
return FALSE;
|
||||
|
||||
loaded_path = g_key_file_get_string(kf,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue