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.
Thank you for reporting the problem! Actually the metakeys should be completely read-only, see #3609
I updated the issue
Most helpful comment
I updated the issue