Commit ef6a1447 authored by Christian Kellner's avatar Christian Kellner

store: return NULL for empty bootacl entries

When the domain is stored and the bootacl is NULL, it will result
in "bootacl=" in the key file. When this later read back, it will
result in a non-zero, but empty (i.e. 0 elements) bootacl property.
As a result the BoltDomain will report that bootacl support is
present, but many of the internal functions will fail, if bootacl
has no usable slots. Therefore when the bootacl is read back and
is empty, we set it to NULL.
parent 7eaa5416
......@@ -415,6 +415,9 @@ bolt_store_get_domain (BoltStore *store,
g_clear_error (&err);
if (bolt_strv_isempty (bootacl))
g_clear_pointer (&bootacl, g_strfreev);
domain = g_object_new (BOLT_TYPE_DOMAIN,
"store", store,
"uid", uid,
......@@ -629,7 +629,7 @@ test_store_domain (TestStore *tt, gconstpointer user_data)
g_assert_cmpstr (uid, ==, bolt_domain_get_uid (s1));
bootacl = bolt_domain_get_bootacl (s1);
g_assert_cmpuint (g_strv_length (bootacl), ==, 0);
g_assert_null (bootacl);
/* update the bootacl */
g_object_set (d1, "bootacl", acl, NULL);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment