Merge pull request #328 from edk0/capability-put-ownerdata

capability: accept new ownerdata for existing caps
This commit is contained in:
Aaron Jones 2020-06-25 17:35:44 +00:00 committed by GitHub
commit 54a7996604
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -67,6 +67,11 @@ capability_put(struct CapabilityIndex *idx, const char *cap, void *ownerdata)
if ((entry = rb_dictionary_retrieve(idx->cap_dict, cap)) != NULL)
{
entry->flags &= ~CAP_ORPHANED;
if (ownerdata != NULL)
{
s_assert(entry->ownerdata == NULL);
entry->ownerdata = ownerdata;
}
return (1 << entry->value);
}