Libelektra: COW metadata / no metadata on metakeys

Created on 24 Dec 2020  路  2Comments  路  Source: ElektraInitiative/libelektra

Because metadata on meta keys is not allowed we can use Copy-On-Write semantics for metadata. Therefore all keys of the namespace KEY_NS_META should _automatically_ have the flags KEY_FLAG_RO_NAME, KEY_FLAG_RO_VALUE and KEY_FLAG_RO_META set _during keyVNew_.

This ensures that keySetMeta will fail. It also avoids any problems with ksDeepDup (#3609), since the need for deep-copies of metadata is removed. Therefore keyDup (#3606) can just create a shallow-copy of the metadata without any further implications.

Additionally, KEY_NS_META keys should at all times fulfill key->meta == NULL and keyMeta() should return NULL instead of allocating a new KeySet.

bug usability

Most helpful comment

I updated the issue

All 2 comments

Thank you for reporting the problem! Actually the metakeys should be completely read-only, see #3609

I updated the issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sanssecours picture sanssecours  路  3Comments

mpranj picture mpranj  路  3Comments

markus2330 picture markus2330  路  3Comments

markus2330 picture markus2330  路  4Comments

mpranj picture mpranj  路  3Comments